import{r as Qr,j as Ae,Z as fM,bj as vM}from"./main-BzPVmAp-.js";/**
 * 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 pa(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var pl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function G(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var QP={exports:{}},vs=function(i){return i&&i.Math===Math&&i},we=vs(typeof globalThis=="object"&&globalThis)||vs(typeof window=="object"&&window)||vs(typeof self=="object"&&self)||vs(typeof pl=="object"&&pl)||function(){return this}()||pl||Function("return this")(),ae=function(i){try{return!!i()}catch{return!0}},pM=ae,Po=!pM(function(){var i=(function(){}).bind();return typeof i!="function"||i.hasOwnProperty("prototype")}),gM=Po,eC=Function.prototype,Qy=eC.apply,em=eC.call,bn=typeof Reflect=="object"&&Reflect.apply||(gM?em.bind(Qy):function(){return em.apply(Qy,arguments)}),tC=Po,rC=Function.prototype,Np=rC.call,yM=tC&&rC.bind.bind(Np,Np),ye=tC?yM:function(i){return function(){return Np.apply(i,arguments)}},iC=ye,mM=iC({}.toString),bM=iC("".slice),zr=function(i){return bM(mM(i),8,-1)},wM=zr,_M=ye,nC=function(i){if(wM(i)==="Function")return _M(i)},kp=typeof document=="object"&&document.all,EM=typeof kp>"u"&&kp!==void 0,oC={all:kp,IS_HTMLDDA:EM},sC=oC,SM=sC.all,Ce=sC.IS_HTMLDDA?function(i){return typeof i=="function"||i===SM}:function(i){return typeof i=="function"},wi={},$M=ae,Ue=!$M(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),OM=Po,ps=Function.prototype.call,Ve=OM?ps.bind(ps):function(){return ps.apply(ps,arguments)},ga={},aC={}.propertyIsEnumerable,lC=Object.getOwnPropertyDescriptor,IM=lC&&!aC.call({1:2},1);ga.f=IM?function(e){var t=lC(this,e);return!!t&&t.enumerable}:aC;var _i=function(i,e){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:e}},TM=ye,PM=ae,CM=zr,gl=Object,RM=TM("".split),ya=PM(function(){return!gl("z").propertyIsEnumerable(0)})?function(i){return CM(i)==="String"?RM(i,""):gl(i)}:gl,wn=function(i){return i==null},xM=wn,DM=TypeError,Og=function(i){if(xM(i))throw new DM("Can't call method on "+i);return i},AM=ya,MM=Og,ir=function(i){return AM(MM(i))},tm=Ce,uC=oC,NM=uC.all,Je=uC.IS_HTMLDDA?function(i){return typeof i=="object"?i!==null:tm(i)||i===NM}:function(i){return typeof i=="object"?i!==null:tm(i)},_e={},yl=_e,ml=we,kM=Ce,rm=function(i){return kM(i)?i:void 0},at=function(i,e){return arguments.length<2?rm(yl[i])||rm(ml[i]):yl[i]&&yl[i][e]||ml[i]&&ml[i][e]},FM=ye,Fe=FM({}.isPrototypeOf),Wr=typeof navigator<"u"&&String(navigator.userAgent)||"",dC=we,bl=Wr,im=dC.process,nm=dC.Deno,om=im&&im.versions||nm&&nm.version,sm=om&&om.v8,Lt,Ks;sm&&(Lt=sm.split("."),Ks=Lt[0]>0&&Lt[0]<4?1:+(Lt[0]+Lt[1]));!Ks&&bl&&(Lt=bl.match(/Edge\/(\d+)/),(!Lt||Lt[1]>=74)&&(Lt=bl.match(/Chrome\/(\d+)/),Lt&&(Ks=+Lt[1])));var _n=Ks,am=_n,qM=ae,BM=we,jM=BM.String,En=!!Object.getOwnPropertySymbols&&!qM(function(){var i=Symbol("symbol detection");return!jM(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&am&&am<41}),LM=En,cC=LM&&!Symbol.sham&&typeof Symbol.iterator=="symbol",zM=at,WM=Ce,HM=Fe,UM=cC,VM=Object,Co=UM?function(i){return typeof i=="symbol"}:function(i){var e=zM("Symbol");return WM(e)&&HM(e.prototype,VM(i))},GM=String,Sn=function(i){try{return GM(i)}catch{return"Object"}},KM=Ce,YM=Sn,XM=TypeError,bt=function(i){if(KM(i))return i;throw new XM(YM(i)+" is not a function")},JM=bt,ZM=wn,Ig=function(i,e){var t=i[e];return ZM(t)?void 0:JM(t)},wl=Ve,_l=Ce,El=Je,QM=TypeError,eN=function(i,e){var t,r;if(e==="string"&&_l(t=i.toString)&&!El(r=wl(t,i))||_l(t=i.valueOf)&&!El(r=wl(t,i))||e!=="string"&&_l(t=i.toString)&&!El(r=wl(t,i)))return r;throw new QM("Can't convert object to primitive value")},hC={exports:{}},tN=!0,lm=we,rN=Object.defineProperty,iN=function(i,e){try{rN(lm,i,{value:e,configurable:!0,writable:!0})}catch{lm[i]=e}return e},nN=we,oN=iN,um="__core-js_shared__",sN=nN[um]||oN(um,{}),Tg=sN,dm=Tg;(hC.exports=function(i,e){return dm[i]||(dm[i]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.2",mode:"pure",copyright:"© 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 $n=hC.exports,aN=Og,lN=Object,wt=function(i){return lN(aN(i))},uN=ye,dN=wt,cN=uN({}.hasOwnProperty),qe=Object.hasOwn||function(e,t){return cN(dN(e),t)},hN=ye,fN=0,vN=Math.random(),pN=hN(1 .toString),ma=function(i){return"Symbol("+(i===void 0?"":i)+")_"+pN(++fN+vN,36)},gN=we,yN=$n,cm=qe,mN=ma,bN=En,wN=cC,Ui=gN.Symbol,Sl=yN("wks"),_N=wN?Ui.for||Ui:Ui&&Ui.withoutSetter||mN,$e=function(i){return cm(Sl,i)||(Sl[i]=bN&&cm(Ui,i)?Ui[i]:_N("Symbol."+i)),Sl[i]},EN=Ve,hm=Je,fm=Co,SN=Ig,$N=eN,ON=$e,IN=TypeError,TN=ON("toPrimitive"),PN=function(i,e){if(!hm(i)||fm(i))return i;var t=SN(i,TN),r;if(t){if(e===void 0&&(e="default"),r=EN(t,i,e),!hm(r)||fm(r))return r;throw new IN("Can't convert object to primitive value")}return e===void 0&&(e="number"),$N(i,e)},CN=PN,RN=Co,ba=function(i){var e=CN(i,"string");return RN(e)?e:e+""},xN=we,vm=Je,Fp=xN.document,DN=vm(Fp)&&vm(Fp.createElement),Pg=function(i){return DN?Fp.createElement(i):{}},AN=Ue,MN=ae,NN=Pg,fC=!AN&&!MN(function(){return Object.defineProperty(NN("div"),"a",{get:function(){return 7}}).a!==7}),kN=Ue,FN=Ve,qN=ga,BN=_i,jN=ir,LN=ba,zN=qe,WN=fC,pm=Object.getOwnPropertyDescriptor;wi.f=kN?pm:function(e,t){if(e=jN(e),t=LN(t),WN)try{return pm(e,t)}catch{}if(zN(e,t))return BN(!FN(qN.f,e,t),e[t])};var HN=ae,UN=Ce,VN=/#|\.prototype\./,Ro=function(i,e){var t=KN[GN(i)];return t===XN?!0:t===YN?!1:UN(e)?HN(e):!!e},GN=Ro.normalize=function(i){return String(i).replace(VN,".").toLowerCase()},KN=Ro.data={},YN=Ro.NATIVE="N",XN=Ro.POLYFILL="P",vC=Ro,gm=nC,JN=bt,ZN=Po,QN=gm(gm.bind),Hr=function(i,e){return JN(i),e===void 0?i:ZN?QN(i,e):function(){return i.apply(e,arguments)}},_t={},ek=Ue,tk=ae,pC=ek&&tk(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),rk=Je,ik=String,nk=TypeError,It=function(i){if(rk(i))return i;throw new nk(ik(i)+" is not an object")},ok=Ue,sk=fC,ak=pC,gs=It,ym=ba,lk=TypeError,$l=Object.defineProperty,uk=Object.getOwnPropertyDescriptor,Ol="enumerable",Il="configurable",Tl="writable";_t.f=ok?ak?function(e,t,r){if(gs(e),t=ym(t),gs(r),typeof e=="function"&&t==="prototype"&&"value"in r&&Tl in r&&!r[Tl]){var n=uk(e,t);n&&n[Tl]&&(e[t]=r.value,r={configurable:Il in r?r[Il]:n[Il],enumerable:Ol in r?r[Ol]:n[Ol],writable:!1})}return $l(e,t,r)}:$l:function(e,t,r){if(gs(e),t=ym(t),gs(r),sk)try{return $l(e,t,r)}catch{}if("get"in r||"set"in r)throw new lk("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var dk=Ue,ck=_t,hk=_i,_r=dk?function(i,e,t){return ck.f(i,e,hk(1,t))}:function(i,e,t){return i[e]=t,i},ys=we,fk=bn,vk=nC,pk=Ce,gk=wi.f,yk=vC,Fi=_e,mk=Hr,qi=_r,mm=qe,bk=function(i){var e=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new i;case 1:return new i(t);case 2:return new i(t,r)}return new i(t,r,n)}return fk(i,this,arguments)};return e.prototype=i.prototype,e},W=function(i,e){var t=i.target,r=i.global,n=i.stat,o=i.proto,s=r?ys:n?ys[t]:(ys[t]||{}).prototype,a=r?Fi:Fi[t]||qi(Fi,t,{})[t],l=a.prototype,u,d,c,h,f,v,g,y,p;for(h in e)u=yk(r?h:t+(n?".":"#")+h,i.forced),d=!u&&s&&mm(s,h),v=a[h],d&&(i.dontCallGetSet?(p=gk(s,h),g=p&&p.value):g=s[h]),f=d&&g?g:e[h],!(d&&typeof v==typeof f)&&(i.bind&&d?y=mk(f,ys):i.wrap&&d?y=bk(f):o&&pk(f)?y=vk(f):y=f,(i.sham||f&&f.sham||v&&v.sham)&&qi(y,"sham",!0),qi(a,h,y),o&&(c=t+"Prototype",mm(Fi,c)||qi(Fi,c,{}),qi(Fi[c],h,f),i.real&&l&&(u||!l[h])&&qi(l,h,f)))},wk=W,_k=Ue,bm=_t.f;wk({target:"Object",stat:!0,forced:Object.defineProperty!==bm,sham:!_k},{defineProperty:bm});var Ek=_e,gC=Ek.Object,Sk=QP.exports=function(e,t,r){return gC.defineProperty(e,t,r)};gC.defineProperty.sham&&(Sk.sham=!0);var $k=QP.exports,Ok=$k,yC=Ok,Ik=yC,Tk=Ik,Pk=Tk,Ck=Pk,mC=Ck,wa=G(mC),Rk=zr,Ur=Array.isArray||function(e){return Rk(e)==="Array"},xk=Math.ceil,Dk=Math.floor,Ak=Math.trunc||function(e){var t=+e;return(t>0?Dk:xk)(t)},Mk=Ak,_a=function(i){var e=+i;return e!==e||e===0?0:Mk(e)},Nk=_a,kk=Math.min,Fk=function(i){return i>0?kk(Nk(i),9007199254740991):0},qk=Fk,Tt=function(i){return qk(i.length)},Bk=TypeError,jk=9007199254740991,Ea=function(i){if(i>jk)throw Bk("Maximum allowed index exceeded");return i},Lk=ba,zk=_t,Wk=_i,On=function(i,e,t){var r=Lk(e);r in i?zk.f(i,r,Wk(0,t)):i[r]=t},Hk=$e,Uk=Hk("toStringTag"),bC={};bC[Uk]="z";var Cg=String(bC)==="[object z]",Vk=Cg,Gk=Ce,qs=zr,Kk=$e,Yk=Kk("toStringTag"),Xk=Object,Jk=qs(function(){return arguments}())==="Arguments",Zk=function(i,e){try{return i[e]}catch{}},Er=Vk?qs:function(i){var e,t,r;return i===void 0?"Undefined":i===null?"Null":typeof(t=Zk(e=Xk(i),Yk))=="string"?t:Jk?qs(e):(r=qs(e))==="Object"&&Gk(e.callee)?"Arguments":r},Qk=ye,eF=Ce,qp=Tg,tF=Qk(Function.toString);eF(qp.inspectSource)||(qp.inspectSource=function(i){return tF(i)});var wC=qp.inspectSource,rF=ye,iF=ae,_C=Ce,nF=Er,oF=at,sF=wC,EC=function(){},aF=[],SC=oF("Reflect","construct"),Rg=/^\s*(?:class|function)\b/,lF=rF(Rg.exec),uF=!Rg.test(EC),Yn=function(e){if(!_C(e))return!1;try{return SC(EC,aF,e),!0}catch{return!1}},$C=function(e){if(!_C(e))return!1;switch(nF(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return uF||!!lF(Rg,sF(e))}catch{return!0}};$C.sham=!0;var Sa=!SC||iF(function(){var i;return Yn(Yn.call)||!Yn(Object)||!Yn(function(){i=!0})||i})?$C:Yn,wm=Ur,dF=Sa,cF=Je,hF=$e,fF=hF("species"),_m=Array,vF=function(i){var e;return wm(i)&&(e=i.constructor,dF(e)&&(e===_m||wm(e.prototype))?e=void 0:cF(e)&&(e=e[fF],e===null&&(e=void 0))),e===void 0?_m:e},pF=vF,$a=function(i,e){return new(pF(i))(e===0?0:e)},gF=ae,yF=$e,mF=_n,bF=yF("species"),xo=function(i){return mF>=51||!gF(function(){var e=[],t=e.constructor={};return t[bF]=function(){return{foo:1}},e[i](Boolean).foo!==1})},wF=W,_F=ae,EF=Ur,SF=Je,$F=wt,OF=Tt,Em=Ea,Sm=On,IF=$a,TF=xo,PF=$e,CF=_n,OC=PF("isConcatSpreadable"),RF=CF>=51||!_F(function(){var i=[];return i[OC]=!1,i.concat()[0]!==i}),xF=function(i){if(!SF(i))return!1;var e=i[OC];return e!==void 0?!!e:EF(i)},DF=!RF||!TF("concat");wF({target:"Array",proto:!0,forced:DF},{concat:function(e){var t=$F(this),r=IF(t,0),n=0,o,s,a,l,u;for(o=-1,a=arguments.length;o<a;o++)if(u=o===-1?t:arguments[o],xF(u))for(l=OF(u),Em(n+l),s=0;s<l;s++,n++)s in u&&Sm(r,n,u[s]);else Em(n+1),Sm(r,n++,u);return r.length=n,r}});var AF=Er,MF=String,Ei=function(i){if(AF(i)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return MF(i)},Oa={},NF=_a,kF=Math.max,FF=Math.min,Ia=function(i,e){var t=NF(i);return t<0?kF(t+e,0):FF(t,e)},qF=ir,BF=Ia,jF=Tt,LF=function(i){return function(e,t,r){var n=qF(e),o=jF(n),s=BF(r,o),a;if(i&&t!==t){for(;o>s;)if(a=n[s++],a!==a)return!0}else for(;o>s;s++)if((i||s in n)&&n[s]===t)return i||s||0;return!i&&-1}},zF={indexOf:LF(!1)},Do={},WF=ye,Pl=qe,HF=ir,UF=zF.indexOf,VF=Do,$m=WF([].push),IC=function(i,e){var t=HF(i),r=0,n=[],o;for(o in t)!Pl(VF,o)&&Pl(t,o)&&$m(n,o);for(;e.length>r;)Pl(t,o=e[r++])&&(~UF(n,o)||$m(n,o));return n},xg=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],GF=IC,KF=xg,Ta=Object.keys||function(e){return GF(e,KF)},YF=Ue,XF=pC,JF=_t,ZF=It,QF=ir,e2=Ta;Oa.f=YF&&!XF?Object.defineProperties:function(e,t){ZF(e);for(var r=QF(t),n=e2(t),o=n.length,s=0,a;o>s;)JF.f(e,a=n[s++],r[a]);return e};var t2=at,TC=t2("document","documentElement"),r2=$n,i2=ma,Om=r2("keys"),Pa=function(i){return Om[i]||(Om[i]=i2(i))},n2=It,o2=Oa,Im=xg,s2=Do,a2=TC,l2=Pg,u2=Pa,Tm=">",Pm="<",Bp="prototype",jp="script",PC=u2("IE_PROTO"),Cl=function(){},CC=function(i){return Pm+jp+Tm+i+Pm+"/"+jp+Tm},Cm=function(i){i.write(CC("")),i.close();var e=i.parentWindow.Object;return i=null,e},d2=function(){var i=l2("iframe"),e="java"+jp+":",t;return i.style.display="none",a2.appendChild(i),i.src=String(e),t=i.contentWindow.document,t.open(),t.write(CC("document.F=Object")),t.close(),t.F},ms,Bs=function(){try{ms=new ActiveXObject("htmlfile")}catch{}Bs=typeof document<"u"?document.domain&&ms?Cm(ms):d2():Cm(ms);for(var i=Im.length;i--;)delete Bs[Bp][Im[i]];return Bs()};s2[PC]=!0;var Si=Object.create||function(e,t){var r;return e!==null?(Cl[Bp]=n2(e),r=new Cl,Cl[Bp]=null,r[PC]=e):r=Bs(),t===void 0?r:o2.f(r,t)},Ao={},c2=IC,h2=xg,f2=h2.concat("length","prototype");Ao.f=Object.getOwnPropertyNames||function(e){return c2(e,f2)};var Dg={},Rm=Ia,v2=Tt,p2=On,g2=Array,y2=Math.max,RC=function(i,e,t){for(var r=v2(i),n=Rm(e,r),o=Rm(t===void 0?r:t,r),s=g2(y2(o-n,0)),a=0;n<o;n++,a++)p2(s,a,i[n]);return s.length=a,s},m2=zr,b2=ir,xC=Ao.f,w2=RC,DC=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],_2=function(i){try{return xC(i)}catch{return w2(DC)}};Dg.f=function(e){return DC&&m2(e)==="Window"?_2(e):xC(b2(e))};var Mo={};Mo.f=Object.getOwnPropertySymbols;var E2=_r,In=function(i,e,t,r){return r&&r.enumerable?i[e]=t:E2(i,e,t),i},S2=_t,Ag=function(i,e,t){return S2.f(i,e,t)},No={},$2=$e;No.f=$2;var xm=_e,O2=qe,I2=No,T2=_t.f,Re=function(i){var e=xm.Symbol||(xm.Symbol={});O2(e,i)||T2(e,i,{value:I2.f(i)})},P2=Ve,C2=at,R2=$e,x2=In,AC=function(){var i=C2("Symbol"),e=i&&i.prototype,t=e&&e.valueOf,r=R2("toPrimitive");e&&!e[r]&&x2(e,r,function(n){return P2(t,this)},{})},D2=Cg,A2=Er,M2=D2?{}.toString:function(){return"[object "+A2(this)+"]"},N2=Cg,k2=_t.f,F2=_r,q2=qe,B2=M2,j2=$e,Dm=j2("toStringTag"),$i=function(i,e,t,r){if(i){var n=t?i:i.prototype;q2(n,Dm)||k2(n,Dm,{configurable:!0,value:e}),r&&!N2&&F2(n,"toString",B2)}},L2=we,z2=Ce,Am=L2.WeakMap,W2=z2(Am)&&/native code/.test(String(Am)),H2=W2,MC=we,U2=Je,V2=_r,Rl=qe,xl=Tg,G2=Pa,K2=Do,Mm="Object already initialized",Lp=MC.TypeError,Y2=MC.WeakMap,Ys,fo,Xs,X2=function(i){return Xs(i)?fo(i):Ys(i,{})},J2=function(i){return function(e){var t;if(!U2(e)||(t=fo(e)).type!==i)throw new Lp("Incompatible receiver, "+i+" required");return t}};if(H2||xl.state){var Yt=xl.state||(xl.state=new Y2);Yt.get=Yt.get,Yt.has=Yt.has,Yt.set=Yt.set,Ys=function(i,e){if(Yt.has(i))throw new Lp(Mm);return e.facade=i,Yt.set(i,e),e},fo=function(i){return Yt.get(i)||{}},Xs=function(i){return Yt.has(i)}}else{var Bi=G2("state");K2[Bi]=!0,Ys=function(i,e){if(Rl(i,Bi))throw new Lp(Mm);return e.facade=i,V2(i,Bi,e),e},fo=function(i){return Rl(i,Bi)?i[Bi]:{}},Xs=function(i){return Rl(i,Bi)}}var Tn={set:Ys,get:fo,has:Xs,enforce:X2,getterFor:J2},Z2=Hr,Q2=ye,eq=ya,tq=wt,rq=Tt,iq=$a,Nm=Q2([].push),bs=function(i){var e=i===1,t=i===2,r=i===3,n=i===4,o=i===6,s=i===7,a=i===5||o;return function(l,u,d,c){for(var h=tq(l),f=eq(h),v=Z2(u,d),g=rq(f),y=0,p=c||iq,m=e?p(l,g):t||s?p(l,0):void 0,w,b;g>y;y++)if((a||y in f)&&(w=f[y],b=v(w,y,h),i))if(e)m[y]=b;else if(b)switch(i){case 3:return!0;case 5:return w;case 6:return y;case 2:Nm(m,w)}else switch(i){case 4:return!1;case 7:Nm(m,w)}return o?-1:r||n?n:m}},Pn={forEach:bs(0),map:bs(1),filter:bs(2),some:bs(3)},Ca=W,ko=we,Mg=Ve,nq=ye,an=Ue,ln=En,oq=ae,He=qe,sq=Fe,zp=It,Ra=ir,Ng=ba,aq=Ei,Wp=_i,vo=Si,NC=Ta,lq=Ao,kC=Dg,uq=Mo,FC=wi,qC=_t,dq=Oa,BC=ga,km=In,cq=Ag,kg=$n,hq=Pa,jC=Do,Fm=ma,fq=$e,vq=No,pq=Re,gq=AC,yq=$i,LC=Tn,xa=Pn.forEach,vt=hq("hidden"),Da="Symbol",po="prototype",mq=LC.set,qm=LC.getterFor(Da),Ht=Object[po],ii=ko.Symbol,eo=ii&&ii[po],bq=ko.RangeError,wq=ko.TypeError,Dl=ko.QObject,zC=FC.f,ni=qC.f,WC=kC.f,_q=BC.f,HC=nq([].push),br=kg("symbols"),Fo=kg("op-symbols"),Eq=kg("wks"),Hp=!Dl||!Dl[po]||!Dl[po].findChild,UC=function(i,e,t){var r=zC(Ht,e);r&&delete Ht[e],ni(i,e,t),r&&i!==Ht&&ni(Ht,e,r)},Up=an&&oq(function(){return vo(ni({},"a",{get:function(){return ni(this,"a",{value:7}).a}})).a!==7})?UC:ni,Al=function(i,e){var t=br[i]=vo(eo);return mq(t,{type:Da,tag:i,description:e}),an||(t.description=e),t},Aa=function(e,t,r){e===Ht&&Aa(Fo,t,r),zp(e);var n=Ng(t);return zp(r),He(br,n)?(r.enumerable?(He(e,vt)&&e[vt][n]&&(e[vt][n]=!1),r=vo(r,{enumerable:Wp(0,!1)})):(He(e,vt)||ni(e,vt,Wp(1,{})),e[vt][n]=!0),Up(e,n,r)):ni(e,n,r)},Fg=function(e,t){zp(e);var r=Ra(t),n=NC(r).concat(YC(r));return xa(n,function(o){(!an||Mg(VC,r,o))&&Aa(e,o,r[o])}),e},Sq=function(e,t){return t===void 0?vo(e):Fg(vo(e),t)},VC=function(e){var t=Ng(e),r=Mg(_q,this,t);return this===Ht&&He(br,t)&&!He(Fo,t)?!1:r||!He(this,t)||!He(br,t)||He(this,vt)&&this[vt][t]?r:!0},GC=function(e,t){var r=Ra(e),n=Ng(t);if(!(r===Ht&&He(br,n)&&!He(Fo,n))){var o=zC(r,n);return o&&He(br,n)&&!(He(r,vt)&&r[vt][n])&&(o.enumerable=!0),o}},KC=function(e){var t=WC(Ra(e)),r=[];return xa(t,function(n){!He(br,n)&&!He(jC,n)&&HC(r,n)}),r},YC=function(i){var e=i===Ht,t=WC(e?Fo:Ra(i)),r=[];return xa(t,function(n){He(br,n)&&(!e||He(Ht,n))&&HC(r,br[n])}),r};ln||(ii=function(){if(sq(eo,this))throw new wq("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:aq(arguments[0]),t=Fm(e),r=function(n){var o=this===void 0?ko:this;o===Ht&&Mg(r,Fo,n),He(o,vt)&&He(o[vt],t)&&(o[vt][t]=!1);var s=Wp(1,n);try{Up(o,t,s)}catch(a){if(!(a instanceof bq))throw a;UC(o,t,s)}};return an&&Hp&&Up(Ht,t,{configurable:!0,set:r}),Al(t,e)},eo=ii[po],km(eo,"toString",function(){return qm(this).tag}),km(ii,"withoutSetter",function(i){return Al(Fm(i),i)}),BC.f=VC,qC.f=Aa,dq.f=Fg,FC.f=GC,lq.f=kC.f=KC,uq.f=YC,vq.f=function(i){return Al(fq(i),i)},an&&cq(eo,"description",{configurable:!0,get:function(){return qm(this).description}}));Ca({global:!0,wrap:!0,forced:!ln,sham:!ln},{Symbol:ii});xa(NC(Eq),function(i){pq(i)});Ca({target:Da,stat:!0,forced:!ln},{useSetter:function(){Hp=!0},useSimple:function(){Hp=!1}});Ca({target:"Object",stat:!0,forced:!ln,sham:!an},{create:Sq,defineProperty:Aa,defineProperties:Fg,getOwnPropertyDescriptor:GC});Ca({target:"Object",stat:!0,forced:!ln},{getOwnPropertyNames:KC});gq();yq(ii,Da);jC[vt]=!0;var $q=En,XC=$q&&!!Symbol.for&&!!Symbol.keyFor,Oq=W,Iq=at,Tq=qe,Pq=Ei,JC=$n,Cq=XC,Ml=JC("string-to-symbol-registry"),Rq=JC("symbol-to-string-registry");Oq({target:"Symbol",stat:!0,forced:!Cq},{for:function(i){var e=Pq(i);if(Tq(Ml,e))return Ml[e];var t=Iq("Symbol")(e);return Ml[e]=t,Rq[t]=e,t}});var xq=W,Dq=qe,Aq=Co,Mq=Sn,Nq=$n,kq=XC,Bm=Nq("symbol-to-string-registry");xq({target:"Symbol",stat:!0,forced:!kq},{keyFor:function(e){if(!Aq(e))throw new TypeError(Mq(e)+" is not a symbol");if(Dq(Bm,e))return Bm[e]}});var Fq=ye,qo=Fq([].slice),qq=ye,jm=Ur,Bq=Ce,Lm=zr,jq=Ei,zm=qq([].push),Lq=function(i){if(Bq(i))return i;if(jm(i)){for(var e=i.length,t=[],r=0;r<e;r++){var n=i[r];typeof n=="string"?zm(t,n):(typeof n=="number"||Lm(n)==="Number"||Lm(n)==="String")&&zm(t,jq(n))}var o=t.length,s=!0;return function(a,l){if(s)return s=!1,l;if(jm(this))return l;for(var u=0;u<o;u++)if(t[u]===a)return l}}},zq=W,ZC=at,QC=bn,Wq=Ve,Bo=ye,eR=ae,Wm=Ce,Hm=Co,tR=qo,Hq=Lq,Uq=En,Vq=String,xr=ZC("JSON","stringify"),ws=Bo(/./.exec),Um=Bo("".charAt),Gq=Bo("".charCodeAt),Kq=Bo("".replace),Yq=Bo(1 .toString),Xq=/[\uD800-\uDFFF]/g,Vm=/^[\uD800-\uDBFF]$/,Gm=/^[\uDC00-\uDFFF]$/,Km=!Uq||eR(function(){var i=ZC("Symbol")("stringify detection");return xr([i])!=="[null]"||xr({a:i})!=="{}"||xr(Object(i))!=="{}"}),Ym=eR(function(){return xr("\uDF06\uD834")!=='"\\udf06\\ud834"'||xr("\uDEAD")!=='"\\udead"'}),Jq=function(i,e){var t=tR(arguments),r=Hq(e);if(!(!Wm(r)&&(i===void 0||Hm(i))))return t[1]=function(n,o){if(Wm(r)&&(o=Wq(r,this,Vq(n),o)),!Hm(o))return o},QC(xr,null,t)},Zq=function(i,e,t){var r=Um(t,e-1),n=Um(t,e+1);return ws(Vm,i)&&!ws(Gm,n)||ws(Gm,i)&&!ws(Vm,r)?"\\u"+Yq(Gq(i,0),16):i};xr&&zq({target:"JSON",stat:!0,forced:Km||Ym},{stringify:function(e,t,r){var n=tR(arguments),o=QC(Km?Jq:xr,null,n);return Ym&&typeof o=="string"?Kq(o,Xq,Zq):o}});var Qq=W,eB=En,tB=ae,rR=Mo,rB=wt,iB=!eB||tB(function(){rR.f(1)});Qq({target:"Object",stat:!0,forced:iB},{getOwnPropertySymbols:function(e){var t=rR.f;return t?t(rB(e)):[]}});var nB=Re;nB("asyncIterator");var oB=Re;oB("hasInstance");var sB=Re;sB("isConcatSpreadable");var aB=Re;aB("iterator");var lB=Re;lB("match");var uB=Re;uB("matchAll");var dB=Re;dB("replace");var cB=Re;cB("search");var hB=Re;hB("species");var fB=Re;fB("split");var vB=Re,pB=AC;vB("toPrimitive");pB();var gB=at,yB=Re,mB=$i;yB("toStringTag");mB(gB("Symbol"),"Symbol");var bB=Re;bB("unscopables");var wB=we,_B=$i;_B(wB.JSON,"JSON",!0);var EB=_e,SB=EB.Symbol,Cn={},Vp=Ue,$B=qe,iR=Function.prototype,OB=Vp&&Object.getOwnPropertyDescriptor,nR=$B(iR,"name"),IB=nR&&(function(){}).name==="something";nR&&(!Vp||Vp&&OB(iR,"name").configurable);var TB={PROPER:IB},PB=ae,oR=!PB(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype}),CB=qe,RB=Ce,xB=wt,DB=Pa,AB=oR,Xm=DB("IE_PROTO"),Gp=Object,MB=Gp.prototype,Ma=AB?Gp.getPrototypeOf:function(i){var e=xB(i);if(CB(e,Xm))return e[Xm];var t=e.constructor;return RB(t)&&e instanceof t?t.prototype:e instanceof Gp?MB:null},NB=ae,kB=Ce,FB=Je,qB=Si,Jm=Ma,BB=In,jB=$e,Kp=jB("iterator"),sR=!1,dr,Nl,kl;[].keys&&(kl=[].keys(),"next"in kl?(Nl=Jm(Jm(kl)),Nl!==Object.prototype&&(dr=Nl)):sR=!0);var LB=!FB(dr)||NB(function(){var i={};return dr[Kp].call(i)!==i});LB?dr={}:dr=qB(dr);kB(dr[Kp])||BB(dr,Kp,function(){return this});var aR={IteratorPrototype:dr,BUGGY_SAFARI_ITERATORS:sR},zB=aR.IteratorPrototype,WB=Si,HB=_i,UB=$i,VB=Cn,GB=function(){return this},KB=function(i,e,t,r){var n=e+" Iterator";return i.prototype=WB(zB,{next:HB(+!r,t)}),UB(i,n,!1,!0),VB[n]=GB,i},YB=ye,XB=bt,JB=function(i,e,t){try{return YB(XB(Object.getOwnPropertyDescriptor(i,e)[t]))}catch{}},ZB=Ce,QB=String,ej=TypeError,tj=function(i){if(typeof i=="object"||ZB(i))return i;throw new ej("Can't set "+QB(i)+" as a prototype")},rj=JB,ij=It,nj=tj,lR=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,e={},t;try{t=rj(Object.prototype,"__proto__","set"),t(e,[]),i=e instanceof Array}catch{}return function(n,o){return ij(n),nj(o),i?t(n,o):n.__proto__=o,n}}():void 0),oj=W,sj=Ve,aj=TB,lj=KB,uj=Ma,dj=$i,Zm=In,cj=$e,Qm=Cn,hj=aR,fj=aj.PROPER,_s=hj.BUGGY_SAFARI_ITERATORS,Fl=cj("iterator"),eb="keys",Es="values",tb="entries",vj=function(){return this},qg=function(i,e,t,r,n,o,s){lj(t,e,r);var a=function(p){if(p===n&&h)return h;if(!_s&&p&&p in d)return d[p];switch(p){case eb:return function(){return new t(this,p)};case Es:return function(){return new t(this,p)};case tb:return function(){return new t(this,p)}}return function(){return new t(this)}},l=e+" Iterator",u=!1,d=i.prototype,c=d[Fl]||d["@@iterator"]||n&&d[n],h=!_s&&c||a(n),f=e==="Array"&&d.entries||c,v,g,y;if(f&&(v=uj(f.call(new i)),v!==Object.prototype&&v.next&&(dj(v,l,!0,!0),Qm[l]=vj)),fj&&n===Es&&c&&c.name!==Es&&(u=!0,h=function(){return sj(c,this)}),n)if(g={values:a(Es),keys:o?h:a(eb),entries:a(tb)},s)for(y in g)(_s||u||!(y in d))&&Zm(d,y,g[y]);else oj({target:e,proto:!0,forced:_s||u},g);return s&&d[Fl]!==h&&Zm(d,Fl,h,{}),Qm[e]=h,g},Bg=function(i,e){return{value:i,done:e}},pj=ir,rb=Cn,uR=Tn;_t.f;var gj=qg,Ss=Bg,dR="Array Iterator",yj=uR.set,mj=uR.getterFor(dR);gj(Array,"Array",function(i,e){yj(this,{type:dR,target:pj(i),index:0,kind:e})},function(){var i=mj(this),e=i.target,t=i.index++;if(!e||t>=e.length)return i.target=void 0,Ss(void 0,!0);switch(i.kind){case"keys":return Ss(t,!1);case"values":return Ss(e[t],!1)}return Ss([t,e[t]],!1)},"values");rb.Arguments=rb.Array;var bj={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},wj=bj,_j=we,Ej=Er,Sj=_r,ib=Cn,$j=$e,nb=$j("toStringTag");for(var ql in wj){var ob=_j[ql],Bl=ob&&ob.prototype;Bl&&Ej(Bl)!==nb&&Sj(Bl,nb,ql),ib[ql]=ib.Array}var Oj=SB,cR=Oj,Ij=$e,Tj=_t.f,sb=Ij("metadata"),ab=Function.prototype;ab[sb]===void 0&&Tj(ab,sb,{value:null});var Pj=Re;Pj("asyncDispose");var Cj=Re;Cj("dispose");var Rj=Re;Rj("metadata");var xj=cR,Dj=xj,Aj=at,Mj=ye,jg=Aj("Symbol"),Nj=jg.keyFor,kj=Mj(jg.prototype.valueOf),hR=jg.isRegisteredSymbol||function(e){try{return Nj(kj(e))!==void 0}catch{return!1}},Fj=W,qj=hR;Fj({target:"Symbol",stat:!0},{isRegisteredSymbol:qj});var Bj=$n,fR=at,jj=ye,Lj=Co,zj=$e,Js=fR("Symbol"),lb=Js.isWellKnownSymbol,vR=fR("Object","getOwnPropertyNames"),Wj=jj(Js.prototype.valueOf),ub=Bj("wks");for(var jl=0,db=vR(Js),Hj=db.length;jl<Hj;jl++)try{var cb=db[jl];Lj(Js[cb])&&zj(cb)}catch{}var pR=function(e){if(lb&&lb(e))return!0;try{for(var t=Wj(e),r=0,n=vR(ub),o=n.length;r<o;r++)if(ub[n[r]]==t)return!0}catch{}return!1},Uj=W,Vj=pR;Uj({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:Vj});var Gj=Re;Gj("matcher");var Kj=Re;Kj("observable");var Yj=W,Xj=hR;Yj({target:"Symbol",stat:!0},{isRegistered:Xj});var Jj=W,Zj=pR;Jj({target:"Symbol",stat:!0,forced:!0},{isWellKnown:Zj});var Qj=Re;Qj("metadataKey");var eL=Re;eL("patternMatch");var tL=Re;tL("replaceAll");var rL=Dj,iL=rL,Lg=iL,Vi=G(Lg),zg=ye,nL=_a,oL=Ei,sL=Og,aL=zg("".charAt),hb=zg("".charCodeAt),lL=zg("".slice),uL=function(i){return function(e,t){var r=oL(sL(e)),n=nL(t),o=r.length,s,a;return n<0||n>=o?i?"":void 0:(s=hb(r,n),s<55296||s>56319||n+1===o||(a=hb(r,n+1))<56320||a>57343?i?aL(r,n):s:i?lL(r,n,n+2):(s-55296<<10)+(a-56320)+65536)}},dL={charAt:uL(!0)},cL=dL.charAt,hL=Ei,gR=Tn,fL=qg,fb=Bg,yR="String Iterator",vL=gR.set,pL=gR.getterFor(yR);fL(String,"String",function(i){vL(this,{type:yR,string:hL(i),index:0})},function(){var e=pL(this),t=e.string,r=e.index,n;return r>=t.length?fb(void 0,!0):(n=cL(t,r),e.index+=n.length,fb(n,!1))});var gL=No,yL=gL.f("iterator"),mL=yL,mR=mL,bL=mR,wL=bL,_L=wL,EL=_L,bR=EL,SL=G(bR);function un(i){"@babel/helpers - typeof";return un=typeof Vi=="function"&&typeof SL=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Vi=="function"&&e.constructor===Vi&&e!==Vi.prototype?"symbol":typeof e},un(i)}var $L=No,OL=$L.f("toPrimitive"),IL=OL,TL=IL,PL=TL,CL=PL,RL=CL,xL=RL,DL=xL,AL=G(DL);function ML(i,e){if(un(i)!=="object"||i===null)return i;var t=i[AL];if(t!==void 0){var r=t.call(i,e);if(un(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function wR(i){var e=ML(i,"string");return un(e)==="symbol"?e:String(e)}function vb(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),wa(i,wR(r.key),r)}}function Na(i,e,t){return e&&vb(i.prototype,e),t&&vb(i,t),wa(i,"prototype",{writable:!1}),i}function Dr(i,e,t){return e=wR(e),e in i?wa(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var _R=ye,NL=bt,kL=Je,FL=qe,pb=qo,qL=Po,ER=Function,BL=_R([].concat),jL=_R([].join),Ll={},LL=function(i,e,t){if(!FL(Ll,e)){for(var r=[],n=0;n<e;n++)r[n]="a["+n+"]";Ll[e]=ER("C,a","return new C("+jL(r,",")+")")}return Ll[e](i,t)},SR=qL?ER.bind:function(e){var t=NL(this),r=t.prototype,n=pb(arguments,1),o=function(){var a=BL(n,pb(arguments));return this instanceof o?LL(t,a.length,a):t.apply(e,a)};return kL(r)&&(o.prototype=r),o},zL=W,gb=SR;zL({target:"Function",proto:!0,forced:Function.bind!==gb},{bind:gb});var WL=we,HL=_e,tt=function(i,e){var t=HL[i+"Prototype"],r=t&&t[e];if(r)return r;var n=WL[i],o=n&&n.prototype;return o&&o[e]},UL=tt,VL=UL("Function","bind"),GL=Fe,KL=VL,zl=Function.prototype,YL=function(i){var e=i.bind;return i===zl||GL(zl,i)&&e===zl.bind?KL:e},XL=YL,$R=XL,JL=$R,OR=G(JL),ZL=bt,QL=wt,ez=ya,tz=Tt,rz=TypeError,iz=function(i){return function(e,t,r,n){ZL(t);var o=QL(e),s=ez(o),a=tz(o),l=i?a-1:0,u=i?-1:1;if(r<2)for(;;){if(l in s){n=s[l],l+=u;break}if(l+=u,i?l<0:a<=l)throw new rz("Reduce of empty array with no initial value")}for(;i?l>=0:a>l;l+=u)l in s&&(n=t(n,s[l],l,o));return n}},nz={left:iz(!1)},oz=ae,ka=function(i,e){var t=[][i];return!!t&&oz(function(){t.call(null,e||function(){return 1},1)})},sz=we,az=zr,jo=az(sz.process)==="process",lz=W,uz=nz.left,dz=ka,yb=_n,cz=jo,hz=!cz&&yb>79&&yb<83,fz=hz||!dz("reduce");lz({target:"Array",proto:!0,forced:fz},{reduce:function(e){var t=arguments.length;return uz(this,e,t,t>1?arguments[1]:void 0)}});var vz=tt,pz=vz("Array","reduce"),gz=Fe,yz=pz,Wl=Array.prototype,mz=function(i){var e=i.reduce;return i===Wl||gz(Wl,i)&&e===Wl.reduce?yz:e},bz=mz,wz=bz,_z=wz,Ez=G(_z),Sz=W,$z=Pn.filter,Oz=xo,Iz=Oz("filter");Sz({target:"Array",proto:!0,forced:!Iz},{filter:function(e){return $z(this,e,arguments.length>1?arguments[1]:void 0)}});var Tz=tt,Pz=Tz("Array","filter"),Cz=Fe,Rz=Pz,Hl=Array.prototype,xz=function(i){var e=i.filter;return i===Hl||Cz(Hl,i)&&e===Hl.filter?Rz:e},Dz=xz,Az=Dz,Mz=Az,Gi=G(Mz),Nz=W,kz=Pn.map,Fz=xo,qz=Fz("map");Nz({target:"Array",proto:!0,forced:!qz},{map:function(e){return kz(this,e,arguments.length>1?arguments[1]:void 0)}});var Bz=tt,jz=Bz("Array","map"),Lz=Fe,zz=jz,Ul=Array.prototype,Wz=function(i){var e=i.map;return i===Ul||Lz(Ul,i)&&e===Ul.map?zz:e},Hz=Wz,Uz=Hz,Vz=Uz,zt=G(Vz),Gz=Ur,Kz=Tt,Yz=Ea,Xz=Hr,IR=function(i,e,t,r,n,o,s,a){for(var l=n,u=0,d=s?Xz(s,a):!1,c,h;u<r;)u in t&&(c=d?d(t[u],u,e):t[u],o>0&&Gz(c)?(h=Kz(c),l=IR(i,e,c,h,l,o-1)-1):(Yz(l+1),i[l]=c),l++),u++;return l},Jz=IR,Zz=W,Qz=Jz,e5=bt,t5=wt,r5=Tt,i5=$a;Zz({target:"Array",proto:!0},{flatMap:function(e){var t=t5(this),r=r5(t),n;return e5(e),n=i5(t,0),n.length=Qz(n,t,t,r,0,1,e,arguments.length>1?arguments[1]:void 0),n}});var n5=tt;n5("Array","flatMap");var o5=Ve,mb=It,s5=Ig,TR=function(i,e,t){var r,n;mb(i);try{if(r=s5(i,"return"),!r){if(e==="throw")throw t;return t}r=o5(r,i)}catch(o){n=!0,r=o}if(e==="throw")throw t;if(n)throw r;return mb(r),t},a5=It,l5=TR,u5=function(i,e,t,r){try{return r?e(a5(t)[0],t[1]):e(t)}catch(n){l5(i,"throw",n)}},d5=$e,c5=Cn,h5=d5("iterator"),f5=Array.prototype,PR=function(i){return i!==void 0&&(c5.Array===i||f5[h5]===i)},v5=Er,bb=Ig,p5=wn,g5=Cn,y5=$e,m5=y5("iterator"),Fa=function(i){if(!p5(i))return bb(i,m5)||bb(i,"@@iterator")||g5[v5(i)]},b5=Ve,w5=bt,_5=It,E5=Sn,S5=Fa,$5=TypeError,Wg=function(i,e){var t=arguments.length<2?S5(i):e;if(w5(t))return _5(b5(t,i));throw new $5(E5(i)+" is not iterable")},O5=Hr,I5=Ve,T5=wt,P5=u5,C5=PR,R5=Sa,x5=Tt,wb=On,D5=Wg,A5=Fa,_b=Array,M5=function(e){var t=T5(e),r=R5(this),n=arguments.length,o=n>1?arguments[1]:void 0,s=o!==void 0;s&&(o=O5(o,n>2?arguments[2]:void 0));var a=A5(t),l=0,u,d,c,h,f,v;if(a&&!(this===_b&&C5(a)))for(h=D5(t,a),f=h.next,d=r?new this:[];!(c=I5(f,h)).done;l++)v=s?P5(h,o,[c.value,l],!0):c.value,wb(d,l,v);else for(u=x5(t),d=r?new this(u):_b(u);u>l;l++)v=s?o(t[l],l):t[l],wb(d,l,v);return d.length=l,d},N5=$e,CR=N5("iterator"),RR=!1;try{var k5=0,Eb={next:function(){return{done:!!k5++}},return:function(){RR=!0}};Eb[CR]=function(){return this},Array.from(Eb,function(){throw 2})}catch{}var xR=function(i,e){try{if(!e&&!RR)return!1}catch{return!1}var t=!1;try{var r={};r[CR]=function(){return{next:function(){return{done:t=!0}}}},i(r)}catch{}return t},F5=W,q5=M5,B5=xR,j5=!B5(function(i){Array.from(i)});F5({target:"Array",stat:!0,forced:j5},{from:q5});var L5=_e,z5=L5.Array.from,W5=z5,DR=W5,H5=DR,Hg=G(H5),U5=Fa,V5=U5,G5=V5,K5=G5,Y5=K5,X5=Y5,J5=X5,Z5=J5,AR=Z5,MR=G(AR),Q5=AR,Ug=G(Q5),e3=W,t3=Ur;e3({target:"Array",stat:!0},{isArray:t3});var r3=_e,i3=r3.Array.isArray,n3=i3,NR=n3,o3=NR,s3=o3,a3=s3,l3=a3,u3=l3,kR=G(u3);function d3(i){if(kR(i))return i}var c3=Ue,h3=Ur,f3=TypeError,v3=Object.getOwnPropertyDescriptor,p3=c3&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(i){return i instanceof TypeError}}(),FR=p3?function(i,e){if(h3(i)&&!v3(i,"length").writable)throw new f3("Cannot set read only .length");return i.length=e}:function(i,e){return i.length=e},g3=W,y3=wt,m3=Tt,b3=FR,w3=Ea,_3=ae,E3=_3(function(){return[].push.call({length:4294967296},1)!==4294967297}),S3=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(i){return i instanceof TypeError}},$3=E3||!S3();g3({target:"Array",proto:!0,forced:$3},{push:function(e){var t=y3(this),r=m3(t),n=arguments.length;w3(r+n);for(var o=0;o<n;o++)t[r]=arguments[o],r++;return b3(t,r),r}});var O3=tt,I3=O3("Array","push"),T3=Fe,P3=I3,Vl=Array.prototype,C3=function(i){var e=i.push;return i===Vl||T3(Vl,i)&&e===Vl.push?P3:e},R3=C3,x3=R3,D3=x3,A3=D3,M3=A3,N3=M3,qR=N3,k3=G(qR);function F3(i,e){var t=i==null?null:typeof Vi<"u"&&MR(i)||i["@@iterator"];if(t!=null){var r,n,o,s,a=[],l=!0,u=!1;try{if(o=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=o.call(t)).done)&&(k3(a).call(a,r.value),a.length!==e);l=!0);}catch(d){u=!0,n=d}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(u)throw n}}return a}}var q3=W,Sb=Ur,B3=Sa,j3=Je,$b=Ia,L3=Tt,z3=ir,W3=On,H3=$e,U3=xo,V3=qo,G3=U3("slice"),K3=H3("species"),Gl=Array,Y3=Math.max;q3({target:"Array",proto:!0,forced:!G3},{slice:function(e,t){var r=z3(this),n=L3(r),o=$b(e,n),s=$b(t===void 0?n:t,n),a,l,u;if(Sb(r)&&(a=r.constructor,B3(a)&&(a===Gl||Sb(a.prototype))?a=void 0:j3(a)&&(a=a[K3],a===null&&(a=void 0)),a===Gl||a===void 0))return V3(r,o,s);for(l=new(a===void 0?Gl:a)(Y3(s-o,0)),u=0;o<s;o++,u++)o in r&&W3(l,u,r[o]);return l.length=u,l}});var X3=tt,J3=X3("Array","slice"),Z3=Fe,Q3=J3,Kl=Array.prototype,eW=function(i){var e=i.slice;return i===Kl||Z3(Kl,i)&&e===Kl.slice?Q3:e},tW=eW,BR=tW,rW=BR,iW=rW,nW=iW,oW=nW,jR=oW,sW=G(jR),aW=DR,lW=aW,uW=lW,dW=uW,cW=dW,LR=G(cW);function Yp(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}function zR(i,e){var t;if(i){if(typeof i=="string")return Yp(i,e);var r=sW(t=Object.prototype.toString.call(i)).call(t,8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return LR(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yp(i,e)}}function hW(){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 ct(i,e){return d3(i)||F3(i,e)||zR(i,e)||hW()}function fW(i){if(kR(i))return Yp(i)}function vW(i){if(typeof Vi<"u"&&MR(i)!=null||i["@@iterator"]!=null)return LR(i)}function pW(){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 pt(i){return fW(i)||vW(i)||zR(i)||pW()}var gW=cR,qa=G(gW),yW=tt,mW=yW("Array","concat"),bW=Fe,wW=mW,Yl=Array.prototype,_W=function(i){var e=i.concat;return i===Yl||bW(Yl,i)&&e===Yl.concat?wW:e},EW=_W,SW=EW,$W=SW,Ba=G($W),OW=BR,ja=G(OW),IW=at,TW=ye,PW=Ao,CW=Mo,RW=It,xW=TW([].concat),Vg=IW("Reflect","ownKeys")||function(e){var t=PW.f(RW(e)),r=CW.f;return r?xW(t,r(e)):t},DW=W,AW=Vg;DW({target:"Reflect",stat:!0},{ownKeys:AW});var MW=_e,NW=MW.Reflect.ownKeys,kW=NW,FW=kW,qW=FW,BW=G(qW),jW=NR,$t=G(jW),LW=W,zW=wt,WR=Ta,WW=ae,HW=WW(function(){WR(1)});LW({target:"Object",stat:!0,forced:HW},{keys:function(e){return WR(zW(e))}});var UW=_e,VW=UW.Object.keys,GW=VW,KW=GW,YW=KW,Gg=G(YW),XW=Pn.forEach,JW=ka,ZW=JW("forEach"),QW=ZW?[].forEach:function(e){return XW(this,e,arguments.length>1?arguments[1]:void 0)},eH=W,Ob=QW;eH({target:"Array",proto:!0,forced:[].forEach!==Ob},{forEach:Ob});var tH=tt,rH=tH("Array","forEach"),iH=rH,nH=iH,oH=Er,sH=qe,aH=Fe,lH=nH,Xl=Array.prototype,uH={DOMTokenList:!0,NodeList:!0},HR=function(i){var e=i.forEach;return i===Xl||aH(Xl,i)&&e===Xl.forEach||sH(uH,oH(i))?lH:e},dH=HR,ci=G(dH),cH=W,hH=ye,fH=Ur,vH=hH([].reverse),Ib=[1,2];cH({target:"Array",proto:!0,forced:String(Ib)===String(Ib.reverse())},{reverse:function(){return fH(this)&&(this.length=this.length),vH(this)}});var pH=tt,gH=pH("Array","reverse"),yH=Fe,mH=gH,Jl=Array.prototype,bH=function(i){var e=i.reverse;return i===Jl||yH(Jl,i)&&e===Jl.reverse?mH:e},wH=bH,UR=wH,_H=UR,EH=G(_H),Tb=Sn,SH=TypeError,VR=function(i,e){if(!delete i[e])throw new SH("Cannot delete property "+Tb(e)+" of "+Tb(i))},$H=W,OH=wt,IH=Ia,TH=_a,PH=Tt,CH=FR,RH=Ea,xH=$a,DH=On,Zl=VR,AH=xo,MH=AH("splice"),NH=Math.max,kH=Math.min;$H({target:"Array",proto:!0,forced:!MH},{splice:function(e,t){var r=OH(this),n=PH(r),o=IH(e,n),s=arguments.length,a,l,u,d,c,h;for(s===0?a=l=0:s===1?(a=0,l=n-o):(a=s-2,l=kH(NH(TH(t),0),n-o)),RH(n+a-l),u=xH(r,l),d=0;d<l;d++)c=o+d,c in r&&DH(u,d,r[c]);if(u.length=l,a<l){for(d=o;d<n-l;d++)c=d+l,h=d+a,c in r?r[h]=r[c]:Zl(r,h);for(d=n;d>n-l+a;d--)Zl(r,d-1)}else if(a>l)for(d=n-l;d>o;d--)c=d+l-1,h=d+a-1,c in r?r[h]=r[c]:Zl(r,h);for(d=0;d<a;d++)r[d+o]=arguments[d+2];return CH(r,n-l+a),u}});var FH=tt,qH=FH("Array","splice"),BH=Fe,jH=qH,Ql=Array.prototype,LH=function(i){var e=i.splice;return i===Ql||BH(Ql,i)&&e===Ql.splice?jH:e},zH=LH,WH=zH,HH=WH,GR=G(HH),Pb=Ue,UH=ye,VH=Ve,GH=ae,eu=Ta,KH=Mo,YH=ga,XH=wt,JH=ya,ji=Object.assign,Cb=Object.defineProperty,ZH=UH([].concat),QH=!ji||GH(function(){if(Pb&&ji({b:1},ji(Cb({},"a",{enumerable:!0,get:function(){Cb(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var i={},e={},t=Symbol("assign detection"),r="abcdefghijklmnopqrst";return i[t]=7,r.split("").forEach(function(n){e[n]=n}),ji({},i)[t]!==7||eu(ji({},e)).join("")!==r})?function(e,t){for(var r=XH(e),n=arguments.length,o=1,s=KH.f,a=YH.f;n>o;)for(var l=JH(arguments[o++]),u=s?ZH(eu(l),s(l)):eu(l),d=u.length,c=0,h;d>c;)h=u[c++],(!Pb||VH(a,l,h))&&(r[h]=l[h]);return r}:ji,e4=W,Rb=QH;e4({target:"Object",stat:!0,forced:Object.assign!==Rb},{assign:Rb});var t4=_e,r4=t4.Object.assign,i4=r4,n4=i4,o4=n4,s4=G(o4),a4=W,l4=ae,u4=wt,KR=Ma,d4=oR,c4=l4(function(){KR(1)});a4({target:"Object",stat:!0,forced:c4,sham:!d4},{getPrototypeOf:function(e){return KR(u4(e))}});var h4=_e,f4=h4.Object.getPrototypeOf,v4=f4,p4=v4,g4=W,y4=Ue,m4=Si;g4({target:"Object",stat:!0,sham:!y4},{create:m4});var b4=_e,w4=b4.Object,_4=function(e,t){return w4.create(e,t)},E4=_4,YR=E4,S4=YR,$4=G(S4),Xp=_e,O4=bn;Xp.JSON||(Xp.JSON={stringify:JSON.stringify});var I4=function(e,t,r){return O4(Xp.JSON.stringify,null,arguments)},T4=I4,P4=T4,C4=P4,R4=G(C4),x4=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",D4=TypeError,XR=function(i,e){if(i<e)throw new D4("Not enough arguments");return i},JR=we,A4=bn,M4=Ce,N4=x4,k4=Wr,F4=qo,q4=XR,B4=JR.Function,j4=/MSIE .\./.test(k4)||N4&&function(){var i=JR.Bun.version.split(".");return i.length<3||i[0]==="0"&&(i[1]<3||i[1]==="3"&&i[2]==="0")}(),ZR=function(i,e){var t=e?2:1;return j4?function(r,n){var o=q4(arguments.length,1)>t,s=M4(r)?r:B4(r),a=o?F4(arguments,t):[],l=o?function(){A4(s,this,a)}:s;return e?i(l,n):i(l)}:i},L4=W,QR=we,z4=ZR,xb=z4(QR.setInterval,!0);L4({global:!0,bind:!0,forced:QR.setInterval!==xb},{setInterval:xb});var W4=W,ex=we,H4=ZR,Db=H4(ex.setTimeout,!0);W4({global:!0,bind:!0,forced:ex.setTimeout!==Db},{setTimeout:Db});var U4=_e,V4=U4.setTimeout,G4=V4,K4=G(G4),tx={exports:{}};(function(i){function e(r){if(r)return t(r);this._callbacks=new Map}function t(r){return Object.assign(r,e.prototype),r._callbacks=new Map,r}e.prototype.on=function(r,n){const o=this._callbacks.get(r)??[];return o.push(n),this._callbacks.set(r,o),this},e.prototype.once=function(r,n){const o=(...s)=>{this.off(r,o),n.apply(this,s)};return o.fn=n,this.on(r,o),this},e.prototype.off=function(r,n){if(r===void 0&&n===void 0)return this._callbacks.clear(),this;if(n===void 0)return this._callbacks.delete(r),this;const o=this._callbacks.get(r);if(o){for(const[s,a]of o.entries())if(a===n||a.fn===n){o.splice(s,1);break}o.length===0?this._callbacks.delete(r):this._callbacks.set(r,o)}return this},e.prototype.emit=function(r,...n){const o=this._callbacks.get(r);if(o){const s=[...o];for(const a of s)a.apply(this,n)}return this},e.prototype.listeners=function(r){return this._callbacks.get(r)??[]},e.prototype.listenerCount=function(r){if(r)return this.listeners(r).length;let n=0;for(const o of this._callbacks.values())n+=o.length;return n},e.prototype.hasListeners=function(r){return this.listenerCount(r)>0},e.prototype.addEventListener=e.prototype.on,e.prototype.removeListener=e.prototype.off,e.prototype.removeEventListener=e.prototype.off,e.prototype.removeAllListeners=e.prototype.off,i.exports=e})(tx);var Y4=tx.exports,X4=G(Y4);/*! 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 Ut(){return Ut=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Ut.apply(this,arguments)}function Mt(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}function $s(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}var Jp;typeof Object.assign!="function"?Jp=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r<arguments.length;r++){var n=arguments[r];if(n!=null)for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])}return t}:Jp=Object.assign;var hi=Jp,Ab=["","webkit","Moz","MS","ms","o"],J4=typeof document>"u"?{style:{}}:document.createElement("div"),Z4="function",Ki=Math.round,fi=Math.abs,Kg=Date.now;function La(i,e){for(var t,r,n=e[0].toUpperCase()+e.slice(1),o=0;o<Ab.length;){if(t=Ab[o],r=t?t+n:e,r in i)return r;o++}}var cr;typeof window>"u"?cr={}:cr=window;var rx=La(J4.style,"touchAction"),ix=rx!==void 0;function Q4(){if(!ix)return!1;var i={},e=cr.CSS&&cr.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return i[t]=e?cr.CSS.supports("touch-action",t):!0}),i}var nx="compute",ox="auto",Zp="manipulation",oi="none",go="pan-x",yo="pan-y",Os=Q4(),eU=/mobile|tablet|ip(ad|hone|od)|android/i,sx="ontouchstart"in cr,tU=La(cr,"PointerEvent")!==void 0,rU=sx&&eU.test(navigator.userAgent),Lo="touch",iU="pen",Yg="mouse",nU="kinect",oU=25,ot=1,Oi=2,Me=4,yt=8,Zs=1,zo=2,Wo=4,Ho=8,dn=16,tr=zo|Wo,si=Ho|dn,ax=tr|si,lx=["x","y"],Qs=["clientX","clientY"];function hr(i,e,t){var r;if(i)if(i.forEach)i.forEach(e,t);else if(i.length!==void 0)for(r=0;r<i.length;)e.call(t,i[r],r,i),r++;else for(r in i)i.hasOwnProperty(r)&&e.call(t,i[r],r,i)}function za(i,e){return typeof i===Z4?i.apply(e&&e[0]||void 0,e):i}function ei(i,e){return i.indexOf(e)>-1}function sU(i){if(ei(i,oi))return oi;var e=ei(i,go),t=ei(i,yo);return e&&t?oi:e||t?e?go:yo:ei(i,Zp)?Zp:ox}var ux=function(){function i(t,r){this.manager=t,this.set(r)}var e=i.prototype;return e.set=function(r){r===nx&&(r=this.compute()),ix&&this.manager.element.style&&Os[r]&&(this.manager.element.style[rx]=r),this.actions=r.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var r=[];return hr(this.manager.recognizers,function(n){za(n.options.enable,[n])&&(r=r.concat(n.getTouchAction()))}),sU(r.join(" "))},e.preventDefaults=function(r){var n=r.srcEvent,o=r.offsetDirection;if(this.manager.session.prevented){n.preventDefault();return}var s=this.actions,a=ei(s,oi)&&!Os[oi],l=ei(s,yo)&&!Os[yo],u=ei(s,go)&&!Os[go];if(a){var d=r.pointers.length===1,c=r.distance<2,h=r.deltaTime<250;if(d&&c&&h)return}if(!(u&&l)&&(a||l&&o&tr||u&&o&si))return this.preventSrc(n)},e.preventSrc=function(r){this.manager.session.prevented=!0,r.preventDefault()},i}();function Xg(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}function dx(i){var e=i.length;if(e===1)return{x:Ki(i[0].clientX),y:Ki(i[0].clientY)};for(var t=0,r=0,n=0;n<e;)t+=i[n].clientX,r+=i[n].clientY,n++;return{x:Ki(t/e),y:Ki(r/e)}}function Mb(i){for(var e=[],t=0;t<i.pointers.length;)e[t]={clientX:Ki(i.pointers[t].clientX),clientY:Ki(i.pointers[t].clientY)},t++;return{timeStamp:Kg(),pointers:e,center:dx(e),deltaX:i.deltaX,deltaY:i.deltaY}}function ea(i,e,t){t||(t=lx);var r=e[t[0]]-i[t[0]],n=e[t[1]]-i[t[1]];return Math.sqrt(r*r+n*n)}function Qp(i,e,t){t||(t=lx);var r=e[t[0]]-i[t[0]],n=e[t[1]]-i[t[1]];return Math.atan2(n,r)*180/Math.PI}function cx(i,e){return i===e?Zs:fi(i)>=fi(e)?i<0?zo:Wo:e<0?Ho:dn}function aU(i,e){var t=e.center,r=i.offsetDelta||{},n=i.prevDelta||{},o=i.prevInput||{};(e.eventType===ot||o.eventType===Me)&&(n=i.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=i.offsetDelta={x:t.x,y:t.y}),e.deltaX=n.x+(t.x-r.x),e.deltaY=n.y+(t.y-r.y)}function hx(i,e,t){return{x:e/i||0,y:t/i||0}}function lU(i,e){return ea(e[0],e[1],Qs)/ea(i[0],i[1],Qs)}function uU(i,e){return Qp(e[1],e[0],Qs)+Qp(i[1],i[0],Qs)}function dU(i,e){var t=i.lastInterval||e,r=e.timeStamp-t.timeStamp,n,o,s,a;if(e.eventType!==yt&&(r>oU||t.velocity===void 0)){var l=e.deltaX-t.deltaX,u=e.deltaY-t.deltaY,d=hx(r,l,u);o=d.x,s=d.y,n=fi(d.x)>fi(d.y)?d.x:d.y,a=cx(l,u),i.lastInterval=e}else n=t.velocity,o=t.velocityX,s=t.velocityY,a=t.direction;e.velocity=n,e.velocityX=o,e.velocityY=s,e.direction=a}function cU(i,e){var t=i.session,r=e.pointers,n=r.length;t.firstInput||(t.firstInput=Mb(e)),n>1&&!t.firstMultiple?t.firstMultiple=Mb(e):n===1&&(t.firstMultiple=!1);var o=t.firstInput,s=t.firstMultiple,a=s?s.center:o.center,l=e.center=dx(r);e.timeStamp=Kg(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=Qp(a,l),e.distance=ea(a,l),aU(t,e),e.offsetDirection=cx(e.deltaX,e.deltaY);var u=hx(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=fi(u.x)>fi(u.y)?u.x:u.y,e.scale=s?lU(s.pointers,r):1,e.rotation=s?uU(s.pointers,r):0,e.maxPointers=t.prevInput?e.pointers.length>t.prevInput.maxPointers?e.pointers.length:t.prevInput.maxPointers:e.pointers.length,dU(t,e);var d=i.element,c=e.srcEvent,h;c.composedPath?h=c.composedPath()[0]:c.path?h=c.path[0]:h=c.target,Xg(h,d)&&(d=h),e.target=d}function hU(i,e,t){var r=t.pointers.length,n=t.changedPointers.length,o=e&ot&&r-n===0,s=e&(Me|yt)&&r-n===0;t.isFirst=!!o,t.isFinal=!!s,o&&(i.session={}),t.eventType=e,cU(i,t),i.emit("hammer.input",t),i.recognize(t),i.session.prevInput=t}function mo(i){return i.trim().split(/\s+/g)}function io(i,e,t){hr(mo(e),function(r){i.addEventListener(r,t,!1)})}function no(i,e,t){hr(mo(e),function(r){i.removeEventListener(r,t,!1)})}function Nb(i){var e=i.ownerDocument||i;return e.defaultView||e.parentWindow||window}var Rn=function(){function i(t,r){var n=this;this.manager=t,this.callback=r,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(o){za(t.options.enable,[t])&&n.handler(o)},this.init()}var e=i.prototype;return e.handler=function(){},e.init=function(){this.evEl&&io(this.element,this.evEl,this.domHandler),this.evTarget&&io(this.target,this.evTarget,this.domHandler),this.evWin&&io(Nb(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&no(this.element,this.evEl,this.domHandler),this.evTarget&&no(this.target,this.evTarget,this.domHandler),this.evWin&&no(Nb(this.element),this.evWin,this.domHandler)},i}();function vi(i,e,t){if(i.indexOf&&!t)return i.indexOf(e);for(var r=0;r<i.length;){if(t&&i[r][t]==e||!t&&i[r]===e)return r;r++}return-1}var fU={pointerdown:ot,pointermove:Oi,pointerup:Me,pointercancel:yt,pointerout:yt},vU={2:Lo,3:iU,4:Yg,5:nU},fx="pointerdown",vx="pointermove pointerup pointercancel";cr.MSPointerEvent&&!cr.PointerEvent&&(fx="MSPointerDown",vx="MSPointerMove MSPointerUp MSPointerCancel");var px=function(i){Mt(e,i);function e(){var r,n=e.prototype;return n.evEl=fx,n.evWin=vx,r=i.apply(this,arguments)||this,r.store=r.manager.session.pointerEvents=[],r}var t=e.prototype;return t.handler=function(n){var o=this.store,s=!1,a=n.type.toLowerCase().replace("ms",""),l=fU[a],u=vU[n.pointerType]||n.pointerType,d=u===Lo,c=vi(o,n.pointerId,"pointerId");l&ot&&(n.button===0||d)?c<0&&(o.push(n),c=o.length-1):l&(Me|yt)&&(s=!0),!(c<0)&&(o[c]=n,this.callback(this.manager,l,{pointers:o,changedPointers:[n],pointerType:u,srcEvent:n}),s&&o.splice(c,1))},e}(Rn);function bo(i){return Array.prototype.slice.call(i,0)}function Jg(i,e,t){for(var r=[],n=[],o=0;o<i.length;){var s=e?i[o][e]:i[o];vi(n,s)<0&&r.push(i[o]),n[o]=s,o++}return t&&(e?r=r.sort(function(a,l){return a[e]>l[e]}):r=r.sort()),r}var pU={touchstart:ot,touchmove:Oi,touchend:Me,touchcancel:yt},gU="touchstart touchmove touchend touchcancel",Zg=function(i){Mt(e,i);function e(){var r;return e.prototype.evTarget=gU,r=i.apply(this,arguments)||this,r.targetIds={},r}var t=e.prototype;return t.handler=function(n){var o=pU[n.type],s=yU.call(this,n,o);s&&this.callback(this.manager,o,{pointers:s[0],changedPointers:s[1],pointerType:Lo,srcEvent:n})},e}(Rn);function yU(i,e){var t=bo(i.touches),r=this.targetIds;if(e&(ot|Oi)&&t.length===1)return r[t[0].identifier]=!0,[t,t];var n,o,s=bo(i.changedTouches),a=[],l=this.target;if(o=t.filter(function(u){return Xg(u.target,l)}),e===ot)for(n=0;n<o.length;)r[o[n].identifier]=!0,n++;for(n=0;n<s.length;)r[s[n].identifier]&&a.push(s[n]),e&(Me|yt)&&delete r[s[n].identifier],n++;if(a.length)return[Jg(o.concat(a),"identifier",!0),a]}var mU={mousedown:ot,mousemove:Oi,mouseup:Me},bU="mousedown",wU="mousemove mouseup",Qg=function(i){Mt(e,i);function e(){var r,n=e.prototype;return n.evEl=bU,n.evWin=wU,r=i.apply(this,arguments)||this,r.pressed=!1,r}var t=e.prototype;return t.handler=function(n){var o=mU[n.type];o&ot&&n.button===0&&(this.pressed=!0),o&Oi&&n.which!==1&&(o=Me),this.pressed&&(o&Me&&(this.pressed=!1),this.callback(this.manager,o,{pointers:[n],changedPointers:[n],pointerType:Yg,srcEvent:n}))},e}(Rn),_U=2500,kb=25;function Fb(i){var e=i.changedPointers,t=e[0];if(t.identifier===this.primaryTouch){var r={x:t.clientX,y:t.clientY},n=this.lastTouches;this.lastTouches.push(r);var o=function(){var a=n.indexOf(r);a>-1&&n.splice(a,1)};setTimeout(o,_U)}}function EU(i,e){i&ot?(this.primaryTouch=e.changedPointers[0].identifier,Fb.call(this,e)):i&(Me|yt)&&Fb.call(this,e)}function SU(i){for(var e=i.srcEvent.clientX,t=i.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var n=this.lastTouches[r],o=Math.abs(e-n.x),s=Math.abs(t-n.y);if(o<=kb&&s<=kb)return!0}return!1}var gx=function(){var i=function(e){Mt(t,e);function t(n,o){var s;return s=e.call(this,n,o)||this,s.handler=function(a,l,u){var d=u.pointerType===Lo,c=u.pointerType===Yg;if(!(c&&u.sourceCapabilities&&u.sourceCapabilities.firesTouchEvents)){if(d)EU.call($s($s(s)),l,u);else if(c&&SU.call($s($s(s)),u))return;s.callback(a,l,u)}},s.touch=new Zg(s.manager,s.handler),s.mouse=new Qg(s.manager,s.handler),s.primaryTouch=null,s.lastTouches=[],s}var r=t.prototype;return r.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Rn);return i}();function $U(i){var e,t=i.options.inputClass;return t?e=t:tU?e=px:rU?e=Zg:sx?e=gx:e=Qg,new e(i,hU)}function Yi(i,e,t){return Array.isArray(i)?(hr(i,t[e],t),!0):!1}var js=1,Dt=2,cn=4,Ar=8,fr=Ar,wo=16,Zt=32,OU=1;function IU(){return OU++}function Is(i,e){var t=e.manager;return t?t.get(i):i}function qb(i){return i&wo?"cancel":i&Ar?"end":i&cn?"move":i&Dt?"start":""}var Uo=function(){function i(t){t===void 0&&(t={}),this.options=Ut({enable:!0},t),this.id=IU(),this.manager=null,this.state=js,this.simultaneous={},this.requireFail=[]}var e=i.prototype;return e.set=function(r){return hi(this.options,r),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(r){if(Yi(r,"recognizeWith",this))return this;var n=this.simultaneous;return r=Is(r,this),n[r.id]||(n[r.id]=r,r.recognizeWith(this)),this},e.dropRecognizeWith=function(r){return Yi(r,"dropRecognizeWith",this)?this:(r=Is(r,this),delete this.simultaneous[r.id],this)},e.requireFailure=function(r){if(Yi(r,"requireFailure",this))return this;var n=this.requireFail;return r=Is(r,this),vi(n,r)===-1&&(n.push(r),r.requireFailure(this)),this},e.dropRequireFailure=function(r){if(Yi(r,"dropRequireFailure",this))return this;r=Is(r,this);var n=vi(this.requireFail,r);return n>-1&&this.requireFail.splice(n,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(r){return!!this.simultaneous[r.id]},e.emit=function(r){var n=this,o=this.state;function s(a){n.manager.emit(a,r)}o<Ar&&s(n.options.event+qb(o)),s(n.options.event),r.additionalEvent&&s(r.additionalEvent),o>=Ar&&s(n.options.event+qb(o))},e.tryEmit=function(r){if(this.canEmit())return this.emit(r);this.state=Zt},e.canEmit=function(){for(var r=0;r<this.requireFail.length;){if(!(this.requireFail[r].state&(Zt|js)))return!1;r++}return!0},e.recognize=function(r){var n=hi({},r);if(!za(this.options.enable,[this,n])){this.reset(),this.state=Zt;return}this.state&(fr|wo|Zt)&&(this.state=js),this.state=this.process(n),this.state&(Dt|cn|Ar|wo)&&this.tryEmit(n)},e.process=function(r){},e.getTouchAction=function(){},e.reset=function(){},i}(),eg=function(i){Mt(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Ut({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},r))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var t=e.prototype;return t.getTouchAction=function(){return[Zp]},t.process=function(n){var o=this,s=this.options,a=n.pointers.length===s.pointers,l=n.distance<s.threshold,u=n.deltaTime<s.time;if(this.reset(),n.eventType&ot&&this.count===0)return this.failTimeout();if(l&&u&&a){if(n.eventType!==Me)return this.failTimeout();var d=this.pTime?n.timeStamp-this.pTime<s.interval:!0,c=!this.pCenter||ea(this.pCenter,n.center)<s.posThreshold;this.pTime=n.timeStamp,this.pCenter=n.center,!c||!d?this.count=1:this.count+=1,this._input=n;var h=this.count%s.taps;if(h===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){o.state=fr,o.tryEmit()},s.interval),Dt):fr}return Zt},t.failTimeout=function(){var n=this;return this._timer=setTimeout(function(){n.state=Zt},this.options.interval),Zt},t.reset=function(){clearTimeout(this._timer)},t.emit=function(){this.state===fr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(Uo),hn=function(i){Mt(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Ut({pointers:1},r))||this}var t=e.prototype;return t.attrTest=function(n){var o=this.options.pointers;return o===0||n.pointers.length===o},t.process=function(n){var o=this.state,s=n.eventType,a=o&(Dt|cn),l=this.attrTest(n);return a&&(s&yt||!l)?o|wo:a||l?s&Me?o|Ar:o&Dt?o|cn:Dt:Zt},e}(Uo);function yx(i){return i===dn?"down":i===Ho?"up":i===zo?"left":i===Wo?"right":""}var ey=function(i){Mt(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Ut({event:"pan",threshold:10,pointers:1,direction:ax},r))||this,n.pX=null,n.pY=null,n}var t=e.prototype;return t.getTouchAction=function(){var n=this.options.direction,o=[];return n&tr&&o.push(yo),n&si&&o.push(go),o},t.directionTest=function(n){var o=this.options,s=!0,a=n.distance,l=n.direction,u=n.deltaX,d=n.deltaY;return l&o.direction||(o.direction&tr?(l=u===0?Zs:u<0?zo:Wo,s=u!==this.pX,a=Math.abs(n.deltaX)):(l=d===0?Zs:d<0?Ho:dn,s=d!==this.pY,a=Math.abs(n.deltaY))),n.direction=l,s&&a>o.threshold&&l&o.direction},t.attrTest=function(n){return hn.prototype.attrTest.call(this,n)&&(this.state&Dt||!(this.state&Dt)&&this.directionTest(n))},t.emit=function(n){this.pX=n.deltaX,this.pY=n.deltaY;var o=yx(n.direction);o&&(n.additionalEvent=this.options.event+o),i.prototype.emit.call(this,n)},e}(hn),mx=function(i){Mt(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Ut({event:"swipe",threshold:10,velocity:.3,direction:tr|si,pointers:1},r))||this}var t=e.prototype;return t.getTouchAction=function(){return ey.prototype.getTouchAction.call(this)},t.attrTest=function(n){var o=this.options.direction,s;return o&(tr|si)?s=n.overallVelocity:o&tr?s=n.overallVelocityX:o&si&&(s=n.overallVelocityY),i.prototype.attrTest.call(this,n)&&o&n.offsetDirection&&n.distance>this.options.threshold&&n.maxPointers===this.options.pointers&&fi(s)>this.options.velocity&&n.eventType&Me},t.emit=function(n){var o=yx(n.offsetDirection);o&&this.manager.emit(this.options.event+o,n),this.manager.emit(this.options.event,n)},e}(hn),bx=function(i){Mt(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Ut({event:"pinch",threshold:0,pointers:2},r))||this}var t=e.prototype;return t.getTouchAction=function(){return[oi]},t.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.scale-1)>this.options.threshold||this.state&Dt)},t.emit=function(n){if(n.scale!==1){var o=n.scale<1?"in":"out";n.additionalEvent=this.options.event+o}i.prototype.emit.call(this,n)},e}(hn),wx=function(i){Mt(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Ut({event:"rotate",threshold:0,pointers:2},r))||this}var t=e.prototype;return t.getTouchAction=function(){return[oi]},t.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.rotation)>this.options.threshold||this.state&Dt)},e}(hn),_x=function(i){Mt(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Ut({event:"press",pointers:1,time:251,threshold:9},r))||this,n._timer=null,n._input=null,n}var t=e.prototype;return t.getTouchAction=function(){return[ox]},t.process=function(n){var o=this,s=this.options,a=n.pointers.length===s.pointers,l=n.distance<s.threshold,u=n.deltaTime>s.time;if(this._input=n,!l||!a||n.eventType&(Me|yt)&&!u)this.reset();else if(n.eventType&ot)this.reset(),this._timer=setTimeout(function(){o.state=fr,o.tryEmit()},s.time);else if(n.eventType&Me)return fr;return Zt},t.reset=function(){clearTimeout(this._timer)},t.emit=function(n){this.state===fr&&(n&&n.eventType&Me?this.manager.emit(this.options.event+"up",n):(this._input.timeStamp=Kg(),this.manager.emit(this.options.event,this._input)))},e}(Uo),Ex={domEvents:!1,touchAction:nx,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Bb=[[wx,{enable:!1}],[bx,{enable:!1},["rotate"]],[mx,{direction:tr}],[ey,{direction:tr},["swipe"]],[eg],[eg,{event:"doubletap",taps:2},["tap"]],[_x]],TU=1,jb=2;function Lb(i,e){var t=i.element;if(t.style){var r;hr(i.options.cssProps,function(n,o){r=La(t.style,o),e?(i.oldCssProps[r]=t.style[r],t.style[r]=n):t.style[r]=i.oldCssProps[r]||""}),e||(i.oldCssProps={})}}function PU(i,e){var t=document.createEvent("Event");t.initEvent(i,!0,!0),t.gesture=e,e.target.dispatchEvent(t)}var zb=function(){function i(t,r){var n=this;this.options=hi({},Ex,r||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=$U(this),this.touchAction=new ux(this,this.options.touchAction),Lb(this,!0),hr(this.options.recognizers,function(o){var s=n.add(new o[0](o[1]));o[2]&&s.recognizeWith(o[2]),o[3]&&s.requireFailure(o[3])},this)}var e=i.prototype;return e.set=function(r){return hi(this.options,r),r.touchAction&&this.touchAction.update(),r.inputTarget&&(this.input.destroy(),this.input.target=r.inputTarget,this.input.init()),this},e.stop=function(r){this.session.stopped=r?jb:TU},e.recognize=function(r){var n=this.session;if(!n.stopped){this.touchAction.preventDefaults(r);var o,s=this.recognizers,a=n.curRecognizer;(!a||a&&a.state&fr)&&(n.curRecognizer=null,a=null);for(var l=0;l<s.length;)o=s[l],n.stopped!==jb&&(!a||o===a||o.canRecognizeWith(a))?o.recognize(r):o.reset(),!a&&o.state&(Dt|cn|Ar)&&(n.curRecognizer=o,a=o),l++}},e.get=function(r){if(r instanceof Uo)return r;for(var n=this.recognizers,o=0;o<n.length;o++)if(n[o].options.event===r)return n[o];return null},e.add=function(r){if(Yi(r,"add",this))return this;var n=this.get(r.options.event);return n&&this.remove(n),this.recognizers.push(r),r.manager=this,this.touchAction.update(),r},e.remove=function(r){if(Yi(r,"remove",this))return this;var n=this.get(r);if(r){var o=this.recognizers,s=vi(o,n);s!==-1&&(o.splice(s,1),this.touchAction.update())}return this},e.on=function(r,n){if(r===void 0||n===void 0)return this;var o=this.handlers;return hr(mo(r),function(s){o[s]=o[s]||[],o[s].push(n)}),this},e.off=function(r,n){if(r===void 0)return this;var o=this.handlers;return hr(mo(r),function(s){n?o[s]&&o[s].splice(vi(o[s],n),1):delete o[s]}),this},e.emit=function(r,n){this.options.domEvents&&PU(r,n);var o=this.handlers[r]&&this.handlers[r].slice();if(!(!o||!o.length)){n.type=r,n.preventDefault=function(){n.srcEvent.preventDefault()};for(var s=0;s<o.length;)o[s](n),s++}},e.destroy=function(){this.element&&Lb(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},i}(),CU={touchstart:ot,touchmove:Oi,touchend:Me,touchcancel:yt},RU="touchstart",xU="touchstart touchmove touchend touchcancel",DU=function(i){Mt(e,i);function e(){var r,n=e.prototype;return n.evTarget=RU,n.evWin=xU,r=i.apply(this,arguments)||this,r.started=!1,r}var t=e.prototype;return t.handler=function(n){var o=CU[n.type];if(o===ot&&(this.started=!0),!!this.started){var s=AU.call(this,n,o);o&(Me|yt)&&s[0].length-s[1].length===0&&(this.started=!1),this.callback(this.manager,o,{pointers:s[0],changedPointers:s[1],pointerType:Lo,srcEvent:n})}},e}(Rn);function AU(i,e){var t=bo(i.touches),r=bo(i.changedTouches);return e&(Me|yt)&&(t=Jg(t.concat(r),"identifier",!0)),[t,r]}function Sx(i,e,t){var r="DEPRECATED METHOD: "+e+`
`+t+` AT 
`;return function(){var n=new Error("get-stack-trace"),o=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=window.console&&(window.console.warn||window.console.log);return s&&s.call(window.console,r,o),i.apply(this,arguments)}}var $x=Sx(function(i,e,t){for(var r=Object.keys(e),n=0;n<r.length;)(!t||t&&i[r[n]]===void 0)&&(i[r[n]]=e[r[n]]),n++;return i},"extend","Use `assign`."),MU=Sx(function(i,e){return $x(i,e,!0)},"merge","Use `assign`.");function NU(i,e,t){var r=e.prototype,n;n=i.prototype=Object.create(r),n.constructor=i,n._super=r,t&&hi(n,t)}function Wb(i,e){return function(){return i.apply(e,arguments)}}var kU=function(){var i=function(t,r){return r===void 0&&(r={}),new zb(t,Ut({recognizers:Bb.concat()},r))};return i.VERSION="2.0.17-rc",i.DIRECTION_ALL=ax,i.DIRECTION_DOWN=dn,i.DIRECTION_LEFT=zo,i.DIRECTION_RIGHT=Wo,i.DIRECTION_UP=Ho,i.DIRECTION_HORIZONTAL=tr,i.DIRECTION_VERTICAL=si,i.DIRECTION_NONE=Zs,i.DIRECTION_DOWN=dn,i.INPUT_START=ot,i.INPUT_MOVE=Oi,i.INPUT_END=Me,i.INPUT_CANCEL=yt,i.STATE_POSSIBLE=js,i.STATE_BEGAN=Dt,i.STATE_CHANGED=cn,i.STATE_ENDED=Ar,i.STATE_RECOGNIZED=fr,i.STATE_CANCELLED=wo,i.STATE_FAILED=Zt,i.Manager=zb,i.Input=Rn,i.TouchAction=ux,i.TouchInput=Zg,i.MouseInput=Qg,i.PointerEventInput=px,i.TouchMouseInput=gx,i.SingleTouchInput=DU,i.Recognizer=Uo,i.AttrRecognizer=hn,i.Tap=eg,i.Pan=ey,i.Swipe=mx,i.Pinch=bx,i.Rotate=wx,i.Press=_x,i.on=io,i.off=no,i.each=hr,i.merge=MU,i.extend=$x,i.bindFn=Wb,i.assign=hi,i.inherit=NU,i.bindFn=Wb,i.prefixed=La,i.toArray=bo,i.inArray=vi,i.uniqueArray=Jg,i.splitStr=mo,i.boolOrFn=za,i.hasParent=Xg,i.addEventListeners=io,i.removeEventListeners=no,i.defaults=hi({},Ex,{preset:Bb}),i}(),FU=kU;function Ox(i,e){var t=typeof qa<"u"&&Ug(i)||i["@@iterator"];if(!t){if($t(i)||(t=qU(i))||e){t&&(i=t);var r=0,n=function(){};return{s:n,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(u){throw u},f:n}}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 o=!0,s=!1,a;return{s:function(){t=t.call(i)},n:function(){var u=t.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw a}}}}function qU(i,e){var t;if(i){if(typeof i=="string")return Hb(i,e);var r=ja(t=Object.prototype.toString.call(i)).call(t,8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return Hg(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hb(i,e)}}function Hb(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}var Ix=qa("DELETE");function BU(i){for(var e,t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return Tx.apply(void 0,Ba(e=[{},i]).call(e,r))}function Tx(){var i=ta.apply(void 0,arguments);return Cx(i),i}function ta(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];if(e.length<2)return e[0];if(e.length>2){var r;return ta.apply(void 0,Ba(r=[Tx(e[0],e[1])]).call(r,pt(ja(e).call(e,2))))}var n=e[0],o=e[1];if(n instanceof Date&&o instanceof Date)return n.setTime(o.getTime()),n;var s=Ox(BW(o)),a;try{for(s.s();!(a=s.n()).done;){var l=a.value;Object.prototype.propertyIsEnumerable.call(o,l)&&(o[l]===Ix?delete n[l]:n[l]!==null&&o[l]!==null&&typeof n[l]=="object"&&typeof o[l]=="object"&&!$t(n[l])&&!$t(o[l])?n[l]=ta(n[l],o[l]):n[l]=Px(o[l]))}}catch(u){s.e(u)}finally{s.f()}return n}function Px(i){return $t(i)?zt(i).call(i,function(e){return Px(e)}):typeof i=="object"&&i!==null?i instanceof Date?new Date(i.getTime()):ta({},i):i}function Cx(i){for(var e=0,t=Gg(i);e<t.length;e++){var r=t[e];i[r]===Ix?delete i[r]:typeof i[r]=="object"&&i[r]!==null&&Cx(i[r])}}function jU(){var i=function(){};return{on:i,off:i,destroy:i,emit:i,get(){return{set:i}}}}var LU=typeof window<"u"?window.Hammer||FU:function(){return jU()};function lr(i){var e=this,t;this._cleanupQueue=[],this.active=!1,this._dom={container:i,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(function(){e._dom.overlay.parentNode.removeChild(e._dom.overlay)});var r=LU(this._dom.overlay);r.on("tap",OR(t=this._onTapOverlay).call(t,this)),this._cleanupQueue.push(function(){r.destroy()});var n=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];ci(n).call(n,function(o){r.on(o,function(s){s.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=function(o){zU(o.target,i)||e.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(function(){document.body.removeEventListener("click",e._onClick)})),this._escListener=function(o){("key"in o?o.key==="Escape":o.keyCode===27)&&e.deactivate()}}X4(lr.prototype);lr.current=null;lr.prototype.destroy=function(){var i,e;this.deactivate();var t=Ox(EH(i=GR(e=this._cleanupQueue).call(e,0)).call(i)),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;n()}}catch(o){t.e(o)}finally{t.f()}};lr.prototype.activate=function(){lr.current&&lr.current.deactivate(),lr.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)};lr.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")};lr.prototype._onTapOverlay=function(i){this.activate(),i.srcEvent.stopPropagation()};function zU(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}var WU=Sa,HU=Sn,UU=TypeError,Rx=function(i){if(WU(i))return i;throw new UU(HU(i)+" is not a constructor")},VU=W,GU=at,tu=bn,KU=SR,Ub=Rx,YU=It,Vb=Je,XU=Si,xx=ae,ty=GU("Reflect","construct"),JU=Object.prototype,ZU=[].push,Dx=xx(function(){function i(){}return!(ty(function(){},[],i)instanceof i)}),Ax=!xx(function(){ty(function(){})}),Gb=Dx||Ax;VU({target:"Reflect",stat:!0,forced:Gb,sham:Gb},{construct:function(e,t){Ub(e),YU(t);var r=arguments.length<3?e:Ub(arguments[2]);if(Ax&&!Dx)return ty(e,t,r);if(e===r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return tu(ZU,n,t),new(tu(KU,e,n))}var o=r.prototype,s=XU(Vb(o)?o:JU),a=tu(e,s,t);return Vb(a)?a:s}});var QU=_e,eV=QU.Reflect.construct,tV=eV,rV=tV,iV=rV,Ls=G(iV),nV=_e,oV=nV.Object.getOwnPropertySymbols,sV=oV,aV=sV,lV=aV,Kb=G(lV),Mx={exports:{}},uV=W,dV=ae,cV=ir,Nx=wi.f,kx=Ue,hV=!kx||dV(function(){Nx(1)});uV({target:"Object",stat:!0,forced:hV,sham:!kx},{getOwnPropertyDescriptor:function(e,t){return Nx(cV(e),t)}});var fV=_e,Fx=fV.Object,vV=Mx.exports=function(e,t){return Fx.getOwnPropertyDescriptor(e,t)};Fx.getOwnPropertyDescriptor.sham&&(vV.sham=!0);var pV=Mx.exports,gV=pV,yV=gV,mV=yV,qx=G(mV),bV=W,wV=Ue,_V=Vg,EV=ir,SV=wi,$V=On;bV({target:"Object",stat:!0,sham:!wV},{getOwnPropertyDescriptors:function(e){for(var t=EV(e),r=SV.f,n=_V(t),o={},s=0,a,l;n.length>s;)l=r(t,a=n[s++]),l!==void 0&&$V(o,a,l);return o}});var OV=_e,IV=OV.Object.getOwnPropertyDescriptors,TV=IV,PV=TV,CV=PV,Yb=G(CV),Bx={exports:{}},RV=W,xV=Ue,Xb=Oa.f;RV({target:"Object",stat:!0,forced:Object.defineProperties!==Xb,sham:!xV},{defineProperties:Xb});var DV=_e,jx=DV.Object,AV=Bx.exports=function(e,t){return jx.defineProperties(e,t)};jx.defineProperties.sham&&(AV.sham=!0);var MV=Bx.exports,NV=MV,kV=NV,FV=kV,qV=G(FV),BV=yC,jV=G(BV);function Lx(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}var LV=YR,zV=LV,WV=zV,HV=WV,zx=HV,UV=G(zx),VV=W,GV=lR;VV({target:"Object",stat:!0},{setPrototypeOf:GV});var KV=_e,YV=KV.Object.setPrototypeOf,XV=YV,JV=XV,ZV=JV,QV=ZV,eG=QV,tG=eG,Wx=tG,tg=G(Wx),rG=$R,iG=rG,nG=iG,oG=nG,sG=oG,Hx=G(sG);function rg(i,e){var t;return rg=tg?Hx(t=tg).call(t):function(n,o){return n.__proto__=o,n},rg(i,e)}function aG(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=UV(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),wa(i,"prototype",{writable:!1}),e&&rg(i,e)}function lG(i,e){if(e&&(un(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lx(i)}var uG=p4,dG=uG,cG=dG,hG=cG,Ux=hG,Jb=G(Ux);function ra(i){var e;return ra=tg?Hx(e=Jb).call(e):function(r){return r.__proto__||Jb(r)},ra(i)}var Vx={exports:{}},Gx={exports:{}};(function(i){var e=Lg,t=bR;function r(n){"@babel/helpers - typeof";return i.exports=r=typeof e=="function"&&typeof t=="symbol"?function(o){return typeof o}:function(o){return o&&typeof e=="function"&&o.constructor===e&&o!==e.prototype?"symbol":typeof o},i.exports.__esModule=!0,i.exports.default=i.exports,r(n)}i.exports=r,i.exports.__esModule=!0,i.exports.default=i.exports})(Gx);var fG=Gx.exports,vG=HR,pG=vG,gG=pG,yG=gG,mG=yG,Zb=qe,bG=Vg,wG=wi,_G=_t,EG=function(i,e,t){for(var r=bG(e),n=_G.f,o=wG.f,s=0;s<r.length;s++){var a=r[s];!Zb(i,a)&&!(t&&Zb(t,a))&&n(i,a,o(e,a))}},SG=Je,$G=_r,OG=function(i,e){SG(e)&&"cause"in e&&$G(i,"cause",e.cause)},IG=ye,Kx=Error,TG=IG("".replace),PG=function(i){return String(new Kx(i).stack)}("zxcasd"),Yx=/\n\s*at [^:]*:[^\n]*/,CG=Yx.test(PG),RG=function(i,e){if(CG&&typeof i=="string"&&!Kx.prepareStackTrace)for(;e--;)i=TG(i,Yx,"");return i},xG=ae,DG=_i,AG=!xG(function(){var i=new Error("a");return"stack"in i?(Object.defineProperty(i,"stack",DG(1,7)),i.stack!==7):!0}),MG=_r,NG=RG,kG=AG,Qb=Error.captureStackTrace,FG=function(i,e,t,r){kG&&(Qb?Qb(i,e):MG(i,"stack",NG(t,r)))},qG=Hr,BG=Ve,jG=It,LG=Sn,zG=PR,WG=Tt,ew=Fe,HG=Wg,UG=Fa,tw=TR,VG=TypeError,zs=function(i,e){this.stopped=i,this.result=e},rw=zs.prototype,Ii=function(i,e,t){var r=t&&t.that,n=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),s=!!(t&&t.IS_ITERATOR),a=!!(t&&t.INTERRUPTED),l=qG(e,r),u,d,c,h,f,v,g,y=function(m){return u&&tw(u,"normal",m),new zs(!0,m)},p=function(m){return n?(jG(m),a?l(m[0],m[1],y):l(m[0],m[1])):a?l(m,y):l(m)};if(o)u=i.iterator;else if(s)u=i;else{if(d=UG(i),!d)throw new VG(LG(i)+" is not iterable");if(zG(d)){for(c=0,h=WG(i);h>c;c++)if(f=p(i[c]),f&&ew(rw,f))return f;return new zs(!1)}u=HG(i,d)}for(v=o?i.next:u.next;!(g=BG(v,u)).done;){try{f=p(g.value)}catch(m){tw(u,"throw",m)}if(typeof f=="object"&&f&&ew(rw,f))return f}return new zs(!1)},GG=Ei,KG=function(i,e){return i===void 0?arguments.length<2?"":e:GG(i)},YG=W,XG=Fe,JG=Ma,ia=lR,ZG=EG,Xx=Si,ru=_r,iu=_i,QG=OG,eK=FG,tK=Ii,rK=KG,iK=$e,nK=iK("toStringTag"),na=Error,oK=[].push,fn=function(e,t){var r=XG(nu,this),n;ia?n=ia(new na,r?JG(this):nu):(n=r?this:Xx(nu),ru(n,nK,"Error")),t!==void 0&&ru(n,"message",rK(t)),eK(n,fn,n.stack,1),arguments.length>2&&QG(n,arguments[2]);var o=[];return tK(e,oK,{that:o}),ru(n,"errors",o),n};ia?ia(fn,na):ZG(fn,na,{name:!0});var nu=fn.prototype=Xx(na.prototype,{constructor:iu(1,fn),message:iu(1,""),name:iu(1,"AggregateError")});YG({global:!0},{AggregateError:fn});var sK=at,aK=Ag,lK=$e,uK=Ue,iw=lK("species"),Jx=function(i){var e=sK(i);uK&&e&&!e[iw]&&aK(e,iw,{configurable:!0,get:function(){return this}})},dK=Fe,cK=TypeError,ry=function(i,e){if(dK(e,i))return i;throw new cK("Incorrect invocation")},nw=It,hK=Rx,fK=wn,vK=$e,pK=vK("species"),Zx=function(i,e){var t=nw(i).constructor,r;return t===void 0||fK(r=nw(t)[pK])?e:hK(r)},gK=Wr,Qx=/(?:ipad|iphone|ipod).*applewebkit/i.test(gK),Ot=we,yK=bn,mK=Hr,ow=Ce,bK=qe,eD=ae,sw=TC,wK=qo,aw=Pg,_K=XR,EK=Qx,SK=jo,ig=Ot.setImmediate,lw=Ot.clearImmediate,$K=Ot.process,ou=Ot.Dispatch,OK=Ot.Function,uw=Ot.MessageChannel,IK=Ot.String,su=0,oo={},dw="onreadystatechange",_o,Xr,au,lu;eD(function(){_o=Ot.location});var iy=function(i){if(bK(oo,i)){var e=oo[i];delete oo[i],e()}},uu=function(i){return function(){iy(i)}},cw=function(i){iy(i.data)},hw=function(i){Ot.postMessage(IK(i),_o.protocol+"//"+_o.host)};(!ig||!lw)&&(ig=function(e){_K(arguments.length,1);var t=ow(e)?e:OK(e),r=wK(arguments,1);return oo[++su]=function(){yK(t,void 0,r)},Xr(su),su},lw=function(e){delete oo[e]},SK?Xr=function(i){$K.nextTick(uu(i))}:ou&&ou.now?Xr=function(i){ou.now(uu(i))}:uw&&!EK?(au=new uw,lu=au.port2,au.port1.onmessage=cw,Xr=mK(lu.postMessage,lu)):Ot.addEventListener&&ow(Ot.postMessage)&&!Ot.importScripts&&_o&&_o.protocol!=="file:"&&!eD(hw)?(Xr=hw,Ot.addEventListener("message",cw,!1)):dw in aw("script")?Xr=function(i){sw.appendChild(aw("script"))[dw]=function(){sw.removeChild(this),iy(i)}}:Xr=function(i){setTimeout(uu(i),0)});var tD={set:ig},rD=function(){this.head=null,this.tail=null};rD.prototype={add:function(i){var e={item:i,next:null},t=this.tail;t?t.next=e:this.head=e,this.tail=e},get:function(){var i=this.head;if(i){var e=this.head=i.next;return e===null&&(this.tail=null),i.item}}};var iD=rD,TK=Wr,PK=/ipad|iphone|ipod/i.test(TK)&&typeof Pebble<"u",CK=Wr,RK=/web0s(?!.*chrome)/i.test(CK),pi=we,fw=Hr,xK=wi.f,du=tD.set,DK=iD,AK=Qx,MK=PK,NK=RK,cu=jo,vw=pi.MutationObserver||pi.WebKitMutationObserver,pw=pi.document,gw=pi.process,Ts=pi.Promise,yw=xK(pi,"queueMicrotask"),ng=yw&&yw.value,Li,hu,fu,Ps,mw;if(!ng){var Cs=new DK,Rs=function(){var i,e;for(cu&&(i=gw.domain)&&i.exit();e=Cs.get();)try{e()}catch(t){throw Cs.head&&Li(),t}i&&i.enter()};!AK&&!cu&&!NK&&vw&&pw?(hu=!0,fu=pw.createTextNode(""),new vw(Rs).observe(fu,{characterData:!0}),Li=function(){fu.data=hu=!hu}):!MK&&Ts&&Ts.resolve?(Ps=Ts.resolve(void 0),Ps.constructor=Ts,mw=fw(Ps.then,Ps),Li=function(){mw(Rs)}):cu?Li=function(){gw.nextTick(Rs)}:(du=fw(du,pi),Li=function(){du(Rs)}),ng=function(i){Cs.head||Li(),Cs.add(i)}}var kK=ng,FK=function(i,e){try{arguments.length===1?console.error(i):console.error(i,e)}catch{}},xn=function(i){try{return{error:!1,value:i()}}catch(e){return{error:!0,value:e}}},qK=we,Dn=qK.Promise,nD=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",BK=nD,jK=jo,LK=!BK&&!jK&&typeof window=="object"&&typeof document=="object",zK=we,so=Dn,WK=Ce,HK=vC,UK=wC,VK=$e,GK=LK,KK=nD,vu=_n,bw=so&&so.prototype,YK=VK("species"),ww=!1,oD=WK(zK.PromiseRejectionEvent),XK=HK("Promise",function(){var i=UK(so),e=i!==String(so);if(!e&&vu===66||!(bw.catch&&bw.finally))return!0;if(!vu||vu<51||!/native code/.test(i)){var t=new so(function(o){o(1)}),r=function(o){o(function(){},function(){})},n=t.constructor={};if(n[YK]=r,ww=t.then(function(){})instanceof r,!ww)return!0}return!e&&(GK||KK)&&!oD}),Vo={CONSTRUCTOR:XK,REJECTION_EVENT:oD},nr={},_w=bt,JK=TypeError,ZK=function(i){var e,t;this.promise=new i(function(r,n){if(e!==void 0||t!==void 0)throw new JK("Bad Promise constructor");e=r,t=n}),this.resolve=_w(e),this.reject=_w(t)};nr.f=function(i){return new ZK(i)};var QK=W,oa=jo,qr=we,Go=Ve,e6=In,t6=$i,r6=Jx,i6=bt,og=Ce,n6=Je,o6=ry,s6=Zx,sD=tD.set,ny=kK,a6=FK,l6=xn,u6=iD,aD=Tn,sg=Dn,lD=Vo,uD=nr,Wa="Promise",dD=lD.CONSTRUCTOR,d6=lD.REJECTION_EVENT,pu=aD.getterFor(Wa),c6=aD.set,h6=sg&&sg.prototype,Xi=sg,gu=h6,cD=qr.TypeError,ag=qr.document,oy=qr.process,lg=uD.f,f6=lg,v6=!!(ag&&ag.createEvent&&qr.dispatchEvent),hD="unhandledrejection",p6="rejectionhandled",Ew=0,fD=1,g6=2,sy=1,vD=2,xs,Sw,y6,pD=function(i){var e;return n6(i)&&og(e=i.then)?e:!1},gD=function(i,e){var t=e.value,r=e.state===fD,n=r?i.ok:i.fail,o=i.resolve,s=i.reject,a=i.domain,l,u,d;try{n?(r||(e.rejection===vD&&b6(e),e.rejection=sy),n===!0?l=t:(a&&a.enter(),l=n(t),a&&(a.exit(),d=!0)),l===i.promise?s(new cD("Promise-chain cycle")):(u=pD(l))?Go(u,l,o,s):o(l)):s(t)}catch(c){a&&!d&&a.exit(),s(c)}},yD=function(i,e){i.notified||(i.notified=!0,ny(function(){for(var t=i.reactions,r;r=t.get();)gD(r,i);i.notified=!1,e&&!i.rejection&&m6(i)}))},mD=function(i,e,t){var r,n;v6?(r=ag.createEvent("Event"),r.promise=e,r.reason=t,r.initEvent(i,!1,!0),qr.dispatchEvent(r)):r={promise:e,reason:t},!d6&&(n=qr["on"+i])?n(r):i===hD&&a6("Unhandled promise rejection",t)},m6=function(i){Go(sD,qr,function(){var e=i.facade,t=i.value,r=$w(i),n;if(r&&(n=l6(function(){oa?oy.emit("unhandledRejection",t,e):mD(hD,e,t)}),i.rejection=oa||$w(i)?vD:sy,n.error))throw n.value})},$w=function(i){return i.rejection!==sy&&!i.parent},b6=function(i){Go(sD,qr,function(){var e=i.facade;oa?oy.emit("rejectionHandled",e):mD(p6,e,i.value)})},Ji=function(i,e,t){return function(r){i(e,r,t)}},tn=function(i,e,t){i.done||(i.done=!0,t&&(i=t),i.value=e,i.state=g6,yD(i,!0))},ug=function(i,e,t){if(!i.done){i.done=!0,t&&(i=t);try{if(i.facade===e)throw new cD("Promise can't be resolved itself");var r=pD(e);r?ny(function(){var n={done:!1};try{Go(r,e,Ji(ug,n,i),Ji(tn,n,i))}catch(o){tn(n,o,i)}}):(i.value=e,i.state=fD,yD(i,!1))}catch(n){tn({done:!1},n,i)}}};dD&&(Xi=function(e){o6(this,gu),i6(e),Go(xs,this);var t=pu(this);try{e(Ji(ug,t),Ji(tn,t))}catch(r){tn(t,r)}},gu=Xi.prototype,xs=function(e){c6(this,{type:Wa,done:!1,notified:!1,parent:!1,reactions:new u6,rejection:!1,state:Ew,value:void 0})},xs.prototype=e6(gu,"then",function(e,t){var r=pu(this),n=lg(s6(this,Xi));return r.parent=!0,n.ok=og(e)?e:!0,n.fail=og(t)&&t,n.domain=oa?oy.domain:void 0,r.state===Ew?r.reactions.add(n):ny(function(){gD(n,r)}),n.promise}),Sw=function(){var i=new xs,e=pu(i);this.promise=i,this.resolve=Ji(ug,e),this.reject=Ji(tn,e)},uD.f=lg=function(i){return i===Xi||i===y6?new Sw(i):f6(i)});QK({global:!0,wrap:!0,forced:dD},{Promise:Xi});t6(Xi,Wa,!1,!0);r6(Wa);var w6=Dn,_6=xR,E6=Vo.CONSTRUCTOR,Ha=E6||!_6(function(i){w6.all(i).then(void 0,function(){})}),S6=W,$6=Ve,O6=bt,I6=nr,T6=xn,P6=Ii,C6=Ha;S6({target:"Promise",stat:!0,forced:C6},{all:function(e){var t=this,r=I6.f(t),n=r.resolve,o=r.reject,s=T6(function(){var a=O6(t.resolve),l=[],u=0,d=1;P6(e,function(c){var h=u++,f=!1;d++,$6(a,t,c).then(function(v){f||(f=!0,l[h]=v,--d||n(l))},o)}),--d||n(l)});return s.error&&o(s.value),r.promise}});var R6=W,x6=Vo.CONSTRUCTOR,Ow=Dn;Ow&&Ow.prototype;R6({target:"Promise",proto:!0,forced:x6,real:!0},{catch:function(i){return this.then(void 0,i)}});var D6=W,A6=Ve,M6=bt,N6=nr,k6=xn,F6=Ii,q6=Ha;D6({target:"Promise",stat:!0,forced:q6},{race:function(e){var t=this,r=N6.f(t),n=r.reject,o=k6(function(){var s=M6(t.resolve);F6(e,function(a){A6(s,t,a).then(r.resolve,n)})});return o.error&&n(o.value),r.promise}});var B6=W,j6=Ve,L6=nr,z6=Vo.CONSTRUCTOR;B6({target:"Promise",stat:!0,forced:z6},{reject:function(e){var t=L6.f(this);return j6(t.reject,void 0,e),t.promise}});var W6=It,H6=Je,U6=nr,bD=function(i,e){if(W6(i),H6(e)&&e.constructor===i)return e;var t=U6.f(i),r=t.resolve;return r(e),t.promise},V6=W,G6=at,K6=tN,Y6=Dn,X6=Vo.CONSTRUCTOR,J6=bD,Z6=G6("Promise"),Q6=!X6;V6({target:"Promise",stat:!0,forced:K6},{resolve:function(e){return J6(Q6&&this===Z6?Y6:this,e)}});var e8=W,t8=Ve,r8=bt,i8=nr,n8=xn,o8=Ii,s8=Ha;e8({target:"Promise",stat:!0,forced:s8},{allSettled:function(e){var t=this,r=i8.f(t),n=r.resolve,o=r.reject,s=n8(function(){var a=r8(t.resolve),l=[],u=0,d=1;o8(e,function(c){var h=u++,f=!1;d++,t8(a,t,c).then(function(v){f||(f=!0,l[h]={status:"fulfilled",value:v},--d||n(l))},function(v){f||(f=!0,l[h]={status:"rejected",reason:v},--d||n(l))})}),--d||n(l)});return s.error&&o(s.value),r.promise}});var a8=W,l8=Ve,u8=bt,d8=at,c8=nr,h8=xn,f8=Ii,v8=Ha,Iw="No one promise resolved";a8({target:"Promise",stat:!0,forced:v8},{any:function(e){var t=this,r=d8("AggregateError"),n=c8.f(t),o=n.resolve,s=n.reject,a=h8(function(){var l=u8(t.resolve),u=[],d=0,c=1,h=!1;f8(e,function(f){var v=d++,g=!1;c++,l8(l,t,f).then(function(y){g||h||(h=!0,o(y))},function(y){g||h||(g=!0,u[v]=y,--c||s(new r(u,Iw)))})}),--c||s(new r(u,Iw))});return a.error&&s(a.value),n.promise}});var p8=W,dg=Dn,g8=ae,y8=at,m8=Ce,b8=Zx,Tw=bD,w8=dg&&dg.prototype,_8=!!dg&&g8(function(){w8.finally.call({then:function(){}},function(){})});p8({target:"Promise",proto:!0,real:!0,forced:_8},{finally:function(i){var e=b8(this,y8("Promise")),t=m8(i);return this.then(t?function(r){return Tw(e,i()).then(function(){return r})}:i,t?function(r){return Tw(e,i()).then(function(){throw r})}:i)}});var E8=_e,S8=E8.Promise,$8=S8,O8=$8,I8=W,T8=nr;I8({target:"Promise",stat:!0},{withResolvers:function(){var e=T8.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}});var P8=O8,C8=P8,R8=W,x8=nr,D8=xn;R8({target:"Promise",stat:!0,forced:!0},{try:function(i){var e=x8.f(this),t=D8(i);return(t.error?e.reject:e.resolve)(t.value),e.promise}});var A8=C8,M8=A8,N8=M8,k8=UR,F8=k8,q8=F8,B8=q8,j8=B8;(function(i){var e=fG.default,t=mC,r=Lg,n=zx,o=Ux,s=mG,a=qR,l=Wx,u=N8,d=j8,c=jR;function h(){i.exports=h=function(){return v},i.exports.__esModule=!0,i.exports.default=i.exports;var f,v={},g=Object.prototype,y=g.hasOwnProperty,p=t||function(k,x,M){k[x]=M.value},m=typeof r=="function"?r:{},w=m.iterator||"@@iterator",b=m.asyncIterator||"@@asyncIterator",_=m.toStringTag||"@@toStringTag";function S(k,x,M){return t(k,x,{value:M,enumerable:!0,configurable:!0,writable:!0}),k[x]}try{S({},"")}catch{S=function(M,j,U){return M[j]=U}}function I(k,x,M,j){var U=x&&x.prototype instanceof F?x:F,V=n(U.prototype),Se=new qt(j||[]);return p(V,"_invoke",{value:lt(k,M,Se)}),V}function E(k,x,M){try{return{type:"normal",arg:k.call(x,M)}}catch(j){return{type:"throw",arg:j}}}v.wrap=I;var $="suspendedStart",T="suspendedYield",R="executing",C="completed",P={};function F(){}function q(){}function X(){}var K={};S(K,w,function(){return this});var oe=o,se=oe&&oe(oe(ar([])));se&&se!==g&&y.call(se,w)&&(K=se);var ce=X.prototype=F.prototype=n(K);function re(k){var x;s(x=["next","throw","return"]).call(x,function(M){S(k,M,function(j){return this._invoke(M,j)})})}function Le(k,x){function M(U,V,Se,ze){var me=E(k[U],k,V);if(me.type!=="throw"){var St=me.arg,Kt=St.value;return Kt&&e(Kt)=="object"&&y.call(Kt,"__await")?x.resolve(Kt.__await).then(function(Bt){M("next",Bt,Se,ze)},function(Bt){M("throw",Bt,Se,ze)}):x.resolve(Kt).then(function(Bt){St.value=Bt,Se(St)},function(Bt){return M("throw",Bt,Se,ze)})}ze(me.arg)}var j;p(this,"_invoke",{value:function(V,Se){function ze(){return new x(function(me,St){M(V,Se,me,St)})}return j=j?j.then(ze,ze):ze()}})}function lt(k,x,M){var j=$;return function(U,V){if(j===R)throw new Error("Generator is already running");if(j===C){if(U==="throw")throw V;return{value:f,done:!0}}for(M.method=U,M.arg=V;;){var Se=M.delegate;if(Se){var ze=ut(Se,M);if(ze){if(ze===P)continue;return ze}}if(M.method==="next")M.sent=M._sent=M.arg;else if(M.method==="throw"){if(j===$)throw j=C,M.arg;M.dispatchException(M.arg)}else M.method==="return"&&M.abrupt("return",M.arg);j=R;var me=E(k,x,M);if(me.type==="normal"){if(j=M.done?C:T,me.arg===P)continue;return{value:me.arg,done:M.done}}me.type==="throw"&&(j=C,M.method="throw",M.arg=me.arg)}}}function ut(k,x){var M=x.method,j=k.iterator[M];if(j===f)return x.delegate=null,M==="throw"&&k.iterator.return&&(x.method="return",x.arg=f,ut(k,x),x.method==="throw")||M!=="return"&&(x.method="throw",x.arg=new TypeError("The iterator does not provide a '"+M+"' method")),P;var U=E(j,k.iterator,x.arg);if(U.type==="throw")return x.method="throw",x.arg=U.arg,x.delegate=null,P;var V=U.arg;return V?V.done?(x[k.resultName]=V.value,x.next=k.nextLoc,x.method!=="return"&&(x.method="next",x.arg=f),x.delegate=null,P):V:(x.method="throw",x.arg=new TypeError("iterator result is not an object"),x.delegate=null,P)}function Yr(k){var x,M={tryLoc:k[0]};1 in k&&(M.catchLoc=k[1]),2 in k&&(M.finallyLoc=k[2],M.afterLoc=k[3]),a(x=this.tryEntries).call(x,M)}function et(k){var x=k.completion||{};x.type="normal",delete x.arg,k.completion=x}function qt(k){this.tryEntries=[{tryLoc:"root"}],s(k).call(k,Yr,this),this.reset(!0)}function ar(k){if(k||k===""){var x=k[w];if(x)return x.call(k);if(typeof k.next=="function")return k;if(!isNaN(k.length)){var M=-1,j=function U(){for(;++M<k.length;)if(y.call(k,M))return U.value=k[M],U.done=!1,U;return U.value=f,U.done=!0,U};return j.next=j}}throw new TypeError(e(k)+" is not iterable")}return q.prototype=X,p(ce,"constructor",{value:X,configurable:!0}),p(X,"constructor",{value:q,configurable:!0}),q.displayName=S(X,_,"GeneratorFunction"),v.isGeneratorFunction=function(k){var x=typeof k=="function"&&k.constructor;return!!x&&(x===q||(x.displayName||x.name)==="GeneratorFunction")},v.mark=function(k){return l?l(k,X):(k.__proto__=X,S(k,_,"GeneratorFunction")),k.prototype=n(ce),k},v.awrap=function(k){return{__await:k}},re(Le.prototype),S(Le.prototype,b,function(){return this}),v.AsyncIterator=Le,v.async=function(k,x,M,j,U){U===void 0&&(U=u);var V=new Le(I(k,x,M,j),U);return v.isGeneratorFunction(x)?V:V.next().then(function(Se){return Se.done?Se.value:V.next()})},re(ce),S(ce,_,"Generator"),S(ce,w,function(){return this}),S(ce,"toString",function(){return"[object Generator]"}),v.keys=function(k){var x=Object(k),M=[];for(var j in x)a(M).call(M,j);return d(M).call(M),function U(){for(;M.length;){var V=M.pop();if(V in x)return U.value=V,U.done=!1,U}return U.done=!0,U}},v.values=ar,qt.prototype={constructor:qt,reset:function(x){var M;if(this.prev=0,this.next=0,this.sent=this._sent=f,this.done=!1,this.delegate=null,this.method="next",this.arg=f,s(M=this.tryEntries).call(M,et),!x)for(var j in this)j.charAt(0)==="t"&&y.call(this,j)&&!isNaN(+c(j).call(j,1))&&(this[j]=f)},stop:function(){this.done=!0;var x=this.tryEntries[0].completion;if(x.type==="throw")throw x.arg;return this.rval},dispatchException:function(x){if(this.done)throw x;var M=this;function j(St,Kt){return Se.type="throw",Se.arg=x,M.next=St,Kt&&(M.method="next",M.arg=f),!!Kt}for(var U=this.tryEntries.length-1;U>=0;--U){var V=this.tryEntries[U],Se=V.completion;if(V.tryLoc==="root")return j("end");if(V.tryLoc<=this.prev){var ze=y.call(V,"catchLoc"),me=y.call(V,"finallyLoc");if(ze&&me){if(this.prev<V.catchLoc)return j(V.catchLoc,!0);if(this.prev<V.finallyLoc)return j(V.finallyLoc)}else if(ze){if(this.prev<V.catchLoc)return j(V.catchLoc,!0)}else{if(!me)throw new Error("try statement without catch or finally");if(this.prev<V.finallyLoc)return j(V.finallyLoc)}}}},abrupt:function(x,M){for(var j=this.tryEntries.length-1;j>=0;--j){var U=this.tryEntries[j];if(U.tryLoc<=this.prev&&y.call(U,"finallyLoc")&&this.prev<U.finallyLoc){var V=U;break}}V&&(x==="break"||x==="continue")&&V.tryLoc<=M&&M<=V.finallyLoc&&(V=null);var Se=V?V.completion:{};return Se.type=x,Se.arg=M,V?(this.method="next",this.next=V.finallyLoc,P):this.complete(Se)},complete:function(x,M){if(x.type==="throw")throw x.arg;return x.type==="break"||x.type==="continue"?this.next=x.arg:x.type==="return"?(this.rval=this.arg=x.arg,this.method="return",this.next="end"):x.type==="normal"&&M&&(this.next=M),P},finish:function(x){for(var M=this.tryEntries.length-1;M>=0;--M){var j=this.tryEntries[M];if(j.finallyLoc===x)return this.complete(j.completion,j.afterLoc),et(j),P}},catch:function(x){for(var M=this.tryEntries.length-1;M>=0;--M){var j=this.tryEntries[M];if(j.tryLoc===x){var U=j.completion;if(U.type==="throw"){var V=U.arg;et(j)}return V}}throw new Error("illegal catch attempt")},delegateYield:function(x,M,j){return this.delegate={iterator:ar(x),resultName:M,nextLoc:j},this.method==="next"&&(this.arg=f),P}},v}i.exports=h,i.exports.__esModule=!0,i.exports.default=i.exports})(Vx);var L8=Vx.exports,Ws=L8(),z8=Ws;try{regeneratorRuntime=Ws}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Ws:Function("r","regeneratorRuntime = r")(Ws)}var ht=G(z8),wD={exports:{}},W8=ae,H8=W8(function(){if(typeof ArrayBuffer=="function"){var i=new ArrayBuffer(8);Object.isExtensible(i)&&Object.defineProperty(i,"a",{value:8})}}),U8=ae,V8=Je,G8=zr,Pw=H8,Hs=Object.isExtensible,K8=U8(function(){Hs(1)}),Y8=K8||Pw?function(e){return!V8(e)||Pw&&G8(e)==="ArrayBuffer"?!1:Hs?Hs(e):!0}:Hs,X8=ae,J8=!X8(function(){return Object.isExtensible(Object.preventExtensions({}))}),Z8=W,Q8=ye,e9=Do,t9=Je,ay=qe,r9=_t.f,Cw=Ao,i9=Dg,ly=Y8,n9=ma,o9=J8,_D=!1,wr=n9("meta"),s9=0,uy=function(i){r9(i,wr,{value:{objectID:"O"+s9++,weakData:{}}})},a9=function(i,e){if(!t9(i))return typeof i=="symbol"?i:(typeof i=="string"?"S":"P")+i;if(!ay(i,wr)){if(!ly(i))return"F";if(!e)return"E";uy(i)}return i[wr].objectID},l9=function(i,e){if(!ay(i,wr)){if(!ly(i))return!0;if(!e)return!1;uy(i)}return i[wr].weakData},u9=function(i){return o9&&_D&&ly(i)&&!ay(i,wr)&&uy(i),i},d9=function(){c9.enable=function(){},_D=!0;var i=Cw.f,e=Q8([].splice),t={};t[wr]=1,i(t).length&&(Cw.f=function(r){for(var n=i(r),o=0,s=n.length;o<s;o++)if(n[o]===wr){e(n,o,1);break}return n},Z8({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:i9.f}))},c9=wD.exports={enable:d9,fastKey:a9,getWeakData:l9,onFreeze:u9};e9[wr]=!0;var ED=wD.exports,h9=W,f9=we,v9=ED,p9=ae,g9=_r,y9=Ii,m9=ry,b9=Ce,w9=Je,_9=wn,E9=$i,S9=_t.f,$9=Pn.forEach,O9=Ue,SD=Tn,I9=SD.set,T9=SD.getterFor,$D=function(i,e,t){var r=i.indexOf("Map")!==-1,n=i.indexOf("Weak")!==-1,o=r?"set":"add",s=f9[i],a=s&&s.prototype,l={},u;if(!O9||!b9(s)||!(n||a.forEach&&!p9(function(){new s().entries().next()})))u=t.getConstructor(e,i,r,o),v9.enable();else{u=e(function(h,f){I9(m9(h,d),{type:i,collection:new s}),_9(f)||y9(f,h[o],{that:h,AS_ENTRIES:r})});var d=u.prototype,c=T9(i);$9(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(h){var f=h==="add"||h==="set";h in a&&!(n&&h==="clear")&&g9(d,h,function(v,g){var y=c(this).collection;if(!f&&n&&!w9(v))return h==="get"?void 0:!1;var p=y[h](v===0?0:v,g);return f?this:p})}),n||S9(d,"size",{configurable:!0,get:function(){return c(this).collection.size}})}return E9(u,i,!1,!0),l[i]=u,h9({global:!0,forced:!0},l),n||t.setStrong(u,i,r),u},P9=In,C9=function(i,e,t){for(var r in e)t&&t.unsafe&&i[r]?i[r]=e[r]:P9(i,r,e[r],t);return i},R9=Si,x9=Ag,Rw=C9,D9=Hr,A9=ry,M9=wn,N9=Ii,k9=qg,Ds=Bg,F9=Jx,Xn=Ue,xw=ED.fastKey,OD=Tn,Dw=OD.set,yu=OD.getterFor,ID={getConstructor:function(i,e,t,r){var n=i(function(u,d){A9(u,o),Dw(u,{type:e,index:R9(null),first:void 0,last:void 0,size:0}),Xn||(u.size=0),M9(d)||N9(d,u[r],{that:u,AS_ENTRIES:t})}),o=n.prototype,s=yu(e),a=function(u,d,c){var h=s(u),f=l(u,d),v,g;return f?f.value=c:(h.last=f={index:g=xw(d,!0),key:d,value:c,previous:v=h.last,next:void 0,removed:!1},h.first||(h.first=f),v&&(v.next=f),Xn?h.size++:u.size++,g!=="F"&&(h.index[g]=f)),u},l=function(u,d){var c=s(u),h=xw(d),f;if(h!=="F")return c.index[h];for(f=c.first;f;f=f.next)if(f.key===d)return f};return Rw(o,{clear:function(){for(var d=this,c=s(d),h=c.index,f=c.first;f;)f.removed=!0,f.previous&&(f.previous=f.previous.next=void 0),delete h[f.index],f=f.next;c.first=c.last=void 0,Xn?c.size=0:d.size=0},delete:function(u){var d=this,c=s(d),h=l(d,u);if(h){var f=h.next,v=h.previous;delete c.index[h.index],h.removed=!0,v&&(v.next=f),f&&(f.previous=v),c.first===h&&(c.first=f),c.last===h&&(c.last=v),Xn?c.size--:d.size--}return!!h},forEach:function(d){for(var c=s(this),h=D9(d,arguments.length>1?arguments[1]:void 0),f;f=f?f.next:c.first;)for(h(f.value,f.key,this);f&&f.removed;)f=f.previous},has:function(d){return!!l(this,d)}}),Rw(o,t?{get:function(d){var c=l(this,d);return c&&c.value},set:function(d,c){return a(this,d===0?0:d,c)}}:{add:function(d){return a(this,d=d===0?0:d,d)}}),Xn&&x9(o,"size",{configurable:!0,get:function(){return s(this).size}}),n},setStrong:function(i,e,t){var r=e+" Iterator",n=yu(e),o=yu(r);k9(i,e,function(s,a){Dw(this,{type:r,target:s,state:n(s),kind:a,last:void 0})},function(){for(var s=o(this),a=s.kind,l=s.last;l&&l.removed;)l=l.previous;return!s.target||!(s.last=l=l?l.next:s.state.first)?(s.target=void 0,Ds(void 0,!0)):Ds(a==="keys"?l.key:a==="values"?l.value:[l.key,l.value],!1)},t?"entries":"values",!t,!0),F9(e)}},q9=$D,B9=ID;q9("Map",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},B9);var j9=_e,L9=j9.Map,z9=L9,W9=z9,H9=W9,TD=G(H9),U9=W,V9=Pn.some,G9=ka,K9=G9("some");U9({target:"Array",proto:!0,forced:!K9},{some:function(e){return V9(this,e,arguments.length>1?arguments[1]:void 0)}});var Y9=tt,X9=Y9("Array","some"),J9=Fe,Z9=X9,mu=Array.prototype,Q9=function(i){var e=i.some;return i===mu||J9(mu,i)&&e===mu.some?Z9:e},eY=Q9,tY=eY,rY=tY,iY=G(rY),nY=tt,oY=nY("Array","keys"),sY=oY,aY=sY,lY=Er,uY=qe,dY=Fe,cY=aY,bu=Array.prototype,hY={DOMTokenList:!0,NodeList:!0},fY=function(i){var e=i.keys;return i===bu||dY(bu,i)&&e===bu.keys||uY(hY,lY(i))?cY:e},vY=fY,zi=G(vY),Aw=RC,pY=Math.floor,cg=function(i,e){var t=i.length,r=pY(t/2);return t<8?gY(i,e):yY(i,cg(Aw(i,0,r),e),cg(Aw(i,r),e),e)},gY=function(i,e){for(var t=i.length,r=1,n,o;r<t;){for(o=r,n=i[r];o&&e(i[o-1],n)>0;)i[o]=i[--o];o!==r++&&(i[o]=n)}return i},yY=function(i,e,t,r){for(var n=e.length,o=t.length,s=0,a=0;s<n||a<o;)i[s+a]=s<n&&a<o?r(e[s],t[a])<=0?e[s++]:t[a++]:s<n?e[s++]:t[a++];return i},mY=cg,bY=Wr,Mw=bY.match(/firefox\/(\d+)/i),wY=!!Mw&&+Mw[1],_Y=Wr,EY=/MSIE|Trident/.test(_Y),SY=Wr,Nw=SY.match(/AppleWebKit\/(\d+)\./),$Y=!!Nw&&+Nw[1],OY=W,PD=ye,IY=bt,TY=wt,kw=Tt,PY=VR,Fw=Ei,dy=ae,CY=mY,RY=ka,qw=wY,xY=EY,Bw=_n,jw=$Y,Cr=[],Lw=PD(Cr.sort),DY=PD(Cr.push),AY=dy(function(){Cr.sort(void 0)}),MY=dy(function(){Cr.sort(null)}),NY=RY("sort"),CD=!dy(function(){if(Bw)return Bw<70;if(!(qw&&qw>3)){if(xY)return!0;if(jw)return jw<603;var i="",e,t,r,n;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)Cr.push({k:t+n,v:r})}for(Cr.sort(function(o,s){return s.v-o.v}),n=0;n<Cr.length;n++)t=Cr[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return i!=="DGBEFHACIJK"}}),kY=AY||!MY||!NY||!CD,FY=function(i){return function(e,t){return t===void 0?-1:e===void 0?1:i!==void 0?+i(e,t)||0:Fw(e)>Fw(t)?1:-1}};OY({target:"Array",proto:!0,forced:kY},{sort:function(e){e!==void 0&&IY(e);var t=TY(this);if(CD)return e===void 0?Lw(t):Lw(t,e);var r=[],n=kw(t),o,s;for(s=0;s<n;s++)s in t&&DY(r,t[s]);for(CY(r,FY(e)),o=kw(r),s=0;s<o;)t[s]=r[s++];for(;s<n;)PY(t,s++);return t}});var qY=tt,BY=qY("Array","sort"),jY=Fe,LY=BY,wu=Array.prototype,zY=function(i){var e=i.sort;return i===wu||jY(wu,i)&&e===wu.sort?LY:e},WY=zY,HY=WY,UY=HY,hg=G(UY),VY=tt,GY=VY("Array","values"),KY=GY,YY=KY,XY=Er,JY=qe,ZY=Fe,QY=YY,_u=Array.prototype,e7={DOMTokenList:!0,NodeList:!0},t7=function(i){var e=i.values;return i===_u||ZY(_u,i)&&e===_u.values||JY(e7,XY(i))?QY:e},r7=t7,zw=G(r7),i7=mR,Zi=G(i7),n7=tt,o7=n7("Array","entries"),s7=o7,a7=s7,l7=Er,u7=qe,d7=Fe,c7=a7,Eu=Array.prototype,h7={DOMTokenList:!0,NodeList:!0},f7=function(i){var e=i.entries;return i===Eu||d7(Eu,i)&&e===Eu.entries||u7(h7,l7(i))?c7:e},v7=f7,p7=G(v7);let As;const g7=new Uint8Array(16);function y7(){if(!As&&(As=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!As))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return As(g7)}const Ye=[];for(let i=0;i<256;++i)Ye.push((i+256).toString(16).slice(1));function m7(i,e=0){return Ye[i[e+0]]+Ye[i[e+1]]+Ye[i[e+2]]+Ye[i[e+3]]+"-"+Ye[i[e+4]]+Ye[i[e+5]]+"-"+Ye[i[e+6]]+Ye[i[e+7]]+"-"+Ye[i[e+8]]+Ye[i[e+9]]+"-"+Ye[i[e+10]]+Ye[i[e+11]]+Ye[i[e+12]]+Ye[i[e+13]]+Ye[i[e+14]]+Ye[i[e+15]]}const b7=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var Ww={randomUUID:b7};function w7(i,e,t){if(Ww.randomUUID&&!i)return Ww.randomUUID();i=i||{};const r=i.random||(i.rng||y7)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,m7(r)}function Hw(i){return typeof i=="string"||typeof i=="number"}var _7=function(){function i(e){pa(this,i),Dr(this,"_queue",[]),Dr(this,"_timeout",null),Dr(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(e)}return Na(i,[{key:"setOptions",value:function(t){t&&typeof t.delay<"u"&&(this.delay=t.delay),t&&typeof t.max<"u"&&(this.max=t.max),this._flushIfNeeded()}},{key:"destroy",value:function(){if(this.flush(),this._extended){for(var t=this._extended.object,r=this._extended.methods,n=0;n<r.length;n++){var o=r[n];o.original?t[o.name]=o.original:delete t[o.name]}this._extended=null}}},{key:"replace",value:function(t,r){var n=this,o=t[r];if(!o)throw new Error("Method "+r+" undefined");t[r]=function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];n.queue({args:a,fn:o,context:this})}}},{key:"queue",value:function(t){typeof t=="function"?this._queue.push({fn:t}):this._queue.push(t),this._flushIfNeeded()}},{key:"_flushIfNeeded",value:function(){var t=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=K4(function(){t.flush()},this.delay))}},{key:"flush",value:function(){var t,r;ci(t=GR(r=this._queue).call(r,0)).call(t,function(n){n.fn.apply(n.context||n.fn,n.args||[])})}}],[{key:"extend",value:function(t,r){var n=new i(r);if(t.flush!==void 0)throw new Error("Target object already has a property flush");t.flush=function(){n.flush()};var o=[{name:"flush",original:void 0}];if(r&&r.replace)for(var s=0;s<r.replace.length;s++){var a=r.replace[s];o.push({name:a,original:t[a]}),n.replace(t,a)}return n._extended={object:t,methods:o},n}}]),i}(),E7=function(){function i(){pa(this,i),Dr(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),Dr(this,"subscribe",i.prototype.on),Dr(this,"unsubscribe",i.prototype.off)}return Na(i,[{key:"_trigger",value:function(t,r,n){var o,s;if(t==="*")throw new Error("Cannot trigger event *");ci(o=Ba(s=[]).call(s,pt(this._subscribers[t]),pt(this._subscribers["*"]))).call(o,function(a){a(t,r,n??null)})}},{key:"on",value:function(t,r){typeof r=="function"&&this._subscribers[t].push(r)}},{key:"off",value:function(t,r){var n;this._subscribers[t]=Gi(n=this._subscribers[t]).call(n,function(o){return o!==r})}}]),i}(),S7=$D,$7=ID;S7("Set",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},$7);var O7=_e,I7=O7.Set,T7=I7,P7=T7,C7=P7,Su=G(C7),R7=Wg,x7=R7,D7=x7,A7=D7,M7=A7,N7=M7,k7=N7,F7=k7,q7=F7,B7=q7,$u=G(B7);function Xt(i,e){var t=typeof qa<"u"&&Ug(i)||i["@@iterator"];if(!t){if($t(i)||(t=j7(i))||e){t&&(i=t);var r=0,n=function(){};return{s:n,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(u){throw u},f:n}}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 o=!0,s=!1,a;return{s:function(){t=t.call(i)},n:function(){var u=t.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw a}}}}function j7(i,e){var t;if(i){if(typeof i=="string")return Uw(i,e);var r=ja(t=Object.prototype.toString.call(i)).call(t,8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return Hg(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Uw(i,e)}}function Uw(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}var Vw=function(i){function e(t){pa(this,e),this._pairs=t}return Na(e,[{key:i,value:ht.mark(function t(){var r,n,o,s,a;return ht.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=Xt(this._pairs),u.prev=1,r.s();case 3:if((n=r.n()).done){u.next=9;break}return o=ct(n.value,2),s=o[0],a=o[1],u.next=7,[s,a];case 7:u.next=3;break;case 9:u.next=14;break;case 11:u.prev=11,u.t0=u.catch(1),r.e(u.t0);case 14:return u.prev=14,r.f(),u.finish(14);case 17:case"end":return u.stop()}},t,this,[[1,11,14,17]])})},{key:"entries",value:ht.mark(function t(){var r,n,o,s,a;return ht.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=Xt(this._pairs),u.prev=1,r.s();case 3:if((n=r.n()).done){u.next=9;break}return o=ct(n.value,2),s=o[0],a=o[1],u.next=7,[s,a];case 7:u.next=3;break;case 9:u.next=14;break;case 11:u.prev=11,u.t0=u.catch(1),r.e(u.t0);case 14:return u.prev=14,r.f(),u.finish(14);case 17:case"end":return u.stop()}},t,this,[[1,11,14,17]])})},{key:"keys",value:ht.mark(function t(){var r,n,o,s;return ht.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:r=Xt(this._pairs),l.prev=1,r.s();case 3:if((n=r.n()).done){l.next=9;break}return o=ct(n.value,1),s=o[0],l.next=7,s;case 7:l.next=3;break;case 9:l.next=14;break;case 11:l.prev=11,l.t0=l.catch(1),r.e(l.t0);case 14:return l.prev=14,r.f(),l.finish(14);case 17:case"end":return l.stop()}},t,this,[[1,11,14,17]])})},{key:"values",value:ht.mark(function t(){var r,n,o,s;return ht.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:r=Xt(this._pairs),l.prev=1,r.s();case 3:if((n=r.n()).done){l.next=9;break}return o=ct(n.value,2),s=o[1],l.next=7,s;case 7:l.next=3;break;case 9:l.next=14;break;case 11:l.prev=11,l.t0=l.catch(1),r.e(l.t0);case 14:return l.prev=14,r.f(),l.finish(14);case 17:case"end":return l.stop()}},t,this,[[1,11,14,17]])})},{key:"toIdArray",value:function(){var r;return zt(r=pt(this._pairs)).call(r,function(n){return n[0]})}},{key:"toItemArray",value:function(){var r;return zt(r=pt(this._pairs)).call(r,function(n){return n[1]})}},{key:"toEntryArray",value:function(){return pt(this._pairs)}},{key:"toObjectMap",value:function(){var r=$4(null),n=Xt(this._pairs),o;try{for(n.s();!(o=n.n()).done;){var s=ct(o.value,2),a=s[0],l=s[1];r[a]=l}}catch(u){n.e(u)}finally{n.f()}return r}},{key:"toMap",value:function(){return new TD(this._pairs)}},{key:"toIdSet",value:function(){return new Su(this.toIdArray())}},{key:"toItemSet",value:function(){return new Su(this.toItemArray())}},{key:"cache",value:function(){return new e(pt(this._pairs))}},{key:"distinct",value:function(r){var n=new Su,o=Xt(this._pairs),s;try{for(o.s();!(s=o.n()).done;){var a=ct(s.value,2),l=a[0],u=a[1];n.add(r(u,l))}}catch(d){o.e(d)}finally{o.f()}return n}},{key:"filter",value:function(r){var n=this._pairs;return new e({[Zi](){return ht.mark(function o(){var s,a,l,u,d;return ht.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:s=Xt(n),h.prev=1,s.s();case 3:if((a=s.n()).done){h.next=10;break}if(l=ct(a.value,2),u=l[0],d=l[1],!r(d,u)){h.next=8;break}return h.next=8,[u,d];case 8:h.next=3;break;case 10:h.next=15;break;case 12:h.prev=12,h.t0=h.catch(1),s.e(h.t0);case 15:return h.prev=15,s.f(),h.finish(15);case 18:case"end":return h.stop()}},o,null,[[1,12,15,18]])})()}})}},{key:"forEach",value:function(r){var n=Xt(this._pairs),o;try{for(n.s();!(o=n.n()).done;){var s=ct(o.value,2),a=s[0],l=s[1];r(l,a)}}catch(u){n.e(u)}finally{n.f()}}},{key:"map",value:function(r){var n=this._pairs;return new e({[Zi](){return ht.mark(function o(){var s,a,l,u,d;return ht.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:s=Xt(n),h.prev=1,s.s();case 3:if((a=s.n()).done){h.next=9;break}return l=ct(a.value,2),u=l[0],d=l[1],h.next=7,[u,r(d,u)];case 7:h.next=3;break;case 9:h.next=14;break;case 11:h.prev=11,h.t0=h.catch(1),s.e(h.t0);case 14:return h.prev=14,s.f(),h.finish(14);case 17:case"end":return h.stop()}},o,null,[[1,11,14,17]])})()}})}},{key:"max",value:function(r){var n=$u(this._pairs),o=n.next();if(o.done)return null;for(var s=o.value[1],a=r(o.value[1],o.value[0]);!(o=n.next()).done;){var l=ct(o.value,2),u=l[0],d=l[1],c=r(d,u);c>a&&(a=c,s=d)}return s}},{key:"min",value:function(r){var n=$u(this._pairs),o=n.next();if(o.done)return null;for(var s=o.value[1],a=r(o.value[1],o.value[0]);!(o=n.next()).done;){var l=ct(o.value,2),u=l[0],d=l[1],c=r(d,u);c<a&&(a=c,s=d)}return s}},{key:"reduce",value:function(r,n){var o=Xt(this._pairs),s;try{for(o.s();!(s=o.n()).done;){var a=ct(s.value,2),l=a[0],u=a[1];n=r(n,u,l)}}catch(d){o.e(d)}finally{o.f()}return n}},{key:"sort",value:function(r){var n=this;return new e({[Zi]:function(){var o;return $u(hg(o=pt(n._pairs)).call(o,function(s,a){var l=ct(s,2),u=l[0],d=l[1],c=ct(a,2),h=c[0],f=c[1];return r(d,f,u,h)}))}})}}]),e}(Zi);function Gw(i,e){var t=Gg(i);if(Kb){var r=Kb(i);e&&(r=Gi(r).call(r,function(n){return qx(i,n).enumerable})),t.push.apply(t,r)}return t}function Kw(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?ci(t=Gw(Object(n),!0)).call(t,function(o){Dr(i,o,n[o])}):Yb?qV(i,Yb(n)):ci(r=Gw(Object(n))).call(r,function(o){jV(i,o,qx(n,o))})}return i}function Ou(i,e){var t=typeof qa<"u"&&Ug(i)||i["@@iterator"];if(!t){if($t(i)||(t=L7(i))||e){t&&(i=t);var r=0,n=function(){};return{s:n,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(u){throw u},f:n}}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 o=!0,s=!1,a;return{s:function(){t=t.call(i)},n:function(){var u=t.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw a}}}}function L7(i,e){var t;if(i){if(typeof i=="string")return Yw(i,e);var r=ja(t=Object.prototype.toString.call(i)).call(t,8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return Hg(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yw(i,e)}}function Yw(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}function z7(i){var e=W7();return function(){var r=ra(i),n;if(e){var o=ra(this).constructor;n=Ls(r,arguments,o)}else n=r.apply(this,arguments);return lG(this,n)}}function W7(){if(typeof Reflect>"u"||!Ls||Ls.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Ls(Boolean,[],function(){})),!0}catch{return!1}}function H7(i,e){return i[e]==null&&(i[e]=w7()),i}var sa=function(i){aG(t,i);var e=z7(t);function t(r,n){var o;return pa(this,t),o=e.call(this),Dr(Lx(o),"_queue",null),r&&!$t(r)&&(n=r,r=[]),o._options=n||{},o._data=new TD,o.length=0,o._idProp=o._options.fieldId||"id",r&&r.length&&o.add(r),o.setOptions(n),o}return Na(t,[{key:"idProp",get:function(){return this._idProp}},{key:"setOptions",value:function(n){n&&n.queue!==void 0&&(n.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=_7.extend(this,{replace:["add","update","remove"]})),n.queue&&typeof n.queue=="object"&&this._queue.setOptions(n.queue)))}},{key:"add",value:function(n,o){var s=this,a=[],l;if($t(n)){var u=zt(n).call(n,function(h){return h[s._idProp]});if(iY(u).call(u,function(h){return s._data.has(h)}))throw new Error("A duplicate id was found in the parameter array.");for(var d=0,c=n.length;d<c;d++)l=this._addItem(n[d]),a.push(l)}else if(n&&typeof n=="object")l=this._addItem(n),a.push(l);else throw new Error("Unknown dataType");return a.length&&this._trigger("add",{items:a},o),a}},{key:"update",value:function(n,o){var s=this,a=[],l=[],u=[],d=[],c=this._idProp,h=function(p){var m=p[c];if(m!=null&&s._data.has(m)){var w=p,b=s4({},s._data.get(m)),_=s._updateItem(w);l.push(_),d.push(w),u.push(b)}else{var S=s._addItem(p);a.push(S)}};if($t(n))for(var f=0,v=n.length;f<v;f++)n[f]&&typeof n[f]=="object"?h(n[f]):console.warn("Ignoring input item, which is not an object at index "+f);else if(n&&typeof n=="object")h(n);else throw new Error("Unknown dataType");if(a.length&&this._trigger("add",{items:a},o),l.length){var g={items:l,oldData:u,data:d};this._trigger("update",g,o)}return Ba(a).call(a,l)}},{key:"updateOnly",value:function(n,o){var s,a=this;$t(n)||(n=[n]);var l=zt(s=zt(n).call(n,function(d){var c=a._data.get(d[a._idProp]);if(c==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:c,update:d}})).call(s,function(d){var c=d.oldData,h=d.update,f=c[a._idProp],v=BU(c,h);return a._data.set(f,v),{id:f,oldData:c,updatedData:v}});if(l.length){var u={items:zt(l).call(l,function(d){return d.id}),oldData:zt(l).call(l,function(d){return d.oldData}),data:zt(l).call(l,function(d){return d.updatedData})};return this._trigger("update",u,o),u.items}else return[]}},{key:"get",value:function(n,o){var s=void 0,a=void 0,l=void 0;Hw(n)?(s=n,l=o):$t(n)?(a=n,l=o):l=n;var u=l&&l.returnType==="Object"?"Object":"Array",d=l&&Gi(l),c=[],h=void 0,f=void 0,v=void 0;if(s!=null)h=this._data.get(s),h&&d&&!d(h)&&(h=void 0);else if(a!=null)for(var g=0,y=a.length;g<y;g++)h=this._data.get(a[g]),h!=null&&(!d||d(h))&&c.push(h);else{var p;f=pt(zi(p=this._data).call(p));for(var m=0,w=f.length;m<w;m++)v=f[m],h=this._data.get(v),h!=null&&(!d||d(h))&&c.push(h)}if(l&&l.order&&s==null&&this._sort(c,l.order),l&&l.fields){var b=l.fields;if(s!=null&&h!=null)h=this._filterFields(h,b);else for(var _=0,S=c.length;_<S;_++)c[_]=this._filterFields(c[_],b)}if(u=="Object"){for(var I={},E=0,$=c.length;E<$;E++){var T=c[E],R=T[this._idProp];I[R]=T}return I}else if(s!=null){var C;return(C=h)!==null&&C!==void 0?C:null}else return c}},{key:"getIds",value:function(n){var o=this._data,s=n&&Gi(n),a=n&&n.order,l=pt(zi(o).call(o)),u=[];if(s)if(a){for(var d=[],c=0,h=l.length;c<h;c++){var f=l[c],v=this._data.get(f);v!=null&&s(v)&&d.push(v)}this._sort(d,a);for(var g=0,y=d.length;g<y;g++)u.push(d[g][this._idProp])}else for(var p=0,m=l.length;p<m;p++){var w=l[p],b=this._data.get(w);b!=null&&s(b)&&u.push(b[this._idProp])}else if(a){for(var _=[],S=0,I=l.length;S<I;S++){var E=l[S];_.push(o.get(E))}this._sort(_,a);for(var $=0,T=_.length;$<T;$++)u.push(_[$][this._idProp])}else for(var R=0,C=l.length;R<C;R++){var P=l[R],F=o.get(P);F!=null&&u.push(F[this._idProp])}return u}},{key:"getDataSet",value:function(){return this}},{key:"forEach",value:function(n,o){var s=o&&Gi(o),a=this._data,l=pt(zi(a).call(a));if(o&&o.order)for(var u=this.get(o),d=0,c=u.length;d<c;d++){var h=u[d],f=h[this._idProp];n(h,f)}else for(var v=0,g=l.length;v<g;v++){var y=l[v],p=this._data.get(y);p!=null&&(!s||s(p))&&n(p,y)}}},{key:"map",value:function(n,o){for(var s=o&&Gi(o),a=[],l=this._data,u=pt(zi(l).call(l)),d=0,c=u.length;d<c;d++){var h=u[d],f=this._data.get(h);f!=null&&(!s||s(f))&&a.push(n(f,h))}return o&&o.order&&this._sort(a,o.order),a}},{key:"_filterFields",value:function(n,o){var s;return n&&Ez(s=$t(o)?o:Gg(o)).call(s,function(a,l){return a[l]=n[l],a},{})}},{key:"_sort",value:function(n,o){if(typeof o=="string"){var s=o;hg(n).call(n,function(a,l){var u=a[s],d=l[s];return u>d?1:u<d?-1:0})}else if(typeof o=="function")hg(n).call(n,o);else throw new TypeError("Order must be a function or a string")}},{key:"remove",value:function(n,o){for(var s=[],a=[],l=$t(n)?n:[n],u=0,d=l.length;u<d;u++){var c=this._remove(l[u]);if(c){var h=c[this._idProp];h!=null&&(s.push(h),a.push(c))}}return s.length&&this._trigger("remove",{items:s,oldData:a},o),s}},{key:"_remove",value:function(n){var o;if(Hw(n)?o=n:n&&typeof n=="object"&&(o=n[this._idProp]),o!=null&&this._data.has(o)){var s=this._data.get(o)||null;return this._data.delete(o),--this.length,s}return null}},{key:"clear",value:function(n){for(var o,s=pt(zi(o=this._data).call(o)),a=[],l=0,u=s.length;l<u;l++)a.push(this._data.get(s[l]));return this._data.clear(),this.length=0,this._trigger("remove",{items:s,oldData:a},n),s}},{key:"max",value:function(n){var o,s=null,a=null,l=Ou(zw(o=this._data).call(o)),u;try{for(l.s();!(u=l.n()).done;){var d=u.value,c=d[n];typeof c=="number"&&(a==null||c>a)&&(s=d,a=c)}}catch(h){l.e(h)}finally{l.f()}return s||null}},{key:"min",value:function(n){var o,s=null,a=null,l=Ou(zw(o=this._data).call(o)),u;try{for(l.s();!(u=l.n()).done;){var d=u.value,c=d[n];typeof c=="number"&&(a==null||c<a)&&(s=d,a=c)}}catch(h){l.e(h)}finally{l.f()}return s||null}},{key:"distinct",value:function(n){for(var o=this._data,s=pt(zi(o).call(o)),a=[],l=0,u=0,d=s.length;u<d;u++){for(var c=s[u],h=o.get(c),f=h[n],v=!1,g=0;g<l;g++)if(a[g]==f){v=!0;break}!v&&f!==void 0&&(a[l]=f,l++)}return a}},{key:"_addItem",value:function(n){var o=H7(n,this._idProp),s=o[this._idProp];if(this._data.has(s))throw new Error("Cannot add item: item with id "+s+" already exists");return this._data.set(s,o),++this.length,s}},{key:"_updateItem",value:function(n){var o=n[this._idProp];if(o==null)throw new Error("Cannot update item: item has no id (item: "+R4(n)+")");var s=this._data.get(o);if(!s)throw new Error("Cannot update item: no item with id "+o+" found");return this._data.set(o,Kw(Kw({},s),n)),o}},{key:"stream",value:function(n){if(n){var o=this._data;return new Vw({[Zi](){return ht.mark(function a(){var l,u,d,c;return ht.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:l=Ou(n),f.prev=1,l.s();case 3:if((u=l.n()).done){f.next=11;break}if(d=u.value,c=o.get(d),c==null){f.next=9;break}return f.next=9,[d,c];case 9:f.next=3;break;case 11:f.next=16;break;case 13:f.prev=13,f.t0=f.catch(1),l.e(f.t0);case 16:return f.prev=16,l.f(),f.finish(16);case 19:case"end":return f.stop()}},a,null,[[1,13,16,19]])})()}})}else{var s;return new Vw({[Zi]:OR(s=p7(this._data)).call(s,this._data)})}}}]),t}(E7);function U7(i,e){return typeof e=="object"&&e!==null&&i===e.idProp&&typeof e.add=="function"&&typeof e.clear=="function"&&typeof e.distinct=="function"&&typeof ci(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof zt(e)=="function"&&typeof e.max=="function"&&typeof e.min=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.remove=="function"&&typeof e.setOptions=="function"&&typeof e.stream=="function"&&typeof e.update=="function"&&typeof e.updateOnly=="function"}function RD(i,e){return typeof e=="object"&&e!==null&&i===e.idProp&&typeof ci(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof zt(e)=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.stream=="function"&&U7(i,e.getDataSet())}/**
 * vis-network
 * https://visjs.github.io/vis-network/
 *
 * A dynamic, browser-based visualization library.
 *
 * @version 10.0.2
 * @date    2025-09-15T17:48:13.838Z
 *
 * @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.
 */var Xw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Y(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Jw={},Jn,Zw;function Ee(){if(Zw)return Jn;Zw=1;var i=function(e){return e&&e.Math===Math&&e};return Jn=i(typeof globalThis=="object"&&globalThis)||i(typeof window=="object"&&window)||i(typeof self=="object"&&self)||i(typeof Xw=="object"&&Xw)||i(typeof Jn=="object"&&Jn)||function(){return this}()||Function("return this")(),Jn}var Iu,Qw;function ee(){return Qw||(Qw=1,Iu=function(i){try{return!!i()}catch{return!0}}),Iu}var Tu,e_;function Ko(){if(e_)return Tu;e_=1;var i=ee();return Tu=!i(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Tu}var Pu,t_;function Ua(){if(t_)return Pu;t_=1;var i=Ko(),e=Function.prototype,t=e.apply,r=e.call;return Pu=typeof Reflect=="object"&&Reflect.apply||(i?r.bind(t):function(){return r.apply(t,arguments)}),Pu}var Cu,r_;function te(){if(r_)return Cu;r_=1;var i=Ko(),e=Function.prototype,t=e.call,r=i&&e.bind.bind(t,t);return Cu=i?r:function(n){return function(){return t.apply(n,arguments)}},Cu}var Ru,i_;function or(){if(i_)return Ru;i_=1;var i=te(),e=i({}.toString),t=i("".slice);return Ru=function(r){return t(e(r),8,-1)},Ru}var xu,n_;function cy(){if(n_)return xu;n_=1;var i=or(),e=te();return xu=function(t){if(i(t)==="Function")return e(t)},xu}var Du,o_;function Ge(){if(o_)return Du;o_=1;var i=typeof document=="object"&&document.all;return Du=typeof i>"u"&&i!==void 0?function(e){return typeof e=="function"||e===i}:function(e){return typeof e=="function"},Du}var Au={},Mu,s_;function De(){if(s_)return Mu;s_=1;var i=ee();return Mu=!i(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Mu}var Nu,a_;function Et(){if(a_)return Nu;a_=1;var i=Ko(),e=Function.prototype.call;return Nu=i?e.bind(e):function(){return e.apply(e,arguments)},Nu}var ku={},l_;function Va(){if(l_)return ku;l_=1;var i={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,t=e&&!i.call({1:2},1);return ku.f=t?function(n){var o=e(this,n);return!!o&&o.enumerable}:i,ku}var Fu,u_;function Yo(){return u_||(u_=1,Fu=function(i,e){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:e}}),Fu}var qu,d_;function Ga(){if(d_)return qu;d_=1;var i=te(),e=ee(),t=or(),r=Object,n=i("".split);return qu=e(function(){return!r("z").propertyIsEnumerable(0)})?function(o){return t(o)==="String"?n(o,""):r(o)}:r,qu}var Bu,c_;function An(){return c_||(c_=1,Bu=function(i){return i==null}),Bu}var ju,h_;function Sr(){if(h_)return ju;h_=1;var i=An(),e=TypeError;return ju=function(t){if(i(t))throw new e("Can't call method on "+t);return t},ju}var Lu,f_;function Gt(){if(f_)return Lu;f_=1;var i=Ga(),e=Sr();return Lu=function(t){return i(e(t))},Lu}var zu,v_;function Ke(){if(v_)return zu;v_=1;var i=Ge();return zu=function(e){return typeof e=="object"?e!==null:i(e)},zu}var Wu,p_;function ue(){return p_||(p_=1,Wu={}),Wu}var Hu,g_;function Pt(){if(g_)return Hu;g_=1;var i=ue(),e=Ee(),t=Ge(),r=function(n){return t(n)?n:void 0};return Hu=function(n,o){return arguments.length<2?r(i[n])||r(e[n]):i[n]&&i[n][o]||e[n]&&e[n][o]},Hu}var Uu,y_;function Be(){if(y_)return Uu;y_=1;var i=te();return Uu=i({}.isPrototypeOf),Uu}var Vu,m_;function Mn(){if(m_)return Vu;m_=1;var i=Ee(),e=i.navigator,t=e&&e.userAgent;return Vu=t?String(t):"",Vu}var Gu,b_;function Xo(){if(b_)return Gu;b_=1;var i=Ee(),e=Mn(),t=i.process,r=i.Deno,n=t&&t.versions||r&&r.version,o=n&&n.v8,s,a;return o&&(s=o.split("."),a=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!a&&e&&(s=e.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=e.match(/Chrome\/(\d+)/),s&&(a=+s[1]))),Gu=a,Gu}var Ku,w_;function Nn(){if(w_)return Ku;w_=1;var i=Xo(),e=ee(),t=Ee(),r=t.String;return Ku=!!Object.getOwnPropertySymbols&&!e(function(){var n=Symbol("symbol detection");return!r(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&i&&i<41}),Ku}var Yu,__;function xD(){if(__)return Yu;__=1;var i=Nn();return Yu=i&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Yu}var Xu,E_;function Jo(){if(E_)return Xu;E_=1;var i=Pt(),e=Ge(),t=Be(),r=xD(),n=Object;return Xu=r?function(o){return typeof o=="symbol"}:function(o){var s=i("Symbol");return e(s)&&t(s.prototype,n(o))},Xu}var Ju,S_;function kn(){if(S_)return Ju;S_=1;var i=String;return Ju=function(e){try{return i(e)}catch{return"Object"}},Ju}var Zu,$_;function $r(){if($_)return Zu;$_=1;var i=Ge(),e=kn(),t=TypeError;return Zu=function(r){if(i(r))return r;throw new t(e(r)+" is not a function")},Zu}var Qu,O_;function hy(){if(O_)return Qu;O_=1;var i=$r(),e=An();return Qu=function(t,r){var n=t[r];return e(n)?void 0:i(n)},Qu}var ed,I_;function V7(){if(I_)return ed;I_=1;var i=Et(),e=Ge(),t=Ke(),r=TypeError;return ed=function(n,o){var s,a;if(o==="string"&&e(s=n.toString)&&!t(a=i(s,n))||e(s=n.valueOf)&&!t(a=i(s,n))||o!=="string"&&e(s=n.toString)&&!t(a=i(s,n)))return a;throw new r("Can't convert object to primitive value")},ed}var td={exports:{}},rd,T_;function Fn(){return T_||(T_=1,rd=!0),rd}var id,P_;function G7(){if(P_)return id;P_=1;var i=Ee(),e=Object.defineProperty;return id=function(t,r){try{e(i,t,{value:r,configurable:!0,writable:!0})}catch{i[t]=r}return r},id}var C_;function fy(){if(C_)return td.exports;C_=1;var i=Fn(),e=Ee(),t=G7(),r="__core-js_shared__",n=td.exports=e[r]||t(r,{});return(n.versions||(n.versions=[])).push({version:"3.44.0",mode:i?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE",source:"https://github.com/zloirock/core-js"}),td.exports}var nd,R_;function qn(){if(R_)return nd;R_=1;var i=fy();return nd=function(e,t){return i[e]||(i[e]=t||{})},nd}var od,x_;function Ct(){if(x_)return od;x_=1;var i=Sr(),e=Object;return od=function(t){return e(i(t))},od}var sd,D_;function Ze(){if(D_)return sd;D_=1;var i=te(),e=Ct(),t=i({}.hasOwnProperty);return sd=Object.hasOwn||function(n,o){return t(e(n),o)},sd}var ad,A_;function Ka(){if(A_)return ad;A_=1;var i=te(),e=0,t=Math.random(),r=i(1.1.toString);return ad=function(n){return"Symbol("+(n===void 0?"":n)+")_"+r(++e+t,36)},ad}var ld,M_;function je(){if(M_)return ld;M_=1;var i=Ee(),e=qn(),t=Ze(),r=Ka(),n=Nn(),o=xD(),s=i.Symbol,a=e("wks"),l=o?s.for||s:s&&s.withoutSetter||r;return ld=function(u){return t(a,u)||(a[u]=n&&t(s,u)?s[u]:l("Symbol."+u)),a[u]},ld}var ud,N_;function DD(){if(N_)return ud;N_=1;var i=Et(),e=Ke(),t=Jo(),r=hy(),n=V7(),o=je(),s=TypeError,a=o("toPrimitive");return ud=function(l,u){if(!e(l)||t(l))return l;var d=r(l,a),c;if(d){if(u===void 0&&(u="default"),c=i(d,l,u),!e(c)||t(c))return c;throw new s("Can't convert object to primitive value")}return u===void 0&&(u="number"),n(l,u)},ud}var dd,k_;function vy(){if(k_)return dd;k_=1;var i=DD(),e=Jo();return dd=function(t){var r=i(t,"string");return e(r)?r:r+""},dd}var cd,F_;function AD(){if(F_)return cd;F_=1;var i=Ee(),e=Ke(),t=i.document,r=e(t)&&e(t.createElement);return cd=function(n){return r?t.createElement(n):{}},cd}var hd,q_;function MD(){if(q_)return hd;q_=1;var i=De(),e=ee(),t=AD();return hd=!i&&!e(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!==7}),hd}var B_;function Ya(){if(B_)return Au;B_=1;var i=De(),e=Et(),t=Va(),r=Yo(),n=Gt(),o=vy(),s=Ze(),a=MD(),l=Object.getOwnPropertyDescriptor;return Au.f=i?l:function(d,c){if(d=n(d),c=o(c),a)try{return l(d,c)}catch{}if(s(d,c))return r(!e(t.f,d,c),d[c])},Au}var fd,j_;function K7(){if(j_)return fd;j_=1;var i=ee(),e=Ge(),t=/#|\.prototype\./,r=function(l,u){var d=o[n(l)];return d===a?!0:d===s?!1:e(u)?i(u):!!u},n=r.normalize=function(l){return String(l).replace(t,".").toLowerCase()},o=r.data={},s=r.NATIVE="N",a=r.POLYFILL="P";return fd=r,fd}var vd,L_;function Xa(){if(L_)return vd;L_=1;var i=cy(),e=$r(),t=Ko(),r=i(i.bind);return vd=function(n,o){return e(n),o===void 0?n:t?r(n,o):function(){return n.apply(o,arguments)}},vd}var pd={},gd,z_;function ND(){if(z_)return gd;z_=1;var i=De(),e=ee();return gd=i&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),gd}var yd,W_;function sr(){if(W_)return yd;W_=1;var i=Ke(),e=String,t=TypeError;return yd=function(r){if(i(r))return r;throw new t(e(r)+" is not an object")},yd}var H_;function Nt(){if(H_)return pd;H_=1;var i=De(),e=MD(),t=ND(),r=sr(),n=vy(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l="enumerable",u="configurable",d="writable";return pd.f=i?t?function(h,f,v){if(r(h),f=n(f),r(v),typeof h=="function"&&f==="prototype"&&"value"in v&&d in v&&!v[d]){var g=a(h,f);g&&g[d]&&(h[f]=v.value,v={configurable:u in v?v[u]:g[u],enumerable:l in v?v[l]:g[l],writable:!1})}return s(h,f,v)}:s:function(h,f,v){if(r(h),f=n(f),r(v),e)try{return s(h,f,v)}catch{}if("get"in v||"set"in v)throw new o("Accessors not supported");return"value"in v&&(h[f]=v.value),h},pd}var md,U_;function Bn(){if(U_)return md;U_=1;var i=De(),e=Nt(),t=Yo();return md=i?function(r,n,o){return e.f(r,n,t(1,o))}:function(r,n,o){return r[n]=o,r},md}var bd,V_;function z(){if(V_)return bd;V_=1;var i=Ee(),e=Ua(),t=cy(),r=Ge(),n=Ya().f,o=K7(),s=ue(),a=Xa(),l=Bn(),u=Ze(),d=function(c){var h=function(f,v,g){if(this instanceof h){switch(arguments.length){case 0:return new c;case 1:return new c(f);case 2:return new c(f,v)}return new c(f,v,g)}return e(c,this,arguments)};return h.prototype=c.prototype,h};return bd=function(c,h){var f=c.target,v=c.global,g=c.stat,y=c.proto,p=v?i:g?i[f]:i[f]&&i[f].prototype,m=v?s:s[f]||l(s,f,{})[f],w=m.prototype,b,_,S,I,E,$,T,R,C;for(I in h)b=o(v?I:f+(g?".":"#")+I,c.forced),_=!b&&p&&u(p,I),$=m[I],_&&(c.dontCallGetSet?(C=n(p,I),T=C&&C.value):T=p[I]),E=_&&T?T:h[I],!(!b&&!y&&typeof $==typeof E)&&(c.bind&&_?R=a(E,i):c.wrap&&_?R=d(E):y&&r(E)?R=t(E):R=E,(c.sham||E&&E.sham||$&&$.sham)&&l(R,"sham",!0),l(m,I,R),y&&(S=f+"Prototype",u(s,S)||l(s,S,{}),l(s[S],I,E),c.real&&w&&(b||!w[I])&&l(w,I,E)))},bd}var wd,G_;function Y7(){if(G_)return wd;G_=1;var i=Math.ceil,e=Math.floor;return wd=Math.trunc||function(r){var n=+r;return(n>0?e:i)(n)},wd}var _d,K_;function jn(){if(K_)return _d;K_=1;var i=Y7();return _d=function(e){var t=+e;return t!==t||t===0?0:i(t)},_d}var Ed,Y_;function Ja(){if(Y_)return Ed;Y_=1;var i=jn(),e=Math.max,t=Math.min;return Ed=function(r,n){var o=i(r);return o<0?e(o+n,0):t(o,n)},Ed}var Sd,X_;function kD(){if(X_)return Sd;X_=1;var i=jn(),e=Math.min;return Sd=function(t){var r=i(t);return r>0?e(r,9007199254740991):0},Sd}var $d,J_;function Or(){if(J_)return $d;J_=1;var i=kD();return $d=function(e){return i(e.length)},$d}var Od,Z_;function py(){if(Z_)return Od;Z_=1;var i=Gt(),e=Ja(),t=Or(),r=function(n){return function(o,s,a){var l=i(o),u=t(l);if(u===0)return!n&&-1;var d=e(a,u),c;if(n&&s!==s){for(;u>d;)if(c=l[d++],c!==c)return!0}else for(;u>d;d++)if((n||d in l)&&l[d]===s)return n||d||0;return!n&&-1}};return Od={includes:r(!0),indexOf:r(!1)},Od}var Id,Q_;function Zo(){return Q_||(Q_=1,Id={}),Id}var Td,e0;function FD(){if(e0)return Td;e0=1;var i=te(),e=Ze(),t=Gt(),r=py().indexOf,n=Zo(),o=i([].push);return Td=function(s,a){var l=t(s),u=0,d=[],c;for(c in l)!e(n,c)&&e(l,c)&&o(d,c);for(;a.length>u;)e(l,c=a[u++])&&(~r(d,c)||o(d,c));return d},Td}var Pd,t0;function gy(){return t0||(t0=1,Pd=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Pd}var Cd,r0;function Qo(){if(r0)return Cd;r0=1;var i=FD(),e=gy();return Cd=Object.keys||function(r){return i(r,e)},Cd}var Rd={},i0;function Za(){return i0||(i0=1,Rd.f=Object.getOwnPropertySymbols),Rd}var xd,n0;function X7(){if(n0)return xd;n0=1;var i=De(),e=te(),t=Et(),r=ee(),n=Qo(),o=Za(),s=Va(),a=Ct(),l=Ga(),u=Object.assign,d=Object.defineProperty,c=e([].concat);return xd=!u||r(function(){if(i&&u({b:1},u(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var h={},f={},v=Symbol("assign detection"),g="abcdefghijklmnopqrst";return h[v]=7,g.split("").forEach(function(y){f[y]=y}),u({},h)[v]!==7||n(u({},f)).join("")!==g})?function(f,v){for(var g=a(f),y=arguments.length,p=1,m=o.f,w=s.f;y>p;)for(var b=l(arguments[p++]),_=m?c(n(b),m(b)):n(b),S=_.length,I=0,E;S>I;)E=_[I++],(!i||t(w,b,E))&&(g[E]=b[E]);return g}:u,xd}var o0;function J7(){if(o0)return Jw;o0=1;var i=z(),e=X7();return i({target:"Object",stat:!0,arity:2,forced:Object.assign!==e},{assign:e}),Jw}var Dd,s0;function Z7(){if(s0)return Dd;s0=1,J7();var i=ue();return Dd=i.Object.assign,Dd}var Ad,a0;function Q7(){if(a0)return Ad;a0=1;var i=Z7();return Ad=i,Ad}var Md,l0;function eX(){return l0||(l0=1,Md=Q7()),Md}var tX=eX(),Ne=Y(tX),u0={},Nd,d0;function Ln(){if(d0)return Nd;d0=1;var i=te();return Nd=i([].slice),Nd}var kd,c0;function rX(){if(c0)return kd;c0=1;var i=te(),e=$r(),t=Ke(),r=Ze(),n=Ln(),o=Ko(),s=Function,a=i([].concat),l=i([].join),u={},d=function(c,h,f){if(!r(u,h)){for(var v=[],g=0;g<h;g++)v[g]="a["+g+"]";u[h]=s("C,a","return new C("+l(v,",")+")")}return u[h](c,f)};return kd=o?s.bind:function(h){var f=e(this),v=f.prototype,g=n(arguments,1),y=function(){var m=a(g,n(arguments));return this instanceof y?d(f,m.length,m):f.apply(h,m)};return t(v)&&(y.prototype=v),y},kd}var h0;function iX(){if(h0)return u0;h0=1;var i=z(),e=rX();return i({target:"Function",proto:!0,forced:Function.bind!==e},{bind:e}),u0}var Fd,f0;function Qe(){if(f0)return Fd;f0=1;var i=Ee(),e=ue();return Fd=function(t,r){var n=e[t+"Prototype"],o=n&&n[r];if(o)return o;var s=i[t],a=s&&s.prototype;return a&&a[r]},Fd}var qd,v0;function nX(){if(v0)return qd;v0=1,iX();var i=Qe();return qd=i("Function","bind"),qd}var Bd,p0;function oX(){if(p0)return Bd;p0=1;var i=Be(),e=nX(),t=Function.prototype;return Bd=function(r){var n=r.bind;return r===t||i(t,r)&&n===t.bind?e:n},Bd}var jd,g0;function sX(){if(g0)return jd;g0=1;var i=oX();return jd=i,jd}var Ld,y0;function aX(){return y0||(y0=1,Ld=sX()),Ld}var lX=aX(),A=Y(lX);function yy(i,e,t,r){i.beginPath(),i.arc(e,t,r,0,2*Math.PI,!1),i.closePath()}function uX(i,e,t,r){i.beginPath(),i.rect(e-r,t-r,r*2,r*2),i.closePath()}function dX(i,e,t,r){i.beginPath(),r*=1.15,t+=.275*r;const n=r*2,o=n/2,s=Math.sqrt(3)/6*n,a=Math.sqrt(n*n-o*o);i.moveTo(e,t-(a-s)),i.lineTo(e+o,t+s),i.lineTo(e-o,t+s),i.lineTo(e,t-(a-s)),i.closePath()}function cX(i,e,t,r){i.beginPath(),r*=1.15,t-=.275*r;const n=r*2,o=n/2,s=Math.sqrt(3)/6*n,a=Math.sqrt(n*n-o*o);i.moveTo(e,t+(a-s)),i.lineTo(e+o,t-s),i.lineTo(e-o,t-s),i.lineTo(e,t+(a-s)),i.closePath()}function hX(i,e,t,r){i.beginPath(),r*=.82,t+=.1*r;for(let n=0;n<10;n++){const o=n%2===0?r*1.3:r*.5;i.lineTo(e+o*Math.sin(n*2*Math.PI/10),t-o*Math.cos(n*2*Math.PI/10))}i.closePath()}function fX(i,e,t,r){i.beginPath(),i.lineTo(e,t+r),i.lineTo(e+r,t),i.lineTo(e,t-r),i.lineTo(e-r,t),i.closePath()}function qD(i,e,t,r,n,o){const s=Math.PI/180;r-2*o<0&&(o=r/2),n-2*o<0&&(o=n/2),i.beginPath(),i.moveTo(e+o,t),i.lineTo(e+r-o,t),i.arc(e+r-o,t+o,o,s*270,s*360,!1),i.lineTo(e+r,t+n-o),i.arc(e+r-o,t+n-o,o,0,s*90,!1),i.lineTo(e+o,t+n),i.arc(e+o,t+n-o,o,s*90,s*180,!1),i.lineTo(e,t+o),i.arc(e+o,t+o,o,s*180,s*270,!1),i.closePath()}function fg(i,e,t,r,n){const o=.5522848,s=r/2*o,a=n/2*o,l=e+r,u=t+n,d=e+r/2,c=t+n/2;i.beginPath(),i.moveTo(e,c),i.bezierCurveTo(e,c-a,d-s,t,d,t),i.bezierCurveTo(d+s,t,l,c-a,l,c),i.bezierCurveTo(l,c+a,d+s,u,d,u),i.bezierCurveTo(d-s,u,e,c+a,e,c),i.closePath()}function BD(i,e,t,r,n){const o=.3333333333333333,s=r,a=n*o,l=.5522848,u=s/2*l,d=a/2*l,c=e+s,h=t+a,f=e+s/2,v=t+a/2,g=t+(n-a/2),y=t+n;i.beginPath(),i.moveTo(c,v),i.bezierCurveTo(c,v+d,f+u,h,f,h),i.bezierCurveTo(f-u,h,e,v+d,e,v),i.bezierCurveTo(e,v-d,f-u,t,f,t),i.bezierCurveTo(f+u,t,c,v-d,c,v),i.lineTo(c,g),i.bezierCurveTo(c,g+d,f+u,y,f,y),i.bezierCurveTo(f-u,y,e,g+d,e,g),i.lineTo(e,v)}function jD(i,e,t,r,n,o){i.beginPath(),i.moveTo(e,t);const s=o.length,a=r-e,l=n-t,u=l/a;let d=Math.sqrt(a*a+l*l),c=0,h=!0,f=0,v=+o[0];for(;d>=.1;)v=+o[c++%s],v>d&&(v=d),f=Math.sqrt(v*v/(1+u*u)),f=a<0?-f:f,e+=f,t+=u*f,h===!0?i.lineTo(e,t):i.moveTo(e,t),d-=v,h=!h}function vX(i,e,t,r){i.beginPath();const n=6,o=Math.PI*2/n;i.moveTo(e+r,t);for(let s=1;s<n;s++)i.lineTo(e+r*Math.cos(o*s),t+r*Math.sin(o*s));i.closePath()}const m0={circle:yy,dashedLine:jD,database:BD,diamond:fX,ellipse:fg,ellipse_vis:fg,hexagon:vX,roundRect:qD,square:uX,star:hX,triangle:dX,triangleDown:cX};function pX(i){return Object.prototype.hasOwnProperty.call(m0,i)?m0[i]:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];CanvasRenderingContext2D.prototype[i].call(e,r)}}var zd={exports:{}},b0;function gX(){return b0||(b0=1,function(i){i.exports=e;function e(r){if(r)return t(r)}function t(r){for(var n in e.prototype)r[n]=e.prototype[n];return r}e.prototype.on=e.prototype.addEventListener=function(r,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(n),this},e.prototype.once=function(r,n){function o(){this.off(r,o),n.apply(this,arguments)}return o.fn=n,this.on(r,o),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(r,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var o=this._callbacks["$"+r];if(!o)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,a=0;a<o.length;a++)if(s=o[a],s===n||s.fn===n){o.splice(a,1);break}return o.length===0&&delete this._callbacks["$"+r],this},e.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),o=this._callbacks["$"+r],s=1;s<arguments.length;s++)n[s-1]=arguments[s];if(o){o=o.slice(0);for(var s=0,a=o.length;s<a;++s)o[s].apply(this,n)}return this},e.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]},e.prototype.hasListeners=function(r){return!!this.listeners(r).length}}(zd)),zd.exports}var yX=gX(),LD=Y(yX),w0={},Wd,_0;function Ti(){if(_0)return Wd;_0=1;var i=or();return Wd=Array.isArray||function(t){return i(t)==="Array"},Wd}var Hd,E0;function zD(){if(E0)return Hd;E0=1;var i=TypeError,e=9007199254740991;return Hd=function(t){if(t>e)throw i("Maximum allowed index exceeded");return t},Hd}var Ud,S0;function Qa(){if(S0)return Ud;S0=1;var i=De(),e=Nt(),t=Yo();return Ud=function(r,n,o){i?e.f(r,n,t(0,o)):r[n]=o},Ud}var Vd,$0;function my(){if($0)return Vd;$0=1;var i=je(),e=i("toStringTag"),t={};return t[e]="z",Vd=String(t)==="[object z]",Vd}var Gd,O0;function zn(){if(O0)return Gd;O0=1;var i=my(),e=Ge(),t=or(),r=je(),n=r("toStringTag"),o=Object,s=t(function(){return arguments}())==="Arguments",a=function(l,u){try{return l[u]}catch{}};return Gd=i?t:function(l){var u,d,c;return l===void 0?"Undefined":l===null?"Null":typeof(d=a(u=o(l),n))=="string"?d:s?t(u):(c=t(u))==="Object"&&e(u.callee)?"Arguments":c},Gd}var Kd,I0;function mX(){if(I0)return Kd;I0=1;var i=te(),e=Ge(),t=fy(),r=i(Function.toString);return e(t.inspectSource)||(t.inspectSource=function(n){return r(n)}),Kd=t.inspectSource,Kd}var Yd,T0;function WD(){if(T0)return Yd;T0=1;var i=te(),e=ee(),t=Ge(),r=zn(),n=Pt(),o=mX(),s=function(){},a=n("Reflect","construct"),l=/^\s*(?:class|function)\b/,u=i(l.exec),d=!l.test(s),c=function(v){if(!t(v))return!1;try{return a(s,[],v),!0}catch{return!1}},h=function(v){if(!t(v))return!1;switch(r(v)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!u(l,o(v))}catch{return!0}};return h.sham=!0,Yd=!a||e(function(){var f;return c(c.call)||!c(Object)||!c(function(){f=!0})||f})?h:c,Yd}var Xd,P0;function bX(){if(P0)return Xd;P0=1;var i=Ti(),e=WD(),t=Ke(),r=je(),n=r("species"),o=Array;return Xd=function(s){var a;return i(s)&&(a=s.constructor,e(a)&&(a===o||i(a.prototype))?a=void 0:t(a)&&(a=a[n],a===null&&(a=void 0))),a===void 0?o:a},Xd}var Jd,C0;function by(){if(C0)return Jd;C0=1;var i=bX();return Jd=function(e,t){return new(i(e))(t===0?0:t)},Jd}var Zd,R0;function es(){if(R0)return Zd;R0=1;var i=ee(),e=je(),t=Xo(),r=e("species");return Zd=function(n){return t>=51||!i(function(){var o=[],s=o.constructor={};return s[r]=function(){return{foo:1}},o[n](Boolean).foo!==1})},Zd}var x0;function HD(){if(x0)return w0;x0=1;var i=z(),e=ee(),t=Ti(),r=Ke(),n=Ct(),o=Or(),s=zD(),a=Qa(),l=by(),u=es(),d=je(),c=Xo(),h=d("isConcatSpreadable"),f=c>=51||!e(function(){var y=[];return y[h]=!1,y.concat()[0]!==y}),v=function(y){if(!r(y))return!1;var p=y[h];return p!==void 0?!!p:t(y)},g=!f||!u("concat");return i({target:"Array",proto:!0,arity:1,forced:g},{concat:function(p){var m=n(this),w=l(m,0),b=0,_,S,I,E,$;for(_=-1,I=arguments.length;_<I;_++)if($=_===-1?m:arguments[_],v($))for(E=o($),s(b+E),S=0;S<E;S++,b++)S in $&&a(w,b,$[S]);else s(b+1),a(w,b++,$);return w.length=b,w}}),w0}var D0={},A0={},Qd,M0;function kt(){if(M0)return Qd;M0=1;var i=zn(),e=String;return Qd=function(t){if(i(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(t)},Qd}var ec={},N0;function wy(){if(N0)return ec;N0=1;var i=De(),e=ND(),t=Nt(),r=sr(),n=Gt(),o=Qo();return ec.f=i&&!e?Object.defineProperties:function(a,l){r(a);for(var u=n(l),d=o(l),c=d.length,h=0,f;c>h;)t.f(a,f=d[h++],u[f]);return a},ec}var tc,k0;function wX(){if(k0)return tc;k0=1;var i=Pt();return tc=i("document","documentElement"),tc}var rc,F0;function el(){if(F0)return rc;F0=1;var i=qn(),e=Ka(),t=i("keys");return rc=function(r){return t[r]||(t[r]=e(r))},rc}var ic,q0;function ts(){if(q0)return ic;q0=1;var i=sr(),e=wy(),t=gy(),r=Zo(),n=wX(),o=AD(),s=el(),a=">",l="<",u="prototype",d="script",c=s("IE_PROTO"),h=function(){},f=function(m){return l+d+a+m+l+"/"+d+a},v=function(m){m.write(f("")),m.close();var w=m.parentWindow.Object;return m=null,w},g=function(){var m=o("iframe"),w="java"+d+":",b;return m.style.display="none",n.appendChild(m),m.src=String(w),b=m.contentWindow.document,b.open(),b.write(f("document.F=Object")),b.close(),b.F},y,p=function(){try{y=new ActiveXObject("htmlfile")}catch{}p=typeof document<"u"?document.domain&&y?v(y):g():v(y);for(var m=t.length;m--;)delete p[u][t[m]];return p()};return r[c]=!0,ic=Object.create||function(w,b){var _;return w!==null?(h[u]=i(w),_=new h,h[u]=null,_[c]=w):_=p(),b===void 0?_:e.f(_,b)},ic}var nc={},B0;function tl(){if(B0)return nc;B0=1;var i=FD(),e=gy(),t=e.concat("length","prototype");return nc.f=Object.getOwnPropertyNames||function(n){return i(n,t)},nc}var oc={},j0;function _y(){if(j0)return oc;j0=1;var i=or(),e=Gt(),t=tl().f,r=Ln(),n=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],o=function(s){try{return t(s)}catch{return r(n)}};return oc.f=function(a){return n&&i(a)==="Window"?o(a):t(e(a))},oc}var sc,L0;function rs(){if(L0)return sc;L0=1;var i=Bn();return sc=function(e,t,r,n){return n&&n.enumerable?e[t]=r:i(e,t,r),e},sc}var ac,z0;function Ey(){if(z0)return ac;z0=1;var i=Nt();return ac=function(e,t,r){return i.f(e,t,r)},ac}var lc={},W0;function rl(){if(W0)return lc;W0=1;var i=je();return lc.f=i,lc}var uc,H0;function Oe(){if(H0)return uc;H0=1;var i=ue(),e=Ze(),t=rl(),r=Nt().f;return uc=function(n){var o=i.Symbol||(i.Symbol={});e(o,n)||r(o,n,{value:t.f(n)})},uc}var dc,U0;function UD(){if(U0)return dc;U0=1;var i=Et(),e=Pt(),t=je(),r=rs();return dc=function(){var n=e("Symbol"),o=n&&n.prototype,s=o&&o.valueOf,a=t("toPrimitive");o&&!o[a]&&r(o,a,function(l){return i(s,this)},{arity:1})},dc}var cc,V0;function _X(){if(V0)return cc;V0=1;var i=my(),e=zn();return cc=i?{}.toString:function(){return"[object "+e(this)+"]"},cc}var hc,G0;function Pi(){if(G0)return hc;G0=1;var i=my(),e=Nt().f,t=Bn(),r=Ze(),n=_X(),o=je(),s=o("toStringTag");return hc=function(a,l,u,d){var c=u?a:a&&a.prototype;c&&(r(c,s)||e(c,s,{configurable:!0,value:l}),d&&!i&&t(c,"toString",n))},hc}var fc,K0;function VD(){if(K0)return fc;K0=1;var i=Ee(),e=Ge(),t=i.WeakMap;return fc=e(t)&&/native code/.test(String(t)),fc}var vc,Y0;function Ci(){if(Y0)return vc;Y0=1;var i=VD(),e=Ee(),t=Ke(),r=Bn(),n=Ze(),o=fy(),s=el(),a=Zo(),l="Object already initialized",u=e.TypeError,d=e.WeakMap,c,h,f,v=function(m){return f(m)?h(m):c(m,{})},g=function(m){return function(w){var b;if(!t(w)||(b=h(w)).type!==m)throw new u("Incompatible receiver, "+m+" required");return b}};if(i||o.state){var y=o.state||(o.state=new d);y.get=y.get,y.has=y.has,y.set=y.set,c=function(m,w){if(y.has(m))throw new u(l);return w.facade=m,y.set(m,w),w},h=function(m){return y.get(m)||{}},f=function(m){return y.has(m)}}else{var p=s("state");a[p]=!0,c=function(m,w){if(n(m,p))throw new u(l);return w.facade=m,r(m,p,w),w},h=function(m){return n(m,p)?m[p]:{}},f=function(m){return n(m,p)}}return vc={set:c,get:h,has:f,enforce:v,getterFor:g},vc}var pc,X0;function Vr(){if(X0)return pc;X0=1;var i=Xa(),e=te(),t=Ga(),r=Ct(),n=Or(),o=by(),s=e([].push),a=function(l){var u=l===1,d=l===2,c=l===3,h=l===4,f=l===6,v=l===7,g=l===5||f;return function(y,p,m,w){for(var b=r(y),_=t(b),S=n(_),I=i(p,m),E=0,$=w||o,T=u?$(y,S):d||v?$(y,0):void 0,R,C;S>E;E++)if((g||E in _)&&(R=_[E],C=I(R,E,b),l))if(u)T[E]=C;else if(C)switch(l){case 3:return!0;case 5:return R;case 6:return E;case 2:s(T,R)}else switch(l){case 4:return!1;case 7:s(T,R)}return f?-1:c||h?h:T}};return pc={forEach:a(0),map:a(1),filter:a(2),some:a(3),every:a(4),find:a(5),findIndex:a(6),filterReject:a(7)},pc}var J0;function EX(){if(J0)return A0;J0=1;var i=z(),e=Ee(),t=Et(),r=te(),n=Fn(),o=De(),s=Nn(),a=ee(),l=Ze(),u=Be(),d=sr(),c=Gt(),h=vy(),f=kt(),v=Yo(),g=ts(),y=Qo(),p=tl(),m=_y(),w=Za(),b=Ya(),_=Nt(),S=wy(),I=Va(),E=rs(),$=Ey(),T=qn(),R=el(),C=Zo(),P=Ka(),F=je(),q=rl(),X=Oe(),K=UD(),oe=Pi(),se=Ci(),ce=Vr().forEach,re=R("hidden"),Le="Symbol",lt="prototype",ut=se.set,Yr=se.getterFor(Le),et=Object[lt],qt=e.Symbol,ar=qt&&qt[lt],k=e.RangeError,x=e.TypeError,M=e.QObject,j=b.f,U=_.f,V=m.f,Se=I.f,ze=r([].push),me=T("symbols"),St=T("op-symbols"),Kt=T("wks"),Bt=!M||!M[lt]||!M[lt].findChild,Gy=function(pe,Q,ie){var ne=j(et,Q);ne&&delete et[Q],U(pe,Q,ie),ne&&pe!==et&&U(et,Q,ne)},cl=o&&a(function(){return g(U({},"a",{get:function(){return U(this,"a",{value:7}).a}})).a!==7})?Gy:U,hl=function(pe,Q){var ie=me[pe]=g(ar);return ut(ie,{type:Le,tag:pe,description:Q}),o||(ie.description=Q),ie},fs=function(Q,ie,ne){Q===et&&fs(St,ie,ne),d(Q);var ge=h(ie);return d(ne),l(me,ge)?(ne.enumerable?(l(Q,re)&&Q[re][ge]&&(Q[re][ge]=!1),ne=g(ne,{enumerable:v(0,!1)})):(l(Q,re)||U(Q,re,v(1,g(null))),Q[re][ge]=!0),cl(Q,ge,ne)):U(Q,ge,ne)},fl=function(Q,ie){d(Q);var ne=c(ie),ge=y(ne).concat(Xy(ne));return ce(ge,function(dt){(!o||t(vl,ne,dt))&&fs(Q,dt,ne[dt])}),Q},hM=function(Q,ie){return ie===void 0?g(Q):fl(g(Q),ie)},vl=function(Q){var ie=h(Q),ne=t(Se,this,ie);return this===et&&l(me,ie)&&!l(St,ie)?!1:ne||!l(this,ie)||!l(me,ie)||l(this,re)&&this[re][ie]?ne:!0},Ky=function(Q,ie){var ne=c(Q),ge=h(ie);if(!(ne===et&&l(me,ge)&&!l(St,ge))){var dt=j(ne,ge);return dt&&l(me,ge)&&!(l(ne,re)&&ne[re][ge])&&(dt.enumerable=!0),dt}},Yy=function(Q){var ie=V(c(Q)),ne=[];return ce(ie,function(ge){!l(me,ge)&&!l(C,ge)&&ze(ne,ge)}),ne},Xy=function(pe){var Q=pe===et,ie=V(Q?St:c(pe)),ne=[];return ce(ie,function(ge){l(me,ge)&&(!Q||l(et,ge))&&ze(ne,me[ge])}),ne};return s||(qt=function(){if(u(ar,this))throw new x("Symbol is not a constructor");var Q=!arguments.length||arguments[0]===void 0?void 0:f(arguments[0]),ie=P(Q),ne=function(ge){var dt=this===void 0?e:this;dt===et&&t(ne,St,ge),l(dt,re)&&l(dt[re],ie)&&(dt[re][ie]=!1);var Jy=v(1,ge);try{cl(dt,ie,Jy)}catch(Zy){if(!(Zy instanceof k))throw Zy;Gy(dt,ie,Jy)}};return o&&Bt&&cl(et,ie,{configurable:!0,set:ne}),hl(ie,Q)},ar=qt[lt],E(ar,"toString",function(){return Yr(this).tag}),E(qt,"withoutSetter",function(pe){return hl(P(pe),pe)}),I.f=vl,_.f=fs,S.f=fl,b.f=Ky,p.f=m.f=Yy,w.f=Xy,q.f=function(pe){return hl(F(pe),pe)},o&&($(ar,"description",{configurable:!0,get:function(){return Yr(this).description}}),n||E(et,"propertyIsEnumerable",vl,{unsafe:!0}))),i({global:!0,constructor:!0,wrap:!0,forced:!s,sham:!s},{Symbol:qt}),ce(y(Kt),function(pe){X(pe)}),i({target:Le,stat:!0,forced:!s},{useSetter:function(){Bt=!0},useSimple:function(){Bt=!1}}),i({target:"Object",stat:!0,forced:!s,sham:!o},{create:hM,defineProperty:fs,defineProperties:fl,getOwnPropertyDescriptor:Ky}),i({target:"Object",stat:!0,forced:!s},{getOwnPropertyNames:Yy}),K(),oe(qt,Le),C[re]=!0,A0}var Z0={},gc,Q0;function GD(){if(Q0)return gc;Q0=1;var i=Nn();return gc=i&&!!Symbol.for&&!!Symbol.keyFor,gc}var e1;function SX(){if(e1)return Z0;e1=1;var i=z(),e=Pt(),t=Ze(),r=kt(),n=qn(),o=GD(),s=n("string-to-symbol-registry"),a=n("symbol-to-string-registry");return i({target:"Symbol",stat:!0,forced:!o},{for:function(l){var u=r(l);if(t(s,u))return s[u];var d=e("Symbol")(u);return s[u]=d,a[d]=u,d}}),Z0}var t1={},r1;function $X(){if(r1)return t1;r1=1;var i=z(),e=Ze(),t=Jo(),r=kn(),n=qn(),o=GD(),s=n("symbol-to-string-registry");return i({target:"Symbol",stat:!0,forced:!o},{keyFor:function(l){if(!t(l))throw new TypeError(r(l)+" is not a symbol");if(e(s,l))return s[l]}}),t1}var i1={},yc,n1;function OX(){if(n1)return yc;n1=1;var i=te(),e=Ti(),t=Ge(),r=or(),n=kt(),o=i([].push);return yc=function(s){if(t(s))return s;if(e(s)){for(var a=s.length,l=[],u=0;u<a;u++){var d=s[u];typeof d=="string"?o(l,d):(typeof d=="number"||r(d)==="Number"||r(d)==="String")&&o(l,n(d))}var c=l.length,h=!0;return function(f,v){if(h)return h=!1,v;if(e(this))return v;for(var g=0;g<c;g++)if(l[g]===f)return v}}},yc}var o1;function KD(){if(o1)return i1;o1=1;var i=z(),e=Pt(),t=Ua(),r=Et(),n=te(),o=ee(),s=Ge(),a=Jo(),l=Ln(),u=OX(),d=Nn(),c=String,h=e("JSON","stringify"),f=n(/./.exec),v=n("".charAt),g=n("".charCodeAt),y=n("".replace),p=n(1.1.toString),m=/[\uD800-\uDFFF]/g,w=/^[\uD800-\uDBFF]$/,b=/^[\uDC00-\uDFFF]$/,_=!d||o(function(){var $=e("Symbol")("stringify detection");return h([$])!=="[null]"||h({a:$})!=="{}"||h(Object($))!=="{}"}),S=o(function(){return h("\uDF06\uD834")!=='"\\udf06\\ud834"'||h("\uDEAD")!=='"\\udead"'}),I=function($,T){var R=l(arguments),C=u(T);if(!(!s(C)&&($===void 0||a($))))return R[1]=function(P,F){if(s(C)&&(F=r(C,this,c(P),F)),!a(F))return F},t(h,null,R)},E=function($,T,R){var C=v(R,T-1),P=v(R,T+1);return f(w,$)&&!f(b,P)||f(b,$)&&!f(w,C)?"\\u"+p(g($,0),16):$};return h&&i({target:"JSON",stat:!0,arity:3,forced:_||S},{stringify:function(T,R,C){var P=l(arguments),F=t(_?I:h,null,P);return S&&typeof F=="string"?y(F,m,E):F}}),i1}var s1={},a1;function IX(){if(a1)return s1;a1=1;var i=z(),e=Nn(),t=ee(),r=Za(),n=Ct(),o=!e||t(function(){r.f(1)});return i({target:"Object",stat:!0,forced:o},{getOwnPropertySymbols:function(a){var l=r.f;return l?l(n(a)):[]}}),s1}var l1;function YD(){return l1||(l1=1,EX(),SX(),$X(),KD(),IX()),D0}var u1={},d1;function XD(){if(d1)return u1;d1=1;var i=Oe();return i("asyncDispose"),u1}var c1={},h1;function TX(){if(h1)return c1;h1=1;var i=Oe();return i("asyncIterator"),c1}var f1={},v1;function JD(){if(v1)return f1;v1=1;var i=Oe();return i("dispose"),f1}var p1={},g1;function PX(){if(g1)return p1;g1=1;var i=Oe();return i("hasInstance"),p1}var y1={},m1;function CX(){if(m1)return y1;m1=1;var i=Oe();return i("isConcatSpreadable"),y1}var b1={},w1;function ZD(){if(w1)return b1;w1=1;var i=Oe();return i("iterator"),b1}var _1={},E1;function RX(){if(E1)return _1;E1=1;var i=Oe();return i("match"),_1}var S1={},$1;function xX(){if($1)return S1;$1=1;var i=Oe();return i("matchAll"),S1}var O1={},I1;function DX(){if(I1)return O1;I1=1;var i=Oe();return i("replace"),O1}var T1={},P1;function AX(){if(P1)return T1;P1=1;var i=Oe();return i("search"),T1}var C1={},R1;function MX(){if(R1)return C1;R1=1;var i=Oe();return i("species"),C1}var x1={},D1;function NX(){if(D1)return x1;D1=1;var i=Oe();return i("split"),x1}var A1={},M1;function QD(){if(M1)return A1;M1=1;var i=Oe(),e=UD();return i("toPrimitive"),e(),A1}var N1={},k1;function kX(){if(k1)return N1;k1=1;var i=Pt(),e=Oe(),t=Pi();return e("toStringTag"),t(i("Symbol"),"Symbol"),N1}var F1={},q1;function FX(){if(q1)return F1;q1=1;var i=Oe();return i("unscopables"),F1}var B1={},j1;function qX(){if(j1)return B1;j1=1;var i=Ee(),e=Pi();return e(i.JSON,"JSON",!0),B1}var mc,L1;function BX(){if(L1)return mc;L1=1,HD(),YD(),XD(),TX(),JD(),PX(),CX(),ZD(),RX(),xX(),DX(),AX(),MX(),NX(),QD(),kX(),FX(),qX();var i=ue();return mc=i.Symbol,mc}var z1={},bc,W1;function Sy(){return W1||(W1=1,bc=function(){}),bc}var wc,H1;function Wn(){return H1||(H1=1,wc={}),wc}var _c,U1;function jX(){if(U1)return _c;U1=1;var i=De(),e=Ze(),t=Function.prototype,r=i&&Object.getOwnPropertyDescriptor,n=e(t,"name"),o=n&&(function(){}).name==="something",s=n&&(!i||i&&r(t,"name").configurable);return _c={EXISTS:n,PROPER:o,CONFIGURABLE:s},_c}var Ec,V1;function eA(){if(V1)return Ec;V1=1;var i=ee();return Ec=!i(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Ec}var Sc,G1;function il(){if(G1)return Sc;G1=1;var i=Ze(),e=Ge(),t=Ct(),r=el(),n=eA(),o=r("IE_PROTO"),s=Object,a=s.prototype;return Sc=n?s.getPrototypeOf:function(l){var u=t(l);if(i(u,o))return u[o];var d=u.constructor;return e(d)&&u instanceof d?d.prototype:u instanceof s?a:null},Sc}var $c,K1;function tA(){if(K1)return $c;K1=1;var i=ee(),e=Ge(),t=Ke(),r=ts(),n=il(),o=rs(),s=je(),a=Fn(),l=s("iterator"),u=!1,d,c,h;[].keys&&(h=[].keys(),"next"in h?(c=n(n(h)),c!==Object.prototype&&(d=c)):u=!0);var f=!t(d)||i(function(){var v={};return d[l].call(v)!==v});return f?d={}:a&&(d=r(d)),e(d[l])||o(d,l,function(){return this}),$c={IteratorPrototype:d,BUGGY_SAFARI_ITERATORS:u},$c}var Oc,Y1;function LX(){if(Y1)return Oc;Y1=1;var i=tA().IteratorPrototype,e=ts(),t=Yo(),r=Pi(),n=Wn(),o=function(){return this};return Oc=function(s,a,l,u){var d=a+" Iterator";return s.prototype=e(i,{next:t(+!u,l)}),r(s,d,!1,!0),n[d]=o,s},Oc}var Ic,X1;function zX(){if(X1)return Ic;X1=1;var i=te(),e=$r();return Ic=function(t,r,n){try{return i(e(Object.getOwnPropertyDescriptor(t,r)[n]))}catch{}},Ic}var Tc,J1;function WX(){if(J1)return Tc;J1=1;var i=Ke();return Tc=function(e){return i(e)||e===null},Tc}var Pc,Z1;function HX(){if(Z1)return Pc;Z1=1;var i=WX(),e=String,t=TypeError;return Pc=function(r){if(i(r))return r;throw new t("Can't set "+e(r)+" as a prototype")},Pc}var Cc,Q1;function UX(){if(Q1)return Cc;Q1=1;var i=zX(),e=Ke(),t=Sr(),r=HX();return Cc=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,o={},s;try{s=i(Object.prototype,"__proto__","set"),s(o,[]),n=o instanceof Array}catch{}return function(l,u){return t(l),r(u),e(l)&&(n?s(l,u):l.__proto__=u),l}}():void 0),Cc}var Rc,eE;function $y(){if(eE)return Rc;eE=1;var i=z(),e=Et(),t=Fn(),r=jX(),n=Ge(),o=LX(),s=il(),a=UX(),l=Pi(),u=Bn(),d=rs(),c=je(),h=Wn(),f=tA(),v=r.PROPER,g=r.CONFIGURABLE,y=f.IteratorPrototype,p=f.BUGGY_SAFARI_ITERATORS,m=c("iterator"),w="keys",b="values",_="entries",S=function(){return this};return Rc=function(I,E,$,T,R,C,P){o($,E,T);var F=function(ut){if(ut===R&&se)return se;if(!p&&ut&&ut in K)return K[ut];switch(ut){case w:return function(){return new $(this,ut)};case b:return function(){return new $(this,ut)};case _:return function(){return new $(this,ut)}}return function(){return new $(this)}},q=E+" Iterator",X=!1,K=I.prototype,oe=K[m]||K["@@iterator"]||R&&K[R],se=!p&&oe||F(R),ce=E==="Array"&&K.entries||oe,re,Le,lt;if(ce&&(re=s(ce.call(new I)),re!==Object.prototype&&re.next&&(!t&&s(re)!==y&&(a?a(re,y):n(re[m])||d(re,m,S)),l(re,q,!0,!0),t&&(h[q]=S))),v&&R===b&&oe&&oe.name!==b&&(!t&&g?u(K,"name",b):(X=!0,se=function(){return e(oe,this)})),R)if(Le={values:F(b),keys:C?se:F(w),entries:F(_)},P)for(lt in Le)(p||X||!(lt in K))&&d(K,lt,Le[lt]);else i({target:E,proto:!0,forced:p||X},Le);return(!t||P)&&K[m]!==se&&d(K,m,se,{name:R}),h[E]=se,Le},Rc}var xc,tE;function Oy(){return tE||(tE=1,xc=function(i,e){return{value:i,done:e}}),xc}var Dc,rE;function Hn(){if(rE)return Dc;rE=1;var i=Gt(),e=Sy(),t=Wn(),r=Ci(),n=Nt().f,o=$y(),s=Oy(),a=Fn(),l=De(),u="Array Iterator",d=r.set,c=r.getterFor(u);Dc=o(Array,"Array",function(f,v){d(this,{type:u,target:i(f),index:0,kind:v})},function(){var f=c(this),v=f.target,g=f.index++;if(!v||g>=v.length)return f.target=null,s(void 0,!0);switch(f.kind){case"keys":return s(g,!1);case"values":return s(v[g],!1)}return s([g,v[g]],!1)},"values");var h=t.Arguments=t.Array;if(e("keys"),e("values"),e("entries"),!a&&l&&h.name!=="values")try{n(h,"name",{value:"values"})}catch{}return Dc}var Ac,iE;function VX(){return iE||(iE=1,Ac={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}),Ac}var nE;function Un(){if(nE)return z1;nE=1,Hn();var i=VX(),e=Ee(),t=Pi(),r=Wn();for(var n in i)t(e[n],n),r[n]=r.Array;return z1}var Mc,oE;function rA(){if(oE)return Mc;oE=1;var i=BX();return Un(),Mc=i,Mc}var Nc,sE;function GX(){return sE||(sE=1,Nc=rA()),Nc}var KX=GX(),YX=Y(KX),aE={},lE;function XX(){if(lE)return aE;lE=1;var i=z(),e=Ti(),t=WD(),r=Ke(),n=Ja(),o=Or(),s=Gt(),a=Qa(),l=je(),u=es(),d=Ln(),c=u("slice"),h=l("species"),f=Array,v=Math.max;return i({target:"Array",proto:!0,forced:!c},{slice:function(y,p){var m=s(this),w=o(m),b=n(y,w),_=n(p===void 0?w:p,w),S,I,E;if(e(m)&&(S=m.constructor,t(S)&&(S===f||e(S.prototype))?S=void 0:r(S)&&(S=S[h],S===null&&(S=void 0)),S===f||S===void 0))return d(m,b,_);for(I=new(S===void 0?f:S)(v(_-b,0)),E=0;b<_;b++,E++)b in m&&a(I,E,m[b]);return I.length=E,I}}),aE}var kc,uE;function JX(){if(uE)return kc;uE=1,XX();var i=Qe();return kc=i("Array","slice"),kc}var Fc,dE;function ZX(){if(dE)return Fc;dE=1;var i=Be(),e=JX(),t=Array.prototype;return Fc=function(r){var n=r.slice;return r===t||i(t,r)&&n===t.slice?e:n},Fc}var qc,cE;function QX(){if(cE)return qc;cE=1;var i=ZX();return qc=i,qc}var Bc,hE;function eJ(){return hE||(hE=1,Bc=QX()),Bc}var tJ=eJ(),Jt=Y(tJ),jc,fE;function rJ(){if(fE)return jc;fE=1;var i=Pt(),e=te(),t=tl(),r=Za(),n=sr(),o=e([].concat);return jc=i("Reflect","ownKeys")||function(a){var l=t.f(n(a)),u=r.f;return u?o(l,u(a)):l},jc}var vE={},pE;function iJ(){if(pE)return vE;pE=1;var i=z(),e=Ti();return i({target:"Array",stat:!0},{isArray:e}),vE}var Lc,gE;function nJ(){if(gE)return Lc;gE=1,iJ();var i=ue();return Lc=i.Array.isArray,Lc}var zc,yE;function oJ(){if(yE)return zc;yE=1;var i=nJ();return zc=i,zc}var Wc,mE;function sJ(){return mE||(mE=1,Wc=oJ()),Wc}var aJ=sJ(),Pe=Y(aJ),bE={},wE;function lJ(){if(wE)return bE;wE=1;var i=z(),e=Vr().map,t=es(),r=t("map");return i({target:"Array",proto:!0,forced:!r},{map:function(o){return e(this,o,arguments.length>1?arguments[1]:void 0)}}),bE}var Hc,_E;function uJ(){if(_E)return Hc;_E=1,lJ();var i=Qe();return Hc=i("Array","map"),Hc}var Uc,EE;function dJ(){if(EE)return Uc;EE=1;var i=Be(),e=uJ(),t=Array.prototype;return Uc=function(r){var n=r.map;return r===t||i(t,r)&&n===t.map?e:n},Uc}var Vc,SE;function cJ(){if(SE)return Vc;SE=1;var i=dJ();return Vc=i,Vc}var Gc,$E;function hJ(){return $E||($E=1,Gc=cJ()),Gc}var fJ=hJ(),vn=Y(fJ),OE={},IE;function vJ(){if(IE)return OE;IE=1;var i=z(),e=Ct(),t=Qo(),r=ee(),n=r(function(){t(1)});return i({target:"Object",stat:!0,forced:n},{keys:function(s){return t(e(s))}}),OE}var Kc,TE;function pJ(){if(TE)return Kc;TE=1,vJ();var i=ue();return Kc=i.Object.keys,Kc}var Yc,PE;function gJ(){if(PE)return Yc;PE=1;var i=pJ();return Yc=i,Yc}var Xc,CE;function yJ(){return CE||(CE=1,Xc=gJ()),Xc}var mJ=yJ(),Te=Y(mJ),RE={},xE;function bJ(){if(xE)return RE;xE=1;var i=z(),e=te(),t=Date,r=e(t.prototype.getTime);return i({target:"Date",stat:!0},{now:function(){return r(new t)}}),RE}var Jc,DE;function wJ(){if(DE)return Jc;DE=1,bJ();var i=ue();return Jc=i.Date.now,Jc}var Zc,AE;function _J(){if(AE)return Zc;AE=1;var i=wJ();return Zc=i,Zc}var Qc,ME;function EJ(){return ME||(ME=1,Qc=_J()),Qc}var SJ=EJ(),aa=Y(SJ),NE={},eh,kE;function Vn(){if(kE)return eh;kE=1;var i=ee();return eh=function(e,t){var r=[][e];return!!r&&i(function(){r.call(null,t||function(){return 1},1)})},eh}var th,FE;function $J(){if(FE)return th;FE=1;var i=Vr().forEach,e=Vn(),t=e("forEach");return th=t?[].forEach:function(n){return i(this,n,arguments.length>1?arguments[1]:void 0)},th}var qE;function OJ(){if(qE)return NE;qE=1;var i=z(),e=$J();return i({target:"Array",proto:!0,forced:[].forEach!==e},{forEach:e}),NE}var rh,BE;function IJ(){if(BE)return rh;BE=1,OJ();var i=Qe();return rh=i("Array","forEach"),rh}var ih,jE;function TJ(){if(jE)return ih;jE=1;var i=IJ();return ih=i,ih}var nh,LE;function PJ(){if(LE)return nh;LE=1;var i=zn(),e=Ze(),t=Be(),r=TJ(),n=Array.prototype,o={DOMTokenList:!0,NodeList:!0};return nh=function(s){var a=s.forEach;return s===n||t(n,s)&&a===n.forEach||e(o,i(s))?r:a},nh}var oh,zE;function CJ(){return zE||(zE=1,oh=PJ()),oh}var RJ=CJ(),de=Y(RJ),WE={},HE;function xJ(){if(HE)return WE;HE=1;var i=z(),e=te(),t=Ti(),r=e([].reverse),n=[1,2];return i({target:"Array",proto:!0,forced:String(n)===String(n.reverse())},{reverse:function(){return t(this)&&(this.length=this.length),r(this)}}),WE}var sh,UE;function DJ(){if(UE)return sh;UE=1,xJ();var i=Qe();return sh=i("Array","reverse"),sh}var ah,VE;function AJ(){if(VE)return ah;VE=1;var i=Be(),e=DJ(),t=Array.prototype;return ah=function(r){var n=r.reverse;return r===t||i(t,r)&&n===t.reverse?e:n},ah}var lh,GE;function MJ(){if(GE)return lh;GE=1;var i=AJ();return lh=i,lh}var uh,KE;function NJ(){return KE||(KE=1,uh=MJ()),uh}var kJ=NJ(),ai=Y(kJ),YE={},dh,XE;function FJ(){if(XE)return dh;XE=1;var i=De(),e=Ti(),t=TypeError,r=Object.getOwnPropertyDescriptor,n=i&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(o){return o instanceof TypeError}}();return dh=n?function(o,s){if(e(o)&&!r(o,"length").writable)throw new t("Cannot set read only .length");return o.length=s}:function(o,s){return o.length=s},dh}var ch,JE;function iA(){if(JE)return ch;JE=1;var i=kn(),e=TypeError;return ch=function(t,r){if(!delete t[r])throw new e("Cannot delete property "+i(r)+" of "+i(t))},ch}var ZE;function qJ(){if(ZE)return YE;ZE=1;var i=z(),e=Ct(),t=Ja(),r=jn(),n=Or(),o=FJ(),s=zD(),a=by(),l=Qa(),u=iA(),d=es(),c=d("splice"),h=Math.max,f=Math.min;return i({target:"Array",proto:!0,forced:!c},{splice:function(g,y){var p=e(this),m=n(p),w=t(g,m),b=arguments.length,_,S,I,E,$,T;for(b===0?_=S=0:b===1?(_=0,S=m-w):(_=b-2,S=f(h(r(y),0),m-w)),s(m+_-S),I=a(p,S),E=0;E<S;E++)$=w+E,$ in p&&l(I,E,p[$]);if(I.length=S,_<S){for(E=w;E<m-S;E++)$=E+S,T=E+_,$ in p?p[T]=p[$]:u(p,T);for(E=m;E>m-S+_;E--)u(p,E-1)}else if(_>S)for(E=m-S;E>w;E--)$=E+S-1,T=E+_-1,$ in p?p[T]=p[$]:u(p,T);for(E=0;E<_;E++)p[E+w]=arguments[E+2];return o(p,m-S+_),I}}),YE}var hh,QE;function BJ(){if(QE)return hh;QE=1,qJ();var i=Qe();return hh=i("Array","splice"),hh}var fh,eS;function jJ(){if(eS)return fh;eS=1;var i=Be(),e=BJ(),t=Array.prototype;return fh=function(r){var n=r.splice;return r===t||i(t,r)&&n===t.splice?e:n},fh}var vh,tS;function LJ(){if(tS)return vh;tS=1;var i=jJ();return vh=i,vh}var ph,rS;function zJ(){return rS||(rS=1,ph=LJ()),ph}var WJ=zJ(),vr=Y(WJ),iS={},nS;function HJ(){if(nS)return iS;nS=1;var i=z(),e=py().includes,t=ee(),r=Sy(),n=t(function(){return!Array(1).includes()});return i({target:"Array",proto:!0,forced:n},{includes:function(s){return e(this,s,arguments.length>1?arguments[1]:void 0)}}),r("includes"),iS}var gh,oS;function UJ(){if(oS)return gh;oS=1,HJ();var i=Qe();return gh=i("Array","includes"),gh}var sS={},yh,aS;function VJ(){if(aS)return yh;aS=1;var i=Ke(),e=or(),t=je(),r=t("match");return yh=function(n){var o;return i(n)&&((o=n[r])!==void 0?!!o:e(n)==="RegExp")},yh}var mh,lS;function GJ(){if(lS)return mh;lS=1;var i=VJ(),e=TypeError;return mh=function(t){if(i(t))throw new e("The method doesn't accept regular expressions");return t},mh}var bh,uS;function KJ(){if(uS)return bh;uS=1;var i=je(),e=i("match");return bh=function(t){var r=/./;try{"/./"[t](r)}catch{try{return r[e]=!1,"/./"[t](r)}catch{}}return!1},bh}var dS;function YJ(){if(dS)return sS;dS=1;var i=z(),e=te(),t=GJ(),r=Sr(),n=kt(),o=KJ(),s=e("".indexOf);return i({target:"String",proto:!0,forced:!o("includes")},{includes:function(l){return!!~s(n(r(this)),n(t(l)),arguments.length>1?arguments[1]:void 0)}}),sS}var wh,cS;function XJ(){if(cS)return wh;cS=1,YJ();var i=Qe();return wh=i("String","includes"),wh}var _h,hS;function JJ(){if(hS)return _h;hS=1;var i=Be(),e=UJ(),t=XJ(),r=Array.prototype,n=String.prototype;return _h=function(o){var s=o.includes;return o===r||i(r,o)&&s===r.includes?e:typeof o=="string"||o===n||i(n,o)&&s===n.includes?t:s},_h}var Eh,fS;function ZJ(){if(fS)return Eh;fS=1;var i=JJ();return Eh=i,Eh}var Sh,vS;function QJ(){return vS||(vS=1,Sh=ZJ()),Sh}var eZ=QJ(),Mr=Y(eZ),pS={},gS;function tZ(){if(gS)return pS;gS=1;var i=z(),e=ee(),t=Ct(),r=il(),n=eA(),o=e(function(){r(1)});return i({target:"Object",stat:!0,forced:o,sham:!n},{getPrototypeOf:function(a){return r(t(a))}}),pS}var $h,yS;function rZ(){if(yS)return $h;yS=1,tZ();var i=ue();return $h=i.Object.getPrototypeOf,$h}var Oh,mS;function iZ(){if(mS)return Oh;mS=1;var i=rZ();return Oh=i,Oh}var Ih,bS;function nZ(){return bS||(bS=1,Ih=iZ()),Ih}var oZ=nZ(),wS=Y(oZ),Th,_S;function sZ(){if(_S)return Th;_S=1,HD();var i=Qe();return Th=i("Array","concat"),Th}var Ph,ES;function aZ(){if(ES)return Ph;ES=1;var i=Be(),e=sZ(),t=Array.prototype;return Ph=function(r){var n=r.concat;return r===t||i(t,r)&&n===t.concat?e:n},Ph}var Ch,SS;function lZ(){if(SS)return Ch;SS=1;var i=aZ();return Ch=i,Ch}var Rh,$S;function uZ(){return $S||($S=1,Rh=lZ()),Rh}var dZ=uZ(),cZ=Y(dZ),OS={},IS;function hZ(){if(IS)return OS;IS=1;var i=z(),e=Vr().filter,t=es(),r=t("filter");return i({target:"Array",proto:!0,forced:!r},{filter:function(o){return e(this,o,arguments.length>1?arguments[1]:void 0)}}),OS}var xh,TS;function fZ(){if(TS)return xh;TS=1,hZ();var i=Qe();return xh=i("Array","filter"),xh}var Dh,PS;function vZ(){if(PS)return Dh;PS=1;var i=Be(),e=fZ(),t=Array.prototype;return Dh=function(r){var n=r.filter;return r===t||i(t,r)&&n===t.filter?e:n},Dh}var Ah,CS;function pZ(){if(CS)return Ah;CS=1;var i=vZ();return Ah=i,Ah}var Mh,RS;function gZ(){return RS||(RS=1,Mh=pZ()),Mh}var yZ=gZ(),gt=Y(yZ),xS={},Nh,DS;function mZ(){if(DS)return Nh;DS=1;var i=De(),e=ee(),t=te(),r=il(),n=Qo(),o=Gt(),s=Va().f,a=t(s),l=t([].push),u=i&&e(function(){var c=Object.create(null);return c[2]=2,!a(c,2)}),d=function(c){return function(h){for(var f=o(h),v=n(f),g=u&&r(f)===null,y=v.length,p=0,m=[],w;y>p;)w=v[p++],(!i||(g?w in f:a(f,w)))&&l(m,c?[w,f[w]]:f[w]);return m}};return Nh={entries:d(!0),values:d(!1)},Nh}var AS;function bZ(){if(AS)return xS;AS=1;var i=z(),e=mZ().values;return i({target:"Object",stat:!0},{values:function(r){return e(r)}}),xS}var kh,MS;function wZ(){if(MS)return kh;MS=1,bZ();var i=ue();return kh=i.Object.values,kh}var Fh,NS;function _Z(){if(NS)return Fh;NS=1;var i=wZ();return Fh=i,Fh}var qh,kS;function EZ(){return kS||(kS=1,qh=_Z()),qh}var SZ=EZ(),$Z=Y(SZ),FS={},Bh,qS;function Iy(){return qS||(qS=1,Bh=`	
\v\f\r                　\u2028\u2029\uFEFF`),Bh}var jh,BS;function nA(){if(BS)return jh;BS=1;var i=te(),e=Sr(),t=kt(),r=Iy(),n=i("".replace),o=RegExp("^["+r+"]+"),s=RegExp("(^|[^"+r+"])["+r+"]+$"),a=function(l){return function(u){var d=t(e(u));return l&1&&(d=n(d,o,"")),l&2&&(d=n(d,s,"$1")),d}};return jh={start:a(1),end:a(2),trim:a(3)},jh}var Lh,jS;function OZ(){if(jS)return Lh;jS=1;var i=Ee(),e=ee(),t=te(),r=kt(),n=nA().trim,o=Iy(),s=i.parseInt,a=i.Symbol,l=a&&a.iterator,u=/^[+-]?0x/i,d=t(u.exec),c=s(o+"08")!==8||s(o+"0x16")!==22||l&&!e(function(){s(Object(l))});return Lh=c?function(f,v){var g=n(r(f));return s(g,v>>>0||(d(u,g)?16:10))}:s,Lh}var LS;function IZ(){if(LS)return FS;LS=1;var i=z(),e=OZ();return i({global:!0,forced:parseInt!==e},{parseInt:e}),FS}var zh,zS;function TZ(){if(zS)return zh;zS=1,IZ();var i=ue();return zh=i.parseInt,zh}var Wh,WS;function PZ(){if(WS)return Wh;WS=1;var i=TZ();return Wh=i,Wh}var Hh,HS;function CZ(){return HS||(HS=1,Hh=PZ()),Hh}var RZ=CZ(),Wt=Y(RZ),US={},VS;function xZ(){if(VS)return US;VS=1;var i=z(),e=cy(),t=py().indexOf,r=Vn(),n=e([].indexOf),o=!!n&&1/n([1],1,-0)<0,s=o||!r("indexOf");return i({target:"Array",proto:!0,forced:s},{indexOf:function(l){var u=arguments.length>1?arguments[1]:void 0;return o?n(this,l,u)||0:t(this,l,u)}}),US}var Uh,GS;function DZ(){if(GS)return Uh;GS=1,xZ();var i=Qe();return Uh=i("Array","indexOf"),Uh}var Vh,KS;function AZ(){if(KS)return Vh;KS=1;var i=Be(),e=DZ(),t=Array.prototype;return Vh=function(r){var n=r.indexOf;return r===t||i(t,r)&&n===t.indexOf?e:n},Vh}var Gh,YS;function MZ(){if(YS)return Gh;YS=1;var i=AZ();return Gh=i,Gh}var Kh,XS;function NZ(){return XS||(XS=1,Kh=MZ()),Kh}var kZ=NZ(),le=Y(kZ),JS={},ZS;function FZ(){if(ZS)return JS;ZS=1;var i=z(),e=De(),t=ts();return i({target:"Object",stat:!0,sham:!e},{create:t}),JS}var Yh,QS;function qZ(){if(QS)return Yh;QS=1,FZ();var i=ue(),e=i.Object;return Yh=function(r,n){return e.create(r,n)},Yh}var Xh,e$;function BZ(){if(e$)return Xh;e$=1;var i=qZ();return Xh=i,Xh}var Jh,t$;function jZ(){return t$||(t$=1,Jh=BZ()),Jh}var LZ=jZ(),li=Y(LZ),r$={},Zh,i$;function zZ(){if(i$)return Zh;i$=1;var i=jn(),e=kt(),t=Sr(),r=RangeError;return Zh=function(o){var s=e(t(this)),a="",l=i(o);if(l<0||l===1/0)throw new r("Wrong number of repetitions");for(;l>0;(l>>>=1)&&(s+=s))l&1&&(a+=s);return a},Zh}var Qh,n$;function WZ(){if(n$)return Qh;n$=1;var i=te(),e=kD(),t=kt(),r=zZ(),n=Sr(),o=i(r),s=i("".slice),a=Math.ceil,l=function(u){return function(d,c,h){var f=t(n(d)),v=e(c),g=f.length,y=h===void 0?" ":t(h),p,m;return v<=g||y===""?f:(p=v-g,m=o(y,a(p/y.length)),m.length>p&&(m=s(m,0,p)),u?f+m:m+f)}};return Qh={start:l(!1),end:l(!0)},Qh}var ef,o$;function HZ(){if(o$)return ef;o$=1;var i=te(),e=ee(),t=WZ().start,r=RangeError,n=isFinite,o=Math.abs,s=Date.prototype,a=s.toISOString,l=i(s.getTime),u=i(s.getUTCDate),d=i(s.getUTCFullYear),c=i(s.getUTCHours),h=i(s.getUTCMilliseconds),f=i(s.getUTCMinutes),v=i(s.getUTCMonth),g=i(s.getUTCSeconds);return ef=e(function(){return a.call(new Date(-5e13-1))!=="0385-07-25T07:06:39.999Z"})||!e(function(){a.call(new Date(NaN))})?function(){if(!n(l(this)))throw new r("Invalid time value");var p=this,m=d(p),w=h(p),b=m<0?"-":m>9999?"+":"";return b+t(o(m),b?6:4,0)+"-"+t(v(p)+1,2,0)+"-"+t(u(p),2,0)+"T"+t(c(p),2,0)+":"+t(f(p),2,0)+":"+t(g(p),2,0)+"."+t(w,3,0)+"Z"}:a,ef}var s$;function UZ(){if(s$)return r$;s$=1;var i=z(),e=Et(),t=Ct(),r=DD(),n=HZ(),o=or(),s=ee(),a=s(function(){return new Date(NaN).toJSON()!==null||e(Date.prototype.toJSON,{toISOString:function(){return 1}})!==1});return i({target:"Date",proto:!0,forced:a},{toJSON:function(u){var d=t(this),c=r(d,"number");return typeof c=="number"&&!isFinite(c)?null:!("toISOString"in d)&&o(d)==="Date"?e(n,d):d.toISOString()}}),r$}var tf,a$;function VZ(){if(a$)return tf;a$=1,UZ(),KD();var i=ue(),e=Ua();return i.JSON||(i.JSON={stringify:JSON.stringify}),tf=function(r,n,o){return e(i.JSON.stringify,null,arguments)},tf}var rf,l$;function GZ(){if(l$)return rf;l$=1;var i=VZ();return rf=i,rf}var nf,u$;function KZ(){return u$||(u$=1,nf=GZ()),nf}var YZ=KZ(),is=Y(YZ),d$={},c$={},of,h$;function oA(){if(h$)return of;h$=1;var i=Ee(),e=Mn(),t=or(),r=function(n){return e.slice(0,n.length)===n};return of=function(){return r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":i.Bun&&typeof Bun.version=="string"?"BUN":i.Deno&&typeof Deno.version=="object"?"DENO":t(i.process)==="process"?"NODE":i.window&&i.document?"BROWSER":"REST"}(),of}var sf,f$;function XZ(){if(f$)return sf;f$=1;var i=TypeError;return sf=function(e,t){if(e<t)throw new i("Not enough arguments");return e},sf}var af,v$;function sA(){if(v$)return af;v$=1;var i=Ee(),e=Ua(),t=Ge(),r=oA(),n=Mn(),o=Ln(),s=XZ(),a=i.Function,l=/MSIE .\./.test(n)||r==="BUN"&&function(){var u=i.Bun.version.split(".");return u.length<3||u[0]==="0"&&(u[1]<3||u[1]==="3"&&u[2]==="0")}();return af=function(u,d){var c=d?2:1;return l?function(h,f){var v=s(arguments.length,1)>c,g=t(h)?h:a(h),y=v?o(arguments,c):[],p=v?function(){e(g,this,y)}:g;return d?u(p,f):u(p)}:u},af}var p$;function JZ(){if(p$)return c$;p$=1;var i=z(),e=Ee(),t=sA(),r=t(e.setInterval,!0);return i({global:!0,bind:!0,forced:e.setInterval!==r},{setInterval:r}),c$}var g$={},y$;function ZZ(){if(y$)return g$;y$=1;var i=z(),e=Ee(),t=sA(),r=t(e.setTimeout,!0);return i({global:!0,bind:!0,forced:e.setTimeout!==r},{setTimeout:r}),g$}var m$;function aA(){return m$||(m$=1,JZ(),ZZ()),d$}var lf,b$;function QZ(){if(b$)return lf;b$=1,aA();var i=ue();return lf=i.setTimeout,lf}var uf,w$;function eQ(){return w$||(w$=1,uf=QZ()),uf}var tQ=eQ(),pr=Y(tQ),_$={},df,E$;function rQ(){if(E$)return df;E$=1;var i=Ct(),e=Ja(),t=Or();return df=function(n){for(var o=i(this),s=t(o),a=arguments.length,l=e(a>1?arguments[1]:void 0,s),u=a>2?arguments[2]:void 0,d=u===void 0?s:e(u,s);d>l;)o[l++]=n;return o},df}var S$;function iQ(){if(S$)return _$;S$=1;var i=z(),e=rQ(),t=Sy();return i({target:"Array",proto:!0},{fill:e}),t("fill"),_$}var cf,$$;function nQ(){if($$)return cf;$$=1,iQ();var i=Qe();return cf=i("Array","fill"),cf}var hf,O$;function oQ(){if(O$)return hf;O$=1;var i=Be(),e=nQ(),t=Array.prototype;return hf=function(r){var n=r.fill;return r===t||i(t,r)&&n===t.fill?e:n},hf}var ff,I$;function sQ(){if(I$)return ff;I$=1;var i=oQ();return ff=i,ff}var vf,T$;function aQ(){return T$||(T$=1,vf=sQ()),vf}var lQ=aQ(),ns=Y(lQ);/*! 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 Vt(){return Vt=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Vt.apply(this,arguments)}function Ft(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}function Ms(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}var vg;typeof Object.assign!="function"?vg=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r<arguments.length;r++){var n=arguments[r];if(n!=null)for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])}return t}:vg=Object.assign;var gi=vg,P$=["","webkit","Moz","MS","ms","o"],uQ=typeof document>"u"?{style:{}}:document.createElement("div"),dQ="function",Qi=Math.round,yi=Math.abs,Ty=Date.now;function nl(i,e){for(var t,r,n=e[0].toUpperCase()+e.slice(1),o=0;o<P$.length;){if(t=P$[o],r=t?t+n:e,r in i)return r;o++}}var gr;typeof window>"u"?gr={}:gr=window;var lA=nl(uQ.style,"touchAction"),uA=lA!==void 0;function cQ(){if(!uA)return!1;var i={},e=gr.CSS&&gr.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return i[t]=e?gr.CSS.supports("touch-action",t):!0}),i}var dA="compute",cA="auto",pg="manipulation",ui="none",Eo="pan-x",So="pan-y",Ns=cQ(),hQ=/mobile|tablet|ip(ad|hone|od)|android/i,hA="ontouchstart"in gr,fQ=nl(gr,"PointerEvent")!==void 0,vQ=hA&&hQ.test(navigator.userAgent),os="touch",pQ="pen",Py="mouse",gQ="kinect",yQ=25,st=1,Ri=2,ke=4,mt=8,la=1,ss=2,as=4,ls=8,pn=16,rr=ss|as,di=ls|pn,fA=rr|di,vA=["x","y"],ua=["clientX","clientY"];function yr(i,e,t){var r;if(i)if(i.forEach)i.forEach(e,t);else if(i.length!==void 0)for(r=0;r<i.length;)e.call(t,i[r],r,i),r++;else for(r in i)i.hasOwnProperty(r)&&e.call(t,i[r],r,i)}function ol(i,e){return typeof i===dQ?i.apply(e&&e[0]||void 0,e):i}function ti(i,e){return i.indexOf(e)>-1}function mQ(i){if(ti(i,ui))return ui;var e=ti(i,Eo),t=ti(i,So);return e&&t?ui:e||t?e?Eo:So:ti(i,pg)?pg:cA}var pA=function(){function i(t,r){this.manager=t,this.set(r)}var e=i.prototype;return e.set=function(r){r===dA&&(r=this.compute()),uA&&this.manager.element.style&&Ns[r]&&(this.manager.element.style[lA]=r),this.actions=r.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var r=[];return yr(this.manager.recognizers,function(n){ol(n.options.enable,[n])&&(r=r.concat(n.getTouchAction()))}),mQ(r.join(" "))},e.preventDefaults=function(r){var n=r.srcEvent,o=r.offsetDirection;if(this.manager.session.prevented){n.preventDefault();return}var s=this.actions,a=ti(s,ui)&&!Ns[ui],l=ti(s,So)&&!Ns[So],u=ti(s,Eo)&&!Ns[Eo];if(a){var d=r.pointers.length===1,c=r.distance<2,h=r.deltaTime<250;if(d&&c&&h)return}if(!(u&&l)&&(a||l&&o&rr||u&&o&di))return this.preventSrc(n)},e.preventSrc=function(r){this.manager.session.prevented=!0,r.preventDefault()},i}();function Cy(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}function gA(i){var e=i.length;if(e===1)return{x:Qi(i[0].clientX),y:Qi(i[0].clientY)};for(var t=0,r=0,n=0;n<e;)t+=i[n].clientX,r+=i[n].clientY,n++;return{x:Qi(t/e),y:Qi(r/e)}}function C$(i){for(var e=[],t=0;t<i.pointers.length;)e[t]={clientX:Qi(i.pointers[t].clientX),clientY:Qi(i.pointers[t].clientY)},t++;return{timeStamp:Ty(),pointers:e,center:gA(e),deltaX:i.deltaX,deltaY:i.deltaY}}function da(i,e,t){t||(t=vA);var r=e[t[0]]-i[t[0]],n=e[t[1]]-i[t[1]];return Math.sqrt(r*r+n*n)}function gg(i,e,t){t||(t=vA);var r=e[t[0]]-i[t[0]],n=e[t[1]]-i[t[1]];return Math.atan2(n,r)*180/Math.PI}function yA(i,e){return i===e?la:yi(i)>=yi(e)?i<0?ss:as:e<0?ls:pn}function bQ(i,e){var t=e.center,r=i.offsetDelta||{},n=i.prevDelta||{},o=i.prevInput||{};(e.eventType===st||o.eventType===ke)&&(n=i.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=i.offsetDelta={x:t.x,y:t.y}),e.deltaX=n.x+(t.x-r.x),e.deltaY=n.y+(t.y-r.y)}function mA(i,e,t){return{x:e/i||0,y:t/i||0}}function wQ(i,e){return da(e[0],e[1],ua)/da(i[0],i[1],ua)}function _Q(i,e){return gg(e[1],e[0],ua)+gg(i[1],i[0],ua)}function EQ(i,e){var t=i.lastInterval||e,r=e.timeStamp-t.timeStamp,n,o,s,a;if(e.eventType!==mt&&(r>yQ||t.velocity===void 0)){var l=e.deltaX-t.deltaX,u=e.deltaY-t.deltaY,d=mA(r,l,u);o=d.x,s=d.y,n=yi(d.x)>yi(d.y)?d.x:d.y,a=yA(l,u),i.lastInterval=e}else n=t.velocity,o=t.velocityX,s=t.velocityY,a=t.direction;e.velocity=n,e.velocityX=o,e.velocityY=s,e.direction=a}function SQ(i,e){var t=i.session,r=e.pointers,n=r.length;t.firstInput||(t.firstInput=C$(e)),n>1&&!t.firstMultiple?t.firstMultiple=C$(e):n===1&&(t.firstMultiple=!1);var o=t.firstInput,s=t.firstMultiple,a=s?s.center:o.center,l=e.center=gA(r);e.timeStamp=Ty(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=gg(a,l),e.distance=da(a,l),bQ(t,e),e.offsetDirection=yA(e.deltaX,e.deltaY);var u=mA(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=yi(u.x)>yi(u.y)?u.x:u.y,e.scale=s?wQ(s.pointers,r):1,e.rotation=s?_Q(s.pointers,r):0,e.maxPointers=t.prevInput?e.pointers.length>t.prevInput.maxPointers?e.pointers.length:t.prevInput.maxPointers:e.pointers.length,EQ(t,e);var d=i.element,c=e.srcEvent,h;c.composedPath?h=c.composedPath()[0]:c.path?h=c.path[0]:h=c.target,Cy(h,d)&&(d=h),e.target=d}function $Q(i,e,t){var r=t.pointers.length,n=t.changedPointers.length,o=e&st&&r-n===0,s=e&(ke|mt)&&r-n===0;t.isFirst=!!o,t.isFinal=!!s,o&&(i.session={}),t.eventType=e,SQ(i,t),i.emit("hammer.input",t),i.recognize(t),i.session.prevInput=t}function $o(i){return i.trim().split(/\s+/g)}function ao(i,e,t){yr($o(e),function(r){i.addEventListener(r,t,!1)})}function lo(i,e,t){yr($o(e),function(r){i.removeEventListener(r,t,!1)})}function R$(i){var e=i.ownerDocument||i;return e.defaultView||e.parentWindow||window}var Gn=function(){function i(t,r){var n=this;this.manager=t,this.callback=r,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(o){ol(t.options.enable,[t])&&n.handler(o)},this.init()}var e=i.prototype;return e.handler=function(){},e.init=function(){this.evEl&&ao(this.element,this.evEl,this.domHandler),this.evTarget&&ao(this.target,this.evTarget,this.domHandler),this.evWin&&ao(R$(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&lo(this.element,this.evEl,this.domHandler),this.evTarget&&lo(this.target,this.evTarget,this.domHandler),this.evWin&&lo(R$(this.element),this.evWin,this.domHandler)},i}();function mi(i,e,t){if(i.indexOf&&!t)return i.indexOf(e);for(var r=0;r<i.length;){if(t&&i[r][t]==e||!t&&i[r]===e)return r;r++}return-1}var OQ={pointerdown:st,pointermove:Ri,pointerup:ke,pointercancel:mt,pointerout:mt},IQ={2:os,3:pQ,4:Py,5:gQ},bA="pointerdown",wA="pointermove pointerup pointercancel";gr.MSPointerEvent&&!gr.PointerEvent&&(bA="MSPointerDown",wA="MSPointerMove MSPointerUp MSPointerCancel");var _A=function(i){Ft(e,i);function e(){var r,n=e.prototype;return n.evEl=bA,n.evWin=wA,r=i.apply(this,arguments)||this,r.store=r.manager.session.pointerEvents=[],r}var t=e.prototype;return t.handler=function(n){var o=this.store,s=!1,a=n.type.toLowerCase().replace("ms",""),l=OQ[a],u=IQ[n.pointerType]||n.pointerType,d=u===os,c=mi(o,n.pointerId,"pointerId");l&st&&(n.button===0||d)?c<0&&(o.push(n),c=o.length-1):l&(ke|mt)&&(s=!0),!(c<0)&&(o[c]=n,this.callback(this.manager,l,{pointers:o,changedPointers:[n],pointerType:u,srcEvent:n}),s&&o.splice(c,1))},e}(Gn);function Oo(i){return Array.prototype.slice.call(i,0)}function Ry(i,e,t){for(var r=[],n=[],o=0;o<i.length;){var s=e?i[o][e]:i[o];mi(n,s)<0&&r.push(i[o]),n[o]=s,o++}return t&&(e?r=r.sort(function(a,l){return a[e]>l[e]}):r=r.sort()),r}var TQ={touchstart:st,touchmove:Ri,touchend:ke,touchcancel:mt},PQ="touchstart touchmove touchend touchcancel",xy=function(i){Ft(e,i);function e(){var r;return e.prototype.evTarget=PQ,r=i.apply(this,arguments)||this,r.targetIds={},r}var t=e.prototype;return t.handler=function(n){var o=TQ[n.type],s=CQ.call(this,n,o);s&&this.callback(this.manager,o,{pointers:s[0],changedPointers:s[1],pointerType:os,srcEvent:n})},e}(Gn);function CQ(i,e){var t=Oo(i.touches),r=this.targetIds;if(e&(st|Ri)&&t.length===1)return r[t[0].identifier]=!0,[t,t];var n,o,s=Oo(i.changedTouches),a=[],l=this.target;if(o=t.filter(function(u){return Cy(u.target,l)}),e===st)for(n=0;n<o.length;)r[o[n].identifier]=!0,n++;for(n=0;n<s.length;)r[s[n].identifier]&&a.push(s[n]),e&(ke|mt)&&delete r[s[n].identifier],n++;if(a.length)return[Ry(o.concat(a),"identifier",!0),a]}var RQ={mousedown:st,mousemove:Ri,mouseup:ke},xQ="mousedown",DQ="mousemove mouseup",Dy=function(i){Ft(e,i);function e(){var r,n=e.prototype;return n.evEl=xQ,n.evWin=DQ,r=i.apply(this,arguments)||this,r.pressed=!1,r}var t=e.prototype;return t.handler=function(n){var o=RQ[n.type];o&st&&n.button===0&&(this.pressed=!0),o&Ri&&n.which!==1&&(o=ke),this.pressed&&(o&ke&&(this.pressed=!1),this.callback(this.manager,o,{pointers:[n],changedPointers:[n],pointerType:Py,srcEvent:n}))},e}(Gn),AQ=2500,x$=25;function D$(i){var e=i.changedPointers,t=e[0];if(t.identifier===this.primaryTouch){var r={x:t.clientX,y:t.clientY},n=this.lastTouches;this.lastTouches.push(r);var o=function(){var a=n.indexOf(r);a>-1&&n.splice(a,1)};setTimeout(o,AQ)}}function MQ(i,e){i&st?(this.primaryTouch=e.changedPointers[0].identifier,D$.call(this,e)):i&(ke|mt)&&D$.call(this,e)}function NQ(i){for(var e=i.srcEvent.clientX,t=i.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var n=this.lastTouches[r],o=Math.abs(e-n.x),s=Math.abs(t-n.y);if(o<=x$&&s<=x$)return!0}return!1}var EA=function(){var i=function(e){Ft(t,e);function t(n,o){var s;return s=e.call(this,n,o)||this,s.handler=function(a,l,u){var d=u.pointerType===os,c=u.pointerType===Py;if(!(c&&u.sourceCapabilities&&u.sourceCapabilities.firesTouchEvents)){if(d)MQ.call(Ms(Ms(s)),l,u);else if(c&&NQ.call(Ms(Ms(s)),u))return;s.callback(a,l,u)}},s.touch=new xy(s.manager,s.handler),s.mouse=new Dy(s.manager,s.handler),s.primaryTouch=null,s.lastTouches=[],s}var r=t.prototype;return r.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Gn);return i}();function kQ(i){var e,t=i.options.inputClass;return t?e=t:fQ?e=_A:vQ?e=xy:hA?e=EA:e=Dy,new e(i,$Q)}function en(i,e,t){return Array.isArray(i)?(yr(i,t[e],t),!0):!1}var Us=1,At=2,gn=4,Nr=8,mr=Nr,Io=16,Qt=32,FQ=1;function qQ(){return FQ++}function ks(i,e){var t=e.manager;return t?t.get(i):i}function A$(i){return i&Io?"cancel":i&Nr?"end":i&gn?"move":i&At?"start":""}var us=function(){function i(t){t===void 0&&(t={}),this.options=Vt({enable:!0},t),this.id=qQ(),this.manager=null,this.state=Us,this.simultaneous={},this.requireFail=[]}var e=i.prototype;return e.set=function(r){return gi(this.options,r),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(r){if(en(r,"recognizeWith",this))return this;var n=this.simultaneous;return r=ks(r,this),n[r.id]||(n[r.id]=r,r.recognizeWith(this)),this},e.dropRecognizeWith=function(r){return en(r,"dropRecognizeWith",this)?this:(r=ks(r,this),delete this.simultaneous[r.id],this)},e.requireFailure=function(r){if(en(r,"requireFailure",this))return this;var n=this.requireFail;return r=ks(r,this),mi(n,r)===-1&&(n.push(r),r.requireFailure(this)),this},e.dropRequireFailure=function(r){if(en(r,"dropRequireFailure",this))return this;r=ks(r,this);var n=mi(this.requireFail,r);return n>-1&&this.requireFail.splice(n,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(r){return!!this.simultaneous[r.id]},e.emit=function(r){var n=this,o=this.state;function s(a){n.manager.emit(a,r)}o<Nr&&s(n.options.event+A$(o)),s(n.options.event),r.additionalEvent&&s(r.additionalEvent),o>=Nr&&s(n.options.event+A$(o))},e.tryEmit=function(r){if(this.canEmit())return this.emit(r);this.state=Qt},e.canEmit=function(){for(var r=0;r<this.requireFail.length;){if(!(this.requireFail[r].state&(Qt|Us)))return!1;r++}return!0},e.recognize=function(r){var n=gi({},r);if(!ol(this.options.enable,[this,n])){this.reset(),this.state=Qt;return}this.state&(mr|Io|Qt)&&(this.state=Us),this.state=this.process(n),this.state&(At|gn|Nr|Io)&&this.tryEmit(n)},e.process=function(r){},e.getTouchAction=function(){},e.reset=function(){},i}(),yg=function(i){Ft(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Vt({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},r))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var t=e.prototype;return t.getTouchAction=function(){return[pg]},t.process=function(n){var o=this,s=this.options,a=n.pointers.length===s.pointers,l=n.distance<s.threshold,u=n.deltaTime<s.time;if(this.reset(),n.eventType&st&&this.count===0)return this.failTimeout();if(l&&u&&a){if(n.eventType!==ke)return this.failTimeout();var d=this.pTime?n.timeStamp-this.pTime<s.interval:!0,c=!this.pCenter||da(this.pCenter,n.center)<s.posThreshold;this.pTime=n.timeStamp,this.pCenter=n.center,!c||!d?this.count=1:this.count+=1,this._input=n;var h=this.count%s.taps;if(h===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){o.state=mr,o.tryEmit()},s.interval),At):mr}return Qt},t.failTimeout=function(){var n=this;return this._timer=setTimeout(function(){n.state=Qt},this.options.interval),Qt},t.reset=function(){clearTimeout(this._timer)},t.emit=function(){this.state===mr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(us),yn=function(i){Ft(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Vt({pointers:1},r))||this}var t=e.prototype;return t.attrTest=function(n){var o=this.options.pointers;return o===0||n.pointers.length===o},t.process=function(n){var o=this.state,s=n.eventType,a=o&(At|gn),l=this.attrTest(n);return a&&(s&mt||!l)?o|Io:a||l?s&ke?o|Nr:o&At?o|gn:At:Qt},e}(us);function SA(i){return i===pn?"down":i===ls?"up":i===ss?"left":i===as?"right":""}var Ay=function(i){Ft(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Vt({event:"pan",threshold:10,pointers:1,direction:fA},r))||this,n.pX=null,n.pY=null,n}var t=e.prototype;return t.getTouchAction=function(){var n=this.options.direction,o=[];return n&rr&&o.push(So),n&di&&o.push(Eo),o},t.directionTest=function(n){var o=this.options,s=!0,a=n.distance,l=n.direction,u=n.deltaX,d=n.deltaY;return l&o.direction||(o.direction&rr?(l=u===0?la:u<0?ss:as,s=u!==this.pX,a=Math.abs(n.deltaX)):(l=d===0?la:d<0?ls:pn,s=d!==this.pY,a=Math.abs(n.deltaY))),n.direction=l,s&&a>o.threshold&&l&o.direction},t.attrTest=function(n){return yn.prototype.attrTest.call(this,n)&&(this.state&At||!(this.state&At)&&this.directionTest(n))},t.emit=function(n){this.pX=n.deltaX,this.pY=n.deltaY;var o=SA(n.direction);o&&(n.additionalEvent=this.options.event+o),i.prototype.emit.call(this,n)},e}(yn),$A=function(i){Ft(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Vt({event:"swipe",threshold:10,velocity:.3,direction:rr|di,pointers:1},r))||this}var t=e.prototype;return t.getTouchAction=function(){return Ay.prototype.getTouchAction.call(this)},t.attrTest=function(n){var o=this.options.direction,s;return o&(rr|di)?s=n.overallVelocity:o&rr?s=n.overallVelocityX:o&di&&(s=n.overallVelocityY),i.prototype.attrTest.call(this,n)&&o&n.offsetDirection&&n.distance>this.options.threshold&&n.maxPointers===this.options.pointers&&yi(s)>this.options.velocity&&n.eventType&ke},t.emit=function(n){var o=SA(n.offsetDirection);o&&this.manager.emit(this.options.event+o,n),this.manager.emit(this.options.event,n)},e}(yn),OA=function(i){Ft(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Vt({event:"pinch",threshold:0,pointers:2},r))||this}var t=e.prototype;return t.getTouchAction=function(){return[ui]},t.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.scale-1)>this.options.threshold||this.state&At)},t.emit=function(n){if(n.scale!==1){var o=n.scale<1?"in":"out";n.additionalEvent=this.options.event+o}i.prototype.emit.call(this,n)},e}(yn),IA=function(i){Ft(e,i);function e(r){return r===void 0&&(r={}),i.call(this,Vt({event:"rotate",threshold:0,pointers:2},r))||this}var t=e.prototype;return t.getTouchAction=function(){return[ui]},t.attrTest=function(n){return i.prototype.attrTest.call(this,n)&&(Math.abs(n.rotation)>this.options.threshold||this.state&At)},e}(yn),TA=function(i){Ft(e,i);function e(r){var n;return r===void 0&&(r={}),n=i.call(this,Vt({event:"press",pointers:1,time:251,threshold:9},r))||this,n._timer=null,n._input=null,n}var t=e.prototype;return t.getTouchAction=function(){return[cA]},t.process=function(n){var o=this,s=this.options,a=n.pointers.length===s.pointers,l=n.distance<s.threshold,u=n.deltaTime>s.time;if(this._input=n,!l||!a||n.eventType&(ke|mt)&&!u)this.reset();else if(n.eventType&st)this.reset(),this._timer=setTimeout(function(){o.state=mr,o.tryEmit()},s.time);else if(n.eventType&ke)return mr;return Qt},t.reset=function(){clearTimeout(this._timer)},t.emit=function(n){this.state===mr&&(n&&n.eventType&ke?this.manager.emit(this.options.event+"up",n):(this._input.timeStamp=Ty(),this.manager.emit(this.options.event,this._input)))},e}(us),PA={domEvents:!1,touchAction:dA,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},M$=[[IA,{enable:!1}],[OA,{enable:!1},["rotate"]],[$A,{direction:rr}],[Ay,{direction:rr},["swipe"]],[yg],[yg,{event:"doubletap",taps:2},["tap"]],[TA]],BQ=1,N$=2;function k$(i,e){var t=i.element;if(t.style){var r;yr(i.options.cssProps,function(n,o){r=nl(t.style,o),e?(i.oldCssProps[r]=t.style[r],t.style[r]=n):t.style[r]=i.oldCssProps[r]||""}),e||(i.oldCssProps={})}}function jQ(i,e){var t=document.createEvent("Event");t.initEvent(i,!0,!0),t.gesture=e,e.target.dispatchEvent(t)}var F$=function(){function i(t,r){var n=this;this.options=gi({},PA,r||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=kQ(this),this.touchAction=new pA(this,this.options.touchAction),k$(this,!0),yr(this.options.recognizers,function(o){var s=n.add(new o[0](o[1]));o[2]&&s.recognizeWith(o[2]),o[3]&&s.requireFailure(o[3])},this)}var e=i.prototype;return e.set=function(r){return gi(this.options,r),r.touchAction&&this.touchAction.update(),r.inputTarget&&(this.input.destroy(),this.input.target=r.inputTarget,this.input.init()),this},e.stop=function(r){this.session.stopped=r?N$:BQ},e.recognize=function(r){var n=this.session;if(!n.stopped){this.touchAction.preventDefaults(r);var o,s=this.recognizers,a=n.curRecognizer;(!a||a&&a.state&mr)&&(n.curRecognizer=null,a=null);for(var l=0;l<s.length;)o=s[l],n.stopped!==N$&&(!a||o===a||o.canRecognizeWith(a))?o.recognize(r):o.reset(),!a&&o.state&(At|gn|Nr)&&(n.curRecognizer=o,a=o),l++}},e.get=function(r){if(r instanceof us)return r;for(var n=this.recognizers,o=0;o<n.length;o++)if(n[o].options.event===r)return n[o];return null},e.add=function(r){if(en(r,"add",this))return this;var n=this.get(r.options.event);return n&&this.remove(n),this.recognizers.push(r),r.manager=this,this.touchAction.update(),r},e.remove=function(r){if(en(r,"remove",this))return this;var n=this.get(r);if(r){var o=this.recognizers,s=mi(o,n);s!==-1&&(o.splice(s,1),this.touchAction.update())}return this},e.on=function(r,n){if(r===void 0||n===void 0)return this;var o=this.handlers;return yr($o(r),function(s){o[s]=o[s]||[],o[s].push(n)}),this},e.off=function(r,n){if(r===void 0)return this;var o=this.handlers;return yr($o(r),function(s){n?o[s]&&o[s].splice(mi(o[s],n),1):delete o[s]}),this},e.emit=function(r,n){this.options.domEvents&&jQ(r,n);var o=this.handlers[r]&&this.handlers[r].slice();if(!(!o||!o.length)){n.type=r,n.preventDefault=function(){n.srcEvent.preventDefault()};for(var s=0;s<o.length;)o[s](n),s++}},e.destroy=function(){this.element&&k$(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},i}(),LQ={touchstart:st,touchmove:Ri,touchend:ke,touchcancel:mt},zQ="touchstart",WQ="touchstart touchmove touchend touchcancel",HQ=function(i){Ft(e,i);function e(){var r,n=e.prototype;return n.evTarget=zQ,n.evWin=WQ,r=i.apply(this,arguments)||this,r.started=!1,r}var t=e.prototype;return t.handler=function(n){var o=LQ[n.type];if(o===st&&(this.started=!0),!!this.started){var s=UQ.call(this,n,o);o&(ke|mt)&&s[0].length-s[1].length===0&&(this.started=!1),this.callback(this.manager,o,{pointers:s[0],changedPointers:s[1],pointerType:os,srcEvent:n})}},e}(Gn);function UQ(i,e){var t=Oo(i.touches),r=Oo(i.changedTouches);return e&(ke|mt)&&(t=Ry(t.concat(r),"identifier",!0)),[t,r]}function CA(i,e,t){var r="DEPRECATED METHOD: "+e+`
`+t+` AT 
`;return function(){var n=new Error("get-stack-trace"),o=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=window.console&&(window.console.warn||window.console.log);return s&&s.call(window.console,r,o),i.apply(this,arguments)}}var RA=CA(function(i,e,t){for(var r=Object.keys(e),n=0;n<r.length;)(!t||t&&i[r[n]]===void 0)&&(i[r[n]]=e[r[n]]),n++;return i},"extend","Use `assign`."),VQ=CA(function(i,e){return RA(i,e,!0)},"merge","Use `assign`.");function GQ(i,e,t){var r=e.prototype,n;n=i.prototype=Object.create(r),n.constructor=i,n._super=r,t&&gi(n,t)}function q$(i,e){return function(){return i.apply(e,arguments)}}var xA=function(){var i=function(t,r){return r===void 0&&(r={}),new F$(t,Vt({recognizers:M$.concat()},r))};return i.VERSION="2.0.17-rc",i.DIRECTION_ALL=fA,i.DIRECTION_DOWN=pn,i.DIRECTION_LEFT=ss,i.DIRECTION_RIGHT=as,i.DIRECTION_UP=ls,i.DIRECTION_HORIZONTAL=rr,i.DIRECTION_VERTICAL=di,i.DIRECTION_NONE=la,i.DIRECTION_DOWN=pn,i.INPUT_START=st,i.INPUT_MOVE=Ri,i.INPUT_END=ke,i.INPUT_CANCEL=mt,i.STATE_POSSIBLE=Us,i.STATE_BEGAN=At,i.STATE_CHANGED=gn,i.STATE_ENDED=Nr,i.STATE_RECOGNIZED=mr,i.STATE_CANCELLED=Io,i.STATE_FAILED=Qt,i.Manager=F$,i.Input=Gn,i.TouchAction=pA,i.TouchInput=xy,i.MouseInput=Dy,i.PointerEventInput=_A,i.TouchMouseInput=EA,i.SingleTouchInput=HQ,i.Recognizer=us,i.AttrRecognizer=yn,i.Tap=yg,i.Pan=Ay,i.Swipe=$A,i.Pinch=OA,i.Rotate=IA,i.Press=TA,i.on=ao,i.off=lo,i.each=yr,i.merge=VQ,i.extend=RA,i.bindFn=q$,i.assign=gi,i.inherit=GQ,i.bindFn=q$,i.prefixed=nl,i.toArray=Oo,i.inArray=mi,i.uniqueArray=Ry,i.splitStr=$o,i.boolOrFn=ol,i.hasParent=Cy,i.addEventListeners=ao,i.removeEventListeners=lo,i.defaults=gi({},PA,{preset:M$}),i}();xA.defaults;YX("DELETE");function sl(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return KQ(e.length?e:[aa()])}function KQ(i){let[e,t,r]=YQ(i),n=1;const o=()=>{const s=2091639*e+n*23283064365386963e-26;return e=t,t=r,r=s-(n=s|0)};return o.uint32=()=>o()*4294967296,o.fract53=()=>o()+(o()*2097152|0)*11102230246251565e-32,o.algorithm="Alea",o.seed=i,o.version="0.9",o}function YQ(){const i=XQ();let e=i(" "),t=i(" "),r=i(" ");for(let n=0;n<arguments.length;n++)e-=i(n<0||arguments.length<=n?void 0:arguments[n]),e<0&&(e+=1),t-=i(n<0||arguments.length<=n?void 0:arguments[n]),t<0&&(t+=1),r-=i(n<0||arguments.length<=n?void 0:arguments[n]),r<0&&(r+=1);return[e,t,r]}function XQ(){let i=4022871197;return function(e){const t=e.toString();for(let r=0;r<t.length;r++){i+=t.charCodeAt(r);let n=.02519603282416938*i;i=n>>>0,n-=i,n*=i,i=n>>>0,n-=i,i+=n*4294967296}return(i>>>0)*23283064365386963e-26}}function JQ(){const i=()=>{};return{on:i,off:i,destroy:i,emit:i,get(){return{set:i}}}}const My=typeof window<"u"?window.Hammer||xA:function(){return JQ()};function er(i){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:i,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=My(this._dom.overlay);t.on("tap",A(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{t.destroy()});const r=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];de(r).call(r,n=>{t.on(n,o=>{o.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=n=>{ZQ(n.target,i)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=n=>{("key"in n?n.key==="Escape":n.keyCode===27)&&this.deactivate()}}LD(er.prototype);er.current=null;er.prototype.destroy=function(){this.deactivate();for(const t of ai(i=vr(e=this._cleanupQueue).call(e,0)).call(i)){var i,e;t()}};er.prototype.activate=function(){er.current&&er.current.deactivate(),er.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)};er.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")};er.prototype._onTapOverlay=function(i){this.activate(),i.srcEvent.stopPropagation()};function ZQ(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}const QQ=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,eee=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,tee=/^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,ree=/^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(i){if(i)for(;i.hasChildNodes()===!0;){const e=i.firstChild;e&&(Ir(e),i.removeChild(e))}}function rn(i){return i instanceof String||typeof i=="string"}function B$(i){return typeof i=="object"&&i!==null}function bi(i,e,t,r){let n=!1;r===!0&&(n=e[t]===null&&i[t]!==void 0),n?delete i[t]:i[t]=e[t]}function DA(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(const r in i)if(e[r]!==void 0)if(e[r]===null||typeof e[r]!="object")bi(i,e,r,t);else{const n=i[r],o=e[r];B$(n)&&B$(o)&&DA(n,o,t)}}function Kn(i,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Pe(t))throw new TypeError("Arrays are not supported by deepExtend");for(let n=0;n<i.length;n++){const o=i[n];if(Object.prototype.hasOwnProperty.call(t,o))if(t[o]&&t[o].constructor===Object)e[o]===void 0&&(e[o]={}),e[o].constructor===Object?fe(e[o],t[o],!1,r):bi(e,t,o,r);else{if(Pe(t[o]))throw new TypeError("Arrays are not supported by deepExtend");bi(e,t,o,r)}}return e}function ca(i,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Pe(t))throw new TypeError("Arrays are not supported by deepExtend");for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&!Mr(i).call(i,n))if(t[n]&&t[n].constructor===Object)e[n]===void 0&&(e[n]={}),e[n].constructor===Object?fe(e[n],t[n]):bi(e,t,n,r);else if(Pe(t[n])){e[n]=[];for(let o=0;o<t[n].length;o++)e[n].push(t[n][o])}else bi(e,t,n,r);return e}function fe(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)||t===!0)if(typeof e[o]=="object"&&e[o]!==null&&wS(e[o])===Object.prototype)i[o]===void 0?i[o]=fe({},e[o],t):typeof i[o]=="object"&&i[o]!==null&&wS(i[o])===Object.prototype?fe(i[o],e[o],t):bi(i,e,o,r);else if(Pe(e[o])){var n;i[o]=Jt(n=e[o]).call(n)}else bi(i,e,o,r);return i}function ha(i,e){return[...i,e]}function iee(i){return Jt(i).call(i)}function nee(i){return i.getBoundingClientRect().left}function oee(i){return i.getBoundingClientRect().top}function Z(i,e){if(Pe(i)){const t=i.length;for(let r=0;r<t;r++)e(i[r],r,i)}else for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&e(i[t],t,i)}function Ny(i){let e;switch(i.length){case 3:case 4:return e=eee.exec(i),e?{r:Wt(e[1]+e[1],16),g:Wt(e[2]+e[2],16),b:Wt(e[3]+e[3],16)}:null;case 6:case 7:return e=QQ.exec(i),e?{r:Wt(e[1],16),g:Wt(e[2],16),b:Wt(e[3],16)}:null;default:return null}}function xt(i,e){if(Mr(i).call(i,"rgba"))return i;if(Mr(i).call(i,"rgb")){const t=i.substr(le(i).call(i,"(")+1).replace(")","").split(",");return"rgba("+t[0]+","+t[1]+","+t[2]+","+e+")"}else{const t=Ny(i);return t==null?i:"rgba("+t.r+","+t.g+","+t.b+","+e+")"}}function AA(i,e,t){var r;return"#"+Jt(r=((1<<24)+(i<<16)+(e<<8)+t).toString(16)).call(r,1)}function mg(i,e){if(rn(i)){let r=i;if(NA(r)){var t;const n=vn(t=r.substr(4).substr(0,r.length-5).split(",")).call(t,function(o){return Wt(o)});r=AA(n[0],n[1],n[2])}if(MA(r)===!0){const n=see(r),o={h:n.h,s:n.s*.8,v:Math.min(1,n.v*1.02)},s={h:n.h,s:Math.min(1,n.s*1.25),v:n.v*.8},a=bg(s.h,s.s,s.v),l=bg(o.h,o.s,o.v);return{background:r,border:a,highlight:{background:l,border:a},hover:{background:l,border:a}}}else return{background:r,border:r,highlight:{background:r,border:r},hover:{background:r,border:r}}}else return{background:i.background||void 0,border:i.border||void 0,highlight:rn(i.highlight)?{border:i.highlight,background:i.highlight}:{background:i.highlight&&i.highlight.background||void 0,border:i.highlight&&i.highlight.border||void 0},hover:rn(i.hover)?{border:i.hover,background:i.hover}:{border:i.hover&&i.hover.border||void 0,background:i.hover&&i.hover.background||void 0}}}function to(i,e,t){i=i/255,e=e/255,t=t/255;const r=Math.min(i,Math.min(e,t)),n=Math.max(i,Math.max(e,t));if(r===n)return{h:0,s:0,v:r};const o=i===r?e-t:t===r?i-e:t-i,a=60*((i===r?3:t===r?1:5)-o/(n-r))/360,l=(n-r)/n;return{h:a,s:l,v:n}}function Vs(i,e,t){let r,n,o;const s=Math.floor(i*6),a=i*6-s,l=t*(1-e),u=t*(1-a*e),d=t*(1-(1-a)*e);switch(s%6){case 0:r=t,n=d,o=l;break;case 1:r=u,n=t,o=l;break;case 2:r=l,n=t,o=d;break;case 3:r=l,n=u,o=t;break;case 4:r=d,n=l,o=t;break;case 5:r=t,n=l,o=u;break}return{r:Math.floor(r*255),g:Math.floor(n*255),b:Math.floor(o*255)}}function bg(i,e,t){const r=Vs(i,e,t);return AA(r.r,r.g,r.b)}function see(i){const e=Ny(i);if(!e)throw new TypeError("'".concat(i,"' is not a valid color."));return to(e.r,e.g,e.b)}function MA(i){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(i)}function NA(i){return tee.test(i)}function aee(i){return ree.test(i)}function kr(i){if(i===null||typeof i!="object")return null;if(i instanceof Element)return i;const e=li(i);for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&typeof i[t]=="object"&&(e[t]=kr(i[t]));return e}function Rt(i,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const n=function(f){return f!=null},o=function(f){return f!==null&&typeof f=="object"},s=function(f){for(const v in f)if(Object.prototype.hasOwnProperty.call(f,v))return!1;return!0};if(!o(i))throw new Error("Parameter mergeTarget must be an object");if(!o(e))throw new Error("Parameter options must be an object");if(!n(t))throw new Error("Parameter option must have a value");if(!o(r))throw new Error("Parameter globalOptions must be an object");const a=function(f,v,g){o(f[g])||(f[g]={});const y=v[g],p=f[g];for(const m in y)Object.prototype.hasOwnProperty.call(y,m)&&(p[m]=y[m])},l=e[t],d=o(r)&&!s(r)?r[t]:void 0,c=d?d.enabled:void 0;if(l===void 0)return;if(typeof l=="boolean"){o(i[t])||(i[t]={}),i[t].enabled=l;return}if(l===null&&!o(i[t]))if(n(d))i[t]=li(d);else return;if(!o(l))return;let h=!0;l.enabled!==void 0?h=l.enabled:c!==void 0&&(h=d.enabled),a(i,e,t),i[t].enabled=h}const lee={linear(i){return i},easeInQuad(i){return i*i},easeOutQuad(i){return i*(2-i)},easeInOutQuad(i){return i<.5?2*i*i:-1+(4-2*i)*i},easeInCubic(i){return i*i*i},easeOutCubic(i){return--i*i*i+1},easeInOutCubic(i){return i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1},easeInQuart(i){return i*i*i*i},easeOutQuart(i){return 1- --i*i*i*i},easeInOutQuart(i){return i<.5?8*i*i*i*i:1-8*--i*i*i*i},easeInQuint(i){return i*i*i*i*i},easeOutQuint(i){return 1+--i*i*i*i*i},easeInOutQuint(i){return i<.5?16*i*i*i*i*i:1+16*--i*i*i*i*i}};function Tr(i,e){let t;Pe(e)||(e=[e]);for(const r of i)if(r){t=r[e[0]];for(let n=1;n<e.length;n++)t&&(t=t[e[n]]);if(typeof t<"u")break}return t}const uee={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 dee=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.pixelRatio=e,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},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(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}setCloseCallback(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}_isColorString(e){if(typeof e=="string")return uee[e]}setColor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==="none")return;let r;const n=this._isColorString(e);if(n!==void 0&&(e=n),rn(e)===!0){if(NA(e)===!0){const o=e.substr(4).substr(0,e.length-5).split(",");r={r:o[0],g:o[1],b:o[2],a:1}}else if(aee(e)===!0){const o=e.substr(5).substr(0,e.length-6).split(",");r={r:o[0],g:o[1],b:o[2],a:o[3]}}else if(MA(e)===!0){const o=Ny(e);r={r:o.r,g:o.g,b:o.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){const o=e.a!==void 0?e.a:"1.0";r={r:e.r,g:e.g,b:e.b,a:o}}if(r===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: "+is(e));this._setColor(r,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)===!0&&(this.previousColor=Ne({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",pr(()=>{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(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)===!0&&(this.initialColor=Ne({},e)),this.color=e;const r=to(e.r,e.g,e.b),n=2*Math.PI,o=this.r*r.s,s=this.centerCoordinates.x+o*Math.sin(n*r.h),a=this.centerCoordinates.y+o*Math.cos(n*r.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=a-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}_setOpacity(e){this.color.a=e/100,this._updatePicker(this.color)}_setBrightness(e){const t=to(this.color.r,this.color.g,this.color.b);t.v=e/100;const r=Vs(t.h,t.s,t.v);r.a=this.color.a,this.color=r,this._updatePicker()}_updatePicker(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color;const t=to(e.r,e.g,e.b),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 n=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;r.clearRect(0,0,n,o),r.putImageData(this.hueCircle,0,0),r.fillStyle="rgba(0,0,0,"+(1-t.v)+")",r.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),ns(r).call(r),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.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 e,t,r,n;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 s=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const s=document.createElement("DIV");s.style.color="red",s.style.fontWeight="bold",s.style.padding="10px",s.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(s)}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=A(e=this._hide).call(e,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=A(t=this._apply).call(t,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=A(r=this._save).call(r,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=A(n=this._loadLast).call(n,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 My(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",e=>{e.isFirst&&this._moveSelector(e)}),this.hammer.on("tap",e=>{this._moveSelector(e)}),this.hammer.on("panstart",e=>{this._moveSelector(e)}),this.hammer.on("panmove",e=>{this._moveSelector(e)}),this.hammer.on("panend",e=>{this._moveSelector(e)})}_generateHueCircle(){if(this.generated===!1){const e=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const t=this.colorPickerCanvas.clientWidth,r=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,r);let n,o,s,a;this.centerCoordinates={x:t*.5,y:r*.5},this.r=.49*t;const l=2*Math.PI/360,u=1/360,d=1/this.r;let c;for(s=0;s<360;s++)for(a=0;a<this.r;a++)n=this.centerCoordinates.x+a*Math.sin(l*s),o=this.centerCoordinates.y+a*Math.cos(l*s),c=Vs(s*u,a*d,1),e.fillStyle="rgb("+c.r+","+c.g+","+c.b+")",e.fillRect(n-.5,o-.5,2,2);e.strokeStyle="rgba(0,0,0,1)",e.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),e.stroke(),this.hueCircle=e.getImageData(0,0,t,r)}this.generated=!0}_moveSelector(e){const t=this.colorPickerDiv.getBoundingClientRect(),r=e.center.x-t.left,n=e.center.y-t.top,o=.5*this.colorPickerDiv.clientHeight,s=.5*this.colorPickerDiv.clientWidth,a=r-s,l=n-o,u=Math.atan2(a,l),d=.98*Math.min(Math.sqrt(a*a+l*l),s),c=Math.cos(u)*d+o,h=Math.sin(u)*d+s;this.colorPickerSelector.style.top=c-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=h-.5*this.colorPickerSelector.clientWidth+"px";let f=u/(2*Math.PI);f=f<0?f+1:f;const v=d/this.r,g=to(this.color.r,this.color.g,this.color.b);g.h=f,g.s=v;const y=Vs(g.h,g.s,g.v);y.a=this.color.a,this.color=y,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 wg(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];if(e.length<1)throw new TypeError("Invalid arguments.");if(e.length===1)return document.createTextNode(e[0]);{const r=document.createElement(e[0]);return r.appendChild(wg(...Jt(e).call(e,1))),r}}let cee=class{constructor(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=e,this.changedOptions=[],this.container=t,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},Ne(this.options,this.defaultOptions),this.configureOptions=r,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new dee(n),this.wrapper=void 0}setOptions(e){if(e!==void 0){this.popupHistory={},this._removePopup();let t=!0;if(typeof e=="string")this.options.filter=e;else if(Pe(e))this.options.filter=e.join();else if(typeof e=="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),gt(e)!==void 0&&(this.options.filter=gt(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(t=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,t=e):typeof e=="function"&&(this.options.filter=e,t=!0);gt(this.options)===!1&&(t=!1),this.options.enabled=t}this._clean()}setModuleOptions(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const e=gt(this.options);let t=0,r=!1;for(const n in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,n)&&(this.allowCreation=!1,r=!1,typeof e=="function"?(r=e(n,[]),r=r||this._handleObject(this.configureOptions[n],[n],!0)):(e===!0||le(e).call(e,n)!==-1)&&(r=!0),r!==!1&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),t++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}_clean(){for(let e=0;e<this.domElements.length;e++)this.wrapper.removeChild(this.domElements[e]);this.wrapper!==void 0&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}_getValue(e){let t=this.moduleOptions;for(let r=0;r<e.length;r++)if(t[e[r]]!==void 0)t=t[e[r]];else{t=void 0;break}return t}_makeItem(e){if(this.allowCreation===!0){const o=document.createElement("div");o.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return de(r).call(r,s=>{o.appendChild(s)}),this.domElements.push(o),this.domElements.length}return 0}_makeHeader(e){const t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerText=e,this._makeItem([],t)}_makeLabel(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const n=document.createElement("div");if(n.className="vis-configuration vis-config-label vis-config-s"+t.length,r===!0){for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(wg("i","b",e))}else n.innerText=e+":";return n}_makeDropdown(e,t,r){const n=document.createElement("select");n.className="vis-configuration vis-config-select";let o=0;t!==void 0&&le(e).call(e,t)!==-1&&(o=le(e).call(e,t));for(let l=0;l<e.length;l++){const u=document.createElement("option");u.value=e[l],l===o&&(u.selected="selected"),u.innerText=e[l],n.appendChild(u)}const s=this;n.onchange=function(){s._update(this.value,r)};const a=this._makeLabel(r[r.length-1],r);this._makeItem(r,a,n)}_makeRange(e,t,r){const n=e[0],o=e[1],s=e[2],a=e[3],l=document.createElement("input");l.className="vis-configuration vis-config-range";try{l.type="range",l.min=o,l.max=s}catch{}l.step=a;let u="",d=0;t!==void 0?(t<0&&t*1.2<o?(l.min=Math.ceil(t*1.2),d=l.min,u="range increased"):t/1.2<o&&(l.min=Math.ceil(t/1.2),d=l.min,u="range increased"),t*1.2>s&&s!==1&&(l.max=Math.ceil(t*1.2),d=l.max,u="range increased"),l.value=t):l.value=n;const c=document.createElement("input");c.className="vis-configuration vis-config-rangeinput",c.value=l.value;const h=this;l.onchange=function(){c.value=this.value,h._update(Number(this.value),r)},l.oninput=function(){c.value=this.value};const f=this._makeLabel(r[r.length-1],r),v=this._makeItem(r,f,l,c);u!==""&&this.popupHistory[v]!==d&&(this.popupHistory[v]=d,this._setupPopup(u,v))}_makeButton(){if(this.options.showButton===!0){const e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerText="generate options",e.onclick=()=>{this._printOptions()},e.onmouseover=()=>{e.className="vis-configuration vis-config-button hover"},e.onmouseout=()=>{e.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(e)}}_setupPopup(e,t){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){const r=document.createElement("div");r.id="vis-configuration-popup",r.className="vis-configuration-popup",r.innerText=e,r.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:r,index:t}}}_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 t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=pr(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=pr(()=>{this._removePopup()},1800)}}_makeCheckbox(e,t,r){const n=document.createElement("input");n.type="checkbox",n.className="vis-configuration vis-config-checkbox",n.checked=e,t!==void 0&&(n.checked=t,t!==e&&(typeof e=="object"?t!==e.enabled&&this.changedOptions.push({path:r,value:t}):this.changedOptions.push({path:r,value:t})));const o=this;n.onchange=function(){o._update(this.checked,r)};const s=this._makeLabel(r[r.length-1],r);this._makeItem(r,s,n)}_makeTextInput(e,t,r){const n=document.createElement("input");n.type="text",n.className="vis-configuration vis-config-text",n.value=t,t!==e&&this.changedOptions.push({path:r,value:t});const o=this;n.onchange=function(){o._update(this.value,r)};const s=this._makeLabel(r[r.length-1],r);this._makeItem(r,s,n)}_makeColorField(e,t,r){const n=e[1],o=document.createElement("div");t=t===void 0?n:t,t!=="none"?(o.className="vis-configuration vis-config-colorBlock",o.style.backgroundColor=t):o.className="vis-configuration vis-config-colorBlock none",t=t===void 0?n:t,o.onclick=()=>{this._showColorPicker(t,o,r)};const s=this._makeLabel(r[r.length-1],r);this._makeItem(r,s,o)}_showColorPicker(e,t,r){t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(n=>{const o="rgba("+n.r+","+n.g+","+n.b+","+n.a+")";t.style.backgroundColor=o,this._update(o,r)}),this.colorPicker.setCloseCallback(()=>{t.onclick=()=>{this._showColorPicker(e,t,r)}})}_handleObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=!1;const o=gt(this.options);let s=!1;for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){n=!0;const l=e[a],u=ha(t,a);if(typeof o=="function"&&(n=o(a,t),n===!1&&!Pe(l)&&typeof l!="string"&&typeof l!="boolean"&&l instanceof Object&&(this.allowCreation=!1,n=this._handleObject(l,u,!0),this.allowCreation=r===!1)),n!==!1){s=!0;const d=this._getValue(u);if(Pe(l))this._handleArray(l,d,u);else if(typeof l=="string")this._makeTextInput(l,d,u);else if(typeof l=="boolean")this._makeCheckbox(l,d,u);else if(l instanceof Object){if(!this.hideOption(t,a,this.moduleOptions))if(l.enabled!==void 0){const c=ha(u,"enabled"),h=this._getValue(c);if(h===!0){const f=this._makeLabel(a,u,!0);this._makeItem(u,f),s=this._handleObject(l,u)||s}else this._makeCheckbox(l,h,u)}else{const c=this._makeLabel(a,u,!0);this._makeItem(u,c),s=this._handleObject(l,u)||s}}else console.error("dont know how to handle",l,a,u)}}return s}_handleArray(e,t,r){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,t,r),e[1]!==t&&this.changedOptions.push({path:r,value:t})):typeof e[0]=="string"?(this._makeDropdown(e,t,r),e[0]!==t&&this.changedOptions.push({path:r,value:t})):typeof e[0]=="number"&&(this._makeRange(e,t,r),e[0]!==t&&this.changedOptions.push({path:r,value:Number(t)}))}_update(e,t){const r=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",r),this.initialized=!0,this.parent.setOptions(r)}_constructOptions(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r;e=e==="true"?!0:e,e=e==="false"?!1:e;for(let o=0;o<t.length;o++)t[o]!=="global"&&(n[t[o]]===void 0&&(n[t[o]]={}),o!==t.length-1?n=n[t[o]]:n[t[o]]=e);return r}_printOptions(){const e=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(wg("pre","const options = "+is(e,null,2)))}getOptions(){const e={};for(let t=0;t<this.changedOptions.length;t++)this._constructOptions(this.changedOptions[t].value,this.changedOptions[t].path,e);return e}},hee=class{constructor(e,t){this.container=e,this.overflowMethod=t||"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(e,t){this.x=Wt(e),this.y=Wt(t)}setText(e){if(e instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(e)}else this.frame.innerText=e}show(e){if(e===void 0&&(e=!0),e===!0){const t=this.frame.clientHeight,r=this.frame.clientWidth,n=this.frame.parentNode.clientHeight,o=this.frame.parentNode.clientWidth;let s=0,a=0;if(this.overflowMethod=="flip"){let l=!1,u=!0;this.y-t<this.padding&&(u=!1),this.x+r>o-this.padding&&(l=!0),l?s=this.x-r:s=this.x,u?a=this.y-t:a=this.y}else a=this.y-t,a+t+this.padding>n&&(a=n-t-this.padding),a<this.padding&&(a=this.padding),s=this.x,s+r+this.padding>o&&(s=o-r-this.padding),s<this.padding&&(s=this.padding);this.frame.style.left=s+"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)}},Zn=!1,j$;const _g="background: #FFeeee; color: #dd0000";let fee=class Ie{static validate(e,t,r){Zn=!1,j$=t;let n=t;return r!==void 0&&(n=t[r]),Ie.parse(e,n,[]),Zn}static parse(e,t,r){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&Ie.check(n,e,t,r)}static check(e,t,r,n){if(r[e]===void 0&&r.__any__===void 0){Ie.getSuggestion(e,r,n);return}let o=e,s=!0;r[e]===void 0&&r.__any__!==void 0&&(o="__any__",s=Ie.getType(t[e])==="object");let a=r[o];s&&a.__type__!==void 0&&(a=a.__type__),Ie.checkFields(e,t,r,o,a,n)}static checkFields(e,t,r,n,o,s){const a=function(d){console.error("%c"+d+Ie.printLocation(s,e),_g)},l=Ie.getType(t[e]),u=o[l];u!==void 0?Ie.getType(u)==="array"&&le(u).call(u,t[e])===-1?(a('Invalid option detected in "'+e+'". Allowed values are:'+Ie.print(u)+' not "'+t[e]+'". '),Zn=!0):l==="object"&&n!=="__any__"&&(s=ha(s,e),Ie.parse(t[e],r[n],s)):o.any===void 0&&(a('Invalid type received for "'+e+'". Expected: '+Ie.print(Te(o))+". Received ["+l+'] "'+t[e]+'"'),Zn=!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,r){const n=Ie.findInOptions(e,t,r,!1),o=Ie.findInOptions(e,j$,[],!0),s=8,a=4;let l;n.indexMatch!==void 0?l=" in "+Ie.printLocation(n.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+n.indexMatch+`"?

`:o.distance<=a&&n.distance>o.distance?l=" in "+Ie.printLocation(n.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+Ie.printLocation(o.path,o.closestMatch,""):n.distance<=s?l='. Did you mean "'+n.closestMatch+'"?'+Ie.printLocation(n.path,e):l=". Did you mean one of these: "+Ie.print(Te(t))+Ie.printLocation(r,e),console.error('%cUnknown option detected: "'+e+'"'+l,_g),Zn=!0}static findInOptions(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=1e9,s="",a=[];const l=e.toLowerCase();let u;for(const c in t){let h;if(t[c].__type__!==void 0&&n===!0){const f=Ie.findInOptions(e,t[c],ha(r,c));o>f.distance&&(s=f.closestMatch,a=f.path,o=f.distance,u=f.indexMatch)}else{var d;le(d=c.toLowerCase()).call(d,l)!==-1&&(u=c),h=Ie.levenshteinDistance(e,c),o>h&&(s=c,a=iee(r),o=h)}}return{closestMatch:s,path:a,distance:o,indexMatch:u}}static printLocation(e,t){let n=`

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

`}static print(e){return is(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 r=[];let n;for(n=0;n<=t.length;n++)r[n]=[n];let o;for(o=0;o<=e.length;o++)r[0][o]=o;for(n=1;n<=t.length;n++)for(o=1;o<=e.length;o++)t.charAt(n-1)==e.charAt(o-1)?r[n][o]=r[n-1][o-1]:r[n][o]=Math.min(r[n-1][o-1]+1,Math.min(r[n][o-1]+1,r[n-1][o]+1));return r[t.length][e.length]}};const vee=er,pee=cee,nn=My,gee=hee,kA=_g,yee=fee;function mee(i){return Rr=i,Eee()}var FA={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},ky=li(FA);ky.color="color.color";ky.style="dashes";var rt={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},L$={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},Rr="",mn=0,J="",H="",ft=rt.NULL;function bee(){mn=0,J=Rr.charAt(0)}function We(){mn++,J=Rr.charAt(mn)}function Wi(){return Rr.charAt(mn+1)}function z$(i){var e=i.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:!1}function Br(i,e){if(i||(i={}),e)for(var t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i}function wee(i,e,t){for(var r=e.split("."),n=i;r.length;){var o=r.shift();r.length?(n[o]||(n[o]={}),n=n[o]):n[o]=t}}function qA(i,e){for(var t,r,n=null,o=[i],s=i;s.parent;)o.push(s.parent),s=s.parent;if(s.nodes){for(t=0,r=s.nodes.length;t<r;t++)if(e.id===s.nodes[t].id){n=s.nodes[t];break}}for(n||(n={id:e.id},i.node&&(n.attr=Br(n.attr,i.node))),t=o.length-1;t>=0;t--){var a,l=o[t];l.nodes||(l.nodes=[]),le(a=l.nodes).call(a,n)===-1&&l.nodes.push(n)}e.attr&&(n.attr=Br(n.attr,e.attr))}function _ee(i,e){if(i.edges||(i.edges=[]),i.edges.push(e),i.edge){var t=Br({},i.edge);e.attr=Br(t,e.attr)}}function BA(i,e,t,r,n){var o={from:e,to:t,type:r};return i.edge&&(o.attr=Br({},i.edge)),o.attr=Br(o.attr||{},n),n!=null&&n.hasOwnProperty("arrows")&&n.arrows!=null&&(o.arrows={to:{enabled:!0,type:n.arrows.type}},n.arrows=null),o}function ve(){for(ft=rt.NULL,H="";J===" "||J==="	"||J===`
`||J==="\r";)We();do{var i=!1;if(J==="#"){for(var e=mn-1;Rr.charAt(e)===" "||Rr.charAt(e)==="	";)e--;if(Rr.charAt(e)===`
`||Rr.charAt(e)===""){for(;J!=""&&J!=`
`;)We();i=!0}}if(J==="/"&&Wi()==="/"){for(;J!=""&&J!=`
`;)We();i=!0}if(J==="/"&&Wi()==="*"){for(;J!="";)if(J==="*"&&Wi()==="/"){We(),We();break}else We();i=!0}for(;J===" "||J==="	"||J===`
`||J==="\r";)We()}while(i);if(J===""){ft=rt.DELIMITER;return}var t=J+Wi();if(L$[t]){ft=rt.DELIMITER,H=t,We(),We();return}if(L$[J]){ft=rt.DELIMITER,H=J,We();return}if(z$(J)||J==="-"){for(H+=J,We();z$(J);)H+=J,We();H==="false"?H=!1:H==="true"?H=!0:isNaN(Number(H))||(H=Number(H)),ft=rt.IDENTIFIER;return}if(J==='"'){for(We();J!=""&&(J!='"'||J==='"'&&Wi()==='"');)J==='"'?(H+=J,We()):J==="\\"&&Wi()==="n"?(H+=`
`,We()):H+=J,We();if(J!='"')throw it('End of string " expected');We(),ft=rt.IDENTIFIER;return}for(ft=rt.UNKNOWN;J!="";)H+=J,We();throw new SyntaxError('Syntax error in part "'+WA(H,30)+'"')}function Eee(){var i={};if(bee(),ve(),H==="strict"&&(i.strict=!0,ve()),(H==="graph"||H==="digraph")&&(i.type=H,ve()),ft===rt.IDENTIFIER&&(i.id=H,ve()),H!="{")throw it("Angle bracket { expected");if(ve(),jA(i),H!="}")throw it("Angle bracket } expected");if(ve(),H!=="")throw it("End of file expected");return ve(),delete i.node,delete i.edge,delete i.graph,i}function jA(i){for(;H!==""&&H!="}";)See(i),H===";"&&ve()}function See(i){var e=LA(i);if(e){zA(i,e);return}var t=$ee(i);if(!t){if(ft!=rt.IDENTIFIER)throw it("Identifier expected");var r=H;if(ve(),H==="="){if(ve(),ft!=rt.IDENTIFIER)throw it("Identifier expected");i[r]=H,ve()}else Oee(i,r)}}function LA(i){var e=null;if(H==="subgraph"&&(e={},e.type="subgraph",ve(),ft===rt.IDENTIFIER&&(e.id=H,ve())),H==="{"){if(ve(),e||(e={}),e.parent=i,e.node=i.node,e.edge=i.edge,e.graph=i.graph,jA(e),H!="}")throw it("Angle bracket } expected");ve(),delete e.node,delete e.edge,delete e.graph,delete e.parent,i.subgraphs||(i.subgraphs=[]),i.subgraphs.push(e)}return e}function $ee(i){return H==="node"?(ve(),i.node=uo(),"node"):H==="edge"?(ve(),i.edge=uo(),"edge"):H==="graph"?(ve(),i.graph=uo(),"graph"):null}function Oee(i,e){var t={id:e},r=uo();r&&(t.attr=r),qA(i,t),zA(i,e)}function zA(i,e){for(;H==="->"||H==="--";){var t,r=H;ve();var n=LA(i);if(n)t=n;else{if(ft!=rt.IDENTIFIER)throw it("Identifier or subgraph expected");t=H,qA(i,{id:t}),ve()}var o=uo(),s=BA(i,e,t,r,o);_ee(i,s),e=t}}function uo(){for(var i,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},r={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,o=new Array;H==="[";){for(ve(),e={};H!==""&&H!="]";){if(ft!=rt.IDENTIFIER)throw it("Attribute name expected");var s=H;if(ve(),H!="=")throw it("Equal sign = expected");if(ve(),ft!=rt.IDENTIFIER)throw it("Attribute value expected");var a=H;s==="style"&&(a=t[a]);var l;s==="arrowhead"&&(l=r[a],s="arrows",a={to:{enabled:!0,type:l}}),s==="arrowtail"&&(l=r[a],s="arrows",a={from:{enabled:!0,type:l}}),n.push({attr:e,name:s,value:a}),o.push(s),ve(),H==","&&ve()}if(H!="]")throw it("Bracket ] expected");ve()}if(Mr(o).call(o,"dir")){var u={};for(u.arrows={},i=0;i<n.length;i++)if(n[i].name==="arrows")if(n[i].value.to!=null)u.arrows.to=i;else if(n[i].value.from!=null)u.arrows.from=i;else throw it("Invalid value of arrows");else n[i].name==="dir"&&(u.dir=i);var d=n[u.dir].value;if(!Mr(o).call(o,"arrows"))if(d==="both")n.push({attr:n[u.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),u.arrows.to=n.length-1,n.push({attr:n[u.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),u.arrows.from=n.length-1;else if(d==="forward")n.push({attr:n[u.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),u.arrows.to=n.length-1;else if(d==="back")n.push({attr:n[u.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),u.arrows.from=n.length-1;else if(d==="none")n.push({attr:n[u.dir].attr,name:"arrows",value:""}),u.arrows.to=n.length-1;else throw it('Invalid dir type "'+d+'"');var c,h;if(d==="both")u.arrows.to&&u.arrows.from?(h=n[u.arrows.to].value.to.type,c=n[u.arrows.from].value.from.type,n[u.arrows.to]={attr:n[u.arrows.to].attr,name:n[u.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:c}}},vr(n).call(n,u.arrows.from,1)):u.arrows.to?(h=n[u.arrows.to].value.to.type,c="arrow",n[u.arrows.to]={attr:n[u.arrows.to].attr,name:n[u.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:c}}}):u.arrows.from&&(h="arrow",c=n[u.arrows.from].value.from.type,n[u.arrows.from]={attr:n[u.arrows.from].attr,name:n[u.arrows.from].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:c}}});else if(d==="back")u.arrows.to&&u.arrows.from?(h="",c=n[u.arrows.from].value.from.type,n[u.arrows.from]={attr:n[u.arrows.from].attr,name:n[u.arrows.from].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:c}}}):u.arrows.to?(h="",c="arrow",u.arrows.from=u.arrows.to,n[u.arrows.from]={attr:n[u.arrows.from].attr,name:n[u.arrows.from].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:c}}}):u.arrows.from&&(h="",c=n[u.arrows.from].value.from.type,n[u.arrows.to]={attr:n[u.arrows.from].attr,name:n[u.arrows.from].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:c}}}),n[u.arrows.from]={attr:n[u.arrows.from].attr,name:n[u.arrows.from].name,value:{from:{enabled:!0,type:n[u.arrows.from].value.from.type}}};else if(d==="none"){var f;u.arrows.to?f=u.arrows.to:f=u.arrows.from,n[f]={attr:n[f].attr,name:n[f].name,value:""}}else if(d==="forward")u.arrows.to&&u.arrows.from?(h=n[u.arrows.to].value.to.type,c="",n[u.arrows.to]={attr:n[u.arrows.to].attr,name:n[u.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:c}}}):u.arrows.to?(h=n[u.arrows.to].value.to.type,c="",n[u.arrows.to]={attr:n[u.arrows.to].attr,name:n[u.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:c}}}):u.arrows.from&&(h="arrow",c="",u.arrows.to=u.arrows.from,n[u.arrows.to]={attr:n[u.arrows.to].attr,name:n[u.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:c}}}),n[u.arrows.to]={attr:n[u.arrows.to].attr,name:n[u.arrows.to].name,value:{to:{enabled:!0,type:n[u.arrows.to].value.to.type}}};else throw it('Invalid dir type "'+d+'"');vr(n).call(n,u.dir,1)}var v;if(Mr(o).call(o,"penwidth")){var g=[];for(v=n.length,i=0;i<v;i++)n[i].name!=="width"&&(n[i].name==="penwidth"&&(n[i].name="width"),g.push(n[i]));n=g}for(v=n.length,i=0;i<v;i++)wee(n[i].attr,n[i].name,n[i].value);return e}function it(i){return new SyntaxError(i+', got "'+WA(H,30)+'" (char '+mn+")")}function WA(i,e){return i.length<=e?i:i.substr(0,27)+"..."}function Iee(i,e,t){Pe(i)?de(i).call(i,function(r){Pe(e)?de(e).call(e,function(n){t(r,n)}):t(r,e)}):Pe(e)?de(e).call(e,function(r){t(i,r)}):t(i,e)}function pf(i,e,t){for(var r=e.split("."),n=r.pop(),o=i,s=0;s<r.length;s++){var a=r[s];a in o||(o[a]={}),o=o[a]}return o[n]=t,i}function W$(i,e){var t={};for(var r in i)if(i.hasOwnProperty(r)){var n=e[r];Pe(n)?de(n).call(n,function(o){pf(t,o,i[r])}):typeof n=="string"?pf(t,n,i[r]):pf(t,r,i[r])}return t}function Tee(i){var e=mee(i),t={nodes:[],edges:[],options:{}};if(e.nodes){var r;de(r=e.nodes).call(r,function(s){var a={id:s.id,label:String(s.label||s.id)};Br(a,W$(s.attr,FA)),a.image&&(a.shape="image"),t.nodes.push(a)})}if(e.edges){var n,o=function(s){var a={from:s.from,to:s.to};return Br(a,W$(s.attr,ky)),a.arrows==null&&s.type==="->"&&(a.arrows="to"),a};de(n=e.edges).call(n,function(s){var a,l;if(s.from instanceof Object?a=s.from.nodes:a={id:s.from},s.to instanceof Object?l=s.to.nodes:l={id:s.to},s.from instanceof Object&&s.from.edges){var u;de(u=s.from.edges).call(u,function(c){var h=o(c);t.edges.push(h)})}if(Iee(a,l,function(c,h){var f=BA(t,c.id,h.id,s.type,s.attr),v=o(f);t.edges.push(v)}),s.to instanceof Object&&s.to.edges){var d;de(d=s.to.edges).call(d,function(c){var h=o(c);t.edges.push(h)})}})}return e.attr&&(t.options=e.attr),t}function Pee(i,e){var t;const r={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};e!=null&&(e.fixed!=null&&(r.nodes.fixed=e.fixed),e.parseColor!=null&&(r.nodes.parseColor=e.parseColor),e.inheritColor!=null&&(r.edges.inheritColor=e.inheritColor));const n=i.edges,o=vn(n).call(n,a=>{const l={from:a.source,id:a.id,to:a.target};return a.attributes!=null&&(l.attributes=a.attributes),a.label!=null&&(l.label=a.label),a.attributes!=null&&a.attributes.title!=null&&(l.title=a.attributes.title),a.type==="Directed"&&(l.arrows="to"),a.color&&r.edges.inheritColor===!1&&(l.color=a.color),l});return{nodes:vn(t=i.nodes).call(t,a=>{const l={id:a.id,fixed:r.nodes.fixed&&a.x!=null&&a.y!=null};return a.attributes!=null&&(l.attributes=a.attributes),a.label!=null&&(l.label=a.label),a.size!=null&&(l.size=a.size),a.attributes!=null&&a.attributes.title!=null&&(l.title=a.attributes.title),a.title!=null&&(l.title=a.title),a.x!=null&&(l.x=a.x),a.y!=null&&(l.y=a.y),a.color!=null&&(r.nodes.parseColor===!0?l.color=a.color:l.color={background:a.color,border:a.color,highlight:{background:a.color,border:a.color},hover:{background:a.color,border:a.color}}),l}),edges:o}}const Cee={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"},Ree={addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},xee={addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",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"},Dee={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"},Aee={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"},Mee={addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},Nee={addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},kee={addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},Fee={addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"},qee={addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},Bee={addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"};var jee=Object.freeze({__proto__:null,cn:kee,cs:Bee,de:Ree,en:Cee,es:xee,fr:qee,it:Dee,nl:Aee,pt:Mee,ru:Nee,uk:Fee});function Lee(i,e){try{const[r,n]=e.split(/[-_ /]/,2),o=r!=null?r.toLowerCase():null,s=n!=null?n.toUpperCase():null;if(o&&s){const a=o+"-"+s;if(Object.prototype.hasOwnProperty.call(i,a))return a;var t;console.warn(cZ(t="Unknown variant ".concat(s," of language ")).call(t,o,"."))}if(o){const a=o;if(Object.prototype.hasOwnProperty.call(i,a))return a;console.warn("Unknown language ".concat(o))}return console.warn("Unknown locale ".concat(e,", falling back to English.")),"en"}catch(r){return console.error(r),console.warn("Unexpected error while normalizing locale ".concat(e,", falling back to English.")),"en"}}class zee{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 r=Math.floor(t/2),n=Math.floor(t/4),o=Math.floor(t/8),s=Math.floor(t/16),a=Math.floor(e/2),l=Math.floor(e/4),u=Math.floor(e/8),d=Math.floor(e/16);this.canvas.width=3*l,this.canvas.height=r,this.coordinates=[[0,0,a,r],[a,0,l,n],[a,n,u,o],[5*u,n,d,s]],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 r=1;r<this.NUM_ITERATIONS;r++){const n=this.coordinates[r-1],o=this.coordinates[r];e.drawImage(this.canvas,n[0],n[1],n[2],n[3],o[0],o[1],o[2],o[3])}}drawImageAtPosition(e,t,r,n,o,s){if(this.initialized())if(t>2){t*=.5;let a=0;for(;t>2&&a<this.NUM_ITERATIONS;)t*=.5,a+=1;a>=this.NUM_ITERATIONS&&(a=this.NUM_ITERATIONS-1);const l=this.coordinates[a];e.drawImage(this.canvas,l[0],l[1],l[2],l[3],r,n,o,s)}else e.drawImage(this.image,r,n,o,s)}}class Wee{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,t,r){if(!(e===void 0||r===void 0)){if(t===void 0){console.warn("No broken url image defined");return}r.image.onerror=()=>{console.error("Could not load brokenImage:",t)},r.image.src=t}}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,t){const r=this.images[e];if(r)return r;const n=new zee;return this.images[e]=n,n.image.onload=()=>{this._fixImageCoordinates(n.image),n.init(),this._redrawWithImage(n)},n.image.onerror=()=>{console.error("Could not load image:",e),this._tryloadBrokenUrl(e,t,n)},n.image.src=e,n}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}var H$={},U$={},gf={exports:{}},yf,V$;function Hee(){if(V$)return yf;V$=1;var i=ee();return yf=i(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),yf}var mf,G$;function Uee(){if(G$)return mf;G$=1;var i=ee(),e=Ke(),t=or(),r=Hee(),n=Object.isExtensible,o=i(function(){});return mf=o||r?function(a){return!e(a)||r&&t(a)==="ArrayBuffer"?!1:n?n(a):!0}:n,mf}var bf,K$;function HA(){if(K$)return bf;K$=1;var i=ee();return bf=!i(function(){return Object.isExtensible(Object.preventExtensions({}))}),bf}var Y$;function al(){if(Y$)return gf.exports;Y$=1;var i=z(),e=te(),t=Zo(),r=Ke(),n=Ze(),o=Nt().f,s=tl(),a=_y(),l=Uee(),u=Ka(),d=HA(),c=!1,h=u("meta"),f=0,v=function(b){o(b,h,{value:{objectID:"O"+f++,weakData:{}}})},g=function(b,_){if(!r(b))return typeof b=="symbol"?b:(typeof b=="string"?"S":"P")+b;if(!n(b,h)){if(!l(b))return"F";if(!_)return"E";v(b)}return b[h].objectID},y=function(b,_){if(!n(b,h)){if(!l(b))return!0;if(!_)return!1;v(b)}return b[h].weakData},p=function(b){return d&&c&&l(b)&&!n(b,h)&&v(b),b},m=function(){w.enable=function(){},c=!0;var b=s.f,_=e([].splice),S={};S[h]=1,b(S).length&&(s.f=function(I){for(var E=b(I),$=0,T=E.length;$<T;$++)if(E[$]===h){_(E,$,1);break}return E},i({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:a.f}))},w=gf.exports={enable:m,fastKey:g,getWeakData:y,onFreeze:p};return t[h]=!0,gf.exports}var wf,X$;function Vee(){if(X$)return wf;X$=1;var i=je(),e=Wn(),t=i("iterator"),r=Array.prototype;return wf=function(n){return n!==void 0&&(e.Array===n||r[t]===n)},wf}var _f,J$;function UA(){if(J$)return _f;J$=1;var i=zn(),e=hy(),t=An(),r=Wn(),n=je(),o=n("iterator");return _f=function(s){if(!t(s))return e(s,o)||e(s,"@@iterator")||r[i(s)]},_f}var Ef,Z$;function Gee(){if(Z$)return Ef;Z$=1;var i=Et(),e=$r(),t=sr(),r=kn(),n=UA(),o=TypeError;return Ef=function(s,a){var l=arguments.length<2?n(s):a;if(e(l))return t(i(l,s));throw new o(r(s)+" is not iterable")},Ef}var Sf,Q$;function Fy(){if(Q$)return Sf;Q$=1;var i=Et(),e=sr(),t=hy();return Sf=function(r,n,o){var s,a;e(r);try{if(s=t(r,"return"),!s){if(n==="throw")throw o;return o}s=i(s,r)}catch(l){a=!0,s=l}if(n==="throw")throw o;if(a)throw s;return e(s),o},Sf}var $f,eO;function ll(){if(eO)return $f;eO=1;var i=Xa(),e=Et(),t=sr(),r=kn(),n=Vee(),o=Or(),s=Be(),a=Gee(),l=UA(),u=Fy(),d=TypeError,c=function(f,v){this.stopped=f,this.result=v},h=c.prototype;return $f=function(f,v,g){var y=g&&g.that,p=!!(g&&g.AS_ENTRIES),m=!!(g&&g.IS_RECORD),w=!!(g&&g.IS_ITERATOR),b=!!(g&&g.INTERRUPTED),_=i(v,y),S,I,E,$,T,R,C,P=function(q){return S&&u(S,"normal"),new c(!0,q)},F=function(q){return p?(t(q),b?_(q[0],q[1],P):_(q[0],q[1])):b?_(q,P):_(q)};if(m)S=f.iterator;else if(w)S=f;else{if(I=l(f),!I)throw new d(r(f)+" is not iterable");if(n(I)){for(E=0,$=o(f);$>E;E++)if(T=F(f[E]),T&&s(h,T))return T;return new c(!1)}S=a(f,I)}for(R=m?f.next:S.next;!(C=e(R,S)).done;){try{T=F(C.value)}catch(q){u(S,"throw",q)}if(typeof T=="object"&&T&&s(h,T))return T}return new c(!1)},$f}var Of,tO;function qy(){if(tO)return Of;tO=1;var i=Be(),e=TypeError;return Of=function(t,r){if(i(r,t))return t;throw new e("Incorrect invocation")},Of}var If,rO;function By(){if(rO)return If;rO=1;var i=z(),e=Ee(),t=al(),r=ee(),n=Bn(),o=ll(),s=qy(),a=Ge(),l=Ke(),u=An(),d=Pi(),c=Nt().f,h=Vr().forEach,f=De(),v=Ci(),g=v.set,y=v.getterFor;return If=function(p,m,w){var b=p.indexOf("Map")!==-1,_=p.indexOf("Weak")!==-1,S=b?"set":"add",I=e[p],E=I&&I.prototype,$={},T;if(!f||!a(I)||!(_||E.forEach&&!r(function(){new I().entries().next()})))T=w.getConstructor(m,p,b,S),t.enable();else{T=m(function(P,F){g(s(P,R),{type:p,collection:new I}),u(F)||o(F,P[S],{that:P,AS_ENTRIES:b})});var R=T.prototype,C=y(p);h(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(P){var F=P==="add"||P==="set";P in E&&!(_&&P==="clear")&&n(R,P,function(q,X){var K=C(this).collection;if(!F&&_&&!l(q))return P==="get"?void 0:!1;var oe=K[P](q===0?0:q,X);return F?this:oe})}),_||c(R,"size",{configurable:!0,get:function(){return C(this).collection.size}})}return d(T,p,!1,!0),$[p]=T,i({global:!0,forced:!0},$),_||w.setStrong(T,p,b),T},If}var Tf,iO;function jy(){if(iO)return Tf;iO=1;var i=rs();return Tf=function(e,t,r){for(var n in t)r&&r.unsafe&&e[n]?e[n]=t[n]:i(e,n,t[n],r);return e},Tf}var Pf,nO;function Kee(){if(nO)return Pf;nO=1;var i=Pt(),e=Ey(),t=je(),r=De(),n=t("species");return Pf=function(o){var s=i(o);r&&s&&!s[n]&&e(s,n,{configurable:!0,get:function(){return this}})},Pf}var Cf,oO;function VA(){if(oO)return Cf;oO=1;var i=ts(),e=Ey(),t=jy(),r=Xa(),n=qy(),o=An(),s=ll(),a=$y(),l=Oy(),u=Kee(),d=De(),c=al().fastKey,h=Ci(),f=h.set,v=h.getterFor;return Cf={getConstructor:function(g,y,p,m){var w=g(function(E,$){n(E,b),f(E,{type:y,index:i(null),first:null,last:null,size:0}),d||(E.size=0),o($)||s($,E[m],{that:E,AS_ENTRIES:p})}),b=w.prototype,_=v(y),S=function(E,$,T){var R=_(E),C=I(E,$),P,F;return C?C.value=T:(R.last=C={index:F=c($,!0),key:$,value:T,previous:P=R.last,next:null,removed:!1},R.first||(R.first=C),P&&(P.next=C),d?R.size++:E.size++,F!=="F"&&(R.index[F]=C)),E},I=function(E,$){var T=_(E),R=c($),C;if(R!=="F")return T.index[R];for(C=T.first;C;C=C.next)if(C.key===$)return C};return t(b,{clear:function(){for(var $=this,T=_($),R=T.first;R;)R.removed=!0,R.previous&&(R.previous=R.previous.next=null),R=R.next;T.first=T.last=null,T.index=i(null),d?T.size=0:$.size=0},delete:function(E){var $=this,T=_($),R=I($,E);if(R){var C=R.next,P=R.previous;delete T.index[R.index],R.removed=!0,P&&(P.next=C),C&&(C.previous=P),T.first===R&&(T.first=C),T.last===R&&(T.last=P),d?T.size--:$.size--}return!!R},forEach:function($){for(var T=_(this),R=r($,arguments.length>1?arguments[1]:void 0),C;C=C?C.next:T.first;)for(R(C.value,C.key,this);C&&C.removed;)C=C.previous},has:function($){return!!I(this,$)}}),t(b,p?{get:function($){var T=I(this,$);return T&&T.value},set:function($,T){return S(this,$===0?0:$,T)}}:{add:function($){return S(this,$=$===0?0:$,$)}}),d&&e(b,"size",{configurable:!0,get:function(){return _(this).size}}),w},setStrong:function(g,y,p){var m=y+" Iterator",w=v(y),b=v(m);a(g,y,function(_,S){f(this,{type:m,target:_,state:w(_),kind:S,last:null})},function(){for(var _=b(this),S=_.kind,I=_.last;I&&I.removed;)I=I.previous;return!_.target||!(_.last=I=I?I.next:_.state.first)?(_.target=null,l(void 0,!0)):l(S==="keys"?I.key:S==="values"?I.value:[I.key,I.value],!1)},p?"entries":"values",!p,!0),u(y)}},Cf}var sO;function Yee(){if(sO)return U$;sO=1;var i=By(),e=VA();return i("Map",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},e),U$}var aO;function Xee(){return aO||(aO=1,Yee()),H$}var lO={},Rf,uO;function GA(){return uO||(uO=1,Rf=function(i,e){return e===1?function(t,r){return t[i](r)}:function(t,r,n){return t[i](r,n)}}),Rf}var xf,dO;function Jee(){if(dO)return xf;dO=1;var i=Pt(),e=GA(),t=i("Map");return xf={Map:t,set:e("set",2),get:e("get",1),has:e("has",1),remove:e("delete",1),proto:t.prototype},xf}var cO;function Zee(){if(cO)return lO;cO=1;var i=z(),e=te(),t=$r(),r=Sr(),n=ll(),o=Jee(),s=Fn(),a=ee(),l=o.Map,u=o.has,d=o.get,c=o.set,h=e([].push),f=s||a(function(){return l.groupBy("ab",function(v){return v}).get("a").length!==1});return i({target:"Map",stat:!0,forced:s||f},{groupBy:function(g,y){r(g),t(y);var p=new l,m=0;return n(g,function(w){var b=y(w,m++);u(p,b)?h(d(p,b),w):c(p,b,[w])}),p}}),lO}var hO={},Df,fO;function Qee(){if(fO)return Df;fO=1;var i=te(),e=jn(),t=kt(),r=Sr(),n=i("".charAt),o=i("".charCodeAt),s=i("".slice),a=function(l){return function(u,d){var c=t(r(u)),h=e(d),f=c.length,v,g;return h<0||h>=f?l?"":void 0:(v=o(c,h),v<55296||v>56319||h+1===f||(g=o(c,h+1))<56320||g>57343?l?n(c,h):v:l?s(c,h,h+2):(v-55296<<10)+(g-56320)+65536)}};return Df={codeAt:a(!1),charAt:a(!0)},Df}var vO;function Ly(){if(vO)return hO;vO=1;var i=Qee().charAt,e=kt(),t=Ci(),r=$y(),n=Oy(),o="String Iterator",s=t.set,a=t.getterFor(o);return r(String,"String",function(l){s(this,{type:o,string:e(l),index:0})},function(){var u=a(this),d=u.string,c=u.index,h;return c>=d.length?n(void 0,!0):(h=i(d,c),u.index+=h.length,n(h,!1))}),hO}var Af,pO;function ete(){if(pO)return Af;pO=1,Hn(),Xee(),Zee(),Ly();var i=ue();return Af=i.Map,Af}var Mf,gO;function tte(){if(gO)return Mf;gO=1;var i=ete();return Un(),Mf=i,Mf}var Nf,yO;function rte(){return yO||(yO=1,Nf=tte()),Nf}var ite=rte(),zy=Y(ite);class nte{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},Ne(this.options,this.defaultOptions)}setOptions(e){const t=["useDefaultGroups"];if(e!==void 0){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&le(t).call(t,r)===-1){const n=e[r];this.add(r,n)}}}clear(){this._groups=new zy,this._groupNames=[]}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this._groups.get(e);if(r===void 0&&t)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){const n=this._groupIndex%this._groupNames.length;++this._groupIndex,r={},r.color=this._groups.get(this._groupNames[n]),this._groups.set(e,r)}else{const n=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,r={},r.color=this._defaultGroups[n],this._groups.set(e,r)}return r}add(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}}var mO={},bO;function ote(){if(bO)return mO;bO=1;var i=z();return i({target:"Number",stat:!0},{isNaN:function(t){return t!==t}}),mO}var kf,wO;function ste(){if(wO)return kf;wO=1,ote();var i=ue();return kf=i.Number.isNaN,kf}var Ff,_O;function ate(){if(_O)return Ff;_O=1;var i=ste();return Ff=i,Ff}var qf,EO;function lte(){return EO||(EO=1,qf=ate()),qf}var ute=lte(),Eg=Y(ute),SO={},Bf,$O;function dte(){if($O)return Bf;$O=1;var i=Ee(),e=i.isFinite;return Bf=Number.isFinite||function(r){return typeof r=="number"&&e(r)},Bf}var OO;function cte(){if(OO)return SO;OO=1;var i=z(),e=dte();return i({target:"Number",stat:!0},{isFinite:e}),SO}var jf,IO;function hte(){if(IO)return jf;IO=1,cte();var i=ue();return jf=i.Number.isFinite,jf}var Lf,TO;function fte(){if(TO)return Lf;TO=1;var i=hte();return Lf=i,Lf}var zf,PO;function vte(){return PO||(PO=1,zf=fte()),zf}var pte=vte(),ri=Y(pte),CO={},RO;function gte(){if(RO)return CO;RO=1;var i=z(),e=Vr().some,t=Vn(),r=t("some");return i({target:"Array",proto:!0,forced:!r},{some:function(o){return e(this,o,arguments.length>1?arguments[1]:void 0)}}),CO}var Wf,xO;function yte(){if(xO)return Wf;xO=1,gte();var i=Qe();return Wf=i("Array","some"),Wf}var Hf,DO;function mte(){if(DO)return Hf;DO=1;var i=Be(),e=yte(),t=Array.prototype;return Hf=function(r){var n=r.some;return r===t||i(t,r)&&n===t.some?e:n},Hf}var Uf,AO;function bte(){if(AO)return Uf;AO=1;var i=mte();return Uf=i,Uf}var Vf,MO;function wte(){return MO||(MO=1,Vf=bte()),Vf}var _te=wte(),Ete=Y(_te),Gf={exports:{}},NO={},kO;function Ste(){if(kO)return NO;kO=1;var i=z(),e=De(),t=Nt().f;return i({target:"Object",stat:!0,forced:Object.defineProperty!==t,sham:!e},{defineProperty:t}),NO}var FO;function $te(){if(FO)return Gf.exports;FO=1,Ste();var i=ue(),e=i.Object,t=Gf.exports=function(n,o,s){return e.defineProperty(n,o,s)};return e.defineProperty.sham&&(t.sham=!0),Gf.exports}var Kf,qO;function KA(){if(qO)return Kf;qO=1;var i=$te();return Kf=i,Kf}var Yf,BO;function Ote(){if(BO)return Yf;BO=1;var i=KA();return Yf=i,Yf}var Xf,jO;function Ite(){if(jO)return Xf;jO=1;var i=Ote();return Xf=i,Xf}var Jf,LO;function Tte(){return LO||(LO=1,Jf=Ite()),Jf}var Pte=Tte(),Cte=Y(Pte),zO={},WO;function Rte(){if(WO)return zO;WO=1;var i=je(),e=Nt().f,t=i("metadata"),r=Function.prototype;return r[t]===void 0&&e(r,t,{value:null}),zO}var HO={},UO;function xte(){return UO||(UO=1,XD()),HO}var VO={},GO;function Dte(){return GO||(GO=1,JD()),VO}var KO={},YO;function Ate(){if(YO)return KO;YO=1;var i=Oe();return i("metadata"),KO}var Zf,XO;function Mte(){if(XO)return Zf;XO=1;var i=rA();return Rte(),xte(),Dte(),Ate(),Zf=i,Zf}var JO={},Qf,ZO;function YA(){if(ZO)return Qf;ZO=1;var i=Pt(),e=te(),t=i("Symbol"),r=t.keyFor,n=e(t.prototype.valueOf);return Qf=t.isRegisteredSymbol||function(s){try{return r(n(s))!==void 0}catch{return!1}},Qf}var QO;function Nte(){if(QO)return JO;QO=1;var i=z(),e=YA();return i({target:"Symbol",stat:!0},{isRegisteredSymbol:e}),JO}var eI={},ev,tI;function XA(){if(tI)return ev;tI=1;for(var i=qn(),e=Pt(),t=te(),r=Jo(),n=je(),o=e("Symbol"),s=o.isWellKnownSymbol,a=e("Object","getOwnPropertyNames"),l=t(o.prototype.valueOf),u=i("wks"),d=0,c=a(o),h=c.length;d<h;d++)try{var f=c[d];r(o[f])&&n(f)}catch{}return ev=function(g){if(s&&s(g))return!0;try{for(var y=l(g),p=0,m=a(u),w=m.length;p<w;p++)if(u[m[p]]==y)return!0}catch{}return!1},ev}var rI;function kte(){if(rI)return eI;rI=1;var i=z(),e=XA();return i({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:e}),eI}var iI={},nI;function Fte(){if(nI)return iI;nI=1;var i=Oe();return i("customMatcher"),iI}var oI={},sI;function qte(){if(sI)return oI;sI=1;var i=Oe();return i("observable"),oI}var aI={},lI;function Bte(){if(lI)return aI;lI=1;var i=z(),e=YA();return i({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:e}),aI}var uI={},dI;function jte(){if(dI)return uI;dI=1;var i=z(),e=XA();return i({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:e}),uI}var cI={},hI;function Lte(){if(hI)return cI;hI=1;var i=Oe();return i("matcher"),cI}var fI={},vI;function zte(){if(vI)return fI;vI=1;var i=Oe();return i("metadataKey"),fI}var pI={},gI;function Wte(){if(gI)return pI;gI=1;var i=Oe();return i("patternMatch"),pI}var yI={},mI;function Hte(){if(mI)return yI;mI=1;var i=Oe();return i("replaceAll"),yI}var tv,bI;function Ute(){if(bI)return tv;bI=1;var i=Mte();return Nte(),kte(),Fte(),qte(),Bte(),jte(),Lte(),zte(),Wte(),Hte(),tv=i,tv}var rv,wI;function Vte(){return wI||(wI=1,rv=Ute()),rv}var Gte=Vte(),Fs=Y(Gte),iv,_I;function Kte(){if(_I)return iv;_I=1,Hn(),Ly(),ZD();var i=rl();return iv=i.f("iterator"),iv}var nv,EI;function Yte(){if(EI)return nv;EI=1;var i=Kte();return Un(),nv=i,nv}var ov,SI;function Xte(){if(SI)return ov;SI=1;var i=Yte();return ov=i,ov}var sv,$I;function Jte(){if($I)return sv;$I=1;var i=Xte();return sv=i,sv}var av,OI;function Zte(){return OI||(OI=1,av=Jte()),av}var Qte=Zte(),ere=Y(Qte);function To(i){"@babel/helpers - typeof";return To=typeof Fs=="function"&&typeof ere=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Fs=="function"&&e.constructor===Fs&&e!==Fs.prototype?"symbol":typeof e},To(i)}var lv,II;function tre(){if(II)return lv;II=1,QD();var i=rl();return lv=i.f("toPrimitive"),lv}var uv,TI;function rre(){if(TI)return uv;TI=1;var i=tre();return uv=i,uv}var dv,PI;function ire(){if(PI)return dv;PI=1;var i=rre();return dv=i,dv}var cv,CI;function nre(){if(CI)return cv;CI=1;var i=ire();return cv=i,cv}var hv,RI;function ore(){return RI||(RI=1,hv=nre()),hv}var sre=ore(),are=Y(sre);function lre(i,e){if(To(i)!="object"||!i)return i;var t=i[are];if(t!==void 0){var r=t.call(i,e);if(To(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function ure(i){var e=lre(i,"string");return To(e)=="symbol"?e:e+""}function ur(i,e,t){return(e=ure(e))in i?Cte(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var xI={},fv,DI;function dre(){if(DI)return fv;DI=1;var i=Ee(),e=ee(),t=te(),r=kt(),n=nA().trim,o=Iy(),s=t("".charAt),a=i.parseFloat,l=i.Symbol,u=l&&l.iterator,d=1/a(o+"-0")!==-1/0||u&&!e(function(){a(Object(u))});return fv=d?function(h){var f=n(r(h)),v=a(f);return v===0&&s(f,0)==="-"?-0:v}:a,fv}var AI;function cre(){if(AI)return xI;AI=1;var i=z(),e=dre();return i({global:!0,forced:parseFloat!==e},{parseFloat:e}),xI}var vv,MI;function hre(){if(MI)return vv;MI=1,cre();var i=ue();return vv=i.parseFloat,vv}var pv,NI;function fre(){if(NI)return pv;NI=1;var i=hre();return pv=i,pv}var gv,kI;function vre(){return kI||(kI=1,gv=fre()),gv}var pre=vre(),JA=Y(pre),FI={},qI;function gre(){if(qI)return FI;qI=1;var i=z(),e=ee(),t=_y().f,r=e(function(){return!Object.getOwnPropertyNames(1)});return i({target:"Object",stat:!0,forced:r},{getOwnPropertyNames:t}),FI}var yv,BI;function yre(){if(BI)return yv;BI=1,gre();var i=ue(),e=i.Object;return yv=function(r){return e.getOwnPropertyNames(r)},yv}var mv,jI;function mre(){if(jI)return mv;jI=1;var i=yre();return mv=i,mv}var bv,LI;function bre(){return LI||(LI=1,bv=mre()),bv}var wre=bre(),_re=Y(wre),wv,zI;function Ere(){if(zI)return wv;zI=1,YD();var i=ue();return wv=i.Object.getOwnPropertySymbols,wv}var _v,WI;function Sre(){if(WI)return _v;WI=1;var i=Ere();return _v=i,_v}var Ev,HI;function $re(){return HI||(HI=1,Ev=Sre()),Ev}var Ore=$re(),jr=Y(Ore),Sv={exports:{}},UI={},VI;function Ire(){if(VI)return UI;VI=1;var i=z(),e=ee(),t=Gt(),r=Ya().f,n=De(),o=!n||e(function(){r(1)});return i({target:"Object",stat:!0,forced:o,sham:!n},{getOwnPropertyDescriptor:function(a,l){return r(t(a),l)}}),UI}var GI;function Tre(){if(GI)return Sv.exports;GI=1,Ire();var i=ue(),e=i.Object,t=Sv.exports=function(n,o){return e.getOwnPropertyDescriptor(n,o)};return e.getOwnPropertyDescriptor.sham&&(t.sham=!0),Sv.exports}var $v,KI;function Pre(){if(KI)return $v;KI=1;var i=Tre();return $v=i,$v}var Ov,YI;function Cre(){return YI||(YI=1,Ov=Pre()),Ov}var Rre=Cre(),Gr=Y(Rre),XI={},JI;function xre(){if(JI)return XI;JI=1;var i=z(),e=De(),t=rJ(),r=Gt(),n=Ya(),o=Qa();return i({target:"Object",stat:!0,sham:!e},{getOwnPropertyDescriptors:function(a){for(var l=r(a),u=n.f,d=t(l),c={},h=0,f,v;d.length>h;)v=u(l,f=d[h++]),v!==void 0&&o(c,f,v);return c}}),XI}var Iv,ZI;function Dre(){if(ZI)return Iv;ZI=1,xre();var i=ue();return Iv=i.Object.getOwnPropertyDescriptors,Iv}var Tv,QI;function Are(){if(QI)return Tv;QI=1;var i=Dre();return Tv=i,Tv}var Pv,eT;function Mre(){return eT||(eT=1,Pv=Are()),Pv}var Nre=Mre(),Lr=Y(Nre),Cv={exports:{}},tT={},rT;function kre(){if(rT)return tT;rT=1;var i=z(),e=De(),t=wy().f;return i({target:"Object",stat:!0,forced:Object.defineProperties!==t,sham:!e},{defineProperties:t}),tT}var iT;function Fre(){if(iT)return Cv.exports;iT=1,kre();var i=ue(),e=i.Object,t=Cv.exports=function(n,o){return e.defineProperties(n,o)};return e.defineProperties.sham&&(t.sham=!0),Cv.exports}var Rv,nT;function qre(){if(nT)return Rv;nT=1;var i=Fre();return Rv=i,Rv}var xv,oT;function Bre(){return oT||(oT=1,xv=qre()),xv}var jre=Bre(),ul=Y(jre),Dv,sT;function Lre(){return sT||(sT=1,Dv=KA()),Dv}var zre=Lre(),dl=Y(zre);function Wy(i,e){const t=["node","edge","label"];let r=!0;const n=Tr(e,"chosen");if(typeof n=="boolean")r=n;else if(typeof n=="object"){if(le(t).call(t,i)===-1)throw new Error("choosify: subOption '"+i+"' should be one of '"+t.join("', '")+"'");const o=Tr(e,["chosen",i]);(typeof o=="boolean"||typeof o=="function")&&(r=o)}return r}function Sg(i,e,t){if(i.width<=0||i.height<=0)return!1;if(t!==void 0){const o={x:e.x-t.x,y:e.y-t.y};if(t.angle!==0){const s=-t.angle;e={x:Math.cos(s)*o.x-Math.sin(s)*o.y,y:Math.sin(s)*o.x+Math.cos(s)*o.y}}else e=o}const r=i.x+i.width,n=i.y+i.width;return i.left<e.x&&r>e.x&&i.top<e.y&&n>e.y}function fa(i){return typeof i=="string"&&i!==""}function ZA(i,e,t,r){let n=r.x,o=r.y;if(typeof r.distanceToBorder=="function"){const s=r.distanceToBorder(i,e),a=Math.sin(e)*s,l=Math.cos(e)*s;l===s?(n+=s,o=r.y):a===s?(n=r.x,o-=s):(n+=l,o-=a)}else r.shape.width>r.shape.height?(n=r.x+r.shape.width*.5,o=r.y-t):(n=r.x+t,o=r.y-r.shape.height*.5);return{x:n,y:o}}var Av,aT;function Wre(){if(aT)return Av;aT=1,Hn();var i=Qe();return Av=i("Array","values"),Av}var Mv,lT;function Hre(){if(lT)return Mv;lT=1;var i=Wre();return Mv=i,Mv}var Nv,uT;function Ure(){if(uT)return Nv;uT=1,Un();var i=zn(),e=Ze(),t=Be(),r=Hre(),n=Array.prototype,o={DOMTokenList:!0,NodeList:!0};return Nv=function(s){var a=s.values;return s===n||t(n,s)&&a===n.values||e(o,i(s))?r:a},Nv}var kv,dT;function Vre(){return dT||(dT=1,kv=Ure()),kv}var Gre=Vre(),QA=Y(Gre);class Kre{constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let n=t;(t===void 0||t==="")&&(n=" ");const o=this.measureText(n,r),s=Ne({},QA(o));s.text=t,s.width=o.width,s.mod=r,(t===void 0||t==="")&&(s.width=0),this.lines[e].blocks.push(s),this.lines[e].width+=s.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 r=0;if(t.blocks!==void 0)for(let n=0;n<t.blocks.length;n++){const o=t.blocks[n];r<o.height&&(r=o.height)}t.height=r}}determineLabelSize(){let e=0,t=0;for(let r=0;r<this.lines.length;r++){const n=this.lines[r];n.width>e&&(e=n.width),t+=n.height}this.width=e,this.height=t}removeEmptyBlocks(){const e=[];for(let t=0;t<this.lines.length;t++){const r=this.lines[t];if(r.blocks.length===0||t===this.lines.length-1&&r.width===0)continue;const n={};Ne(n,r),n.blocks=[];let o;const s=[];for(let a=0;a<r.blocks.length;a++){const l=r.blocks[a];l.width!==0?s.push(l):o===void 0&&(o=l)}s.length===0&&o!==void 0&&s.push(o),n.blocks=s,e.push(n)}return e}finalize(){this.determineLineHeights(),this.determineLabelSize();const e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}}const Yre={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/};class cT{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(){if(this.modStack.length===0)return"normal";if(this.modStack[0]==="mono")return"mono";if(this.bold&&this.ital)return"boldital";if(this.bold)return"bold";if(this.ital)return"ital"}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):!1}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):!1}match(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const[r,n]=this.prepareRegExp(e),o=r.test(this.text.substr(this.position,n));return o&&t&&(this.position+=n-1),o}parseEndTag(e,t,r){let n=this.mod()===e;return e==="mono"?n=n&&this.mono:n=n&&!this.mono,n&&this.match(t)?(r!==void 0?(this.position===this.text.length-1||this.match(r,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}replace(e,t){return this.match(e)?(this.add(t),this.position+=length-1,!0):!1}prepareRegExp(e){let t,r;if(e instanceof RegExp)r=e,t=1;else{const n=Yre[e];n!==void 0?r=n:r=new RegExp(e),t=e.length}return[r,t]}}class Xre{constructor(e,t,r,n){this.ctx=e,this.parent=t,this.selected=r,this.hover=n;const o=(s,a)=>{if(s===void 0)return 0;const l=this.parent.getFormattingValues(e,r,n,a);let u=0;return s!==""&&(u=this.ctx.measureText(s).width),{width:u,values:l}};this.lines=new Kre(o)}process(e){if(!fa(e))return this.lines.finalize();const t=this.parent.fontOptions;e=e.replace(/\r\n/g,`
`),e=e.replace(/\r/g,`
`);const r=String(e).split(`
`),n=r.length;if(t.multi)for(let o=0;o<n;o++){const s=this.splitBlocks(r[o],t.multi);if(s!==void 0){if(s.length===0){this.lines.newLine("");continue}if(t.maxWdt>0)for(let a=0;a<s.length;a++){const l=s[a].mod,u=s[a].text;this.splitStringIntoLines(u,l,!0)}else for(let a=0;a<s.length;a++){const l=s[a].mod,u=s[a].text;this.lines.append(u,l)}this.lines.newLine()}}else if(t.maxWdt>0)for(let o=0;o<n;o++)this.splitStringIntoLines(r[o]);else for(let o=0;o<n;o++)this.lines.newLine(r[o]);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 cT(e),r=n=>/&/.test(n)?(t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&")||t.add("&"),!0):!1;for(;t.position<t.text.length;){const n=t.text.charAt(t.position);t.parseWS(n)||/</.test(n)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||r(n)||t.add(n),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){const t=new cT(e);let r=!0;const n=o=>/\\/.test(o)?(t.position<this.text.length+1&&(t.position++,o=this.text.charAt(t.position),/ \t/.test(o)?t.spacing=!0:(t.add(o),r=!1)),!0):!1;for(;t.position<t.text.length;){const o=t.text.charAt(t.position);t.parseWS(o)||n(o)||(r||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(o),r=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){const r=this.decodeMarkupSystem(t);if(r==="none")return[{text:e,mod:"normal"}];if(r==="markdown")return this.splitMarkdownBlocks(e);if(r==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){const t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t="",r=0;for(;r<e.length;){const o=t+(t===""?"":" ")+e[r];if(this.overMaxWidth(o))break;t=o,r++}return r}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(Jt(e).call(e,0,t));)t++;return t}splitStringIntoLines(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let n=e.split("\r");for(;n.length>0;){let o=this.getLongestFit(n);if(o===0){const s=n[0],a=this.getLongestFitWord(s);this.lines.newLine(Jt(s).call(s,0,a),t),n[0]=Jt(s).call(s,a)}else{let s=o;n[o-1]===" "?o--:n[s]===" "&&s++;const a=Jt(n).call(n,0,o).join("");o==n.length&&r?this.lines.append(a,t):this.lines.newLine(a,t),n=Jt(n).call(n,s)}}}}const Qn=["bold","ital","boldital","mono"];class on{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;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=r}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),fa(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){if(Z(Qn,t=>{this.fontOptions[t]={}}),on.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}Z(e,(t,r)=>{t!=null&&typeof t!="object"&&(this.fontOptions[r]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;const r=t.split(" ");return e.size=+r[0].replace("px",""),e.face=r[1],e.color=r[2],!0}constrain(e){const t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},r=Tr(e,"widthConstraint");if(typeof r=="number")t.maxWdt=Number(r),t.minWdt=Number(r);else if(typeof r=="object"){const o=Tr(e,["widthConstraint","maximum"]);typeof o=="number"&&(t.maxWdt=Number(o));const s=Tr(e,["widthConstraint","minimum"]);typeof s=="number"&&(t.minWdt=Number(s))}const n=Tr(e,"heightConstraint");if(typeof n=="number")t.minHgt=Number(n);else if(typeof n=="object"){const o=Tr(e,["heightConstraint","minimum"]);typeof o=="number"&&(t.minHgt=Number(o));const s=Tr(e,["heightConstraint","valign"]);typeof s=="string"&&(s==="top"||s==="bottom")&&(t.valign=s)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),fe(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=Wy("label",t)}adjustSizes(e){const t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);const r=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=r)}addFontOptionsToPile(e,t){for(let r=0;r<t.length;++r)this.addFontToPile(e,t[r])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;const r=t.font;e.push(r)}getBasicOptions(e){const t={};for(let r=0;r<e.length;++r){let n=e[r];const o={};on.parseFontString(o,n)&&(n=o),Z(n,(s,a)=>{s!==void 0&&(Object.prototype.hasOwnProperty.call(t,a)||(le(Qn).call(Qn,a)!==-1?t[a]={}:t[a]=s))})}return t}getFontOption(e,t,r){let n;for(let o=0;o<e.length;++o){const s=e[o];if(Object.prototype.hasOwnProperty.call(s,t)){if(n=s[t],n==null)continue;const a={};if(on.parseFontString(a,n)&&(n=a),Object.prototype.hasOwnProperty.call(n,r))return n[r]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,r))return this.fontOptions[r];throw new Error("Did not find value for multi-font for property: '"+r+"'")}getFontOptions(e,t){const r={},n=["color","size","face","mod","vadjust"];for(let o=0;o<n.length;++o){const s=n[o];r[s]=this.getFontOption(e,t,s)}return r}propagateFonts(e){const t=[];this.addFontOptionsToPile(t,e),this.fontOptions=this.getBasicOptions(t);for(let r=0;r<Qn.length;++r){const n=Qn[r],o=this.fontOptions[n],s=this.getFontOptions(t,n);Z(s,(a,l)=>{o[l]=a}),o.size=Number(o.size),o.vadjust=Number(o.vadjust)}}draw(e,t,r,n,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let a=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&a<this.elementOptions.scaling.label.drawThreshold-1||(a>=this.elementOptions.scaling.label.maxVisible&&(a=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,n,o,t,r,s),this._drawBackground(e),this._drawText(e,t,this.size.yLine,s,a))}_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,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",o=arguments.length>4?arguments[4]:void 0;[t,r]=this._setAlignment(e,t,r,n),e.textAlign="left",t=t-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(r-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(r+=(this.size.height-this.size.labelHeight)/2));for(let s=0;s<this.lineCount;s++){const a=this.lines[s];if(a&&a.blocks){let l=0;this.isEdgeLabel||this.fontOptions.align==="center"?l+=(this.size.width-a.width)/2:this.fontOptions.align==="right"&&(l+=this.size.width-a.width);for(let u=0;u<a.blocks.length;u++){const d=a.blocks[u];e.font=d.font;const[c,h]=this._getColor(d.color,o,d.strokeColor);d.strokeWidth>0&&(e.lineWidth=d.strokeWidth,e.strokeStyle=h,e.lineJoin="round"),e.fillStyle=c,d.strokeWidth>0&&e.strokeText(d.text,t+l,r+d.vadjust),e.fillText(d.text,t+l,r+d.vadjust),l+=d.width}r+=a.height}}}_setAlignment(e,t,r,n){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){t=0,r=0;const o=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",r-=2*o):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",r+=2*o):e.textBaseline="middle"}else e.textBaseline=n;return[t,r]}_getColor(e,t,r){let n=e||"#000000",o=r||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){const s=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));n=xt(n,s),o=xt(o,s)}return[n,o]}getTextSize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,t,r),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let t=this.size.left,r=this.size.top-.5*2;if(this.isEdgeLabel){const o=-this.size.width*.5;switch(this.fontOptions.align){case"middle":t=o,r=-this.size.height*.5;break;case"top":t=o,r=-(this.size.height+2);break;case"bottom":t=o,r=2;break}}return{left:t,top:r,width:this.size.width,height:this.size.height}}calculateLabelSize(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,t,r),this.size.left=n-this.size.width*.5,this.size.top=o-this.size.height*.5,this.size.yLine=o+(1-this.lineCount)*.5*this.fontOptions.size,s==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,t,r,n){const o=function(l,u,d){return u==="normal"?d==="mod"?"":l[d]:l[u][d]!==void 0?l[u][d]:l[d]},s={color:o(this.fontOptions,n,"color"),size:o(this.fontOptions,n,"size"),face:o(this.fontOptions,n,"face"),mod:o(this.fontOptions,n,"mod"),vadjust:o(this.fontOptions,n,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||r)&&(n==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?s.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(s,this.elementOptions.id,t,r));let a="";return s.mod!==void 0&&s.mod!==""&&(a+=s.mod+" "),a+=s.size+"px "+s.face,e.font=a.replace(/"/g,""),s.font=e.font,s.height=s.size,s}differentState(e,t){return e!==this.selectedState||t!==this.hoverState}_processLabelText(e,t,r,n){return new Xre(e,this,t,r).process(n)}_processLabel(e,t,r){if(this.labelDirty===!1&&!this.differentState(t,r))return;const n=this._processLabelText(e,t,r,this.elementOptions.label);this.fontOptions.minWdt>0&&n.width<this.fontOptions.minWdt&&(n.width=this.fontOptions.minWdt),this.size.labelHeight=n.height,this.fontOptions.minHgt>0&&n.height<this.fontOptions.minHgt&&(n.height=this.fontOptions.minHgt),this.lines=n.lines,this.lineCount=n.lines.length,this.size.width=n.width,this.size.height=n.height,this.selectedState=t,this.hoverState=r,this.labelDirty=!1}visible(){return!(this.size.width===0||this.size.height===0||this.elementOptions.label===void 0||this.fontOptions.size*this.body.view.scale<this.elementOptions.scaling.label.drawThreshold-1)}}class xi{constructor(e,t,r){this.body=t,this.labelModule=r,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 r=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)))+r}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 r=t.borderDashes;r===!0&&(r=[5,15]),e.setLineDash(r)}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 r=t.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,r),e.strokeStyle=t.borderColor,e.fillStyle=t.color}performStroke(e,t){const r=t.borderWidth/this.body.view.scale;e.save(),r>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),ns(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,r,n,o){r!==void 0&&this.resize(r,n,o),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,r,n,o){this._updateBoundingBox(e,t,r,n,o)}getDimensionsFromLabel(e,t,r){this.textSize=this.labelModule.getTextSize(e,t,r);let n=this.textSize.width,o=this.textSize.height;const s=14;return n===0&&(n=s,o=s),{width:n,height:o}}}let Jre=class extends xi{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,r)){const n=this.getDimensionsFromLabel(e,t,r);this.width=n.width+this.margin.right+this.margin.left,this.height=n.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(e,t,r,n,o,s){this.resize(e,n,o),this.left=t-this.width/2,this.top=r-this.height/2,this.initContextForDraw(e,s),qD(e,this.left,this.top,this.width,this.height,s.borderRadius),this.performFill(e,s),this.updateBoundingBox(t,r,e,n,o),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,o)}updateBoundingBox(e,t,r,n,o){this._updateBoundingBox(e,t,r,n,o);const s=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(s)}distanceToBorder(e,t){e&&this.resize(e);const r=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+r}};class Hy extends xi{constructor(e,t,r){super(e,t,r),this.labelOffset=0,this.selected=!1}setOptions(e,t,r){this.options=e,t===void 0&&r===void 0||this.setImages(t,r)}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 r=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=r}}_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 r=1,n=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?r=this.imageObj.width/this.imageObj.height:n=this.imageObj.height/this.imageObj.width),e=this.options.size*2*r,t=this.options.size*2*n}else{const r=this._getImagePadding();e=this.imageObj.width+r.left+r.right,t=this.imageObj.height+r.top+r.bottom}this.width=e,this.height=t,this.radius=.5*this.width}_drawRawCircle(e,t,r,n){this.initContextForDraw(e,n),yy(e,t,r,n.size),this.performFill(e,n)}_drawImageAtPosition(e,t){if(this.imageObj.width!=0){e.globalAlpha=t.opacity!==void 0?t.opacity:1,this.enableShadow(e,t);let r=1;this.options.shapeProperties.interpolation===!0&&(r=this.imageObj.width/this.width/this.body.view.scale);const n=this._getImagePadding(),o=this.left+n.left,s=this.top+n.top,a=this.width-n.left-n.right,l=this.height-n.top-n.bottom;this.imageObj.drawImageAtPosition(e,r,o,s,a,l),this.disableShadow(e,t)}}_drawImageLabel(e,t,r,n,o){let s=0;if(this.height!==void 0){s=this.height*.5;const l=this.labelModule.getTextSize(e,n,o);l.lineCount>=1&&(s+=l.height/2)}const a=r+s;this.options.label&&(this.labelOffset=s),this.labelModule.draw(e,t,a,n,o,"hanging")}}let Zre=class extends Hy{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,r)){const n=this.getDimensionsFromLabel(e,t,r),o=Math.max(n.width+this.margin.right+this.margin.left,n.height+this.margin.top+this.margin.bottom);this.options.size=o/2,this.width=o,this.height=o,this.radius=this.width/2}}draw(e,t,r,n,o,s){this.resize(e,n,o),this.left=t-this.width/2,this.top=r-this.height/2,this._drawRawCircle(e,t,r,s),this.updateBoundingBox(t,r),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,r,n,o)}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}distanceToBorder(e){return e&&this.resize(e),this.width*.5}};class Qre extends Hy{constructor(e,t,r,n,o){super(e,t,r),this.setImages(n,o)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=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=this.options.size*2;this.width=o,this.height=o,this.radius=.5*this.width;return}this.needsRefresh(t,r)&&this._resizeImage()}draw(e,t,r,n,o,s){this.switchImages(n),this.resize();let a=t,l=r;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=r,a+=this.width/2,l+=this.height/2):(this.left=t-this.width/2,this.top=r-this.height/2),this._drawRawCircle(e,a,l,s),e.save(),e.clip(),this._drawImageAtPosition(e,s),e.restore(),this._drawImageLabel(e,a,l,n,o),this.updateBoundingBox(t,r)}updateBoundingBox(e,t){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=t,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=t+this.options.size*2):(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),this.width*.5}}class Kr extends xi{constructor(e,t,r){super(e,t,r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,r)){var o,s;this.labelModule.getTextSize(e,t,r);const a=2*n.size;this.width=(o=this.customSizeWidth)!==null&&o!==void 0?o:a,this.height=(s=this.customSizeHeight)!==null&&s!==void 0?s:a,this.radius=.5*this.width}}_drawShape(e,t,r,n,o,s,a,l){return this.resize(e,s,a,l),this.left=n-this.width/2,this.top=o-this.height/2,this.initContextForDraw(e,l),pX(t)(e,n,o,l.size),this.performFill(e,l),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(s?"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,n,o)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,s,a,n,o,"hanging");const u=o+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,n,u,s,a,"hanging")}this.updateBoundingBox(n,o)}}}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 hT(i,e){var t=Te(i);if(jr){var r=jr(i);e&&(r=gt(r).call(r,function(n){return Gr(i,n).enumerable})),t.push.apply(t,r)}return t}function eie(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?de(t=hT(Object(n),!0)).call(t,function(o){ur(i,o,n[o])}):Lr?ul(i,Lr(n)):de(r=hT(Object(n))).call(r,function(o){dl(i,o,Gr(n,o))})}return i}class tie extends Kr{constructor(e,t,r,n){super(e,t,r,n),this.ctxRenderer=n}draw(e,t,r,n,o,s){this.resize(e,n,o,s),this.left=t-this.width/2,this.top=r-this.height/2,e.save();const a=this.ctxRenderer({ctx:e,id:this.options.id,x:t,y:r,state:{selected:n,hover:o},style:eie({},s),label:this.options.label});if(a.drawNode!=null&&a.drawNode(),e.restore(),a.drawExternalLabel){const l=a.drawExternalLabel;a.drawExternalLabel=()=>{e.save(),l(),e.restore()}}return a.nodeDimensions&&(this.customSizeWidth=a.nodeDimensions.width,this.customSizeHeight=a.nodeDimensions.height),a}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class rie extends xi{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e,t,r){if(this.needsRefresh(t,r)){const o=this.getDimensionsFromLabel(e,t,r).width+this.margin.right+this.margin.left;this.width=o,this.height=o,this.radius=this.width/2}}draw(e,t,r,n,o,s){this.resize(e,n,o),this.left=t-this.width/2,this.top=r-this.height/2,this.initContextForDraw(e,s),BD(e,t-this.width/2,r-this.height/2,this.width,this.height),this.performFill(e,s),this.updateBoundingBox(t,r,e,n,o),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let iie=class extends Kr{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,o,s){return this._drawShape(e,"diamond",4,t,r,n,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class nie extends Kr{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,o,s){return this._drawShape(e,"circle",2,t,r,n,o,s)}distanceToBorder(e){return e&&this.resize(e),this.options.size}}class fT extends xi{constructor(e,t,r){super(e,t,r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,r)){const n=this.getDimensionsFromLabel(e,t,r);this.height=n.height*2,this.width=n.width+n.height,this.radius=.5*this.width}}draw(e,t,r,n,o,s){this.resize(e,n,o),this.left=t-this.width*.5,this.top=r-this.height*.5,this.initContextForDraw(e,s),fg(e,this.left,this.top,this.width,this.height),this.performFill(e,s),this.updateBoundingBox(t,r,e,n,o),this.labelModule.draw(e,t,r,n,o)}distanceToBorder(e,t){e&&this.resize(e);const r=this.width*.5,n=this.height*.5,o=Math.sin(t)*r,s=Math.cos(t)*n;return r*n/Math.sqrt(o*o+s*s)}}class oie extends xi{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e,t,r){this.needsRefresh(t,r)&&(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,r,n,o,s){return this.resize(e,n,o),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=r-this.height/2,this._icon(e,t,r,n,o,s),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,r+this.height/2+5,n),this.updateBoundingBox(t,r)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.icon.size*.5,this.boundingBox.left=e-this.options.icon.size*.5,this.boundingBox.right=e+this.options.icon.size*.5,this.boundingBox.bottom=t+this.options.icon.size*.5,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,r,n,o,s){const a=Number(this.options.icon.size);this.options.icon.code!==void 0?(e.font=[this.options.icon.weight!=null?this.options.icon.weight:n?"bold":"",(this.options.icon.weight!=null&&n?5:0)+a+"px",this.options.icon.face].join(" "),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,s),e.fillText(this.options.icon.code,t,r),this.disableShadow(e,s)):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 sie=class extends Hy{constructor(e,t,r,n,o){super(e,t,r),this.setImages(n,o)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,r=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=this.options.size*2;this.width=o,this.height=o;return}this.needsRefresh(t,r)&&this._resizeImage()}draw(e,t,r,n,o,s){e.save(),this.switchImages(n),this.resize();let a=t,l=r;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=r,a+=this.width/2,l+=this.height/2):(this.left=t-this.width/2,this.top=r-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){const u=this.options.borderWidth,d=this.options.borderWidthSelected||2*this.options.borderWidth,c=(n?d:u)/this.body.view.scale;e.lineWidth=Math.min(this.width,c),e.beginPath();let h=n?this.options.color.highlight.border:o?this.options.color.hover.border:this.options.color.border,f=n?this.options.color.highlight.background:o?this.options.color.hover.background:this.options.color.background;s.opacity!==void 0&&(h=xt(h,s.opacity),f=xt(f,s.opacity)),e.strokeStyle=h,e.fillStyle=f,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),ns(e).call(e),this.performStroke(e,s),e.closePath()}this._drawImageAtPosition(e,s),this._drawImageLabel(e,a,l,n,o),this.updateBoundingBox(t,r),e.restore()}updateBoundingBox(e,t){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=t):(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,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(e,t){return this._distanceToBorder(e,t)}};class aie extends Kr{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,o,s){return this._drawShape(e,"square",2,t,r,n,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class lie extends Kr{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,o,s){return this._drawShape(e,"hexagon",4,t,r,n,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class uie extends Kr{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,o,s){return this._drawShape(e,"star",4,t,r,n,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class die extends xi{constructor(e,t,r){super(e,t,r),this._setMargins(r)}resize(e,t,r){this.needsRefresh(t,r)&&(this.textSize=this.labelModule.getTextSize(e,t,r),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,r,n,o,s){this.resize(e,n,o),this.left=t-this.width/2,this.top=r-this.height/2,this.enableShadow(e,s),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,o),this.disableShadow(e,s),this.updateBoundingBox(t,r,e,n,o)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let cie=class extends Kr{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,o,s){return this._drawShape(e,"triangle",3,t,r,n,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class hie extends Kr{constructor(e,t,r){super(e,t,r)}draw(e,t,r,n,o,s){return this._drawShape(e,"triangleDown",3,t,r,n,o,s)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}function vT(i,e){var t=Te(i);if(jr){var r=jr(i);e&&(r=gt(r).call(r,function(n){return Gr(i,n).enumerable})),t.push.apply(t,r)}return t}function pT(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?de(t=vT(Object(n),!0)).call(t,function(o){ur(i,o,n[o])}):Lr?ul(i,Lr(n)):de(r=vT(Object(n))).call(r,function(o){dl(i,o,Gr(n,o))})}return i}class be{constructor(e,t,r,n,o,s){this.options=kr(o),this.globalOptions=o,this.defaultOptions=s,this.body=t,this.edges=[],this.id=void 0,this.imagelist=r,this.grouplist=n,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 on(this.body,this.options,!1),this.setOptions(e)}attachEdge(e){var t;le(t=this.edges).call(t,e)===-1&&this.edges.push(e)}detachEdge(e){var t;const r=le(t=this.edges).call(t,e);if(r!=-1){var n;vr(n=this.edges).call(n,r,1)}}setOptions(e){const t=this.options.shape;if(!e)return;if(typeof e.color<"u"&&(this._localColor=e.color),e.id!==void 0&&(this.id=e.id),this.id===void 0)throw new Error("Node must have an id");be.checkMass(e,this.id),e.x!==void 0&&(e.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=Wt(e.x),this.predefinedPosition=!0)),e.y!==void 0&&(e.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=Wt(e.y),this.predefinedPosition=!0)),e.size!==void 0&&(this.baseSize=e.size),e.value!==void 0&&(e.value=JA(e.value)),be.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);const r=[e,this.options,this.defaultOptions];return this.chooser=Wy("node",r),this._load_images(),this.updateLabelModule(e),e.opacity!==void 0&&be.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,r){var n;if(r===void 0)return;const o=e.group;if(t!==void 0&&t.group!==void 0&&o!==t.group)throw new Error("updateGroupOptions: group values in options don't match.");if(!(typeof o=="number"||typeof o=="string"&&o!=""))return;const a=r.get(o);a.opacity!==void 0&&t.opacity===void 0&&(be.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 l=gt(n=_re(t)).call(n,u=>t[u]!=null);l.push("font"),ca(l,e,a),e.color=mg(e.color)}static parseOptions(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0;if(ca(["color","fixed","shadow"],e,t,r),be.checkMass(t),e.opacity!==void 0&&(be.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&&(be.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&&!be.checkCoordinateOrigin(t.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+t.shapeProperties.coordinateOrigin),Rt(e,t,"shadow",n),t.color!==void 0&&t.color!==null){const a=mg(t.color);DA(e.color,a)}else r===!0&&t.color===null&&(e.color=kr(n.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))),r===!0&&t.font===null&&(e.font=kr(n.font)),be.updateGroupOptions(e,t,o),t.scaling!==void 0&&Rt(e.scaling,t.scaling,"label",n.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=xt(e.borderColor,t),e.color=xt(e.color,t),e.shadowColor=xt(e.shadowColor,t)}return e}updateLabelModule(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),be.updateGroupOptions(this.options,pT(pT({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);const t=this.grouplist.get(this.options.group,!1),r=[e,this.options,t,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,r),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 Jre(this.options,this.body,this.labelModule);break;case"circle":this.shape=new Zre(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new Qre(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new tie(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new rie(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new iie(this.options,this.body,this.labelModule);break;case"dot":this.shape=new nie(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new fT(this.options,this.body,this.labelModule);break;case"icon":this.shape=new oie(this.options,this.body,this.labelModule);break;case"image":this.shape=new sie(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new aie(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new lie(this.options,this.body,this.labelModule);break;case"star":this.shape=new uie(this.options,this.body,this.labelModule);break;case"text":this.shape=new die(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new cie(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new hie(this.options,this.body,this.labelModule);break;default:this.shape=new fT(this.options,this.body,this.labelModule);break}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,r){if(this.options.value!==void 0){const n=this.options.scaling.customScalingFunction(e,t,r,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*s}this.options.size=this.options.scaling.min+n*o}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()&&Sg(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),Sg(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 r="";t!==void 0&&(r=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+r+", setting mass to 1.",kA),e.mass=1}}}class fie{constructor(e,t,r,n){var o;if(this.body=e,this.images=t,this.groups=r,this.layoutEngine=n,this.body.functions.createNode=A(o=this.create).call(o,this),this.nodesListeners={add:(s,a)=>{this.add(a.items)},update:(s,a)=>{this.update(a.items,a.data,a.oldData)},remove:(s,a)=>{this.remove(a.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(s,a,l,u){if(a===s)return .5;{const d=1/(a-s);return Math.max(0,(u-s)*d)}}},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=kr(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,t;this.body.emitter.on("refreshNodes",A(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",A(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{Z(this.nodesListeners,(r,n)=>{this.body.data.nodes&&this.body.data.nodes.off(n,r)}),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(be.parseOptions(this.options,e),e.opacity!==void 0&&(Eg(e.opacity)||!ri(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(typeof e.font<"u"||typeof e.widthConstraint<"u"||typeof e.heightConstraint<"u")for(const t of Te(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]:!1;const r=this.body.data.nodes;if(RD("id",e))this.body.data.nodes=e;else if(Pe(e))this.body.data.nodes=new sa,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new sa;else throw new TypeError("Array or DataSet expected");if(r&&Z(this.nodesListeners,function(n,o){r.off(o,n)}),this.body.nodes={},this.body.data.nodes){const n=this;Z(this.nodesListeners,function(s,a){n.body.data.nodes.on(a,s)});const o=this.body.data.nodes.getIds();this.add(o,!0)}t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r;const n=[];for(let o=0;o<e.length;o++){r=e[o];const s=this.body.data.nodes.get(r),a=this.create(s);n.push(a),this.body.nodes[r]=a}this.layoutEngine.positionInitially(n),t===!1&&this.body.emitter.emit("_dataChanged")}update(e,t,r){const n=this.body.nodes;let o=!1;for(let s=0;s<e.length;s++){const a=e[s];let l=n[a];const u=t[s];l!==void 0?l.setOptions(u)&&(o=!0):(o=!0,l=this.create(u),n[a]=l)}!o&&r!==void 0&&(o=Ete(t).call(t,function(s,a){const l=r[a];return l&&l.level!==s.level})),o===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}remove(e){const t=this.body.nodes;for(let r=0;r<e.length;r++){const n=e[r];delete t[n]}this.body.emitter.emit("_dataChanged")}create(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:be;return new t(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Z(this.body.nodes,(t,r)=>{const n=this.body.data.nodes.get(r);n!==void 0&&(e===!0&&t.setOptions({x:null,y:null}),t.setOptions({fixed:!1}),t.setOptions(n))})}getPositions(e){const t={};if(e!==void 0){if(Pe(e)===!0){for(let r=0;r<e.length;r++)if(this.body.nodes[e[r]]!==void 0){const n=this.body.nodes[e[r]];t[e[r]]={x:Math.round(n.x),y:Math.round(n.y)}}}else if(this.body.nodes[e]!==void 0){const r=this.body.nodes[e];t[e]={x:Math.round(r.x),y:Math.round(r.y)}}}else for(let r=0;r<this.body.nodeIndices.length;r++){const n=this.body.nodes[this.body.nodeIndices[r]];t[this.body.nodeIndices[r]]={x:Math.round(n.x),y:Math.round(n.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 r of t.get()){const n=r.id,o=this.body.nodes[n],s=Math.round(o.x),a=Math.round(o.y);(r.x!==s||r.y!==a)&&e.push({id:n,x:s,y:a})}t.update(e)}getBoundingBox(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}getConnectedNodes(e,t){const r=[];if(this.body.nodes[e]!==void 0){const n=this.body.nodes[e],o={};for(let s=0;s<n.edges.length;s++){const a=n.edges[s];t!=="to"&&a.toId==n.id?o[a.fromId]===void 0&&(r.push(a.fromId),o[a.fromId]=!0):t!=="from"&&a.fromId==n.id&&o[a.toId]===void 0&&(r.push(a.toId),o[a.toId]=!0)}}return r}getConnectedEdges(e){const t=[];if(this.body.nodes[e]!==void 0){const r=this.body.nodes[e];for(let n=0;n<r.edges.length;n++)t.push(r.edges[n].id)}else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return t}moveNode(e,t,r){this.body.nodes[e]!==void 0?(this.body.nodes[e].x=Number(t),this.body.nodes[e].y=Number(r),pr(()=>{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}}var gT={},yT;function vie(){if(yT)return gT;yT=1;var i=z(),e=Math.hypot,t=Math.abs,r=Math.sqrt,n=!!e&&e(1/0,NaN)!==1/0;return i({target:"Math",stat:!0,arity:2,forced:n},{hypot:function(s,a){for(var l=0,u=0,d=arguments.length,c=0,h,f;u<d;)h=t(arguments[u++]),c<h?(f=c/h,l=l*f*f+1,c=h):h>0?(f=h/c,l+=f*f):l+=h;return c===1/0?1/0:c*r(l)}}),gT}var Fv,mT;function pie(){if(mT)return Fv;mT=1,vie();var i=ue();return Fv=i.Math.hypot,Fv}var qv,bT;function gie(){if(bT)return qv;bT=1;var i=pie();return qv=i,qv}var Bv,wT;function yie(){return wT||(wT=1,Bv=gie()),Bv}var mie=yie(),bie=Y(mie);class xe{static transform(e,t){Pe(e)||(e=[e]);const r=t.point.x,n=t.point.y,o=t.angle,s=t.length;for(let a=0;a<e.length;++a){const l=e[a],u=l.x*Math.cos(o)-l.y*Math.sin(o),d=l.x*Math.sin(o)+l.y*Math.cos(o);l.x=r+s*u,l.y=n+s*d}}static drawPath(e,t){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(let r=1;r<t.length;++r)e.lineTo(t[r].x,t[r].y);e.closePath()}}let wie=class extends xe{static draw(e,t){if(t.image){e.save(),e.translate(t.point.x,t.point.y),e.rotate(Math.PI/2+t.angle);const r=t.imageWidth!=null?t.imageWidth:t.image.width,n=t.imageHeight!=null?t.imageHeight:t.image.height;t.image.drawImageAtPosition(e,1,-r/2,0,r,n),e.restore()}return!1}};class _ie extends xe{static draw(e,t){const r=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return xe.transform(r,t),xe.drawPath(e,r),!0}}class Eie{static draw(e,t){const r=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return xe.transform(r,t),xe.drawPath(e,r),!0}}class Sie{static draw(e,t){const r={x:-.4,y:0};xe.transform(r,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";const n=Math.PI,o=t.angle-n/2,s=t.angle+n/2;return e.beginPath(),e.arc(r.x,r.y,t.length*.4,o,s,!1),e.stroke(),!0}}class $ie{static draw(e,t){const r={x:-.3,y:0};xe.transform(r,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";const n=Math.PI,o=t.angle+n/2,s=t.angle+3*n/2;return e.beginPath(),e.arc(r.x,r.y,t.length*.4,o,s,!1),e.stroke(),!0}}class Oie{static draw(e,t){const r=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return xe.transform(r,t),xe.drawPath(e,r),!0}}class Iie{static draw(e,t){const r=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return xe.transform(r,t),xe.drawPath(e,r),!0}}class Tie{static draw(e,t){const r={x:-.4,y:0};return xe.transform(r,t),yy(e,r.x,r.y,t.length*.4),!0}}class Pie{static draw(e,t){const r=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return xe.transform(r,t),xe.drawPath(e,r),!0}}class Cie{static draw(e,t){const r=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return xe.transform(r,t),xe.drawPath(e,r),!0}}class Rie{static draw(e,t){const r=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return xe.transform(r,t),xe.drawPath(e,r),!0}}class xie{static draw(e,t){const r=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return xe.transform(r,t),xe.drawPath(e,r),!0}}class eM{static draw(e,t){let r;switch(t.type&&(r=t.type.toLowerCase()),r){case"image":return wie.draw(e,t);case"circle":return Tie.draw(e,t);case"box":return Cie.draw(e,t);case"crow":return Eie.draw(e,t);case"curve":return Sie.draw(e,t);case"diamond":return Rie.draw(e,t);case"inv_curve":return $ie.draw(e,t);case"triangle":return Oie.draw(e,t);case"inv_triangle":return Iie.draw(e,t);case"bar":return Pie.draw(e,t);case"vee":return xie.draw(e,t);case"arrow":default:return _ie.draw(e,t)}}}function _T(i,e){var t=Te(i);if(jr){var r=jr(i);e&&(r=gt(r).call(r,function(n){return Gr(i,n).enumerable})),t.push.apply(t,r)}return t}function ET(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?de(t=_T(Object(n),!0)).call(t,function(o){ur(i,o,n[o])}):Lr?ul(i,Lr(n)):de(r=_T(Object(n))).call(r,function(o){dl(i,o,Gr(n,o))})}return i}class tM{constructor(e,t,r){ur(this,"color",{}),ur(this,"colorDirty",!0),ur(this,"hoverWidth",1.5),ur(this,"selectionWidth",2),this._body=t,this._labelModule=r,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,r,n){let o=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,o):this._drawLine(e,t,o)}_drawLine(e,t,r,n,o){if(this.from!=this.to)this._line(e,t,r,n,o);else{const[s,a,l]=this._getCircleData(e);this._circle(e,t,s,a,l)}}_drawDashedLine(e,t,r,n,o){e.lineCap="round";const s=Pe(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(s),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,r);else{const[a,l,u]=this._getCircleData(e);this._circle(e,t,a,l,u)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)jD(e,this.from.x,this.from.y,this.to.x,this.to.y,s);else{const[a,l,u]=this._getCircleData(e);this._circle(e,t,a,l,u)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}findBorderPosition(e,t,r){return this.from!=this.to?this._findBorderPosition(e,t,r):this._findBorderPositionCircle(e,t,r)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var t;const[r,n]=Jt(t=this._getCircleData(e)).call(t,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:r,y:n,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:r,y:n,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 r=ZA(e,this.options.selfReference.angle,t,this.from);return[r.x,r.y,t]}_pointOnCircle(e,t,r,n){const o=n*2*Math.PI;return{x:e+r*Math.cos(o),y:t-r*Math.sin(o)}}_findBorderPositionCircle(e,t,r){const n=r.x,o=r.y;let s=r.low,a=r.high;const l=r.direction,u=10,d=this.options.selfReference.size,c=.05;let h,f=(s+a)*.5,v=0;this.options.arrowStrikethrough===!0&&(l===-1?v=this.options.endPointOffset.from:l===1&&(v=this.options.endPointOffset.to));let g=0;do{f=(s+a)*.5,h=this._pointOnCircle(n,o,d,f);const y=Math.atan2(e.y-h.y,e.x-h.x),p=e.distanceToBorder(t,y)+v,m=Math.sqrt(Math.pow(h.x-e.x,2)+Math.pow(h.y-e.y,2)),w=p-m;if(Math.abs(w)<c)break;w>0?l>0?s=f:a=f:l>0?a=f:s=f,++g}while(s<=a&&g<u);return ET(ET({},h),{},{t:f})}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 r=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y);let n=this.from.options.color.highlight.border,o=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(n=xt(this.from.options.color.border,t.opacity),o=xt(this.to.options.color.border,t.opacity)):this.from.selected===!0&&this.to.selected===!1?o=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(n=this.from.options.color.border),r.addColorStop(0,n),r.addColorStop(1,o),r}return t.inheritsColor==="to"?xt(this.to.options.color.border,t.opacity):xt(this.from.options.color.border,t.opacity)}else return xt(t.color,t.opacity)}_circle(e,t,r,n,o){this.enableShadow(e,t);let s=0,a=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){const l=this.options.selfReference.angle,u=this.options.selfReference.angle+Math.PI,d=this._findBorderPositionCircle(this.from,e,{x:r,y:n,low:l,high:u,direction:-1}),c=this._findBorderPositionCircle(this.from,e,{x:r,y:n,low:l,high:u,direction:1});s=Math.atan2(d.y-n,d.x-r),a=Math.atan2(c.y-n,c.x-r)}e.beginPath(),e.arc(r,n,o,s,a,!1),e.stroke(),this.disableShadow(e,t)}getDistanceToEdge(e,t,r,n,o,s){if(this.from!=this.to)return this._getDistanceToEdge(e,t,r,n,o,s);{const[a,l,u]=this._getCircleData(void 0),d=a-o,c=l-s;return Math.abs(Math.sqrt(d*d+c*c)-u)}}_getDistanceToLine(e,t,r,n,o,s){const a=r-e,l=n-t,u=a*a+l*l;let d=((o-e)*a+(s-t)*l)/u;d>1?d=1:d<0&&(d=0);const c=e+d*a,h=t+d*l,f=c-o,v=h-s;return Math.sqrt(f*f+v*v)}getArrowData(e,t,r,n,o,s){let a,l,u,d,c,h,f;const v=s.width;t==="from"?(u=this.from,d=this.to,c=s.fromArrowScale<0,h=Math.abs(s.fromArrowScale),f=s.fromArrowType):t==="to"?(u=this.to,d=this.from,c=s.toArrowScale<0,h=Math.abs(s.toArrowScale),f=s.toArrowType):(u=this.to,d=this.from,c=s.middleArrowScale<0,h=Math.abs(s.middleArrowScale),f=s.middleArrowType);const g=15*h+3*v;if(u!=d){const w=bie(u.x-d.x,u.y-d.y),b=g/w;if(t!=="middle")if(this.options.smooth.enabled===!0){const _=this._findBorderPosition(u,e,{via:r}),S=this.getPoint(_.t+b*(t==="from"?1:-1),r);a=Math.atan2(_.y-S.y,_.x-S.x),l=_}else a=Math.atan2(u.y-d.y,u.x-d.x),l=this._findBorderPosition(u,e);else{const _=(c?-b:b)/2,S=this.getPoint(.5+_,r),I=this.getPoint(.5-_,r);a=Math.atan2(S.y-I.y,S.x-I.x),l=this.getPoint(.5,r)}}else{const[w,b,_]=this._getCircleData(e);if(t==="from"){const S=this.options.selfReference.angle,I=this.options.selfReference.angle+Math.PI,E=this._findBorderPositionCircle(this.from,e,{x:w,y:b,low:S,high:I,direction:-1});a=E.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,l=E}else if(t==="to"){const S=this.options.selfReference.angle,I=this.options.selfReference.angle+Math.PI,E=this._findBorderPositionCircle(this.from,e,{x:w,y:b,low:S,high:I,direction:1});a=E.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,l=E}else{const S=this.options.selfReference.angle/(2*Math.PI);l=this._pointOnCircle(w,b,_,S),a=S*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}const y=l.x-g*.9*Math.cos(a),p=l.y-g*.9*Math.sin(a);return{point:l,core:{x:y,y:p},angle:a,length:g,type:f}}drawArrowHead(e,t,r,n,o){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,eM.draw(e,o)&&(this.enableShadow(e,t),ns(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 r={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=r.strokeStyle,e.lineWidth=r.lineWidth,e.dashes=r.dashes,this.setStrokeDashed(e,t.dashes)}}setStrokeDashed(e,t){if(t!==!1)if(e.setLineDash!==void 0){const r=Pe(t)?t:[5,5];e.setLineDash(r)}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 ST(i,e){var t=Te(i);if(jr){var r=jr(i);e&&(r=gt(r).call(r,function(n){return Gr(i,n).enumerable})),t.push.apply(t,r)}return t}function $T(i){for(var e=1;e<arguments.length;e++){var t,r,n=arguments[e]!=null?arguments[e]:{};e%2?de(t=ST(Object(n),!0)).call(t,function(o){ur(i,o,n[o])}):Lr?ul(i,Lr(n)):de(r=ST(Object(n))).call(r,function(o){dl(i,o,Gr(n,o))})}return i}class Uy extends tM{constructor(e,t,r){super(e,t,r)}_findBorderPositionBezier(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates();const n=10,o=.2;let s=!1,a=1,l=0,u=this.to,d,c,h=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(u=this.from,s=!0,h=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(h=0);let f=0;do{c=(l+a)*.5,d=this.getPoint(c,r);const v=Math.atan2(u.y-d.y,u.x-d.x),g=u.distanceToBorder(t,v)+h,y=Math.sqrt(Math.pow(d.x-u.x,2)+Math.pow(d.y-u.y,2)),p=g-y;if(Math.abs(p)<o)break;p<0?s===!1?l=c:a=c:s===!1?a=c:l=c,++f}while(l<=a&&f<n);return $T($T({},d),{},{t:c})}_getDistanceToBezierEdge(e,t,r,n,o,s,a){let l=1e9,u,d,c,h,f,v=e,g=t;for(d=1;d<10;d++)c=.1*d,h=Math.pow(1-c,2)*e+2*c*(1-c)*a.x+Math.pow(c,2)*r,f=Math.pow(1-c,2)*t+2*c*(1-c)*a.y+Math.pow(c,2)*n,d>0&&(u=this._getDistanceToLine(v,g,h,f,o,s),l=u<l?u:l),v=h,g=f;return l}_bezierCurve(e,t,r,n){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),r!=null&&r.x!=null?n!=null&&n.x!=null?e.bezierCurveTo(r.x,r.y,n.x,n.y,this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(r.x,r.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 OT extends Uy{constructor(e,t,r){super(e,t,r),ur(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.via.setOptions({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):!1}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,r){this._bezierCurve(e,t,r)}_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[r,n,o]=this._getCircleData(),s=2*Math.PI*(1-e);return{x:r+o*Math.sin(s),y:n+o-o*(1-Math.cos(s))}}else 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,r,n,o,s){return this._getDistanceToBezierEdge(e,t,r,n,o,s,this.via)}}class IT extends Uy{constructor(e,t,r){super(e,t,r)}_line(e,t,r){this._bezierCurve(e,t,r)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){const e=this.options.smooth.roundness,t=this.options.smooth.type;let r=Math.abs(this.from.x-this.to.x),n=Math.abs(this.from.y-this.to.y);if(t==="discrete"||t==="diagonalCross"){let o,s;r<=n?o=s=e*n:o=s=e*r,this.from.x>this.to.x&&(o=-o),this.from.y>=this.to.y&&(s=-s);let a=this.from.x+o,l=this.from.y+s;return t==="discrete"&&(r<=n?a=r<e*n?this.from.x:a:l=n<e*r?this.from.y:l),{x:a,y:l}}else if(t==="straightCross"){let o=(1-e)*r,s=(1-e)*n;return r<=n?(o=0,this.from.y<this.to.y&&(s=-s)):(this.from.x<this.to.x&&(o=-o),s=0),{x:this.to.x+o,y:this.to.y+s}}else if(t==="horizontal"){let o=(1-e)*r;return this.from.x<this.to.x&&(o=-o),{x:this.to.x+o,y:this.from.y}}else if(t==="vertical"){let o=(1-e)*n;return this.from.y<this.to.y&&(o=-o),{x:this.from.x,y:this.to.y+o}}else if(t==="curvedCW"){r=this.to.x-this.from.x,n=this.from.y-this.to.y;const o=Math.sqrt(r*r+n*n),s=Math.PI,l=(Math.atan2(n,r)+(e*.5+.5)*s)%(2*s);return{x:this.from.x+(e*.5+.5)*o*Math.sin(l),y:this.from.y+(e*.5+.5)*o*Math.cos(l)}}else if(t==="curvedCCW"){r=this.to.x-this.from.x,n=this.from.y-this.to.y;const o=Math.sqrt(r*r+n*n),s=Math.PI,l=(Math.atan2(n,r)+(-e*.5+.5)*s)%(2*s);return{x:this.from.x+(e*.5+.5)*o*Math.sin(l),y:this.from.y+(e*.5+.5)*o*Math.cos(l)}}else{let o,s;r<=n?o=s=e*n:o=s=e*r,this.from.x>this.to.x&&(o=-o),this.from.y>=this.to.y&&(s=-s);let a=this.from.x+o,l=this.from.y+s;return r<=n?this.from.x<=this.to.x?a=this.to.x<a?this.to.x:a:a=this.to.x>a?this.to.x:a:this.from.y>=this.to.y?l=this.to.y>l?this.to.y:l:l=this.to.y<l?this.to.y:l,{x:a,y:l}}}_findBorderPosition(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,t,r.via)}_getDistanceToEdge(e,t,r,n,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,r,n,o,s,a)}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const r=e,n=Math.pow(1-r,2)*this.fromPoint.x+2*r*(1-r)*t.x+Math.pow(r,2)*this.toPoint.x,o=Math.pow(1-r,2)*this.fromPoint.y+2*r*(1-r)*t.y+Math.pow(r,2)*this.toPoint.y;return{x:n,y:o}}}class Die extends Uy{constructor(e,t,r){super(e,t,r)}_getDistanceToBezierEdge2(e,t,r,n,o,s,a,l){let u=1e9,d=e,c=t;const h=[0,0,0,0];for(let f=1;f<10;f++){const v=.1*f;h[0]=Math.pow(1-v,3),h[1]=3*v*Math.pow(1-v,2),h[2]=3*Math.pow(v,2)*(1-v),h[3]=Math.pow(v,3);const g=h[0]*e+h[1]*a.x+h[2]*l.x+h[3]*r,y=h[0]*t+h[1]*a.y+h[2]*l.y+h[3]*n;if(f>0){const p=this._getDistanceToLine(d,c,g,y,o,s);u=p<u?p:u}d=g,c=y}return u}}class TT extends Die{constructor(e,t,r){super(e,t,r)}_line(e,t,r){const n=r[0],o=r[1];this._bezierCurve(e,t,n,o)}_getViaCoordinates(){const e=this.from.x-this.to.x,t=this.from.y-this.to.y;let r,n,o,s;const a=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"?(n=this.from.y,s=this.to.y,r=this.from.x-a*e,o=this.to.x+a*e):(n=this.from.y-a*t,s=this.to.y+a*t,r=this.from.x,o=this.to.x),[{x:r,y:n},{x:o,y:s}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t)}_getDistanceToEdge(e,t,r,n,o,s){let[a,l]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,t,r,n,o,s,a,l)}getPoint(e){let[t,r]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const n=e,o=[Math.pow(1-n,3),3*n*Math.pow(1-n,2),3*Math.pow(n,2)*(1-n),Math.pow(n,3)],s=o[0]*this.fromPoint.x+o[1]*t.x+o[2]*r.x+o[3]*this.toPoint.x,a=o[0]*this.fromPoint.y+o[1]*t.y+o[2]*r.y+o[3]*this.toPoint.y;return{x:s,y:a}}}class PT extends tM{constructor(e,t,r){super(e,t,r)}_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 r=this.to,n=this.from;e.id===this.from.id&&(r=this.from,n=this.to);const o=Math.atan2(r.y-n.y,r.x-n.x),s=r.x-n.x,a=r.y-n.y,l=Math.sqrt(s*s+a*a),u=e.distanceToBorder(t,o),d=(l-u)/l;return{x:(1-d)*n.x+d*r.x,y:(1-d)*n.y+d*r.y,t:0}}_getDistanceToEdge(e,t,r,n,o,s){return this._getDistanceToLine(e,t,r,n,o,s)}}class Fr{constructor(e,t,r,n,o){if(t===void 0)throw new Error("No body provided");this.options=kr(n),this.globalOptions=n,this.defaultOptions=o,this.body=t,this.imagelist=r,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 on(this.body,this.options,!0),this.setOptions(e)}setOptions(e){if(!e)return;let t=typeof e.physics<"u"&&this.options.physics!==e.physics||typeof e.hidden<"u"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from<"u"&&this.options.from!==e.from||typeof e.to<"u"&&this.options.to!==e.to;Fr.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=JA(e.value));const r=[e,this.options,this.defaultOptions];return this.chooser=Wy("edge",r),this.updateLabelModule(e),t=this.updateEdgeType()||t,this._setInteractionWidths(),this.connect(),t}static parseOptions(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Kn(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],e,t,r),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(ri(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=n.endPointOffset.from!==void 0?n.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(ri(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=n.endPointOffset.to!==void 0?n.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),fa(t.label)?e.label=t.label:fa(e.label)||(e.label=void 0),Rt(e,t,"smooth",n),Rt(e,t,"shadow",n),Rt(e,t,"background",n),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:r===!0&&t.dashes===null&&(e.dashes=li(n.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),Rt(e.scaling,t.scaling,"label",n.scaling)):r===!0&&t.scaling===null&&(e.scaling=li(n.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows=="string"){const a=t.arrows.toLowerCase();e.arrows.to.enabled=le(a).call(a,"to")!=-1,e.arrows.middle.enabled=le(a).call(a,"middle")!=-1,e.arrows.from.enabled=le(a).call(a,"from")!=-1}else if(typeof t.arrows=="object")Rt(e.arrows,t.arrows,"to",n.arrows),Rt(e.arrows,t.arrows,"middle",n.arrows),Rt(e.arrows,t.arrows,"from",n.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+is(t.arrows));else r===!0&&t.arrows===null&&(e.arrows=li(n.arrows));if(t.color!==void 0&&t.color!==null){const a=rn(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,l=e.color;if(o)fe(l,n.color,!1,r);else for(const u in l)Object.prototype.hasOwnProperty.call(l,u)&&delete l[u];if(rn(l))l.color=l,l.highlight=l,l.hover=l,l.inherit=!1,a.opacity===void 0&&(l.opacity=1);else{let u=!1;a.color!==void 0&&(l.color=a.color,u=!0),a.highlight!==void 0&&(l.highlight=a.highlight,u=!0),a.hover!==void 0&&(l.hover=a.hover,u=!0),a.inherit!==void 0&&(l.inherit=a.inherit),a.opacity!==void 0&&(l.opacity=Math.min(1,Math.max(0,a.opacity))),u===!0?l.inherit=!1:l.inherit===void 0&&(l.inherit="from")}}else r===!0&&t.color===null&&(e.color=kr(n.color));r===!0&&t.font===null&&(e.font=kr(n.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,r=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,n=this.options.color.inherit,o={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:r,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:n?void 0:this.options.color.color,inheritsColor:n,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 s=this.options.selectionWidth;typeof s=="function"?o.width=s(o.width):typeof s=="number"&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.highlight,o.shadow=this.options.shadow.enabled}else if(this.hover){const s=this.options.hoverWidth;typeof s=="function"?o.width=s(o.width):typeof s=="number"&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.hover,o.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(o,this.options.id,this.selected,this.hover),o.color!==void 0&&(o.inheritsColor=!1),o.shadow===!1&&(o.shadowColor!==this.options.shadow.color||o.shadowSize!==this.options.shadow.size||o.shadowX!==this.options.shadow.x||o.shadowY!==this.options.shadow.y)&&(o.shadow=!0));else o.shadow=this.options.shadow.enabled,o.width=Math.max(o.width,.3/this.body.view.scale);return o}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,r=!0;return this.edgeType!==void 0&&((this.edgeType instanceof OT&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof TT&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof IT&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof PT&&e.type.enabled===!1)&&(r=!1),r===!0&&(t=this.cleanup())),r===!0?e.enabled===!0?e.type==="dynamic"?(t=!0,this.edgeType=new OT(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new TT(this.options,this.body,this.labelModule):this.edgeType=new IT(this.options,this.body,this.labelModule):this.edgeType=new PT(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,r){if(this.options.value!==void 0){const n=this.options.scaling.customScalingFunction(e,t,r,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*s}this.options.width=this.options.scaling.min+n*o}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 r=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,r),this.drawLabel(e,r)}drawArrows(e){const t=this.getFormattingValues();if(t.hidden)return;const r=this.edgeType.getViaNode(),n={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(n.from=this.edgeType.getArrowData(e,"from",r,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.fromPoint=n.from.core),t.fromArrowSrc&&(n.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(n.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(n.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(n.to=this.edgeType.getArrowData(e,"to",r,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.toPoint=n.to.core),t.toArrowSrc&&(n.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(n.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(n.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(n.middle=this.edgeType.getArrowData(e,"middle",r,this.selected,this.hover,t),t.middleArrowSrc&&(n.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(n.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(n.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,n.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,n.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,n.to)}drawLabel(e,t){if(this.options.label!==void 0){const r=this.from,n=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let o;if(r.id!=n.id){this.labelModule.pointToSelf=!1,o=this.edgeType.getPoint(.5,t),e.save();const s=this._getRotation(e);s.angle!=0&&(e.translate(s.x,s.y),e.rotate(s.angle)),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;const s=ZA(e,this.options.selfReference.angle,this.options.selfReference.size,r);o=this._pointOnCircle(s.x,s.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover)}}}getItemsOnPoint(e){const t=[];if(this.labelModule.visible()){const n=this._getRotation();Sg(this.labelModule.getSize(),e,n)&&t.push({edgeId:this.id,labelId:0})}const r={left:e.x,top:e.y};return this.isOverlappingWith(r)&&t.push({edgeId:this.id}),t}isOverlappingWith(e){if(this.connected){const r=this.from.x,n=this.from.y,o=this.to.x,s=this.to.y,a=e.left,l=e.top;return this.edgeType.getDistanceToEdge(r,n,o,s,a,l)<10}else return!1}_getRotation(e){const t=this.edgeType.getViaNode(),r=this.edgeType.getPoint(.5,t);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,r.x,r.y);const n={x:r.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return n;const o=this.from.y-this.to.y,s=this.from.x-this.to.x;let a=Math.atan2(o,s);return(a<-1&&s<0||a>0&&s<0)&&(a+=Math.PI),n.angle=a,n}_pointOnCircle(e,t,r,n){return{x:e+r*Math.cos(n),y:t-r*Math.sin(n)}}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 Aie{constructor(e,t,r){var n;this.body=e,this.images=t,this.groups=r,this.body.functions.createEdge=A(n=this.create).call(n,this),this.edgesListeners={add:(o,s)=>{this.add(s.items)},update:(o,s)=>{this.update(s.items)},remove:(o,s)=>{this.remove(s.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(o,s,a,l){if(s===o)return .5;{const u=1/(s-o);return Math.max(0,(l-o)*u)}}},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},fe(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,t,r;this.body.emitter.on("_forceDisableDynamicCurves",function(n){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;n==="dynamic"&&(n="continuous");let s=!1;for(const a in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,a)){const l=e.body.edges[a],u=e.body.data.edges.get(a);if(u!=null){const d=u.smooth;d!==void 0&&d.enabled===!0&&d.type==="dynamic"&&(n===void 0?l.setOptions({smooth:!1}):l.setOptions({smooth:{type:n}}),s=!0)}}o===!0&&s===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",A(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",A(r=this.refresh).call(r,this)),this.body.emitter.on("destroy",()=>{Z(this.edgesListeners,(n,o)=>{this.body.data.edges&&this.body.data.edges.off(o,n)}),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){Fr.parseOptions(this.options,e,!0,this.defaultOptions,!0);let t=!1;if(e.smooth!==void 0)for(const r in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,r)&&(t=this.body.edges[r].updateEdgeType()||t);if(e.font!==void 0)for(const r in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,r)&&this.body.edges[r].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]:!1;const r=this.body.data.edges;if(RD("id",e))this.body.data.edges=e;else if(Pe(e))this.body.data.edges=new sa,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new sa;else throw new TypeError("Array or DataSet expected");if(r&&Z(this.edgesListeners,(n,o)=>{r.off(o,n)}),this.body.edges={},this.body.data.edges){Z(this.edgesListeners,(o,s)=>{this.body.data.edges.on(s,o)});const n=this.body.data.edges.getIds();this.add(n,!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]:!1;const r=this.body.edges,n=this.body.data.edges;for(let o=0;o<e.length;o++){const s=e[o],a=r[s];a&&a.disconnect();const l=n.get(s,{showInternalIds:!0});r[s]=this.create(l)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}update(e){const t=this.body.edges,r=this.body.data.edges;let n=!1;for(let o=0;o<e.length;o++){const s=e[o],a=r.get(s),l=t[s];l!==void 0?(l.disconnect(),n=l.setOptions(a)||n,l.connect()):(this.body.edges[s]=this.create(a),n=!0)}n===!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]:!0;if(e.length===0)return;const r=this.body.edges;Z(e,n=>{const o=r[n];o!==void 0&&o.remove()}),t&&this.body.emitter.emit("_dataChanged")}refresh(){Z(this.body.edges,(e,t)=>{const r=this.body.data.edges.get(t);r!==void 0&&e.setOptions(r)})}create(e){return new Fr(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e;const t=this.body.nodes,r=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const n=r[e];n.from=null,n.to=null,n.connect()}}getConnectedNodes(e){const t=[];if(this.body.edges[e]!==void 0){const r=this.body.edges[e];r.fromId!==void 0&&t.push(r.fromId),r.toId!==void 0&&t.push(r.toId)}return t}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){const e=[];Z(this.body.edges,(t,r)=>{const n=this.body.nodes[t.toId],o=this.body.nodes[t.fromId];n!==void 0&&n.isCluster===!0||o!==void 0&&o.isCluster===!0||(n===void 0||o===void 0)&&e.push(r)}),this.remove(e,!1)}_addMissingEdges(){const e=this.body.data.edges;if(e==null)return;const t=this.body.edges,r=[];de(e).call(e,(n,o)=>{t[o]===void 0&&r.push(o)}),this.add(r,!0)}}class rM{constructor(e,t,r){this.body=e,this.physicsBody=t,this.barnesHutTree,this.setOptions(r),this._rng=sl("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,r=this.physicsBody.physicsNodeIndices,n=r.length,o=this._formBarnesHutTree(t,r);this.barnesHutTree=o;for(let s=0;s<n;s++)e=t[r[s]],e.options.mass>0&&this._getForceContributions(o.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 r=e.centerOfMass.x-t.x,n=e.centerOfMass.y-t.y,o=Math.sqrt(r*r+n*n);o*e.calcSize>this.thetaInversed?this._calculateForces(o,r,n,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(o,r,n,t,e)}}_calculateForces(e,t,r,n,o){e===0&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&n.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*n.shape.radius,e-n.shape.radius));const s=this.options.gravitationalConstant*o.mass*n.options.mass/Math.pow(e,3),a=t*s,l=r*s;this.physicsBody.forces[n.id].x+=a,this.physicsBody.forces[n.id].y+=l}_formBarnesHutTree(e,t){let r;const n=t.length;let o=e[t[0]].x,s=e[t[0]].y,a=e[t[0]].x,l=e[t[0]].y;for(let y=1;y<n;y++){const p=e[t[y]],m=p.x,w=p.y;p.options.mass>0&&(m<o&&(o=m),m>a&&(a=m),w<s&&(s=w),w>l&&(l=w))}const u=Math.abs(a-o)-Math.abs(l-s);u>0?(s-=.5*u,l+=.5*u):(o+=.5*u,a-=.5*u);const c=Math.max(1e-5,Math.abs(a-o)),h=.5*c,f=.5*(o+a),v=.5*(s+l),g={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:f-h,maxX:f+h,minY:v-h,maxY:v+h},size:c,calcSize:1/c,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(g.root);for(let y=0;y<n;y++)r=e[t[y]],r.options.mass>0&&this._placeInTree(g.root,r);return g}_updateBranchMass(e,t){const r=e.centerOfMass,n=e.mass+t.options.mass,o=1/n;r.x=r.x*e.mass+t.x*t.options.mass,r.x*=o,r.y=r.y*e.mass+t.y*t.options.mass,r.y*=o,e.mass=n;const s=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<s?s:e.maxWidth}_placeInTree(e,t,r){(r!=!0||r===void 0)&&this._updateBranchMass(e,t);const n=e.children.NW.range;let o;n.maxX>t.x?n.maxY>t.y?o="NW":o="SW":n.maxY>t.y?o="NE":o="SE",this._placeInRegion(e,t,o)}_placeInRegion(e,t,r){const n=e.children[r];switch(n.childrenCount){case 0:n.children.data=t,n.childrenCount=1,this._updateBranchMass(n,t);break;case 1:n.children.data.x===t.x&&n.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(n),this._placeInTree(n,t));break;case 4:this._placeInTree(n,t);break}}_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 r,n,o,s;const a=.5*e.size;switch(t){case"NW":r=e.range.minX,n=e.range.minX+a,o=e.range.minY,s=e.range.minY+a;break;case"NE":r=e.range.minX+a,n=e.range.maxX,o=e.range.minY,s=e.range.minY+a;break;case"SW":r=e.range.minX,n=e.range.minX+a,o=e.range.minY+a,s=e.range.maxY;break;case"SE":r=e.range.minX+a,n=e.range.maxX,o=e.range.minY+a,s=e.range.maxY;break}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:r,maxX:n,minY:o,maxY:s},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,r){r===void 0&&(r="#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=r,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 Mie{constructor(e,t,r){this._rng=sl("REPULSION SOLVER"),this.body=e,this.physicsBody=t,this.setOptions(r)}setOptions(e){this.options=e}solve(){let e,t,r,n,o,s,a,l;const u=this.body.nodes,d=this.physicsBody.physicsNodeIndices,c=this.physicsBody.forces,h=this.options.nodeDistance,f=-2/3/h,v=4/3;for(let g=0;g<d.length-1;g++){a=u[d[g]];for(let y=g+1;y<d.length;y++)l=u[d[y]],e=l.x-a.x,t=l.y-a.y,r=Math.sqrt(e*e+t*t),r===0&&(r=.1*this._rng(),e=r),r<2*h&&(r<.5*h?s=1:s=f*r+v,s=s/r,n=e*s,o=t*s,c[a.id].x-=n,c[a.id].y-=o,c[l.id].x+=n,c[l.id].y+=o)}}}class Nie{constructor(e,t,r){this.body=e,this.physicsBody=t,this.setOptions(r)}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,r=this.physicsBody.forces,n=this.options.nodeDistance;for(let o=0;o<t.length-1;o++){const s=e[t[o]];for(let a=o+1;a<t.length;a++){const l=e[t[a]];if(s.level===l.level){const u=n+this.overlapAvoidanceFactor*((s.shape.radius||0)/2+(l.shape.radius||0)/2),d=l.x-s.x,c=l.y-s.y,h=Math.sqrt(d*d+c*c),f=.05;let v;h<u?v=-Math.pow(f*h,2)+Math.pow(f*u,2):v=0,h!==0&&(v=v/h);const g=d*v,y=c*v;r[s.id].x-=g,r[s.id].y-=y,r[l.id].x+=g,r[l.id].y+=y}}}}}class jv{constructor(e,t,r){this.body=e,this.physicsBody=t,this.setOptions(r)}setOptions(e){this.options=e}solve(){let e,t;const r=this.physicsBody.physicsEdgeIndices,n=this.body.edges;let o,s,a;for(let l=0;l<r.length;l++)t=n[r[l]],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,o=t.to,s=t.edgeType.via,a=t.from,this._calculateSpringForce(o,s,.5*e),this._calculateSpringForce(s,a,.5*e)):(e=t.options.length===void 0?this.options.springLength*1.5:t.options.length,this._calculateSpringForce(t.from,t.to,e)))}_calculateSpringForce(e,t,r){const n=e.x-t.x,o=e.y-t.y,s=Math.max(Math.sqrt(n*n+o*o),.01),a=this.options.springConstant*(r-s)/s,l=n*a,u=o*a;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=l,this.physicsBody.forces[e.id].y+=u),this.physicsBody.forces[t.id]!==void 0&&(this.physicsBody.forces[t.id].x-=l,this.physicsBody.forces[t.id].y-=u)}}class kie{constructor(e,t,r){this.body=e,this.physicsBody=t,this.setOptions(r)}setOptions(e){this.options=e}solve(){let e,t,r,n,o,s,a,l;const u=this.body.edges,d=.5,c=this.physicsBody.physicsEdgeIndices,h=this.physicsBody.physicsNodeIndices,f=this.physicsBody.forces;for(let b=0;b<h.length;b++){const _=h[b];f[_].springFx=0,f[_].springFy=0}for(let b=0;b<c.length;b++)t=u[c[b]],t.connected===!0&&(e=t.options.length===void 0?this.options.springLength:t.options.length,r=t.from.x-t.to.x,n=t.from.y-t.to.y,l=Math.sqrt(r*r+n*n),l=l===0?.01:l,a=this.options.springConstant*(e-l)/l,o=r*a,s=n*a,t.to.level!=t.from.level?(f[t.toId]!==void 0&&(f[t.toId].springFx-=o,f[t.toId].springFy-=s),f[t.fromId]!==void 0&&(f[t.fromId].springFx+=o,f[t.fromId].springFy+=s)):(f[t.toId]!==void 0&&(f[t.toId].x-=d*o,f[t.toId].y-=d*s),f[t.fromId]!==void 0&&(f[t.fromId].x+=d*o,f[t.fromId].y+=d*s)));a=1;let v,g;for(let b=0;b<h.length;b++){const _=h[b];v=Math.min(a,Math.max(-a,f[_].springFx)),g=Math.min(a,Math.max(-a,f[_].springFy)),f[_].x+=v,f[_].y+=g}let y=0,p=0;for(let b=0;b<h.length;b++){const _=h[b];y+=f[_].x,p+=f[_].y}const m=y/h.length,w=p/h.length;for(let b=0;b<h.length;b++){const _=h[b];f[_].x-=m,f[_].y-=w}}}class Gs{constructor(e,t,r){this.body=e,this.physicsBody=t,this.setOptions(r)}setOptions(e){this.options=e}solve(){let e,t,r,n;const o=this.body.nodes,s=this.physicsBody.physicsNodeIndices,a=this.physicsBody.forces;for(let l=0;l<s.length;l++){const u=s[l];n=o[u],e=-n.x,t=-n.y,r=Math.sqrt(e*e+t*t),this._calculateForces(r,e,t,a,n)}}_calculateForces(e,t,r,n,o){const s=e===0?0:this.options.centralGravity/e;n[o.id].x=t*s,n[o.id].y=r*s}}class Fie extends rM{constructor(e,t,r){super(e,t,r),this._rng=sl("FORCE ATLAS 2 BASED REPULSION SOLVER")}_calculateForces(e,t,r,n,o){e===0&&(e=.1*this._rng(),t=e),this.overlapAvoidanceFactor<1&&n.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*n.shape.radius,e-n.shape.radius));const s=n.edges.length+1,a=this.options.gravitationalConstant*o.mass*n.options.mass*s/Math.pow(e,2),l=t*a,u=r*a;this.physicsBody.forces[n.id].x+=l,this.physicsBody.forces[n.id].y+=u}}class qie extends Gs{constructor(e,t,r){super(e,t,r)}_calculateForces(e,t,r,n,o){if(e>0){const s=o.edges.length+1,a=this.options.centralGravity*s*o.options.mass;n[o.id].x=t*a,n[o.id].y=r*a}}}class Bie{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}},Ne(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,ca(["stabilization"],this.options,e),Rt(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"||Eg(t.x))&&(t.x=0),(typeof t.y!="number"||Eg(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 Fie(this.body,this.physicsBody,e),this.edgesSolver=new jv(this.body,this.physicsBody,e),this.gravitySolver=new qie(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new Mie(this.body,this.physicsBody,e),this.edgesSolver=new jv(this.body,this.physicsBody,e),this.gravitySolver=new Gs(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new Nie(this.body,this.physicsBody,e),this.edgesSolver=new kie(this.body,this.physicsBody,e),this.gravitySolver=new Gs(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new rM(this.body,this.physicsBody,e),this.edgesSolver=new jv(this.body,this.physicsBody,e),this.gravitySolver=new Gs(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(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=A(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}stopSimulation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!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=aa();this.physicsTick(),(aa()-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)&&pr(()=>{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 r in e)Object.prototype.hasOwnProperty.call(e,r)&&e[r].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[r].id);for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&t[r].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(t[r].id);for(let r=0;r<this.physicsBody.physicsNodeIndices.length;r++){const n=this.physicsBody.physicsNodeIndices[r];this.physicsBody.forces[n]={x:0,y:0},this.physicsBody.velocities[n]===void 0&&(this.physicsBody.velocities[n]={x:0,y:0})}for(const r in this.physicsBody.velocities)e[r]===void 0&&delete this.physicsBody.velocities[r]}revert(){const e=Te(this.previousStates),t=this.body.nodes,r=this.physicsBody.velocities;this.referenceState={};for(let n=0;n<e.length;n++){const o=e[n];t[o]!==void 0?t[o].options.physics===!0&&(this.referenceState[o]={positions:{x:t[o].x,y:t[o].y}},r[o].x=this.previousStates[o].vx,r[o].y=this.previousStates[o].vy,t[o].x=this.previousStates[o].x,t[o].y=this.previousStates[o].y):delete this.previousStates[o]}}_evaluateStepQuality(){let e,t,r;const n=this.body.nodes,o=this.referenceState,s=.3;for(const a in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,a)&&n[a]!==void 0&&(e=n[a].x-o[a].positions.x,t=n[a].y-o[a].positions.y,r=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),r>s))return!1;return!0}moveNodes(){const e=this.physicsBody.physicsNodeIndices;let t=0,r=0;const n=5;for(let o=0;o<e.length;o++){const s=e[o],a=this._performStep(s);t=Math.max(t,a),r+=a}this.adaptiveTimestepEnabled=r/e.length<n,this.stabilized=t<this.options.minVelocity}calculateComponentVelocity(e,t,r){const n=this.modelOptions.damping*e,o=(t-n)/r;e+=o*this.timestep;const s=this.options.maxVelocity||1e9;return Math.abs(e)>s&&(e=e>0?s:-s),e}_performStep(e){const t=this.body.nodes[e],r=this.physicsBody.forces[e];this.options.wind&&(r.x+=this.options.wind.x,r.y+=this.options.wind.y);const n=this.physicsBody.velocities[e];return this.previousStates[e]={x:t.x,y:t.y,vx:n.x,vy:n.y},t.options.fixed.x===!1?(n.x=this.calculateComponentVelocity(n.x,r.x,t.options.mass),t.x+=n.x*this.timestep):(r.x=0,n.x=0),t.options.fixed.y===!1?(n.y=this.calculateComponentVelocity(n.y,r.y,t.options.mass),t.y+=n.y*this.timestep):(r.y=0,n.y=0),Math.sqrt(Math.pow(n.x,2)+Math.pow(n.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 r=e[t].options.fixed;this.freezeCache[t]={x:r.x,y:r.y},r.x=!0,r.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;if(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.ready=!0;return}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,pr(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(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 r=0;for(;e()&&r<this.options.stabilization.updateInterval;)this.physicsTick(),r++;if(t(),e()){var n;pr(A(n=this._stabilizationBatch).call(n,this),0)}else 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 r=this.physicsBody.physicsNodeIndices[t],n=this.body.nodes[r],o=this.physicsBody.forces[r],s=20,a=.03,l=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.x,2)),u=Math.min(Math.max(5,l),15),d=3*u,c=bg((180-Math.min(1,Math.max(0,a*l))*180)/360,1,1),h={x:n.x+s*o.x,y:n.y+s*o.y};e.lineWidth=u,e.strokeStyle=c,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(h.x,h.y),e.stroke();const f=Math.atan2(o.y,o.x);e.fillStyle=c,eM.draw(e,{type:"arrow",point:h,angle:f,length:d}),ns(e).call(e)}}}const Xe=[];for(let i=0;i<256;++i)Xe.push((i+256).toString(16).slice(1));function jie(i,e=0){return(Xe[i[e+0]]+Xe[i[e+1]]+Xe[i[e+2]]+Xe[i[e+3]]+"-"+Xe[i[e+4]]+Xe[i[e+5]]+"-"+Xe[i[e+6]]+Xe[i[e+7]]+"-"+Xe[i[e+8]]+Xe[i[e+9]]+"-"+Xe[i[e+10]]+Xe[i[e+11]]+Xe[i[e+12]]+Xe[i[e+13]]+Xe[i[e+14]]+Xe[i[e+15]]).toLowerCase()}let Lv;const Lie=new Uint8Array(16);function zie(){if(!Lv){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Lv=crypto.getRandomValues.bind(crypto)}return Lv(Lie)}const Wie=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var CT={randomUUID:Wie};function Hie(i,e,t){var n;i=i||{};const r=i.random??((n=i.rng)==null?void 0:n.call(i))??zie();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,jie(r)}function co(i,e,t){return CT.randomUUID?CT.randomUUID():Hie(i)}class nt{constructor(){}static getRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=1e9,n=-1e9,o=1e9,s=-1e9,a;if(t.length>0)for(let l=0;l<t.length;l++)a=e[t[l]],o>a.shape.boundingBox.left&&(o=a.shape.boundingBox.left),s<a.shape.boundingBox.right&&(s=a.shape.boundingBox.right),r>a.shape.boundingBox.top&&(r=a.shape.boundingBox.top),n<a.shape.boundingBox.bottom&&(n=a.shape.boundingBox.bottom);return o===1e9&&s===-1e9&&r===1e9&&n===-1e9&&(r=0,n=0,o=0,s=0),{minX:o,maxX:s,minY:r,maxY:n}}static getRangeCore(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=1e9,n=-1e9,o=1e9,s=-1e9,a;if(t.length>0)for(let l=0;l<t.length;l++)a=e[t[l]],o>a.x&&(o=a.x),s<a.x&&(s=a.x),r>a.y&&(r=a.y),n<a.y&&(n=a.y);return o===1e9&&s===-1e9&&r===1e9&&n===-1e9&&(r=0,n=0,o=0,s=0),{minX:o,maxX:s,minY:r,maxY:n}}static findCenter(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}static cloneOptions(e,t){const r={};return t===void 0||t==="node"?(fe(r,e.options,!0),r.x=e.x,r.y=e.y,r.amountOfConnections=e.edges.length):fe(r,e.options,!0),r}}class Uie extends be{constructor(e,t,r,n,o,s){super(e,t,r,n,o,s),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],Z(t.edges,r=>{delete this.containedEdges[r.id]}),Z(t.containedNodes,(r,n)=>{this.containedNodes[n]=r}),t.containedNodes={},Z(t.containedEdges,(r,n)=>{this.containedEdges[n]=r}),t.containedEdges={},Z(t.edges,r=>{Z(this.edges,n=>{var o,s;const a=le(o=n.clusteringEdgeReplacingIds).call(o,r.id);a!==-1&&(Z(r.clusteringEdgeReplacingIds,l=>{n.clusteringEdgeReplacingIds.push(l),this.body.edges[l].edgeReplacedById=n.id}),vr(s=n.clusteringEdgeReplacingIds).call(s,a,1))})}),t.edges=[]}}class Vie{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},Ne(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 r=[];for(let n=0;n<this.body.nodeIndices.length;n++){const o=this.body.nodes[this.body.nodeIndices[n]];o.edges.length>=e&&r.push(o.id)}for(let n=0;n<r.length;n++)this.clusterByConnection(r[n],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]:!0;if(e.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);const r={},n={};Z(this.body.nodes,(o,s)=>{o.options&&e.joinCondition(o.options)===!0&&(r[s]=o,Z(o.edges,a=>{this.clusteredEdges[a.id]===void 0&&(n[a.id]=a)}))}),this._cluster(r,n,e,t)}clusterByEdgeCount(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;t=this._checkOptions(t);const n=[],o={};let s,a,l;for(let u=0;u<this.body.nodeIndices.length;u++){const d={},c={},h=this.body.nodeIndices[u],f=this.body.nodes[h];if(o[h]===void 0){l=0,a=[];for(let v=0;v<f.edges.length;v++)s=f.edges[v],this.clusteredEdges[s.id]===void 0&&(s.toId!==s.fromId&&l++,a.push(s));if(l===e){const v=function(y){if(t.joinCondition===void 0||t.joinCondition===null)return!0;const p=nt.cloneOptions(y);return t.joinCondition(p)};let g=!0;for(let y=0;y<a.length;y++){s=a[y];const p=this._getConnectedId(s,h);if(v(f))c[s.id]=s,d[h]=f,d[p]=this.body.nodes[p],o[h]=!0;else{g=!1;break}}if(Te(d).length>0&&Te(c).length>0&&g===!0){const p=function(){for(let m=0;m<n.length;++m)for(const w in d)if(n[m].nodes[w]!==void 0)return n[m]}();if(p!==void 0){for(const m in d)p.nodes[m]===void 0&&(p.nodes[m]=d[m]);for(const m in c)p.edges[m]===void 0&&(p.edges[m]=c[m])}else n.push({nodes:d,edges:c})}}}}for(let u=0;u<n.length;u++)this._cluster(n[u].nodes,n[u].edges,t,!1);r===!0&&this.body.emitter.emit("_dataChanged")}clusterOutliers(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,t)}clusterBridges(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,t)}clusterByConnection(e,t){var r;let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;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 o=this.body.nodes[e];t=this._checkOptions(t,o),t.clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=o.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=o.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=o.options.fixed.x,t.clusterNodeProperties.fixed.y=o.options.fixed.y);const s={},a={},l=o.id,u=nt.cloneOptions(o);s[l]=o;for(let c=0;c<o.edges.length;c++){const h=o.edges[c];if(this.clusteredEdges[h.id]===void 0){const f=this._getConnectedId(h,l);if(this.clusteredNodes[f]===void 0)if(f!==l)if(t.joinCondition===void 0)a[h.id]=h,s[f]=this.body.nodes[f];else{const v=nt.cloneOptions(this.body.nodes[f]);t.joinCondition(u,v)===!0&&(a[h.id]=h,s[f]=this.body.nodes[f])}else a[h.id]=h}}const d=vn(r=Te(s)).call(r,function(c){return s[c].id});for(const c in s){if(!Object.prototype.hasOwnProperty.call(s,c))continue;const h=s[c];for(let f=0;f<h.edges.length;f++){const v=h.edges[f];le(d).call(d,this._getConnectedId(v,h.id))>-1&&(a[v.id]=v)}}this._cluster(s,a,t,n)}_createClusterEdges(e,t,r,n){let o,s,a,l,u,d;const c=Te(e),h=[];for(let g=0;g<c.length;g++){s=c[g],a=e[s];for(let y=0;y<a.edges.length;y++)o=a.edges[y],this.clusteredEdges[o.id]===void 0&&(o.toId==o.fromId?t[o.id]=o:o.toId==s?(l=r.id,u=o.fromId,d=u):(l=o.toId,u=r.id,d=l),e[d]===void 0&&h.push({edge:o,fromId:u,toId:l}))}const f=[],v=function(g){for(let y=0;y<f.length;y++){const p=f[y],m=g.fromId===p.fromId&&g.toId===p.toId,w=g.fromId===p.toId&&g.toId===p.fromId;if(m||w)return p}return null};for(let g=0;g<h.length;g++){const y=h[g],p=y.edge;let m=v(y);m===null?(m=this._createClusteredEdge(y.fromId,y.toId,p,n),f.push(m)):m.clusteringEdgeReplacingIds.push(p.id),this.body.edges[p.id].edgeReplacedById=m.id,this._backupEdgeOptions(p),p.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,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;const o=[];for(const d in e)Object.prototype.hasOwnProperty.call(e,d)&&this.clusteredNodes[d]!==void 0&&o.push(d);for(let d=0;d<o.length;++d)delete e[o[d]];if(Te(e).length==0||Te(e).length==1&&r.clusterNodeProperties.allowSingleNodeCluster!=!0)return;let s=fe({},r.clusterNodeProperties);if(r.processProperties!==void 0){const d=[];for(const h in e)if(Object.prototype.hasOwnProperty.call(e,h)){const f=nt.cloneOptions(e[h]);d.push(f)}const c=[];for(const h in t)if(Object.prototype.hasOwnProperty.call(t,h)&&h.substr(0,12)!=="clusterEdge:"){const f=nt.cloneOptions(t[h],"edge");c.push(f)}if(s=r.processProperties(s,d,c),!s)throw new Error("The processProperties function does not return properties!")}s.id===void 0&&(s.id="cluster:"+co());const a=s.id;s.label===void 0&&(s.label="cluster");let l;s.x===void 0&&(l=this._getClusterPosition(e),s.x=l.x),s.y===void 0&&(l===void 0&&(l=this._getClusterPosition(e)),s.y=l.y),s.id=a;const u=this.body.functions.createNode(s,Uie);u.containedNodes=e,u.containedEdges=t,u.clusterEdgeProperties=r.clusterEdgeProperties,this.body.nodes[s.id]=u,this._clusterEdges(e,t,s,r.clusterEdgeProperties),s.id=void 0,n===!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=Te(e);let r=e[t[0]].x,n=e[t[0]].x,o=e[t[0]].y,s=e[t[0]].y,a;for(let l=1;l<t.length;l++)a=e[t[l]],r=a.x<r?a.x:r,n=a.x>n?a.x:n,o=a.y<o?a.y:o,s=a.y>s?a.y:s;return{x:.5*(r+n),y:.5*(o+s)}}openCluster(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");const n=this.body.nodes[e];if(n===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(n.isCluster!==!0||n.containedNodes===void 0||n.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");const o=this.findNode(e),s=le(o).call(o,e)-1;if(s>=0){const d=o[s];this.body.nodes[d]._openChildCluster(e),delete this.body.nodes[e],r===!0&&this.body.emitter.emit("_dataChanged");return}const a=n.containedNodes,l=n.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction=="function"){const d={},c={x:n.x,y:n.y};for(const f in a)if(Object.prototype.hasOwnProperty.call(a,f)){const v=this.body.nodes[f];d[f]={x:v.x,y:v.y}}const h=t.releaseFunction(c,d);for(const f in a)if(Object.prototype.hasOwnProperty.call(a,f)){const v=this.body.nodes[f];h[f]!==void 0&&(v.x=h[f].x===void 0?n.x:h[f].x,v.y=h[f].y===void 0?n.y:h[f].y)}}else Z(a,function(d){d.options.fixed.x===!1&&(d.x=n.x),d.options.fixed.y===!1&&(d.y=n.y)});for(const d in a)if(Object.prototype.hasOwnProperty.call(a,d)){const c=this.body.nodes[d];c.vx=n.vx,c.vy=n.vy,c.setOptions({physics:!0}),delete this.clusteredNodes[d]}const u=[];for(let d=0;d<n.edges.length;d++)u.push(n.edges[d]);for(let d=0;d<u.length;d++){const c=u[d],h=this._getConnectedId(c,e),f=this.clusteredNodes[h];for(let v=0;v<c.clusteringEdgeReplacingIds.length;v++){const g=c.clusteringEdgeReplacingIds[v],y=this.body.edges[g];if(y!==void 0)if(f!==void 0){const p=this.body.nodes[f.clusterId];p.containedEdges[y.id]=y,delete l[y.id];let m=y.fromId,w=y.toId;y.toId==h?w=f.clusterId:m=f.clusterId,this._createClusteredEdge(m,w,y,p.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(y)}c.remove()}for(const d in l)Object.prototype.hasOwnProperty.call(l,d)&&this._restoreEdge(l[d]);delete this.body.nodes[e],r===!0&&this.body.emitter.emit("_dataChanged")}getNodesInCluster(e){const t=[];if(this.isCluster(e)===!0){const r=this.body.nodes[e].containedNodes;for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.push(this.body.nodes[n].id)}return t}findNode(e){const t=[];let n=0,o;for(;this.clusteredNodes[e]!==void 0&&n<100;){if(o=this.body.nodes[e],o===void 0)return[];t.push(o.id),e=this.clusteredNodes[e].clusterId,n++}return o=this.body.nodes[e],o===void 0?[]:(t.push(o.id),ai(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 r=this.getClusteredEdges(e);for(let n=0;n<r.length;n++)this.body.edges[r[n]].setOptions(t);this.body.emitter.emit("_dataChanged")}getClusteredEdges(e){const t=[];let n=0;for(;e!==void 0&&this.body.edges[e]!==void 0&&n<100;)t.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,n++;return ai(t).call(t),t}getBaseEdge(e){return this.getBaseEdges(e)[0]}getBaseEdges(e){const t=[e],r=[],n=[],o=100;let s=0;for(;t.length>0&&s<o;){const a=t.pop();if(a===void 0)continue;const l=this.body.edges[a];if(l===void 0)continue;s++;const u=l.clusteringEdgeReplacingIds;if(u===void 0)n.push(a);else for(let d=0;d<u.length;++d){const c=u[d];le(t).call(t,u)!==-1||le(r).call(r,u)!==-1||t.push(c)}r.push(a)}return n}_getConnectedId(e,t){return e.toId!=t?e.toId:(e.fromId!=t,e.fromId)}_getHubSize(){let e=0,t=0,r=0,n=0;for(let l=0;l<this.body.nodeIndices.length;l++){const u=this.body.nodes[this.body.nodeIndices[l]];u.edges.length>n&&(n=u.edges.length),e+=u.edges.length,t+=Math.pow(u.edges.length,2),r+=1}e=e/r,t=t/r;const o=t-Math.pow(e,2),s=Math.sqrt(o);let a=Math.floor(e+2*s);return a>n&&(a=n),a}_createClusteredEdge(e,t,r,n,o){const s=nt.cloneOptions(r,"edge");fe(s,n),s.from=e,s.to=t,s.id="clusterEdge:"+co(),o!==void 0&&fe(s,o);const a=this.body.functions.createEdge(s);return a.clusteringEdgeReplacingIds=[r.id],a.connect(),this.body.edges[a.id]=a,a}_clusterEdges(e,t,r,n){if(t instanceof Fr){const o=t,s={};s[o.id]=o,t=s}if(e instanceof be){const o=e,s={};s[o.id]=o,e=s}if(r==null)throw new Error("_clusterEdges: parameter clusterNode required");n===void 0&&(n=r.clusterEdgeProperties),this._createClusterEdges(e,t,r,n);for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&this.body.edges[o]!==void 0){const s=this.body.edges[o];this._backupEdgeOptions(s),s.setOptions({physics:!1})}for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(this.clusteredNodes[o]={clusterId:r.id,node:this.body.nodes[o]},this.body.nodes[o].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;const t=this.clusteredNodes[e];if(t===void 0)return;const r=t.clusterId;if(r!==void 0)return this.body.nodes[r]}_filter(e,t){const r=[];return Z(e,n=>{t(n)&&r.push(n)}),r}_updateState(){let e;const t=[],r={},n=l=>{Z(this.body.nodes,u=>{u.isCluster===!0&&l(u)})};for(e in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,e))continue;this.body.nodes[e]===void 0&&t.push(e)}n(function(l){for(let u=0;u<t.length;u++)delete l.containedNodes[t[u]]});for(let l=0;l<t.length;l++)delete this.clusteredNodes[t[l]];Z(this.clusteredEdges,l=>{const u=this.body.edges[l];(u===void 0||!u.endPointsValid())&&(r[l]=l)}),n(function(l){Z(l.containedEdges,(u,d)=>{!u.endPointsValid()&&!r[d]&&(r[d]=d)})}),Z(this.body.edges,(l,u)=>{let d=!0;const c=l.clusteringEdgeReplacingIds;if(c!==void 0){let h=0;Z(c,f=>{const v=this.body.edges[f];v!==void 0&&v.endPointsValid()&&(h+=1)}),d=h>0}(!l.endPointsValid()||!d)&&(r[u]=u)}),n(l=>{Z(r,u=>{delete l.containedEdges[u],Z(l.edges,(d,c)=>{if(d.id===u){l.edges[c]=null;return}d.clusteringEdgeReplacingIds=this._filter(d.clusteringEdgeReplacingIds,function(h){return!r[h]})}),l.edges=this._filter(l.edges,function(d){return d!==null})})}),Z(r,l=>{delete this.clusteredEdges[l]}),Z(r,l=>{delete this.body.edges[l]});const o=Te(this.body.edges);Z(o,l=>{const u=this.body.edges[l],d=this._isClusteredNode(u.fromId)||this._isClusteredNode(u.toId);if(d!==this._isClusteredEdge(u.id))if(d){const c=this._getClusterNodeForNode(u.fromId);c!==void 0&&this._clusterEdges(this.body.nodes[u.fromId],u,c);const h=this._getClusterNodeForNode(u.toId);h!==void 0&&this._clusterEdges(this.body.nodes[u.toId],u,h)}else delete this._clusterEdges[l],this._restoreEdge(u)});let s=!1,a=!0;for(;a;){const l=[];n(function(u){const d=Te(u.containedNodes).length,c=u.options.allowSingleNodeCluster===!0;(c&&d<1||!c&&d<2)&&l.push(u.id)});for(let u=0;u<l.length;++u)this.openCluster(l[u],{},!1);a=l.length>0,s=s||a}s&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}}class Gie{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},Ne(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=pr(()=>{var t;this.zooming=!1,A(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",A(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&&Kn(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var e;this.requestAnimationFrameRequestId=window.requestAnimationFrame(A(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]:!1;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 r=this.canvas.getContext(),n=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(r.clearRect(0,0,n,o),this.canvas.frame.clientWidth===0)return;if(r.save(),r.translate(this.body.view.translation.x,this.body.view.translation.y),r.scale(this.body.view.scale,this.body.view.scale),r.beginPath(),this.body.emitter.emit("beforeDrawing",r),r.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(r),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){const{drawExternalLabels:s}=this._drawNodes(r,e);t.drawExternalLabels=s}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(r),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(r),r.beginPath(),this.body.emitter.emit("afterDrawing",r),r.closePath(),r.restore(),e===!0&&r.clearRect(0,0,n,o)}}_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 r;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r=t[n],r.resize(e),r.updateBoundingBox(e,r.selected));e.restore()}_drawNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.body.nodes,n=this.body.nodeIndices;let o;const s=[],a=[],l=20,u=this.canvas.DOMtoCanvas({x:-20,y:-20}),d=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+l,y:this.canvas.frame.canvas.clientHeight+l}),c={top:u.y,left:u.x,bottom:d.y,right:d.x},h=[];for(let y=0;y<n.length;y++)if(o=r[n[y]],o.hover)a.push(n[y]);else if(o.isSelected())s.push(n[y]);else if(t===!0){const p=o.draw(e);p.drawExternalLabel!=null&&h.push(p.drawExternalLabel)}else if(o.isBoundingBoxOverlappingWith(c)===!0){const p=o.draw(e);p.drawExternalLabel!=null&&h.push(p.drawExternalLabel)}else o.updateBoundingBox(e,o.selected);let f;const v=s.length,g=a.length;for(f=0;f<v;f++){o=r[s[f]];const y=o.draw(e);y.drawExternalLabel!=null&&h.push(y.drawExternalLabel)}for(f=0;f<g;f++){o=r[a[f]];const y=o.draw(e);y.drawExternalLabel!=null&&h.push(y.drawExternalLabel)}return{drawExternalLabels:()=>{for(const y of h)y()}}}_drawEdges(e){const t=this.body.edges,r=this.body.edgeIndices;for(let n=0;n<r.length;n++){const o=t[r[n]];o.connected===!0&&o.draw(e)}}_drawArrows(e){const t=this.body.edges,r=this.body.edgeIndices;for(let n=0;n<r.length;n++){const o=t[r[n]];o.connected===!0&&o.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,r=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,r),e.fillStyle="rgba(151, 194, 252, 0.2)",e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,r),e.strokeStyle="rgba(151, 194, 252, 1)",e.stroke()}else e.closePath()}}var zv,RT;function Kie(){if(RT)return zv;RT=1,aA();var i=ue();return zv=i.setInterval,zv}var Wv,xT;function Yie(){return xT||(xT=1,Wv=Kie()),Wv}var Xie=Yie(),Jie=Y(Xie);function va(i,e){e.inputHandler=function(t){t.isFirst&&e(t)},i.on("hammer.input",e.inputHandler)}function iM(i,e){return e.inputHandler=function(t){t.isFinal&&e(t)},i.on("hammer.input",e.inputHandler)}class Zie{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%"},Ne(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.once("resize",t=>{t.width!==0&&(this.body.view.translation.x=t.width*.5),t.height!==0&&(this.body.view.translation.y=t.height*.5)}),this.body.emitter.on("setSize",A(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&&Kn(["width","height","autoResize"],this.options,e),this._cleanUp(),this.options.autoResize===!0){var t;if(window.ResizeObserver){const n=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:o}=this;n.observe(o),this._cleanupCallbacks.push(()=>{n.unobserve(o)})}else{const n=Jie(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(n)})}const r=A(t=this._onResize).call(t,this);window.addEventListener("resize",r),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",r)})}}_cleanUp(){var e,t,r;de(e=ai(t=vr(r=this._cleanupCallbacks).call(r,0)).call(t)).call(e,n=>{try{n()}catch(o){console.error(o)}})}_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 r=this.cameraState.scale;e!=1&&t!=1?r=this.cameraState.scale*.5*(e+t):e!=1?r=this.cameraState.scale*e:t!=1&&(r=this.cameraState.scale*t),this.body.view.scale=r;const n=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),o={x:n.x-this.cameraState.position.x,y:n.y-this.cameraState.position.y};this.body.view.translation.x+=o.x*this.body.view.scale,this.body.view.translation.y+=o.y*this.body.view.scale}}_prepareValue(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(le(e).call(e,"%")!==-1||le(e).call(e,"px")!==-1)return e;if(le(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 nn(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:nn.DIRECTION_ALL}),va(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 nn(this.frame),iM(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 r=!1;const n=this.frame.canvas.width,o=this.frame.canvas.height,s=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(s),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},r=!0;else{const a=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),l=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==a||this.frame.canvas.height!==l)&&this._getCameraState(s),this.frame.canvas.width!==a&&(this.frame.canvas.width=a,r=!0),this.frame.canvas.height!==l&&(this.frame.canvas.height=l,r=!0)}return r===!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(n/this.pixelRatio),oldHeight:Math.round(o/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,r}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;typeof window<"u"&&(t=window.devicePixelRatio||1);const r=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/r}_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)}}}function Qie(i,e){const t=Ne({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},i??{});if(!Pe(t.nodes))throw new TypeError("Nodes has to be an array of ids.");if(t.nodes.length===0&&(t.nodes=e),!(typeof t.minZoomLevel=="number"&&t.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof t.maxZoomLevel=="number"&&t.minZoomLevel<=t.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return t}class ene{constructor(e,t){var r,n;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",A(r=this.fit).call(r,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",A(n=this.releaseNode).call(n,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]:!1;e=Qie(e,this.body.nodeIndices);const r=this.canvas.frame.canvas.clientWidth,n=this.canvas.frame.canvas.clientHeight;let o,s;if(r===0||n===0)s=1,o=nt.getRange(this.body.nodes,e.nodes);else if(t===!0){let u=0;for(const h in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,h)&&this.body.nodes[h].predefinedPosition===!0&&(u+=1);if(u>.5*this.body.nodeIndices.length){this.fit(e,!1);return}o=nt.getRange(this.body.nodes,e.nodes),s=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;const c=Math.min(r/600,n/600);s*=c}else{this.body.emitter.emit("_resizeNodes"),o=nt.getRange(this.body.nodes,e.nodes);const u=Math.abs(o.maxX-o.minX)*1.1,d=Math.abs(o.maxY-o.minY)*1.1,c=r/u,h=n/d;s=c<=h?c:h}s>e.maxZoomLevel?s=e.maxZoomLevel:s<e.minZoomLevel&&(s=e.minZoomLevel);const l={position:nt.findCenter(o),scale:s,animation:e.animation};this.moveTo(l)}focus(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){const r={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=r,t.lockedOnNode=e,this.moveTo(t)}else console.error("Node: "+e+" cannot be found.")}moveTo(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!ri(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,!ri(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,!ri(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,!ri(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)}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}),r={x:t.x-e.position.x,y:t.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+r.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+r.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var n;this.viewFunction=A(n=this._lockedRedraw).call(n,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var o;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=A(o=this._transitionRedraw).call(o,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}_lockedRedraw(){const e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),r={x:t.x-e.x,y:t.y-e.y},n=this.body.view.translation,o={x:n.x+r.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:n.y+r.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=o}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]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;const t=lee[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){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var r;this.viewFunction=A(r=this._lockedRedraw).call(r,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 DT(i){var e=i&&i.preventDefault||!1,t=i&&i.container||window,r={},n={keydown:{},keyup:{}},o={},s;for(s=97;s<=122;s++)o[String.fromCharCode(s)]={code:65+(s-97),shift:!1};for(s=65;s<=90;s++)o[String.fromCharCode(s)]={code:s,shift:!0};for(s=0;s<=9;s++)o[""+s]={code:48+s,shift:!1};for(s=1;s<=12;s++)o["F"+s]={code:111+s,shift:!1};for(s=0;s<=9;s++)o["num"+s]={code:96+s,shift:!1};o["num*"]={code:106,shift:!1},o["num+"]={code:107,shift:!1},o["num-"]={code:109,shift:!1},o["num/"]={code:111,shift:!1},o["num."]={code:110,shift:!1},o.left={code:37,shift:!1},o.up={code:38,shift:!1},o.right={code:39,shift:!1},o.down={code:40,shift:!1},o.space={code:32,shift:!1},o.enter={code:13,shift:!1},o.shift={code:16,shift:void 0},o.esc={code:27,shift:!1},o.backspace={code:8,shift:!1},o.tab={code:9,shift:!1},o.ctrl={code:17,shift:!1},o.alt={code:18,shift:!1},o.delete={code:46,shift:!1},o.pageup={code:33,shift:!1},o.pagedown={code:34,shift:!1},o["="]={code:187,shift:!1},o["-"]={code:189,shift:!1},o["]"]={code:221,shift:!1},o["["]={code:219,shift:!1};var a=function(d){u(d,"keydown")},l=function(d){u(d,"keyup")},u=function(d,c){if(n[c][d.keyCode]!==void 0){for(var h=n[c][d.keyCode],f=0;f<h.length;f++)(h[f].shift===void 0||h[f].shift==!0&&d.shiftKey==!0||h[f].shift==!1&&d.shiftKey==!1)&&h[f].fn(d);e==!0&&d.preventDefault()}};return r.bind=function(d,c,h){if(h===void 0&&(h="keydown"),o[d]===void 0)throw new Error("unsupported key: "+d);n[h][o[d].code]===void 0&&(n[h][o[d].code]=[]),n[h][o[d].code].push({fn:c,shift:o[d].shift})},r.bindAll=function(d,c){c===void 0&&(c="keydown");for(var h in o)o.hasOwnProperty(h)&&r.bind(h,d,c)},r.getKey=function(d){for(var c in o)if(o.hasOwnProperty(c)){if(d.shiftKey==!0&&o[c].shift==!0&&d.keyCode==o[c].code)return c;if(d.shiftKey==!1&&o[c].shift==!1&&d.keyCode==o[c].code)return c;if(d.keyCode==o[c].code&&c=="shift")return c}return"unknown key, currently not supported"},r.unbind=function(d,c,h){if(h===void 0&&(h="keydown"),o[d]===void 0)throw new Error("unsupported key: "+d);if(c!==void 0){var f=[],v=n[h][o[d].code];if(v!==void 0)for(var g=0;g<v.length;g++)v[g].fn==c&&v[g].shift==o[d].shift||f.push(n[h][o[d].code][g]);n[h][o[d].code]=f}else n[h][o[d].code]=[]},r.reset=function(){n={keydown:{},keyup:{}}},r.destroy=function(){n={keydown:{},keyup:{}},t.removeEventListener("keydown",a,!0),t.removeEventListener("keyup",l,!0)},t.addEventListener("keydown",a,!0),t.addEventListener("keyup",l,!0),r}class tne{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 s=0;s<e.length;s++){this.navigationDOM[e[s]]=document.createElement("div"),this.navigationDOM[e[s]].className="vis-button vis-"+e[s],this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[s]]);const a=new nn(this.navigationDOM[e[s]]);if(t[s]==="_fit"){var r;va(a,A(r=this._fit).call(r,this))}else{var n;va(a,A(n=this.bindToRedraw).call(n,this,t[s]))}this.navigationHammers.push(a)}const o=new nn(this.canvas.frame);iM(o,()=>{this._stopMovement()}),this.navigationHammers.push(o),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var t;this.boundFunctions[e]=A(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),r=this.body.view.translation,n=t/e,o=(1-n)*this.canvas.canvasViewCenter.x+r.x*n,s=(1-n)*this.canvas.canvasViewCenter.y+r.y*n;this.body.view.scale=t,this.body.view.translation={x:o,y:s},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),r=this.body.view.translation,n=t/e,o=(1-n)*this.canvas.canvasViewCenter.x+r.x*n,s=(1-n)*this.canvas.canvasViewCenter.y+r.y*n;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=DT({container:window,preventDefault:!0}):this.keycharm=DT({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,t,r,n,o,s,a,l,u,d,c,h,f,v,g,y,p,m,w,b,_,S,I,E;A(e=this.keycharm).call(e,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),A(t=this.keycharm).call(t,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),A(r=this.keycharm).call(r,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),A(n=this.keycharm).call(n,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),A(o=this.keycharm).call(o,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),A(s=this.keycharm).call(s,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),A(a=this.keycharm).call(a,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),A(l=this.keycharm).call(l,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),A(u=this.keycharm).call(u,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),A(d=this.keycharm).call(d,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),A(c=this.keycharm).call(c,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),A(h=this.keycharm).call(h,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),A(f=this.keycharm).call(f,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),A(v=this.keycharm).call(v,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),A(g=this.keycharm).call(g,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),A(y=this.keycharm).call(y,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),A(p=this.keycharm).call(p,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),A(m=this.keycharm).call(m,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),A(w=this.keycharm).call(w,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),A(b=this.keycharm).call(b,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),A(_=this.keycharm).call(_,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),A(S=this.keycharm).call(S,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),A(I=this.keycharm).call(I,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),A(E=this.keycharm).call(E,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}}class rne{constructor(e,t,r){var n,o,s,a,l,u,d,c,h,f,v,g,y;this.body=e,this.canvas=t,this.selectionHandler=r,this.navigationHandler=new tne(e,t),this.body.eventListeners.onTap=A(n=this.onTap).call(n,this),this.body.eventListeners.onTouch=A(o=this.onTouch).call(o,this),this.body.eventListeners.onDoubleTap=A(s=this.onDoubleTap).call(s,this),this.body.eventListeners.onHold=A(a=this.onHold).call(a,this),this.body.eventListeners.onDragStart=A(l=this.onDragStart).call(l,this),this.body.eventListeners.onDrag=A(u=this.onDrag).call(u,this),this.body.eventListeners.onDragEnd=A(d=this.onDragEnd).call(d,this),this.body.eventListeners.onMouseWheel=A(c=this.onMouseWheel).call(c,this),this.body.eventListeners.onPinch=A(h=this.onPinch).call(h,this),this.body.eventListeners.onMouseMove=A(f=this.onMouseMove).call(f,this),this.body.eventListeners.onRelease=A(v=this.onRelease).call(v,this),this.body.eventListeners.onContext=A(g=this.onContext).call(g,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=A(y=this.getPointer).call(y,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},Ne(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&&(ca(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),Rt(this.options,e,"keyboard"),e.tooltip&&(Ne(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=mg(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-nee(this.canvas.frame.canvas),y:e.y-oee(this.canvas.frame.canvas)}}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),r=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,r),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),r=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,r),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]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,t){const r=function(n,o){const s=[];for(let a=0;a<n.length;a++){const l=n[a];le(o).call(o,l)===-1&&s.push(l)}return s};return{nodes:r(e.nodes,t.nodes),edges:r(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=Ne({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;const r=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(r.x),y:this.canvas._YconvertDOMtoCanvas(r.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(r.x),y:this.canvas._YconvertDOMtoCanvas(r.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 r of this.selectionHandler.getSelectedNodes()){const n={id:r.id,node:r,x:r.x,y:r.y,xFixed:r.options.fixed.x,yFixed:r.options.fixed.y};r.options.fixed.x=!0,r.options.fixed.y=!0,this.drag.selection.push(n)}}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),r=this.drag.selection;if(r&&r.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent("dragging",e,t);const n=t.x-this.drag.pointer.x,o=t.y-this.drag.pointer.y;de(r).call(r,s=>{const a=s.node;s.xFixed===!1&&(a.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(s.x)+n)),s.yFixed===!1&&(a.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(s.y)+o))}),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){this.onDragStart(e);return}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){this.onDragStart(e);return}const n=t.x-this.drag.pointer.x,o=t.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+n,y:this.drag.translation.y+o},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var t;this.body.selectionBox.show=!1;const r=this.body.selectionBox.position,n={minX:Math.min(r.start.x,r.end.x),minY:Math.min(r.start.y,r.end.y),maxX:Math.max(r.start.x,r.end.x),maxY:Math.max(r.start.y,r.end.y)},o=gt(t=this.body.nodeIndices).call(t,a=>{const l=this.body.nodes[a];return l.x>=n.minX&&l.x<=n.maxX&&l.y>=n.minY&&l.y<=n.maxY});de(o).call(o,a=>this.selectionHandler.selectObject(this.body.nodes[a]));const s=this.getPointer(e.center);this.selectionHandler.commitAndEmit(s,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{const r=this.drag.selection;r&&r.length?(de(r).call(r,function(n){n.node.options.fixed.x=n.xFixed,n.node.options.fixed.y=n.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 r=this.pinch.scale*e.scale;this.zoom(r,t)}zoom(e,t){if(this.options.zoomView===!0){const r=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let n;this.drag!==void 0&&this.drag.dragging===!0&&(n=this.canvas.DOMtoCanvas(this.drag.pointer));const o=this.body.view.translation,s=e/r,a=(1-s)*t.x+o.x*s,l=(1-s)*t.y+o.y*s;if(this.body.view.scale=e,this.body.view.translation={x:a,y:l},n!=null){const u=this.canvas.canvasToDOM(n);this.drag.pointer.x=u.x,this.drag.pointer.y=u.y}this.body.emitter.emit("_requestRedraw"),r<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)*(this.options.zoomSpeed*.1);const r=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(t,r)}e.preventDefault()}}onMouseMove(e){const t=this.getPointer({x:e.clientX,y:e.clientY});let r=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(t),this.popup.hidden===!1&&(r=!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(),r===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=pr(()=>this._checkShowPopup(t),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,t)}_checkShowPopup(e){const t=this.canvas._XconvertDOMtoCanvas(e.x),r=this.canvas._YconvertDOMtoCanvas(e.y),n={left:t,top:r,right:t,bottom:r},o=this.popupObj===void 0?void 0:this.popupObj.id;let s=!1,a="node";if(this.popupObj===void 0){const l=this.body.nodeIndices,u=this.body.nodes;let d;const c=[];for(let h=0;h<l.length;h++)d=u[l[h]],d.isOverlappingWith(n)===!0&&(s=!0,d.getTitle()!==void 0&&c.push(l[h]));c.length>0&&(this.popupObj=u[c[c.length-1]],s=!0)}if(this.popupObj===void 0&&s===!1){const l=this.body.edgeIndices,u=this.body.edges;let d;const c=[];for(let h=0;h<l.length;h++)d=u[l[h]],d.isOverlappingWith(n)===!0&&d.connected===!0&&d.getTitle()!==void 0&&c.push(l[h]);c.length>0&&(this.popupObj=u[c[c.length-1]],a="edge")}this.popupObj!==void 0?this.popupObj.id!==o&&(this.popup===void 0&&(this.popup=new gee(this.canvas.frame)),this.popup.popupTargetType=a,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 r=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(r=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),r===!0)){const n=this.selectionHandler.getNodeAt(e);r=n===void 0?!1:n.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(r=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));r===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}var AT={},MT={},NT;function ine(){if(NT)return MT;NT=1;var i=By(),e=VA();return i("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},e),MT}var kT;function nne(){return kT||(kT=1,ine()),AT}var FT={},Hv,qT;function Di(){if(qT)return Hv;qT=1;var i=kn(),e=TypeError;return Hv=function(t){if(typeof t=="object"&&"size"in t&&"has"in t&&"add"in t&&"delete"in t&&"keys"in t)return t;throw new e(i(t)+" is not a set")},Hv}var Uv,BT;function Ai(){if(BT)return Uv;BT=1;var i=Pt(),e=GA(),t=i("Set"),r=t.prototype;return Uv={Set:t,add:e("add",1),has:e("has",1),remove:e("delete",1),proto:r},Uv}var Vv,jT;function Mi(){if(jT)return Vv;jT=1;var i=Et();return Vv=function(e,t,r){for(var n=r?e:e.iterator,o=e.next,s,a;!(s=i(o,n)).done;)if(a=t(s.value),a!==void 0)return a},Vv}var Gv,LT;function ds(){if(LT)return Gv;LT=1;var i=Mi();return Gv=function(e,t,r){return r?i(e.keys(),t,!0):e.forEach(t)},Gv}var Kv,zT;function Vy(){if(zT)return Kv;zT=1;var i=Ai(),e=ds(),t=i.Set,r=i.add;return Kv=function(n){var o=new t;return e(n,function(s){r(o,s)}),o},Kv}var Yv,WT;function cs(){return WT||(WT=1,Yv=function(i){return i.size}),Yv}var Xv,HT;function one(){return HT||(HT=1,Xv=function(i){return{iterator:i,next:i.next,done:!1}}),Xv}var Jv,UT;function Ni(){if(UT)return Jv;UT=1;var i=$r(),e=sr(),t=Et(),r=jn(),n=one(),o="Invalid size",s=RangeError,a=TypeError,l=Math.max,u=function(d,c){this.set=d,this.size=l(c,0),this.has=i(d.has),this.keys=i(d.keys)};return u.prototype={getIterator:function(){return n(e(t(this.keys,this.set)))},includes:function(d){return t(this.has,this.set,d)}},Jv=function(d){e(d);var c=+d.size;if(c!==c)throw new a(o);var h=r(c);if(h<0)throw new s(o);return new u(d,h)},Jv}var Zv,VT;function sne(){if(VT)return Zv;VT=1;var i=Di(),e=Ai(),t=Vy(),r=cs(),n=Ni(),o=ds(),s=Mi(),a=e.has,l=e.remove;return Zv=function(d){var c=i(this),h=n(d),f=t(c);return r(c)<=h.size?o(c,function(v){h.includes(v)&&l(f,v)}):s(h.getIterator(),function(v){a(f,v)&&l(f,v)}),f},Zv}var Qv,GT;function ki(){return GT||(GT=1,Qv=function(){return!1}),Qv}var KT;function ane(){if(KT)return FT;KT=1;var i=z(),e=sne(),t=ee(),r=ki(),n=!r("difference",function(s){return s.size===0}),o=n||t(function(){var s={size:1,has:function(){return!0},keys:function(){var l=0;return{next:function(){var u=l++>1;return a.has(1)&&a.clear(),{done:u,value:2}}}}},a=new Set([1,2,3,4]);return a.difference(s).size!==3});return i({target:"Set",proto:!0,real:!0,forced:o},{difference:e}),FT}var YT={},ep,XT;function lne(){if(XT)return ep;XT=1;var i=Di(),e=Ai(),t=cs(),r=Ni(),n=ds(),o=Mi(),s=e.Set,a=e.add,l=e.has;return ep=function(d){var c=i(this),h=r(d),f=new s;return t(c)>h.size?o(h.getIterator(),function(v){l(c,v)&&a(f,v)}):n(c,function(v){h.includes(v)&&a(f,v)}),f},ep}var JT;function une(){if(JT)return YT;JT=1;var i=z(),e=ee(),t=lne(),r=ki(),n=!r("intersection",function(o){return o.size===2&&o.has(1)&&o.has(2)})||e(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});return i({target:"Set",proto:!0,real:!0,forced:n},{intersection:t}),YT}var ZT={},tp,QT;function dne(){if(QT)return tp;QT=1;var i=Di(),e=Ai().has,t=cs(),r=Ni(),n=ds(),o=Mi(),s=Fy();return tp=function(l){var u=i(this),d=r(l);if(t(u)<=d.size)return n(u,function(h){if(d.includes(h))return!1},!0)!==!1;var c=d.getIterator();return o(c,function(h){if(e(u,h))return s(c,"normal",!1)})!==!1},tp}var eP;function cne(){if(eP)return ZT;eP=1;var i=z(),e=dne(),t=ki(),r=!t("isDisjointFrom",function(n){return!n});return i({target:"Set",proto:!0,real:!0,forced:r},{isDisjointFrom:e}),ZT}var tP={},rp,rP;function hne(){if(rP)return rp;rP=1;var i=Di(),e=cs(),t=ds(),r=Ni();return rp=function(o){var s=i(this),a=r(o);return e(s)>a.size?!1:t(s,function(l){if(!a.includes(l))return!1},!0)!==!1},rp}var iP;function fne(){if(iP)return tP;iP=1;var i=z(),e=hne(),t=ki(),r=!t("isSubsetOf",function(n){return n});return i({target:"Set",proto:!0,real:!0,forced:r},{isSubsetOf:e}),tP}var nP={},ip,oP;function vne(){if(oP)return ip;oP=1;var i=Di(),e=Ai().has,t=cs(),r=Ni(),n=Mi(),o=Fy();return ip=function(a){var l=i(this),u=r(a);if(t(l)<u.size)return!1;var d=u.getIterator();return n(d,function(c){if(!e(l,c))return o(d,"normal",!1)})!==!1},ip}var sP;function pne(){if(sP)return nP;sP=1;var i=z(),e=vne(),t=ki(),r=!t("isSupersetOf",function(n){return!n});return i({target:"Set",proto:!0,real:!0,forced:r},{isSupersetOf:e}),nP}var aP={},np,lP;function gne(){if(lP)return np;lP=1;var i=Di(),e=Ai(),t=Vy(),r=Ni(),n=Mi(),o=e.add,s=e.has,a=e.remove;return np=function(u){var d=i(this),c=r(u).getIterator(),h=t(d);return n(c,function(f){s(d,f)?a(h,f):o(h,f)}),h},np}var op,uP;function nM(){return uP||(uP=1,op=function(i){try{var e=new Set,t={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return e.clear(),e.add(4),function(){return{done:!0}}}})}},r=e[i](t);return r.size===1&&r.values().next().value===4}catch{return!1}}),op}var dP;function yne(){if(dP)return aP;dP=1;var i=z(),e=gne(),t=nM(),r=ki(),n=!r("symmetricDifference")||!t("symmetricDifference");return i({target:"Set",proto:!0,real:!0,forced:n},{symmetricDifference:e}),aP}var cP={},sp,hP;function mne(){if(hP)return sp;hP=1;var i=Di(),e=Ai().add,t=Vy(),r=Ni(),n=Mi();return sp=function(s){var a=i(this),l=r(s).getIterator(),u=t(a);return n(l,function(d){e(u,d)}),u},sp}var fP;function bne(){if(fP)return cP;fP=1;var i=z(),e=mne(),t=nM(),r=ki(),n=!r("union")||!t("union");return i({target:"Set",proto:!0,real:!0,forced:n},{union:e}),cP}var ap,vP;function wne(){if(vP)return ap;vP=1,Hn(),nne(),ane(),une(),cne(),fne(),pne(),yne(),bne(),Ly();var i=ue();return ap=i.Set,ap}var lp,pP;function _ne(){if(pP)return lp;pP=1;var i=wne();return Un(),lp=i,lp}var up,gP;function Ene(){return gP||(gP=1,up=_ne()),up}var Sne=Ene(),Pr=Y(Sne),yP={},mP={},dp,bP;function $ne(){if(bP)return dp;bP=1;var i=te(),e=jy(),t=al().getWeakData,r=qy(),n=sr(),o=An(),s=Ke(),a=ll(),l=Vr(),u=Ze(),d=Ci(),c=d.set,h=d.getterFor,f=l.find,v=l.findIndex,g=i([].splice),y=0,p=function(b){return b.frozen||(b.frozen=new m)},m=function(){this.entries=[]},w=function(b,_){return f(b.entries,function(S){return S[0]===_})};return m.prototype={get:function(b){var _=w(this,b);if(_)return _[1]},has:function(b){return!!w(this,b)},set:function(b,_){var S=w(this,b);S?S[1]=_:this.entries.push([b,_])},delete:function(b){var _=v(this.entries,function(S){return S[0]===b});return~_&&g(this.entries,_,1),!!~_}},dp={getConstructor:function(b,_,S,I){var E=b(function(C,P){r(C,$),c(C,{type:_,id:y++,frozen:null}),o(P)||a(P,C[I],{that:C,AS_ENTRIES:S})}),$=E.prototype,T=h(_),R=function(C,P,F){var q=T(C),X=t(n(P),!0);return X===!0?p(q).set(P,F):X[q.id]=F,C};return e($,{delete:function(C){var P=T(this);if(!s(C))return!1;var F=t(C);return F===!0?p(P).delete(C):F&&u(F,P.id)&&delete F[P.id]},has:function(P){var F=T(this);if(!s(P))return!1;var q=t(P);return q===!0?p(F).has(P):q&&u(q,F.id)}}),e($,S?{get:function(P){var F=T(this);if(s(P)){var q=t(P);if(q===!0)return p(F).get(P);if(q)return q[F.id]}},set:function(P,F){return R(this,P,F)}}:{add:function(P){return R(this,P,!0)}}),E}},dp}var wP;function One(){if(wP)return mP;wP=1;var i=HA(),e=Ee(),t=te(),r=jy(),n=al(),o=By(),s=$ne(),a=Ke(),l=Ci().enforce,u=ee(),d=VD(),c=Object,h=Array.isArray,f=c.isExtensible,v=c.isFrozen,g=c.isSealed,y=c.freeze,p=c.seal,m=!e.ActiveXObject&&"ActiveXObject"in e,w,b=function(C){return function(){return C(this,arguments.length?arguments[0]:void 0)}},_=o("WeakMap",b,s),S=_.prototype,I=t(S.set),E=function(){return i&&u(function(){var C=y([]);return I(new _,C,1),!v(C)})};if(d)if(m){w=s.getConstructor(b,"WeakMap",!0),n.enable();var $=t(S.delete),T=t(S.has),R=t(S.get);r(S,{delete:function(C){if(a(C)&&!f(C)){var P=l(this);return P.frozen||(P.frozen=new w),$(this,C)||P.frozen.delete(C)}return $(this,C)},has:function(P){if(a(P)&&!f(P)){var F=l(this);return F.frozen||(F.frozen=new w),T(this,P)||F.frozen.has(P)}return T(this,P)},get:function(P){if(a(P)&&!f(P)){var F=l(this);return F.frozen||(F.frozen=new w),T(this,P)?R(this,P):F.frozen.get(P)}return R(this,P)},set:function(P,F){if(a(P)&&!f(P)){var q=l(this);q.frozen||(q.frozen=new w),T(this,P)?I(this,P,F):q.frozen.set(P,F)}else I(this,P,F);return this}})}else E()&&r(S,{set:function(P,F){var q;return h(P)&&(v(P)?q=y:g(P)&&(q=p)),I(this,P,F),q&&q(P),this}});return mP}var _P;function Ine(){return _P||(_P=1,One()),yP}var cp,EP;function Tne(){if(EP)return cp;EP=1,Hn(),Ine();var i=ue();return cp=i.WeakMap,cp}var hp,SP;function Pne(){if(SP)return hp;SP=1;var i=Tne();return Un(),hp=i,hp}var fp,$P;function Cne(){return $P||($P=1,fp=Pne()),fp}var Rne=Cne(),hs=Y(Rne);function ho(i,e,t){xne(i,e),e.set(i,t)}function xne(i,e){if(e.has(i))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $g(i,e,t){return i.set(oM(i,e),t),t}function he(i,e){return i.get(oM(i,e))}function oM(i,e,t){if(typeof i=="function"?i===e:i.has(e))return arguments.length<3?e:t;throw new TypeError("Private element is not present on this object")}function OP(i,e){const t=new Pr;for(const r of e)i.has(r)||t.add(r);return t}var Hi=new hs,jt=new hs;class IP{constructor(){ho(this,Hi,new Pr),ho(this,jt,new Pr)}get size(){return he(jt,this).size}add(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(const n of t)he(jt,this).add(n)}delete(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(const n of t)he(jt,this).delete(n)}clear(){he(jt,this).clear()}getSelection(){return[...he(jt,this)]}getChanges(){return{added:[...OP(he(Hi,this),he(jt,this))],deleted:[...OP(he(jt,this),he(Hi,this))],previous:[...new Pr(he(Hi,this))],current:[...new Pr(he(jt,this))]}}commit(){const e=this.getChanges();$g(Hi,this,he(jt,this)),$g(jt,this,new Pr(he(Hi,this)));for(const t of e.added)t.select();for(const t of e.deleted)t.unselect();return e}}var Jr=new hs,Zr=new hs,vp=new hs;class Dne{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};ho(this,Jr,new IP),ho(this,Zr,new IP),ho(this,vp,void 0),$g(vp,this,e)}get sizeNodes(){return he(Jr,this).size}get sizeEdges(){return he(Zr,this).size}getNodes(){return he(Jr,this).getSelection()}getEdges(){return he(Zr,this).getSelection()}addNodes(){he(Jr,this).add(...arguments)}addEdges(){he(Zr,this).add(...arguments)}deleteNodes(e){he(Jr,this).delete(e)}deleteEdges(e){he(Zr,this).delete(e)}clear(){he(Jr,this).clear(),he(Zr,this).clear()}commit(){const e={nodes:he(Jr,this).commit(),edges:he(Zr,this).commit()};for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return he(vp,this).call(this,e,...r),e}}class Ane{constructor(e,t){this.body=e,this.canvas=t,this._selectionAccumulator=new Dne,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},Ne(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",()=>{this.updateSelection()})}setOptions(e){e!==void 0&&Kn(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}selectOnPoint(e){let t=!1;if(this.options.selectable===!0){const r=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),r!==void 0&&(t=this.selectObject(r)),this.body.emitter.emit("_requestRedraw")}return t}selectAdditionalOnPoint(e){let t=!1;if(this.options.selectable===!0){const r=this.getNodeAt(e)||this.getEdgeAt(e);r!==void 0&&(t=!0,r.isSelected()===!0?this.deselectObject(r):this.selectObject(r),this.body.emitter.emit("_requestRedraw"))}return t}_initBaseEvent(e,t){const r={};return r.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},r.event=e,r}generateClickEvent(e,t,r,n){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;const s=this._initBaseEvent(t,r);if(o===!0)s.nodes=[],s.edges=[];else{const a=this.getSelection();s.nodes=a.nodes,s.edges=a.edges}n!==void 0&&(s.previousSelection=n),e=="click"&&(s.items=this.getClickedItems(r)),t.controlEdge!==void 0&&(s.controlEdge=t.controlEdge),this.body.emitter.emit(e,s)}selectObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e!==void 0?(e instanceof be?(t===!0&&this._selectionAccumulator.addEdges(...e.edges),this._selectionAccumulator.addNodes(e)):this._selectionAccumulator.addEdges(e),!0):!1}deselectObject(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}_getAllNodesOverlappingWith(e){const t=[],r=this.body.nodes;for(let n=0;n<this.body.nodeIndices.length;n++){const o=this.body.nodeIndices[n];r[o].isOverlappingWith(e)&&t.push(o)}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]:!0;const r=this._pointerToPositionObject(e),n=this._getAllNodesOverlappingWith(r);if(n.length>0)return t===!0?this.body.nodes[n[n.length-1]]:n[n.length-1]}_getEdgesOverlappingWith(e,t){const r=this.body.edges;for(let n=0;n<this.body.edgeIndices.length;n++){const o=this.body.edgeIndices[n];r[o].isOverlappingWith(e)&&t.push(o)}}_getAllEdgesOverlappingWith(e){const t=[];return this._getEdgesOverlappingWith(e,t),t}getEdgeAt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const r=this.canvas.DOMtoCanvas(e);let n=10,o=null;const s=this.body.edges;for(let a=0;a<this.body.edgeIndices.length;a++){const l=this.body.edgeIndices[a],u=s[l];if(u.connected){const d=u.from.x,c=u.from.y,h=u.to.x,f=u.to.y,v=u.edgeType.getDistanceToEdge(d,c,h,f,r.x,r.y);v<n&&(o=l,n=v)}}if(o!==null)return t===!0?this.body.edges[o]:o}_addToHover(e){e instanceof be?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}_removeFromSelection(e){e instanceof be?(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 r=e.edges[t];r.hover=!0,this._addToHover(r)}}emitBlurEvent(e,t,r){const n=this._initBaseEvent(e,t);r.hover===!0&&(r.hover=!1,r instanceof be?(n.node=r.id,this.body.emitter.emit("blurNode",n)):(n.edge=r.id,this.body.emitter.emit("blurEdge",n)))}emitHoverEvent(e,t,r){const n=this._initBaseEvent(e,t);let o=!1;return r.hover===!1&&(r.hover=!0,this._addToHover(r),o=!0,r instanceof be?(n.node=r.id,this.body.emitter.emit("hoverNode",n)):(n.edge=r.id,this.body.emitter.emit("hoverEdge",n))),o}hoverObject(e,t){let r=this.getNodeAt(t);r===void 0&&(r=this.getEdgeAt(t));let n=!1;for(const o in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,o)&&(r===void 0||r instanceof be&&r.id!=o||r instanceof Fr)&&(this.emitBlurEvent(e,t,this.hoverObj.nodes[o]),delete this.hoverObj.nodes[o],n=!0);for(const o in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,o)&&(n===!0?(this.hoverObj.edges[o].hover=!1,delete this.hoverObj.edges[o]):(r===void 0||r instanceof Fr&&r.id!=o||r instanceof be&&!r.hover)&&(this.emitBlurEvent(e,t,this.hoverObj.edges[o]),delete this.hoverObj.edges[o],n=!0));if(r!==void 0){const o=Te(this.hoverObj.edges).length,s=Te(this.hoverObj.nodes).length,a=r instanceof Fr&&o===0&&s===0,l=r instanceof be&&o===0&&s===0;(n||a||l)&&(n=this.emitHoverEvent(e,t,r)),r instanceof be&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(r)}n===!0&&this.body.emitter.emit("_requestRedraw")}commitWithoutEmitting(){this._selectionAccumulator.commit()}commitAndEmit(e,t){let r=!1;const n=this._selectionAccumulator.commit(),o={nodes:n.nodes.previous,edges:n.edges.previous};n.edges.deleted.length>0&&(this.generateClickEvent("deselectEdge",t,e,o),r=!0),n.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,e,o),r=!0),n.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,e),r=!0),n.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,e),r=!0),r===!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 vn(e=this._selectionAccumulator.getNodes()).call(e,t=>t.id)}getSelectedEdgeIds(){var e;return vn(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 r of e.nodes){const n=this.body.nodes[r];if(!n)throw new RangeError('Node with id "'+r+'" not found');this.selectObject(n,t.highlightEdges)}if(e.edges)for(const r of e.edges){const n=this.body.edges[r];if(!n)throw new RangeError('Edge with id "'+r+'" not found');this.selectObject(n)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;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),r=[],n=this.body.nodeIndices,o=this.body.nodes;for(let l=n.length-1;l>=0;l--){const d=o[n[l]].getItemsOnPoint(t);r.push.apply(r,d)}const s=this.body.edgeIndices,a=this.body.edges;for(let l=s.length-1;l>=0;l--){const d=a[s[l]].getItemsOnPoint(t);r.push.apply(r,d)}return r}}var TP={},pp,PP;function Mne(){if(PP)return pp;PP=1;var i=Ln(),e=Math.floor,t=function(r,n){var o=r.length;if(o<8)for(var s=1,a,l;s<o;){for(l=s,a=r[s];l&&n(r[l-1],a)>0;)r[l]=r[--l];l!==s++&&(r[l]=a)}else for(var u=e(o/2),d=t(i(r,0,u),n),c=t(i(r,u),n),h=d.length,f=c.length,v=0,g=0;v<h||g<f;)r[v+g]=v<h&&g<f?n(d[v],c[g])<=0?d[v++]:c[g++]:v<h?d[v++]:c[g++];return r};return pp=t,pp}var gp,CP;function Nne(){if(CP)return gp;CP=1;var i=Mn(),e=i.match(/firefox\/(\d+)/i);return gp=!!e&&+e[1],gp}var yp,RP;function kne(){if(RP)return yp;RP=1;var i=Mn();return yp=/MSIE|Trident/.test(i),yp}var mp,xP;function Fne(){if(xP)return mp;xP=1;var i=Mn(),e=i.match(/AppleWebKit\/(\d+)\./);return mp=!!e&&+e[1],mp}var DP;function qne(){if(DP)return TP;DP=1;var i=z(),e=te(),t=$r(),r=Ct(),n=Or(),o=iA(),s=kt(),a=ee(),l=Mne(),u=Vn(),d=Nne(),c=kne(),h=Xo(),f=Fne(),v=[],g=e(v.sort),y=e(v.push),p=a(function(){v.sort(void 0)}),m=a(function(){v.sort(null)}),w=u("sort"),b=!a(function(){if(h)return h<70;if(!(d&&d>3)){if(c)return!0;if(f)return f<603;var I="",E,$,T,R;for(E=65;E<76;E++){switch($=String.fromCharCode(E),E){case 66:case 69:case 70:case 72:T=3;break;case 68:case 71:T=4;break;default:T=2}for(R=0;R<47;R++)v.push({k:$+R,v:T})}for(v.sort(function(C,P){return P.v-C.v}),R=0;R<v.length;R++)$=v[R].k.charAt(0),I.charAt(I.length-1)!==$&&(I+=$);return I!=="DGBEFHACIJK"}}),_=p||!m||!w||!b,S=function(I){return function(E,$){return $===void 0?-1:E===void 0?1:I!==void 0?+I(E,$)||0:s(E)>s($)?1:-1}};return i({target:"Array",proto:!0,forced:_},{sort:function(E){E!==void 0&&t(E);var $=r(this);if(b)return E===void 0?g($):g($,E);var T=[],R=n($),C,P;for(P=0;P<R;P++)P in $&&y(T,$[P]);for(l(T,S(E)),C=n(T),P=0;P<C;)$[P]=T[P++];for(;P<R;)o($,P++);return $}}),TP}var bp,AP;function Bne(){if(AP)return bp;AP=1,qne();var i=Qe();return bp=i("Array","sort"),bp}var wp,MP;function jne(){if(MP)return wp;MP=1;var i=Be(),e=Bne(),t=Array.prototype;return wp=function(r){var n=r.sort;return r===t||i(t,r)&&n===t.sort?e:n},wp}var _p,NP;function Lne(){if(NP)return _p;NP=1;var i=jne();return _p=i,_p}var Ep,kP;function zne(){return kP||(kP=1,Ep=Lne()),Ep}var Wne=zne(),sn=Y(Wne),FP={},Sp,qP;function Hne(){if(qP)return Sp;qP=1;var i=$r(),e=Ct(),t=Ga(),r=Or(),n=TypeError,o="Reduce of empty array with no initial value",s=function(a){return function(l,u,d,c){var h=e(l),f=t(h),v=r(h);if(i(u),v===0&&d<2)throw new n(o);var g=a?v-1:0,y=a?-1:1;if(d<2)for(;;){if(g in f){c=f[g],g+=y;break}if(g+=y,a?g<0:v<=g)throw new n(o)}for(;a?g>=0:v>g;g+=y)g in f&&(c=u(c,f[g],g,h));return c}};return Sp={left:s(!1),right:s(!0)},Sp}var $p,BP;function Une(){if(BP)return $p;BP=1;var i=oA();return $p=i==="NODE",$p}var jP;function Vne(){if(jP)return FP;jP=1;var i=z(),e=Hne().left,t=Vn(),r=Xo(),n=Une(),o=!n&&r>79&&r<83,s=o||!t("reduce");return i({target:"Array",proto:!0,forced:s},{reduce:function(l){var u=arguments.length;return e(this,l,u,u>1?arguments[1]:void 0)}}),FP}var Op,LP;function Gne(){if(LP)return Op;LP=1,Vne();var i=Qe();return Op=i("Array","reduce"),Op}var Ip,zP;function Kne(){if(zP)return Ip;zP=1;var i=Be(),e=Gne(),t=Array.prototype;return Ip=function(r){var n=r.reduce;return r===t||i(t,r)&&n===t.reduce?e:n},Ip}var Tp,WP;function Yne(){if(WP)return Tp;WP=1;var i=Kne();return Tp=i,Tp}var Pp,HP;function Xne(){return HP||(HP=1,Pp=Yne()),Pp}var Jne=Xne(),sM=Y(Jne);class aM{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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,r),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 Zne extends aM{constructor(e){super(),this.layout=e}curveType(){return"horizontal"}getPosition(e){return e.x}setPosition(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;r!==void 0&&this.layout.hierarchical.addToOrdering(e,r),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){sn(e).call(e,function(t,r){return t.x-r.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 Qne extends aM{constructor(e){super(),this.layout=e}curveType(){return"vertical"}getPosition(e){return e.y}setPosition(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;r!==void 0&&this.layout.hierarchical.addToOrdering(e,r),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){sn(e).call(e,function(t,r){return t.y-r.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 UP={},VP;function eoe(){if(VP)return UP;VP=1;var i=z(),e=Vr().every,t=Vn(),r=t("every");return i({target:"Array",proto:!0,forced:!r},{every:function(o){return e(this,o,arguments.length>1?arguments[1]:void 0)}}),UP}var Cp,GP;function toe(){if(GP)return Cp;GP=1,eoe();var i=Qe();return Cp=i("Array","every"),Cp}var Rp,KP;function roe(){if(KP)return Rp;KP=1;var i=Be(),e=toe(),t=Array.prototype;return Rp=function(r){var n=r.every;return r===t||i(t,r)&&n===t.every?e:n},Rp}var xp,YP;function ioe(){if(YP)return xp;YP=1;var i=roe();return xp=i,xp}var Dp,XP;function noe(){return XP||(XP=1,Dp=ioe()),Dp}var ooe=noe(),lM=Y(ooe);function soe(i,e){const t=new Pr;return de(i).call(i,r=>{var n;de(n=r.edges).call(n,o=>{o.connected&&t.add(o)})}),de(t).call(t,r=>{const n=r.from.id,o=r.to.id;e[n]==null&&(e[n]=0),(e[o]==null||e[n]>=e[o])&&(e[o]=e[n]+1)}),e}function aoe(i){return uM(e=>{var t,r;return lM(t=gt(r=e.edges).call(r,n=>i.has(n.toId))).call(t,n=>n.to===e)},(e,t)=>t>e,"from",i)}function loe(i){return uM(e=>{var t,r;return lM(t=gt(r=e.edges).call(r,n=>i.has(n.toId))).call(t,n=>n.from===e)},(e,t)=>t<e,"to",i)}function uM(i,e,t,r){var n;const o=li(null),s=sM(n=[...QA(r).call(r)]).call(n,(c,h)=>c+1+h.edges.length,0),a=t+"Id",l=t==="to"?1:-1;for(const[c,h]of r){if(!r.has(c)||!i(h))continue;o[c]=0;const f=[h];let v=0,g;for(;g=f.pop();){var u,d;if(!r.has(c))continue;const y=o[g.id]+l;if(de(u=gt(d=g.edges).call(d,p=>p.connected&&p.to!==p.from&&p[t]!==g&&r.has(p.toId)&&r.has(p.fromId))).call(u,p=>{const m=p[a],w=o[m];(w==null||e(y,w))&&(o[m]=y,f.push(p[t]))}),v>s)return soe(r,o);++v}}return o}class uoe{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){this.isTree=!1;return}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={},r=n=>{if(t[n]!==void 0)return t[n];let o=this.levels[n];if(this.childrenReference[n]){const s=this.childrenReference[n];if(s.length>0)for(let a=0;a<s.length;a++)o=Math.max(o,r(s[a]))}return t[n]=o,o};return r(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 zy;let r=0;const n=sn(e=[...new Pr($Z(this.levels))]).call(e,(o,s)=>o-s);for(const o of n)t.set(o,r++);for(const o in this.levels)Object.prototype.hasOwnProperty.call(this.levels,o)&&(this.levels[o]=t.get(this.levels[o]))}getTreeSize(e,t){let r=1e9,n=-1e9,o=1e9,s=-1e9;for(const a in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,a)&&this.trees[a]===t){const l=e[a];r=Math.min(l.x,r),n=Math.max(l.x,n),o=Math.min(l.y,o),s=Math.max(l.y,s)}return{min_x:r,max_x:n,min_y:o,max_y:s}}hasSameParent(e,t){const r=this.parentReference[e.id],n=this.parentReference[t.id];if(r===void 0||n===void 0)return!1;for(let o=0;o<r.length;o++)for(let s=0;s<n.length;s++)if(r[o]==n[s])return!0;return!1}inSameSubNetwork(e,t){return this.trees[e.id]===this.trees[t.id]}getLevels(){return Te(this.distributionOrdering)}addToOrdering(e,t){this.distributionOrdering[t]===void 0&&(this.distributionOrdering[t]=[]);let r=!1;const n=this.distributionOrdering[t];for(const o in n)if(n[o]===e){r=!0;break}r||(this.distributionOrdering[t].push(e),this.distributionIndex[e.id]=this.distributionOrdering[t].length-1)}}class doe{constructor(e){this.body=e,this._resetRNG(Math.random()+":"+aa()),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"}},Ne(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 r=this.options.hierarchical,n=r.enabled;if(Kn(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),Rt(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),r.enabled===!0)return n===!0&&this.body.emitter.emit("refresh",!0),r.direction==="RL"||r.direction==="DU"?r.levelSeparation>0&&(r.levelSeparation*=-1):r.levelSeparation<0&&(r.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(n===!0)return this.body.emitter.emit("refresh"),fe(t,this.optionsBackup)}return t}_resetRNG(e){this.initialRandomSeed=e,this._rng=sl(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?!0:t.enabled,solver:"hierarchicalRepulsion"},t.enabled=t.enabled===void 0?!0:t.enabled,t.solver=t.solver||"barnesHut"):typeof e.physics=="object"?(t.enabled=e.physics.enabled===void 0?!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 r=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:r};else{const n=e.edges.smooth;n.type!==void 0&&n.type!=="dynamic"&&(r=n.type),this.optionsBackup.edges={smooth:{enabled:n.enabled===void 0?!0:n.enabled,type:n.type===void 0?"dynamic":n.type,roundness:n.roundness===void 0?.5:n.roundness,forceDirection:n.forceDirection===void 0?!1:n.forceDirection}},e.edges.smooth={enabled:n.enabled===void 0?!0:n.enabled,type:r,roundness:n.roundness===void 0?.5:n.roundness,forceDirection:n.forceDirection===void 0?!1:n.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",r)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);const t=e.length+50;for(let r=0;r<e.length;r++){const n=e[r],o=2*Math.PI*this._rng();n.x===void 0&&(n.x=t*Math.cos(o)),n.y===void 0&&(n.y=t*Math.sin(o))}}}layoutNetwork(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){const e=this.body.nodeIndices;let t=0;for(let r=0;r<e.length;r++)this.body.nodes[e[r]].predefinedPosition===!0&&(t+=1);if(t<.5*e.length){let n=0;const o=this.options.clusterThreshold,s={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>o){const l=e.length;for(;e.length>o&&n<=10;){n+=1;const u=e.length;n%3===0?this.body.modules.clustering.clusterBridges(s):this.body.modules.clustering.clusterOutliers(s);const d=e.length;if(u==d&&n%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*l)})}n>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 a=70;for(let l=0;l<e.length;l++){const u=this.body.nodes[e[l]];u.predefinedPosition===!1&&(u.x+=(.5-this._rng())*a,u.y+=(.5-this._rng())*a)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}_shiftToCenter(){const e=nt.getRangeCore(this.body.nodes,this.body.nodeIndices),t=nt.findCenter(e);for(let r=0;r<this.body.nodeIndices.length;r++){const n=this.body.nodes[this.body.nodeIndices[r]];n.x-=t.x,n.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,r=!1,n=!1;this.lastNodeOnLevel={},this.hierarchical=new uoe;for(t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level!==void 0?(r=!0,this.hierarchical.levels[t]=e.options.level):n=!0);if(n===!0&&r===!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(n===!0){const s=this.options.hierarchical.sortMethod;s==="hubsize"?this._determineLevelsByHubsize():s==="directed"?this._determineLevelsDirected():s==="custom"&&this._determineLevelsCustomCallback()}for(const s in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,s)&&this.hierarchical.ensureLevel(s);const o=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(o),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let t=!1;const r={},n=()=>{const p=s();let m=0;for(let w=0;w<p.length-1;w++){const b=p[w].max-p[w+1].min;m+=b+this.options.hierarchical.treeSpacing,o(w+1,m)}},o=(p,m)=>{const w=this.hierarchical.trees;for(const b in w)Object.prototype.hasOwnProperty.call(w,b)&&w[b]===p&&this.direction.shift(b,m)},s=()=>{const p=[];for(let m=0;m<this.hierarchical.numTrees();m++)p.push(this.direction.getTreeSize(m));return p},a=(p,m)=>{if(!m[p.id]&&(m[p.id]=!0,this.hierarchical.childrenReference[p.id])){const w=this.hierarchical.childrenReference[p.id];if(w.length>0)for(let b=0;b<w.length;b++)a(this.body.nodes[w[b]],m)}},l=function(p){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,w=1e9,b=1e9,_=1e9,S=-1e9;for(const I in p)if(Object.prototype.hasOwnProperty.call(p,I)){const E=e.body.nodes[I],$=e.hierarchical.levels[E.id],T=e.direction.getPosition(E),[R,C]=e._getSpaceAroundNode(E,p);w=Math.min(R,w),b=Math.min(C,b),$<=m&&(_=Math.min(T,_),S=Math.max(T,S))}return[_,S,w,b]},u=(p,m)=>{const w=this.hierarchical.getMaxLevel(p.id),b=this.hierarchical.getMaxLevel(m.id);return Math.min(w,b)},d=(p,m,w)=>{const b=this.hierarchical;for(let _=0;_<m.length;_++){const S=m[_],I=b.distributionOrdering[S];if(I.length>1)for(let E=0;E<I.length-1;E++){const $=I[E],T=I[E+1];b.hasSameParent($,T)&&b.inSameSubNetwork($,T)&&p($,T,w)}}},c=function(p,m){let w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const b=e.direction.getPosition(p),_=e.direction.getPosition(m),S=Math.abs(_-b),I=e.options.hierarchical.nodeSpacing;if(S>I){const E={},$={};a(p,E),a(m,$);const T=u(p,m),R=l(E,T),C=l($,T),P=R[1],F=C[0],q=C[2];if(Math.abs(P-F)>I){let K=P-F+I;K<-q+I&&(K=-q+I),K<0&&(e._shiftBlock(m.id,K),t=!0,w===!0&&e._centerParent(m))}}},h=(p,m)=>{const w=m.id,b=m.edges,_=this.hierarchical.levels[m.id],S=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,I={},E=[];for(let q=0;q<b.length;q++){const X=b[q];if(X.toId!=X.fromId){const K=X.toId==w?X.from:X.to;I[b[q].id]=K,this.hierarchical.levels[K.id]<_&&E.push(X)}}const $=(q,X)=>{let K=0;for(let oe=0;oe<X.length;oe++)if(I[X[oe].id]!==void 0){const se=this.direction.getPosition(I[X[oe].id])-q;K+=se/Math.sqrt(se*se+S)}return K},T=(q,X)=>{let K=0;for(let oe=0;oe<X.length;oe++)if(I[X[oe].id]!==void 0){const se=this.direction.getPosition(I[X[oe].id])-q;K-=S*Math.pow(se*se+S,-1.5)}return K},R=(q,X)=>{let K=this.direction.getPosition(m);const oe={};for(let se=0;se<q;se++){const ce=$(K,X),re=T(K,X),lt=Math.max(-40,Math.min(40,Math.round(ce/re)));if(K=K-lt,oe[K]!==void 0)break;oe[K]=se}return K},C=q=>{const X=this.direction.getPosition(m);if(r[m.id]===void 0){const Le={};a(m,Le),r[m.id]=Le}const K=l(r[m.id]),oe=K[2],se=K[3],ce=q-X;let re=0;ce>0?re=Math.min(ce,se-this.options.hierarchical.nodeSpacing):ce<0&&(re=-Math.min(-ce,oe-this.options.hierarchical.nodeSpacing)),re!=0&&(this._shiftBlock(m.id,re),t=!0)},P=q=>{const X=this.direction.getPosition(m),[K,oe]=this._getSpaceAroundNode(m),se=q-X;let ce=X;se>0?ce=Math.min(X+(oe-this.options.hierarchical.nodeSpacing),q):se<0&&(ce=Math.max(X-(K-this.options.hierarchical.nodeSpacing),q)),ce!==X&&(this.direction.setPosition(m,ce),t=!0)};let F=R(p,E);C(F),F=R(p,b),P(F)},f=p=>{let m=this.hierarchical.getLevels();m=ai(m).call(m);for(let w=0;w<p;w++){t=!1;for(let b=0;b<m.length;b++){const _=m[b],S=this.hierarchical.distributionOrdering[_];for(let I=0;I<S.length;I++)h(1e3,S[I])}if(t!==!0)break}},v=p=>{let m=this.hierarchical.getLevels();m=ai(m).call(m);for(let w=0;w<p&&(t=!1,d(c,m,!0),t===!0);w++);},g=()=>{for(const p in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,p)&&this._centerParent(this.body.nodes[p])},y=()=>{let p=this.hierarchical.getLevels();p=ai(p).call(p);for(let m=0;m<p.length;m++){const w=p[m],b=this.hierarchical.distributionOrdering[w];for(let _=0;_<b.length;_++)this._centerParent(b[_])}};this.options.hierarchical.blockShifting===!0&&(v(5),g()),this.options.hierarchical.edgeMinimization===!0&&f(20),this.options.hierarchical.parentCentralization===!0&&y(),n()}_getSpaceAroundNode(e,t){let r=!0;t===void 0&&(r=!1);const n=this.hierarchical.levels[e.id];if(n!==void 0){const o=this.hierarchical.distributionIndex[e.id],s=this.direction.getPosition(e),a=this.hierarchical.distributionOrdering[n];let l=1e9,u=1e9;if(o!==0){const d=a[o-1];if(r===!0&&t[d.id]===void 0||r===!1){const c=this.direction.getPosition(d);l=s-c}}if(o!=a.length-1){const d=a[o+1];if(r===!0&&t[d.id]===void 0||r===!1){const c=this.direction.getPosition(d);u=Math.min(u,c-s)}}return[l,u]}else return[0,0]}_centerParent(e){if(this.hierarchical.parentReference[e.id]){const t=this.hierarchical.parentReference[e.id];for(let r=0;r<t.length;r++){const n=t[r],o=this.body.nodes[n],s=this.hierarchical.childrenReference[n];if(s!==void 0){const a=this._getCenterPosition(s),l=this.direction.getPosition(o),[u,d]=this._getSpaceAroundNode(o),c=l-a;(c<0&&Math.abs(c)<d-this.options.hierarchical.nodeSpacing||c>0&&Math.abs(c)<u-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(o,a)}}}}_placeNodesByHierarchy(e){this.positionedNodes={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var t;let n=Te(e[r]);n=this._indexArrayToNodes(n),sn(t=this.direction).call(t,n);let o=0;for(let s=0;s<n.length;s++){const a=n[s];if(this.positionedNodes[a.id]===void 0){const l=this.options.hierarchical.nodeSpacing;let u=l*o;o>0&&(u=this.direction.getPosition(n[s-1])+l),this.direction.setPosition(a,u,r),this._validatePositionAndContinue(a,r,u),o++}}}}_placeBranchNodes(e,t){var r;const n=this.hierarchical.childrenReference[e];if(n===void 0)return;const o=[];for(let a=0;a<n.length;a++)o.push(this.body.nodes[n[a]]);sn(r=this.direction).call(r,o);for(let a=0;a<o.length;a++){const l=o[a],u=this.hierarchical.levels[l.id];if(u>t&&this.positionedNodes[l.id]===void 0){const d=this.options.hierarchical.nodeSpacing;let c;a===0?c=this.direction.getPosition(this.body.nodes[e]):c=this.direction.getPosition(o[a-1])+d,this.direction.setPosition(l,c,u),this._validatePositionAndContinue(l,u,c)}else return}const s=this._getCenterPosition(o);this.direction.setPosition(this.body.nodes[e],s,t)}_validatePositionAndContinue(e,t,r){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){const n=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(r-n<this.options.hierarchical.nodeSpacing){const o=n+this.options.hierarchical.nodeSpacing-r,s=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(s.withChild,o)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}}_indexArrayToNodes(e){const t=[];for(let r=0;r<e.length;r++)t.push(this.body.nodes[e[r]]);return t}_getDistribution(){const e={};let t,r;for(t in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,t)){r=this.body.nodes[t];const n=this.hierarchical.levels[t]===void 0?0:this.hierarchical.levels[t];this.direction.fix(r,n),e[n]===void 0&&(e[n]={}),e[n][t]=r}return e}_getActiveEdges(e){const t=[];return Z(e.edges,r=>{var n;le(n=this.body.edgeIndices).call(n,r.id)!==-1&&t.push(r)}),t}_getHubSizes(){const e={},t=this.body.nodeIndices;Z(t,n=>{const o=this.body.nodes[n],s=this._getActiveEdges(o).length;e[s]=!0});const r=[];return Z(e,n=>{r.push(Number(n))}),sn(r).call(r,function(n,o){return o-n}),r}_determineLevelsByHubsize(){const e=(r,n)=>{this.hierarchical.levelDownstream(r,n)},t=this._getHubSizes();for(let r=0;r<t.length;++r){const n=t[r];if(n===0)break;Z(this.body.nodeIndices,o=>{const s=this.body.nodes[o];n===this._getActiveEdges(s).length&&this._crawlNetwork(e,o)})}}_determineLevelsCustomCallback(){const t=function(n,o,s){},r=(n,o,s)=>{let a=this.hierarchical.levels[n.id];a===void 0&&(a=this.hierarchical.levels[n.id]=1e5);const l=t(nt.cloneOptions(n,"node"),nt.cloneOptions(o,"node"),nt.cloneOptions(s,"edge"));this.hierarchical.levels[o.id]=a+l};this._crawlNetwork(r),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;const t=sM(e=this.body.nodeIndices).call(e,(r,n)=>(r.set(n,this.body.nodes[n]),r),new zy);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=loe(t):this.hierarchical.levels=aoe(t),this.hierarchical.setMinLevelToZero()}_generateMap(){const e=(t,r)=>{this.hierarchical.levels[r.id]>this.hierarchical.levels[t.id]&&this.hierarchical.addRelation(t.id,r.id)};this._crawlNetwork(e),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 r={},n=(o,s)=>{if(r[o.id]===void 0){this.hierarchical.setTreeIndex(o,s),r[o.id]=!0;let a;const l=this._getActiveEdges(o);for(let u=0;u<l.length;u++){const d=l[u];d.connected===!0&&(d.toId==o.id?a=d.from:a=d.to,o.id!=a.id&&(e(o,a,d),n(a,s)))}}};if(t===void 0){let o=0;for(let s=0;s<this.body.nodeIndices.length;s++){const a=this.body.nodeIndices[s];if(r[a]===void 0){const l=this.body.nodes[a];n(l,o),o+=1}}}else{const o=this.body.nodes[t];if(o===void 0){console.error("Node not found:",t);return}n(o)}}_shiftBlock(e,t){const r={},n=o=>{if(r[o])return;r[o]=!0,this.direction.shift(o,t);const s=this.hierarchical.childrenReference[o];if(s!==void 0)for(let a=0;a<s.length;a++)n(s[a])};n(e)}_findCommonParent(e,t){const r={},n=(s,a)=>{const l=this.hierarchical.parentReference[a];if(l!==void 0)for(let u=0;u<l.length;u++){const d=l[u];s[d]=!0,n(s,d)}},o=(s,a)=>{const l=this.hierarchical.parentReference[a];if(l!==void 0)for(let u=0;u<l.length;u++){const d=l[u];if(s[d]!==void 0)return{foundParent:d,withChild:a};const c=o(s,d);if(c.foundParent!==null)return c}return{foundParent:null,withChild:a}};return n(r,e),o(r,t)}setDirectionStrategy(){this.options.hierarchical.direction==="UD"||this.options.hierarchical.direction==="DU"?this.direction=new Zne(this):this.direction=new Qne(this)}_getCenterPosition(e){let t=1e9,r=-1e9;for(let n=0;n<e.length;n++){let o;if(e[n].id!==void 0)o=e[n];else{const a=e[n];o=this.body.nodes[a]}const s=this.direction.getPosition(o);t=Math.min(t,s),r=Math.max(r,s)}return .5*(t+r)}}class coe{constructor(e,t,r,n){var o,s;this.body=e,this.canvas=t,this.selectionHandler=r,this.interactionHandler=n,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}},Ne(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",A(o=this._restore).call(o,this)),this.body.emitter.on("_resetData",A(s=this._restore).call(s,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,t,r){t!==void 0&&(t.locale!==void 0?this.options.locale=t.locale:this.options.locale=r.locale,t.locales!==void 0?this.options.locales=t.locales:this.options.locales=r.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,fe(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 r=this.selectionHandler.getSelectedNodeCount(),n=this.selectionHandler.getSelectedEdgeCount(),o=r+n,s=this.options.locales[this.options.locale];let a=!1;this.options.addNode!==!1&&(this._createAddNodeButton(s),a=!0),this.options.addEdge!==!1&&(a===!0?this._createSeperator(1):a=!0,this._createAddEdgeButton(s)),r===1&&typeof this.options.editNode=="function"?(a===!0?this._createSeperator(2):a=!0,this._createEditNodeButton(s)):n===1&&r===0&&this.options.editEdge!==!1&&(a===!0?this._createSeperator(3):a=!0,this._createEditEdgeButton(s)),o!==0&&(r>0&&this.options.deleteNode!==!1?(a===!0&&this._createSeperator(4),this._createDeleteButton(s)):r===0&&this.options.deleteEdge!==!1&&(a===!0&&this._createSeperator(4),this._createDeleteButton(s))),this._bindElementEvents(this.closeDiv,A(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",A(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 r=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(r),this._createSeperator(),this._createDescription(r.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,A(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",A(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")if(e.isCluster!==!0){const t=fe({},e.options,!1);if(t.x=e.x,t.y=e.y,this.options.editNode.length===2)this.options.editNode(t,r=>{r!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(r),this.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}addEdgeMode(){var e,t,r,n,o;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var s;const a=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(a),this._createSeperator(),this._createDescription(a.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,A(s=this.toggleEditMode).call(s,this))}this._temporaryBindUI("onTouch",A(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",A(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",A(r=this._dragControlNode).call(r,this)),this._temporaryBindUI("onRelease",A(n=this._finishConnect).call(n,this)),this._temporaryBindUI("onDragStart",A(o=this._dragStartEdge).call(o,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)){const s=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(s.from.id,s.to.id);return}if(this.guiEnabled===!0){var e;const s=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(s),this._createSeperator(),this._createDescription(s.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,A(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var t,r,n,o;const s=this.body.edges[this.edgeBeingEditedId],a=this._getNewTargetNode(s.from.x,s.from.y),l=this._getNewTargetNode(s.to.x,s.to.y);this.temporaryIds.nodes.push(a.id),this.temporaryIds.nodes.push(l.id),this.body.nodes[a.id]=a,this.body.nodeIndices.push(a.id),this.body.nodes[l.id]=l,this.body.nodeIndices.push(l.id),this._temporaryBindUI("onTouch",A(t=this._controlNodeTouch).call(t,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",A(r=this._controlNodeDragStart).call(r,this)),this._temporaryBindUI("onDrag",A(n=this._controlNodeDrag).call(n,this)),this._temporaryBindUI("onDragEnd",A(o=this._controlNodeDragEnd).call(o,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",u=>{const d=s.edgeType.findBorderPositions(u);a.selected===!1&&(a.x=d.from.x,a.y=d.from.y),l.selected===!1&&(l.x=d.to.x,l.y=d.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";const e=this.selectionHandler.getSelectedNodeIds(),t=this.selectionHandler.getSelectedEdgeIds();let r;if(e.length>0){for(let n=0;n<e.length;n++)if(this.body.nodes[e[n]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(r=this.options.deleteNode)}else t.length>0&&typeof this.options.deleteEdge=="function"&&(r=this.options.deleteEdge);if(typeof r=="function"){const n={nodes:e,edges:t};if(r.length===2)r(n,o=>{o!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(o.edges),this.body.data.nodes.getDataSet().remove(o.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}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(){if(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){var e,t;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 r=fe({},this.options.controlNodeStyle);r.id="targetNode"+co(),r.hidden=!1,r.physics=!1,r.x=e,r.y=t;const n=this.body.functions.createNode(r);return n.shape.boundingBox={left:e,right:e,top:t,bottom:t},n}_createEditButton(){var e;this._clean(),this.manipulationDOM={},Ir(this.editModeDiv);const t=this.options.locales[this.options.locale],r=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(r),this._bindElementEvents(r,A(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 vr(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 r=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,A(t=this.addNodeMode).call(t,this))}_createAddEdgeButton(e){var t;const r=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,A(t=this.addEdgeMode).call(t,this))}_createEditNodeButton(e){var t;const r=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,A(t=this.editNode).call(t,this))}_createEditEdgeButton(e){var t;const r=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,A(t=this.editEdgeMode).call(t,this))}_createDeleteButton(e){var t;let r;this.options.rtl?r="vis-delete-rtl":r="vis-delete";const n=this._createButton("delete",r,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,A(t=this.deleteSelected).call(t,this))}_createBackButton(e){var t;const r=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,A(t=this.showManipulatorToolbar).call(t,this))}_createButton(e,t,r){let n=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=n,this.manipulationDOM[e+"Label"].innerText=r,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)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+is(Te(this.body.eventListeners)))}_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,r=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,r)}this.temporaryEventFunctions=[]}_bindElementEvents(e,t){const r=new nn(e,{});va(r,t),this._domEventListenerCleanupQueue.push(()=>{r.destroy()});const n=o=>{let{keyCode:s,key:a}=o;(a==="Enter"||a===" "||s===13||s===32)&&t()};e.addEventListener("keyup",n,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener("keyup",n,!1)})}_cleanupTemporaryNodesAndEdges(){for(let o=0;o<this.temporaryIds.edges.length;o++){var e;this.body.edges[this.temporaryIds.edges[o]].disconnect(),delete this.body.edges[this.temporaryIds.edges[o]];const s=le(e=this.body.edgeIndices).call(e,this.temporaryIds.edges[o]);if(s!==-1){var t;vr(t=this.body.edgeIndices).call(t,s,1)}}for(let o=0;o<this.temporaryIds.nodes.length;o++){var r;delete this.body.nodes[this.temporaryIds.nodes[o]];const s=le(r=this.body.nodeIndices).call(r,this.temporaryIds.nodes[o]);if(s!==-1){var n;vr(n=this.body.nodeIndices).call(n,s,1)}}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Ne({},this.body.view.translation)}_controlNodeDragStart(){const e=this.lastTouch,t=this.selectionHandler._pointerToPositionObject(e),r=this.body.nodes[this.temporaryIds.nodes[0]],n=this.body.nodes[this.temporaryIds.nodes[1]],o=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;const s=r.isOverlappingWith(t),a=n.isOverlappingWith(t);s===!0?(this.selectedControlNode=r,o.edgeType.from=r):a===!0&&(this.selectedControlNode=n,o.edgeType.to=n),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),r=this.canvas.DOMtoCanvas(t);this.selectedControlNode!==void 0?(this.selectedControlNode.x=r.x,this.selectedControlNode.y=r.y):this.interactionHandler.onDrag(e),this.body.emitter.emit("_redraw")}_controlNodeDragEnd(e){const t=this.body.functions.getPointer(e.center),r=this.selectionHandler._pointerToPositionObject(t),n=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();const o=this.selectionHandler._getAllNodesOverlappingWith(r);let s;for(let a=o.length-1;a>=0;a--)if(o[a]!==this.selectedControlNode.id){s=this.body.nodes[o[a]];break}if(s!==void 0&&this.selectedControlNode!==void 0)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(s.id,n.to.id):this._performEditEdge(n.from.id,s.id)}else n.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=Ne({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;const t=this.lastTouch,r=this.selectionHandler.getNodeAt(t);if(r!==void 0)if(r.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const n=this._getNewTargetNode(r.x,r.y);this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id);const o=this.body.functions.createEdge({id:"connectionEdge"+co(),from:r.id,to:n.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[o.id]=o,this.body.edgeIndices.push(o.id),this.temporaryIds.nodes.push(n.id),this.temporaryIds.edges.push(o.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){const t=this.body.functions.getPointer(e.center),r=this.selectionHandler._pointerToPositionObject(t);let n;this.temporaryIds.edges[0]!==void 0&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);const o=this.selectionHandler._getAllNodesOverlappingWith(r);let s;for(let l=o.length-1;l>=0;l--){var a;if(le(a=this.temporaryIds.nodes).call(a,o[l])===-1){s=this.body.nodes[o[l]];break}}if(e.controlEdge={from:n,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,t),this.temporaryIds.nodes[0]!==void 0){const l=this.body.nodes[this.temporaryIds.nodes[0]];l.x=this.canvas._XconvertDOMtoCanvas(t.x),l.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),r=this.selectionHandler._pointerToPositionObject(t);let n;this.temporaryIds.edges[0]!==void 0&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);const o=this.selectionHandler._getAllNodesOverlappingWith(r);let s;for(let l=o.length-1;l>=0;l--){var a;if(le(a=this.temporaryIds.nodes).call(a,o[l])===-1){s=this.body.nodes[o[l]];break}}this._cleanupTemporaryNodesAndEdges(),s!==void 0&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[n]!==void 0&&this.body.nodes[s.id]!==void 0&&this._performAddEdge(n,s.id)),e.controlEdge={from:n,to:s?s.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:co(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(t,r=>{r!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(r),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()}_performAddEdge(e,t){const r={from:e,to:t};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(r,n=>{n!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(r),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,t){const r={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label};let n=this.options.editEdge;if(typeof n=="object"&&(n=n.editWithoutDrag),typeof n=="function")if(n.length===2)n(r,o=>{o==null||this.inMode!=="editEdge"?(this.body.edges[r.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(r),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}const N="string",D="boolean",O="number",ro="array",L="object",dM="dom",hoe="any",Ap=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],Mp={borderWidth:{number:O},borderWidthSelected:{number:O,undefined:"undefined"},brokenImage:{string:N,undefined:"undefined"},chosen:{label:{boolean:D,function:"function"},node:{boolean:D,function:"function"},__type__:{object:L,boolean:D}},color:{border:{string:N},background:{string:N},highlight:{border:{string:N},background:{string:N},__type__:{object:L,string:N}},hover:{border:{string:N},background:{string:N},__type__:{object:L,string:N}},__type__:{object:L,string:N}},opacity:{number:O,undefined:"undefined"},fixed:{x:{boolean:D},y:{boolean:D},__type__:{object:L,boolean:D}},font:{align:{string:N},color:{string:N},size:{number:O},face:{string:N},background:{string:N},strokeWidth:{number:O},strokeColor:{string:N},vadjust:{number:O},multi:{boolean:D,string:N},bold:{color:{string:N},size:{number:O},face:{string:N},mod:{string:N},vadjust:{number:O},__type__:{object:L,string:N}},boldital:{color:{string:N},size:{number:O},face:{string:N},mod:{string:N},vadjust:{number:O},__type__:{object:L,string:N}},ital:{color:{string:N},size:{number:O},face:{string:N},mod:{string:N},vadjust:{number:O},__type__:{object:L,string:N}},mono:{color:{string:N},size:{number:O},face:{string:N},mod:{string:N},vadjust:{number:O},__type__:{object:L,string:N}},__type__:{object:L,string:N}},group:{string:N,number:O,undefined:"undefined"},heightConstraint:{minimum:{number:O},valign:{string:N},__type__:{object:L,boolean:D,number:O}},hidden:{boolean:D},icon:{face:{string:N},code:{string:N},size:{number:O},color:{string:N},weight:{string:N,number:O},__type__:{object:L}},id:{string:N,number:O},image:{selected:{string:N,undefined:"undefined"},unselected:{string:N,undefined:"undefined"},__type__:{object:L,string:N}},imagePadding:{top:{number:O},right:{number:O},bottom:{number:O},left:{number:O},__type__:{object:L,number:O}},label:{string:N,undefined:"undefined"},labelHighlightBold:{boolean:D},level:{number:O,undefined:"undefined"},margin:{top:{number:O},right:{number:O},bottom:{number:O},left:{number:O},__type__:{object:L,number:O}},mass:{number:O},physics:{boolean:D},scaling:{min:{number:O},max:{number:O},label:{enabled:{boolean:D},min:{number:O},max:{number:O},maxVisible:{number:O},drawThreshold:{number:O},__type__:{object:L,boolean:D}},customScalingFunction:{function:"function"},__type__:{object:L}},shadow:{enabled:{boolean:D},color:{string:N},size:{number:O},x:{number:O},y:{number:O},__type__:{object:L,boolean:D}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:D,array:ro},borderRadius:{number:O},interpolation:{boolean:D},useImageSize:{boolean:D},useBorderWithImage:{boolean:D},coordinateOrigin:{string:["center","top-left"]},__type__:{object:L}},size:{number:O},title:{string:N,dom:dM,undefined:"undefined"},value:{number:O,undefined:"undefined"},widthConstraint:{minimum:{number:O},maximum:{number:O},__type__:{object:L,boolean:D,number:O}},x:{number:O},y:{number:O},__type__:{object:L}},foe={configure:{enabled:{boolean:D},filter:{boolean:D,string:N,array:ro,function:"function"},container:{dom:dM},showButton:{boolean:D},__type__:{object:L,boolean:D,string:N,array:ro,function:"function"}},edges:{arrows:{to:{enabled:{boolean:D},scaleFactor:{number:O},type:{string:Ap},imageHeight:{number:O},imageWidth:{number:O},src:{string:N},__type__:{object:L,boolean:D}},middle:{enabled:{boolean:D},scaleFactor:{number:O},type:{string:Ap},imageWidth:{number:O},imageHeight:{number:O},src:{string:N},__type__:{object:L,boolean:D}},from:{enabled:{boolean:D},scaleFactor:{number:O},type:{string:Ap},imageWidth:{number:O},imageHeight:{number:O},src:{string:N},__type__:{object:L,boolean:D}},__type__:{string:["from","to","middle"],object:L}},endPointOffset:{from:{number:O},to:{number:O},__type__:{object:L,number:O}},arrowStrikethrough:{boolean:D},background:{enabled:{boolean:D},color:{string:N},size:{number:O},dashes:{boolean:D,array:ro},__type__:{object:L,boolean:D}},chosen:{label:{boolean:D,function:"function"},edge:{boolean:D,function:"function"},__type__:{object:L,boolean:D}},color:{color:{string:N},highlight:{string:N},hover:{string:N},inherit:{string:["from","to","both"],boolean:D},opacity:{number:O},__type__:{object:L,string:N}},dashes:{boolean:D,array:ro},font:{color:{string:N},size:{number:O},face:{string:N},background:{string:N},strokeWidth:{number:O},strokeColor:{string:N},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:O},multi:{boolean:D,string:N},bold:{color:{string:N},size:{number:O},face:{string:N},mod:{string:N},vadjust:{number:O},__type__:{object:L,string:N}},boldital:{color:{string:N},size:{number:O},face:{string:N},mod:{string:N},vadjust:{number:O},__type__:{object:L,string:N}},ital:{color:{string:N},size:{number:O},face:{string:N},mod:{string:N},vadjust:{number:O},__type__:{object:L,string:N}},mono:{color:{string:N},size:{number:O},face:{string:N},mod:{string:N},vadjust:{number:O},__type__:{object:L,string:N}},__type__:{object:L,string:N}},hidden:{boolean:D},hoverWidth:{function:"function",number:O},label:{string:N,undefined:"undefined"},labelHighlightBold:{boolean:D},length:{number:O,undefined:"undefined"},physics:{boolean:D},scaling:{min:{number:O},max:{number:O},label:{enabled:{boolean:D},min:{number:O},max:{number:O},maxVisible:{number:O},drawThreshold:{number:O},__type__:{object:L,boolean:D}},customScalingFunction:{function:"function"},__type__:{object:L}},selectionWidth:{function:"function",number:O},selfReferenceSize:{number:O},selfReference:{size:{number:O},angle:{number:O},renderBehindTheNode:{boolean:D},__type__:{object:L}},shadow:{enabled:{boolean:D},color:{string:N},size:{number:O},x:{number:O},y:{number:O},__type__:{object:L,boolean:D}},smooth:{enabled:{boolean:D},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:O},forceDirection:{string:["horizontal","vertical","none"],boolean:D},__type__:{object:L,boolean:D}},title:{string:N,undefined:"undefined"},width:{number:O},widthConstraint:{maximum:{number:O},__type__:{object:L,boolean:D,number:O}},value:{number:O,undefined:"undefined"},__type__:{object:L}},groups:{useDefaultGroups:{boolean:D},__any__:Mp,__type__:{object:L}},interaction:{dragNodes:{boolean:D},dragView:{boolean:D},hideEdgesOnDrag:{boolean:D},hideEdgesOnZoom:{boolean:D},hideNodesOnDrag:{boolean:D},hover:{boolean:D},keyboard:{enabled:{boolean:D},speed:{x:{number:O},y:{number:O},zoom:{number:O},__type__:{object:L}},bindToWindow:{boolean:D},autoFocus:{boolean:D},__type__:{object:L,boolean:D}},multiselect:{boolean:D},navigationButtons:{boolean:D},selectable:{boolean:D},selectConnectedEdges:{boolean:D},hoverConnectedEdges:{boolean:D},tooltipDelay:{number:O},zoomView:{boolean:D},zoomSpeed:{number:O},__type__:{object:L}},layout:{randomSeed:{undefined:"undefined",number:O,string:N},improvedLayout:{boolean:D},clusterThreshold:{number:O},hierarchical:{enabled:{boolean:D},levelSeparation:{number:O},nodeSpacing:{number:O},treeSpacing:{number:O},blockShifting:{boolean:D},edgeMinimization:{boolean:D},parentCentralization:{boolean:D},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:L,boolean:D}},__type__:{object:L}},manipulation:{enabled:{boolean:D},initiallyActive:{boolean:D},addNode:{boolean:D,function:"function"},addEdge:{boolean:D,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:L,boolean:D,function:"function"}},deleteNode:{boolean:D,function:"function"},deleteEdge:{boolean:D,function:"function"},controlNodeStyle:Mp,__type__:{object:L,boolean:D}},nodes:Mp,physics:{enabled:{boolean:D},barnesHut:{theta:{number:O},gravitationalConstant:{number:O},centralGravity:{number:O},springLength:{number:O},springConstant:{number:O},damping:{number:O},avoidOverlap:{number:O},__type__:{object:L}},forceAtlas2Based:{theta:{number:O},gravitationalConstant:{number:O},centralGravity:{number:O},springLength:{number:O},springConstant:{number:O},damping:{number:O},avoidOverlap:{number:O},__type__:{object:L}},repulsion:{centralGravity:{number:O},springLength:{number:O},springConstant:{number:O},nodeDistance:{number:O},damping:{number:O},__type__:{object:L}},hierarchicalRepulsion:{centralGravity:{number:O},springLength:{number:O},springConstant:{number:O},nodeDistance:{number:O},damping:{number:O},avoidOverlap:{number:O},__type__:{object:L}},maxVelocity:{number:O},minVelocity:{number:O},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:D},iterations:{number:O},updateInterval:{number:O},onlyDynamicEdges:{boolean:D},fit:{boolean:D},__type__:{object:L,boolean:D}},timestep:{number:O},adaptiveTimestep:{boolean:D},wind:{x:{number:O},y:{number:O},__type__:{object:L}},__type__:{object:L,boolean:D}},autoResize:{boolean:D},clickToUse:{boolean:D},locale:{string:N},locales:{__any__:{any:hoe},__type__:{object:L}},height:{string:N},width:{string:N},__type__:{object:L}},cM={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]}}},voe=(i,e,t)=>{var r;return!!(Mr(i).call(i,"physics")&&Mr(r=cM.physics.solver).call(r,e)&&t.physics.solver!==e&&e!=="wind")};class poe{constructor(){}getDistances(e,t,r){const n={},o=e.edges;for(let a=0;a<t.length;a++){const l=t[a],u={};n[l]=u;for(let d=0;d<t.length;d++)u[t[d]]=a==d?0:1e9}for(let a=0;a<r.length;a++){const l=o[r[a]];l.connected===!0&&n[l.fromId]!==void 0&&n[l.toId]!==void 0&&(n[l.fromId][l.toId]=1,n[l.toId][l.fromId]=1)}const s=t.length;for(let a=0;a<s;a++){const l=t[a],u=n[l];for(let d=0;d<s-1;d++){const c=t[d],h=n[c];for(let f=d+1;f<s;f++){const v=t[f],g=n[v],y=Math.min(h[v],h[l]+u[v]);h[v]=y,g[c]=y}}}return n}}class goe{constructor(e,t,r){this.body=e,this.springLength=t,this.springConstant=r,this.distanceSolver=new poe}setOptions(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}solve(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const n=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(n),this._createK_matrix(n),this._createE_matrix();const o=.01,s=1;let a=0;const l=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),u=5;let d=1e9,c=0,h=0,f=0,v=0,g=0;for(;d>o&&a<l;)for(a+=1,[c,d,h,f]=this._getHighestEnergyNode(r),v=d,g=0;v>s&&g<u;)g+=1,this._moveNode(c,h,f),[v,h,f]=this._getEnergy(c)}_getHighestEnergyNode(e){const t=this.body.nodeIndices,r=this.body.nodes;let n=0,o=t[0],s=0,a=0;for(let l=0;l<t.length;l++){const u=t[l];if(r[u].predefinedPosition!==!0||r[u].isCluster===!0&&e===!0||r[u].options.fixed.x!==!0||r[u].options.fixed.y!==!0){const[d,c,h]=this._getEnergy(u);n<d&&(n=d,o=u,s=c,a=h)}}return[o,n,s,a]}_getEnergy(e){const[t,r]=this.E_sums[e];return[Math.sqrt(t**2+r**2),t,r]}_moveNode(e,t,r){const n=this.body.nodeIndices,o=this.body.nodes;let s=0,a=0,l=0;const u=o[e].x,d=o[e].y,c=this.K_matrix[e],h=this.L_matrix[e];for(let b=0;b<n.length;b++){const _=n[b];if(_!==e){const S=o[_].x,I=o[_].y,E=c[_],$=h[_],T=1/((u-S)**2+(d-I)**2)**1.5;s+=E*(1-$*(d-I)**2*T),a+=E*($*(u-S)*(d-I)*T),l+=E*(1-$*(u-S)**2*T)}}const f=s,v=a,g=t,y=l,p=r,m=(g/f+p/v)/(v/f-y/v),w=-(v*m+g)/f;o[e].x+=w,o[e].y+=m,this._updateE_matrix(e)}_createL_matrix(e){const t=this.body.nodeIndices,r=this.springLength;this.L_matrix=[];for(let n=0;n<t.length;n++){this.L_matrix[t[n]]={};for(let o=0;o<t.length;o++)this.L_matrix[t[n]][t[o]]=r*e[t[n]][t[o]]}}_createK_matrix(e){const t=this.body.nodeIndices,r=this.springConstant;this.K_matrix=[];for(let n=0;n<t.length;n++){this.K_matrix[t[n]]={};for(let o=0;o<t.length;o++)this.K_matrix[t[n]][t[o]]=r*e[t[n]][t[o]]**-2}}_createE_matrix(){const e=this.body.nodeIndices,t=this.body.nodes;this.E_matrix={},this.E_sums={};for(let r=0;r<e.length;r++)this.E_matrix[e[r]]=[];for(let r=0;r<e.length;r++){const n=e[r],o=t[n].x,s=t[n].y;let a=0,l=0;for(let u=r;u<e.length;u++){const d=e[u];if(d!==n){const c=t[d].x,h=t[d].y,f=1/Math.sqrt((o-c)**2+(s-h)**2);this.E_matrix[n][u]=[this.K_matrix[n][d]*(o-c-this.L_matrix[n][d]*(o-c)*f),this.K_matrix[n][d]*(s-h-this.L_matrix[n][d]*(s-h)*f)],this.E_matrix[d][r]=this.E_matrix[n][u],a+=this.E_matrix[n][u][0],l+=this.E_matrix[n][u][1]}}this.E_sums[n]=[a,l]}}_updateE_matrix(e){const t=this.body.nodeIndices,r=this.body.nodes,n=this.E_matrix[e],o=this.K_matrix[e],s=this.L_matrix[e],a=r[e].x,l=r[e].y;let u=0,d=0;for(let c=0;c<t.length;c++){const h=t[c];if(h!==e){const f=n[c],v=f[0],g=f[1],y=r[h].x,p=r[h].y,m=1/Math.sqrt((a-y)**2+(l-p)**2),w=o[h]*(a-y-s[h]*(a-y)*m),b=o[h]*(l-p-s[h]*(l-p)*m);n[c]=[w,b],u+=w,d+=b;const _=this.E_sums[h];_[0]+=w-v,_[1]+=b-g}}this.E_sums[e]=[u,d]}}function B(i,e,t){var r,n,o,s;if(!(this instanceof B))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:jee,clickToUse:!1},Ne(this.options,this.defaultOptions),this.body={container:i,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:A(r=this.on).call(r,this),off:A(n=this.off).call(n,this),emit:A(o=this.emit).call(o,this),once:A(s=this.once).call(s,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 Wee(()=>this.body.emitter.emit("_requestRedraw")),this.groups=new nte,this.canvas=new Zie(this.body),this.selectionHandler=new Ane(this.body,this.canvas),this.interactionHandler=new rne(this.body,this.canvas,this.selectionHandler),this.view=new ene(this.body,this.canvas),this.renderer=new Gie(this.body,this.canvas),this.physics=new Bie(this.body),this.layoutEngine=new doe(this.body),this.clustering=new Vie(this.body),this.manipulation=new coe(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new fie(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new Aie(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new goe(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(t),this.setData(e)}LD(B.prototype);B.prototype.setOptions=function(i){if(i===null&&(i=void 0),i!==void 0){if(yee.validate(i,foe)===!0&&console.error("%cErrors have been found in the supplied options object.",kA),Kn(["locale","locales","clickToUse"],this.options,i),i.locale!==void 0&&(i.locale=Lee(i.locales||this.options.locales,i.locale)),i=this.layoutEngine.setOptions(i.layout,i),this.canvas.setOptions(i),this.groups.setOptions(i.groups),this.nodesHandler.setOptions(i.nodes),this.edgesHandler.setOptions(i.edges),this.physics.setOptions(i.physics),this.manipulation.setOptions(i.manipulation,i,this.options),this.interactionHandler.setOptions(i.interaction),this.renderer.setOptions(i.interaction),this.selectionHandler.setOptions(i.interaction),i.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in i&&(this.configurator||(this.configurator=new pee(this,this.body.container,cM,this.canvas.pixelRatio,voe)),this.configurator.setOptions(i.configure)),this.configurator&&this.configurator.options.enabled===!0){const r={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};fe(r.nodes,this.nodesHandler.options),fe(r.edges,this.edgesHandler.options),fe(r.layout,this.layoutEngine.options),fe(r.interaction,this.selectionHandler.options),fe(r.interaction,this.renderer.options),fe(r.interaction,this.interactionHandler.options),fe(r.manipulation,this.manipulation.options),fe(r.physics,this.physics.options),fe(r.global,this.canvas.options),fe(r.global,this.options),this.configurator.setModuleOptions(r)}i.clickToUse!==void 0?i.clickToUse===!0?this.activator===void 0&&(this.activator=new vee(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")}};B.prototype._updateVisibleIndices=function(){const i=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&!this.clustering._isClusteredNode(t)&&i[t].options.hidden===!1&&this.body.nodeIndices.push(i[t].id);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t],n=i[r.fromId],o=i[r.toId],s=n!==void 0&&o!==void 0;!this.clustering._isClusteredEdge(t)&&r.options.hidden===!1&&s&&n.options.hidden===!1&&o.options.hidden===!1&&this.body.edgeIndices.push(r.id)}};B.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")})};B.prototype.setData=function(i){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),i&&i.dot&&(i.nodes||i.edges))throw new SyntaxError('Data must contain either parameter "dot" or  parameter pair "nodes" and "edges", but not both.');if(this.setOptions(i&&i.options),i&&i.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=Tee(i.dot);this.setData(e);return}else if(i&&i.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=Pee(i.gephi);this.setData(e);return}else this.nodesHandler.setData(i&&i.nodes,!0),this.edgesHandler.setData(i&&i.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")};B.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 i in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,i)&&delete this.body.nodes[i];for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&delete this.body.edges[i];Ir(this.body.container)};B.prototype._updateValueRange=function(i){let e,t,r,n=0;for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)){const o=i[e].getValue();o!==void 0&&(t=t===void 0?o:Math.min(o,t),r=r===void 0?o:Math.max(o,r),n+=o)}if(t!==void 0&&r!==void 0)for(e in i)Object.prototype.hasOwnProperty.call(i,e)&&i[e].setValueRange(t,r,n)};B.prototype.isActive=function(){return!this.activator||this.activator.active};B.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)};B.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)};B.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)};B.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)};B.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)};B.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)};B.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)};B.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)};B.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)};B.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)};B.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)};B.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)};B.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)};B.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)};B.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)};B.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)};B.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)};B.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)};B.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)};B.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)};B.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)};B.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)};B.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)};B.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)};B.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)};B.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)};B.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)};B.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)};B.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)};B.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)};B.prototype.getConnectedNodes=function(i){return this.body.nodes[i]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)};B.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)};B.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)};B.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)};B.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)};B.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)};B.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)};B.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)};B.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)};B.prototype.getNodeAt=function(){const i=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return i!==void 0&&i.id!==void 0?i.id:i};B.prototype.getEdgeAt=function(){const i=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return i!==void 0&&i.id!==void 0?i.id:i};B.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)};B.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)};B.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()};B.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)};B.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)};B.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)};B.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)};B.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)};B.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)};B.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)};B.prototype.getOptionsFromConfigurator=function(){let i={};return this.configurator&&(i=this.configurator.getOptions.apply(this.configurator)),i};const yoe=({graph:i,options:e={},events:t={},getNetwork:r,setGraphReady:n,networkRef:o,width:s,height:a})=>{const l=Qr.useRef(null),u=Qr.useRef({w:0,h:0});return Qr.useEffect(()=>{if(!l.current)return;console.log("render NetworkGraph",i),n(!1);const d=i.nodes,c=i.edges,h={nodes:d,edges:c},f=new B(l.current,h,e);o.current=f,Object.keys(t).forEach(y=>{f.on(y,t[y])}),r&&r(f);const v=new ResizeObserver(y=>{for(const p of y){const{width:m,height:w}=p.contentRect;if(!(m===0||w===0)){if(Math.floor(m)===Math.floor(u.current.w)&&Math.floor(w)===Math.floor(u.current.h))return;u.current={w:m,h:w},requestAnimationFrame(()=>{try{f.setSize(`${m}px`,`${w}px`),f.fit({animation:{duration:400,easingFunction:"easeInOutQuad"}})}catch(b){console.warn("network resize error",b)}})}}}),g=l.current;return v.observe(g),console.log("onReady"),n(!0),()=>{f.destroy(),v.disconnect()}},[JSON.stringify(i)]),Ae.jsx("div",{ref:l,style:{width:s,height:a}})},moe={CORRELATED_WITH:"#1f77b4",PRODUCES:"#ff7f0e",MODULATES:"#2ca02c",ACTIVATES:"#d62728",INHIBITS:"#9467bd"},JP=[{label:"Disease",color:"#FF9900",shape:"triangle"},{label:"Microbe",color:"#2B7CE9",shape:"dot"},{label:"Compound",color:"#5A1E5C",shape:"square"},{label:"Pathway",color:"#C5000B",shape:"square"}],ZP=[{label:"CORRELATED_WITH",color:"#1f77b4"},{label:"PRODUCES",color:"#ff7f0e"},{label:"MODULATES",color:"#2ca02c"},{label:"ACTIVATES",color:"#d62728"},{label:"INHIBITS",color:"#9467bd"}],Coe=({setGraphReady:i,graphReady:e,width:t,height:r,graphData:n,openView:o})=>{const[s,a]=Qr.useState(!0),[l,u]=Qr.useState(null),d=Qr.useRef(null);function c(y){const p={},m=y.nodes.map(b=>(p[b.id]=b.id,{id:b.id,label:b.entity_name,title:`${b.label}: ${b.entity_name}`,group:b.label})),w=[];return y.links.forEach(b=>{const _=p[b.source],S=p[b.target],I=[],E=[],$=[];let T;b.relations.forEach(R=>{I.push(`${R.type||""}${R.effect?" ("+R.effect+")":""}`),E.push(`${R.study_name||""}${R.effect?" ("+R.effect+")":""}`),$.push(R.association_id),T=moe[R.type];const C=ZP.find(P=>P.label==R.type);C&&(T=C.color)}),w.push({from:_,to:S,color:T,length:150,fontColor:T,width:b.relations.length*2,title:I.join(", "),label:E.join(", ")})}),{nodes:m,edges:w}}const h=Qr.useMemo(()=>{const y=c(n);return console.log(y),y},[n]),f=JP.reduce((y,p)=>(y[p.label]={shape:p.shape,color:p.color},y),{}),v={layout:{hierarchical:!1},interaction:{hover:!0},physics:{stabilization:!0},edges:{color:"#000000",scaling:{label:!0},shadow:!0,smooth:!0,arrows:{to:{enabled:!0,type:"arrow",scaleFactor:1},from:{enabled:!1},middle:{enabled:!1}}},height:`${r}px`,width:`${t}px`,groups:f,autoResize:!0},g={click:y=>{if(y.nodes.length>0){const p=y.nodes[0];console.log("clicked node:",p),o("details",{id:p})}else if(y.edges.length>0&&d.current){const p=d.current,m=y.edges[0],w=p.getConnectedNodes(m);console.log("clicked edge:",m,"connected nodes:",w);const b=p.body.data.nodes.get(w[0]),_=p.body.data.nodes.get(w[1]);o("relation",{fromNode:b,toNode:_})}},select:function(y){var{nodes:p,edges:m}=y},selectNode:y=>{},selectEdge:y=>{},initRedraw:()=>{}};return Ae.jsxs("div",{style:{position:"relative",width:t,height:r},children:[Ae.jsxs("div",{style:{position:"absolute",top:10,left:10,backgroundColor:"rgba(255, 255, 255, 0.95)",padding:12,borderRadius:8,boxShadow:"0 4px 12px rgba(0,0,0,0.2)",zIndex:10,maxWidth:220,fontFamily:"Arial, sans-serif",fontSize:13,userSelect:"none",width:"13rem"},children:[Ae.jsxs("div",{onClick:()=>a(!s),style:{cursor:"pointer",fontWeight:600,marginBottom:`${s?"1rem":0}`,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Ae.jsx("span",{children:"Legend"}),s?Ae.jsx(fM,{}):Ae.jsx(vM,{})]}),s&&Ae.jsxs(Ae.Fragment,{children:[Ae.jsxs("div",{style:{marginBottom:8},children:[Ae.jsx("strong",{children:"Node Types"}),JP.map(y=>Ae.jsxs("div",{style:{display:"flex",alignItems:"center",margin:"4px 0"},children:[Ae.jsx("div",{style:{width:18,height:18,backgroundColor:y.color,clipPath:y.shape==="triangle"?"polygon(50% 0%, 0% 100%, 100% 100%)":"none",borderRadius:y.shape==="dot"?"50%":"0",marginRight:6}}),Ae.jsx("span",{children:y.label})]},y.label))]}),Ae.jsxs("div",{children:[Ae.jsx("strong",{children:"Edge Types"}),ZP.map(y=>Ae.jsxs("div",{style:{display:"flex",alignItems:"center",margin:"4px 0"},children:[Ae.jsx("div",{style:{width:30,height:4,backgroundColor:y.color,marginRight:6,borderRadius:2}}),Ae.jsx("span",{children:y.label})]},y.label))]})]})]}),Ae.jsx(yoe,{width:`${t}px`,height:`${r}px`,networkRef:d,setGraphReady:i,graph:h,options:v,events:g,getNetwork:y=>{u(y)}})]})};export{Coe as default};
