(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[502],{14107(Q$,Yb,la){/**
 * vis-data
 * http://visjs.org/
 *
 * Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
 *
 * @version 7.1.10
 * @date    2025-07-06T08:42:20.006Z
 *
 * @copyright (c) 2011-2017 Almende B.V, http://almende.com
 * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
 *
 * @license
 * vis.js is dual licensed under both
 *
 *   1. The Apache 2.0 License
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *   and
 *
 *   2. The MIT License
 *      http://opensource.org/licenses/MIT
 *
 * vis.js may be distributed under either license.
 */(function(nt,st){st(Yb)})(this,function(nt){function st(s,h){if(!(s instanceof h))throw new TypeError("Cannot call a class as a function")}var Tn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof la.g<"u"?la.g:typeof self<"u"?self:{};function A(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var In={exports:{}},we=function(s){return s&&s.Math===Math&&s},G=we(typeof globalThis=="object"&&globalThis)||we(typeof window=="object"&&window)||we(typeof self=="object"&&self)||we(typeof Tn=="object"&&Tn)||function(){return this}()||Tn||Function("return this")(),he=function(s){try{return!!s()}catch{return!0}},Xb=he,yo=!Xb(function(){var s=function(){}.bind();return typeof s!="function"||s.hasOwnProperty("prototype")}),hp=yo,fl=Function.prototype,$n=fl.apply,vl=fl.call,yr=typeof Reflect=="object"&&Reflect.apply||(hp?vl.bind($n):function(){return vl.apply($n,arguments)}),da=yo,lp=Function.prototype,de=lp.call,dp=da&&lp.bind.bind(de,de),_e=da?dp:function(s){return function(){return de.apply(s,arguments)}},cp=_e,yi=cp({}.toString),Qb=cp("".slice),zi=function(s){return Qb(yi(s),8,-1)},ca=zi,gl=_e,Cn=function(s){if(ca(s)==="Function")return gl(s)},ml=typeof document=="object"&&document.all,Qe=typeof ml>"u"&&ml!==void 0,bo={all:ml,IS_HTMLDDA:Qe},ze=bo,Jb=ze.all,Ee=ze.IS_HTMLDDA?function(s){return typeof s=="function"||s===Jb}:function(s){return typeof s=="function"},Je={},Pn=he,Ue=!Pn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),up=yo,ua=Function.prototype.call,Oe=up?ua.bind(ua):function(){return ua.apply(ua,arguments)},br={},wo={}.propertyIsEnumerable,pp=Object.getOwnPropertyDescriptor,Zb=pp&&!wo.call({1:2},1);br.f=Zb?function(h){var l=pp(this,h);return!!l&&l.enumerable}:wo;var bi=function(s,h){return{enumerable:!(s&1),configurable:!(s&2),writable:!(s&4),value:h}},e0=_e,pa=he,_o=zi,yl=Object,t0=e0("".split),Li=pa(function(){return!yl("z").propertyIsEnumerable(0)})?function(s){return _o(s)==="String"?t0(s,""):yl(s)}:yl,Eo=function(s){return s==null},i0=Eo,Yt=TypeError,fa=function(s){if(i0(s))throw new Yt("Can't call method on "+s);return s},r0=Li,at=fa,ne=function(s){return r0(at(s))},va=Ee,ga=bo,o0=ga.all,Ke=ga.IS_HTMLDDA?function(s){return typeof s=="object"?s!==null:va(s)||s===o0}:function(s){return typeof s=="object"?s!==null:va(s)},le={},Ie=le,wr=G,fp=Ee,ma=function(s){return fp(s)?s:void 0},ht=function(s,h){return arguments.length<2?ma(Ie[s])||ma(wr[s]):Ie[s]&&Ie[s][h]||wr[s]&&wr[s][h]},vp=_e,$e=vp({}.isPrototypeOf),wi=typeof navigator<"u"&&String(navigator.userAgent)||"",_r=G,ya=wi,gp=_r.process,mp=_r.Deno,Er=gp&&gp.versions||mp&&mp.version,bl=Er&&Er.v8,Xt,ba;bl&&(Xt=bl.split("."),ba=Xt[0]>0&&Xt[0]<4?1:+(Xt[0]+Xt[1])),!ba&&ya&&(Xt=ya.match(/Edge\/(\d+)/),(!Xt||Xt[1]>=74)&&(Xt=ya.match(/Chrome\/(\d+)/),Xt&&(ba=+Xt[1])));var Oo=ba,yp=Oo,kn=he,n0=G,Dn=n0.String,xo=!!Object.getOwnPropertySymbols&&!kn(function(){var s=Symbol("symbol detection");return!Dn(s)||!(Object(s)instanceof Symbol)||!Symbol.sham&&yp&&yp<41}),s0=xo,bp=s0&&!Symbol.sham&&typeof Symbol.iterator=="symbol",So=ht,a0=Ee,h0=$e,wl=bp,_l=Object,Or=wl?function(s){return typeof s=="symbol"}:function(s){var h=So("Symbol");return a0(h)&&h0(h.prototype,_l(s))},El=String,To=function(s){try{return El(s)}catch{return"Object"}},wp=Ee,_p=To,l0=TypeError,St=function(s){if(wp(s))return s;throw new l0(_p(s)+" is not a function")},Ep=St,Ol=Eo,wa=function(s,h){var l=s[h];return Ol(l)?void 0:Ep(l)},Hi=Oe,xl=Ee,Sl=Ke,Bt=TypeError,d0=function(s,h){var l,c;if(h==="string"&&xl(l=s.toString)&&!Sl(c=Hi(l,s))||xl(l=s.valueOf)&&!Sl(c=Hi(l,s))||h!=="string"&&xl(l=s.toString)&&!Sl(c=Hi(l,s)))return c;throw new Bt("Can't convert object to primitive value")},Op={exports:{}},Ze=!0,xp=G,c0=Object.defineProperty,u0=function(s,h){try{c0(xp,s,{value:h,configurable:!0,writable:!0})}catch{xp[s]=h}return h},p0=G,_a=u0,Sp="__core-js_shared__",Tp=p0[Sp]||_a(Sp,{}),Tl=Tp,Ip=Tl;(Op.exports=function(s,h){return Ip[s]||(Ip[s]=h!==void 0?h:{})})("versions",[]).push({version:"3.33.2",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE",source:"https://github.com/zloirock/core-js"});var Io=Op.exports,$o=fa,Il=Object,Tt=function(s){return Il($o(s))},Me=_e,f0=Tt,$p=Me({}.hasOwnProperty),Ae=Object.hasOwn||function(h,l){return $p(f0(h),l)},v0=_e,g0=0,m0=Math.random(),y0=v0(1 .toString),Ea=function(s){return"Symbol("+(s===void 0?"":s)+")_"+y0(++g0+m0,36)},b0=G,Oa=Io,$l=Ae,Cl=Ea,w0=xo,Cp=bp,Co=b0.Symbol,xa=Oa("wks"),_0=Cp?Co.for||Co:Co&&Co.withoutSetter||Cl,xe=function(s){return $l(xa,s)||(xa[s]=w0&&$l(Co,s)?Co[s]:_0("Symbol."+s)),xa[s]},E0=Oe,Pp=Ke,kp=Or,O0=wa,x0=d0,S0=xe,Dp=TypeError,T0=S0("toPrimitive"),I0=function(s,h){if(!Pp(s)||kp(s))return s;var l=O0(s,T0),c;if(l){if(h===void 0&&(h="default"),c=E0(l,s,h),!Pp(c)||kp(c))return c;throw new Dp("Can't convert object to primitive value")}return h===void 0&&(h="number"),x0(s,h)},$0=I0,Mn=Or,Sa=function(s){var h=$0(s,"string");return Mn(h)?h:h+""},C0=G,Mp=Ke,Pl=C0.document,P0=Mp(Pl)&&Mp(Pl.createElement),kl=function(s){return P0?Pl.createElement(s):{}},k0=Ue,D0=he,Ta=kl,It=!k0&&!D0(function(){return Object.defineProperty(Ta("div"),"a",{get:function(){return 7}}).a!==7}),Ap=Ue,M0=Oe,A0=br,N0=bi,_i=ne,R0=Sa,F0=Ae,B0=It,An=Object.getOwnPropertyDescriptor;Je.f=Ap?An:function(h,l){if(h=_i(h),l=R0(l),B0)try{return An(h,l)}catch{}if(F0(h,l))return N0(!M0(A0.f,h,l),h[l])};var Np=he,j0=Ee,Dl=/#|\.prototype\./,Nn=function(s,h){var l=Al[Ml(s)];return l===z0?!0:l===Nl?!1:j0(h)?Np(h):!!h},Ml=Nn.normalize=function(s){return String(s).replace(Dl,".").toLowerCase()},Al=Nn.data={},Nl=Nn.NATIVE="N",z0=Nn.POLYFILL="P",Rp=Nn,xr=Cn,Ia=St,L0=yo,H0=xr(xr.bind),Wi=function(s,h){return Ia(s),h===void 0?s:L0?H0(s,h):function(){return s.apply(h,arguments)}},$t={},W0=Ue,Po=he,Fp=W0&&Po(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),ko=Ke,Bp=String,U0=TypeError,V=function(s){if(ko(s))return s;throw new U0(Bp(s)+" is not an object")},V0=Ue,q0=It,G0=Fp,Sr=V,jp=Sa,K0=TypeError,Rl=Object.defineProperty,Rn=Object.getOwnPropertyDescriptor,Fl="enumerable",Bl="configurable",jl="writable";$t.f=V0?G0?function(h,l,c){if(Sr(h),l=jp(l),Sr(c),typeof h=="function"&&l==="prototype"&&"value"in c&&jl in c&&!c[jl]){var u=Rn(h,l);u&&u[jl]&&(h[l]=c.value,c={configurable:Bl in c?c[Bl]:u[Bl],enumerable:Fl in c?c[Fl]:u[Fl],writable:!1})}return Rl(h,l,c)}:Rl:function(h,l,c){if(Sr(h),l=jp(l),Sr(c),q0)try{return Rl(h,l,c)}catch{}if("get"in c||"set"in c)throw new K0("Accessors not supported");return"value"in c&&(h[l]=c.value),h};var hi=Ue,Y0=$t,X0=bi,Ei=hi?function(s,h,l){return Y0.f(s,h,X0(1,l))}:function(s,h,l){return s[h]=l,s},Fn=G,zl=yr,Bn=Cn,Ll=Ee,Q0=Je.f,J0=Rp,Do=le,zp=Wi,Tr=Ei,$a=Ae,Z0=function(s){var h=function(l,c,u){if(this instanceof h){switch(arguments.length){case 0:return new s;case 1:return new s(l);case 2:return new s(l,c)}return new s(l,c,u)}return zl(s,this,arguments)};return h.prototype=s.prototype,h},X=function(s,h){var l=s.target,c=s.global,u=s.stat,f=s.proto,m=c?Fn:u?Fn[l]:(Fn[l]||{}).prototype,b=c?Do:Do[l]||Tr(Do,l,{})[l],y=b.prototype,E,x,T,S,k,z,J,Z,te;for(S in h)E=J0(c?S:l+(u?".":"#")+S,s.forced),x=!E&&m&&$a(m,S),z=b[S],x&&(s.dontCallGetSet?(te=Q0(m,S),J=te&&te.value):J=m[S]),k=x&&J?J:h[S],!(x&&typeof z==typeof k)&&(s.bind&&x?Z=zp(k,Fn):s.wrap&&x?Z=Z0(k):f&&Ll(k)?Z=Bn(k):Z=k,(s.sham||k&&k.sham||z&&z.sham)&&Tr(Z,"sham",!0),Tr(b,S,Z),f&&(T=l+"Prototype",$a(Do,T)||Tr(Do,T,{}),Tr(Do[T],S,k),s.real&&y&&(E||!y[S])&&Tr(y,S,k)))},jn=X,zn=Ue,Hl=$t.f;jn({target:"Object",stat:!0,forced:Object.defineProperty!==Hl,sham:!zn},{defineProperty:Hl});var ew=le,Lp=ew.Object,tw=In.exports=function(h,l,c){return Lp.defineProperty(h,l,c)};Lp.defineProperty.sham&&(tw.sham=!0);var Wl=In.exports,iw=Wl,Hp=iw,rw=Hp,ow=rw,Mo=ow,Wp=Mo,Up=Wp,Ca=A(Up),Vp=zi,ge=Array.isArray||function(h){return Vp(h)==="Array"},Pa=Math.ceil,qp=Math.floor,nw=Math.trunc||function(h){var l=+h;return(l>0?qp:Pa)(l)},sw=nw,ka=function(s){var h=+s;return h!==h||h===0?0:sw(h)},Gp=ka,aw=Math.min,Kp=function(s){return s>0?aw(Gp(s),9007199254740991):0},hw=Kp,Mt=function(s){return hw(s.length)},Ul=TypeError,lw=9007199254740991,Ln=function(s){if(s>lw)throw Ul("Maximum allowed index exceeded");return s},dw=Sa,et=$t,cw=bi,Ao=function(s,h,l){var c=dw(h);c in s?et.f(s,c,cw(0,l)):s[c]=l},uw=xe,Vl=uw("toStringTag"),Yp={};Yp[Vl]="z";var N=String(Yp)==="[object z]",ql=N,Xp=Ee,No=zi,Qp=xe,Jp=Qp("toStringTag"),Zp=Object,ef=No(function(){return arguments}())==="Arguments",tf=function(s,h){try{return s[h]}catch{}},Oi=ql?No:function(s){var h,l,c;return s===void 0?"Undefined":s===null?"Null":typeof(l=tf(h=Zp(s),Jp))=="string"?l:ef?No(h):(c=No(h))==="Object"&&Xp(h.callee)?"Arguments":c},Ir=_e,pw=Ee,Da=Tl,fw=Ir(Function.toString);pw(Da.inspectSource)||(Da.inspectSource=function(s){return fw(s)});var rf=Da.inspectSource,vw=_e,Hn=he,Gl=Ee,Kl=Oi,gw=ht,mw=rf,Wn=function(){},yw=[],of=gw("Reflect","construct"),Yl=/^\s*(?:class|function)\b/,$r=vw(Yl.exec),bw=!Yl.test(Wn),Cr=function(h){if(!Gl(h))return!1;try{return of(Wn,yw,h),!0}catch{return!1}},nf=function(h){if(!Gl(h))return!1;switch(Kl(h)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return bw||!!$r(Yl,mw(h))}catch{return!0}};nf.sham=!0;var Ma=!of||Hn(function(){var s;return Cr(Cr.call)||!Cr(Object)||!Cr(function(){s=!0})||s})?nf:Cr,sf=ge,ww=Ma,af=Ke,_w=xe,Ew=_w("species"),Xl=Array,Ow=function(s){var h;return sf(s)&&(h=s.constructor,ww(h)&&(h===Xl||sf(h.prototype))?h=void 0:af(h)&&(h=h[Ew],h===null&&(h=void 0))),h===void 0?Xl:h},hf=Ow,Ro=function(s,h){return new(hf(s))(h===0?0:h)},xw=he,Sw=xe,Un=Oo,lf=Sw("species"),Fo=function(s){return Un>=51||!xw(function(){var h=[],l=h.constructor={};return l[lf]=function(){return{foo:1}},h[s](Boolean).foo!==1})},df=X,Tw=he,Iw=ge,$w=Ke,cf=Tt,Cw=Mt,Aa=Ln,uf=Ao,Pw=Ro,kw=Fo,Vn=xe,Dw=Oo,pf=Vn("isConcatSpreadable"),Mw=Dw>=51||!Tw(function(){var s=[];return s[pf]=!1,s.concat()[0]!==s}),Aw=function(s){if(!$w(s))return!1;var h=s[pf];return h!==void 0?!!h:Iw(s)},Nw=!Mw||!kw("concat");df({target:"Array",proto:!0,arity:1,forced:Nw},{concat:function(h){var l=cf(this),c=Pw(l,0),u=0,f,m,b,y,E;for(f=-1,b=arguments.length;f<b;f++)if(E=f===-1?l:arguments[f],Aw(E))for(y=Cw(E),Aa(u+y),m=0;m<y;m++,u++)m in E&&uf(c,u,E[m]);else Aa(u+1),uf(c,u++,E);return c.length=u,c}});var Rw=Oi,ff=String,Ui=function(s){if(Rw(s)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return ff(s)},Na={},Fw=ka,Bw=Math.max,vf=Math.min,Ra=function(s,h){var l=Fw(s);return l<0?Bw(l+h,0):vf(l,h)},jw=ne,zw=Ra,Lw=Mt,Qt=function(s){return function(h,l,c){var u=jw(h),f=Lw(u),m=zw(c,f),b;if(s&&l!==l){for(;f>m;)if(b=u[m++],b!==b)return!0}else for(;f>m;m++)if((s||m in u)&&u[m]===l)return s||m||0;return!s&&-1}},Fa={includes:Qt(!0),indexOf:Qt(!1)},qn={},Hw=_e,Ql=Ae,Ww=ne,Uw=Fa.indexOf,Vw=qn,Gn=Hw([].push),gf=function(s,h){var l=Ww(s),c=0,u=[],f;for(f in l)!Ql(Vw,f)&&Ql(l,f)&&Gn(u,f);for(;h.length>c;)Ql(l,f=h[c++])&&(~Uw(u,f)||Gn(u,f));return u},Jl=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],mf=gf,Ba=Jl,ja=Object.keys||function(h){return mf(h,Ba)},qw=Ue,yf=Fp,Gw=$t,Kw=V,Yw=ne,Zl=ja;Na.f=qw&&!yf?Object.defineProperties:function(h,l){Kw(h);for(var c=Yw(l),u=Zl(l),f=u.length,m=0,b;f>m;)Gw.f(h,b=u[m++],c[b]);return h};var ed=ht,td=ed("document","documentElement"),id=Io,bf=Ea,rd=id("keys"),Pr=function(s){return rd[s]||(rd[s]=bf(s))},Kn=V,Yn=Na,wf=Jl,Xw=qn,za=td,_f=kl,Qw=Pr,Ef=">",Of="<",od="prototype",La="script",xf=Qw("IE_PROTO"),nd=function(){},sd=function(s){return Of+La+Ef+s+Of+"/"+La+Ef},Sf=function(s){s.write(sd("")),s.close();var h=s.parentWindow.Object;return s=null,h},Tf=function(){var s=_f("iframe"),h="java"+La+":",l;return s.style.display="none",za.appendChild(s),s.src=String(h),l=s.contentWindow.document,l.open(),l.write(sd("document.F=Object")),l.close(),l.F},Ha,Vi=function(){try{Ha=new ActiveXObject("htmlfile")}catch{}Vi=typeof document<"u"?document.domain&&Ha?Sf(Ha):Tf():Sf(Ha);for(var s=wf.length;s--;)delete Vi[od][wf[s]];return Vi()};Xw[xf]=!0;var kr=Object.create||function(h,l){var c;return h!==null?(nd[od]=Kn(h),c=new nd,nd[od]=null,c[xf]=h):c=Vi(),l===void 0?c:Yn.f(c,l)},Dr={},Xn=gf,Jw=Jl,Wa=Jw.concat("length","prototype");Dr.f=Object.getOwnPropertyNames||function(h){return Xn(h,Wa)};var Mr={},Qn=Ra,If=Mt,Zw=Ao,e1=Array,t1=Math.max,Se=function(s,h,l){for(var c=If(s),u=Qn(h,c),f=Qn(l===void 0?c:l,c),m=e1(t1(f-u,0)),b=0;u<f;u++,b++)Zw(m,b,s[u]);return m.length=b,m},i1=zi,r1=ne,$f=Dr.f,o1=Se,ad=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],n1=function(s){try{return $f(s)}catch{return o1(ad)}};Mr.f=function(h){return ad&&i1(h)==="Window"?n1(h):$f(r1(h))};var Jn={};Jn.f=Object.getOwnPropertySymbols;var s1=Ei,Bo=function(s,h,l,c){return c&&c.enumerable?s[h]=l:s1(s,h,l),s},a1=$t,hd=function(s,h,l){return a1.f(s,h,l)},Zn={},Cf=xe;Zn.f=Cf;var Ar=le,h1=Ae,Pf=Zn,kf=$t.f,Ce=function(s){var h=Ar.Symbol||(Ar.Symbol={});h1(h,s)||kf(h,s,{value:Pf.f(s)})},Df=Oe,l1=ht,d1=xe,ld=Bo,Ua=function(){var s=l1("Symbol"),h=s&&s.prototype,l=h&&h.valueOf,c=d1("toPrimitive");h&&!h[c]&&ld(h,c,function(u){return Df(l,this)},{arity:1})},c1=N,u1=Oi,Mf=c1?{}.toString:function(){return"[object "+u1(this)+"]"},dd=N,p1=$t.f,li=Ei,jo=Ae,di=Mf,f1=xe,Af=f1("toStringTag"),Nr=function(s,h,l,c){if(s){var u=l?s:s.prototype;jo(u,Af)||p1(u,Af,{configurable:!0,value:h}),c&&!dd&&li(u,"toString",di)}},v1=G,g1=Ee,cd=v1.WeakMap,qi=g1(cd)&&/native code/.test(String(cd)),xi=qi,es=G,Va=Ke,ud=Ei,pd=Ae,Gi=Tl,zo=Pr,m1=qn,Ve="Object already initialized",fd=es.TypeError,vd=es.WeakMap,Rr,Fr,qa,gd=function(s){return qa(s)?Fr(s):Rr(s,{})},ts=function(s){return function(h){var l;if(!Va(h)||(l=Fr(h)).type!==s)throw new fd("Incompatible receiver, "+s+" required");return l}};if(xi||Gi.state){var Jt=Gi.state||(Gi.state=new vd);Jt.get=Jt.get,Jt.has=Jt.has,Jt.set=Jt.set,Rr=function(s,h){if(Jt.has(s))throw new fd(Ve);return h.facade=s,Jt.set(s,h),h},Fr=function(s){return Jt.get(s)||{}},qa=function(s){return Jt.has(s)}}else{var Lo=zo("state");m1[Lo]=!0,Rr=function(s,h){if(pd(s,Lo))throw new fd(Ve);return h.facade=s,ud(s,Lo,h),h},Fr=function(s){return pd(s,Lo)?s[Lo]:{}},qa=function(s){return pd(s,Lo)}}var Br={set:Rr,get:Fr,has:qa,enforce:gd,getterFor:ts},y1=Wi,Nf=_e,Rf=Li,b1=Tt,Ff=Mt,Bf=Ro,jf=Nf([].push),ci=function(s){var h=s===1,l=s===2,c=s===3,u=s===4,f=s===6,m=s===7,b=s===5||f;return function(y,E,x,T){for(var S=b1(y),k=Rf(S),z=y1(E,x),J=Ff(k),Z=0,te=T||Bf,oe=h?te(y,J):l||m?te(y,0):void 0,ot,Be;J>Z;Z++)if((b||Z in k)&&(ot=k[Z],Be=z(ot,Z,S),s))if(h)oe[Z]=Be;else if(Be)switch(s){case 3:return!0;case 5:return ot;case 6:return Z;case 2:jf(oe,ot)}else switch(s){case 4:return!1;case 7:jf(oe,ot)}return f?-1:c||u?u:oe}},jr={forEach:ci(0),map:ci(1),filter:ci(2),some:ci(3),every:ci(4),find:ci(5),findIndex:ci(6),filterReject:ci(7)},is=X,rs=G,md=Oe,w1=_e,Ho=Ue,Wo=xo,zf=he,Ne=Ae,Ct=$e,Uo=V,Ki=ne,yd=Sa,Lf=Ui,At=bi,Zt=kr,os=ja,_1=Dr,Hf=Mr,bd=Jn,wd=Je,Yi=$t,Wf=Na,Uf=br,_d=Bo,Si=hd,zr=Io,E1=Pr,Ga=qn,Ed=Ea,Od=xe,xd=Zn,Ka=Ce,Sd=Ua,Vf=Nr,Td=Br,ns=jr.forEach,pt=E1("hidden"),ss="Symbol",as="prototype",O1=Td.set,qf=Td.getterFor(ss),ei=Object[as],Xi=rs.Symbol,hs=Xi&&Xi[as],Id=rs.RangeError,x1=rs.TypeError,$d=rs.QObject,Gf=wd.f,Lr=Yi.f,Kf=Hf.f,S1=Uf.f,Cd=w1([].push),ui=zr("symbols"),ls=zr("op-symbols"),Yf=zr("wks"),Pd=!$d||!$d[as]||!$d[as].findChild,kd=function(s,h,l){var c=Gf(ei,h);c&&delete ei[h],Lr(s,h,l),c&&s!==ei&&Lr(ei,h,c)},Dd=Ho&&zf(function(){return Zt(Lr({},"a",{get:function(){return Lr(this,"a",{value:7}).a}})).a!==7})?kd:Lr,Ya=function(s,h){var l=ui[s]=Zt(hs);return O1(l,{type:ss,tag:s,description:h}),Ho||(l.description=h),l},ds=function(h,l,c){h===ei&&ds(ls,l,c),Uo(h);var u=yd(l);return Uo(c),Ne(ui,u)?(c.enumerable?(Ne(h,pt)&&h[pt][u]&&(h[pt][u]=!1),c=Zt(c,{enumerable:At(0,!1)})):(Ne(h,pt)||Lr(h,pt,At(1,{})),h[pt][u]=!0),Dd(h,u,c)):Lr(h,u,c)},Md=function(h,l){Uo(h);var c=Ki(l),u=os(c).concat(Fd(c));return ns(u,function(f){(!Ho||md(Ad,c,f))&&ds(h,f,c[f])}),h},cs=function(h,l){return l===void 0?Zt(h):Md(Zt(h),l)},Ad=function(h){var l=yd(h),c=md(S1,this,l);return this===ei&&Ne(ui,l)&&!Ne(ls,l)?!1:c||!Ne(this,l)||!Ne(ui,l)||Ne(this,pt)&&this[pt][l]?c:!0},Nd=function(h,l){var c=Ki(h),u=yd(l);if(!(c===ei&&Ne(ui,u)&&!Ne(ls,u))){var f=Gf(c,u);return f&&Ne(ui,u)&&!(Ne(c,pt)&&c[pt][u])&&(f.enumerable=!0),f}},Rd=function(h){var l=Kf(Ki(h)),c=[];return ns(l,function(u){!Ne(ui,u)&&!Ne(Ga,u)&&Cd(c,u)}),c},Fd=function(s){var h=s===ei,l=Kf(h?ls:Ki(s)),c=[];return ns(l,function(u){Ne(ui,u)&&(!h||Ne(ei,u))&&Cd(c,ui[u])}),c};Wo||(Xi=function(){if(Ct(hs,this))throw new x1("Symbol is not a constructor");var h=!arguments.length||arguments[0]===void 0?void 0:Lf(arguments[0]),l=Ed(h),c=function(u){var f=this===void 0?rs:this;f===ei&&md(c,ls,u),Ne(f,pt)&&Ne(f[pt],l)&&(f[pt][l]=!1);var m=At(1,u);try{Dd(f,l,m)}catch(b){if(!(b instanceof Id))throw b;kd(f,l,m)}};return Ho&&Pd&&Dd(ei,l,{configurable:!0,set:c}),Ya(l,h)},hs=Xi[as],_d(hs,"toString",function(){return qf(this).tag}),_d(Xi,"withoutSetter",function(s){return Ya(Ed(s),s)}),Uf.f=Ad,Yi.f=ds,Wf.f=Md,wd.f=Nd,_1.f=Hf.f=Rd,bd.f=Fd,xd.f=function(s){return Ya(Od(s),s)},Ho&&Si(hs,"description",{configurable:!0,get:function(){return qf(this).description}})),is({global:!0,constructor:!0,wrap:!0,forced:!Wo,sham:!Wo},{Symbol:Xi}),ns(os(Yf),function(s){Ka(s)}),is({target:ss,stat:!0,forced:!Wo},{useSetter:function(){Pd=!0},useSimple:function(){Pd=!1}}),is({target:"Object",stat:!0,forced:!Wo,sham:!Ho},{create:cs,defineProperty:ds,defineProperties:Md,getOwnPropertyDescriptor:Nd}),is({target:"Object",stat:!0,forced:!Wo},{getOwnPropertyNames:Rd}),Sd(),Vf(Xi,ss),Ga[pt]=!0;var T1=xo,Xf=T1&&!!Symbol.for&&!!Symbol.keyFor,I1=X,Qi=ht,Xa=Ae,Qf=Ui,Jf=Io,$1=Xf,Bd=Jf("string-to-symbol-registry"),C1=Jf("symbol-to-string-registry");I1({target:"Symbol",stat:!0,forced:!$1},{for:function(s){var h=Qf(s);if(Xa(Bd,h))return Bd[h];var l=Qi("Symbol")(h);return Bd[h]=l,C1[l]=h,l}});var Zf=X,ev=Ae,tv=Or,iv=To,P1=Io,k1=Xf,jd=P1("symbol-to-string-registry");Zf({target:"Symbol",stat:!0,forced:!k1},{keyFor:function(h){if(!tv(h))throw new TypeError(iv(h)+" is not a symbol");if(ev(jd,h))return jd[h]}});var D1=_e,us=D1([].slice),M1=_e,rv=ge,Hr=Ee,zd=zi,ov=Ui,nv=M1([].push),Vo=function(s){if(Hr(s))return s;if(rv(s)){for(var h=s.length,l=[],c=0;c<h;c++){var u=s[c];typeof u=="string"?nv(l,u):(typeof u=="number"||zd(u)==="Number"||zd(u)==="String")&&nv(l,ov(u))}var f=l.length,m=!0;return function(b,y){if(m)return m=!1,y;if(rv(this))return y;for(var E=0;E<f;E++)if(l[E]===b)return y}}},Ld=X,sv=ht,Hd=yr,A1=Oe,Wr=_e,av=he,Wd=Ee,hv=Or,lv=us,N1=Vo,R1=xo,dv=String,pi=sv("JSON","stringify"),Qa=Wr(/./.exec),ps=Wr("".charAt),F1=Wr("".charCodeAt),B1=Wr("".replace),j1=Wr(1 .toString),z1=/[\uD800-\uDFFF]/g,Ud=/^[\uD800-\uDBFF]$/,cv=/^[\uDC00-\uDFFF]$/,Ja=!R1||av(function(){var s=sv("Symbol")("stringify detection");return pi([s])!=="[null]"||pi({a:s})!=="{}"||pi(Object(s))!=="{}"}),Vd=av(function(){return pi("\uDF06\uD834")!=='"\\udf06\\ud834"'||pi("\uDEAD")!=='"\\udead"'}),L1=function(s,h){var l=lv(arguments),c=N1(h);if(!(!Wd(c)&&(s===void 0||hv(s))))return l[1]=function(u,f){if(Wd(c)&&(f=A1(c,this,dv(u),f)),!hv(f))return f},Hd(pi,null,l)},uv=function(s,h,l){var c=ps(l,h-1),u=ps(l,h+1);return Qa(Ud,s)&&!Qa(cv,u)||Qa(cv,s)&&!Qa(Ud,c)?"\\u"+j1(F1(s,0),16):s};pi&&Ld({target:"JSON",stat:!0,arity:3,forced:Ja||Vd},{stringify:function(h,l,c){var u=lv(arguments),f=Hd(Ja?L1:pi,null,u);return Vd&&typeof f=="string"?B1(f,z1,uv):f}});var H1=X,W1=xo,U1=he,pv=Jn,V1=Tt,q1=!W1||U1(function(){pv.f(1)});H1({target:"Object",stat:!0,forced:q1},{getOwnPropertySymbols:function(h){var l=pv.f;return l?l(V1(h)):[]}});var G1=Ce;G1("asyncIterator");var K1=Ce;K1("hasInstance");var Y1=Ce;Y1("isConcatSpreadable");var X1=Ce;X1("iterator");var Q1=Ce;Q1("match");var J1=Ce;J1("matchAll");var fv=Ce;fv("replace");var vv=Ce;vv("search");var Z1=Ce;Z1("species");var e_=Ce;e_("split");var Za=Ce,qd=Ua;Za("toPrimitive"),qd();var gv=ht,eh=Ce,mv=Nr;eh("toStringTag"),mv(gv("Symbol"),"Symbol");var t_=Ce;t_("unscopables");var Gd=G,Kd=Nr;Kd(Gd.JSON,"JSON",!0);var i_=le,yv=i_.Symbol,Ur={},Yd=Ue,th=Ae,Xd=Function.prototype,r_=Yd&&Object.getOwnPropertyDescriptor,Qd=th(Xd,"name"),o_=Qd&&function(){}.name==="something",n_=Qd&&(!Yd||Yd&&r_(Xd,"name").configurable),s_={EXISTS:Qd,PROPER:o_,CONFIGURABLE:n_},a_=he,Jd=!a_(function(){function s(){}return s.prototype.constructor=null,Object.getPrototypeOf(new s)!==s.prototype}),bv=Ae,Zd=Ee,wv=Tt,ec=Pr,_v=Jd,Ev=ec("IE_PROTO"),tc=Object,Ov=tc.prototype,ih=_v?tc.getPrototypeOf:function(s){var h=wv(s);if(bv(h,Ev))return h[Ev];var l=h.constructor;return Zd(l)&&h instanceof l?l.prototype:h instanceof tc?Ov:null},h_=he,xv=Ee,l_=Ke,d_=kr,Sv=ih,c_=Bo,u_=xe,ic=u_("iterator"),Tv=!1,ti,rc,oc;[].keys&&(oc=[].keys(),"next"in oc?(rc=Sv(Sv(oc)),rc!==Object.prototype&&(ti=rc)):Tv=!0);var p_=!l_(ti)||h_(function(){var s={};return ti[ic].call(s)!==s});p_?ti={}:ti=d_(ti),xv(ti[ic])||c_(ti,ic,function(){return this});var Iv={IteratorPrototype:ti,BUGGY_SAFARI_ITERATORS:Tv},nc=Iv.IteratorPrototype,f_=kr,fi=bi,v_=Nr,g_=Ur,m_=function(){return this},y_=function(s,h,l,c){var u=h+" Iterator";return s.prototype=f_(nc,{next:fi(+!c,l)}),v_(s,u,!1,!0),g_[u]=m_,s},b_=_e,w_=St,Pe=function(s,h,l){try{return b_(w_(Object.getOwnPropertyDescriptor(s,h)[l]))}catch{}},__=Ee,E_=String,O_=TypeError,x_=function(s){if(typeof s=="object"||__(s))return s;throw new O_("Can't set "+E_(s)+" as a prototype")},sc=Pe,S_=V,qo=x_,$v=Object.setPrototypeOf||("__proto__"in{}?function(){var s=!1,h={},l;try{l=sc(Object.prototype,"__proto__","set"),l(h,[]),s=h instanceof Array}catch{}return function(u,f){return S_(u),qo(f),s?l(u,f):u.__proto__=f,u}}():void 0),Cv=X,ke=Oe,Pv=s_,kv=y_,T_=ih,rh=Nr,Dv=Bo,Go=xe,Mv=Ur,ac=Iv,I_=Pv.PROPER;Pv.CONFIGURABLE,ac.IteratorPrototype;var oh=ac.BUGGY_SAFARI_ITERATORS,hc=Go("iterator"),Av="keys",nh="values",sh="entries",$_=function(){return this},lc=function(s,h,l,c,u,f,m){kv(l,h,c);var b=function(te){if(te===u&&S)return S;if(!oh&&te&&te in x)return x[te];switch(te){case Av:return function(){return new l(this,te)};case nh:return function(){return new l(this,te)};case sh:return function(){return new l(this,te)}}return function(){return new l(this)}},y=h+" Iterator",E=!1,x=s.prototype,T=x[hc]||x["@@iterator"]||u&&x[u],S=!oh&&T||b(u),k=h==="Array"&&x.entries||T,z,J,Z;if(k&&(z=T_(k.call(new s)),z!==Object.prototype&&z.next&&(rh(z,y,!0,!0),Mv[y]=$_)),I_&&u===nh&&T&&T.name!==nh&&(E=!0,S=function(){return ke(T,this)}),u)if(J={values:b(nh),keys:f?S:b(Av),entries:b(sh)},m)for(Z in J)(oh||E||!(Z in x))&&Dv(x,Z,J[Z]);else Cv({target:h,proto:!0,forced:oh||E},J);return m&&x[hc]!==S&&Dv(x,hc,S,{name:u}),Mv[h]=S,J},ue=function(s,h){return{value:s,done:h}},C_=ne,Nv=Ur,Rv=Br;$t.f;var Fv=lc,ah=ue,Bv="Array Iterator",P_=Rv.set,dc=Rv.getterFor(Bv);Fv(Array,"Array",function(s,h){P_(this,{type:Bv,target:C_(s),index:0,kind:h})},function(){var s=dc(this),h=s.target,l=s.index++;if(!h||l>=h.length)return s.target=void 0,ah(void 0,!0);switch(s.kind){case"keys":return ah(l,!1);case"values":return ah(h[l],!1)}return ah([l,h[l]],!1)},"values"),Nv.Arguments=Nv.Array;var k_={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Vr=k_,D_=G,M_=Oi,A_=Ei,jv=Ur,N_=xe,cc=N_("toStringTag");for(var uc in Vr){var pc=D_[uc],fc=pc&&pc.prototype;fc&&M_(fc)!==cc&&A_(fc,cc,uc),jv[uc]=jv.Array}var R_=yv,zv=R_,F_=xe,B_=$t.f,Lv=F_("metadata"),Hv=Function.prototype;Hv[Lv]===void 0&&B_(Hv,Lv,{value:null});var j_=Ce;j_("asyncDispose");var z_=Ce;z_("dispose");var vc=Ce;vc("metadata");var L_=zv,H_=L_,W_=ht,U_=_e,gc=W_("Symbol"),V_=gc.keyFor,mc=U_(gc.prototype.valueOf),Wv=gc.isRegisteredSymbol||function(h){try{return V_(mc(h))!==void 0}catch{return!1}},Ti=X,q_=Wv;Ti({target:"Symbol",stat:!0},{isRegisteredSymbol:q_});for(var G_=Io,Uv=ht,K_=_e,Y_=Or,X_=xe,hh=Uv("Symbol"),Vv=hh.isWellKnownSymbol,qv=Uv("Object","getOwnPropertyNames"),Q_=K_(hh.prototype.valueOf),Gv=G_("wks"),lh=0,Kv=qv(hh),J_=Kv.length;lh<J_;lh++)try{var Yv=Kv[lh];Y_(hh[Yv])&&X_(Yv)}catch{}var yc=function(h){if(Vv&&Vv(h))return!0;try{for(var l=Q_(h),c=0,u=qv(Gv),f=u.length;c<f;c++)if(Gv[u[c]]==l)return!0}catch{}return!1},Z_=X,eE=yc;Z_({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:eE});var bc=Ce;bc("matcher");var wc=Ce;wc("observable");var tE=X,Ji=Wv;tE({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:Ji});var iE=X,Xv=yc;iE({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:Xv});var rE=Ce;rE("metadataKey");var Qv=Ce;Qv("patternMatch");var oE=Ce;oE("replaceAll");var nE=H_,sE=nE,fs=sE,Ko=A(fs),_c=_e,aE=ka,hE=Ui,lE=fa,dE=_c("".charAt),dh=_c("".charCodeAt),cE=_c("".slice),ft=function(s){return function(h,l){var c=hE(lE(h)),u=aE(l),f=c.length,m,b;return u<0||u>=f?s?"":void 0:(m=dh(c,u),m<55296||m>56319||u+1===f||(b=dh(c,u+1))<56320||b>57343?s?dE(c,u):m:s?cE(c,u,u+2):(m-55296<<10)+(b-56320)+65536)}},Jv={codeAt:ft(!1),charAt:ft(!0)},uE=Jv.charAt,Zv=Ui,eg=Br,pE=lc,tg=ue,Ec="String Iterator",fE=eg.set,vE=eg.getterFor(Ec);pE(String,"String",function(s){fE(this,{type:Ec,string:Zv(s),index:0})},function(){var h=vE(this),l=h.string,c=h.index,u;return c>=l.length?tg(void 0,!0):(u=uE(l,c),h.index+=u.length,tg(u,!1))});var ig=Zn,gE=ig.f("iterator"),mE=gE,ch=mE,yE=ch,bE=yE,Oc=bE,rg=Oc,og=rg,wE=A(og);function Zi(s){"@babel/helpers - typeof";return Zi=typeof Ko=="function"&&typeof wE=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Ko=="function"&&h.constructor===Ko&&h!==Ko.prototype?"symbol":typeof h},Zi(s)}var ng=Zn,sg=ng.f("toPrimitive"),_E=sg,EE=_E,OE=EE,xE=OE,ag=xE,vs=ag,hg=vs,lg=A(hg);function dg(s,h){if(Zi(s)!=="object"||s===null)return s;var l=s[lg];if(l!==void 0){var c=l.call(s,h||"default");if(Zi(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(s)}function cg(s){var h=dg(s,"string");return Zi(h)==="symbol"?h:String(h)}function xc(s,h){for(var l=0;l<h.length;l++){var c=h[l];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Ca(s,cg(c.key),c)}}function tt(s,h,l){return h&&xc(s.prototype,h),l&&xc(s,l),Ca(s,"prototype",{writable:!1}),s}function jt(s,h,l){return h=cg(h),h in s?Ca(s,h,{value:l,enumerable:!0,configurable:!0,writable:!0}):s[h]=l,s}var ug=_e,SE=St,Sc=Ke,pg=Ae,fg=us,TE=yo,vg=Function,Tc=ug([].concat),IE=ug([].join),ce={},$E=function(s,h,l){if(!pg(ce,h)){for(var c=[],u=0;u<h;u++)c[u]="a["+u+"]";ce[h]=vg("C,a","return new C("+IE(c,",")+")")}return ce[h](s,l)},er=TE?vg.bind:function(h){var l=SE(this),c=l.prototype,u=fg(arguments,1),f=function(){var b=Tc(u,fg(arguments));return this instanceof f?$E(l,b.length,b):l.apply(h,b)};return Sc(c)&&(f.prototype=c),f},Ic=X,gg=er;Ic({target:"Function",proto:!0,forced:Function.bind!==gg},{bind:gg});var CE=G,gs=le,lt=function(s,h){var l=gs[s+"Prototype"],c=l&&l[h];if(c)return c;var u=CE[s],f=u&&u.prototype;return f&&f[h]},PE=lt,mg=PE("Function","bind"),kE=$e,DE=mg,$c=Function.prototype,ME=function(s){var h=s.bind;return s===$c||kE($c,s)&&h===$c.bind?DE:h},AE=ME,yg=AE,NE=yg,qr=A(NE),bg=St,RE=Tt,wg=Li,_g=Mt,FE=TypeError,Cc=function(s){return function(h,l,c,u){bg(l);var f=RE(h),m=wg(f),b=_g(f),y=s?b-1:0,E=s?-1:1;if(c<2)for(;;){if(y in m){u=m[y],y+=E;break}if(y+=E,s?y<0:b<=y)throw new FE("Reduce of empty array with no initial value")}for(;s?y>=0:b>y;y+=E)y in m&&(u=l(u,m[y],y,f));return u}},Eg={left:Cc(!1),right:Cc(!0)},Ii=he,uh=function(s,h){var l=[][s];return!!l&&Ii(function(){l.call(null,h||function(){return 1},1)})},Og=G,BE=zi,ms=BE(Og.process)==="process",xg=X,jE=Eg.left,zE=uh,Sg=Oo,Pc=ms,LE=!Pc&&Sg>79&&Sg<83,ys=LE||!zE("reduce");xg({target:"Array",proto:!0,forced:ys},{reduce:function(h){var l=arguments.length;return jE(this,h,l,l>1?arguments[1]:void 0)}});var ii=lt,zt=ii("Array","reduce"),ph=$e,tr=zt,$i=Array.prototype,Tg=function(s){var h=s.reduce;return s===$i||ph($i,s)&&h===$i.reduce?tr:h},HE=Tg,Yo=HE,Gr=Yo,fh=A(Gr),vh=X,Ig=jr.filter,$g=Fo,Cg=$g("filter");vh({target:"Array",proto:!0,forced:!Cg},{filter:function(h){return Ig(this,h,arguments.length>1?arguments[1]:void 0)}});var Pg=lt,kc=Pg("Array","filter"),Kr=$e,bs=kc,Yr=Array.prototype,gh=function(s){var h=s.filter;return s===Yr||Kr(Yr,s)&&h===Yr.filter?bs:h},kg=gh,WE=kg,UE=WE,De=A(UE),Dc=X,VE=jr.map,vt=Fo,Le=vt("map");Dc({target:"Array",proto:!0,forced:!Le},{map:function(h){return VE(this,h,arguments.length>1?arguments[1]:void 0)}});var Pt=lt,mh=Pt("Array","map"),ws=$e,_s=mh,Xr=Array.prototype,Xo=function(s){var h=s.map;return s===Xr||ws(Xr,s)&&h===Xr.map?_s:h},vi=Xo,Qr=vi,Dg=Qr,kt=A(Dg),yh=ge,Ci=Mt,bh=Ln,Jr=Wi,Mc=function(s,h,l,c,u,f,m,b){for(var y=u,E=0,x=m?Jr(m,b):!1,T,S;E<c;)E in l&&(T=x?x(l[E],E,h):l[E],f>0&&yh(T)?(S=Ci(T),y=Mc(s,h,T,S,y,f-1)-1):(bh(y+1),s[y]=T),y++),E++;return y},Ac=Mc,Mg=X,Ag=Ac,wh=St,Nc=Tt,Ng=Mt,Rg=Ro;Mg({target:"Array",proto:!0},{flatMap:function(h){var l=Nc(this),c=Ng(l),u;return wh(h),u=Rg(l,0),u.length=Ag(u,l,l,c,0,1,h,arguments.length>1?arguments[1]:void 0),u}});var qE=lt,GE=qE("Array","flatMap"),Es=$e,Os=GE,Zr=Array.prototype,Fg=function(s){var h=s.flatMap;return s===Zr||Es(Zr,s)&&h===Zr.flatMap?Os:h},Qo=Fg,eo=Qo,KE=eo,YE=A(KE);function Bg(s){return new zg(s)}var jg=function(){function s(h,l,c){var u,f,m;st(this,s),jt(this,"_listeners",{add:qr(u=this._add).call(u,this),remove:qr(f=this._remove).call(f,this),update:qr(m=this._update).call(m,this)}),this._source=h,this._transformers=l,this._target=c}return tt(s,[{key:"all",value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:"start",value:function(){return this._source.on("add",this._listeners.add),this._source.on("remove",this._listeners.remove),this._source.on("update",this._listeners.update),this}},{key:"stop",value:function(){return this._source.off("add",this._listeners.add),this._source.off("remove",this._listeners.remove),this._source.off("update",this._listeners.update),this}},{key:"_transformItems",value:function(l){var c;return fh(c=this._transformers).call(c,function(u,f){return f(u)},l)}},{key:"_add",value:function(l,c){c!=null&&this._target.add(this._transformItems(this._source.get(c.items)))}},{key:"_update",value:function(l,c){c!=null&&this._target.update(this._transformItems(this._source.get(c.items)))}},{key:"_remove",value:function(l,c){c!=null&&this._target.remove(this._transformItems(c.oldData))}}]),s}(),zg=function(){function s(h){st(this,s),jt(this,"_transformers",[]),this._source=h}return tt(s,[{key:"filter",value:function(l){return this._transformers.push(function(c){return De(c).call(c,l)}),this}},{key:"map",value:function(l){return this._transformers.push(function(c){return kt(c).call(c,l)}),this}},{key:"flatMap",value:function(l){return this._transformers.push(function(c){return YE(c).call(c,l)}),this}},{key:"to",value:function(l){return new jg(this._source,this._transformers,l)}}]),s}(),xs=Oe,_h=V,XE=wa,Eh=function(s,h,l){var c,u;_h(s);try{if(c=XE(s,"return"),!c){if(h==="throw")throw l;return l}c=xs(c,s)}catch(f){u=!0,c=f}if(h==="throw")throw l;if(u)throw c;return _h(c),l},QE=V,JE=Eh,Rc=function(s,h,l,c){try{return c?h(QE(l)[0],l[1]):h(l)}catch(u){JE(s,"throw",u)}},ZE=xe,Lg=Ur,eO=ZE("iterator"),tO=Array.prototype,Fc=function(s){return s!==void 0&&(Lg.Array===s||tO[eO]===s)},Jo=Oi,Pi=wa,iO=Eo,Oh=Ur,Hg=xe,Ss=Hg("iterator"),Zo=function(s){if(!iO(s))return Pi(s,Ss)||Pi(s,"@@iterator")||Oh[Jo(s)]},en=Oe,Wg=St,Bc=V,Ug=To,Vg=Zo,qg=TypeError,xh=function(s,h){var l=arguments.length<2?Vg(s):h;if(Wg(l))return Bc(en(l,s));throw new qg(Ug(s)+" is not iterable")},Gg=Wi,Kg=Oe,Yg=Tt,Xg=Rc,rO=Fc,oO=Ma,nO=Mt,jc=Ao,Qg=xh,sO=Zo,Jg=Array,Zg=function(h){var l=Yg(h),c=oO(this),u=arguments.length,f=u>1?arguments[1]:void 0,m=f!==void 0;m&&(f=Gg(f,u>2?arguments[2]:void 0));var b=sO(l),y=0,E,x,T,S,k,z;if(b&&!(this===Jg&&rO(b)))for(S=Qg(l,b),k=S.next,x=c?new this:[];!(T=Kg(k,S)).done;y++)z=m?Xg(S,f,[T.value,y],!0):T.value,jc(x,y,z);else for(E=nO(l),x=c?new this(E):Jg(E);E>y;y++)z=m?f(l[y],y):l[y],jc(x,y,z);return x.length=y,x},em=xe,tm=em("iterator"),Ts=!1;try{var zc=0,ri={next:function(){return{done:!!zc++}},return:function(){Ts=!0}};ri[tm]=function(){return this},Array.from(ri,function(){throw 2})}catch{}var im=function(s,h){try{if(!h&&!Ts)return!1}catch{return!1}var l=!1;try{var c={};c[tm]=function(){return{next:function(){return{done:l=!0}}}},s(c)}catch{}return l},aO=X,hO=Zg,lO=im,ir=!lO(function(s){Array.from(s)});aO({target:"Array",stat:!0,forced:ir},{from:hO});var rr=le,rm=rr.Array.from,to=rm,Lc=to,tn=Lc,io=A(tn),ye=Zo,Sh=ye,dO=Sh,se=dO,Hc=se,Lt=Hc,om=Lt,Wc=om,rn=Wc,Is=A(rn),Uc=rn,$s=A(Uc),nm=X,or=ge;nm({target:"Array",stat:!0},{isArray:or});var Ht=le,cO=Ht.Array.isArray,nr=cO,sm=nr,uO=sm,Vc=uO,am=Vc,Cs=am,qc=Cs,hm=A(qc);function pO(s){if(hm(s))return s}var on=Ue,fO=ge,lm=TypeError,vO=Object.getOwnPropertyDescriptor,dm=on&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(s){return s instanceof TypeError}}(),Gc=dm?function(s,h){if(fO(s)&&!vO(s,"length").writable)throw new lm("Cannot set read only .length");return s.length=h}:function(s,h){return s.length=h},Kc=X,gt=Tt,cm=Mt,sr=Gc,nn=Ln,re=he,Q=re(function(){return[].push.call({length:4294967296},1)!==4294967297}),Dt=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(s){return s instanceof TypeError}},Ye=Q||!Dt();Kc({target:"Array",proto:!0,arity:1,forced:Ye},{push:function(h){var l=gt(this),c=cm(l),u=arguments.length;nn(c+u);for(var f=0;f<u;f++)l[c]=arguments[f],c++;return sr(l,c),c}});var sn=lt,um=sn("Array","push"),ar=$e,gO=um,Th=Array.prototype,mO=function(s){var h=s.push;return s===Th||ar(Th,s)&&h===Th.push?gO:h},pm=mO,be=pm,fm=be,yO=fm,vm=yO,gm=vm,an=gm,mt=A(an);function mm(s,h){var l=s==null?null:typeof Ko<"u"&&Is(s)||s["@@iterator"];if(l!=null){var c,u,f,m,b=[],y=!0,E=!1;try{if(f=(l=l.call(s)).next,h===0){if(Object(l)!==l)return;y=!1}else for(;!(y=(c=f.call(l)).done)&&(mt(b).call(b,c.value),b.length!==h);y=!0);}catch(x){E=!0,u=x}finally{try{if(!y&&l.return!=null&&(m=l.return(),Object(m)!==m))return}finally{if(E)throw u}}return b}}var ym=X,Yc=ge,Xc=Ma,bO=Ke,Ih=Ra,wO=Mt,_O=ne,EO=Ao,bm=xe,wm=Fo,OO=us,xO=wm("slice"),SO=bm("species"),Qc=Array,_m=Math.max;ym({target:"Array",proto:!0,forced:!xO},{slice:function(h,l){var c=_O(this),u=wO(c),f=Ih(h,u),m=Ih(l===void 0?u:l,u),b,y,E;if(Yc(c)&&(b=c.constructor,Xc(b)&&(b===Qc||Yc(b.prototype))?b=void 0:bO(b)&&(b=b[SO],b===null&&(b=void 0)),b===Qc||b===void 0))return OO(c,f,m);for(y=new(b===void 0?Qc:b)(_m(m-f,0)),E=0;f<m;f++,E++)f in c&&EO(y,E,c[f]);return y.length=E,y}});var $h=lt,TO=$h("Array","slice"),Em=$e,IO=TO,Jc=Array.prototype,$O=function(s){var h=s.slice;return s===Jc||Em(Jc,s)&&h===Jc.slice?IO:h},CO=$O,Ch=CO,PO=Ch,Om=PO,kO=Om,Zc=kO,xm=Zc,Sm=A(xm),ki=Lc,DO=ki,eu=DO,MO=eu,Ph=MO,Tm=A(Ph);function tu(s,h){(h==null||h>s.length)&&(h=s.length);for(var l=0,c=new Array(h);l<h;l++)c[l]=s[l];return c}function Im(s,h){var l;if(s){if(typeof s=="string")return tu(s,h);var c=Sm(l=Object.prototype.toString.call(s)).call(l,8,-1);if(c==="Object"&&s.constructor&&(c=s.constructor.name),c==="Map"||c==="Set")return Tm(s);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return tu(s,h)}}function AO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yt(s,h){return pO(s)||mm(s,h)||Im(s,h)||AO()}function NO(s){if(hm(s))return tu(s)}function RO(s){if(typeof Ko<"u"&&Is(s)!=null||s["@@iterator"]!=null)return Tm(s)}function FO(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dt(s){return NO(s)||RO(s)||Im(s)||FO()}var BO=zv,Ps=A(BO),jO=lt,zO=jO("Array","concat"),LO=$e,HO=zO,iu=Array.prototype,$m=function(s){var h=s.concat;return s===iu||LO(iu,s)&&h===iu.concat?HO:h},WO=$m,UO=WO,VO=UO,kh=A(VO),qO=Ch,ks=A(qO),GO=ht,Cm=_e,KO=Dr,YO=Jn,Pm=V,XO=Cm([].concat),hn=GO("Reflect","ownKeys")||function(h){var l=KO.f(Pm(h)),c=YO.f;return c?XO(l,c(h)):l},km=X,ru=hn;km({target:"Reflect",stat:!0},{ownKeys:ru});var QO=le,JO=QO.Reflect.ownKeys,ou=JO,ZO=ou,ex=ZO,Dm=A(ex),tx=sm,bt=A(tx),ix=X,rx=Tt,Mm=ja,ox=he,nx=ox(function(){Mm(1)});ix({target:"Object",stat:!0,forced:nx},{keys:function(h){return Mm(rx(h))}});var sx=le,ax=sx.Object.keys,hx=ax,lx=hx,dx=lx,nu=A(dx),su=jr.forEach,cx=uh,au=cx("forEach"),ux=au?[].forEach:function(h){return su(this,h,arguments.length>1?arguments[1]:void 0)},px=X,Am=ux;px({target:"Array",proto:!0,forced:[].forEach!==Am},{forEach:Am});var Nm=lt,fx=Nm("Array","forEach"),vx=fx,Rm=vx,gx=Oi,mx=Ae,yx=$e,bx=Rm,hu=Array.prototype,Fm={DOMTokenList:!0,NodeList:!0},Bm=function(s){var h=s.forEach;return s===hu||yx(hu,s)&&h===hu.forEach||mx(Fm,gx(s))?bx:h},Ds=Bm,Di=A(Ds),jm=X,lu=_e,zm=ge,du=lu([].reverse),Lm=[1,2];jm({target:"Array",proto:!0,forced:String(Lm)===String(Lm.reverse())},{reverse:function(){return zm(this)&&(this.length=this.length),du(this)}});var wx=lt,_x=wx("Array","reverse"),Ex=$e,Hm=_x,cu=Array.prototype,Wm=function(s){var h=s.reverse;return s===cu||Ex(cu,s)&&h===cu.reverse?Hm:h},Ox=Wm,Um=Ox,Vm=Um,xx=A(Vm),uu=To,qm=TypeError,Gm=function(s,h){if(!delete s[h])throw new qm("Cannot delete property "+uu(h)+" of "+uu(s))},Sx=X,pu=Tt,Tx=Ra,fu=ka,Ix=Mt,$x=Gc,ro=Ln,Cx=Ro,Px=Ao,vu=Gm,kx=Fo,gu=kx("splice"),Dx=Math.max,Mx=Math.min;Sx({target:"Array",proto:!0,forced:!gu},{splice:function(h,l){var c=pu(this),u=Ix(c),f=Tx(h,u),m=arguments.length,b,y,E,x,T,S;for(m===0?b=y=0:m===1?(b=0,y=u-f):(b=m-2,y=Mx(Dx(fu(l),0),u-f)),ro(u+b-y),E=Cx(c,y),x=0;x<y;x++)T=f+x,T in c&&Px(E,x,c[T]);if(E.length=y,b<y){for(x=f;x<u-y;x++)T=x+y,S=x+b,T in c?c[S]=c[T]:vu(c,S);for(x=u;x>u-y+b;x--)vu(c,x-1)}else if(b>y)for(x=u-y;x>f;x--)T=x+y-1,S=x+b-1,T in c?c[S]=c[T]:vu(c,S);for(x=0;x<b;x++)c[x+f]=arguments[x+2];return $x(c,u-y+b),E}});var Km=lt,Ax=Km("Array","splice"),Nx=$e,Ym=Ax,Dh=Array.prototype,Rx=function(s){var h=s.splice;return s===Dh||Nx(Dh,s)&&h===Dh.splice?Ym:h},Xm=Rx,Fx=Xm,Bx=Fx,Qm=A(Bx),mu=Ue,Jm=_e,jx=Oe,zx=he,Ms=ja,Lx=Jn,Hx=br,Zm=Tt,Wx=Li,oo=Object.assign,ey=Object.defineProperty,Ux=Jm([].concat),Vx=!oo||zx(function(){if(mu&&oo({b:1},oo(ey({},"a",{enumerable:!0,get:function(){ey(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var s={},h={},l=Symbol("assign detection"),c="abcdefghijklmnopqrst";return s[l]=7,c.split("").forEach(function(u){h[u]=u}),oo({},s)[l]!==7||Ms(oo({},h)).join("")!==c})?function(h,l){for(var c=Zm(h),u=arguments.length,f=1,m=Lx.f,b=Hx.f;u>f;)for(var y=Wx(arguments[f++]),E=m?Ux(Ms(y),m(y)):Ms(y),x=E.length,T=0,S;x>T;)S=E[T++],(!mu||jx(b,y,S))&&(c[S]=y[S]);return c}:oo,Mh=X,yu=Vx;Mh({target:"Object",stat:!0,arity:2,forced:Object.assign!==yu},{assign:yu});var ty=le,qx=ty.Object.assign,iy=qx,bu=iy,ry=bu,oy=A(ry),ny=X,sy=he,Ah=Tt,ay=ih,As=Jd,Gx=sy(function(){ay(1)});ny({target:"Object",stat:!0,forced:Gx,sham:!As},{getPrototypeOf:function(h){return ay(Ah(h))}});var Kx=le,Nh=Kx.Object.getPrototypeOf,hy=Nh,Yx=hy,Xx=X,Qx=Ue,Jx=kr;Xx({target:"Object",stat:!0,sham:!Qx},{create:Jx});var Zx=le,Rh=Zx.Object,ly=function(h,l){return Rh.create(h,l)},dy=ly,wu=dy,cy=wu,eS=A(cy),_u=le,tS=yr;_u.JSON||(_u.JSON={stringify:JSON.stringify});var iS=function(h,l,c){return tS(_u.JSON.stringify,null,arguments)},rS=iS,oS=rS,hr=oS,uy=A(hr),nS=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",sS=TypeError,py=function(s,h){if(s<h)throw new sS("Not enough arguments");return s},Eu=G,fy=yr,vy=Ee,aS=nS,lr=wi,hS=us,lS=py,dS=Eu.Function,cS=/MSIE .\./.test(lr)||aS&&function(){var s=Eu.Bun.version.split(".");return s.length<3||s[0]==="0"&&(s[1]<3||s[1]==="3"&&s[2]==="0")}(),Mi=function(s,h){var l=h?2:1;return cS?function(c,u){var f=lS(arguments.length,1)>l,m=vy(c)?c:dS(c),b=f?hS(arguments,l):[],y=f?function(){fy(m,this,b)}:m;return h?s(y,u):s(y)}:s},gy=X,my=G,uS=Mi,Ou=uS(my.setInterval,!0);gy({global:!0,bind:!0,forced:my.setInterval!==Ou},{setInterval:Ou});var yy=X,by=G,Fh=Mi,Ns=Fh(by.setTimeout,!0);yy({global:!0,bind:!0,forced:by.setTimeout!==Ns},{setTimeout:Ns});var xu=le,Su=xu.setTimeout,Bh=Su,wy=A(Bh),_y={exports:{}};(function(s){function h(c){if(c)return l(c);this._callbacks=new Map}function l(c){return Object.assign(c,h.prototype),c._callbacks=new Map,c}h.prototype.on=function(c,u){const f=this._callbacks.get(c)??[];return f.push(u),this._callbacks.set(c,f),this},h.prototype.once=function(c,u){const f=(...m)=>{this.off(c,f),u.apply(this,m)};return f.fn=u,this.on(c,f),this},h.prototype.off=function(c,u){if(c===void 0&&u===void 0)return this._callbacks.clear(),this;if(u===void 0)return this._callbacks.delete(c),this;const f=this._callbacks.get(c);if(f){for(const[m,b]of f.entries())if(b===u||b.fn===u){f.splice(m,1);break}f.length===0?this._callbacks.delete(c):this._callbacks.set(c,f)}return this},h.prototype.emit=function(c,...u){const f=this._callbacks.get(c);if(f){const m=[...f];for(const b of m)b.apply(this,u)}return this},h.prototype.listeners=function(c){return this._callbacks.get(c)??[]},h.prototype.listenerCount=function(c){if(c)return this.listeners(c).length;let u=0;for(const f of this._callbacks.values())u+=f.length;return u},h.prototype.hasListeners=function(c){return this.listenerCount(c)>0},h.prototype.addEventListener=h.prototype.on,h.prototype.removeListener=h.prototype.off,h.prototype.removeEventListener=h.prototype.off,h.prototype.removeAllListeners=h.prototype.off,s.exports=h})(_y);var pS=_y.exports,fS=A(pS);/*! Hammer.JS - v2.0.17-rc - 2019-12-16
 * http://naver.github.io/egjs
 *
 * Forked By Naver egjs
 * Copyright (c) hammerjs
 * Licensed under the MIT license */function oi(){return oi=Object.assign||function(s){for(var h=1;h<arguments.length;h++){var l=arguments[h];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&(s[c]=l[c])}return s},oi.apply(this,arguments)}function Wt(s,h){s.prototype=Object.create(h.prototype),s.prototype.constructor=s,s.__proto__=h}function ln(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}var Tu;typeof Object.assign!="function"?Tu=function(h){if(h==null)throw new TypeError("Cannot convert undefined or null to object");for(var l=Object(h),c=1;c<arguments.length;c++){var u=arguments[c];if(u!=null)for(var f in u)u.hasOwnProperty(f)&&(l[f]=u[f])}return l}:Tu=Object.assign;var no=Tu,Iu=["","webkit","Moz","MS","ms","o"],vS=typeof document>"u"?{style:{}}:document.createElement("div"),gS="function",so=Math.round,ao=Math.abs,ho=Date.now;function Ai(s,h){for(var l,c,u=h[0].toUpperCase()+h.slice(1),f=0;f<Iu.length;){if(l=Iu[f],c=l?l+u:h,c in s)return c;f++}}var wt;typeof window>"u"?wt={}:wt=window;var Ey=Ai(vS.style,"touchAction"),jh=Ey!==void 0;function mS(){if(!jh)return!1;var s={},h=wt.CSS&&wt.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(l){return s[l]=h?wt.CSS.supports("touch-action",l):!0}),s}var Oy="compute",Ni="auto",zh="manipulation",lo="none",Rs="pan-x",Fs="pan-y",Lh=mS(),yS=/mobile|tablet|ip(ad|hone|od)|android/i,xy="ontouchstart"in wt,bS=Ai(wt,"PointerEvent")!==void 0,wS=xy&&yS.test(navigator.userAgent),Bs="touch",_S="pen",$u="mouse",ES="kinect",OS=25,_t=1,dr=2,Re=4,ae=8,Hh=1,js=2,dn=4,zs=8,cn=16,gi=js|dn,me=zs|cn,Ls=gi|me,Sy=["x","y"],Wh=["clientX","clientY"];function Ri(s,h,l){var c;if(s)if(s.forEach)s.forEach(h,l);else if(s.length!==void 0)for(c=0;c<s.length;)h.call(l,s[c],c,s),c++;else for(c in s)s.hasOwnProperty(c)&&h.call(l,s[c],c,s)}function Uh(s,h){return typeof s===gS?s.apply(h&&h[0]||void 0,h):s}function co(s,h){return s.indexOf(h)>-1}function xS(s){if(co(s,lo))return lo;var h=co(s,Rs),l=co(s,Fs);return h&&l?lo:h||l?h?Rs:Fs:co(s,zh)?zh:Ni}var Ty=function(){function s(l,c){this.manager=l,this.set(c)}var h=s.prototype;return h.set=function(c){c===Oy&&(c=this.compute()),jh&&this.manager.element.style&&Lh[c]&&(this.manager.element.style[Ey]=c),this.actions=c.toLowerCase().trim()},h.update=function(){this.set(this.manager.options.touchAction)},h.compute=function(){var c=[];return Ri(this.manager.recognizers,function(u){Uh(u.options.enable,[u])&&(c=c.concat(u.getTouchAction()))}),xS(c.join(" "))},h.preventDefaults=function(c){var u=c.srcEvent,f=c.offsetDirection;if(this.manager.session.prevented){u.preventDefault();return}var m=this.actions,b=co(m,lo)&&!Lh[lo],y=co(m,Fs)&&!Lh[Fs],E=co(m,Rs)&&!Lh[Rs];if(b){var x=c.pointers.length===1,T=c.distance<2,S=c.deltaTime<250;if(x&&T&&S)return}if(!(E&&y)&&(b||y&&f&gi||E&&f&me))return this.preventSrc(u)},h.preventSrc=function(c){this.manager.session.prevented=!0,c.preventDefault()},s}();function Cu(s,h){for(;s;){if(s===h)return!0;s=s.parentNode}return!1}function Iy(s){var h=s.length;if(h===1)return{x:so(s[0].clientX),y:so(s[0].clientY)};for(var l=0,c=0,u=0;u<h;)l+=s[u].clientX,c+=s[u].clientY,u++;return{x:so(l/h),y:so(c/h)}}function $y(s){for(var h=[],l=0;l<s.pointers.length;)h[l]={clientX:so(s.pointers[l].clientX),clientY:so(s.pointers[l].clientY)},l++;return{timeStamp:ho(),pointers:h,center:Iy(h),deltaX:s.deltaX,deltaY:s.deltaY}}function Vh(s,h,l){l||(l=Sy);var c=h[l[0]]-s[l[0]],u=h[l[1]]-s[l[1]];return Math.sqrt(c*c+u*u)}function Pu(s,h,l){l||(l=Sy);var c=h[l[0]]-s[l[0]],u=h[l[1]]-s[l[1]];return Math.atan2(u,c)*180/Math.PI}function ku(s,h){return s===h?Hh:ao(s)>=ao(h)?s<0?js:dn:h<0?zs:cn}function Cy(s,h){var l=h.center,c=s.offsetDelta||{},u=s.prevDelta||{},f=s.prevInput||{};(h.eventType===_t||f.eventType===Re)&&(u=s.prevDelta={x:f.deltaX||0,y:f.deltaY||0},c=s.offsetDelta={x:l.x,y:l.y}),h.deltaX=u.x+(l.x-c.x),h.deltaY=u.y+(l.y-c.y)}function Du(s,h,l){return{x:h/s||0,y:l/s||0}}function Py(s,h){return Vh(h[0],h[1],Wh)/Vh(s[0],s[1],Wh)}function ky(s,h){return Pu(h[1],h[0],Wh)+Pu(s[1],s[0],Wh)}function Dy(s,h){var l=s.lastInterval||h,c=h.timeStamp-l.timeStamp,u,f,m,b;if(h.eventType!==ae&&(c>OS||l.velocity===void 0)){var y=h.deltaX-l.deltaX,E=h.deltaY-l.deltaY,x=Du(c,y,E);f=x.x,m=x.y,u=ao(x.x)>ao(x.y)?x.x:x.y,b=ku(y,E),s.lastInterval=h}else u=l.velocity,f=l.velocityX,m=l.velocityY,b=l.direction;h.velocity=u,h.velocityX=f,h.velocityY=m,h.direction=b}function Mu(s,h){var l=s.session,c=h.pointers,u=c.length;l.firstInput||(l.firstInput=$y(h)),u>1&&!l.firstMultiple?l.firstMultiple=$y(h):u===1&&(l.firstMultiple=!1);var f=l.firstInput,m=l.firstMultiple,b=m?m.center:f.center,y=h.center=Iy(c);h.timeStamp=ho(),h.deltaTime=h.timeStamp-f.timeStamp,h.angle=Pu(b,y),h.distance=Vh(b,y),Cy(l,h),h.offsetDirection=ku(h.deltaX,h.deltaY);var E=Du(h.deltaTime,h.deltaX,h.deltaY);h.overallVelocityX=E.x,h.overallVelocityY=E.y,h.overallVelocity=ao(E.x)>ao(E.y)?E.x:E.y,h.scale=m?Py(m.pointers,c):1,h.rotation=m?ky(m.pointers,c):0,h.maxPointers=l.prevInput?h.pointers.length>l.prevInput.maxPointers?h.pointers.length:l.prevInput.maxPointers:h.pointers.length,Dy(l,h);var x=s.element,T=h.srcEvent,S;T.composedPath?S=T.composedPath()[0]:T.path?S=T.path[0]:S=T.target,Cu(S,x)&&(x=S),h.target=x}function My(s,h,l){var c=l.pointers.length,u=l.changedPointers.length,f=h&_t&&c-u===0,m=h&(Re|ae)&&c-u===0;l.isFirst=!!f,l.isFinal=!!m,f&&(s.session={}),l.eventType=h,Mu(s,l),s.emit("hammer.input",l),s.recognize(l),s.session.prevInput=l}function un(s){return s.trim().split(/\s+/g)}function Hs(s,h,l){Ri(un(h),function(c){s.addEventListener(c,l,!1)})}function pn(s,h,l){Ri(un(h),function(c){s.removeEventListener(c,l,!1)})}function Au(s){var h=s.ownerDocument||s;return h.defaultView||h.parentWindow||window}var Nt=function(){function s(l,c){var u=this;this.manager=l,this.callback=c,this.element=l.element,this.target=l.options.inputTarget,this.domHandler=function(f){Uh(l.options.enable,[l])&&u.handler(f)},this.init()}var h=s.prototype;return h.handler=function(){},h.init=function(){this.evEl&&Hs(this.element,this.evEl,this.domHandler),this.evTarget&&Hs(this.target,this.evTarget,this.domHandler),this.evWin&&Hs(Au(this.element),this.evWin,this.domHandler)},h.destroy=function(){this.evEl&&pn(this.element,this.evEl,this.domHandler),this.evTarget&&pn(this.target,this.evTarget,this.domHandler),this.evWin&&pn(Au(this.element),this.evWin,this.domHandler)},s}();function uo(s,h,l){if(s.indexOf&&!l)return s.indexOf(h);for(var c=0;c<s.length;){if(l&&s[c][l]==h||!l&&s[c]===h)return c;c++}return-1}var Ay={pointerdown:_t,pointermove:dr,pointerup:Re,pointercancel:ae,pointerout:ae},SS={2:Bs,3:_S,4:$u,5:ES},Ny="pointerdown",qh="pointermove pointerup pointercancel";wt.MSPointerEvent&&!wt.PointerEvent&&(Ny="MSPointerDown",qh="MSPointerMove MSPointerUp MSPointerCancel");var Ry=function(s){Wt(h,s);function h(){var c,u=h.prototype;return u.evEl=Ny,u.evWin=qh,c=s.apply(this,arguments)||this,c.store=c.manager.session.pointerEvents=[],c}var l=h.prototype;return l.handler=function(u){var f=this.store,m=!1,b=u.type.toLowerCase().replace("ms",""),y=Ay[b],E=SS[u.pointerType]||u.pointerType,x=E===Bs,T=uo(f,u.pointerId,"pointerId");y&_t&&(u.button===0||x)?T<0&&(f.push(u),T=f.length-1):y&(Re|ae)&&(m=!0),!(T<0)&&(f[T]=u,this.callback(this.manager,y,{pointers:f,changedPointers:[u],pointerType:E,srcEvent:u}),m&&f.splice(T,1))},h}(Nt);function cr(s){return Array.prototype.slice.call(s,0)}function Nu(s,h,l){for(var c=[],u=[],f=0;f<s.length;){var m=h?s[f][h]:s[f];uo(u,m)<0&&c.push(s[f]),u[f]=m,f++}return l&&(h?c=c.sort(function(b,y){return b[h]>y[h]}):c=c.sort()),c}var TS={touchstart:_t,touchmove:dr,touchend:Re,touchcancel:ae},IS="touchstart touchmove touchend touchcancel",Ru=function(s){Wt(h,s);function h(){var c;return h.prototype.evTarget=IS,c=s.apply(this,arguments)||this,c.targetIds={},c}var l=h.prototype;return l.handler=function(u){var f=TS[u.type],m=$S.call(this,u,f);m&&this.callback(this.manager,f,{pointers:m[0],changedPointers:m[1],pointerType:Bs,srcEvent:u})},h}(Nt);function $S(s,h){var l=cr(s.touches),c=this.targetIds;if(h&(_t|dr)&&l.length===1)return c[l[0].identifier]=!0,[l,l];var u,f,m=cr(s.changedTouches),b=[],y=this.target;if(f=l.filter(function(E){return Cu(E.target,y)}),h===_t)for(u=0;u<f.length;)c[f[u].identifier]=!0,u++;for(u=0;u<m.length;)c[m[u].identifier]&&b.push(m[u]),h&(Re|ae)&&delete c[m[u].identifier],u++;if(b.length)return[Nu(f.concat(b),"identifier",!0),b]}var it={mousedown:_t,mousemove:dr,mouseup:Re},Fy="mousedown",Ws="mousemove mouseup",rt=function(s){Wt(h,s);function h(){var c,u=h.prototype;return u.evEl=Fy,u.evWin=Ws,c=s.apply(this,arguments)||this,c.pressed=!1,c}var l=h.prototype;return l.handler=function(u){var f=it[u.type];f&_t&&u.button===0&&(this.pressed=!0),f&dr&&u.which!==1&&(f=Re),this.pressed&&(f&Re&&(this.pressed=!1),this.callback(this.manager,f,{pointers:[u],changedPointers:[u],pointerType:$u,srcEvent:u}))},h}(Nt),CS=2500,By=25;function jy(s){var h=s.changedPointers,l=h[0];if(l.identifier===this.primaryTouch){var c={x:l.clientX,y:l.clientY},u=this.lastTouches;this.lastTouches.push(c);var f=function(){var b=u.indexOf(c);b>-1&&u.splice(b,1)};setTimeout(f,CS)}}function PS(s,h){s&_t?(this.primaryTouch=h.changedPointers[0].identifier,jy.call(this,h)):s&(Re|ae)&&jy.call(this,h)}function Gh(s){for(var h=s.srcEvent.clientX,l=s.srcEvent.clientY,c=0;c<this.lastTouches.length;c++){var u=this.lastTouches[c],f=Math.abs(h-u.x),m=Math.abs(l-u.y);if(f<=By&&m<=By)return!0}return!1}var Fu=function(){var s=function(h){Wt(l,h);function l(u,f){var m;return m=h.call(this,u,f)||this,m.handler=function(b,y,E){var x=E.pointerType===Bs,T=E.pointerType===$u;if(!(T&&E.sourceCapabilities&&E.sourceCapabilities.firesTouchEvents)){if(x)PS.call(ln(ln(m)),y,E);else if(T&&Gh.call(ln(ln(m)),E))return;m.callback(b,y,E)}},m.touch=new Ru(m.manager,m.handler),m.mouse=new rt(m.manager,m.handler),m.primaryTouch=null,m.lastTouches=[],m}var c=l.prototype;return c.destroy=function(){this.touch.destroy(),this.mouse.destroy()},l}(Nt);return s}();function kS(s){var h,l=s.options.inputClass;return l?h=l:bS?h=Ry:wS?h=Ru:xy?h=Fu:h=rt,new h(s,My)}function fn(s,h,l){return Array.isArray(s)?(Ri(s,l[h],l),!0):!1}var Us=1,Ut=2,vn=4,Et=8,Fi=Et,gn=16,Rt=32,DS=1;function MS(){return DS++}function Kh(s,h){var l=h.manager;return l?l.get(s):s}function Yh(s){return s&gn?"cancel":s&Et?"end":s&vn?"move":s&Ut?"start":""}var Vs=function(){function s(l){l===void 0&&(l={}),this.options=oi({enable:!0},l),this.id=MS(),this.manager=null,this.state=Us,this.simultaneous={},this.requireFail=[]}var h=s.prototype;return h.set=function(c){return no(this.options,c),this.manager&&this.manager.touchAction.update(),this},h.recognizeWith=function(c){if(fn(c,"recognizeWith",this))return this;var u=this.simultaneous;return c=Kh(c,this),u[c.id]||(u[c.id]=c,c.recognizeWith(this)),this},h.dropRecognizeWith=function(c){return fn(c,"dropRecognizeWith",this)?this:(c=Kh(c,this),delete this.simultaneous[c.id],this)},h.requireFailure=function(c){if(fn(c,"requireFailure",this))return this;var u=this.requireFail;return c=Kh(c,this),uo(u,c)===-1&&(u.push(c),c.requireFailure(this)),this},h.dropRequireFailure=function(c){if(fn(c,"dropRequireFailure",this))return this;c=Kh(c,this);var u=uo(this.requireFail,c);return u>-1&&this.requireFail.splice(u,1),this},h.hasRequireFailures=function(){return this.requireFail.length>0},h.canRecognizeWith=function(c){return!!this.simultaneous[c.id]},h.emit=function(c){var u=this,f=this.state;function m(b){u.manager.emit(b,c)}f<Et&&m(u.options.event+Yh(f)),m(u.options.event),c.additionalEvent&&m(c.additionalEvent),f>=Et&&m(u.options.event+Yh(f))},h.tryEmit=function(c){if(this.canEmit())return this.emit(c);this.state=Rt},h.canEmit=function(){for(var c=0;c<this.requireFail.length;){if(!(this.requireFail[c].state&(Rt|Us)))return!1;c++}return!0},h.recognize=function(c){var u=no({},c);if(!Uh(this.options.enable,[this,u])){this.reset(),this.state=Rt;return}this.state&(Fi|gn|Rt)&&(this.state=Us),this.state=this.process(u),this.state&(Ut|vn|Et|gn)&&this.tryEmit(u)},h.process=function(c){},h.getTouchAction=function(){},h.reset=function(){},s}(),Xh=function(s){Wt(h,s);function h(c){var u;return c===void 0&&(c={}),u=s.call(this,oi({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},c))||this,u.pTime=!1,u.pCenter=!1,u._timer=null,u._input=null,u.count=0,u}var l=h.prototype;return l.getTouchAction=function(){return[zh]},l.process=function(u){var f=this,m=this.options,b=u.pointers.length===m.pointers,y=u.distance<m.threshold,E=u.deltaTime<m.time;if(this.reset(),u.eventType&_t&&this.count===0)return this.failTimeout();if(y&&E&&b){if(u.eventType!==Re)return this.failTimeout();var x=this.pTime?u.timeStamp-this.pTime<m.interval:!0,T=!this.pCenter||Vh(this.pCenter,u.center)<m.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!T||!x?this.count=1:this.count+=1,this._input=u;var S=this.count%m.taps;if(S===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){f.state=Fi,f.tryEmit()},m.interval),Ut):Fi}return Rt},l.failTimeout=function(){var u=this;return this._timer=setTimeout(function(){u.state=Rt},this.options.interval),Rt},l.reset=function(){clearTimeout(this._timer)},l.emit=function(){this.state===Fi&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},h}(Vs),mn=function(s){Wt(h,s);function h(c){return c===void 0&&(c={}),s.call(this,oi({pointers:1},c))||this}var l=h.prototype;return l.attrTest=function(u){var f=this.options.pointers;return f===0||u.pointers.length===f},l.process=function(u){var f=this.state,m=u.eventType,b=f&(Ut|vn),y=this.attrTest(u);return b&&(m&ae||!y)?f|gn:b||y?m&Re?f|Et:f&Ut?f|vn:Ut:Rt},h}(Vs);function zy(s){return s===cn?"down":s===zs?"up":s===js?"left":s===dn?"right":""}var Bu=function(s){Wt(h,s);function h(c){var u;return c===void 0&&(c={}),u=s.call(this,oi({event:"pan",threshold:10,pointers:1,direction:Ls},c))||this,u.pX=null,u.pY=null,u}var l=h.prototype;return l.getTouchAction=function(){var u=this.options.direction,f=[];return u&gi&&f.push(Fs),u&me&&f.push(Rs),f},l.directionTest=function(u){var f=this.options,m=!0,b=u.distance,y=u.direction,E=u.deltaX,x=u.deltaY;return y&f.direction||(f.direction&gi?(y=E===0?Hh:E<0?js:dn,m=E!==this.pX,b=Math.abs(u.deltaX)):(y=x===0?Hh:x<0?zs:cn,m=x!==this.pY,b=Math.abs(u.deltaY))),u.direction=y,m&&b>f.threshold&&y&f.direction},l.attrTest=function(u){return mn.prototype.attrTest.call(this,u)&&(this.state&Ut||!(this.state&Ut)&&this.directionTest(u))},l.emit=function(u){this.pX=u.deltaX,this.pY=u.deltaY;var f=zy(u.direction);f&&(u.additionalEvent=this.options.event+f),s.prototype.emit.call(this,u)},h}(mn),Ly=function(s){Wt(h,s);function h(c){return c===void 0&&(c={}),s.call(this,oi({event:"swipe",threshold:10,velocity:.3,direction:gi|me,pointers:1},c))||this}var l=h.prototype;return l.getTouchAction=function(){return Bu.prototype.getTouchAction.call(this)},l.attrTest=function(u){var f=this.options.direction,m;return f&(gi|me)?m=u.overallVelocity:f&gi?m=u.overallVelocityX:f&me&&(m=u.overallVelocityY),s.prototype.attrTest.call(this,u)&&f&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers===this.options.pointers&&ao(m)>this.options.velocity&&u.eventType&Re},l.emit=function(u){var f=zy(u.offsetDirection);f&&this.manager.emit(this.options.event+f,u),this.manager.emit(this.options.event,u)},h}(mn),Hy=function(s){Wt(h,s);function h(c){return c===void 0&&(c={}),s.call(this,oi({event:"pinch",threshold:0,pointers:2},c))||this}var l=h.prototype;return l.getTouchAction=function(){return[lo]},l.attrTest=function(u){return s.prototype.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&Ut)},l.emit=function(u){if(u.scale!==1){var f=u.scale<1?"in":"out";u.additionalEvent=this.options.event+f}s.prototype.emit.call(this,u)},h}(mn),Wy=function(s){Wt(h,s);function h(c){return c===void 0&&(c={}),s.call(this,oi({event:"rotate",threshold:0,pointers:2},c))||this}var l=h.prototype;return l.getTouchAction=function(){return[lo]},l.attrTest=function(u){return s.prototype.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&Ut)},h}(mn),qs=function(s){Wt(h,s);function h(c){var u;return c===void 0&&(c={}),u=s.call(this,oi({event:"press",pointers:1,time:251,threshold:9},c))||this,u._timer=null,u._input=null,u}var l=h.prototype;return l.getTouchAction=function(){return[Ni]},l.process=function(u){var f=this,m=this.options,b=u.pointers.length===m.pointers,y=u.distance<m.threshold,E=u.deltaTime>m.time;if(this._input=u,!y||!b||u.eventType&(Re|ae)&&!E)this.reset();else if(u.eventType&_t)this.reset(),this._timer=setTimeout(function(){f.state=Fi,f.tryEmit()},m.time);else if(u.eventType&Re)return Fi;return Rt},l.reset=function(){clearTimeout(this._timer)},l.emit=function(u){this.state===Fi&&(u&&u.eventType&Re?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=ho(),this.manager.emit(this.options.event,this._input)))},h}(Vs),ju={domEvents:!1,touchAction:Oy,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Qh=[[Wy,{enable:!1}],[Hy,{enable:!1},["rotate"]],[Ly,{direction:gi}],[Bu,{direction:gi},["swipe"]],[Xh],[Xh,{event:"doubletap",taps:2},["tap"]],[qs]],Gs=1,Uy=2;function Vy(s,h){var l=s.element;if(l.style){var c;Ri(s.options.cssProps,function(u,f){c=Ai(l.style,f),h?(s.oldCssProps[c]=l.style[c],l.style[c]=u):l.style[c]=s.oldCssProps[c]||""}),h||(s.oldCssProps={})}}function qy(s,h){var l=document.createEvent("Event");l.initEvent(s,!0,!0),l.gesture=h,h.target.dispatchEvent(l)}var Ks=function(){function s(l,c){var u=this;this.options=no({},ju,c||{}),this.options.inputTarget=this.options.inputTarget||l,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=l,this.input=kS(this),this.touchAction=new Ty(this,this.options.touchAction),Vy(this,!0),Ri(this.options.recognizers,function(f){var m=u.add(new f[0](f[1]));f[2]&&m.recognizeWith(f[2]),f[3]&&m.requireFailure(f[3])},this)}var h=s.prototype;return h.set=function(c){return no(this.options,c),c.touchAction&&this.touchAction.update(),c.inputTarget&&(this.input.destroy(),this.input.target=c.inputTarget,this.input.init()),this},h.stop=function(c){this.session.stopped=c?Uy:Gs},h.recognize=function(c){var u=this.session;if(!u.stopped){this.touchAction.preventDefaults(c);var f,m=this.recognizers,b=u.curRecognizer;(!b||b&&b.state&Fi)&&(u.curRecognizer=null,b=null);for(var y=0;y<m.length;)f=m[y],u.stopped!==Uy&&(!b||f===b||f.canRecognizeWith(b))?f.recognize(c):f.reset(),!b&&f.state&(Ut|vn|Et)&&(u.curRecognizer=f,b=f),y++}},h.get=function(c){if(c instanceof Vs)return c;for(var u=this.recognizers,f=0;f<u.length;f++)if(u[f].options.event===c)return u[f];return null},h.add=function(c){if(fn(c,"add",this))return this;var u=this.get(c.options.event);return u&&this.remove(u),this.recognizers.push(c),c.manager=this,this.touchAction.update(),c},h.remove=function(c){if(fn(c,"remove",this))return this;var u=this.get(c);if(c){var f=this.recognizers,m=uo(f,u);m!==-1&&(f.splice(m,1),this.touchAction.update())}return this},h.on=function(c,u){if(c===void 0||u===void 0)return this;var f=this.handlers;return Ri(un(c),function(m){f[m]=f[m]||[],f[m].push(u)}),this},h.off=function(c,u){if(c===void 0)return this;var f=this.handlers;return Ri(un(c),function(m){u?f[m]&&f[m].splice(uo(f[m],u),1):delete f[m]}),this},h.emit=function(c,u){this.options.domEvents&&qy(c,u);var f=this.handlers[c]&&this.handlers[c].slice();if(!(!f||!f.length)){u.type=c,u.preventDefault=function(){u.srcEvent.preventDefault()};for(var m=0;m<f.length;)f[m](u),m++}},h.destroy=function(){this.element&&Vy(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},s}(),Gy={touchstart:_t,touchmove:dr,touchend:Re,touchcancel:ae},AS="touchstart",NS="touchstart touchmove touchend touchcancel",Ky=function(s){Wt(h,s);function h(){var c,u=h.prototype;return u.evTarget=AS,u.evWin=NS,c=s.apply(this,arguments)||this,c.started=!1,c}var l=h.prototype;return l.handler=function(u){var f=Gy[u.type];if(f===_t&&(this.started=!0),!!this.started){var m=Jh.call(this,u,f);f&(Re|ae)&&m[0].length-m[1].length===0&&(this.started=!1),this.callback(this.manager,f,{pointers:m[0],changedPointers:m[1],pointerType:Bs,srcEvent:u})}},h}(Nt);function Jh(s,h){var l=cr(s.touches),c=cr(s.changedTouches);return h&(Re|ae)&&(l=Nu(l.concat(c),"identifier",!0)),[l,c]}function Ys(s,h,l){var c="DEPRECATED METHOD: "+h+`
`+l+` AT 
`;return function(){var u=new Error("get-stack-trace"),f=u&&u.stack?u.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",m=window.console&&(window.console.warn||window.console.log);return m&&m.call(window.console,c,f),s.apply(this,arguments)}}var Yy=Ys(function(s,h,l){for(var c=Object.keys(h),u=0;u<c.length;)(!l||l&&s[c[u]]===void 0)&&(s[c[u]]=h[c[u]]),u++;return s},"extend","Use `assign`."),RS=Ys(function(s,h){return Yy(s,h,!0)},"merge","Use `assign`.");function Xs(s,h,l){var c=h.prototype,u;u=s.prototype=Object.create(c),u.constructor=s,u._super=c,l&&no(u,l)}function Xy(s,h){return function(){return s.apply(h,arguments)}}var Zh=function(){var s=function(l,c){return c===void 0&&(c={}),new Ks(l,oi({recognizers:Qh.concat()},c))};return s.VERSION="2.0.17-rc",s.DIRECTION_ALL=Ls,s.DIRECTION_DOWN=cn,s.DIRECTION_LEFT=js,s.DIRECTION_RIGHT=dn,s.DIRECTION_UP=zs,s.DIRECTION_HORIZONTAL=gi,s.DIRECTION_VERTICAL=me,s.DIRECTION_NONE=Hh,s.DIRECTION_DOWN=cn,s.INPUT_START=_t,s.INPUT_MOVE=dr,s.INPUT_END=Re,s.INPUT_CANCEL=ae,s.STATE_POSSIBLE=Us,s.STATE_BEGAN=Ut,s.STATE_CHANGED=vn,s.STATE_ENDED=Et,s.STATE_RECOGNIZED=Fi,s.STATE_CANCELLED=gn,s.STATE_FAILED=Rt,s.Manager=Ks,s.Input=Nt,s.TouchAction=Ty,s.TouchInput=Ru,s.MouseInput=rt,s.PointerEventInput=Ry,s.TouchMouseInput=Fu,s.SingleTouchInput=Ky,s.Recognizer=Vs,s.AttrRecognizer=mn,s.Tap=Xh,s.Pan=Bu,s.Swipe=Ly,s.Pinch=Hy,s.Rotate=Wy,s.Press=qs,s.on=Hs,s.off=pn,s.each=Ri,s.merge=RS,s.extend=Yy,s.bindFn=Xy,s.assign=no,s.inherit=Xs,s.bindFn=Xy,s.prefixed=Ai,s.toArray=cr,s.inArray=uo,s.uniqueArray=Nu,s.splitStr=un,s.boolOrFn=Uh,s.hasParent=Cu,s.addEventListeners=Hs,s.removeEventListeners=pn,s.defaults=no({},ju,{preset:Qh}),s}(),Qy=Zh;function Jy(s,h){var l=typeof Ps<"u"&&$s(s)||s["@@iterator"];if(!l){if(bt(s)||(l=Zy(s))||h&&s&&typeof s.length=="number"){l&&(s=l);var c=0,u=function(){};return{s:u,n:function(){return c>=s.length?{done:!0}:{done:!1,value:s[c++]}},e:function(E){throw E},f:u}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f=!0,m=!1,b;return{s:function(){l=l.call(s)},n:function(){var E=l.next();return f=E.done,E},e:function(E){m=!0,b=E},f:function(){try{!f&&l.return!=null&&l.return()}finally{if(m)throw b}}}}function Zy(s,h){var l;if(s){if(typeof s=="string")return eb(s,h);var c=ks(l=Object.prototype.toString.call(s)).call(l,8,-1);if(c==="Object"&&s.constructor&&(c=s.constructor.name),c==="Map"||c==="Set")return io(s);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return eb(s,h)}}function eb(s,h){(h==null||h>s.length)&&(h=s.length);for(var l=0,c=new Array(h);l<h;l++)c[l]=s[l];return c}var el=Ps("DELETE");function tb(s){for(var h,l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];return ib.apply(void 0,kh(h=[{},s]).call(h,c))}function ib(){var s=Qs.apply(void 0,arguments);return po(s),s}function Qs(){for(var s=arguments.length,h=new Array(s),l=0;l<s;l++)h[l]=arguments[l];if(h.length<2)return h[0];if(h.length>2){var c;return Qs.apply(void 0,kh(c=[ib(h[0],h[1])]).call(c,dt(ks(h).call(h,2))))}var u=h[0],f=h[1];if(u instanceof Date&&f instanceof Date)return u.setTime(f.getTime()),u;var m=Jy(Dm(f)),b;try{for(m.s();!(b=m.n()).done;){var y=b.value;Object.prototype.propertyIsEnumerable.call(f,y)&&(f[y]===el?delete u[y]:u[y]!==null&&f[y]!==null&&typeof u[y]=="object"&&typeof f[y]=="object"&&!bt(u[y])&&!bt(f[y])?u[y]=Qs(u[y],f[y]):u[y]=zu(f[y]))}}catch(E){m.e(E)}finally{m.f()}return u}function zu(s){return bt(s)?kt(s).call(s,function(h){return zu(h)}):typeof s=="object"&&s!==null?s instanceof Date?new Date(s.getTime()):Qs({},s):s}function po(s){for(var h=0,l=nu(s);h<l.length;h++){var c=l[h];s[c]===el?delete s[c]:typeof s[c]=="object"&&s[c]!==null&&po(s[c])}}function tl(){var s=function(){};return{on:s,off:s,destroy:s,emit:s,get(){return{set:s}}}}var rb=typeof window<"u"?window.Hammer||Qy:function(){return tl()};function Vt(s){var h=this,l;this._cleanupQueue=[],this.active=!1,this._dom={container:s,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(function(){h._dom.overlay.parentNode.removeChild(h._dom.overlay)});var c=rb(this._dom.overlay);c.on("tap",qr(l=this._onTapOverlay).call(l,this)),this._cleanupQueue.push(function(){c.destroy()});var u=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];Di(u).call(u,function(f){c.on(f,function(m){m.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=function(f){ob(f.target,s)||h.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(function(){document.body.removeEventListener("click",h._onClick)})),this._escListener=function(f){("key"in f?f.key==="Escape":f.keyCode===27)&&h.deactivate()}}fS(Vt.prototype),Vt.current=null,Vt.prototype.destroy=function(){var s,h;this.deactivate();var l=Jy(xx(s=Qm(h=this._cleanupQueue).call(h,0)).call(s)),c;try{for(l.s();!(c=l.n()).done;){var u=c.value;u()}}catch(f){l.e(f)}finally{l.f()}},Vt.prototype.activate=function(){Vt.current&&Vt.current.deactivate(),Vt.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},Vt.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},Vt.prototype._onTapOverlay=function(s){this.activate(),s.srcEvent.stopPropagation()};function ob(s,h){for(;s;){if(s===h)return!0;s=s.parentNode}return!1}var fo=Ma,qt=To,ur=TypeError,Bi=function(s){if(fo(s))return s;throw new ur(qt(s)+" is not a constructor")},il=X,Js=ht,ve=yr,Lu=er,Hu=Bi,nb=V,sb=Ke,FS=kr,Wu=he,Uu=Js("Reflect","construct"),Vu=Object.prototype,BS=[].push,ab=Wu(function(){function s(){}return!(Uu(function(){},[],s)instanceof s)}),hb=!Wu(function(){Uu(function(){})}),qu=ab||hb;il({target:"Reflect",stat:!0,forced:qu,sham:qu},{construct:function(h,l){Hu(h),nb(l);var c=arguments.length<3?h:Hu(arguments[2]);if(hb&&!ab)return Uu(h,l,c);if(h===c){switch(l.length){case 0:return new h;case 1:return new h(l[0]);case 2:return new h(l[0],l[1]);case 3:return new h(l[0],l[1],l[2]);case 4:return new h(l[0],l[1],l[2],l[3])}var u=[null];return ve(BS,u,l),new(ve(Lu,h,u))}var f=c.prototype,m=FS(sb(f)?f:Vu),b=ve(h,m,l);return sb(b)?b:m}});var jS=le,zS=jS.Reflect.construct,lb=zS,LS=lb,HS=LS,ji=A(HS),WS=le,US=WS.Object.getOwnPropertySymbols,db=US,VS=db,cb=VS,rl=A(cb),ub={exports:{}},qS=X,pb=he,GS=ne,Gu=Je.f,Ku=Ue,pr=!Ku||pb(function(){Gu(1)});qS({target:"Object",stat:!0,forced:pr,sham:!Ku},{getOwnPropertyDescriptor:function(h,l){return Gu(GS(h),l)}});var fb=le,vb=fb.Object,KS=ub.exports=function(h,l){return vb.getOwnPropertyDescriptor(h,l)};vb.getOwnPropertyDescriptor.sham&&(KS.sham=!0);var YS=ub.exports,XS=YS,gb=XS,QS=gb,mb=A(QS),JS=X,Yu=Ue,ZS=hn,yn=ne,eT=Je,tT=Ao;JS({target:"Object",stat:!0,sham:!Yu},{getOwnPropertyDescriptors:function(h){for(var l=yn(h),c=eT.f,u=ZS(l),f={},m=0,b,y;u.length>m;)y=c(l,b=u[m++]),y!==void 0&&tT(f,b,y);return f}});var iT=le,rT=iT.Object.getOwnPropertyDescriptors,oT=rT,yb=oT,nT=yb,bb=A(nT),wb={exports:{}},sT=X,aT=Ue,_b=Na.f;sT({target:"Object",stat:!0,forced:Object.defineProperties!==_b,sham:!aT},{defineProperties:_b});var Xu=le,Eb=Xu.Object,Ob=wb.exports=function(h,l){return Eb.defineProperties(h,l)};Eb.defineProperties.sham&&(Ob.sham=!0);var xb=wb.exports,hT=xb,lT=hT,dT=lT,cT=A(dT),uT=Hp,Sb=A(uT);function vo(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}var pT=wu,Tb=pT,fT=Tb,Ib=fT,$b=Ib,vT=A($b),gT=X,B=$v;gT({target:"Object",stat:!0},{setPrototypeOf:B});var R=le,D=R.Object.setPrototypeOf,Zs=D,q=Zs,Qu=q,Ju=Qu,Cb=Ju,Zu=Cb,ep=Zu,tp=A(ep),mT=yg,yT=mT,U=yT,bT=U,r=bT,e=A(r);function t(s,h){var l;return t=tp?e(l=tp).call(l):function(u,f){return u.__proto__=f,u},t(s,h)}function i(s,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=vT(h&&h.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Ca(s,"prototype",{writable:!1}),h&&t(s,h)}function o(s,h){if(h&&(Zi(h)==="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vo(s)}var n=Yx,a=n,d=a,p=d,v=p,g=A(v);function w(s){var h;return w=tp?e(h=g).call(h):function(c){return c.__proto__||g(c)},w(s)}var _={exports:{}},O={exports:{}};(function(s){var h=fs,l=og;function c(u){"@babel/helpers - typeof";return s.exports=c=typeof h=="function"&&typeof l=="symbol"?function(f){return typeof f}:function(f){return f&&typeof h=="function"&&f.constructor===h&&f!==h.prototype?"symbol":typeof f},s.exports.__esModule=!0,s.exports.default=s.exports,c(u)}s.exports=c,s.exports.__esModule=!0,s.exports.default=s.exports})(O);var $=O.exports,P=Bm,C=P,I=C,M=I,L=M,W=Ae,Y=hn,pe=Je,He=$t,ct=function(s,h,l){for(var c=Y(h),u=He.f,f=pe.f,m=0;m<c.length;m++){var b=c[m];!W(s,b)&&!(l&&W(l,b))&&u(s,b,f(h,b))}},Xe=Ke,bn=Ei,fr=function(s,h){Xe(h)&&"cause"in h&&bn(s,"cause",h.cause)},qe=_e,fe=Error,Te=qe("".replace),Fe=function(s){return String(new fe(s).stack)}("zxcasd"),ut=/\n\s*at [^:]*:[^\n]*/,ni=ut.test(Fe),wn=function(s,h){if(ni&&typeof s=="string"&&!fe.prepareStackTrace)for(;h--;)s=Te(s,ut,"");return s},ea=he,J$=bi,Z$=!ea(function(){var s=new Error("a");return"stack"in s?(Object.defineProperty(s,"stack",J$(1,7)),s.stack!==7):!0}),eC=Ei,tC=wn,iC=Z$,yI=Error.captureStackTrace,rC=function(s,h,l,c){iC&&(yI?yI(s,h):eC(s,"stack",tC(l,c)))},oC=Wi,nC=Oe,sC=V,aC=To,hC=Fc,lC=Mt,bI=$e,dC=xh,cC=Zo,wI=Eh,uC=TypeError,Pb=function(s,h){this.stopped=s,this.result=h},_I=Pb.prototype,ta=function(s,h,l){var c=l&&l.that,u=!!(l&&l.AS_ENTRIES),f=!!(l&&l.IS_RECORD),m=!!(l&&l.IS_ITERATOR),b=!!(l&&l.INTERRUPTED),y=oC(h,c),E,x,T,S,k,z,J,Z=function(oe){return E&&wI(E,"normal",oe),new Pb(!0,oe)},te=function(oe){return u?(sC(oe),b?y(oe[0],oe[1],Z):y(oe[0],oe[1])):b?y(oe,Z):y(oe)};if(f)E=s.iterator;else if(m)E=s;else{if(x=cC(s),!x)throw new uC(aC(s)+" is not iterable");if(hC(x)){for(T=0,S=lC(s);S>T;T++)if(k=te(s[T]),k&&bI(_I,k))return k;return new Pb(!1)}E=dC(s,x)}for(z=f?s.next:E.next;!(J=nC(z,E)).done;){try{k=te(J.value)}catch(oe){wI(E,"throw",oe)}if(typeof k=="object"&&k&&bI(_I,k))return k}return new Pb(!1)},pC=Ui,fC=function(s,h){return s===void 0?arguments.length<2?"":h:pC(s)},vC=X,gC=$e,mC=ih,kb=$v,yC=ct,EI=kr,wT=Ei,_T=bi,bC=fr,wC=rC,_C=ta,EC=fC,OC=xe,xC=OC("toStringTag"),Db=Error,SC=[].push,ol=function(h,l){var c=gC(ET,this),u;kb?u=kb(new Db,c?mC(this):ET):(u=c?this:EI(ET),wT(u,xC,"Error")),l!==void 0&&wT(u,"message",EC(l)),wC(u,ol,u.stack,1),arguments.length>2&&bC(u,arguments[2]);var f=[];return _C(h,SC,{that:f}),wT(u,"errors",f),u};kb?kb(ol,Db):yC(ol,Db,{name:!0});var ET=ol.prototype=EI(Db.prototype,{constructor:_T(1,ol),message:_T(1,""),name:_T(1,"AggregateError")});vC({global:!0,constructor:!0,arity:2},{AggregateError:ol});var TC=ht,IC=hd,$C=xe,CC=Ue,OI=$C("species"),xI=function(s){var h=TC(s);CC&&h&&!h[OI]&&IC(h,OI,{configurable:!0,get:function(){return this}})},PC=$e,kC=TypeError,OT=function(s,h){if(PC(h,s))return s;throw new kC("Incorrect invocation")},SI=V,DC=Bi,MC=Eo,AC=xe,NC=AC("species"),TI=function(s,h){var l=SI(s).constructor,c;return l===void 0||MC(c=SI(l)[NC])?h:DC(c)},RC=wi,II=/(?:ipad|iphone|ipod).*applewebkit/i.test(RC),si=G,FC=yr,BC=Wi,$I=Ee,jC=Ae,CI=he,PI=td,zC=us,kI=kl,LC=py,HC=II,WC=ms,xT=si.setImmediate,ST=si.clearImmediate,UC=si.process,TT=si.Dispatch,VC=si.Function,DI=si.MessageChannel,qC=si.String,IT=0,ip={},MI="onreadystatechange",rp,ia,$T,CT;CI(function(){rp=si.location});var PT=function(s){if(jC(ip,s)){var h=ip[s];delete ip[s],h()}},kT=function(s){return function(){PT(s)}},AI=function(s){PT(s.data)},NI=function(s){si.postMessage(qC(s),rp.protocol+"//"+rp.host)};(!xT||!ST)&&(xT=function(h){LC(arguments.length,1);var l=$I(h)?h:VC(h),c=zC(arguments,1);return ip[++IT]=function(){FC(l,void 0,c)},ia(IT),IT},ST=function(h){delete ip[h]},WC?ia=function(s){UC.nextTick(kT(s))}:TT&&TT.now?ia=function(s){TT.now(kT(s))}:DI&&!HC?($T=new DI,CT=$T.port2,$T.port1.onmessage=AI,ia=BC(CT.postMessage,CT)):si.addEventListener&&$I(si.postMessage)&&!si.importScripts&&rp&&rp.protocol!=="file:"&&!CI(NI)?(ia=NI,si.addEventListener("message",AI,!1)):MI in kI("script")?ia=function(s){PI.appendChild(kI("script"))[MI]=function(){PI.removeChild(this),PT(s)}}:ia=function(s){setTimeout(kT(s),0)});var RI={set:xT,clear:ST},FI=function(){this.head=null,this.tail=null};FI.prototype={add:function(s){var h={item:s,next:null},l=this.tail;l?l.next=h:this.head=h,this.tail=h},get:function(){var s=this.head;if(s){var h=this.head=s.next;return h===null&&(this.tail=null),s.item}}};var BI=FI,GC=wi,KC=/ipad|iphone|ipod/i.test(GC)&&typeof Pebble<"u",YC=wi,XC=/web0s(?!.*chrome)/i.test(YC),ra=G,jI=Wi,QC=Je.f,DT=RI.set,JC=BI,ZC=II,eP=KC,tP=XC,MT=ms,zI=ra.MutationObserver||ra.WebKitMutationObserver,LI=ra.document,HI=ra.process,Mb=ra.Promise,WI=QC(ra,"queueMicrotask"),AT=WI&&WI.value,nl,NT,RT,Ab,UI;if(!AT){var Nb=new JC,Rb=function(){var s,h;for(MT&&(s=HI.domain)&&s.exit();h=Nb.get();)try{h()}catch(l){throw Nb.head&&nl(),l}s&&s.enter()};!ZC&&!MT&&!tP&&zI&&LI?(NT=!0,RT=LI.createTextNode(""),new zI(Rb).observe(RT,{characterData:!0}),nl=function(){RT.data=NT=!NT}):!eP&&Mb&&Mb.resolve?(Ab=Mb.resolve(void 0),Ab.constructor=Mb,UI=jI(Ab.then,Ab),nl=function(){UI(Rb)}):MT?nl=function(){HI.nextTick(Rb)}:(DT=jI(DT,ra),nl=function(){DT(Rb)}),AT=function(s){Nb.head||nl(),Nb.add(s)}}var iP=AT,rP=function(s,h){try{arguments.length===1?console.error(s):console.error(s,h)}catch{}},sl=function(s){try{return{error:!1,value:s()}}catch(h){return{error:!0,value:h}}},oP=G,al=oP.Promise,VI=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",nP=VI,sP=ms,aP=!nP&&!sP&&typeof window=="object"&&typeof document=="object",hP=G,op=al,lP=Ee,dP=Rp,cP=rf,uP=xe,pP=aP,fP=VI,FT=Oo,qI=op&&op.prototype,vP=uP("species"),BT=!1,GI=lP(hP.PromiseRejectionEvent),gP=dP("Promise",function(){var s=cP(op),h=s!==String(op);if(!h&&FT===66||!(qI.catch&&qI.finally))return!0;if(!FT||FT<51||!/native code/.test(s)){var l=new op(function(f){f(1)}),c=function(f){f(function(){},function(){})},u=l.constructor={};if(u[vP]=c,BT=l.then(function(){})instanceof c,!BT)return!0}return!h&&(pP||fP)&&!GI}),np={CONSTRUCTOR:gP,REJECTION_EVENT:GI,SUBCLASSING:BT},vr={},KI=St,mP=TypeError,yP=function(s){var h,l;this.promise=new s(function(c,u){if(h!==void 0||l!==void 0)throw new mP("Bad Promise constructor");h=c,l=u}),this.resolve=KI(h),this.reject=KI(l)};vr.f=function(s){return new yP(s)};var bP=X,Fb=ms,_n=G,sp=Oe,wP=Bo,_P=Nr,EP=xI,OP=St,jT=Ee,xP=Ke,SP=OT,TP=TI,YI=RI.set,zT=iP,IP=rP,$P=sl,CP=BI,XI=Br,LT=al,HT=np,QI=vr,Bb="Promise",JI=HT.CONSTRUCTOR,PP=HT.REJECTION_EVENT;HT.SUBCLASSING;var WT=XI.getterFor(Bb),kP=XI.set,DP=LT&&LT.prototype,hl=LT,UT=DP,ZI=_n.TypeError,VT=_n.document,qT=_n.process,GT=QI.f,MP=GT,AP=!!(VT&&VT.createEvent&&_n.dispatchEvent),e$="unhandledrejection",NP="rejectionhandled",t$=0,i$=1,RP=2,KT=1,r$=2,jb,o$,FP,n$=function(s){var h;return xP(s)&&jT(h=s.then)?h:!1},s$=function(s,h){var l=h.value,c=h.state===i$,u=c?s.ok:s.fail,f=s.resolve,m=s.reject,b=s.domain,y,E,x;try{u?(c||(h.rejection===r$&&jP(h),h.rejection=KT),u===!0?y=l:(b&&b.enter(),y=u(l),b&&(b.exit(),x=!0)),y===s.promise?m(new ZI("Promise-chain cycle")):(E=n$(y))?sp(E,y,f,m):f(y)):m(l)}catch(T){b&&!x&&b.exit(),m(T)}},a$=function(s,h){s.notified||(s.notified=!0,zT(function(){for(var l=s.reactions,c;c=l.get();)s$(c,s);s.notified=!1,h&&!s.rejection&&BP(s)}))},h$=function(s,h,l){var c,u;AP?(c=VT.createEvent("Event"),c.promise=h,c.reason=l,c.initEvent(s,!1,!0),_n.dispatchEvent(c)):c={promise:h,reason:l},!PP&&(u=_n["on"+s])?u(c):s===e$&&IP("Unhandled promise rejection",l)},BP=function(s){sp(YI,_n,function(){var h=s.facade,l=s.value,c=l$(s),u;if(c&&(u=$P(function(){Fb?qT.emit("unhandledRejection",l,h):h$(e$,h,l)}),s.rejection=Fb||l$(s)?r$:KT,u.error))throw u.value})},l$=function(s){return s.rejection!==KT&&!s.parent},jP=function(s){sp(YI,_n,function(){var h=s.facade;Fb?qT.emit("rejectionHandled",h):h$(NP,h,s.value)})},ll=function(s,h,l){return function(c){s(h,c,l)}},dl=function(s,h,l){s.done||(s.done=!0,l&&(s=l),s.value=h,s.state=RP,a$(s,!0))},YT=function(s,h,l){if(!s.done){s.done=!0,l&&(s=l);try{if(s.facade===h)throw new ZI("Promise can't be resolved itself");var c=n$(h);c?zT(function(){var u={done:!1};try{sp(c,h,ll(YT,u,s),ll(dl,u,s))}catch(f){dl(u,f,s)}}):(s.value=h,s.state=i$,a$(s,!1))}catch(u){dl({done:!1},u,s)}}};JI&&(hl=function(h){SP(this,UT),OP(h),sp(jb,this);var l=WT(this);try{h(ll(YT,l),ll(dl,l))}catch(c){dl(l,c)}},UT=hl.prototype,jb=function(h){kP(this,{type:Bb,done:!1,notified:!1,parent:!1,reactions:new CP,rejection:!1,state:t$,value:void 0})},jb.prototype=wP(UT,"then",function(h,l){var c=WT(this),u=GT(TP(this,hl));return c.parent=!0,u.ok=jT(h)?h:!0,u.fail=jT(l)&&l,u.domain=Fb?qT.domain:void 0,c.state===t$?c.reactions.add(u):zT(function(){s$(u,c)}),u.promise}),o$=function(){var s=new jb,h=WT(s);this.promise=s,this.resolve=ll(YT,h),this.reject=ll(dl,h)},QI.f=GT=function(s){return s===hl||s===FP?new o$(s):MP(s)}),bP({global:!0,constructor:!0,wrap:!0,forced:JI},{Promise:hl}),_P(hl,Bb,!1,!0),EP(Bb);var zP=al,LP=im,HP=np.CONSTRUCTOR,zb=HP||!LP(function(s){zP.all(s).then(void 0,function(){})}),WP=X,UP=Oe,VP=St,qP=vr,GP=sl,KP=ta,YP=zb;WP({target:"Promise",stat:!0,forced:YP},{all:function(h){var l=this,c=qP.f(l),u=c.resolve,f=c.reject,m=GP(function(){var b=VP(l.resolve),y=[],E=0,x=1;KP(h,function(T){var S=E++,k=!1;x++,UP(b,l,T).then(function(z){k||(k=!0,y[S]=z,--x||u(y))},f)}),--x||u(y)});return m.error&&f(m.value),c.promise}});var XP=X,QP=np.CONSTRUCTOR,d$=al;d$&&d$.prototype,XP({target:"Promise",proto:!0,forced:QP,real:!0},{catch:function(s){return this.then(void 0,s)}});var JP=X,ZP=Oe,ek=St,tk=vr,ik=sl,rk=ta,ok=zb;JP({target:"Promise",stat:!0,forced:ok},{race:function(h){var l=this,c=tk.f(l),u=c.reject,f=ik(function(){var m=ek(l.resolve);rk(h,function(b){ZP(m,l,b).then(c.resolve,u)})});return f.error&&u(f.value),c.promise}});var nk=X,sk=Oe,ak=vr,hk=np.CONSTRUCTOR;nk({target:"Promise",stat:!0,forced:hk},{reject:function(h){var l=ak.f(this);return sk(l.reject,void 0,h),l.promise}});var lk=V,dk=Ke,ck=vr,c$=function(s,h){if(lk(s),dk(h)&&h.constructor===s)return h;var l=ck.f(s),c=l.resolve;return c(h),l.promise},uk=X,pk=ht,fk=Ze,vk=al,gk=np.CONSTRUCTOR,mk=c$,yk=pk("Promise"),bk=!gk;uk({target:"Promise",stat:!0,forced:fk},{resolve:function(h){return mk(bk&&this===yk?vk:this,h)}});var wk=X,_k=Oe,Ek=St,Ok=vr,xk=sl,Sk=ta,Tk=zb;wk({target:"Promise",stat:!0,forced:Tk},{allSettled:function(h){var l=this,c=Ok.f(l),u=c.resolve,f=c.reject,m=xk(function(){var b=Ek(l.resolve),y=[],E=0,x=1;Sk(h,function(T){var S=E++,k=!1;x++,_k(b,l,T).then(function(z){k||(k=!0,y[S]={status:"fulfilled",value:z},--x||u(y))},function(z){k||(k=!0,y[S]={status:"rejected",reason:z},--x||u(y))})}),--x||u(y)});return m.error&&f(m.value),c.promise}});var Ik=X,$k=Oe,Ck=St,Pk=ht,kk=vr,Dk=sl,Mk=ta,Ak=zb,u$="No one promise resolved";Ik({target:"Promise",stat:!0,forced:Ak},{any:function(h){var l=this,c=Pk("AggregateError"),u=kk.f(l),f=u.resolve,m=u.reject,b=Dk(function(){var y=Ck(l.resolve),E=[],x=0,T=1,S=!1;Mk(h,function(k){var z=x++,J=!1;T++,$k(y,l,k).then(function(Z){J||S||(S=!0,f(Z))},function(Z){J||S||(J=!0,E[z]=Z,--T||m(new c(E,u$)))})}),--T||m(new c(E,u$))});return b.error&&m(b.value),u.promise}});var Nk=X,XT=al,Rk=he,Fk=ht,Bk=Ee,jk=TI,p$=c$,zk=XT&&XT.prototype,Lk=!!XT&&Rk(function(){zk.finally.call({then:function(){}},function(){})});Nk({target:"Promise",proto:!0,real:!0,forced:Lk},{finally:function(s){var h=jk(this,Fk("Promise")),l=Bk(s);return this.then(l?function(c){return p$(h,s()).then(function(){return c})}:s,l?function(c){return p$(h,s()).then(function(){throw c})}:s)}});var Hk=le,Wk=Hk.Promise,Uk=Wk,Vk=Uk,qk=X,Gk=vr;qk({target:"Promise",stat:!0},{withResolvers:function(){var h=Gk.f(this);return{promise:h.promise,resolve:h.resolve,reject:h.reject}}});var Kk=Vk,Yk=Kk,Xk=X,Qk=vr,Jk=sl;Xk({target:"Promise",stat:!0,forced:!0},{try:function(s){var h=Qk.f(this),l=Jk(s);return(l.error?h.reject:h.resolve)(l.value),h.promise}});var Zk=Yk,eD=Zk,tD=eD,iD=Um,rD=iD,oD=rD,nD=oD,sD=nD;(function(s){var h=$.default,l=Up,c=fs,u=$b,f=v,m=L,b=an,y=ep,E=tD,x=sD,T=xm;function S(){s.exports=S=function(){return z},s.exports.__esModule=!0,s.exports.default=s.exports;var k,z={},J=Object.prototype,Z=J.hasOwnProperty,te=l||function(H,F,j){H[F]=j.value},oe=typeof c=="function"?c:{},ot=oe.iterator||"@@iterator",Be=oe.asyncIterator||"@@asyncIterator",xt=oe.toStringTag||"@@toStringTag";function je(H,F,j){return l(H,F,{value:j,enumerable:!0,configurable:!0,writable:!0}),H[F]}try{je({},"")}catch{je=function(j,K,ie){return j[K]=ie}}function mo(H,F,j,K){var ie=F&&F.prototype instanceof ul?F:ul,ee=u(ie.prototype),Ge=new gI(K||[]);return te(ee,"_invoke",{value:fN(H,j,Ge)}),ee}function ai(H,F,j){try{return{type:"normal",arg:H.call(F,j)}}catch(K){return{type:"throw",arg:K}}}z.wrap=mo;var On="suspendedStart",cl="suspendedYield",xn="executing",mr="completed",mi={};function ul(){}function qb(){}function sa(){}var pI={};je(pI,ot,function(){return this});var fI=f,Gb=fI&&fI(fI(mI([])));Gb&&Gb!==J&&Z.call(Gb,ot)&&(pI=Gb);var pl=sa.prototype=ul.prototype=u(pI);function Y$(H){var F;m(F=["next","throw","return"]).call(F,function(j){je(H,j,function(K){return this._invoke(j,K)})})}function Kb(H,F){function j(ie,ee,Ge,Ft){var Kt=ai(H[ie],H,ee);if(Kt.type!=="throw"){var aa=Kt.arg,Sn=aa.value;return Sn&&h(Sn)=="object"&&Z.call(Sn,"__await")?F.resolve(Sn.__await).then(function(ha){j("next",ha,Ge,Ft)},function(ha){j("throw",ha,Ge,Ft)}):F.resolve(Sn).then(function(ha){aa.value=ha,Ge(aa)},function(ha){return j("throw",ha,Ge,Ft)})}Ft(Kt.arg)}var K;te(this,"_invoke",{value:function(ee,Ge){function Ft(){return new F(function(Kt,aa){j(ee,Ge,Kt,aa)})}return K=K?K.then(Ft,Ft):Ft()}})}function fN(H,F,j){var K=On;return function(ie,ee){if(K===xn)throw new Error("Generator is already running");if(K===mr){if(ie==="throw")throw ee;return{value:k,done:!0}}for(j.method=ie,j.arg=ee;;){var Ge=j.delegate;if(Ge){var Ft=X$(Ge,j);if(Ft){if(Ft===mi)continue;return Ft}}if(j.method==="next")j.sent=j._sent=j.arg;else if(j.method==="throw"){if(K===On)throw K=mr,j.arg;j.dispatchException(j.arg)}else j.method==="return"&&j.abrupt("return",j.arg);K=xn;var Kt=ai(H,F,j);if(Kt.type==="normal"){if(K=j.done?mr:cl,Kt.arg===mi)continue;return{value:Kt.arg,done:j.done}}Kt.type==="throw"&&(K=mr,j.method="throw",j.arg=Kt.arg)}}}function X$(H,F){var j=F.method,K=H.iterator[j];if(K===k)return F.delegate=null,j==="throw"&&H.iterator.return&&(F.method="return",F.arg=k,X$(H,F),F.method==="throw")||j!=="return"&&(F.method="throw",F.arg=new TypeError("The iterator does not provide a '"+j+"' method")),mi;var ie=ai(K,H.iterator,F.arg);if(ie.type==="throw")return F.method="throw",F.arg=ie.arg,F.delegate=null,mi;var ee=ie.arg;return ee?ee.done?(F[H.resultName]=ee.value,F.next=H.nextLoc,F.method!=="return"&&(F.method="next",F.arg=k),F.delegate=null,mi):ee:(F.method="throw",F.arg=new TypeError("iterator result is not an object"),F.delegate=null,mi)}function vN(H){var F,j={tryLoc:H[0]};1 in H&&(j.catchLoc=H[1]),2 in H&&(j.finallyLoc=H[2],j.afterLoc=H[3]),b(F=this.tryEntries).call(F,j)}function vI(H){var F=H.completion||{};F.type="normal",delete F.arg,H.completion=F}function gI(H){this.tryEntries=[{tryLoc:"root"}],m(H).call(H,vN,this),this.reset(!0)}function mI(H){if(H||H===""){var F=H[ot];if(F)return F.call(H);if(typeof H.next=="function")return H;if(!isNaN(H.length)){var j=-1,K=function ie(){for(;++j<H.length;)if(Z.call(H,j))return ie.value=H[j],ie.done=!1,ie;return ie.value=k,ie.done=!0,ie};return K.next=K}}throw new TypeError(h(H)+" is not iterable")}return qb.prototype=sa,te(pl,"constructor",{value:sa,configurable:!0}),te(sa,"constructor",{value:qb,configurable:!0}),qb.displayName=je(sa,xt,"GeneratorFunction"),z.isGeneratorFunction=function(H){var F=typeof H=="function"&&H.constructor;return!!F&&(F===qb||(F.displayName||F.name)==="GeneratorFunction")},z.mark=function(H){return y?y(H,sa):(H.__proto__=sa,je(H,xt,"GeneratorFunction")),H.prototype=u(pl),H},z.awrap=function(H){return{__await:H}},Y$(Kb.prototype),je(Kb.prototype,Be,function(){return this}),z.AsyncIterator=Kb,z.async=function(H,F,j,K,ie){ie===void 0&&(ie=E);var ee=new Kb(mo(H,F,j,K),ie);return z.isGeneratorFunction(F)?ee:ee.next().then(function(Ge){return Ge.done?Ge.value:ee.next()})},Y$(pl),je(pl,xt,"Generator"),je(pl,ot,function(){return this}),je(pl,"toString",function(){return"[object Generator]"}),z.keys=function(H){var F=Object(H),j=[];for(var K in F)b(j).call(j,K);return x(j).call(j),function ie(){for(;j.length;){var ee=j.pop();if(ee in F)return ie.value=ee,ie.done=!1,ie}return ie.done=!0,ie}},z.values=mI,gI.prototype={constructor:gI,reset:function(F){var j;if(this.prev=0,this.next=0,this.sent=this._sent=k,this.done=!1,this.delegate=null,this.method="next",this.arg=k,m(j=this.tryEntries).call(j,vI),!F)for(var K in this)K.charAt(0)==="t"&&Z.call(this,K)&&!isNaN(+T(K).call(K,1))&&(this[K]=k)},stop:function(){this.done=!0;var F=this.tryEntries[0].completion;if(F.type==="throw")throw F.arg;return this.rval},dispatchException:function(F){if(this.done)throw F;var j=this;function K(aa,Sn){return Ge.type="throw",Ge.arg=F,j.next=aa,Sn&&(j.method="next",j.arg=k),!!Sn}for(var ie=this.tryEntries.length-1;ie>=0;--ie){var ee=this.tryEntries[ie],Ge=ee.completion;if(ee.tryLoc==="root")return K("end");if(ee.tryLoc<=this.prev){var Ft=Z.call(ee,"catchLoc"),Kt=Z.call(ee,"finallyLoc");if(Ft&&Kt){if(this.prev<ee.catchLoc)return K(ee.catchLoc,!0);if(this.prev<ee.finallyLoc)return K(ee.finallyLoc)}else if(Ft){if(this.prev<ee.catchLoc)return K(ee.catchLoc,!0)}else{if(!Kt)throw new Error("try statement without catch or finally");if(this.prev<ee.finallyLoc)return K(ee.finallyLoc)}}}},abrupt:function(F,j){for(var K=this.tryEntries.length-1;K>=0;--K){var ie=this.tryEntries[K];if(ie.tryLoc<=this.prev&&Z.call(ie,"finallyLoc")&&this.prev<ie.finallyLoc){var ee=ie;break}}ee&&(F==="break"||F==="continue")&&ee.tryLoc<=j&&j<=ee.finallyLoc&&(ee=null);var Ge=ee?ee.completion:{};return Ge.type=F,Ge.arg=j,ee?(this.method="next",this.next=ee.finallyLoc,mi):this.complete(Ge)},complete:function(F,j){if(F.type==="throw")throw F.arg;return F.type==="break"||F.type==="continue"?this.next=F.arg:F.type==="return"?(this.rval=this.arg=F.arg,this.method="return",this.next="end"):F.type==="normal"&&j&&(this.next=j),mi},finish:function(F){for(var j=this.tryEntries.length-1;j>=0;--j){var K=this.tryEntries[j];if(K.finallyLoc===F)return this.complete(K.completion,K.afterLoc),vI(K),mi}},catch:function(F){for(var j=this.tryEntries.length-1;j>=0;--j){var K=this.tryEntries[j];if(K.tryLoc===F){var ie=K.completion;if(ie.type==="throw"){var ee=ie.arg;vI(K)}return ee}}throw new Error("illegal catch attempt")},delegateYield:function(F,j,K){return this.delegate={iterator:mI(F),resultName:j,nextLoc:K},this.method==="next"&&(this.arg=k),mi}},z}s.exports=S,s.exports.__esModule=!0,s.exports.default=s.exports})(_);var aD=_.exports,Lb=aD(),hD=Lb;try{regeneratorRuntime=Lb}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Lb:Function("r","regeneratorRuntime = r")(Lb)}var Gt=A(hD),f$={exports:{}},lD=he,dD=lD(function(){if(typeof ArrayBuffer=="function"){var s=new ArrayBuffer(8);Object.isExtensible(s)&&Object.defineProperty(s,"a",{value:8})}}),cD=he,uD=Ke,pD=zi,v$=dD,Hb=Object.isExtensible,fD=cD(function(){Hb(1)}),vD=fD||v$?function(h){return!uD(h)||v$&&pD(h)==="ArrayBuffer"?!1:Hb?Hb(h):!0}:Hb,gD=he,mD=!gD(function(){return Object.isExtensible(Object.preventExtensions({}))}),yD=X,bD=_e,wD=qn,_D=Ke,QT=Ae,ED=$t.f,g$=Dr,OD=Mr,JT=vD,xD=Ea,SD=mD,m$=!1,go=xD("meta"),TD=0,ZT=function(s){ED(s,go,{value:{objectID:"O"+TD++,weakData:{}}})},ID=function(s,h){if(!_D(s))return typeof s=="symbol"?s:(typeof s=="string"?"S":"P")+s;if(!QT(s,go)){if(!JT(s))return"F";if(!h)return"E";ZT(s)}return s[go].objectID},$D=function(s,h){if(!QT(s,go)){if(!JT(s))return!0;if(!h)return!1;ZT(s)}return s[go].weakData},CD=function(s){return SD&&m$&&JT(s)&&!QT(s,go)&&ZT(s),s},PD=function(){kD.enable=function(){},m$=!0;var s=g$.f,h=bD([].splice),l={};l[go]=1,s(l).length&&(g$.f=function(c){for(var u=s(c),f=0,m=u.length;f<m;f++)if(u[f]===go){h(u,f,1);break}return u},yD({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:OD.f}))},kD=f$.exports={enable:PD,fastKey:ID,getWeakData:$D,onFreeze:CD};wD[go]=!0;var y$=f$.exports,DD=X,MD=G,AD=y$,ND=he,RD=Ei,FD=ta,BD=OT,jD=Ee,zD=Ke,LD=Eo,HD=Nr,WD=$t.f,UD=jr.forEach,VD=Ue,b$=Br,qD=b$.set,GD=b$.getterFor,w$=function(s,h,l){var c=s.indexOf("Map")!==-1,u=s.indexOf("Weak")!==-1,f=c?"set":"add",m=MD[s],b=m&&m.prototype,y={},E;if(!VD||!jD(m)||!(u||b.forEach&&!ND(function(){new m().entries().next()})))E=l.getConstructor(h,s,c,f),AD.enable();else{E=h(function(S,k){qD(BD(S,x),{type:s,collection:new m}),LD(k)||FD(k,S[f],{that:S,AS_ENTRIES:c})});var x=E.prototype,T=GD(s);UD(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(S){var k=S==="add"||S==="set";S in b&&!(u&&S==="clear")&&RD(x,S,function(z,J){var Z=T(this).collection;if(!k&&u&&!zD(z))return S==="get"?void 0:!1;var te=Z[S](z===0?0:z,J);return k?this:te})}),u||WD(x,"size",{configurable:!0,get:function(){return T(this).collection.size}})}return HD(E,s,!1,!0),y[s]=E,DD({global:!0,forced:!0},y),u||l.setStrong(E,s,c),E},KD=Bo,YD=function(s,h,l){for(var c in h)l&&l.unsafe&&s[c]?s[c]=h[c]:KD(s,c,h[c],l);return s},XD=kr,QD=hd,_$=YD,JD=Wi,ZD=OT,eM=Eo,tM=ta,iM=lc,Wb=ue,rM=xI,ap=Ue,E$=y$.fastKey,O$=Br,x$=O$.set,eI=O$.getterFor,S$={getConstructor:function(s,h,l,c){var u=s(function(E,x){ZD(E,f),x$(E,{type:h,index:XD(null),first:void 0,last:void 0,size:0}),ap||(E.size=0),eM(x)||tM(x,E[c],{that:E,AS_ENTRIES:l})}),f=u.prototype,m=eI(h),b=function(E,x,T){var S=m(E),k=y(E,x),z,J;return k?k.value=T:(S.last=k={index:J=E$(x,!0),key:x,value:T,previous:z=S.last,next:void 0,removed:!1},S.first||(S.first=k),z&&(z.next=k),ap?S.size++:E.size++,J!=="F"&&(S.index[J]=k)),E},y=function(E,x){var T=m(E),S=E$(x),k;if(S!=="F")return T.index[S];for(k=T.first;k;k=k.next)if(k.key===x)return k};return _$(f,{clear:function(){for(var x=this,T=m(x),S=T.index,k=T.first;k;)k.removed=!0,k.previous&&(k.previous=k.previous.next=void 0),delete S[k.index],k=k.next;T.first=T.last=void 0,ap?T.size=0:x.size=0},delete:function(E){var x=this,T=m(x),S=y(x,E);if(S){var k=S.next,z=S.previous;delete T.index[S.index],S.removed=!0,z&&(z.next=k),k&&(k.previous=z),T.first===S&&(T.first=k),T.last===S&&(T.last=z),ap?T.size--:x.size--}return!!S},forEach:function(x){for(var T=m(this),S=JD(x,arguments.length>1?arguments[1]:void 0),k;k=k?k.next:T.first;)for(S(k.value,k.key,this);k&&k.removed;)k=k.previous},has:function(x){return!!y(this,x)}}),_$(f,l?{get:function(x){var T=y(this,x);return T&&T.value},set:function(x,T){return b(this,x===0?0:x,T)}}:{add:function(x){return b(this,x=x===0?0:x,x)}}),ap&&QD(f,"size",{configurable:!0,get:function(){return m(this).size}}),u},setStrong:function(s,h,l){var c=h+" Iterator",u=eI(h),f=eI(c);iM(s,h,function(m,b){x$(this,{type:c,target:m,state:u(m),kind:b,last:void 0})},function(){for(var m=f(this),b=m.kind,y=m.last;y&&y.removed;)y=y.previous;return!m.target||!(m.last=y=y?y.next:m.state.first)?(m.target=void 0,Wb(void 0,!0)):Wb(b==="keys"?y.key:b==="values"?y.value:[y.key,y.value],!1)},l?"entries":"values",!l,!0),rM(h)}},oM=w$,nM=S$;oM("Map",function(s){return function(){return s(this,arguments.length?arguments[0]:void 0)}},nM);var sM=le,aM=sM.Map,hM=aM,lM=hM,dM=lM,T$=A(dM),cM=X,uM=jr.some,pM=uh,fM=pM("some");cM({target:"Array",proto:!0,forced:!fM},{some:function(h){return uM(this,h,arguments.length>1?arguments[1]:void 0)}});var vM=lt,gM=vM("Array","some"),mM=$e,yM=gM,tI=Array.prototype,bM=function(s){var h=s.some;return s===tI||mM(tI,s)&&h===tI.some?yM:h},wM=bM,_M=wM,EM=_M,OM=A(EM),xM=lt,SM=xM("Array","keys"),TM=SM,IM=TM,$M=Oi,CM=Ae,PM=$e,kM=IM,iI=Array.prototype,DM={DOMTokenList:!0,NodeList:!0},MM=function(s){var h=s.keys;return s===iI||PM(iI,s)&&h===iI.keys||CM(DM,$M(s))?kM:h},AM=MM,oa=A(AM),I$=Se,NM=Math.floor,rI=function(s,h){var l=s.length,c=NM(l/2);return l<8?RM(s,h):FM(s,rI(I$(s,0,c),h),rI(I$(s,c),h),h)},RM=function(s,h){for(var l=s.length,c=1,u,f;c<l;){for(f=c,u=s[c];f&&h(s[f-1],u)>0;)s[f]=s[--f];f!==c++&&(s[f]=u)}return s},FM=function(s,h,l,c){for(var u=h.length,f=l.length,m=0,b=0;m<u||b<f;)s[m+b]=m<u&&b<f?c(h[m],l[b])<=0?h[m++]:l[b++]:m<u?h[m++]:l[b++];return s},BM=rI,jM=wi,$$=jM.match(/firefox\/(\d+)/i),zM=!!$$&&+$$[1],LM=wi,HM=/MSIE|Trident/.test(LM),WM=wi,C$=WM.match(/AppleWebKit\/(\d+)\./),UM=!!C$&&+C$[1],VM=X,P$=_e,qM=St,GM=Tt,k$=Mt,KM=Gm,D$=Ui,oI=he,YM=BM,XM=uh,M$=zM,QM=HM,A$=Oo,N$=UM,En=[],R$=P$(En.sort),JM=P$(En.push),ZM=oI(function(){En.sort(void 0)}),eA=oI(function(){En.sort(null)}),tA=XM("sort"),F$=!oI(function(){if(A$)return A$<70;if(!(M$&&M$>3)){if(QM)return!0;if(N$)return N$<603;var s="",h,l,c,u;for(h=65;h<76;h++){switch(l=String.fromCharCode(h),h){case 66:case 69:case 70:case 72:c=3;break;case 68:case 71:c=4;break;default:c=2}for(u=0;u<47;u++)En.push({k:l+u,v:c})}for(En.sort(function(f,m){return m.v-f.v}),u=0;u<En.length;u++)l=En[u].k.charAt(0),s.charAt(s.length-1)!==l&&(s+=l);return s!=="DGBEFHACIJK"}}),iA=ZM||!eA||!tA||!F$,rA=function(s){return function(h,l){return l===void 0?-1:h===void 0?1:s!==void 0?+s(h,l)||0:D$(h)>D$(l)?1:-1}};VM({target:"Array",proto:!0,forced:iA},{sort:function(h){h!==void 0&&qM(h);var l=GM(this);if(F$)return h===void 0?R$(l):R$(l,h);var c=[],u=k$(l),f,m;for(m=0;m<u;m++)m in l&&JM(c,l[m]);for(YM(c,rA(h)),f=k$(c),m=0;m<f;)l[m]=c[m++];for(;m<u;)KM(l,m++);return l}});var oA=lt,nA=oA("Array","sort"),sA=$e,aA=nA,nI=Array.prototype,hA=function(s){var h=s.sort;return s===nI||sA(nI,s)&&h===nI.sort?aA:h},lA=hA,dA=lA,cA=dA,sI=A(cA),uA=lt,pA=uA("Array","values"),fA=pA,vA=fA,gA=Oi,mA=Ae,yA=$e,bA=vA,aI=Array.prototype,wA={DOMTokenList:!0,NodeList:!0},_A=function(s){var h=s.values;return s===aI||yA(aI,s)&&h===aI.values||mA(wA,gA(s))?bA:h},EA=_A,B$=A(EA),OA=ch,na=A(OA),xA=lt,SA=xA("Array","entries"),TA=SA,IA=TA,$A=Oi,CA=Ae,PA=$e,kA=IA,hI=Array.prototype,DA={DOMTokenList:!0,NodeList:!0},MA=function(s){var h=s.entries;return s===hI||PA(hI,s)&&h===hI.entries||CA(DA,$A(s))?kA:h},AA=MA,NA=A(AA);let Ub;const RA=new Uint8Array(16);function FA(){if(!Ub&&(Ub=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ub))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ub(RA)}const Ot=[];for(let s=0;s<256;++s)Ot.push((s+256).toString(16).slice(1));function BA(s,h=0){return Ot[s[h+0]]+Ot[s[h+1]]+Ot[s[h+2]]+Ot[s[h+3]]+"-"+Ot[s[h+4]]+Ot[s[h+5]]+"-"+Ot[s[h+6]]+Ot[s[h+7]]+"-"+Ot[s[h+8]]+Ot[s[h+9]]+"-"+Ot[s[h+10]]+Ot[s[h+11]]+Ot[s[h+12]]+Ot[s[h+13]]+Ot[s[h+14]]+Ot[s[h+15]]}var j$={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function jA(s,h,l){if(j$.randomUUID&&!h&&!s)return j$.randomUUID();s=s||{};const c=s.random||(s.rng||FA)();if(c[6]=c[6]&15|64,c[8]=c[8]&63|128,h){l=l||0;for(let u=0;u<16;++u)h[l+u]=c[u];return h}return BA(c)}function lI(s){return typeof s=="string"||typeof s=="number"}var z$=function(){function s(h){st(this,s),jt(this,"_queue",[]),jt(this,"_timeout",null),jt(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(h)}return tt(s,[{key:"setOptions",value:function(l){l&&typeof l.delay<"u"&&(this.delay=l.delay),l&&typeof l.max<"u"&&(this.max=l.max),this._flushIfNeeded()}},{key:"destroy",value:function(){if(this.flush(),this._extended){for(var l=this._extended.object,c=this._extended.methods,u=0;u<c.length;u++){var f=c[u];f.original?l[f.name]=f.original:delete l[f.name]}this._extended=null}}},{key:"replace",value:function(l,c){var u=this,f=l[c];if(!f)throw new Error("Method "+c+" undefined");l[c]=function(){for(var m=arguments.length,b=new Array(m),y=0;y<m;y++)b[y]=arguments[y];u.queue({args:b,fn:f,context:this})}}},{key:"queue",value:function(l){typeof l=="function"?this._queue.push({fn:l}):this._queue.push(l),this._flushIfNeeded()}},{key:"_flushIfNeeded",value:function(){var l=this;this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=wy(function(){l.flush()},this.delay))}},{key:"flush",value:function(){var l,c;Di(l=Qm(c=this._queue).call(c,0)).call(l,function(u){u.fn.apply(u.context||u.fn,u.args||[])})}}],[{key:"extend",value:function(l,c){var u=new s(c);if(l.flush!==void 0)throw new Error("Target object already has a property flush");l.flush=function(){u.flush()};var f=[{name:"flush",original:void 0}];if(c&&c.replace)for(var m=0;m<c.replace.length;m++){var b=c.replace[m];f.push({name:b,original:l[b]}),u.replace(l,b)}return u._extended={object:l,methods:f},u}}]),s}(),L$=function(){function s(){st(this,s),jt(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),jt(this,"subscribe",s.prototype.on),jt(this,"unsubscribe",s.prototype.off)}return tt(s,[{key:"_trigger",value:function(l,c,u){var f,m;if(l==="*")throw new Error("Cannot trigger event *");Di(f=kh(m=[]).call(m,dt(this._subscribers[l]),dt(this._subscribers["*"]))).call(f,function(b){b(l,c,u??null)})}},{key:"on",value:function(l,c){typeof c=="function"&&this._subscribers[l].push(c)}},{key:"off",value:function(l,c){var u;this._subscribers[l]=De(u=this._subscribers[l]).call(u,function(f){return f!==c})}}]),s}(),zA=w$,LA=S$;zA("Set",function(s){return function(){return s(this,arguments.length?arguments[0]:void 0)}},LA);var HA=le,WA=HA.Set,UA=WA,VA=UA,qA=VA,Vb=A(qA),GA=xh,KA=GA,YA=KA,XA=YA,QA=XA,JA=QA,ZA=JA,eN=ZA,tN=eN,iN=tN,dI=A(iN);function gr(s,h){var l=typeof Ps<"u"&&$s(s)||s["@@iterator"];if(!l){if(bt(s)||(l=rN(s))||h&&s&&typeof s.length=="number"){l&&(s=l);var c=0,u=function(){};return{s:u,n:function(){return c>=s.length?{done:!0}:{done:!1,value:s[c++]}},e:function(E){throw E},f:u}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f=!0,m=!1,b;return{s:function(){l=l.call(s)},n:function(){var E=l.next();return f=E.done,E},e:function(E){m=!0,b=E},f:function(){try{!f&&l.return!=null&&l.return()}finally{if(m)throw b}}}}function rN(s,h){var l;if(s){if(typeof s=="string")return H$(s,h);var c=ks(l=Object.prototype.toString.call(s)).call(l,8,-1);if(c==="Object"&&s.constructor&&(c=s.constructor.name),c==="Map"||c==="Set")return io(s);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return H$(s,h)}}function H$(s,h){(h==null||h>s.length)&&(h=s.length);for(var l=0,c=new Array(h);l<h;l++)c[l]=s[l];return c}var cI=function(s){function h(l){st(this,h),this._pairs=l}return tt(h,[{key:s,value:Gt.mark(function l(){var c,u,f,m,b;return Gt.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:c=gr(this._pairs),E.prev=1,c.s();case 3:if((u=c.n()).done){E.next=9;break}return f=yt(u.value,2),m=f[0],b=f[1],E.next=7,[m,b];case 7:E.next=3;break;case 9:E.next=14;break;case 11:E.prev=11,E.t0=E.catch(1),c.e(E.t0);case 14:return E.prev=14,c.f(),E.finish(14);case 17:case"end":return E.stop()}},l,this,[[1,11,14,17]])})},{key:"entries",value:Gt.mark(function l(){var c,u,f,m,b;return Gt.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:c=gr(this._pairs),E.prev=1,c.s();case 3:if((u=c.n()).done){E.next=9;break}return f=yt(u.value,2),m=f[0],b=f[1],E.next=7,[m,b];case 7:E.next=3;break;case 9:E.next=14;break;case 11:E.prev=11,E.t0=E.catch(1),c.e(E.t0);case 14:return E.prev=14,c.f(),E.finish(14);case 17:case"end":return E.stop()}},l,this,[[1,11,14,17]])})},{key:"keys",value:Gt.mark(function l(){var c,u,f,m;return Gt.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:c=gr(this._pairs),y.prev=1,c.s();case 3:if((u=c.n()).done){y.next=9;break}return f=yt(u.value,1),m=f[0],y.next=7,m;case 7:y.next=3;break;case 9:y.next=14;break;case 11:y.prev=11,y.t0=y.catch(1),c.e(y.t0);case 14:return y.prev=14,c.f(),y.finish(14);case 17:case"end":return y.stop()}},l,this,[[1,11,14,17]])})},{key:"values",value:Gt.mark(function l(){var c,u,f,m;return Gt.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:c=gr(this._pairs),y.prev=1,c.s();case 3:if((u=c.n()).done){y.next=9;break}return f=yt(u.value,2),m=f[1],y.next=7,m;case 7:y.next=3;break;case 9:y.next=14;break;case 11:y.prev=11,y.t0=y.catch(1),c.e(y.t0);case 14:return y.prev=14,c.f(),y.finish(14);case 17:case"end":return y.stop()}},l,this,[[1,11,14,17]])})},{key:"toIdArray",value:function(){var c;return kt(c=dt(this._pairs)).call(c,function(u){return u[0]})}},{key:"toItemArray",value:function(){var c;return kt(c=dt(this._pairs)).call(c,function(u){return u[1]})}},{key:"toEntryArray",value:function(){return dt(this._pairs)}},{key:"toObjectMap",value:function(){var c=eS(null),u=gr(this._pairs),f;try{for(u.s();!(f=u.n()).done;){var m=yt(f.value,2),b=m[0],y=m[1];c[b]=y}}catch(E){u.e(E)}finally{u.f()}return c}},{key:"toMap",value:function(){return new T$(this._pairs)}},{key:"toIdSet",value:function(){return new Vb(this.toIdArray())}},{key:"toItemSet",value:function(){return new Vb(this.toItemArray())}},{key:"cache",value:function(){return new h(dt(this._pairs))}},{key:"distinct",value:function(c){var u=new Vb,f=gr(this._pairs),m;try{for(f.s();!(m=f.n()).done;){var b=yt(m.value,2),y=b[0],E=b[1];u.add(c(E,y))}}catch(x){f.e(x)}finally{f.f()}return u}},{key:"filter",value:function(c){var u=this._pairs;return new h({[na](){return Gt.mark(function f(){var m,b,y,E,x;return Gt.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:m=gr(u),S.prev=1,m.s();case 3:if((b=m.n()).done){S.next=10;break}if(y=yt(b.value,2),E=y[0],x=y[1],!c(x,E)){S.next=8;break}return S.next=8,[E,x];case 8:S.next=3;break;case 10:S.next=15;break;case 12:S.prev=12,S.t0=S.catch(1),m.e(S.t0);case 15:return S.prev=15,m.f(),S.finish(15);case 18:case"end":return S.stop()}},f,null,[[1,12,15,18]])})()}})}},{key:"forEach",value:function(c){var u=gr(this._pairs),f;try{for(u.s();!(f=u.n()).done;){var m=yt(f.value,2),b=m[0],y=m[1];c(y,b)}}catch(E){u.e(E)}finally{u.f()}}},{key:"map",value:function(c){var u=this._pairs;return new h({[na](){return Gt.mark(function f(){var m,b,y,E,x;return Gt.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:m=gr(u),S.prev=1,m.s();case 3:if((b=m.n()).done){S.next=9;break}return y=yt(b.value,2),E=y[0],x=y[1],S.next=7,[E,c(x,E)];case 7:S.next=3;break;case 9:S.next=14;break;case 11:S.prev=11,S.t0=S.catch(1),m.e(S.t0);case 14:return S.prev=14,m.f(),S.finish(14);case 17:case"end":return S.stop()}},f,null,[[1,11,14,17]])})()}})}},{key:"max",value:function(c){var u=dI(this._pairs),f=u.next();if(f.done)return null;for(var m=f.value[1],b=c(f.value[1],f.value[0]);!(f=u.next()).done;){var y=yt(f.value,2),E=y[0],x=y[1],T=c(x,E);T>b&&(b=T,m=x)}return m}},{key:"min",value:function(c){var u=dI(this._pairs),f=u.next();if(f.done)return null;for(var m=f.value[1],b=c(f.value[1],f.value[0]);!(f=u.next()).done;){var y=yt(f.value,2),E=y[0],x=y[1],T=c(x,E);T<b&&(b=T,m=x)}return m}},{key:"reduce",value:function(c,u){var f=gr(this._pairs),m;try{for(f.s();!(m=f.n()).done;){var b=yt(m.value,2),y=b[0],E=b[1];u=c(u,E,y)}}catch(x){f.e(x)}finally{f.f()}return u}},{key:"sort",value:function(c){var u=this;return new h({[na]:function(){var f;return dI(sI(f=dt(u._pairs)).call(f,function(m,b){var y=yt(m,2),E=y[0],x=y[1],T=yt(b,2),S=T[0],k=T[1];return c(x,k,E,S)}))}})}}]),h}(na);function W$(s,h){var l=nu(s);if(rl){var c=rl(s);h&&(c=De(c).call(c,function(u){return mb(s,u).enumerable})),l.push.apply(l,c)}return l}function U$(s){for(var h=1;h<arguments.length;h++){var l,c,u=arguments[h]!=null?arguments[h]:{};h%2?Di(l=W$(Object(u),!0)).call(l,function(f){jt(s,f,u[f])}):bb?cT(s,bb(u)):Di(c=W$(Object(u))).call(c,function(f){Sb(s,f,mb(u,f))})}return s}function uI(s,h){var l=typeof Ps<"u"&&$s(s)||s["@@iterator"];if(!l){if(bt(s)||(l=oN(s))||h&&s&&typeof s.length=="number"){l&&(s=l);var c=0,u=function(){};return{s:u,n:function(){return c>=s.length?{done:!0}:{done:!1,value:s[c++]}},e:function(E){throw E},f:u}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f=!0,m=!1,b;return{s:function(){l=l.call(s)},n:function(){var E=l.next();return f=E.done,E},e:function(E){m=!0,b=E},f:function(){try{!f&&l.return!=null&&l.return()}finally{if(m)throw b}}}}function oN(s,h){var l;if(s){if(typeof s=="string")return V$(s,h);var c=ks(l=Object.prototype.toString.call(s)).call(l,8,-1);if(c==="Object"&&s.constructor&&(c=s.constructor.name),c==="Map"||c==="Set")return io(s);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return V$(s,h)}}function V$(s,h){(h==null||h>s.length)&&(h=s.length);for(var l=0,c=new Array(h);l<h;l++)c[l]=s[l];return c}function nN(s){var h=sN();return function(){var c=w(s),u;if(h){var f=w(this).constructor;u=ji(c,arguments,f)}else u=c.apply(this,arguments);return o(this,u)}}function sN(){if(typeof Reflect>"u"||!ji||ji.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(ji(Boolean,[],function(){})),!0}catch{return!1}}function aN(s,h){return s[h]==null&&(s[h]=jA()),s}var q$=function(s){i(l,s);var h=nN(l);function l(c,u){var f;return st(this,l),f=h.call(this),jt(vo(f),"_queue",null),c&&!bt(c)&&(u=c,c=[]),f._options=u||{},f._data=new T$,f.length=0,f._idProp=f._options.fieldId||"id",c&&c.length&&f.add(c),f.setOptions(u),f}return tt(l,[{key:"idProp",get:function(){return this._idProp}},{key:"setOptions",value:function(u){u&&u.queue!==void 0&&(u.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=z$.extend(this,{replace:["add","update","remove"]})),u.queue&&typeof u.queue=="object"&&this._queue.setOptions(u.queue)))}},{key:"add",value:function(u,f){var m=this,b=[],y;if(bt(u)){var E=kt(u).call(u,function(S){return S[m._idProp]});if(OM(E).call(E,function(S){return m._data.has(S)}))throw new Error("A duplicate id was found in the parameter array.");for(var x=0,T=u.length;x<T;x++)y=this._addItem(u[x]),b.push(y)}else if(u&&typeof u=="object")y=this._addItem(u),b.push(y);else throw new Error("Unknown dataType");return b.length&&this._trigger("add",{items:b},f),b}},{key:"update",value:function(u,f){var m=this,b=[],y=[],E=[],x=[],T=this._idProp,S=function(te){var oe=te[T];if(oe!=null&&m._data.has(oe)){var ot=te,Be=oy({},m._data.get(oe)),xt=m._updateItem(ot);y.push(xt),x.push(ot),E.push(Be)}else{var je=m._addItem(te);b.push(je)}};if(bt(u))for(var k=0,z=u.length;k<z;k++)u[k]&&typeof u[k]=="object"?S(u[k]):console.warn("Ignoring input item, which is not an object at index "+k);else if(u&&typeof u=="object")S(u);else throw new Error("Unknown dataType");if(b.length&&this._trigger("add",{items:b},f),y.length){var J={items:y,oldData:E,data:x};this._trigger("update",J,f)}return kh(b).call(b,y)}},{key:"updateOnly",value:function(u,f){var m,b=this;bt(u)||(u=[u]);var y=kt(m=kt(u).call(u,function(x){var T=b._data.get(x[b._idProp]);if(T==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:T,update:x}})).call(m,function(x){var T=x.oldData,S=x.update,k=T[b._idProp],z=tb(T,S);return b._data.set(k,z),{id:k,oldData:T,updatedData:z}});if(y.length){var E={items:kt(y).call(y,function(x){return x.id}),oldData:kt(y).call(y,function(x){return x.oldData}),data:kt(y).call(y,function(x){return x.updatedData})};return this._trigger("update",E,f),E.items}else return[]}},{key:"get",value:function(u,f){var m=void 0,b=void 0,y=void 0;lI(u)?(m=u,y=f):bt(u)?(b=u,y=f):y=u;var E=y&&y.returnType==="Object"?"Object":"Array",x=y&&De(y),T=[],S=void 0,k=void 0,z=void 0;if(m!=null)S=this._data.get(m),S&&x&&!x(S)&&(S=void 0);else if(b!=null)for(var J=0,Z=b.length;J<Z;J++)S=this._data.get(b[J]),S!=null&&(!x||x(S))&&T.push(S);else{var te;k=dt(oa(te=this._data).call(te));for(var oe=0,ot=k.length;oe<ot;oe++)z=k[oe],S=this._data.get(z),S!=null&&(!x||x(S))&&T.push(S)}if(y&&y.order&&m==null&&this._sort(T,y.order),y&&y.fields){var Be=y.fields;if(m!=null&&S!=null)S=this._filterFields(S,Be);else for(var xt=0,je=T.length;xt<je;xt++)T[xt]=this._filterFields(T[xt],Be)}if(E=="Object"){for(var mo={},ai=0,On=T.length;ai<On;ai++){var cl=T[ai],xn=cl[this._idProp];mo[xn]=cl}return mo}else if(m!=null){var mr;return(mr=S)!==null&&mr!==void 0?mr:null}else return T}},{key:"getIds",value:function(u){var f=this._data,m=u&&De(u),b=u&&u.order,y=dt(oa(f).call(f)),E=[];if(m)if(b){for(var x=[],T=0,S=y.length;T<S;T++){var k=y[T],z=this._data.get(k);z!=null&&m(z)&&x.push(z)}this._sort(x,b);for(var J=0,Z=x.length;J<Z;J++)E.push(x[J][this._idProp])}else for(var te=0,oe=y.length;te<oe;te++){var ot=y[te],Be=this._data.get(ot);Be!=null&&m(Be)&&E.push(Be[this._idProp])}else if(b){for(var xt=[],je=0,mo=y.length;je<mo;je++){var ai=y[je];xt.push(f.get(ai))}this._sort(xt,b);for(var On=0,cl=xt.length;On<cl;On++)E.push(xt[On][this._idProp])}else for(var xn=0,mr=y.length;xn<mr;xn++){var mi=y[xn],ul=f.get(mi);ul!=null&&E.push(ul[this._idProp])}return E}},{key:"getDataSet",value:function(){return this}},{key:"forEach",value:function(u,f){var m=f&&De(f),b=this._data,y=dt(oa(b).call(b));if(f&&f.order)for(var E=this.get(f),x=0,T=E.length;x<T;x++){var S=E[x],k=S[this._idProp];u(S,k)}else for(var z=0,J=y.length;z<J;z++){var Z=y[z],te=this._data.get(Z);te!=null&&(!m||m(te))&&u(te,Z)}}},{key:"map",value:function(u,f){for(var m=f&&De(f),b=[],y=this._data,E=dt(oa(y).call(y)),x=0,T=E.length;x<T;x++){var S=E[x],k=this._data.get(S);k!=null&&(!m||m(k))&&b.push(u(k,S))}return f&&f.order&&this._sort(b,f.order),b}},{key:"_filterFields",value:function(u,f){var m;return u&&fh(m=bt(f)?f:nu(f)).call(m,function(b,y){return b[y]=u[y],b},{})}},{key:"_sort",value:function(u,f){if(typeof f=="string"){var m=f;sI(u).call(u,function(b,y){var E=b[m],x=y[m];return E>x?1:E<x?-1:0})}else if(typeof f=="function")sI(u).call(u,f);else throw new TypeError("Order must be a function or a string")}},{key:"remove",value:function(u,f){for(var m=[],b=[],y=bt(u)?u:[u],E=0,x=y.length;E<x;E++){var T=this._remove(y[E]);if(T){var S=T[this._idProp];S!=null&&(m.push(S),b.push(T))}}return m.length&&this._trigger("remove",{items:m,oldData:b},f),m}},{key:"_remove",value:function(u){var f;if(lI(u)?f=u:u&&typeof u=="object"&&(f=u[this._idProp]),f!=null&&this._data.has(f)){var m=this._data.get(f)||null;return this._data.delete(f),--this.length,m}return null}},{key:"clear",value:function(u){for(var f,m=dt(oa(f=this._data).call(f)),b=[],y=0,E=m.length;y<E;y++)b.push(this._data.get(m[y]));return this._data.clear(),this.length=0,this._trigger("remove",{items:m,oldData:b},u),m}},{key:"max",value:function(u){var f,m=null,b=null,y=uI(B$(f=this._data).call(f)),E;try{for(y.s();!(E=y.n()).done;){var x=E.value,T=x[u];typeof T=="number"&&(b==null||T>b)&&(m=x,b=T)}}catch(S){y.e(S)}finally{y.f()}return m||null}},{key:"min",value:function(u){var f,m=null,b=null,y=uI(B$(f=this._data).call(f)),E;try{for(y.s();!(E=y.n()).done;){var x=E.value,T=x[u];typeof T=="number"&&(b==null||T<b)&&(m=x,b=T)}}catch(S){y.e(S)}finally{y.f()}return m||null}},{key:"distinct",value:function(u){for(var f=this._data,m=dt(oa(f).call(f)),b=[],y=0,E=0,x=m.length;E<x;E++){for(var T=m[E],S=f.get(T),k=S[u],z=!1,J=0;J<y;J++)if(b[J]==k){z=!0;break}!z&&k!==void 0&&(b[y]=k,y++)}return b}},{key:"_addItem",value:function(u){var f=aN(u,this._idProp),m=f[this._idProp];if(this._data.has(m))throw new Error("Cannot add item: item with id "+m+" already exists");return this._data.set(m,f),++this.length,m}},{key:"_updateItem",value:function(u){var f=u[this._idProp];if(f==null)throw new Error("Cannot update item: item has no id (item: "+uy(u)+")");var m=this._data.get(f);if(!m)throw new Error("Cannot update item: no item with id "+f+" found");return this._data.set(f,U$(U$({},m),u)),f}},{key:"stream",value:function(u){if(u){var f=this._data;return new cI({[na](){return Gt.mark(function b(){var y,E,x,T;return Gt.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:y=uI(u),k.prev=1,y.s();case 3:if((E=y.n()).done){k.next=11;break}if(x=E.value,T=f.get(x),T==null){k.next=9;break}return k.next=9,[x,T];case 9:k.next=3;break;case 11:k.next=16;break;case 13:k.prev=13,k.t0=k.catch(1),y.e(k.t0);case 16:return k.prev=16,y.f(),k.finish(16);case 19:case"end":return k.stop()}},b,null,[[1,13,16,19]])})()}})}else{var m;return new cI({[na]:qr(m=NA(this._data)).call(m,this._data)})}}}]),l}(L$);function hN(s,h){var l=typeof Ps<"u"&&$s(s)||s["@@iterator"];if(!l){if(bt(s)||(l=lN(s))||h&&s&&typeof s.length=="number"){l&&(s=l);var c=0,u=function(){};return{s:u,n:function(){return c>=s.length?{done:!0}:{done:!1,value:s[c++]}},e:function(E){throw E},f:u}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f=!0,m=!1,b;return{s:function(){l=l.call(s)},n:function(){var E=l.next();return f=E.done,E},e:function(E){m=!0,b=E},f:function(){try{!f&&l.return!=null&&l.return()}finally{if(m)throw b}}}}function lN(s,h){var l;if(s){if(typeof s=="string")return G$(s,h);var c=ks(l=Object.prototype.toString.call(s)).call(l,8,-1);if(c==="Object"&&s.constructor&&(c=s.constructor.name),c==="Map"||c==="Set")return io(s);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return G$(s,h)}}function G$(s,h){(h==null||h>s.length)&&(h=s.length);for(var l=0,c=new Array(h);l<h;l++)c[l]=s[l];return c}function dN(s){var h=cN();return function(){var c=w(s),u;if(h){var f=w(this).constructor;u=ji(c,arguments,f)}else u=c.apply(this,arguments);return o(this,u)}}function cN(){if(typeof Reflect>"u"||!ji||ji.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(ji(Boolean,[],function(){})),!0}catch{return!1}}var uN=function(s){i(l,s);var h=dN(l);function l(c,u){var f,m;return st(this,l),m=h.call(this),jt(vo(m),"length",0),jt(vo(m),"_ids",new Vb),m._options=u||{},m._listener=qr(f=m._onEvent).call(f,vo(m)),m.setData(c),m}return tt(l,[{key:"idProp",get:function(){return this.getDataSet().idProp}},{key:"setData",value:function(u){if(this._data){this._data.off&&this._data.off("*",this._listener);var f=this._data.getIds({filter:De(this._options)}),m=this._data.get(f);this._ids.clear(),this.length=0,this._trigger("remove",{items:f,oldData:m})}if(u!=null){this._data=u;for(var b=this._data.getIds({filter:De(this._options)}),y=0,E=b.length;y<E;y++){var x=b[y];this._ids.add(x)}this.length=b.length,this._trigger("add",{items:b})}else this._data=new q$;this._data.on&&this._data.on("*",this._listener)}},{key:"refresh",value:function(){for(var u=this._data.getIds({filter:De(this._options)}),f=dt(this._ids),m={},b=[],y=[],E=[],x=0,T=u.length;x<T;x++){var S=u[x];m[S]=!0,this._ids.has(S)||(b.push(S),this._ids.add(S))}for(var k=0,z=f.length;k<z;k++){var J=f[k],Z=this._data.get(J);Z==null?console.error("If you see this, report it please."):m[J]||(y.push(J),E.push(Z),this._ids.delete(J))}this.length+=b.length-y.length,b.length&&this._trigger("add",{items:b}),y.length&&this._trigger("remove",{items:y,oldData:E})}},{key:"get",value:function(u,f){if(this._data==null)return null;var m=null,b;lI(u)||bt(u)?(m=u,b=f):b=u;var y=oy({},this._options,b),E=De(this._options),x=b&&De(b);return E&&x&&(y.filter=function(T){return E(T)&&x(T)}),m==null?this._data.get(y):this._data.get(m,y)}},{key:"getIds",value:function(u){if(this._data.length){var f=De(this._options),m=u!=null?De(u):null,b;return m?f?b=function(E){return f(E)&&m(E)}:b=m:b=f,this._data.getIds({filter:b,order:u&&u.order})}else return[]}},{key:"forEach",value:function(u,f){if(this._data){var m,b=De(this._options),y=f&&De(f),E;y?b?E=function(T){return b(T)&&y(T)}:E=y:E=b,Di(m=this._data).call(m,u,{filter:E,order:f&&f.order})}}},{key:"map",value:function(u,f){if(this._data){var m,b=De(this._options),y=f&&De(f),E;return y?b?E=function(T){return b(T)&&y(T)}:E=y:E=b,kt(m=this._data).call(m,u,{filter:E,order:f&&f.order})}else return[]}},{key:"getDataSet",value:function(){return this._data.getDataSet()}},{key:"stream",value:function(u){var f;return this._data.stream(u||{[na]:qr(f=oa(this._ids)).call(f,this._ids)})}},{key:"dispose",value:function(){var u;(u=this._data)!==null&&u!==void 0&&u.off&&this._data.off("*",this._listener);var f="This data view has already been disposed of.",m={get:function(){throw new Error(f)},set:function(){throw new Error(f)},configurable:!1},b=hN(Dm(l.prototype)),y;try{for(b.s();!(y=b.n()).done;){var E=y.value;Sb(this,E,m)}}catch(x){b.e(x)}finally{b.f()}}},{key:"_onEvent",value:function(u,f,m){if(!(!f||!f.items||!this._data)){var b=f.items,y=[],E=[],x=[],T=[],S=[],k=[];switch(u){case"add":for(var z=0,J=b.length;z<J;z++){var Z=b[z],te=this.get(Z);te&&(this._ids.add(Z),y.push(Z))}break;case"update":for(var oe=0,ot=b.length;oe<ot;oe++){var Be=b[oe],xt=this.get(Be);xt?this._ids.has(Be)?(E.push(Be),S.push(f.data[oe]),T.push(f.oldData[oe])):(this._ids.add(Be),y.push(Be)):this._ids.has(Be)&&(this._ids.delete(Be),x.push(Be),k.push(f.oldData[oe]))}break;case"remove":for(var je=0,mo=b.length;je<mo;je++){var ai=b[je];this._ids.has(ai)&&(this._ids.delete(ai),x.push(ai),k.push(f.oldData[je]))}break}this.length+=y.length-x.length,y.length&&this._trigger("add",{items:y},m),E.length&&this._trigger("update",{items:E,oldData:T,data:S},m),x.length&&this._trigger("remove",{items:x,oldData:k},m)}}}]),l}(L$);function K$(s,h){return typeof h=="object"&&h!==null&&s===h.idProp&&typeof h.add=="function"&&typeof h.clear=="function"&&typeof h.distinct=="function"&&typeof Di(h)=="function"&&typeof h.get=="function"&&typeof h.getDataSet=="function"&&typeof h.getIds=="function"&&typeof h.length=="number"&&typeof kt(h)=="function"&&typeof h.max=="function"&&typeof h.min=="function"&&typeof h.off=="function"&&typeof h.on=="function"&&typeof h.remove=="function"&&typeof h.setOptions=="function"&&typeof h.stream=="function"&&typeof h.update=="function"&&typeof h.updateOnly=="function"}function pN(s,h){return typeof h=="object"&&h!==null&&s===h.idProp&&typeof Di(h)=="function"&&typeof h.get=="function"&&typeof h.getDataSet=="function"&&typeof h.getIds=="function"&&typeof h.length=="number"&&typeof kt(h)=="function"&&typeof h.off=="function"&&typeof h.on=="function"&&typeof h.stream=="function"&&K$(s,h.getDataSet())}nt.DELETE=el,nt.DataSet=q$,nt.DataStream=cI,nt.DataView=uN,nt.Queue=z$,nt.createNewDataPipeFrom=Bg,nt.isDataSetLike=K$,nt.isDataViewLike=pN})},78993(Q$,Yb,la){/**
 * vis-network
 * https://visjs.github.io/vis-network/
 *
 * A dynamic, browser-based visualization library.
 *
 * @version 9.1.13
 * @date    2025-06-28T12:43:17.849Z
 *
 * @copyright (c) 2011-2017 Almende B.V, http://almende.com
 * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
 *
 * @license
 * vis.js is dual licensed under both
 *
 *   1. The Apache 2.0 License
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *   and
 *
 *   2. The MIT License
 *      http://opensource.org/licenses/MIT
 *
 * vis.js may be distributed under either license.
 */(function(nt,st){st(Yb,la(14107))})(this,function(nt,st){var Tn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof la.g<"u"?la.g:typeof self<"u"?self:{};function A(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var In=function(r){return r&&r.Math===Math&&r},we=In(typeof globalThis=="object"&&globalThis)||In(typeof window=="object"&&window)||In(typeof self=="object"&&self)||In(typeof Tn=="object"&&Tn)||function(){return this}()||Tn||Function("return this")(),G=function(r){try{return!!r()}catch{return!0}},he=!G(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),Xb=he,yo=Function.prototype,hp=yo.apply,fl=yo.call,$n=typeof Reflect=="object"&&Reflect.apply||(Xb?fl.bind(hp):function(){return fl.apply(hp,arguments)}),vl=he,yr=Function.prototype,da=yr.call,lp=vl&&yr.bind.bind(da,da),de=vl?lp:function(r){return function(){return da.apply(r,arguments)}},dp=de,_e=dp({}.toString),cp=dp("".slice),yi=function(r){return cp(_e(r),8,-1)},Qb=yi,zi=de,ca=function(r){if(Qb(r)==="Function")return zi(r)},gl=typeof document=="object"&&document.all,Cn={all:gl,IS_HTMLDDA:gl===void 0&&gl!==void 0},ml=Cn.all,Qe=Cn.IS_HTMLDDA?function(r){return typeof r=="function"||r===ml}:function(r){return typeof r=="function"},bo={},ze=!G(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Jb=he,Ee=Function.prototype.call,Je=Jb?Ee.bind(Ee):function(){return Ee.apply(Ee,arguments)},Pn={},Ue={}.propertyIsEnumerable,up=Object.getOwnPropertyDescriptor,ua=up&&!Ue.call({1:2},1);Pn.f=ua?function(r){var e=up(this,r);return!!e&&e.enumerable}:Ue;var Oe,br,wo=function(r,e){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:e}},pp=G,Zb=yi,bi=Object,e0=de("".split),pa=pp(function(){return!bi("z").propertyIsEnumerable(0)})?function(r){return Zb(r)==="String"?e0(r,""):bi(r)}:bi,_o=function(r){return r==null},yl=_o,t0=TypeError,Li=function(r){if(yl(r))throw new t0("Can't call method on "+r);return r},Eo=pa,i0=Li,Yt=function(r){return Eo(i0(r))},fa=Qe,r0=Cn.all,at=Cn.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:fa(r)||r===r0}:function(r){return typeof r=="object"?r!==null:fa(r)},ne={},va=ne,ga=we,o0=Qe,Ke=function(r){return o0(r)?r:void 0},le=function(r,e){return arguments.length<2?Ke(va[r])||Ke(ga[r]):va[r]&&va[r][e]||ga[r]&&ga[r][e]},Ie=de({}.isPrototypeOf),wr=typeof navigator<"u"&&String(navigator.userAgent)||"",fp=we,ma=wr,ht=fp.process,vp=fp.Deno,$e=ht&&ht.versions||vp&&vp.version,wi=$e&&$e.v8;wi&&(br=(Oe=wi.split("."))[0]>0&&Oe[0]<4?1:+(Oe[0]+Oe[1])),!br&&ma&&(!(Oe=ma.match(/Edge\/(\d+)/))||Oe[1]>=74)&&(Oe=ma.match(/Chrome\/(\d+)/))&&(br=+Oe[1]);var _r=br,ya=_r,gp=G,mp=we.String,Er=!!Object.getOwnPropertySymbols&&!gp(function(){var r=Symbol("symbol detection");return!mp(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&ya&&ya<41}),bl=Er&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Xt=le,ba=Qe,Oo=Ie,yp=Object,kn=bl?function(r){return typeof r=="symbol"}:function(r){var e=Xt("Symbol");return ba(e)&&Oo(e.prototype,yp(r))},n0=String,Dn=function(r){try{return n0(r)}catch{return"Object"}},xo=Qe,s0=Dn,bp=TypeError,So=function(r){if(xo(r))return r;throw new bp(s0(r)+" is not a function")},a0=So,h0=_o,wl=function(r,e){var t=r[e];return h0(t)?void 0:a0(t)},_l=Je,Or=Qe,El=at,To=TypeError,wp={exports:{}},_p=we,l0=Object.defineProperty,St=function(r,e){try{l0(_p,r,{value:e,configurable:!0,writable:!0})}catch{_p[r]=e}return e},Ep="__core-js_shared__",Ol=we[Ep]||St(Ep,{}),wa=Ol;(wp.exports=function(r,e){return wa[r]||(wa[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Hi=wp.exports,xl=Li,Sl=Object,Bt=function(r){return Sl(xl(r))},d0=Bt,Op=de({}.hasOwnProperty),Ze=Object.hasOwn||function(r,e){return Op(d0(r),e)},xp=de,c0=0,u0=Math.random(),p0=xp(1 .toString),_a=function(r){return"Symbol("+(r===void 0?"":r)+")_"+p0(++c0+u0,36)},Sp=Hi,Tp=Ze,Tl=_a,Ip=Er,Io=bl,$o=we.Symbol,Il=Sp("wks"),Tt=Io?$o.for||$o:$o&&$o.withoutSetter||Tl,Me=function(r){return Tp(Il,r)||(Il[r]=Ip&&Tp($o,r)?$o[r]:Tt("Symbol."+r)),Il[r]},f0=Je,$p=at,Ae=kn,v0=wl,g0=function(r,e){var t,i;if(e==="string"&&Or(t=r.toString)&&!El(i=_l(t,r))||Or(t=r.valueOf)&&!El(i=_l(t,r))||e!=="string"&&Or(t=r.toString)&&!El(i=_l(t,r)))return i;throw new To("Can't convert object to primitive value")},m0=TypeError,y0=Me("toPrimitive"),Ea=function(r,e){if(!$p(r)||Ae(r))return r;var t,i=v0(r,y0);if(i){if(e===void 0&&(e="default"),t=f0(i,r,e),!$p(t)||Ae(t))return t;throw new m0("Can't convert object to primitive value")}return e===void 0&&(e="number"),g0(r,e)},b0=kn,Oa=function(r){var e=Ea(r,"string");return b0(e)?e:e+""},$l=at,Cl=we.document,w0=$l(Cl)&&$l(Cl.createElement),Cp=function(r){return w0?Cl.createElement(r):{}},Co=Cp,xa=!ze&&!G(function(){return Object.defineProperty(Co("div"),"a",{get:function(){return 7}}).a!==7}),_0=ze,xe=Je,E0=Pn,Pp=wo,kp=Yt,O0=Oa,x0=Ze,S0=xa,Dp=Object.getOwnPropertyDescriptor;bo.f=_0?Dp:function(r,e){if(r=kp(r),e=O0(e),S0)try{return Dp(r,e)}catch{}if(x0(r,e))return Pp(!xe(E0.f,r,e),r[e])};var T0=G,I0=Qe,$0=/#|\.prototype\./,Mn=function(r,e){var t=C0[Sa(r)];return t===Pl||t!==Mp&&(I0(e)?T0(e):!!e)},Sa=Mn.normalize=function(r){return String(r).replace($0,".").toLowerCase()},C0=Mn.data={},Mp=Mn.NATIVE="N",Pl=Mn.POLYFILL="P",P0=Mn,kl=So,k0=he,D0=ca(ca.bind),Ta=function(r,e){return kl(r),e===void 0?r:k0?D0(r,e):function(){return r.apply(e,arguments)}},It={},Ap=ze&&G(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),M0=at,A0=String,N0=TypeError,_i=function(r){if(M0(r))return r;throw new N0(A0(r)+" is not an object")},R0=ze,F0=xa,B0=Ap,An=_i,Np=Oa,j0=TypeError,Dl=Object.defineProperty,Nn=Object.getOwnPropertyDescriptor,Ml="enumerable",Al="configurable",Nl="writable";It.f=R0?B0?function(r,e,t){if(An(r),e=Np(e),An(t),typeof r=="function"&&e==="prototype"&&"value"in t&&Nl in t&&!t[Nl]){var i=Nn(r,e);i&&i[Nl]&&(r[e]=t.value,t={configurable:Al in t?t[Al]:i[Al],enumerable:Ml in t?t[Ml]:i[Ml],writable:!1})}return Dl(r,e,t)}:Dl:function(r,e,t){if(An(r),e=Np(e),An(t),F0)try{return Dl(r,e,t)}catch{}if("get"in t||"set"in t)throw new j0("Accessors not supported");return"value"in t&&(r[e]=t.value),r};var z0=It,Rp=wo,xr=ze?function(r,e,t){return z0.f(r,e,Rp(1,t))}:function(r,e,t){return r[e]=t,r},Ia=we,L0=$n,H0=ca,Wi=Qe,$t=bo.f,W0=P0,Po=ne,Fp=Ta,ko=xr,Bp=Ze,U0=function(r){var e=function(t,i,o){if(this instanceof e){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,i)}return new r(t,i,o)}return L0(r,this,arguments)};return e.prototype=r.prototype,e},V=function(r,e){var t,i,o,n,a,d,p,v,g,w=r.target,_=r.global,O=r.stat,$=r.proto,P=_?Ia:O?Ia[w]:(Ia[w]||{}).prototype,C=_?Po:Po[w]||ko(Po,w,{})[w],I=C.prototype;for(n in e)i=!(t=W0(_?n:w+(O?".":"#")+n,r.forced))&&P&&Bp(P,n),d=C[n],i&&(p=r.dontCallGetSet?(g=$t(P,n))&&g.value:P[n]),a=i&&p?p:e[n],i&&typeof d==typeof a||(v=r.bind&&i?Fp(a,Ia):r.wrap&&i?U0(a):$&&Wi(a)?H0(a):a,(r.sham||a&&a.sham||d&&d.sham)&&ko(v,"sham",!0),ko(C,n,v),$&&(Bp(Po,o=w+"Prototype")||ko(Po,o,{}),ko(Po[o],n,a),r.real&&I&&(t||!I[n])&&ko(I,n,a)))},V0=Math.ceil,q0=Math.floor,G0=Math.trunc||function(r){var e=+r;return(e>0?q0:V0)(e)},Sr=function(r){var e=+r;return e!=e||e===0?0:G0(e)},jp=Sr,K0=Math.max,Rl=Math.min,Rn=function(r,e){var t=jp(r);return t<0?K0(t+e,0):Rl(t,e)},Fl=Sr,Bl=Math.min,jl=function(r){return r>0?Bl(Fl(r),9007199254740991):0},hi=function(r){return jl(r.length)},Y0=Yt,X0=Rn,Ei=hi,Fn=function(r){return function(e,t,i){var o,n=Y0(e),a=Ei(n),d=X0(i,a);if(r&&t!=t){for(;a>d;)if((o=n[d++])!=o)return!0}else for(;a>d;d++)if((r||d in n)&&n[d]===t)return r||d||0;return!r&&-1}},zl={includes:Fn(!0),indexOf:Fn(!1)},Bn={},Ll=Ze,Q0=Yt,J0=zl.indexOf,Do=Bn,zp=de([].push),Tr=function(r,e){var t,i=Q0(r),o=0,n=[];for(t in i)!Ll(Do,t)&&Ll(i,t)&&zp(n,t);for(;e.length>o;)Ll(i,t=e[o++])&&(~J0(n,t)||zp(n,t));return n},$a=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Z0=Tr,X=$a,jn=Object.keys||function(r){return Z0(r,X)},zn={};zn.f=Object.getOwnPropertySymbols;var Hl=ze,ew=de,Lp=Je,tw=G,Wl=jn,iw=zn,Hp=Pn,rw=Bt,ow=pa,Mo=Object.assign,Wp=Object.defineProperty,Up=ew([].concat),Ca=!Mo||tw(function(){if(Hl&&Mo({b:1},Mo(Wp({},"a",{enumerable:!0,get:function(){Wp(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var r={},e={},t=Symbol("assign detection"),i="abcdefghijklmnopqrst";return r[t]=7,i.split("").forEach(function(o){e[o]=o}),Mo({},r)[t]!==7||Wl(Mo({},e)).join("")!==i})?function(r,e){for(var t=rw(r),i=arguments.length,o=1,n=iw.f,a=Hp.f;i>o;)for(var d,p=ow(arguments[o++]),v=n?Up(Wl(p),n(p)):Wl(p),g=v.length,w=0;g>w;)d=v[w++],Hl&&!Lp(a,p,d)||(t[d]=p[d]);return t}:Mo,Vp=Ca;V({target:"Object",stat:!0,arity:2,forced:Object.assign!==Vp},{assign:Vp});var ge=A(ne.Object.assign),Pa=de([].slice),qp=de,nw=So,sw=at,ka=Ze,Gp=Pa,aw=he,Kp=Function,hw=qp([].concat),Mt=qp([].join),Ul={},lw=aw?Kp.bind:function(r){var e=nw(this),t=e.prototype,i=Gp(arguments,1),o=function(){var n=hw(i,Gp(arguments));return this instanceof o?function(a,d,p){if(!ka(Ul,d)){for(var v=[],g=0;g<d;g++)v[g]="a["+g+"]";Ul[d]=Kp("C,a","return new C("+Mt(v,",")+")")}return Ul[d](a,p)}(e,n.length,n):e.apply(r,n)};return sw(t)&&(o.prototype=t),o},Ln=lw;V({target:"Function",proto:!0,forced:Function.bind!==Ln},{bind:Ln});var dw=ne,et=function(r){return dw[r+"Prototype"]},cw=et("Function").bind,Ao=Ie,uw=cw,Vl=Function.prototype,Yp=function(r){var e=r.bind;return r===Vl||Ao(Vl,r)&&e===Vl.bind?uw:e},N=A(Yp);function ql(r,e,t,i){r.beginPath(),r.arc(e,t,i,0,2*Math.PI,!1),r.closePath()}function Xp(r,e,t,i,o,n){const a=Math.PI/180;i-2*n<0&&(n=i/2),o-2*n<0&&(n=o/2),r.beginPath(),r.moveTo(e+n,t),r.lineTo(e+i-n,t),r.arc(e+i-n,t+n,n,270*a,360*a,!1),r.lineTo(e+i,t+o-n),r.arc(e+i-n,t+o-n,n,0,90*a,!1),r.lineTo(e+n,t+o),r.arc(e+n,t+o-n,n,90*a,180*a,!1),r.lineTo(e,t+n),r.arc(e+n,t+n,n,180*a,270*a,!1),r.closePath()}function No(r,e,t,i,o){const n=.5522848,a=i/2*n,d=o/2*n,p=e+i,v=t+o,g=e+i/2,w=t+o/2;r.beginPath(),r.moveTo(e,w),r.bezierCurveTo(e,w-d,g-a,t,g,t),r.bezierCurveTo(g+a,t,p,w-d,p,w),r.bezierCurveTo(p,w+d,g+a,v,g,v),r.bezierCurveTo(g-a,v,e,w+d,e,w),r.closePath()}function Qp(r,e,t,i,o){const n=o*.3333333333333333,a=.5522848,d=i/2*a,p=n/2*a,v=e+i,g=t+n,w=e+i/2,_=t+n/2,O=t+(o-n/2),$=t+o;r.beginPath(),r.moveTo(v,_),r.bezierCurveTo(v,_+p,w+d,g,w,g),r.bezierCurveTo(w-d,g,e,_+p,e,_),r.bezierCurveTo(e,_-p,w-d,t,w,t),r.bezierCurveTo(w+d,t,v,_-p,v,_),r.lineTo(v,O),r.bezierCurveTo(v,O+p,w+d,$,w,$),r.bezierCurveTo(w-d,$,e,O+p,e,O),r.lineTo(e,_)}function Jp(r,e,t,i,o,n){r.beginPath(),r.moveTo(e,t);const a=n.length,d=i-e,p=o-t,v=p/d;let g=Math.sqrt(d*d+p*p),w=0,_=!0,O=0,$=+n[0];for(;g>=.1;)$=+n[w++%a],$>g&&($=g),O=Math.sqrt($*$/(1+v*v)),O=d<0?-O:O,e+=O,t+=v*O,_===!0?r.lineTo(e,t):r.moveTo(e,t),g-=$,_=!_}const Zp={circle:ql,dashedLine:Jp,database:Qp,diamond:function(r,e,t,i){r.beginPath(),r.lineTo(e,t+i),r.lineTo(e+i,t),r.lineTo(e,t-i),r.lineTo(e-i,t),r.closePath()},ellipse:No,ellipse_vis:No,hexagon:function(r,e,t,i){r.beginPath();const o=2*Math.PI/6;r.moveTo(e+i,t);for(let n=1;n<6;n++)r.lineTo(e+i*Math.cos(o*n),t+i*Math.sin(o*n));r.closePath()},roundRect:Xp,square:function(r,e,t,i){r.beginPath(),r.rect(e-i,t-i,2*i,2*i),r.closePath()},star:function(r,e,t,i){r.beginPath(),t+=.1*(i*=.82);for(let o=0;o<10;o++){const n=o%2==0?1.3*i:.5*i;r.lineTo(e+n*Math.sin(2*o*Math.PI/10),t-n*Math.cos(2*o*Math.PI/10))}r.closePath()},triangle:function(r,e,t,i){r.beginPath(),t+=.275*(i*=1.15);const o=2*i,n=o/2,a=Math.sqrt(3)/6*o,d=Math.sqrt(o*o-n*n);r.moveTo(e,t-(d-a)),r.lineTo(e+n,t+a),r.lineTo(e-n,t+a),r.lineTo(e,t-(d-a)),r.closePath()},triangleDown:function(r,e,t,i){r.beginPath(),t-=.275*(i*=1.15);const o=2*i,n=o/2,a=Math.sqrt(3)/6*o,d=Math.sqrt(o*o-n*n);r.moveTo(e,t+(d-a)),r.lineTo(e+n,t-a),r.lineTo(e-n,t-a),r.lineTo(e,t+(d-a)),r.closePath()}};var ef={exports:{}};(function(r){function e(t){if(t)return function(i){for(var o in e.prototype)i[o]=e.prototype[o];return i}(t)}r.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(i),this},e.prototype.once=function(t,i){function o(){this.off(t,o),i.apply(this,arguments)}return o.fn=i,this.on(t,o),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var o,n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var a=0;a<n.length;a++)if((o=n[a])===i||o.fn===i){n.splice(a,1);break}return n.length===0&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),o=this._callbacks["$"+t],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(o){n=0;for(var a=(o=o.slice(0)).length;n<a;++n)o[n].apply(this,i)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}})(ef);var tf=A(ef.exports),Oi=yi,Ir=Array.isArray||function(r){return Oi(r)==="Array"},pw=TypeError,Da=function(r){if(r>9007199254740991)throw pw("Maximum allowed index exceeded");return r},fw=Oa,rf=It,vw=wo,Hn=function(r,e,t){var i=fw(e);i in r?rf.f(r,i,vw(0,t)):r[i]=t},Gl={};Gl[Me("toStringTag")]="z";var Kl=String(Gl)==="[object z]",gw=Kl,mw=Qe,Wn=yi,yw=Me("toStringTag"),of=Object,Yl=Wn(function(){return arguments}())==="Arguments",$r=gw?Wn:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=function(o,n){try{return o[n]}catch{}}(e=of(r),yw))=="string"?t:Yl?Wn(e):(i=Wn(e))==="Object"&&mw(e.callee)?"Arguments":i},bw=Qe,Cr=Ol,nf=de(Function.toString);bw(Cr.inspectSource)||(Cr.inspectSource=function(r){return nf(r)});var Ma=Cr.inspectSource,sf=de,ww=G,af=Qe,_w=$r,Ew=Ma,Xl=function(){},Ow=[],hf=le("Reflect","construct"),Ro=/^\s*(?:class|function)\b/,xw=sf(Ro.exec),Sw=!Ro.test(Xl),Un=function(r){if(!af(r))return!1;try{return hf(Xl,Ow,r),!0}catch{return!1}},lf=function(r){if(!af(r))return!1;switch(_w(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Sw||!!xw(Ro,Ew(r))}catch{return!0}};lf.sham=!0;var Fo=!hf||ww(function(){var r;return Un(Un.call)||!Un(Object)||!Un(function(){r=!0})||r})?lf:Un,df=Ir,Tw=Fo,Iw=at,$w=Me("species"),cf=Array,Cw=function(r){var e;return df(r)&&(e=r.constructor,(Tw(e)&&(e===cf||df(e.prototype))||Iw(e)&&(e=e[$w])===null)&&(e=void 0)),e===void 0?cf:e},Aa=function(r,e){return new(Cw(r))(e===0?0:e)},uf=G,Pw=_r,kw=Me("species"),Vn=function(r){return Pw>=51||!uf(function(){var e=[];return(e.constructor={})[kw]=function(){return{foo:1}},e[r](Boolean).foo!==1})},Dw=V,pf=G,Mw=Ir,Aw=at,Nw=Bt,Rw=hi,ff=Da,Ui=Hn,Na=Aa,Fw=Vn,Bw=_r,vf=Me("isConcatSpreadable"),Ra=Bw>=51||!pf(function(){var r=[];return r[vf]=!1,r.concat()[0]!==r}),jw=function(r){if(!Aw(r))return!1;var e=r[vf];return e!==void 0?!!e:Mw(r)};Dw({target:"Array",proto:!0,arity:1,forced:!Ra||!Fw("concat")},{concat:function(r){var e,t,i,o,n,a=Nw(this),d=Na(a,0),p=0;for(e=-1,i=arguments.length;e<i;e++)if(jw(n=e===-1?a:arguments[e]))for(o=Rw(n),ff(p+o),t=0;t<o;t++,p++)t in n&&Ui(d,p,n[t]);else ff(p+1),Ui(d,p++,n);return d.length=p,d}});var zw=$r,Lw=String,Qt=function(r){if(zw(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Lw(r)},Fa={},qn=ze,Hw=Ap,Ql=It,Ww=_i,Uw=Yt,Vw=jn;Fa.f=qn&&!Hw?Object.defineProperties:function(r,e){Ww(r);for(var t,i=Uw(e),o=Vw(e),n=o.length,a=0;n>a;)Ql.f(r,t=o[a++],i[t]);return r};var Gn,gf=le("document","documentElement"),Jl=_a,mf=Hi("keys"),Ba=function(r){return mf[r]||(mf[r]=Jl(r))},ja=_i,qw=Fa,yf=$a,Gw=Bn,Kw=gf,Yw=Cp,Zl="prototype",ed="script",td=Ba("IE_PROTO"),id=function(){},bf=function(r){return"<"+ed+">"+r+"</"+ed+">"},rd=function(r){r.write(bf("")),r.close();var e=r.parentWindow.Object;return r=null,e},Pr=function(){try{Gn=new ActiveXObject("htmlfile")}catch{}var r,e,t;Pr=typeof document<"u"?document.domain&&Gn?rd(Gn):(e=Yw("iframe"),t="java"+ed+":",e.style.display="none",Kw.appendChild(e),e.src=String(t),(r=e.contentWindow.document).open(),r.write(bf("document.F=Object")),r.close(),r.F):rd(Gn);for(var i=yf.length;i--;)delete Pr[Zl][yf[i]];return Pr()};Gw[td]=!0;var Kn=Object.create||function(r,e){var t;return r!==null?(id[Zl]=ja(r),t=new id,id[Zl]=null,t[td]=r):t=Pr(),e===void 0?t:qw.f(t,e)},Yn={},wf=Tr,Xw=$a.concat("length","prototype");Yn.f=Object.getOwnPropertyNames||function(r){return wf(r,Xw)};var za={},_f=Rn,Qw=hi,Ef=Hn,Of=Array,od=Math.max,La=function(r,e,t){for(var i=Qw(r),o=_f(e,i),n=_f(t===void 0?i:t,i),a=Of(od(n-o,0)),d=0;o<n;o++,d++)Ef(a,d,r[o]);return a.length=d,a},xf=yi,nd=Yt,sd=Yn.f,Sf=La,Tf=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];za.f=function(r){return Tf&&xf(r)==="Window"?function(e){try{return sd(e)}catch{return Sf(Tf)}}(r):sd(nd(r))};var Ha=xr,Vi=function(r,e,t,i){return i&&i.enumerable?r[e]=t:Ha(r,e,t),r},kr=It,Dr=function(r,e,t){return kr.f(r,e,t)},Xn={},Jw=Me;Xn.f=Jw;var Wa,Mr,Qn,If=ne,Zw=Ze,e1=Xn,t1=It.f,Se=function(r){var e=If.Symbol||(If.Symbol={});Zw(e,r)||t1(e,r,{value:e1.f(r)})},i1=Je,r1=le,$f=Me,o1=Vi,ad=function(){var r=r1("Symbol"),e=r&&r.prototype,t=e&&e.valueOf,i=$f("toPrimitive");e&&!e[i]&&o1(e,i,function(o){return i1(t,this)},{arity:1})},n1=$r,Jn=Kl?{}.toString:function(){return"[object "+n1(this)+"]"},s1=Kl,Bo=It.f,a1=xr,hd=Ze,Zn=Jn,Cf=Me("toStringTag"),Ar=function(r,e,t,i){if(r){var o=t?r:r.prototype;hd(o,Cf)||Bo(o,Cf,{configurable:!0,value:e}),i&&!s1&&a1(o,"toString",Zn)}},h1=Qe,Pf=we.WeakMap,kf=h1(Pf)&&/native code/.test(String(Pf)),Ce=kf,Df=we,l1=at,d1=xr,ld=Ze,Ua=Ol,c1=Ba,u1=Bn,Mf="Object already initialized",dd=Df.TypeError,p1=Df.WeakMap;if(Ce||Ua.state){var li=Ua.state||(Ua.state=new p1);li.get=li.get,li.has=li.has,li.set=li.set,Wa=function(r,e){if(li.has(r))throw new dd(Mf);return e.facade=r,li.set(r,e),e},Mr=function(r){return li.get(r)||{}},Qn=function(r){return li.has(r)}}else{var jo=c1("state");u1[jo]=!0,Wa=function(r,e){if(ld(r,jo))throw new dd(Mf);return e.facade=r,d1(r,jo,e),e},Mr=function(r){return ld(r,jo)?r[jo]:{}},Qn=function(r){return ld(r,jo)}}var di={set:Wa,get:Mr,has:Qn,enforce:function(r){return Qn(r)?Mr(r):Wa(r,{})},getterFor:function(r){return function(e){var t;if(!l1(e)||(t=Mr(e)).type!==r)throw new dd("Incompatible receiver, "+r+" required");return t}}},f1=Ta,Af=pa,Nr=Bt,v1=hi,g1=Aa,cd=de([].push),qi=function(r){var e=r===1,t=r===2,i=r===3,o=r===4,n=r===6,a=r===7,d=r===5||n;return function(p,v,g,w){for(var _,O,$=Nr(p),P=Af($),C=f1(v,g),I=v1(P),M=0,L=w||g1,W=e?L(p,I):t||a?L(p,0):void 0;I>M;M++)if((d||M in P)&&(O=C(_=P[M],M,$),r))if(e)W[M]=O;else if(O)switch(r){case 3:return!0;case 5:return _;case 6:return M;case 2:cd(W,_)}else switch(r){case 4:return!1;case 7:cd(W,_)}return n?-1:i||o?o:W}},xi={forEach:qi(0),map:qi(1),filter:qi(2),some:qi(3),every:qi(4),find:qi(5),findIndex:qi(6),filterReject:qi(7)},es=V,Va=we,ud=Je,pd=de,Gi=ze,zo=Er,m1=G,Ve=Ze,fd=Ie,vd=_i,Rr=Yt,Fr=Oa,qa=Qt,gd=wo,ts=Kn,Jt=jn,Lo=Yn,Br=za,y1=zn,Nf=bo,Rf=It,b1=Fa,Ff=Pn,Bf=Vi,jf=Dr,ci=Hi,jr=Bn,is=_a,rs=Me,md=Xn,w1=Se,Ho=ad,Wo=Ar,zf=di,Ne=xi.forEach,Ct=Ba("hidden"),Uo="Symbol",Ki="prototype",yd=zf.set,Lf=zf.getterFor(Uo),At=Object[Ki],Zt=Va.Symbol,os=Zt&&Zt[Ki],_1=Va.RangeError,Hf=Va.TypeError,bd=Va.QObject,wd=Nf.f,Yi=Rf.f,Wf=Br.f,Uf=Ff.f,_d=pd([].push),Si=ci("symbols"),zr=ci("op-symbols"),E1=ci("wks"),Ga=!bd||!bd[Ki]||!bd[Ki].findChild,Ed=function(r,e,t){var i=wd(At,e);i&&delete At[e],Yi(r,e,t),i&&r!==At&&Yi(At,e,i)},Od=Gi&&m1(function(){return ts(Yi({},"a",{get:function(){return Yi(this,"a",{value:7}).a}})).a!==7})?Ed:Yi,xd=function(r,e){var t=Si[r]=ts(os);return yd(t,{type:Uo,tag:r,description:e}),Gi||(t.description=e),t},Ka=function(r,e,t){r===At&&Ka(zr,e,t),vd(r);var i=Fr(e);return vd(t),Ve(Si,i)?(t.enumerable?(Ve(r,Ct)&&r[Ct][i]&&(r[Ct][i]=!1),t=ts(t,{enumerable:gd(0,!1)})):(Ve(r,Ct)||Yi(r,Ct,gd(1,{})),r[Ct][i]=!0),Od(r,i,t)):Yi(r,i,t)},Sd=function(r,e){vd(r);var t=Rr(e),i=Jt(t).concat(pt(t));return Ne(i,function(o){Gi&&!ud(Vf,t,o)||Ka(r,o,t[o])}),r},Vf=function(r){var e=Fr(r),t=ud(Uf,this,e);return!(this===At&&Ve(Si,e)&&!Ve(zr,e))&&(!(t||!Ve(this,e)||!Ve(Si,e)||Ve(this,Ct)&&this[Ct][e])||t)},Td=function(r,e){var t=Rr(r),i=Fr(e);if(t!==At||!Ve(Si,i)||Ve(zr,i)){var o=wd(t,i);return!o||!Ve(Si,i)||Ve(t,Ct)&&t[Ct][i]||(o.enumerable=!0),o}},ns=function(r){var e=Wf(Rr(r)),t=[];return Ne(e,function(i){Ve(Si,i)||Ve(jr,i)||_d(t,i)}),t},pt=function(r){var e=r===At,t=Wf(e?zr:Rr(r)),i=[];return Ne(t,function(o){!Ve(Si,o)||e&&!Ve(At,o)||_d(i,Si[o])}),i};zo||(Zt=function(){if(fd(os,this))throw new Hf("Symbol is not a constructor");var r=arguments.length&&arguments[0]!==void 0?qa(arguments[0]):void 0,e=is(r),t=function(i){this===At&&ud(t,zr,i),Ve(this,Ct)&&Ve(this[Ct],e)&&(this[Ct][e]=!1);var o=gd(1,i);try{Od(this,e,o)}catch(n){if(!(n instanceof _1))throw n;Ed(this,e,o)}};return Gi&&Ga&&Od(At,e,{configurable:!0,set:t}),xd(e,r)},Bf(os=Zt[Ki],"toString",function(){return Lf(this).tag}),Bf(Zt,"withoutSetter",function(r){return xd(is(r),r)}),Ff.f=Vf,Rf.f=Ka,b1.f=Sd,Nf.f=Td,Lo.f=Br.f=ns,y1.f=pt,md.f=function(r){return xd(rs(r),r)},Gi&&jf(os,"description",{configurable:!0,get:function(){return Lf(this).description}})),es({global:!0,constructor:!0,wrap:!0,forced:!zo,sham:!zo},{Symbol:Zt}),Ne(Jt(E1),function(r){w1(r)}),es({target:Uo,stat:!0,forced:!zo},{useSetter:function(){Ga=!0},useSimple:function(){Ga=!1}}),es({target:"Object",stat:!0,forced:!zo,sham:!Gi},{create:function(r,e){return e===void 0?ts(r):Sd(ts(r),e)},defineProperty:Ka,defineProperties:Sd,getOwnPropertyDescriptor:Td}),es({target:"Object",stat:!0,forced:!zo},{getOwnPropertyNames:ns}),Ho(),Wo(Zt,Uo),jr[Ct]=!0;var ss=Er&&!!Symbol.for&&!!Symbol.keyFor,as=V,O1=le,qf=Ze,ei=Qt,Xi=Hi,hs=ss,Id=Xi("string-to-symbol-registry"),x1=Xi("symbol-to-string-registry");as({target:"Symbol",stat:!0,forced:!hs},{for:function(r){var e=ei(r);if(qf(Id,e))return Id[e];var t=O1("Symbol")(e);return Id[e]=t,x1[t]=e,t}});var $d=V,Gf=Ze,Lr=kn,Kf=Dn,S1=ss,Cd=Hi("symbol-to-string-registry");$d({target:"Symbol",stat:!0,forced:!S1},{keyFor:function(r){if(!Lr(r))throw new TypeError(Kf(r)+" is not a symbol");if(Gf(Cd,r))return Cd[r]}});var ui=Ir,ls=Qe,Yf=yi,Pd=Qt,kd=de([].push),Dd=V,Ya=le,ds=$n,Md=Je,cs=de,Ad=G,Nd=Qe,Rd=kn,Fd=Pa,T1=function(r){if(ls(r))return r;if(ui(r)){for(var e=r.length,t=[],i=0;i<e;i++){var o=r[i];typeof o=="string"?kd(t,o):typeof o!="number"&&Yf(o)!=="Number"&&Yf(o)!=="String"||kd(t,Pd(o))}var n=t.length,a=!0;return function(d,p){if(a)return a=!1,p;if(ui(this))return p;for(var v=0;v<n;v++)if(t[v]===d)return p}}},Xf=Er,I1=String,Qi=Ya("JSON","stringify"),Xa=cs(/./.exec),Qf=cs("".charAt),Jf=cs("".charCodeAt),$1=cs("".replace),Bd=cs(1 .toString),C1=/[\uD800-\uDFFF]/g,Zf=/^[\uD800-\uDBFF]$/,ev=/^[\uDC00-\uDFFF]$/,tv=!Xf||Ad(function(){var r=Ya("Symbol")("stringify detection");return Qi([r])!=="[null]"||Qi({a:r})!=="{}"||Qi(Object(r))!=="{}"}),iv=Ad(function(){return Qi("\uDF06\uD834")!=='"\\udf06\\ud834"'||Qi("\uDEAD")!=='"\\udead"'}),P1=function(r,e){var t=Fd(arguments),i=T1(e);if(Nd(i)||r!==void 0&&!Rd(r))return t[1]=function(o,n){if(Nd(i)&&(n=Md(i,this,I1(o),n)),!Rd(n))return n},ds(Qi,null,t)},k1=function(r,e,t){var i=Qf(t,e-1),o=Qf(t,e+1);return Xa(Zf,r)&&!Xa(ev,o)||Xa(ev,r)&&!Xa(Zf,i)?"\\u"+Bd(Jf(r,0),16):r};Qi&&Dd({target:"JSON",stat:!0,arity:3,forced:tv||iv},{stringify:function(r,e,t){var i=Fd(arguments),o=ds(tv?P1:Qi,null,i);return iv&&typeof o=="string"?$1(o,C1,k1):o}});var jd=zn,D1=Bt;V({target:"Object",stat:!0,forced:!Er||G(function(){jd.f(1)})},{getOwnPropertySymbols:function(r){var e=jd.f;return e?e(D1(r)):[]}}),Se("asyncIterator"),Se("hasInstance"),Se("isConcatSpreadable"),Se("iterator"),Se("match"),Se("matchAll"),Se("replace"),Se("search"),Se("species"),Se("split");var us=ad;Se("toPrimitive"),us();var M1=le,rv=Ar;Se("toStringTag"),rv(M1("Symbol"),"Symbol"),Se("unscopables"),Ar(we.JSON,"JSON",!0);var Hr,zd,ov,nv=ne.Symbol,Vo={},Ld=ze,sv=Ze,Hd=Function.prototype,A1=Ld&&Object.getOwnPropertyDescriptor,Wr=sv(Hd,"name"),av={EXISTS:Wr,PROPER:Wr&&function(){}.name==="something",CONFIGURABLE:Wr&&(!Ld||Ld&&A1(Hd,"name").configurable)},Wd=!G(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),hv=Ze,lv=Qe,N1=Bt,R1=Wd,dv=Ba("IE_PROTO"),pi=Object,Qa=pi.prototype,ps=R1?pi.getPrototypeOf:function(r){var e=N1(r);if(hv(e,dv))return e[dv];var t=e.constructor;return lv(t)&&e instanceof t?t.prototype:e instanceof pi?Qa:null},F1=G,B1=Qe,j1=at,z1=Kn,Ud=ps,cv=Vi,Ja=Me("iterator"),Vd=!1;[].keys&&("next"in(ov=[].keys())?(zd=Ud(Ud(ov)))!==Object.prototype&&(Hr=zd):Vd=!0);var L1=!j1(Hr)||F1(function(){var r={};return Hr[Ja].call(r)!==r});B1((Hr=L1?{}:z1(Hr))[Ja])||cv(Hr,Ja,function(){return this});var uv={IteratorPrototype:Hr,BUGGY_SAFARI_ITERATORS:Vd},H1=uv.IteratorPrototype,W1=Kn,U1=wo,pv=Ar,V1=Vo,q1=function(){return this},G1=V,K1=Je,Y1=av,X1=function(r,e,t,i){var o=e+" Iterator";return r.prototype=W1(H1,{next:U1(+!i,t)}),pv(r,o,!1,!0),V1[o]=q1,r},Q1=ps,J1=Ar,fv=Vi,vv=Vo,Z1=uv,e_=Y1.PROPER,Za=Z1.BUGGY_SAFARI_ITERATORS,qd=Me("iterator"),gv="keys",eh="values",mv="entries",t_=function(){return this},Gd=function(r,e,t,i,o,n,a){X1(t,e,i);var d,p,v,g=function(I){if(I===o&&P)return P;if(!Za&&I&&I in O)return O[I];switch(I){case gv:case eh:case mv:return function(){return new t(this,I)}}return function(){return new t(this)}},w=e+" Iterator",_=!1,O=r.prototype,$=O[qd]||O["@@iterator"]||o&&O[o],P=!Za&&$||g(o),C=e==="Array"&&O.entries||$;if(C&&(d=Q1(C.call(new r)))!==Object.prototype&&d.next&&(J1(d,w,!0,!0),vv[w]=t_),e_&&o===eh&&$&&$.name!==eh&&(_=!0,P=function(){return K1($,this)}),o)if(p={values:g(eh),keys:n?P:g(gv),entries:g(mv)},a)for(v in p)(Za||_||!(v in O))&&fv(O,v,p[v]);else G1({target:e,proto:!0,forced:Za||_},p);return a&&O[qd]!==P&&fv(O,qd,P,{name:o}),vv[e]=P,p},Kd=function(r,e){return{value:r,done:e}},i_=Yt,yv=Vo,Ur=di;It.f;var Yd=Gd,th=Kd,Xd="Array Iterator",r_=Ur.set,Qd=Ur.getterFor(Xd);Yd(Array,"Array",function(r,e){r_(this,{type:Xd,target:i_(r),index:0,kind:e})},function(){var r=Qd(this),e=r.target,t=r.kind,i=r.index++;if(!e||i>=e.length)return r.target=void 0,th(void 0,!0);switch(t){case"keys":return th(i,!1);case"values":return th(e[i],!1)}return th([i,e[i]],!1)},"values"),yv.Arguments=yv.Array;var o_={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},n_=we,s_=$r,a_=xr,Jd=Vo,bv=Me("toStringTag");for(var Zd in o_){var wv=n_[Zd],ec=wv&&wv.prototype;ec&&s_(ec)!==bv&&a_(ec,bv,Zd),Jd[Zd]=Jd.Array}var _v=nv,Ev=A(_v),tc=V,Ov=Ir,ih=Fo,h_=at,xv=Rn,l_=hi,d_=Yt,Sv=Hn,c_=Me,u_=Pa,ic=Vn("slice"),Tv=c_("species"),ti=Array,rc=Math.max;tc({target:"Array",proto:!0,forced:!ic},{slice:function(r,e){var t,i,o,n=d_(this),a=l_(n),d=xv(r,a),p=xv(e===void 0?a:e,a);if(Ov(n)&&(t=n.constructor,(ih(t)&&(t===ti||Ov(t.prototype))||h_(t)&&(t=t[Tv])===null)&&(t=void 0),t===ti||t===void 0))return u_(n,d,p);for(i=new(t===void 0?ti:t)(rc(p-d,0)),o=0;d<p;d++,o++)d in n&&Sv(i,o,n[d]);return i.length=o,i}});var oc=et("Array").slice,p_=Ie,Iv=oc,nc=Array.prototype,f_=function(r){var e=r.slice;return r===nc||p_(nc,r)&&e===nc.slice?Iv:e},fi=A(f_),v_=le,g_=Yn,m_=zn,y_=_i,b_=de([].concat),w_=v_("Reflect","ownKeys")||function(r){var e=g_.f(y_(r)),t=m_.f;return t?b_(e,t(r)):e};V({target:"Array",stat:!0},{isArray:Ir});var Pe=A(ne.Array.isArray),__=xi.map;V({target:"Array",proto:!0,forced:!Vn("map")},{map:function(r){return __(this,r,arguments.length>1?arguments[1]:void 0)}});var E_=et("Array").map,O_=Ie,x_=E_,sc=Array.prototype,S_=function(r){var e=r.map;return r===sc||O_(sc,r)&&e===sc.map?x_:e},qo=A(S_),$v=Bt,Cv=jn;V({target:"Object",stat:!0,forced:G(function(){Cv(1)})},{keys:function(r){return Cv($v(r))}});var ke=A(ne.Object.keys),Pv=V,kv=Date,T_=de(kv.prototype.getTime);Pv({target:"Date",stat:!0},{now:function(){return T_(new kv)}});var rh=A(ne.Date.now),Dv=G,Go=function(r,e){var t=[][r];return!!t&&Dv(function(){t.call(null,e||function(){return 1},1)})},Mv=xi.forEach,ac=Go("forEach")?[].forEach:function(r){return Mv(this,r,arguments.length>1?arguments[1]:void 0)};V({target:"Array",proto:!0,forced:[].forEach!==ac},{forEach:ac});var I_=et("Array").forEach,oh=$r,hc=Ze,Av=Ie,nh=I_,sh=Array.prototype,$_={DOMTokenList:!0,NodeList:!0},lc=function(r){var e=r.forEach;return r===sh||Av(sh,r)&&e===sh.forEach||hc($_,oh(r))?nh:e},ue=A(lc),C_=V,Nv=Ir,Rv=de([].reverse),Fv=[1,2];C_({target:"Array",proto:!0,forced:String(Fv)===String(Fv.reverse())},{reverse:function(){return Nv(this)&&(this.length=this.length),Rv(this)}});var ah=et("Array").reverse,Bv=Ie,P_=ah,dc=Array.prototype,k_=function(r){var e=r.reverse;return r===dc||Bv(dc,r)&&e===dc.reverse?P_:e},Vr=A(k_),D_=ze,M_=Ir,A_=TypeError,jv=Object.getOwnPropertyDescriptor,N_=D_&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(r){return r instanceof TypeError}}(),cc=Dn,uc=TypeError,pc=function(r,e){if(!delete r[e])throw new uc("Cannot delete property "+cc(e)+" of "+cc(r))},fc=V,R_=Bt,zv=Rn,F_=Sr,B_=hi,Lv=N_?function(r,e){if(M_(r)&&!jv(r,"length").writable)throw new A_("Cannot set read only .length");return r.length=e}:function(r,e){return r.length=e},Hv=Da,j_=Aa,z_=Hn,vc=pc,L_=Vn("splice"),H_=Math.max,W_=Math.min;fc({target:"Array",proto:!0,forced:!L_},{splice:function(r,e){var t,i,o,n,a,d,p=R_(this),v=B_(p),g=zv(r,v),w=arguments.length;for(w===0?t=i=0:w===1?(t=0,i=v-g):(t=w-2,i=W_(H_(F_(e),0),v-g)),Hv(v+t-i),o=j_(p,i),n=0;n<i;n++)(a=g+n)in p&&z_(o,n,p[a]);if(o.length=i,t<i){for(n=g;n<v-i;n++)d=n+t,(a=n+i)in p?p[d]=p[a]:vc(p,d);for(n=v;n>v-i+t;n--)vc(p,n-1)}else if(t>i)for(n=v-i;n>g;n--)d=n+t-1,(a=n+i-1)in p?p[d]=p[a]:vc(p,d);for(n=0;n<t;n++)p[n+g]=arguments[n+2];return Lv(p,v-i+t),o}});var U_=et("Array").splice,gc=Ie,V_=U_,mc=Array.prototype,Wv=function(r){var e=r.splice;return r===mc||gc(mc,r)&&e===mc.splice?V_:e},Ti=A(Wv),q_=zl.includes;V({target:"Array",proto:!0,forced:G(function(){return!Array(1).includes()})},{includes:function(r){return q_(this,r,arguments.length>1?arguments[1]:void 0)}});var G_=et("Array").includes,Uv=at,K_=yi,Y_=Me("match"),X_=function(r){var e;return Uv(r)&&((e=r[Y_])!==void 0?!!e:K_(r)==="RegExp")},hh=TypeError,Vv=Me("match"),qv=V,Q_=function(r){if(X_(r))throw new hh("The method doesn't accept regular expressions");return r},Gv=Li,lh=Qt,Kv=function(r){var e=/./;try{"/./"[r](e)}catch{try{return e[Vv]=!1,"/./"[r](e)}catch{}}return!1},J_=de("".indexOf);qv({target:"String",proto:!0,forced:!Kv("includes")},{includes:function(r){return!!~J_(lh(Gv(this)),lh(Q_(r)),arguments.length>1?arguments[1]:void 0)}});var Yv=et("String").includes,yc=Ie,Z_=G_,eE=Yv,bc=Array.prototype,wc=String.prototype,tE=function(r){var e=r.includes;return r===bc||yc(bc,r)&&e===bc.includes?Z_:typeof r=="string"||r===wc||yc(wc,r)&&e===wc.includes?eE:e},Ji=A(tE),iE=Bt,Xv=ps,rE=Wd;V({target:"Object",stat:!0,forced:G(function(){Xv(1)}),sham:!rE},{getPrototypeOf:function(r){return Xv(iE(r))}});var Qv=A(ne.Object.getPrototypeOf),oE=et("Array").concat,nE=Ie,sE=oE,fs=Array.prototype,Ko=function(r){var e=r.concat;return r===fs||nE(fs,r)&&e===fs.concat?sE:e},_c=A(Ko),aE=xi.filter;V({target:"Array",proto:!0,forced:!Vn("filter")},{filter:function(r){return aE(this,r,arguments.length>1?arguments[1]:void 0)}});var hE=et("Array").filter,lE=Ie,dE=hE,dh=Array.prototype,cE=function(r){var e=r.filter;return r===dh||lE(dh,r)&&e===dh.filter?dE:e},ft=A(cE),Jv=ze,uE=G,Zv=de,eg=ps,pE=jn,tg=Yt,Ec=Zv(Pn.f),fE=Zv([].push),vE=Jv&&uE(function(){var r=Object.create(null);return r[2]=2,!Ec(r,2)}),ig=function(r){return function(e){for(var t,i=tg(e),o=pE(i),n=vE&&eg(i)===null,a=o.length,d=0,p=[];a>d;)t=o[d++],Jv&&!(n?t in i:Ec(i,t))||fE(p,r?[t,i[t]]:i[t]);return p}},gE={entries:ig(!0),values:ig(!1)}.values;V({target:"Object",stat:!0},{values:function(r){return gE(r)}});var mE=A(ne.Object.values),ch=`	
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,yE=Li,bE=Qt,Oc=ch,rg=de("".replace),og=RegExp("^["+Oc+"]+"),wE=RegExp("(^|[^"+Oc+"])["+Oc+"]+$"),Zi=function(r){return function(e){var t=bE(yE(e));return 1&r&&(t=rg(t,og,"")),2&r&&(t=rg(t,wE,"$1")),t}},ng={start:Zi(1),end:Zi(2),trim:Zi(3)},sg=we,_E=G,EE=de,OE=Qt,xE=ng.trim,ag=ch,vs=sg.parseInt,hg=sg.Symbol,lg=hg&&hg.iterator,dg=/^[+-]?0x/i,cg=EE(dg.exec),xc=vs(ag+"08")!==8||vs(ag+"0x16")!==22||lg&&!_E(function(){vs(Object(lg))})?function(r,e){var t=xE(OE(r));return vs(t,e>>>0||(cg(dg,t)?16:10))}:vs;V({global:!0,forced:parseInt!==xc},{parseInt:xc});var tt=A(ne.parseInt),jt=V,ug=zl.indexOf,SE=Go,Sc=ca([].indexOf),pg=!!Sc&&1/Sc([1],1,-0)<0;jt({target:"Array",proto:!0,forced:pg||!SE("indexOf")},{indexOf:function(r){var e=arguments.length>1?arguments[1]:void 0;return pg?Sc(this,r,e)||0:ug(this,r,e)}});var fg=et("Array").indexOf,TE=Ie,vg=fg,Tc=Array.prototype,IE=function(r){var e=r.indexOf;return r===Tc||TE(Tc,r)&&e===Tc.indexOf?vg:e},ce=A(IE);V({target:"Object",stat:!0,sham:!ze},{create:Kn});var $E=ne.Object,er=A(function(r,e){return $E.create(r,e)}),Ic=ne,gg=$n;Ic.JSON||(Ic.JSON={stringify:JSON.stringify});var CE=function(r,e,t){return gg(Ic.JSON.stringify,null,arguments)},gs=A(CE),lt=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",PE=TypeError,mg=we,kE=$n,DE=Qe,$c=lt,ME=wr,AE=Pa,yg=function(r,e){if(r<e)throw new PE("Not enough arguments");return r},NE=mg.Function,qr=/MSIE .\./.test(ME)||$c&&function(){var r=mg.Bun.version.split(".");return r.length<3||r[0]==="0"&&(r[1]<3||r[1]==="3"&&r[2]==="0")}(),bg=function(r,e){var t=e?2:1;return qr?function(i,o){var n=yg(arguments.length,1)>t,a=DE(i)?i:NE(i),d=n?AE(arguments,t):[],p=n?function(){kE(a,this,d)}:a;return e?r(p,o):r(p)}:r},RE=V,wg=we,_g=bg(wg.setInterval,!0);RE({global:!0,bind:!0,forced:wg.setInterval!==_g},{setInterval:_g});var FE=V,Cc=we,Eg=bg(Cc.setTimeout,!0);FE({global:!0,bind:!0,forced:Cc.setTimeout!==Eg},{setTimeout:Eg});var Ii=A(ne.setTimeout),uh=Bt,Og=Rn,BE=hi,ms=function(r){for(var e=uh(this),t=BE(e),i=arguments.length,o=Og(i>1?arguments[1]:void 0,t),n=i>2?arguments[2]:void 0,a=n===void 0?t:Og(n,t);a>o;)e[o++]=r;return e};V({target:"Array",proto:!0},{fill:ms});var xg,jE=et("Array").fill,zE=Ie,Sg=jE,Pc=Array.prototype,LE=function(r){var e=r.fill;return r===Pc||zE(Pc,r)&&e===Pc.fill?Sg:e},ys=A(LE);/*! Hammer.JS - v2.0.17-rc - 2019-12-16
	 * http://naver.github.io/egjs
	 *
	 * Forked By Naver egjs
	 * Copyright (c) hammerjs
	 * Licensed under the MIT license */function ii(){return ii=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},ii.apply(this,arguments)}function zt(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}function ph(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}xg=typeof Object.assign!="function"?function(r){if(r==null)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(r),t=1;t<arguments.length;t++){var i=arguments[t];if(i!=null)for(var o in i)i.hasOwnProperty(o)&&(e[o]=i[o])}return e}:Object.assign;var tr,$i=xg,Tg=["","webkit","Moz","MS","ms","o"],HE=typeof document>"u"?{style:{}}:document.createElement("div"),Yo=Math.round,Gr=Math.abs,fh=Date.now;function vh(r,e){for(var t,i,o=e[0].toUpperCase()+e.slice(1),n=0;n<Tg.length;){if((i=(t=Tg[n])?t+o:e)in r)return i;n++}}tr=typeof window>"u"?{}:window;var Ig=vh(HE.style,"touchAction"),$g=Ig!==void 0,Cg="compute",Pg="auto",kc="manipulation",Kr="none",bs="pan-x",Yr="pan-y",gh=function(){if(!$g)return!1;var r={},e=tr.CSS&&tr.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return r[t]=!e||tr.CSS.supports("touch-action",t)}),r}(),kg="ontouchstart"in tr,WE=vh(tr,"PointerEvent")!==void 0,UE=kg&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),De="touch",Dc="mouse",VE=25,vt=1,Le=4,Pt=8,mh=1,ws=2,_s=4,Xr=8,Xo=16,vi=ws|_s,Qr=Xr|Xo,Dg=vi|Qr,kt=["x","y"],yh=["clientX","clientY"];function Ci(r,e,t){var i;if(r)if(r.forEach)r.forEach(e,t);else if(r.length!==void 0)for(i=0;i<r.length;)e.call(t,r[i],i,r),i++;else for(i in r)r.hasOwnProperty(i)&&e.call(t,r[i],i,r)}function bh(r,e){return typeof r=="function"?r.apply(e&&e[0]||void 0,e):r}function Jr(r,e){return r.indexOf(e)>-1}var Mc=function(){function r(t,i){this.manager=t,this.set(i)}var e=r.prototype;return e.set=function(t){t===Cg&&(t=this.compute()),$g&&this.manager.element.style&&gh[t]&&(this.manager.element.style[Ig]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return Ci(this.manager.recognizers,function(i){bh(i.options.enable,[i])&&(t=t.concat(i.getTouchAction()))}),function(i){if(Jr(i,Kr))return Kr;var o=Jr(i,bs),n=Jr(i,Yr);return o&&n?Kr:o||n?o?bs:Yr:Jr(i,kc)?kc:Pg}(t.join(" "))},e.preventDefaults=function(t){var i=t.srcEvent,o=t.offsetDirection;if(this.manager.session.prevented)i.preventDefault();else{var n=this.actions,a=Jr(n,Kr)&&!gh[Kr],d=Jr(n,Yr)&&!gh[Yr],p=Jr(n,bs)&&!gh[bs];if(a){var v=t.pointers.length===1,g=t.distance<2,w=t.deltaTime<250;if(v&&g&&w)return}if(!p||!d)return a||d&&o&vi||p&&o&Qr?this.preventSrc(i):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},r}();function Ac(r,e){for(;r;){if(r===e)return!0;r=r.parentNode}return!1}function Mg(r){var e=r.length;if(e===1)return{x:Yo(r[0].clientX),y:Yo(r[0].clientY)};for(var t=0,i=0,o=0;o<e;)t+=r[o].clientX,i+=r[o].clientY,o++;return{x:Yo(t/e),y:Yo(i/e)}}function Ag(r){for(var e=[],t=0;t<r.pointers.length;)e[t]={clientX:Yo(r.pointers[t].clientX),clientY:Yo(r.pointers[t].clientY)},t++;return{timeStamp:fh(),pointers:e,center:Mg(e),deltaX:r.deltaX,deltaY:r.deltaY}}function wh(r,e,t){t||(t=kt);var i=e[t[0]]-r[t[0]],o=e[t[1]]-r[t[1]];return Math.sqrt(i*i+o*o)}function Nc(r,e,t){t||(t=kt);var i=e[t[0]]-r[t[0]],o=e[t[1]]-r[t[1]];return 180*Math.atan2(o,i)/Math.PI}function Ng(r,e){return r===e?mh:Gr(r)>=Gr(e)?r<0?ws:_s:e<0?Xr:Xo}function Rg(r,e,t){return{x:e/r||0,y:t/r||0}}function qE(r,e){var t=r.session,i=e.pointers,o=i.length;t.firstInput||(t.firstInput=Ag(e)),o>1&&!t.firstMultiple?t.firstMultiple=Ag(e):o===1&&(t.firstMultiple=!1);var n=t.firstInput,a=t.firstMultiple,d=a?a.center:n.center,p=e.center=Mg(i);e.timeStamp=fh(),e.deltaTime=e.timeStamp-n.timeStamp,e.angle=Nc(d,p),e.distance=wh(d,p),function(P,C){var I=C.center,M=P.offsetDelta||{},L=P.prevDelta||{},W=P.prevInput||{};C.eventType!==vt&&W.eventType!==Le||(L=P.prevDelta={x:W.deltaX||0,y:W.deltaY||0},M=P.offsetDelta={x:I.x,y:I.y}),C.deltaX=L.x+(I.x-M.x),C.deltaY=L.y+(I.y-M.y)}(t,e),e.offsetDirection=Ng(e.deltaX,e.deltaY);var v,g,w=Rg(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=w.x,e.overallVelocityY=w.y,e.overallVelocity=Gr(w.x)>Gr(w.y)?w.x:w.y,e.scale=a?(v=a.pointers,wh((g=i)[0],g[1],yh)/wh(v[0],v[1],yh)):1,e.rotation=a?function(P,C){return Nc(C[1],C[0],yh)+Nc(P[1],P[0],yh)}(a.pointers,i):0,e.maxPointers=t.prevInput?e.pointers.length>t.prevInput.maxPointers?e.pointers.length:t.prevInput.maxPointers:e.pointers.length,function(P,C){var I,M,L,W,Y=P.lastInterval||C,pe=C.timeStamp-Y.timeStamp;if(C.eventType!==Pt&&(pe>VE||Y.velocity===void 0)){var He=C.deltaX-Y.deltaX,ct=C.deltaY-Y.deltaY,Xe=Rg(pe,He,ct);M=Xe.x,L=Xe.y,I=Gr(Xe.x)>Gr(Xe.y)?Xe.x:Xe.y,W=Ng(He,ct),P.lastInterval=C}else I=Y.velocity,M=Y.velocityX,L=Y.velocityY,W=Y.direction;C.velocity=I,C.velocityX=M,C.velocityY=L,C.direction=W}(t,e);var _,O=r.element,$=e.srcEvent;Ac(_=$.composedPath?$.composedPath()[0]:$.path?$.path[0]:$.target,O)&&(O=_),e.target=O}function GE(r,e,t){var i=t.pointers.length,o=t.changedPointers.length,n=e&vt&&i-o==0,a=e&(Le|Pt)&&i-o==0;t.isFirst=!!n,t.isFinal=!!a,n&&(r.session={}),t.eventType=e,qE(r,t),r.emit("hammer.input",t),r.recognize(t),r.session.prevInput=t}function Es(r){return r.trim().split(/\s+/g)}function Os(r,e,t){Ci(Es(e),function(i){r.addEventListener(i,t,!1)})}function Zr(r,e,t){Ci(Es(e),function(i){r.removeEventListener(i,t,!1)})}function Fg(r){var e=r.ownerDocument||r;return e.defaultView||e.parentWindow||window}var Qo=function(){function r(t,i){var o=this;this.manager=t,this.callback=i,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(n){bh(t.options.enable,[t])&&o.handler(n)},this.init()}var e=r.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Os(this.element,this.evEl,this.domHandler),this.evTarget&&Os(this.target,this.evTarget,this.domHandler),this.evWin&&Os(Fg(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Zr(this.element,this.evEl,this.domHandler),this.evTarget&&Zr(this.target,this.evTarget,this.domHandler),this.evWin&&Zr(Fg(this.element),this.evWin,this.domHandler)},r}();function eo(r,e,t){if(r.indexOf&&!t)return r.indexOf(e);for(var i=0;i<r.length;){if(t&&r[i][t]==e||!t&&r[i]===e)return i;i++}return-1}var KE={pointerdown:vt,pointermove:2,pointerup:Le,pointercancel:Pt,pointerout:Pt},YE={2:De,3:"pen",4:Dc,5:"kinect"},Bg="pointerdown",jg="pointermove pointerup pointercancel";tr.MSPointerEvent&&!tr.PointerEvent&&(Bg="MSPointerDown",jg="MSPointerMove MSPointerUp MSPointerCancel");var zg=function(r){function e(){var t,i=e.prototype;return i.evEl=Bg,i.evWin=jg,(t=r.apply(this,arguments)||this).store=t.manager.session.pointerEvents=[],t}return zt(e,r),e.prototype.handler=function(t){var i=this.store,o=!1,n=t.type.toLowerCase().replace("ms",""),a=KE[n],d=YE[t.pointerType]||t.pointerType,p=d===De,v=eo(i,t.pointerId,"pointerId");a&vt&&(t.button===0||p)?v<0&&(i.push(t),v=i.length-1):a&(Le|Pt)&&(o=!0),v<0||(i[v]=t,this.callback(this.manager,a,{pointers:i,changedPointers:[t],pointerType:d,srcEvent:t}),o&&i.splice(v,1))},e}(Qo);function xs(r){return Array.prototype.slice.call(r,0)}function _h(r,e,t){for(var i=[],o=[],n=0;n<r.length;){var a=e?r[n][e]:r[n];eo(o,a)<0&&i.push(r[n]),o[n]=a,n++}return t&&(i=e?i.sort(function(d,p){return d[e]>p[e]}):i.sort()),i}var XE={touchstart:vt,touchmove:2,touchend:Le,touchcancel:Pt},Eh=function(r){function e(){var t;return e.prototype.evTarget="touchstart touchmove touchend touchcancel",(t=r.apply(this,arguments)||this).targetIds={},t}return zt(e,r),e.prototype.handler=function(t){var i=XE[t.type],o=QE.call(this,t,i);o&&this.callback(this.manager,i,{pointers:o[0],changedPointers:o[1],pointerType:De,srcEvent:t})},e}(Qo);function QE(r,e){var t,i,o=xs(r.touches),n=this.targetIds;if(e&(2|vt)&&o.length===1)return n[o[0].identifier]=!0,[o,o];var a=xs(r.changedTouches),d=[],p=this.target;if(i=o.filter(function(v){return Ac(v.target,p)}),e===vt)for(t=0;t<i.length;)n[i[t].identifier]=!0,t++;for(t=0;t<a.length;)n[a[t].identifier]&&d.push(a[t]),e&(Le|Pt)&&delete n[a[t].identifier],t++;return d.length?[_h(i.concat(d),"identifier",!0),d]:void 0}var JE={mousedown:vt,mousemove:2,mouseup:Le},Rc=function(r){function e(){var t,i=e.prototype;return i.evEl="mousedown",i.evWin="mousemove mouseup",(t=r.apply(this,arguments)||this).pressed=!1,t}return zt(e,r),e.prototype.handler=function(t){var i=JE[t.type];i&vt&&t.button===0&&(this.pressed=!0),2&i&&t.which!==1&&(i=Le),this.pressed&&(i&Le&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[t],changedPointers:[t],pointerType:Dc,srcEvent:t}))},e}(Qo),ZE=2500;function Lg(r){var e=r.changedPointers[0];if(e.identifier===this.primaryTouch){var t={x:e.clientX,y:e.clientY},i=this.lastTouches;this.lastTouches.push(t),setTimeout(function(){var o=i.indexOf(t);o>-1&&i.splice(o,1)},ZE)}}function eO(r,e){r&vt?(this.primaryTouch=e.changedPointers[0].identifier,Lg.call(this,e)):r&(Le|Pt)&&Lg.call(this,e)}function tO(r){for(var e=r.srcEvent.clientX,t=r.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var o=this.lastTouches[i],n=Math.abs(e-o.x),a=Math.abs(t-o.y);if(n<=25&&a<=25)return!0}return!1}var Fc=function(){return function(r){function e(t,i){var o;return(o=r.call(this,t,i)||this).handler=function(n,a,d){var p=d.pointerType===De,v=d.pointerType===Dc;if(!(v&&d.sourceCapabilities&&d.sourceCapabilities.firesTouchEvents)){if(p)eO.call(ph(ph(o)),a,d);else if(v&&tO.call(ph(ph(o)),d))return;o.callback(n,a,d)}},o.touch=new Eh(o.manager,o.handler),o.mouse=new Rc(o.manager,o.handler),o.primaryTouch=null,o.lastTouches=[],o}return zt(e,r),e.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},e}(Qo)}();function Jo(r,e,t){return!!Array.isArray(r)&&(Ci(r,t[e],t),!0)}var Pi=32,iO=1;function Oh(r,e){var t=e.manager;return t?t.get(r):r}function Hg(r){return 16&r?"cancel":8&r?"end":4&r?"move":2&r?"start":""}var Ss=function(){function r(t){t===void 0&&(t={}),this.options=ii({enable:!0},t),this.id=iO++,this.manager=null,this.state=1,this.simultaneous={},this.requireFail=[]}var e=r.prototype;return e.set=function(t){return $i(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(Jo(t,"recognizeWith",this))return this;var i=this.simultaneous;return i[(t=Oh(t,this)).id]||(i[t.id]=t,t.recognizeWith(this)),this},e.dropRecognizeWith=function(t){return Jo(t,"dropRecognizeWith",this)||(t=Oh(t,this),delete this.simultaneous[t.id]),this},e.requireFailure=function(t){if(Jo(t,"requireFailure",this))return this;var i=this.requireFail;return eo(i,t=Oh(t,this))===-1&&(i.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(Jo(t,"dropRequireFailure",this))return this;t=Oh(t,this);var i=eo(this.requireFail,t);return i>-1&&this.requireFail.splice(i,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(t){var i=this,o=this.state;function n(a){i.manager.emit(a,t)}o<8&&n(i.options.event+Hg(o)),n(i.options.event),t.additionalEvent&&n(t.additionalEvent),o>=8&&n(i.options.event+Hg(o))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=Pi},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},e.recognize=function(t){var i=$i({},t);if(!bh(this.options.enable,[this,i]))return this.reset(),void(this.state=Pi);56&this.state&&(this.state=1),this.state=this.process(i),30&this.state&&this.tryEmit(i)},e.process=function(t){},e.getTouchAction=function(){},e.reset=function(){},r}(),Zo=function(r){function e(i){var o;return i===void 0&&(i={}),(o=r.call(this,ii({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},i))||this).pTime=!1,o.pCenter=!1,o._timer=null,o._input=null,o.count=0,o}zt(e,r);var t=e.prototype;return t.getTouchAction=function(){return[kc]},t.process=function(i){var o=this,n=this.options,a=i.pointers.length===n.pointers,d=i.distance<n.threshold,p=i.deltaTime<n.time;if(this.reset(),i.eventType&vt&&this.count===0)return this.failTimeout();if(d&&p&&a){if(i.eventType!==Le)return this.failTimeout();var v=!this.pTime||i.timeStamp-this.pTime<n.interval,g=!this.pCenter||wh(this.pCenter,i.center)<n.posThreshold;if(this.pTime=i.timeStamp,this.pCenter=i.center,g&&v?this.count+=1:this.count=1,this._input=i,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){o.state=8,o.tryEmit()},n.interval),2):8}return Pi},t.failTimeout=function(){var i=this;return this._timer=setTimeout(function(){i.state=Pi},this.options.interval),Pi},t.reset=function(){clearTimeout(this._timer)},t.emit=function(){this.state===8&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(Ss),en=function(r){function e(i){return i===void 0&&(i={}),r.call(this,ii({pointers:1},i))||this}zt(e,r);var t=e.prototype;return t.attrTest=function(i){var o=this.options.pointers;return o===0||i.pointers.length===o},t.process=function(i){var o=this.state,n=i.eventType,a=6&o,d=this.attrTest(i);return a&&(n&Pt||!d)?16|o:a||d?n&Le?8|o:2&o?4|o:2:Pi},e}(Ss);function Wg(r){return r===Xo?"down":r===Xr?"up":r===ws?"left":r===_s?"right":""}var Bc=function(r){function e(i){var o;return i===void 0&&(i={}),(o=r.call(this,ii({event:"pan",threshold:10,pointers:1,direction:Dg},i))||this).pX=null,o.pY=null,o}zt(e,r);var t=e.prototype;return t.getTouchAction=function(){var i=this.options.direction,o=[];return i&vi&&o.push(Yr),i&Qr&&o.push(bs),o},t.directionTest=function(i){var o=this.options,n=!0,a=i.distance,d=i.direction,p=i.deltaX,v=i.deltaY;return d&o.direction||(o.direction&vi?(d=p===0?mh:p<0?ws:_s,n=p!==this.pX,a=Math.abs(i.deltaX)):(d=v===0?mh:v<0?Xr:Xo,n=v!==this.pY,a=Math.abs(i.deltaY))),i.direction=d,n&&a>o.threshold&&d&o.direction},t.attrTest=function(i){return en.prototype.attrTest.call(this,i)&&(2&this.state||!(2&this.state)&&this.directionTest(i))},t.emit=function(i){this.pX=i.deltaX,this.pY=i.deltaY;var o=Wg(i.direction);o&&(i.additionalEvent=this.options.event+o),r.prototype.emit.call(this,i)},e}(en),Ug=function(r){function e(i){return i===void 0&&(i={}),r.call(this,ii({event:"swipe",threshold:10,velocity:.3,direction:vi|Qr,pointers:1},i))||this}zt(e,r);var t=e.prototype;return t.getTouchAction=function(){return Bc.prototype.getTouchAction.call(this)},t.attrTest=function(i){var o,n=this.options.direction;return n&(vi|Qr)?o=i.overallVelocity:n&vi?o=i.overallVelocityX:n&Qr&&(o=i.overallVelocityY),r.prototype.attrTest.call(this,i)&&n&i.offsetDirection&&i.distance>this.options.threshold&&i.maxPointers===this.options.pointers&&Gr(o)>this.options.velocity&&i.eventType&Le},t.emit=function(i){var o=Wg(i.offsetDirection);o&&this.manager.emit(this.options.event+o,i),this.manager.emit(this.options.event,i)},e}(en),Vg=function(r){function e(i){return i===void 0&&(i={}),r.call(this,ii({event:"pinch",threshold:0,pointers:2},i))||this}zt(e,r);var t=e.prototype;return t.getTouchAction=function(){return[Kr]},t.attrTest=function(i){return r.prototype.attrTest.call(this,i)&&(Math.abs(i.scale-1)>this.options.threshold||2&this.state)},t.emit=function(i){if(i.scale!==1){var o=i.scale<1?"in":"out";i.additionalEvent=this.options.event+o}r.prototype.emit.call(this,i)},e}(en),qg=function(r){function e(i){return i===void 0&&(i={}),r.call(this,ii({event:"rotate",threshold:0,pointers:2},i))||this}zt(e,r);var t=e.prototype;return t.getTouchAction=function(){return[Kr]},t.attrTest=function(i){return r.prototype.attrTest.call(this,i)&&(Math.abs(i.rotation)>this.options.threshold||2&this.state)},e}(en),xh=function(r){function e(i){var o;return i===void 0&&(i={}),(o=r.call(this,ii({event:"press",pointers:1,time:251,threshold:9},i))||this)._timer=null,o._input=null,o}zt(e,r);var t=e.prototype;return t.getTouchAction=function(){return[Pg]},t.process=function(i){var o=this,n=this.options,a=i.pointers.length===n.pointers,d=i.distance<n.threshold,p=i.deltaTime>n.time;if(this._input=i,!d||!a||i.eventType&(Le|Pt)&&!p)this.reset();else if(i.eventType&vt)this.reset(),this._timer=setTimeout(function(){o.state=8,o.tryEmit()},n.time);else if(i.eventType&Le)return 8;return Pi},t.reset=function(){clearTimeout(this._timer)},t.emit=function(i){this.state===8&&(i&&i.eventType&Le?this.manager.emit(this.options.event+"up",i):(this._input.timeStamp=fh(),this.manager.emit(this.options.event,this._input)))},e}(Ss),Gg={domEvents:!1,touchAction:Cg,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Kg=[[qg,{enable:!1}],[Vg,{enable:!1},["rotate"]],[Ug,{direction:vi}],[Bc,{direction:vi},["swipe"]],[Zo],[Zo,{event:"doubletap",taps:2},["tap"]],[xh]];function Yg(r,e){var t,i=r.element;i.style&&(Ci(r.options.cssProps,function(o,n){t=vh(i.style,n),e?(r.oldCssProps[t]=i.style[t],i.style[t]=o):i.style[t]=r.oldCssProps[t]||""}),e||(r.oldCssProps={}))}var Xg=function(){function r(t,i){var o,n=this;this.options=$i({},Gg,i||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((o=this).options.inputClass||(WE?zg:UE?Eh:kg?Fc:Rc))(o,GE),this.touchAction=new Mc(this,this.options.touchAction),Yg(this,!0),Ci(this.options.recognizers,function(a){var d=n.add(new a[0](a[1]));a[2]&&d.recognizeWith(a[2]),a[3]&&d.requireFailure(a[3])},this)}var e=r.prototype;return e.set=function(t){return $i(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var i=this.session;if(!i.stopped){var o;this.touchAction.preventDefaults(t);var n=this.recognizers,a=i.curRecognizer;(!a||a&&8&a.state)&&(i.curRecognizer=null,a=null);for(var d=0;d<n.length;)o=n[d],i.stopped===2||a&&o!==a&&!o.canRecognizeWith(a)?o.reset():o.recognize(t),!a&&14&o.state&&(i.curRecognizer=o,a=o),d++}},e.get=function(t){if(t instanceof Ss)return t;for(var i=this.recognizers,o=0;o<i.length;o++)if(i[o].options.event===t)return i[o];return null},e.add=function(t){if(Jo(t,"add",this))return this;var i=this.get(t.options.event);return i&&this.remove(i),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},e.remove=function(t){if(Jo(t,"remove",this))return this;var i=this.get(t);if(t){var o=this.recognizers,n=eo(o,i);n!==-1&&(o.splice(n,1),this.touchAction.update())}return this},e.on=function(t,i){if(t===void 0||i===void 0)return this;var o=this.handlers;return Ci(Es(t),function(n){o[n]=o[n]||[],o[n].push(i)}),this},e.off=function(t,i){if(t===void 0)return this;var o=this.handlers;return Ci(Es(t),function(n){i?o[n]&&o[n].splice(eo(o[n],i),1):delete o[n]}),this},e.emit=function(t,i){this.options.domEvents&&function(a,d){var p=document.createEvent("Event");p.initEvent(a,!0,!0),p.gesture=d,d.target.dispatchEvent(p)}(t,i);var o=this.handlers[t]&&this.handlers[t].slice();if(o&&o.length){i.type=t,i.preventDefault=function(){i.srcEvent.preventDefault()};for(var n=0;n<o.length;)o[n](i),n++}},e.destroy=function(){this.element&&Yg(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},r}(),rO={touchstart:vt,touchmove:2,touchend:Le,touchcancel:Pt},oO=function(r){function e(){var t,i=e.prototype;return i.evTarget="touchstart",i.evWin="touchstart touchmove touchend touchcancel",(t=r.apply(this,arguments)||this).started=!1,t}return zt(e,r),e.prototype.handler=function(t){var i=rO[t.type];if(i===vt&&(this.started=!0),this.started){var o=nO.call(this,t,i);i&(Le|Pt)&&o[0].length-o[1].length==0&&(this.started=!1),this.callback(this.manager,i,{pointers:o[0],changedPointers:o[1],pointerType:De,srcEvent:t})}},e}(Qo);function nO(r,e){var t=xs(r.touches),i=xs(r.changedTouches);return e&(Le|Pt)&&(t=_h(t.concat(i),"identifier",!0)),[t,i]}function jc(r,e,t){var i="DEPRECATED METHOD: "+e+`
`+t+` AT 
`;return function(){var o=new Error("get-stack-trace"),n=o&&o.stack?o.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=window.console&&(window.console.warn||window.console.log);return a&&a.call(window.console,i,n),r.apply(this,arguments)}}var Qg=jc(function(r,e,t){for(var i=Object.keys(e),o=0;o<i.length;)(!t||t&&r[i[o]]===void 0)&&(r[i[o]]=e[i[o]]),o++;return r},"extend","Use `assign`."),sO=jc(function(r,e){return Qg(r,e,!0)},"merge","Use `assign`.");function Jg(r,e,t){var i,o=e.prototype;(i=r.prototype=Object.create(o)).constructor=r,i._super=o,t&&$i(i,t)}function Zg(r,e){return function(){return r.apply(e,arguments)}}var em=function(){var r=function(e,t){return t===void 0&&(t={}),new Xg(e,ii({recognizers:Kg.concat()},t))};return r.VERSION="2.0.17-rc",r.DIRECTION_ALL=Dg,r.DIRECTION_DOWN=Xo,r.DIRECTION_LEFT=ws,r.DIRECTION_RIGHT=_s,r.DIRECTION_UP=Xr,r.DIRECTION_HORIZONTAL=vi,r.DIRECTION_VERTICAL=Qr,r.DIRECTION_NONE=mh,r.DIRECTION_DOWN=Xo,r.INPUT_START=vt,r.INPUT_MOVE=2,r.INPUT_END=Le,r.INPUT_CANCEL=Pt,r.STATE_POSSIBLE=1,r.STATE_BEGAN=2,r.STATE_CHANGED=4,r.STATE_ENDED=8,r.STATE_RECOGNIZED=8,r.STATE_CANCELLED=16,r.STATE_FAILED=Pi,r.Manager=Xg,r.Input=Qo,r.TouchAction=Mc,r.TouchInput=Eh,r.MouseInput=Rc,r.PointerEventInput=zg,r.TouchMouseInput=Fc,r.SingleTouchInput=oO,r.Recognizer=Ss,r.AttrRecognizer=en,r.Tap=Zo,r.Pan=Bc,r.Swipe=Ug,r.Pinch=Vg,r.Rotate=qg,r.Press=xh,r.on=Os,r.off=Zr,r.each=Ci,r.merge=sO,r.extend=Qg,r.bindFn=Zg,r.assign=$i,r.inherit=Jg,r.bindFn=Zg,r.prefixed=vh,r.toArray=xs,r.inArray=eo,r.uniqueArray=_h,r.splitStr=Es,r.boolOrFn=bh,r.hasParent=Ac,r.addEventListeners=Os,r.removeEventListeners=Zr,r.defaults=$i({},Gg,{preset:Kg}),r}();em.defaults;var tm=em;function Ts(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(i){let[o,n,a]=function(){const v=function(){let O=4022871197;return function($){const P=$.toString();for(let C=0;C<P.length;C++){O+=P.charCodeAt(C);let I=.02519603282416938*O;O=I>>>0,I-=O,I*=O,O=I>>>0,I-=O,O+=4294967296*I}return 23283064365386963e-26*(O>>>0)}}();let g=v(" "),w=v(" "),_=v(" ");for(let O=0;O<arguments.length;O++)g-=v(O<0||arguments.length<=O?void 0:arguments[O]),g<0&&(g+=1),w-=v(O<0||arguments.length<=O?void 0:arguments[O]),w<0&&(w+=1),_-=v(O<0||arguments.length<=O?void 0:arguments[O]),_<0&&(_+=1);return[g,w,_]}(i),d=1;const p=()=>{const v=2091639*o+23283064365386963e-26*d;return o=n,n=a,a=v-(d=0|v)};return p.uint32=()=>4294967296*p(),p.fract53=()=>p()+11102230246251565e-32*(2097152*p()|0),p.algorithm="Alea",p.seed=i,p.version="0.9",p}(e.length?e:[rh()])}Ev("DELETE");const zc=typeof window<"u"?window.Hammer||tm:function(){return function(){const r=()=>{};return{on:r,off:r,destroy:r,emit:r,get:()=>({set:r})}}()};function ri(r){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:r,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});const t=zc(this._dom.overlay);t.on("tap",N(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{t.destroy()});const i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];ue(i).call(i,o=>{t.on(o,n=>{n.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=o=>{(function(n,a){for(;n;){if(n===a)return!0;n=n.parentNode}return!1})(o.target,r)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=o=>{("key"in o?o.key==="Escape":o.keyCode===27)&&this.deactivate()}}tf(ri.prototype),ri.current=null,ri.prototype.destroy=function(){this.deactivate();for(const t of Vr(r=Ti(e=this._cleanupQueue).call(e,0)).call(r)){var r,e;t()}},ri.prototype.activate=function(){ri.current&&ri.current.deactivate(),ri.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},ri.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},ri.prototype._onTapOverlay=function(r){this.activate(),r.srcEvent.stopPropagation()};const im=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,aO=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,hO=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,lO=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function ir(r){if(r)for(;r.hasChildNodes()===!0;){const e=r.firstChild;e&&(ir(e),r.removeChild(e))}}function rr(r){return r instanceof String||typeof r=="string"}function rm(r){return typeof r=="object"&&r!==null}function to(r,e,t,i){let o=!1;i===!0&&(o=e[t]===null&&r[t]!==void 0),o?delete r[t]:r[t]=e[t]}function Lc(r,e){let t=arguments.length>2&&arguments[2]!==void 0&&arguments[2];for(const i in r)if(e[i]!==void 0)if(e[i]===null||typeof e[i]!="object")to(r,e,i,t);else{const o=r[i],n=e[i];rm(o)&&rm(n)&&Lc(o,n,t)}}function tn(r,e,t){let i=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(Pe(t))throw new TypeError("Arrays are not supported by deepExtend");for(let o=0;o<r.length;o++){const n=r[o];if(Object.prototype.hasOwnProperty.call(t,n))if(t[n]&&t[n].constructor===Object)e[n]===void 0&&(e[n]={}),e[n].constructor===Object?ye(e[n],t[n],!1,i):to(e,t,n,i);else{if(Pe(t[n]))throw new TypeError("Arrays are not supported by deepExtend");to(e,t,n,i)}}return e}function io(r,e,t){let i=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(Pe(t))throw new TypeError("Arrays are not supported by deepExtend");for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&!Ji(r).call(r,o))if(t[o]&&t[o].constructor===Object)e[o]===void 0&&(e[o]={}),e[o].constructor===Object?ye(e[o],t[o]):to(e,t,o,i);else if(Pe(t[o])){e[o]=[];for(let n=0;n<t[o].length;n++)e[o].push(t[o][n])}else to(e,t,o,i);return e}function ye(r,e){let t=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=arguments.length>3&&arguments[3]!==void 0&&arguments[3];for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)||t===!0)if(typeof e[n]=="object"&&e[n]!==null&&Qv(e[n])===Object.prototype)r[n]===void 0?r[n]=ye({},e[n],t):typeof r[n]=="object"&&r[n]!==null&&Qv(r[n])===Object.prototype?ye(r[n],e[n],t):to(r,e,n,i);else if(Pe(e[n])){var o;r[n]=fi(o=e[n]).call(o)}else to(r,e,n,i);return r}function Sh(r,e){return[...r,e]}function dO(r){return r.getBoundingClientRect().top}function se(r,e){if(Pe(r)){const t=r.length;for(let i=0;i<t;i++)e(r[i],i,r)}else for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&e(r[t],t,r)}function Hc(r){let e;switch(r.length){case 3:case 4:return e=aO.exec(r),e?{r:tt(e[1]+e[1],16),g:tt(e[2]+e[2],16),b:tt(e[3]+e[3],16)}:null;case 6:case 7:return e=im.exec(r),e?{r:tt(e[1],16),g:tt(e[2],16),b:tt(e[3],16)}:null;default:return null}}function Lt(r,e){if(Ji(r).call(r,"rgba"))return r;if(Ji(r).call(r,"rgb")){const t=r.substr(ce(r).call(r,"(")+1).replace(")","").split(",");return"rgba("+t[0]+","+t[1]+","+t[2]+","+e+")"}{const t=Hc(r);return t==null?r:"rgba("+t.r+","+t.g+","+t.b+","+e+")"}}function om(r,e,t){var i;return"#"+fi(i=((1<<24)+(r<<16)+(e<<8)+t).toString(16)).call(i,1)}function Wc(r,e){if(rr(r)){let i=r;if(nm(i)){var t;const o=qo(t=i.substr(4).substr(0,i.length-5).split(",")).call(t,function(n){return tt(n)});i=om(o[0],o[1],o[2])}if($s(i)===!0){const o=function(v){const g=Hc(v);if(!g)throw new TypeError("'".concat(v,"' is not a valid color."));return rn(g.r,g.g,g.b)}(i),n={h:o.h,s:.8*o.s,v:Math.min(1,1.02*o.v)},a={h:o.h,s:Math.min(1,1.25*o.s),v:.8*o.v},d=Uc(a.h,a.s,a.v),p=Uc(n.h,n.s,n.v);return{background:i,border:d,highlight:{background:p,border:d},hover:{background:p,border:d}}}return{background:i,border:i,highlight:{background:i,border:i},hover:{background:i,border:i}}}return e?{background:r.background||e.background,border:r.border||e.border,highlight:rr(r.highlight)?{border:r.highlight,background:r.highlight}:{background:r.highlight&&r.highlight.background||e.highlight.background,border:r.highlight&&r.highlight.border||e.highlight.border},hover:rr(r.hover)?{border:r.hover,background:r.hover}:{border:r.hover&&r.hover.border||e.hover.border,background:r.hover&&r.hover.background||e.hover.background}}:{background:r.background||void 0,border:r.border||void 0,highlight:rr(r.highlight)?{border:r.highlight,background:r.highlight}:{background:r.highlight&&r.highlight.background||void 0,border:r.highlight&&r.highlight.border||void 0},hover:rr(r.hover)?{border:r.hover,background:r.hover}:{border:r.hover&&r.hover.border||void 0,background:r.hover&&r.hover.background||void 0}}}function rn(r,e,t){r/=255,e/=255,t/=255;const i=Math.min(r,Math.min(e,t)),o=Math.max(r,Math.max(e,t));return i===o?{h:0,s:0,v:i}:{h:60*((r===i?3:t===i?1:5)-(r===i?e-t:t===i?r-e:t-r)/(o-i))/360,s:(o-i)/o,v:o}}function Is(r,e,t){let i,o,n;const a=Math.floor(6*r),d=6*r-a,p=t*(1-e),v=t*(1-d*e),g=t*(1-(1-d)*e);switch(a%6){case 0:i=t,o=g,n=p;break;case 1:i=v,o=t,n=p;break;case 2:i=p,o=t,n=g;break;case 3:i=p,o=v,n=t;break;case 4:i=g,o=p,n=t;break;case 5:i=t,o=p,n=v}return{r:Math.floor(255*i),g:Math.floor(255*o),b:Math.floor(255*n)}}function Uc(r,e,t){const i=Is(r,e,t);return om(i.r,i.g,i.b)}function $s(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)}function nm(r){return hO.test(r)}function or(r){if(r===null||typeof r!="object")return null;if(r instanceof Element)return r;const e=er(r);for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&typeof r[t]=="object"&&(e[t]=or(r[t]));return e}function Ht(r,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=function(g){return g!=null},n=function(g){return g!==null&&typeof g=="object"};if(!n(r))throw new Error("Parameter mergeTarget must be an object");if(!n(e))throw new Error("Parameter options must be an object");if(!o(t))throw new Error("Parameter option must have a value");if(!n(i))throw new Error("Parameter globalOptions must be an object");const a=e[t],d=n(i)&&!function(g){for(const w in g)if(Object.prototype.hasOwnProperty.call(g,w))return!1;return!0}(i)?i[t]:void 0,p=d?d.enabled:void 0;if(a===void 0)return;if(typeof a=="boolean")return n(r[t])||(r[t]={}),void(r[t].enabled=a);if(a===null&&!n(r[t])){if(!o(d))return;r[t]=er(d)}if(!n(a))return;let v=!0;a.enabled!==void 0?v=a.enabled:p!==void 0&&(v=d.enabled),function(g,w,_){n(g[_])||(g[_]={});const O=w[_],$=g[_];for(const P in O)Object.prototype.hasOwnProperty.call(O,P)&&($[P]=O[P])}(r,e,t),r[t].enabled=v}const cO={linear:r=>r,easeInQuad:r=>r*r,easeOutQuad:r=>r*(2-r),easeInOutQuad:r=>r<.5?2*r*r:(4-2*r)*r-1,easeInCubic:r=>r*r*r,easeOutCubic:r=>--r*r*r+1,easeInOutCubic:r=>r<.5?4*r*r*r:(r-1)*(2*r-2)*(2*r-2)+1,easeInQuart:r=>r*r*r*r,easeOutQuart:r=>1- --r*r*r*r,easeInOutQuart:r=>r<.5?8*r*r*r*r:1-8*--r*r*r*r,easeInQuint:r=>r*r*r*r*r,easeOutQuint:r=>1+--r*r*r*r*r,easeInOutQuint:r=>r<.5?16*r*r*r*r*r:1+16*--r*r*r*r*r};function nr(r,e){let t;Pe(e)||(e=[e]);for(const i of r)if(i){t=i[e[0]];for(let o=1;o<e.length;o++)t&&(t=t[e[o]]);if(t!==void 0)break}return t}const sm={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"};let uO=class{constructor(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.pixelRatio=r,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(r){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=r,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(r){if(typeof r!="function")throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=r}setCloseCallback(r){if(typeof r!="function")throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=r}_isColorString(r){if(typeof r=="string")return sm[r]}setColor(r){let e,t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(r==="none")return;const i=this._isColorString(r);if(i!==void 0&&(r=i),rr(r)===!0){if(nm(r)===!0){const o=r.substr(4).substr(0,r.length-5).split(",");e={r:o[0],g:o[1],b:o[2],a:1}}else if(function(o){return lO.test(o)}(r)===!0){const o=r.substr(5).substr(0,r.length-6).split(",");e={r:o[0],g:o[1],b:o[2],a:o[3]}}else if($s(r)===!0){const o=Hc(r);e={r:o.r,g:o.g,b:o.b,a:1}}}else if(r instanceof Object&&r.r!==void 0&&r.g!==void 0&&r.b!==void 0){const o=r.a!==void 0?r.a:"1.0";e={r:r.r,g:r.g,b:r.b,a:o}}if(e===void 0)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+gs(r));this._setColor(e,t)}show(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){(!(arguments.length>0&&arguments[0]!==void 0)||arguments[0])===!0&&(this.previousColor=ge({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",Ii(()=>{this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0)},0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(r){(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])===!0&&(this.initialColor=ge({},r)),this.color=r;const e=rn(r.r,r.g,r.b),t=2*Math.PI,i=this.r*e.s,o=this.centerCoordinates.x+i*Math.sin(t*e.h),n=this.centerCoordinates.y+i*Math.cos(t*e.h);this.colorPickerSelector.style.left=o-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=n-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(r)}_setOpacity(r){this.color.a=r/100,this._updatePicker(this.color)}_setBrightness(r){const e=rn(this.color.r,this.color.g,this.color.b);e.v=r/100;const t=Is(e.h,e.s,e.v);t.a=this.color.a,this.color=t,this._updatePicker()}_updatePicker(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color;const e=rn(r.r,r.g,r.b),t=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const i=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,i,o),t.putImageData(this.hueCircle,0,0),t.fillStyle="rgba(0,0,0,"+(1-e.v)+")",t.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),ys(t).call(t),this.brightnessRange.value=100*e.v,this.opacityRange.value=100*r.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){var r,e,t,i;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){const n=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const n=document.createElement("DIV");n.style.color="red",n.style.fontWeight="bold",n.style.padding="10px",n.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(n)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch{}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch{}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);const o=this;this.opacityRange.onchange=function(){o._setOpacity(this.value)},this.opacityRange.oninput=function(){o._setOpacity(this.value)},this.brightnessRange.onchange=function(){o._setBrightness(this.value)},this.brightnessRange.oninput=function(){o._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=N(r=this._hide).call(r,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=N(e=this._apply).call(e,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=N(t=this._save).call(t,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=N(i=this._loadLast).call(i,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new zc(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",r=>{r.isFirst&&this._moveSelector(r)}),this.hammer.on("tap",r=>{this._moveSelector(r)}),this.hammer.on("panstart",r=>{this._moveSelector(r)}),this.hammer.on("panmove",r=>{this._moveSelector(r)}),this.hammer.on("panend",r=>{this._moveSelector(r)})}_generateHueCircle(){if(this.generated===!1){const r=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1)),r.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const e=this.colorPickerCanvas.clientWidth,t=this.colorPickerCanvas.clientHeight;let i,o,n,a;r.clearRect(0,0,e,t),this.centerCoordinates={x:.5*e,y:.5*t},this.r=.49*e;const d=2*Math.PI/360,p=1/360,v=1/this.r;let g;for(n=0;n<360;n++)for(a=0;a<this.r;a++)i=this.centerCoordinates.x+a*Math.sin(d*n),o=this.centerCoordinates.y+a*Math.cos(d*n),g=Is(n*p,a*v,1),r.fillStyle="rgb("+g.r+","+g.g+","+g.b+")",r.fillRect(i-.5,o-.5,2,2);r.strokeStyle="rgba(0,0,0,1)",r.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),r.stroke(),this.hueCircle=r.getImageData(0,0,e,t)}this.generated=!0}_moveSelector(r){const e=this.colorPickerDiv.getBoundingClientRect(),t=r.center.x-e.left,i=r.center.y-e.top,o=.5*this.colorPickerDiv.clientHeight,n=.5*this.colorPickerDiv.clientWidth,a=t-n,d=i-o,p=Math.atan2(a,d),v=.98*Math.min(Math.sqrt(a*a+d*d),n),g=Math.cos(p)*v+o,w=Math.sin(p)*v+n;this.colorPickerSelector.style.top=g-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=w-.5*this.colorPickerSelector.clientWidth+"px";let _=p/(2*Math.PI);_=_<0?_+1:_;const O=v/this.r,$=rn(this.color.r,this.color.g,this.color.b);$.h=_,$.s=O;const P=Is($.h,$.s,$.v);P.a=this.color.a,this.color=P,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}};function Vc(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(e.length<1)throw new TypeError("Invalid arguments.");if(e.length===1)return document.createTextNode(e[0]);{const i=document.createElement(e[0]);return i.appendChild(Vc(...fi(e).call(e,1))),i}}let am,Cs=!1;const qc="background: #FFeeee; color: #dd0000",hm=ri,pO=class{constructor(r,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=r,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.hideOption=o,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},ge(this.options,this.defaultOptions),this.configureOptions=t,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new uO(i),this.wrapper=void 0}setOptions(r){if(r!==void 0){this.popupHistory={},this._removePopup();let e=!0;if(typeof r=="string")this.options.filter=r;else if(Pe(r))this.options.filter=r.join();else if(typeof r=="object"){if(r==null)throw new TypeError("options cannot be null");r.container!==void 0&&(this.options.container=r.container),ft(r)!==void 0&&(this.options.filter=ft(r)),r.showButton!==void 0&&(this.options.showButton=r.showButton),r.enabled!==void 0&&(e=r.enabled)}else typeof r=="boolean"?(this.options.filter=!0,e=r):typeof r=="function"&&(this.options.filter=r,e=!0);ft(this.options)===!1&&(e=!1),this.options.enabled=e}this._clean()}setModuleOptions(r){this.moduleOptions=r,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const r=ft(this.options);let e=0,t=!1;for(const i in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,i)&&(this.allowCreation=!1,t=!1,typeof r=="function"?(t=r(i,[]),t=t||this._handleObject(this.configureOptions[i],[i],!0)):r!==!0&&ce(r).call(r,i)===-1||(t=!0),t!==!1&&(this.allowCreation=!0,e>0&&this._makeItem([]),this._makeHeader(i),this._handleObject(this.configureOptions[i],[i])),e++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let r=0;r<this.domElements.length;r++)this.wrapper.appendChild(this.domElements[r]);this._showPopupIfNeeded()}_clean(){for(let r=0;r<this.domElements.length;r++)this.wrapper.removeChild(this.domElements[r]);this.wrapper!==void 0&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}_getValue(r){let e=this.moduleOptions;for(let t=0;t<r.length;t++){if(e[r[t]]===void 0){e=void 0;break}e=e[r[t]]}return e}_makeItem(r){if(this.allowCreation===!0){const o=document.createElement("div");o.className="vis-configuration vis-config-item vis-config-s"+r.length;for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ue(t).call(t,n=>{o.appendChild(n)}),this.domElements.push(o),this.domElements.length}return 0}_makeHeader(r){const e=document.createElement("div");e.className="vis-configuration vis-config-header",e.innerText=r,this._makeItem([],e)}_makeLabel(r,e){let t=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const i=document.createElement("div");if(i.className="vis-configuration vis-config-label vis-config-s"+e.length,t===!0){for(;i.firstChild;)i.removeChild(i.firstChild);i.appendChild(Vc("i","b",r))}else i.innerText=r+":";return i}_makeDropdown(r,e,t){const i=document.createElement("select");i.className="vis-configuration vis-config-select";let o=0;e!==void 0&&ce(r).call(r,e)!==-1&&(o=ce(r).call(r,e));for(let d=0;d<r.length;d++){const p=document.createElement("option");p.value=r[d],d===o&&(p.selected="selected"),p.innerText=r[d],i.appendChild(p)}const n=this;i.onchange=function(){n._update(this.value,t)};const a=this._makeLabel(t[t.length-1],t);this._makeItem(t,a,i)}_makeRange(r,e,t){const i=r[0],o=r[1],n=r[2],a=r[3],d=document.createElement("input");d.className="vis-configuration vis-config-range";try{d.type="range",d.min=o,d.max=n}catch{}d.step=a;let p="",v=0;e!==void 0?(e<0&&e*1.2<o?(d.min=Math.ceil(e*1.2),v=d.min,p="range increased"):e/1.2<o&&(d.min=Math.ceil(e/1.2),v=d.min,p="range increased"),e*1.2>n&&n!==1&&(d.max=Math.ceil(e*1.2),v=d.max,p="range increased"),d.value=e):d.value=i;const g=document.createElement("input");g.className="vis-configuration vis-config-rangeinput",g.value=d.value;const w=this;d.onchange=function(){g.value=this.value,w._update(Number(this.value),t)},d.oninput=function(){g.value=this.value};const _=this._makeLabel(t[t.length-1],t),O=this._makeItem(t,_,d,g);p!==""&&this.popupHistory[O]!==v&&(this.popupHistory[O]=v,this._setupPopup(p,O))}_makeButton(){if(this.options.showButton===!0){const r=document.createElement("div");r.className="vis-configuration vis-config-button",r.innerText="generate options",r.onclick=()=>{this._printOptions()},r.onmouseover=()=>{r.className="vis-configuration vis-config-button hover"},r.onmouseout=()=>{r.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(r)}}_setupPopup(r,e){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){const t=document.createElement("div");t.id="vis-configuration-popup",t.className="vis-configuration-popup",t.innerText=r,t.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:t,index:e}}}_removePopup(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(this.popupDiv.html!==void 0){const r=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=r.left+"px",this.popupDiv.html.style.top=r.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=Ii(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=Ii(()=>{this._removePopup()},1800)}}_makeCheckbox(r,e,t){const i=document.createElement("input");i.type="checkbox",i.className="vis-configuration vis-config-checkbox",i.checked=r,e!==void 0&&(i.checked=e,e!==r&&(typeof r=="object"?e!==r.enabled&&this.changedOptions.push({path:t,value:e}):this.changedOptions.push({path:t,value:e})));const o=this;i.onchange=function(){o._update(this.checked,t)};const n=this._makeLabel(t[t.length-1],t);this._makeItem(t,n,i)}_makeTextInput(r,e,t){const i=document.createElement("input");i.type="text",i.className="vis-configuration vis-config-text",i.value=e,e!==r&&this.changedOptions.push({path:t,value:e});const o=this;i.onchange=function(){o._update(this.value,t)};const n=this._makeLabel(t[t.length-1],t);this._makeItem(t,n,i)}_makeColorField(r,e,t){const i=r[1],o=document.createElement("div");(e=e===void 0?i:e)!=="none"?(o.className="vis-configuration vis-config-colorBlock",o.style.backgroundColor=e):o.className="vis-configuration vis-config-colorBlock none",e=e===void 0?i:e,o.onclick=()=>{this._showColorPicker(e,o,t)};const n=this._makeLabel(t[t.length-1],t);this._makeItem(t,n,o)}_showColorPicker(r,e,t){e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(r),this.colorPicker.setUpdateCallback(i=>{const o="rgba("+i.r+","+i.g+","+i.b+","+i.a+")";e.style.backgroundColor=o,this._update(o,t)}),this.colorPicker.setCloseCallback(()=>{e.onclick=()=>{this._showColorPicker(r,e,t)}})}_handleObject(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=!1;const o=ft(this.options);let n=!1;for(const a in r)if(Object.prototype.hasOwnProperty.call(r,a)){i=!0;const d=r[a],p=Sh(e,a);if(typeof o=="function"&&(i=o(a,e),i===!1&&!Pe(d)&&typeof d!="string"&&typeof d!="boolean"&&d instanceof Object&&(this.allowCreation=!1,i=this._handleObject(d,p,!0),this.allowCreation=t===!1)),i!==!1){n=!0;const v=this._getValue(p);if(Pe(d))this._handleArray(d,v,p);else if(typeof d=="string")this._makeTextInput(d,v,p);else if(typeof d=="boolean")this._makeCheckbox(d,v,p);else if(d instanceof Object){if(!this.hideOption(e,a,this.moduleOptions))if(d.enabled!==void 0){const g=Sh(p,"enabled"),w=this._getValue(g);if(w===!0){const _=this._makeLabel(a,p,!0);this._makeItem(p,_),n=this._handleObject(d,p)||n}else this._makeCheckbox(d,w,p)}else{const g=this._makeLabel(a,p,!0);this._makeItem(p,g),n=this._handleObject(d,p)||n}}else console.error("dont know how to handle",d,a,p)}}return n}_handleArray(r,e,t){typeof r[0]=="string"&&r[0]==="color"?(this._makeColorField(r,e,t),r[1]!==e&&this.changedOptions.push({path:t,value:e})):typeof r[0]=="string"?(this._makeDropdown(r,e,t),r[0]!==e&&this.changedOptions.push({path:t,value:e})):typeof r[0]=="number"&&(this._makeRange(r,e,t),r[0]!==e&&this.changedOptions.push({path:t,value:Number(e)}))}_update(r,e){const t=this._constructOptions(r,e);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",t),this.initialized=!0,this.parent.setOptions(t)}_constructOptions(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=t;r=(r=r==="true"||r)!=="false"&&r;for(let o=0;o<e.length;o++)e[o]!=="global"&&(i[e[o]]===void 0&&(i[e[o]]={}),o!==e.length-1?i=i[e[o]]:i[e[o]]=r);return t}_printOptions(){const r=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(Vc("pre","const options = "+gs(r,null,2)))}getOptions(){const r={};for(let e=0;e<this.changedOptions.length;e++)this._constructOptions(this.changedOptions[e].value,this.changedOptions[e].path,r);return r}},on=zc,fO=class{constructor(r,e){this.container=r,this.overflowMethod=e||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}setPosition(r,e){this.x=tt(r),this.y=tt(e)}setText(r){if(r instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(r)}else this.frame.innerText=r}show(r){if(r===void 0&&(r=!0),r===!0){const e=this.frame.clientHeight,t=this.frame.clientWidth,i=this.frame.parentNode.clientHeight,o=this.frame.parentNode.clientWidth;let n=0,a=0;if(this.overflowMethod=="flip"){let d=!1,p=!0;this.y-e<this.padding&&(p=!1),this.x+t>o-this.padding&&(d=!0),n=d?this.x-t:this.x,a=p?this.y-e:this.y}else a=this.y-e,a+e+this.padding>i&&(a=i-e-this.padding),a<this.padding&&(a=this.padding),n=this.x,n+t+this.padding>o&&(n=o-t-this.padding),n<this.padding&&(n=this.padding);this.frame.style.left=n+"px",this.frame.style.top=a+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}hide(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}destroy(){this.frame.parentNode.removeChild(this.frame)}},lm=qc,vO=class We{static validate(e,t,i){Cs=!1,am=t;let o=t;return i!==void 0&&(o=t[i]),We.parse(e,o,[]),Cs}static parse(e,t,i){for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&We.check(o,e,t,i)}static check(e,t,i,o){if(i[e]===void 0&&i.__any__===void 0)return void We.getSuggestion(e,i,o);let n=e,a=!0;i[e]===void 0&&i.__any__!==void 0&&(n="__any__",a=We.getType(t[e])==="object");let d=i[n];a&&d.__type__!==void 0&&(d=d.__type__),We.checkFields(e,t,i,n,d,o)}static checkFields(e,t,i,o,n,a){const d=function(g){console.error("%c"+g+We.printLocation(a,e),qc)},p=We.getType(t[e]),v=n[p];v!==void 0?We.getType(v)==="array"&&ce(v).call(v,t[e])===-1?(d('Invalid option detected in "'+e+'". Allowed values are:'+We.print(v)+' not "'+t[e]+'". '),Cs=!0):p==="object"&&o!=="__any__"&&(a=Sh(a,e),We.parse(t[e],i[o],a)):n.any===void 0&&(d('Invalid type received for "'+e+'". Expected: '+We.print(ke(n))+". Received ["+p+'] "'+t[e]+'"'),Cs=!0)}static getType(e){const t=typeof e;return t==="object"?e===null?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":Pe(e)?"array":e instanceof Date?"date":e.nodeType!==void 0?"dom":e._isAMomentObject===!0?"moment":"object":t==="number"?"number":t==="boolean"?"boolean":t==="string"?"string":t===void 0?"undefined":t}static getSuggestion(e,t,i){const o=We.findInOptions(e,t,i,!1),n=We.findInOptions(e,am,[],!0);let a;a=o.indexMatch!==void 0?" in "+We.printLocation(o.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+o.indexMatch+`"?

`:n.distance<=4&&o.distance>n.distance?" in "+We.printLocation(o.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+We.printLocation(n.path,n.closestMatch,""):o.distance<=8?'. Did you mean "'+o.closestMatch+'"?'+We.printLocation(o.path,e):". Did you mean one of these: "+We.print(ke(t))+We.printLocation(i,e),console.error('%cUnknown option detected: "'+e+'"'+a,qc),Cs=!0}static findInOptions(e,t,i){let o=arguments.length>3&&arguments[3]!==void 0&&arguments[3],n=1e9,a="",d=[];const p=e.toLowerCase();let v;for(const _ in t){let O;if(t[_].__type__!==void 0&&o===!0){const $=We.findInOptions(e,t[_],Sh(i,_));n>$.distance&&(a=$.closestMatch,d=$.path,n=$.distance,v=$.indexMatch)}else{var g;ce(g=_.toLowerCase()).call(g,p)!==-1&&(v=_),O=We.levenshteinDistance(e,_),n>O&&(a=_,d=fi(w=i).call(w),n=O)}}var w;return{closestMatch:a,path:d,distance:n,indexMatch:v}}static printLocation(e,t){let i=`

`+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at: 
`)+`options = {
`;for(let o=0;o<e.length;o++){for(let n=0;n<o+1;n++)i+="  ";i+=e[o]+`: {
`}for(let o=0;o<e.length+1;o++)i+="  ";i+=t+`
`;for(let o=0;o<e.length+1;o++){for(let n=0;n<e.length-o;n++)i+="  ";i+=`}
`}return i+`

`}static print(e){return gs(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;const i=[];let o,n;for(o=0;o<=t.length;o++)i[o]=[o];for(n=0;n<=e.length;n++)i[0][n]=n;for(o=1;o<=t.length;o++)for(n=1;n<=e.length;n++)t.charAt(o-1)==e.charAt(n-1)?i[o][n]=i[o-1][n-1]:i[o][n]=Math.min(i[o-1][n-1]+1,Math.min(i[o][n-1]+1,i[o-1][n]+1));return i[t.length][e.length]}};function dm(r){return sr=r,function(){var e={};if(nn=0,re=sr.charAt(0),be(),Q==="strict"&&(e.strict=!0,be()),Q!=="graph"&&Q!=="digraph"||(e.type=Q,be()),Dt===gt.IDENTIFIER&&(e.id=Q,be()),Q!="{")throw mt("Angle bracket { expected");if(be(),fm(e),Q!="}")throw mt("Angle bracket } expected");if(be(),Q!=="")throw mt("End of file expected");return be(),delete e.node,delete e.edge,delete e.graph,e}()}var Gc={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},Kc=er(Gc);Kc.color="color.color",Kc.style="dashes";var gt={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},cm={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},sr="",nn=0,re="",Q="",Dt=gt.NULL;function Ye(){nn++,re=sr.charAt(nn)}function sn(){return sr.charAt(nn+1)}function um(r){var e=r.charCodeAt(0);return e<47?e===35||e===46:e<59?e>47:e<91?e>64:e<96?e===95:e<123&&e>96}function ar(r,e){if(r||(r={}),e)for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r}function gO(r,e,t){for(var i=e.split("."),o=r;i.length;){var n=i.shift();i.length?(o[n]||(o[n]={}),o=o[n]):o[n]=t}}function Th(r,e){for(var t,i,o=null,n=[r],a=r;a.parent;)n.push(a.parent),a=a.parent;if(a.nodes){for(t=0,i=a.nodes.length;t<i;t++)if(e.id===a.nodes[t].id){o=a.nodes[t];break}}for(o||(o={id:e.id},r.node&&(o.attr=ar(o.attr,r.node))),t=n.length-1;t>=0;t--){var d,p=n[t];p.nodes||(p.nodes=[]),ce(d=p.nodes).call(d,o)===-1&&p.nodes.push(o)}e.attr&&(o.attr=ar(o.attr,e.attr))}function mO(r,e){if(r.edges||(r.edges=[]),r.edges.push(e),r.edge){var t=ar({},r.edge);e.attr=ar(t,e.attr)}}function pm(r,e,t,i,o){var n={from:e,to:t,type:i};return r.edge&&(n.attr=ar({},r.edge)),n.attr=ar(n.attr||{},o),o!=null&&o.hasOwnProperty("arrows")&&o.arrows!=null&&(n.arrows={to:{enabled:!0,type:o.arrows.type}},o.arrows=null),n}function be(){for(Dt=gt.NULL,Q="";re===" "||re==="	"||re===`
`||re==="\r";)Ye();do{var r=!1;if(re==="#"){for(var e=nn-1;sr.charAt(e)===" "||sr.charAt(e)==="	";)e--;if(sr.charAt(e)===`
`||sr.charAt(e)===""){for(;re!=""&&re!=`
`;)Ye();r=!0}}if(re==="/"&&sn()==="/"){for(;re!=""&&re!=`
`;)Ye();r=!0}if(re==="/"&&sn()==="*"){for(;re!="";){if(re==="*"&&sn()==="/"){Ye(),Ye();break}Ye()}r=!0}for(;re===" "||re==="	"||re===`
`||re==="\r";)Ye()}while(r);if(re!==""){var t=re+sn();if(cm[t])return Dt=gt.DELIMITER,Q=t,Ye(),void Ye();if(cm[re])return Dt=gt.DELIMITER,Q=re,void Ye();if(um(re)||re==="-"){for(Q+=re,Ye();um(re);)Q+=re,Ye();return Q==="false"?Q=!1:Q==="true"?Q=!0:isNaN(Number(Q))||(Q=Number(Q)),void(Dt=gt.IDENTIFIER)}if(re==='"'){for(Ye();re!=""&&(re!='"'||re==='"'&&sn()==='"');)re==='"'?(Q+=re,Ye()):re==="\\"&&sn()==="n"?(Q+=`
`,Ye()):Q+=re,Ye();if(re!='"')throw mt('End of string " expected');return Ye(),void(Dt=gt.IDENTIFIER)}for(Dt=gt.UNKNOWN;re!="";)Q+=re,Ye();throw new SyntaxError('Syntax error in part "'+mm(Q,30)+'"')}Dt=gt.DELIMITER}function fm(r){for(;Q!==""&&Q!="}";)yO(r),Q===";"&&be()}function yO(r){var e=vm(r);if(e)gm(r,e);else{var t=function(o){return Q==="node"?(be(),o.node=an(),"node"):Q==="edge"?(be(),o.edge=an(),"edge"):Q==="graph"?(be(),o.graph=an(),"graph"):null}(r);if(!t){if(Dt!=gt.IDENTIFIER)throw mt("Identifier expected");var i=Q;if(be(),Q==="="){if(be(),Dt!=gt.IDENTIFIER)throw mt("Identifier expected");r[i]=Q,be()}else(function(o,n){var a={id:n},d=an();d&&(a.attr=d),Th(o,a),gm(o,n)})(r,i)}}}function vm(r){var e=null;if(Q==="subgraph"&&((e={}).type="subgraph",be(),Dt===gt.IDENTIFIER&&(e.id=Q,be())),Q==="{"){if(be(),e||(e={}),e.parent=r,e.node=r.node,e.edge=r.edge,e.graph=r.graph,fm(e),Q!="}")throw mt("Angle bracket } expected");be(),delete e.node,delete e.edge,delete e.graph,delete e.parent,r.subgraphs||(r.subgraphs=[]),r.subgraphs.push(e)}return e}function gm(r,e){for(;Q==="->"||Q==="--";){var t,i=Q;be();var o=vm(r);if(o)t=o;else{if(Dt!=gt.IDENTIFIER)throw mt("Identifier or subgraph expected");Th(r,{id:t=Q}),be()}mO(r,pm(r,e,t,i,an())),e=t}}function an(){for(var r,e,t=null,i={dashed:!0,solid:!1,dotted:[1,5]},o={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},n=new Array,a=new Array;Q==="[";){for(be(),t={};Q!==""&&Q!="]";){if(Dt!=gt.IDENTIFIER)throw mt("Attribute name expected");var d=Q;if(be(),Q!="=")throw mt("Equal sign = expected");if(be(),Dt!=gt.IDENTIFIER)throw mt("Attribute value expected");var p=Q;d==="style"&&(p=i[p]),d==="arrowhead"&&(d="arrows",p={to:{enabled:!0,type:o[p]}}),d==="arrowtail"&&(d="arrows",p={from:{enabled:!0,type:o[p]}}),n.push({attr:t,name:d,value:p}),a.push(d),be(),Q==","&&be()}if(Q!="]")throw mt("Bracket ] expected");be()}if(Ji(a).call(a,"dir")){var v={arrows:{}};for(r=0;r<n.length;r++)if(n[r].name==="arrows")if(n[r].value.to!=null)v.arrows.to=r;else{if(n[r].value.from==null)throw mt("Invalid value of arrows");v.arrows.from=r}else n[r].name==="dir"&&(v.dir=r);var g,w,_=n[v.dir].value;if(!Ji(a).call(a,"arrows"))if(_==="both")n.push({attr:n[v.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),v.arrows.to=n.length-1,n.push({attr:n[v.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),v.arrows.from=n.length-1;else if(_==="forward")n.push({attr:n[v.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),v.arrows.to=n.length-1;else if(_==="back")n.push({attr:n[v.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),v.arrows.from=n.length-1;else{if(_!=="none")throw mt('Invalid dir type "'+_+'"');n.push({attr:n[v.dir].attr,name:"arrows",value:""}),v.arrows.to=n.length-1}if(_==="both")v.arrows.to&&v.arrows.from?(w=n[v.arrows.to].value.to.type,g=n[v.arrows.from].value.from.type,n[v.arrows.to]={attr:n[v.arrows.to].attr,name:n[v.arrows.to].name,value:{to:{enabled:!0,type:w},from:{enabled:!0,type:g}}},Ti(n).call(n,v.arrows.from,1)):v.arrows.to?(w=n[v.arrows.to].value.to.type,g="arrow",n[v.arrows.to]={attr:n[v.arrows.to].attr,name:n[v.arrows.to].name,value:{to:{enabled:!0,type:w},from:{enabled:!0,type:g}}}):v.arrows.from&&(w="arrow",g=n[v.arrows.from].value.from.type,n[v.arrows.from]={attr:n[v.arrows.from].attr,name:n[v.arrows.from].name,value:{to:{enabled:!0,type:w},from:{enabled:!0,type:g}}});else if(_==="back")v.arrows.to&&v.arrows.from?(w="",g=n[v.arrows.from].value.from.type,n[v.arrows.from]={attr:n[v.arrows.from].attr,name:n[v.arrows.from].name,value:{to:{enabled:!0,type:w},from:{enabled:!0,type:g}}}):v.arrows.to?(w="",g="arrow",v.arrows.from=v.arrows.to,n[v.arrows.from]={attr:n[v.arrows.from].attr,name:n[v.arrows.from].name,value:{to:{enabled:!0,type:w},from:{enabled:!0,type:g}}}):v.arrows.from&&(w="",g=n[v.arrows.from].value.from.type,n[v.arrows.to]={attr:n[v.arrows.from].attr,name:n[v.arrows.from].name,value:{to:{enabled:!0,type:w},from:{enabled:!0,type:g}}}),n[v.arrows.from]={attr:n[v.arrows.from].attr,name:n[v.arrows.from].name,value:{from:{enabled:!0,type:n[v.arrows.from].value.from.type}}};else if(_==="none"){var O;n[O=v.arrows.to?v.arrows.to:v.arrows.from]={attr:n[O].attr,name:n[O].name,value:""}}else{if(_!=="forward")throw mt('Invalid dir type "'+_+'"');v.arrows.to&&v.arrows.from||v.arrows.to?(w=n[v.arrows.to].value.to.type,g="",n[v.arrows.to]={attr:n[v.arrows.to].attr,name:n[v.arrows.to].name,value:{to:{enabled:!0,type:w},from:{enabled:!0,type:g}}}):v.arrows.from&&(w="arrow",g="",v.arrows.to=v.arrows.from,n[v.arrows.to]={attr:n[v.arrows.to].attr,name:n[v.arrows.to].name,value:{to:{enabled:!0,type:w},from:{enabled:!0,type:g}}}),n[v.arrows.to]={attr:n[v.arrows.to].attr,name:n[v.arrows.to].name,value:{to:{enabled:!0,type:n[v.arrows.to].value.to.type}}}}Ti(n).call(n,v.dir,1)}if(Ji(a).call(a,"penwidth")){var $=[];for(e=n.length,r=0;r<e;r++)n[r].name!=="width"&&(n[r].name==="penwidth"&&(n[r].name="width"),$.push(n[r]));n=$}for(e=n.length,r=0;r<e;r++)gO(n[r].attr,n[r].name,n[r].value);return t}function mt(r){return new SyntaxError(r+', got "'+mm(Q,30)+'" (char '+nn+")")}function mm(r,e){return r.length<=e?r:r.substr(0,27)+"..."}function ym(r,e,t){for(var i=e.split("."),o=i.pop(),n=r,a=0;a<i.length;a++){var d=i[a];d in n||(n[d]={}),n=n[d]}return n[o]=t,r}function Yc(r,e){var t={};for(var i in r)if(r.hasOwnProperty(i)){var o=e[i];Pe(o)?ue(o).call(o,function(n){ym(t,n,r[i])}):ym(t,typeof o=="string"?o:i,r[i])}return t}function Xc(r){var e,t=dm(r),i={nodes:[],edges:[],options:{}};if(t.nodes&&ue(e=t.nodes).call(e,function(a){var d={id:a.id,label:String(a.label||a.id)};ar(d,Yc(a.attr,Gc)),d.image&&(d.shape="image"),i.nodes.push(d)}),t.edges){var o,n=function(a){var d={from:a.from,to:a.to};return ar(d,Yc(a.attr,Kc)),d.arrows==null&&a.type==="->"&&(d.arrows="to"),d};ue(o=t.edges).call(o,function(a){var d,p,v,g,w,_,O;d=a.from instanceof Object?a.from.nodes:{id:a.from},p=a.to instanceof Object?a.to.nodes:{id:a.to},a.from instanceof Object&&a.from.edges&&ue(v=a.from.edges).call(v,function($){var P=n($);i.edges.push(P)}),w=p,_=function($,P){var C=pm(i,$.id,P.id,a.type,a.attr),I=n(C);i.edges.push(I)},Pe(g=d)?ue(g).call(g,function($){Pe(w)?ue(w).call(w,function(P){_($,P)}):_($,w)}):Pe(w)?ue(w).call(w,function($){_(g,$)}):_(g,w),a.to instanceof Object&&a.to.edges&&ue(O=a.to.edges).call(O,function($){var P=n($);i.edges.push(P)})})}return t.attr&&(i.options=t.attr),i}var bO=Object.freeze({__proto__:null,DOTToGraph:Xc,parseDOT:dm});function Ih(r,e){var t;const i={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};e!=null&&(e.fixed!=null&&(i.nodes.fixed=e.fixed),e.parseColor!=null&&(i.nodes.parseColor=e.parseColor),e.inheritColor!=null&&(i.edges.inheritColor=e.inheritColor));const o=r.edges,n=qo(o).call(o,a=>{const d={from:a.source,id:a.id,to:a.target};return a.attributes!=null&&(d.attributes=a.attributes),a.label!=null&&(d.label=a.label),a.attributes!=null&&a.attributes.title!=null&&(d.title=a.attributes.title),a.type==="Directed"&&(d.arrows="to"),a.color&&i.edges.inheritColor===!1&&(d.color=a.color),d});return{nodes:qo(t=r.nodes).call(t,a=>{const d={id:a.id,fixed:i.nodes.fixed&&a.x!=null&&a.y!=null};return a.attributes!=null&&(d.attributes=a.attributes),a.label!=null&&(d.label=a.label),a.size!=null&&(d.size=a.size),a.attributes!=null&&a.attributes.title!=null&&(d.title=a.attributes.title),a.title!=null&&(d.title=a.title),a.x!=null&&(d.x=a.x),a.y!=null&&(d.y=a.y),a.color!=null&&(i.nodes.parseColor===!0?d.color=a.color:d.color={background:a.color,border:a.color,highlight:{background:a.color,border:a.color},hover:{background:a.color,border:a.color}}),d}),edges:n}}var wO=Object.freeze({__proto__:null,parseGephi:Ih}),_O=Object.freeze({__proto__:null,cn:{addDescription:"\u5355\u51FB\u7A7A\u767D\u5904\u653E\u7F6E\u65B0\u8282\u70B9\u3002",addEdge:"\u6DFB\u52A0\u8FDE\u63A5\u7EBF",addNode:"\u6DFB\u52A0\u8282\u70B9",back:"\u8FD4\u56DE",close:"\u95DC\u9589",createEdgeError:"\u65E0\u6CD5\u5C06\u8FDE\u63A5\u7EBF\u8FDE\u63A5\u5230\u7FA4\u96C6\u3002",del:"\u5220\u9664\u9009\u5B9A",deleteClusterError:"\u65E0\u6CD5\u5220\u9664\u7FA4\u96C6\u3002",edgeDescription:"\u5355\u51FB\u67D0\u4E2A\u8282\u70B9\u5E76\u5C06\u8BE5\u8FDE\u63A5\u7EBF\u62D6\u52A8\u5230\u53E6\u4E00\u4E2A\u8282\u70B9\u4EE5\u8FDE\u63A5\u5B83\u4EEC\u3002",edit:"\u7F16\u8F91",editClusterError:"\u65E0\u6CD5\u7F16\u8F91\u7FA4\u96C6\u3002",editEdge:"\u7F16\u8F91\u8FDE\u63A5\u7EBF",editEdgeDescription:"\u5355\u51FB\u63A7\u5236\u8282\u70B9\u5E76\u5C06\u5B83\u4EEC\u62D6\u5230\u8282\u70B9\u4E0A\u8FDE\u63A5\u3002",editNode:"\u7F16\u8F91\u8282\u70B9"},cs:{addDescription:"Kluknut\xEDm do pr\xE1zdn\xE9ho prostoru m\u016F\u017Eete p\u0159idat nov\xFD vrchol.",addEdge:"P\u0159idat hranu",addNode:"P\u0159idat vrchol",back:"Zp\u011Bt",close:"Zav\u0159\xEDt",createEdgeError:"Nelze p\u0159ipojit hranu ke shluku.",del:"Smazat v\xFDb\u011Br",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"P\u0159eta\u017Een\xEDm z jednoho vrcholu do druh\xE9ho m\u016F\u017Eete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"P\u0159eta\u017Een\xEDm kontroln\xEDho vrcholu hrany ji m\u016F\u017Eete p\u0159ipojit k jin\xE9mu vrcholu.",editNode:"Upravit vrchol"},de:{addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzuf\xFCgen",addNode:"Knoten hinzuf\xFCgen",back:"Zur\xFCck",close:"Schlie\xDFen",createEdgeError:"Es ist nicht m\xF6glich, Kanten mit Clustern zu verbinden.",del:"L\xF6sche Auswahl",deleteClusterError:"Cluster k\xF6nnen nicht gel\xF6scht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster k\xF6nnen nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},en:{addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},es:{addDescription:"Haga clic en un lugar vac\xEDo para colocar un nuevo nodo.",addEdge:"A\xF1adir arista",addNode:"A\xF1adir nodo",back:"Atr\xE1s",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selecci\xF3n",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},fr:{addDescription:"Cliquez dans un endroit vide pour placer un n\u0153ud.",addEdge:"Ajouter un lien",addNode:"Ajouter un n\u0153ud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de cr\xE9er un lien vers un cluster.",del:"Effacer la s\xE9lection",deleteClusterError:"Les clusters ne peuvent pas \xEAtre effac\xE9s.",edgeDescription:"Cliquez sur un n\u0153ud et glissez le lien vers un autre n\u0153ud pour les connecter.",edit:"\xC9diter",editClusterError:"Les clusters ne peuvent pas \xEAtre \xE9dit\xE9s.",editEdge:"\xC9diter le lien",editEdgeDescription:"Cliquez sur les points de contr\xF4le et glissez-les pour connecter un n\u0153ud.",editNode:"\xC9diter le n\u0153ud"},it:{addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},nl:{addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},pt:{addDescription:"Clique em um espa\xE7o em branco para adicionar um novo n\xF3",addEdge:"Adicionar aresta",addNode:"Adicionar n\xF3",back:"Voltar",close:"Fechar",createEdgeError:"N\xE3o foi poss\xEDvel linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters n\xE3o puderam ser removidos.",edgeDescription:"Clique em um n\xF3 e arraste a aresta at\xE9 outro n\xF3 para conect\xE1-los",edit:"Editar",editClusterError:"Clusters n\xE3o puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um n\xF3 para conect\xE1-los",editNode:"Editar n\xF3"},ru:{addDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u0432 \u0441\u0432\u043E\u0431\u043E\u0434\u043D\u043E\u0435 \u043C\u0435\u0441\u0442\u043E, \u0447\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u0443\u0437\u0435\u043B.",addEdge:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u043E",addNode:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0443\u0437\u0435\u043B",back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C",createEdgeError:"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u0430 \u0432 \u043A\u043B\u0430\u0441\u0442\u0435\u0440.",del:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435",deleteClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0443\u0434\u0430\u043B\u0435\u043D\u044B",edgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u0443\u0437\u0435\u043B \u0438 \u043F\u0440\u043E\u0442\u044F\u043D\u0438\u0442\u0435 \u0440\u0435\u0431\u0440\u043E \u043A \u0434\u0440\u0443\u0433\u043E\u043C\u0443 \u0443\u0437\u043B\u0443, \u0447\u0442\u043E\u0431\u044B \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0438\u0445.",edit:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C",editClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F.",editEdge:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0435\u0431\u0440\u043E",editEdgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u0438 \u043F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u0445 \u0432 \u0443\u0437\u0435\u043B, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043A \u043D\u0435\u043C\u0443.",editNode:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0443\u0437\u0435\u043B"},uk:{addDescription:"K\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0456\u043B\u044C\u043D\u0435 \u043C\u0456\u0441\u0446\u0435, \u0449\u043E\u0431 \u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0432\u0443\u0437\u043E\u043B.",addEdge:"\u0414\u043E\u0434\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",addNode:"\u0414\u043E\u0434\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B",back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u0438\u0442\u0438",createEdgeError:"\u041D\u0435 \u043C\u043E\u0436\u043B\u0438\u0432\u043E \u043E\u0431'\u0454\u0434\u043D\u0430\u0442\u0438 \u043A\u0440\u0430\u0457 \u0432 \u0433\u0440\u0443\u043F\u0443.",del:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043E\u0431\u0440\u0430\u043D\u0435",deleteClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435 \u043C\u043E\u0436\u0443\u0442\u044C \u0431\u0443\u0442\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u0456.",edgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0443\u0437\u043E\u043B \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u043A\u0440\u0430\u0439 \u0434\u043E \u0456\u043D\u0448\u043E\u0433\u043E \u0432\u0443\u0437\u043B\u0430, \u0449\u043E\u0431 \u0457\u0445 \u0437'\u0454\u0434\u043D\u0430\u0442\u0438.",edit:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438",editClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043D\u043D\u044F.",editEdge:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",editEdgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u0456 \u0442\u043E\u0447\u043A\u0438 \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0457\u0445 \u0443 \u0432\u0443\u0437\u043E\u043B, \u0449\u043E\u0431 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0438\u0441\u044F \u0434\u043E \u043D\u044C\u043E\u0433\u043E.",editNode:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B"}});class EO{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;const e=this.image.width,t=this.image.height;this.width=e,this.height=t;const i=Math.floor(t/2),o=Math.floor(t/4),n=Math.floor(t/8),a=Math.floor(t/16),d=Math.floor(e/2),p=Math.floor(e/4),v=Math.floor(e/8),g=Math.floor(e/16);this.canvas.width=3*p,this.canvas.height=i,this.coordinates=[[0,0,d,i],[d,0,p,o],[d,o,v,n],[5*v,o,g,a]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){const e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(let i=1;i<this.NUM_ITERATIONS;i++){const o=this.coordinates[i-1],n=this.coordinates[i];e.drawImage(this.canvas,o[0],o[1],o[2],o[3],n[0],n[1],n[2],n[3])}}drawImageAtPosition(e,t,i,o,n,a){if(this.initialized())if(t>2){t*=.5;let d=0;for(;t>2&&d<this.NUM_ITERATIONS;)t*=.5,d+=1;d>=this.NUM_ITERATIONS&&(d=this.NUM_ITERATIONS-1);const p=this.coordinates[d];e.drawImage(this.canvas,p[0],p[1],p[2],p[3],i,o,n,a)}else e.drawImage(this.image,i,o,n,a)}}class bm{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,t,i){e!==void 0&&i!==void 0&&(t!==void 0?(i.image.onerror=()=>{console.error("Could not load brokenImage:",t)},i.image.src=t):console.warn("No broken url image defined"))}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,t){const i=this.images[e];if(i)return i;const o=new EO;return this.images[e]=o,o.image.onload=()=>{this._fixImageCoordinates(o.image),o.init(),this._redrawWithImage(o)},o.image.onerror=()=>{console.error("Could not load image:",e),this._tryloadBrokenUrl(e,t,o)},o.image.src=e,o}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}var wm={exports:{}},OO=G(function(){if(typeof ArrayBuffer=="function"){var r=new ArrayBuffer(8);Object.isExtensible(r)&&Object.defineProperty(r,"a",{value:8})}}),xO=G,SO=at,Qc=yi,_m=OO,$h=Object.isExtensible,TO=xO(function(){$h(1)})||_m?function(r){return!!SO(r)&&(!_m||Qc(r)!=="ArrayBuffer")&&(!$h||$h(r))}:$h,Em=!G(function(){return Object.isExtensible(Object.preventExtensions({}))}),IO=V,Jc=de,$O=Bn,CO=at,Ch=Ze,PO=It.f,Om=Yn,kO=za,Zc=TO,xm=Em,Sm=!1,ki=_a("meta"),DO=0,eu=function(r){PO(r,ki,{value:{objectID:"O"+DO++,weakData:{}}})},MO=wm.exports={enable:function(){MO.enable=function(){},Sm=!0;var r=Om.f,e=Jc([].splice),t={};t[ki]=1,r(t).length&&(Om.f=function(i){for(var o=r(i),n=0,a=o.length;n<a;n++)if(o[n]===ki){e(o,n,1);break}return o},IO({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:kO.f}))},fastKey:function(r,e){if(!CO(r))return typeof r=="symbol"?r:(typeof r=="string"?"S":"P")+r;if(!Ch(r,ki)){if(!Zc(r))return"F";if(!e)return"E";eu(r)}return r[ki].objectID},getWeakData:function(r,e){if(!Ch(r,ki)){if(!Zc(r))return!0;if(!e)return!1;eu(r)}return r[ki].weakData},onFreeze:function(r){return xm&&Sm&&Zc(r)&&!Ch(r,ki)&&eu(r),r}};$O[ki]=!0;var Ph=wm.exports,Tm=Vo,tu=Me("iterator"),Im=Array.prototype,AO=$r,yt=wl,NO=_o,RO=Vo,FO=Me("iterator"),dt=function(r){if(!NO(r))return yt(r,FO)||yt(r,"@@iterator")||RO[AO(r)]},BO=Je,Ps=So,jO=_i,zO=Dn,LO=dt,HO=TypeError,iu=Je,$m=_i,WO=wl,UO=Ta,VO=Je,kh=_i,qO=Dn,ks=function(r){return r!==void 0&&(Tm.Array===r||Im[tu]===r)},GO=hi,Cm=Ie,KO=function(r,e){var t=arguments.length<2?LO(r):e;if(Ps(t))return jO(BO(t,r));throw new HO(zO(r)+" is not iterable")},YO=dt,Pm=function(r,e,t){var i,o;$m(r);try{if(!(i=WO(r,"return"))){if(e==="throw")throw t;return t}i=iu(i,r)}catch(n){o=!0,i=n}if(e==="throw")throw t;if(o)throw i;return $m(i),t},XO=TypeError,hn=function(r,e){this.stopped=r,this.result=e},km=hn.prototype,ru=function(r,e,t){var i,o,n,a,d,p,v,g=t&&t.that,w=!(!t||!t.AS_ENTRIES),_=!(!t||!t.IS_RECORD),O=!(!t||!t.IS_ITERATOR),$=!(!t||!t.INTERRUPTED),P=UO(e,g),C=function(M){return i&&Pm(i,"normal",M),new hn(!0,M)},I=function(M){return w?(kh(M),$?P(M[0],M[1],C):P(M[0],M[1])):$?P(M,C):P(M)};if(_)i=r.iterator;else if(O)i=r;else{if(!(o=YO(r)))throw new XO(qO(r)+" is not iterable");if(ks(o)){for(n=0,a=GO(r);a>n;n++)if((d=I(r[n]))&&Cm(km,d))return d;return new hn(!1)}i=KO(r,o)}for(p=_?r.next:i.next;!(v=VO(p,i)).done;){try{d=I(v.value)}catch(M){Pm(i,"throw",M)}if(typeof d=="object"&&d&&Cm(km,d))return d}return new hn(!1)},QO=Ie,JO=TypeError,ou=function(r,e){if(QO(e,r))return r;throw new JO("Incorrect invocation")},ZO=V,ex=we,Dm=Ph,tx=G,bt=xr,ix=ru,rx=ou,Mm=Qe,ox=at,nx=_o,sx=Ar,ax=It.f,hx=xi.forEach,lx=ze,dx=di.set,nu=di.getterFor,su=function(r,e,t){var i,o=r.indexOf("Map")!==-1,n=r.indexOf("Weak")!==-1,a=o?"set":"add",d=ex[r],p=d&&d.prototype,v={};if(lx&&Mm(d)&&(n||p.forEach&&!tx(function(){new d().entries().next()}))){var g=(i=e(function(_,O){dx(rx(_,g),{type:r,collection:new d}),nx(O)||ix(O,_[a],{that:_,AS_ENTRIES:o})})).prototype,w=nu(r);hx(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(_){var O=_==="add"||_==="set";!(_ in p)||n&&_==="clear"||bt(g,_,function($,P){var C=w(this).collection;if(!O&&n&&!ox($))return _==="get"&&void 0;var I=C[_]($===0?0:$,P);return O?this:I})}),n||ax(g,"size",{configurable:!0,get:function(){return w(this).collection.size}})}else i=t.getConstructor(e,r,o,a),Dm.enable();return sx(i,r,!1,!0),v[r]=i,ZO({global:!0,forced:!0},v),n||t.setStrong(i,r,o),i},cx=Vi,au=function(r,e,t){for(var i in e)t&&t.unsafe&&r[i]?r[i]=e[i]:cx(r,i,e[i],t);return r},ux=le,px=Dr,Am=ze,Nm=Me("species"),fx=Kn,vx=Dr,Rm=au,gx=Ta,mx=ou,yx=_o,bx=ru,hu=Gd,Fm=Kd,Bm=function(r){var e=ux(r);Am&&e&&!e[Nm]&&px(e,Nm,{configurable:!0,get:function(){return this}})},Ds=ze,Di=Ph.fastKey,jm=di.set,lu=di.getterFor,zm={getConstructor:function(r,e,t,i){var o=r(function(v,g){mx(v,n),jm(v,{type:e,index:fx(null),first:void 0,last:void 0,size:0}),Ds||(v.size=0),yx(g)||bx(g,v[i],{that:v,AS_ENTRIES:t})}),n=o.prototype,a=lu(e),d=function(v,g,w){var _,O,$=a(v),P=p(v,g);return P?P.value=w:($.last=P={index:O=Di(g,!0),key:g,value:w,previous:_=$.last,next:void 0,removed:!1},$.first||($.first=P),_&&(_.next=P),Ds?$.size++:v.size++,O!=="F"&&($.index[O]=P)),v},p=function(v,g){var w,_=a(v),O=Di(g);if(O!=="F")return _.index[O];for(w=_.first;w;w=w.next)if(w.key===g)return w};return Rm(n,{clear:function(){for(var v=a(this),g=v.index,w=v.first;w;)w.removed=!0,w.previous&&(w.previous=w.previous.next=void 0),delete g[w.index],w=w.next;v.first=v.last=void 0,Ds?v.size=0:this.size=0},delete:function(v){var g=this,w=a(g),_=p(g,v);if(_){var O=_.next,$=_.previous;delete w.index[_.index],_.removed=!0,$&&($.next=O),O&&(O.previous=$),w.first===_&&(w.first=O),w.last===_&&(w.last=$),Ds?w.size--:g.size--}return!!_},forEach:function(v){for(var g,w=a(this),_=gx(v,arguments.length>1?arguments[1]:void 0);g=g?g.next:w.first;)for(_(g.value,g.key,this);g&&g.removed;)g=g.previous},has:function(v){return!!p(this,v)}}),Rm(n,t?{get:function(v){var g=p(this,v);return g&&g.value},set:function(v,g){return d(this,v===0?0:v,g)}}:{add:function(v){return d(this,v=v===0?0:v,v)}}),Ds&&vx(n,"size",{configurable:!0,get:function(){return a(this).size}}),o},setStrong:function(r,e,t){var i=e+" Iterator",o=lu(e),n=lu(i);hu(r,e,function(a,d){jm(this,{type:i,target:a,state:o(a),kind:d,last:void 0})},function(){for(var a=n(this),d=a.kind,p=a.last;p&&p.removed;)p=p.previous;return a.target&&(a.last=p=p?p.next:a.state.first)?Fm(d==="keys"?p.key:d==="values"?p.value:[p.key,p.value],!1):(a.target=void 0,Fm(void 0,!0))},t?"entries":"values",!t,!0),Bm(e)}};su("Map",function(r){return function(){return r(this,arguments.length?arguments[0]:void 0)}},zm);var du=de,Lm=Sr,wx=Qt,_x=Li,Ex=du("".charAt),Hm=du("".charCodeAt),cu=du("".slice),Wm=function(r){return function(e,t){var i,o,n=wx(_x(e)),a=Lm(t),d=n.length;return a<0||a>=d?r?"":void 0:(i=Hm(n,a))<55296||i>56319||a+1===d||(o=Hm(n,a+1))<56320||o>57343?r?Ex(n,a):i:r?cu(n,a,a+2):o-56320+(i-55296<<10)+65536}},Ox={codeAt:Wm(!1),charAt:Wm(!0)}.charAt,Um=Qt,Vm=di,xx=Gd,uu=Kd,qm="String Iterator",Gm=Vm.set,Sx=Vm.getterFor(qm);xx(String,"String",function(r){Gm(this,{type:qm,string:Um(r),index:0})},function(){var r,e=Sx(this),t=e.string,i=e.index;return i>=t.length?uu(void 0,!0):(r=Ox(t,i),e.index+=r.length,uu(r,!1))});var pu=A(ne.Map);class Tx{constructor(){this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},ge(this.options,this.defaultOptions)}setOptions(e){const t=["useDefaultGroups"];if(e!==void 0){for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&ce(t).call(t,i)===-1){const o=e[i];this.add(i,o)}}}clear(){this._groups=new pu,this._groupNames=[]}get(e){let t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this._groups.get(e);if(i===void 0&&t)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){const o=this._groupIndex%this._groupNames.length;++this._groupIndex,i={},i.color=this._groups.get(this._groupNames[o]),this._groups.set(e,i)}else{const o=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,i={},i.color=this._defaultGroups[o],this._groups.set(e,i)}return i}add(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}}V({target:"Number",stat:!0},{isNaN:function(r){return r!=r}});var fu=A(ne.Number.isNaN),Ix=we.isFinite,$x=Number.isFinite||function(r){return typeof r=="number"&&Ix(r)};V({target:"Number",stat:!0},{isFinite:$x});var ro=A(ne.Number.isFinite),Cx=xi.some;V({target:"Array",proto:!0,forced:!Go("some")},{some:function(r){return Cx(this,r,arguments.length>1?arguments[1]:void 0)}});var Px=et("Array").some,vu=Ie,kx=Px,gu=Array.prototype,Dx=function(r){var e=r.some;return r===gu||vu(gu,r)&&e===gu.some?kx:e},Mx=A(Dx),Km={exports:{}},Ax=V,Nx=ze,Ym=It.f;Ax({target:"Object",stat:!0,forced:Object.defineProperty!==Ym,sham:!Nx},{defineProperty:Ym});var Dh=ne.Object,Rx=Km.exports=function(r,e,t){return Dh.defineProperty(r,e,t)};Dh.defineProperty.sham&&(Rx.sham=!0);var Xm=Km.exports,Fx=A(Xm),Bx=Me,Qm=It.f,mu=Bx("metadata"),Jm=Function.prototype;Jm[mu]===void 0&&Qm(Jm,mu,{value:null}),Se("asyncDispose"),Se("dispose"),Se("metadata");var jx=_v,zx=de,Ms=le("Symbol"),Lx=Ms.keyFor,Hx=zx(Ms.prototype.valueOf),Zm=Ms.isRegisteredSymbol||function(r){try{return Lx(Hx(r))!==void 0}catch{return!1}};V({target:"Symbol",stat:!0},{isRegisteredSymbol:Zm});for(var Wx=Hi,oo=le,ey=de,Ux=kn,Vx=Me,Mh=oo("Symbol"),yu=Mh.isWellKnownSymbol,ty=oo("Object","getOwnPropertyNames"),qx=ey(Mh.prototype.valueOf),iy=Wx("wks"),bu=0,ry=ty(Mh),oy=ry.length;bu<oy;bu++)try{var ny=ry[bu];Ux(Mh[ny])&&Vx(ny)}catch{}var sy=function(r){if(yu&&yu(r))return!0;try{for(var e=qx(r),t=0,i=ty(iy),o=i.length;t<o;t++)if(iy[i[t]]==e)return!0}catch{}return!1};V({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:sy}),Se("matcher"),Se("observable"),V({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:Zm}),V({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:sy}),Se("metadataKey"),Se("patternMatch"),Se("replaceAll");var Ah=A(jx),ay=A(Xn.f("iterator"));function As(r){return As=typeof Ah=="function"&&typeof ay=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Ah=="function"&&e.constructor===Ah&&e!==Ah.prototype?"symbol":typeof e},As(r)}var Gx=A(Xn.f("toPrimitive"));function Kx(r){var e=function(t,i){if(As(t)!=="object"||t===null)return t;var o=t[Gx];if(o!==void 0){var n=o.call(t,i||"default");if(As(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(t)}(r,"string");return As(e)==="symbol"?e:String(e)}function Nh(r,e,t){return(e=Kx(e))in r?Fx(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var hy=we,Yx=G,Xx=Qt,Qx=ng.trim,Jx=ch,Zx=de("".charAt),Rh=hy.parseFloat,ly=hy.Symbol,dy=ly&&ly.iterator,wu=1/Rh(Jx+"-0")!=-1/0||dy&&!Yx(function(){Rh(Object(dy))})?function(r){var e=Qx(Xx(r)),t=Rh(e);return t===0&&Zx(e,0)==="-"?-0:t}:Rh;V({global:!0,forced:parseFloat!==wu},{parseFloat:wu});var cy=A(ne.parseFloat),eS=V,_u=G,tS=za.f;eS({target:"Object",stat:!0,forced:_u(function(){return!Object.getOwnPropertyNames(1)})},{getOwnPropertyNames:tS});var iS=ne.Object,rS=function(r){return iS.getOwnPropertyNames(r)},oS=A(rS),hr=A(ne.Object.getOwnPropertySymbols),uy={exports:{}},nS=V,sS=G,py=Yt,Eu=bo.f,fy=ze;nS({target:"Object",stat:!0,forced:!fy||sS(function(){Eu(1)}),sham:!fy},{getOwnPropertyDescriptor:function(r,e){return Eu(py(r),e)}});var vy=ne.Object,aS=uy.exports=function(r,e){return vy.getOwnPropertyDescriptor(r,e)};vy.getOwnPropertyDescriptor.sham&&(aS.sham=!0);var lr=A(uy.exports),hS=w_,lS=Yt,dS=bo,cS=Hn;V({target:"Object",stat:!0,sham:!ze},{getOwnPropertyDescriptors:function(r){for(var e,t,i=lS(r),o=dS.f,n=hS(i),a={},d=0;n.length>d;)(t=o(i,e=n[d++]))!==void 0&&cS(a,e,t);return a}});var Mi=A(ne.Object.getOwnPropertyDescriptors),gy={exports:{}},my=V,uS=ze,Ou=Fa.f;my({target:"Object",stat:!0,forced:Object.defineProperties!==Ou,sham:!uS},{defineProperties:Ou});var yy=ne.Object,by=gy.exports=function(r,e){return yy.defineProperties(r,e)};yy.defineProperties.sham&&(by.sham=!0);var Fh=A(gy.exports),Ns=A(Xm);function xu(r,e){const t=["node","edge","label"];let i=!0;const o=nr(e,"chosen");if(typeof o=="boolean")i=o;else if(typeof o=="object"){if(ce(t).call(t,r)===-1)throw new Error("choosify: subOption '"+r+"' should be one of '"+t.join("', '")+"'");const n=nr(e,["chosen",r]);typeof n!="boolean"&&typeof n!="function"||(i=n)}return i}function Su(r,e,t){if(r.width<=0||r.height<=0)return!1;if(t!==void 0){const n={x:e.x-t.x,y:e.y-t.y};if(t.angle!==0){const a=-t.angle;e={x:Math.cos(a)*n.x-Math.sin(a)*n.y,y:Math.sin(a)*n.x+Math.cos(a)*n.y}}else e=n}const i=r.x+r.width,o=r.y+r.width;return r.left<e.x&&i>e.x&&r.top<e.y&&o>e.y}function Bh(r){return typeof r=="string"&&r!==""}function wy(r,e,t,i){let o=i.x,n=i.y;if(typeof i.distanceToBorder=="function"){const a=i.distanceToBorder(r,e),d=Math.sin(e)*a,p=Math.cos(e)*a;p===a?(o+=a,n=i.y):d===a?(o=i.x,n-=a):(o+=p,n-=d)}else i.shape.width>i.shape.height?(o=i.x+.5*i.shape.width,n=i.y-t):(o=i.x+t,n=i.y-.5*i.shape.height);return{x:o,y:n}}var _y=et("Array").values,pS=$r,fS=Ze,oi=Ie,Wt=_y,ln=Array.prototype,Tu={DOMTokenList:!0,NodeList:!0},no=function(r){var e=r.values;return r===ln||oi(ln,r)&&e===ln.values||fS(Tu,pS(r))?Wt:e},Iu=A(no);class vS{constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let o=t;t!==void 0&&t!==""||(o=" ");const n=this.measureText(o,i),a=ge({},Iu(n));a.text=t,a.width=n.width,a.mod=i,t!==void 0&&t!==""||(a.width=0),this.lines[e].blocks.push(a),this.lines[e].width+=a.width}curWidth(){const e=this.lines[this.current];return e===void 0?0:e.width}append(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t)}newLine(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t),this.current++}determineLineHeights(){for(let e=0;e<this.lines.length;e++){const t=this.lines[e];let i=0;if(t.blocks!==void 0)for(let o=0;o<t.blocks.length;o++){const n=t.blocks[o];i<n.height&&(i=n.height)}t.height=i}}determineLabelSize(){let e=0,t=0;for(let i=0;i<this.lines.length;i++){const o=this.lines[i];o.width>e&&(e=o.width),t+=o.height}this.width=e,this.height=t}removeEmptyBlocks(){const e=[];for(let t=0;t<this.lines.length;t++){const i=this.lines[t];if(i.blocks.length===0||t===this.lines.length-1&&i.width===0)continue;const o={};let n;ge(o,i),o.blocks=[];const a=[];for(let d=0;d<i.blocks.length;d++){const p=i.blocks[d];p.width!==0?a.push(p):n===void 0&&(n=p)}a.length===0&&n!==void 0&&a.push(n),o.blocks=a,e.push(o)}return e}finalize(){this.determineLineHeights(),this.determineLabelSize();const e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}}const gS={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/};class so{constructor(e){this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}mod(){return this.modStack.length===0?"normal":this.modStack[0]}modName(){return this.modStack.length===0?"normal":this.modStack[0]==="mono"?"mono":this.bold&&this.ital?"boldital":this.bold?"bold":this.ital?"ital":void 0}emitBlock(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}add(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}parseWS(e){return!!/[ \t]/.test(e)&&(this.mono?this.add(e):this.spacing=!0,!0)}setTag(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}unsetTag(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}parseStartTag(e,t){return!(this.mono||this[e]||!this.match(t))&&(this.setTag(e),!0)}match(e){let t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const[i,o]=this.prepareRegExp(e),n=i.test(this.text.substr(this.position,o));return n&&t&&(this.position+=o-1),n}parseEndTag(e,t,i){let o=this.mod()===e;return o=e==="mono"?o&&this.mono:o&&!this.mono,!(!o||!this.match(t))&&(i!==void 0?(this.position===this.text.length-1||this.match(i,!1))&&this.unsetTag(e):this.unsetTag(e),!0)}replace(e,t){return!!this.match(e)&&(this.add(t),this.position+=length-1,!0)}prepareRegExp(e){let t,i;if(e instanceof RegExp)i=e,t=1;else{const o=gS[e];i=o!==void 0?o:new RegExp(e),t=e.length}return[i,t]}}class ao{constructor(e,t,i,o){this.ctx=e,this.parent=t,this.selected=i,this.hover=o,this.lines=new vS((n,a)=>{if(n===void 0)return 0;const d=this.parent.getFormattingValues(e,i,o,a);let p=0;return n!==""&&(p=this.ctx.measureText(n).width),{width:p,values:d}})}process(e){if(!Bh(e))return this.lines.finalize();const t=this.parent.fontOptions;e=(e=e.replace(/\r\n/g,`
`)).replace(/\r/g,`
`);const i=String(e).split(`
`),o=i.length;if(t.multi)for(let n=0;n<o;n++){const a=this.splitBlocks(i[n],t.multi);if(a!==void 0)if(a.length!==0){if(t.maxWdt>0)for(let d=0;d<a.length;d++){const p=a[d].mod,v=a[d].text;this.splitStringIntoLines(v,p,!0)}else for(let d=0;d<a.length;d++){const p=a[d].mod,v=a[d].text;this.lines.append(v,p)}this.lines.newLine()}else this.lines.newLine("")}else if(t.maxWdt>0)for(let n=0;n<o;n++)this.splitStringIntoLines(i[n]);else for(let n=0;n<o;n++)this.lines.newLine(i[n]);return this.lines.finalize()}decodeMarkupSystem(e){let t="none";return e==="markdown"||e==="md"?t="markdown":e!==!0&&e!=="html"||(t="html"),t}splitHtmlBlocks(e){const t=new so(e),i=o=>/&/.test(o)?(t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&")||t.add("&"),!0):!1;for(;t.position<t.text.length;){const o=t.text.charAt(t.position);t.parseWS(o)||/</.test(o)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||i(o)||t.add(o),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){const t=new so(e);let i=!0;const o=n=>!!/\\/.test(n)&&(t.position<this.text.length+1&&(t.position++,n=this.text.charAt(t.position),/ \t/.test(n)?t.spacing=!0:(t.add(n),i=!1)),!0);for(;t.position<t.text.length;){const n=t.text.charAt(t.position);t.parseWS(n)||o(n)||(i||t.spacing)&&(t.parseStartTag("bold","*")||t.parseStartTag("ital","_")||t.parseStartTag("mono","`"))||t.parseEndTag("bold","*","afterBold")||t.parseEndTag("ital","_","afterItal")||t.parseEndTag("mono","`","afterMono")||(t.add(n),i=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){const i=this.decodeMarkupSystem(t);return i==="none"?[{text:e,mod:"normal"}]:i==="markdown"?this.splitMarkdownBlocks(e):i==="html"?this.splitHtmlBlocks(e):void 0}overMaxWidth(e){const t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t="",i=0;for(;i<e.length;){const o=t+(t===""?"":" ")+e[i];if(this.overMaxWidth(o))break;t=o,i++}return i}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(fi(e).call(e,0,t));)t++;return t}splitStringIntoLines(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal",i=arguments.length>2&&arguments[2]!==void 0&&arguments[2];this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t);let o=(e=(e=e.replace(/^( +)/g,"$1\r")).replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r")).split("\r");for(;o.length>0;){let n=this.getLongestFit(o);if(n===0){const a=o[0],d=this.getLongestFitWord(a);this.lines.newLine(fi(a).call(a,0,d),t),o[0]=fi(a).call(a,d)}else{let a=n;o[n-1]===" "?n--:o[a]===" "&&a++;const d=fi(o).call(o,0,n).join("");n==o.length&&i?this.lines.append(d,t):this.lines.newLine(d,t),o=fi(o).call(o,a)}}}}const ho=["bold","ital","boldital","mono"];class Ai{constructor(e,t){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2];this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=i}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),Bh(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){const t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){se(ho,t=>{this.fontOptions[t]={}}),Ai.parseFontString(this.fontOptions,e)?this.fontOptions.vadjust=0:se(e,(t,i)=>{t!=null&&typeof t!="object"&&(this.fontOptions[i]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;const i=t.split(" ");return e.size=+i[0].replace("px",""),e.face=i[1],e.color=i[2],!0}constrain(e){const t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=nr(e,"widthConstraint");if(typeof i=="number")t.maxWdt=Number(i),t.minWdt=Number(i);else if(typeof i=="object"){const n=nr(e,["widthConstraint","maximum"]);typeof n=="number"&&(t.maxWdt=Number(n));const a=nr(e,["widthConstraint","minimum"]);typeof a=="number"&&(t.minWdt=Number(a))}const o=nr(e,"heightConstraint");if(typeof o=="number")t.minHgt=Number(o);else if(typeof o=="object"){const n=nr(e,["heightConstraint","minimum"]);typeof n=="number"&&(t.minHgt=Number(n));const a=nr(e,["heightConstraint","valign"]);typeof a=="string"&&(a!=="top"&&a!=="bottom"||(t.valign=a))}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),ye(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=xu("label",t)}adjustSizes(e){const t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);const i=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}addFontOptionsToPile(e,t){for(let i=0;i<t.length;++i)this.addFontToPile(e,t[i])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;const i=t.font;e.push(i)}getBasicOptions(e){const t={};for(let i=0;i<e.length;++i){let o=e[i];const n={};Ai.parseFontString(n,o)&&(o=n),se(o,(a,d)=>{a!==void 0&&(Object.prototype.hasOwnProperty.call(t,d)||(ce(ho).call(ho,d)!==-1?t[d]={}:t[d]=a))})}return t}getFontOption(e,t,i){let o;for(let n=0;n<e.length;++n){const a=e[n];if(Object.prototype.hasOwnProperty.call(a,t)){if(o=a[t],o==null)continue;const d={};if(Ai.parseFontString(d,o)&&(o=d),Object.prototype.hasOwnProperty.call(o,i))return o[i]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,i))return this.fontOptions[i];throw new Error("Did not find value for multi-font for property: '"+i+"'")}getFontOptions(e,t){const i={},o=["color","size","face","mod","vadjust"];for(let n=0;n<o.length;++n){const a=o[n];i[a]=this.getFontOption(e,t,a)}return i}propagateFonts(e){const t=[];this.addFontOptionsToPile(t,e),this.fontOptions=this.getBasicOptions(t);for(let i=0;i<ho.length;++i){const o=ho[i],n=this.fontOptions[o];se(this.getFontOptions(t,o),(a,d)=>{n[d]=a}),n.size=Number(n.size),n.vadjust=Number(n.vadjust)}}draw(e,t,i,o,n){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let d=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&d<this.elementOptions.scaling.label.drawThreshold-1||(d>=this.elementOptions.scaling.label.maxVisible&&(d=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,o,n,t,i,a),this._drawBackground(e),this._drawText(e,t,this.size.yLine,a,d))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;const t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}_drawText(e,t,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",n=arguments.length>4?arguments[4]:void 0;[t,i]=this._setAlignment(e,t,i,o),e.textAlign="left",t-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(i-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(i+=(this.size.height-this.size.labelHeight)/2));for(let a=0;a<this.lineCount;a++){const d=this.lines[a];if(d&&d.blocks){let p=0;this.isEdgeLabel||this.fontOptions.align==="center"?p+=(this.size.width-d.width)/2:this.fontOptions.align==="right"&&(p+=this.size.width-d.width);for(let v=0;v<d.blocks.length;v++){const g=d.blocks[v];e.font=g.font;const[w,_]=this._getColor(g.color,n,g.strokeColor);g.strokeWidth>0&&(e.lineWidth=g.strokeWidth,e.strokeStyle=_,e.lineJoin="round"),e.fillStyle=w,g.strokeWidth>0&&e.strokeText(g.text,t+p,i+g.vadjust),e.fillText(g.text,t+p,i+g.vadjust),p+=g.width}i+=d.height}}}_setAlignment(e,t,i,o){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){t=0,i=0;const n=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",i-=2*n):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",i+=2*n):e.textBaseline="middle"}else e.textBaseline=o;return[t,i]}_getColor(e,t,i){let o=e||"#000000",n=i||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){const a=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));o=Lt(o,a),n=Lt(n,a)}return[o,n]}getTextSize(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return this._processLabel(e,t,i),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let e=this.size.left,t=this.size.top-1;if(this.isEdgeLabel){const i=.5*-this.size.width;switch(this.fontOptions.align){case"middle":e=i,t=.5*-this.size.height;break;case"top":e=i,t=-(this.size.height+2);break;case"bottom":e=i,t=2}}return{left:e,top:t,width:this.size.width,height:this.size.height}}calculateLabelSize(e,t,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,t,i),this.size.left=o-.5*this.size.width,this.size.top=n-.5*this.size.height,this.size.yLine=n+.5*(1-this.lineCount)*this.fontOptions.size,a==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,t,i,o){const n=function(p,v,g){return v==="normal"?g==="mod"?"":p[g]:p[v][g]!==void 0?p[v][g]:p[g]},a={color:n(this.fontOptions,o,"color"),size:n(this.fontOptions,o,"size"),face:n(this.fontOptions,o,"face"),mod:n(this.fontOptions,o,"mod"),vadjust:n(this.fontOptions,o,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||i)&&(o==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?a.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(a,this.elementOptions.id,t,i));let d="";return a.mod!==void 0&&a.mod!==""&&(d+=a.mod+" "),d+=a.size+"px "+a.face,e.font=d.replace(/"/g,""),a.font=e.font,a.height=a.size,a}differentState(e,t){return e!==this.selectedState||t!==this.hoverState}_processLabelText(e,t,i,o){return new ao(e,this,t,i).process(o)}_processLabel(e,t,i){if(this.labelDirty===!1&&!this.differentState(t,i))return;const o=this._processLabelText(e,t,i,this.elementOptions.label);this.fontOptions.minWdt>0&&o.width<this.fontOptions.minWdt&&(o.width=this.fontOptions.minWdt),this.size.labelHeight=o.height,this.fontOptions.minHgt>0&&o.height<this.fontOptions.minHgt&&(o.height=this.fontOptions.minHgt),this.lines=o.lines,this.lineCount=o.lines.length,this.size.width=o.width,this.size.height=o.height,this.selectedState=t,this.hoverState=i,this.labelDirty=!1}visible(){return this.size.width===0||this.size.height===0||this.elementOptions.label===void 0?!1:!(this.fontOptions.size*this.body.view.scale<this.elementOptions.scaling.label.drawThreshold-1)}}class wt{constructor(e,t,i){this.body=t,this.labelModule=i,this.setOptions(e),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}setOptions(e){this.options=e}_setMargins(e){this.margin={},this.options.margin&&(typeof this.options.margin=="object"?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),e.adjustSizes(this.margin)}_distanceToBorder(e,t){const i=this.options.borderWidth;return e&&this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}enableShadow(e,t){t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}enableBorderDashes(e,t){if(t.borderDashes!==!1)if(e.setLineDash!==void 0){let i=t.borderDashes;i===!0&&(i=[5,15]),e.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1}disableBorderDashes(e,t){t.borderDashes!==!1&&(e.setLineDash!==void 0?e.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1))}needsRefresh(e,t){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,t)}initContextForDraw(e,t){const i=t.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,i),e.strokeStyle=t.borderColor,e.fillStyle=t.color}performStroke(e,t){const i=t.borderWidth/this.body.view.scale;e.save(),i>0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}performFill(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),ys(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,t,i,o,n){i!==void 0&&this.resize(i,o,n),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}updateBoundingBox(e,t,i,o,n){this._updateBoundingBox(e,t,i,o,n)}getDimensionsFromLabel(e,t,i){this.textSize=this.labelModule.getTextSize(e,t,i);let o=this.textSize.width,n=this.textSize.height;return o===0&&(o=14,n=14),{width:o,height:n}}}let Ey=class extends wt{constructor(r,e,t){super(r,e,t),this._setMargins(t)}resize(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(e,t)){const i=this.getDimensionsFromLabel(r,e,t);this.width=i.width+this.margin.right+this.margin.left,this.height=i.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(r,e,t,i,o,n){this.resize(r,i,o),this.left=e-this.width/2,this.top=t-this.height/2,this.initContextForDraw(r,n),Xp(r,this.left,this.top,this.width,this.height,n.borderRadius),this.performFill(r,n),this.updateBoundingBox(e,t,r,i,o),this.labelModule.draw(r,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,i,o)}updateBoundingBox(r,e,t,i,o){this._updateBoundingBox(r,e,t,i,o);const n=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(n)}distanceToBorder(r,e){r&&this.resize(r);const t=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+t}};class jh extends wt{constructor(e,t,i){super(e,t,i),this.labelOffset=0,this.selected=!1}setOptions(e,t,i){this.options=e,t===void 0&&i===void 0||this.setImages(t,i)}setImages(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}switchImages(e){const t=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&t){const i=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=i}}_getImagePadding(){const e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){const t=this.options.imagePadding;typeof t=="object"?(e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left):(e.top=t,e.right=t,e.bottom=t,e.left=t)}return e}_resizeImage(){let e,t;if(this.options.shapeProperties.useImageSize===!1){let i=1,o=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?i=this.imageObj.width/this.imageObj.height:o=this.imageObj.height/this.imageObj.width),e=2*this.options.size*i,t=2*this.options.size*o}else{const i=this._getImagePadding();e=this.imageObj.width+i.left+i.right,t=this.imageObj.height+i.top+i.bottom}this.width=e,this.height=t,this.radius=.5*this.width}_drawRawCircle(e,t,i,o){this.initContextForDraw(e,o),ql(e,t,i,o.size),this.performFill(e,o)}_drawImageAtPosition(e,t){if(this.imageObj.width!=0){e.globalAlpha=t.opacity!==void 0?t.opacity:1,this.enableShadow(e,t);let i=1;this.options.shapeProperties.interpolation===!0&&(i=this.imageObj.width/this.width/this.body.view.scale);const o=this._getImagePadding(),n=this.left+o.left,a=this.top+o.top,d=this.width-o.left-o.right,p=this.height-o.top-o.bottom;this.imageObj.drawImageAtPosition(e,i,n,a,d,p),this.disableShadow(e,t)}}_drawImageLabel(e,t,i,o,n){let a=0;if(this.height!==void 0){a=.5*this.height;const p=this.labelModule.getTextSize(e,o,n);p.lineCount>=1&&(a+=p.height/2)}const d=i+a;this.options.label&&(this.labelOffset=a),this.labelModule.draw(e,t,d,o,n,"hanging")}}let mS=class extends jh{constructor(r,e,t){super(r,e,t),this._setMargins(t)}resize(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(e,t)){const i=this.getDimensionsFromLabel(r,e,t),o=Math.max(i.width+this.margin.right+this.margin.left,i.height+this.margin.top+this.margin.bottom);this.options.size=o/2,this.width=o,this.height=o,this.radius=this.width/2}}draw(r,e,t,i,o,n){this.resize(r,i,o),this.left=e-this.width/2,this.top=t-this.height/2,this._drawRawCircle(r,e,t,n),this.updateBoundingBox(e,t),this.labelModule.draw(r,this.left+this.textSize.width/2+this.margin.left,t,i,o)}updateBoundingBox(r,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=r-this.options.size,this.boundingBox.right=r+this.options.size,this.boundingBox.bottom=e+this.options.size}distanceToBorder(r){return r&&this.resize(r),.5*this.width}};class Oy extends jh{constructor(e,t,i,o,n){super(e,t,i),this.setImages(o,n)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){const o=2*this.options.size;return this.width=o,this.height=o,void(this.radius=.5*this.width)}this.needsRefresh(t,i)&&this._resizeImage()}draw(e,t,i,o,n,a){this.switchImages(o),this.resize();let d=t,p=i;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=i,d+=this.width/2,p+=this.height/2):(this.left=t-this.width/2,this.top=i-this.height/2),this._drawRawCircle(e,d,p,a),e.save(),e.clip(),this._drawImageAtPosition(e,a),e.restore(),this._drawImageLabel(e,d,p,o,n),this.updateBoundingBox(t,i)}updateBoundingBox(e,t){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=t,this.boundingBox.left=e,this.boundingBox.right=e+2*this.options.size,this.boundingBox.bottom=t+2*this.options.size):(this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}distanceToBorder(e){return e&&this.resize(e),.5*this.width}}class Ni extends wt{constructor(e,t,i){super(e,t,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,i)){var n,a;this.labelModule.getTextSize(e,t,i);const d=2*o.size;this.width=(n=this.customSizeWidth)!==null&&n!==void 0?n:d,this.height=(a=this.customSizeHeight)!==null&&a!==void 0?a:d,this.radius=.5*this.width}}_drawShape(e,t,i,o,n,a,d,p){var v;return this.resize(e,a,d,p),this.left=o-this.width/2,this.top=n-this.height/2,this.initContextForDraw(e,p),(v=t,Object.prototype.hasOwnProperty.call(Zp,v)?Zp[v]:function(g){for(var w=arguments.length,_=new Array(w>1?w-1:0),O=1;O<w;O++)_[O-1]=arguments[O];CanvasRenderingContext2D.prototype[v].call(g,_)})(e,o,n,p.size),this.performFill(e,p),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(a?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",e.fillText(this.options.icon.code,o,n)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,a,d,o,n,"hanging");const g=n+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,o,g,a,d,"hanging")}this.updateBoundingBox(o,n)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}function zh(r,e){var t=ke(r);if(hr){var i=hr(r);e&&(i=ft(i).call(i,function(o){return lr(r,o).enumerable})),t.push.apply(t,i)}return t}function lo(r){for(var e=1;e<arguments.length;e++){var t,i,o=arguments[e]!=null?arguments[e]:{};e%2?ue(t=zh(Object(o),!0)).call(t,function(n){Nh(r,n,o[n])}):Mi?Fh(r,Mi(o)):ue(i=zh(Object(o))).call(i,function(n){Ns(r,n,lr(o,n))})}return r}class Rs extends Ni{constructor(e,t,i,o){super(e,t,i,o),this.ctxRenderer=o}draw(e,t,i,o,n,a){this.resize(e,o,n,a),this.left=t-this.width/2,this.top=i-this.height/2,e.save();const d=this.ctxRenderer({ctx:e,id:this.options.id,x:t,y:i,state:{selected:o,hover:n},style:lo({},a),label:this.options.label});if(d.drawNode!=null&&d.drawNode(),e.restore(),d.drawExternalLabel){const p=d.drawExternalLabel;d.drawExternalLabel=()=>{e.save(),p(),e.restore()}}return d.nodeDimensions&&(this.customSizeWidth=d.nodeDimensions.width,this.customSizeHeight=d.nodeDimensions.height),d}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class Fs extends wt{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){if(this.needsRefresh(t,i)){const o=this.getDimensionsFromLabel(e,t,i).width+this.margin.right+this.margin.left;this.width=o,this.height=o,this.radius=this.width/2}}draw(e,t,i,o,n,a){this.resize(e,o,n),this.left=t-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,a),Qp(e,t-this.width/2,i-this.height/2,this.width,this.height),this.performFill(e,a),this.updateBoundingBox(t,i,e,o,n),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,n)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let Lh=class extends Ni{constructor(r,e,t){super(r,e,t)}draw(r,e,t,i,o,n){return this._drawShape(r,"diamond",4,e,t,i,o,n)}distanceToBorder(r,e){return this._distanceToBorder(r,e)}};class yS extends Ni{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,n,a){return this._drawShape(e,"circle",2,t,i,o,n,a)}distanceToBorder(e){return e&&this.resize(e),this.options.size}}class xy extends wt{constructor(e,t,i){super(e,t,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const o=this.getDimensionsFromLabel(e,t,i);this.height=2*o.height,this.width=o.width+o.height,this.radius=.5*this.width}}draw(e,t,i,o,n,a){this.resize(e,o,n),this.left=t-.5*this.width,this.top=i-.5*this.height,this.initContextForDraw(e,a),No(e,this.left,this.top,this.width,this.height),this.performFill(e,a),this.updateBoundingBox(t,i,e,o,n),this.labelModule.draw(e,t,i,o,n)}distanceToBorder(e,t){e&&this.resize(e);const i=.5*this.width,o=.5*this.height,n=Math.sin(t)*i,a=Math.cos(t)*o;return i*o/Math.sqrt(n*n+a*a)}}class bS extends wt{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){this.needsRefresh(t,i)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,i,o,n,a){return this.resize(e,o,n),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=i-this.height/2,this._icon(e,t,i,o,n,a),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,i+this.height/2+5,o),this.updateBoundingBox(t,i)}}}updateBoundingBox(e,t){this.boundingBox.top=t-.5*this.options.icon.size,this.boundingBox.left=e-.5*this.options.icon.size,this.boundingBox.right=e+.5*this.options.icon.size,this.boundingBox.bottom=t+.5*this.options.icon.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5))}_icon(e,t,i,o,n,a){const d=Number(this.options.icon.size);this.options.icon.code!==void 0?(e.font=[this.options.icon.weight!=null?this.options.icon.weight:o?"bold":"",(this.options.icon.weight!=null&&o?5:0)+d+"px",this.options.icon.face].join(" "),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,a),e.fillText(this.options.icon.code,t,i),this.disableShadow(e,a)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let wS=class extends jh{constructor(r,e,t,i,o){super(r,e,t),this.setImages(i,o)}resize(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){const i=2*this.options.size;return this.width=i,void(this.height=i)}this.needsRefresh(e,t)&&this._resizeImage()}draw(r,e,t,i,o,n){r.save(),this.switchImages(i),this.resize();let a=e,d=t;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=t,a+=this.width/2,d+=this.height/2):(this.left=e-this.width/2,this.top=t-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){const p=this.options.borderWidth,v=this.options.borderWidthSelected||2*this.options.borderWidth,g=(i?v:p)/this.body.view.scale;r.lineWidth=Math.min(this.width,g),r.beginPath();let w=i?this.options.color.highlight.border:o?this.options.color.hover.border:this.options.color.border,_=i?this.options.color.highlight.background:o?this.options.color.hover.background:this.options.color.background;n.opacity!==void 0&&(w=Lt(w,n.opacity),_=Lt(_,n.opacity)),r.strokeStyle=w,r.fillStyle=_,r.rect(this.left-.5*r.lineWidth,this.top-.5*r.lineWidth,this.width+r.lineWidth,this.height+r.lineWidth),ys(r).call(r),this.performStroke(r,n),r.closePath()}this._drawImageAtPosition(r,n),this._drawImageLabel(r,a,d,i,o),this.updateBoundingBox(e,t),r.restore()}updateBoundingBox(r,e){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=r,this.top=e):(this.left=r-this.width/2,this.top=e-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}distanceToBorder(r,e){return this._distanceToBorder(r,e)}};class Bs extends Ni{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,n,a){return this._drawShape(e,"square",2,t,i,o,n,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class _S extends Ni{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,n,a){return this._drawShape(e,"hexagon",4,t,i,o,n,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class $u extends Ni{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,n,a){return this._drawShape(e,"star",4,t,i,o,n,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class ES extends wt{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){this.needsRefresh(t,i)&&(this.textSize=this.labelModule.getTextSize(e,t,i),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,i,o,n,a){this.resize(e,o,n),this.left=t-this.width/2,this.top=i-this.height/2,this.enableShadow(e,a),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,n),this.disableShadow(e,a),this.updateBoundingBox(t,i,e,o,n)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let OS=class extends Ni{constructor(r,e,t){super(r,e,t)}draw(r,e,t,i,o,n){return this._drawShape(r,"triangle",3,e,t,i,o,n)}distanceToBorder(r,e){return this._distanceToBorder(r,e)}};class _t extends Ni{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,n,a){return this._drawShape(e,"triangleDown",3,t,i,o,n,a)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}function dr(r,e){var t=ke(r);if(hr){var i=hr(r);e&&(i=ft(i).call(i,function(o){return lr(r,o).enumerable})),t.push.apply(t,i)}return t}function Re(r){for(var e=1;e<arguments.length;e++){var t,i,o=arguments[e]!=null?arguments[e]:{};e%2?ue(t=dr(Object(o),!0)).call(t,function(n){Nh(r,n,o[n])}):Mi?Fh(r,Mi(o)):ue(i=dr(Object(o))).call(i,function(n){Ns(r,n,lr(o,n))})}return r}class ae{constructor(e,t,i,o,n,a){this.options=or(n),this.globalOptions=n,this.defaultOptions=a,this.body=t,this.edges=[],this.id=void 0,this.imagelist=i,this.grouplist=o,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new Ai(this.body,this.options,!1),this.setOptions(e)}attachEdge(e){var t;ce(t=this.edges).call(t,e)===-1&&this.edges.push(e)}detachEdge(e){var t;const i=ce(t=this.edges).call(t,e);var o;i!=-1&&Ti(o=this.edges).call(o,i,1)}setOptions(e){const t=this.options.shape;if(!e)return;if(e.color!==void 0&&(this._localColor=e.color),e.id!==void 0&&(this.id=e.id),this.id===void 0)throw new Error("Node must have an id");ae.checkMass(e,this.id),e.x!==void 0&&(e.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=tt(e.x),this.predefinedPosition=!0)),e.y!==void 0&&(e.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=tt(e.y),this.predefinedPosition=!0)),e.size!==void 0&&(this.baseSize=e.size),e.value!==void 0&&(e.value=cy(e.value)),ae.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);const i=[e,this.options,this.defaultOptions];return this.chooser=xu("node",i),this._load_images(),this.updateLabelModule(e),e.opacity!==void 0&&ae.checkOpacity(e.opacity)&&(this.options.opacity=e.opacity),this.updateShape(t),e.hidden!==void 0||e.physics!==void 0}_load_images(){if((this.options.shape==="circularImage"||this.options.shape==="image")&&this.options.image===void 0)throw new Error("Option image must be defined for node type '"+this.options.shape+"'");if(this.options.image!==void 0){if(this.imagelist===void 0)throw new Error("Internal Error: No images provided");if(typeof this.options.image=="string")this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(this.options.image.unselected===void 0)throw new Error("No unselected image provided");this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),this.options.image.selected!==void 0?this.imageObjAlt=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id):this.imageObjAlt=void 0}}}static checkOpacity(e){return 0<=e&&e<=1}static checkCoordinateOrigin(e){return e===void 0||e==="center"||e==="top-left"}static updateGroupOptions(e,t,i){var o;if(i===void 0)return;const n=e.group;if(t!==void 0&&t.group!==void 0&&n!==t.group)throw new Error("updateGroupOptions: group values in options don't match.");if(!(typeof n=="number"||typeof n=="string"&&n!=""))return;const a=i.get(n);a.opacity!==void 0&&t.opacity===void 0&&(ae.checkOpacity(a.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+a.opacity),a.opacity=void 0));const d=ft(o=oS(t)).call(o,p=>t[p]!=null);d.push("font"),io(d,e,a),e.color=Wc(e.color)}static parseOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=arguments.length>4?arguments[4]:void 0;if(io(["color","fixed","shadow"],e,t,i),ae.checkMass(t),e.opacity!==void 0&&(ae.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),t.opacity!==void 0&&(ae.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),t.shapeProperties&&!ae.checkCoordinateOrigin(t.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+t.shapeProperties.coordinateOrigin),Ht(e,t,"shadow",o),t.color!==void 0&&t.color!==null){const a=Wc(t.color);Lc(e.color,a)}else i===!0&&t.color===null&&(e.color=or(o.color));t.fixed!==void 0&&t.fixed!==null&&(typeof t.fixed=="boolean"?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(t.fixed.x!==void 0&&typeof t.fixed.x=="boolean"&&(e.fixed.x=t.fixed.x),t.fixed.y!==void 0&&typeof t.fixed.y=="boolean"&&(e.fixed.y=t.fixed.y))),i===!0&&t.font===null&&(e.font=or(o.font)),ae.updateGroupOptions(e,t,n),t.scaling!==void 0&&Ht(e.scaling,t.scaling,"label",o.scaling)}getFormattingValues(){const e={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?this.chooser===!0?this.selected?(this.options.borderWidthSelected!=null?e.borderWidth=this.options.borderWidthSelected:e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser=="function"&&(this.chooser(e,this.options.id,this.selected,this.hover),e.shadow===!1&&(e.shadowColor===this.options.shadow.color&&e.shadowSize===this.options.shadow.size&&e.shadowX===this.options.shadow.x&&e.shadowY===this.options.shadow.y||(e.shadow=!0))):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){const t=this.options.opacity;e.borderColor=Lt(e.borderColor,t),e.color=Lt(e.color,t),e.shadowColor=Lt(e.shadowColor,t)}return e}updateLabelModule(e){this.options.label!==void 0&&this.options.label!==null||(this.options.label=""),ae.updateGroupOptions(this.options,Re(Re({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);const t=this.grouplist.get(this.options.group,!1),i=[e,this.options,t,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,i),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new Ey(this.options,this.body,this.labelModule);break;case"circle":this.shape=new mS(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new Oy(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new Rs(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new Fs(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new Lh(this.options,this.body,this.labelModule);break;case"dot":this.shape=new yS(this.options,this.body,this.labelModule);break;case"ellipse":default:this.shape=new xy(this.options,this.body,this.labelModule);break;case"icon":this.shape=new bS(this.options,this.body,this.labelModule);break;case"image":this.shape=new wS(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new Bs(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new _S(this.options,this.body,this.labelModule);break;case"star":this.shape=new $u(this.options,this.body,this.labelModule);break;case"text":this.shape=new ES(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new OS(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new _t(this.options,this.body,this.labelModule)}this.needsRefresh()}select(){this.selected=!0,this.needsRefresh()}unselect(){this.selected=!1,this.needsRefresh()}needsRefresh(){this.shape.refreshNeeded=!0}getTitle(){return this.options.title}distanceToBorder(e,t){return this.shape.distanceToBorder(e,t)}isFixed(){return this.options.fixed.x&&this.options.fixed.y}isSelected(){return this.selected}getValue(){return this.options.value}getLabelSize(){return this.labelModule.size()}setValueRange(e,t,i){if(this.options.value!==void 0){const o=this.options.scaling.customScalingFunction(e,t,i,this.options.value),n=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const a=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+o*a}this.options.size=this.options.scaling.min+o*n}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){const t=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){const t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}getItemsOnPoint(e){const t=[];return this.labelModule.visible()&&Su(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),Su(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}isOverlappingWith(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}isBoundingBoxOverlappingWith(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}static checkMass(e,t){if(e.mass!==void 0&&e.mass<=0){let i="";t!==void 0&&(i=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+i+", setting mass to 1.",lm),e.mass=1}}}class Hh{constructor(e,t,i,o){var n;if(this.body=e,this.images=t,this.groups=i,this.layoutEngine=o,this.body.functions.createNode=N(n=this.create).call(n,this),this.nodesListeners={add:(a,d)=>{this.add(d.items)},update:(a,d)=>{this.update(d.items,d.data,d.oldData)},remove:(a,d)=>{this.remove(d.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(a,d,p,v){if(d===a)return .5;{const g=1/(d-a);return Math.max(0,(v-a)*g)}}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:"center"},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=or(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,t;this.body.emitter.on("refreshNodes",N(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",N(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{se(this.nodesListeners,(i,o)=>{this.body.data.nodes&&this.body.data.nodes.off(o,i)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(e){if(e!==void 0){if(ae.parseOptions(this.options,e),e.opacity!==void 0&&(fu(e.opacity)||!ro(e.opacity)||e.opacity<0||e.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(e.font!==void 0||e.widthConstraint!==void 0||e.heightConstraint!==void 0)for(const t of ke(this.body.nodes))this.body.nodes[t].updateLabelModule(),this.body.nodes[t].needsRefresh();if(e.size!==void 0)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].needsRefresh();e.hidden===void 0&&e.physics===void 0||this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];const i=this.body.data.nodes;if(st.isDataViewLike("id",e))this.body.data.nodes=e;else if(Pe(e))this.body.data.nodes=new st.DataSet,this.body.data.nodes.add(e);else{if(e)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new st.DataSet}if(i&&se(this.nodesListeners,function(o,n){i.off(n,o)}),this.body.nodes={},this.body.data.nodes){const o=this;se(this.nodesListeners,function(a,d){o.body.data.nodes.on(d,a)});const n=this.body.data.nodes.getIds();this.add(n,!0)}t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];const o=[];for(let n=0;n<e.length;n++){t=e[n];const a=this.body.data.nodes.get(t),d=this.create(a);o.push(d),this.body.nodes[t]=d}this.layoutEngine.positionInitially(o),i===!1&&this.body.emitter.emit("_dataChanged")}update(e,t,i){const o=this.body.nodes;let n=!1;for(let a=0;a<e.length;a++){const d=e[a];let p=o[d];const v=t[a];p!==void 0?p.setOptions(v)&&(n=!0):(n=!0,p=this.create(v),o[d]=p)}n||i===void 0||(n=Mx(t).call(t,function(a,d){const p=i[d];return p&&p.level!==a.level})),n===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}remove(e){const t=this.body.nodes;for(let i=0;i<e.length;i++)delete t[e[i]];this.body.emitter.emit("_dataChanged")}create(e){return new(arguments.length>1&&arguments[1]!==void 0?arguments[1]:ae)(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0&&arguments[0];se(this.body.nodes,(t,i)=>{const o=this.body.data.nodes.get(i);o!==void 0&&(e===!0&&t.setOptions({x:null,y:null}),t.setOptions({fixed:!1}),t.setOptions(o))})}getPositions(e){const t={};if(e!==void 0){if(Pe(e)===!0){for(let i=0;i<e.length;i++)if(this.body.nodes[e[i]]!==void 0){const o=this.body.nodes[e[i]];t[e[i]]={x:Math.round(o.x),y:Math.round(o.y)}}}else if(this.body.nodes[e]!==void 0){const i=this.body.nodes[e];t[e]={x:Math.round(i.x),y:Math.round(i.y)}}}else for(let i=0;i<this.body.nodeIndices.length;i++){const o=this.body.nodes[this.body.nodeIndices[i]];t[this.body.nodeIndices[i]]={x:Math.round(o.x),y:Math.round(o.y)}}return t}getPosition(e){if(e==null)throw new TypeError("No id was specified for getPosition method.");if(this.body.nodes[e]==null)throw new ReferenceError("NodeId provided for getPosition does not exist. Provided: ".concat(e));return{x:Math.round(this.body.nodes[e].x),y:Math.round(this.body.nodes[e].y)}}storePositions(){const e=[],t=this.body.data.nodes.getDataSet();for(const i of t.get()){const o=i.id,n=this.body.nodes[o],a=Math.round(n.x),d=Math.round(n.y);i.x===a&&i.y===d||e.push({id:o,x:a,y:d})}t.update(e)}getBoundingBox(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}getConnectedNodes(e,t){const i=[];if(this.body.nodes[e]!==void 0){const o=this.body.nodes[e],n={};for(let a=0;a<o.edges.length;a++){const d=o.edges[a];t!=="to"&&d.toId==o.id?n[d.fromId]===void 0&&(i.push(d.fromId),n[d.fromId]=!0):t!=="from"&&d.fromId==o.id&&n[d.toId]===void 0&&(i.push(d.toId),n[d.toId]=!0)}}return i}getConnectedEdges(e){const t=[];if(this.body.nodes[e]!==void 0){const i=this.body.nodes[e];for(let o=0;o<i.edges.length;o++)t.push(i.edges[o].id)}else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return t}moveNode(e,t,i){this.body.nodes[e]!==void 0?(this.body.nodes[e].x=Number(t),this.body.nodes[e].y=Number(i),Ii(()=>{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}}var js=V,dn=Math.hypot,zs=Math.abs,cn=Math.sqrt;js({target:"Math",stat:!0,arity:2,forced:!!dn&&dn(1/0,NaN)!==1/0},{hypot:function(r,e){for(var t,i,o=0,n=0,a=arguments.length,d=0;n<a;)d<(t=zs(arguments[n++]))?(o=o*(i=d/t)*i+1,d=t):o+=t>0?(i=t/d)*i:t;return d===1/0?1/0:d*cn(o)}});var gi=A(ne.Math.hypot);class me{static transform(e,t){Pe(e)||(e=[e]);const i=t.point.x,o=t.point.y,n=t.angle,a=t.length;for(let d=0;d<e.length;++d){const p=e[d],v=p.x*Math.cos(n)-p.y*Math.sin(n),g=p.x*Math.sin(n)+p.y*Math.cos(n);p.x=i+a*v,p.y=o+a*g}}static drawPath(e,t){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(let i=1;i<t.length;++i)e.lineTo(t[i].x,t[i].y);e.closePath()}}let Ls,Sy=class extends me{static draw(r,e){if(e.image){r.save(),r.translate(e.point.x,e.point.y),r.rotate(Math.PI/2+e.angle);const t=e.imageWidth!=null?e.imageWidth:e.image.width,i=e.imageHeight!=null?e.imageHeight:e.image.height;e.image.drawImageAtPosition(r,1,-t/2,0,t,i),r.restore()}return!1}};class Wh extends me{static draw(e,t){const i=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return me.transform(i,t),me.drawPath(e,i),!0}}class Ri{static draw(e,t){const i=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return me.transform(i,t),me.drawPath(e,i),!0}}class Uh{static draw(e,t){const i={x:-.4,y:0};me.transform(i,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";const o=Math.PI,n=t.angle-o/2,a=t.angle+o/2;return e.beginPath(),e.arc(i.x,i.y,.4*t.length,n,a,!1),e.stroke(),!0}}class co{static draw(e,t){const i={x:-.3,y:0};me.transform(i,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";const o=Math.PI,n=t.angle+o/2,a=t.angle+3*o/2;return e.beginPath(),e.arc(i.x,i.y,.4*t.length,n,a,!1),e.stroke(),!0}}class xS{static draw(e,t){const i=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return me.transform(i,t),me.drawPath(e,i),!0}}class Ty{static draw(e,t){const i=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return me.transform(i,t),me.drawPath(e,i),!0}}class Cu{static draw(e,t){const i={x:-.4,y:0};return me.transform(i,t),ql(e,i.x,i.y,.4*t.length),!0}}class Iy{static draw(e,t){const i=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return me.transform(i,t),me.drawPath(e,i),!0}}class $y{static draw(e,t){const i=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return me.transform(i,t),me.drawPath(e,i),!0}}class Vh{static draw(e,t){const i=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return me.transform(i,t),me.drawPath(e,i),!0}}class Pu{static draw(e,t){const i=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return me.transform(i,t),me.drawPath(e,i),!0}}class ku{static draw(e,t){let i;switch(t.type&&(i=t.type.toLowerCase()),i){case"image":return Sy.draw(e,t);case"circle":return Cu.draw(e,t);case"box":return $y.draw(e,t);case"crow":return Ri.draw(e,t);case"curve":return Uh.draw(e,t);case"diamond":return Vh.draw(e,t);case"inv_curve":return co.draw(e,t);case"triangle":return xS.draw(e,t);case"inv_triangle":return Ty.draw(e,t);case"bar":return Iy.draw(e,t);case"vee":return Pu.draw(e,t);default:return Wh.draw(e,t)}}}function Cy(r,e){var t=ke(r);if(hr){var i=hr(r);e&&(i=ft(i).call(i,function(o){return lr(r,o).enumerable})),t.push.apply(t,i)}return t}function Du(r){for(var e=1;e<arguments.length;e++){var t,i,o=arguments[e]!=null?arguments[e]:{};e%2?ue(t=Cy(Object(o),!0)).call(t,function(n){Nh(r,n,o[n])}):Mi?Fh(r,Mi(o)):ue(i=Cy(Object(o))).call(i,function(n){Ns(r,n,lr(o,n))})}return r}class Py{constructor(e,t,i){this._body=t,this._labelModule=i,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(e),this.fromPoint=this.from,this.toPoint=this.to}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}cleanup(){return!1}setOptions(e){this.options=e,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}drawLine(e,t,i,o){let n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,t.dashes!==!1?this._drawDashedLine(e,t,n):this._drawLine(e,t,n)}_drawLine(e,t,i,o,n){if(this.from!=this.to)this._line(e,t,i,o,n);else{const[a,d,p]=this._getCircleData(e);this._circle(e,t,a,d,p)}}_drawDashedLine(e,t,i,o,n){e.lineCap="round";const a=Pe(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(a),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,i);else{const[d,p,v]=this._getCircleData(e);this._circle(e,t,d,p,v)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)Jp(e,this.from.x,this.from.y,this.to.x,this.to.y,a);else{const[d,p,v]=this._getCircleData(e);this._circle(e,t,d,p,v)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}findBorderPosition(e,t,i){return this.from!=this.to?this._findBorderPosition(e,t,i):this._findBorderPositionCircle(e,t,i)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var t;const[i,o]=fi(t=this._getCircleData(e)).call(t,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:i,y:o,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:i,y:o,low:.6,high:.8,direction:1})}}}_getCircleData(e){const t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);const i=wy(e,this.options.selfReference.angle,t,this.from);return[i.x,i.y,t]}_pointOnCircle(e,t,i,o){const n=2*o*Math.PI;return{x:e+i*Math.cos(n),y:t-i*Math.sin(n)}}_findBorderPositionCircle(e,t,i){const o=i.x,n=i.y;let a=i.low,d=i.high;const p=i.direction,v=this.options.selfReference.size;let g,w=.5*(a+d),_=0;this.options.arrowStrikethrough===!0&&(p===-1?_=this.options.endPointOffset.from:p===1&&(_=this.options.endPointOffset.to));let O=0;do{w=.5*(a+d),g=this._pointOnCircle(o,n,v,w);const $=Math.atan2(e.y-g.y,e.x-g.x),P=e.distanceToBorder(t,$)+_-Math.sqrt(Math.pow(g.x-e.x,2)+Math.pow(g.y-e.y,2));if(Math.abs(P)<.05)break;P>0?p>0?a=w:d=w:p>0?d=w:a=w,++O}while(a<=d&&O<10);return Du(Du({},g),{},{t:w})}getLineWidth(e,t){return e===!0?Math.max(this.selectionWidth,.3/this._body.view.scale):t===!0?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}getColor(e,t){if(t.inheritsColor!==!1){if(t.inheritsColor==="both"&&this.from.id!==this.to.id){const i=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y);let o=this.from.options.color.highlight.border,n=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(o=Lt(this.from.options.color.border,t.opacity),n=Lt(this.to.options.color.border,t.opacity)):this.from.selected===!0&&this.to.selected===!1?n=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(o=this.from.options.color.border),i.addColorStop(0,o),i.addColorStop(1,n),i}return t.inheritsColor==="to"?Lt(this.to.options.color.border,t.opacity):Lt(this.from.options.color.border,t.opacity)}return Lt(t.color,t.opacity)}_circle(e,t,i,o,n){this.enableShadow(e,t);let a=0,d=2*Math.PI;if(!this.options.selfReference.renderBehindTheNode){const p=this.options.selfReference.angle,v=this.options.selfReference.angle+Math.PI,g=this._findBorderPositionCircle(this.from,e,{x:i,y:o,low:p,high:v,direction:-1}),w=this._findBorderPositionCircle(this.from,e,{x:i,y:o,low:p,high:v,direction:1});a=Math.atan2(g.y-o,g.x-i),d=Math.atan2(w.y-o,w.x-i)}e.beginPath(),e.arc(i,o,n,a,d,!1),e.stroke(),this.disableShadow(e,t)}getDistanceToEdge(e,t,i,o,n,a){if(this.from!=this.to)return this._getDistanceToEdge(e,t,i,o,n,a);{const[d,p,v]=this._getCircleData(void 0),g=d-n,w=p-a;return Math.abs(Math.sqrt(g*g+w*w)-v)}}_getDistanceToLine(e,t,i,o,n,a){const d=i-e,p=o-t;let v=((n-e)*d+(a-t)*p)/(d*d+p*p);v>1?v=1:v<0&&(v=0);const g=e+v*d-n,w=t+v*p-a;return Math.sqrt(g*g+w*w)}getArrowData(e,t,i,o,n,a){let d,p,v,g,w,_,O;const $=a.width;t==="from"?(v=this.from,g=this.to,w=a.fromArrowScale<0,_=Math.abs(a.fromArrowScale),O=a.fromArrowType):t==="to"?(v=this.to,g=this.from,w=a.toArrowScale<0,_=Math.abs(a.toArrowScale),O=a.toArrowType):(v=this.to,g=this.from,w=a.middleArrowScale<0,_=Math.abs(a.middleArrowScale),O=a.middleArrowType);const P=15*_+3*$;if(v!=g){const C=P/gi(v.x-g.x,v.y-g.y);if(t!=="middle")if(this.options.smooth.enabled===!0){const I=this._findBorderPosition(v,e,{via:i}),M=this.getPoint(I.t+C*(t==="from"?1:-1),i);d=Math.atan2(I.y-M.y,I.x-M.x),p=I}else d=Math.atan2(v.y-g.y,v.x-g.x),p=this._findBorderPosition(v,e);else{const I=(w?-C:C)/2,M=this.getPoint(.5+I,i),L=this.getPoint(.5-I,i);d=Math.atan2(M.y-L.y,M.x-L.x),p=this.getPoint(.5,i)}}else{const[C,I,M]=this._getCircleData(e);if(t==="from"){const L=this.options.selfReference.angle,W=this.options.selfReference.angle+Math.PI,Y=this._findBorderPositionCircle(this.from,e,{x:C,y:I,low:L,high:W,direction:-1});d=-2*Y.t*Math.PI+1.5*Math.PI+.1*Math.PI,p=Y}else if(t==="to"){const L=this.options.selfReference.angle,W=this.options.selfReference.angle+Math.PI,Y=this._findBorderPositionCircle(this.from,e,{x:C,y:I,low:L,high:W,direction:1});d=-2*Y.t*Math.PI+1.5*Math.PI-1.1*Math.PI,p=Y}else{const L=this.options.selfReference.angle/(2*Math.PI);p=this._pointOnCircle(C,I,M,L),d=-2*L*Math.PI+1.5*Math.PI+.1*Math.PI}}return{point:p,core:{x:p.x-.9*P*Math.cos(d),y:p.y-.9*P*Math.sin(d)},angle:d,length:P,type:O}}drawArrowHead(e,t,i,o,n){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,ku.draw(e,n)&&(this.enableShadow(e,t),ys(e).call(e),this.disableShadow(e,t))}enableShadow(e,t){t.shadow===!0&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,t){if(t.background!==!1){const i={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),e.strokeStyle=i.strokeStyle,e.lineWidth=i.lineWidth,e.dashes=i.dashes,this.setStrokeDashed(e,t.dashes)}}setStrokeDashed(e,t){if(t!==!1)if(e.setLineDash!==void 0){const i=Pe(t)?t:[5,5];e.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}function ky(r,e){var t=ke(r);if(hr){var i=hr(r);e&&(i=ft(i).call(i,function(o){return lr(r,o).enumerable})),t.push.apply(t,i)}return t}function Dy(r){for(var e=1;e<arguments.length;e++){var t,i,o=arguments[e]!=null?arguments[e]:{};e%2?ue(t=ky(Object(o),!0)).call(t,function(n){Nh(r,n,o[n])}):Mi?Fh(r,Mi(o)):ue(i=ky(Object(o))).call(i,function(n){Ns(r,n,lr(o,n))})}return r}class Mu extends Py{constructor(e,t,i){super(e,t,i)}_findBorderPositionBezier(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),o,n,a=!1,d=1,p=0,v=this.to,g=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(v=this.from,a=!0,g=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(g=0);let w=0;do{n=.5*(p+d),o=this.getPoint(n,i);const _=Math.atan2(v.y-o.y,v.x-o.x),O=v.distanceToBorder(t,_)+g-Math.sqrt(Math.pow(o.x-v.x,2)+Math.pow(o.y-v.y,2));if(Math.abs(O)<.2)break;O<0?a===!1?p=n:d=n:a===!1?d=n:p=n,++w}while(p<=d&&w<10);return Dy(Dy({},o),{},{t:n})}_getDistanceToBezierEdge(e,t,i,o,n,a,d){let p,v,g,w,_,O=1e9,$=e,P=t;for(v=1;v<10;v++)g=.1*v,w=Math.pow(1-g,2)*e+2*g*(1-g)*d.x+Math.pow(g,2)*i,_=Math.pow(1-g,2)*t+2*g*(1-g)*d.y+Math.pow(g,2)*o,v>0&&(p=this._getDistanceToLine($,P,w,_,n,a),O=p<O?p:O),$=w,P=_;return O}_bezierCurve(e,t,i,o){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),i!=null&&i.x!=null?o!=null&&o.x!=null?e.bezierCurveTo(i.x,i.y,o.x,o.y,this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(i.x,i.y,this.toPoint.x,this.toPoint.y):e.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(e,t),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){return this._getViaCoordinates()}}class My extends Mu{constructor(e,t,i){super(e,t,i),this.via=this.via,this._boundFunction=()=>{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(e){super.setOptions(e);let t=!1;this.options.physics!==e.physics&&(t=!0),this.options=e,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),t===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1||this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}cleanup(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),this.via!==void 0&&(delete this._body.nodes[this.via.id],this.via=void 0,!0)}setupSupportNode(){if(this.via===void 0){const e="edgeId:"+this.id,t=this._body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this._body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}_line(e,t,i){this._bezierCurve(e,t,i)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){const[i,o,n]=this._getCircleData(),a=2*Math.PI*(1-e);return{x:i+n*Math.sin(a),y:o+n-n*(1-Math.cos(a))}}return{x:Math.pow(1-e,2)*this.fromPoint.x+2*e*(1-e)*t.x+Math.pow(e,2)*this.toPoint.x,y:Math.pow(1-e,2)*this.fromPoint.y+2*e*(1-e)*t.y+Math.pow(e,2)*this.toPoint.y}}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t,this.via)}_getDistanceToEdge(e,t,i,o,n,a){return this._getDistanceToBezierEdge(e,t,i,o,n,a,this.via)}}class un extends Mu{constructor(e,t,i){super(e,t,i)}_line(e,t,i){this._bezierCurve(e,t,i)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){const e=this.options.smooth.roundness,t=this.options.smooth.type;let i=Math.abs(this.from.x-this.to.x),o=Math.abs(this.from.y-this.to.y);if(t==="discrete"||t==="diagonalCross"){let n,a;n=a=i<=o?e*o:e*i,this.from.x>this.to.x&&(n=-n),this.from.y>=this.to.y&&(a=-a);let d=this.from.x+n,p=this.from.y+a;return t==="discrete"&&(i<=o?d=i<e*o?this.from.x:d:p=o<e*i?this.from.y:p),{x:d,y:p}}if(t==="straightCross"){let n=(1-e)*i,a=(1-e)*o;return i<=o?(n=0,this.from.y<this.to.y&&(a=-a)):(this.from.x<this.to.x&&(n=-n),a=0),{x:this.to.x+n,y:this.to.y+a}}if(t==="horizontal"){let n=(1-e)*i;return this.from.x<this.to.x&&(n=-n),{x:this.to.x+n,y:this.from.y}}if(t==="vertical"){let n=(1-e)*o;return this.from.y<this.to.y&&(n=-n),{x:this.from.x,y:this.to.y+n}}if(t==="curvedCW"){i=this.to.x-this.from.x,o=this.from.y-this.to.y;const n=Math.sqrt(i*i+o*o),a=Math.PI,d=(Math.atan2(o,i)+(.5*e+.5)*a)%(2*a);return{x:this.from.x+(.5*e+.5)*n*Math.sin(d),y:this.from.y+(.5*e+.5)*n*Math.cos(d)}}if(t==="curvedCCW"){i=this.to.x-this.from.x,o=this.from.y-this.to.y;const n=Math.sqrt(i*i+o*o),a=Math.PI,d=(Math.atan2(o,i)+(.5*-e+.5)*a)%(2*a);return{x:this.from.x+(.5*e+.5)*n*Math.sin(d),y:this.from.y+(.5*e+.5)*n*Math.cos(d)}}{let n,a;n=a=i<=o?e*o:e*i,this.from.x>this.to.x&&(n=-n),this.from.y>=this.to.y&&(a=-a);let d=this.from.x+n,p=this.from.y+a;return i<=o?d=this.from.x<=this.to.x?this.to.x<d?this.to.x:d:this.to.x>d?this.to.x:d:p=this.from.y>=this.to.y?this.to.y>p?this.to.y:p:this.to.y<p?this.to.y:p,{x:d,y:p}}}_findBorderPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,t,i.via)}_getDistanceToEdge(e,t,i,o,n,a){let d=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,i,o,n,a,d)}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const i=e;return{x:Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*t.x+Math.pow(i,2)*this.toPoint.x,y:Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*t.y+Math.pow(i,2)*this.toPoint.y}}}class Hs extends Mu{constructor(e,t,i){super(e,t,i)}_getDistanceToBezierEdge2(e,t,i,o,n,a,d,p){let v=1e9,g=e,w=t;const _=[0,0,0,0];for(let O=1;O<10;O++){const $=.1*O;_[0]=Math.pow(1-$,3),_[1]=3*$*Math.pow(1-$,2),_[2]=3*Math.pow($,2)*(1-$),_[3]=Math.pow($,3);const P=_[0]*e+_[1]*d.x+_[2]*p.x+_[3]*i,C=_[0]*t+_[1]*d.y+_[2]*p.y+_[3]*o;if(O>0){const I=this._getDistanceToLine(g,w,P,C,n,a);v=I<v?I:v}g=P,w=C}return v}}class pn extends Hs{constructor(e,t,i){super(e,t,i)}_line(e,t,i){const o=i[0],n=i[1];this._bezierCurve(e,t,o,n)}_getViaCoordinates(){const e=this.from.x-this.to.x,t=this.from.y-this.to.y;let i,o,n,a;const d=this.options.smooth.roundness;return(Math.abs(e)>Math.abs(t)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(o=this.from.y,a=this.to.y,i=this.from.x-d*e,n=this.to.x+d*e):(o=this.from.y-d*t,a=this.to.y+d*t,i=this.from.x,n=this.to.x),[{x:i,y:o},{x:n,y:a}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t)}_getDistanceToEdge(e,t,i,o,n,a){let[d,p]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,t,i,o,n,a,d,p)}getPoint(e){let[t,i]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const o=e,n=[Math.pow(1-o,3),3*o*Math.pow(1-o,2),3*Math.pow(o,2)*(1-o),Math.pow(o,3)];return{x:n[0]*this.fromPoint.x+n[1]*t.x+n[2]*i.x+n[3]*this.toPoint.x,y:n[0]*this.fromPoint.y+n[1]*t.y+n[2]*i.y+n[3]*this.toPoint.y}}}class Au extends Py{constructor(e,t,i){super(e,t,i)}_line(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){}getPoint(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}_findBorderPosition(e,t){let i=this.to,o=this.from;e.id===this.from.id&&(i=this.from,o=this.to);const n=Math.atan2(i.y-o.y,i.x-o.x),a=i.x-o.x,d=i.y-o.y,p=Math.sqrt(a*a+d*d),v=(p-e.distanceToBorder(t,n))/p;return{x:(1-v)*o.x+v*i.x,y:(1-v)*o.y+v*i.y,t:0}}_getDistanceToEdge(e,t,i,o,n,a){return this._getDistanceToLine(e,t,i,o,n,a)}}class Nt{constructor(e,t,i,o,n){if(t===void 0)throw new Error("No body provided");this.options=or(o),this.globalOptions=o,this.defaultOptions=n,this.body=t,this.imagelist=i,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new Ai(this.body,this.options,!0),this.setOptions(e)}setOptions(e){if(!e)return;let t=e.physics!==void 0&&this.options.physics!==e.physics||e.hidden!==void 0&&(this.options.hidden||!1)!==(e.hidden||!1)||e.from!==void 0&&this.options.from!==e.from||e.to!==void 0&&this.options.to!==e.to;Nt.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=cy(e.value));const i=[e,this.options,this.defaultOptions];return this.chooser=xu("edge",i),this.updateLabelModule(e),t=this.updateEdgeType()||t,this._setInteractionWidths(),this.connect(),t}static parseOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=arguments.length>4&&arguments[4]!==void 0&&arguments[4];if(tn(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],e,t,i),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(ro(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=o.endPointOffset.from!==void 0?o.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(ro(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=o.endPointOffset.to!==void 0?o.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),Bh(t.label)?e.label=t.label:Bh(e.label)||(e.label=void 0),Ht(e,t,"smooth",o),Ht(e,t,"shadow",o),Ht(e,t,"background",o),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:i===!0&&t.dashes===null&&(e.dashes=er(o.dashes)),t.scaling!==void 0&&t.scaling!==null?(t.scaling.min!==void 0&&(e.scaling.min=t.scaling.min),t.scaling.max!==void 0&&(e.scaling.max=t.scaling.max),Ht(e.scaling,t.scaling,"label",o.scaling)):i===!0&&t.scaling===null&&(e.scaling=er(o.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows=="string"){const a=t.arrows.toLowerCase();e.arrows.to.enabled=ce(a).call(a,"to")!=-1,e.arrows.middle.enabled=ce(a).call(a,"middle")!=-1,e.arrows.from.enabled=ce(a).call(a,"from")!=-1}else{if(typeof t.arrows!="object")throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+gs(t.arrows));Ht(e.arrows,t.arrows,"to",o.arrows),Ht(e.arrows,t.arrows,"middle",o.arrows),Ht(e.arrows,t.arrows,"from",o.arrows)}else i===!0&&t.arrows===null&&(e.arrows=er(o.arrows));if(t.color!==void 0&&t.color!==null){const a=rr(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,d=e.color;if(n)ye(d,o.color,!1,i);else for(const p in d)Object.prototype.hasOwnProperty.call(d,p)&&delete d[p];if(rr(d))d.color=d,d.highlight=d,d.hover=d,d.inherit=!1,a.opacity===void 0&&(d.opacity=1);else{let p=!1;a.color!==void 0&&(d.color=a.color,p=!0),a.highlight!==void 0&&(d.highlight=a.highlight,p=!0),a.hover!==void 0&&(d.hover=a.hover,p=!0),a.inherit!==void 0&&(d.inherit=a.inherit),a.opacity!==void 0&&(d.opacity=Math.min(1,Math.max(0,a.opacity))),p===!0?d.inherit=!1:d.inherit===void 0&&(d.inherit="from")}}else i===!0&&t.color===null&&(e.color=or(o.color));i===!0&&t.font===null&&(e.font=or(o.font)),Object.prototype.hasOwnProperty.call(t,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),e.selfReference.size=t.selfReferenceSize)}getFormattingValues(){const e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,t=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,i=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,o=this.options.color.inherit,n={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:i,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:o?void 0:this.options.color.color,inheritsColor:o,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(this.chooser===!0){if(this.selected){const a=this.options.selectionWidth;typeof a=="function"?n.width=a(n.width):typeof a=="number"&&(n.width+=a),n.width=Math.max(n.width,.3/this.body.view.scale),n.color=this.options.color.highlight,n.shadow=this.options.shadow.enabled}else if(this.hover){const a=this.options.hoverWidth;typeof a=="function"?n.width=a(n.width):typeof a=="number"&&(n.width+=a),n.width=Math.max(n.width,.3/this.body.view.scale),n.color=this.options.color.hover,n.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(n,this.options.id,this.selected,this.hover),n.color!==void 0&&(n.inheritsColor=!1),n.shadow===!1&&(n.shadowColor===this.options.shadow.color&&n.shadowSize===this.options.shadow.size&&n.shadowX===this.options.shadow.x&&n.shadowY===this.options.shadow.y||(n.shadow=!0)));else n.shadow=this.options.shadow.enabled,n.width=Math.max(n.width,.3/this.body.view.scale);return n}updateLabelModule(e){const t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){const e=this.options.smooth;let t=!1,i=!0;return this.edgeType!==void 0&&((this.edgeType instanceof My&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof pn&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof un&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof Au&&e.type.enabled===!1)&&(i=!1),i===!0&&(t=this.cleanup())),i===!0?e.enabled===!0?e.type==="dynamic"?(t=!0,this.edgeType=new My(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new pn(this.options,this.body,this.labelModule):this.edgeType=new un(this.options,this.body,this.labelModule):this.edgeType=new Au(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}disconnect(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}getTitle(){return this.title}isSelected(){return this.selected}getValue(){return this.options.value}setValueRange(e,t,i){if(this.options.value!==void 0){const o=this.options.scaling.customScalingFunction(e,t,i,this.options.value),n=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const a=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+o*a}this.options.width=this.options.scaling.min+o*n}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}_setInteractionWidths(){typeof this.options.hoverWidth=="function"?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth=="function"?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(e){const t=this.getFormattingValues();if(t.hidden)return;const i=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,i),this.drawLabel(e,i)}drawArrows(e){const t=this.getFormattingValues();if(t.hidden)return;const i=this.edgeType.getViaNode(),o={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(o.from=this.edgeType.getArrowData(e,"from",i,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.fromPoint=o.from.core),t.fromArrowSrc&&(o.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(o.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(o.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(o.to=this.edgeType.getArrowData(e,"to",i,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.toPoint=o.to.core),t.toArrowSrc&&(o.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(o.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(o.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(o.middle=this.edgeType.getArrowData(e,"middle",i,this.selected,this.hover,t),t.middleArrowSrc&&(o.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(o.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(o.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,o.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,o.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,o.to)}drawLabel(e,t){if(this.options.label!==void 0){const i=this.from,o=this.to;let n;if(this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover),i.id!=o.id){this.labelModule.pointToSelf=!1,n=this.edgeType.getPoint(.5,t),e.save();const a=this._getRotation(e);a.angle!=0&&(e.translate(a.x,a.y),e.rotate(a.angle)),this.labelModule.draw(e,n.x,n.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;const a=wy(e,this.options.selfReference.angle,this.options.selfReference.size,i);n=this._pointOnCircle(a.x,a.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,n.x,n.y,this.selected,this.hover)}}}getItemsOnPoint(e){const t=[];if(this.labelModule.visible()){const o=this._getRotation();Su(this.labelModule.getSize(),e,o)&&t.push({edgeId:this.id,labelId:0})}const i={left:e.x,top:e.y};return this.isOverlappingWith(i)&&t.push({edgeId:this.id}),t}isOverlappingWith(e){if(this.connected){const i=this.from.x,o=this.from.y,n=this.to.x,a=this.to.y,d=e.left,p=e.top;return this.edgeType.getDistanceToEdge(i,o,n,a,d,p)<10}return!1}_getRotation(e){const t=this.edgeType.getViaNode(),i=this.edgeType.getPoint(.5,t);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,i.x,i.y);const o={x:i.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return o;const n=this.from.y-this.to.y,a=this.from.x-this.to.x;let d=Math.atan2(n,a);return(d<-1&&a<0||d>0&&a<0)&&(d+=Math.PI),o.angle=d,o}_pointOnCircle(e,t,i,o){return{x:e+i*Math.cos(o),y:t-i*Math.sin(o)}}select(){this.selected=!0}unselect(){this.selected=!1}cleanup(){return this.edgeType.cleanup()}remove(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}endPointsValid(){return this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}}class uo{constructor(e,t,i){var o;this.body=e,this.images=t,this.groups=i,this.body.functions.createEdge=N(o=this.create).call(o,this),this.edgesListeners={add:(n,a)=>{this.add(a.items)},update:(n,a)=>{this.update(a.items)},remove:(n,a)=>{this.remove(a.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(n,a,d,p){if(a===n)return .5;{const v=1/(a-n);return Math.max(0,(p-n)*v)}}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},ye(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,t,i=this;this.body.emitter.on("_forceDisableDynamicCurves",function(o){let n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];o==="dynamic"&&(o="continuous");let a=!1;for(const d in i.body.edges)if(Object.prototype.hasOwnProperty.call(i.body.edges,d)){const p=i.body.edges[d],v=i.body.data.edges.get(d);if(v!=null){const g=v.smooth;g!==void 0&&g.enabled===!0&&g.type==="dynamic"&&(o===void 0?p.setOptions({smooth:!1}):p.setOptions({smooth:{type:o}}),a=!0)}}n===!0&&a===!0&&i.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",N(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",N(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{se(this.edgesListeners,(o,n)=>{this.body.data.edges&&this.body.data.edges.off(n,o)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(e){if(e!==void 0){Nt.parseOptions(this.options,e,!0,this.defaultOptions,!0);let t=!1;if(e.smooth!==void 0)for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&(t=this.body.edges[i].updateEdgeType()||t);if(e.font!==void 0)for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&this.body.edges[i].updateLabelModule();e.hidden===void 0&&e.physics===void 0&&t!==!0||this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];const i=this.body.data.edges;if(st.isDataViewLike("id",e))this.body.data.edges=e;else if(Pe(e))this.body.data.edges=new st.DataSet,this.body.data.edges.add(e);else{if(e)throw new TypeError("Array or DataSet expected");this.body.data.edges=new st.DataSet}if(i&&se(this.edgesListeners,(o,n)=>{i.off(n,o)}),this.body.edges={},this.body.data.edges){se(this.edgesListeners,(n,a)=>{this.body.data.edges.on(a,n)});const o=this.body.data.edges.getIds();this.add(o,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];const i=this.body.edges,o=this.body.data.edges;for(let n=0;n<e.length;n++){const a=e[n],d=i[a];d&&d.disconnect();const p=o.get(a,{showInternalIds:!0});i[a]=this.create(p)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}update(e){const t=this.body.edges,i=this.body.data.edges;let o=!1;for(let n=0;n<e.length;n++){const a=e[n],d=i.get(a),p=t[a];p!==void 0?(p.disconnect(),o=p.setOptions(d)||o,p.connect()):(this.body.edges[a]=this.create(d),o=!0)}o===!0?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}remove(e){let t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(e.length===0)return;const i=this.body.edges;se(e,o=>{const n=i[o];n!==void 0&&n.remove()}),t&&this.body.emitter.emit("_dataChanged")}refresh(){se(this.body.edges,(e,t)=>{const i=this.body.data.edges.get(t);i!==void 0&&e.setOptions(i)})}create(e){return new Nt(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e;const t=this.body.nodes,i=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)){const o=i[e];o.from=null,o.to=null,o.connect()}}getConnectedNodes(e){const t=[];if(this.body.edges[e]!==void 0){const i=this.body.edges[e];i.fromId!==void 0&&t.push(i.fromId),i.toId!==void 0&&t.push(i.toId)}return t}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){const e=[];se(this.body.edges,(t,i)=>{const o=this.body.nodes[t.toId],n=this.body.nodes[t.fromId];o!==void 0&&o.isCluster===!0||n!==void 0&&n.isCluster===!0||o!==void 0&&n!==void 0||e.push(i)}),this.remove(e,!1)}_addMissingEdges(){const e=this.body.data.edges;if(e==null)return;const t=this.body.edges,i=[];ue(e).call(e,(o,n)=>{t[n]===void 0&&i.push(n)}),this.add(i,!0)}}class Ay{constructor(e,t,i){this.body=e,this.physicsBody=t,this.barnesHutTree,this.setOptions(i),this._rng=Ts("BARNES HUT SOLVER")}setOptions(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){let e;const t=this.body.nodes,i=this.physicsBody.physicsNodeIndices,o=i.length,n=this._formBarnesHutTree(t,i);this.barnesHutTree=n;for(let a=0;a<o;a++)e=t[i[a]],e.options.mass>0&&this._getForceContributions(n.root,e)}}_getForceContributions(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}_getForceContribution(e,t){if(e.childrenCount>0){const i=e.centerOfMass.x-t.x,o=e.centerOfMass.y-t.y,n=Math.sqrt(i*i+o*o);n*e.calcSize>this.thetaInversed?this._calculateForces(n,i,o,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(n,i,o,t,e)}}_calculateForces(e,t,i,o,n){e===0&&(t=e=.1),this.overlapAvoidanceFactor<1&&o.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,e-o.shape.radius));const a=this.options.gravitationalConstant*n.mass*o.options.mass/Math.pow(e,3),d=t*a,p=i*a;this.physicsBody.forces[o.id].x+=d,this.physicsBody.forces[o.id].y+=p}_formBarnesHutTree(e,t){let i;const o=t.length;let n=e[t[0]].x,a=e[t[0]].y,d=e[t[0]].x,p=e[t[0]].y;for(let P=1;P<o;P++){const C=e[t[P]],I=C.x,M=C.y;C.options.mass>0&&(I<n&&(n=I),I>d&&(d=I),M<a&&(a=M),M>p&&(p=M))}const v=Math.abs(d-n)-Math.abs(p-a);v>0?(a-=.5*v,p+=.5*v):(n+=.5*v,d-=.5*v);const g=Math.max(1e-5,Math.abs(d-n)),w=.5*g,_=.5*(n+d),O=.5*(a+p),$={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:_-w,maxX:_+w,minY:O-w,maxY:O+w},size:g,calcSize:1/g,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch($.root);for(let P=0;P<o;P++)i=e[t[P]],i.options.mass>0&&this._placeInTree($.root,i);return $}_updateBranchMass(e,t){const i=e.centerOfMass,o=e.mass+t.options.mass,n=1/o;i.x=i.x*e.mass+t.x*t.options.mass,i.x*=n,i.y=i.y*e.mass+t.y*t.options.mass,i.y*=n,e.mass=o;const a=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<a?a:e.maxWidth}_placeInTree(e,t,i){i==1&&i!==void 0||this._updateBranchMass(e,t);const o=e.children.NW.range;let n;n=o.maxX>t.x?o.maxY>t.y?"NW":"SW":o.maxY>t.y?"NE":"SE",this._placeInRegion(e,t,n)}_placeInRegion(e,t,i){const o=e.children[i];switch(o.childrenCount){case 0:o.children.data=t,o.childrenCount=1,this._updateBranchMass(o,t);break;case 1:o.children.data.x===t.x&&o.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(o),this._placeInTree(o,t));break;case 4:this._placeInTree(o,t)}}_splitBranch(e){let t=null;e.childrenCount===1&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),t!=null&&this._placeInTree(e,t)}_insertRegion(e,t){let i,o,n,a;const d=.5*e.size;switch(t){case"NW":i=e.range.minX,o=e.range.minX+d,n=e.range.minY,a=e.range.minY+d;break;case"NE":i=e.range.minX+d,o=e.range.maxX,n=e.range.minY,a=e.range.minY+d;break;case"SW":i=e.range.minX,o=e.range.minX+d,n=e.range.minY+d,a=e.range.maxY;break;case"SE":i=e.range.minX+d,o=e.range.maxX,n=e.range.minY+d,a=e.range.maxY}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:o,minY:n,maxY:a},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}_drawBranch(e,t,i){i===void 0&&(i="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=i,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}class SS{constructor(e,t,i){this._rng=Ts("REPULSION SOLVER"),this.body=e,this.physicsBody=t,this.setOptions(i)}setOptions(e){this.options=e}solve(){let e,t,i,o,n,a,d,p;const v=this.body.nodes,g=this.physicsBody.physicsNodeIndices,w=this.physicsBody.forces,_=this.options.nodeDistance,O=-2/3/_;for(let $=0;$<g.length-1;$++){d=v[g[$]];for(let P=$+1;P<g.length;P++)p=v[g[P]],e=p.x-d.x,t=p.y-d.y,i=Math.sqrt(e*e+t*t),i===0&&(i=.1*this._rng(),e=i),i<2*_&&(a=i<.5*_?1:O*i+1.3333333333333333,a/=i,o=e*a,n=t*a,w[d.id].x-=o,w[d.id].y-=n,w[p.id].x+=o,w[p.id].y+=n)}}}class Ny{constructor(e,t,i){this.body=e,this.physicsBody=t,this.setOptions(i)}setOptions(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}solve(){const e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,i=this.physicsBody.forces,o=this.options.nodeDistance;for(let n=0;n<t.length-1;n++){const a=e[t[n]];for(let d=n+1;d<t.length;d++){const p=e[t[d]];if(a.level===p.level){const v=o+this.overlapAvoidanceFactor*((a.shape.radius||0)/2+(p.shape.radius||0)/2),g=p.x-a.x,w=p.y-a.y,_=Math.sqrt(g*g+w*w),O=.05;let $;$=_<v?-Math.pow(O*_,2)+Math.pow(O*v,2):0,_!==0&&($/=_);const P=g*$,C=w*$;i[a.id].x-=P,i[a.id].y-=C,i[p.id].x+=P,i[p.id].y+=C}}}}}class qh{constructor(e,t,i){this.body=e,this.physicsBody=t,this.setOptions(i)}setOptions(e){this.options=e}solve(){let e,t;const i=this.physicsBody.physicsEdgeIndices,o=this.body.edges;let n,a,d;for(let p=0;p<i.length;p++)t=o[i[p]],t.connected===!0&&t.toId!==t.fromId&&this.body.nodes[t.toId]!==void 0&&this.body.nodes[t.fromId]!==void 0&&(t.edgeType.via!==void 0?(e=t.options.length===void 0?this.options.springLength:t.options.length,n=t.to,a=t.edgeType.via,d=t.from,this._calculateSpringForce(n,a,.5*e),this._calculateSpringForce(a,d,.5*e)):(e=t.options.length===void 0?1.5*this.options.springLength:t.options.length,this._calculateSpringForce(t.from,t.to,e)))}_calculateSpringForce(e,t,i){const o=e.x-t.x,n=e.y-t.y,a=Math.max(Math.sqrt(o*o+n*n),.01),d=this.options.springConstant*(i-a)/a,p=o*d,v=n*d;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=p,this.physicsBody.forces[e.id].y+=v),this.physicsBody.forces[t.id]!==void 0&&(this.physicsBody.forces[t.id].x-=p,this.physicsBody.forces[t.id].y-=v)}}class Ry{constructor(e,t,i){this.body=e,this.physicsBody=t,this.setOptions(i)}setOptions(e){this.options=e}solve(){let e,t,i,o,n,a,d,p;const v=this.body.edges,g=.5,w=this.physicsBody.physicsEdgeIndices,_=this.physicsBody.physicsNodeIndices,O=this.physicsBody.forces;for(let W=0;W<_.length;W++){const Y=_[W];O[Y].springFx=0,O[Y].springFy=0}for(let W=0;W<w.length;W++)t=v[w[W]],t.connected===!0&&(e=t.options.length===void 0?this.options.springLength:t.options.length,i=t.from.x-t.to.x,o=t.from.y-t.to.y,p=Math.sqrt(i*i+o*o),p=p===0?.01:p,d=this.options.springConstant*(e-p)/p,n=i*d,a=o*d,t.to.level!=t.from.level?(O[t.toId]!==void 0&&(O[t.toId].springFx-=n,O[t.toId].springFy-=a),O[t.fromId]!==void 0&&(O[t.fromId].springFx+=n,O[t.fromId].springFy+=a)):(O[t.toId]!==void 0&&(O[t.toId].x-=g*n,O[t.toId].y-=g*a),O[t.fromId]!==void 0&&(O[t.fromId].x+=g*n,O[t.fromId].y+=g*a)));let $,P;d=1;for(let W=0;W<_.length;W++){const Y=_[W];$=Math.min(d,Math.max(-d,O[Y].springFx)),P=Math.min(d,Math.max(-d,O[Y].springFy)),O[Y].x+=$,O[Y].y+=P}let C=0,I=0;for(let W=0;W<_.length;W++){const Y=_[W];C+=O[Y].x,I+=O[Y].y}const M=C/_.length,L=I/_.length;for(let W=0;W<_.length;W++){const Y=_[W];O[Y].x-=M,O[Y].y-=L}}}class cr{constructor(e,t,i){this.body=e,this.physicsBody=t,this.setOptions(i)}setOptions(e){this.options=e}solve(){let e,t,i,o;const n=this.body.nodes,a=this.physicsBody.physicsNodeIndices,d=this.physicsBody.forces;for(let p=0;p<a.length;p++)o=n[a[p]],e=-o.x,t=-o.y,i=Math.sqrt(e*e+t*t),this._calculateForces(i,e,t,d,o)}_calculateForces(e,t,i,o,n){const a=e===0?0:this.options.centralGravity/e;o[n.id].x=t*a,o[n.id].y=i*a}}class Nu extends Ay{constructor(e,t,i){super(e,t,i),this._rng=Ts("FORCE ATLAS 2 BASED REPULSION SOLVER")}_calculateForces(e,t,i,o,n){e===0&&(t=e=.1*this._rng()),this.overlapAvoidanceFactor<1&&o.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,e-o.shape.radius));const a=o.edges.length+1,d=this.options.gravitationalConstant*n.mass*o.options.mass*a/Math.pow(e,2),p=t*d,v=i*d;this.physicsBody.forces[o.id].x+=p,this.physicsBody.forces[o.id].y+=v}}class TS extends cr{constructor(e,t,i){super(e,t,i)}_calculateForces(e,t,i,o,n){if(e>0){const a=n.edges.length+1,d=this.options.centralGravity*a*n.options.mass;o[n.id].x=t*d,o[n.id].y=i*d}}}class IS{constructor(e){this.body=e,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},ge(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("initPhysics",()=>{this.initPhysics()}),this.body.emitter.on("_layoutFailed",()=>{this.layoutFailed=!0}),this.body.emitter.on("resetPhysics",()=>{this.stopSimulation(),this.ready=!1}),this.body.emitter.on("disablePhysics",()=>{this.physicsEnabled=!1,this.stopSimulation()}),this.body.emitter.on("restorePhysics",()=>{this.setOptions(this.options),this.ready===!0&&this.startSimulation()}),this.body.emitter.on("startSimulation",()=>{this.ready===!0&&this.startSimulation()}),this.body.emitter.on("stopSimulation",()=>{this.stopSimulation()}),this.body.emitter.on("destroy",()=>{this.stopSimulation(!1),this.body.emitter.off()}),this.body.emitter.on("_dataChanged",()=>{this.updatePhysicsData()})}setOptions(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,io(["stabilization"],this.options,e),Ht(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());const t=this.options.wind;t&&((typeof t.x!="number"||fu(t.x))&&(t.x=0),(typeof t.y!="number"||fu(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new Nu(this.body,this.physicsBody,e),this.edgesSolver=new qh(this.body,this.physicsBody,e),this.gravitySolver=new TS(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new SS(this.body,this.physicsBody,e),this.edgesSolver=new qh(this.body,this.physicsBody,e),this.gravitySolver=new cr(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new Ny(this.body,this.physicsBody,e),this.edgesSolver=new Ry(this.body,this.physicsBody,e),this.gravitySolver=new cr(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new Ay(this.body,this.physicsBody,e),this.edgesSolver=new qh(this.body,this.physicsBody,e),this.gravitySolver=new cr(this.body,this.physicsBody,e)),this.modelOptions=e}initPhysics(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}startSimulation(){var e;this.physicsEnabled===!0&&this.options.enabled===!0?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0&&(this.viewFunction=N(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}stopSimulation(){let e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}simulationStep(){const e=rh();this.physicsTick(),(rh()-e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}_emitStabilized(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&Ii(()=>{this.body.emitter.emit("stabilized",{iterations:e}),this.startedStabilization=!1,this.stabilizationIterations=0},0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){this._evaluateStepQuality()===!0?this.timestep=1.2*this.timestep:this.timestep/1.2<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/1.2))}physicsTick(){this._startStabilizing(),this.stabilized!==!0&&(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0?(this.adaptiveCounter%this.adaptiveInterval==0?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1):(this.timestep=this.options.timestep,this.physicsStep()),this.stabilized===!0&&this.revert(),this.stabilizationIterations++)}updatePhysicsData(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];const e=this.body.nodes,t=this.body.edges;for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&e[i].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[i].id);for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&t[i].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(t[i].id);for(let i=0;i<this.physicsBody.physicsNodeIndices.length;i++){const o=this.physicsBody.physicsNodeIndices[i];this.physicsBody.forces[o]={x:0,y:0},this.physicsBody.velocities[o]===void 0&&(this.physicsBody.velocities[o]={x:0,y:0})}for(const i in this.physicsBody.velocities)e[i]===void 0&&delete this.physicsBody.velocities[i]}revert(){const e=ke(this.previousStates),t=this.body.nodes,i=this.physicsBody.velocities;this.referenceState={};for(let o=0;o<e.length;o++){const n=e[o];t[n]!==void 0?t[n].options.physics===!0&&(this.referenceState[n]={positions:{x:t[n].x,y:t[n].y}},i[n].x=this.previousStates[n].vx,i[n].y=this.previousStates[n].vy,t[n].x=this.previousStates[n].x,t[n].y=this.previousStates[n].y):delete this.previousStates[n]}}_evaluateStepQuality(){let e,t,i;const o=this.body.nodes,n=this.referenceState;for(const a in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,a)&&o[a]!==void 0&&(e=o[a].x-n[a].positions.x,t=o[a].y-n[a].positions.y,i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),i>.3))return!1;return!0}moveNodes(){const e=this.physicsBody.physicsNodeIndices;let t=0,i=0;for(let o=0;o<e.length;o++){const n=e[o],a=this._performStep(n);t=Math.max(t,a),i+=a}this.adaptiveTimestepEnabled=i/e.length<5,this.stabilized=t<this.options.minVelocity}calculateComponentVelocity(e,t,i){e+=(t-this.modelOptions.damping*e)/i*this.timestep;const o=this.options.maxVelocity||1e9;return Math.abs(e)>o&&(e=e>0?o:-o),e}_performStep(e){const t=this.body.nodes[e],i=this.physicsBody.forces[e];this.options.wind&&(i.x+=this.options.wind.x,i.y+=this.options.wind.y);const o=this.physicsBody.velocities[e];return this.previousStates[e]={x:t.x,y:t.y,vx:o.x,vy:o.y},t.options.fixed.x===!1?(o.x=this.calculateComponentVelocity(o.x,i.x,t.options.mass),t.x+=o.x*this.timestep):(i.x=0,o.x=0),t.options.fixed.y===!1?(o.y=this.calculateComponentVelocity(o.y,i.y,t.options.mass),t.y+=o.y*this.timestep):(i.y=0,o.y=0),Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2))}_freezeNodes(){const e=this.body.nodes;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){const i=e[t].options.fixed;this.freezeCache[t]={x:i.x,y:i.y},i.x=!0,i.y=!0}}_restoreFrozenNodes(){const e=this.body.nodes;for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.freezeCache[t]!==void 0&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}stabilize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;typeof e!="number"&&(e=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",e)),this.physicsBody.physicsNodeIndices.length!==0?(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,Ii(()=>this._stabilizationBatch(),0)):this.ready=!0}_startStabilizing(){return this.startedStabilization!==!0&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){const e=()=>this.stabilized===!1&&this.stabilizationIterations<this.targetIterations,t=()=>{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&t();let i=0;for(;e()&&i<this.options.stabilization.updateInterval;)this.physicsTick(),i++;var o;t(),e()?Ii(N(o=this._stabilizationBatch).call(o,this),0):this._finalizeStabilization()}_finalizeStabilization(){this.body.emitter.emit("_allowRedraw"),this.options.stabilization.fit===!0&&this.body.emitter.emit("fit"),this.options.stabilization.onlyDynamicEdges===!0&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),this.stabilized===!0?this._emitStabilized():this.startSimulation(),this.ready=!0}_drawForces(e){for(let t=0;t<this.physicsBody.physicsNodeIndices.length;t++){const i=this.physicsBody.physicsNodeIndices[t],o=this.body.nodes[i],n=this.physicsBody.forces[i],a=20,d=.03,p=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.x,2)),v=Math.min(Math.max(5,p),15),g=3*v,w=Uc((180-180*Math.min(1,Math.max(0,d*p)))/360,1,1),_={x:o.x+a*n.x,y:o.y+a*n.y};e.lineWidth=v,e.strokeStyle=w,e.beginPath(),e.moveTo(o.x,o.y),e.lineTo(_.x,_.y),e.stroke();const O=Math.atan2(n.y,n.x);e.fillStyle=w,ku.draw(e,{type:"arrow",point:_,angle:O,length:g}),ys(e).call(e)}}}const Ru=new Uint8Array(16);function $S(){if(!Ls&&(Ls=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ls))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ls(Ru)}const it=[];for(let r=0;r<256;++r)it.push((r+256).toString(16).slice(1));var Fy={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ws(r,e,t){if(Fy.randomUUID&&!e&&!r)return Fy.randomUUID();const i=(r=r||{}).random||(r.rng||$S)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){t=t||0;for(let o=0;o<16;++o)e[t+o]=i[o];return e}return function(o,n=0){return it[o[n+0]]+it[o[n+1]]+it[o[n+2]]+it[o[n+3]]+"-"+it[o[n+4]]+it[o[n+5]]+"-"+it[o[n+6]]+it[o[n+7]]+"-"+it[o[n+8]]+it[o[n+9]]+"-"+it[o[n+10]]+it[o[n+11]]+it[o[n+12]]+it[o[n+13]]+it[o[n+14]]+it[o[n+15]]}(i)}class rt{constructor(){}static getRange(e){let t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],o=1e9,n=-1e9,a=1e9,d=-1e9;if(i.length>0)for(let p=0;p<i.length;p++)t=e[i[p]],a>t.shape.boundingBox.left&&(a=t.shape.boundingBox.left),d<t.shape.boundingBox.right&&(d=t.shape.boundingBox.right),o>t.shape.boundingBox.top&&(o=t.shape.boundingBox.top),n<t.shape.boundingBox.bottom&&(n=t.shape.boundingBox.bottom);return a===1e9&&d===-1e9&&o===1e9&&n===-1e9&&(o=0,n=0,a=0,d=0),{minX:a,maxX:d,minY:o,maxY:n}}static getRangeCore(e){let t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],o=1e9,n=-1e9,a=1e9,d=-1e9;if(i.length>0)for(let p=0;p<i.length;p++)t=e[i[p]],a>t.x&&(a=t.x),d<t.x&&(d=t.x),o>t.y&&(o=t.y),n<t.y&&(n=t.y);return a===1e9&&d===-1e9&&o===1e9&&n===-1e9&&(o=0,n=0,a=0,d=0),{minX:a,maxX:d,minY:o,maxY:n}}static findCenter(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}static cloneOptions(e,t){const i={};return t===void 0||t==="node"?(ye(i,e.options,!0),i.x=e.x,i.y=e.y,i.amountOfConnections=e.edges.length):ye(i,e.options,!0),i}}class CS extends ae{constructor(e,t,i,o,n,a){super(e,t,i,o,n,a),this.isCluster=!0,this.containedNodes={},this.containedEdges={}}_openChildCluster(e){const t=this.body.nodes[e];if(this.containedNodes[e]===void 0)throw new Error("node with id: "+e+" not in current cluster");if(!t.isCluster)throw new Error("node with id: "+e+" is not a cluster");delete this.containedNodes[e],se(t.edges,i=>{delete this.containedEdges[i.id]}),se(t.containedNodes,(i,o)=>{this.containedNodes[o]=i}),t.containedNodes={},se(t.containedEdges,(i,o)=>{this.containedEdges[o]=i}),t.containedEdges={},se(t.edges,i=>{se(this.edges,o=>{var n,a;const d=ce(n=o.clusteringEdgeReplacingIds).call(n,i.id);d!==-1&&(se(i.clusteringEdgeReplacingIds,p=>{o.clusteringEdgeReplacingIds.push(p),this.body.edges[p].edgeReplacedById=o.id}),Ti(a=o.clusteringEdgeReplacingIds).call(a,d,1))})}),t.edges=[]}}class By{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},ge(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,t){e===void 0?e=this._getHubSize():typeof e=="object"&&(t=this._checkOptions(e),e=this._getHubSize());const i=[];for(let o=0;o<this.body.nodeIndices.length;o++){const n=this.body.nodes[this.body.nodeIndices[o]];n.edges.length>=e&&i.push(n.id)}for(let o=0;o<i.length;o++)this.clusterByConnection(i[o],t,!0);this.body.emitter.emit("_dataChanged")}cluster(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(e.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);const i={},o={};se(this.body.nodes,(n,a)=>{n.options&&e.joinCondition(n.options)===!0&&(i[a]=n,se(n.edges,d=>{this.clusteredEdges[d.id]===void 0&&(o[d.id]=d)}))}),this._cluster(i,o,e,t)}clusterByEdgeCount(e,t){let i=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];t=this._checkOptions(t);const o=[],n={};let a,d,p;for(let v=0;v<this.body.nodeIndices.length;v++){const g={},w={},_=this.body.nodeIndices[v],O=this.body.nodes[_];if(n[_]===void 0){p=0,d=[];for(let $=0;$<O.edges.length;$++)a=O.edges[$],this.clusteredEdges[a.id]===void 0&&(a.toId!==a.fromId&&p++,d.push(a));if(p===e){const $=function(C){if(t.joinCondition===void 0||t.joinCondition===null)return!0;const I=rt.cloneOptions(C);return t.joinCondition(I)};let P=!0;for(let C=0;C<d.length;C++){a=d[C];const I=this._getConnectedId(a,_);if(!$(O)){P=!1;break}w[a.id]=a,g[_]=O,g[I]=this.body.nodes[I],n[_]=!0}if(ke(g).length>0&&ke(w).length>0&&P===!0){const C=function(){for(let I=0;I<o.length;++I)for(const M in g)if(o[I].nodes[M]!==void 0)return o[I]}();if(C!==void 0){for(const I in g)C.nodes[I]===void 0&&(C.nodes[I]=g[I]);for(const I in w)C.edges[I]===void 0&&(C.edges[I]=w[I])}else o.push({nodes:g,edges:w})}}}}for(let v=0;v<o.length;v++)this._cluster(o[v].nodes,o[v].edges,t,!1);i===!0&&this.body.emitter.emit("_dataChanged")}clusterOutliers(e){let t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.clusterByEdgeCount(1,e,t)}clusterBridges(e){let t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.clusterByEdgeCount(2,e,t)}clusterByConnection(e,t){var i;let o=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");const n=this.body.nodes[e];(t=this._checkOptions(t,n)).clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=n.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=n.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=n.options.fixed.x,t.clusterNodeProperties.fixed.y=n.options.fixed.y);const a={},d={},p=n.id,v=rt.cloneOptions(n);a[p]=n;for(let w=0;w<n.edges.length;w++){const _=n.edges[w];if(this.clusteredEdges[_.id]===void 0){const O=this._getConnectedId(_,p);if(this.clusteredNodes[O]===void 0)if(O!==p)if(t.joinCondition===void 0)d[_.id]=_,a[O]=this.body.nodes[O];else{const $=rt.cloneOptions(this.body.nodes[O]);t.joinCondition(v,$)===!0&&(d[_.id]=_,a[O]=this.body.nodes[O])}else d[_.id]=_}}const g=qo(i=ke(a)).call(i,function(w){return a[w].id});for(const w in a){if(!Object.prototype.hasOwnProperty.call(a,w))continue;const _=a[w];for(let O=0;O<_.edges.length;O++){const $=_.edges[O];ce(g).call(g,this._getConnectedId($,_.id))>-1&&(d[$.id]=$)}}this._cluster(a,d,t,o)}_createClusterEdges(e,t,i,o){let n,a,d,p,v,g;const w=ke(e),_=[];for(let P=0;P<w.length;P++){a=w[P],d=e[a];for(let C=0;C<d.edges.length;C++)n=d.edges[C],this.clusteredEdges[n.id]===void 0&&(n.toId==n.fromId?t[n.id]=n:n.toId==a?(p=i.id,v=n.fromId,g=v):(p=n.toId,v=i.id,g=p),e[g]===void 0&&_.push({edge:n,fromId:v,toId:p}))}const O=[],$=function(P){for(let C=0;C<O.length;C++){const I=O[C],M=P.fromId===I.fromId&&P.toId===I.toId,L=P.fromId===I.toId&&P.toId===I.fromId;if(M||L)return I}return null};for(let P=0;P<_.length;P++){const C=_[P],I=C.edge;let M=$(C);M===null?(M=this._createClusteredEdge(C.fromId,C.toId,I,o),O.push(M)):M.clusteringEdgeReplacingIds.push(I.id),this.body.edges[I.id].edgeReplacedById=M.id,this._backupEdgeOptions(I),I.setOptions({physics:!1})}}_checkOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}_cluster(e,t,i){let o=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3];const n=[];for(const g in e)Object.prototype.hasOwnProperty.call(e,g)&&this.clusteredNodes[g]!==void 0&&n.push(g);for(let g=0;g<n.length;++g)delete e[n[g]];if(ke(e).length==0||ke(e).length==1&&i.clusterNodeProperties.allowSingleNodeCluster!=1)return;let a=ye({},i.clusterNodeProperties);if(i.processProperties!==void 0){const g=[];for(const _ in e)if(Object.prototype.hasOwnProperty.call(e,_)){const O=rt.cloneOptions(e[_]);g.push(O)}const w=[];for(const _ in t)if(Object.prototype.hasOwnProperty.call(t,_)&&_.substr(0,12)!=="clusterEdge:"){const O=rt.cloneOptions(t[_],"edge");w.push(O)}if(a=i.processProperties(a,g,w),!a)throw new Error("The processProperties function does not return properties!")}a.id===void 0&&(a.id="cluster:"+Ws());const d=a.id;let p;a.label===void 0&&(a.label="cluster"),a.x===void 0&&(p=this._getClusterPosition(e),a.x=p.x),a.y===void 0&&(p===void 0&&(p=this._getClusterPosition(e)),a.y=p.y),a.id=d;const v=this.body.functions.createNode(a,CS);v.containedNodes=e,v.containedEdges=t,v.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[a.id]=v,this._clusterEdges(e,t,a,i.clusterEdgeProperties),a.id=void 0,o===!0&&this.body.emitter.emit("_dataChanged")}_backupEdgeOptions(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}_restoreEdge(e){const t=this.clusteredEdges[e.id];t!==void 0&&(e.setOptions({physics:t.physics}),delete this.clusteredEdges[e.id])}isCluster(e){return this.body.nodes[e]!==void 0?this.body.nodes[e].isCluster===!0:(console.error("Node does not exist."),!1)}_getClusterPosition(e){const t=ke(e);let i,o=e[t[0]].x,n=e[t[0]].x,a=e[t[0]].y,d=e[t[0]].y;for(let p=1;p<t.length;p++)i=e[t[p]],o=i.x<o?i.x:o,n=i.x>n?i.x:n,a=i.y<a?i.y:a,d=i.y>d?i.y:d;return{x:.5*(o+n),y:.5*(a+d)}}openCluster(e,t){let i=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");const o=this.body.nodes[e];if(o===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(o.isCluster!==!0||o.containedNodes===void 0||o.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");const n=this.findNode(e),a=ce(n).call(n,e)-1;if(a>=0){const g=n[a];return this.body.nodes[g]._openChildCluster(e),delete this.body.nodes[e],void(i===!0&&this.body.emitter.emit("_dataChanged"))}const d=o.containedNodes,p=o.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction=="function"){const g={},w={x:o.x,y:o.y};for(const O in d)if(Object.prototype.hasOwnProperty.call(d,O)){const $=this.body.nodes[O];g[O]={x:$.x,y:$.y}}const _=t.releaseFunction(w,g);for(const O in d)if(Object.prototype.hasOwnProperty.call(d,O)){const $=this.body.nodes[O];_[O]!==void 0&&($.x=_[O].x===void 0?o.x:_[O].x,$.y=_[O].y===void 0?o.y:_[O].y)}}else se(d,function(g){g.options.fixed.x===!1&&(g.x=o.x),g.options.fixed.y===!1&&(g.y=o.y)});for(const g in d)if(Object.prototype.hasOwnProperty.call(d,g)){const w=this.body.nodes[g];w.vx=o.vx,w.vy=o.vy,w.setOptions({physics:!0}),delete this.clusteredNodes[g]}const v=[];for(let g=0;g<o.edges.length;g++)v.push(o.edges[g]);for(let g=0;g<v.length;g++){const w=v[g],_=this._getConnectedId(w,e),O=this.clusteredNodes[_];for(let $=0;$<w.clusteringEdgeReplacingIds.length;$++){const P=w.clusteringEdgeReplacingIds[$],C=this.body.edges[P];if(C!==void 0)if(O!==void 0){const I=this.body.nodes[O.clusterId];I.containedEdges[C.id]=C,delete p[C.id];let M=C.fromId,L=C.toId;C.toId==_?L=O.clusterId:M=O.clusterId,this._createClusteredEdge(M,L,C,I.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(C)}w.remove()}for(const g in p)Object.prototype.hasOwnProperty.call(p,g)&&this._restoreEdge(p[g]);delete this.body.nodes[e],i===!0&&this.body.emitter.emit("_dataChanged")}getNodesInCluster(e){const t=[];if(this.isCluster(e)===!0){const i=this.body.nodes[e].containedNodes;for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&t.push(this.body.nodes[o].id)}return t}findNode(e){const t=[];let i,o=0;for(;this.clusteredNodes[e]!==void 0&&o<100;){if(i=this.body.nodes[e],i===void 0)return[];t.push(i.id),e=this.clusteredNodes[e].clusterId,o++}return i=this.body.nodes[e],i===void 0?[]:(t.push(i.id),Vr(t).call(t),t)}updateClusteredNode(e,t){if(e===void 0)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(t===void 0)throw new Error("No newOptions supplied to updateClusteredNode.");if(this.body.nodes[e]===void 0)throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[e].setOptions(t),this.body.emitter.emit("_dataChanged")}updateEdge(e,t){if(e===void 0)throw new Error("No startEdgeId supplied to updateEdge.");if(t===void 0)throw new Error("No newOptions supplied to updateEdge.");if(this.body.edges[e]===void 0)throw new Error("The startEdgeId supplied to updateEdge does not exist.");const i=this.getClusteredEdges(e);for(let o=0;o<i.length;o++)this.body.edges[i[o]].setOptions(t);this.body.emitter.emit("_dataChanged")}getClusteredEdges(e){const t=[];let i=0;for(;e!==void 0&&this.body.edges[e]!==void 0&&i<100;)t.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,i++;return Vr(t).call(t),t}getBaseEdge(e){return this.getBaseEdges(e)[0]}getBaseEdges(e){const t=[e],i=[],o=[];let n=0;for(;t.length>0&&n<100;){const a=t.pop();if(a===void 0)continue;const d=this.body.edges[a];if(d===void 0)continue;n++;const p=d.clusteringEdgeReplacingIds;if(p===void 0)o.push(a);else for(let v=0;v<p.length;++v){const g=p[v];ce(t).call(t,p)===-1&&ce(i).call(i,p)===-1&&t.push(g)}i.push(a)}return o}_getConnectedId(e,t){return e.toId!=t?e.toId:(e.fromId,e.fromId)}_getHubSize(){let e=0,t=0,i=0,o=0;for(let p=0;p<this.body.nodeIndices.length;p++){const v=this.body.nodes[this.body.nodeIndices[p]];v.edges.length>o&&(o=v.edges.length),e+=v.edges.length,t+=Math.pow(v.edges.length,2),i+=1}e/=i,t/=i;const n=t-Math.pow(e,2),a=Math.sqrt(n);let d=Math.floor(e+2*a);return d>o&&(d=o),d}_createClusteredEdge(e,t,i,o,n){const a=rt.cloneOptions(i,"edge");ye(a,o),a.from=e,a.to=t,a.id="clusterEdge:"+Ws(),n!==void 0&&ye(a,n);const d=this.body.functions.createEdge(a);return d.clusteringEdgeReplacingIds=[i.id],d.connect(),this.body.edges[d.id]=d,d}_clusterEdges(e,t,i,o){if(t instanceof Nt){const n=t,a={};a[n.id]=n,t=a}if(e instanceof ae){const n=e,a={};a[n.id]=n,e=a}if(i==null)throw new Error("_clusterEdges: parameter clusterNode required");o===void 0&&(o=i.clusterEdgeProperties),this._createClusterEdges(e,t,i,o);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&this.body.edges[n]!==void 0){const a=this.body.edges[n];this._backupEdgeOptions(a),a.setOptions({physics:!1})}for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this.clusteredNodes[n]={clusterId:i.id,node:this.body.nodes[n]},this.body.nodes[n].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;const t=this.clusteredNodes[e];if(t===void 0)return;const i=t.clusterId;return i!==void 0?this.body.nodes[i]:void 0}_filter(e,t){const i=[];return se(e,o=>{t(o)&&i.push(o)}),i}_updateState(){let e;const t=[],i={},o=d=>{se(this.body.nodes,p=>{p.isCluster===!0&&d(p)})};for(e in this.clusteredNodes)Object.prototype.hasOwnProperty.call(this.clusteredNodes,e)&&this.body.nodes[e]===void 0&&t.push(e);o(function(d){for(let p=0;p<t.length;p++)delete d.containedNodes[t[p]]});for(let d=0;d<t.length;d++)delete this.clusteredNodes[t[d]];se(this.clusteredEdges,d=>{const p=this.body.edges[d];p!==void 0&&p.endPointsValid()||(i[d]=d)}),o(function(d){se(d.containedEdges,(p,v)=>{p.endPointsValid()||i[v]||(i[v]=v)})}),se(this.body.edges,(d,p)=>{let v=!0;const g=d.clusteringEdgeReplacingIds;if(g!==void 0){let w=0;se(g,_=>{const O=this.body.edges[_];O!==void 0&&O.endPointsValid()&&(w+=1)}),v=w>0}d.endPointsValid()&&v||(i[p]=p)}),o(d=>{se(i,p=>{delete d.containedEdges[p],se(d.edges,(v,g)=>{v.id!==p?v.clusteringEdgeReplacingIds=this._filter(v.clusteringEdgeReplacingIds,function(w){return!i[w]}):d.edges[g]=null}),d.edges=this._filter(d.edges,function(v){return v!==null})})}),se(i,d=>{delete this.clusteredEdges[d]}),se(i,d=>{delete this.body.edges[d]}),se(ke(this.body.edges),d=>{const p=this.body.edges[d],v=this._isClusteredNode(p.fromId)||this._isClusteredNode(p.toId);if(v!==this._isClusteredEdge(p.id))if(v){const g=this._getClusterNodeForNode(p.fromId);g!==void 0&&this._clusterEdges(this.body.nodes[p.fromId],p,g);const w=this._getClusterNodeForNode(p.toId);w!==void 0&&this._clusterEdges(this.body.nodes[p.toId],p,w)}else delete this._clusterEdges[d],this._restoreEdge(p)});let n=!1,a=!0;for(;a;){const d=[];o(function(p){const v=ke(p.containedNodes).length,g=p.options.allowSingleNodeCluster===!0;(g&&v<1||!g&&v<2)&&d.push(p.id)});for(let p=0;p<d.length;++p)this.openCluster(d[p],{},!1);a=d.length>0,n=n||a}n&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}}class jy{constructor(e,t){this.body=e,this.canvas=t,this.redrawRequested=!1,this.requestAnimationFrameRequestId=void 0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},ge(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.on("dragStart",()=>{this.dragging=!0}),this.body.emitter.on("dragEnd",()=>{this.dragging=!1}),this.body.emitter.on("zoom",()=>{this.zooming=!0,window.clearTimeout(this.zoomTimeoutId),this.zoomTimeoutId=Ii(()=>{var t;this.zooming=!1,N(t=this._requestRedraw).call(t,this)()},250)}),this.body.emitter.on("_resizeNodes",()=>{this._resizeNodes()}),this.body.emitter.on("_redraw",()=>{this.renderingActive===!1&&this._redraw()}),this.body.emitter.on("_blockRedraw",()=>{this.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",()=>{this.allowRedraw=!0,this.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",N(e=this._requestRedraw).call(e,this)),this.body.emitter.on("_startRendering",()=>{this.renderRequests+=1,this.renderingActive=!0,this._startRendering()}),this.body.emitter.on("_stopRendering",()=>{this.renderRequests-=1,this.renderingActive=this.renderRequests>0,this.requestAnimationFrameRequestId=void 0}),this.body.emitter.on("destroy",()=>{this.renderRequests=0,this.allowRedraw=!1,this.renderingActive=!1,window.cancelAnimationFrame(this.requestAnimationFrameRequestId),this.body.emitter.off()})}setOptions(e){e!==void 0&&tn(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}_startRendering(){var e;this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0&&(this.requestAnimationFrameRequestId=window.requestAnimationFrame(N(e=this._renderStep).call(e,this),this.simulationInterval))}_renderStep(){this.renderingActive===!0&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit("setSize"),this._redraw()}_requestRedraw(){this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,window.requestAnimationFrame(()=>{this._redraw(!1)}))}_redraw(){let e=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;const t={drawExternalLabels:null};this.canvas.frame.canvas.width!==0&&this.canvas.frame.canvas.height!==0||this.canvas.setSize(),this.canvas.setTransform();const i=this.canvas.getContext(),o=this.canvas.frame.canvas.clientWidth,n=this.canvas.frame.canvas.clientHeight;if(i.clearRect(0,0,o,n),this.canvas.frame.clientWidth===0)return;if(i.save(),i.translate(this.body.view.translation.x,this.body.view.translation.y),i.scale(this.body.view.scale,this.body.view.scale),i.beginPath(),this.body.emitter.emit("beforeDrawing",i),i.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(i),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){const{drawExternalLabels:a}=this._drawNodes(i,e);t.drawExternalLabels=a}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(i),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(i),i.beginPath(),this.body.emitter.emit("afterDrawing",i),i.closePath(),i.restore(),e===!0&&i.clearRect(0,0,o,n)}}_resizeNodes(){this.canvas.setTransform();const e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);const t=this.body.nodes;let i;for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(i=t[o],i.resize(e),i.updateBoundingBox(e,i.selected));e.restore()}_drawNodes(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];const i=this.body.nodes,o=this.body.nodeIndices;let n;const a=[],d=[],p=this.canvas.DOMtoCanvas({x:-20,y:-20}),v=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+20,y:this.canvas.frame.canvas.clientHeight+20}),g={top:p.y,left:p.x,bottom:v.y,right:v.x},w=[];for(let P=0;P<o.length;P++)if(n=i[o[P]],n.hover)d.push(o[P]);else if(n.isSelected())a.push(o[P]);else if(t===!0){const C=n.draw(e);C.drawExternalLabel!=null&&w.push(C.drawExternalLabel)}else if(n.isBoundingBoxOverlappingWith(g)===!0){const C=n.draw(e);C.drawExternalLabel!=null&&w.push(C.drawExternalLabel)}else n.updateBoundingBox(e,n.selected);let _;const O=a.length,$=d.length;for(_=0;_<O;_++){n=i[a[_]];const P=n.draw(e);P.drawExternalLabel!=null&&w.push(P.drawExternalLabel)}for(_=0;_<$;_++){n=i[d[_]];const P=n.draw(e);P.drawExternalLabel!=null&&w.push(P.drawExternalLabel)}return{drawExternalLabels:()=>{for(const P of w)P()}}}_drawEdges(e){const t=this.body.edges,i=this.body.edgeIndices;for(let o=0;o<i.length;o++){const n=t[i[o]];n.connected===!0&&n.draw(e)}}_drawArrows(e){const t=this.body.edges,i=this.body.edgeIndices;for(let o=0;o<i.length;o++){const n=t[i[o]];n.connected===!0&&n.drawArrows(e)}}_drawSelectionBox(e){if(this.body.selectionBox.show){e.beginPath();const t=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,i=this.body.selectionBox.position.end.y-this.body.selectionBox.position.start.y;e.rect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,i),e.fillStyle="rgba(151, 194, 252, 0.2)",e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,i),e.strokeStyle="rgba(151, 194, 252, 1)",e.stroke()}else e.closePath()}}var PS=A(ne.setInterval);function Gh(r,e){e.inputHandler=function(t){t.isFirst&&e(t)},r.on("hammer.input",e.inputHandler)}function Fu(r,e){return e.inputHandler=function(t){t.isFinal&&e(t)},r.on("hammer.input",e.inputHandler)}class kS{constructor(e){this.body=e,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},ge(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.once("resize",t=>{t.width!==0&&(this.body.view.translation.x=.5*t.width),t.height!==0&&(this.body.view.translation.y=.5*t.height)}),this.body.emitter.on("setSize",N(e=this.setSize).call(e,this)),this.body.emitter.on("destroy",()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(e){if(e!==void 0&&tn(["width","height","autoResize"],this.options,e),this._cleanUp(),this.options.autoResize===!0){var t;if(window.ResizeObserver){const o=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:n}=this;o.observe(n),this._cleanupCallbacks.push(()=>{o.unobserve(n)})}else{const o=PS(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(o)})}const i=N(t=this._onResize).call(t,this);window.addEventListener("resize",i),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",i)})}}_cleanUp(){var e,t,i;ue(e=Vr(t=Ti(i=this._cleanupCallbacks).call(i,0)).call(t)).call(e,o=>{try{o()}catch(n){console.error(n)}})}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}_setCameraState(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){const e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight;let i=this.cameraState.scale;e!=1&&t!=1?i=.5*this.cameraState.scale*(e+t):e!=1?i=this.cameraState.scale*e:t!=1&&(i=this.cameraState.scale*t),this.body.view.scale=i;const o=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),n={x:o.x-this.cameraState.position.x,y:o.y-this.cameraState.position.y};this.body.view.translation.x+=n.x*this.body.view.scale,this.body.view.translation.y+=n.y*this.body.view.scale}}_prepareValue(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(ce(e).call(e,"%")!==-1||ce(e).call(e,"px")!==-1)return e;if(ce(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}_create(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{const e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}_bindHammer(){this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new on(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:on.DIRECTION_ALL}),Gh(this.hammer,e=>{this.body.eventListeners.onTouch(e)}),this.hammer.on("tap",e=>{this.body.eventListeners.onTap(e)}),this.hammer.on("doubletap",e=>{this.body.eventListeners.onDoubleTap(e)}),this.hammer.on("press",e=>{this.body.eventListeners.onHold(e)}),this.hammer.on("panstart",e=>{this.body.eventListeners.onDragStart(e)}),this.hammer.on("panmove",e=>{this.body.eventListeners.onDrag(e)}),this.hammer.on("panend",e=>{this.body.eventListeners.onDragEnd(e)}),this.hammer.on("pinch",e=>{this.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener("wheel",e=>{this.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("mousemove",e=>{this.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener("contextmenu",e=>{this.body.eventListeners.onContext(e)}),this.hammerFrame=new on(this.frame),Fu(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);let i=!1;const o=this.frame.canvas.width,n=this.frame.canvas.height,a=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(a),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},i=!0;else{const d=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),p=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);this.frame.canvas.width===d&&this.frame.canvas.height===p||this._getCameraState(a),this.frame.canvas.width!==d&&(this.frame.canvas.width=d,i=!0),this.frame.canvas.height!==p&&(this.frame.canvas.height=p,i=!0)}return i===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(o/this.pixelRatio),oldHeight:Math.round(n/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");let t=1;return typeof window<"u"&&(t=window.devicePixelRatio||1),t/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(e){return(e-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(e){return(e-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.y}canvasToDOM(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}DOMtoCanvas(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}class fn{constructor(e,t){var i,o;this.body=e,this.canvas=t,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",N(i=this.fit).call(i,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",N(o=this.releaseNode).call(o,this))}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}fit(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];e=function(p,v){const g=ge({nodes:v,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},p??{});if(!Pe(g.nodes))throw new TypeError("Nodes has to be an array of ids.");if(g.nodes.length===0&&(g.nodes=v),!(typeof g.minZoomLevel=="number"&&g.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof g.maxZoomLevel=="number"&&g.minZoomLevel<=g.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return g}(e,this.body.nodeIndices);const i=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;let n,a;if(i===0||o===0)a=1,n=rt.getRange(this.body.nodes,e.nodes);else if(t===!0){let p=0;for(const v in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,v)&&this.body.nodes[v].predefinedPosition===!0&&(p+=1);if(p>.5*this.body.nodeIndices.length)return void this.fit(e,!1);n=rt.getRange(this.body.nodes,e.nodes),a=12.662/(this.body.nodeIndices.length+7.4147)+.0964822,a*=Math.min(i/600,o/600)}else{this.body.emitter.emit("_resizeNodes"),n=rt.getRange(this.body.nodes,e.nodes);const p=i/(1.1*Math.abs(n.maxX-n.minX)),v=o/(1.1*Math.abs(n.maxY-n.minY));a=p<=v?p:v}a>e.maxZoomLevel?a=e.maxZoomLevel:a<e.minZoomLevel&&(a=e.minZoomLevel);const d={position:rt.findCenter(n),scale:a,animation:e.animation};this.moveTo(d)}focus(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){const i={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=i,t.lockedOnNode=e,this.moveTo(t)}else console.error("Node: "+e+" cannot be found.")}moveTo(e){if(e!==void 0){if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!ro(e.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!ro(e.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!ro(e.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!ro(e.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}else e={}}animateView(e){if(e===void 0)return;this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;const t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i=t.x-e.position.x,o=t.y-e.position.y;var n,a;this.targetTranslation={x:this.sourceTranslation.x+i*this.targetScale+e.offset.x,y:this.sourceTranslation.y+o*this.targetScale+e.offset.y},e.animation.duration===0?this.lockedOnNodeId!=null?(this.viewFunction=N(n=this._lockedRedraw).call(n,this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=N(a=this._transitionRedraw).call(a,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))}_lockedRedraw(){const e=this.body.nodes[this.lockedOnNodeId].x,t=this.body.nodes[this.lockedOnNodeId].y,i=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),o=i.x-e,n=i.y-t,a=this.body.view.translation,d={x:a.x+o*this.body.view.scale+this.lockedOnNodeOffset.x,y:a.y+n*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=d}releaseNode(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let e=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;const t=cO[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){var i;this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null&&(this.viewFunction=N(i=this._lockedRedraw).call(i,this),this.body.emitter.on("initRedraw",this.viewFunction)),this.body.emitter.emit("animationFinished")}}getScale(){return this.body.view.scale}getViewPosition(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}function Us(r){var e,t=r&&r.preventDefault||!1,i=r&&r.container||window,o={},n={keydown:{},keyup:{}},a={};for(e=97;e<=122;e++)a[String.fromCharCode(e)]={code:e-97+65,shift:!1};for(e=65;e<=90;e++)a[String.fromCharCode(e)]={code:e,shift:!0};for(e=0;e<=9;e++)a[""+e]={code:48+e,shift:!1};for(e=1;e<=12;e++)a["F"+e]={code:111+e,shift:!1};for(e=0;e<=9;e++)a["num"+e]={code:96+e,shift:!1};a["num*"]={code:106,shift:!1},a["num+"]={code:107,shift:!1},a["num-"]={code:109,shift:!1},a["num/"]={code:111,shift:!1},a["num."]={code:110,shift:!1},a.left={code:37,shift:!1},a.up={code:38,shift:!1},a.right={code:39,shift:!1},a.down={code:40,shift:!1},a.space={code:32,shift:!1},a.enter={code:13,shift:!1},a.shift={code:16,shift:void 0},a.esc={code:27,shift:!1},a.backspace={code:8,shift:!1},a.tab={code:9,shift:!1},a.ctrl={code:17,shift:!1},a.alt={code:18,shift:!1},a.delete={code:46,shift:!1},a.pageup={code:33,shift:!1},a.pagedown={code:34,shift:!1},a["="]={code:187,shift:!1},a["-"]={code:189,shift:!1},a["]"]={code:221,shift:!1},a["["]={code:219,shift:!1};var d=function(g){v(g,"keydown")},p=function(g){v(g,"keyup")},v=function(g,w){if(n[w][g.keyCode]!==void 0){for(var _=n[w][g.keyCode],O=0;O<_.length;O++)(_[O].shift===void 0||_[O].shift==1&&g.shiftKey==1||_[O].shift==0&&g.shiftKey==0)&&_[O].fn(g);t==1&&g.preventDefault()}};return o.bind=function(g,w,_){if(_===void 0&&(_="keydown"),a[g]===void 0)throw new Error("unsupported key: "+g);n[_][a[g].code]===void 0&&(n[_][a[g].code]=[]),n[_][a[g].code].push({fn:w,shift:a[g].shift})},o.bindAll=function(g,w){for(var _ in w===void 0&&(w="keydown"),a)a.hasOwnProperty(_)&&o.bind(_,g,w)},o.getKey=function(g){for(var w in a)if(a.hasOwnProperty(w)&&(g.shiftKey==1&&a[w].shift==1&&g.keyCode==a[w].code||g.shiftKey==0&&a[w].shift==0&&g.keyCode==a[w].code||g.keyCode==a[w].code&&w=="shift"))return w;return"unknown key, currently not supported"},o.unbind=function(g,w,_){if(_===void 0&&(_="keydown"),a[g]===void 0)throw new Error("unsupported key: "+g);if(w!==void 0){var O=[],$=n[_][a[g].code];if($!==void 0)for(var P=0;P<$.length;P++)$[P].fn==w&&$[P].shift==a[g].shift||O.push(n[_][a[g].code][P]);n[_][a[g].code]=O}else n[_][a[g].code]=[]},o.reset=function(){n={keydown:{},keyup:{}}},o.destroy=function(){n={keydown:{},keyup:{}},i.removeEventListener("keydown",d,!0),i.removeEventListener("keyup",p,!0)},i.addEventListener("keydown",d,!0),i.addEventListener("keyup",p,!0),o}class Ut{constructor(e,t){this.body=e,this.canvas=t,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",()=>{this.activated=!0,this.configureKeyboardBindings()}),this.body.emitter.on("deactivate",()=>{this.activated=!1,this.configureKeyboardBindings()}),this.body.emitter.on("destroy",()=>{this.keycharm!==void 0&&this.keycharm.destroy()}),this.options={}}setOptions(e){e!==void 0&&(this.options=e,this.create())}create(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(this.navigationHammers.length!=0){for(let e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}loadNavigationElements(){this.cleanNavigation(),this.navigationDOM={};const e=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],t=["_moveUp","_moveDown","_moveLeft","_moveRight","_zoomIn","_zoomOut","_fit"];this.navigationDOM.wrapper=document.createElement("div"),this.navigationDOM.wrapper.className="vis-navigation",this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(let a=0;a<e.length;a++){this.navigationDOM[e[a]]=document.createElement("div"),this.navigationDOM[e[a]].className="vis-button vis-"+e[a],this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[a]]);const d=new on(this.navigationDOM[e[a]]);var i,o;t[a]==="_fit"?Gh(d,N(i=this._fit).call(i,this)):Gh(d,N(o=this.bindToRedraw).call(o,this,t[a])),this.navigationHammers.push(d)}const n=new on(this.canvas.frame);Fu(n,()=>{this._stopMovement()}),this.navigationHammers.push(n),this.iconsCreated=!0}bindToRedraw(e){var t;this.boundFunctions[e]===void 0&&(this.boundFunctions[e]=N(t=this[e]).call(t,this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering"))}unbindFromRedraw(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}_fit(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}_stopMovement(){for(const e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}_moveUp(){this.body.view.translation.y+=this.options.keyboard.speed.y}_moveDown(){this.body.view.translation.y-=this.options.keyboard.speed.y}_moveLeft(){this.body.view.translation.x+=this.options.keyboard.speed.x}_moveRight(){this.body.view.translation.x-=this.options.keyboard.speed.x}_zoomIn(){const e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,o=t/e,n=(1-o)*this.canvas.canvasViewCenter.x+i.x*o,a=(1-o)*this.canvas.canvasViewCenter.y+i.y*o;this.body.view.scale=t,this.body.view.translation={x:n,y:a},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){const e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,o=t/e,n=(1-o)*this.canvas.canvasViewCenter.x+i.x*o,a=(1-o)*this.canvas.canvasViewCenter.y+i.y*o;this.body.view.scale=t,this.body.view.translation={x:n,y:a},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){var e,t,i,o,n,a,d,p,v,g,w,_,O,$,P,C,I,M,L,W,Y,pe,He,ct;this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=Us({container:window,preventDefault:!0}):this.keycharm=Us({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0&&(N(e=this.keycharm).call(e,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),N(t=this.keycharm).call(t,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),N(i=this.keycharm).call(i,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),N(o=this.keycharm).call(o,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),N(n=this.keycharm).call(n,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),N(a=this.keycharm).call(a,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),N(d=this.keycharm).call(d,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),N(p=this.keycharm).call(p,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),N(v=this.keycharm).call(v,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),N(g=this.keycharm).call(g,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),N(w=this.keycharm).call(w,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),N(_=this.keycharm).call(_,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),N(O=this.keycharm).call(O,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),N($=this.keycharm).call($,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),N(P=this.keycharm).call(P,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),N(C=this.keycharm).call(C,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),N(I=this.keycharm).call(I,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),N(M=this.keycharm).call(M,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),N(L=this.keycharm).call(L,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),N(W=this.keycharm).call(W,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),N(Y=this.keycharm).call(Y,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),N(pe=this.keycharm).call(pe,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),N(He=this.keycharm).call(He,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),N(ct=this.keycharm).call(ct,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")))}}class vn{constructor(e,t,i){var o,n,a,d,p,v,g,w,_,O,$,P,C;this.body=e,this.canvas=t,this.selectionHandler=i,this.navigationHandler=new Ut(e,t),this.body.eventListeners.onTap=N(o=this.onTap).call(o,this),this.body.eventListeners.onTouch=N(n=this.onTouch).call(n,this),this.body.eventListeners.onDoubleTap=N(a=this.onDoubleTap).call(a,this),this.body.eventListeners.onHold=N(d=this.onHold).call(d,this),this.body.eventListeners.onDragStart=N(p=this.onDragStart).call(p,this),this.body.eventListeners.onDrag=N(v=this.onDrag).call(v,this),this.body.eventListeners.onDragEnd=N(g=this.onDragEnd).call(g,this),this.body.eventListeners.onMouseWheel=N(w=this.onMouseWheel).call(w,this),this.body.eventListeners.onPinch=N(_=this.onPinch).call(_,this),this.body.eventListeners.onMouseMove=N(O=this.onMouseMove).call(O,this),this.body.eventListeners.onRelease=N($=this.onRelease).call($,this),this.body.eventListeners.onContext=N(P=this.onContext).call(P,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=N(C=this.getPointer).call(C,this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0,autoFocus:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},ge(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(e){e!==void 0&&(io(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),Ht(this.options,e,"keyboard"),e.tooltip&&(ge(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=Wc(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-(t=this.canvas.frame.canvas,t.getBoundingClientRect().left),y:e.y-dO(this.canvas.frame.canvas)};var t}onTouch(e){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}onTap(e){const t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,i),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t)}onDoubleTap(e){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,t)}onHold(e){const t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,i),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t),this.selectionHandler.generateClickEvent("hold",e,t)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,t),this.touchTime=new Date().valueOf()}}onContext(e){const t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,t)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0&&arguments[1])===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,t){const i=function(o,n){const a=[];for(let d=0;d<o.length;d++){const p=o[d];ce(n).call(n,p)===-1&&a.push(p)}return a};return{nodes:i(e.nodes,t.nodes),edges:i(e.edges,t.edges)}}onDragStart(e){if(this.drag.dragging)return;this.drag.pointer===void 0&&this.onTouch(e);const t=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=ge({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;const i=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(i.x),y:this.canvas._YconvertDOMtoCanvas(i.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(i.x),y:this.canvas._YconvertDOMtoCanvas(i.y)}}else if(t!==void 0&&this.options.dragNodes===!0){this.drag.nodeId=t.id,t.isSelected()===!1&&this.selectionHandler.setSelection({nodes:[t.id]}),this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer);for(const i of this.selectionHandler.getSelectedNodes()){const o={id:i.id,node:i,x:i.x,y:i.y,xFixed:i.options.fixed.x,yFixed:i.options.fixed.y};i.options.fixed.x=!0,i.options.fixed.y=!0,this.drag.selection.push(o)}}else this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}onDrag(e){if(this.drag.pinched===!0)return;this.body.emitter.emit("unlockNode");const t=this.getPointer(e.center),i=this.drag.selection;if(i&&i.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent("dragging",e,t);const o=t.x-this.drag.pointer.x,n=t.y-this.drag.pointer.y;ue(i).call(i,a=>{const d=a.node;a.xFixed===!1&&(d.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(a.x)+o)),a.yFixed===!1&&(d.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(a.y)+n))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0)return void this.onDragStart(e);this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0)return void this.onDragStart(e);const o=t.x-this.drag.pointer.x,n=t.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+o,y:this.drag.translation.y+n},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var t;this.body.selectionBox.show=!1;const i=this.body.selectionBox.position,o={minX:Math.min(i.start.x,i.end.x),minY:Math.min(i.start.y,i.end.y),maxX:Math.max(i.start.x,i.end.x),maxY:Math.max(i.start.y,i.end.y)},n=ft(t=this.body.nodeIndices).call(t,d=>{const p=this.body.nodes[d];return p.x>=o.minX&&p.x<=o.maxX&&p.y>=o.minY&&p.y<=o.maxY});ue(n).call(n,d=>this.selectionHandler.selectObject(this.body.nodes[d]));const a=this.getPointer(e.center);this.selectionHandler.commitAndEmit(a,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{const i=this.drag.selection;i&&i.length?(ue(i).call(i,function(o){o.node.options.fixed.x=o.xFixed,o.node.options.fixed.y=o.yFixed}),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}onPinch(e){const t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);const i=this.pinch.scale*e.scale;this.zoom(i,t)}zoom(e,t){if(this.options.zoomView===!0){const i=this.body.view.scale;let o;e<1e-5&&(e=1e-5),e>10&&(e=10),this.drag!==void 0&&this.drag.dragging===!0&&(o=this.canvas.DOMtoCanvas(this.drag.pointer));const n=this.body.view.translation,a=e/i,d=(1-a)*t.x+n.x*a,p=(1-a)*t.y+n.y*a;if(this.body.view.scale=e,this.body.view.translation={x:d,y:p},o!=null){const v=this.canvas.canvasToDOM(o);this.drag.pointer.x=v.x,this.drag.pointer.y=v.y}this.body.emitter.emit("_requestRedraw"),i<e?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:t}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:t})}}onMouseWheel(e){if(this.options.zoomView===!0){if(e.deltaY!==0){let t=this.body.view.scale;t*=1+(e.deltaY<0?1:-1)*(.1*this.options.zoomSpeed);const i=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(t,i)}e.preventDefault()}}onMouseMove(e){const t=this.getPointer({x:e.clientX,y:e.clientY});let i=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(t),this.popup.hidden===!1&&(i=!0,this.popup.setPosition(t.x+3,t.y-5),this.popup.show())),this.options.keyboard.autoFocus&&this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),i===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=Ii(()=>this._checkShowPopup(t),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,t)}_checkShowPopup(e){const t=this.canvas._XconvertDOMtoCanvas(e.x),i=this.canvas._YconvertDOMtoCanvas(e.y),o={left:t,top:i,right:t,bottom:i},n=this.popupObj===void 0?void 0:this.popupObj.id;let a=!1,d="node";if(this.popupObj===void 0){const p=this.body.nodeIndices,v=this.body.nodes;let g;const w=[];for(let _=0;_<p.length;_++)g=v[p[_]],g.isOverlappingWith(o)===!0&&(a=!0,g.getTitle()!==void 0&&w.push(p[_]));w.length>0&&(this.popupObj=v[w[w.length-1]],a=!0)}if(this.popupObj===void 0&&a===!1){const p=this.body.edgeIndices,v=this.body.edges;let g;const w=[];for(let _=0;_<p.length;_++)g=v[p[_]],g.isOverlappingWith(o)===!0&&g.connected===!0&&g.getTitle()!==void 0&&w.push(p[_]);w.length>0&&(this.popupObj=v[w[w.length-1]],d="edge")}this.popupObj!==void 0?this.popupObj.id!==n&&(this.popup===void 0&&(this.popup=new fO(this.canvas.frame)),this.popup.popupTargetType=d,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}_checkHidePopup(e){const t=this.selectionHandler._pointerToPositionObject(e);let i=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),i===!0)){const o=this.selectionHandler.getNodeAt(e);i=o!==void 0&&o.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}su("Set",function(r){return function(){return r(this,arguments.length?arguments[0]:void 0)}},zm);var Et=A(ne.Set),Fi=de,gn=au,Rt=Ph.getWeakData,DS=ou,MS=_i,Kh=_o,Yh=at,Vs=ru,Xh=Ze,mn=di.set,zy=di.getterFor,Bu=xi.find,Ly=xi.findIndex,Hy=Fi([].splice),Wy=0,qs=function(r){return r.frozen||(r.frozen=new ju)},ju=function(){this.entries=[]},Qh=function(r,e){return Bu(r.entries,function(t){return t[0]===e})};ju.prototype={get:function(r){var e=Qh(this,r);if(e)return e[1]},has:function(r){return!!Qh(this,r)},set:function(r,e){var t=Qh(this,r);t?t[1]=e:this.entries.push([r,e])},delete:function(r){var e=Ly(this.entries,function(t){return t[0]===r});return~e&&Hy(this.entries,e,1),!!~e}};var Gs,Uy={getConstructor:function(r,e,t,i){var o=r(function(p,v){DS(p,n),mn(p,{type:e,id:Wy++,frozen:void 0}),Kh(v)||Vs(v,p[i],{that:p,AS_ENTRIES:t})}),n=o.prototype,a=zy(e),d=function(p,v,g){var w=a(p),_=Rt(MS(v),!0);return _===!0?qs(w).set(v,g):_[w.id]=g,p};return gn(n,{delete:function(p){var v=a(this);if(!Yh(p))return!1;var g=Rt(p);return g===!0?qs(v).delete(p):g&&Xh(g,v.id)&&delete g[v.id]},has:function(p){var v=a(this);if(!Yh(p))return!1;var g=Rt(p);return g===!0?qs(v).has(p):g&&Xh(g,v.id)}}),gn(n,t?{get:function(p){var v=a(this);if(Yh(p)){var g=Rt(p);return g===!0?qs(v).get(p):g?g[v.id]:void 0}},set:function(p,v){return d(this,p,v)}}:{add:function(p){return d(this,p,!0)}}),o}},Vy=Em,qy=we,Ks=de,Gy=au,AS=Ph,NS=su,Ky=Uy,Jh=at,Ys=di.enforce,Yy=G,RS=kf,Xs=Object,Xy=Array.isArray,Zh=Xs.isExtensible,Qy=Xs.isFrozen,Jy=Xs.isSealed,Zy=Xs.freeze,eb=Xs.seal,el={},tb={},ib=!qy.ActiveXObject&&"ActiveXObject"in qy,Qs=function(r){return function(){return r(this,arguments.length?arguments[0]:void 0)}},zu=NS("WeakMap",Qs,Ky),po=zu.prototype,tl=Ks(po.set);if(RS)if(ib){Gs=Ky.getConstructor(Qs,"WeakMap",!0),AS.enable();var rb=Ks(po.delete),Vt=Ks(po.has),ob=Ks(po.get);Gy(po,{delete:function(r){if(Jh(r)&&!Zh(r)){var e=Ys(this);return e.frozen||(e.frozen=new Gs),rb(this,r)||e.frozen.delete(r)}return rb(this,r)},has:function(r){if(Jh(r)&&!Zh(r)){var e=Ys(this);return e.frozen||(e.frozen=new Gs),Vt(this,r)||e.frozen.has(r)}return Vt(this,r)},get:function(r){if(Jh(r)&&!Zh(r)){var e=Ys(this);return e.frozen||(e.frozen=new Gs),Vt(this,r)?ob(this,r):e.frozen.get(r)}return ob(this,r)},set:function(r,e){if(Jh(r)&&!Zh(r)){var t=Ys(this);t.frozen||(t.frozen=new Gs),Vt(this,r)?tl(this,r,e):t.frozen.set(r,e)}else tl(this,r,e);return this}})}else Vy&&Yy(function(){var r=Zy([]);return tl(new zu,r,1),!Qy(r)})&&Gy(po,{set:function(r,e){var t;return Xy(r)&&(Qy(r)?t=el:Jy(r)&&(t=tb)),tl(this,r,e),t===el&&Zy(r),t===tb&&eb(r),this}});var fo,qt,ur,Bi,il,Js=A(ne.WeakMap);function ve(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)}function Lu(r,e,t,i,o){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?o.call(r,t):o?o.value=t:e.set(r,t),t}function Hu(r,e){const t=new Et;for(const i of e)r.has(i)||t.add(i);return t}typeof SuppressedError=="function"&&SuppressedError;class nb{constructor(){fo.set(this,new Et),qt.set(this,new Et)}get size(){return ve(this,qt,"f").size}add(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(const o of t)ve(this,qt,"f").add(o)}delete(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(const o of t)ve(this,qt,"f").delete(o)}clear(){ve(this,qt,"f").clear()}getSelection(){return[...ve(this,qt,"f")]}getChanges(){return{added:[...Hu(ve(this,fo,"f"),ve(this,qt,"f"))],deleted:[...Hu(ve(this,qt,"f"),ve(this,fo,"f"))],previous:[...new Et(ve(this,fo,"f"))],current:[...new Et(ve(this,qt,"f"))]}}commit(){const e=this.getChanges();Lu(this,fo,ve(this,qt,"f"),"f"),Lu(this,qt,new Et(ve(this,fo,"f")),"f");for(const t of e.added)t.select();for(const t of e.deleted)t.unselect();return e}}fo=new Js,qt=new Js;class sb{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};ur.set(this,new nb),Bi.set(this,new nb),il.set(this,void 0),Lu(this,il,e,"f")}get sizeNodes(){return ve(this,ur,"f").size}get sizeEdges(){return ve(this,Bi,"f").size}getNodes(){return ve(this,ur,"f").getSelection()}getEdges(){return ve(this,Bi,"f").getSelection()}addNodes(){ve(this,ur,"f").add(...arguments)}addEdges(){ve(this,Bi,"f").add(...arguments)}deleteNodes(e){ve(this,ur,"f").delete(e)}deleteEdges(e){ve(this,Bi,"f").delete(e)}clear(){ve(this,ur,"f").clear(),ve(this,Bi,"f").clear()}commit(){const e={nodes:ve(this,ur,"f").commit(),edges:ve(this,Bi,"f").commit()};for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return ve(this,il,"f").call(this,e,...i),e}}ur=new Js,Bi=new Js,il=new Js;class FS{constructor(e,t){this.body=e,this.canvas=t,this._selectionAccumulator=new sb,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},ge(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",()=>{this.updateSelection()})}setOptions(e){e!==void 0&&tn(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}selectOnPoint(e){let t=!1;if(this.options.selectable===!0){const i=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),i!==void 0&&(t=this.selectObject(i)),this.body.emitter.emit("_requestRedraw")}return t}selectAdditionalOnPoint(e){let t=!1;if(this.options.selectable===!0){const i=this.getNodeAt(e)||this.getEdgeAt(e);i!==void 0&&(t=!0,i.isSelected()===!0?this.deselectObject(i):this.selectObject(i),this.body.emitter.emit("_requestRedraw"))}return t}_initBaseEvent(e,t){const i={};return i.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},i.event=e,i}generateClickEvent(e,t,i,o){let n=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const a=this._initBaseEvent(t,i);if(n===!0)a.nodes=[],a.edges=[];else{const d=this.getSelection();a.nodes=d.nodes,a.edges=d.edges}o!==void 0&&(a.previousSelection=o),e=="click"&&(a.items=this.getClickedItems(i)),t.controlEdge!==void 0&&(a.controlEdge=t.controlEdge),this.body.emitter.emit(e,a)}selectObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e!==void 0&&(e instanceof ae?(t===!0&&this._selectionAccumulator.addEdges(...e.edges),this._selectionAccumulator.addNodes(e)):this._selectionAccumulator.addEdges(e),!0)}deselectObject(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}_getAllNodesOverlappingWith(e){const t=[],i=this.body.nodes;for(let o=0;o<this.body.nodeIndices.length;o++){const n=this.body.nodeIndices[o];i[n].isOverlappingWith(e)&&t.push(n)}return t}_pointerToPositionObject(e){const t=this.canvas.DOMtoCanvas(e);return{left:t.x-1,top:t.y+1,right:t.x+1,bottom:t.y-1}}getNodeAt(e){let t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const i=this._pointerToPositionObject(e),o=this._getAllNodesOverlappingWith(i);return o.length>0?t===!0?this.body.nodes[o[o.length-1]]:o[o.length-1]:void 0}_getEdgesOverlappingWith(e,t){const i=this.body.edges;for(let o=0;o<this.body.edgeIndices.length;o++){const n=this.body.edgeIndices[o];i[n].isOverlappingWith(e)&&t.push(n)}}_getAllEdgesOverlappingWith(e){const t=[];return this._getEdgesOverlappingWith(e,t),t}getEdgeAt(e){let t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const i=this.canvas.DOMtoCanvas(e);let o=10,n=null;const a=this.body.edges;for(let d=0;d<this.body.edgeIndices.length;d++){const p=this.body.edgeIndices[d],v=a[p];if(v.connected){const g=v.from.x,w=v.from.y,_=v.to.x,O=v.to.y,$=v.edgeType.getDistanceToEdge(g,w,_,O,i.x,i.y);$<o&&(n=p,o=$)}}return n!==null?t===!0?this.body.edges[n]:n:void 0}_addToHover(e){e instanceof ae?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}_removeFromSelection(e){e instanceof ae?(this._selectionAccumulator.deleteNodes(e),this._selectionAccumulator.deleteEdges(...e.edges)):this._selectionAccumulator.deleteEdges(e)}unselectAll(){this._selectionAccumulator.clear()}getSelectedNodeCount(){return this._selectionAccumulator.sizeNodes}getSelectedEdgeCount(){return this._selectionAccumulator.sizeEdges}_hoverConnectedEdges(e){for(let t=0;t<e.edges.length;t++){const i=e.edges[t];i.hover=!0,this._addToHover(i)}}emitBlurEvent(e,t,i){const o=this._initBaseEvent(e,t);i.hover===!0&&(i.hover=!1,i instanceof ae?(o.node=i.id,this.body.emitter.emit("blurNode",o)):(o.edge=i.id,this.body.emitter.emit("blurEdge",o)))}emitHoverEvent(e,t,i){const o=this._initBaseEvent(e,t);let n=!1;return i.hover===!1&&(i.hover=!0,this._addToHover(i),n=!0,i instanceof ae?(o.node=i.id,this.body.emitter.emit("hoverNode",o)):(o.edge=i.id,this.body.emitter.emit("hoverEdge",o))),n}hoverObject(e,t){let i=this.getNodeAt(t);i===void 0&&(i=this.getEdgeAt(t));let o=!1;for(const n in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,n)&&(i===void 0||i instanceof ae&&i.id!=n||i instanceof Nt)&&(this.emitBlurEvent(e,t,this.hoverObj.nodes[n]),delete this.hoverObj.nodes[n],o=!0);for(const n in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,n)&&(o===!0?(this.hoverObj.edges[n].hover=!1,delete this.hoverObj.edges[n]):(i===void 0||i instanceof Nt&&i.id!=n||i instanceof ae&&!i.hover)&&(this.emitBlurEvent(e,t,this.hoverObj.edges[n]),delete this.hoverObj.edges[n],o=!0));if(i!==void 0){const n=ke(this.hoverObj.edges).length,a=ke(this.hoverObj.nodes).length;(o||i instanceof Nt&&n===0&&a===0||i instanceof ae&&n===0&&a===0)&&(o=this.emitHoverEvent(e,t,i)),i instanceof ae&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(i)}o===!0&&this.body.emitter.emit("_requestRedraw")}commitWithoutEmitting(){this._selectionAccumulator.commit()}commitAndEmit(e,t){let i=!1;const o=this._selectionAccumulator.commit(),n={nodes:o.nodes.previous,edges:o.edges.previous};o.edges.deleted.length>0&&(this.generateClickEvent("deselectEdge",t,e,n),i=!0),o.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,e,n),i=!0),o.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,e),i=!0),o.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,e),i=!0),i===!0&&this.generateClickEvent("select",t,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return qo(e=this._selectionAccumulator.getNodes()).call(e,t=>t.id)}getSelectedEdgeIds(){var e;return qo(e=this._selectionAccumulator.getEdges()).call(e,t=>t.id)}setSelection(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((t.unselectAll||t.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(const i of e.nodes){const o=this.body.nodes[i];if(!o)throw new RangeError('Node with id "'+i+'" not found');this.selectObject(o,t.highlightEdges)}if(e.edges)for(const i of e.edges){const o=this.body.edges[i];if(!o)throw new RangeError('Edge with id "'+i+'" not found');this.selectObject(o)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(e){let t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}selectEdges(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}updateSelection(){for(const e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(const e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){const t=this.canvas.DOMtoCanvas(e),i=[],o=this.body.nodeIndices,n=this.body.nodes;for(let p=o.length-1;p>=0;p--){const v=n[o[p]].getItemsOnPoint(t);i.push.apply(i,v)}const a=this.body.edgeIndices,d=this.body.edges;for(let p=a.length-1;p>=0;p--){const v=d[a[p]].getItemsOnPoint(t);i.push.apply(i,v)}return i}}var Wu=La,Uu=Math.floor,Vu=function(r,e){var t=r.length,i=Uu(t/2);return t<8?BS(r,e):ab(r,Vu(Wu(r,0,i),e),Vu(Wu(r,i),e),e)},BS=function(r,e){for(var t,i,o=r.length,n=1;n<o;){for(i=n,t=r[n];i&&e(r[i-1],t)>0;)r[i]=r[--i];i!==n++&&(r[i]=t)}return r},ab=function(r,e,t,i){for(var o=e.length,n=t.length,a=0,d=0;a<o||d<n;)r[a+d]=a<o&&d<n?i(e[a],t[d])<=0?e[a++]:t[d++]:a<o?e[a++]:t[d++];return r},hb=Vu,qu=wr.match(/firefox\/(\d+)/i),jS=!!qu&&+qu[1],zS=/MSIE|Trident/.test(wr),lb=wr.match(/AppleWebKit\/(\d+)\./),LS=!!lb&&+lb[1],HS=V,ji=de,WS=So,US=Bt,db=hi,VS=pc,cb=Qt,rl=G,ub=hb,qS=Go,pb=jS,GS=zS,Gu=_r,Ku=LS,pr=[],fb=ji(pr.sort),vb=ji(pr.push),KS=rl(function(){pr.sort(void 0)}),YS=rl(function(){pr.sort(null)}),XS=qS("sort"),gb=!rl(function(){if(Gu)return Gu<70;if(!(pb&&pb>3)){if(GS)return!0;if(Ku)return Ku<603;var r,e,t,i,o="";for(r=65;r<76;r++){switch(e=String.fromCharCode(r),r){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(i=0;i<47;i++)pr.push({k:e+i,v:t})}for(pr.sort(function(n,a){return a.v-n.v}),i=0;i<pr.length;i++)e=pr[i].k.charAt(0),o.charAt(o.length-1)!==e&&(o+=e);return o!=="DGBEFHACIJK"}});HS({target:"Array",proto:!0,forced:KS||!YS||!XS||!gb},{sort:function(r){r!==void 0&&WS(r);var e=US(this);if(gb)return r===void 0?fb(e):fb(e,r);var t,i,o=[],n=db(e);for(i=0;i<n;i++)i in e&&vb(o,e[i]);for(ub(o,function(a){return function(d,p){return p===void 0?-1:d===void 0?1:a!==void 0?+a(d,p)||0:cb(d)>cb(p)?1:-1}}(r)),t=db(o),i=0;i<t;)e[i]=o[i++];for(;i<n;)VS(e,i++);return e}});var QS=et("Array").sort,mb=Ie,JS=QS,Yu=Array.prototype,ZS=function(r){var e=r.sort;return r===Yu||mb(Yu,r)&&e===Yu.sort?JS:e},yn=A(ZS),eT=So,tT=Bt,iT=pa,rT=hi,oT=TypeError,yb=function(r){return function(e,t,i,o){eT(t);var n=tT(e),a=iT(n),d=rT(n),p=r?d-1:0,v=r?-1:1;if(i<2)for(;;){if(p in a){o=a[p],p+=v;break}if(p+=v,r?p<0:d<=p)throw new oT("Reduce of empty array with no initial value")}for(;r?p>=0:d>p;p+=v)p in a&&(o=t(o,a[p],p,n));return o}},nT={left:yb(!1),right:yb(!0)},bb=yi(we.process)==="process",wb=nT.left;V({target:"Array",proto:!0,forced:!bb&&_r>79&&_r<83||!Go("reduce")},{reduce:function(r){var e=arguments.length;return wb(this,r,e,e>1?arguments[1]:void 0)}});var sT=et("Array").reduce,aT=Ie,_b=sT,Xu=Array.prototype,Eb=function(r){var e=r.reduce;return r===Xu||aT(Xu,r)&&e===Xu.reduce?_b:e},Ob=A(Eb);class xb{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(e){return this.fake_use(e),this.abstract()}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,i),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,t){this.fake_use(e,t),this.abstract()}shift(e,t){this.fake_use(e,t),this.abstract()}}class hT extends xb{constructor(e){super(),this.layout=e}curveType(){return"horizontal"}getPosition(e){return e.x}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;i!==void 0&&this.layout.hierarchical.addToOrdering(e,i),e.x=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}sort(e){yn(e).call(e,function(t,i){return t.x-i.x})}fix(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}shift(e,t){this.layout.body.nodes[e].x+=t}}class lT extends xb{constructor(e){super(),this.layout=e}curveType(){return"vertical"}getPosition(e){return e.y}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;i!==void 0&&this.layout.hierarchical.addToOrdering(e,i),e.y=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}sort(e){yn(e).call(e,function(t,i){return t.y-i.y})}fix(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}shift(e,t){this.layout.body.nodes[e].y+=t}}var dT=xi.every;V({target:"Array",proto:!0,forced:!Go("every")},{every:function(r){return dT(this,r,arguments.length>1?arguments[1]:void 0)}});var cT=et("Array").every,uT=Ie,Sb=cT,vo=Array.prototype,pT=function(r){var e=r.every;return r===vo||uT(vo,r)&&e===vo.every?Sb:e},Tb=A(pT);function fT(r,e){const t=new Et;return ue(r).call(r,i=>{var o;ue(o=i.edges).call(o,n=>{n.connected&&t.add(n)})}),ue(t).call(t,i=>{const o=i.from.id,n=i.to.id;e[o]==null&&(e[o]=0),(e[n]==null||e[o]>=e[n])&&(e[n]=e[o]+1)}),e}function Ib(r,e,t,i){var o;const n=er(null),a=Ob(o=[...Iu(i).call(i)]).call(o,(w,_)=>w+1+_.edges.length,0),d=t+"Id",p=t==="to"?1:-1;for(const[w,_]of i){if(!i.has(w)||!r(_))continue;n[w]=0;const O=[_];let $,P=0;for(;$=O.pop();){var v,g;if(!i.has(w))continue;const C=n[$.id]+p;if(ue(v=ft(g=$.edges).call(g,I=>I.connected&&I.to!==I.from&&I[t]!==$&&i.has(I.toId)&&i.has(I.fromId))).call(v,I=>{const M=I[d],L=n[M];(L==null||e(C,L))&&(n[M]=C,O.push(I[t]))}),P>a)return fT(i,n);++P}}return n}class $b{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(e,t){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),this.parentReference[t]===void 0&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}checkIfTree(){for(const e in this.parentReference)if(this.parentReference[e].length>1)return void(this.isTree=!1);this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){const t={},i=o=>{if(t[o]!==void 0)return t[o];let n=this.levels[o];if(this.childrenReference[o]){const a=this.childrenReference[o];if(a.length>0)for(let d=0;d<a.length;d++)n=Math.max(n,i(a[d]))}return t[o]=n,n};return i(e)}levelDownstream(e,t){this.levels[t.id]===void 0&&(this.levels[e.id]===void 0&&(this.levels[e.id]=0),this.levels[t.id]=this.levels[e.id]+1)}setMinLevelToZero(){var e;const t=new pu;let i=0;const o=yn(e=[...new Et(mE(this.levels))]).call(e,(n,a)=>n-a);for(const n of o)t.set(n,i++);for(const n in this.levels)Object.prototype.hasOwnProperty.call(this.levels,n)&&(this.levels[n]=t.get(this.levels[n]))}getTreeSize(e,t){let i=1e9,o=-1e9,n=1e9,a=-1e9;for(const d in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,d)&&this.trees[d]===t){const p=e[d];i=Math.min(p.x,i),o=Math.max(p.x,o),n=Math.min(p.y,n),a=Math.max(p.y,a)}return{min_x:i,max_x:o,min_y:n,max_y:a}}hasSameParent(e,t){const i=this.parentReference[e.id],o=this.parentReference[t.id];if(i===void 0||o===void 0)return!1;for(let n=0;n<i.length;n++)for(let a=0;a<o.length;a++)if(i[n]==o[a])return!0;return!1}inSameSubNetwork(e,t){return this.trees[e.id]===this.trees[t.id]}getLevels(){return ke(this.distributionOrdering)}addToOrdering(e,t){this.distributionOrdering[t]===void 0&&(this.distributionOrdering[t]=[]);let i=!1;const o=this.distributionOrdering[t];for(const n in o)if(o[n]===e){i=!0;break}i||(this.distributionOrdering[t].push(e),this.distributionIndex[e.id]=this.distributionOrdering[t].length-1)}}class vT{constructor(e){this.body=e,this._resetRNG(Math.random()+":"+rh()),this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,clusterThreshold:150,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:"UD",sortMethod:"hubsize"}},ge(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("_dataChanged",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",()=>{this.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",()=>{if(this.options.hierarchical.enabled!==!0)return;const e=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",e,!1)})}setOptions(e,t){if(e!==void 0){const i=this.options.hierarchical,o=i.enabled;if(tn(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),Ht(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),i.enabled===!0)return o===!0&&this.body.emitter.emit("refresh",!0),i.direction==="RL"||i.direction==="DU"?i.levelSeparation>0&&(i.levelSeparation*=-1):i.levelSeparation<0&&(i.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(o===!0)return this.body.emitter.emit("refresh"),ye(t,this.optionsBackup)}return t}_resetRNG(e){this.initialRandomSeed=e,this._rng=Ts(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){const t=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:t.enabled===void 0||t.enabled,solver:"hierarchicalRepulsion"},t.enabled=t.enabled===void 0||t.enabled,t.solver=t.solver||"barnesHut"):typeof e.physics=="object"?(t.enabled=e.physics.enabled===void 0||e.physics.enabled,t.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(t.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});let i=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if(typeof e.edges.smooth=="boolean")this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:i};else{const o=e.edges.smooth;o.type!==void 0&&o.type!=="dynamic"&&(i=o.type),this.optionsBackup.edges={smooth:{enabled:o.enabled===void 0||o.enabled,type:o.type===void 0?"dynamic":o.type,roundness:o.roundness===void 0?.5:o.roundness,forceDirection:o.forceDirection!==void 0&&o.forceDirection}},e.edges.smooth={enabled:o.enabled===void 0||o.enabled,type:i,roundness:o.roundness===void 0?.5:o.roundness,forceDirection:o.forceDirection!==void 0&&o.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",i)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);const t=e.length+50;for(let i=0;i<e.length;i++){const o=e[i],n=2*Math.PI*this._rng();o.x===void 0&&(o.x=t*Math.cos(n)),o.y===void 0&&(o.y=t*Math.sin(n))}}}layoutNetwork(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){const e=this.body.nodeIndices;let t=0;for(let i=0;i<e.length;i++)this.body.nodes[e[i]].predefinedPosition===!0&&(t+=1);if(t<.5*e.length){let o=0;const n=this.options.clusterThreshold,a={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>n){const p=e.length;for(;e.length>n&&o<=10;){o+=1;const v=e.length;if(o%3==0?this.body.modules.clustering.clusterBridges(a):this.body.modules.clustering.clusterOutliers(a),v==e.length&&o%3!=0)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*p)})}o>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();const d=70;for(let p=0;p<e.length;p++){const v=this.body.nodes[e[p]];v.predefinedPosition===!1&&(v.x+=(.5-this._rng())*d,v.y+=(.5-this._rng())*d)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}_shiftToCenter(){const e=rt.getRangeCore(this.body.nodes,this.body.nodeIndices),t=rt.findCenter(e);for(let i=0;i<this.body.nodeIndices.length;i++){const o=this.body.nodes[this.body.nodeIndices[i]];o.x-=t.x,o.y-=t.y}}_declusterAll(){let e=!0;for(;e===!0;){e=!1;for(let t=0;t<this.body.nodeIndices.length;t++)this.body.nodes[this.body.nodeIndices[t]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[t],{},!1));e===!0&&this.body.emitter.emit("_dataChanged")}}getSeed(){return this.initialRandomSeed}setupHierarchicalLayout(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){let e,t,i=!1,o=!1;for(t in this.lastNodeOnLevel={},this.hierarchical=new $b,this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level!==void 0?(i=!0,this.hierarchical.levels[t]=e.options.level):o=!0);if(o===!0&&i===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");{if(o===!0){const a=this.options.hierarchical.sortMethod;a==="hubsize"?this._determineLevelsByHubsize():a==="directed"?this._determineLevelsDirected():a==="custom"&&this._determineLevelsCustomCallback()}for(const a in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,a)&&this.hierarchical.ensureLevel(a);const n=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(n),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let t=!1;const i={},o=(C,I)=>{const M=this.hierarchical.trees;for(const L in M)Object.prototype.hasOwnProperty.call(M,L)&&M[L]===C&&this.direction.shift(L,I)},n=()=>{const C=[];for(let I=0;I<this.hierarchical.numTrees();I++)C.push(this.direction.getTreeSize(I));return C},a=(C,I)=>{if(!I[C.id]&&(I[C.id]=!0,this.hierarchical.childrenReference[C.id])){const M=this.hierarchical.childrenReference[C.id];if(M.length>0)for(let L=0;L<M.length;L++)a(this.body.nodes[M[L]],I)}},d=function(C){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,M=1e9,L=1e9,W=1e9,Y=-1e9;for(const pe in C)if(Object.prototype.hasOwnProperty.call(C,pe)){const He=e.body.nodes[pe],ct=e.hierarchical.levels[He.id],Xe=e.direction.getPosition(He),[bn,fr]=e._getSpaceAroundNode(He,C);M=Math.min(bn,M),L=Math.min(fr,L),ct<=I&&(W=Math.min(Xe,W),Y=Math.max(Xe,Y))}return[W,Y,M,L]},p=(C,I)=>{const M=this.hierarchical.getMaxLevel(C.id),L=this.hierarchical.getMaxLevel(I.id);return Math.min(M,L)},v=(C,I,M)=>{const L=this.hierarchical;for(let W=0;W<I.length;W++){const Y=I[W],pe=L.distributionOrdering[Y];if(pe.length>1)for(let He=0;He<pe.length-1;He++){const ct=pe[He],Xe=pe[He+1];L.hasSameParent(ct,Xe)&&L.inSameSubNetwork(ct,Xe)&&C(ct,Xe,M)}}},g=function(C,I){let M=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const L=e.direction.getPosition(C),W=e.direction.getPosition(I),Y=Math.abs(W-L),pe=e.options.hierarchical.nodeSpacing;if(Y>pe){const He={},ct={};a(C,He),a(I,ct);const Xe=p(C,I),bn=d(He,Xe),fr=d(ct,Xe),qe=bn[1],fe=fr[0],Te=fr[2];if(Math.abs(qe-fe)>pe){let Fe=qe-fe+pe;Fe<-Te+pe&&(Fe=-Te+pe),Fe<0&&(e._shiftBlock(I.id,Fe),t=!0,M===!0&&e._centerParent(I))}}},w=(C,I)=>{const M=I.id,L=I.edges,W=this.hierarchical.levels[I.id],Y=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,pe={},He=[];for(let qe=0;qe<L.length;qe++){const fe=L[qe];if(fe.toId!=fe.fromId){const Te=fe.toId==M?fe.from:fe.to;pe[L[qe].id]=Te,this.hierarchical.levels[Te.id]<W&&He.push(fe)}}const ct=(qe,fe)=>{let Te=0;for(let Fe=0;Fe<fe.length;Fe++)if(pe[fe[Fe].id]!==void 0){const ut=this.direction.getPosition(pe[fe[Fe].id])-qe;Te+=ut/Math.sqrt(ut*ut+Y)}return Te},Xe=(qe,fe)=>{let Te=0;for(let Fe=0;Fe<fe.length;Fe++)if(pe[fe[Fe].id]!==void 0){const ut=this.direction.getPosition(pe[fe[Fe].id])-qe;Te-=Y*Math.pow(ut*ut+Y,-1.5)}return Te},bn=(qe,fe)=>{let Te=this.direction.getPosition(I);const Fe={};for(let ut=0;ut<qe;ut++){const ni=ct(Te,fe),wn=Xe(Te,fe),ea=40;if(Te-=Math.max(-ea,Math.min(ea,Math.round(ni/wn))),Fe[Te]!==void 0)break;Fe[Te]=ut}return Te};let fr=bn(C,He);(qe=>{const fe=this.direction.getPosition(I);if(i[I.id]===void 0){const ea={};a(I,ea),i[I.id]=ea}const Te=d(i[I.id]),Fe=Te[2],ut=Te[3],ni=qe-fe;let wn=0;ni>0?wn=Math.min(ni,ut-this.options.hierarchical.nodeSpacing):ni<0&&(wn=-Math.min(-ni,Fe-this.options.hierarchical.nodeSpacing)),wn!=0&&(this._shiftBlock(I.id,wn),t=!0)})(fr),fr=bn(C,L),(qe=>{const fe=this.direction.getPosition(I),[Te,Fe]=this._getSpaceAroundNode(I),ut=qe-fe;let ni=fe;ut>0?ni=Math.min(fe+(Fe-this.options.hierarchical.nodeSpacing),qe):ut<0&&(ni=Math.max(fe-(Te-this.options.hierarchical.nodeSpacing),qe)),ni!==fe&&(this.direction.setPosition(I,ni),t=!0)})(fr)},_=C=>{let I=this.hierarchical.getLevels();I=Vr(I).call(I);for(let M=0;M<C;M++){t=!1;for(let L=0;L<I.length;L++){const W=I[L],Y=this.hierarchical.distributionOrdering[W];for(let pe=0;pe<Y.length;pe++)w(1e3,Y[pe])}if(t!==!0)break}},O=C=>{let I=this.hierarchical.getLevels();I=Vr(I).call(I);for(let M=0;M<C&&(t=!1,v(g,I,!0),t===!0);M++);},$=()=>{for(const C in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,C)&&this._centerParent(this.body.nodes[C])},P=()=>{let C=this.hierarchical.getLevels();C=Vr(C).call(C);for(let I=0;I<C.length;I++){const M=C[I],L=this.hierarchical.distributionOrdering[M];for(let W=0;W<L.length;W++)this._centerParent(L[W])}};this.options.hierarchical.blockShifting===!0&&(O(5),$()),this.options.hierarchical.edgeMinimization===!0&&_(20),this.options.hierarchical.parentCentralization===!0&&P(),(()=>{const C=n();let I=0;for(let M=0;M<C.length-1;M++)I+=C[M].max-C[M+1].min+this.options.hierarchical.treeSpacing,o(M+1,I)})()}_getSpaceAroundNode(e,t){let i=!0;t===void 0&&(i=!1);const o=this.hierarchical.levels[e.id];if(o!==void 0){const n=this.hierarchical.distributionIndex[e.id],a=this.direction.getPosition(e),d=this.hierarchical.distributionOrdering[o];let p=1e9,v=1e9;if(n!==0){const g=d[n-1];(i===!0&&t[g.id]===void 0||i===!1)&&(p=a-this.direction.getPosition(g))}if(n!=d.length-1){const g=d[n+1];if(i===!0&&t[g.id]===void 0||i===!1){const w=this.direction.getPosition(g);v=Math.min(v,w-a)}}return[p,v]}return[0,0]}_centerParent(e){if(this.hierarchical.parentReference[e.id]){const t=this.hierarchical.parentReference[e.id];for(let i=0;i<t.length;i++){const o=t[i],n=this.body.nodes[o],a=this.hierarchical.childrenReference[o];if(a!==void 0){const d=this._getCenterPosition(a),p=this.direction.getPosition(n),[v,g]=this._getSpaceAroundNode(n),w=p-d;(w<0&&Math.abs(w)<g-this.options.hierarchical.nodeSpacing||w>0&&Math.abs(w)<v-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(n,d)}}}}_placeNodesByHierarchy(e){this.positionedNodes={};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var t;let o=ke(e[i]);o=this._indexArrayToNodes(o),yn(t=this.direction).call(t,o);let n=0;for(let a=0;a<o.length;a++){const d=o[a];if(this.positionedNodes[d.id]===void 0){const p=this.options.hierarchical.nodeSpacing;let v=p*n;n>0&&(v=this.direction.getPosition(o[a-1])+p),this.direction.setPosition(d,v,i),this._validatePositionAndContinue(d,i,v),n++}}}}_placeBranchNodes(e,t){var i;const o=this.hierarchical.childrenReference[e];if(o===void 0)return;const n=[];for(let d=0;d<o.length;d++)n.push(this.body.nodes[o[d]]);yn(i=this.direction).call(i,n);for(let d=0;d<n.length;d++){const p=n[d],v=this.hierarchical.levels[p.id];if(!(v>t&&this.positionedNodes[p.id]===void 0))return;{const g=this.options.hierarchical.nodeSpacing;let w;w=d===0?this.direction.getPosition(this.body.nodes[e]):this.direction.getPosition(n[d-1])+g,this.direction.setPosition(p,w,v),this._validatePositionAndContinue(p,v,w)}}const a=this._getCenterPosition(n);this.direction.setPosition(this.body.nodes[e],a,t)}_validatePositionAndContinue(e,t,i){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){const o=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(i-o<this.options.hierarchical.nodeSpacing){const n=o+this.options.hierarchical.nodeSpacing-i,a=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(a.withChild,n)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}}_indexArrayToNodes(e){const t=[];for(let i=0;i<e.length;i++)t.push(this.body.nodes[e[i]]);return t}_getDistribution(){const e={};let t,i;for(t in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,t)){i=this.body.nodes[t];const o=this.hierarchical.levels[t]===void 0?0:this.hierarchical.levels[t];this.direction.fix(i,o),e[o]===void 0&&(e[o]={}),e[o][t]=i}return e}_getActiveEdges(e){const t=[];return se(e.edges,i=>{var o;ce(o=this.body.edgeIndices).call(o,i.id)!==-1&&t.push(i)}),t}_getHubSizes(){const e={};se(this.body.nodeIndices,i=>{const o=this.body.nodes[i],n=this._getActiveEdges(o).length;e[n]=!0});const t=[];return se(e,i=>{t.push(Number(i))}),yn(t).call(t,function(i,o){return o-i}),t}_determineLevelsByHubsize(){const e=(i,o)=>{this.hierarchical.levelDownstream(i,o)},t=this._getHubSizes();for(let i=0;i<t.length;++i){const o=t[i];if(o===0)break;se(this.body.nodeIndices,n=>{const a=this.body.nodes[n];o===this._getActiveEdges(a).length&&this._crawlNetwork(e,n)})}}_determineLevelsCustomCallback(){this._crawlNetwork((e,t,i)=>{let o=this.hierarchical.levels[e.id];o===void 0&&(o=this.hierarchical.levels[e.id]=1e5);const n=(rt.cloneOptions(e,"node"),rt.cloneOptions(t,"node"),void rt.cloneOptions(i,"edge"));this.hierarchical.levels[t.id]=o+n}),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;const t=Ob(e=this.body.nodeIndices).call(e,(i,o)=>(i.set(o,this.body.nodes[o]),i),new pu);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=function(i){return Ib(o=>{var n,a;return Tb(n=ft(a=o.edges).call(a,d=>i.has(d.toId))).call(n,d=>d.from===o)},(o,n)=>n<o,"to",i)}(t):this.hierarchical.levels=function(i){return Ib(o=>{var n,a;return Tb(n=ft(a=o.edges).call(a,d=>i.has(d.toId))).call(n,d=>d.to===o)},(o,n)=>n>o,"from",i)}(t),this.hierarchical.setMinLevelToZero()}_generateMap(){this._crawlNetwork((e,t)=>{this.hierarchical.levels[t.id]>this.hierarchical.levels[e.id]&&this.hierarchical.addRelation(e.id,t.id)}),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},t=arguments.length>1?arguments[1]:void 0;const i={},o=(n,a)=>{if(i[n.id]===void 0){let d;this.hierarchical.setTreeIndex(n,a),i[n.id]=!0;const p=this._getActiveEdges(n);for(let v=0;v<p.length;v++){const g=p[v];g.connected===!0&&(d=g.toId==n.id?g.from:g.to,n.id!=d.id&&(e(n,d,g),o(d,a)))}}};if(t===void 0){let n=0;for(let a=0;a<this.body.nodeIndices.length;a++){const d=this.body.nodeIndices[a];if(i[d]===void 0){const p=this.body.nodes[d];o(p,n),n+=1}}}else{const n=this.body.nodes[t];if(n===void 0)return void console.error("Node not found:",t);o(n)}}_shiftBlock(e,t){const i={},o=n=>{if(i[n])return;i[n]=!0,this.direction.shift(n,t);const a=this.hierarchical.childrenReference[n];if(a!==void 0)for(let d=0;d<a.length;d++)o(a[d])};o(e)}_findCommonParent(e,t){const i={},o=(a,d)=>{const p=this.hierarchical.parentReference[d];if(p!==void 0)for(let v=0;v<p.length;v++){const g=p[v];a[g]=!0,o(a,g)}},n=(a,d)=>{const p=this.hierarchical.parentReference[d];if(p!==void 0)for(let v=0;v<p.length;v++){const g=p[v];if(a[g]!==void 0)return{foundParent:g,withChild:d};const w=n(a,g);if(w.foundParent!==null)return w}return{foundParent:null,withChild:d}};return o(i,e),n(i,t)}setDirectionStrategy(){const e=this.options.hierarchical.direction==="UD"||this.options.hierarchical.direction==="DU";this.direction=e?new hT(this):new lT(this)}_getCenterPosition(e){let t=1e9,i=-1e9;for(let o=0;o<e.length;o++){let n;if(e[o].id!==void 0)n=e[o];else{const d=e[o];n=this.body.nodes[d]}const a=this.direction.getPosition(n);t=Math.min(t,a),i=Math.max(i,a)}return .5*(t+i)}}class gT{constructor(e,t,i,o){var n,a;this.body=e,this.canvas=t,this.selectionHandler=i,this.interactionHandler=o,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},ge(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",N(n=this._restore).call(n,this)),this.body.emitter.on("_resetData",N(a=this._restore).call(a,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,t,i){t!==void 0&&(t.locale!==void 0?this.options.locale=t.locale:this.options.locale=i.locale,t.locales!==void 0?this.options.locales=t.locales:this.options.locales=i.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,ye(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,t;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";const i=this.selectionHandler.getSelectedNodeCount(),o=this.selectionHandler.getSelectedEdgeCount(),n=i+o,a=this.options.locales[this.options.locale];let d=!1;this.options.addNode!==!1&&(this._createAddNodeButton(a),d=!0),this.options.addEdge!==!1&&(d===!0?this._createSeperator(1):d=!0,this._createAddEdgeButton(a)),i===1&&typeof this.options.editNode=="function"?(d===!0?this._createSeperator(2):d=!0,this._createEditNodeButton(a)):o===1&&i===0&&this.options.editEdge!==!1&&(d===!0?this._createSeperator(3):d=!0,this._createEditEdgeButton(a)),n!==0&&(i>0&&this.options.deleteNode!==!1||i===0&&this.options.deleteEdge!==!1)&&(d===!0&&this._createSeperator(4),this._createDeleteButton(a)),this._bindElementEvents(this.closeDiv,N(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",N(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t;const i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,N(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",N(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();const e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0){if(this.inMode="editNode",typeof this.options.editNode!="function")throw new Error("No function has been configured to handle the editing of nodes.");if(e.isCluster!==!0){const t=ye({},e.options,!1);if(t.x=e.x,t.y=e.y,this.options.editNode.length!==2)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(t,i=>{i!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(i),this.showManipulatorToolbar()})}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}addEdgeMode(){var e,t,i,o,n;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var a;const d=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(d),this._createSeperator(),this._createDescription(d.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,N(a=this.toggleEditMode).call(a,this))}this._temporaryBindUI("onTouch",N(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",N(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",N(i=this._dragControlNode).call(i,this)),this._temporaryBindUI("onRelease",N(o=this._finishConnect).call(o,this)),this._temporaryBindUI("onDragStart",N(n=this._dragStartEdge).call(n,this)),this._temporaryBindUI("onHold",()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",typeof this.options.editEdge!="object"||typeof this.options.editEdge.editWithoutDrag!="function"||(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId===void 0)){if(this.guiEnabled===!0){var e;const a=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(a),this._createSeperator(),this._createDescription(a.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,N(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var t,i,o,n;const a=this.body.edges[this.edgeBeingEditedId],d=this._getNewTargetNode(a.from.x,a.from.y),p=this._getNewTargetNode(a.to.x,a.to.y);this.temporaryIds.nodes.push(d.id),this.temporaryIds.nodes.push(p.id),this.body.nodes[d.id]=d,this.body.nodeIndices.push(d.id),this.body.nodes[p.id]=p,this.body.nodeIndices.push(p.id),this._temporaryBindUI("onTouch",N(t=this._controlNodeTouch).call(t,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",N(i=this._controlNodeDragStart).call(i,this)),this._temporaryBindUI("onDrag",N(o=this._controlNodeDrag).call(o,this)),this._temporaryBindUI("onDragEnd",N(n=this._controlNodeDragEnd).call(n,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",v=>{const g=a.edgeType.findBorderPositions(v);d.selected===!1&&(d.x=g.from.x,d.y=g.from.y),p.selected===!1&&(p.x=g.to.x,p.y=g.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}else{const a=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(a.from.id,a.to.id)}}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";const e=this.selectionHandler.getSelectedNodeIds(),t=this.selectionHandler.getSelectedEdgeIds();let i;if(e.length>0){for(let o=0;o<e.length;o++)if(this.body.nodes[e[o]].isCluster===!0)return void alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);typeof this.options.deleteNode=="function"&&(i=this.options.deleteNode)}else t.length>0&&typeof this.options.deleteEdge=="function"&&(i=this.options.deleteEdge);if(typeof i=="function"){const o={nodes:e,edges:t};if(i.length!==2)throw new Error("The function for delete does not support two arguments (data, callback)");i(o,n=>{n!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(n.edges),this.body.data.nodes.getDataSet().remove(n.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().remove(t),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){var e,t;this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0&&(this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(t=this.options.locales[this.options.locale])===null||t===void 0?void 0:t.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}_getNewTargetNode(e,t){const i=ye({},this.options.controlNodeStyle);i.id="targetNode"+Ws(),i.hidden=!1,i.physics=!1,i.x=e,i.y=t;const o=this.body.functions.createNode(i);return o.shape.boundingBox={left:e,right:e,top:t,bottom:t},o}_createEditButton(){var e;this._clean(),this.manipulationDOM={},ir(this.editModeDiv);const t=this.options.locales[this.options.locale],i=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(i),this._bindElementEvents(i,N(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(ir(this.editModeDiv),ir(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(const t of Ti(e=this._domEventListenerCleanupQueue).call(e,0)){var e;t()}}_removeManipulationDOM(){this._clean(),ir(this.manipulationDiv),ir(this.editModeDiv),ir(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}_createAddNodeButton(e){var t;const i=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,N(t=this.addNodeMode).call(t,this))}_createAddEdgeButton(e){var t;const i=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,N(t=this.addEdgeMode).call(t,this))}_createEditNodeButton(e){var t;const i=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,N(t=this.editNode).call(t,this))}_createEditEdgeButton(e){var t;const i=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,N(t=this.editEdgeMode).call(t,this))}_createDeleteButton(e){var t;let i;i=this.options.rtl?"vis-delete-rtl":"vis-delete";const o=this._createButton("delete",i,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(o),this._bindElementEvents(o,N(t=this.deleteSelected).call(t,this))}_createBackButton(e){var t;const i=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,N(t=this.showManipulatorToolbar).call(t,this))}_createButton(e,t,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("button"),this.manipulationDOM[e+"Div"].className="vis-button "+t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=o,this.manipulationDOM[e+"Label"].innerText=i,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}_createDescription(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}_temporaryBindUI(e,t){if(this.body.eventListeners[e]===void 0)throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+gs(ke(this.body.eventListeners)));this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t}_unbindTemporaryUIs(){for(const e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let e=0;e<this.temporaryEventFunctions.length;e++){const t=this.temporaryEventFunctions[e].event,i=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,i)}this.temporaryEventFunctions=[]}_bindElementEvents(e,t){const i=new on(e,{});Gh(i,t),this._domEventListenerCleanupQueue.push(()=>{i.destroy()});const o=n=>{let{keyCode:a,key:d}=n;d!=="Enter"&&d!==" "&&a!==13&&a!==32||t()};e.addEventListener("keyup",o,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener("keyup",o,!1)})}_cleanupTemporaryNodesAndEdges(){for(let n=0;n<this.temporaryIds.edges.length;n++){var e;this.body.edges[this.temporaryIds.edges[n]].disconnect(),delete this.body.edges[this.temporaryIds.edges[n]];const a=ce(e=this.body.edgeIndices).call(e,this.temporaryIds.edges[n]);var t;a!==-1&&Ti(t=this.body.edgeIndices).call(t,a,1)}for(let n=0;n<this.temporaryIds.nodes.length;n++){var i;delete this.body.nodes[this.temporaryIds.nodes[n]];const a=ce(i=this.body.nodeIndices).call(i,this.temporaryIds.nodes[n]);var o;a!==-1&&Ti(o=this.body.nodeIndices).call(o,a,1)}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=ge({},this.body.view.translation)}_controlNodeDragStart(){const e=this.lastTouch,t=this.selectionHandler._pointerToPositionObject(e),i=this.body.nodes[this.temporaryIds.nodes[0]],o=this.body.nodes[this.temporaryIds.nodes[1]],n=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;const a=i.isOverlappingWith(t),d=o.isOverlappingWith(t);a===!0?(this.selectedControlNode=i,n.edgeType.from=i):d===!0&&(this.selectedControlNode=o,n.edgeType.to=o),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}_controlNodeDrag(e){this.body.emitter.emit("disablePhysics");const t=this.body.functions.getPointer(e.center),i=this.canvas.DOMtoCanvas(t);this.selectedControlNode!==void 0?(this.selectedControlNode.x=i.x,this.selectedControlNode.y=i.y):this.interactionHandler.onDrag(e),this.body.emitter.emit("_redraw")}_controlNodeDragEnd(e){const t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t),o=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();const n=this.selectionHandler._getAllNodesOverlappingWith(i);let a;for(let d=n.length-1;d>=0;d--)if(n[d]!==this.selectedControlNode.id){a=this.body.nodes[n[d]];break}if(a!==void 0&&this.selectedControlNode!==void 0)if(a.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const d=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===d.id?this._performEditEdge(a.id,o.to.id):this._performEditEdge(o.from.id,a.id)}else o.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=ge({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;const t=this.lastTouch,i=this.selectionHandler.getNodeAt(t);if(i!==void 0)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const o=this._getNewTargetNode(i.x,i.y);this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id);const n=this.body.functions.createEdge({id:"connectionEdge"+Ws(),from:i.id,to:o.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[n.id]=n,this.body.edgeIndices.push(n.id),this.temporaryIds.nodes.push(o.id),this.temporaryIds.edges.push(n.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){const t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t);let o;this.temporaryIds.edges[0]!==void 0&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);const n=this.selectionHandler._getAllNodesOverlappingWith(i);let a;for(let p=n.length-1;p>=0;p--){var d;if(ce(d=this.temporaryIds.nodes).call(d,n[p])===-1){a=this.body.nodes[n[p]];break}}if(e.controlEdge={from:o,to:a?a.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,t),this.temporaryIds.nodes[0]!==void 0){const p=this.body.nodes[this.temporaryIds.nodes[0]];p.x=this.canvas._XconvertDOMtoCanvas(t.x),p.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}_finishConnect(e){const t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t);let o;this.temporaryIds.edges[0]!==void 0&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);const n=this.selectionHandler._getAllNodesOverlappingWith(i);let a;for(let p=n.length-1;p>=0;p--){var d;if(ce(d=this.temporaryIds.nodes).call(d,n[p])===-1){a=this.body.nodes[n[p]];break}}this._cleanupTemporaryNodesAndEdges(),a!==void 0&&(a.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[o]!==void 0&&this.body.nodes[a.id]!==void 0&&this._performAddEdge(o,a.id)),e.controlEdge={from:o,to:a?a.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,t),this.body.emitter.emit("_redraw")}_dragStartEdge(e){const t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,t,void 0,!0)}_performAddNode(e){const t={id:Ws(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function"){if(this.options.addNode.length!==2)throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(t,i=>{i!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()})}else this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()}_performAddEdge(e,t){const i={from:e,to:t};if(typeof this.options.addEdge=="function"){if(this.options.addEdge.length!==2)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(i,o=>{o!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().add(i),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,t){const i={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label};let o=this.options.editEdge;if(typeof o=="object"&&(o=o.editWithoutDrag),typeof o=="function"){if(o.length!==2)throw new Error("The function for edit does not support two arguments (data, callback)");o(i,n=>{n==null||this.inMode!=="editEdge"?(this.body.edges[i.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().update(i),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}const B="string",R="boolean",D="number",Zs="array",q="object",Qu=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],Ju={borderWidth:{number:D},borderWidthSelected:{number:D,undefined:"undefined"},brokenImage:{string:B,undefined:"undefined"},chosen:{label:{boolean:R,function:"function"},node:{boolean:R,function:"function"},__type__:{object:q,boolean:R}},color:{border:{string:B},background:{string:B},highlight:{border:{string:B},background:{string:B},__type__:{object:q,string:B}},hover:{border:{string:B},background:{string:B},__type__:{object:q,string:B}},__type__:{object:q,string:B}},opacity:{number:D,undefined:"undefined"},fixed:{x:{boolean:R},y:{boolean:R},__type__:{object:q,boolean:R}},font:{align:{string:B},color:{string:B},size:{number:D},face:{string:B},background:{string:B},strokeWidth:{number:D},strokeColor:{string:B},vadjust:{number:D},multi:{boolean:R,string:B},bold:{color:{string:B},size:{number:D},face:{string:B},mod:{string:B},vadjust:{number:D},__type__:{object:q,string:B}},boldital:{color:{string:B},size:{number:D},face:{string:B},mod:{string:B},vadjust:{number:D},__type__:{object:q,string:B}},ital:{color:{string:B},size:{number:D},face:{string:B},mod:{string:B},vadjust:{number:D},__type__:{object:q,string:B}},mono:{color:{string:B},size:{number:D},face:{string:B},mod:{string:B},vadjust:{number:D},__type__:{object:q,string:B}},__type__:{object:q,string:B}},group:{string:B,number:D,undefined:"undefined"},heightConstraint:{minimum:{number:D},valign:{string:B},__type__:{object:q,boolean:R,number:D}},hidden:{boolean:R},icon:{face:{string:B},code:{string:B},size:{number:D},color:{string:B},weight:{string:B,number:D},__type__:{object:q}},id:{string:B,number:D},image:{selected:{string:B,undefined:"undefined"},unselected:{string:B,undefined:"undefined"},__type__:{object:q,string:B}},imagePadding:{top:{number:D},right:{number:D},bottom:{number:D},left:{number:D},__type__:{object:q,number:D}},label:{string:B,undefined:"undefined"},labelHighlightBold:{boolean:R},level:{number:D,undefined:"undefined"},margin:{top:{number:D},right:{number:D},bottom:{number:D},left:{number:D},__type__:{object:q,number:D}},mass:{number:D},physics:{boolean:R},scaling:{min:{number:D},max:{number:D},label:{enabled:{boolean:R},min:{number:D},max:{number:D},maxVisible:{number:D},drawThreshold:{number:D},__type__:{object:q,boolean:R}},customScalingFunction:{function:"function"},__type__:{object:q}},shadow:{enabled:{boolean:R},color:{string:B},size:{number:D},x:{number:D},y:{number:D},__type__:{object:q,boolean:R}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:R,array:Zs},borderRadius:{number:D},interpolation:{boolean:R},useImageSize:{boolean:R},useBorderWithImage:{boolean:R},coordinateOrigin:{string:["center","top-left"]},__type__:{object:q}},size:{number:D},title:{string:B,dom:"dom",undefined:"undefined"},value:{number:D,undefined:"undefined"},widthConstraint:{minimum:{number:D},maximum:{number:D},__type__:{object:q,boolean:R,number:D}},x:{number:D},y:{number:D},__type__:{object:q}},Cb={configure:{enabled:{boolean:R},filter:{boolean:R,string:B,array:Zs,function:"function"},container:{dom:"dom"},showButton:{boolean:R},__type__:{object:q,boolean:R,string:B,array:Zs,function:"function"}},edges:{arrows:{to:{enabled:{boolean:R},scaleFactor:{number:D},type:{string:Qu},imageHeight:{number:D},imageWidth:{number:D},src:{string:B},__type__:{object:q,boolean:R}},middle:{enabled:{boolean:R},scaleFactor:{number:D},type:{string:Qu},imageWidth:{number:D},imageHeight:{number:D},src:{string:B},__type__:{object:q,boolean:R}},from:{enabled:{boolean:R},scaleFactor:{number:D},type:{string:Qu},imageWidth:{number:D},imageHeight:{number:D},src:{string:B},__type__:{object:q,boolean:R}},__type__:{string:["from","to","middle"],object:q}},endPointOffset:{from:{number:D},to:{number:D},__type__:{object:q,number:D}},arrowStrikethrough:{boolean:R},background:{enabled:{boolean:R},color:{string:B},size:{number:D},dashes:{boolean:R,array:Zs},__type__:{object:q,boolean:R}},chosen:{label:{boolean:R,function:"function"},edge:{boolean:R,function:"function"},__type__:{object:q,boolean:R}},color:{color:{string:B},highlight:{string:B},hover:{string:B},inherit:{string:["from","to","both"],boolean:R},opacity:{number:D},__type__:{object:q,string:B}},dashes:{boolean:R,array:Zs},font:{color:{string:B},size:{number:D},face:{string:B},background:{string:B},strokeWidth:{number:D},strokeColor:{string:B},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:D},multi:{boolean:R,string:B},bold:{color:{string:B},size:{number:D},face:{string:B},mod:{string:B},vadjust:{number:D},__type__:{object:q,string:B}},boldital:{color:{string:B},size:{number:D},face:{string:B},mod:{string:B},vadjust:{number:D},__type__:{object:q,string:B}},ital:{color:{string:B},size:{number:D},face:{string:B},mod:{string:B},vadjust:{number:D},__type__:{object:q,string:B}},mono:{color:{string:B},size:{number:D},face:{string:B},mod:{string:B},vadjust:{number:D},__type__:{object:q,string:B}},__type__:{object:q,string:B}},hidden:{boolean:R},hoverWidth:{function:"function",number:D},label:{string:B,undefined:"undefined"},labelHighlightBold:{boolean:R},length:{number:D,undefined:"undefined"},physics:{boolean:R},scaling:{min:{number:D},max:{number:D},label:{enabled:{boolean:R},min:{number:D},max:{number:D},maxVisible:{number:D},drawThreshold:{number:D},__type__:{object:q,boolean:R}},customScalingFunction:{function:"function"},__type__:{object:q}},selectionWidth:{function:"function",number:D},selfReferenceSize:{number:D},selfReference:{size:{number:D},angle:{number:D},renderBehindTheNode:{boolean:R},__type__:{object:q}},shadow:{enabled:{boolean:R},color:{string:B},size:{number:D},x:{number:D},y:{number:D},__type__:{object:q,boolean:R}},smooth:{enabled:{boolean:R},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:D},forceDirection:{string:["horizontal","vertical","none"],boolean:R},__type__:{object:q,boolean:R}},title:{string:B,undefined:"undefined"},width:{number:D},widthConstraint:{maximum:{number:D},__type__:{object:q,boolean:R,number:D}},value:{number:D,undefined:"undefined"},__type__:{object:q}},groups:{useDefaultGroups:{boolean:R},__any__:Ju,__type__:{object:q}},interaction:{dragNodes:{boolean:R},dragView:{boolean:R},hideEdgesOnDrag:{boolean:R},hideEdgesOnZoom:{boolean:R},hideNodesOnDrag:{boolean:R},hover:{boolean:R},keyboard:{enabled:{boolean:R},speed:{x:{number:D},y:{number:D},zoom:{number:D},__type__:{object:q}},bindToWindow:{boolean:R},autoFocus:{boolean:R},__type__:{object:q,boolean:R}},multiselect:{boolean:R},navigationButtons:{boolean:R},selectable:{boolean:R},selectConnectedEdges:{boolean:R},hoverConnectedEdges:{boolean:R},tooltipDelay:{number:D},zoomView:{boolean:R},zoomSpeed:{number:D},__type__:{object:q}},layout:{randomSeed:{undefined:"undefined",number:D,string:B},improvedLayout:{boolean:R},clusterThreshold:{number:D},hierarchical:{enabled:{boolean:R},levelSeparation:{number:D},nodeSpacing:{number:D},treeSpacing:{number:D},blockShifting:{boolean:R},edgeMinimization:{boolean:R},parentCentralization:{boolean:R},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:q,boolean:R}},__type__:{object:q}},manipulation:{enabled:{boolean:R},initiallyActive:{boolean:R},addNode:{boolean:R,function:"function"},addEdge:{boolean:R,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:q,boolean:R,function:"function"}},deleteNode:{boolean:R,function:"function"},deleteEdge:{boolean:R,function:"function"},controlNodeStyle:Ju,__type__:{object:q,boolean:R}},nodes:Ju,physics:{enabled:{boolean:R},barnesHut:{theta:{number:D},gravitationalConstant:{number:D},centralGravity:{number:D},springLength:{number:D},springConstant:{number:D},damping:{number:D},avoidOverlap:{number:D},__type__:{object:q}},forceAtlas2Based:{theta:{number:D},gravitationalConstant:{number:D},centralGravity:{number:D},springLength:{number:D},springConstant:{number:D},damping:{number:D},avoidOverlap:{number:D},__type__:{object:q}},repulsion:{centralGravity:{number:D},springLength:{number:D},springConstant:{number:D},nodeDistance:{number:D},damping:{number:D},__type__:{object:q}},hierarchicalRepulsion:{centralGravity:{number:D},springLength:{number:D},springConstant:{number:D},nodeDistance:{number:D},damping:{number:D},avoidOverlap:{number:D},__type__:{object:q}},maxVelocity:{number:D},minVelocity:{number:D},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:R},iterations:{number:D},updateInterval:{number:D},onlyDynamicEdges:{boolean:R},fit:{boolean:R},__type__:{object:q,boolean:R}},timestep:{number:D},adaptiveTimestep:{boolean:R},wind:{x:{number:D},y:{number:D},__type__:{object:q}},__type__:{object:q,boolean:R}},autoResize:{boolean:R},clickToUse:{boolean:R},locale:{string:B},locales:{__any__:{any:"any"},__type__:{object:q}},height:{string:B},width:{string:B},__type__:{object:q}},Zu={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},ep=(r,e,t)=>{var i;return!(!Ji(r).call(r,"physics")||!Ji(i=Zu.physics.solver).call(i,e)||t.physics.solver===e||e==="wind")};var tp=Object.freeze({__proto__:null,allOptions:Cb,configuratorHideOption:ep,configureOptions:Zu});class mT{constructor(){}getDistances(e,t,i){const o={},n=e.edges;for(let d=0;d<t.length;d++){const p={};o[t[d]]=p;for(let v=0;v<t.length;v++)p[t[v]]=d==v?0:1e9}for(let d=0;d<i.length;d++){const p=n[i[d]];p.connected===!0&&o[p.fromId]!==void 0&&o[p.toId]!==void 0&&(o[p.fromId][p.toId]=1,o[p.toId][p.fromId]=1)}const a=t.length;for(let d=0;d<a;d++){const p=t[d],v=o[p];for(let g=0;g<a-1;g++){const w=t[g],_=o[w];for(let O=g+1;O<a;O++){const $=t[O],P=o[$],C=Math.min(_[$],_[p]+v[$]);_[$]=C,P[w]=C}}}return o}}class yT{constructor(e,t,i){this.body=e,this.springLength=t,this.springConstant=i,this.distanceSolver=new mT}setOptions(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}solve(e,t){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const o=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(o),this._createK_matrix(o),this._createE_matrix();let n=0;const a=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3));let d=1e9,p=0,v=0,g=0,w=0,_=0;for(;d>.01&&n<a;)for(n+=1,[p,d,v,g]=this._getHighestEnergyNode(i),w=d,_=0;w>1&&_<5;)_+=1,this._moveNode(p,v,g),[w,v,g]=this._getEnergy(p)}_getHighestEnergyNode(e){const t=this.body.nodeIndices,i=this.body.nodes;let o=0,n=t[0],a=0,d=0;for(let p=0;p<t.length;p++){const v=t[p];if(i[v].predefinedPosition!==!0||i[v].isCluster===!0&&e===!0||i[v].options.fixed.x!==!0||i[v].options.fixed.y!==!0){const[g,w,_]=this._getEnergy(v);o<g&&(o=g,n=v,a=w,d=_)}}return[n,o,a,d]}_getEnergy(e){const[t,i]=this.E_sums[e];return[Math.sqrt(t**2+i**2),t,i]}_moveNode(e,t,i){const o=this.body.nodeIndices,n=this.body.nodes;let a=0,d=0,p=0;const v=n[e].x,g=n[e].y,w=this.K_matrix[e],_=this.L_matrix[e];for(let P=0;P<o.length;P++){const C=o[P];if(C!==e){const I=n[C].x,M=n[C].y,L=w[C],W=_[C],Y=1/((v-I)**2+(g-M)**2)**1.5;a+=L*(1-W*(g-M)**2*Y),d+=L*(W*(v-I)*(g-M)*Y),p+=L*(1-W*(v-I)**2*Y)}}const O=(t/a+i/d)/(d/a-p/d),$=-(d*O+t)/a;n[e].x+=$,n[e].y+=O,this._updateE_matrix(e)}_createL_matrix(e){const t=this.body.nodeIndices,i=this.springLength;this.L_matrix=[];for(let o=0;o<t.length;o++){this.L_matrix[t[o]]={};for(let n=0;n<t.length;n++)this.L_matrix[t[o]][t[n]]=i*e[t[o]][t[n]]}}_createK_matrix(e){const t=this.body.nodeIndices,i=this.springConstant;this.K_matrix=[];for(let o=0;o<t.length;o++){this.K_matrix[t[o]]={};for(let n=0;n<t.length;n++)this.K_matrix[t[o]][t[n]]=i*e[t[o]][t[n]]**-2}}_createE_matrix(){const e=this.body.nodeIndices,t=this.body.nodes;this.E_matrix={},this.E_sums={};for(let i=0;i<e.length;i++)this.E_matrix[e[i]]=[];for(let i=0;i<e.length;i++){const o=e[i],n=t[o].x,a=t[o].y;let d=0,p=0;for(let v=i;v<e.length;v++){const g=e[v];if(g!==o){const w=t[g].x,_=t[g].y,O=1/Math.sqrt((n-w)**2+(a-_)**2);this.E_matrix[o][v]=[this.K_matrix[o][g]*(n-w-this.L_matrix[o][g]*(n-w)*O),this.K_matrix[o][g]*(a-_-this.L_matrix[o][g]*(a-_)*O)],this.E_matrix[g][i]=this.E_matrix[o][v],d+=this.E_matrix[o][v][0],p+=this.E_matrix[o][v][1]}}this.E_sums[o]=[d,p]}}_updateE_matrix(e){const t=this.body.nodeIndices,i=this.body.nodes,o=this.E_matrix[e],n=this.K_matrix[e],a=this.L_matrix[e],d=i[e].x,p=i[e].y;let v=0,g=0;for(let w=0;w<t.length;w++){const _=t[w];if(_!==e){const O=o[w],$=O[0],P=O[1],C=i[_].x,I=i[_].y,M=1/Math.sqrt((d-C)**2+(p-I)**2),L=n[_]*(d-C-a[_]*(d-C)*M),W=n[_]*(p-I-a[_]*(p-I)*M);o[w]=[L,W],v+=L,g+=W;const Y=this.E_sums[_];Y[0]+=L-$,Y[1]+=W-P}}this.E_sums[e]=[v,g]}}function U(r,e,t){var i,o,n,a;if(!(this instanceof U))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:_O,clickToUse:!1},ge(this.options,this.defaultOptions),this.body={container:r,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:N(i=this.on).call(i,this),off:N(o=this.off).call(o,this),emit:N(n=this.emit).call(n,this),once:N(a=this.once).call(a,this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}},selectionBox:{show:!1,position:{start:{x:0,y:0},end:{x:0,y:0}}}},this.bindEventListeners(),this.images=new bm(()=>this.body.emitter.emit("_requestRedraw")),this.groups=new Tx,this.canvas=new kS(this.body),this.selectionHandler=new FS(this.body,this.canvas),this.interactionHandler=new vn(this.body,this.canvas,this.selectionHandler),this.view=new fn(this.body,this.canvas),this.renderer=new jy(this.body,this.canvas),this.physics=new IS(this.body),this.layoutEngine=new vT(this.body),this.clustering=new By(this.body),this.manipulation=new gT(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new Hh(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new uo(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new yT(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(t),this.setData(e)}tf(U.prototype),U.prototype.setOptions=function(r){if(r===null&&(r=void 0),r!==void 0){if(vO.validate(r,Cb)===!0&&console.error("%cErrors have been found in the supplied options object.",lm),tn(["locale","locales","clickToUse"],this.options,r),r.locale!==void 0&&(r.locale=function(e,t){try{const[o,n]=t.split(/[-_ /]/,2),a=o!=null?o.toLowerCase():null,d=n!=null?n.toUpperCase():null;if(a&&d){const p=a+"-"+d;if(Object.prototype.hasOwnProperty.call(e,p))return p;var i;console.warn(_c(i="Unknown variant ".concat(d," of language ")).call(i,a,"."))}if(a){const p=a;if(Object.prototype.hasOwnProperty.call(e,p))return p;console.warn("Unknown language ".concat(a))}return console.warn("Unknown locale ".concat(t,", falling back to English.")),"en"}catch(o){return console.error(o),console.warn("Unexpected error while normalizing locale ".concat(t,", falling back to English.")),"en"}}(r.locales||this.options.locales,r.locale)),r=this.layoutEngine.setOptions(r.layout,r),this.canvas.setOptions(r),this.groups.setOptions(r.groups),this.nodesHandler.setOptions(r.nodes),this.edgesHandler.setOptions(r.edges),this.physics.setOptions(r.physics),this.manipulation.setOptions(r.manipulation,r,this.options),this.interactionHandler.setOptions(r.interaction),this.renderer.setOptions(r.interaction),this.selectionHandler.setOptions(r.interaction),r.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in r&&(this.configurator||(this.configurator=new pO(this,this.body.container,Zu,this.canvas.pixelRatio,ep)),this.configurator.setOptions(r.configure)),this.configurator&&this.configurator.options.enabled===!0){const e={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};ye(e.nodes,this.nodesHandler.options),ye(e.edges,this.edgesHandler.options),ye(e.layout,this.layoutEngine.options),ye(e.interaction,this.selectionHandler.options),ye(e.interaction,this.renderer.options),ye(e.interaction,this.interactionHandler.options),ye(e.manipulation,this.manipulation.options),ye(e.physics,this.physics.options),ye(e.global,this.canvas.options),ye(e.global,this.options),this.configurator.setModuleOptions(e)}r.clickToUse!==void 0?r.clickToUse===!0?this.activator===void 0&&(this.activator=new hm(this.canvas.frame),this.activator.on("change",()=>{this.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},U.prototype._updateVisibleIndices=function(){const r=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&(this.clustering._isClusteredNode(t)||r[t].options.hidden!==!1||this.body.nodeIndices.push(r[t].id));for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const i=e[t],o=r[i.fromId],n=r[i.toId],a=o!==void 0&&n!==void 0;!this.clustering._isClusteredEdge(t)&&i.options.hidden===!1&&a&&o.options.hidden===!1&&n.options.hidden===!1&&this.body.edgeIndices.push(i.id)}},U.prototype.bindEventListeners=function(){this.body.emitter.on("_dataChanged",()=>{this.edgesHandler._updateState(),this.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit("startSimulation"),this.body.emitter.emit("_requestRedraw")})},U.prototype.setData=function(r){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),r&&r.dot&&(r.nodes||r.edges))throw new SyntaxError('Data must contain either parameter "dot" or  parameter pair "nodes" and "edges", but not both.');if(this.setOptions(r&&r.options),r&&r.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");const e=Xc(r.dot);this.setData(e)}else if(r&&r.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");const e=Ih(r.gephi);this.setData(e)}else this.nodesHandler.setData(r&&r.nodes,!0),this.edgesHandler.setData(r&&r.edges,!0),this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},U.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(const r in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,r)&&delete this.body.nodes[r];for(const r in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,r)&&delete this.body.edges[r];ir(this.body.container)},U.prototype._updateValueRange=function(r){let e,t,i,o=0;for(e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const n=r[e].getValue();n!==void 0&&(t=t===void 0?n:Math.min(n,t),i=i===void 0?n:Math.max(n,i),o+=n)}if(t!==void 0&&i!==void 0)for(e in r)Object.prototype.hasOwnProperty.call(r,e)&&r[e].setValueRange(t,i,o)},U.prototype.isActive=function(){return!this.activator||this.activator.active},U.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},U.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},U.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},U.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},U.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},U.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},U.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},U.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},U.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},U.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},U.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)},U.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)},U.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)},U.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)},U.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)},U.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},U.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},U.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},U.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},U.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},U.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},U.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},U.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},U.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},U.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},U.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},U.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)},U.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},U.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},U.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},U.prototype.getConnectedNodes=function(r){return this.body.nodes[r]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)},U.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},U.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},U.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},U.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},U.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},U.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},U.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)},U.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)},U.prototype.getNodeAt=function(){const r=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return r!==void 0&&r.id!==void 0?r.id:r},U.prototype.getEdgeAt=function(){const r=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return r!==void 0&&r.id!==void 0?r.id:r},U.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},U.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},U.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()},U.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},U.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},U.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},U.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},U.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},U.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},U.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},U.prototype.getOptionsFromConfigurator=function(){let r={};return this.configurator&&(r=this.configurator.getOptions.apply(this.configurator)),r};const bT=Xc;nt.Network=U,nt.NetworkImages=bm,nt.networkDOTParser=bO,nt.networkGephiParser=wO,nt.networkOptions=tp,nt.parseDOTNetwork=bT,nt.parseGephiNetwork=Ih})}}]);

//# sourceMappingURL=vis-network.6c7a01c6f8009d61ab10.js.map