@matdata/yasgui-graph-plugin 1.0.8 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var GraphPlugin=(()=>{var oC=Object.defineProperty;var Gh=Object.getOwnPropertyDescriptor;var Vh=Object.getOwnPropertyNames;var jh=Object.prototype.hasOwnProperty;var Wh=(I,g)=>{for(var e in g)oC(I,e,{get:g[e],enumerable:!0})},Yh=(I,g,e,t)=>{if(g&&typeof g=="object"||typeof g=="function")for(let A of Vh(g))!jh.call(I,A)&&A!==e&&oC(I,A,{get:()=>g[A],enumerable:!(t=Gh(g,A))||t.enumerable});return I};var _h=I=>Yh(oC({},"__esModule",{value:!0}),I);var GM={};Wh(GM,{default:()=>LM});function Mo(I){let g=new Map;if(I&&I.getPrefixes){let t=I.getPrefixes();t&&typeof t=="object"&&Object.entries(t).forEach(([A,C])=>{C&&A&&g.set(C,A)})}return Object.entries({"http://www.w3.org/1999/02/22-rdf-syntax-ns#":"rdf","http://www.w3.org/2000/01/rdf-schema#":"rdfs","http://www.w3.org/2001/XMLSchema#":"xsd","http://www.w3.org/2002/07/owl#":"owl"}).forEach(([t,A])=>{g.has(t)||g.set(t,A)}),g}function de(I,g){if(!I||typeof I!="string")return I;for(let[e,t]of g.entries())if(I.startsWith(e)){let A=I.substring(e.length);return`${t}:${A}`}return I}function Pt(I,g=50){return!I||typeof I!="string"||I.length<=g?I:I.substring(0,g-3)+"..."}function Fo(){return{autoResize:!0,width:"100%",height:"100%",physics:{enabled:!0,stabilization:{enabled:!0,iterations:200,updateInterval:25},barnesHut:{gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09}},interaction:{dragNodes:!0,dragView:!0,zoomView:!0,hover:!0,tooltipDelay:300},nodes:{shape:"dot",size:20,font:{size:14,color:"#000000",align:"center",vadjust:0,multi:!1},borderWidth:2,borderWidthSelected:3,labelHighlightBold:!0,fixed:{x:!1,y:!1}},edges:{arrows:{to:{enabled:!0,scaleFactor:.5}},smooth:{enabled:!0,type:"dynamic"},font:{size:12,align:"middle"}}}}function Bo(I){let g=[];return!I||!I.getBindings||I.getBindings().forEach(t=>{if(!t.subject||!t.predicate||!t.object)return;let A={subject:t.subject.value,predicate:t.predicate.value,object:{value:t.object.value,type:t.object.type||"uri",datatype:t.object.datatype,lang:t.object["xml:lang"]}};g.push(A)}),g}function sC(I,g){return I.uri&&I.uri.startsWith("_:")?"#c5c5c5ff":I.type==="literal"?"#a6c8a6ff":g.some(t=>t.predicate==="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"&&t.object.value===I.uri)?"#e15b13ff":"#97C2FC"}function Kh(I,g){let e=new Map,t=1;return I.forEach(A=>{if(!e.has(A.subject)){let i=A.subject.startsWith("_:"),n=i?A.subject:Pt(de(A.subject,g));e.set(A.subject,{id:t++,uri:A.subject,label:n,color:sC({uri:A.subject,type:"uri"},I),type:"uri",fullValue:A.subject,title:i?A.subject:de(A.subject,g),font:{vadjust:-30,align:"center"}})}let C=A.object.value;if(!e.has(C)){let i=A.object.type==="literal",n=!i&&C.startsWith("_:"),o,s,r;i?(o=Pt(C),s=C,r=A.object.datatype?`"${C}"^^${de(A.object.datatype,g)}`:`"${C}"`):n?(o=C,s=C,r=C):(o=Pt(de(C,g)),s=C,r=de(C,g)),e.set(C,{id:t++,uri:i?null:C,label:o,color:sC({uri:C,type:i?"literal":"uri"},I),type:i?"literal":"uri",fullValue:s,title:r,font:{vadjust:-30,align:"center"}})}}),e}function Uh(I,g,e){let t=[],A=new Set;return I.forEach(C=>{let i=g.get(C.subject),n=g.get(C.object.value);if(!i||!n)return;let o=`${i.id}-${C.predicate}-${n.id}`;A.has(o)||(A.add(o),t.push({id:`edge_${i.id}_${n.id}_${t.length}`,from:i.id,to:n.id,label:Pt(de(C.predicate,e)),predicate:C.predicate,title:de(C.predicate,e),arrows:"to"}))}),t}function zo(I,g){let e=Kh(I,g),t=Uh(I,e,g);return{nodes:Array.from(e.values()),edges:t}}var rC=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function D(I){return I&&I.__esModule&&Object.prototype.hasOwnProperty.call(I,"default")?I.default:I}var FA=function(I){return I&&I.Math===Math&&I},X=FA(typeof globalThis=="object"&&globalThis)||FA(typeof window=="object"&&window)||FA(typeof self=="object"&&self)||FA(typeof rC=="object"&&rC)||function(){return this}()||rC||Function("return this")(),z=function(I){try{return!!I()}catch(g){return!0}},Hh=z,eA=!Hh(function(){var I=function(){}.bind();return typeof I!="function"||I.hasOwnProperty("prototype")}),Qh=eA,Ra=Function.prototype,Zo=Ra.apply,Lo=Ra.call,VI=typeof Reflect=="object"&&Reflect.apply||(Qh?Lo.bind(Zo):function(){return Lo.apply(Zo,arguments)}),Na=eA,Sa=Function.prototype,ci=Sa.call,Xh=Na&&Sa.bind.bind(ci,ci),Z=Na?Xh:function(I){return function(){return ci.apply(I,arguments)}},ka=Z,Jh=ka({}.toString),$h=ka("".slice),se=function(I){return $h(Jh(I),8,-1)},qh=se,gc=Z,_n=function(I){if(qh(I)==="Function")return gc(I)},ui=typeof document=="object"&&document.all,ec=typeof ui=="undefined"&&ui!==void 0,Ma={all:ui,IS_HTMLDDA:ec},Fa=Ma,tc=Fa.all,lg=Fa.IS_HTMLDDA?function(I){return typeof I=="function"||I===tc}:function(I){return typeof I=="function"},tA={},Ac=z,ig=!Ac(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Ic=eA,BA=Function.prototype.call,jg=Ic?BA.bind(BA):function(){return BA.apply(BA,arguments)},AA={},Ba={}.propertyIsEnumerable,za=Object.getOwnPropertyDescriptor,Cc=za&&!Ba.call({1:2},1);AA.f=Cc?function(g){var e=za(this,g);return!!e&&e.enumerable}:Ba;var IA=function(I,g){return{enumerable:!(I&1),configurable:!(I&2),writable:!(I&4),value:g}},ic=Z,nc=z,oc=se,aC=Object,sc=ic("".split),jI=nc(function(){return!aC("z").propertyIsEnumerable(0)})?function(I){return oc(I)==="String"?sc(I,""):aC(I)}:aC,ft=function(I){return I==null},rc=ft,ac=TypeError,CA=function(I){if(rc(I))throw new ac("Can't call method on "+I);return I},dc=jI,lc=CA,Wg=function(I){return dc(lc(I))},Go=lg,Za=Ma,hc=Za.all,cg=Za.IS_HTMLDDA?function(I){return typeof I=="object"?I!==null:Go(I)||I===hc}:function(I){return typeof I=="object"?I!==null:Go(I)},L={},dC=L,lC=X,cc=lg,Vo=function(I){return cc(I)?I:void 0},Yg=function(I,g){return arguments.length<2?Vo(dC[I])||Vo(lC[I]):dC[I]&&dC[I][g]||lC[I]&&lC[I][g]},uc=Z,J=uc({}.isPrototypeOf),iA=typeof navigator!="undefined"&&String(navigator.userAgent)||"",La=X,hC=iA,jo=La.process,Wo=La.Deno,Yo=jo&&jo.versions||Wo&&Wo.version,_o=Yo&&Yo.v8,Bg,lI;_o&&(Bg=_o.split("."),lI=Bg[0]>0&&Bg[0]<4?1:+(Bg[0]+Bg[1]));!lI&&hC&&(Bg=hC.match(/Edge\/(\d+)/),(!Bg||Bg[1]>=74)&&(Bg=hC.match(/Chrome\/(\d+)/),Bg&&(lI=+Bg[1])));var nA=lI,Ko=nA,fc=z,pc=X,mc=pc.String,pt=!!Object.getOwnPropertySymbols&&!fc(function(){var I=Symbol("symbol detection");return!mc(I)||!(Object(I)instanceof Symbol)||!Symbol.sham&&Ko&&Ko<41}),vc=pt,Ga=vc&&!Symbol.sham&&typeof Symbol.iterator=="symbol",bc=Yg,yc=lg,wc=J,Ec=Ga,Tc=Object,oA=Ec?function(I){return typeof I=="symbol"}:function(I){var g=bc("Symbol");return yc(g)&&wc(g.prototype,Tc(I))},xc=String,sA=function(I){try{return xc(I)}catch(g){return"Object"}},Oc=lg,Pc=sA,Dc=TypeError,Ye=function(I){if(Oc(I))return I;throw new Dc(Pc(I)+" is not a function")},Rc=Ye,Nc=ft,Kn=function(I,g){var e=I[g];return Nc(e)?void 0:Rc(e)},cC=jg,uC=lg,fC=cg,Sc=TypeError,kc=function(I,g){var e,t;if(g==="string"&&uC(e=I.toString)&&!fC(t=cC(e,I))||uC(e=I.valueOf)&&!fC(t=cC(e,I))||g!=="string"&&uC(e=I.toString)&&!fC(t=cC(e,I)))return t;throw new Sc("Can't convert object to primitive value")},Va={exports:{}},Uo=X,Mc=Object.defineProperty,Fc=function(I,g){try{Mc(Uo,I,{value:g,configurable:!0,writable:!0})}catch(e){Uo[I]=g}return g},Bc=X,zc=Fc,Ho="__core-js_shared__",Zc=Bc[Ho]||zc(Ho,{}),Un=Zc,Qo=Un;(Va.exports=function(I,g){return Qo[I]||(Qo[I]=g!==void 0?g:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var mt=Va.exports,Lc=CA,Gc=Object,xg=function(I){return Gc(Lc(I))},Vc=Z,jc=xg,Wc=Vc({}.hasOwnProperty),ng=Object.hasOwn||function(g,e){return Wc(jc(g),e)},Yc=Z,_c=0,Kc=Math.random(),Uc=Yc(1 .toString),WI=function(I){return"Symbol("+(I===void 0?"":I)+")_"+Uc(++_c+Kc,36)},Hc=X,Qc=mt,Xo=ng,Xc=WI,Jc=pt,$c=Ga,It=Hc.Symbol,pC=Qc("wks"),qc=$c?It.for||It:It&&It.withoutSetter||Xc,gg=function(I){return Xo(pC,I)||(pC[I]=Jc&&Xo(It,I)?It[I]:qc("Symbol."+I)),pC[I]},gu=jg,Jo=cg,$o=oA,eu=Kn,tu=kc,Au=gg,Iu=TypeError,Cu=Au("toPrimitive"),iu=function(I,g){if(!Jo(I)||$o(I))return I;var e=eu(I,Cu),t;if(e){if(g===void 0&&(g="default"),t=gu(e,I,g),!Jo(t)||$o(t))return t;throw new Iu("Can't convert object to primitive value")}return g===void 0&&(g="number"),tu(I,g)},nu=iu,ou=oA,YI=function(I){var g=nu(I,"string");return ou(g)?g:g+""},su=X,qo=cg,fi=su.document,ru=qo(fi)&&qo(fi.createElement),ja=function(I){return ru?fi.createElement(I):{}},au=ig,du=z,lu=ja,Wa=!au&&!du(function(){return Object.defineProperty(lu("div"),"a",{get:function(){return 7}}).a!==7}),hu=ig,cu=jg,uu=AA,fu=IA,pu=Wg,mu=YI,vu=ng,bu=Wa,gs=Object.getOwnPropertyDescriptor;tA.f=hu?gs:function(g,e){if(g=pu(g),e=mu(e),bu)try{return gs(g,e)}catch(t){}if(vu(g,e))return fu(!cu(uu.f,g,e),g[e])};var yu=z,wu=lg,Eu=/#|\.prototype\./,rA=function(I,g){var e=xu[Tu(I)];return e===Pu?!0:e===Ou?!1:wu(g)?yu(g):!!g},Tu=rA.normalize=function(I){return String(I).replace(Eu,".").toLowerCase()},xu=rA.data={},Ou=rA.NATIVE="N",Pu=rA.POLYFILL="P",Du=rA,es=_n,Ru=Ye,Nu=eA,Su=es(es.bind),aA=function(I,g){return Ru(I),g===void 0?I:Nu?Su(I,g):function(){return I.apply(g,arguments)}},Og={},ku=ig,Mu=z,Ya=ku&&Mu(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Fu=cg,Bu=String,zu=TypeError,re=function(I){if(Fu(I))return I;throw new zu(Bu(I)+" is not an object")},Zu=ig,Lu=Wa,Gu=Ya,zA=re,ts=YI,Vu=TypeError,mC=Object.defineProperty,ju=Object.getOwnPropertyDescriptor,vC="enumerable",bC="configurable",yC="writable";Og.f=Zu?Gu?function(g,e,t){if(zA(g),e=ts(e),zA(t),typeof g=="function"&&e==="prototype"&&"value"in t&&yC in t&&!t[yC]){var A=ju(g,e);A&&A[yC]&&(g[e]=t.value,t={configurable:bC in t?t[bC]:A[bC],enumerable:vC in t?t[vC]:A[vC],writable:!1})}return mC(g,e,t)}:mC:function(g,e,t){if(zA(g),e=ts(e),zA(t),Lu)try{return mC(g,e,t)}catch(A){}if("get"in t||"set"in t)throw new Vu("Accessors not supported");return"value"in t&&(g[e]=t.value),g};var Wu=ig,Yu=Og,_u=IA,vt=Wu?function(I,g,e){return Yu.f(I,g,_u(1,e))}:function(I,g,e){return I[g]=e,I},ZA=X,Ku=VI,Uu=_n,Hu=lg,Qu=tA.f,Xu=Du,$e=L,Ju=aA,qe=vt,As=ng,$u=function(I){var g=function(e,t,A){if(this instanceof g){switch(arguments.length){case 0:return new I;case 1:return new I(e);case 2:return new I(e,t)}return new I(e,t,A)}return Ku(I,this,arguments)};return g.prototype=I.prototype,g},R=function(I,g){var e=I.target,t=I.global,A=I.stat,C=I.proto,i=t?ZA:A?ZA[e]:(ZA[e]||{}).prototype,n=t?$e:$e[e]||qe($e,e,{})[e],o=n.prototype,s,r,a,d,l,h,c,p,u;for(d in g)s=Xu(t?d:e+(A?".":"#")+d,I.forced),r=!s&&i&&As(i,d),h=n[d],r&&(I.dontCallGetSet?(u=Qu(i,d),c=u&&u.value):c=i[d]),l=r&&c?c:g[d],!(r&&typeof h==typeof l)&&(I.bind&&r?p=Ju(l,ZA):I.wrap&&r?p=$u(l):C&&Hu(l)?p=Uu(l):p=l,(I.sham||l&&l.sham||h&&h.sham)&&qe(p,"sham",!0),qe(n,d,p),C&&(a=e+"Prototype",As($e,a)||qe($e,a,{}),qe($e[a],d,l),I.real&&o&&(s||!o[d])&&qe(o,d,l)))},qu=Math.ceil,gf=Math.floor,ef=Math.trunc||function(g){var e=+g;return(e>0?gf:qu)(e)},tf=ef,_I=function(I){var g=+I;return g!==g||g===0?0:tf(g)},Af=_I,If=Math.max,Cf=Math.min,dA=function(I,g){var e=Af(I);return e<0?If(e+g,0):Cf(e,g)},nf=_I,of=Math.min,sf=function(I){return I>0?of(nf(I),9007199254740991):0},rf=sf,Sg=function(I){return rf(I.length)},af=Wg,df=dA,lf=Sg,Is=function(I){return function(g,e,t){var A=af(g),C=lf(A),i=df(t,C),n;if(I&&e!==e){for(;C>i;)if(n=A[i++],n!==n)return!0}else for(;C>i;i++)if((I||i in A)&&A[i]===e)return I||i||0;return!I&&-1}},Hn={includes:Is(!0),indexOf:Is(!1)},lA={},hf=Z,wC=ng,cf=Wg,uf=Hn.indexOf,ff=lA,Cs=hf([].push),_a=function(I,g){var e=cf(I),t=0,A=[],C;for(C in e)!wC(ff,C)&&wC(e,C)&&Cs(A,C);for(;g.length>t;)wC(e,C=g[t++])&&(~uf(A,C)||Cs(A,C));return A},Qn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],pf=_a,mf=Qn,hA=Object.keys||function(g){return pf(g,mf)},cA={};cA.f=Object.getOwnPropertySymbols;var is=ig,vf=Z,bf=jg,yf=z,EC=hA,wf=cA,Ef=AA,Tf=xg,xf=jI,gt=Object.assign,ns=Object.defineProperty,Of=vf([].concat),Pf=!gt||yf(function(){if(is&&gt({b:1},gt(ns({},"a",{enumerable:!0,get:function(){ns(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var I={},g={},e=Symbol("assign detection"),t="abcdefghijklmnopqrst";return I[e]=7,t.split("").forEach(function(A){g[A]=A}),gt({},I)[e]!==7||EC(gt({},g)).join("")!==t})?function(g,e){for(var t=Tf(g),A=arguments.length,C=1,i=wf.f,n=Ef.f;A>C;)for(var o=xf(arguments[C++]),s=i?Of(EC(o),i(o)):EC(o),r=s.length,a=0,d;r>a;)d=s[a++],(!is||bf(n,o,d))&&(t[d]=o[d]);return t}:gt,Df=R,os=Pf;Df({target:"Object",stat:!0,arity:2,forced:Object.assign!==os},{assign:os});var Rf=L,Nf=Rf.Object.assign,Sf=Nf,kf=Sf,Mf=kf,q=D(Mf),Ff=Z,KI=Ff([].slice),Ka=Z,Bf=Ye,zf=cg,Zf=ng,ss=KI,Lf=eA,Ua=Function,Gf=Ka([].concat),Vf=Ka([].join),TC={},jf=function(I,g,e){if(!Zf(TC,g)){for(var t=[],A=0;A<g;A++)t[A]="a["+A+"]";TC[g]=Ua("C,a","return new C("+Vf(t,",")+")")}return TC[g](I,e)},Wf=Lf?Ua.bind:function(g){var e=Bf(this),t=e.prototype,A=ss(arguments,1),C=function(){var n=Gf(A,ss(arguments));return this instanceof C?jf(e,n.length,n):e.apply(g,n)};return zf(t)&&(C.prototype=t),C},Yf=R,rs=Wf;Yf({target:"Function",proto:!0,forced:Function.bind!==rs},{bind:rs});var _f=L,Ig=function(I){return _f[I+"Prototype"]},Kf=Ig,Uf=Kf("Function").bind,Hf=J,Qf=Uf,xC=Function.prototype,Xf=function(I){var g=I.bind;return I===xC||Hf(xC,I)&&g===xC.bind?Qf:g},Jf=Xf,$f=Jf,qf=$f,b=D(qf);function Xn(I,g,e,t){I.beginPath(),I.arc(g,e,t,0,2*Math.PI,!1),I.closePath()}function gp(I,g,e,t){I.beginPath(),I.rect(g-t,e-t,t*2,t*2),I.closePath()}function ep(I,g,e,t){I.beginPath(),t*=1.15,e+=.275*t;let A=t*2,C=A/2,i=Math.sqrt(3)/6*A,n=Math.sqrt(A*A-C*C);I.moveTo(g,e-(n-i)),I.lineTo(g+C,e+i),I.lineTo(g-C,e+i),I.lineTo(g,e-(n-i)),I.closePath()}function tp(I,g,e,t){I.beginPath(),t*=1.15,e-=.275*t;let A=t*2,C=A/2,i=Math.sqrt(3)/6*A,n=Math.sqrt(A*A-C*C);I.moveTo(g,e+(n-i)),I.lineTo(g+C,e-i),I.lineTo(g-C,e-i),I.lineTo(g,e+(n-i)),I.closePath()}function Ap(I,g,e,t){I.beginPath(),t*=.82,e+=.1*t;for(let A=0;A<10;A++){let C=A%2===0?t*1.3:t*.5;I.lineTo(g+C*Math.sin(A*2*Math.PI/10),e-C*Math.cos(A*2*Math.PI/10))}I.closePath()}function Ip(I,g,e,t){I.beginPath(),I.lineTo(g,e+t),I.lineTo(g+t,e),I.lineTo(g,e-t),I.lineTo(g-t,e),I.closePath()}function Ha(I,g,e,t,A,C){let i=Math.PI/180;t-2*C<0&&(C=t/2),A-2*C<0&&(C=A/2),I.beginPath(),I.moveTo(g+C,e),I.lineTo(g+t-C,e),I.arc(g+t-C,e+C,C,i*270,i*360,!1),I.lineTo(g+t,e+A-C),I.arc(g+t-C,e+A-C,C,0,i*90,!1),I.lineTo(g+C,e+A),I.arc(g+C,e+A-C,C,i*90,i*180,!1),I.lineTo(g,e+C),I.arc(g+C,e+C,C,i*180,i*270,!1),I.closePath()}function pi(I,g,e,t,A){let C=.5522848,i=t/2*C,n=A/2*C,o=g+t,s=e+A,r=g+t/2,a=e+A/2;I.beginPath(),I.moveTo(g,a),I.bezierCurveTo(g,a-n,r-i,e,r,e),I.bezierCurveTo(r+i,e,o,a-n,o,a),I.bezierCurveTo(o,a+n,r+i,s,r,s),I.bezierCurveTo(r-i,s,g,a+n,g,a),I.closePath()}function Qa(I,g,e,t,A){let C=.3333333333333333,i=t,n=A*C,o=.5522848,s=i/2*o,r=n/2*o,a=g+i,d=e+n,l=g+i/2,h=e+n/2,c=e+(A-n/2),p=e+A;I.beginPath(),I.moveTo(a,h),I.bezierCurveTo(a,h+r,l+s,d,l,d),I.bezierCurveTo(l-s,d,g,h+r,g,h),I.bezierCurveTo(g,h-r,l-s,e,l,e),I.bezierCurveTo(l+s,e,a,h-r,a,h),I.lineTo(a,c),I.bezierCurveTo(a,c+r,l+s,p,l,p),I.bezierCurveTo(l-s,p,g,c+r,g,c),I.lineTo(g,h)}function Xa(I,g,e,t,A,C){I.beginPath(),I.moveTo(g,e);let i=C.length,n=t-g,o=A-e,s=o/n,r=Math.sqrt(n*n+o*o),a=0,d=!0,l=0,h=+C[0];for(;r>=.1;)h=+C[a++%i],h>r&&(h=r),l=Math.sqrt(h*h/(1+s*s)),l=n<0?-l:l,g+=l,e+=s*l,d===!0?I.lineTo(g,e):I.moveTo(g,e),r-=h,d=!d}function Cp(I,g,e,t){I.beginPath();let A=6,C=Math.PI*2/A;I.moveTo(g+t,e);for(let i=1;i<A;i++)I.lineTo(g+t*Math.cos(C*i),e+t*Math.sin(C*i));I.closePath()}var as={circle:Xn,dashedLine:Xa,database:Qa,diamond:Ip,ellipse:pi,ellipse_vis:pi,hexagon:Cp,roundRect:Ha,square:gp,star:Ap,triangle:ep,triangleDown:tp};function ip(I){return Object.prototype.hasOwnProperty.call(as,I)?as[I]:function(g){for(var e=arguments.length,t=new Array(e>1?e-1:0),A=1;A<e;A++)t[A-1]=arguments[A];CanvasRenderingContext2D.prototype[I].call(g,t)}}function _e(I,g){g===void 0&&(g={});var e=g.insertAt;if(!(!I||typeof document=="undefined")){var t=document.head||document.getElementsByTagName("head")[0],A=document.createElement("style");A.type="text/css",e==="top"&&t.firstChild?t.insertBefore(A,t.firstChild):t.appendChild(A),A.styleSheet?A.styleSheet.cssText=I:A.appendChild(document.createTextNode(I))}}var np=`.vis-overlay {
1
+ var GraphPlugin=(()=>{var sC=Object.defineProperty;var Wh=Object.getOwnPropertyDescriptor;var Yh=Object.getOwnPropertyNames;var _h=Object.prototype.hasOwnProperty;var Kh=(I,e)=>{for(var g in e)sC(I,g,{get:e[g],enumerable:!0})},Uh=(I,e,g,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let A of Yh(e))!_h.call(I,A)&&A!==g&&sC(I,A,{get:()=>e[A],enumerable:!(t=Wh(e,A))||t.enumerable});return I};var Hh=I=>Uh(sC({},"__esModule",{value:!0}),I);var WM={};Kh(WM,{default:()=>jM});function Zo(I){let e=new Map;if(I&&I.getPrefixes){let t=I.getPrefixes();t&&typeof t=="object"&&Object.entries(t).forEach(([A,C])=>{C&&A&&e.set(C,A)})}return Object.entries({"http://www.w3.org/1999/02/22-rdf-syntax-ns#":"rdf","http://www.w3.org/2000/01/rdf-schema#":"rdfs","http://www.w3.org/2001/XMLSchema#":"xsd","http://www.w3.org/2002/07/owl#":"owl"}).forEach(([t,A])=>{e.has(t)||e.set(t,A)}),e}function dg(I,e){if(!I||typeof I!="string")return I;for(let[g,t]of e.entries())if(I.startsWith(g)){let A=I.substring(g.length);return`${t}:${A}`}return I}function Pt(I,e=50){return!I||typeof I!="string"||I.length<=e?I:I.substring(0,e-3)+"..."}function rC(I){return{autoResize:!0,width:"100%",height:"100%",physics:{enabled:!0,stabilization:{enabled:!0,iterations:200,updateInterval:25},barnesHut:{gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09}},interaction:{dragNodes:!0,dragView:!0,zoomView:!0,hover:!0,tooltipDelay:300},nodes:{shape:"dot",size:10,font:{size:12,color:I.text},borderWidth:1,borderWidthSelected:2,labelHighlightBold:!0},edges:{arrows:{to:{enabled:!0,scaleFactor:.6}},smooth:{enabled:!0,type:"dynamic"},font:{size:12,align:"middle",color:I.edgeLabel,background:I.edgeLabelBackground,strokeWidth:0},color:{color:I.edge}}}}function Lo(I){let e=[];return!I||!I.getBindings||I.getBindings().forEach(t=>{if(!t.subject||!t.predicate||!t.object)return;let A={subject:t.subject.value,predicate:t.predicate.value,object:{value:t.object.value,type:t.object.type||"uri",datatype:t.object.datatype,lang:t.object["xml:lang"]}};e.push(A)}),e}function aC(I,e,g){return I.uri&&I.uri.startsWith("_:")?g.blankNode:I.type==="literal"?g.literal:e.some(A=>A.predicate==="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"&&A.object.value===I.uri)?g.typeObject:g.uri}function Qh(I,e,g){let t=new Map,A=1;return I.forEach(C=>{if(!t.has(C.subject)){let n=C.subject.startsWith("_:"),o=n?C.subject:Pt(dg(C.subject,e));t.set(C.subject,{id:A++,uri:C.subject,label:o,color:aC({uri:C.subject,type:"uri"},I,g),type:"uri",fullValue:C.subject,title:n?C.subject:dg(C.subject,e)})}let i=C.object.value;if(!t.has(i)){let n=C.object.type==="literal",o=!n&&i.startsWith("_:"),s,r,a;n?(s=Pt(i),r=i,a=C.object.datatype?`"${i}"^^${dg(C.object.datatype,e)}`:`"${i}"`):o?(s=i,r=i,a=i):(s=Pt(dg(i,e)),r=i,a=dg(i,e)),t.set(i,{id:A++,uri:n?null:i,label:s,color:aC({uri:i,type:n?"literal":"uri"},I,g),type:n?"literal":"uri",fullValue:r,title:a})}}),t}function Xh(I,e,g){let t=[],A=new Set;return I.forEach(C=>{let i=e.get(C.subject),n=e.get(C.object.value);if(!i||!n)return;let o=`${i.id}-${C.predicate}-${n.id}`;A.has(o)||(A.add(o),t.push({id:`edge_${i.id}_${n.id}_${t.length}`,from:i.id,to:n.id,label:Pt(dg(C.predicate,g)),predicate:C.predicate,title:dg(C.predicate,g),arrows:"to"}))}),t}function dC(I,e,g){let t=Qh(I,e,g),A=Xh(I,t,e);return{nodes:Array.from(t.values()),edges:A}}var lC=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function D(I){return I&&I.__esModule&&Object.prototype.hasOwnProperty.call(I,"default")?I.default:I}var FA=function(I){return I&&I.Math===Math&&I},X=FA(typeof globalThis=="object"&&globalThis)||FA(typeof window=="object"&&window)||FA(typeof self=="object"&&self)||FA(typeof lC=="object"&&lC)||function(){return this}()||lC||Function("return this")(),z=function(I){try{return!!I()}catch(e){return!0}},Jh=z,gA=!Jh(function(){var I=function(){}.bind();return typeof I!="function"||I.hasOwnProperty("prototype")}),$h=gA,Sa=Function.prototype,Go=Sa.apply,Vo=Sa.call,VI=typeof Reflect=="object"&&Reflect.apply||($h?Vo.bind(Go):function(){return Vo.apply(Go,arguments)}),ka=gA,Ma=Function.prototype,pi=Ma.call,qh=ka&&Ma.bind.bind(pi,pi),Z=ka?qh:function(I){return function(){return pi.apply(I,arguments)}},Fa=Z,ec=Fa({}.toString),gc=Fa("".slice),sg=function(I){return gc(ec(I),8,-1)},tc=sg,Ac=Z,Hn=function(I){if(tc(I)==="Function")return Ac(I)},mi=typeof document=="object"&&document.all,Ic=typeof mi=="undefined"&&mi!==void 0,Ba={all:mi,IS_HTMLDDA:Ic},za=Ba,Cc=za.all,le=za.IS_HTMLDDA?function(I){return typeof I=="function"||I===Cc}:function(I){return typeof I=="function"},tA={},ic=z,ie=!ic(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),nc=gA,BA=Function.prototype.call,je=nc?BA.bind(BA):function(){return BA.apply(BA,arguments)},AA={},Za={}.propertyIsEnumerable,La=Object.getOwnPropertyDescriptor,oc=La&&!Za.call({1:2},1);AA.f=oc?function(e){var g=La(this,e);return!!g&&g.enumerable}:Za;var IA=function(I,e){return{enumerable:!(I&1),configurable:!(I&2),writable:!(I&4),value:e}},sc=Z,rc=z,ac=sg,hC=Object,dc=sc("".split),jI=rc(function(){return!hC("z").propertyIsEnumerable(0)})?function(I){return ac(I)==="String"?dc(I,""):hC(I)}:hC,ft=function(I){return I==null},lc=ft,hc=TypeError,CA=function(I){if(lc(I))throw new hc("Can't call method on "+I);return I},cc=jI,uc=CA,We=function(I){return cc(uc(I))},jo=le,Ga=Ba,fc=Ga.all,ce=Ga.IS_HTMLDDA?function(I){return typeof I=="object"?I!==null:jo(I)||I===fc}:function(I){return typeof I=="object"?I!==null:jo(I)},L={},cC=L,uC=X,pc=le,Wo=function(I){return pc(I)?I:void 0},Ye=function(I,e){return arguments.length<2?Wo(cC[I])||Wo(uC[I]):cC[I]&&cC[I][e]||uC[I]&&uC[I][e]},mc=Z,J=mc({}.isPrototypeOf),iA=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Va=X,fC=iA,Yo=Va.process,_o=Va.Deno,Ko=Yo&&Yo.versions||_o&&_o.version,Uo=Ko&&Ko.v8,Be,lI;Uo&&(Be=Uo.split("."),lI=Be[0]>0&&Be[0]<4?1:+(Be[0]+Be[1]));!lI&&fC&&(Be=fC.match(/Edge\/(\d+)/),(!Be||Be[1]>=74)&&(Be=fC.match(/Chrome\/(\d+)/),Be&&(lI=+Be[1])));var nA=lI,Ho=nA,vc=z,bc=X,yc=bc.String,pt=!!Object.getOwnPropertySymbols&&!vc(function(){var I=Symbol("symbol detection");return!yc(I)||!(Object(I)instanceof Symbol)||!Symbol.sham&&Ho&&Ho<41}),wc=pt,ja=wc&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ec=Ye,Tc=le,xc=J,Oc=ja,Pc=Object,oA=Oc?function(I){return typeof I=="symbol"}:function(I){var e=Ec("Symbol");return Tc(e)&&xc(e.prototype,Pc(I))},Dc=String,sA=function(I){try{return Dc(I)}catch(e){return"Object"}},Nc=le,Rc=sA,Sc=TypeError,Yg=function(I){if(Nc(I))return I;throw new Sc(Rc(I)+" is not a function")},kc=Yg,Mc=ft,Qn=function(I,e){var g=I[e];return Mc(g)?void 0:kc(g)},pC=je,mC=le,vC=ce,Fc=TypeError,Bc=function(I,e){var g,t;if(e==="string"&&mC(g=I.toString)&&!vC(t=pC(g,I))||mC(g=I.valueOf)&&!vC(t=pC(g,I))||e!=="string"&&mC(g=I.toString)&&!vC(t=pC(g,I)))return t;throw new Fc("Can't convert object to primitive value")},Wa={exports:{}},Qo=X,zc=Object.defineProperty,Zc=function(I,e){try{zc(Qo,I,{value:e,configurable:!0,writable:!0})}catch(g){Qo[I]=e}return e},Lc=X,Gc=Zc,Xo="__core-js_shared__",Vc=Lc[Xo]||Gc(Xo,{}),Xn=Vc,Jo=Xn;(Wa.exports=function(I,e){return Jo[I]||(Jo[I]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var mt=Wa.exports,jc=CA,Wc=Object,xe=function(I){return Wc(jc(I))},Yc=Z,_c=xe,Kc=Yc({}.hasOwnProperty),ne=Object.hasOwn||function(e,g){return Kc(_c(e),g)},Uc=Z,Hc=0,Qc=Math.random(),Xc=Uc(1 .toString),WI=function(I){return"Symbol("+(I===void 0?"":I)+")_"+Xc(++Hc+Qc,36)},Jc=X,$c=mt,$o=ne,qc=WI,eu=pt,gu=ja,It=Jc.Symbol,bC=$c("wks"),tu=gu?It.for||It:It&&It.withoutSetter||qc,ee=function(I){return $o(bC,I)||(bC[I]=eu&&$o(It,I)?It[I]:tu("Symbol."+I)),bC[I]},Au=je,qo=ce,es=oA,Iu=Qn,Cu=Bc,iu=ee,nu=TypeError,ou=iu("toPrimitive"),su=function(I,e){if(!qo(I)||es(I))return I;var g=Iu(I,ou),t;if(g){if(e===void 0&&(e="default"),t=Au(g,I,e),!qo(t)||es(t))return t;throw new nu("Can't convert object to primitive value")}return e===void 0&&(e="number"),Cu(I,e)},ru=su,au=oA,YI=function(I){var e=ru(I,"string");return au(e)?e:e+""},du=X,gs=ce,vi=du.document,lu=gs(vi)&&gs(vi.createElement),Ya=function(I){return lu?vi.createElement(I):{}},hu=ie,cu=z,uu=Ya,_a=!hu&&!cu(function(){return Object.defineProperty(uu("div"),"a",{get:function(){return 7}}).a!==7}),fu=ie,pu=je,mu=AA,vu=IA,bu=We,yu=YI,wu=ne,Eu=_a,ts=Object.getOwnPropertyDescriptor;tA.f=fu?ts:function(e,g){if(e=bu(e),g=yu(g),Eu)try{return ts(e,g)}catch(t){}if(wu(e,g))return vu(!pu(mu.f,e,g),e[g])};var Tu=z,xu=le,Ou=/#|\.prototype\./,rA=function(I,e){var g=Du[Pu(I)];return g===Ru?!0:g===Nu?!1:xu(e)?Tu(e):!!e},Pu=rA.normalize=function(I){return String(I).replace(Ou,".").toLowerCase()},Du=rA.data={},Nu=rA.NATIVE="N",Ru=rA.POLYFILL="P",Su=rA,As=Hn,ku=Yg,Mu=gA,Fu=As(As.bind),aA=function(I,e){return ku(I),e===void 0?I:Mu?Fu(I,e):function(){return I.apply(e,arguments)}},Oe={},Bu=ie,zu=z,Ka=Bu&&zu(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Zu=ce,Lu=String,Gu=TypeError,rg=function(I){if(Zu(I))return I;throw new Gu(Lu(I)+" is not an object")},Vu=ie,ju=_a,Wu=Ka,zA=rg,Is=YI,Yu=TypeError,yC=Object.defineProperty,_u=Object.getOwnPropertyDescriptor,wC="enumerable",EC="configurable",TC="writable";Oe.f=Vu?Wu?function(e,g,t){if(zA(e),g=Is(g),zA(t),typeof e=="function"&&g==="prototype"&&"value"in t&&TC in t&&!t[TC]){var A=_u(e,g);A&&A[TC]&&(e[g]=t.value,t={configurable:EC in t?t[EC]:A[EC],enumerable:wC in t?t[wC]:A[wC],writable:!1})}return yC(e,g,t)}:yC:function(e,g,t){if(zA(e),g=Is(g),zA(t),ju)try{return yC(e,g,t)}catch(A){}if("get"in t||"set"in t)throw new Yu("Accessors not supported");return"value"in t&&(e[g]=t.value),e};var Ku=ie,Uu=Oe,Hu=IA,vt=Ku?function(I,e,g){return Uu.f(I,e,Hu(1,g))}:function(I,e,g){return I[e]=g,I},ZA=X,Qu=VI,Xu=Hn,Ju=le,$u=tA.f,qu=Su,$g=L,ef=aA,qg=vt,Cs=ne,gf=function(I){var e=function(g,t,A){if(this instanceof e){switch(arguments.length){case 0:return new I;case 1:return new I(g);case 2:return new I(g,t)}return new I(g,t,A)}return Qu(I,this,arguments)};return e.prototype=I.prototype,e},N=function(I,e){var g=I.target,t=I.global,A=I.stat,C=I.proto,i=t?ZA:A?ZA[g]:(ZA[g]||{}).prototype,n=t?$g:$g[g]||qg($g,g,{})[g],o=n.prototype,s,r,a,d,l,h,c,p,u;for(d in e)s=qu(t?d:g+(A?".":"#")+d,I.forced),r=!s&&i&&Cs(i,d),h=n[d],r&&(I.dontCallGetSet?(u=$u(i,d),c=u&&u.value):c=i[d]),l=r&&c?c:e[d],!(r&&typeof h==typeof l)&&(I.bind&&r?p=ef(l,ZA):I.wrap&&r?p=gf(l):C&&Ju(l)?p=Xu(l):p=l,(I.sham||l&&l.sham||h&&h.sham)&&qg(p,"sham",!0),qg(n,d,p),C&&(a=g+"Prototype",Cs($g,a)||qg($g,a,{}),qg($g[a],d,l),I.real&&o&&(s||!o[d])&&qg(o,d,l)))},tf=Math.ceil,Af=Math.floor,If=Math.trunc||function(e){var g=+e;return(g>0?Af:tf)(g)},Cf=If,_I=function(I){var e=+I;return e!==e||e===0?0:Cf(e)},nf=_I,of=Math.max,sf=Math.min,dA=function(I,e){var g=nf(I);return g<0?of(g+e,0):sf(g,e)},rf=_I,af=Math.min,df=function(I){return I>0?af(rf(I),9007199254740991):0},lf=df,Se=function(I){return lf(I.length)},hf=We,cf=dA,uf=Se,is=function(I){return function(e,g,t){var A=hf(e),C=uf(A),i=cf(t,C),n;if(I&&g!==g){for(;C>i;)if(n=A[i++],n!==n)return!0}else for(;C>i;i++)if((I||i in A)&&A[i]===g)return I||i||0;return!I&&-1}},Jn={includes:is(!0),indexOf:is(!1)},lA={},ff=Z,xC=ne,pf=We,mf=Jn.indexOf,vf=lA,ns=ff([].push),Ua=function(I,e){var g=pf(I),t=0,A=[],C;for(C in g)!xC(vf,C)&&xC(g,C)&&ns(A,C);for(;e.length>t;)xC(g,C=e[t++])&&(~mf(A,C)||ns(A,C));return A},$n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],bf=Ua,yf=$n,hA=Object.keys||function(e){return bf(e,yf)},cA={};cA.f=Object.getOwnPropertySymbols;var os=ie,wf=Z,Ef=je,Tf=z,OC=hA,xf=cA,Of=AA,Pf=xe,Df=jI,et=Object.assign,ss=Object.defineProperty,Nf=wf([].concat),Rf=!et||Tf(function(){if(os&&et({b:1},et(ss({},"a",{enumerable:!0,get:function(){ss(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var I={},e={},g=Symbol("assign detection"),t="abcdefghijklmnopqrst";return I[g]=7,t.split("").forEach(function(A){e[A]=A}),et({},I)[g]!==7||OC(et({},e)).join("")!==t})?function(e,g){for(var t=Pf(e),A=arguments.length,C=1,i=xf.f,n=Of.f;A>C;)for(var o=Df(arguments[C++]),s=i?Nf(OC(o),i(o)):OC(o),r=s.length,a=0,d;r>a;)d=s[a++],(!os||Ef(n,o,d))&&(t[d]=o[d]);return t}:et,Sf=N,rs=Rf;Sf({target:"Object",stat:!0,arity:2,forced:Object.assign!==rs},{assign:rs});var kf=L,Mf=kf.Object.assign,Ff=Mf,Bf=Ff,zf=Bf,q=D(zf),Zf=Z,KI=Zf([].slice),Ha=Z,Lf=Yg,Gf=ce,Vf=ne,as=KI,jf=gA,Qa=Function,Wf=Ha([].concat),Yf=Ha([].join),PC={},_f=function(I,e,g){if(!Vf(PC,e)){for(var t=[],A=0;A<e;A++)t[A]="a["+A+"]";PC[e]=Qa("C,a","return new C("+Yf(t,",")+")")}return PC[e](I,g)},Kf=jf?Qa.bind:function(e){var g=Lf(this),t=g.prototype,A=as(arguments,1),C=function(){var n=Wf(A,as(arguments));return this instanceof C?_f(g,n.length,n):g.apply(e,n)};return Gf(t)&&(C.prototype=t),C},Uf=N,ds=Kf;Uf({target:"Function",proto:!0,forced:Function.bind!==ds},{bind:ds});var Hf=L,Ie=function(I){return Hf[I+"Prototype"]},Qf=Ie,Xf=Qf("Function").bind,Jf=J,$f=Xf,DC=Function.prototype,qf=function(I){var e=I.bind;return I===DC||Jf(DC,I)&&e===DC.bind?$f:e},ep=qf,gp=ep,tp=gp,b=D(tp);function qn(I,e,g,t){I.beginPath(),I.arc(e,g,t,0,2*Math.PI,!1),I.closePath()}function Ap(I,e,g,t){I.beginPath(),I.rect(e-t,g-t,t*2,t*2),I.closePath()}function Ip(I,e,g,t){I.beginPath(),t*=1.15,g+=.275*t;let A=t*2,C=A/2,i=Math.sqrt(3)/6*A,n=Math.sqrt(A*A-C*C);I.moveTo(e,g-(n-i)),I.lineTo(e+C,g+i),I.lineTo(e-C,g+i),I.lineTo(e,g-(n-i)),I.closePath()}function Cp(I,e,g,t){I.beginPath(),t*=1.15,g-=.275*t;let A=t*2,C=A/2,i=Math.sqrt(3)/6*A,n=Math.sqrt(A*A-C*C);I.moveTo(e,g+(n-i)),I.lineTo(e+C,g-i),I.lineTo(e-C,g-i),I.lineTo(e,g+(n-i)),I.closePath()}function ip(I,e,g,t){I.beginPath(),t*=.82,g+=.1*t;for(let A=0;A<10;A++){let C=A%2===0?t*1.3:t*.5;I.lineTo(e+C*Math.sin(A*2*Math.PI/10),g-C*Math.cos(A*2*Math.PI/10))}I.closePath()}function np(I,e,g,t){I.beginPath(),I.lineTo(e,g+t),I.lineTo(e+t,g),I.lineTo(e,g-t),I.lineTo(e-t,g),I.closePath()}function Xa(I,e,g,t,A,C){let i=Math.PI/180;t-2*C<0&&(C=t/2),A-2*C<0&&(C=A/2),I.beginPath(),I.moveTo(e+C,g),I.lineTo(e+t-C,g),I.arc(e+t-C,g+C,C,i*270,i*360,!1),I.lineTo(e+t,g+A-C),I.arc(e+t-C,g+A-C,C,0,i*90,!1),I.lineTo(e+C,g+A),I.arc(e+C,g+A-C,C,i*90,i*180,!1),I.lineTo(e,g+C),I.arc(e+C,g+C,C,i*180,i*270,!1),I.closePath()}function bi(I,e,g,t,A){let C=.5522848,i=t/2*C,n=A/2*C,o=e+t,s=g+A,r=e+t/2,a=g+A/2;I.beginPath(),I.moveTo(e,a),I.bezierCurveTo(e,a-n,r-i,g,r,g),I.bezierCurveTo(r+i,g,o,a-n,o,a),I.bezierCurveTo(o,a+n,r+i,s,r,s),I.bezierCurveTo(r-i,s,e,a+n,e,a),I.closePath()}function Ja(I,e,g,t,A){let C=.3333333333333333,i=t,n=A*C,o=.5522848,s=i/2*o,r=n/2*o,a=e+i,d=g+n,l=e+i/2,h=g+n/2,c=g+(A-n/2),p=g+A;I.beginPath(),I.moveTo(a,h),I.bezierCurveTo(a,h+r,l+s,d,l,d),I.bezierCurveTo(l-s,d,e,h+r,e,h),I.bezierCurveTo(e,h-r,l-s,g,l,g),I.bezierCurveTo(l+s,g,a,h-r,a,h),I.lineTo(a,c),I.bezierCurveTo(a,c+r,l+s,p,l,p),I.bezierCurveTo(l-s,p,e,c+r,e,c),I.lineTo(e,h)}function $a(I,e,g,t,A,C){I.beginPath(),I.moveTo(e,g);let i=C.length,n=t-e,o=A-g,s=o/n,r=Math.sqrt(n*n+o*o),a=0,d=!0,l=0,h=+C[0];for(;r>=.1;)h=+C[a++%i],h>r&&(h=r),l=Math.sqrt(h*h/(1+s*s)),l=n<0?-l:l,e+=l,g+=s*l,d===!0?I.lineTo(e,g):I.moveTo(e,g),r-=h,d=!d}function op(I,e,g,t){I.beginPath();let A=6,C=Math.PI*2/A;I.moveTo(e+t,g);for(let i=1;i<A;i++)I.lineTo(e+t*Math.cos(C*i),g+t*Math.sin(C*i));I.closePath()}var ls={circle:qn,dashedLine:$a,database:Ja,diamond:np,ellipse:bi,ellipse_vis:bi,hexagon:op,roundRect:Xa,square:Ap,star:ip,triangle:Ip,triangleDown:Cp};function sp(I){return Object.prototype.hasOwnProperty.call(ls,I)?ls[I]:function(e){for(var g=arguments.length,t=new Array(g>1?g-1:0),A=1;A<g;A++)t[A-1]=arguments[A];CanvasRenderingContext2D.prototype[I].call(e,t)}}function _g(I,e){e===void 0&&(e={});var g=e.insertAt;if(!(!I||typeof document=="undefined")){var t=document.head||document.getElementsByTagName("head")[0],A=document.createElement("style");A.type="text/css",g==="top"&&t.firstChild?t.insertBefore(A,t.firstChild):t.appendChild(A),A.styleSheet?A.styleSheet.cssText=I:A.appendChild(document.createTextNode(I))}}var rp=`.vis-overlay {
2
2
  position: absolute;
3
3
  top: 0px;
4
4
  right: 0px;
@@ -12,13 +12,13 @@ var GraphPlugin=(()=>{var oC=Object.defineProperty;var Gh=Object.getOwnPropertyD
12
12
  .vis-active {
13
13
  box-shadow: 0 0 10px #86d5f8;
14
14
  }
15
- `;_e(np);var op=`/* override some bootstrap styles screwing up the timelines css */
15
+ `;_g(rp);var ap=`/* override some bootstrap styles screwing up the timelines css */
16
16
 
17
17
  .vis [class*="span"] {
18
18
  min-height: 0;
19
19
  width: auto;
20
20
  }
21
- `;_e(op);var sp=`div.vis-color-picker {
21
+ `;_g(ap);var dp=`div.vis-color-picker {
22
22
  position: absolute;
23
23
  top: 0px;
24
24
  left: 30px;
@@ -263,7 +263,7 @@ div.vis-color-picker input.vis-range-brightness {
263
263
  div.vis-color-picker input.vis-saturation-range {
264
264
  width: 289px !important;
265
265
  }*/
266
- `;_e(sp);var rp=`div.vis-configuration {
266
+ `;_g(dp);var lp=`div.vis-configuration {
267
267
  position: relative;
268
268
  display: block;
269
269
  float: left;
@@ -606,7 +606,7 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper {
606
606
  border-width: 12px;
607
607
  margin-top: -12px;
608
608
  }
609
- `;_e(rp);var ap=`div.vis-tooltip {
609
+ `;_g(lp);var hp=`div.vis-tooltip {
610
610
  position: absolute;
611
611
  visibility: hidden;
612
612
  padding: 5px;
@@ -627,30 +627,30 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper {
627
627
 
628
628
  z-index: 5;
629
629
  }
630
- `;_e(ap);var Ja={exports:{}};(function(I){I.exports=g;function g(t){if(t)return e(t)}function e(t){for(var A in g.prototype)t[A]=g.prototype[A];return t}g.prototype.on=g.prototype.addEventListener=function(t,A){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(A),this},g.prototype.once=function(t,A){function C(){this.off(t,C),A.apply(this,arguments)}return C.fn=A,this.on(t,C),this},g.prototype.off=g.prototype.removeListener=g.prototype.removeAllListeners=g.prototype.removeEventListener=function(t,A){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var C=this._callbacks["$"+t];if(!C)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var i,n=0;n<C.length;n++)if(i=C[n],i===A||i.fn===A){C.splice(n,1);break}return C.length===0&&delete this._callbacks["$"+t],this},g.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var A=new Array(arguments.length-1),C=this._callbacks["$"+t],i=1;i<arguments.length;i++)A[i-1]=arguments[i];if(C){C=C.slice(0);for(var i=0,n=C.length;i<n;++i)C[i].apply(this,A)}return this},g.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},g.prototype.hasListeners=function(t){return!!this.listeners(t).length}})(Ja);var dp=Ja.exports,$a=D(dp),lp=se,De=Array.isArray||function(g){return lp(g)==="Array"},hp=TypeError,cp=9007199254740991,Jn=function(I){if(I>cp)throw hp("Maximum allowed index exceeded");return I},up=YI,fp=Og,pp=IA,uA=function(I,g,e){var t=up(g);t in I?fp.f(I,t,pp(0,e)):I[t]=e},mp=gg,vp=mp("toStringTag"),qa={};qa[vp]="z";var $n=String(qa)==="[object z]",bp=$n,yp=lg,II=se,wp=gg,Ep=wp("toStringTag"),Tp=Object,xp=II(function(){return arguments}())==="Arguments",Op=function(I,g){try{return I[g]}catch(e){}},ae=bp?II:function(I){var g,e,t;return I===void 0?"Undefined":I===null?"Null":typeof(e=Op(g=Tp(I),Ep))=="string"?e:xp?II(g):(t=II(g))==="Object"&&yp(g.callee)?"Arguments":t},Pp=Z,Dp=lg,mi=Un,Rp=Pp(Function.toString);Dp(mi.inspectSource)||(mi.inspectSource=function(I){return Rp(I)});var Np=mi.inspectSource,Sp=Z,kp=z,gd=lg,Mp=ae,Fp=Yg,Bp=Np,ed=function(){},zp=[],td=Fp("Reflect","construct"),qn=/^\s*(?:class|function)\b/,Zp=Sp(qn.exec),Lp=!qn.test(ed),Dt=function(g){if(!gd(g))return!1;try{return td(ed,zp,g),!0}catch(e){return!1}},Ad=function(g){if(!gd(g))return!1;switch(Mp(g)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Lp||!!Zp(qn,Bp(g))}catch(e){return!0}};Ad.sham=!0;var Id=!td||kp(function(){var I;return Dt(Dt.call)||!Dt(Object)||!Dt(function(){I=!0})||I})?Ad:Dt,ds=De,Gp=Id,Vp=cg,jp=gg,Wp=jp("species"),ls=Array,Yp=function(I){var g;return ds(I)&&(g=I.constructor,Gp(g)&&(g===ls||ds(g.prototype))?g=void 0:Vp(g)&&(g=g[Wp],g===null&&(g=void 0))),g===void 0?ls:g},_p=Yp,UI=function(I,g){return new(_p(I))(g===0?0:g)},Kp=z,Up=gg,Hp=nA,Qp=Up("species"),fA=function(I){return Hp>=51||!Kp(function(){var g=[],e=g.constructor={};return e[Qp]=function(){return{foo:1}},g[I](Boolean).foo!==1})},Xp=R,Jp=z,$p=De,qp=cg,gm=xg,em=Sg,hs=Jn,cs=uA,tm=UI,Am=fA,Im=gg,Cm=nA,Cd=Im("isConcatSpreadable"),im=Cm>=51||!Jp(function(){var I=[];return I[Cd]=!1,I.concat()[0]!==I}),nm=function(I){if(!qp(I))return!1;var g=I[Cd];return g!==void 0?!!g:$p(I)},om=!im||!Am("concat");Xp({target:"Array",proto:!0,arity:1,forced:om},{concat:function(g){var e=gm(this),t=tm(e,0),A=0,C,i,n,o,s;for(C=-1,n=arguments.length;C<n;C++)if(s=C===-1?e:arguments[C],nm(s))for(o=em(s),hs(A+o),i=0;i<o;i++,A++)i in s&&cs(t,A,s[i]);else hs(A+1),cs(t,A++,s);return t.length=A,t}});var sm=ae,rm=String,qg=function(I){if(sm(I)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return rm(I)},HI={},am=ig,dm=Ya,lm=Og,hm=re,cm=Wg,um=hA;HI.f=am&&!dm?Object.defineProperties:function(g,e){hm(g);for(var t=cm(e),A=um(e),C=A.length,i=0,n;C>i;)lm.f(g,n=A[i++],t[n]);return g};var fm=Yg,pm=fm("document","documentElement"),mm=mt,vm=WI,us=mm("keys"),QI=function(I){return us[I]||(us[I]=vm(I))},bm=re,ym=HI,fs=Qn,wm=lA,Em=pm,Tm=ja,xm=QI,ps=">",ms="<",vi="prototype",bi="script",id=xm("IE_PROTO"),OC=function(){},nd=function(I){return ms+bi+ps+I+ms+"/"+bi+ps},vs=function(I){I.write(nd("")),I.close();var g=I.parentWindow.Object;return I=null,g},Om=function(){var I=Tm("iframe"),g="java"+bi+":",e;return I.style.display="none",Em.appendChild(I),I.src=String(g),e=I.contentWindow.document,e.open(),e.write(nd("document.F=Object")),e.close(),e.F},LA,CI=function(){try{LA=new ActiveXObject("htmlfile")}catch(g){}CI=typeof document!="undefined"?document.domain&&LA?vs(LA):Om():vs(LA);for(var I=fs.length;I--;)delete CI[vi][fs[I]];return CI()};wm[id]=!0;var pA=Object.create||function(g,e){var t;return g!==null?(OC[vi]=bm(g),t=new OC,OC[vi]=null,t[id]=g):t=CI(),e===void 0?t:ym.f(t,e)},mA={},Pm=_a,Dm=Qn,Rm=Dm.concat("length","prototype");mA.f=Object.getOwnPropertyNames||function(g){return Pm(g,Rm)};var XI={},bs=dA,Nm=Sg,Sm=uA,km=Array,Mm=Math.max,od=function(I,g,e){for(var t=Nm(I),A=bs(g,t),C=bs(e===void 0?t:e,t),i=km(Mm(C-A,0)),n=0;A<C;A++,n++)Sm(i,n,I[A]);return i.length=n,i},Fm=se,Bm=Wg,sd=mA.f,zm=od,rd=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Zm=function(I){try{return sd(I)}catch(g){return zm(rd)}};XI.f=function(g){return rd&&Fm(g)==="Window"?Zm(g):sd(Bm(g))};var Lm=vt,vA=function(I,g,e,t){return t&&t.enumerable?I[g]=e:Lm(I,g,e),I},Gm=Og,go=function(I,g,e){return Gm.f(I,g,e)},bA={},Vm=gg;bA.f=Vm;var ys=L,jm=ng,Wm=bA,Ym=Og.f,$=function(I){var g=ys.Symbol||(ys.Symbol={});jm(g,I)||Ym(g,I,{value:Wm.f(I)})},_m=jg,Km=Yg,Um=gg,Hm=vA,ad=function(){var I=Km("Symbol"),g=I&&I.prototype,e=g&&g.valueOf,t=Um("toPrimitive");g&&!g[t]&&Hm(g,t,function(A){return _m(e,this)},{arity:1})},Qm=$n,Xm=ae,Jm=Qm?{}.toString:function(){return"[object "+Xm(this)+"]"},$m=$n,qm=Og.f,gv=vt,ev=ng,tv=Jm,Av=gg,ws=Av("toStringTag"),bt=function(I,g,e,t){if(I){var A=e?I:I.prototype;ev(A,ws)||qm(A,ws,{configurable:!0,value:g}),t&&!$m&&gv(A,"toString",tv)}},Iv=X,Cv=lg,Es=Iv.WeakMap,dd=Cv(Es)&&/native code/.test(String(Es)),iv=dd,ld=X,nv=cg,ov=vt,PC=ng,DC=Un,sv=QI,rv=lA,Ts="Object already initialized",yi=ld.TypeError,av=ld.WeakMap,hI,Yt,cI,dv=function(I){return cI(I)?Yt(I):hI(I,{})},lv=function(I){return function(g){var e;if(!nv(g)||(e=Yt(g)).type!==I)throw new yi("Incompatible receiver, "+I+" required");return e}};iv||DC.state?(Fg=DC.state||(DC.state=new av),Fg.get=Fg.get,Fg.has=Fg.has,Fg.set=Fg.set,hI=function(I,g){if(Fg.has(I))throw new yi(Ts);return g.facade=I,Fg.set(I,g),g},Yt=function(I){return Fg.get(I)||{}},cI=function(I){return Fg.has(I)}):(Ne=sv("state"),rv[Ne]=!0,hI=function(I,g){if(PC(I,Ne))throw new yi(Ts);return g.facade=I,ov(I,Ne,g),g},Yt=function(I){return PC(I,Ne)?I[Ne]:{}},cI=function(I){return PC(I,Ne)});var Fg,Ne,Ke={set:hI,get:Yt,has:cI,enforce:dv,getterFor:lv},hv=aA,cv=Z,uv=jI,fv=xg,pv=Sg,mv=UI,xs=cv([].push),le=function(I){var g=I===1,e=I===2,t=I===3,A=I===4,C=I===6,i=I===7,n=I===5||C;return function(o,s,r,a){for(var d=fv(o),l=uv(d),h=hv(s,r),c=pv(l),p=0,u=a||mv,m=g?u(o,c):e||i?u(o,0):void 0,E,w;c>p;p++)if((n||p in l)&&(E=l[p],w=h(E,p,d),I))if(g)m[p]=w;else if(w)switch(I){case 3:return!0;case 5:return E;case 6:return p;case 2:xs(m,E)}else switch(I){case 4:return!1;case 7:xs(m,E)}return C?-1:t||A?A:m}},Re={forEach:le(0),map:le(1),filter:le(2),some:le(3),every:le(4),find:le(5),findIndex:le(6),filterReject:le(7)},JI=R,$I=X,eo=jg,vv=Z,at=ig,dt=pt,bv=z,sg=ng,yv=J,wi=re,qI=Wg,to=YI,wv=qg,Ei=IA,_t=pA,hd=hA,Ev=mA,cd=XI,Tv=cA,ud=tA,fd=Og,xv=HI,pd=AA,Os=vA,Ov=go,Ao=mt,Pv=QI,md=lA,Ps=WI,Dv=gg,Rv=bA,Nv=$,Sv=ad,kv=bt,vd=Ke,gC=Re.forEach,Eg=Pv("hidden"),eC="Symbol",Kt="prototype",Mv=vd.set,Ds=vd.getterFor(eC),Gg=Object[Kt],Fe=$I.Symbol,Ft=Fe&&Fe[Kt],Fv=$I.RangeError,Bv=$I.TypeError,RC=$I.QObject,bd=ud.f,Be=fd.f,yd=cd.f,zv=pd.f,wd=vv([].push),ie=Ao("symbols"),yA=Ao("op-symbols"),Zv=Ao("wks"),Ti=!RC||!RC[Kt]||!RC[Kt].findChild,Ed=function(I,g,e){var t=bd(Gg,g);t&&delete Gg[g],Be(I,g,e),t&&I!==Gg&&Be(Gg,g,t)},xi=at&&bv(function(){return _t(Be({},"a",{get:function(){return Be(this,"a",{value:7}).a}})).a!==7})?Ed:Be,NC=function(I,g){var e=ie[I]=_t(Ft);return Mv(e,{type:eC,tag:I,description:g}),at||(e.description=g),e},tC=function(g,e,t){g===Gg&&tC(yA,e,t),wi(g);var A=to(e);return wi(t),sg(ie,A)?(t.enumerable?(sg(g,Eg)&&g[Eg][A]&&(g[Eg][A]=!1),t=_t(t,{enumerable:Ei(0,!1)})):(sg(g,Eg)||Be(g,Eg,Ei(1,{})),g[Eg][A]=!0),xi(g,A,t)):Be(g,A,t)},Io=function(g,e){wi(g);var t=qI(e),A=hd(t).concat(Pd(t));return gC(A,function(C){(!at||eo(Td,t,C))&&tC(g,C,t[C])}),g},Lv=function(g,e){return e===void 0?_t(g):Io(_t(g),e)},Td=function(g){var e=to(g),t=eo(zv,this,e);return this===Gg&&sg(ie,e)&&!sg(yA,e)?!1:t||!sg(this,e)||!sg(ie,e)||sg(this,Eg)&&this[Eg][e]?t:!0},xd=function(g,e){var t=qI(g),A=to(e);if(!(t===Gg&&sg(ie,A)&&!sg(yA,A))){var C=bd(t,A);return C&&sg(ie,A)&&!(sg(t,Eg)&&t[Eg][A])&&(C.enumerable=!0),C}},Od=function(g){var e=yd(qI(g)),t=[];return gC(e,function(A){!sg(ie,A)&&!sg(md,A)&&wd(t,A)}),t},Pd=function(I){var g=I===Gg,e=yd(g?yA:qI(I)),t=[];return gC(e,function(A){sg(ie,A)&&(!g||sg(Gg,A))&&wd(t,ie[A])}),t};dt||(Fe=function(){if(yv(Ft,this))throw new Bv("Symbol is not a constructor");var g=!arguments.length||arguments[0]===void 0?void 0:wv(arguments[0]),e=Ps(g),t=function(A){this===Gg&&eo(t,yA,A),sg(this,Eg)&&sg(this[Eg],e)&&(this[Eg][e]=!1);var C=Ei(1,A);try{xi(this,e,C)}catch(i){if(!(i instanceof Fv))throw i;Ed(this,e,C)}};return at&&Ti&&xi(Gg,e,{configurable:!0,set:t}),NC(e,g)},Ft=Fe[Kt],Os(Ft,"toString",function(){return Ds(this).tag}),Os(Fe,"withoutSetter",function(I){return NC(Ps(I),I)}),pd.f=Td,fd.f=tC,xv.f=Io,ud.f=xd,Ev.f=cd.f=Od,Tv.f=Pd,Rv.f=function(I){return NC(Dv(I),I)},at&&Ov(Ft,"description",{configurable:!0,get:function(){return Ds(this).description}}));JI({global:!0,constructor:!0,wrap:!0,forced:!dt,sham:!dt},{Symbol:Fe});gC(hd(Zv),function(I){Nv(I)});JI({target:eC,stat:!0,forced:!dt},{useSetter:function(){Ti=!0},useSimple:function(){Ti=!1}});JI({target:"Object",stat:!0,forced:!dt,sham:!at},{create:Lv,defineProperty:tC,defineProperties:Io,getOwnPropertyDescriptor:xd});JI({target:"Object",stat:!0,forced:!dt},{getOwnPropertyNames:Od});Sv();kv(Fe,eC);md[Eg]=!0;var Gv=pt,Dd=Gv&&!!Symbol.for&&!!Symbol.keyFor,Vv=R,jv=Yg,Wv=ng,Yv=qg,Rd=mt,_v=Dd,SC=Rd("string-to-symbol-registry"),Kv=Rd("symbol-to-string-registry");Vv({target:"Symbol",stat:!0,forced:!_v},{for:function(I){var g=Yv(I);if(Wv(SC,g))return SC[g];var e=jv("Symbol")(g);return SC[g]=e,Kv[e]=g,e}});var Uv=R,Hv=ng,Qv=oA,Xv=sA,Jv=mt,$v=Dd,Rs=Jv("symbol-to-string-registry");Uv({target:"Symbol",stat:!0,forced:!$v},{keyFor:function(g){if(!Qv(g))throw new TypeError(Xv(g)+" is not a symbol");if(Hv(Rs,g))return Rs[g]}});var qv=Z,Ns=De,gb=lg,Ss=se,eb=qg,ks=qv([].push),tb=function(I){if(gb(I))return I;if(Ns(I)){for(var g=I.length,e=[],t=0;t<g;t++){var A=I[t];typeof A=="string"?ks(e,A):(typeof A=="number"||Ss(A)==="Number"||Ss(A)==="String")&&ks(e,eb(A))}var C=e.length,i=!0;return function(n,o){if(i)return i=!1,o;if(Ns(this))return o;for(var s=0;s<C;s++)if(e[s]===n)return o}}},Ab=R,Nd=Yg,Sd=VI,Ib=jg,wA=Z,kd=z,Ms=lg,Fs=oA,Md=KI,Cb=tb,ib=pt,nb=String,be=Nd("JSON","stringify"),GA=wA(/./.exec),Bs=wA("".charAt),ob=wA("".charCodeAt),sb=wA("".replace),rb=wA(1 .toString),ab=/[\uD800-\uDFFF]/g,zs=/^[\uD800-\uDBFF]$/,Zs=/^[\uDC00-\uDFFF]$/,Ls=!ib||kd(function(){var I=Nd("Symbol")("stringify detection");return be([I])!=="[null]"||be({a:I})!=="{}"||be(Object(I))!=="{}"}),Gs=kd(function(){return be("\uDF06\uD834")!=='"\\udf06\\ud834"'||be("\uDEAD")!=='"\\udead"'}),db=function(I,g){var e=Md(arguments),t=Cb(g);if(!(!Ms(t)&&(I===void 0||Fs(I))))return e[1]=function(A,C){if(Ms(t)&&(C=Ib(t,this,nb(A),C)),!Fs(C))return C},Sd(be,null,e)},lb=function(I,g,e){var t=Bs(e,g-1),A=Bs(e,g+1);return GA(zs,I)&&!GA(Zs,A)||GA(Zs,I)&&!GA(zs,t)?"\\u"+rb(ob(I,0),16):I};be&&Ab({target:"JSON",stat:!0,arity:3,forced:Ls||Gs},{stringify:function(g,e,t){var A=Md(arguments),C=Sd(Ls?db:be,null,A);return Gs&&typeof C=="string"?sb(C,ab,lb):C}});var hb=R,cb=pt,ub=z,Fd=cA,fb=xg,pb=!cb||ub(function(){Fd.f(1)});hb({target:"Object",stat:!0,forced:pb},{getOwnPropertySymbols:function(g){var e=Fd.f;return e?e(fb(g)):[]}});var mb=$;mb("asyncIterator");var vb=$;vb("hasInstance");var bb=$;bb("isConcatSpreadable");var yb=$;yb("iterator");var wb=$;wb("match");var Eb=$;Eb("matchAll");var Tb=$;Tb("replace");var xb=$;xb("search");var Ob=$;Ob("species");var Pb=$;Pb("split");var Db=$,Rb=ad;Db("toPrimitive");Rb();var Nb=Yg,Sb=$,kb=bt;Sb("toStringTag");kb(Nb("Symbol"),"Symbol");var Mb=$;Mb("unscopables");var Fb=X,Bb=bt;Bb(Fb.JSON,"JSON",!0);var zb=L,Zb=zb.Symbol,yt={},Oi=ig,Lb=ng,Bd=Function.prototype,Gb=Oi&&Object.getOwnPropertyDescriptor,Co=Lb(Bd,"name"),Vb=Co&&function(){}.name==="something",jb=Co&&(!Oi||Oi&&Gb(Bd,"name").configurable),Wb={EXISTS:Co,PROPER:Vb,CONFIGURABLE:jb},Yb=z,zd=!Yb(function(){function I(){}return I.prototype.constructor=null,Object.getPrototypeOf(new I)!==I.prototype}),_b=ng,Kb=lg,Ub=xg,Hb=QI,Qb=zd,Vs=Hb("IE_PROTO"),Pi=Object,Xb=Pi.prototype,AC=Qb?Pi.getPrototypeOf:function(I){var g=Ub(I);if(_b(g,Vs))return g[Vs];var e=g.constructor;return Kb(e)&&g instanceof e?e.prototype:g instanceof Pi?Xb:null},Jb=z,$b=lg,qb=cg,gy=pA,js=AC,ey=vA,ty=gg,Di=ty("iterator"),Zd=!1,ee,kC,MC;[].keys&&(MC=[].keys(),"next"in MC?(kC=js(js(MC)),kC!==Object.prototype&&(ee=kC)):Zd=!0);var Ay=!qb(ee)||Jb(function(){var I={};return ee[Di].call(I)!==I});Ay?ee={}:ee=gy(ee);$b(ee[Di])||ey(ee,Di,function(){return this});var Ld={IteratorPrototype:ee,BUGGY_SAFARI_ITERATORS:Zd},Iy=Ld.IteratorPrototype,Cy=pA,iy=IA,ny=bt,oy=yt,sy=function(){return this},ry=function(I,g,e,t){var A=g+" Iterator";return I.prototype=Cy(Iy,{next:iy(+!t,e)}),ny(I,A,!1,!0),oy[A]=sy,I},ay=R,dy=jg,Gd=Wb,ly=ry,hy=AC,cy=bt,Ws=vA,uy=gg,Ys=yt,Vd=Ld,fy=Gd.PROPER;Gd.CONFIGURABLE;Vd.IteratorPrototype;var VA=Vd.BUGGY_SAFARI_ITERATORS,FC=uy("iterator"),_s="keys",jA="values",Ks="entries",py=function(){return this},io=function(I,g,e,t,A,C,i){ly(e,g,t);var n=function(u){if(u===A&&d)return d;if(!VA&&u&&u in r)return r[u];switch(u){case _s:return function(){return new e(this,u)};case jA:return function(){return new e(this,u)};case Ks:return function(){return new e(this,u)}}return function(){return new e(this)}},o=g+" Iterator",s=!1,r=I.prototype,a=r[FC]||r["@@iterator"]||A&&r[A],d=!VA&&a||n(A),l=g==="Array"&&r.entries||a,h,c,p;if(l&&(h=hy(l.call(new I)),h!==Object.prototype&&h.next&&(cy(h,o,!0,!0),Ys[o]=py)),fy&&A===jA&&a&&a.name!==jA&&(s=!0,d=function(){return dy(a,this)}),A)if(c={values:n(jA),keys:C?d:n(_s),entries:n(Ks)},i)for(p in c)(VA||s||!(p in r))&&Ws(r,p,c[p]);else ay({target:g,proto:!0,forced:VA||s},c);return i&&r[FC]!==d&&Ws(r,FC,d,{name:A}),Ys[g]=d,c},no=function(I,g){return{value:I,done:g}},my=Wg,Us=yt,jd=Ke;Og.f;var vy=io,WA=no,Wd="Array Iterator",by=jd.set,yy=jd.getterFor(Wd);vy(Array,"Array",function(I,g){by(this,{type:Wd,target:my(I),index:0,kind:g})},function(){var I=yy(this),g=I.target,e=I.kind,t=I.index++;if(!g||t>=g.length)return I.target=void 0,WA(void 0,!0);switch(e){case"keys":return WA(t,!1);case"values":return WA(g[t],!1)}return WA([t,g[t]],!1)},"values");Us.Arguments=Us.Array;var wy={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},Ey=wy,Ty=X,xy=ae,Oy=vt,Hs=yt,Py=gg,Qs=Py("toStringTag");for(YA in Ey)BC=Ty[YA],_A=BC&&BC.prototype,_A&&xy(_A)!==Qs&&Oy(_A,Qs,YA),Hs[YA]=Hs.Array;var BC,_A,YA,Dy=Zb,Yd=Dy,Ry=Yd,Ny=D(Ry),Sy=R,Xs=De,ky=Id,My=cg,Js=dA,Fy=Sg,By=Wg,zy=uA,Zy=gg,Ly=fA,Gy=KI,Vy=Ly("slice"),jy=Zy("species"),zC=Array,Wy=Math.max;Sy({target:"Array",proto:!0,forced:!Vy},{slice:function(g,e){var t=By(this),A=Fy(t),C=Js(g,A),i=Js(e===void 0?A:e,A),n,o,s;if(Xs(t)&&(n=t.constructor,ky(n)&&(n===zC||Xs(n.prototype))?n=void 0:My(n)&&(n=n[jy],n===null&&(n=void 0)),n===zC||n===void 0))return Gy(t,C,i);for(o=new(n===void 0?zC:n)(Wy(i-C,0)),s=0;C<i;C++,s++)C in t&&zy(o,s,t[C]);return o.length=s,o}});var Yy=Ig,_y=Yy("Array").slice,Ky=J,Uy=_y,ZC=Array.prototype,Hy=function(I){var g=I.slice;return I===ZC||Ky(ZC,I)&&g===ZC.slice?Uy:g},Qy=Hy,Xy=Qy,Jy=Xy,Zg=D(Jy),$y=Yg,qy=Z,g0=mA,e0=cA,t0=re,A0=qy([].concat),_d=$y("Reflect","ownKeys")||function(g){var e=g0.f(t0(g)),t=e0.f;return t?A0(e,t(g)):e},I0=R,C0=_d;I0({target:"Reflect",stat:!0},{ownKeys:C0});var i0=L,n0=i0.Reflect.ownKeys,o0=n0,s0=o0,r0=s0,a0=D(r0),d0=R,l0=De;d0({target:"Array",stat:!0},{isArray:l0});var h0=L,c0=h0.Array.isArray,u0=c0,f0=u0,p0=f0,B=D(p0),m0=R,v0=Re.map,b0=fA,y0=b0("map");m0({target:"Array",proto:!0,forced:!y0},{map:function(g){return v0(this,g,arguments.length>1?arguments[1]:void 0)}});var w0=Ig,E0=w0("Array").map,T0=J,x0=E0,LC=Array.prototype,O0=function(I){var g=I.map;return I===LC||T0(LC,I)&&g===LC.map?x0:g},P0=O0,D0=P0,R0=D0,ag=D(R0),N0=R,S0=xg,Kd=hA,k0=z,M0=k0(function(){Kd(1)});N0({target:"Object",stat:!0,forced:M0},{keys:function(g){return Kd(S0(g))}});var F0=L,B0=F0.Object.keys,z0=B0,Z0=z0,L0=Z0,U=D(L0),G0=R,V0=Z,Ud=Date,j0=V0(Ud.prototype.getTime);G0({target:"Date",stat:!0},{now:function(){return j0(new Ud)}});var W0=L,Y0=W0.Date.now,_0=Y0,K0=_0,U0=K0,uI=D(U0),H0=z,wt=function(I,g){var e=[][I];return!!e&&H0(function(){e.call(null,g||function(){return 1},1)})},Q0=Re.forEach,X0=wt,J0=X0("forEach"),$0=J0?[].forEach:function(g){return Q0(this,g,arguments.length>1?arguments[1]:void 0)},q0=R,$s=$0;q0({target:"Array",proto:!0,forced:[].forEach!==$s},{forEach:$s});var gw=Ig,ew=gw("Array").forEach,tw=ew,Aw=tw,Iw=ae,Cw=ng,iw=J,nw=Aw,GC=Array.prototype,ow={DOMTokenList:!0,NodeList:!0},sw=function(I){var g=I.forEach;return I===GC||iw(GC,I)&&g===GC.forEach||Cw(ow,Iw(I))?nw:g},rw=sw,F=D(rw),aw=R,dw=Z,lw=De,hw=dw([].reverse),qs=[1,2];aw({target:"Array",proto:!0,forced:String(qs)===String(qs.reverse())},{reverse:function(){return lw(this)&&(this.length=this.length),hw(this)}});var cw=Ig,uw=cw("Array").reverse,fw=J,pw=uw,VC=Array.prototype,mw=function(I){var g=I.reverse;return I===VC||fw(VC,I)&&g===VC.reverse?pw:g},vw=mw,bw=vw,yw=bw,ze=D(yw),ww=ig,Ew=De,Tw=TypeError,xw=Object.getOwnPropertyDescriptor,Ow=ww&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(I){return I instanceof TypeError}}(),Pw=Ow?function(I,g){if(Ew(I)&&!xw(I,"length").writable)throw new Tw("Cannot set read only .length");return I.length=g}:function(I,g){return I.length=g},gr=sA,Dw=TypeError,Hd=function(I,g){if(!delete I[g])throw new Dw("Cannot delete property "+gr(g)+" of "+gr(I))},Rw=R,Nw=xg,Sw=dA,kw=_I,Mw=Sg,Fw=Pw,Bw=Jn,zw=UI,Zw=uA,jC=Hd,Lw=fA,Gw=Lw("splice"),Vw=Math.max,jw=Math.min;Rw({target:"Array",proto:!0,forced:!Gw},{splice:function(g,e){var t=Nw(this),A=Mw(t),C=Sw(g,A),i=arguments.length,n,o,s,r,a,d;for(i===0?n=o=0:i===1?(n=0,o=A-C):(n=i-2,o=jw(Vw(kw(e),0),A-C)),Bw(A+n-o),s=zw(t,o),r=0;r<o;r++)a=C+r,a in t&&Zw(s,r,t[a]);if(s.length=o,n<o){for(r=C;r<A-o;r++)a=r+o,d=r+n,a in t?t[d]=t[a]:jC(t,d);for(r=A;r>A-o+n;r--)jC(t,r-1)}else if(n>o)for(r=A-o;r>C;r--)a=r+o-1,d=r+n-1,a in t?t[d]=t[a]:jC(t,d);for(r=0;r<n;r++)t[r+C]=arguments[r+2];return Fw(t,A-o+n),s}});var Ww=Ig,Yw=Ww("Array").splice,_w=J,Kw=Yw,WC=Array.prototype,Uw=function(I){var g=I.splice;return I===WC||_w(WC,I)&&g===WC.splice?Kw:g},Hw=Uw,Qw=Hw,Xw=Qw,Ug=D(Xw),Jw=R,$w=Hn.includes,qw=z,gE=qw(function(){return!Array(1).includes()});Jw({target:"Array",proto:!0,forced:gE},{includes:function(g){return $w(this,g,arguments.length>1?arguments[1]:void 0)}});var eE=Ig,tE=eE("Array").includes,AE=cg,IE=se,CE=gg,iE=CE("match"),nE=function(I){var g;return AE(I)&&((g=I[iE])!==void 0?!!g:IE(I)==="RegExp")},oE=nE,sE=TypeError,rE=function(I){if(oE(I))throw new sE("The method doesn't accept regular expressions");return I},aE=gg,dE=aE("match"),lE=function(I){var g=/./;try{"/./"[I](g)}catch(e){try{return g[dE]=!1,"/./"[I](g)}catch(t){}}return!1},hE=R,cE=Z,uE=rE,fE=CA,er=qg,pE=lE,mE=cE("".indexOf);hE({target:"String",proto:!0,forced:!pE("includes")},{includes:function(g){return!!~mE(er(fE(this)),er(uE(g)),arguments.length>1?arguments[1]:void 0)}});var vE=Ig,bE=vE("String").includes,tr=J,yE=tE,wE=bE,YC=Array.prototype,_C=String.prototype,EE=function(I){var g=I.includes;return I===YC||tr(YC,I)&&g===YC.includes?yE:typeof I=="string"||I===_C||tr(_C,I)&&g===_C.includes?wE:g},TE=EE,xE=TE,OE=xE,ye=D(OE),PE=R,DE=z,RE=xg,Qd=AC,NE=zd,SE=DE(function(){Qd(1)});PE({target:"Object",stat:!0,forced:SE,sham:!NE},{getPrototypeOf:function(g){return Qd(RE(g))}});var kE=L,ME=kE.Object.getPrototypeOf,FE=ME,BE=FE,zE=BE,Ar=D(zE),ZE=Ig,LE=ZE("Array").concat,GE=J,VE=LE,KC=Array.prototype,jE=function(I){var g=I.concat;return I===KC||GE(KC,I)&&g===KC.concat?VE:g},WE=jE,YE=WE,_E=YE,Xd=D(_E),KE=R,UE=Re.filter,HE=fA,QE=HE("filter");KE({target:"Array",proto:!0,forced:!QE},{filter:function(g){return UE(this,g,arguments.length>1?arguments[1]:void 0)}});var XE=Ig,JE=XE("Array").filter,$E=J,qE=JE,UC=Array.prototype,gT=function(I){var g=I.filter;return I===UC||$E(UC,I)&&g===UC.filter?qE:g},eT=gT,tT=eT,AT=tT,tg=D(AT),Jd=ig,IT=z,$d=Z,CT=AC,iT=hA,nT=Wg,oT=AA.f,qd=$d(oT),sT=$d([].push),rT=Jd&&IT(function(){var I=Object.create(null);return I[2]=2,!qd(I,2)}),Ir=function(I){return function(g){for(var e=nT(g),t=iT(e),A=rT&&CT(e)===null,C=t.length,i=0,n=[],o;C>i;)o=t[i++],(!Jd||(A?o in e:qd(e,o)))&&sT(n,I?[o,e[o]]:e[o]);return n}},aT={entries:Ir(!0),values:Ir(!1)},dT=R,lT=aT.values;dT({target:"Object",stat:!0},{values:function(g){return lT(g)}});var hT=L,cT=hT.Object.values,uT=cT,fT=uT,pT=fT,mT=D(pT),oo=`
631
- \v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,vT=Z,bT=CA,yT=qg,Ri=oo,Cr=vT("".replace),wT=RegExp("^["+Ri+"]+"),ET=RegExp("(^|[^"+Ri+"])["+Ri+"]+$"),HC=function(I){return function(g){var e=yT(bT(g));return I&1&&(e=Cr(e,wT,"")),I&2&&(e=Cr(e,ET,"$1")),e}},gl={start:HC(1),end:HC(2),trim:HC(3)},el=X,TT=z,xT=Z,OT=qg,PT=gl.trim,ir=oo,Zt=el.parseInt,nr=el.Symbol,or=nr&&nr.iterator,tl=/^[+-]?0x/i,DT=xT(tl.exec),RT=Zt(ir+"08")!==8||Zt(ir+"0x16")!==22||or&&!TT(function(){Zt(Object(or))}),NT=RT?function(g,e){var t=PT(OT(g));return Zt(t,e>>>0||(DT(tl,t)?16:10))}:Zt,ST=R,sr=NT;ST({global:!0,forced:parseInt!==sr},{parseInt:sr});var kT=L,MT=kT.parseInt,FT=MT,BT=FT,zT=BT,zg=D(zT),ZT=R,LT=_n,GT=Hn.indexOf,VT=wt,Ni=LT([].indexOf),Al=!!Ni&&1/Ni([1],1,-0)<0,jT=Al||!VT("indexOf");ZT({target:"Array",proto:!0,forced:jT},{indexOf:function(g){var e=arguments.length>1?arguments[1]:void 0;return Al?Ni(this,g,e)||0:GT(this,g,e)}});var WT=Ig,YT=WT("Array").indexOf,_T=J,KT=YT,QC=Array.prototype,UT=function(I){var g=I.indexOf;return I===QC||_T(QC,I)&&g===QC.indexOf?KT:g},HT=UT,QT=HT,XT=QT,G=D(XT),JT=R,$T=ig,qT=pA;JT({target:"Object",stat:!0,sham:!$T},{create:qT});var gx=L,ex=gx.Object,tx=function(g,e){return ex.create(g,e)},Ax=tx,Ix=Ax,Cx=Ix,we=D(Cx),Si=L,ix=VI;Si.JSON||(Si.JSON={stringify:JSON.stringify});var nx=function(g,e,t){return ix(Si.JSON.stringify,null,arguments)},ox=nx,sx=ox,rx=sx,Et=D(rx),ax=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",dx=TypeError,lx=function(I,g){if(I<g)throw new dx("Not enough arguments");return I},Il=X,hx=VI,cx=lg,ux=ax,fx=iA,px=KI,mx=lx,vx=Il.Function,bx=/MSIE .\./.test(fx)||ux&&function(){var I=Il.Bun.version.split(".");return I.length<3||I[0]==="0"&&(I[1]<3||I[1]==="3"&&I[2]==="0")}(),Cl=function(I,g){var e=g?2:1;return bx?function(t,A){var C=mx(arguments.length,1)>e,i=cx(t)?t:vx(t),n=C?px(arguments,e):[],o=C?function(){hx(i,this,n)}:i;return g?I(o,A):I(o)}:I},yx=R,il=X,wx=Cl,rr=wx(il.setInterval,!0);yx({global:!0,bind:!0,forced:il.setInterval!==rr},{setInterval:rr});var Ex=R,nl=X,Tx=Cl,ar=Tx(nl.setTimeout,!0);Ex({global:!0,bind:!0,forced:nl.setTimeout!==ar},{setTimeout:ar});var xx=L,Ox=xx.setTimeout,Px=Ox,Hg=D(Px),Dx=xg,dr=dA,Rx=Sg,Nx=function(g){for(var e=Dx(this),t=Rx(e),A=arguments.length,C=dr(A>1?arguments[1]:void 0,t),i=A>2?arguments[2]:void 0,n=i===void 0?t:dr(i,t);n>C;)e[C++]=g;return e},Sx=R,kx=Nx;Sx({target:"Array",proto:!0},{fill:kx});var Mx=Ig,Fx=Mx("Array").fill,Bx=J,zx=Fx,XC=Array.prototype,Zx=function(I){var g=I.fill;return I===XC||Bx(XC,I)&&g===XC.fill?zx:g},Lx=Zx,Gx=Lx,Vx=Gx,EA=D(Vx);function Vg(){return Vg=Object.assign||function(I){for(var g=1;g<arguments.length;g++){var e=arguments[g];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(I[t]=e[t])}return I},Vg.apply(this,arguments)}function kg(I,g){I.prototype=Object.create(g.prototype),I.prototype.constructor=I,I.__proto__=g}function KA(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}var ki;typeof Object.assign!="function"?ki=function(g){if(g==null)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(g),t=1;t<arguments.length;t++){var A=arguments[t];if(A!=null)for(var C in A)A.hasOwnProperty(C)&&(e[C]=A[C])}return e}:ki=Object.assign;var Ge=ki,lr=["","webkit","Moz","MS","ms","o"],jx=typeof document=="undefined"?{style:{}}:document.createElement("div"),Wx="function",Ct=Math.round,Ve=Math.abs,so=Date.now;function IC(I,g){for(var e,t,A=g[0].toUpperCase()+g.slice(1),C=0;C<lr.length;){if(e=lr[C],t=e?e+A:g,t in I)return t;C++}}var te;typeof window=="undefined"?te={}:te=window;var ol=IC(jx.style,"touchAction"),sl=ol!==void 0;function Yx(){if(!sl)return!1;var I={},g=te.CSS&&te.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(e){return I[e]=g?te.CSS.supports("touch-action",e):!0}),I}var rl="compute",al="auto",Mi="manipulation",Ze="none",Ut="pan-x",Ht="pan-y",UA=Yx(),_x=/mobile|tablet|ip(ad|hone|od)|android/i,dl="ontouchstart"in te,Kx=IC(te,"PointerEvent")!==void 0,Ux=dl&&_x.test(navigator.userAgent),TA="touch",Hx="pen",ro="mouse",Qx="kinect",Xx=25,bg=1,Ue=2,Ag=4,Tg=8,fI=1,xA=2,OA=4,PA=8,lt=16,Qg=xA|OA,Le=PA|lt,ll=Qg|Le,hl=["x","y"],pI=["clientX","clientY"];function Ae(I,g,e){var t;if(I)if(I.forEach)I.forEach(g,e);else if(I.length!==void 0)for(t=0;t<I.length;)g.call(e,I[t],t,I),t++;else for(t in I)I.hasOwnProperty(t)&&g.call(e,I[t],t,I)}function CC(I,g){return typeof I===Wx?I.apply(g&&g[0]||void 0,g):I}function ke(I,g){return I.indexOf(g)>-1}function Jx(I){if(ke(I,Ze))return Ze;var g=ke(I,Ut),e=ke(I,Ht);return g&&e?Ze:g||e?g?Ut:Ht:ke(I,Mi)?Mi:al}var cl=function(){function I(e,t){this.manager=e,this.set(t)}var g=I.prototype;return g.set=function(t){t===rl&&(t=this.compute()),sl&&this.manager.element.style&&UA[t]&&(this.manager.element.style[ol]=t),this.actions=t.toLowerCase().trim()},g.update=function(){this.set(this.manager.options.touchAction)},g.compute=function(){var t=[];return Ae(this.manager.recognizers,function(A){CC(A.options.enable,[A])&&(t=t.concat(A.getTouchAction()))}),Jx(t.join(" "))},g.preventDefaults=function(t){var A=t.srcEvent,C=t.offsetDirection;if(this.manager.session.prevented){A.preventDefault();return}var i=this.actions,n=ke(i,Ze)&&!UA[Ze],o=ke(i,Ht)&&!UA[Ht],s=ke(i,Ut)&&!UA[Ut];if(n){var r=t.pointers.length===1,a=t.distance<2,d=t.deltaTime<250;if(r&&a&&d)return}if(!(s&&o)&&(n||o&&C&Qg||s&&C&Le))return this.preventSrc(A)},g.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},I}();function ao(I,g){for(;I;){if(I===g)return!0;I=I.parentNode}return!1}function ul(I){var g=I.length;if(g===1)return{x:Ct(I[0].clientX),y:Ct(I[0].clientY)};for(var e=0,t=0,A=0;A<g;)e+=I[A].clientX,t+=I[A].clientY,A++;return{x:Ct(e/g),y:Ct(t/g)}}function hr(I){for(var g=[],e=0;e<I.pointers.length;)g[e]={clientX:Ct(I.pointers[e].clientX),clientY:Ct(I.pointers[e].clientY)},e++;return{timeStamp:so(),pointers:g,center:ul(g),deltaX:I.deltaX,deltaY:I.deltaY}}function mI(I,g,e){e||(e=hl);var t=g[e[0]]-I[e[0]],A=g[e[1]]-I[e[1]];return Math.sqrt(t*t+A*A)}function Fi(I,g,e){e||(e=hl);var t=g[e[0]]-I[e[0]],A=g[e[1]]-I[e[1]];return Math.atan2(A,t)*180/Math.PI}function fl(I,g){return I===g?fI:Ve(I)>=Ve(g)?I<0?xA:OA:g<0?PA:lt}function $x(I,g){var e=g.center,t=I.offsetDelta||{},A=I.prevDelta||{},C=I.prevInput||{};(g.eventType===bg||C.eventType===Ag)&&(A=I.prevDelta={x:C.deltaX||0,y:C.deltaY||0},t=I.offsetDelta={x:e.x,y:e.y}),g.deltaX=A.x+(e.x-t.x),g.deltaY=A.y+(e.y-t.y)}function pl(I,g,e){return{x:g/I||0,y:e/I||0}}function qx(I,g){return mI(g[0],g[1],pI)/mI(I[0],I[1],pI)}function gO(I,g){return Fi(g[1],g[0],pI)+Fi(I[1],I[0],pI)}function eO(I,g){var e=I.lastInterval||g,t=g.timeStamp-e.timeStamp,A,C,i,n;if(g.eventType!==Tg&&(t>Xx||e.velocity===void 0)){var o=g.deltaX-e.deltaX,s=g.deltaY-e.deltaY,r=pl(t,o,s);C=r.x,i=r.y,A=Ve(r.x)>Ve(r.y)?r.x:r.y,n=fl(o,s),I.lastInterval=g}else A=e.velocity,C=e.velocityX,i=e.velocityY,n=e.direction;g.velocity=A,g.velocityX=C,g.velocityY=i,g.direction=n}function tO(I,g){var e=I.session,t=g.pointers,A=t.length;e.firstInput||(e.firstInput=hr(g)),A>1&&!e.firstMultiple?e.firstMultiple=hr(g):A===1&&(e.firstMultiple=!1);var C=e.firstInput,i=e.firstMultiple,n=i?i.center:C.center,o=g.center=ul(t);g.timeStamp=so(),g.deltaTime=g.timeStamp-C.timeStamp,g.angle=Fi(n,o),g.distance=mI(n,o),$x(e,g),g.offsetDirection=fl(g.deltaX,g.deltaY);var s=pl(g.deltaTime,g.deltaX,g.deltaY);g.overallVelocityX=s.x,g.overallVelocityY=s.y,g.overallVelocity=Ve(s.x)>Ve(s.y)?s.x:s.y,g.scale=i?qx(i.pointers,t):1,g.rotation=i?gO(i.pointers,t):0,g.maxPointers=e.prevInput?g.pointers.length>e.prevInput.maxPointers?g.pointers.length:e.prevInput.maxPointers:g.pointers.length,eO(e,g);var r=I.element,a=g.srcEvent,d;a.composedPath?d=a.composedPath()[0]:a.path?d=a.path[0]:d=a.target,ao(d,r)&&(r=d),g.target=r}function AO(I,g,e){var t=e.pointers.length,A=e.changedPointers.length,C=g&bg&&t-A===0,i=g&(Ag|Tg)&&t-A===0;e.isFirst=!!C,e.isFinal=!!i,C&&(I.session={}),e.eventType=g,tO(I,e),I.emit("hammer.input",e),I.recognize(e),I.session.prevInput=e}function Qt(I){return I.trim().split(/\s+/g)}function Lt(I,g,e){Ae(Qt(g),function(t){I.addEventListener(t,e,!1)})}function Gt(I,g,e){Ae(Qt(g),function(t){I.removeEventListener(t,e,!1)})}function cr(I){var g=I.ownerDocument||I;return g.defaultView||g.parentWindow||window}var Tt=function(){function I(e,t){var A=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(C){CC(e.options.enable,[e])&&A.handler(C)},this.init()}var g=I.prototype;return g.handler=function(){},g.init=function(){this.evEl&&Lt(this.element,this.evEl,this.domHandler),this.evTarget&&Lt(this.target,this.evTarget,this.domHandler),this.evWin&&Lt(cr(this.element),this.evWin,this.domHandler)},g.destroy=function(){this.evEl&&Gt(this.element,this.evEl,this.domHandler),this.evTarget&&Gt(this.target,this.evTarget,this.domHandler),this.evWin&&Gt(cr(this.element),this.evWin,this.domHandler)},I}();function je(I,g,e){if(I.indexOf&&!e)return I.indexOf(g);for(var t=0;t<I.length;){if(e&&I[t][e]==g||!e&&I[t]===g)return t;t++}return-1}var IO={pointerdown:bg,pointermove:Ue,pointerup:Ag,pointercancel:Tg,pointerout:Tg},CO={2:TA,3:Hx,4:ro,5:Qx},ml="pointerdown",vl="pointermove pointerup pointercancel";te.MSPointerEvent&&!te.PointerEvent&&(ml="MSPointerDown",vl="MSPointerMove MSPointerUp MSPointerCancel");var bl=function(I){kg(g,I);function g(){var t,A=g.prototype;return A.evEl=ml,A.evWin=vl,t=I.apply(this,arguments)||this,t.store=t.manager.session.pointerEvents=[],t}var e=g.prototype;return e.handler=function(A){var C=this.store,i=!1,n=A.type.toLowerCase().replace("ms",""),o=IO[n],s=CO[A.pointerType]||A.pointerType,r=s===TA,a=je(C,A.pointerId,"pointerId");o&bg&&(A.button===0||r)?a<0&&(C.push(A),a=C.length-1):o&(Ag|Tg)&&(i=!0),!(a<0)&&(C[a]=A,this.callback(this.manager,o,{pointers:C,changedPointers:[A],pointerType:s,srcEvent:A}),i&&C.splice(a,1))},g}(Tt);function Xt(I){return Array.prototype.slice.call(I,0)}function lo(I,g,e){for(var t=[],A=[],C=0;C<I.length;){var i=g?I[C][g]:I[C];je(A,i)<0&&t.push(I[C]),A[C]=i,C++}return e&&(g?t=t.sort(function(n,o){return n[g]>o[g]}):t=t.sort()),t}var iO={touchstart:bg,touchmove:Ue,touchend:Ag,touchcancel:Tg},nO="touchstart touchmove touchend touchcancel",ho=function(I){kg(g,I);function g(){var t;return g.prototype.evTarget=nO,t=I.apply(this,arguments)||this,t.targetIds={},t}var e=g.prototype;return e.handler=function(A){var C=iO[A.type],i=oO.call(this,A,C);i&&this.callback(this.manager,C,{pointers:i[0],changedPointers:i[1],pointerType:TA,srcEvent:A})},g}(Tt);function oO(I,g){var e=Xt(I.touches),t=this.targetIds;if(g&(bg|Ue)&&e.length===1)return t[e[0].identifier]=!0,[e,e];var A,C,i=Xt(I.changedTouches),n=[],o=this.target;if(C=e.filter(function(s){return ao(s.target,o)}),g===bg)for(A=0;A<C.length;)t[C[A].identifier]=!0,A++;for(A=0;A<i.length;)t[i[A].identifier]&&n.push(i[A]),g&(Ag|Tg)&&delete t[i[A].identifier],A++;if(n.length)return[lo(C.concat(n),"identifier",!0),n]}var sO={mousedown:bg,mousemove:Ue,mouseup:Ag},rO="mousedown",aO="mousemove mouseup",co=function(I){kg(g,I);function g(){var t,A=g.prototype;return A.evEl=rO,A.evWin=aO,t=I.apply(this,arguments)||this,t.pressed=!1,t}var e=g.prototype;return e.handler=function(A){var C=sO[A.type];C&bg&&A.button===0&&(this.pressed=!0),C&Ue&&A.which!==1&&(C=Ag),this.pressed&&(C&Ag&&(this.pressed=!1),this.callback(this.manager,C,{pointers:[A],changedPointers:[A],pointerType:ro,srcEvent:A}))},g}(Tt),dO=2500,ur=25;function fr(I){var g=I.changedPointers,e=g[0];if(e.identifier===this.primaryTouch){var t={x:e.clientX,y:e.clientY},A=this.lastTouches;this.lastTouches.push(t);var C=function(){var n=A.indexOf(t);n>-1&&A.splice(n,1)};setTimeout(C,dO)}}function lO(I,g){I&bg?(this.primaryTouch=g.changedPointers[0].identifier,fr.call(this,g)):I&(Ag|Tg)&&fr.call(this,g)}function hO(I){for(var g=I.srcEvent.clientX,e=I.srcEvent.clientY,t=0;t<this.lastTouches.length;t++){var A=this.lastTouches[t],C=Math.abs(g-A.x),i=Math.abs(e-A.y);if(C<=ur&&i<=ur)return!0}return!1}var yl=function(){var I=function(g){kg(e,g);function e(A,C){var i;return i=g.call(this,A,C)||this,i.handler=function(n,o,s){var r=s.pointerType===TA,a=s.pointerType===ro;if(!(a&&s.sourceCapabilities&&s.sourceCapabilities.firesTouchEvents)){if(r)lO.call(KA(KA(i)),o,s);else if(a&&hO.call(KA(KA(i)),s))return;i.callback(n,o,s)}},i.touch=new ho(i.manager,i.handler),i.mouse=new co(i.manager,i.handler),i.primaryTouch=null,i.lastTouches=[],i}var t=e.prototype;return t.destroy=function(){this.touch.destroy(),this.mouse.destroy()},e}(Tt);return I}();function cO(I){var g,e=I.options.inputClass;return e?g=e:Kx?g=bl:Ux?g=ho:dl?g=yl:g=co,new g(I,AO)}function it(I,g,e){return Array.isArray(I)?(Ae(I,e[g],e),!0):!1}var iI=1,Ng=2,ht=4,Ee=8,Ie=Ee,Jt=16,_g=32,uO=1;function fO(){return uO++}function HA(I,g){var e=g.manager;return e?e.get(I):I}function pr(I){return I&Jt?"cancel":I&Ee?"end":I&ht?"move":I&Ng?"start":""}var DA=function(){function I(e){e===void 0&&(e={}),this.options=Vg({enable:!0},e),this.id=fO(),this.manager=null,this.state=iI,this.simultaneous={},this.requireFail=[]}var g=I.prototype;return g.set=function(t){return Ge(this.options,t),this.manager&&this.manager.touchAction.update(),this},g.recognizeWith=function(t){if(it(t,"recognizeWith",this))return this;var A=this.simultaneous;return t=HA(t,this),A[t.id]||(A[t.id]=t,t.recognizeWith(this)),this},g.dropRecognizeWith=function(t){return it(t,"dropRecognizeWith",this)?this:(t=HA(t,this),delete this.simultaneous[t.id],this)},g.requireFailure=function(t){if(it(t,"requireFailure",this))return this;var A=this.requireFail;return t=HA(t,this),je(A,t)===-1&&(A.push(t),t.requireFailure(this)),this},g.dropRequireFailure=function(t){if(it(t,"dropRequireFailure",this))return this;t=HA(t,this);var A=je(this.requireFail,t);return A>-1&&this.requireFail.splice(A,1),this},g.hasRequireFailures=function(){return this.requireFail.length>0},g.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},g.emit=function(t){var A=this,C=this.state;function i(n){A.manager.emit(n,t)}C<Ee&&i(A.options.event+pr(C)),i(A.options.event),t.additionalEvent&&i(t.additionalEvent),C>=Ee&&i(A.options.event+pr(C))},g.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=_g},g.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(_g|iI)))return!1;t++}return!0},g.recognize=function(t){var A=Ge({},t);if(!CC(this.options.enable,[this,A])){this.reset(),this.state=_g;return}this.state&(Ie|Jt|_g)&&(this.state=iI),this.state=this.process(A),this.state&(Ng|ht|Ee|Jt)&&this.tryEmit(A)},g.process=function(t){},g.getTouchAction=function(){},g.reset=function(){},I}(),Bi=function(I){kg(g,I);function g(t){var A;return t===void 0&&(t={}),A=I.call(this,Vg({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,A.pTime=!1,A.pCenter=!1,A._timer=null,A._input=null,A.count=0,A}var e=g.prototype;return e.getTouchAction=function(){return[Mi]},e.process=function(A){var C=this,i=this.options,n=A.pointers.length===i.pointers,o=A.distance<i.threshold,s=A.deltaTime<i.time;if(this.reset(),A.eventType&bg&&this.count===0)return this.failTimeout();if(o&&s&&n){if(A.eventType!==Ag)return this.failTimeout();var r=this.pTime?A.timeStamp-this.pTime<i.interval:!0,a=!this.pCenter||mI(this.pCenter,A.center)<i.posThreshold;this.pTime=A.timeStamp,this.pCenter=A.center,!a||!r?this.count=1:this.count+=1,this._input=A;var d=this.count%i.taps;if(d===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){C.state=Ie,C.tryEmit()},i.interval),Ng):Ie}return _g},e.failTimeout=function(){var A=this;return this._timer=setTimeout(function(){A.state=_g},this.options.interval),_g},e.reset=function(){clearTimeout(this._timer)},e.emit=function(){this.state===Ie&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},g}(DA),ct=function(I){kg(g,I);function g(t){return t===void 0&&(t={}),I.call(this,Vg({pointers:1},t))||this}var e=g.prototype;return e.attrTest=function(A){var C=this.options.pointers;return C===0||A.pointers.length===C},e.process=function(A){var C=this.state,i=A.eventType,n=C&(Ng|ht),o=this.attrTest(A);return n&&(i&Tg||!o)?C|Jt:n||o?i&Ag?C|Ee:C&Ng?C|ht:Ng:_g},g}(DA);function wl(I){return I===lt?"down":I===PA?"up":I===xA?"left":I===OA?"right":""}var uo=function(I){kg(g,I);function g(t){var A;return t===void 0&&(t={}),A=I.call(this,Vg({event:"pan",threshold:10,pointers:1,direction:ll},t))||this,A.pX=null,A.pY=null,A}var e=g.prototype;return e.getTouchAction=function(){var A=this.options.direction,C=[];return A&Qg&&C.push(Ht),A&Le&&C.push(Ut),C},e.directionTest=function(A){var C=this.options,i=!0,n=A.distance,o=A.direction,s=A.deltaX,r=A.deltaY;return o&C.direction||(C.direction&Qg?(o=s===0?fI:s<0?xA:OA,i=s!==this.pX,n=Math.abs(A.deltaX)):(o=r===0?fI:r<0?PA:lt,i=r!==this.pY,n=Math.abs(A.deltaY))),A.direction=o,i&&n>C.threshold&&o&C.direction},e.attrTest=function(A){return ct.prototype.attrTest.call(this,A)&&(this.state&Ng||!(this.state&Ng)&&this.directionTest(A))},e.emit=function(A){this.pX=A.deltaX,this.pY=A.deltaY;var C=wl(A.direction);C&&(A.additionalEvent=this.options.event+C),I.prototype.emit.call(this,A)},g}(ct),El=function(I){kg(g,I);function g(t){return t===void 0&&(t={}),I.call(this,Vg({event:"swipe",threshold:10,velocity:.3,direction:Qg|Le,pointers:1},t))||this}var e=g.prototype;return e.getTouchAction=function(){return uo.prototype.getTouchAction.call(this)},e.attrTest=function(A){var C=this.options.direction,i;return C&(Qg|Le)?i=A.overallVelocity:C&Qg?i=A.overallVelocityX:C&Le&&(i=A.overallVelocityY),I.prototype.attrTest.call(this,A)&&C&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers===this.options.pointers&&Ve(i)>this.options.velocity&&A.eventType&Ag},e.emit=function(A){var C=wl(A.offsetDirection);C&&this.manager.emit(this.options.event+C,A),this.manager.emit(this.options.event,A)},g}(ct),Tl=function(I){kg(g,I);function g(t){return t===void 0&&(t={}),I.call(this,Vg({event:"pinch",threshold:0,pointers:2},t))||this}var e=g.prototype;return e.getTouchAction=function(){return[Ze]},e.attrTest=function(A){return I.prototype.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||this.state&Ng)},e.emit=function(A){if(A.scale!==1){var C=A.scale<1?"in":"out";A.additionalEvent=this.options.event+C}I.prototype.emit.call(this,A)},g}(ct),xl=function(I){kg(g,I);function g(t){return t===void 0&&(t={}),I.call(this,Vg({event:"rotate",threshold:0,pointers:2},t))||this}var e=g.prototype;return e.getTouchAction=function(){return[Ze]},e.attrTest=function(A){return I.prototype.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||this.state&Ng)},g}(ct),Ol=function(I){kg(g,I);function g(t){var A;return t===void 0&&(t={}),A=I.call(this,Vg({event:"press",pointers:1,time:251,threshold:9},t))||this,A._timer=null,A._input=null,A}var e=g.prototype;return e.getTouchAction=function(){return[al]},e.process=function(A){var C=this,i=this.options,n=A.pointers.length===i.pointers,o=A.distance<i.threshold,s=A.deltaTime>i.time;if(this._input=A,!o||!n||A.eventType&(Ag|Tg)&&!s)this.reset();else if(A.eventType&bg)this.reset(),this._timer=setTimeout(function(){C.state=Ie,C.tryEmit()},i.time);else if(A.eventType&Ag)return Ie;return _g},e.reset=function(){clearTimeout(this._timer)},e.emit=function(A){this.state===Ie&&(A&&A.eventType&Ag?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=so(),this.manager.emit(this.options.event,this._input)))},g}(DA),Pl={domEvents:!1,touchAction:rl,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},mr=[[xl,{enable:!1}],[Tl,{enable:!1},["rotate"]],[El,{direction:Qg}],[uo,{direction:Qg},["swipe"]],[Bi],[Bi,{event:"doubletap",taps:2},["tap"]],[Ol]],pO=1,vr=2;function br(I,g){var e=I.element;if(e.style){var t;Ae(I.options.cssProps,function(A,C){t=IC(e.style,C),g?(I.oldCssProps[t]=e.style[t],e.style[t]=A):e.style[t]=I.oldCssProps[t]||""}),g||(I.oldCssProps={})}}function mO(I,g){var e=document.createEvent("Event");e.initEvent(I,!0,!0),e.gesture=g,g.target.dispatchEvent(e)}var yr=function(){function I(e,t){var A=this;this.options=Ge({},Pl,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=cO(this),this.touchAction=new cl(this,this.options.touchAction),br(this,!0),Ae(this.options.recognizers,function(C){var i=A.add(new C[0](C[1]));C[2]&&i.recognizeWith(C[2]),C[3]&&i.requireFailure(C[3])},this)}var g=I.prototype;return g.set=function(t){return Ge(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},g.stop=function(t){this.session.stopped=t?vr:pO},g.recognize=function(t){var A=this.session;if(!A.stopped){this.touchAction.preventDefaults(t);var C,i=this.recognizers,n=A.curRecognizer;(!n||n&&n.state&Ie)&&(A.curRecognizer=null,n=null);for(var o=0;o<i.length;)C=i[o],A.stopped!==vr&&(!n||C===n||C.canRecognizeWith(n))?C.recognize(t):C.reset(),!n&&C.state&(Ng|ht|Ee)&&(A.curRecognizer=C,n=C),o++}},g.get=function(t){if(t instanceof DA)return t;for(var A=this.recognizers,C=0;C<A.length;C++)if(A[C].options.event===t)return A[C];return null},g.add=function(t){if(it(t,"add",this))return this;var A=this.get(t.options.event);return A&&this.remove(A),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},g.remove=function(t){if(it(t,"remove",this))return this;var A=this.get(t);if(t){var C=this.recognizers,i=je(C,A);i!==-1&&(C.splice(i,1),this.touchAction.update())}return this},g.on=function(t,A){if(t===void 0||A===void 0)return this;var C=this.handlers;return Ae(Qt(t),function(i){C[i]=C[i]||[],C[i].push(A)}),this},g.off=function(t,A){if(t===void 0)return this;var C=this.handlers;return Ae(Qt(t),function(i){A?C[i]&&C[i].splice(je(C[i],A),1):delete C[i]}),this},g.emit=function(t,A){this.options.domEvents&&mO(t,A);var C=this.handlers[t]&&this.handlers[t].slice();if(!(!C||!C.length)){A.type=t,A.preventDefault=function(){A.srcEvent.preventDefault()};for(var i=0;i<C.length;)C[i](A),i++}},g.destroy=function(){this.element&&br(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},I}(),vO={touchstart:bg,touchmove:Ue,touchend:Ag,touchcancel:Tg},bO="touchstart",yO="touchstart touchmove touchend touchcancel",wO=function(I){kg(g,I);function g(){var t,A=g.prototype;return A.evTarget=bO,A.evWin=yO,t=I.apply(this,arguments)||this,t.started=!1,t}var e=g.prototype;return e.handler=function(A){var C=vO[A.type];if(C===bg&&(this.started=!0),!!this.started){var i=EO.call(this,A,C);C&(Ag|Tg)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,C,{pointers:i[0],changedPointers:i[1],pointerType:TA,srcEvent:A})}},g}(Tt);function EO(I,g){var e=Xt(I.touches),t=Xt(I.changedTouches);return g&(Ag|Tg)&&(e=lo(e.concat(t),"identifier",!0)),[e,t]}function Dl(I,g,e){var t="DEPRECATED METHOD: "+g+`
632
- `+e+` AT
633
- `;return function(){var A=new Error("get-stack-trace"),C=A&&A.stack?A.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=window.console&&(window.console.warn||window.console.log);return i&&i.call(window.console,t,C),I.apply(this,arguments)}}var Rl=Dl(function(I,g,e){for(var t=Object.keys(g),A=0;A<t.length;)(!e||e&&I[t[A]]===void 0)&&(I[t[A]]=g[t[A]]),A++;return I},"extend","Use `assign`."),TO=Dl(function(I,g){return Rl(I,g,!0)},"merge","Use `assign`.");function xO(I,g,e){var t=g.prototype,A;A=I.prototype=Object.create(t),A.constructor=I,A._super=t,e&&Ge(A,e)}function wr(I,g){return function(){return I.apply(g,arguments)}}var Nl=function(){var I=function(e,t){return t===void 0&&(t={}),new yr(e,Vg({recognizers:mr.concat()},t))};return I.VERSION="2.0.17-rc",I.DIRECTION_ALL=ll,I.DIRECTION_DOWN=lt,I.DIRECTION_LEFT=xA,I.DIRECTION_RIGHT=OA,I.DIRECTION_UP=PA,I.DIRECTION_HORIZONTAL=Qg,I.DIRECTION_VERTICAL=Le,I.DIRECTION_NONE=fI,I.DIRECTION_DOWN=lt,I.INPUT_START=bg,I.INPUT_MOVE=Ue,I.INPUT_END=Ag,I.INPUT_CANCEL=Tg,I.STATE_POSSIBLE=iI,I.STATE_BEGAN=Ng,I.STATE_CHANGED=ht,I.STATE_ENDED=Ee,I.STATE_RECOGNIZED=Ie,I.STATE_CANCELLED=Jt,I.STATE_FAILED=_g,I.Manager=yr,I.Input=Tt,I.TouchAction=cl,I.TouchInput=ho,I.MouseInput=co,I.PointerEventInput=bl,I.TouchMouseInput=yl,I.SingleTouchInput=wO,I.Recognizer=DA,I.AttrRecognizer=ct,I.Tap=Bi,I.Pan=uo,I.Swipe=El,I.Pinch=Tl,I.Rotate=xl,I.Press=Ol,I.on=Lt,I.off=Gt,I.each=Ae,I.merge=TO,I.extend=Rl,I.bindFn=wr,I.assign=Ge,I.inherit=xO,I.bindFn=wr,I.prefixed=IC,I.toArray=Xt,I.inArray=je,I.uniqueArray=lo,I.splitStr=Qt,I.boolOrFn=CC,I.hasParent=ao,I.addEventListeners=Lt,I.removeEventListeners=Gt,I.defaults=Ge({},Pl,{preset:mr}),I}();Nl.defaults;var OO=Nl,Sl=Ny("DELETE");function PO(I){for(var g=arguments.length,e=new Array(g>1?g-1:0),t=1;t<g;t++)e[t-1]=arguments[t];return kl({},I,...e)}function kl(){let I=vI(...arguments);return Fl(I),I}function vI(){for(var I=arguments.length,g=new Array(I),e=0;e<I;e++)g[e]=arguments[e];if(g.length<2)return g[0];if(g.length>2)return vI(kl(g[0],g[1]),...Zg(g).call(g,2));let t=g[0],A=g[1];if(t instanceof Date&&A instanceof Date)return t.setTime(A.getTime()),t;for(let C of a0(A))Object.prototype.propertyIsEnumerable.call(A,C)&&(A[C]===Sl?delete t[C]:t[C]!==null&&A[C]!==null&&typeof t[C]=="object"&&typeof A[C]=="object"&&!B(t[C])&&!B(A[C])?t[C]=vI(t[C],A[C]):t[C]=Ml(A[C]));return t}function Ml(I){return B(I)?ag(I).call(I,g=>Ml(g)):typeof I=="object"&&I!==null?I instanceof Date?new Date(I.getTime()):vI({},I):I}function Fl(I){for(let g of U(I))I[g]===Sl?delete I[g]:typeof I[g]=="object"&&I[g]!==null&&Fl(I[g])}function iC(){for(var I=arguments.length,g=new Array(I),e=0;e<I;e++)g[e]=arguments[e];return DO(g.length?g:[uI()])}function DO(I){let[g,e,t]=RO(I),A=1,C=()=>{let i=2091639*g+A*23283064365386963e-26;return g=e,e=t,t=i-(A=i|0)};return C.uint32=()=>C()*4294967296,C.fract53=()=>C()+(C()*2097152|0)*11102230246251565e-32,C.algorithm="Alea",C.seed=I,C.version="0.9",C}function RO(){let I=NO(),g=I(" "),e=I(" "),t=I(" ");for(let A=0;A<arguments.length;A++)g-=I(A<0||arguments.length<=A?void 0:arguments[A]),g<0&&(g+=1),e-=I(A<0||arguments.length<=A?void 0:arguments[A]),e<0&&(e+=1),t-=I(A<0||arguments.length<=A?void 0:arguments[A]),t<0&&(t+=1);return[g,e,t]}function NO(){let I=4022871197;return function(g){let e=g.toString();for(let t=0;t<e.length;t++){I+=e.charCodeAt(t);let A=.02519603282416938*I;I=A>>>0,A-=I,A*=I,I=A>>>0,A-=I,I+=A*4294967296}return(I>>>0)*23283064365386963e-26}}function SO(){let I=()=>{};return{on:I,off:I,destroy:I,emit:I,get(){return{set:I}}}}var fo=typeof window!="undefined"?window.Hammer||OO:function(){return SO()};function Kg(I){var g;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)});let e=fo(this._dom.overlay);e.on("tap",b(g=this._onTapOverlay).call(g,this)),this._cleanupQueue.push(()=>{e.destroy()});let t=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];F(t).call(t,A=>{e.on(A,C=>{C.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=A=>{kO(A.target,I)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=A=>{("key"in A?A.key==="Escape":A.keyCode===27)&&this.deactivate()}}$a(Kg.prototype);Kg.current=null;Kg.prototype.destroy=function(){this.deactivate();for(let e of ze(I=Ug(g=this._cleanupQueue).call(g,0)).call(I)){var I,g;e()}};Kg.prototype.activate=function(){Kg.current&&Kg.current.deactivate(),Kg.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)};Kg.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")};Kg.prototype._onTapOverlay=function(I){this.activate(),I.srcEvent.stopPropagation()};function kO(I,g){for(;I;){if(I===g)return!0;I=I.parentNode}return!1}var MO=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,FO=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,BO=/^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,zO=/^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 ue(I){if(I)for(;I.hasChildNodes()===!0;){let g=I.firstChild;g&&(ue(g),I.removeChild(g))}}function pe(I){return I instanceof String||typeof I=="string"}function Er(I){return typeof I=="object"&&I!==null}function We(I,g,e,t){let A=!1;t===!0&&(A=g[e]===null&&I[e]!==void 0),A?delete I[e]:I[e]=g[e]}function Bl(I,g){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(let t in I)if(g[t]!==void 0)if(g[t]===null||typeof g[t]!="object")We(I,g,t,e);else{let A=I[t],C=g[t];Er(A)&&Er(C)&&Bl(A,C,e)}}function xt(I,g,e){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(B(e))throw new TypeError("Arrays are not supported by deepExtend");for(let A=0;A<I.length;A++){let C=I[A];if(Object.prototype.hasOwnProperty.call(e,C))if(e[C]&&e[C].constructor===Object)g[C]===void 0&&(g[C]={}),g[C].constructor===Object?_(g[C],e[C],!1,t):We(g,e,C,t);else{if(B(e[C]))throw new TypeError("Arrays are not supported by deepExtend");We(g,e,C,t)}}return g}function bI(I,g,e){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(B(e))throw new TypeError("Arrays are not supported by deepExtend");for(let A in e)if(Object.prototype.hasOwnProperty.call(e,A)&&!ye(I).call(I,A))if(e[A]&&e[A].constructor===Object)g[A]===void 0&&(g[A]={}),g[A].constructor===Object?_(g[A],e[A]):We(g,e,A,t);else if(B(e[A])){g[A]=[];for(let C=0;C<e[A].length;C++)g[A].push(e[A][C])}else We(g,e,A,t);return g}function _(I,g){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(let C in g)if(Object.prototype.hasOwnProperty.call(g,C)||e===!0)if(typeof g[C]=="object"&&g[C]!==null&&Ar(g[C])===Object.prototype)I[C]===void 0?I[C]=_({},g[C],e):typeof I[C]=="object"&&I[C]!==null&&Ar(I[C])===Object.prototype?_(I[C],g[C],e):We(I,g,C,t);else if(B(g[C])){var A;I[C]=Zg(A=g[C]).call(A)}else We(I,g,C,t);return I}function yI(I,g){return[...I,g]}function ZO(I){return Zg(I).call(I)}function LO(I){return I.getBoundingClientRect().left}function GO(I){return I.getBoundingClientRect().top}function S(I,g){if(B(I)){let e=I.length;for(let t=0;t<e;t++)g(I[t],t,I)}else for(let e in I)Object.prototype.hasOwnProperty.call(I,e)&&g(I[e],e,I)}function po(I){let g;switch(I.length){case 3:case 4:return g=FO.exec(I),g?{r:zg(g[1]+g[1],16),g:zg(g[2]+g[2],16),b:zg(g[3]+g[3],16)}:null;case 6:case 7:return g=MO.exec(I),g?{r:zg(g[1],16),g:zg(g[2],16),b:zg(g[3],16)}:null;default:return null}}function Rg(I,g){if(ye(I).call(I,"rgba"))return I;if(ye(I).call(I,"rgb")){let e=I.substr(G(I).call(I,"(")+1).replace(")","").split(",");return"rgba("+e[0]+","+e[1]+","+e[2]+","+g+")"}else{let e=po(I);return e==null?I:"rgba("+e.r+","+e.g+","+e.b+","+g+")"}}function zl(I,g,e){var t;return"#"+Zg(t=((1<<24)+(I<<16)+(g<<8)+e).toString(16)).call(t,1)}function zi(I,g){if(pe(I)){let t=I;if(Ll(t)){var e;let A=ag(e=t.substr(4).substr(0,t.length-5).split(",")).call(e,function(C){return zg(C)});t=zl(A[0],A[1],A[2])}if(Zl(t)===!0){let A=VO(t),C={h:A.h,s:A.s*.8,v:Math.min(1,A.v*1.02)},i={h:A.h,s:Math.min(1,A.s*1.25),v:A.v*.8},n=Zi(i.h,i.s,i.v),o=Zi(C.h,C.s,C.v);return{background:t,border:n,highlight:{background:o,border:n},hover:{background:o,border:n}}}else return{background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else return g?{background:I.background||g.background,border:I.border||g.border,highlight:pe(I.highlight)?{border:I.highlight,background:I.highlight}:{background:I.highlight&&I.highlight.background||g.highlight.background,border:I.highlight&&I.highlight.border||g.highlight.border},hover:pe(I.hover)?{border:I.hover,background:I.hover}:{border:I.hover&&I.hover.border||g.hover.border,background:I.hover&&I.hover.background||g.hover.background}}:{background:I.background||void 0,border:I.border||void 0,highlight:pe(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:pe(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 Bt(I,g,e){I=I/255,g=g/255,e=e/255;let t=Math.min(I,Math.min(g,e)),A=Math.max(I,Math.max(g,e));if(t===A)return{h:0,s:0,v:t};let C=I===t?g-e:e===t?I-g:e-I,n=60*((I===t?3:e===t?1:5)-C/(A-t))/360,o=(A-t)/A;return{h:n,s:o,v:A}}function nI(I,g,e){let t,A,C,i=Math.floor(I*6),n=I*6-i,o=e*(1-g),s=e*(1-n*g),r=e*(1-(1-n)*g);switch(i%6){case 0:t=e,A=r,C=o;break;case 1:t=s,A=e,C=o;break;case 2:t=o,A=e,C=r;break;case 3:t=o,A=s,C=e;break;case 4:t=r,A=o,C=e;break;case 5:t=e,A=o,C=s;break}return{r:Math.floor(t*255),g:Math.floor(A*255),b:Math.floor(C*255)}}function Zi(I,g,e){let t=nI(I,g,e);return zl(t.r,t.g,t.b)}function VO(I){let g=po(I);if(!g)throw new TypeError("'".concat(I,"' is not a valid color."));return Bt(g.r,g.g,g.b)}function Zl(I){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(I)}function Ll(I){return BO.test(I)}function jO(I){return zO.test(I)}function Te(I){if(I===null||typeof I!="object")return null;if(I instanceof Element)return I;let g=we(I);for(let e in I)Object.prototype.hasOwnProperty.call(I,e)&&typeof I[e]=="object"&&(g[e]=Te(I[e]));return g}function Dg(I,g,e){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},A=function(l){return l!=null},C=function(l){return l!==null&&typeof l=="object"},i=function(l){for(let h in l)if(Object.prototype.hasOwnProperty.call(l,h))return!1;return!0};if(!C(I))throw new Error("Parameter mergeTarget must be an object");if(!C(g))throw new Error("Parameter options must be an object");if(!A(e))throw new Error("Parameter option must have a value");if(!C(t))throw new Error("Parameter globalOptions must be an object");let n=function(l,h,c){C(l[c])||(l[c]={});let p=h[c],u=l[c];for(let m in p)Object.prototype.hasOwnProperty.call(p,m)&&(u[m]=p[m])},o=g[e],r=C(t)&&!i(t)?t[e]:void 0,a=r?r.enabled:void 0;if(o===void 0)return;if(typeof o=="boolean"){C(I[e])||(I[e]={}),I[e].enabled=o;return}if(o===null&&!C(I[e]))if(A(r))I[e]=we(r);else return;if(!C(o))return;let d=!0;o.enabled!==void 0?d=o.enabled:a!==void 0&&(d=r.enabled),n(I,g,e),I[e].enabled=d}var WO={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 fe(I,g){let e;B(g)||(g=[g]);for(let t of I)if(t){e=t[g[0]];for(let A=1;A<g.length;A++)e&&(e=e[g[A]]);if(typeof e!="undefined")break}return e}var YO={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"},_O=class{constructor(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.pixelRatio=g,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(g){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=g,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(g){if(typeof g=="function")this.updateCallback=g;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}setCloseCallback(g){if(typeof g=="function")this.closeCallback=g;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}_isColorString(g){if(typeof g=="string")return YO[g]}setColor(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(g==="none")return;let t,A=this._isColorString(g);if(A!==void 0&&(g=A),pe(g)===!0){if(Ll(g)===!0){let C=g.substr(4).substr(0,g.length-5).split(",");t={r:C[0],g:C[1],b:C[2],a:1}}else if(jO(g)===!0){let C=g.substr(5).substr(0,g.length-6).split(",");t={r:C[0],g:C[1],b:C[2],a:C[3]}}else if(Zl(g)===!0){let C=po(g);t={r:C.r,g:C.g,b:C.b,a:1}}}else if(g instanceof Object&&g.r!==void 0&&g.g!==void 0&&g.b!==void 0){let C=g.a!==void 0?g.a:"1.0";t={r:g.r,g:g.g,b:g.b,a:C}}if(t===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: "+Et(g));this._setColor(t,e)}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=q({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",Hg(()=>{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(g){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)===!0&&(this.initialColor=q({},g)),this.color=g;let t=Bt(g.r,g.g,g.b),A=2*Math.PI,C=this.r*t.s,i=this.centerCoordinates.x+C*Math.sin(A*t.h),n=this.centerCoordinates.y+C*Math.cos(A*t.h);this.colorPickerSelector.style.left=i-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=n-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(g)}_setOpacity(g){this.color.a=g/100,this._updatePicker(this.color)}_setBrightness(g){let e=Bt(this.color.r,this.color.g,this.color.b);e.v=g/100;let t=nI(e.h,e.s,e.v);t.a=this.color.a,this.color=t,this._updatePicker()}_updatePicker(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color,e=Bt(g.r,g.g,g.b),t=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let A=this.colorPickerCanvas.clientWidth,C=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,A,C),t.putImageData(this.hueCircle,0,0),t.fillStyle="rgba(0,0,0,"+(1-e.v)+")",t.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),EA(t).call(t),this.brightnessRange.value=100*e.v,this.opacityRange.value=100*g.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 g,e,t,A;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){let i=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{let i=document.createElement("DIV");i.style.color="red",i.style.fontWeight="bold",i.style.padding="10px",i.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(i)}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(i){}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(i){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);let C=this;this.opacityRange.onchange=function(){C._setOpacity(this.value)},this.opacityRange.oninput=function(){C._setOpacity(this.value)},this.brightnessRange.onchange=function(){C._setBrightness(this.value)},this.brightnessRange.oninput=function(){C._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=b(g=this._hide).call(g,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=b(e=this._apply).call(e,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=b(t=this._save).call(t,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=b(A=this._loadLast).call(A,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 fo(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",g=>{g.isFirst&&this._moveSelector(g)}),this.hammer.on("tap",g=>{this._moveSelector(g)}),this.hammer.on("panstart",g=>{this._moveSelector(g)}),this.hammer.on("panmove",g=>{this._moveSelector(g)}),this.hammer.on("panend",g=>{this._moveSelector(g)})}_generateHueCircle(){if(this.generated===!1){let g=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1)),g.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let e=this.colorPickerCanvas.clientWidth,t=this.colorPickerCanvas.clientHeight;g.clearRect(0,0,e,t);let A,C,i,n;this.centerCoordinates={x:e*.5,y:t*.5},this.r=.49*e;let o=2*Math.PI/360,s=1/360,r=1/this.r,a;for(i=0;i<360;i++)for(n=0;n<this.r;n++)A=this.centerCoordinates.x+n*Math.sin(o*i),C=this.centerCoordinates.y+n*Math.cos(o*i),a=nI(i*s,n*r,1),g.fillStyle="rgb("+a.r+","+a.g+","+a.b+")",g.fillRect(A-.5,C-.5,2,2);g.strokeStyle="rgba(0,0,0,1)",g.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),g.stroke(),this.hueCircle=g.getImageData(0,0,e,t)}this.generated=!0}_moveSelector(g){let e=this.colorPickerDiv.getBoundingClientRect(),t=g.center.x-e.left,A=g.center.y-e.top,C=.5*this.colorPickerDiv.clientHeight,i=.5*this.colorPickerDiv.clientWidth,n=t-i,o=A-C,s=Math.atan2(n,o),r=.98*Math.min(Math.sqrt(n*n+o*o),i),a=Math.cos(s)*r+C,d=Math.sin(s)*r+i;this.colorPickerSelector.style.top=a-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=d-.5*this.colorPickerSelector.clientWidth+"px";let l=s/(2*Math.PI);l=l<0?l+1:l;let h=r/this.r,c=Bt(this.color.r,this.color.g,this.color.b);c.h=l,c.s=h;let p=nI(c.h,c.s,c.v);p.a=this.color.a,this.color=p,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}};function Li(){for(var I=arguments.length,g=new Array(I),e=0;e<I;e++)g[e]=arguments[e];if(g.length<1)throw new TypeError("Invalid arguments.");if(g.length===1)return document.createTextNode(g[0]);{let t=document.createElement(g[0]);return t.appendChild(Li(...Zg(g).call(g,1))),t}}var KO=class{constructor(g,e,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=g,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.hideOption=C,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},q(this.options,this.defaultOptions),this.configureOptions=t,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new _O(A),this.wrapper=void 0}setOptions(g){if(g!==void 0){this.popupHistory={},this._removePopup();let e=!0;if(typeof g=="string")this.options.filter=g;else if(B(g))this.options.filter=g.join();else if(typeof g=="object"){if(g==null)throw new TypeError("options cannot be null");g.container!==void 0&&(this.options.container=g.container),tg(g)!==void 0&&(this.options.filter=tg(g)),g.showButton!==void 0&&(this.options.showButton=g.showButton),g.enabled!==void 0&&(e=g.enabled)}else typeof g=="boolean"?(this.options.filter=!0,e=g):typeof g=="function"&&(this.options.filter=g,e=!0);tg(this.options)===!1&&(e=!1),this.options.enabled=e}this._clean()}setModuleOptions(g){this.moduleOptions=g,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];let g=tg(this.options),e=0,t=!1;for(let A in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,A)&&(this.allowCreation=!1,t=!1,typeof g=="function"?(t=g(A,[]),t=t||this._handleObject(this.configureOptions[A],[A],!0)):(g===!0||G(g).call(g,A)!==-1)&&(t=!0),t!==!1&&(this.allowCreation=!0,e>0&&this._makeItem([]),this._makeHeader(A),this._handleObject(this.configureOptions[A],[A])),e++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let g=0;g<this.domElements.length;g++)this.wrapper.appendChild(this.domElements[g]);this._showPopupIfNeeded()}_clean(){for(let g=0;g<this.domElements.length;g++)this.wrapper.removeChild(this.domElements[g]);this.wrapper!==void 0&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}_getValue(g){let e=this.moduleOptions;for(let t=0;t<g.length;t++)if(e[g[t]]!==void 0)e=e[g[t]];else{e=void 0;break}return e}_makeItem(g){if(this.allowCreation===!0){let C=document.createElement("div");C.className="vis-configuration vis-config-item vis-config-s"+g.length;for(var e=arguments.length,t=new Array(e>1?e-1:0),A=1;A<e;A++)t[A-1]=arguments[A];return F(t).call(t,i=>{C.appendChild(i)}),this.domElements.push(C),this.domElements.length}return 0}_makeHeader(g){let e=document.createElement("div");e.className="vis-configuration vis-config-header",e.innerText=g,this._makeItem([],e)}_makeLabel(g,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=document.createElement("div");if(A.className="vis-configuration vis-config-label vis-config-s"+e.length,t===!0){for(;A.firstChild;)A.removeChild(A.firstChild);A.appendChild(Li("i","b",g))}else A.innerText=g+":";return A}_makeDropdown(g,e,t){let A=document.createElement("select");A.className="vis-configuration vis-config-select";let C=0;e!==void 0&&G(g).call(g,e)!==-1&&(C=G(g).call(g,e));for(let o=0;o<g.length;o++){let s=document.createElement("option");s.value=g[o],o===C&&(s.selected="selected"),s.innerText=g[o],A.appendChild(s)}let i=this;A.onchange=function(){i._update(this.value,t)};let n=this._makeLabel(t[t.length-1],t);this._makeItem(t,n,A)}_makeRange(g,e,t){let A=g[0],C=g[1],i=g[2],n=g[3],o=document.createElement("input");o.className="vis-configuration vis-config-range";try{o.type="range",o.min=C,o.max=i}catch(c){}o.step=n;let s="",r=0;e!==void 0?(e<0&&e*1.2<C?(o.min=Math.ceil(e*1.2),r=o.min,s="range increased"):e/1.2<C&&(o.min=Math.ceil(e/1.2),r=o.min,s="range increased"),e*1.2>i&&i!==1&&(o.max=Math.ceil(e*1.2),r=o.max,s="range increased"),o.value=e):o.value=A;let a=document.createElement("input");a.className="vis-configuration vis-config-rangeinput",a.value=o.value;let d=this;o.onchange=function(){a.value=this.value,d._update(Number(this.value),t)},o.oninput=function(){a.value=this.value};let l=this._makeLabel(t[t.length-1],t),h=this._makeItem(t,l,o,a);s!==""&&this.popupHistory[h]!==r&&(this.popupHistory[h]=r,this._setupPopup(s,h))}_makeButton(){if(this.options.showButton===!0){let g=document.createElement("div");g.className="vis-configuration vis-config-button",g.innerText="generate options",g.onclick=()=>{this._printOptions()},g.onmouseover=()=>{g.className="vis-configuration vis-config-button hover"},g.onmouseout=()=>{g.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(g)}}_setupPopup(g,e){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){let t=document.createElement("div");t.id="vis-configuration-popup",t.className="vis-configuration-popup",t.innerText=g,t.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:t,index:e}}}_removePopup(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(this.popupDiv.html!==void 0){let e=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=e.left+"px",this.popupDiv.html.style.top=e.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=Hg(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=Hg(()=>{this._removePopup()},1800)}}_makeCheckbox(g,e,t){let A=document.createElement("input");A.type="checkbox",A.className="vis-configuration vis-config-checkbox",A.checked=g,e!==void 0&&(A.checked=e,e!==g&&(typeof g=="object"?e!==g.enabled&&this.changedOptions.push({path:t,value:e}):this.changedOptions.push({path:t,value:e})));let C=this;A.onchange=function(){C._update(this.checked,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,A)}_makeTextInput(g,e,t){let A=document.createElement("input");A.type="text",A.className="vis-configuration vis-config-text",A.value=e,e!==g&&this.changedOptions.push({path:t,value:e});let C=this;A.onchange=function(){C._update(this.value,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,A)}_makeColorField(g,e,t){let A=g[1],C=document.createElement("div");e=e===void 0?A:e,e!=="none"?(C.className="vis-configuration vis-config-colorBlock",C.style.backgroundColor=e):C.className="vis-configuration vis-config-colorBlock none",e=e===void 0?A:e,C.onclick=()=>{this._showColorPicker(e,C,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,C)}_showColorPicker(g,e,t){e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(g),this.colorPicker.setUpdateCallback(A=>{let C="rgba("+A.r+","+A.g+","+A.b+","+A.a+")";e.style.backgroundColor=C,this._update(C,t)}),this.colorPicker.setCloseCallback(()=>{e.onclick=()=>{this._showColorPicker(g,e,t)}})}_handleObject(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=!1,C=tg(this.options),i=!1;for(let n in g)if(Object.prototype.hasOwnProperty.call(g,n)){A=!0;let o=g[n],s=yI(e,n);if(typeof C=="function"&&(A=C(n,e),A===!1&&!B(o)&&typeof o!="string"&&typeof o!="boolean"&&o instanceof Object&&(this.allowCreation=!1,A=this._handleObject(o,s,!0),this.allowCreation=t===!1)),A!==!1){i=!0;let r=this._getValue(s);if(B(o))this._handleArray(o,r,s);else if(typeof o=="string")this._makeTextInput(o,r,s);else if(typeof o=="boolean")this._makeCheckbox(o,r,s);else if(o instanceof Object){if(!this.hideOption(e,n,this.moduleOptions))if(o.enabled!==void 0){let a=yI(s,"enabled"),d=this._getValue(a);if(d===!0){let l=this._makeLabel(n,s,!0);this._makeItem(s,l),i=this._handleObject(o,s)||i}else this._makeCheckbox(o,d,s)}else{let a=this._makeLabel(n,s,!0);this._makeItem(s,a),i=this._handleObject(o,s)||i}}else console.error("dont know how to handle",o,n,s)}}return i}_handleArray(g,e,t){typeof g[0]=="string"&&g[0]==="color"?(this._makeColorField(g,e,t),g[1]!==e&&this.changedOptions.push({path:t,value:e})):typeof g[0]=="string"?(this._makeDropdown(g,e,t),g[0]!==e&&this.changedOptions.push({path:t,value:e})):typeof g[0]=="number"&&(this._makeRange(g,e,t),g[0]!==e&&this.changedOptions.push({path:t,value:Number(e)}))}_update(g,e){let t=this._constructOptions(g,e);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",t),this.initialized=!0,this.parent.setOptions(t)}_constructOptions(g,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=t;g=g==="true"?!0:g,g=g==="false"?!1:g;for(let C=0;C<e.length;C++)e[C]!=="global"&&(A[e[C]]===void 0&&(A[e[C]]={}),C!==e.length-1?A=A[e[C]]:A[e[C]]=g);return t}_printOptions(){let g=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(Li("pre","const options = "+Et(g,null,2)))}getOptions(){let g={};for(let e=0;e<this.changedOptions.length;e++)this._constructOptions(this.changedOptions[e].value,this.changedOptions[e].path,g);return g}},UO=class{constructor(g,e){this.container=g,this.overflowMethod=e||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}setPosition(g,e){this.x=zg(g),this.y=zg(e)}setText(g){if(g instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(g)}else this.frame.innerText=g}show(g){if(g===void 0&&(g=!0),g===!0){let e=this.frame.clientHeight,t=this.frame.clientWidth,A=this.frame.parentNode.clientHeight,C=this.frame.parentNode.clientWidth,i=0,n=0;if(this.overflowMethod=="flip"){let o=!1,s=!0;this.y-e<this.padding&&(s=!1),this.x+t>C-this.padding&&(o=!0),o?i=this.x-t:i=this.x,s?n=this.y-e:n=this.y}else n=this.y-e,n+e+this.padding>A&&(n=A-e-this.padding),n<this.padding&&(n=this.padding),i=this.x,i+t+this.padding>C&&(i=C-t-this.padding),i<this.padding&&(i=this.padding);this.frame.style.left=i+"px",this.frame.style.top=n+"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)}},Rt=!1,Tr,Gi="background: #FFeeee; color: #dd0000",HO=class Q{static validate(g,e,t){Rt=!1,Tr=e;let A=e;return t!==void 0&&(A=e[t]),Q.parse(g,A,[]),Rt}static parse(g,e,t){for(let A in g)Object.prototype.hasOwnProperty.call(g,A)&&Q.check(A,g,e,t)}static check(g,e,t,A){if(t[g]===void 0&&t.__any__===void 0){Q.getSuggestion(g,t,A);return}let C=g,i=!0;t[g]===void 0&&t.__any__!==void 0&&(C="__any__",i=Q.getType(e[g])==="object");let n=t[C];i&&n.__type__!==void 0&&(n=n.__type__),Q.checkFields(g,e,t,C,n,A)}static checkFields(g,e,t,A,C,i){let n=function(r){console.error("%c"+r+Q.printLocation(i,g),Gi)},o=Q.getType(e[g]),s=C[o];s!==void 0?Q.getType(s)==="array"&&G(s).call(s,e[g])===-1?(n('Invalid option detected in "'+g+'". Allowed values are:'+Q.print(s)+' not "'+e[g]+'". '),Rt=!0):o==="object"&&A!=="__any__"&&(i=yI(i,g),Q.parse(e[g],t[A],i)):C.any===void 0&&(n('Invalid type received for "'+g+'". Expected: '+Q.print(U(C))+". Received ["+o+'] "'+e[g]+'"'),Rt=!0)}static getType(g){let e=typeof g;return e==="object"?g===null?"null":g instanceof Boolean?"boolean":g instanceof Number?"number":g instanceof String?"string":B(g)?"array":g instanceof Date?"date":g.nodeType!==void 0?"dom":g._isAMomentObject===!0?"moment":"object":e==="number"?"number":e==="boolean"?"boolean":e==="string"?"string":e===void 0?"undefined":e}static getSuggestion(g,e,t){let A=Q.findInOptions(g,e,t,!1),C=Q.findInOptions(g,Tr,[],!0),i=8,n=4,o;A.indexMatch!==void 0?o=" in "+Q.printLocation(A.path,g,"")+'Perhaps it was incomplete? Did you mean: "'+A.indexMatch+`"?
630
+ `;_g(hp);var qa={exports:{}};(function(I){I.exports=e;function e(t){if(t)return g(t)}function g(t){for(var A in e.prototype)t[A]=e.prototype[A];return t}e.prototype.on=e.prototype.addEventListener=function(t,A){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(A),this},e.prototype.once=function(t,A){function C(){this.off(t,C),A.apply(this,arguments)}return C.fn=A,this.on(t,C),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,A){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var C=this._callbacks["$"+t];if(!C)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var i,n=0;n<C.length;n++)if(i=C[n],i===A||i.fn===A){C.splice(n,1);break}return C.length===0&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var A=new Array(arguments.length-1),C=this._callbacks["$"+t],i=1;i<arguments.length;i++)A[i-1]=arguments[i];if(C){C=C.slice(0);for(var i=0,n=C.length;i<n;++i)C[i].apply(this,A)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}})(qa);var cp=qa.exports,ed=D(cp),up=sg,Dg=Array.isArray||function(e){return up(e)==="Array"},fp=TypeError,pp=9007199254740991,eo=function(I){if(I>pp)throw fp("Maximum allowed index exceeded");return I},mp=YI,vp=Oe,bp=IA,uA=function(I,e,g){var t=mp(e);t in I?vp.f(I,t,bp(0,g)):I[t]=g},yp=ee,wp=yp("toStringTag"),gd={};gd[wp]="z";var go=String(gd)==="[object z]",Ep=go,Tp=le,II=sg,xp=ee,Op=xp("toStringTag"),Pp=Object,Dp=II(function(){return arguments}())==="Arguments",Np=function(I,e){try{return I[e]}catch(g){}},ag=Ep?II:function(I){var e,g,t;return I===void 0?"Undefined":I===null?"Null":typeof(g=Np(e=Pp(I),Op))=="string"?g:Dp?II(e):(t=II(e))==="Object"&&Tp(e.callee)?"Arguments":t},Rp=Z,Sp=le,yi=Xn,kp=Rp(Function.toString);Sp(yi.inspectSource)||(yi.inspectSource=function(I){return kp(I)});var Mp=yi.inspectSource,Fp=Z,Bp=z,td=le,zp=ag,Zp=Ye,Lp=Mp,Ad=function(){},Gp=[],Id=Zp("Reflect","construct"),to=/^\s*(?:class|function)\b/,Vp=Fp(to.exec),jp=!to.test(Ad),Dt=function(e){if(!td(e))return!1;try{return Id(Ad,Gp,e),!0}catch(g){return!1}},Cd=function(e){if(!td(e))return!1;switch(zp(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return jp||!!Vp(to,Lp(e))}catch(g){return!0}};Cd.sham=!0;var id=!Id||Bp(function(){var I;return Dt(Dt.call)||!Dt(Object)||!Dt(function(){I=!0})||I})?Cd:Dt,hs=Dg,Wp=id,Yp=ce,_p=ee,Kp=_p("species"),cs=Array,Up=function(I){var e;return hs(I)&&(e=I.constructor,Wp(e)&&(e===cs||hs(e.prototype))?e=void 0:Yp(e)&&(e=e[Kp],e===null&&(e=void 0))),e===void 0?cs:e},Hp=Up,UI=function(I,e){return new(Hp(I))(e===0?0:e)},Qp=z,Xp=ee,Jp=nA,$p=Xp("species"),fA=function(I){return Jp>=51||!Qp(function(){var e=[],g=e.constructor={};return g[$p]=function(){return{foo:1}},e[I](Boolean).foo!==1})},qp=N,em=z,gm=Dg,tm=ce,Am=xe,Im=Se,us=eo,fs=uA,Cm=UI,im=fA,nm=ee,om=nA,nd=nm("isConcatSpreadable"),sm=om>=51||!em(function(){var I=[];return I[nd]=!1,I.concat()[0]!==I}),rm=function(I){if(!tm(I))return!1;var e=I[nd];return e!==void 0?!!e:gm(I)},am=!sm||!im("concat");qp({target:"Array",proto:!0,arity:1,forced:am},{concat:function(e){var g=Am(this),t=Cm(g,0),A=0,C,i,n,o,s;for(C=-1,n=arguments.length;C<n;C++)if(s=C===-1?g:arguments[C],rm(s))for(o=Im(s),us(A+o),i=0;i<o;i++,A++)i in s&&fs(t,A,s[i]);else us(A+1),fs(t,A++,s);return t.length=A,t}});var dm=ag,lm=String,qe=function(I){if(dm(I)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return lm(I)},HI={},hm=ie,cm=Ka,um=Oe,fm=rg,pm=We,mm=hA;HI.f=hm&&!cm?Object.defineProperties:function(e,g){fm(e);for(var t=pm(g),A=mm(g),C=A.length,i=0,n;C>i;)um.f(e,n=A[i++],t[n]);return e};var vm=Ye,bm=vm("document","documentElement"),ym=mt,wm=WI,ps=ym("keys"),QI=function(I){return ps[I]||(ps[I]=wm(I))},Em=rg,Tm=HI,ms=$n,xm=lA,Om=bm,Pm=Ya,Dm=QI,vs=">",bs="<",wi="prototype",Ei="script",od=Dm("IE_PROTO"),NC=function(){},sd=function(I){return bs+Ei+vs+I+bs+"/"+Ei+vs},ys=function(I){I.write(sd("")),I.close();var e=I.parentWindow.Object;return I=null,e},Nm=function(){var I=Pm("iframe"),e="java"+Ei+":",g;return I.style.display="none",Om.appendChild(I),I.src=String(e),g=I.contentWindow.document,g.open(),g.write(sd("document.F=Object")),g.close(),g.F},LA,CI=function(){try{LA=new ActiveXObject("htmlfile")}catch(e){}CI=typeof document!="undefined"?document.domain&&LA?ys(LA):Nm():ys(LA);for(var I=ms.length;I--;)delete CI[wi][ms[I]];return CI()};xm[od]=!0;var pA=Object.create||function(e,g){var t;return e!==null?(NC[wi]=Em(e),t=new NC,NC[wi]=null,t[od]=e):t=CI(),g===void 0?t:Tm.f(t,g)},mA={},Rm=Ua,Sm=$n,km=Sm.concat("length","prototype");mA.f=Object.getOwnPropertyNames||function(e){return Rm(e,km)};var XI={},ws=dA,Mm=Se,Fm=uA,Bm=Array,zm=Math.max,rd=function(I,e,g){for(var t=Mm(I),A=ws(e,t),C=ws(g===void 0?t:g,t),i=Bm(zm(C-A,0)),n=0;A<C;A++,n++)Fm(i,n,I[A]);return i.length=n,i},Zm=sg,Lm=We,ad=mA.f,Gm=rd,dd=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Vm=function(I){try{return ad(I)}catch(e){return Gm(dd)}};XI.f=function(e){return dd&&Zm(e)==="Window"?Vm(e):ad(Lm(e))};var jm=vt,vA=function(I,e,g,t){return t&&t.enumerable?I[e]=g:jm(I,e,g),I},Wm=Oe,Ao=function(I,e,g){return Wm.f(I,e,g)},bA={},Ym=ee;bA.f=Ym;var Es=L,_m=ne,Km=bA,Um=Oe.f,$=function(I){var e=Es.Symbol||(Es.Symbol={});_m(e,I)||Um(e,I,{value:Km.f(I)})},Hm=je,Qm=Ye,Xm=ee,Jm=vA,ld=function(){var I=Qm("Symbol"),e=I&&I.prototype,g=e&&e.valueOf,t=Xm("toPrimitive");e&&!e[t]&&Jm(e,t,function(A){return Hm(g,this)},{arity:1})},$m=go,qm=ag,ev=$m?{}.toString:function(){return"[object "+qm(this)+"]"},gv=go,tv=Oe.f,Av=vt,Iv=ne,Cv=ev,iv=ee,Ts=iv("toStringTag"),bt=function(I,e,g,t){if(I){var A=g?I:I.prototype;Iv(A,Ts)||tv(A,Ts,{configurable:!0,value:e}),t&&!gv&&Av(A,"toString",Cv)}},nv=X,ov=le,xs=nv.WeakMap,hd=ov(xs)&&/native code/.test(String(xs)),sv=hd,cd=X,rv=ce,av=vt,RC=ne,SC=Xn,dv=QI,lv=lA,Os="Object already initialized",Ti=cd.TypeError,hv=cd.WeakMap,hI,Yt,cI,cv=function(I){return cI(I)?Yt(I):hI(I,{})},uv=function(I){return function(e){var g;if(!rv(e)||(g=Yt(e)).type!==I)throw new Ti("Incompatible receiver, "+I+" required");return g}};sv||SC.state?(Fe=SC.state||(SC.state=new hv),Fe.get=Fe.get,Fe.has=Fe.has,Fe.set=Fe.set,hI=function(I,e){if(Fe.has(I))throw new Ti(Os);return e.facade=I,Fe.set(I,e),e},Yt=function(I){return Fe.get(I)||{}},cI=function(I){return Fe.has(I)}):(Rg=dv("state"),lv[Rg]=!0,hI=function(I,e){if(RC(I,Rg))throw new Ti(Os);return e.facade=I,av(I,Rg,e),e},Yt=function(I){return RC(I,Rg)?I[Rg]:{}},cI=function(I){return RC(I,Rg)});var Fe,Rg,Kg={set:hI,get:Yt,has:cI,enforce:cv,getterFor:uv},fv=aA,pv=Z,mv=jI,vv=xe,bv=Se,yv=UI,Ps=pv([].push),lg=function(I){var e=I===1,g=I===2,t=I===3,A=I===4,C=I===6,i=I===7,n=I===5||C;return function(o,s,r,a){for(var d=vv(o),l=mv(d),h=fv(s,r),c=bv(l),p=0,u=a||yv,m=e?u(o,c):g||i?u(o,0):void 0,E,w;c>p;p++)if((n||p in l)&&(E=l[p],w=h(E,p,d),I))if(e)m[p]=w;else if(w)switch(I){case 3:return!0;case 5:return E;case 6:return p;case 2:Ps(m,E)}else switch(I){case 4:return!1;case 7:Ps(m,E)}return C?-1:t||A?A:m}},Ng={forEach:lg(0),map:lg(1),filter:lg(2),some:lg(3),every:lg(4),find:lg(5),findIndex:lg(6),filterReject:lg(7)},JI=N,$I=X,Io=je,wv=Z,at=ie,dt=pt,Ev=z,se=ne,Tv=J,xi=rg,qI=We,Co=YI,xv=qe,Oi=IA,_t=pA,ud=hA,Ov=mA,fd=XI,Pv=cA,pd=tA,md=Oe,Dv=HI,vd=AA,Ds=vA,Nv=Ao,io=mt,Rv=QI,bd=lA,Ns=WI,Sv=ee,kv=bA,Mv=$,Fv=ld,Bv=bt,yd=Kg,eC=Ng.forEach,Ee=Rv("hidden"),gC="Symbol",Kt="prototype",zv=yd.set,Rs=yd.getterFor(gC),Ge=Object[Kt],Fg=$I.Symbol,Ft=Fg&&Fg[Kt],Zv=$I.RangeError,Lv=$I.TypeError,kC=$I.QObject,wd=pd.f,Bg=md.f,Ed=fd.f,Gv=vd.f,Td=wv([].push),ig=io("symbols"),yA=io("op-symbols"),Vv=io("wks"),Pi=!kC||!kC[Kt]||!kC[Kt].findChild,xd=function(I,e,g){var t=wd(Ge,e);t&&delete Ge[e],Bg(I,e,g),t&&I!==Ge&&Bg(Ge,e,t)},Di=at&&Ev(function(){return _t(Bg({},"a",{get:function(){return Bg(this,"a",{value:7}).a}})).a!==7})?xd:Bg,MC=function(I,e){var g=ig[I]=_t(Ft);return zv(g,{type:gC,tag:I,description:e}),at||(g.description=e),g},tC=function(e,g,t){e===Ge&&tC(yA,g,t),xi(e);var A=Co(g);return xi(t),se(ig,A)?(t.enumerable?(se(e,Ee)&&e[Ee][A]&&(e[Ee][A]=!1),t=_t(t,{enumerable:Oi(0,!1)})):(se(e,Ee)||Bg(e,Ee,Oi(1,{})),e[Ee][A]=!0),Di(e,A,t)):Bg(e,A,t)},no=function(e,g){xi(e);var t=qI(g),A=ud(t).concat(Nd(t));return eC(A,function(C){(!at||Io(Od,t,C))&&tC(e,C,t[C])}),e},jv=function(e,g){return g===void 0?_t(e):no(_t(e),g)},Od=function(e){var g=Co(e),t=Io(Gv,this,g);return this===Ge&&se(ig,g)&&!se(yA,g)?!1:t||!se(this,g)||!se(ig,g)||se(this,Ee)&&this[Ee][g]?t:!0},Pd=function(e,g){var t=qI(e),A=Co(g);if(!(t===Ge&&se(ig,A)&&!se(yA,A))){var C=wd(t,A);return C&&se(ig,A)&&!(se(t,Ee)&&t[Ee][A])&&(C.enumerable=!0),C}},Dd=function(e){var g=Ed(qI(e)),t=[];return eC(g,function(A){!se(ig,A)&&!se(bd,A)&&Td(t,A)}),t},Nd=function(I){var e=I===Ge,g=Ed(e?yA:qI(I)),t=[];return eC(g,function(A){se(ig,A)&&(!e||se(Ge,A))&&Td(t,ig[A])}),t};dt||(Fg=function(){if(Tv(Ft,this))throw new Lv("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:xv(arguments[0]),g=Ns(e),t=function(A){this===Ge&&Io(t,yA,A),se(this,Ee)&&se(this[Ee],g)&&(this[Ee][g]=!1);var C=Oi(1,A);try{Di(this,g,C)}catch(i){if(!(i instanceof Zv))throw i;xd(this,g,C)}};return at&&Pi&&Di(Ge,g,{configurable:!0,set:t}),MC(g,e)},Ft=Fg[Kt],Ds(Ft,"toString",function(){return Rs(this).tag}),Ds(Fg,"withoutSetter",function(I){return MC(Ns(I),I)}),vd.f=Od,md.f=tC,Dv.f=no,pd.f=Pd,Ov.f=fd.f=Dd,Pv.f=Nd,kv.f=function(I){return MC(Sv(I),I)},at&&Nv(Ft,"description",{configurable:!0,get:function(){return Rs(this).description}}));JI({global:!0,constructor:!0,wrap:!0,forced:!dt,sham:!dt},{Symbol:Fg});eC(ud(Vv),function(I){Mv(I)});JI({target:gC,stat:!0,forced:!dt},{useSetter:function(){Pi=!0},useSimple:function(){Pi=!1}});JI({target:"Object",stat:!0,forced:!dt,sham:!at},{create:jv,defineProperty:tC,defineProperties:no,getOwnPropertyDescriptor:Pd});JI({target:"Object",stat:!0,forced:!dt},{getOwnPropertyNames:Dd});Fv();Bv(Fg,gC);bd[Ee]=!0;var Wv=pt,Rd=Wv&&!!Symbol.for&&!!Symbol.keyFor,Yv=N,_v=Ye,Kv=ne,Uv=qe,Sd=mt,Hv=Rd,FC=Sd("string-to-symbol-registry"),Qv=Sd("symbol-to-string-registry");Yv({target:"Symbol",stat:!0,forced:!Hv},{for:function(I){var e=Uv(I);if(Kv(FC,e))return FC[e];var g=_v("Symbol")(e);return FC[e]=g,Qv[g]=e,g}});var Xv=N,Jv=ne,$v=oA,qv=sA,eb=mt,gb=Rd,Ss=eb("symbol-to-string-registry");Xv({target:"Symbol",stat:!0,forced:!gb},{keyFor:function(e){if(!$v(e))throw new TypeError(qv(e)+" is not a symbol");if(Jv(Ss,e))return Ss[e]}});var tb=Z,ks=Dg,Ab=le,Ms=sg,Ib=qe,Fs=tb([].push),Cb=function(I){if(Ab(I))return I;if(ks(I)){for(var e=I.length,g=[],t=0;t<e;t++){var A=I[t];typeof A=="string"?Fs(g,A):(typeof A=="number"||Ms(A)==="Number"||Ms(A)==="String")&&Fs(g,Ib(A))}var C=g.length,i=!0;return function(n,o){if(i)return i=!1,o;if(ks(this))return o;for(var s=0;s<C;s++)if(g[s]===n)return o}}},ib=N,kd=Ye,Md=VI,nb=je,wA=Z,Fd=z,Bs=le,zs=oA,Bd=KI,ob=Cb,sb=pt,rb=String,bg=kd("JSON","stringify"),GA=wA(/./.exec),Zs=wA("".charAt),ab=wA("".charCodeAt),db=wA("".replace),lb=wA(1 .toString),hb=/[\uD800-\uDFFF]/g,Ls=/^[\uD800-\uDBFF]$/,Gs=/^[\uDC00-\uDFFF]$/,Vs=!sb||Fd(function(){var I=kd("Symbol")("stringify detection");return bg([I])!=="[null]"||bg({a:I})!=="{}"||bg(Object(I))!=="{}"}),js=Fd(function(){return bg("\uDF06\uD834")!=='"\\udf06\\ud834"'||bg("\uDEAD")!=='"\\udead"'}),cb=function(I,e){var g=Bd(arguments),t=ob(e);if(!(!Bs(t)&&(I===void 0||zs(I))))return g[1]=function(A,C){if(Bs(t)&&(C=nb(t,this,rb(A),C)),!zs(C))return C},Md(bg,null,g)},ub=function(I,e,g){var t=Zs(g,e-1),A=Zs(g,e+1);return GA(Ls,I)&&!GA(Gs,A)||GA(Gs,I)&&!GA(Ls,t)?"\\u"+lb(ab(I,0),16):I};bg&&ib({target:"JSON",stat:!0,arity:3,forced:Vs||js},{stringify:function(e,g,t){var A=Bd(arguments),C=Md(Vs?cb:bg,null,A);return js&&typeof C=="string"?db(C,hb,ub):C}});var fb=N,pb=pt,mb=z,zd=cA,vb=xe,bb=!pb||mb(function(){zd.f(1)});fb({target:"Object",stat:!0,forced:bb},{getOwnPropertySymbols:function(e){var g=zd.f;return g?g(vb(e)):[]}});var yb=$;yb("asyncIterator");var wb=$;wb("hasInstance");var Eb=$;Eb("isConcatSpreadable");var Tb=$;Tb("iterator");var xb=$;xb("match");var Ob=$;Ob("matchAll");var Pb=$;Pb("replace");var Db=$;Db("search");var Nb=$;Nb("species");var Rb=$;Rb("split");var Sb=$,kb=ld;Sb("toPrimitive");kb();var Mb=Ye,Fb=$,Bb=bt;Fb("toStringTag");Bb(Mb("Symbol"),"Symbol");var zb=$;zb("unscopables");var Zb=X,Lb=bt;Lb(Zb.JSON,"JSON",!0);var Gb=L,Vb=Gb.Symbol,yt={},Ni=ie,jb=ne,Zd=Function.prototype,Wb=Ni&&Object.getOwnPropertyDescriptor,oo=jb(Zd,"name"),Yb=oo&&function(){}.name==="something",_b=oo&&(!Ni||Ni&&Wb(Zd,"name").configurable),Kb={EXISTS:oo,PROPER:Yb,CONFIGURABLE:_b},Ub=z,Ld=!Ub(function(){function I(){}return I.prototype.constructor=null,Object.getPrototypeOf(new I)!==I.prototype}),Hb=ne,Qb=le,Xb=xe,Jb=QI,$b=Ld,Ws=Jb("IE_PROTO"),Ri=Object,qb=Ri.prototype,AC=$b?Ri.getPrototypeOf:function(I){var e=Xb(I);if(Hb(e,Ws))return e[Ws];var g=e.constructor;return Qb(g)&&e instanceof g?g.prototype:e instanceof Ri?qb:null},ey=z,gy=le,ty=ce,Ay=pA,Ys=AC,Iy=vA,Cy=ee,Si=Cy("iterator"),Gd=!1,gg,BC,zC;[].keys&&(zC=[].keys(),"next"in zC?(BC=Ys(Ys(zC)),BC!==Object.prototype&&(gg=BC)):Gd=!0);var iy=!ty(gg)||ey(function(){var I={};return gg[Si].call(I)!==I});iy?gg={}:gg=Ay(gg);gy(gg[Si])||Iy(gg,Si,function(){return this});var Vd={IteratorPrototype:gg,BUGGY_SAFARI_ITERATORS:Gd},ny=Vd.IteratorPrototype,oy=pA,sy=IA,ry=bt,ay=yt,dy=function(){return this},ly=function(I,e,g,t){var A=e+" Iterator";return I.prototype=oy(ny,{next:sy(+!t,g)}),ry(I,A,!1,!0),ay[A]=dy,I},hy=N,cy=je,jd=Kb,uy=ly,fy=AC,py=bt,_s=vA,my=ee,Ks=yt,Wd=Vd,vy=jd.PROPER;jd.CONFIGURABLE;Wd.IteratorPrototype;var VA=Wd.BUGGY_SAFARI_ITERATORS,ZC=my("iterator"),Us="keys",jA="values",Hs="entries",by=function(){return this},so=function(I,e,g,t,A,C,i){uy(g,e,t);var n=function(u){if(u===A&&d)return d;if(!VA&&u&&u in r)return r[u];switch(u){case Us:return function(){return new g(this,u)};case jA:return function(){return new g(this,u)};case Hs:return function(){return new g(this,u)}}return function(){return new g(this)}},o=e+" Iterator",s=!1,r=I.prototype,a=r[ZC]||r["@@iterator"]||A&&r[A],d=!VA&&a||n(A),l=e==="Array"&&r.entries||a,h,c,p;if(l&&(h=fy(l.call(new I)),h!==Object.prototype&&h.next&&(py(h,o,!0,!0),Ks[o]=by)),vy&&A===jA&&a&&a.name!==jA&&(s=!0,d=function(){return cy(a,this)}),A)if(c={values:n(jA),keys:C?d:n(Us),entries:n(Hs)},i)for(p in c)(VA||s||!(p in r))&&_s(r,p,c[p]);else hy({target:e,proto:!0,forced:VA||s},c);return i&&r[ZC]!==d&&_s(r,ZC,d,{name:A}),Ks[e]=d,c},ro=function(I,e){return{value:I,done:e}},yy=We,Qs=yt,Yd=Kg;Oe.f;var wy=so,WA=ro,_d="Array Iterator",Ey=Yd.set,Ty=Yd.getterFor(_d);wy(Array,"Array",function(I,e){Ey(this,{type:_d,target:yy(I),index:0,kind:e})},function(){var I=Ty(this),e=I.target,g=I.kind,t=I.index++;if(!e||t>=e.length)return I.target=void 0,WA(void 0,!0);switch(g){case"keys":return WA(t,!1);case"values":return WA(e[t],!1)}return WA([t,e[t]],!1)},"values");Qs.Arguments=Qs.Array;var xy={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},Oy=xy,Py=X,Dy=ag,Ny=vt,Xs=yt,Ry=ee,Js=Ry("toStringTag");for(YA in Oy)LC=Py[YA],_A=LC&&LC.prototype,_A&&Dy(_A)!==Js&&Ny(_A,Js,YA),Xs[YA]=Xs.Array;var LC,_A,YA,Sy=Vb,Kd=Sy,ky=Kd,My=D(ky),Fy=N,$s=Dg,By=id,zy=ce,qs=dA,Zy=Se,Ly=We,Gy=uA,Vy=ee,jy=fA,Wy=KI,Yy=jy("slice"),_y=Vy("species"),GC=Array,Ky=Math.max;Fy({target:"Array",proto:!0,forced:!Yy},{slice:function(e,g){var t=Ly(this),A=Zy(t),C=qs(e,A),i=qs(g===void 0?A:g,A),n,o,s;if($s(t)&&(n=t.constructor,By(n)&&(n===GC||$s(n.prototype))?n=void 0:zy(n)&&(n=n[_y],n===null&&(n=void 0)),n===GC||n===void 0))return Wy(t,C,i);for(o=new(n===void 0?GC:n)(Ky(i-C,0)),s=0;C<i;C++,s++)C in t&&Gy(o,s,t[C]);return o.length=s,o}});var Uy=Ie,Hy=Uy("Array").slice,Qy=J,Xy=Hy,VC=Array.prototype,Jy=function(I){var e=I.slice;return I===VC||Qy(VC,I)&&e===VC.slice?Xy:e},$y=Jy,qy=$y,e0=qy,Ze=D(e0),g0=Ye,t0=Z,A0=mA,I0=cA,C0=rg,i0=t0([].concat),Ud=g0("Reflect","ownKeys")||function(e){var g=A0.f(C0(e)),t=I0.f;return t?i0(g,t(e)):g},n0=N,o0=Ud;n0({target:"Reflect",stat:!0},{ownKeys:o0});var s0=L,r0=s0.Reflect.ownKeys,a0=r0,d0=a0,l0=d0,h0=D(l0),c0=N,u0=Dg;c0({target:"Array",stat:!0},{isArray:u0});var f0=L,p0=f0.Array.isArray,m0=p0,v0=m0,b0=v0,B=D(b0),y0=N,w0=Ng.map,E0=fA,T0=E0("map");y0({target:"Array",proto:!0,forced:!T0},{map:function(e){return w0(this,e,arguments.length>1?arguments[1]:void 0)}});var x0=Ie,O0=x0("Array").map,P0=J,D0=O0,jC=Array.prototype,N0=function(I){var e=I.map;return I===jC||P0(jC,I)&&e===jC.map?D0:e},R0=N0,S0=R0,k0=S0,ae=D(k0),M0=N,F0=xe,Hd=hA,B0=z,z0=B0(function(){Hd(1)});M0({target:"Object",stat:!0,forced:z0},{keys:function(e){return Hd(F0(e))}});var Z0=L,L0=Z0.Object.keys,G0=L0,V0=G0,j0=V0,U=D(j0),W0=N,Y0=Z,Qd=Date,_0=Y0(Qd.prototype.getTime);W0({target:"Date",stat:!0},{now:function(){return _0(new Qd)}});var K0=L,U0=K0.Date.now,H0=U0,Q0=H0,X0=Q0,uI=D(X0),J0=z,wt=function(I,e){var g=[][I];return!!g&&J0(function(){g.call(null,e||function(){return 1},1)})},$0=Ng.forEach,q0=wt,ew=q0("forEach"),gw=ew?[].forEach:function(e){return $0(this,e,arguments.length>1?arguments[1]:void 0)},tw=N,er=gw;tw({target:"Array",proto:!0,forced:[].forEach!==er},{forEach:er});var Aw=Ie,Iw=Aw("Array").forEach,Cw=Iw,iw=Cw,nw=ag,ow=ne,sw=J,rw=iw,WC=Array.prototype,aw={DOMTokenList:!0,NodeList:!0},dw=function(I){var e=I.forEach;return I===WC||sw(WC,I)&&e===WC.forEach||ow(aw,nw(I))?rw:e},lw=dw,F=D(lw),hw=N,cw=Z,uw=Dg,fw=cw([].reverse),gr=[1,2];hw({target:"Array",proto:!0,forced:String(gr)===String(gr.reverse())},{reverse:function(){return uw(this)&&(this.length=this.length),fw(this)}});var pw=Ie,mw=pw("Array").reverse,vw=J,bw=mw,YC=Array.prototype,yw=function(I){var e=I.reverse;return I===YC||vw(YC,I)&&e===YC.reverse?bw:e},ww=yw,Ew=ww,Tw=Ew,zg=D(Tw),xw=ie,Ow=Dg,Pw=TypeError,Dw=Object.getOwnPropertyDescriptor,Nw=xw&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(I){return I instanceof TypeError}}(),Rw=Nw?function(I,e){if(Ow(I)&&!Dw(I,"length").writable)throw new Pw("Cannot set read only .length");return I.length=e}:function(I,e){return I.length=e},tr=sA,Sw=TypeError,Xd=function(I,e){if(!delete I[e])throw new Sw("Cannot delete property "+tr(e)+" of "+tr(I))},kw=N,Mw=xe,Fw=dA,Bw=_I,zw=Se,Zw=Rw,Lw=eo,Gw=UI,Vw=uA,_C=Xd,jw=fA,Ww=jw("splice"),Yw=Math.max,_w=Math.min;kw({target:"Array",proto:!0,forced:!Ww},{splice:function(e,g){var t=Mw(this),A=zw(t),C=Fw(e,A),i=arguments.length,n,o,s,r,a,d;for(i===0?n=o=0:i===1?(n=0,o=A-C):(n=i-2,o=_w(Yw(Bw(g),0),A-C)),Lw(A+n-o),s=Gw(t,o),r=0;r<o;r++)a=C+r,a in t&&Vw(s,r,t[a]);if(s.length=o,n<o){for(r=C;r<A-o;r++)a=r+o,d=r+n,a in t?t[d]=t[a]:_C(t,d);for(r=A;r>A-o+n;r--)_C(t,r-1)}else if(n>o)for(r=A-o;r>C;r--)a=r+o-1,d=r+n-1,a in t?t[d]=t[a]:_C(t,d);for(r=0;r<n;r++)t[r+C]=arguments[r+2];return Zw(t,A-o+n),s}});var Kw=Ie,Uw=Kw("Array").splice,Hw=J,Qw=Uw,KC=Array.prototype,Xw=function(I){var e=I.splice;return I===KC||Hw(KC,I)&&e===KC.splice?Qw:e},Jw=Xw,$w=Jw,qw=$w,Ue=D(qw),eE=N,gE=Jn.includes,tE=z,AE=tE(function(){return!Array(1).includes()});eE({target:"Array",proto:!0,forced:AE},{includes:function(e){return gE(this,e,arguments.length>1?arguments[1]:void 0)}});var IE=Ie,CE=IE("Array").includes,iE=ce,nE=sg,oE=ee,sE=oE("match"),rE=function(I){var e;return iE(I)&&((e=I[sE])!==void 0?!!e:nE(I)==="RegExp")},aE=rE,dE=TypeError,lE=function(I){if(aE(I))throw new dE("The method doesn't accept regular expressions");return I},hE=ee,cE=hE("match"),uE=function(I){var e=/./;try{"/./"[I](e)}catch(g){try{return e[cE]=!1,"/./"[I](e)}catch(t){}}return!1},fE=N,pE=Z,mE=lE,vE=CA,Ar=qe,bE=uE,yE=pE("".indexOf);fE({target:"String",proto:!0,forced:!bE("includes")},{includes:function(e){return!!~yE(Ar(vE(this)),Ar(mE(e)),arguments.length>1?arguments[1]:void 0)}});var wE=Ie,EE=wE("String").includes,Ir=J,TE=CE,xE=EE,UC=Array.prototype,HC=String.prototype,OE=function(I){var e=I.includes;return I===UC||Ir(UC,I)&&e===UC.includes?TE:typeof I=="string"||I===HC||Ir(HC,I)&&e===HC.includes?xE:e},PE=OE,DE=PE,NE=DE,yg=D(NE),RE=N,SE=z,kE=xe,Jd=AC,ME=Ld,FE=SE(function(){Jd(1)});RE({target:"Object",stat:!0,forced:FE,sham:!ME},{getPrototypeOf:function(e){return Jd(kE(e))}});var BE=L,zE=BE.Object.getPrototypeOf,ZE=zE,LE=ZE,GE=LE,Cr=D(GE),VE=Ie,jE=VE("Array").concat,WE=J,YE=jE,QC=Array.prototype,_E=function(I){var e=I.concat;return I===QC||WE(QC,I)&&e===QC.concat?YE:e},KE=_E,UE=KE,HE=UE,$d=D(HE),QE=N,XE=Ng.filter,JE=fA,$E=JE("filter");QE({target:"Array",proto:!0,forced:!$E},{filter:function(e){return XE(this,e,arguments.length>1?arguments[1]:void 0)}});var qE=Ie,eT=qE("Array").filter,gT=J,tT=eT,XC=Array.prototype,AT=function(I){var e=I.filter;return I===XC||gT(XC,I)&&e===XC.filter?tT:e},IT=AT,CT=IT,iT=CT,te=D(iT),qd=ie,nT=z,el=Z,oT=AC,sT=hA,rT=We,aT=AA.f,gl=el(aT),dT=el([].push),lT=qd&&nT(function(){var I=Object.create(null);return I[2]=2,!gl(I,2)}),ir=function(I){return function(e){for(var g=rT(e),t=sT(g),A=lT&&oT(g)===null,C=t.length,i=0,n=[],o;C>i;)o=t[i++],(!qd||(A?o in g:gl(g,o)))&&dT(n,I?[o,g[o]]:g[o]);return n}},hT={entries:ir(!0),values:ir(!1)},cT=N,uT=hT.values;cT({target:"Object",stat:!0},{values:function(e){return uT(e)}});var fT=L,pT=fT.Object.values,mT=pT,vT=mT,bT=vT,yT=D(bT),ao=`
631
+ \v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,wT=Z,ET=CA,TT=qe,ki=ao,nr=wT("".replace),xT=RegExp("^["+ki+"]+"),OT=RegExp("(^|[^"+ki+"])["+ki+"]+$"),JC=function(I){return function(e){var g=TT(ET(e));return I&1&&(g=nr(g,xT,"")),I&2&&(g=nr(g,OT,"$1")),g}},tl={start:JC(1),end:JC(2),trim:JC(3)},Al=X,PT=z,DT=Z,NT=qe,RT=tl.trim,or=ao,Zt=Al.parseInt,sr=Al.Symbol,rr=sr&&sr.iterator,Il=/^[+-]?0x/i,ST=DT(Il.exec),kT=Zt(or+"08")!==8||Zt(or+"0x16")!==22||rr&&!PT(function(){Zt(Object(rr))}),MT=kT?function(e,g){var t=RT(NT(e));return Zt(t,g>>>0||(ST(Il,t)?16:10))}:Zt,FT=N,ar=MT;FT({global:!0,forced:parseInt!==ar},{parseInt:ar});var BT=L,zT=BT.parseInt,ZT=zT,LT=ZT,GT=LT,ze=D(GT),VT=N,jT=Hn,WT=Jn.indexOf,YT=wt,Mi=jT([].indexOf),Cl=!!Mi&&1/Mi([1],1,-0)<0,_T=Cl||!YT("indexOf");VT({target:"Array",proto:!0,forced:_T},{indexOf:function(e){var g=arguments.length>1?arguments[1]:void 0;return Cl?Mi(this,e,g)||0:WT(this,e,g)}});var KT=Ie,UT=KT("Array").indexOf,HT=J,QT=UT,$C=Array.prototype,XT=function(I){var e=I.indexOf;return I===$C||HT($C,I)&&e===$C.indexOf?QT:e},JT=XT,$T=JT,qT=$T,G=D(qT),ex=N,gx=ie,tx=pA;ex({target:"Object",stat:!0,sham:!gx},{create:tx});var Ax=L,Ix=Ax.Object,Cx=function(e,g){return Ix.create(e,g)},ix=Cx,nx=ix,ox=nx,wg=D(ox),Fi=L,sx=VI;Fi.JSON||(Fi.JSON={stringify:JSON.stringify});var rx=function(e,g,t){return sx(Fi.JSON.stringify,null,arguments)},ax=rx,dx=ax,lx=dx,Et=D(lx),hx=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",cx=TypeError,ux=function(I,e){if(I<e)throw new cx("Not enough arguments");return I},il=X,fx=VI,px=le,mx=hx,vx=iA,bx=KI,yx=ux,wx=il.Function,Ex=/MSIE .\./.test(vx)||mx&&function(){var I=il.Bun.version.split(".");return I.length<3||I[0]==="0"&&(I[1]<3||I[1]==="3"&&I[2]==="0")}(),nl=function(I,e){var g=e?2:1;return Ex?function(t,A){var C=yx(arguments.length,1)>g,i=px(t)?t:wx(t),n=C?bx(arguments,g):[],o=C?function(){fx(i,this,n)}:i;return e?I(o,A):I(o)}:I},Tx=N,ol=X,xx=nl,dr=xx(ol.setInterval,!0);Tx({global:!0,bind:!0,forced:ol.setInterval!==dr},{setInterval:dr});var Ox=N,sl=X,Px=nl,lr=Px(sl.setTimeout,!0);Ox({global:!0,bind:!0,forced:sl.setTimeout!==lr},{setTimeout:lr});var Dx=L,Nx=Dx.setTimeout,Rx=Nx,He=D(Rx),Sx=xe,hr=dA,kx=Se,Mx=function(e){for(var g=Sx(this),t=kx(g),A=arguments.length,C=hr(A>1?arguments[1]:void 0,t),i=A>2?arguments[2]:void 0,n=i===void 0?t:hr(i,t);n>C;)g[C++]=e;return g},Fx=N,Bx=Mx;Fx({target:"Array",proto:!0},{fill:Bx});var zx=Ie,Zx=zx("Array").fill,Lx=J,Gx=Zx,qC=Array.prototype,Vx=function(I){var e=I.fill;return I===qC||Lx(qC,I)&&e===qC.fill?Gx:e},jx=Vx,Wx=jx,Yx=Wx,EA=D(Yx);function Ve(){return Ve=Object.assign||function(I){for(var e=1;e<arguments.length;e++){var g=arguments[e];for(var t in g)Object.prototype.hasOwnProperty.call(g,t)&&(I[t]=g[t])}return I},Ve.apply(this,arguments)}function ke(I,e){I.prototype=Object.create(e.prototype),I.prototype.constructor=I,I.__proto__=e}function KA(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}var Bi;typeof Object.assign!="function"?Bi=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var g=Object(e),t=1;t<arguments.length;t++){var A=arguments[t];if(A!=null)for(var C in A)A.hasOwnProperty(C)&&(g[C]=A[C])}return g}:Bi=Object.assign;var Gg=Bi,cr=["","webkit","Moz","MS","ms","o"],_x=typeof document=="undefined"?{style:{}}:document.createElement("div"),Kx="function",Ct=Math.round,Vg=Math.abs,lo=Date.now;function IC(I,e){for(var g,t,A=e[0].toUpperCase()+e.slice(1),C=0;C<cr.length;){if(g=cr[C],t=g?g+A:e,t in I)return t;C++}}var tg;typeof window=="undefined"?tg={}:tg=window;var rl=IC(_x.style,"touchAction"),al=rl!==void 0;function Ux(){if(!al)return!1;var I={},e=tg.CSS&&tg.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(g){return I[g]=e?tg.CSS.supports("touch-action",g):!0}),I}var dl="compute",ll="auto",zi="manipulation",Zg="none",Ut="pan-x",Ht="pan-y",UA=Ux(),Hx=/mobile|tablet|ip(ad|hone|od)|android/i,hl="ontouchstart"in tg,Qx=IC(tg,"PointerEvent")!==void 0,Xx=hl&&Hx.test(navigator.userAgent),TA="touch",Jx="pen",ho="mouse",$x="kinect",qx=25,be=1,Ug=2,Ae=4,Te=8,fI=1,xA=2,OA=4,PA=8,lt=16,Qe=xA|OA,Lg=PA|lt,cl=Qe|Lg,ul=["x","y"],pI=["clientX","clientY"];function Ag(I,e,g){var t;if(I)if(I.forEach)I.forEach(e,g);else if(I.length!==void 0)for(t=0;t<I.length;)e.call(g,I[t],t,I),t++;else for(t in I)I.hasOwnProperty(t)&&e.call(g,I[t],t,I)}function CC(I,e){return typeof I===Kx?I.apply(e&&e[0]||void 0,e):I}function kg(I,e){return I.indexOf(e)>-1}function eO(I){if(kg(I,Zg))return Zg;var e=kg(I,Ut),g=kg(I,Ht);return e&&g?Zg:e||g?e?Ut:Ht:kg(I,zi)?zi:ll}var fl=function(){function I(g,t){this.manager=g,this.set(t)}var e=I.prototype;return e.set=function(t){t===dl&&(t=this.compute()),al&&this.manager.element.style&&UA[t]&&(this.manager.element.style[rl]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return Ag(this.manager.recognizers,function(A){CC(A.options.enable,[A])&&(t=t.concat(A.getTouchAction()))}),eO(t.join(" "))},e.preventDefaults=function(t){var A=t.srcEvent,C=t.offsetDirection;if(this.manager.session.prevented){A.preventDefault();return}var i=this.actions,n=kg(i,Zg)&&!UA[Zg],o=kg(i,Ht)&&!UA[Ht],s=kg(i,Ut)&&!UA[Ut];if(n){var r=t.pointers.length===1,a=t.distance<2,d=t.deltaTime<250;if(r&&a&&d)return}if(!(s&&o)&&(n||o&&C&Qe||s&&C&Lg))return this.preventSrc(A)},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},I}();function co(I,e){for(;I;){if(I===e)return!0;I=I.parentNode}return!1}function pl(I){var e=I.length;if(e===1)return{x:Ct(I[0].clientX),y:Ct(I[0].clientY)};for(var g=0,t=0,A=0;A<e;)g+=I[A].clientX,t+=I[A].clientY,A++;return{x:Ct(g/e),y:Ct(t/e)}}function ur(I){for(var e=[],g=0;g<I.pointers.length;)e[g]={clientX:Ct(I.pointers[g].clientX),clientY:Ct(I.pointers[g].clientY)},g++;return{timeStamp:lo(),pointers:e,center:pl(e),deltaX:I.deltaX,deltaY:I.deltaY}}function mI(I,e,g){g||(g=ul);var t=e[g[0]]-I[g[0]],A=e[g[1]]-I[g[1]];return Math.sqrt(t*t+A*A)}function Zi(I,e,g){g||(g=ul);var t=e[g[0]]-I[g[0]],A=e[g[1]]-I[g[1]];return Math.atan2(A,t)*180/Math.PI}function ml(I,e){return I===e?fI:Vg(I)>=Vg(e)?I<0?xA:OA:e<0?PA:lt}function gO(I,e){var g=e.center,t=I.offsetDelta||{},A=I.prevDelta||{},C=I.prevInput||{};(e.eventType===be||C.eventType===Ae)&&(A=I.prevDelta={x:C.deltaX||0,y:C.deltaY||0},t=I.offsetDelta={x:g.x,y:g.y}),e.deltaX=A.x+(g.x-t.x),e.deltaY=A.y+(g.y-t.y)}function vl(I,e,g){return{x:e/I||0,y:g/I||0}}function tO(I,e){return mI(e[0],e[1],pI)/mI(I[0],I[1],pI)}function AO(I,e){return Zi(e[1],e[0],pI)+Zi(I[1],I[0],pI)}function IO(I,e){var g=I.lastInterval||e,t=e.timeStamp-g.timeStamp,A,C,i,n;if(e.eventType!==Te&&(t>qx||g.velocity===void 0)){var o=e.deltaX-g.deltaX,s=e.deltaY-g.deltaY,r=vl(t,o,s);C=r.x,i=r.y,A=Vg(r.x)>Vg(r.y)?r.x:r.y,n=ml(o,s),I.lastInterval=e}else A=g.velocity,C=g.velocityX,i=g.velocityY,n=g.direction;e.velocity=A,e.velocityX=C,e.velocityY=i,e.direction=n}function CO(I,e){var g=I.session,t=e.pointers,A=t.length;g.firstInput||(g.firstInput=ur(e)),A>1&&!g.firstMultiple?g.firstMultiple=ur(e):A===1&&(g.firstMultiple=!1);var C=g.firstInput,i=g.firstMultiple,n=i?i.center:C.center,o=e.center=pl(t);e.timeStamp=lo(),e.deltaTime=e.timeStamp-C.timeStamp,e.angle=Zi(n,o),e.distance=mI(n,o),gO(g,e),e.offsetDirection=ml(e.deltaX,e.deltaY);var s=vl(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=s.x,e.overallVelocityY=s.y,e.overallVelocity=Vg(s.x)>Vg(s.y)?s.x:s.y,e.scale=i?tO(i.pointers,t):1,e.rotation=i?AO(i.pointers,t):0,e.maxPointers=g.prevInput?e.pointers.length>g.prevInput.maxPointers?e.pointers.length:g.prevInput.maxPointers:e.pointers.length,IO(g,e);var r=I.element,a=e.srcEvent,d;a.composedPath?d=a.composedPath()[0]:a.path?d=a.path[0]:d=a.target,co(d,r)&&(r=d),e.target=r}function iO(I,e,g){var t=g.pointers.length,A=g.changedPointers.length,C=e&be&&t-A===0,i=e&(Ae|Te)&&t-A===0;g.isFirst=!!C,g.isFinal=!!i,C&&(I.session={}),g.eventType=e,CO(I,g),I.emit("hammer.input",g),I.recognize(g),I.session.prevInput=g}function Qt(I){return I.trim().split(/\s+/g)}function Lt(I,e,g){Ag(Qt(e),function(t){I.addEventListener(t,g,!1)})}function Gt(I,e,g){Ag(Qt(e),function(t){I.removeEventListener(t,g,!1)})}function fr(I){var e=I.ownerDocument||I;return e.defaultView||e.parentWindow||window}var Tt=function(){function I(g,t){var A=this;this.manager=g,this.callback=t,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(C){CC(g.options.enable,[g])&&A.handler(C)},this.init()}var e=I.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Lt(this.element,this.evEl,this.domHandler),this.evTarget&&Lt(this.target,this.evTarget,this.domHandler),this.evWin&&Lt(fr(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Gt(this.element,this.evEl,this.domHandler),this.evTarget&&Gt(this.target,this.evTarget,this.domHandler),this.evWin&&Gt(fr(this.element),this.evWin,this.domHandler)},I}();function jg(I,e,g){if(I.indexOf&&!g)return I.indexOf(e);for(var t=0;t<I.length;){if(g&&I[t][g]==e||!g&&I[t]===e)return t;t++}return-1}var nO={pointerdown:be,pointermove:Ug,pointerup:Ae,pointercancel:Te,pointerout:Te},oO={2:TA,3:Jx,4:ho,5:$x},bl="pointerdown",yl="pointermove pointerup pointercancel";tg.MSPointerEvent&&!tg.PointerEvent&&(bl="MSPointerDown",yl="MSPointerMove MSPointerUp MSPointerCancel");var wl=function(I){ke(e,I);function e(){var t,A=e.prototype;return A.evEl=bl,A.evWin=yl,t=I.apply(this,arguments)||this,t.store=t.manager.session.pointerEvents=[],t}var g=e.prototype;return g.handler=function(A){var C=this.store,i=!1,n=A.type.toLowerCase().replace("ms",""),o=nO[n],s=oO[A.pointerType]||A.pointerType,r=s===TA,a=jg(C,A.pointerId,"pointerId");o&be&&(A.button===0||r)?a<0&&(C.push(A),a=C.length-1):o&(Ae|Te)&&(i=!0),!(a<0)&&(C[a]=A,this.callback(this.manager,o,{pointers:C,changedPointers:[A],pointerType:s,srcEvent:A}),i&&C.splice(a,1))},e}(Tt);function Xt(I){return Array.prototype.slice.call(I,0)}function uo(I,e,g){for(var t=[],A=[],C=0;C<I.length;){var i=e?I[C][e]:I[C];jg(A,i)<0&&t.push(I[C]),A[C]=i,C++}return g&&(e?t=t.sort(function(n,o){return n[e]>o[e]}):t=t.sort()),t}var sO={touchstart:be,touchmove:Ug,touchend:Ae,touchcancel:Te},rO="touchstart touchmove touchend touchcancel",fo=function(I){ke(e,I);function e(){var t;return e.prototype.evTarget=rO,t=I.apply(this,arguments)||this,t.targetIds={},t}var g=e.prototype;return g.handler=function(A){var C=sO[A.type],i=aO.call(this,A,C);i&&this.callback(this.manager,C,{pointers:i[0],changedPointers:i[1],pointerType:TA,srcEvent:A})},e}(Tt);function aO(I,e){var g=Xt(I.touches),t=this.targetIds;if(e&(be|Ug)&&g.length===1)return t[g[0].identifier]=!0,[g,g];var A,C,i=Xt(I.changedTouches),n=[],o=this.target;if(C=g.filter(function(s){return co(s.target,o)}),e===be)for(A=0;A<C.length;)t[C[A].identifier]=!0,A++;for(A=0;A<i.length;)t[i[A].identifier]&&n.push(i[A]),e&(Ae|Te)&&delete t[i[A].identifier],A++;if(n.length)return[uo(C.concat(n),"identifier",!0),n]}var dO={mousedown:be,mousemove:Ug,mouseup:Ae},lO="mousedown",hO="mousemove mouseup",po=function(I){ke(e,I);function e(){var t,A=e.prototype;return A.evEl=lO,A.evWin=hO,t=I.apply(this,arguments)||this,t.pressed=!1,t}var g=e.prototype;return g.handler=function(A){var C=dO[A.type];C&be&&A.button===0&&(this.pressed=!0),C&Ug&&A.which!==1&&(C=Ae),this.pressed&&(C&Ae&&(this.pressed=!1),this.callback(this.manager,C,{pointers:[A],changedPointers:[A],pointerType:ho,srcEvent:A}))},e}(Tt),cO=2500,pr=25;function mr(I){var e=I.changedPointers,g=e[0];if(g.identifier===this.primaryTouch){var t={x:g.clientX,y:g.clientY},A=this.lastTouches;this.lastTouches.push(t);var C=function(){var n=A.indexOf(t);n>-1&&A.splice(n,1)};setTimeout(C,cO)}}function uO(I,e){I&be?(this.primaryTouch=e.changedPointers[0].identifier,mr.call(this,e)):I&(Ae|Te)&&mr.call(this,e)}function fO(I){for(var e=I.srcEvent.clientX,g=I.srcEvent.clientY,t=0;t<this.lastTouches.length;t++){var A=this.lastTouches[t],C=Math.abs(e-A.x),i=Math.abs(g-A.y);if(C<=pr&&i<=pr)return!0}return!1}var El=function(){var I=function(e){ke(g,e);function g(A,C){var i;return i=e.call(this,A,C)||this,i.handler=function(n,o,s){var r=s.pointerType===TA,a=s.pointerType===ho;if(!(a&&s.sourceCapabilities&&s.sourceCapabilities.firesTouchEvents)){if(r)uO.call(KA(KA(i)),o,s);else if(a&&fO.call(KA(KA(i)),s))return;i.callback(n,o,s)}},i.touch=new fo(i.manager,i.handler),i.mouse=new po(i.manager,i.handler),i.primaryTouch=null,i.lastTouches=[],i}var t=g.prototype;return t.destroy=function(){this.touch.destroy(),this.mouse.destroy()},g}(Tt);return I}();function pO(I){var e,g=I.options.inputClass;return g?e=g:Qx?e=wl:Xx?e=fo:hl?e=El:e=po,new e(I,iO)}function it(I,e,g){return Array.isArray(I)?(Ag(I,g[e],g),!0):!1}var iI=1,Re=2,ht=4,Eg=8,Ig=Eg,Jt=16,_e=32,mO=1;function vO(){return mO++}function HA(I,e){var g=e.manager;return g?g.get(I):I}function vr(I){return I&Jt?"cancel":I&Eg?"end":I&ht?"move":I&Re?"start":""}var DA=function(){function I(g){g===void 0&&(g={}),this.options=Ve({enable:!0},g),this.id=vO(),this.manager=null,this.state=iI,this.simultaneous={},this.requireFail=[]}var e=I.prototype;return e.set=function(t){return Gg(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(it(t,"recognizeWith",this))return this;var A=this.simultaneous;return t=HA(t,this),A[t.id]||(A[t.id]=t,t.recognizeWith(this)),this},e.dropRecognizeWith=function(t){return it(t,"dropRecognizeWith",this)?this:(t=HA(t,this),delete this.simultaneous[t.id],this)},e.requireFailure=function(t){if(it(t,"requireFailure",this))return this;var A=this.requireFail;return t=HA(t,this),jg(A,t)===-1&&(A.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(it(t,"dropRequireFailure",this))return this;t=HA(t,this);var A=jg(this.requireFail,t);return A>-1&&this.requireFail.splice(A,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(t){var A=this,C=this.state;function i(n){A.manager.emit(n,t)}C<Eg&&i(A.options.event+vr(C)),i(A.options.event),t.additionalEvent&&i(t.additionalEvent),C>=Eg&&i(A.options.event+vr(C))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=_e},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(_e|iI)))return!1;t++}return!0},e.recognize=function(t){var A=Gg({},t);if(!CC(this.options.enable,[this,A])){this.reset(),this.state=_e;return}this.state&(Ig|Jt|_e)&&(this.state=iI),this.state=this.process(A),this.state&(Re|ht|Eg|Jt)&&this.tryEmit(A)},e.process=function(t){},e.getTouchAction=function(){},e.reset=function(){},I}(),Li=function(I){ke(e,I);function e(t){var A;return t===void 0&&(t={}),A=I.call(this,Ve({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,A.pTime=!1,A.pCenter=!1,A._timer=null,A._input=null,A.count=0,A}var g=e.prototype;return g.getTouchAction=function(){return[zi]},g.process=function(A){var C=this,i=this.options,n=A.pointers.length===i.pointers,o=A.distance<i.threshold,s=A.deltaTime<i.time;if(this.reset(),A.eventType&be&&this.count===0)return this.failTimeout();if(o&&s&&n){if(A.eventType!==Ae)return this.failTimeout();var r=this.pTime?A.timeStamp-this.pTime<i.interval:!0,a=!this.pCenter||mI(this.pCenter,A.center)<i.posThreshold;this.pTime=A.timeStamp,this.pCenter=A.center,!a||!r?this.count=1:this.count+=1,this._input=A;var d=this.count%i.taps;if(d===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){C.state=Ig,C.tryEmit()},i.interval),Re):Ig}return _e},g.failTimeout=function(){var A=this;return this._timer=setTimeout(function(){A.state=_e},this.options.interval),_e},g.reset=function(){clearTimeout(this._timer)},g.emit=function(){this.state===Ig&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(DA),ct=function(I){ke(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({pointers:1},t))||this}var g=e.prototype;return g.attrTest=function(A){var C=this.options.pointers;return C===0||A.pointers.length===C},g.process=function(A){var C=this.state,i=A.eventType,n=C&(Re|ht),o=this.attrTest(A);return n&&(i&Te||!o)?C|Jt:n||o?i&Ae?C|Eg:C&Re?C|ht:Re:_e},e}(DA);function Tl(I){return I===lt?"down":I===PA?"up":I===xA?"left":I===OA?"right":""}var mo=function(I){ke(e,I);function e(t){var A;return t===void 0&&(t={}),A=I.call(this,Ve({event:"pan",threshold:10,pointers:1,direction:cl},t))||this,A.pX=null,A.pY=null,A}var g=e.prototype;return g.getTouchAction=function(){var A=this.options.direction,C=[];return A&Qe&&C.push(Ht),A&Lg&&C.push(Ut),C},g.directionTest=function(A){var C=this.options,i=!0,n=A.distance,o=A.direction,s=A.deltaX,r=A.deltaY;return o&C.direction||(C.direction&Qe?(o=s===0?fI:s<0?xA:OA,i=s!==this.pX,n=Math.abs(A.deltaX)):(o=r===0?fI:r<0?PA:lt,i=r!==this.pY,n=Math.abs(A.deltaY))),A.direction=o,i&&n>C.threshold&&o&C.direction},g.attrTest=function(A){return ct.prototype.attrTest.call(this,A)&&(this.state&Re||!(this.state&Re)&&this.directionTest(A))},g.emit=function(A){this.pX=A.deltaX,this.pY=A.deltaY;var C=Tl(A.direction);C&&(A.additionalEvent=this.options.event+C),I.prototype.emit.call(this,A)},e}(ct),xl=function(I){ke(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({event:"swipe",threshold:10,velocity:.3,direction:Qe|Lg,pointers:1},t))||this}var g=e.prototype;return g.getTouchAction=function(){return mo.prototype.getTouchAction.call(this)},g.attrTest=function(A){var C=this.options.direction,i;return C&(Qe|Lg)?i=A.overallVelocity:C&Qe?i=A.overallVelocityX:C&Lg&&(i=A.overallVelocityY),I.prototype.attrTest.call(this,A)&&C&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers===this.options.pointers&&Vg(i)>this.options.velocity&&A.eventType&Ae},g.emit=function(A){var C=Tl(A.offsetDirection);C&&this.manager.emit(this.options.event+C,A),this.manager.emit(this.options.event,A)},e}(ct),Ol=function(I){ke(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({event:"pinch",threshold:0,pointers:2},t))||this}var g=e.prototype;return g.getTouchAction=function(){return[Zg]},g.attrTest=function(A){return I.prototype.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||this.state&Re)},g.emit=function(A){if(A.scale!==1){var C=A.scale<1?"in":"out";A.additionalEvent=this.options.event+C}I.prototype.emit.call(this,A)},e}(ct),Pl=function(I){ke(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({event:"rotate",threshold:0,pointers:2},t))||this}var g=e.prototype;return g.getTouchAction=function(){return[Zg]},g.attrTest=function(A){return I.prototype.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||this.state&Re)},e}(ct),Dl=function(I){ke(e,I);function e(t){var A;return t===void 0&&(t={}),A=I.call(this,Ve({event:"press",pointers:1,time:251,threshold:9},t))||this,A._timer=null,A._input=null,A}var g=e.prototype;return g.getTouchAction=function(){return[ll]},g.process=function(A){var C=this,i=this.options,n=A.pointers.length===i.pointers,o=A.distance<i.threshold,s=A.deltaTime>i.time;if(this._input=A,!o||!n||A.eventType&(Ae|Te)&&!s)this.reset();else if(A.eventType&be)this.reset(),this._timer=setTimeout(function(){C.state=Ig,C.tryEmit()},i.time);else if(A.eventType&Ae)return Ig;return _e},g.reset=function(){clearTimeout(this._timer)},g.emit=function(A){this.state===Ig&&(A&&A.eventType&Ae?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=lo(),this.manager.emit(this.options.event,this._input)))},e}(DA),Nl={domEvents:!1,touchAction:dl,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},br=[[Pl,{enable:!1}],[Ol,{enable:!1},["rotate"]],[xl,{direction:Qe}],[mo,{direction:Qe},["swipe"]],[Li],[Li,{event:"doubletap",taps:2},["tap"]],[Dl]],bO=1,yr=2;function wr(I,e){var g=I.element;if(g.style){var t;Ag(I.options.cssProps,function(A,C){t=IC(g.style,C),e?(I.oldCssProps[t]=g.style[t],g.style[t]=A):g.style[t]=I.oldCssProps[t]||""}),e||(I.oldCssProps={})}}function yO(I,e){var g=document.createEvent("Event");g.initEvent(I,!0,!0),g.gesture=e,e.target.dispatchEvent(g)}var Er=function(){function I(g,t){var A=this;this.options=Gg({},Nl,t||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=pO(this),this.touchAction=new fl(this,this.options.touchAction),wr(this,!0),Ag(this.options.recognizers,function(C){var i=A.add(new C[0](C[1]));C[2]&&i.recognizeWith(C[2]),C[3]&&i.requireFailure(C[3])},this)}var e=I.prototype;return e.set=function(t){return Gg(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?yr:bO},e.recognize=function(t){var A=this.session;if(!A.stopped){this.touchAction.preventDefaults(t);var C,i=this.recognizers,n=A.curRecognizer;(!n||n&&n.state&Ig)&&(A.curRecognizer=null,n=null);for(var o=0;o<i.length;)C=i[o],A.stopped!==yr&&(!n||C===n||C.canRecognizeWith(n))?C.recognize(t):C.reset(),!n&&C.state&(Re|ht|Eg)&&(A.curRecognizer=C,n=C),o++}},e.get=function(t){if(t instanceof DA)return t;for(var A=this.recognizers,C=0;C<A.length;C++)if(A[C].options.event===t)return A[C];return null},e.add=function(t){if(it(t,"add",this))return this;var A=this.get(t.options.event);return A&&this.remove(A),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},e.remove=function(t){if(it(t,"remove",this))return this;var A=this.get(t);if(t){var C=this.recognizers,i=jg(C,A);i!==-1&&(C.splice(i,1),this.touchAction.update())}return this},e.on=function(t,A){if(t===void 0||A===void 0)return this;var C=this.handlers;return Ag(Qt(t),function(i){C[i]=C[i]||[],C[i].push(A)}),this},e.off=function(t,A){if(t===void 0)return this;var C=this.handlers;return Ag(Qt(t),function(i){A?C[i]&&C[i].splice(jg(C[i],A),1):delete C[i]}),this},e.emit=function(t,A){this.options.domEvents&&yO(t,A);var C=this.handlers[t]&&this.handlers[t].slice();if(!(!C||!C.length)){A.type=t,A.preventDefault=function(){A.srcEvent.preventDefault()};for(var i=0;i<C.length;)C[i](A),i++}},e.destroy=function(){this.element&&wr(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},I}(),wO={touchstart:be,touchmove:Ug,touchend:Ae,touchcancel:Te},EO="touchstart",TO="touchstart touchmove touchend touchcancel",xO=function(I){ke(e,I);function e(){var t,A=e.prototype;return A.evTarget=EO,A.evWin=TO,t=I.apply(this,arguments)||this,t.started=!1,t}var g=e.prototype;return g.handler=function(A){var C=wO[A.type];if(C===be&&(this.started=!0),!!this.started){var i=OO.call(this,A,C);C&(Ae|Te)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,C,{pointers:i[0],changedPointers:i[1],pointerType:TA,srcEvent:A})}},e}(Tt);function OO(I,e){var g=Xt(I.touches),t=Xt(I.changedTouches);return e&(Ae|Te)&&(g=uo(g.concat(t),"identifier",!0)),[g,t]}function Rl(I,e,g){var t="DEPRECATED METHOD: "+e+`
632
+ `+g+` AT
633
+ `;return function(){var A=new Error("get-stack-trace"),C=A&&A.stack?A.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=window.console&&(window.console.warn||window.console.log);return i&&i.call(window.console,t,C),I.apply(this,arguments)}}var Sl=Rl(function(I,e,g){for(var t=Object.keys(e),A=0;A<t.length;)(!g||g&&I[t[A]]===void 0)&&(I[t[A]]=e[t[A]]),A++;return I},"extend","Use `assign`."),PO=Rl(function(I,e){return Sl(I,e,!0)},"merge","Use `assign`.");function DO(I,e,g){var t=e.prototype,A;A=I.prototype=Object.create(t),A.constructor=I,A._super=t,g&&Gg(A,g)}function Tr(I,e){return function(){return I.apply(e,arguments)}}var kl=function(){var I=function(g,t){return t===void 0&&(t={}),new Er(g,Ve({recognizers:br.concat()},t))};return I.VERSION="2.0.17-rc",I.DIRECTION_ALL=cl,I.DIRECTION_DOWN=lt,I.DIRECTION_LEFT=xA,I.DIRECTION_RIGHT=OA,I.DIRECTION_UP=PA,I.DIRECTION_HORIZONTAL=Qe,I.DIRECTION_VERTICAL=Lg,I.DIRECTION_NONE=fI,I.DIRECTION_DOWN=lt,I.INPUT_START=be,I.INPUT_MOVE=Ug,I.INPUT_END=Ae,I.INPUT_CANCEL=Te,I.STATE_POSSIBLE=iI,I.STATE_BEGAN=Re,I.STATE_CHANGED=ht,I.STATE_ENDED=Eg,I.STATE_RECOGNIZED=Ig,I.STATE_CANCELLED=Jt,I.STATE_FAILED=_e,I.Manager=Er,I.Input=Tt,I.TouchAction=fl,I.TouchInput=fo,I.MouseInput=po,I.PointerEventInput=wl,I.TouchMouseInput=El,I.SingleTouchInput=xO,I.Recognizer=DA,I.AttrRecognizer=ct,I.Tap=Li,I.Pan=mo,I.Swipe=xl,I.Pinch=Ol,I.Rotate=Pl,I.Press=Dl,I.on=Lt,I.off=Gt,I.each=Ag,I.merge=PO,I.extend=Sl,I.bindFn=Tr,I.assign=Gg,I.inherit=DO,I.bindFn=Tr,I.prefixed=IC,I.toArray=Xt,I.inArray=jg,I.uniqueArray=uo,I.splitStr=Qt,I.boolOrFn=CC,I.hasParent=co,I.addEventListeners=Lt,I.removeEventListeners=Gt,I.defaults=Gg({},Nl,{preset:br}),I}();kl.defaults;var NO=kl,Ml=My("DELETE");function RO(I){for(var e=arguments.length,g=new Array(e>1?e-1:0),t=1;t<e;t++)g[t-1]=arguments[t];return Fl({},I,...g)}function Fl(){let I=vI(...arguments);return zl(I),I}function vI(){for(var I=arguments.length,e=new Array(I),g=0;g<I;g++)e[g]=arguments[g];if(e.length<2)return e[0];if(e.length>2)return vI(Fl(e[0],e[1]),...Ze(e).call(e,2));let t=e[0],A=e[1];if(t instanceof Date&&A instanceof Date)return t.setTime(A.getTime()),t;for(let C of h0(A))Object.prototype.propertyIsEnumerable.call(A,C)&&(A[C]===Ml?delete t[C]:t[C]!==null&&A[C]!==null&&typeof t[C]=="object"&&typeof A[C]=="object"&&!B(t[C])&&!B(A[C])?t[C]=vI(t[C],A[C]):t[C]=Bl(A[C]));return t}function Bl(I){return B(I)?ae(I).call(I,e=>Bl(e)):typeof I=="object"&&I!==null?I instanceof Date?new Date(I.getTime()):vI({},I):I}function zl(I){for(let e of U(I))I[e]===Ml?delete I[e]:typeof I[e]=="object"&&I[e]!==null&&zl(I[e])}function iC(){for(var I=arguments.length,e=new Array(I),g=0;g<I;g++)e[g]=arguments[g];return SO(e.length?e:[uI()])}function SO(I){let[e,g,t]=kO(I),A=1,C=()=>{let i=2091639*e+A*23283064365386963e-26;return e=g,g=t,t=i-(A=i|0)};return C.uint32=()=>C()*4294967296,C.fract53=()=>C()+(C()*2097152|0)*11102230246251565e-32,C.algorithm="Alea",C.seed=I,C.version="0.9",C}function kO(){let I=MO(),e=I(" "),g=I(" "),t=I(" ");for(let A=0;A<arguments.length;A++)e-=I(A<0||arguments.length<=A?void 0:arguments[A]),e<0&&(e+=1),g-=I(A<0||arguments.length<=A?void 0:arguments[A]),g<0&&(g+=1),t-=I(A<0||arguments.length<=A?void 0:arguments[A]),t<0&&(t+=1);return[e,g,t]}function MO(){let I=4022871197;return function(e){let g=e.toString();for(let t=0;t<g.length;t++){I+=g.charCodeAt(t);let A=.02519603282416938*I;I=A>>>0,A-=I,A*=I,I=A>>>0,A-=I,I+=A*4294967296}return(I>>>0)*23283064365386963e-26}}function FO(){let I=()=>{};return{on:I,off:I,destroy:I,emit:I,get(){return{set:I}}}}var vo=typeof window!="undefined"?window.Hammer||NO:function(){return FO()};function Ke(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)});let g=vo(this._dom.overlay);g.on("tap",b(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{g.destroy()});let t=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];F(t).call(t,A=>{g.on(A,C=>{C.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=A=>{BO(A.target,I)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=A=>{("key"in A?A.key==="Escape":A.keyCode===27)&&this.deactivate()}}ed(Ke.prototype);Ke.current=null;Ke.prototype.destroy=function(){this.deactivate();for(let g of zg(I=Ue(e=this._cleanupQueue).call(e,0)).call(I)){var I,e;g()}};Ke.prototype.activate=function(){Ke.current&&Ke.current.deactivate(),Ke.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)};Ke.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")};Ke.prototype._onTapOverlay=function(I){this.activate(),I.srcEvent.stopPropagation()};function BO(I,e){for(;I;){if(I===e)return!0;I=I.parentNode}return!1}var zO=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ZO=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,LO=/^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,GO=/^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 ug(I){if(I)for(;I.hasChildNodes()===!0;){let e=I.firstChild;e&&(ug(e),I.removeChild(e))}}function pg(I){return I instanceof String||typeof I=="string"}function xr(I){return typeof I=="object"&&I!==null}function Wg(I,e,g,t){let A=!1;t===!0&&(A=e[g]===null&&I[g]!==void 0),A?delete I[g]:I[g]=e[g]}function Zl(I,e){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(let t in I)if(e[t]!==void 0)if(e[t]===null||typeof e[t]!="object")Wg(I,e,t,g);else{let A=I[t],C=e[t];xr(A)&&xr(C)&&Zl(A,C,g)}}function xt(I,e,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(B(g))throw new TypeError("Arrays are not supported by deepExtend");for(let A=0;A<I.length;A++){let C=I[A];if(Object.prototype.hasOwnProperty.call(g,C))if(g[C]&&g[C].constructor===Object)e[C]===void 0&&(e[C]={}),e[C].constructor===Object?_(e[C],g[C],!1,t):Wg(e,g,C,t);else{if(B(g[C]))throw new TypeError("Arrays are not supported by deepExtend");Wg(e,g,C,t)}}return e}function bI(I,e,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(B(g))throw new TypeError("Arrays are not supported by deepExtend");for(let A in g)if(Object.prototype.hasOwnProperty.call(g,A)&&!yg(I).call(I,A))if(g[A]&&g[A].constructor===Object)e[A]===void 0&&(e[A]={}),e[A].constructor===Object?_(e[A],g[A]):Wg(e,g,A,t);else if(B(g[A])){e[A]=[];for(let C=0;C<g[A].length;C++)e[A].push(g[A][C])}else Wg(e,g,A,t);return e}function _(I,e){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(let C in e)if(Object.prototype.hasOwnProperty.call(e,C)||g===!0)if(typeof e[C]=="object"&&e[C]!==null&&Cr(e[C])===Object.prototype)I[C]===void 0?I[C]=_({},e[C],g):typeof I[C]=="object"&&I[C]!==null&&Cr(I[C])===Object.prototype?_(I[C],e[C],g):Wg(I,e,C,t);else if(B(e[C])){var A;I[C]=Ze(A=e[C]).call(A)}else Wg(I,e,C,t);return I}function yI(I,e){return[...I,e]}function VO(I){return Ze(I).call(I)}function jO(I){return I.getBoundingClientRect().left}function WO(I){return I.getBoundingClientRect().top}function S(I,e){if(B(I)){let g=I.length;for(let t=0;t<g;t++)e(I[t],t,I)}else for(let g in I)Object.prototype.hasOwnProperty.call(I,g)&&e(I[g],g,I)}function bo(I){let e;switch(I.length){case 3:case 4:return e=ZO.exec(I),e?{r:ze(e[1]+e[1],16),g:ze(e[2]+e[2],16),b:ze(e[3]+e[3],16)}:null;case 6:case 7:return e=zO.exec(I),e?{r:ze(e[1],16),g:ze(e[2],16),b:ze(e[3],16)}:null;default:return null}}function Ne(I,e){if(yg(I).call(I,"rgba"))return I;if(yg(I).call(I,"rgb")){let g=I.substr(G(I).call(I,"(")+1).replace(")","").split(",");return"rgba("+g[0]+","+g[1]+","+g[2]+","+e+")"}else{let g=bo(I);return g==null?I:"rgba("+g.r+","+g.g+","+g.b+","+e+")"}}function Ll(I,e,g){var t;return"#"+Ze(t=((1<<24)+(I<<16)+(e<<8)+g).toString(16)).call(t,1)}function Gi(I,e){if(pg(I)){let t=I;if(Vl(t)){var g;let A=ae(g=t.substr(4).substr(0,t.length-5).split(",")).call(g,function(C){return ze(C)});t=Ll(A[0],A[1],A[2])}if(Gl(t)===!0){let A=YO(t),C={h:A.h,s:A.s*.8,v:Math.min(1,A.v*1.02)},i={h:A.h,s:Math.min(1,A.s*1.25),v:A.v*.8},n=Vi(i.h,i.s,i.v),o=Vi(C.h,C.s,C.v);return{background:t,border:n,highlight:{background:o,border:n},hover:{background:o,border:n}}}else return{background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else return e?{background:I.background||e.background,border:I.border||e.border,highlight:pg(I.highlight)?{border:I.highlight,background:I.highlight}:{background:I.highlight&&I.highlight.background||e.highlight.background,border:I.highlight&&I.highlight.border||e.highlight.border},hover:pg(I.hover)?{border:I.hover,background:I.hover}:{border:I.hover&&I.hover.border||e.hover.border,background:I.hover&&I.hover.background||e.hover.background}}:{background:I.background||void 0,border:I.border||void 0,highlight:pg(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:pg(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 Bt(I,e,g){I=I/255,e=e/255,g=g/255;let t=Math.min(I,Math.min(e,g)),A=Math.max(I,Math.max(e,g));if(t===A)return{h:0,s:0,v:t};let C=I===t?e-g:g===t?I-e:g-I,n=60*((I===t?3:g===t?1:5)-C/(A-t))/360,o=(A-t)/A;return{h:n,s:o,v:A}}function nI(I,e,g){let t,A,C,i=Math.floor(I*6),n=I*6-i,o=g*(1-e),s=g*(1-n*e),r=g*(1-(1-n)*e);switch(i%6){case 0:t=g,A=r,C=o;break;case 1:t=s,A=g,C=o;break;case 2:t=o,A=g,C=r;break;case 3:t=o,A=s,C=g;break;case 4:t=r,A=o,C=g;break;case 5:t=g,A=o,C=s;break}return{r:Math.floor(t*255),g:Math.floor(A*255),b:Math.floor(C*255)}}function Vi(I,e,g){let t=nI(I,e,g);return Ll(t.r,t.g,t.b)}function YO(I){let e=bo(I);if(!e)throw new TypeError("'".concat(I,"' is not a valid color."));return Bt(e.r,e.g,e.b)}function Gl(I){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(I)}function Vl(I){return LO.test(I)}function _O(I){return GO.test(I)}function Tg(I){if(I===null||typeof I!="object")return null;if(I instanceof Element)return I;let e=wg(I);for(let g in I)Object.prototype.hasOwnProperty.call(I,g)&&typeof I[g]=="object"&&(e[g]=Tg(I[g]));return e}function De(I,e,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},A=function(l){return l!=null},C=function(l){return l!==null&&typeof l=="object"},i=function(l){for(let h in l)if(Object.prototype.hasOwnProperty.call(l,h))return!1;return!0};if(!C(I))throw new Error("Parameter mergeTarget must be an object");if(!C(e))throw new Error("Parameter options must be an object");if(!A(g))throw new Error("Parameter option must have a value");if(!C(t))throw new Error("Parameter globalOptions must be an object");let n=function(l,h,c){C(l[c])||(l[c]={});let p=h[c],u=l[c];for(let m in p)Object.prototype.hasOwnProperty.call(p,m)&&(u[m]=p[m])},o=e[g],r=C(t)&&!i(t)?t[g]:void 0,a=r?r.enabled:void 0;if(o===void 0)return;if(typeof o=="boolean"){C(I[g])||(I[g]={}),I[g].enabled=o;return}if(o===null&&!C(I[g]))if(A(r))I[g]=wg(r);else return;if(!C(o))return;let d=!0;o.enabled!==void 0?d=o.enabled:a!==void 0&&(d=r.enabled),n(I,e,g),I[g].enabled=d}var KO={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 fg(I,e){let g;B(e)||(e=[e]);for(let t of I)if(t){g=t[e[0]];for(let A=1;A<e.length;A++)g&&(g=g[e[A]]);if(typeof g!="undefined")break}return g}var UO={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"},HO=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 UO[e]}setColor(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==="none")return;let t,A=this._isColorString(e);if(A!==void 0&&(e=A),pg(e)===!0){if(Vl(e)===!0){let C=e.substr(4).substr(0,e.length-5).split(",");t={r:C[0],g:C[1],b:C[2],a:1}}else if(_O(e)===!0){let C=e.substr(5).substr(0,e.length-6).split(",");t={r:C[0],g:C[1],b:C[2],a:C[3]}}else if(Gl(e)===!0){let C=bo(e);t={r:C.r,g:C.g,b:C.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){let C=e.a!==void 0?e.a:"1.0";t={r:e.r,g:e.g,b:e.b,a:C}}if(t===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: "+Et(e));this._setColor(t,g)}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=q({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",He(()=>{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=q({},e)),this.color=e;let t=Bt(e.r,e.g,e.b),A=2*Math.PI,C=this.r*t.s,i=this.centerCoordinates.x+C*Math.sin(A*t.h),n=this.centerCoordinates.y+C*Math.cos(A*t.h);this.colorPickerSelector.style.left=i-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=n-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}_setOpacity(e){this.color.a=e/100,this._updatePicker(this.color)}_setBrightness(e){let g=Bt(this.color.r,this.color.g,this.color.b);g.v=e/100;let t=nI(g.h,g.s,g.v);t.a=this.color.a,this.color=t,this._updatePicker()}_updatePicker(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color,g=Bt(e.r,e.g,e.b),t=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let A=this.colorPickerCanvas.clientWidth,C=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,A,C),t.putImageData(this.hueCircle,0,0),t.fillStyle="rgba(0,0,0,"+(1-g.v)+")",t.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),EA(t).call(t),this.brightnessRange.value=100*g.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,g,t,A;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){let i=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{let i=document.createElement("DIV");i.style.color="red",i.style.fontWeight="bold",i.style.padding="10px",i.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(i)}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(i){}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(i){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);let C=this;this.opacityRange.onchange=function(){C._setOpacity(this.value)},this.opacityRange.oninput=function(){C._setOpacity(this.value)},this.brightnessRange.onchange=function(){C._setBrightness(this.value)},this.brightnessRange.oninput=function(){C._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=b(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=b(g=this._apply).call(g,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=b(t=this._save).call(t,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=b(A=this._loadLast).call(A,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 vo(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){let 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);let g=this.colorPickerCanvas.clientWidth,t=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,g,t);let A,C,i,n;this.centerCoordinates={x:g*.5,y:t*.5},this.r=.49*g;let o=2*Math.PI/360,s=1/360,r=1/this.r,a;for(i=0;i<360;i++)for(n=0;n<this.r;n++)A=this.centerCoordinates.x+n*Math.sin(o*i),C=this.centerCoordinates.y+n*Math.cos(o*i),a=nI(i*s,n*r,1),e.fillStyle="rgb("+a.r+","+a.g+","+a.b+")",e.fillRect(A-.5,C-.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,g,t)}this.generated=!0}_moveSelector(e){let g=this.colorPickerDiv.getBoundingClientRect(),t=e.center.x-g.left,A=e.center.y-g.top,C=.5*this.colorPickerDiv.clientHeight,i=.5*this.colorPickerDiv.clientWidth,n=t-i,o=A-C,s=Math.atan2(n,o),r=.98*Math.min(Math.sqrt(n*n+o*o),i),a=Math.cos(s)*r+C,d=Math.sin(s)*r+i;this.colorPickerSelector.style.top=a-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=d-.5*this.colorPickerSelector.clientWidth+"px";let l=s/(2*Math.PI);l=l<0?l+1:l;let h=r/this.r,c=Bt(this.color.r,this.color.g,this.color.b);c.h=l,c.s=h;let p=nI(c.h,c.s,c.v);p.a=this.color.a,this.color=p,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}};function ji(){for(var I=arguments.length,e=new Array(I),g=0;g<I;g++)e[g]=arguments[g];if(e.length<1)throw new TypeError("Invalid arguments.");if(e.length===1)return document.createTextNode(e[0]);{let t=document.createElement(e[0]);return t.appendChild(ji(...Ze(e).call(e,1))),t}}var QO=class{constructor(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=e,this.changedOptions=[],this.container=g,this.allowCreation=!1,this.hideOption=C,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},q(this.options,this.defaultOptions),this.configureOptions=t,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new HO(A),this.wrapper=void 0}setOptions(e){if(e!==void 0){this.popupHistory={},this._removePopup();let g=!0;if(typeof e=="string")this.options.filter=e;else if(B(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),te(e)!==void 0&&(this.options.filter=te(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(g=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,g=e):typeof e=="function"&&(this.options.filter=e,g=!0);te(this.options)===!1&&(g=!1),this.options.enabled=g}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=[];let e=te(this.options),g=0,t=!1;for(let A in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,A)&&(this.allowCreation=!1,t=!1,typeof e=="function"?(t=e(A,[]),t=t||this._handleObject(this.configureOptions[A],[A],!0)):(e===!0||G(e).call(e,A)!==-1)&&(t=!0),t!==!1&&(this.allowCreation=!0,g>0&&this._makeItem([]),this._makeHeader(A),this._handleObject(this.configureOptions[A],[A])),g++);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 g=this.moduleOptions;for(let t=0;t<e.length;t++)if(g[e[t]]!==void 0)g=g[e[t]];else{g=void 0;break}return g}_makeItem(e){if(this.allowCreation===!0){let C=document.createElement("div");C.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var g=arguments.length,t=new Array(g>1?g-1:0),A=1;A<g;A++)t[A-1]=arguments[A];return F(t).call(t,i=>{C.appendChild(i)}),this.domElements.push(C),this.domElements.length}return 0}_makeHeader(e){let g=document.createElement("div");g.className="vis-configuration vis-config-header",g.innerText=e,this._makeItem([],g)}_makeLabel(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=document.createElement("div");if(A.className="vis-configuration vis-config-label vis-config-s"+g.length,t===!0){for(;A.firstChild;)A.removeChild(A.firstChild);A.appendChild(ji("i","b",e))}else A.innerText=e+":";return A}_makeDropdown(e,g,t){let A=document.createElement("select");A.className="vis-configuration vis-config-select";let C=0;g!==void 0&&G(e).call(e,g)!==-1&&(C=G(e).call(e,g));for(let o=0;o<e.length;o++){let s=document.createElement("option");s.value=e[o],o===C&&(s.selected="selected"),s.innerText=e[o],A.appendChild(s)}let i=this;A.onchange=function(){i._update(this.value,t)};let n=this._makeLabel(t[t.length-1],t);this._makeItem(t,n,A)}_makeRange(e,g,t){let A=e[0],C=e[1],i=e[2],n=e[3],o=document.createElement("input");o.className="vis-configuration vis-config-range";try{o.type="range",o.min=C,o.max=i}catch(c){}o.step=n;let s="",r=0;g!==void 0?(g<0&&g*1.2<C?(o.min=Math.ceil(g*1.2),r=o.min,s="range increased"):g/1.2<C&&(o.min=Math.ceil(g/1.2),r=o.min,s="range increased"),g*1.2>i&&i!==1&&(o.max=Math.ceil(g*1.2),r=o.max,s="range increased"),o.value=g):o.value=A;let a=document.createElement("input");a.className="vis-configuration vis-config-rangeinput",a.value=o.value;let d=this;o.onchange=function(){a.value=this.value,d._update(Number(this.value),t)},o.oninput=function(){a.value=this.value};let l=this._makeLabel(t[t.length-1],t),h=this._makeItem(t,l,o,a);s!==""&&this.popupHistory[h]!==r&&(this.popupHistory[h]=r,this._setupPopup(s,h))}_makeButton(){if(this.options.showButton===!0){let 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,g){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){let t=document.createElement("div");t.id="vis-configuration-popup",t.className="vis-configuration-popup",t.innerText=e,t.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:t,index:g}}}_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){let g=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=g.left+"px",this.popupDiv.html.style.top=g.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=He(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=He(()=>{this._removePopup()},1800)}}_makeCheckbox(e,g,t){let A=document.createElement("input");A.type="checkbox",A.className="vis-configuration vis-config-checkbox",A.checked=e,g!==void 0&&(A.checked=g,g!==e&&(typeof e=="object"?g!==e.enabled&&this.changedOptions.push({path:t,value:g}):this.changedOptions.push({path:t,value:g})));let C=this;A.onchange=function(){C._update(this.checked,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,A)}_makeTextInput(e,g,t){let A=document.createElement("input");A.type="text",A.className="vis-configuration vis-config-text",A.value=g,g!==e&&this.changedOptions.push({path:t,value:g});let C=this;A.onchange=function(){C._update(this.value,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,A)}_makeColorField(e,g,t){let A=e[1],C=document.createElement("div");g=g===void 0?A:g,g!=="none"?(C.className="vis-configuration vis-config-colorBlock",C.style.backgroundColor=g):C.className="vis-configuration vis-config-colorBlock none",g=g===void 0?A:g,C.onclick=()=>{this._showColorPicker(g,C,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,C)}_showColorPicker(e,g,t){g.onclick=function(){},this.colorPicker.insertTo(g),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(A=>{let C="rgba("+A.r+","+A.g+","+A.b+","+A.a+")";g.style.backgroundColor=C,this._update(C,t)}),this.colorPicker.setCloseCallback(()=>{g.onclick=()=>{this._showColorPicker(e,g,t)}})}_handleObject(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=!1,C=te(this.options),i=!1;for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){A=!0;let o=e[n],s=yI(g,n);if(typeof C=="function"&&(A=C(n,g),A===!1&&!B(o)&&typeof o!="string"&&typeof o!="boolean"&&o instanceof Object&&(this.allowCreation=!1,A=this._handleObject(o,s,!0),this.allowCreation=t===!1)),A!==!1){i=!0;let r=this._getValue(s);if(B(o))this._handleArray(o,r,s);else if(typeof o=="string")this._makeTextInput(o,r,s);else if(typeof o=="boolean")this._makeCheckbox(o,r,s);else if(o instanceof Object){if(!this.hideOption(g,n,this.moduleOptions))if(o.enabled!==void 0){let a=yI(s,"enabled"),d=this._getValue(a);if(d===!0){let l=this._makeLabel(n,s,!0);this._makeItem(s,l),i=this._handleObject(o,s)||i}else this._makeCheckbox(o,d,s)}else{let a=this._makeLabel(n,s,!0);this._makeItem(s,a),i=this._handleObject(o,s)||i}}else console.error("dont know how to handle",o,n,s)}}return i}_handleArray(e,g,t){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,g,t),e[1]!==g&&this.changedOptions.push({path:t,value:g})):typeof e[0]=="string"?(this._makeDropdown(e,g,t),e[0]!==g&&this.changedOptions.push({path:t,value:g})):typeof e[0]=="number"&&(this._makeRange(e,g,t),e[0]!==g&&this.changedOptions.push({path:t,value:Number(g)}))}_update(e,g){let t=this._constructOptions(e,g);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",t),this.initialized=!0,this.parent.setOptions(t)}_constructOptions(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=t;e=e==="true"?!0:e,e=e==="false"?!1:e;for(let C=0;C<g.length;C++)g[C]!=="global"&&(A[g[C]]===void 0&&(A[g[C]]={}),C!==g.length-1?A=A[g[C]]:A[g[C]]=e);return t}_printOptions(){let e=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(ji("pre","const options = "+Et(e,null,2)))}getOptions(){let e={};for(let g=0;g<this.changedOptions.length;g++)this._constructOptions(this.changedOptions[g].value,this.changedOptions[g].path,e);return e}},XO=class{constructor(e,g){this.container=e,this.overflowMethod=g||"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,g){this.x=ze(e),this.y=ze(g)}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){let g=this.frame.clientHeight,t=this.frame.clientWidth,A=this.frame.parentNode.clientHeight,C=this.frame.parentNode.clientWidth,i=0,n=0;if(this.overflowMethod=="flip"){let o=!1,s=!0;this.y-g<this.padding&&(s=!1),this.x+t>C-this.padding&&(o=!0),o?i=this.x-t:i=this.x,s?n=this.y-g:n=this.y}else n=this.y-g,n+g+this.padding>A&&(n=A-g-this.padding),n<this.padding&&(n=this.padding),i=this.x,i+t+this.padding>C&&(i=C-t-this.padding),i<this.padding&&(i=this.padding);this.frame.style.left=i+"px",this.frame.style.top=n+"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)}},Nt=!1,Or,Wi="background: #FFeeee; color: #dd0000",JO=class Q{static validate(e,g,t){Nt=!1,Or=g;let A=g;return t!==void 0&&(A=g[t]),Q.parse(e,A,[]),Nt}static parse(e,g,t){for(let A in e)Object.prototype.hasOwnProperty.call(e,A)&&Q.check(A,e,g,t)}static check(e,g,t,A){if(t[e]===void 0&&t.__any__===void 0){Q.getSuggestion(e,t,A);return}let C=e,i=!0;t[e]===void 0&&t.__any__!==void 0&&(C="__any__",i=Q.getType(g[e])==="object");let n=t[C];i&&n.__type__!==void 0&&(n=n.__type__),Q.checkFields(e,g,t,C,n,A)}static checkFields(e,g,t,A,C,i){let n=function(r){console.error("%c"+r+Q.printLocation(i,e),Wi)},o=Q.getType(g[e]),s=C[o];s!==void 0?Q.getType(s)==="array"&&G(s).call(s,g[e])===-1?(n('Invalid option detected in "'+e+'". Allowed values are:'+Q.print(s)+' not "'+g[e]+'". '),Nt=!0):o==="object"&&A!=="__any__"&&(i=yI(i,e),Q.parse(g[e],t[A],i)):C.any===void 0&&(n('Invalid type received for "'+e+'". Expected: '+Q.print(U(C))+". Received ["+o+'] "'+g[e]+'"'),Nt=!0)}static getType(e){let g=typeof e;return g==="object"?e===null?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":B(e)?"array":e instanceof Date?"date":e.nodeType!==void 0?"dom":e._isAMomentObject===!0?"moment":"object":g==="number"?"number":g==="boolean"?"boolean":g==="string"?"string":g===void 0?"undefined":g}static getSuggestion(e,g,t){let A=Q.findInOptions(e,g,t,!1),C=Q.findInOptions(e,Or,[],!0),i=8,n=4,o;A.indexMatch!==void 0?o=" in "+Q.printLocation(A.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+A.indexMatch+`"?
634
634
 
635
- `:C.distance<=n&&A.distance>C.distance?o=" in "+Q.printLocation(A.path,g,"")+"Perhaps it was misplaced? Matching option found at: "+Q.printLocation(C.path,C.closestMatch,""):A.distance<=i?o='. Did you mean "'+A.closestMatch+'"?'+Q.printLocation(A.path,g):o=". Did you mean one of these: "+Q.print(U(e))+Q.printLocation(t,g),console.error('%cUnknown option detected: "'+g+'"'+o,Gi),Rt=!0}static findInOptions(g,e,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,C=1e9,i="",n=[],o=g.toLowerCase(),s;for(let a in e){let d;if(e[a].__type__!==void 0&&A===!0){let l=Q.findInOptions(g,e[a],yI(t,a));C>l.distance&&(i=l.closestMatch,n=l.path,C=l.distance,s=l.indexMatch)}else{var r;G(r=a.toLowerCase()).call(r,o)!==-1&&(s=a),d=Q.levenshteinDistance(g,a),C>d&&(i=a,n=ZO(t),C=d)}}return{closestMatch:i,path:n,distance:C,indexMatch:s}}static printLocation(g,e){let A=`
635
+ `:C.distance<=n&&A.distance>C.distance?o=" in "+Q.printLocation(A.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+Q.printLocation(C.path,C.closestMatch,""):A.distance<=i?o='. Did you mean "'+A.closestMatch+'"?'+Q.printLocation(A.path,e):o=". Did you mean one of these: "+Q.print(U(g))+Q.printLocation(t,e),console.error('%cUnknown option detected: "'+e+'"'+o,Wi),Nt=!0}static findInOptions(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,C=1e9,i="",n=[],o=e.toLowerCase(),s;for(let a in g){let d;if(g[a].__type__!==void 0&&A===!0){let l=Q.findInOptions(e,g[a],yI(t,a));C>l.distance&&(i=l.closestMatch,n=l.path,C=l.distance,s=l.indexMatch)}else{var r;G(r=a.toLowerCase()).call(r,o)!==-1&&(s=a),d=Q.levenshteinDistance(e,a),C>d&&(i=a,n=VO(t),C=d)}}return{closestMatch:i,path:n,distance:C,indexMatch:s}}static printLocation(e,g){let A=`
636
636
 
637
637
  `+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at:
638
638
  `)+`options = {
639
- `;for(let C=0;C<g.length;C++){for(let i=0;i<C+1;i++)A+=" ";A+=g[C]+`: {
640
- `}for(let C=0;C<g.length+1;C++)A+=" ";A+=e+`
641
- `;for(let C=0;C<g.length+1;C++){for(let i=0;i<g.length-C;i++)A+=" ";A+=`}
639
+ `;for(let C=0;C<e.length;C++){for(let i=0;i<C+1;i++)A+=" ";A+=e[C]+`: {
640
+ `}for(let C=0;C<e.length+1;C++)A+=" ";A+=g+`
641
+ `;for(let C=0;C<e.length+1;C++){for(let i=0;i<e.length-C;i++)A+=" ";A+=`}
642
642
  `}return A+`
643
643
 
644
- `}static print(g){return Et(g).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(g,e){if(g.length===0)return e.length;if(e.length===0)return g.length;let t=[],A;for(A=0;A<=e.length;A++)t[A]=[A];let C;for(C=0;C<=g.length;C++)t[0][C]=C;for(A=1;A<=e.length;A++)for(C=1;C<=g.length;C++)e.charAt(A-1)==g.charAt(C-1)?t[A][C]=t[A-1][C-1]:t[A][C]=Math.min(t[A-1][C-1]+1,Math.min(t[A][C-1]+1,t[A-1][C]+1));return t[e.length][g.length]}},QO=Kg,XO=KO,ot=fo,JO=UO,Gl=Gi,$O=HO;function qO(I){return me=I,A1()}var Vl={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},mo=we(Vl);mo.color="color.color";mo.style="dashes";var mg={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},xr={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},me="",ut=0,N="",P="",wg=mg.NULL;function g1(){ut=0,N=me.charAt(0)}function og(){ut++,N=me.charAt(ut)}function et(){return me.charAt(ut+1)}function Or(I){var g=I.charCodeAt(0);return g<47?g===35||g===46:g<59?g>47:g<91?g>64:g<96?g===95:g<123?g>96:!1}function Oe(I,g){if(I||(I={}),g)for(var e in g)g.hasOwnProperty(e)&&(I[e]=g[e]);return I}function e1(I,g,e){for(var t=g.split("."),A=I;t.length;){var C=t.shift();t.length?(A[C]||(A[C]={}),A=A[C]):A[C]=e}}function jl(I,g){for(var e,t,A=null,C=[I],i=I;i.parent;)C.push(i.parent),i=i.parent;if(i.nodes){for(e=0,t=i.nodes.length;e<t;e++)if(g.id===i.nodes[e].id){A=i.nodes[e];break}}for(A||(A={id:g.id},I.node&&(A.attr=Oe(A.attr,I.node))),e=C.length-1;e>=0;e--){var n,o=C[e];o.nodes||(o.nodes=[]),G(n=o.nodes).call(n,A)===-1&&o.nodes.push(A)}g.attr&&(A.attr=Oe(A.attr,g.attr))}function t1(I,g){if(I.edges||(I.edges=[]),I.edges.push(g),I.edge){var e=Oe({},I.edge);g.attr=Oe(e,g.attr)}}function Wl(I,g,e,t,A){var C={from:g,to:e,type:t};return I.edge&&(C.attr=Oe({},I.edge)),C.attr=Oe(C.attr||{},A),A!=null&&A.hasOwnProperty("arrows")&&A.arrows!=null&&(C.arrows={to:{enabled:!0,type:A.arrows.type}},A.arrows=null),C}function K(){for(wg=mg.NULL,P="";N===" "||N===" "||N===`
645
- `||N==="\r";)og();do{var I=!1;if(N==="#"){for(var g=ut-1;me.charAt(g)===" "||me.charAt(g)===" ";)g--;if(me.charAt(g)===`
646
- `||me.charAt(g)===""){for(;N!=""&&N!=`
647
- `;)og();I=!0}}if(N==="/"&&et()==="/"){for(;N!=""&&N!=`
648
- `;)og();I=!0}if(N==="/"&&et()==="*"){for(;N!="";)if(N==="*"&&et()==="/"){og(),og();break}else og();I=!0}for(;N===" "||N===" "||N===`
649
- `||N==="\r";)og()}while(I);if(N===""){wg=mg.DELIMITER;return}var e=N+et();if(xr[e]){wg=mg.DELIMITER,P=e,og(),og();return}if(xr[N]){wg=mg.DELIMITER,P=N,og();return}if(Or(N)||N==="-"){for(P+=N,og();Or(N);)P+=N,og();P==="false"?P=!1:P==="true"?P=!0:isNaN(Number(P))||(P=Number(P)),wg=mg.IDENTIFIER;return}if(N==='"'){for(og();N!=""&&(N!='"'||N==='"'&&et()==='"');)N==='"'?(P+=N,og()):N==="\\"&&et()==="n"?(P+=`
650
- `,og()):P+=N,og();if(N!='"')throw vg('End of string " expected');og(),wg=mg.IDENTIFIER;return}for(wg=mg.UNKNOWN;N!="";)P+=N,og();throw new SyntaxError('Syntax error in part "'+Ul(P,30)+'"')}function A1(){var I={};if(g1(),K(),P==="strict"&&(I.strict=!0,K()),(P==="graph"||P==="digraph")&&(I.type=P,K()),wg===mg.IDENTIFIER&&(I.id=P,K()),P!="{")throw vg("Angle bracket { expected");if(K(),Yl(I),P!="}")throw vg("Angle bracket } expected");if(K(),P!=="")throw vg("End of file expected");return K(),delete I.node,delete I.edge,delete I.graph,I}function Yl(I){for(;P!==""&&P!="}";)I1(I),P===";"&&K()}function I1(I){var g=_l(I);if(g){Kl(I,g);return}var e=C1(I);if(!e){if(wg!=mg.IDENTIFIER)throw vg("Identifier expected");var t=P;if(K(),P==="="){if(K(),wg!=mg.IDENTIFIER)throw vg("Identifier expected");I[t]=P,K()}else i1(I,t)}}function _l(I){var g=null;if(P==="subgraph"&&(g={},g.type="subgraph",K(),wg===mg.IDENTIFIER&&(g.id=P,K())),P==="{"){if(K(),g||(g={}),g.parent=I,g.node=I.node,g.edge=I.edge,g.graph=I.graph,Yl(g),P!="}")throw vg("Angle bracket } expected");K(),delete g.node,delete g.edge,delete g.graph,delete g.parent,I.subgraphs||(I.subgraphs=[]),I.subgraphs.push(g)}return g}function C1(I){return P==="node"?(K(),I.node=Vt(),"node"):P==="edge"?(K(),I.edge=Vt(),"edge"):P==="graph"?(K(),I.graph=Vt(),"graph"):null}function i1(I,g){var e={id:g},t=Vt();t&&(e.attr=t),jl(I,e),Kl(I,g)}function Kl(I,g){for(;P==="->"||P==="--";){var e,t=P;K();var A=_l(I);if(A)e=A;else{if(wg!=mg.IDENTIFIER)throw vg("Identifier or subgraph expected");e=P,jl(I,{id:e}),K()}var C=Vt(),i=Wl(I,g,e,t,C);t1(I,i),g=e}}function Vt(){for(var I,g=null,e={dashed:!0,solid:!1,dotted:[1,5]},t={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},A=new Array,C=new Array;P==="[";){for(K(),g={};P!==""&&P!="]";){if(wg!=mg.IDENTIFIER)throw vg("Attribute name expected");var i=P;if(K(),P!="=")throw vg("Equal sign = expected");if(K(),wg!=mg.IDENTIFIER)throw vg("Attribute value expected");var n=P;i==="style"&&(n=e[n]);var o;i==="arrowhead"&&(o=t[n],i="arrows",n={to:{enabled:!0,type:o}}),i==="arrowtail"&&(o=t[n],i="arrows",n={from:{enabled:!0,type:o}}),A.push({attr:g,name:i,value:n}),C.push(i),K(),P==","&&K()}if(P!="]")throw vg("Bracket ] expected");K()}if(ye(C).call(C,"dir")){var s={};for(s.arrows={},I=0;I<A.length;I++)if(A[I].name==="arrows")if(A[I].value.to!=null)s.arrows.to=I;else if(A[I].value.from!=null)s.arrows.from=I;else throw vg("Invalid value of arrows");else A[I].name==="dir"&&(s.dir=I);var r=A[s.dir].value;if(!ye(C).call(C,"arrows"))if(r==="both")A.push({attr:A[s.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),s.arrows.to=A.length-1,A.push({attr:A[s.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),s.arrows.from=A.length-1;else if(r==="forward")A.push({attr:A[s.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),s.arrows.to=A.length-1;else if(r==="back")A.push({attr:A[s.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),s.arrows.from=A.length-1;else if(r==="none")A.push({attr:A[s.dir].attr,name:"arrows",value:""}),s.arrows.to=A.length-1;else throw vg('Invalid dir type "'+r+'"');var a,d;if(r==="both")s.arrows.to&&s.arrows.from?(d=A[s.arrows.to].value.to.type,a=A[s.arrows.from].value.from.type,A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}},Ug(A).call(A,s.arrows.from,1)):s.arrows.to?(d=A[s.arrows.to].value.to.type,a="arrow",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.from&&(d="arrow",a=A[s.arrows.from].value.from.type,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}});else if(r==="back")s.arrows.to&&s.arrows.from?(d="",a=A[s.arrows.from].value.from.type,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.to?(d="",a="arrow",s.arrows.from=s.arrows.to,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.from&&(d="",a=A[s.arrows.from].value.from.type,A[s.arrows.to]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}),A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{from:{enabled:!0,type:A[s.arrows.from].value.from.type}}};else if(r==="none"){var l;s.arrows.to?l=s.arrows.to:l=s.arrows.from,A[l]={attr:A[l].attr,name:A[l].name,value:""}}else if(r==="forward")s.arrows.to&&s.arrows.from?(d=A[s.arrows.to].value.to.type,a="",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.to?(d=A[s.arrows.to].value.to.type,a="",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.from&&(d="arrow",a="",s.arrows.to=s.arrows.from,A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}),A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:A[s.arrows.to].value.to.type}}};else throw vg('Invalid dir type "'+r+'"');Ug(A).call(A,s.dir,1)}var h;if(ye(C).call(C,"penwidth")){var c=[];for(h=A.length,I=0;I<h;I++)A[I].name!=="width"&&(A[I].name==="penwidth"&&(A[I].name="width"),c.push(A[I]));A=c}for(h=A.length,I=0;I<h;I++)e1(A[I].attr,A[I].name,A[I].value);return g}function vg(I){return new SyntaxError(I+', got "'+Ul(P,30)+'" (char '+ut+")")}function Ul(I,g){return I.length<=g?I:I.substr(0,27)+"..."}function n1(I,g,e){B(I)?F(I).call(I,function(t){B(g)?F(g).call(g,function(A){e(t,A)}):e(t,g)}):B(g)?F(g).call(g,function(t){e(I,t)}):e(I,g)}function JC(I,g,e){for(var t=g.split("."),A=t.pop(),C=I,i=0;i<t.length;i++){var n=t[i];n in C||(C[n]={}),C=C[n]}return C[A]=e,I}function Pr(I,g){var e={};for(var t in I)if(I.hasOwnProperty(t)){var A=g[t];B(A)?F(A).call(A,function(C){JC(e,C,I[t])}):typeof A=="string"?JC(e,A,I[t]):JC(e,t,I[t])}return e}function o1(I){var g=qO(I),e={nodes:[],edges:[],options:{}};if(g.nodes){var t;F(t=g.nodes).call(t,function(i){var n={id:i.id,label:String(i.label||i.id)};Oe(n,Pr(i.attr,Vl)),n.image&&(n.shape="image"),e.nodes.push(n)})}if(g.edges){var A,C=function(i){var n={from:i.from,to:i.to};return Oe(n,Pr(i.attr,mo)),n.arrows==null&&i.type==="->"&&(n.arrows="to"),n};F(A=g.edges).call(A,function(i){var n,o;if(i.from instanceof Object?n=i.from.nodes:n={id:i.from},i.to instanceof Object?o=i.to.nodes:o={id:i.to},i.from instanceof Object&&i.from.edges){var s;F(s=i.from.edges).call(s,function(a){var d=C(a);e.edges.push(d)})}if(n1(n,o,function(a,d){var l=Wl(e,a.id,d.id,i.type,i.attr),h=C(l);e.edges.push(h)}),i.to instanceof Object&&i.to.edges){var r;F(r=i.to.edges).call(r,function(a){var d=C(a);e.edges.push(d)})}})}return g.attr&&(e.options=g.attr),e}function s1(I,g){var e;let t={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};g!=null&&(g.fixed!=null&&(t.nodes.fixed=g.fixed),g.parseColor!=null&&(t.nodes.parseColor=g.parseColor),g.inheritColor!=null&&(t.edges.inheritColor=g.inheritColor));let A=I.edges,C=ag(A).call(A,n=>{let o={from:n.source,id:n.id,to:n.target};return n.attributes!=null&&(o.attributes=n.attributes),n.label!=null&&(o.label=n.label),n.attributes!=null&&n.attributes.title!=null&&(o.title=n.attributes.title),n.type==="Directed"&&(o.arrows="to"),n.color&&t.edges.inheritColor===!1&&(o.color=n.color),o});return{nodes:ag(e=I.nodes).call(e,n=>{let o={id:n.id,fixed:t.nodes.fixed&&n.x!=null&&n.y!=null};return n.attributes!=null&&(o.attributes=n.attributes),n.label!=null&&(o.label=n.label),n.size!=null&&(o.size=n.size),n.attributes!=null&&n.attributes.title!=null&&(o.title=n.attributes.title),n.title!=null&&(o.title=n.title),n.x!=null&&(o.x=n.x),n.y!=null&&(o.y=n.y),n.color!=null&&(t.nodes.parseColor===!0?o.color=n.color:o.color={background:n.color,border:n.color,highlight:{background:n.color,border:n.color},hover:{background:n.color,border:n.color}}),o}),edges:C}}var r1={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"},a1={addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzuf\xFCgen",addNode:"Knoten hinzuf\xFCgen",back:"Zur\xFCck",close:"Schlie\xDFen",createEdgeError:"Es ist nicht m\xF6glich, Kanten mit Clustern zu verbinden.",del:"L\xF6sche Auswahl",deleteClusterError:"Cluster k\xF6nnen nicht gel\xF6scht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster k\xF6nnen nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},d1={addDescription:"Haga clic en un lugar vac\xEDo para colocar un nuevo nodo.",addEdge:"A\xF1adir arista",addNode:"A\xF1adir nodo",back:"Atr\xE1s",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selecci\xF3n",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},l1={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"},h1={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"},c1={addDescription:"Clique em um espa\xE7o em branco para adicionar um novo n\xF3",addEdge:"Adicionar aresta",addNode:"Adicionar n\xF3",back:"Voltar",close:"Fechar",createEdgeError:"N\xE3o foi poss\xEDvel linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters n\xE3o puderam ser removidos.",edgeDescription:"Clique em um n\xF3 e arraste a aresta at\xE9 outro n\xF3 para conect\xE1-los",edit:"Editar",editClusterError:"Clusters n\xE3o puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um n\xF3 para conect\xE1-los",editNode:"Editar n\xF3"},u1={addDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u0432 \u0441\u0432\u043E\u0431\u043E\u0434\u043D\u043E\u0435 \u043C\u0435\u0441\u0442\u043E, \u0447\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u0443\u0437\u0435\u043B.",addEdge:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u043E",addNode:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0443\u0437\u0435\u043B",back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C",createEdgeError:"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u0430 \u0432 \u043A\u043B\u0430\u0441\u0442\u0435\u0440.",del:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435",deleteClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0443\u0434\u0430\u043B\u0435\u043D\u044B",edgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u0443\u0437\u0435\u043B \u0438 \u043F\u0440\u043E\u0442\u044F\u043D\u0438\u0442\u0435 \u0440\u0435\u0431\u0440\u043E \u043A \u0434\u0440\u0443\u0433\u043E\u043C\u0443 \u0443\u0437\u043B\u0443, \u0447\u0442\u043E\u0431\u044B \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0438\u0445.",edit:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C",editClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F.",editEdge:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0435\u0431\u0440\u043E",editEdgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u0438 \u043F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u0445 \u0432 \u0443\u0437\u0435\u043B, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043A \u043D\u0435\u043C\u0443.",editNode:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0443\u0437\u0435\u043B"},f1={addDescription:"\u5355\u51FB\u7A7A\u767D\u5904\u653E\u7F6E\u65B0\u8282\u70B9\u3002",addEdge:"\u6DFB\u52A0\u8FDE\u63A5\u7EBF",addNode:"\u6DFB\u52A0\u8282\u70B9",back:"\u8FD4\u56DE",close:"\u95DC\u9589",createEdgeError:"\u65E0\u6CD5\u5C06\u8FDE\u63A5\u7EBF\u8FDE\u63A5\u5230\u7FA4\u96C6\u3002",del:"\u5220\u9664\u9009\u5B9A",deleteClusterError:"\u65E0\u6CD5\u5220\u9664\u7FA4\u96C6\u3002",edgeDescription:"\u5355\u51FB\u67D0\u4E2A\u8282\u70B9\u5E76\u5C06\u8BE5\u8FDE\u63A5\u7EBF\u62D6\u52A8\u5230\u53E6\u4E00\u4E2A\u8282\u70B9\u4EE5\u8FDE\u63A5\u5B83\u4EEC\u3002",edit:"\u7F16\u8F91",editClusterError:"\u65E0\u6CD5\u7F16\u8F91\u7FA4\u96C6\u3002",editEdge:"\u7F16\u8F91\u8FDE\u63A5\u7EBF",editEdgeDescription:"\u5355\u51FB\u63A7\u5236\u8282\u70B9\u5E76\u5C06\u5B83\u4EEC\u62D6\u5230\u8282\u70B9\u4E0A\u8FDE\u63A5\u3002",editNode:"\u7F16\u8F91\u8282\u70B9"},p1={addDescription:"K\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0456\u043B\u044C\u043D\u0435 \u043C\u0456\u0441\u0446\u0435, \u0449\u043E\u0431 \u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0432\u0443\u0437\u043E\u043B.",addEdge:"\u0414\u043E\u0434\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",addNode:"\u0414\u043E\u0434\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B",back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u0438\u0442\u0438",createEdgeError:"\u041D\u0435 \u043C\u043E\u0436\u043B\u0438\u0432\u043E \u043E\u0431'\u0454\u0434\u043D\u0430\u0442\u0438 \u043A\u0440\u0430\u0457 \u0432 \u0433\u0440\u0443\u043F\u0443.",del:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043E\u0431\u0440\u0430\u043D\u0435",deleteClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435 \u043C\u043E\u0436\u0443\u0442\u044C \u0431\u0443\u0442\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u0456.",edgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0443\u0437\u043E\u043B \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u043A\u0440\u0430\u0439 \u0434\u043E \u0456\u043D\u0448\u043E\u0433\u043E \u0432\u0443\u0437\u043B\u0430, \u0449\u043E\u0431 \u0457\u0445 \u0437'\u0454\u0434\u043D\u0430\u0442\u0438.",edit:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438",editClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043D\u043D\u044F.",editEdge:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",editEdgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u0456 \u0442\u043E\u0447\u043A\u0438 \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0457\u0445 \u0443 \u0432\u0443\u0437\u043E\u043B, \u0449\u043E\u0431 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0438\u0441\u044F \u0434\u043E \u043D\u044C\u043E\u0433\u043E.",editNode:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B"},m1={addDescription:"Cliquez dans un endroit vide pour placer un n\u0153ud.",addEdge:"Ajouter un lien",addNode:"Ajouter un n\u0153ud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de cr\xE9er un lien vers un cluster.",del:"Effacer la s\xE9lection",deleteClusterError:"Les clusters ne peuvent pas \xEAtre effac\xE9s.",edgeDescription:"Cliquez sur un n\u0153ud et glissez le lien vers un autre n\u0153ud pour les connecter.",edit:"\xC9diter",editClusterError:"Les clusters ne peuvent pas \xEAtre \xE9dit\xE9s.",editEdge:"\xC9diter le lien",editEdgeDescription:"Cliquez sur les points de contr\xF4le et glissez-les pour connecter un n\u0153ud.",editNode:"\xC9diter le n\u0153ud"},v1={addDescription:"Kluknut\xEDm do pr\xE1zdn\xE9ho prostoru m\u016F\u017Eete p\u0159idat nov\xFD vrchol.",addEdge:"P\u0159idat hranu",addNode:"P\u0159idat vrchol",back:"Zp\u011Bt",close:"Zav\u0159\xEDt",createEdgeError:"Nelze p\u0159ipojit hranu ke shluku.",del:"Smazat v\xFDb\u011Br",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"P\u0159eta\u017Een\xEDm z jednoho vrcholu do druh\xE9ho m\u016F\u017Eete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"P\u0159eta\u017Een\xEDm kontroln\xEDho vrcholu hrany ji m\u016F\u017Eete p\u0159ipojit k jin\xE9mu vrcholu.",editNode:"Upravit vrchol"},b1=Object.freeze({__proto__:null,cn:f1,cs:v1,de:a1,en:r1,es:d1,fr:m1,it:l1,nl:h1,pt:c1,ru:u1,uk:p1});function y1(I,g){try{let[t,A]=g.split(/[-_ /]/,2),C=t!=null?t.toLowerCase():null,i=A!=null?A.toUpperCase():null;if(C&&i){let n=C+"-"+i;if(Object.prototype.hasOwnProperty.call(I,n))return n;var e;console.warn(Xd(e="Unknown variant ".concat(i," of language ")).call(e,C,"."))}if(C){let n=C;if(Object.prototype.hasOwnProperty.call(I,n))return n;console.warn("Unknown language ".concat(C))}return console.warn("Unknown locale ".concat(g,", falling back to English.")),"en"}catch(t){return console.error(t),console.warn("Unexpected error while normalizing locale ".concat(g,", falling back to English.")),"en"}}var Vi=class{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;let g=this.image.width,e=this.image.height;this.width=g,this.height=e;let t=Math.floor(e/2),A=Math.floor(e/4),C=Math.floor(e/8),i=Math.floor(e/16),n=Math.floor(g/2),o=Math.floor(g/4),s=Math.floor(g/8),r=Math.floor(g/16);this.canvas.width=3*o,this.canvas.height=t,this.coordinates=[[0,0,n,t],[n,0,o,A],[n,A,s,C],[5*s,A,r,i]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){let g=this.canvas.getContext("2d"),e=this.coordinates[0];g.drawImage(this.image,e[0],e[1],e[2],e[3]);for(let t=1;t<this.NUM_ITERATIONS;t++){let A=this.coordinates[t-1],C=this.coordinates[t];g.drawImage(this.canvas,A[0],A[1],A[2],A[3],C[0],C[1],C[2],C[3])}}drawImageAtPosition(g,e,t,A,C,i){if(this.initialized())if(e>2){e*=.5;let n=0;for(;e>2&&n<this.NUM_ITERATIONS;)e*=.5,n+=1;n>=this.NUM_ITERATIONS&&(n=this.NUM_ITERATIONS-1);let o=this.coordinates[n];g.drawImage(this.canvas,o[0],o[1],o[2],o[3],t,A,C,i)}else g.drawImage(this.image,t,A,C,i)}},ji=class{constructor(g){this.images={},this.imageBroken={},this.callback=g}_tryloadBrokenUrl(g,e,t){if(!(g===void 0||t===void 0)){if(e===void 0){console.warn("No broken url image defined");return}t.image.onerror=()=>{console.error("Could not load brokenImage:",e)},t.image.src=e}}_redrawWithImage(g){this.callback&&this.callback(g)}load(g,e){let t=this.images[g];if(t)return t;let A=new Vi;return this.images[g]=A,A.image.onload=()=>{this._fixImageCoordinates(A.image),A.init(),this._redrawWithImage(A)},A.image.onerror=()=>{console.error("Could not load image:",g),this._tryloadBrokenUrl(g,e,A)},A.image.src=g,A}_fixImageCoordinates(g){g.width===0&&(document.body.appendChild(g),g.width=g.offsetWidth,g.height=g.offsetHeight,document.body.removeChild(g))}},Hl={exports:{}},w1=z,E1=w1(function(){if(typeof ArrayBuffer=="function"){var I=new ArrayBuffer(8);Object.isExtensible(I)&&Object.defineProperty(I,"a",{value:8})}}),T1=z,x1=cg,O1=se,Dr=E1,oI=Object.isExtensible,P1=T1(function(){oI(1)}),D1=P1||Dr?function(g){return!x1(g)||Dr&&O1(g)==="ArrayBuffer"?!1:oI?oI(g):!0}:oI,R1=z,Ql=!R1(function(){return Object.isExtensible(Object.preventExtensions({}))}),N1=R,S1=Z,k1=lA,M1=cg,vo=ng,F1=Og.f,Rr=mA,B1=XI,bo=D1,z1=WI,Z1=Ql,Xl=!1,ne=z1("meta"),L1=0,yo=function(I){F1(I,ne,{value:{objectID:"O"+L1++,weakData:{}}})},G1=function(I,g){if(!M1(I))return typeof I=="symbol"?I:(typeof I=="string"?"S":"P")+I;if(!vo(I,ne)){if(!bo(I))return"F";if(!g)return"E";yo(I)}return I[ne].objectID},V1=function(I,g){if(!vo(I,ne)){if(!bo(I))return!0;if(!g)return!1;yo(I)}return I[ne].weakData},j1=function(I){return Z1&&Xl&&bo(I)&&!vo(I,ne)&&yo(I),I},W1=function(){Y1.enable=function(){},Xl=!0;var I=Rr.f,g=S1([].splice),e={};e[ne]=1,I(e).length&&(Rr.f=function(t){for(var A=I(t),C=0,i=A.length;C<i;C++)if(A[C]===ne){g(A,C,1);break}return A},N1({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:B1.f}))},Y1=Hl.exports={enable:W1,fastKey:G1,getWeakData:V1,onFreeze:j1};k1[ne]=!0;var nC=Hl.exports,_1=gg,K1=yt,U1=_1("iterator"),H1=Array.prototype,Q1=function(I){return I!==void 0&&(K1.Array===I||H1[U1]===I)},X1=ae,Nr=Kn,J1=ft,$1=yt,q1=gg,gP=q1("iterator"),Jl=function(I){if(!J1(I))return Nr(I,gP)||Nr(I,"@@iterator")||$1[X1(I)]},eP=jg,tP=Ye,AP=re,IP=sA,CP=Jl,iP=TypeError,$l=function(I,g){var e=arguments.length<2?CP(I):g;if(tP(e))return AP(eP(e,I));throw new iP(IP(I)+" is not iterable")},nP=jg,Sr=re,oP=Kn,sP=function(I,g,e){var t,A;Sr(I);try{if(t=oP(I,"return"),!t){if(g==="throw")throw e;return e}t=nP(t,I)}catch(C){A=!0,t=C}if(g==="throw")throw e;if(A)throw t;return Sr(t),e},rP=aA,aP=jg,dP=re,lP=sA,hP=Q1,cP=Sg,kr=J,uP=$l,fP=Jl,Mr=sP,pP=TypeError,sI=function(I,g){this.stopped=I,this.result=g},Fr=sI.prototype,wo=function(I,g,e){var t=e&&e.that,A=!!(e&&e.AS_ENTRIES),C=!!(e&&e.IS_RECORD),i=!!(e&&e.IS_ITERATOR),n=!!(e&&e.INTERRUPTED),o=rP(g,t),s,r,a,d,l,h,c,p=function(m){return s&&Mr(s,"normal",m),new sI(!0,m)},u=function(m){return A?(dP(m),n?o(m[0],m[1],p):o(m[0],m[1])):n?o(m,p):o(m)};if(C)s=I.iterator;else if(i)s=I;else{if(r=fP(I),!r)throw new pP(lP(I)+" is not iterable");if(hP(r)){for(a=0,d=cP(I);d>a;a++)if(l=u(I[a]),l&&kr(Fr,l))return l;return new sI(!1)}s=uP(I,r)}for(h=C?I.next:s.next;!(c=aP(h,s)).done;){try{l=u(c.value)}catch(m){Mr(s,"throw",m)}if(typeof l=="object"&&l&&kr(Fr,l))return l}return new sI(!1)},mP=J,vP=TypeError,Eo=function(I,g){if(mP(g,I))return I;throw new vP("Incorrect invocation")},bP=R,yP=X,wP=nC,EP=z,TP=vt,xP=wo,OP=Eo,PP=lg,DP=cg,RP=ft,NP=bt,SP=Og.f,kP=Re.forEach,MP=ig,ql=Ke,FP=ql.set,BP=ql.getterFor,To=function(I,g,e){var t=I.indexOf("Map")!==-1,A=I.indexOf("Weak")!==-1,C=t?"set":"add",i=yP[I],n=i&&i.prototype,o={},s;if(!MP||!PP(i)||!(A||n.forEach&&!EP(function(){new i().entries().next()})))s=e.getConstructor(g,I,t,C),wP.enable();else{s=g(function(d,l){FP(OP(d,r),{type:I,collection:new i}),RP(l)||xP(l,d[C],{that:d,AS_ENTRIES:t})});var r=s.prototype,a=BP(I);kP(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(d){var l=d==="add"||d==="set";d in n&&!(A&&d==="clear")&&TP(r,d,function(h,c){var p=a(this).collection;if(!l&&A&&!DP(h))return d==="get"?void 0:!1;var u=p[d](h===0?0:h,c);return l?this:u})}),A||SP(r,"size",{configurable:!0,get:function(){return a(this).collection.size}})}return NP(s,I,!1,!0),o[I]=s,bP({global:!0,forced:!0},o),A||e.setStrong(s,I,t),s},zP=vA,xo=function(I,g,e){for(var t in g)e&&e.unsafe&&I[t]?I[t]=g[t]:zP(I,t,g[t],e);return I},ZP=Yg,LP=go,GP=gg,VP=ig,Br=GP("species"),jP=function(I){var g=ZP(I);VP&&g&&!g[Br]&&LP(g,Br,{configurable:!0,get:function(){return this}})},WP=pA,YP=go,zr=xo,_P=aA,KP=Eo,UP=ft,HP=wo,QP=io,QA=no,XP=jP,Nt=ig,Zr=nC.fastKey,gh=Ke,Lr=gh.set,$C=gh.getterFor,eh={getConstructor:function(I,g,e,t){var A=I(function(s,r){KP(s,C),Lr(s,{type:g,index:WP(null),first:void 0,last:void 0,size:0}),Nt||(s.size=0),UP(r)||HP(r,s[t],{that:s,AS_ENTRIES:e})}),C=A.prototype,i=$C(g),n=function(s,r,a){var d=i(s),l=o(s,r),h,c;return l?l.value=a:(d.last=l={index:c=Zr(r,!0),key:r,value:a,previous:h=d.last,next:void 0,removed:!1},d.first||(d.first=l),h&&(h.next=l),Nt?d.size++:s.size++,c!=="F"&&(d.index[c]=l)),s},o=function(s,r){var a=i(s),d=Zr(r),l;if(d!=="F")return a.index[d];for(l=a.first;l;l=l.next)if(l.key===r)return l};return zr(C,{clear:function(){for(var r=this,a=i(r),d=a.index,l=a.first;l;)l.removed=!0,l.previous&&(l.previous=l.previous.next=void 0),delete d[l.index],l=l.next;a.first=a.last=void 0,Nt?a.size=0:r.size=0},delete:function(s){var r=this,a=i(r),d=o(r,s);if(d){var l=d.next,h=d.previous;delete a.index[d.index],d.removed=!0,h&&(h.next=l),l&&(l.previous=h),a.first===d&&(a.first=l),a.last===d&&(a.last=h),Nt?a.size--:r.size--}return!!d},forEach:function(r){for(var a=i(this),d=_P(r,arguments.length>1?arguments[1]:void 0),l;l=l?l.next:a.first;)for(d(l.value,l.key,this);l&&l.removed;)l=l.previous},has:function(r){return!!o(this,r)}}),zr(C,e?{get:function(r){var a=o(this,r);return a&&a.value},set:function(r,a){return n(this,r===0?0:r,a)}}:{add:function(r){return n(this,r=r===0?0:r,r)}}),Nt&&YP(C,"size",{configurable:!0,get:function(){return i(this).size}}),A},setStrong:function(I,g,e){var t=g+" Iterator",A=$C(g),C=$C(t);QP(I,g,function(i,n){Lr(this,{type:t,target:i,state:A(i),kind:n,last:void 0})},function(){for(var i=C(this),n=i.kind,o=i.last;o&&o.removed;)o=o.previous;return!i.target||!(i.last=o=o?o.next:i.state.first)?(i.target=void 0,QA(void 0,!0)):QA(n==="keys"?o.key:n==="values"?o.value:[o.key,o.value],!1)},e?"entries":"values",!e,!0),XP(g)}},JP=To,$P=eh;JP("Map",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},$P);var Oo=Z,qP=_I,gD=qg,eD=CA,tD=Oo("".charAt),Gr=Oo("".charCodeAt),AD=Oo("".slice),Vr=function(I){return function(g,e){var t=gD(eD(g)),A=qP(e),C=t.length,i,n;return A<0||A>=C?I?"":void 0:(i=Gr(t,A),i<55296||i>56319||A+1===C||(n=Gr(t,A+1))<56320||n>57343?I?tD(t,A):i:I?AD(t,A,A+2):(i-55296<<10)+(n-56320)+65536)}},ID={codeAt:Vr(!1),charAt:Vr(!0)},CD=ID.charAt,iD=qg,th=Ke,nD=io,jr=no,Ah="String Iterator",oD=th.set,sD=th.getterFor(Ah);nD(String,"String",function(I){oD(this,{type:Ah,string:iD(I),index:0})},function(){var g=sD(this),e=g.string,t=g.index,A;return t>=e.length?jr(void 0,!0):(A=CD(e,t),g.index+=A.length,jr(A,!1))});var rD=L,aD=rD.Map,dD=aD,lD=dD,hD=lD,RA=D(hD),Wi=class{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},q(this.options,this.defaultOptions)}setOptions(g){let e=["useDefaultGroups"];if(g!==void 0){for(let t in g)if(Object.prototype.hasOwnProperty.call(g,t)&&G(e).call(e,t)===-1){let A=g[t];this.add(t,A)}}}clear(){this._groups=new RA,this._groupNames=[]}get(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this._groups.get(g);if(t===void 0&&e)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){let A=this._groupIndex%this._groupNames.length;++this._groupIndex,t={},t.color=this._groups.get(this._groupNames[A]),this._groups.set(g,t)}else{let A=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,t={},t.color=this._defaultGroups[A],this._groups.set(g,t)}return t}add(g,e){return this._groups.has(g)||this._groupNames.push(g),this._groups.set(g,e),e}},cD=R;cD({target:"Number",stat:!0},{isNaN:function(g){return g!==g}});var uD=L,fD=uD.Number.isNaN,pD=fD,mD=pD,vD=mD,Yi=D(vD),bD=X,yD=bD.isFinite,wD=Number.isFinite||function(g){return typeof g=="number"&&yD(g)},ED=R,TD=wD;ED({target:"Number",stat:!0},{isFinite:TD});var xD=L,OD=xD.Number.isFinite,PD=OD,DD=PD,RD=DD,Me=D(RD),ND=R,SD=Re.some,kD=wt,MD=kD("some");ND({target:"Array",proto:!0,forced:!MD},{some:function(g){return SD(this,g,arguments.length>1?arguments[1]:void 0)}});var FD=Ig,BD=FD("Array").some,zD=J,ZD=BD,qC=Array.prototype,LD=function(I){var g=I.some;return I===qC||zD(qC,I)&&g===qC.some?ZD:g},GD=LD,VD=GD,jD=VD,Ih=D(jD),WD=L,YD=WD.Object.getOwnPropertySymbols,_D=YD,KD=_D,UD=KD,Xg=D(UD),Ch={exports:{}},HD=R,QD=z,XD=Wg,ih=tA.f,nh=ig,JD=!nh||QD(function(){ih(1)});HD({target:"Object",stat:!0,forced:JD,sham:!nh},{getOwnPropertyDescriptor:function(g,e){return ih(XD(g),e)}});var $D=L,oh=$D.Object,qD=Ch.exports=function(g,e){return oh.getOwnPropertyDescriptor(g,e)};oh.getOwnPropertyDescriptor.sham&&(qD.sham=!0);var g2=Ch.exports,e2=g2,t2=e2,A2=t2,ge=D(A2),I2=R,C2=ig,i2=_d,n2=Wg,o2=tA,s2=uA;I2({target:"Object",stat:!0,sham:!C2},{getOwnPropertyDescriptors:function(g){for(var e=n2(g),t=o2.f,A=i2(e),C={},i=0,n,o;A.length>i;)o=t(e,n=A[i++]),o!==void 0&&s2(C,n,o);return C}});var r2=L,a2=r2.Object.getOwnPropertyDescriptors,d2=a2,l2=d2,h2=l2,Jg=D(h2),sh={exports:{}},c2=R,u2=ig,Wr=HI.f;c2({target:"Object",stat:!0,forced:Object.defineProperties!==Wr,sham:!u2},{defineProperties:Wr});var f2=L,rh=f2.Object,p2=sh.exports=function(g,e){return rh.defineProperties(g,e)};rh.defineProperties.sham&&(p2.sham=!0);var m2=sh.exports,v2=m2,b2=v2,y2=b2,NA=D(y2),ah={exports:{}},w2=R,E2=ig,Yr=Og.f;w2({target:"Object",stat:!0,forced:Object.defineProperty!==Yr,sham:!E2},{defineProperty:Yr});var T2=L,dh=T2.Object,x2=ah.exports=function(g,e,t){return dh.defineProperty(g,e,t)};dh.defineProperty.sham&&(x2.sham=!0);var O2=ah.exports,P2=O2,lh=P2,D2=lh,R2=D2,N2=R2,S2=N2,k2=S2,M2=D(k2),F2=gg,B2=Og.f,_r=F2("metadata"),Kr=Function.prototype;Kr[_r]===void 0&&B2(Kr,_r,{value:null});var z2=$;z2("asyncDispose");var Z2=$;Z2("dispose");var L2=$;L2("metadata");var G2=Yd,V2=G2,j2=Yg,W2=Z,Po=j2("Symbol"),Y2=Po.keyFor,_2=W2(Po.prototype.valueOf),hh=Po.isRegisteredSymbol||function(g){try{return Y2(_2(g))!==void 0}catch(e){return!1}},K2=R,U2=hh;K2({target:"Symbol",stat:!0},{isRegisteredSymbol:U2});var H2=mt,ch=Yg,Q2=Z,X2=oA,J2=gg,wI=ch("Symbol"),Ur=wI.isWellKnownSymbol,uh=ch("Object","getOwnPropertyNames"),$2=Q2(wI.prototype.valueOf),Hr=H2("wks");for(XA=0,gi=uh(wI),Qr=gi.length;XA<Qr;XA++)try{ei=gi[XA],X2(wI[ei])&&J2(ei)}catch(I){}var ei,XA,gi,Qr,fh=function(g){if(Ur&&Ur(g))return!0;try{for(var e=$2(g),t=0,A=uh(Hr),C=A.length;t<C;t++)if(Hr[A[t]]==e)return!0}catch(i){}return!1},q2=R,gR=fh;q2({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:gR});var eR=$;eR("matcher");var tR=$;tR("observable");var AR=R,IR=hh;AR({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:IR});var CR=R,iR=fh;CR({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:iR});var nR=$;nR("metadataKey");var oR=$;oR("patternMatch");var sR=$;sR("replaceAll");var rR=V2,aR=rR,dR=aR,JA=D(dR),lR=bA,hR=lR.f("iterator"),cR=hR,ph=cR,uR=ph,fR=uR,pR=fR,mR=pR,vR=mR,bR=D(vR);function $t(I){"@babel/helpers - typeof";return $t=typeof JA=="function"&&typeof bR=="symbol"?function(g){return typeof g}:function(g){return g&&typeof JA=="function"&&g.constructor===JA&&g!==JA.prototype?"symbol":typeof g},$t(I)}var yR=bA,wR=yR.f("toPrimitive"),ER=wR,TR=ER,xR=TR,OR=xR,PR=OR,DR=PR,RR=DR,NR=D(RR);function SR(I,g){if($t(I)!=="object"||I===null)return I;var e=I[NR];if(e!==void 0){var t=e.call(I,g||"default");if($t(t)!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(I)}function kR(I){var g=SR(I,"string");return $t(g)==="symbol"?g:String(g)}function eg(I,g,e){return g=kR(g),g in I?M2(I,g,{value:e,enumerable:!0,configurable:!0,writable:!0}):I[g]=e,I}var MR=Ye,FR=xg,BR=jI,zR=Sg,ZR=TypeError,Xr=function(I){return function(g,e,t,A){MR(e);var C=FR(g),i=BR(C),n=zR(C),o=I?n-1:0,s=I?-1:1;if(t<2)for(;;){if(o in i){A=i[o],o+=s;break}if(o+=s,I?o<0:n<=o)throw new ZR("Reduce of empty array with no initial value")}for(;I?o>=0:n>o;o+=s)o in i&&(A=e(A,i[o],o,C));return A}},LR={left:Xr(!1),right:Xr(!0)},GR=X,VR=se,jR=VR(GR.process)==="process",WR=R,YR=LR.left,_R=wt,Jr=nA,KR=jR,UR=!KR&&Jr>79&&Jr<83,HR=UR||!_R("reduce");WR({target:"Array",proto:!0,forced:HR},{reduce:function(g){var e=arguments.length;return YR(this,g,e,e>1?arguments[1]:void 0)}});var QR=Ig,XR=QR("Array").reduce,JR=J,$R=XR,ti=Array.prototype,qR=function(I){var g=I.reduce;return I===ti||JR(ti,I)&&g===ti.reduce?$R:g},gN=qR,eN=gN,tN=eN,Do=D(tN),AN=De,IN=Sg,CN=Jn,iN=aA,mh=function(I,g,e,t,A,C,i,n){for(var o=A,s=0,r=i?iN(i,n):!1,a,d;s<t;)s in e&&(a=r?r(e[s],s,g):e[s],C>0&&AN(a)?(d=IN(a),o=mh(I,g,a,d,o,C-1)-1):(CN(o+1),I[o]=a),o++),s++;return o},nN=mh,oN=R,sN=nN,rN=Ye,aN=xg,dN=Sg,lN=UI;oN({target:"Array",proto:!0},{flatMap:function(g){var e=aN(this),t=dN(e),A;return rN(g),A=lN(e,0),A.length=sN(A,e,e,t,0,1,g,arguments.length>1?arguments[1]:void 0),A}});var hN=Ig,$M=hN("Array").flatMap;var qM=Array.prototype;var cN=ph,nt=D(cN),uN=To,fN=eh;uN("Set",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},fN);var pN=L,mN=pN.Set,vN=mN,bN=vN,yN=bN,Lg=D(yN),wN=$l,EN=wN,TN=EN,xN=TN,ON=xN,PN=ON,DN=PN,RN=DN,NN=RN,SN=NN,Ai=D(SN),$r=od,kN=Math.floor,_i=function(I,g){var e=I.length,t=kN(e/2);return e<8?MN(I,g):FN(I,_i($r(I,0,t),g),_i($r(I,t),g),g)},MN=function(I,g){for(var e=I.length,t=1,A,C;t<e;){for(C=t,A=I[t];C&&g(I[C-1],A)>0;)I[C]=I[--C];C!==t++&&(I[C]=A)}return I},FN=function(I,g,e,t){for(var A=g.length,C=e.length,i=0,n=0;i<A||n<C;)I[i+n]=i<A&&n<C?t(g[i],e[n])<=0?g[i++]:e[n++]:i<A?g[i++]:e[n++];return I},BN=_i,zN=iA,qr=zN.match(/firefox\/(\d+)/i),ZN=!!qr&&+qr[1],LN=iA,GN=/MSIE|Trident/.test(LN),VN=iA,ga=VN.match(/AppleWebKit\/(\d+)\./),jN=!!ga&&+ga[1],WN=R,vh=Z,YN=Ye,_N=xg,ea=Sg,KN=Hd,ta=qg,Ro=z,UN=BN,HN=wt,Aa=ZN,QN=GN,Ia=nA,Ca=jN,ve=[],ia=vh(ve.sort),XN=vh(ve.push),JN=Ro(function(){ve.sort(void 0)}),$N=Ro(function(){ve.sort(null)}),qN=HN("sort"),bh=!Ro(function(){if(Ia)return Ia<70;if(!(Aa&&Aa>3)){if(QN)return!0;if(Ca)return Ca<603;var I="",g,e,t,A;for(g=65;g<76;g++){switch(e=String.fromCharCode(g),g){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(A=0;A<47;A++)ve.push({k:e+A,v:t})}for(ve.sort(function(C,i){return i.v-C.v}),A=0;A<ve.length;A++)e=ve[A].k.charAt(0),I.charAt(I.length-1)!==e&&(I+=e);return I!=="DGBEFHACIJK"}}),gS=JN||!$N||!qN||!bh,eS=function(I){return function(g,e){return e===void 0?-1:g===void 0?1:I!==void 0?+I(g,e)||0:ta(g)>ta(e)?1:-1}};WN({target:"Array",proto:!0,forced:gS},{sort:function(g){g!==void 0&&YN(g);var e=_N(this);if(bh)return g===void 0?ia(e):ia(e,g);var t=[],A=ea(e),C,i;for(i=0;i<A;i++)i in e&&XN(t,e[i]);for(UN(t,eS(g)),C=ea(t),i=0;i<C;)e[i]=t[i++];for(;i<A;)KN(e,i++);return e}});var tS=Ig,AS=tS("Array").sort,IS=J,CS=AS,Ii=Array.prototype,iS=function(I){var g=I.sort;return I===Ii||IS(Ii,I)&&g===Ii.sort?CS:g},nS=iS,oS=nS,sS=oS,Ce=D(sS),rS=Ig,aS=rS("Array").keys,dS=aS,lS=dS,hS=ae,cS=ng,uS=J,fS=lS,Ci=Array.prototype,pS={DOMTokenList:!0,NodeList:!0},mS=function(I){var g=I.keys;return I===Ci||uS(Ci,I)&&g===Ci.keys||cS(pS,hS(I))?fS:g},vS=mS,tt=D(vS),bS=Ig,yS=bS("Array").values,wS=yS,ES=wS,TS=ae,xS=ng,OS=J,PS=ES,ii=Array.prototype,DS={DOMTokenList:!0,NodeList:!0},RS=function(I){var g=I.values;return I===ii||OS(ii,I)&&g===ii.values||xS(DS,TS(I))?PS:g},NS=RS,EI=D(NS),SS=Ig,kS=SS("Array").entries,MS=kS,FS=MS,BS=ae,zS=ng,ZS=J,LS=FS,ni=Array.prototype,GS={DOMTokenList:!0,NodeList:!0},VS=function(I){var g=I.entries;return I===ni||ZS(ni,I)&&g===ni.entries||zS(GS,BS(I))?LS:g},jS=VS,WS=D(jS),YS=lh,SA=D(YS),$A,_S=new Uint8Array(16);function KS(){if(!$A&&($A=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!$A))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return $A(_S)}var rg=[];for(let I=0;I<256;++I)rg.push((I+256).toString(16).slice(1));function US(I,g=0){return rg[I[g+0]]+rg[I[g+1]]+rg[I[g+2]]+rg[I[g+3]]+"-"+rg[I[g+4]]+rg[I[g+5]]+"-"+rg[I[g+6]]+rg[I[g+7]]+"-"+rg[I[g+8]]+rg[I[g+9]]+"-"+rg[I[g+10]]+rg[I[g+11]]+rg[I[g+12]]+rg[I[g+13]]+rg[I[g+14]]+rg[I[g+15]]}var HS=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),na={randomUUID:HS};function st(I,g,e){if(na.randomUUID&&!g&&!I)return na.randomUUID();I=I||{};let t=I.random||(I.rng||KS)();if(t[6]=t[6]&15|64,t[8]=t[8]&63|128,g){e=e||0;for(let A=0;A<16;++A)g[e+A]=t[A];return g}return US(t)}function oa(I,g){var e=U(I);if(Xg){var t=Xg(I);g&&(t=tg(t).call(t,function(A){return ge(I,A).enumerable})),e.push.apply(e,t)}return e}function sa(I){for(var g=1;g<arguments.length;g++){var e,t,A=arguments[g]!=null?arguments[g]:{};g%2?F(e=oa(Object(A),!0)).call(e,function(C){eg(I,C,A[C])}):Jg?NA(I,Jg(A)):F(t=oa(Object(A))).call(t,function(C){SA(I,C,ge(A,C))})}return I}function ra(I){return typeof I=="string"||typeof I=="number"}var Ki=class I{constructor(g){eg(this,"delay",void 0),eg(this,"max",void 0),eg(this,"_queue",[]),eg(this,"_timeout",null),eg(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(g)}setOptions(g){g&&typeof g.delay!="undefined"&&(this.delay=g.delay),g&&typeof g.max!="undefined"&&(this.max=g.max),this._flushIfNeeded()}static extend(g,e){let t=new I(e);if(g.flush!==void 0)throw new Error("Target object already has a property flush");g.flush=()=>{t.flush()};let A=[{name:"flush",original:void 0}];if(e&&e.replace)for(let C=0;C<e.replace.length;C++){let i=e.replace[C];A.push({name:i,original:g[i]}),t.replace(g,i)}return t._extended={object:g,methods:A},t}destroy(){if(this.flush(),this._extended){let g=this._extended.object,e=this._extended.methods;for(let t=0;t<e.length;t++){let A=e[t];A.original?g[A.name]=A.original:delete g[A.name]}this._extended=null}}replace(g,e){let t=this,A=g[e];if(!A)throw new Error("Method "+e+" undefined");g[e]=function(){for(var C=arguments.length,i=new Array(C),n=0;n<C;n++)i[n]=arguments[n];t.queue({args:i,fn:A,context:this})}}queue(g){typeof g=="function"?this._queue.push({fn:g}):this._queue.push(g),this._flushIfNeeded()}_flushIfNeeded(){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=Hg(()=>{this.flush()},this.delay))}flush(){var g,e;F(g=Ug(e=this._queue).call(e,0)).call(g,t=>{t.fn.apply(t.context||t.fn,t.args||[])})}},Ui=class I{constructor(){eg(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),eg(this,"subscribe",I.prototype.on),eg(this,"unsubscribe",I.prototype.off)}_trigger(g,e,t){var A;if(g==="*")throw new Error("Cannot trigger event *");F(A=[...this._subscribers[g],...this._subscribers["*"]]).call(A,C=>{C(g,e,t!=null?t:null)})}on(g,e){typeof e=="function"&&this._subscribers[g].push(e)}off(g,e){var t;this._subscribers[g]=tg(t=this._subscribers[g]).call(t,A=>A!==e)}},TI=class I{constructor(g){eg(this,"_pairs",void 0),this._pairs=g}*[nt](){for(let[g,e]of this._pairs)yield[g,e]}*entries(){for(let[g,e]of this._pairs)yield[g,e]}*keys(){for(let[g]of this._pairs)yield g}*values(){for(let[,g]of this._pairs)yield g}toIdArray(){var g;return ag(g=[...this._pairs]).call(g,e=>e[0])}toItemArray(){var g;return ag(g=[...this._pairs]).call(g,e=>e[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let g=we(null);for(let[e,t]of this._pairs)g[e]=t;return g}toMap(){return new RA(this._pairs)}toIdSet(){return new Lg(this.toIdArray())}toItemSet(){return new Lg(this.toItemArray())}cache(){return new I([...this._pairs])}distinct(g){let e=new Lg;for(let[t,A]of this._pairs)e.add(g(A,t));return e}filter(g){let e=this._pairs;return new I({*[nt](){for(let[t,A]of e)g(A,t)&&(yield[t,A])}})}forEach(g){for(let[e,t]of this._pairs)g(t,e)}map(g){let e=this._pairs;return new I({*[nt](){for(let[t,A]of e)yield[t,g(A,t)]}})}max(g){let e=Ai(this._pairs),t=e.next();if(t.done)return null;let A=t.value[1],C=g(t.value[1],t.value[0]);for(;!(t=e.next()).done;){let[i,n]=t.value,o=g(n,i);o>C&&(C=o,A=n)}return A}min(g){let e=Ai(this._pairs),t=e.next();if(t.done)return null;let A=t.value[1],C=g(t.value[1],t.value[0]);for(;!(t=e.next()).done;){let[i,n]=t.value,o=g(n,i);o<C&&(C=o,A=n)}return A}reduce(g,e){for(let[t,A]of this._pairs)e=g(e,A,t);return e}sort(g){return new I({[nt]:()=>{var e;return Ai(Ce(e=[...this._pairs]).call(e,(t,A)=>{let[C,i]=t,[n,o]=A;return g(i,o,C,n)}))}})}};function QS(I,g){return I[g]==null&&(I[g]=st()),I}var Pe=class extends Ui{get idProp(){return this._idProp}constructor(g,e){super(),eg(this,"flush",void 0),eg(this,"length",void 0),eg(this,"_options",void 0),eg(this,"_data",void 0),eg(this,"_idProp",void 0),eg(this,"_queue",null),g&&!B(g)&&(e=g,g=[]),this._options=e||{},this._data=new RA,this.length=0,this._idProp=this._options.fieldId||"id",g&&g.length&&this.add(g),this.setOptions(e)}setOptions(g){g&&g.queue!==void 0&&(g.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=Ki.extend(this,{replace:["add","update","remove"]})),g.queue&&typeof g.queue=="object"&&this._queue.setOptions(g.queue)))}add(g,e){let t=[],A;if(B(g)){let C=ag(g).call(g,i=>i[this._idProp]);if(Ih(C).call(C,i=>this._data.has(i)))throw new Error("A duplicate id was found in the parameter array.");for(let i=0,n=g.length;i<n;i++)A=this._addItem(g[i]),t.push(A)}else if(g&&typeof g=="object")A=this._addItem(g),t.push(A);else throw new Error("Unknown dataType");return t.length&&this._trigger("add",{items:t},e),t}update(g,e){let t=[],A=[],C=[],i=[],n=this._idProp,o=s=>{let r=s[n];if(r!=null&&this._data.has(r)){let a=s,d=q({},this._data.get(r)),l=this._updateItem(a);A.push(l),i.push(a),C.push(d)}else{let a=this._addItem(s);t.push(a)}};if(B(g))for(let s=0,r=g.length;s<r;s++)g[s]&&typeof g[s]=="object"?o(g[s]):console.warn("Ignoring input item, which is not an object at index "+s);else if(g&&typeof g=="object")o(g);else throw new Error("Unknown dataType");if(t.length&&this._trigger("add",{items:t},e),A.length){let s={items:A,oldData:C,data:i};this._trigger("update",s,e)}return Xd(t).call(t,A)}updateOnly(g,e){var t;B(g)||(g=[g]);let A=ag(t=ag(g).call(g,C=>{let i=this._data.get(C[this._idProp]);if(i==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:i,update:C}})).call(t,C=>{let{oldData:i,update:n}=C,o=i[this._idProp],s=PO(i,n);return this._data.set(o,s),{id:o,oldData:i,updatedData:s}});if(A.length){let C={items:ag(A).call(A,i=>i.id),oldData:ag(A).call(A,i=>i.oldData),data:ag(A).call(A,i=>i.updatedData)};return this._trigger("update",C,e),C.items}else return[]}get(g,e){let t,A,C;ra(g)?(t=g,C=e):B(g)?(A=g,C=e):C=g;let i=C&&C.returnType==="Object"?"Object":"Array",n=C&&tg(C),o=[],s,r,a;if(t!=null)s=this._data.get(t),s&&n&&!n(s)&&(s=void 0);else if(A!=null)for(let h=0,c=A.length;h<c;h++)s=this._data.get(A[h]),s!=null&&(!n||n(s))&&o.push(s);else{var d;r=[...tt(d=this._data).call(d)];for(let h=0,c=r.length;h<c;h++)a=r[h],s=this._data.get(a),s!=null&&(!n||n(s))&&o.push(s)}if(C&&C.order&&t==null&&this._sort(o,C.order),C&&C.fields){let h=C.fields;if(t!=null&&s!=null)s=this._filterFields(s,h);else for(let c=0,p=o.length;c<p;c++)o[c]=this._filterFields(o[c],h)}if(i=="Object"){let h={};for(let c=0,p=o.length;c<p;c++){let u=o[c],m=u[this._idProp];h[m]=u}return h}else if(t!=null){var l;return(l=s)!==null&&l!==void 0?l:null}else return o}getIds(g){let e=this._data,t=g&&tg(g),A=g&&g.order,C=[...tt(e).call(e)],i=[];if(t)if(A){let n=[];for(let o=0,s=C.length;o<s;o++){let r=C[o],a=this._data.get(r);a!=null&&t(a)&&n.push(a)}this._sort(n,A);for(let o=0,s=n.length;o<s;o++)i.push(n[o][this._idProp])}else for(let n=0,o=C.length;n<o;n++){let s=C[n],r=this._data.get(s);r!=null&&t(r)&&i.push(r[this._idProp])}else if(A){let n=[];for(let o=0,s=C.length;o<s;o++){let r=C[o];n.push(e.get(r))}this._sort(n,A);for(let o=0,s=n.length;o<s;o++)i.push(n[o][this._idProp])}else for(let n=0,o=C.length;n<o;n++){let s=C[n],r=e.get(s);r!=null&&i.push(r[this._idProp])}return i}getDataSet(){return this}forEach(g,e){let t=e&&tg(e),A=this._data,C=[...tt(A).call(A)];if(e&&e.order){let i=this.get(e);for(let n=0,o=i.length;n<o;n++){let s=i[n],r=s[this._idProp];g(s,r)}}else for(let i=0,n=C.length;i<n;i++){let o=C[i],s=this._data.get(o);s!=null&&(!t||t(s))&&g(s,o)}}map(g,e){let t=e&&tg(e),A=[],C=this._data,i=[...tt(C).call(C)];for(let n=0,o=i.length;n<o;n++){let s=i[n],r=this._data.get(s);r!=null&&(!t||t(r))&&A.push(g(r,s))}return e&&e.order&&this._sort(A,e.order),A}_filterFields(g,e){var t;return g&&Do(t=B(e)?e:U(e)).call(t,(A,C)=>(A[C]=g[C],A),{})}_sort(g,e){if(typeof e=="string"){let t=e;Ce(g).call(g,(A,C)=>{let i=A[t],n=C[t];return i>n?1:i<n?-1:0})}else if(typeof e=="function")Ce(g).call(g,e);else throw new TypeError("Order must be a function or a string")}remove(g,e){let t=[],A=[],C=B(g)?g:[g];for(let i=0,n=C.length;i<n;i++){let o=this._remove(C[i]);if(o){let s=o[this._idProp];s!=null&&(t.push(s),A.push(o))}}return t.length&&this._trigger("remove",{items:t,oldData:A},e),t}_remove(g){let e;if(ra(g)?e=g:g&&typeof g=="object"&&(e=g[this._idProp]),e!=null&&this._data.has(e)){let t=this._data.get(e)||null;return this._data.delete(e),--this.length,t}return null}clear(g){var e;let t=[...tt(e=this._data).call(e)],A=[];for(let C=0,i=t.length;C<i;C++)A.push(this._data.get(t[C]));return this._data.clear(),this.length=0,this._trigger("remove",{items:t,oldData:A},g),t}max(g){let e=null,t=null;for(let C of EI(A=this._data).call(A)){var A;let i=C[g];typeof i=="number"&&(t==null||i>t)&&(e=C,t=i)}return e||null}min(g){let e=null,t=null;for(let C of EI(A=this._data).call(A)){var A;let i=C[g];typeof i=="number"&&(t==null||i<t)&&(e=C,t=i)}return e||null}distinct(g){let e=this._data,t=[...tt(e).call(e)],A=[],C=0;for(let i=0,n=t.length;i<n;i++){let o=t[i],r=e.get(o)[g],a=!1;for(let d=0;d<C;d++)if(A[d]==r){a=!0;break}!a&&r!==void 0&&(A[C]=r,C++)}return A}_addItem(g){let e=QS(g,this._idProp),t=e[this._idProp];if(this._data.has(t))throw new Error("Cannot add item: item with id "+t+" already exists");return this._data.set(t,e),++this.length,t}_updateItem(g){let e=g[this._idProp];if(e==null)throw new Error("Cannot update item: item has no id (item: "+Et(g)+")");let t=this._data.get(e);if(!t)throw new Error("Cannot update item: no item with id "+e+" found");return this._data.set(e,sa(sa({},t),g)),e}stream(g){if(g){let t=this._data;return new TI({*[nt](){for(let A of g){let C=t.get(A);C!=null&&(yield[A,C])}}})}else{var e;return new TI({[nt]:b(e=WS(this._data)).call(e,this._data)})}}};function XS(I,g){return typeof g=="object"&&g!==null&&I===g.idProp&&typeof g.add=="function"&&typeof g.clear=="function"&&typeof g.distinct=="function"&&typeof F(g)=="function"&&typeof g.get=="function"&&typeof g.getDataSet=="function"&&typeof g.getIds=="function"&&typeof g.length=="number"&&typeof ag(g)=="function"&&typeof g.max=="function"&&typeof g.min=="function"&&typeof g.off=="function"&&typeof g.on=="function"&&typeof g.remove=="function"&&typeof g.setOptions=="function"&&typeof g.stream=="function"&&typeof g.update=="function"&&typeof g.updateOnly=="function"}function yh(I,g){return typeof g=="object"&&g!==null&&I===g.idProp&&typeof F(g)=="function"&&typeof g.get=="function"&&typeof g.getDataSet=="function"&&typeof g.getIds=="function"&&typeof g.length=="number"&&typeof ag(g)=="function"&&typeof g.off=="function"&&typeof g.on=="function"&&typeof g.stream=="function"&&XS(I,g.getDataSet())}var wh=X,JS=z,$S=Z,qS=qg,gk=gl.trim,ek=oo,tk=$S("".charAt),xI=wh.parseFloat,aa=wh.Symbol,da=aa&&aa.iterator,Ak=1/xI(ek+"-0")!==-1/0||da&&!JS(function(){xI(Object(da))}),Ik=Ak?function(g){var e=gk(qS(g)),t=xI(e);return t===0&&tk(e,0)==="-"?-0:t}:xI,Ck=R,la=Ik;Ck({global:!0,forced:parseFloat!==la},{parseFloat:la});var ik=L,nk=ik.parseFloat,ok=nk,sk=ok,rk=sk,Eh=D(rk),ak=R,dk=z,lk=XI.f,hk=dk(function(){return!Object.getOwnPropertyNames(1)});ak({target:"Object",stat:!0,forced:hk},{getOwnPropertyNames:lk});var ck=L,uk=ck.Object,fk=function(g){return uk.getOwnPropertyNames(g)},pk=fk,mk=pk,vk=mk,bk=D(vk);function No(I,g){let e=["node","edge","label"],t=!0,A=fe(g,"chosen");if(typeof A=="boolean")t=A;else if(typeof A=="object"){if(G(e).call(e,I)===-1)throw new Error("choosify: subOption '"+I+"' should be one of '"+e.join("', '")+"'");let C=fe(g,["chosen",I]);(typeof C=="boolean"||typeof C=="function")&&(t=C)}return t}function Hi(I,g,e){if(I.width<=0||I.height<=0)return!1;if(e!==void 0){let C={x:g.x-e.x,y:g.y-e.y};if(e.angle!==0){let i=-e.angle;g={x:Math.cos(i)*C.x-Math.sin(i)*C.y,y:Math.sin(i)*C.x+Math.cos(i)*C.y}}else g=C}let t=I.x+I.width,A=I.y+I.width;return I.left<g.x&&t>g.x&&I.top<g.y&&A>g.y}function OI(I){return typeof I=="string"&&I!==""}function Th(I,g,e,t){let A=t.x,C=t.y;if(typeof t.distanceToBorder=="function"){let i=t.distanceToBorder(I,g),n=Math.sin(g)*i,o=Math.cos(g)*i;o===i?(A+=i,C=t.y):n===i?(A=t.x,C-=i):(A+=o,C-=n)}else t.shape.width>t.shape.height?(A=t.x+t.shape.width*.5,C=t.y-e):(A=t.x+e,C=t.y-t.shape.height*.5);return{x:A,y:C}}var Qi=class{constructor(g){this.measureText=g,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(g,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[g]===void 0&&(this.lines[g]={width:0,height:0,blocks:[]});let A=e;(e===void 0||e==="")&&(A=" ");let C=this.measureText(A,t),i=q({},EI(C));i.text=e,i.width=C.width,i.mod=t,(e===void 0||e==="")&&(i.width=0),this.lines[g].blocks.push(i),this.lines[g].width+=i.width}curWidth(){let g=this.lines[this.current];return g===void 0?0:g.width}append(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,g,e)}newLine(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,g,e),this.current++}determineLineHeights(){for(let g=0;g<this.lines.length;g++){let e=this.lines[g],t=0;if(e.blocks!==void 0)for(let A=0;A<e.blocks.length;A++){let C=e.blocks[A];t<C.height&&(t=C.height)}e.height=t}}determineLabelSize(){let g=0,e=0;for(let t=0;t<this.lines.length;t++){let A=this.lines[t];A.width>g&&(g=A.width),e+=A.height}this.width=g,this.height=e}removeEmptyBlocks(){let g=[];for(let e=0;e<this.lines.length;e++){let t=this.lines[e];if(t.blocks.length===0||e===this.lines.length-1&&t.width===0)continue;let A={};q(A,t),A.blocks=[];let C,i=[];for(let n=0;n<t.blocks.length;n++){let o=t.blocks[n];o.width!==0?i.push(o):C===void 0&&(C=o)}i.length===0&&C!==void 0&&i.push(C),A.blocks=i,g.push(A)}return g}finalize(){this.determineLineHeights(),this.determineLabelSize();let g=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:g}}},yk={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},PI=class{constructor(g){this.text=g,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(g){g===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),g!=" "&&(this.buffer+=g)}parseWS(g){return/[ \t]/.test(g)?(this.mono?this.add(g):this.spacing=!0,!0):!1}setTag(g){this.emitBlock(),this[g]=!0,this.modStack.unshift(g)}unsetTag(g){this.emitBlock(),this[g]=!1,this.modStack.shift()}parseStartTag(g,e){return!this.mono&&!this[g]&&this.match(e)?(this.setTag(g),!0):!1}match(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,[t,A]=this.prepareRegExp(g),C=t.test(this.text.substr(this.position,A));return C&&e&&(this.position+=A-1),C}parseEndTag(g,e,t){let A=this.mod()===g;return g==="mono"?A=A&&this.mono:A=A&&!this.mono,A&&this.match(e)?(t!==void 0?(this.position===this.text.length-1||this.match(t,!1))&&this.unsetTag(g):this.unsetTag(g),!0):!1}replace(g,e){return this.match(g)?(this.add(e),this.position+=length-1,!0):!1}prepareRegExp(g){let e,t;if(g instanceof RegExp)t=g,e=1;else{let A=yk[g];A!==void 0?t=A:t=new RegExp(g),e=g.length}return[t,e]}},Xi=class{constructor(g,e,t,A){this.ctx=g,this.parent=e,this.selected=t,this.hover=A;let C=(i,n)=>{if(i===void 0)return 0;let o=this.parent.getFormattingValues(g,t,A,n),s=0;return i!==""&&(s=this.ctx.measureText(i).width),{width:s,values:o}};this.lines=new Qi(C)}process(g){if(!OI(g))return this.lines.finalize();let e=this.parent.fontOptions;g=g.replace(/\r\n/g,`
651
- `),g=g.replace(/\r/g,`
652
- `);let t=String(g).split(`
653
- `),A=t.length;if(e.multi)for(let C=0;C<A;C++){let i=this.splitBlocks(t[C],e.multi);if(i!==void 0){if(i.length===0){this.lines.newLine("");continue}if(e.maxWdt>0)for(let n=0;n<i.length;n++){let o=i[n].mod,s=i[n].text;this.splitStringIntoLines(s,o,!0)}else for(let n=0;n<i.length;n++){let o=i[n].mod,s=i[n].text;this.lines.append(s,o)}this.lines.newLine()}}else if(e.maxWdt>0)for(let C=0;C<A;C++)this.splitStringIntoLines(t[C]);else for(let C=0;C<A;C++)this.lines.newLine(t[C]);return this.lines.finalize()}decodeMarkupSystem(g){let e="none";return g==="markdown"||g==="md"?e="markdown":(g===!0||g==="html")&&(e="html"),e}splitHtmlBlocks(g){let e=new PI(g),t=A=>/&/.test(A)?(e.replace(e.text,"&lt;","<")||e.replace(e.text,"&amp;","&")||e.add("&"),!0):!1;for(;e.position<e.text.length;){let A=e.text.charAt(e.position);e.parseWS(A)||/</.test(A)&&(e.parseStartTag("bold","<b>")||e.parseStartTag("ital","<i>")||e.parseStartTag("mono","<code>")||e.parseEndTag("bold","</b>")||e.parseEndTag("ital","</i>")||e.parseEndTag("mono","</code>"))||t(A)||e.add(A),e.position++}return e.emitBlock(),e.blocks}splitMarkdownBlocks(g){let e=new PI(g),t=!0,A=C=>/\\/.test(C)?(e.position<this.text.length+1&&(e.position++,C=this.text.charAt(e.position),/ \t/.test(C)?e.spacing=!0:(e.add(C),t=!1)),!0):!1;for(;e.position<e.text.length;){let C=e.text.charAt(e.position);e.parseWS(C)||A(C)||(t||e.spacing)&&(e.parseStartTag("bold","*")||e.parseStartTag("ital","_")||e.parseStartTag("mono","`"))||e.parseEndTag("bold","*","afterBold")||e.parseEndTag("ital","_","afterItal")||e.parseEndTag("mono","`","afterMono")||(e.add(C),t=!1),e.position++}return e.emitBlock(),e.blocks}splitBlocks(g,e){let t=this.decodeMarkupSystem(e);if(t==="none")return[{text:g,mod:"normal"}];if(t==="markdown")return this.splitMarkdownBlocks(g);if(t==="html")return this.splitHtmlBlocks(g)}overMaxWidth(g){let e=this.ctx.measureText(g).width;return this.lines.curWidth()+e>this.parent.fontOptions.maxWdt}getLongestFit(g){let e="",t=0;for(;t<g.length;){let C=e+(e===""?"":" ")+g[t];if(this.overMaxWidth(C))break;e=C,t++}return t}getLongestFitWord(g){let e=0;for(;e<g.length&&!this.overMaxWidth(Zg(g).call(g,0,e));)e++;return e}splitStringIntoLines(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,e),g=g.replace(/^( +)/g,"$1\r"),g=g.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let A=g.split("\r");for(;A.length>0;){let C=this.getLongestFit(A);if(C===0){let i=A[0],n=this.getLongestFitWord(i);this.lines.newLine(Zg(i).call(i,0,n),e),A[0]=Zg(i).call(i,n)}else{let i=C;A[C-1]===" "?C--:A[i]===" "&&i++;let n=Zg(A).call(A,0,C).join("");C==A.length&&t?this.lines.append(n,e):this.lines.newLine(n,e),A=Zg(A).call(A,i)}}}},St=["bold","ital","boldital","mono"],DI=class I{constructor(g,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=g,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(e),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=t}setOptions(g){if(this.elementOptions=g,this.initFontOptions(g.font),OI(g.label)?this.labelDirty=!0:g.label=void 0,g.font!==void 0&&g.font!==null){if(typeof g.font=="string")this.baseSize=this.fontOptions.size;else if(typeof g.font=="object"){let e=g.font.size;e!==void 0&&(this.baseSize=e)}}}initFontOptions(g){if(S(St,e=>{this.fontOptions[e]={}}),I.parseFontString(this.fontOptions,g)){this.fontOptions.vadjust=0;return}S(g,(e,t)=>{e!=null&&typeof e!="object"&&(this.fontOptions[t]=e)})}static parseFontString(g,e){if(!e||typeof e!="string")return!1;let t=e.split(" ");return g.size=+t[0].replace("px",""),g.face=t[1],g.color=t[2],!0}constrain(g){let e={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},t=fe(g,"widthConstraint");if(typeof t=="number")e.maxWdt=Number(t),e.minWdt=Number(t);else if(typeof t=="object"){let C=fe(g,["widthConstraint","maximum"]);typeof C=="number"&&(e.maxWdt=Number(C));let i=fe(g,["widthConstraint","minimum"]);typeof i=="number"&&(e.minWdt=Number(i))}let A=fe(g,"heightConstraint");if(typeof A=="number")e.minHgt=Number(A);else if(typeof A=="object"){let C=fe(g,["heightConstraint","minimum"]);typeof C=="number"&&(e.minHgt=Number(C));let i=fe(g,["heightConstraint","valign"]);typeof i=="string"&&(i==="top"||i==="bottom")&&(e.valign=i)}return e}update(g,e){this.setOptions(g,!0),this.propagateFonts(e),_(this.fontOptions,this.constrain(e)),this.fontOptions.chooser=No("label",e)}adjustSizes(g){let e=g?g.right+g.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=e,this.fontOptions.minWdt-=e);let t=g?g.top+g.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=t)}addFontOptionsToPile(g,e){for(let t=0;t<e.length;++t)this.addFontToPile(g,e[t])}addFontToPile(g,e){if(e===void 0||e.font===void 0||e.font===null)return;let t=e.font;g.push(t)}getBasicOptions(g){let e={};for(let t=0;t<g.length;++t){let A=g[t],C={};I.parseFontString(C,A)&&(A=C),S(A,(i,n)=>{i!==void 0&&(Object.prototype.hasOwnProperty.call(e,n)||(G(St).call(St,n)!==-1?e[n]={}:e[n]=i))})}return e}getFontOption(g,e,t){let A;for(let C=0;C<g.length;++C){let i=g[C];if(Object.prototype.hasOwnProperty.call(i,e)){if(A=i[e],A==null)continue;let n={};if(I.parseFontString(n,A)&&(A=n),Object.prototype.hasOwnProperty.call(A,t))return A[t]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,t))return this.fontOptions[t];throw new Error("Did not find value for multi-font for property: '"+t+"'")}getFontOptions(g,e){let t={},A=["color","size","face","mod","vadjust"];for(let C=0;C<A.length;++C){let i=A[C];t[i]=this.getFontOption(g,e,i)}return t}propagateFonts(g){let e=[];this.addFontOptionsToPile(e,g),this.fontOptions=this.getBasicOptions(e);for(let t=0;t<St.length;++t){let A=St[t],C=this.fontOptions[A],i=this.getFontOptions(e,A);S(i,(n,o)=>{C[o]=n}),C.size=Number(C.size),C.vadjust=Number(C.vadjust)}}draw(g,e,t,A,C){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let n=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&n<this.elementOptions.scaling.label.drawThreshold-1||(n>=this.elementOptions.scaling.label.maxVisible&&(n=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(g,A,C,e,t,i),this._drawBackground(g),this._drawText(g,e,this.size.yLine,i,n))}_drawBackground(g){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){g.fillStyle=this.fontOptions.background;let e=this.getSize();g.fillRect(e.left,e.top,e.width,e.height)}}_drawText(g,e,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",C=arguments.length>4?arguments[4]:void 0;[e,t]=this._setAlignment(g,e,t,A),g.textAlign="left",e=e-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(t-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(t+=(this.size.height-this.size.labelHeight)/2));for(let i=0;i<this.lineCount;i++){let n=this.lines[i];if(n&&n.blocks){let o=0;this.isEdgeLabel||this.fontOptions.align==="center"?o+=(this.size.width-n.width)/2:this.fontOptions.align==="right"&&(o+=this.size.width-n.width);for(let s=0;s<n.blocks.length;s++){let r=n.blocks[s];g.font=r.font;let[a,d]=this._getColor(r.color,C,r.strokeColor);r.strokeWidth>0&&(g.lineWidth=r.strokeWidth,g.strokeStyle=d,g.lineJoin="round"),g.fillStyle=a,r.strokeWidth>0&&g.strokeText(r.text,e+o,t+r.vadjust),g.fillText(r.text,e+o,t+r.vadjust),o+=r.width}t+=n.height}}}_setAlignment(g,e,t,A){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){e=0,t=0;let C=2;this.fontOptions.align==="top"?(g.textBaseline="alphabetic",t-=2*C):this.fontOptions.align==="bottom"?(g.textBaseline="hanging",t+=2*C):g.textBaseline="middle"}else g.textBaseline=A;return[e,t]}_getColor(g,e,t){let A=g||"#000000",C=t||"#ffffff";if(e<=this.elementOptions.scaling.label.drawThreshold){let i=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-e)));A=Rg(A,i),C=Rg(C,i)}return[A,C]}getTextSize(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(g,e,t),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let e=this.size.left,t=this.size.top-.5*2;if(this.isEdgeLabel){let C=-this.size.width*.5;switch(this.fontOptions.align){case"middle":e=C,t=-this.size.height*.5;break;case"top":e=C,t=-(this.size.height+2);break;case"bottom":e=C,t=2;break}}return{left:e,top:t,width:this.size.width,height:this.size.height}}calculateLabelSize(g,e,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(g,e,t),this.size.left=A-this.size.width*.5,this.size.top=C-this.size.height*.5,this.size.yLine=C+(1-this.lineCount)*.5*this.fontOptions.size,i==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(g,e,t,A){let C=function(o,s,r){return s==="normal"?r==="mod"?"":o[r]:o[s][r]!==void 0?o[s][r]:o[r]},i={color:C(this.fontOptions,A,"color"),size:C(this.fontOptions,A,"size"),face:C(this.fontOptions,A,"face"),mod:C(this.fontOptions,A,"mod"),vadjust:C(this.fontOptions,A,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(e||t)&&(A==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?i.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(i,this.elementOptions.id,e,t));let n="";return i.mod!==void 0&&i.mod!==""&&(n+=i.mod+" "),n+=i.size+"px "+i.face,g.font=n.replace(/"/g,""),i.font=g.font,i.height=i.size,i}differentState(g,e){return g!==this.selectedState||e!==this.hoverState}_processLabelText(g,e,t,A){return new Xi(g,this,e,t).process(A)}_processLabel(g,e,t){if(this.labelDirty===!1&&!this.differentState(e,t))return;let A=this._processLabelText(g,e,t,this.elementOptions.label);this.fontOptions.minWdt>0&&A.width<this.fontOptions.minWdt&&(A.width=this.fontOptions.minWdt),this.size.labelHeight=A.height,this.fontOptions.minHgt>0&&A.height<this.fontOptions.minHgt&&(A.height=this.fontOptions.minHgt),this.lines=A.lines,this.lineCount=A.lines.length,this.size.width=A.width,this.size.height=A.height,this.selectedState=e,this.hoverState=t,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)}},oe=class{constructor(g,e,t){this.body=e,this.labelModule=t,this.setOptions(g),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(g){this.options=g}_setMargins(g){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)),g.adjustSizes(this.margin)}_distanceToBorder(g,e){let t=this.options.borderWidth;return g&&this.resize(g),Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+t}enableShadow(g,e){e.shadow&&(g.shadowColor=e.shadowColor,g.shadowBlur=e.shadowSize,g.shadowOffsetX=e.shadowX,g.shadowOffsetY=e.shadowY)}disableShadow(g,e){e.shadow&&(g.shadowColor="rgba(0,0,0,0)",g.shadowBlur=0,g.shadowOffsetX=0,g.shadowOffsetY=0)}enableBorderDashes(g,e){if(e.borderDashes!==!1)if(g.setLineDash!==void 0){let t=e.borderDashes;t===!0&&(t=[5,15]),g.setLineDash(t)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,e.borderDashes=!1}disableBorderDashes(g,e){e.borderDashes!==!1&&(g.setLineDash!==void 0?g.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,e.borderDashes=!1))}needsRefresh(g,e){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(g,e)}initContextForDraw(g,e){let t=e.borderWidth/this.body.view.scale;g.lineWidth=Math.min(this.width,t),g.strokeStyle=e.borderColor,g.fillStyle=e.color}performStroke(g,e){let t=e.borderWidth/this.body.view.scale;g.save(),t>0&&(this.enableBorderDashes(g,e),g.stroke(),this.disableBorderDashes(g,e)),g.restore()}performFill(g,e){g.save(),g.fillStyle=e.color,this.enableShadow(g,e),EA(g).call(g),this.disableShadow(g,e),g.restore(),this.performStroke(g,e)}_addBoundingBoxMargin(g){this.boundingBox.left-=g,this.boundingBox.top-=g,this.boundingBox.bottom+=g,this.boundingBox.right+=g}_updateBoundingBox(g,e,t,A,C){t!==void 0&&this.resize(t,A,C),this.left=g-this.width/2,this.top=e-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}updateBoundingBox(g,e,t,A,C){this._updateBoundingBox(g,e,t,A,C)}getDimensionsFromLabel(g,e,t){this.textSize=this.labelModule.getTextSize(g,e,t);let A=this.textSize.width,C=this.textSize.height,i=14;return A===0&&(A=i,C=i),{width:A,height:C}}},wk=class extends oe{constructor(g,e,t){super(g,e,t),this._setMargins(t)}resize(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(e,t)){let A=this.getDimensionsFromLabel(g,e,t);this.width=A.width+this.margin.right+this.margin.left,this.height=A.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(g,e,t,A,C,i){this.resize(g,A,C),this.left=e-this.width/2,this.top=t-this.height/2,this.initContextForDraw(g,i),Ha(g,this.left,this.top,this.width,this.height,i.borderRadius),this.performFill(g,i),this.updateBoundingBox(e,t,g,A,C),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C)}updateBoundingBox(g,e,t,A,C){this._updateBoundingBox(g,e,t,A,C);let i=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(i)}distanceToBorder(g,e){g&&this.resize(g);let t=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+t}},qt=class extends oe{constructor(g,e,t){super(g,e,t),this.labelOffset=0,this.selected=!1}setOptions(g,e,t){this.options=g,e===void 0&&t===void 0||this.setImages(e,t)}setImages(g,e){e&&this.selected?(this.imageObj=e,this.imageObjAlt=g):(this.imageObj=g,this.imageObjAlt=e)}switchImages(g){let e=g&&!this.selected||!g&&this.selected;if(this.selected=g,this.imageObjAlt!==void 0&&e){let t=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=t}}_getImagePadding(){let g={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){let e=this.options.imagePadding;typeof e=="object"?(g.top=e.top,g.right=e.right,g.bottom=e.bottom,g.left=e.left):(g.top=e,g.right=e,g.bottom=e,g.left=e)}return g}_resizeImage(){let g,e;if(this.options.shapeProperties.useImageSize===!1){let t=1,A=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?t=this.imageObj.width/this.imageObj.height:A=this.imageObj.height/this.imageObj.width),g=this.options.size*2*t,e=this.options.size*2*A}else{let t=this._getImagePadding();g=this.imageObj.width+t.left+t.right,e=this.imageObj.height+t.top+t.bottom}this.width=g,this.height=e,this.radius=.5*this.width}_drawRawCircle(g,e,t,A){this.initContextForDraw(g,A),Xn(g,e,t,A.size),this.performFill(g,A)}_drawImageAtPosition(g,e){if(this.imageObj.width!=0){g.globalAlpha=e.opacity!==void 0?e.opacity:1,this.enableShadow(g,e);let t=1;this.options.shapeProperties.interpolation===!0&&(t=this.imageObj.width/this.width/this.body.view.scale);let A=this._getImagePadding(),C=this.left+A.left,i=this.top+A.top,n=this.width-A.left-A.right,o=this.height-A.top-A.bottom;this.imageObj.drawImageAtPosition(g,t,C,i,n,o),this.disableShadow(g,e)}}_drawImageLabel(g,e,t,A,C){let i=0;if(this.height!==void 0){i=this.height*.5;let o=this.labelModule.getTextSize(g,A,C);o.lineCount>=1&&(i+=o.height/2)}let n=t+i;this.options.label&&(this.labelOffset=i),this.labelModule.draw(g,e,n,A,C,"hanging")}},Ek=class extends qt{constructor(g,e,t){super(g,e,t),this._setMargins(t)}resize(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(e,t)){let A=this.getDimensionsFromLabel(g,e,t),C=Math.max(A.width+this.margin.right+this.margin.left,A.height+this.margin.top+this.margin.bottom);this.options.size=C/2,this.width=C,this.height=C,this.radius=this.width/2}}draw(g,e,t,A,C,i){this.resize(g,A,C),this.left=e-this.width/2,this.top=t-this.height/2,this._drawRawCircle(g,e,t,i),this.updateBoundingBox(e,t),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,t,A,C)}updateBoundingBox(g,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=e+this.options.size}distanceToBorder(g){return g&&this.resize(g),this.width*.5}},Ji=class extends qt{constructor(g,e,t,A,C){super(g,e,t),this.setImages(A,C)}resize(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let C=this.options.size*2;this.width=C,this.height=C,this.radius=.5*this.width;return}this.needsRefresh(e,t)&&this._resizeImage()}draw(g,e,t,A,C,i){this.switchImages(A),this.resize();let n=e,o=t;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=t,n+=this.width/2,o+=this.height/2):(this.left=e-this.width/2,this.top=t-this.height/2),this._drawRawCircle(g,n,o,i),g.save(),g.clip(),this._drawImageAtPosition(g,i),g.restore(),this._drawImageLabel(g,n,o,A,C),this.updateBoundingBox(e,t)}updateBoundingBox(g,e){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=e,this.boundingBox.left=g,this.boundingBox.right=g+this.options.size*2,this.boundingBox.bottom=e+this.options.size*2):(this.boundingBox.top=e-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=e+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(g){return g&&this.resize(g),this.width*.5}},$g=class extends oe{constructor(g,e,t){super(g,e,t)}resize(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(e,t)){var C,i;this.labelModule.getTextSize(g,e,t);let n=2*A.size;this.width=(C=this.customSizeWidth)!==null&&C!==void 0?C:n,this.height=(i=this.customSizeHeight)!==null&&i!==void 0?i:n,this.radius=.5*this.width}}_drawShape(g,e,t,A,C,i,n,o){return this.resize(g,i,n,o),this.left=A-this.width/2,this.top=C-this.height/2,this.initContextForDraw(g,o),ip(e)(g,A,C,o.size),this.performFill(g,o),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(g.font=(i?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),g.fillStyle=this.options.icon.color||"black",g.textAlign="center",g.textBaseline="middle",g.fillText(this.options.icon.code,A,C)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(g,i,n,A,C,"hanging");let s=C+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(g,A,s,i,n,"hanging")}this.updateBoundingBox(A,C)}}}updateBoundingBox(g,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=e+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 ha(I,g){var e=U(I);if(Xg){var t=Xg(I);g&&(t=tg(t).call(t,function(A){return ge(I,A).enumerable})),e.push.apply(e,t)}return e}function Tk(I){for(var g=1;g<arguments.length;g++){var e,t,A=arguments[g]!=null?arguments[g]:{};g%2?F(e=ha(Object(A),!0)).call(e,function(C){eg(I,C,A[C])}):Jg?NA(I,Jg(A)):F(t=ha(Object(A))).call(t,function(C){SA(I,C,ge(A,C))})}return I}var $i=class extends $g{constructor(g,e,t,A){super(g,e,t,A),this.ctxRenderer=A}draw(g,e,t,A,C,i){this.resize(g,A,C,i),this.left=e-this.width/2,this.top=t-this.height/2,g.save();let n=this.ctxRenderer({ctx:g,id:this.options.id,x:e,y:t,state:{selected:A,hover:C},style:Tk({},i),label:this.options.label});if(n.drawNode!=null&&n.drawNode(),g.restore(),n.drawExternalLabel){let o=n.drawExternalLabel;n.drawExternalLabel=()=>{g.save(),o(),g.restore()}}return n.nodeDimensions&&(this.customSizeWidth=n.nodeDimensions.width,this.customSizeHeight=n.nodeDimensions.height),n}distanceToBorder(g,e){return this._distanceToBorder(g,e)}},qi=class extends oe{constructor(g,e,t){super(g,e,t),this._setMargins(t)}resize(g,e,t){if(this.needsRefresh(e,t)){let C=this.getDimensionsFromLabel(g,e,t).width+this.margin.right+this.margin.left;this.width=C,this.height=C,this.radius=this.width/2}}draw(g,e,t,A,C,i){this.resize(g,A,C),this.left=e-this.width/2,this.top=t-this.height/2,this.initContextForDraw(g,i),Qa(g,e-this.width/2,t-this.height/2,this.width,this.height),this.performFill(g,i),this.updateBoundingBox(e,t,g,A,C),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C)}distanceToBorder(g,e){return this._distanceToBorder(g,e)}},xk=class extends $g{constructor(g,e,t){super(g,e,t)}draw(g,e,t,A,C,i){return this._drawShape(g,"diamond",4,e,t,A,C,i)}distanceToBorder(g,e){return this._distanceToBorder(g,e)}},gn=class extends $g{constructor(g,e,t){super(g,e,t)}draw(g,e,t,A,C,i){return this._drawShape(g,"circle",2,e,t,A,C,i)}distanceToBorder(g){return g&&this.resize(g),this.options.size}},RI=class extends oe{constructor(g,e,t){super(g,e,t)}resize(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(e,t)){let A=this.getDimensionsFromLabel(g,e,t);this.height=A.height*2,this.width=A.width+A.height,this.radius=.5*this.width}}draw(g,e,t,A,C,i){this.resize(g,A,C),this.left=e-this.width*.5,this.top=t-this.height*.5,this.initContextForDraw(g,i),pi(g,this.left,this.top,this.width,this.height),this.performFill(g,i),this.updateBoundingBox(e,t,g,A,C),this.labelModule.draw(g,e,t,A,C)}distanceToBorder(g,e){g&&this.resize(g);let t=this.width*.5,A=this.height*.5,C=Math.sin(e)*t,i=Math.cos(e)*A;return t*A/Math.sqrt(C*C+i*i)}},en=class extends oe{constructor(g,e,t){super(g,e,t),this._setMargins(t)}resize(g,e,t){this.needsRefresh(e,t)&&(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(g,e,t,A,C,i){return this.resize(g,A,C),this.options.icon.size=this.options.icon.size||50,this.left=e-this.width/2,this.top=t-this.height/2,this._icon(g,e,t,A,C,i),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(g,this.left+this.iconSize.width/2+this.margin.left,t+this.height/2+5,A),this.updateBoundingBox(e,t)}}}updateBoundingBox(g,e){this.boundingBox.top=e-this.options.icon.size*.5,this.boundingBox.left=g-this.options.icon.size*.5,this.boundingBox.right=g+this.options.icon.size*.5,this.boundingBox.bottom=e+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(g,e,t,A,C,i){let n=Number(this.options.icon.size);this.options.icon.code!==void 0?(g.font=[this.options.icon.weight!=null?this.options.icon.weight:A?"bold":"",(this.options.icon.weight!=null&&A?5:0)+n+"px",this.options.icon.face].join(" "),g.fillStyle=this.options.icon.color||"black",g.textAlign="center",g.textBaseline="middle",this.enableShadow(g,i),g.fillText(this.options.icon.code,e,t),this.disableShadow(g,i)):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(g,e){return this._distanceToBorder(g,e)}},Ok=class extends qt{constructor(g,e,t,A,C){super(g,e,t),this.setImages(A,C)}resize(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let C=this.options.size*2;this.width=C,this.height=C;return}this.needsRefresh(e,t)&&this._resizeImage()}draw(g,e,t,A,C,i){g.save(),this.switchImages(A),this.resize();let n=e,o=t;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=t,n+=this.width/2,o+=this.height/2):(this.left=e-this.width/2,this.top=t-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){let s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,a=(A?r:s)/this.body.view.scale;g.lineWidth=Math.min(this.width,a),g.beginPath();let d=A?this.options.color.highlight.border:C?this.options.color.hover.border:this.options.color.border,l=A?this.options.color.highlight.background:C?this.options.color.hover.background:this.options.color.background;i.opacity!==void 0&&(d=Rg(d,i.opacity),l=Rg(l,i.opacity)),g.strokeStyle=d,g.fillStyle=l,g.rect(this.left-.5*g.lineWidth,this.top-.5*g.lineWidth,this.width+g.lineWidth,this.height+g.lineWidth),EA(g).call(g),this.performStroke(g,i),g.closePath()}this._drawImageAtPosition(g,i),this._drawImageLabel(g,n,o,A,C),this.updateBoundingBox(e,t),g.restore()}updateBoundingBox(g,e){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=g,this.top=e):(this.left=g-this.width/2,this.top=e-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}distanceToBorder(g,e){return this._distanceToBorder(g,e)}},tn=class extends $g{constructor(g,e,t){super(g,e,t)}draw(g,e,t,A,C,i){return this._drawShape(g,"square",2,e,t,A,C,i)}distanceToBorder(g,e){return this._distanceToBorder(g,e)}},An=class extends $g{constructor(g,e,t){super(g,e,t)}draw(g,e,t,A,C,i){return this._drawShape(g,"hexagon",4,e,t,A,C,i)}distanceToBorder(g,e){return this._distanceToBorder(g,e)}},In=class extends $g{constructor(g,e,t){super(g,e,t)}draw(g,e,t,A,C,i){return this._drawShape(g,"star",4,e,t,A,C,i)}distanceToBorder(g,e){return this._distanceToBorder(g,e)}},Cn=class extends oe{constructor(g,e,t){super(g,e,t),this._setMargins(t)}resize(g,e,t){this.needsRefresh(e,t)&&(this.textSize=this.labelModule.getTextSize(g,e,t),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(g,e,t,A,C,i){this.resize(g,A,C),this.left=e-this.width/2,this.top=t-this.height/2,this.enableShadow(g,i),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C),this.disableShadow(g,i),this.updateBoundingBox(e,t,g,A,C)}distanceToBorder(g,e){return this._distanceToBorder(g,e)}},Pk=class extends $g{constructor(g,e,t){super(g,e,t)}draw(g,e,t,A,C,i){return this._drawShape(g,"triangle",3,e,t,A,C,i)}distanceToBorder(g,e){return this._distanceToBorder(g,e)}},nn=class extends $g{constructor(g,e,t){super(g,e,t)}draw(g,e,t,A,C,i){return this._drawShape(g,"triangleDown",3,e,t,A,C,i)}distanceToBorder(g,e){return this._distanceToBorder(g,e)}};function ca(I,g){var e=U(I);if(Xg){var t=Xg(I);g&&(t=tg(t).call(t,function(A){return ge(I,A).enumerable})),e.push.apply(e,t)}return e}function ua(I){for(var g=1;g<arguments.length;g++){var e,t,A=arguments[g]!=null?arguments[g]:{};g%2?F(e=ca(Object(A),!0)).call(e,function(C){eg(I,C,A[C])}):Jg?NA(I,Jg(A)):F(t=ca(Object(A))).call(t,function(C){SA(I,C,ge(A,C))})}return I}var pg=class I{constructor(g,e,t,A,C,i){this.options=Te(C),this.globalOptions=C,this.defaultOptions=i,this.body=e,this.edges=[],this.id=void 0,this.imagelist=t,this.grouplist=A,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 DI(this.body,this.options,!1),this.setOptions(g)}attachEdge(g){var e;G(e=this.edges).call(e,g)===-1&&this.edges.push(g)}detachEdge(g){var e;let t=G(e=this.edges).call(e,g);if(t!=-1){var A;Ug(A=this.edges).call(A,t,1)}}setOptions(g){let e=this.options.shape;if(!g)return;if(typeof g.color!="undefined"&&(this._localColor=g.color),g.id!==void 0&&(this.id=g.id),this.id===void 0)throw new Error("Node must have an id");I.checkMass(g,this.id),g.x!==void 0&&(g.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=zg(g.x),this.predefinedPosition=!0)),g.y!==void 0&&(g.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=zg(g.y),this.predefinedPosition=!0)),g.size!==void 0&&(this.baseSize=g.size),g.value!==void 0&&(g.value=Eh(g.value)),I.parseOptions(this.options,g,!0,this.globalOptions,this.grouplist);let t=[g,this.options,this.defaultOptions];return this.chooser=No("node",t),this._load_images(),this.updateLabelModule(g),g.opacity!==void 0&&I.checkOpacity(g.opacity)&&(this.options.opacity=g.opacity),this.updateShape(e),g.hidden!==void 0||g.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(g){return 0<=g&&g<=1}static checkCoordinateOrigin(g){return g===void 0||g==="center"||g==="top-left"}static updateGroupOptions(g,e,t){var A;if(t===void 0)return;let C=g.group;if(e!==void 0&&e.group!==void 0&&C!==e.group)throw new Error("updateGroupOptions: group values in options don't match.");if(!(typeof C=="number"||typeof C=="string"&&C!=""))return;let n=t.get(C);n.opacity!==void 0&&e.opacity===void 0&&(I.checkOpacity(n.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+n.opacity),n.opacity=void 0));let o=tg(A=bk(e)).call(A,s=>e[s]!=null);o.push("font"),bI(o,g,n),g.color=zi(g.color)}static parseOptions(g,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},C=arguments.length>4?arguments[4]:void 0;if(bI(["color","fixed","shadow"],g,e,t),I.checkMass(e),g.opacity!==void 0&&(I.checkOpacity(g.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+g.opacity),g.opacity=void 0)),e.opacity!==void 0&&(I.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),e.shapeProperties&&!I.checkCoordinateOrigin(e.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+e.shapeProperties.coordinateOrigin),Dg(g,e,"shadow",A),e.color!==void 0&&e.color!==null){let n=zi(e.color);Bl(g.color,n)}else t===!0&&e.color===null&&(g.color=Te(A.color));e.fixed!==void 0&&e.fixed!==null&&(typeof e.fixed=="boolean"?(g.fixed.x=e.fixed,g.fixed.y=e.fixed):(e.fixed.x!==void 0&&typeof e.fixed.x=="boolean"&&(g.fixed.x=e.fixed.x),e.fixed.y!==void 0&&typeof e.fixed.y=="boolean"&&(g.fixed.y=e.fixed.y))),t===!0&&e.font===null&&(g.font=Te(A.font)),I.updateGroupOptions(g,e,C),e.scaling!==void 0&&Dg(g.scaling,e.scaling,"label",A.scaling)}getFormattingValues(){let g={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?g.borderWidth=this.options.borderWidthSelected:g.borderWidth*=2,g.color=this.options.color.highlight.background,g.borderColor=this.options.color.highlight.border,g.shadow=this.options.shadow.enabled):this.hover&&(g.color=this.options.color.hover.background,g.borderColor=this.options.color.hover.border,g.shadow=this.options.shadow.enabled):typeof this.chooser=="function"&&(this.chooser(g,this.options.id,this.selected,this.hover),g.shadow===!1&&(g.shadowColor!==this.options.shadow.color||g.shadowSize!==this.options.shadow.size||g.shadowX!==this.options.shadow.x||g.shadowY!==this.options.shadow.y)&&(g.shadow=!0)):g.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){let e=this.options.opacity;g.borderColor=Rg(g.borderColor,e),g.color=Rg(g.color,e),g.shadowColor=Rg(g.shadowColor,e)}return g}updateLabelModule(g){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),I.updateGroupOptions(this.options,ua(ua({},g),{},{color:g&&g.color||this._localColor||void 0}),this.grouplist);let e=this.grouplist.get(this.options.group,!1),t=[g,this.options,e,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(g){if(g===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new wk(this.options,this.body,this.labelModule);break;case"circle":this.shape=new Ek(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new Ji(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new $i(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new qi(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new xk(this.options,this.body,this.labelModule);break;case"dot":this.shape=new gn(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new RI(this.options,this.body,this.labelModule);break;case"icon":this.shape=new en(this.options,this.body,this.labelModule);break;case"image":this.shape=new Ok(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new tn(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new An(this.options,this.body,this.labelModule);break;case"star":this.shape=new In(this.options,this.body,this.labelModule);break;case"text":this.shape=new Cn(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new Pk(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new nn(this.options,this.body,this.labelModule);break;default:this.shape=new RI(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(g,e){return this.shape.distanceToBorder(g,e)}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(g,e,t){if(this.options.value!==void 0){let A=this.options.scaling.customScalingFunction(g,e,t,this.options.value),C=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let i=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+A*i}this.options.size=this.options.scaling.min+A*C}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(g){let e=this.getFormattingValues();return this.shape.draw(g,this.x,this.y,this.selected,this.hover,e)||{}}updateBoundingBox(g){this.shape.updateBoundingBox(this.x,this.y,g)}resize(g){let e=this.getFormattingValues();this.shape.resize(g,this.selected,this.hover,e)}getItemsOnPoint(g){let e=[];return this.labelModule.visible()&&Hi(this.labelModule.getSize(),g)&&e.push({nodeId:this.id,labelId:0}),Hi(this.shape.boundingBox,g)&&e.push({nodeId:this.id}),e}isOverlappingWith(g){return this.shape.left<g.right&&this.shape.left+this.shape.width>g.left&&this.shape.top<g.bottom&&this.shape.top+this.shape.height>g.top}isBoundingBoxOverlappingWith(g){return this.shape.boundingBox.left<g.right&&this.shape.boundingBox.right>g.left&&this.shape.boundingBox.top<g.bottom&&this.shape.boundingBox.bottom>g.top}static checkMass(g,e){if(g.mass!==void 0&&g.mass<=0){let t="";e!==void 0&&(t=" in node id: "+e),console.error("%cNegative or zero mass disallowed"+t+", setting mass to 1.",Gl),g.mass=1}}},on=class{constructor(g,e,t,A){var C;if(this.body=g,this.images=e,this.groups=t,this.layoutEngine=A,this.body.functions.createNode=b(C=this.create).call(C,this),this.nodesListeners={add:(i,n)=>{this.add(n.items)},update:(i,n)=>{this.update(n.items,n.data,n.oldData)},remove:(i,n)=>{this.remove(n.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(i,n,o,s){if(n===i)return .5;{let r=1/(n-i);return Math.max(0,(s-i)*r)}}},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=Te(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var g,e;this.body.emitter.on("refreshNodes",b(g=this.refresh).call(g,this)),this.body.emitter.on("refresh",b(e=this.refresh).call(e,this)),this.body.emitter.on("destroy",()=>{S(this.nodesListeners,(t,A)=>{this.body.data.nodes&&this.body.data.nodes.off(A,t)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(g){if(g!==void 0){if(pg.parseOptions(this.options,g),g.opacity!==void 0&&(Yi(g.opacity)||!Me(g.opacity)||g.opacity<0||g.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+g.opacity):this.options.opacity=g.opacity),g.shape!==void 0)for(let e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&this.body.nodes[e].updateShape();if(typeof g.font!="undefined"||typeof g.widthConstraint!="undefined"||typeof g.heightConstraint!="undefined")for(let e of U(this.body.nodes))this.body.nodes[e].updateLabelModule(),this.body.nodes[e].needsRefresh();if(g.size!==void 0)for(let e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&this.body.nodes[e].needsRefresh();(g.hidden!==void 0||g.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}setData(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.data.nodes;if(yh("id",g))this.body.data.nodes=g;else if(B(g))this.body.data.nodes=new Pe,this.body.data.nodes.add(g);else if(!g)this.body.data.nodes=new Pe;else throw new TypeError("Array or DataSet expected");if(t&&S(this.nodesListeners,function(A,C){t.off(C,A)}),this.body.nodes={},this.body.data.nodes){let A=this;S(this.nodesListeners,function(i,n){A.body.data.nodes.on(n,i)});let C=this.body.data.nodes.getIds();this.add(C,!0)}e===!1&&this.body.emitter.emit("_dataChanged")}add(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t,A=[];for(let C=0;C<g.length;C++){t=g[C];let i=this.body.data.nodes.get(t),n=this.create(i);A.push(n),this.body.nodes[t]=n}this.layoutEngine.positionInitially(A),e===!1&&this.body.emitter.emit("_dataChanged")}update(g,e,t){let A=this.body.nodes,C=!1;for(let i=0;i<g.length;i++){let n=g[i],o=A[n],s=e[i];o!==void 0?o.setOptions(s)&&(C=!0):(C=!0,o=this.create(s),A[n]=o)}!C&&t!==void 0&&(C=Ih(e).call(e,function(i,n){let o=t[n];return o&&o.level!==i.level})),C===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}remove(g){let e=this.body.nodes;for(let t=0;t<g.length;t++){let A=g[t];delete e[A]}this.body.emitter.emit("_dataChanged")}create(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pg;return new e(g,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;S(this.body.nodes,(e,t)=>{let A=this.body.data.nodes.get(t);A!==void 0&&(g===!0&&e.setOptions({x:null,y:null}),e.setOptions({fixed:!1}),e.setOptions(A))})}getPositions(g){let e={};if(g!==void 0){if(B(g)===!0){for(let t=0;t<g.length;t++)if(this.body.nodes[g[t]]!==void 0){let A=this.body.nodes[g[t]];e[g[t]]={x:Math.round(A.x),y:Math.round(A.y)}}}else if(this.body.nodes[g]!==void 0){let t=this.body.nodes[g];e[g]={x:Math.round(t.x),y:Math.round(t.y)}}}else for(let t=0;t<this.body.nodeIndices.length;t++){let A=this.body.nodes[this.body.nodeIndices[t]];e[this.body.nodeIndices[t]]={x:Math.round(A.x),y:Math.round(A.y)}}return e}getPosition(g){if(g==null)throw new TypeError("No id was specified for getPosition method.");if(this.body.nodes[g]==null)throw new ReferenceError("NodeId provided for getPosition does not exist. Provided: ".concat(g));return{x:Math.round(this.body.nodes[g].x),y:Math.round(this.body.nodes[g].y)}}storePositions(){let g=[],e=this.body.data.nodes.getDataSet();for(let t of e.get()){let A=t.id,C=this.body.nodes[A],i=Math.round(C.x),n=Math.round(C.y);(t.x!==i||t.y!==n)&&g.push({id:A,x:i,y:n})}e.update(g)}getBoundingBox(g){if(this.body.nodes[g]!==void 0)return this.body.nodes[g].shape.boundingBox}getConnectedNodes(g,e){let t=[];if(this.body.nodes[g]!==void 0){let A=this.body.nodes[g],C={};for(let i=0;i<A.edges.length;i++){let n=A.edges[i];e!=="to"&&n.toId==A.id?C[n.fromId]===void 0&&(t.push(n.fromId),C[n.fromId]=!0):e!=="from"&&n.fromId==A.id&&C[n.toId]===void 0&&(t.push(n.toId),C[n.toId]=!0)}}return t}getConnectedEdges(g){let e=[];if(this.body.nodes[g]!==void 0){let t=this.body.nodes[g];for(let A=0;A<t.edges.length;A++)e.push(t.edges[A].id)}else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",g);return e}moveNode(g,e,t){this.body.nodes[g]!==void 0?(this.body.nodes[g].x=Number(e),this.body.nodes[g].y=Number(t),Hg(()=>{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",g)}},Dk=R,fa=Math.hypot,Rk=Math.abs,Nk=Math.sqrt,Sk=!!fa&&fa(1/0,NaN)!==1/0;Dk({target:"Math",stat:!0,arity:2,forced:Sk},{hypot:function(g,e){for(var t=0,A=0,C=arguments.length,i=0,n,o;A<C;)n=Rk(arguments[A++]),i<n?(o=i/n,t=t*o*o+1,i=n):n>0?(o=n/i,t+=o*o):t+=n;return i===1/0?1/0:i*Nk(t)}});var kk=L,Mk=kk.Math.hypot,Fk=Mk,Bk=Fk,zk=Bk,Zk=D(zk),H=class{static transform(g,e){B(g)||(g=[g]);let t=e.point.x,A=e.point.y,C=e.angle,i=e.length;for(let n=0;n<g.length;++n){let o=g[n],s=o.x*Math.cos(C)-o.y*Math.sin(C),r=o.x*Math.sin(C)+o.y*Math.cos(C);o.x=t+i*s,o.y=A+i*r}}static drawPath(g,e){g.beginPath(),g.moveTo(e[0].x,e[0].y);for(let t=1;t<e.length;++t)g.lineTo(e[t].x,e[t].y);g.closePath()}},Lk=class extends H{static draw(g,e){if(e.image){g.save(),g.translate(e.point.x,e.point.y),g.rotate(Math.PI/2+e.angle);let t=e.imageWidth!=null?e.imageWidth:e.image.width,A=e.imageHeight!=null?e.imageHeight:e.image.height;e.image.drawImageAtPosition(g,1,-t/2,0,t,A),g.restore()}return!1}},sn=class extends H{static draw(g,e){let t=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return H.transform(t,e),H.drawPath(g,t),!0}},rn=class{static draw(g,e){let t=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return H.transform(t,e),H.drawPath(g,t),!0}},an=class{static draw(g,e){let t={x:-.4,y:0};H.transform(t,e),g.strokeStyle=g.fillStyle,g.fillStyle="rgba(0, 0, 0, 0)";let A=Math.PI,C=e.angle-A/2,i=e.angle+A/2;return g.beginPath(),g.arc(t.x,t.y,e.length*.4,C,i,!1),g.stroke(),!0}},dn=class{static draw(g,e){let t={x:-.3,y:0};H.transform(t,e),g.strokeStyle=g.fillStyle,g.fillStyle="rgba(0, 0, 0, 0)";let A=Math.PI,C=e.angle+A/2,i=e.angle+3*A/2;return g.beginPath(),g.arc(t.x,t.y,e.length*.4,C,i,!1),g.stroke(),!0}},ln=class{static draw(g,e){let t=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return H.transform(t,e),H.drawPath(g,t),!0}},hn=class{static draw(g,e){let t=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return H.transform(t,e),H.drawPath(g,t),!0}},cn=class{static draw(g,e){let t={x:-.4,y:0};return H.transform(t,e),Xn(g,t.x,t.y,e.length*.4),!0}},un=class{static draw(g,e){let t=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return H.transform(t,e),H.drawPath(g,t),!0}},fn=class{static draw(g,e){let t=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return H.transform(t,e),H.drawPath(g,t),!0}},pn=class{static draw(g,e){let t=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return H.transform(t,e),H.drawPath(g,t),!0}},mn=class{static draw(g,e){let t=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return H.transform(t,e),H.drawPath(g,t),!0}},NI=class{static draw(g,e){let t;switch(e.type&&(t=e.type.toLowerCase()),t){case"image":return Lk.draw(g,e);case"circle":return cn.draw(g,e);case"box":return fn.draw(g,e);case"crow":return rn.draw(g,e);case"curve":return an.draw(g,e);case"diamond":return pn.draw(g,e);case"inv_curve":return dn.draw(g,e);case"triangle":return ln.draw(g,e);case"inv_triangle":return hn.draw(g,e);case"bar":return un.draw(g,e);case"vee":return mn.draw(g,e);case"arrow":default:return sn.draw(g,e)}}};function pa(I,g){var e=U(I);if(Xg){var t=Xg(I);g&&(t=tg(t).call(t,function(A){return ge(I,A).enumerable})),e.push.apply(e,t)}return e}function ma(I){for(var g=1;g<arguments.length;g++){var e,t,A=arguments[g]!=null?arguments[g]:{};g%2?F(e=pa(Object(A),!0)).call(e,function(C){eg(I,C,A[C])}):Jg?NA(I,Jg(A)):F(t=pa(Object(A))).call(t,function(C){SA(I,C,ge(A,C))})}return I}var SI=class{constructor(g,e,t){this._body=e,this._labelModule=t,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(g),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(g){this.options=g,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}drawLine(g,e,t,A){let C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();g.strokeStyle=this.getColor(g,e),g.lineWidth=e.width,e.dashes!==!1?this._drawDashedLine(g,e,C):this._drawLine(g,e,C)}_drawLine(g,e,t,A,C){if(this.from!=this.to)this._line(g,e,t,A,C);else{let[i,n,o]=this._getCircleData(g);this._circle(g,e,i,n,o)}}_drawDashedLine(g,e,t,A,C){g.lineCap="round";let i=B(e.dashes)?e.dashes:[5,5];if(g.setLineDash!==void 0){if(g.save(),g.setLineDash(i),g.lineDashOffset=0,this.from!=this.to)this._line(g,e,t);else{let[n,o,s]=this._getCircleData(g);this._circle(g,e,n,o,s)}g.setLineDash([0]),g.lineDashOffset=0,g.restore()}else{if(this.from!=this.to)Xa(g,this.from.x,this.from.y,this.to.x,this.to.y,i);else{let[n,o,s]=this._getCircleData(g);this._circle(g,e,n,o,s)}this.enableShadow(g,e),g.stroke(),this.disableShadow(g,e)}}findBorderPosition(g,e,t){return this.from!=this.to?this._findBorderPosition(g,e,t):this._findBorderPositionCircle(g,e,t)}findBorderPositions(g){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,g),to:this._findBorderPosition(this.to,g)};{var e;let[t,A]=Zg(e=this._getCircleData(g)).call(e,0,2);return{from:this._findBorderPositionCircle(this.from,g,{x:t,y:A,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,g,{x:t,y:A,low:.6,high:.8,direction:1})}}}_getCircleData(g){let e=this.options.selfReference.size;g!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(g);let t=Th(g,this.options.selfReference.angle,e,this.from);return[t.x,t.y,e]}_pointOnCircle(g,e,t,A){let C=A*2*Math.PI;return{x:g+t*Math.cos(C),y:e-t*Math.sin(C)}}_findBorderPositionCircle(g,e,t){let A=t.x,C=t.y,i=t.low,n=t.high,o=t.direction,s=10,r=this.options.selfReference.size,a=.05,d,l=(i+n)*.5,h=0;this.options.arrowStrikethrough===!0&&(o===-1?h=this.options.endPointOffset.from:o===1&&(h=this.options.endPointOffset.to));let c=0;do{l=(i+n)*.5,d=this._pointOnCircle(A,C,r,l);let p=Math.atan2(g.y-d.y,g.x-d.x),u=g.distanceToBorder(e,p)+h,m=Math.sqrt(Math.pow(d.x-g.x,2)+Math.pow(d.y-g.y,2)),E=u-m;if(Math.abs(E)<a)break;E>0?o>0?i=l:n=l:o>0?n=l:i=l,++c}while(i<=n&&c<s);return ma(ma({},d),{},{t:l})}getLineWidth(g,e){return g===!0?Math.max(this.selectionWidth,.3/this._body.view.scale):e===!0?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}getColor(g,e){if(e.inheritsColor!==!1){if(e.inheritsColor==="both"&&this.from.id!==this.to.id){let t=g.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),A=this.from.options.color.highlight.border,C=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(A=Rg(this.from.options.color.border,e.opacity),C=Rg(this.to.options.color.border,e.opacity)):this.from.selected===!0&&this.to.selected===!1?C=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(A=this.from.options.color.border),t.addColorStop(0,A),t.addColorStop(1,C),t}return e.inheritsColor==="to"?Rg(this.to.options.color.border,e.opacity):Rg(this.from.options.color.border,e.opacity)}else return Rg(e.color,e.opacity)}_circle(g,e,t,A,C){this.enableShadow(g,e);let i=0,n=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){let o=this.options.selfReference.angle,s=this.options.selfReference.angle+Math.PI,r=this._findBorderPositionCircle(this.from,g,{x:t,y:A,low:o,high:s,direction:-1}),a=this._findBorderPositionCircle(this.from,g,{x:t,y:A,low:o,high:s,direction:1});i=Math.atan2(r.y-A,r.x-t),n=Math.atan2(a.y-A,a.x-t)}g.beginPath(),g.arc(t,A,C,i,n,!1),g.stroke(),this.disableShadow(g,e)}getDistanceToEdge(g,e,t,A,C,i){if(this.from!=this.to)return this._getDistanceToEdge(g,e,t,A,C,i);{let[n,o,s]=this._getCircleData(void 0),r=n-C,a=o-i;return Math.abs(Math.sqrt(r*r+a*a)-s)}}_getDistanceToLine(g,e,t,A,C,i){let n=t-g,o=A-e,s=n*n+o*o,r=((C-g)*n+(i-e)*o)/s;r>1?r=1:r<0&&(r=0);let a=g+r*n,d=e+r*o,l=a-C,h=d-i;return Math.sqrt(l*l+h*h)}getArrowData(g,e,t,A,C,i){let n,o,s,r,a,d,l,h=i.width;e==="from"?(s=this.from,r=this.to,a=i.fromArrowScale<0,d=Math.abs(i.fromArrowScale),l=i.fromArrowType):e==="to"?(s=this.to,r=this.from,a=i.toArrowScale<0,d=Math.abs(i.toArrowScale),l=i.toArrowType):(s=this.to,r=this.from,a=i.middleArrowScale<0,d=Math.abs(i.middleArrowScale),l=i.middleArrowType);let c=15*d+3*h;if(s!=r){let E=Zk(s.x-r.x,s.y-r.y),w=c/E;if(e!=="middle")if(this.options.smooth.enabled===!0){let O=this._findBorderPosition(s,g,{via:t}),M=this.getPoint(O.t+w*(e==="from"?1:-1),t);n=Math.atan2(O.y-M.y,O.x-M.x),o=O}else n=Math.atan2(s.y-r.y,s.x-r.x),o=this._findBorderPosition(s,g);else{let O=(a?-w:w)/2,M=this.getPoint(.5+O,t),k=this.getPoint(.5-O,t);n=Math.atan2(M.y-k.y,M.x-k.x),o=this.getPoint(.5,t)}}else{let[E,w,O]=this._getCircleData(g);if(e==="from"){let M=this.options.selfReference.angle,k=this.options.selfReference.angle+Math.PI,V=this._findBorderPositionCircle(this.from,g,{x:E,y:w,low:M,high:k,direction:-1});n=V.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,o=V}else if(e==="to"){let M=this.options.selfReference.angle,k=this.options.selfReference.angle+Math.PI,V=this._findBorderPositionCircle(this.from,g,{x:E,y:w,low:M,high:k,direction:1});n=V.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,o=V}else{let M=this.options.selfReference.angle/(2*Math.PI);o=this._pointOnCircle(E,w,O,M),n=M*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}let p=o.x-c*.9*Math.cos(n),u=o.y-c*.9*Math.sin(n);return{point:o,core:{x:p,y:u},angle:n,length:c,type:l}}drawArrowHead(g,e,t,A,C){g.strokeStyle=this.getColor(g,e),g.fillStyle=g.strokeStyle,g.lineWidth=e.width,NI.draw(g,C)&&(this.enableShadow(g,e),EA(g).call(g),this.disableShadow(g,e))}enableShadow(g,e){e.shadow===!0&&(g.shadowColor=e.shadowColor,g.shadowBlur=e.shadowSize,g.shadowOffsetX=e.shadowX,g.shadowOffsetY=e.shadowY)}disableShadow(g,e){e.shadow===!0&&(g.shadowColor="rgba(0,0,0,0)",g.shadowBlur=0,g.shadowOffsetX=0,g.shadowOffsetY=0)}drawBackground(g,e){if(e.background!==!1){let t={strokeStyle:g.strokeStyle,lineWidth:g.lineWidth,dashes:g.dashes};g.strokeStyle=e.backgroundColor,g.lineWidth=e.backgroundSize,this.setStrokeDashed(g,e.backgroundDashes),g.stroke(),g.strokeStyle=t.strokeStyle,g.lineWidth=t.lineWidth,g.dashes=t.dashes,this.setStrokeDashed(g,e.dashes)}}setStrokeDashed(g,e){if(e!==!1)if(g.setLineDash!==void 0){let t=B(e)?e:[5,5];g.setLineDash(t)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else g.setLineDash!==void 0?g.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}};function va(I,g){var e=U(I);if(Xg){var t=Xg(I);g&&(t=tg(t).call(t,function(A){return ge(I,A).enumerable})),e.push.apply(e,t)}return e}function ba(I){for(var g=1;g<arguments.length;g++){var e,t,A=arguments[g]!=null?arguments[g]:{};g%2?F(e=va(Object(A),!0)).call(e,function(C){eg(I,C,A[C])}):Jg?NA(I,Jg(A)):F(t=va(Object(A))).call(t,function(C){SA(I,C,ge(A,C))})}return I}var gA=class extends SI{constructor(g,e,t){super(g,e,t)}_findBorderPositionBezier(g,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),A=10,C=.2,i=!1,n=1,o=0,s=this.to,r,a,d=this.options.endPointOffset?this.options.endPointOffset.to:0;g.id===this.from.id&&(s=this.from,i=!0,d=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(d=0);let l=0;do{a=(o+n)*.5,r=this.getPoint(a,t);let h=Math.atan2(s.y-r.y,s.x-r.x),c=s.distanceToBorder(e,h)+d,p=Math.sqrt(Math.pow(r.x-s.x,2)+Math.pow(r.y-s.y,2)),u=c-p;if(Math.abs(u)<C)break;u<0?i===!1?o=a:n=a:i===!1?n=a:o=a,++l}while(o<=n&&l<A);return ba(ba({},r),{},{t:a})}_getDistanceToBezierEdge(g,e,t,A,C,i,n){let o=1e9,s,r,a,d,l,h=g,c=e;for(r=1;r<10;r++)a=.1*r,d=Math.pow(1-a,2)*g+2*a*(1-a)*n.x+Math.pow(a,2)*t,l=Math.pow(1-a,2)*e+2*a*(1-a)*n.y+Math.pow(a,2)*A,r>0&&(s=this._getDistanceToLine(h,c,d,l,C,i),o=s<o?s:o),h=d,c=l;return o}_bezierCurve(g,e,t,A){g.beginPath(),g.moveTo(this.fromPoint.x,this.fromPoint.y),t!=null&&t.x!=null?A!=null&&A.x!=null?g.bezierCurveTo(t.x,t.y,A.x,A.y,this.toPoint.x,this.toPoint.y):g.quadraticCurveTo(t.x,t.y,this.toPoint.x,this.toPoint.y):g.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(g,e),this.enableShadow(g,e),g.stroke(),this.disableShadow(g,e)}getViaNode(){return this._getViaCoordinates()}},kI=class extends gA{constructor(g,e,t){super(g,e,t),this.via=this.via,this._boundFunction=()=>{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(g){super.setOptions(g);let e=!1;this.options.physics!==g.physics&&(e=!0),this.options=g,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(),e===!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){let g="edgeId:"+this.id,e=this._body.functions.createNode({id:g,shape:"circle",physics:!0,hidden:!0});this._body.nodes[g]=e,this.via=e,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(g,e,t){this._bezierCurve(g,e,t)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){let[t,A,C]=this._getCircleData(),i=2*Math.PI*(1-g);return{x:t+C*Math.sin(i),y:A+C-C*(1-Math.cos(i))}}else return{x:Math.pow(1-g,2)*this.fromPoint.x+2*g*(1-g)*e.x+Math.pow(g,2)*this.toPoint.x,y:Math.pow(1-g,2)*this.fromPoint.y+2*g*(1-g)*e.y+Math.pow(g,2)*this.toPoint.y}}_findBorderPosition(g,e){return this._findBorderPositionBezier(g,e,this.via)}_getDistanceToEdge(g,e,t,A,C,i){return this._getDistanceToBezierEdge(g,e,t,A,C,i,this.via)}},MI=class extends gA{constructor(g,e,t){super(g,e,t)}_line(g,e,t){this._bezierCurve(g,e,t)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){let g=this.options.smooth.roundness,e=this.options.smooth.type,t=Math.abs(this.from.x-this.to.x),A=Math.abs(this.from.y-this.to.y);if(e==="discrete"||e==="diagonalCross"){let C,i;t<=A?C=i=g*A:C=i=g*t,this.from.x>this.to.x&&(C=-C),this.from.y>=this.to.y&&(i=-i);let n=this.from.x+C,o=this.from.y+i;return e==="discrete"&&(t<=A?n=t<g*A?this.from.x:n:o=A<g*t?this.from.y:o),{x:n,y:o}}else if(e==="straightCross"){let C=(1-g)*t,i=(1-g)*A;return t<=A?(C=0,this.from.y<this.to.y&&(i=-i)):(this.from.x<this.to.x&&(C=-C),i=0),{x:this.to.x+C,y:this.to.y+i}}else if(e==="horizontal"){let C=(1-g)*t;return this.from.x<this.to.x&&(C=-C),{x:this.to.x+C,y:this.from.y}}else if(e==="vertical"){let C=(1-g)*A;return this.from.y<this.to.y&&(C=-C),{x:this.from.x,y:this.to.y+C}}else if(e==="curvedCW"){t=this.to.x-this.from.x,A=this.from.y-this.to.y;let C=Math.sqrt(t*t+A*A),i=Math.PI,o=(Math.atan2(A,t)+(g*.5+.5)*i)%(2*i);return{x:this.from.x+(g*.5+.5)*C*Math.sin(o),y:this.from.y+(g*.5+.5)*C*Math.cos(o)}}else if(e==="curvedCCW"){t=this.to.x-this.from.x,A=this.from.y-this.to.y;let C=Math.sqrt(t*t+A*A),i=Math.PI,o=(Math.atan2(A,t)+(-g*.5+.5)*i)%(2*i);return{x:this.from.x+(g*.5+.5)*C*Math.sin(o),y:this.from.y+(g*.5+.5)*C*Math.cos(o)}}else{let C,i;t<=A?C=i=g*A:C=i=g*t,this.from.x>this.to.x&&(C=-C),this.from.y>=this.to.y&&(i=-i);let n=this.from.x+C,o=this.from.y+i;return t<=A?this.from.x<=this.to.x?n=this.to.x<n?this.to.x:n:n=this.to.x>n?this.to.x:n:this.from.y>=this.to.y?o=this.to.y>o?this.to.y:o:o=this.to.y<o?this.to.y:o,{x:n,y:o}}}_findBorderPosition(g,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(g,e,t.via)}_getDistanceToEdge(g,e,t,A,C,i){let n=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(g,e,t,A,C,i,n)}getPoint(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),t=g,A=Math.pow(1-t,2)*this.fromPoint.x+2*t*(1-t)*e.x+Math.pow(t,2)*this.toPoint.x,C=Math.pow(1-t,2)*this.fromPoint.y+2*t*(1-t)*e.y+Math.pow(t,2)*this.toPoint.y;return{x:A,y:C}}},vn=class extends gA{constructor(g,e,t){super(g,e,t)}_getDistanceToBezierEdge2(g,e,t,A,C,i,n,o){let s=1e9,r=g,a=e,d=[0,0,0,0];for(let l=1;l<10;l++){let h=.1*l;d[0]=Math.pow(1-h,3),d[1]=3*h*Math.pow(1-h,2),d[2]=3*Math.pow(h,2)*(1-h),d[3]=Math.pow(h,3);let c=d[0]*g+d[1]*n.x+d[2]*o.x+d[3]*t,p=d[0]*e+d[1]*n.y+d[2]*o.y+d[3]*A;if(l>0){let u=this._getDistanceToLine(r,a,c,p,C,i);s=u<s?u:s}r=c,a=p}return s}},FI=class extends vn{constructor(g,e,t){super(g,e,t)}_line(g,e,t){let A=t[0],C=t[1];this._bezierCurve(g,e,A,C)}_getViaCoordinates(){let g=this.from.x-this.to.x,e=this.from.y-this.to.y,t,A,C,i,n=this.options.smooth.roundness;return(Math.abs(g)>Math.abs(e)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(A=this.from.y,i=this.to.y,t=this.from.x-n*g,C=this.to.x+n*g):(A=this.from.y-n*e,i=this.to.y+n*e,t=this.from.x,C=this.to.x),[{x:t,y:A},{x:C,y:i}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(g,e){return this._findBorderPositionBezier(g,e)}_getDistanceToEdge(g,e,t,A,C,i){let[n,o]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(g,e,t,A,C,i,n,o)}getPoint(g){let[e,t]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),A=g,C=[Math.pow(1-A,3),3*A*Math.pow(1-A,2),3*Math.pow(A,2)*(1-A),Math.pow(A,3)],i=C[0]*this.fromPoint.x+C[1]*e.x+C[2]*t.x+C[3]*this.toPoint.x,n=C[0]*this.fromPoint.y+C[1]*e.y+C[2]*t.y+C[3]*this.toPoint.y;return{x:i,y:n}}},BI=class extends SI{constructor(g,e,t){super(g,e,t)}_line(g,e){g.beginPath(),g.moveTo(this.fromPoint.x,this.fromPoint.y),g.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(g,e),g.stroke(),this.disableShadow(g,e)}getViaNode(){}getPoint(g){return{x:(1-g)*this.fromPoint.x+g*this.toPoint.x,y:(1-g)*this.fromPoint.y+g*this.toPoint.y}}_findBorderPosition(g,e){let t=this.to,A=this.from;g.id===this.from.id&&(t=this.from,A=this.to);let C=Math.atan2(t.y-A.y,t.x-A.x),i=t.x-A.x,n=t.y-A.y,o=Math.sqrt(i*i+n*n),s=g.distanceToBorder(e,C),r=(o-s)/o;return{x:(1-r)*A.x+r*t.x,y:(1-r)*A.y+r*t.y,t:0}}_getDistanceToEdge(g,e,t,A,C,i){return this._getDistanceToLine(g,e,t,A,C,i)}},xe=class I{constructor(g,e,t,A,C){if(e===void 0)throw new Error("No body provided");this.options=Te(A),this.globalOptions=A,this.defaultOptions=C,this.body=e,this.imagelist=t,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 DI(this.body,this.options,!0),this.setOptions(g)}setOptions(g){if(!g)return;let e=typeof g.physics!="undefined"&&this.options.physics!==g.physics||typeof g.hidden!="undefined"&&(this.options.hidden||!1)!==(g.hidden||!1)||typeof g.from!="undefined"&&this.options.from!==g.from||typeof g.to!="undefined"&&this.options.to!==g.to;I.parseOptions(this.options,g,!0,this.globalOptions),g.id!==void 0&&(this.id=g.id),g.from!==void 0&&(this.fromId=g.from),g.to!==void 0&&(this.toId=g.to),g.title!==void 0&&(this.title=g.title),g.value!==void 0&&(g.value=Eh(g.value));let t=[g,this.options,this.defaultOptions];return this.chooser=No("edge",t),this.updateLabelModule(g),e=this.updateEdgeType()||e,this._setInteractionWidths(),this.connect(),e}static parseOptions(g,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(xt(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],g,e,t),e.endPointOffset!==void 0&&e.endPointOffset.from!==void 0&&(Me(e.endPointOffset.from)?g.endPointOffset.from=e.endPointOffset.from:(g.endPointOffset.from=A.endPointOffset.from!==void 0?A.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),e.endPointOffset!==void 0&&e.endPointOffset.to!==void 0&&(Me(e.endPointOffset.to)?g.endPointOffset.to=e.endPointOffset.to:(g.endPointOffset.to=A.endPointOffset.to!==void 0?A.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),OI(e.label)?g.label=e.label:OI(g.label)||(g.label=void 0),Dg(g,e,"smooth",A),Dg(g,e,"shadow",A),Dg(g,e,"background",A),e.dashes!==void 0&&e.dashes!==null?g.dashes=e.dashes:t===!0&&e.dashes===null&&(g.dashes=we(A.dashes)),e.scaling!==void 0&&e.scaling!==null?(e.scaling.min!==void 0&&(g.scaling.min=e.scaling.min),e.scaling.max!==void 0&&(g.scaling.max=e.scaling.max),Dg(g.scaling,e.scaling,"label",A.scaling)):t===!0&&e.scaling===null&&(g.scaling=we(A.scaling)),e.arrows!==void 0&&e.arrows!==null)if(typeof e.arrows=="string"){let n=e.arrows.toLowerCase();g.arrows.to.enabled=G(n).call(n,"to")!=-1,g.arrows.middle.enabled=G(n).call(n,"middle")!=-1,g.arrows.from.enabled=G(n).call(n,"from")!=-1}else if(typeof e.arrows=="object")Dg(g.arrows,e.arrows,"to",A.arrows),Dg(g.arrows,e.arrows,"middle",A.arrows),Dg(g.arrows,e.arrows,"from",A.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+Et(e.arrows));else t===!0&&e.arrows===null&&(g.arrows=we(A.arrows));if(e.color!==void 0&&e.color!==null){let n=pe(e.color)?{color:e.color,highlight:e.color,hover:e.color,inherit:!1,opacity:1}:e.color,o=g.color;if(C)_(o,A.color,!1,t);else for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&delete o[s];if(pe(o))o.color=o,o.highlight=o,o.hover=o,o.inherit=!1,n.opacity===void 0&&(o.opacity=1);else{let s=!1;n.color!==void 0&&(o.color=n.color,s=!0),n.highlight!==void 0&&(o.highlight=n.highlight,s=!0),n.hover!==void 0&&(o.hover=n.hover,s=!0),n.inherit!==void 0&&(o.inherit=n.inherit),n.opacity!==void 0&&(o.opacity=Math.min(1,Math.max(0,n.opacity))),s===!0?o.inherit=!1:o.inherit===void 0&&(o.inherit="from")}}else t===!0&&e.color===null&&(g.color=Te(A.color));t===!0&&e.font===null&&(g.font=Te(A.font)),Object.prototype.hasOwnProperty.call(e,"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}"),g.selfReference.size=e.selfReferenceSize)}getFormattingValues(){let g=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,e=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,t=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,A=this.options.color.inherit,C={toArrow:g,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:t,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:e,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:A?void 0:this.options.color.color,inheritsColor:A,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){let i=this.options.selectionWidth;typeof i=="function"?C.width=i(C.width):typeof i=="number"&&(C.width+=i),C.width=Math.max(C.width,.3/this.body.view.scale),C.color=this.options.color.highlight,C.shadow=this.options.shadow.enabled}else if(this.hover){let i=this.options.hoverWidth;typeof i=="function"?C.width=i(C.width):typeof i=="number"&&(C.width+=i),C.width=Math.max(C.width,.3/this.body.view.scale),C.color=this.options.color.hover,C.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(C,this.options.id,this.selected,this.hover),C.color!==void 0&&(C.inheritsColor=!1),C.shadow===!1&&(C.shadowColor!==this.options.shadow.color||C.shadowSize!==this.options.shadow.size||C.shadowX!==this.options.shadow.x||C.shadowY!==this.options.shadow.y)&&(C.shadow=!0));else C.shadow=this.options.shadow.enabled,C.width=Math.max(C.width,.3/this.body.view.scale);return C}updateLabelModule(g){let e=[g,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,e),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){let g=this.options.smooth,e=!1,t=!0;return this.edgeType!==void 0&&((this.edgeType instanceof kI&&g.enabled===!0&&g.type==="dynamic"||this.edgeType instanceof FI&&g.enabled===!0&&g.type==="cubicBezier"||this.edgeType instanceof MI&&g.enabled===!0&&g.type!=="dynamic"&&g.type!=="cubicBezier"||this.edgeType instanceof BI&&g.type.enabled===!1)&&(t=!1),t===!0&&(e=this.cleanup())),t===!0?g.enabled===!0?g.type==="dynamic"?(e=!0,this.edgeType=new kI(this.options,this.body,this.labelModule)):g.type==="cubicBezier"?this.edgeType=new FI(this.options,this.body,this.labelModule):this.edgeType=new MI(this.options,this.body,this.labelModule):this.edgeType=new BI(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),e}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(g,e,t){if(this.options.value!==void 0){let A=this.options.scaling.customScalingFunction(g,e,t,this.options.value),C=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let i=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+A*i}this.options.width=this.options.scaling.min+A*C}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(g){let e=this.getFormattingValues();if(e.hidden)return;let t=this.edgeType.getViaNode();this.edgeType.drawLine(g,e,this.selected,this.hover,t),this.drawLabel(g,t)}drawArrows(g){let e=this.getFormattingValues();if(e.hidden)return;let t=this.edgeType.getViaNode(),A={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,e.fromArrow&&(A.from=this.edgeType.getArrowData(g,"from",t,this.selected,this.hover,e),e.arrowStrikethrough===!1&&(this.edgeType.fromPoint=A.from.core),e.fromArrowSrc&&(A.from.image=this.imagelist.load(e.fromArrowSrc)),e.fromArrowImageWidth&&(A.from.imageWidth=e.fromArrowImageWidth),e.fromArrowImageHeight&&(A.from.imageHeight=e.fromArrowImageHeight)),e.toArrow&&(A.to=this.edgeType.getArrowData(g,"to",t,this.selected,this.hover,e),e.arrowStrikethrough===!1&&(this.edgeType.toPoint=A.to.core),e.toArrowSrc&&(A.to.image=this.imagelist.load(e.toArrowSrc)),e.toArrowImageWidth&&(A.to.imageWidth=e.toArrowImageWidth),e.toArrowImageHeight&&(A.to.imageHeight=e.toArrowImageHeight)),e.middleArrow&&(A.middle=this.edgeType.getArrowData(g,"middle",t,this.selected,this.hover,e),e.middleArrowSrc&&(A.middle.image=this.imagelist.load(e.middleArrowSrc)),e.middleArrowImageWidth&&(A.middle.imageWidth=e.middleArrowImageWidth),e.middleArrowImageHeight&&(A.middle.imageHeight=e.middleArrowImageHeight)),e.fromArrow&&this.edgeType.drawArrowHead(g,e,this.selected,this.hover,A.from),e.middleArrow&&this.edgeType.drawArrowHead(g,e,this.selected,this.hover,A.middle),e.toArrow&&this.edgeType.drawArrowHead(g,e,this.selected,this.hover,A.to)}drawLabel(g,e){if(this.options.label!==void 0){let t=this.from,A=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(g,this.selected,this.hover);let C;if(t.id!=A.id){this.labelModule.pointToSelf=!1,C=this.edgeType.getPoint(.5,e),g.save();let i=this._getRotation(g);i.angle!=0&&(g.translate(i.x,i.y),g.rotate(i.angle)),this.labelModule.draw(g,C.x,C.y,this.selected,this.hover),g.restore()}else{this.labelModule.pointToSelf=!0;let i=Th(g,this.options.selfReference.angle,this.options.selfReference.size,t);C=this._pointOnCircle(i.x,i.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(g,C.x,C.y,this.selected,this.hover)}}}getItemsOnPoint(g){let e=[];if(this.labelModule.visible()){let A=this._getRotation();Hi(this.labelModule.getSize(),g,A)&&e.push({edgeId:this.id,labelId:0})}let t={left:g.x,top:g.y};return this.isOverlappingWith(t)&&e.push({edgeId:this.id}),e}isOverlappingWith(g){if(this.connected){let t=this.from.x,A=this.from.y,C=this.to.x,i=this.to.y,n=g.left,o=g.top;return this.edgeType.getDistanceToEdge(t,A,C,i,n,o)<10}else return!1}_getRotation(g){let e=this.edgeType.getViaNode(),t=this.edgeType.getPoint(.5,e);g!==void 0&&this.labelModule.calculateLabelSize(g,this.selected,this.hover,t.x,t.y);let A={x:t.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return A;let C=this.from.y-this.to.y,i=this.from.x-this.to.x,n=Math.atan2(C,i);return(n<-1&&i<0||n>0&&i<0)&&(n+=Math.PI),A.angle=n,A}_pointOnCircle(g,e,t,A){return{x:g+t*Math.cos(A),y:e-t*Math.sin(A)}}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}},bn=class{constructor(g,e,t){var A;this.body=g,this.images=e,this.groups=t,this.body.functions.createEdge=b(A=this.create).call(A,this),this.edgesListeners={add:(C,i)=>{this.add(i.items)},update:(C,i)=>{this.update(i.items)},remove:(C,i)=>{this.remove(i.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(C,i,n,o){if(i===C)return .5;{let s=1/(i-C);return Math.max(0,(o-C)*s)}}},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},_(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var g=this,e,t;this.body.emitter.on("_forceDisableDynamicCurves",function(A){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;A==="dynamic"&&(A="continuous");let i=!1;for(let n in g.body.edges)if(Object.prototype.hasOwnProperty.call(g.body.edges,n)){let o=g.body.edges[n],s=g.body.data.edges.get(n);if(s!=null){let r=s.smooth;r!==void 0&&r.enabled===!0&&r.type==="dynamic"&&(A===void 0?o.setOptions({smooth:!1}):o.setOptions({smooth:{type:A}}),i=!0)}}C===!0&&i===!0&&g.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",b(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",b(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{S(this.edgesListeners,(A,C)=>{this.body.data.edges&&this.body.data.edges.off(C,A)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(g){if(g!==void 0){xe.parseOptions(this.options,g,!0,this.defaultOptions,!0);let e=!1;if(g.smooth!==void 0)for(let t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&(e=this.body.edges[t].updateEdgeType()||e);if(g.font!==void 0)for(let t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&this.body.edges[t].updateLabelModule();(g.hidden!==void 0||g.physics!==void 0||e===!0)&&this.body.emitter.emit("_dataChanged")}}setData(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.data.edges;if(yh("id",g))this.body.data.edges=g;else if(B(g))this.body.data.edges=new Pe,this.body.data.edges.add(g);else if(!g)this.body.data.edges=new Pe;else throw new TypeError("Array or DataSet expected");if(t&&S(this.edgesListeners,(A,C)=>{t.off(C,A)}),this.body.edges={},this.body.data.edges){S(this.edgesListeners,(C,i)=>{this.body.data.edges.on(i,C)});let A=this.body.data.edges.getIds();this.add(A,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),e===!1&&this.body.emitter.emit("_dataChanged")}add(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.edges,A=this.body.data.edges;for(let C=0;C<g.length;C++){let i=g[C],n=t[i];n&&n.disconnect();let o=A.get(i,{showInternalIds:!0});t[i]=this.create(o)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),e===!1&&this.body.emitter.emit("_dataChanged")}update(g){let e=this.body.edges,t=this.body.data.edges,A=!1;for(let C=0;C<g.length;C++){let i=g[C],n=t.get(i),o=e[i];o!==void 0?(o.disconnect(),A=o.setOptions(n)||A,o.connect()):(this.body.edges[i]=this.create(n),A=!0)}A===!0?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}remove(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(g.length===0)return;let t=this.body.edges;S(g,A=>{let C=t[A];C!==void 0&&C.remove()}),e&&this.body.emitter.emit("_dataChanged")}refresh(){S(this.body.edges,(g,e)=>{let t=this.body.data.edges.get(e);t!==void 0&&g.setOptions(t)})}create(g){return new xe(g,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let g,e=this.body.nodes,t=this.body.edges;for(g in e)Object.prototype.hasOwnProperty.call(e,g)&&(e[g].edges=[]);for(g in t)if(Object.prototype.hasOwnProperty.call(t,g)){let A=t[g];A.from=null,A.to=null,A.connect()}}getConnectedNodes(g){let e=[];if(this.body.edges[g]!==void 0){let t=this.body.edges[g];t.fromId!==void 0&&e.push(t.fromId),t.toId!==void 0&&e.push(t.toId)}return e}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){let g=[];S(this.body.edges,(e,t)=>{let A=this.body.nodes[e.toId],C=this.body.nodes[e.fromId];A!==void 0&&A.isCluster===!0||C!==void 0&&C.isCluster===!0||(A===void 0||C===void 0)&&g.push(t)}),this.remove(g,!1)}_addMissingEdges(){let g=this.body.data.edges;if(g==null)return;let e=this.body.edges,t=[];F(g).call(g,(A,C)=>{e[C]===void 0&&t.push(C)}),this.add(t,!0)}},zI=class{constructor(g,e,t){this.body=g,this.physicsBody=e,this.barnesHutTree,this.setOptions(t),this._rng=iC("BARNES HUT SOLVER")}setOptions(g){this.options=g,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 g,e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,A=t.length,C=this._formBarnesHutTree(e,t);this.barnesHutTree=C;for(let i=0;i<A;i++)g=e[t[i]],g.options.mass>0&&this._getForceContributions(C.root,g)}}_getForceContributions(g,e){this._getForceContribution(g.children.NW,e),this._getForceContribution(g.children.NE,e),this._getForceContribution(g.children.SW,e),this._getForceContribution(g.children.SE,e)}_getForceContribution(g,e){if(g.childrenCount>0){let t=g.centerOfMass.x-e.x,A=g.centerOfMass.y-e.y,C=Math.sqrt(t*t+A*A);C*g.calcSize>this.thetaInversed?this._calculateForces(C,t,A,e,g):g.childrenCount===4?this._getForceContributions(g,e):g.children.data.id!=e.id&&this._calculateForces(C,t,A,e,g)}}_calculateForces(g,e,t,A,C){g===0&&(g=.1,e=g),this.overlapAvoidanceFactor<1&&A.shape.radius&&(g=Math.max(.1+this.overlapAvoidanceFactor*A.shape.radius,g-A.shape.radius));let i=this.options.gravitationalConstant*C.mass*A.options.mass/Math.pow(g,3),n=e*i,o=t*i;this.physicsBody.forces[A.id].x+=n,this.physicsBody.forces[A.id].y+=o}_formBarnesHutTree(g,e){let t,A=e.length,C=g[e[0]].x,i=g[e[0]].y,n=g[e[0]].x,o=g[e[0]].y;for(let p=1;p<A;p++){let u=g[e[p]],m=u.x,E=u.y;u.options.mass>0&&(m<C&&(C=m),m>n&&(n=m),E<i&&(i=E),E>o&&(o=E))}let s=Math.abs(n-C)-Math.abs(o-i);s>0?(i-=.5*s,o+=.5*s):(C+=.5*s,n-=.5*s);let a=Math.max(1e-5,Math.abs(n-C)),d=.5*a,l=.5*(C+n),h=.5*(i+o),c={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:l-d,maxX:l+d,minY:h-d,maxY:h+d},size:a,calcSize:1/a,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(c.root);for(let p=0;p<A;p++)t=g[e[p]],t.options.mass>0&&this._placeInTree(c.root,t);return c}_updateBranchMass(g,e){let t=g.centerOfMass,A=g.mass+e.options.mass,C=1/A;t.x=t.x*g.mass+e.x*e.options.mass,t.x*=C,t.y=t.y*g.mass+e.y*e.options.mass,t.y*=C,g.mass=A;let i=Math.max(Math.max(e.height,e.radius),e.width);g.maxWidth=g.maxWidth<i?i:g.maxWidth}_placeInTree(g,e,t){(t!=!0||t===void 0)&&this._updateBranchMass(g,e);let A=g.children.NW.range,C;A.maxX>e.x?A.maxY>e.y?C="NW":C="SW":A.maxY>e.y?C="NE":C="SE",this._placeInRegion(g,e,C)}_placeInRegion(g,e,t){let A=g.children[t];switch(A.childrenCount){case 0:A.children.data=e,A.childrenCount=1,this._updateBranchMass(A,e);break;case 1:A.children.data.x===e.x&&A.children.data.y===e.y?(e.x+=this._rng(),e.y+=this._rng()):(this._splitBranch(A),this._placeInTree(A,e));break;case 4:this._placeInTree(A,e);break}}_splitBranch(g){let e=null;g.childrenCount===1&&(e=g.children.data,g.mass=0,g.centerOfMass.x=0,g.centerOfMass.y=0),g.childrenCount=4,g.children.data=null,this._insertRegion(g,"NW"),this._insertRegion(g,"NE"),this._insertRegion(g,"SW"),this._insertRegion(g,"SE"),e!=null&&this._placeInTree(g,e)}_insertRegion(g,e){let t,A,C,i,n=.5*g.size;switch(e){case"NW":t=g.range.minX,A=g.range.minX+n,C=g.range.minY,i=g.range.minY+n;break;case"NE":t=g.range.minX+n,A=g.range.maxX,C=g.range.minY,i=g.range.minY+n;break;case"SW":t=g.range.minX,A=g.range.minX+n,C=g.range.minY+n,i=g.range.maxY;break;case"SE":t=g.range.minX+n,A=g.range.maxX,C=g.range.minY+n,i=g.range.maxY;break}g.children[e]={centerOfMass:{x:0,y:0},mass:0,range:{minX:t,maxX:A,minY:C,maxY:i},size:.5*g.size,calcSize:2*g.calcSize,children:{data:null},maxWidth:0,level:g.level+1,childrenCount:0}}_debug(g,e){this.barnesHutTree!==void 0&&(g.lineWidth=1,this._drawBranch(this.barnesHutTree.root,g,e))}_drawBranch(g,e,t){t===void 0&&(t="#FF0000"),g.childrenCount===4&&(this._drawBranch(g.children.NW,e),this._drawBranch(g.children.NE,e),this._drawBranch(g.children.SE,e),this._drawBranch(g.children.SW,e)),e.strokeStyle=t,e.beginPath(),e.moveTo(g.range.minX,g.range.minY),e.lineTo(g.range.maxX,g.range.minY),e.stroke(),e.beginPath(),e.moveTo(g.range.maxX,g.range.minY),e.lineTo(g.range.maxX,g.range.maxY),e.stroke(),e.beginPath(),e.moveTo(g.range.maxX,g.range.maxY),e.lineTo(g.range.minX,g.range.maxY),e.stroke(),e.beginPath(),e.moveTo(g.range.minX,g.range.maxY),e.lineTo(g.range.minX,g.range.minY),e.stroke()}},yn=class{constructor(g,e,t){this._rng=iC("REPULSION SOLVER"),this.body=g,this.physicsBody=e,this.setOptions(t)}setOptions(g){this.options=g}solve(){let g,e,t,A,C,i,n,o,s=this.body.nodes,r=this.physicsBody.physicsNodeIndices,a=this.physicsBody.forces,d=this.options.nodeDistance,l=-2/3/d,h=4/3;for(let c=0;c<r.length-1;c++){n=s[r[c]];for(let p=c+1;p<r.length;p++)o=s[r[p]],g=o.x-n.x,e=o.y-n.y,t=Math.sqrt(g*g+e*e),t===0&&(t=.1*this._rng(),g=t),t<2*d&&(t<.5*d?i=1:i=l*t+h,i=i/t,A=g*i,C=e*i,a[n.id].x-=A,a[n.id].y-=C,a[o.id].x+=A,a[o.id].y+=C)}}},wn=class{constructor(g,e,t){this.body=g,this.physicsBody=e,this.setOptions(t)}setOptions(g){this.options=g,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}solve(){let g=this.body.nodes,e=this.physicsBody.physicsNodeIndices,t=this.physicsBody.forces,A=this.options.nodeDistance;for(let C=0;C<e.length-1;C++){let i=g[e[C]];for(let n=C+1;n<e.length;n++){let o=g[e[n]];if(i.level===o.level){let s=A+this.overlapAvoidanceFactor*((i.shape.radius||0)/2+(o.shape.radius||0)/2),r=o.x-i.x,a=o.y-i.y,d=Math.sqrt(r*r+a*a),l=.05,h;d<s?h=-Math.pow(l*d,2)+Math.pow(l*s,2):h=0,d!==0&&(h=h/d);let c=r*h,p=a*h;t[i.id].x-=c,t[i.id].y-=p,t[o.id].x+=c,t[o.id].y+=p}}}}},jt=class{constructor(g,e,t){this.body=g,this.physicsBody=e,this.setOptions(t)}setOptions(g){this.options=g}solve(){let g,e,t=this.physicsBody.physicsEdgeIndices,A=this.body.edges,C,i,n;for(let o=0;o<t.length;o++)e=A[t[o]],e.connected===!0&&e.toId!==e.fromId&&this.body.nodes[e.toId]!==void 0&&this.body.nodes[e.fromId]!==void 0&&(e.edgeType.via!==void 0?(g=e.options.length===void 0?this.options.springLength:e.options.length,C=e.to,i=e.edgeType.via,n=e.from,this._calculateSpringForce(C,i,.5*g),this._calculateSpringForce(i,n,.5*g)):(g=e.options.length===void 0?this.options.springLength*1.5:e.options.length,this._calculateSpringForce(e.from,e.to,g)))}_calculateSpringForce(g,e,t){let A=g.x-e.x,C=g.y-e.y,i=Math.max(Math.sqrt(A*A+C*C),.01),n=this.options.springConstant*(t-i)/i,o=A*n,s=C*n;this.physicsBody.forces[g.id]!==void 0&&(this.physicsBody.forces[g.id].x+=o,this.physicsBody.forces[g.id].y+=s),this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x-=o,this.physicsBody.forces[e.id].y-=s)}},En=class{constructor(g,e,t){this.body=g,this.physicsBody=e,this.setOptions(t)}setOptions(g){this.options=g}solve(){let g,e,t,A,C,i,n,o,s=this.body.edges,r=.5,a=this.physicsBody.physicsEdgeIndices,d=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces;for(let w=0;w<d.length;w++){let O=d[w];l[O].springFx=0,l[O].springFy=0}for(let w=0;w<a.length;w++)e=s[a[w]],e.connected===!0&&(g=e.options.length===void 0?this.options.springLength:e.options.length,t=e.from.x-e.to.x,A=e.from.y-e.to.y,o=Math.sqrt(t*t+A*A),o=o===0?.01:o,n=this.options.springConstant*(g-o)/o,C=t*n,i=A*n,e.to.level!=e.from.level?(l[e.toId]!==void 0&&(l[e.toId].springFx-=C,l[e.toId].springFy-=i),l[e.fromId]!==void 0&&(l[e.fromId].springFx+=C,l[e.fromId].springFy+=i)):(l[e.toId]!==void 0&&(l[e.toId].x-=r*C,l[e.toId].y-=r*i),l[e.fromId]!==void 0&&(l[e.fromId].x+=r*C,l[e.fromId].y+=r*i)));n=1;let h,c;for(let w=0;w<d.length;w++){let O=d[w];h=Math.min(n,Math.max(-n,l[O].springFx)),c=Math.min(n,Math.max(-n,l[O].springFy)),l[O].x+=h,l[O].y+=c}let p=0,u=0;for(let w=0;w<d.length;w++){let O=d[w];p+=l[O].x,u+=l[O].y}let m=p/d.length,E=u/d.length;for(let w=0;w<d.length;w++){let O=d[w];l[O].x-=m,l[O].y-=E}}},rt=class{constructor(g,e,t){this.body=g,this.physicsBody=e,this.setOptions(t)}setOptions(g){this.options=g}solve(){let g,e,t,A,C=this.body.nodes,i=this.physicsBody.physicsNodeIndices,n=this.physicsBody.forces;for(let o=0;o<i.length;o++){let s=i[o];A=C[s],g=-A.x,e=-A.y,t=Math.sqrt(g*g+e*e),this._calculateForces(t,g,e,n,A)}}_calculateForces(g,e,t,A,C){let i=g===0?0:this.options.centralGravity/g;A[C.id].x=e*i,A[C.id].y=t*i}},Tn=class extends zI{constructor(g,e,t){super(g,e,t),this._rng=iC("FORCE ATLAS 2 BASED REPULSION SOLVER")}_calculateForces(g,e,t,A,C){g===0&&(g=.1*this._rng(),e=g),this.overlapAvoidanceFactor<1&&A.shape.radius&&(g=Math.max(.1+this.overlapAvoidanceFactor*A.shape.radius,g-A.shape.radius));let i=A.edges.length+1,n=this.options.gravitationalConstant*C.mass*A.options.mass*i/Math.pow(g,2),o=e*n,s=t*n;this.physicsBody.forces[A.id].x+=o,this.physicsBody.forces[A.id].y+=s}},xn=class extends rt{constructor(g,e,t){super(g,e,t)}_calculateForces(g,e,t,A,C){if(g>0){let i=C.edges.length+1,n=this.options.centralGravity*i*C.options.mass;A[C.id].x=e*n,A[C.id].y=t*n}}},On=class{constructor(g){this.body=g,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}},q(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(g){if(g!==void 0)if(g===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(g===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,bI(["stabilization"],this.options,g),Dg(this.options,g,"stabilization"),g.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());let e=this.options.wind;e&&((typeof e.x!="number"||Yi(e.x))&&(e.x=0),(typeof e.y!="number"||Yi(e.y))&&(e.y=0)),this.timestep=this.options.timestep}this.init()}init(){let g;this.options.solver==="forceAtlas2Based"?(g=this.options.forceAtlas2Based,this.nodesSolver=new Tn(this.body,this.physicsBody,g),this.edgesSolver=new jt(this.body,this.physicsBody,g),this.gravitySolver=new xn(this.body,this.physicsBody,g)):this.options.solver==="repulsion"?(g=this.options.repulsion,this.nodesSolver=new yn(this.body,this.physicsBody,g),this.edgesSolver=new jt(this.body,this.physicsBody,g),this.gravitySolver=new rt(this.body,this.physicsBody,g)):this.options.solver==="hierarchicalRepulsion"?(g=this.options.hierarchicalRepulsion,this.nodesSolver=new wn(this.body,this.physicsBody,g),this.edgesSolver=new En(this.body,this.physicsBody,g),this.gravitySolver=new rt(this.body,this.physicsBody,g)):(g=this.options.barnesHut,this.nodesSolver=new zI(this.body,this.physicsBody,g),this.edgesSolver=new jt(this.body,this.physicsBody,g),this.gravitySolver=new rt(this.body,this.physicsBody,g)),this.modelOptions=g}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 g;this.viewFunction=b(g=this.simulationStep).call(g,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}stopSimulation(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,g===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,g===!0&&this.body.emitter.emit("_stopRendering"))}simulationStep(){let g=uI();this.physicsTick(),(uI()-g<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}_emitStabilized(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&Hg(()=>{this.body.emitter.emit("stabilized",{iterations:g}),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=[];let g=this.body.nodes,e=this.body.edges;for(let t in g)Object.prototype.hasOwnProperty.call(g,t)&&g[t].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(g[t].id);for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(e[t].id);for(let t=0;t<this.physicsBody.physicsNodeIndices.length;t++){let A=this.physicsBody.physicsNodeIndices[t];this.physicsBody.forces[A]={x:0,y:0},this.physicsBody.velocities[A]===void 0&&(this.physicsBody.velocities[A]={x:0,y:0})}for(let t in this.physicsBody.velocities)g[t]===void 0&&delete this.physicsBody.velocities[t]}revert(){let g=U(this.previousStates),e=this.body.nodes,t=this.physicsBody.velocities;this.referenceState={};for(let A=0;A<g.length;A++){let C=g[A];e[C]!==void 0?e[C].options.physics===!0&&(this.referenceState[C]={positions:{x:e[C].x,y:e[C].y}},t[C].x=this.previousStates[C].vx,t[C].y=this.previousStates[C].vy,e[C].x=this.previousStates[C].x,e[C].y=this.previousStates[C].y):delete this.previousStates[C]}}_evaluateStepQuality(){let g,e,t,A=this.body.nodes,C=this.referenceState,i=.3;for(let n in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,n)&&A[n]!==void 0&&(g=A[n].x-C[n].positions.x,e=A[n].y-C[n].positions.y,t=Math.sqrt(Math.pow(g,2)+Math.pow(e,2)),t>i))return!1;return!0}moveNodes(){let g=this.physicsBody.physicsNodeIndices,e=0,t=0,A=5;for(let C=0;C<g.length;C++){let i=g[C],n=this._performStep(i);e=Math.max(e,n),t+=n}this.adaptiveTimestepEnabled=t/g.length<A,this.stabilized=e<this.options.minVelocity}calculateComponentVelocity(g,e,t){let A=this.modelOptions.damping*g,C=(e-A)/t;g+=C*this.timestep;let i=this.options.maxVelocity||1e9;return Math.abs(g)>i&&(g=g>0?i:-i),g}_performStep(g){let e=this.body.nodes[g],t=this.physicsBody.forces[g];this.options.wind&&(t.x+=this.options.wind.x,t.y+=this.options.wind.y);let A=this.physicsBody.velocities[g];return this.previousStates[g]={x:e.x,y:e.y,vx:A.x,vy:A.y},e.options.fixed.x===!1?(A.x=this.calculateComponentVelocity(A.x,t.x,e.options.mass),e.x+=A.x*this.timestep):(t.x=0,A.x=0),e.options.fixed.y===!1?(A.y=this.calculateComponentVelocity(A.y,t.y,e.options.mass),e.y+=A.y*this.timestep):(t.y=0,A.y=0),Math.sqrt(Math.pow(A.x,2)+Math.pow(A.y,2))}_freezeNodes(){let g=this.body.nodes;for(let e in g)if(Object.prototype.hasOwnProperty.call(g,e)&&g[e].x&&g[e].y){let t=g[e].options.fixed;this.freezeCache[e]={x:t.x,y:t.y},t.x=!0,t.y=!0}}_restoreFrozenNodes(){let g=this.body.nodes;for(let e in g)Object.prototype.hasOwnProperty.call(g,e)&&this.freezeCache[e]!==void 0&&(g[e].options.fixed.x=this.freezeCache[e].x,g[e].options.fixed.y=this.freezeCache[e].y);this.freezeCache={}}stabilize(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof g!="number"&&(g=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",g)),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=g,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,Hg(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){let g=()=>this.stabilized===!1&&this.stabilizationIterations<this.targetIterations,e=()=>{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&e();let t=0;for(;g()&&t<this.options.stabilization.updateInterval;)this.physicsTick(),t++;if(e(),g()){var A;Hg(b(A=this._stabilizationBatch).call(A,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(g){for(let e=0;e<this.physicsBody.physicsNodeIndices.length;e++){let t=this.physicsBody.physicsNodeIndices[e],A=this.body.nodes[t],C=this.physicsBody.forces[t],i=20,n=.03,o=Math.sqrt(Math.pow(C.x,2)+Math.pow(C.x,2)),s=Math.min(Math.max(5,o),15),r=3*s,a=Zi((180-Math.min(1,Math.max(0,n*o))*180)/360,1,1),d={x:A.x+i*C.x,y:A.y+i*C.y};g.lineWidth=s,g.strokeStyle=a,g.beginPath(),g.moveTo(A.x,A.y),g.lineTo(d.x,d.y),g.stroke();let l=Math.atan2(C.y,C.x);g.fillStyle=a,NI.draw(g,{type:"arrow",point:d,angle:l,length:r}),EA(g).call(g)}}},dg=class{constructor(){}static getRange(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=1e9,A=-1e9,C=1e9,i=-1e9,n;if(e.length>0)for(let o=0;o<e.length;o++)n=g[e[o]],C>n.shape.boundingBox.left&&(C=n.shape.boundingBox.left),i<n.shape.boundingBox.right&&(i=n.shape.boundingBox.right),t>n.shape.boundingBox.top&&(t=n.shape.boundingBox.top),A<n.shape.boundingBox.bottom&&(A=n.shape.boundingBox.bottom);return C===1e9&&i===-1e9&&t===1e9&&A===-1e9&&(t=0,A=0,C=0,i=0),{minX:C,maxX:i,minY:t,maxY:A}}static getRangeCore(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=1e9,A=-1e9,C=1e9,i=-1e9,n;if(e.length>0)for(let o=0;o<e.length;o++)n=g[e[o]],C>n.x&&(C=n.x),i<n.x&&(i=n.x),t>n.y&&(t=n.y),A<n.y&&(A=n.y);return C===1e9&&i===-1e9&&t===1e9&&A===-1e9&&(t=0,A=0,C=0,i=0),{minX:C,maxX:i,minY:t,maxY:A}}static findCenter(g){return{x:.5*(g.maxX+g.minX),y:.5*(g.maxY+g.minY)}}static cloneOptions(g,e){let t={};return e===void 0||e==="node"?(_(t,g.options,!0),t.x=g.x,t.y=g.y,t.amountOfConnections=g.edges.length):_(t,g.options,!0),t}},Pn=class extends pg{constructor(g,e,t,A,C,i){super(g,e,t,A,C,i),this.isCluster=!0,this.containedNodes={},this.containedEdges={}}_openChildCluster(g){let e=this.body.nodes[g];if(this.containedNodes[g]===void 0)throw new Error("node with id: "+g+" not in current cluster");if(!e.isCluster)throw new Error("node with id: "+g+" is not a cluster");delete this.containedNodes[g],S(e.edges,t=>{delete this.containedEdges[t.id]}),S(e.containedNodes,(t,A)=>{this.containedNodes[A]=t}),e.containedNodes={},S(e.containedEdges,(t,A)=>{this.containedEdges[A]=t}),e.containedEdges={},S(e.edges,t=>{S(this.edges,A=>{var C,i;let n=G(C=A.clusteringEdgeReplacingIds).call(C,t.id);n!==-1&&(S(t.clusteringEdgeReplacingIds,o=>{A.clusteringEdgeReplacingIds.push(o),this.body.edges[o].edgeReplacedById=A.id}),Ug(i=A.clusteringEdgeReplacingIds).call(i,n,1))})}),e.edges=[]}},Dn=class{constructor(g){this.body=g,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},q(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(g,e){g===void 0?g=this._getHubSize():typeof g=="object"&&(e=this._checkOptions(g),g=this._getHubSize());let t=[];for(let A=0;A<this.body.nodeIndices.length;A++){let C=this.body.nodes[this.body.nodeIndices[A]];C.edges.length>=g&&t.push(C.id)}for(let A=0;A<t.length;A++)this.clusterByConnection(t[A],e,!0);this.body.emitter.emit("_dataChanged")}cluster(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(g.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");g=this._checkOptions(g);let t={},A={};S(this.body.nodes,(C,i)=>{C.options&&g.joinCondition(C.options)===!0&&(t[i]=C,S(C.edges,n=>{this.clusteredEdges[n.id]===void 0&&(A[n.id]=n)}))}),this._cluster(t,A,g,e)}clusterByEdgeCount(g,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;e=this._checkOptions(e);let A=[],C={},i,n,o;for(let s=0;s<this.body.nodeIndices.length;s++){let r={},a={},d=this.body.nodeIndices[s],l=this.body.nodes[d];if(C[d]===void 0){o=0,n=[];for(let h=0;h<l.edges.length;h++)i=l.edges[h],this.clusteredEdges[i.id]===void 0&&(i.toId!==i.fromId&&o++,n.push(i));if(o===g){let h=function(p){if(e.joinCondition===void 0||e.joinCondition===null)return!0;let u=dg.cloneOptions(p);return e.joinCondition(u)},c=!0;for(let p=0;p<n.length;p++){i=n[p];let u=this._getConnectedId(i,d);if(h(l))a[i.id]=i,r[d]=l,r[u]=this.body.nodes[u],C[d]=!0;else{c=!1;break}}if(U(r).length>0&&U(a).length>0&&c===!0){let u=function(){for(let m=0;m<A.length;++m)for(let E in r)if(A[m].nodes[E]!==void 0)return A[m]}();if(u!==void 0){for(let m in r)u.nodes[m]===void 0&&(u.nodes[m]=r[m]);for(let m in a)u.edges[m]===void 0&&(u.edges[m]=a[m])}else A.push({nodes:r,edges:a})}}}}for(let s=0;s<A.length;s++)this._cluster(A[s].nodes,A[s].edges,e,!1);t===!0&&this.body.emitter.emit("_dataChanged")}clusterOutliers(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,g,e)}clusterBridges(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,g,e)}clusterByConnection(g,e){var t;let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(g===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[g]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");let C=this.body.nodes[g];e=this._checkOptions(e,C),e.clusterNodeProperties.x===void 0&&(e.clusterNodeProperties.x=C.x),e.clusterNodeProperties.y===void 0&&(e.clusterNodeProperties.y=C.y),e.clusterNodeProperties.fixed===void 0&&(e.clusterNodeProperties.fixed={},e.clusterNodeProperties.fixed.x=C.options.fixed.x,e.clusterNodeProperties.fixed.y=C.options.fixed.y);let i={},n={},o=C.id,s=dg.cloneOptions(C);i[o]=C;for(let a=0;a<C.edges.length;a++){let d=C.edges[a];if(this.clusteredEdges[d.id]===void 0){let l=this._getConnectedId(d,o);if(this.clusteredNodes[l]===void 0)if(l!==o)if(e.joinCondition===void 0)n[d.id]=d,i[l]=this.body.nodes[l];else{let h=dg.cloneOptions(this.body.nodes[l]);e.joinCondition(s,h)===!0&&(n[d.id]=d,i[l]=this.body.nodes[l])}else n[d.id]=d}}let r=ag(t=U(i)).call(t,function(a){return i[a].id});for(let a in i){if(!Object.prototype.hasOwnProperty.call(i,a))continue;let d=i[a];for(let l=0;l<d.edges.length;l++){let h=d.edges[l];G(r).call(r,this._getConnectedId(h,d.id))>-1&&(n[h.id]=h)}}this._cluster(i,n,e,A)}_createClusterEdges(g,e,t,A){let C,i,n,o,s,r,a=U(g),d=[];for(let c=0;c<a.length;c++){i=a[c],n=g[i];for(let p=0;p<n.edges.length;p++)C=n.edges[p],this.clusteredEdges[C.id]===void 0&&(C.toId==C.fromId?e[C.id]=C:C.toId==i?(o=t.id,s=C.fromId,r=s):(o=C.toId,s=t.id,r=o),g[r]===void 0&&d.push({edge:C,fromId:s,toId:o}))}let l=[],h=function(c){for(let p=0;p<l.length;p++){let u=l[p],m=c.fromId===u.fromId&&c.toId===u.toId,E=c.fromId===u.toId&&c.toId===u.fromId;if(m||E)return u}return null};for(let c=0;c<d.length;c++){let p=d[c],u=p.edge,m=h(p);m===null?(m=this._createClusteredEdge(p.fromId,p.toId,u,A),l.push(m)):m.clusteringEdgeReplacingIds.push(u.id),this.body.edges[u.id].edgeReplacedById=m.id,this._backupEdgeOptions(u),u.setOptions({physics:!1})}}_checkOptions(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return g.clusterEdgeProperties===void 0&&(g.clusterEdgeProperties={}),g.clusterNodeProperties===void 0&&(g.clusterNodeProperties={}),g}_cluster(g,e,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,C=[];for(let r in g)Object.prototype.hasOwnProperty.call(g,r)&&this.clusteredNodes[r]!==void 0&&C.push(r);for(let r=0;r<C.length;++r)delete g[C[r]];if(U(g).length==0||U(g).length==1&&t.clusterNodeProperties.allowSingleNodeCluster!=!0)return;let i=_({},t.clusterNodeProperties);if(t.processProperties!==void 0){let r=[];for(let d in g)if(Object.prototype.hasOwnProperty.call(g,d)){let l=dg.cloneOptions(g[d]);r.push(l)}let a=[];for(let d in e)if(Object.prototype.hasOwnProperty.call(e,d)&&d.substr(0,12)!=="clusterEdge:"){let l=dg.cloneOptions(e[d],"edge");a.push(l)}if(i=t.processProperties(i,r,a),!i)throw new Error("The processProperties function does not return properties!")}i.id===void 0&&(i.id="cluster:"+st());let n=i.id;i.label===void 0&&(i.label="cluster");let o;i.x===void 0&&(o=this._getClusterPosition(g),i.x=o.x),i.y===void 0&&(o===void 0&&(o=this._getClusterPosition(g)),i.y=o.y),i.id=n;let s=this.body.functions.createNode(i,Pn);s.containedNodes=g,s.containedEdges=e,s.clusterEdgeProperties=t.clusterEdgeProperties,this.body.nodes[i.id]=s,this._clusterEdges(g,e,i,t.clusterEdgeProperties),i.id=void 0,A===!0&&this.body.emitter.emit("_dataChanged")}_backupEdgeOptions(g){this.clusteredEdges[g.id]===void 0&&(this.clusteredEdges[g.id]={physics:g.options.physics})}_restoreEdge(g){let e=this.clusteredEdges[g.id];e!==void 0&&(g.setOptions({physics:e.physics}),delete this.clusteredEdges[g.id])}isCluster(g){return this.body.nodes[g]!==void 0?this.body.nodes[g].isCluster===!0:(console.error("Node does not exist."),!1)}_getClusterPosition(g){let e=U(g),t=g[e[0]].x,A=g[e[0]].x,C=g[e[0]].y,i=g[e[0]].y,n;for(let o=1;o<e.length;o++)n=g[e[o]],t=n.x<t?n.x:t,A=n.x>A?n.x:A,C=n.y<C?n.y:C,i=n.y>i?n.y:i;return{x:.5*(t+A),y:.5*(C+i)}}openCluster(g,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(g===void 0)throw new Error("No clusterNodeId supplied to openCluster.");let A=this.body.nodes[g];if(A===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(A.isCluster!==!0||A.containedNodes===void 0||A.containedEdges===void 0)throw new Error("The node:"+g+" is not a valid cluster.");let C=this.findNode(g),i=G(C).call(C,g)-1;if(i>=0){let r=C[i];this.body.nodes[r]._openChildCluster(g),delete this.body.nodes[g],t===!0&&this.body.emitter.emit("_dataChanged");return}let n=A.containedNodes,o=A.containedEdges;if(e!==void 0&&e.releaseFunction!==void 0&&typeof e.releaseFunction=="function"){let r={},a={x:A.x,y:A.y};for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){let h=this.body.nodes[l];r[l]={x:h.x,y:h.y}}let d=e.releaseFunction(a,r);for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){let h=this.body.nodes[l];d[l]!==void 0&&(h.x=d[l].x===void 0?A.x:d[l].x,h.y=d[l].y===void 0?A.y:d[l].y)}}else S(n,function(r){r.options.fixed.x===!1&&(r.x=A.x),r.options.fixed.y===!1&&(r.y=A.y)});for(let r in n)if(Object.prototype.hasOwnProperty.call(n,r)){let a=this.body.nodes[r];a.vx=A.vx,a.vy=A.vy,a.setOptions({physics:!0}),delete this.clusteredNodes[r]}let s=[];for(let r=0;r<A.edges.length;r++)s.push(A.edges[r]);for(let r=0;r<s.length;r++){let a=s[r],d=this._getConnectedId(a,g),l=this.clusteredNodes[d];for(let h=0;h<a.clusteringEdgeReplacingIds.length;h++){let c=a.clusteringEdgeReplacingIds[h],p=this.body.edges[c];if(p!==void 0)if(l!==void 0){let u=this.body.nodes[l.clusterId];u.containedEdges[p.id]=p,delete o[p.id];let m=p.fromId,E=p.toId;p.toId==d?E=l.clusterId:m=l.clusterId,this._createClusteredEdge(m,E,p,u.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(p)}a.remove()}for(let r in o)Object.prototype.hasOwnProperty.call(o,r)&&this._restoreEdge(o[r]);delete this.body.nodes[g],t===!0&&this.body.emitter.emit("_dataChanged")}getNodesInCluster(g){let e=[];if(this.isCluster(g)===!0){let t=this.body.nodes[g].containedNodes;for(let A in t)Object.prototype.hasOwnProperty.call(t,A)&&e.push(this.body.nodes[A].id)}return e}findNode(g){let e=[],A=0,C;for(;this.clusteredNodes[g]!==void 0&&A<100;){if(C=this.body.nodes[g],C===void 0)return[];e.push(C.id),g=this.clusteredNodes[g].clusterId,A++}return C=this.body.nodes[g],C===void 0?[]:(e.push(C.id),ze(e).call(e),e)}updateClusteredNode(g,e){if(g===void 0)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(e===void 0)throw new Error("No newOptions supplied to updateClusteredNode.");if(this.body.nodes[g]===void 0)throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[g].setOptions(e),this.body.emitter.emit("_dataChanged")}updateEdge(g,e){if(g===void 0)throw new Error("No startEdgeId supplied to updateEdge.");if(e===void 0)throw new Error("No newOptions supplied to updateEdge.");if(this.body.edges[g]===void 0)throw new Error("The startEdgeId supplied to updateEdge does not exist.");let t=this.getClusteredEdges(g);for(let A=0;A<t.length;A++)this.body.edges[t[A]].setOptions(e);this.body.emitter.emit("_dataChanged")}getClusteredEdges(g){let e=[],A=0;for(;g!==void 0&&this.body.edges[g]!==void 0&&A<100;)e.push(this.body.edges[g].id),g=this.body.edges[g].edgeReplacedById,A++;return ze(e).call(e),e}getBaseEdge(g){return this.getBaseEdges(g)[0]}getBaseEdges(g){let e=[g],t=[],A=[],C=100,i=0;for(;e.length>0&&i<C;){let n=e.pop();if(n===void 0)continue;let o=this.body.edges[n];if(o===void 0)continue;i++;let s=o.clusteringEdgeReplacingIds;if(s===void 0)A.push(n);else for(let r=0;r<s.length;++r){let a=s[r];G(e).call(e,s)!==-1||G(t).call(t,s)!==-1||e.push(a)}t.push(n)}return A}_getConnectedId(g,e){return g.toId!=e?g.toId:(g.fromId!=e,g.fromId)}_getHubSize(){let g=0,e=0,t=0,A=0;for(let o=0;o<this.body.nodeIndices.length;o++){let s=this.body.nodes[this.body.nodeIndices[o]];s.edges.length>A&&(A=s.edges.length),g+=s.edges.length,e+=Math.pow(s.edges.length,2),t+=1}g=g/t,e=e/t;let C=e-Math.pow(g,2),i=Math.sqrt(C),n=Math.floor(g+2*i);return n>A&&(n=A),n}_createClusteredEdge(g,e,t,A,C){let i=dg.cloneOptions(t,"edge");_(i,A),i.from=g,i.to=e,i.id="clusterEdge:"+st(),C!==void 0&&_(i,C);let n=this.body.functions.createEdge(i);return n.clusteringEdgeReplacingIds=[t.id],n.connect(),this.body.edges[n.id]=n,n}_clusterEdges(g,e,t,A){if(e instanceof xe){let C=e,i={};i[C.id]=C,e=i}if(g instanceof pg){let C=g,i={};i[C.id]=C,g=i}if(t==null)throw new Error("_clusterEdges: parameter clusterNode required");A===void 0&&(A=t.clusterEdgeProperties),this._createClusterEdges(g,e,t,A);for(let C in e)if(Object.prototype.hasOwnProperty.call(e,C)&&this.body.edges[C]!==void 0){let i=this.body.edges[C];this._backupEdgeOptions(i),i.setOptions({physics:!1})}for(let C in g)Object.prototype.hasOwnProperty.call(g,C)&&(this.clusteredNodes[C]={clusterId:t.id,node:this.body.nodes[C]},this.body.nodes[C].setOptions({physics:!1}))}_getClusterNodeForNode(g){if(g===void 0)return;let e=this.clusteredNodes[g];if(e===void 0)return;let t=e.clusterId;if(t!==void 0)return this.body.nodes[t]}_filter(g,e){let t=[];return S(g,A=>{e(A)&&t.push(A)}),t}_updateState(){let g,e=[],t={},A=o=>{S(this.body.nodes,s=>{s.isCluster===!0&&o(s)})};for(g in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,g))continue;this.body.nodes[g]===void 0&&e.push(g)}A(function(o){for(let s=0;s<e.length;s++)delete o.containedNodes[e[s]]});for(let o=0;o<e.length;o++)delete this.clusteredNodes[e[o]];S(this.clusteredEdges,o=>{let s=this.body.edges[o];(s===void 0||!s.endPointsValid())&&(t[o]=o)}),A(function(o){S(o.containedEdges,(s,r)=>{!s.endPointsValid()&&!t[r]&&(t[r]=r)})}),S(this.body.edges,(o,s)=>{let r=!0,a=o.clusteringEdgeReplacingIds;if(a!==void 0){let d=0;S(a,l=>{let h=this.body.edges[l];h!==void 0&&h.endPointsValid()&&(d+=1)}),r=d>0}(!o.endPointsValid()||!r)&&(t[s]=s)}),A(o=>{S(t,s=>{delete o.containedEdges[s],S(o.edges,(r,a)=>{if(r.id===s){o.edges[a]=null;return}r.clusteringEdgeReplacingIds=this._filter(r.clusteringEdgeReplacingIds,function(d){return!t[d]})}),o.edges=this._filter(o.edges,function(r){return r!==null})})}),S(t,o=>{delete this.clusteredEdges[o]}),S(t,o=>{delete this.body.edges[o]});let C=U(this.body.edges);S(C,o=>{let s=this.body.edges[o],r=this._isClusteredNode(s.fromId)||this._isClusteredNode(s.toId);if(r!==this._isClusteredEdge(s.id))if(r){let a=this._getClusterNodeForNode(s.fromId);a!==void 0&&this._clusterEdges(this.body.nodes[s.fromId],s,a);let d=this._getClusterNodeForNode(s.toId);d!==void 0&&this._clusterEdges(this.body.nodes[s.toId],s,d)}else delete this._clusterEdges[o],this._restoreEdge(s)});let i=!1,n=!0;for(;n;){let o=[];A(function(s){let r=U(s.containedNodes).length,a=s.options.allowSingleNodeCluster===!0;(a&&r<1||!a&&r<2)&&o.push(s.id)});for(let s=0;s<o.length;++s)this.openCluster(o[s],{},!1);n=o.length>0,i=i||n}i&&this._updateState()}_isClusteredNode(g){return this.clusteredNodes[g]!==void 0}_isClusteredEdge(g){return this.clusteredEdges[g]!==void 0}},Rn=class{constructor(g,e){this.body=g,this.canvas=e,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},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var g;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=Hg(()=>{var e;this.zooming=!1,b(e=this._requestRedraw).call(e,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",b(g=this._requestRedraw).call(g,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(g){g!==void 0&&xt(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,g)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var g;this.requestAnimationFrameRequestId=window.requestAnimationFrame(b(g=this._renderStep).call(g,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 g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;let e={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();let t=this.canvas.getContext(),A=this.canvas.frame.canvas.clientWidth,C=this.canvas.frame.canvas.clientHeight;if(t.clearRect(0,0,A,C),this.canvas.frame.clientWidth===0)return;if(t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale),t.beginPath(),this.body.emitter.emit("beforeDrawing",t),t.closePath(),g===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(t),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){let{drawExternalLabels:i}=this._drawNodes(t,g);e.drawExternalLabels=i}g===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(t),e.drawExternalLabels!=null&&e.drawExternalLabels(),g===!1&&this._drawSelectionBox(t),t.beginPath(),this.body.emitter.emit("afterDrawing",t),t.closePath(),t.restore(),g===!0&&t.clearRect(0,0,A,C)}}_resizeNodes(){this.canvas.setTransform();let g=this.canvas.getContext();g.save(),g.translate(this.body.view.translation.x,this.body.view.translation.y),g.scale(this.body.view.scale,this.body.view.scale);let e=this.body.nodes,t;for(let A in e)Object.prototype.hasOwnProperty.call(e,A)&&(t=e[A],t.resize(g),t.updateBoundingBox(g,t.selected));g.restore()}_drawNodes(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.nodes,A=this.body.nodeIndices,C,i=[],n=[],o=20,s=this.canvas.DOMtoCanvas({x:-o,y:-o}),r=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+o,y:this.canvas.frame.canvas.clientHeight+o}),a={top:s.y,left:s.x,bottom:r.y,right:r.x},d=[];for(let p=0;p<A.length;p++)if(C=t[A[p]],C.hover)n.push(A[p]);else if(C.isSelected())i.push(A[p]);else if(e===!0){let u=C.draw(g);u.drawExternalLabel!=null&&d.push(u.drawExternalLabel)}else if(C.isBoundingBoxOverlappingWith(a)===!0){let u=C.draw(g);u.drawExternalLabel!=null&&d.push(u.drawExternalLabel)}else C.updateBoundingBox(g,C.selected);let l,h=i.length,c=n.length;for(l=0;l<h;l++){C=t[i[l]];let p=C.draw(g);p.drawExternalLabel!=null&&d.push(p.drawExternalLabel)}for(l=0;l<c;l++){C=t[n[l]];let p=C.draw(g);p.drawExternalLabel!=null&&d.push(p.drawExternalLabel)}return{drawExternalLabels:()=>{for(let p of d)p()}}}_drawEdges(g){let e=this.body.edges,t=this.body.edgeIndices;for(let A=0;A<t.length;A++){let C=e[t[A]];C.connected===!0&&C.draw(g)}}_drawArrows(g){let e=this.body.edges,t=this.body.edgeIndices;for(let A=0;A<t.length;A++){let C=e[t[A]];C.connected===!0&&C.drawArrows(g)}}_drawSelectionBox(g){if(this.body.selectionBox.show){g.beginPath();let e=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,t=this.body.selectionBox.position.end.y-this.body.selectionBox.position.start.y;g.rect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,e,t),g.fillStyle="rgba(151, 194, 252, 0.2)",g.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,e,t),g.strokeStyle="rgba(151, 194, 252, 1)",g.stroke()}else g.closePath()}},Gk=L,Vk=Gk.setInterval,jk=Vk,Wk=D(jk);function ZI(I,g){g.inputHandler=function(e){e.isFirst&&g(e)},I.on("hammer.input",g.inputHandler)}function xh(I,g){return g.inputHandler=function(e){e.isFinal&&g(e)},I.on("hammer.input",g.inputHandler)}var Nn=class{constructor(g){this.body=g,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var g;this.body.emitter.once("resize",e=>{e.width!==0&&(this.body.view.translation.x=e.width*.5),e.height!==0&&(this.body.view.translation.y=e.height*.5)}),this.body.emitter.on("setSize",b(g=this.setSize).call(g,this)),this.body.emitter.on("destroy",()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(g){if(g!==void 0&&xt(["width","height","autoResize"],this.options,g),this._cleanUp(),this.options.autoResize===!0){var e;if(window.ResizeObserver){let A=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:C}=this;A.observe(C),this._cleanupCallbacks.push(()=>{A.unobserve(C)})}else{let A=Wk(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(A)})}let t=b(e=this._onResize).call(e,this);window.addEventListener("resize",t),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",t)})}}_cleanUp(){var g,e,t;F(g=ze(e=Ug(t=this._cleanupCallbacks).call(t,0)).call(e)).call(g,A=>{try{A()}catch(C){console.error(C)}})}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/g,this.cameraState.previousHeight=this.frame.canvas.height/g,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/g,y:.5*this.frame.canvas.height/g}))}_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){let g=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,e=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,t=this.cameraState.scale;g!=1&&e!=1?t=this.cameraState.scale*.5*(g+e):g!=1?t=this.cameraState.scale*g:e!=1&&(t=this.cameraState.scale*e),this.body.view.scale=t;let A=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),C={x:A.x-this.cameraState.position.x,y:A.y-this.cameraState.position.y};this.body.view.translation.x+=C.x*this.body.view.scale,this.body.view.translation.y+=C.y*this.body.view.scale}}_prepareValue(g){if(typeof g=="number")return g+"px";if(typeof g=="string"){if(G(g).call(g,"%")!==-1||G(g).call(g,"px")!==-1)return g;if(G(g).call(g,"%")===-1)return g+"px"}throw new Error("Could not use the value supplied for width or height:"+g)}_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{let g=document.createElement("DIV");g.style.color="red",g.style.fontWeight="bold",g.style.padding="10px",g.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(g)}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 ot(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:ot.DIRECTION_ALL}),ZI(this.hammer,g=>{this.body.eventListeners.onTouch(g)}),this.hammer.on("tap",g=>{this.body.eventListeners.onTap(g)}),this.hammer.on("doubletap",g=>{this.body.eventListeners.onDoubleTap(g)}),this.hammer.on("press",g=>{this.body.eventListeners.onHold(g)}),this.hammer.on("panstart",g=>{this.body.eventListeners.onDragStart(g)}),this.hammer.on("panmove",g=>{this.body.eventListeners.onDrag(g)}),this.hammer.on("panend",g=>{this.body.eventListeners.onDragEnd(g)}),this.hammer.on("pinch",g=>{this.body.eventListeners.onPinch(g)}),this.frame.canvas.addEventListener("wheel",g=>{this.body.eventListeners.onMouseWheel(g)}),this.frame.canvas.addEventListener("mousemove",g=>{this.body.eventListeners.onMouseMove(g)}),this.frame.canvas.addEventListener("contextmenu",g=>{this.body.eventListeners.onContext(g)}),this.hammerFrame=new ot(this.frame),xh(this.hammerFrame,g=>{this.body.eventListeners.onRelease(g)})}setSize(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;g=this._prepareValue(g),e=this._prepareValue(e);let t=!1,A=this.frame.canvas.width,C=this.frame.canvas.height,i=this.pixelRatio;if(this._setPixelRatio(),g!=this.options.width||e!=this.options.height||this.frame.style.width!=g||this.frame.style.height!=e)this._getCameraState(i),this.frame.style.width=g,this.frame.style.height=e,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=g,this.options.height=e,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},t=!0;else{let n=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),o=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==n||this.frame.canvas.height!==o)&&this._getCameraState(i),this.frame.canvas.width!==n&&(this.frame.canvas.width=n,t=!0),this.frame.canvas.height!==o&&(this.frame.canvas.height=o,t=!0)}return t===!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(A/this.pixelRatio),oldHeight:Math.round(C/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,t}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){let g=this.getContext();if(g===void 0)throw new Error("Could not get canvax context");let e=1;typeof window!="undefined"&&(e=window.devicePixelRatio||1);let t=g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1;return e/t}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){let g=this.getContext();if(g===void 0)throw new Error("Could not get canvax context");g.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(g){return(g-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(g){return g*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(g){return(g-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(g){return g*this.body.view.scale+this.body.view.translation.y}canvasToDOM(g){return{x:this._XconvertCanvasToDOM(g.x),y:this._YconvertCanvasToDOM(g.y)}}DOMtoCanvas(g){return{x:this._XconvertDOMtoCanvas(g.x),y:this._YconvertDOMtoCanvas(g.y)}}};function Yk(I,g){let e=q({nodes:g,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},I!=null?I:{});if(!B(e.nodes))throw new TypeError("Nodes has to be an array of ids.");if(e.nodes.length===0&&(e.nodes=g),!(typeof e.minZoomLevel=="number"&&e.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof e.maxZoomLevel=="number"&&e.minZoomLevel<=e.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return e}var Sn=class{constructor(g,e){var t,A;this.body=g,this.canvas=e,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",b(t=this.fit).call(t,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",b(A=this.releaseNode).call(A,this))}setOptions(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=g}fit(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;g=Yk(g,this.body.nodeIndices);let t=this.canvas.frame.canvas.clientWidth,A=this.canvas.frame.canvas.clientHeight,C,i;if(t===0||A===0)i=1,C=dg.getRange(this.body.nodes,g.nodes);else if(e===!0){let s=0;for(let d in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,d)&&this.body.nodes[d].predefinedPosition===!0&&(s+=1);if(s>.5*this.body.nodeIndices.length){this.fit(g,!1);return}C=dg.getRange(this.body.nodes,g.nodes),i=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;let a=Math.min(t/600,A/600);i*=a}else{this.body.emitter.emit("_resizeNodes"),C=dg.getRange(this.body.nodes,g.nodes);let s=Math.abs(C.maxX-C.minX)*1.1,r=Math.abs(C.maxY-C.minY)*1.1,a=t/s,d=A/r;i=a<=d?a:d}i>g.maxZoomLevel?i=g.maxZoomLevel:i<g.minZoomLevel&&(i=g.minZoomLevel);let o={position:dg.findCenter(C),scale:i,animation:g.animation};this.moveTo(o)}focus(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[g]!==void 0){let t={x:this.body.nodes[g].x,y:this.body.nodes[g].y};e.position=t,e.lockedOnNode=g,this.moveTo(e)}else console.error("Node: "+g+" cannot be found.")}moveTo(g){if(g===void 0){g={};return}if(g.offset!=null){if(g.offset.x!=null){if(g.offset.x=+g.offset.x,!Me(g.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else g.offset.x=0;if(g.offset.y!=null){if(g.offset.y=+g.offset.y,!Me(g.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else g.offset.x=0}else g.offset={x:0,y:0};if(g.position!=null){if(g.position.x!=null){if(g.position.x=+g.position.x,!Me(g.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else g.position.x=0;if(g.position.y!=null){if(g.position.y=+g.position.y,!Me(g.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else g.position.x=0}else g.position=this.getViewPosition();if(g.scale!=null){if(g.scale=+g.scale,!(g.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else g.scale=this.body.view.scale;g.animation===void 0&&(g.animation={duration:0}),g.animation===!1&&(g.animation={duration:0}),g.animation===!0&&(g.animation={}),g.animation.duration===void 0&&(g.animation.duration=1e3),g.animation.easingFunction===void 0&&(g.animation.easingFunction="easeInOutQuad"),this.animateView(g)}animateView(g){if(g===void 0)return;this.animationEasingFunction=g.animation.easingFunction,this.releaseNode(),g.locked===!0&&(this.lockedOnNodeId=g.lockedOnNode,this.lockedOnNodeOffset=g.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=g.scale,this.body.view.scale=this.targetScale;let e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),t={x:e.x-g.position.x,y:e.y-g.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+t.x*this.targetScale+g.offset.x,y:this.sourceTranslation.y+t.y*this.targetScale+g.offset.y},g.animation.duration===0)if(this.lockedOnNodeId!=null){var A;this.viewFunction=b(A=this._lockedRedraw).call(A,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 C;this.animationSpeed=1/(60*g.animation.duration*.001)||1/60,this.animationEasingFunction=g.animation.easingFunction,this.viewFunction=b(C=this._transitionRedraw).call(C,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}_lockedRedraw(){let g={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),t={x:e.x-g.x,y:e.y-g.y},A=this.body.view.translation,C={x:A.x+t.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:A.y+t.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=C}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 g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=g===!0?1:this.easingTime;let e=WO[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*e,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*e,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*e},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var t;this.viewFunction=b(t=this._lockedRedraw).call(t,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})}},_k=`div.vis-network div.vis-navigation div.vis-button {
644
+ `}static print(e){return Et(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,g){if(e.length===0)return g.length;if(g.length===0)return e.length;let t=[],A;for(A=0;A<=g.length;A++)t[A]=[A];let C;for(C=0;C<=e.length;C++)t[0][C]=C;for(A=1;A<=g.length;A++)for(C=1;C<=e.length;C++)g.charAt(A-1)==e.charAt(C-1)?t[A][C]=t[A-1][C-1]:t[A][C]=Math.min(t[A-1][C-1]+1,Math.min(t[A][C-1]+1,t[A-1][C]+1));return t[g.length][e.length]}},$O=Ke,qO=QO,ot=vo,e1=XO,jl=Wi,g1=JO;function t1(I){return mg=I,i1()}var Wl={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},yo=wg(Wl);yo.color="color.color";yo.style="dashes";var me={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},Pr={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},mg="",ut=0,R="",P="",we=me.NULL;function A1(){ut=0,R=mg.charAt(0)}function oe(){ut++,R=mg.charAt(ut)}function gt(){return mg.charAt(ut+1)}function Dr(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 Og(I,e){if(I||(I={}),e)for(var g in e)e.hasOwnProperty(g)&&(I[g]=e[g]);return I}function I1(I,e,g){for(var t=e.split("."),A=I;t.length;){var C=t.shift();t.length?(A[C]||(A[C]={}),A=A[C]):A[C]=g}}function Yl(I,e){for(var g,t,A=null,C=[I],i=I;i.parent;)C.push(i.parent),i=i.parent;if(i.nodes){for(g=0,t=i.nodes.length;g<t;g++)if(e.id===i.nodes[g].id){A=i.nodes[g];break}}for(A||(A={id:e.id},I.node&&(A.attr=Og(A.attr,I.node))),g=C.length-1;g>=0;g--){var n,o=C[g];o.nodes||(o.nodes=[]),G(n=o.nodes).call(n,A)===-1&&o.nodes.push(A)}e.attr&&(A.attr=Og(A.attr,e.attr))}function C1(I,e){if(I.edges||(I.edges=[]),I.edges.push(e),I.edge){var g=Og({},I.edge);e.attr=Og(g,e.attr)}}function _l(I,e,g,t,A){var C={from:e,to:g,type:t};return I.edge&&(C.attr=Og({},I.edge)),C.attr=Og(C.attr||{},A),A!=null&&A.hasOwnProperty("arrows")&&A.arrows!=null&&(C.arrows={to:{enabled:!0,type:A.arrows.type}},A.arrows=null),C}function K(){for(we=me.NULL,P="";R===" "||R===" "||R===`
645
+ `||R==="\r";)oe();do{var I=!1;if(R==="#"){for(var e=ut-1;mg.charAt(e)===" "||mg.charAt(e)===" ";)e--;if(mg.charAt(e)===`
646
+ `||mg.charAt(e)===""){for(;R!=""&&R!=`
647
+ `;)oe();I=!0}}if(R==="/"&&gt()==="/"){for(;R!=""&&R!=`
648
+ `;)oe();I=!0}if(R==="/"&&gt()==="*"){for(;R!="";)if(R==="*"&&gt()==="/"){oe(),oe();break}else oe();I=!0}for(;R===" "||R===" "||R===`
649
+ `||R==="\r";)oe()}while(I);if(R===""){we=me.DELIMITER;return}var g=R+gt();if(Pr[g]){we=me.DELIMITER,P=g,oe(),oe();return}if(Pr[R]){we=me.DELIMITER,P=R,oe();return}if(Dr(R)||R==="-"){for(P+=R,oe();Dr(R);)P+=R,oe();P==="false"?P=!1:P==="true"?P=!0:isNaN(Number(P))||(P=Number(P)),we=me.IDENTIFIER;return}if(R==='"'){for(oe();R!=""&&(R!='"'||R==='"'&&gt()==='"');)R==='"'?(P+=R,oe()):R==="\\"&&gt()==="n"?(P+=`
650
+ `,oe()):P+=R,oe();if(R!='"')throw ve('End of string " expected');oe(),we=me.IDENTIFIER;return}for(we=me.UNKNOWN;R!="";)P+=R,oe();throw new SyntaxError('Syntax error in part "'+Ql(P,30)+'"')}function i1(){var I={};if(A1(),K(),P==="strict"&&(I.strict=!0,K()),(P==="graph"||P==="digraph")&&(I.type=P,K()),we===me.IDENTIFIER&&(I.id=P,K()),P!="{")throw ve("Angle bracket { expected");if(K(),Kl(I),P!="}")throw ve("Angle bracket } expected");if(K(),P!=="")throw ve("End of file expected");return K(),delete I.node,delete I.edge,delete I.graph,I}function Kl(I){for(;P!==""&&P!="}";)n1(I),P===";"&&K()}function n1(I){var e=Ul(I);if(e){Hl(I,e);return}var g=o1(I);if(!g){if(we!=me.IDENTIFIER)throw ve("Identifier expected");var t=P;if(K(),P==="="){if(K(),we!=me.IDENTIFIER)throw ve("Identifier expected");I[t]=P,K()}else s1(I,t)}}function Ul(I){var e=null;if(P==="subgraph"&&(e={},e.type="subgraph",K(),we===me.IDENTIFIER&&(e.id=P,K())),P==="{"){if(K(),e||(e={}),e.parent=I,e.node=I.node,e.edge=I.edge,e.graph=I.graph,Kl(e),P!="}")throw ve("Angle bracket } expected");K(),delete e.node,delete e.edge,delete e.graph,delete e.parent,I.subgraphs||(I.subgraphs=[]),I.subgraphs.push(e)}return e}function o1(I){return P==="node"?(K(),I.node=Vt(),"node"):P==="edge"?(K(),I.edge=Vt(),"edge"):P==="graph"?(K(),I.graph=Vt(),"graph"):null}function s1(I,e){var g={id:e},t=Vt();t&&(g.attr=t),Yl(I,g),Hl(I,e)}function Hl(I,e){for(;P==="->"||P==="--";){var g,t=P;K();var A=Ul(I);if(A)g=A;else{if(we!=me.IDENTIFIER)throw ve("Identifier or subgraph expected");g=P,Yl(I,{id:g}),K()}var C=Vt(),i=_l(I,e,g,t,C);C1(I,i),e=g}}function Vt(){for(var I,e=null,g={dashed:!0,solid:!1,dotted:[1,5]},t={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},A=new Array,C=new Array;P==="[";){for(K(),e={};P!==""&&P!="]";){if(we!=me.IDENTIFIER)throw ve("Attribute name expected");var i=P;if(K(),P!="=")throw ve("Equal sign = expected");if(K(),we!=me.IDENTIFIER)throw ve("Attribute value expected");var n=P;i==="style"&&(n=g[n]);var o;i==="arrowhead"&&(o=t[n],i="arrows",n={to:{enabled:!0,type:o}}),i==="arrowtail"&&(o=t[n],i="arrows",n={from:{enabled:!0,type:o}}),A.push({attr:e,name:i,value:n}),C.push(i),K(),P==","&&K()}if(P!="]")throw ve("Bracket ] expected");K()}if(yg(C).call(C,"dir")){var s={};for(s.arrows={},I=0;I<A.length;I++)if(A[I].name==="arrows")if(A[I].value.to!=null)s.arrows.to=I;else if(A[I].value.from!=null)s.arrows.from=I;else throw ve("Invalid value of arrows");else A[I].name==="dir"&&(s.dir=I);var r=A[s.dir].value;if(!yg(C).call(C,"arrows"))if(r==="both")A.push({attr:A[s.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),s.arrows.to=A.length-1,A.push({attr:A[s.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),s.arrows.from=A.length-1;else if(r==="forward")A.push({attr:A[s.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),s.arrows.to=A.length-1;else if(r==="back")A.push({attr:A[s.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),s.arrows.from=A.length-1;else if(r==="none")A.push({attr:A[s.dir].attr,name:"arrows",value:""}),s.arrows.to=A.length-1;else throw ve('Invalid dir type "'+r+'"');var a,d;if(r==="both")s.arrows.to&&s.arrows.from?(d=A[s.arrows.to].value.to.type,a=A[s.arrows.from].value.from.type,A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}},Ue(A).call(A,s.arrows.from,1)):s.arrows.to?(d=A[s.arrows.to].value.to.type,a="arrow",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.from&&(d="arrow",a=A[s.arrows.from].value.from.type,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}});else if(r==="back")s.arrows.to&&s.arrows.from?(d="",a=A[s.arrows.from].value.from.type,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.to?(d="",a="arrow",s.arrows.from=s.arrows.to,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.from&&(d="",a=A[s.arrows.from].value.from.type,A[s.arrows.to]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}),A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{from:{enabled:!0,type:A[s.arrows.from].value.from.type}}};else if(r==="none"){var l;s.arrows.to?l=s.arrows.to:l=s.arrows.from,A[l]={attr:A[l].attr,name:A[l].name,value:""}}else if(r==="forward")s.arrows.to&&s.arrows.from?(d=A[s.arrows.to].value.to.type,a="",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.to?(d=A[s.arrows.to].value.to.type,a="",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}):s.arrows.from&&(d="arrow",a="",s.arrows.to=s.arrows.from,A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:a}}}),A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:A[s.arrows.to].value.to.type}}};else throw ve('Invalid dir type "'+r+'"');Ue(A).call(A,s.dir,1)}var h;if(yg(C).call(C,"penwidth")){var c=[];for(h=A.length,I=0;I<h;I++)A[I].name!=="width"&&(A[I].name==="penwidth"&&(A[I].name="width"),c.push(A[I]));A=c}for(h=A.length,I=0;I<h;I++)I1(A[I].attr,A[I].name,A[I].value);return e}function ve(I){return new SyntaxError(I+', got "'+Ql(P,30)+'" (char '+ut+")")}function Ql(I,e){return I.length<=e?I:I.substr(0,27)+"..."}function r1(I,e,g){B(I)?F(I).call(I,function(t){B(e)?F(e).call(e,function(A){g(t,A)}):g(t,e)}):B(e)?F(e).call(e,function(t){g(I,t)}):g(I,e)}function ei(I,e,g){for(var t=e.split("."),A=t.pop(),C=I,i=0;i<t.length;i++){var n=t[i];n in C||(C[n]={}),C=C[n]}return C[A]=g,I}function Nr(I,e){var g={};for(var t in I)if(I.hasOwnProperty(t)){var A=e[t];B(A)?F(A).call(A,function(C){ei(g,C,I[t])}):typeof A=="string"?ei(g,A,I[t]):ei(g,t,I[t])}return g}function a1(I){var e=t1(I),g={nodes:[],edges:[],options:{}};if(e.nodes){var t;F(t=e.nodes).call(t,function(i){var n={id:i.id,label:String(i.label||i.id)};Og(n,Nr(i.attr,Wl)),n.image&&(n.shape="image"),g.nodes.push(n)})}if(e.edges){var A,C=function(i){var n={from:i.from,to:i.to};return Og(n,Nr(i.attr,yo)),n.arrows==null&&i.type==="->"&&(n.arrows="to"),n};F(A=e.edges).call(A,function(i){var n,o;if(i.from instanceof Object?n=i.from.nodes:n={id:i.from},i.to instanceof Object?o=i.to.nodes:o={id:i.to},i.from instanceof Object&&i.from.edges){var s;F(s=i.from.edges).call(s,function(a){var d=C(a);g.edges.push(d)})}if(r1(n,o,function(a,d){var l=_l(g,a.id,d.id,i.type,i.attr),h=C(l);g.edges.push(h)}),i.to instanceof Object&&i.to.edges){var r;F(r=i.to.edges).call(r,function(a){var d=C(a);g.edges.push(d)})}})}return e.attr&&(g.options=e.attr),g}function d1(I,e){var g;let t={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};e!=null&&(e.fixed!=null&&(t.nodes.fixed=e.fixed),e.parseColor!=null&&(t.nodes.parseColor=e.parseColor),e.inheritColor!=null&&(t.edges.inheritColor=e.inheritColor));let A=I.edges,C=ae(A).call(A,n=>{let o={from:n.source,id:n.id,to:n.target};return n.attributes!=null&&(o.attributes=n.attributes),n.label!=null&&(o.label=n.label),n.attributes!=null&&n.attributes.title!=null&&(o.title=n.attributes.title),n.type==="Directed"&&(o.arrows="to"),n.color&&t.edges.inheritColor===!1&&(o.color=n.color),o});return{nodes:ae(g=I.nodes).call(g,n=>{let o={id:n.id,fixed:t.nodes.fixed&&n.x!=null&&n.y!=null};return n.attributes!=null&&(o.attributes=n.attributes),n.label!=null&&(o.label=n.label),n.size!=null&&(o.size=n.size),n.attributes!=null&&n.attributes.title!=null&&(o.title=n.attributes.title),n.title!=null&&(o.title=n.title),n.x!=null&&(o.x=n.x),n.y!=null&&(o.y=n.y),n.color!=null&&(t.nodes.parseColor===!0?o.color=n.color:o.color={background:n.color,border:n.color,highlight:{background:n.color,border:n.color},hover:{background:n.color,border:n.color}}),o}),edges:C}}var l1={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"},h1={addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzuf\xFCgen",addNode:"Knoten hinzuf\xFCgen",back:"Zur\xFCck",close:"Schlie\xDFen",createEdgeError:"Es ist nicht m\xF6glich, Kanten mit Clustern zu verbinden.",del:"L\xF6sche Auswahl",deleteClusterError:"Cluster k\xF6nnen nicht gel\xF6scht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster k\xF6nnen nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},c1={addDescription:"Haga clic en un lugar vac\xEDo para colocar un nuevo nodo.",addEdge:"A\xF1adir arista",addNode:"A\xF1adir nodo",back:"Atr\xE1s",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selecci\xF3n",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},u1={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"},f1={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"},p1={addDescription:"Clique em um espa\xE7o em branco para adicionar um novo n\xF3",addEdge:"Adicionar aresta",addNode:"Adicionar n\xF3",back:"Voltar",close:"Fechar",createEdgeError:"N\xE3o foi poss\xEDvel linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters n\xE3o puderam ser removidos.",edgeDescription:"Clique em um n\xF3 e arraste a aresta at\xE9 outro n\xF3 para conect\xE1-los",edit:"Editar",editClusterError:"Clusters n\xE3o puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um n\xF3 para conect\xE1-los",editNode:"Editar n\xF3"},m1={addDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u0432 \u0441\u0432\u043E\u0431\u043E\u0434\u043D\u043E\u0435 \u043C\u0435\u0441\u0442\u043E, \u0447\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u0443\u0437\u0435\u043B.",addEdge:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u043E",addNode:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0443\u0437\u0435\u043B",back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C",createEdgeError:"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u0430 \u0432 \u043A\u043B\u0430\u0441\u0442\u0435\u0440.",del:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435",deleteClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0443\u0434\u0430\u043B\u0435\u043D\u044B",edgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u0443\u0437\u0435\u043B \u0438 \u043F\u0440\u043E\u0442\u044F\u043D\u0438\u0442\u0435 \u0440\u0435\u0431\u0440\u043E \u043A \u0434\u0440\u0443\u0433\u043E\u043C\u0443 \u0443\u0437\u043B\u0443, \u0447\u0442\u043E\u0431\u044B \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0438\u0445.",edit:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C",editClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F.",editEdge:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0435\u0431\u0440\u043E",editEdgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u0438 \u043F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u0445 \u0432 \u0443\u0437\u0435\u043B, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043A \u043D\u0435\u043C\u0443.",editNode:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0443\u0437\u0435\u043B"},v1={addDescription:"\u5355\u51FB\u7A7A\u767D\u5904\u653E\u7F6E\u65B0\u8282\u70B9\u3002",addEdge:"\u6DFB\u52A0\u8FDE\u63A5\u7EBF",addNode:"\u6DFB\u52A0\u8282\u70B9",back:"\u8FD4\u56DE",close:"\u95DC\u9589",createEdgeError:"\u65E0\u6CD5\u5C06\u8FDE\u63A5\u7EBF\u8FDE\u63A5\u5230\u7FA4\u96C6\u3002",del:"\u5220\u9664\u9009\u5B9A",deleteClusterError:"\u65E0\u6CD5\u5220\u9664\u7FA4\u96C6\u3002",edgeDescription:"\u5355\u51FB\u67D0\u4E2A\u8282\u70B9\u5E76\u5C06\u8BE5\u8FDE\u63A5\u7EBF\u62D6\u52A8\u5230\u53E6\u4E00\u4E2A\u8282\u70B9\u4EE5\u8FDE\u63A5\u5B83\u4EEC\u3002",edit:"\u7F16\u8F91",editClusterError:"\u65E0\u6CD5\u7F16\u8F91\u7FA4\u96C6\u3002",editEdge:"\u7F16\u8F91\u8FDE\u63A5\u7EBF",editEdgeDescription:"\u5355\u51FB\u63A7\u5236\u8282\u70B9\u5E76\u5C06\u5B83\u4EEC\u62D6\u5230\u8282\u70B9\u4E0A\u8FDE\u63A5\u3002",editNode:"\u7F16\u8F91\u8282\u70B9"},b1={addDescription:"K\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0456\u043B\u044C\u043D\u0435 \u043C\u0456\u0441\u0446\u0435, \u0449\u043E\u0431 \u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0432\u0443\u0437\u043E\u043B.",addEdge:"\u0414\u043E\u0434\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",addNode:"\u0414\u043E\u0434\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B",back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u0438\u0442\u0438",createEdgeError:"\u041D\u0435 \u043C\u043E\u0436\u043B\u0438\u0432\u043E \u043E\u0431'\u0454\u0434\u043D\u0430\u0442\u0438 \u043A\u0440\u0430\u0457 \u0432 \u0433\u0440\u0443\u043F\u0443.",del:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043E\u0431\u0440\u0430\u043D\u0435",deleteClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435 \u043C\u043E\u0436\u0443\u0442\u044C \u0431\u0443\u0442\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u0456.",edgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0443\u0437\u043E\u043B \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u043A\u0440\u0430\u0439 \u0434\u043E \u0456\u043D\u0448\u043E\u0433\u043E \u0432\u0443\u0437\u043B\u0430, \u0449\u043E\u0431 \u0457\u0445 \u0437'\u0454\u0434\u043D\u0430\u0442\u0438.",edit:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438",editClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043D\u043D\u044F.",editEdge:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",editEdgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u0456 \u0442\u043E\u0447\u043A\u0438 \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0457\u0445 \u0443 \u0432\u0443\u0437\u043E\u043B, \u0449\u043E\u0431 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0438\u0441\u044F \u0434\u043E \u043D\u044C\u043E\u0433\u043E.",editNode:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B"},y1={addDescription:"Cliquez dans un endroit vide pour placer un n\u0153ud.",addEdge:"Ajouter un lien",addNode:"Ajouter un n\u0153ud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de cr\xE9er un lien vers un cluster.",del:"Effacer la s\xE9lection",deleteClusterError:"Les clusters ne peuvent pas \xEAtre effac\xE9s.",edgeDescription:"Cliquez sur un n\u0153ud et glissez le lien vers un autre n\u0153ud pour les connecter.",edit:"\xC9diter",editClusterError:"Les clusters ne peuvent pas \xEAtre \xE9dit\xE9s.",editEdge:"\xC9diter le lien",editEdgeDescription:"Cliquez sur les points de contr\xF4le et glissez-les pour connecter un n\u0153ud.",editNode:"\xC9diter le n\u0153ud"},w1={addDescription:"Kluknut\xEDm do pr\xE1zdn\xE9ho prostoru m\u016F\u017Eete p\u0159idat nov\xFD vrchol.",addEdge:"P\u0159idat hranu",addNode:"P\u0159idat vrchol",back:"Zp\u011Bt",close:"Zav\u0159\xEDt",createEdgeError:"Nelze p\u0159ipojit hranu ke shluku.",del:"Smazat v\xFDb\u011Br",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"P\u0159eta\u017Een\xEDm z jednoho vrcholu do druh\xE9ho m\u016F\u017Eete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"P\u0159eta\u017Een\xEDm kontroln\xEDho vrcholu hrany ji m\u016F\u017Eete p\u0159ipojit k jin\xE9mu vrcholu.",editNode:"Upravit vrchol"},E1=Object.freeze({__proto__:null,cn:v1,cs:w1,de:h1,en:l1,es:c1,fr:y1,it:u1,nl:f1,pt:p1,ru:m1,uk:b1});function T1(I,e){try{let[t,A]=e.split(/[-_ /]/,2),C=t!=null?t.toLowerCase():null,i=A!=null?A.toUpperCase():null;if(C&&i){let n=C+"-"+i;if(Object.prototype.hasOwnProperty.call(I,n))return n;var g;console.warn($d(g="Unknown variant ".concat(i," of language ")).call(g,C,"."))}if(C){let n=C;if(Object.prototype.hasOwnProperty.call(I,n))return n;console.warn("Unknown language ".concat(C))}return console.warn("Unknown locale ".concat(e,", falling back to English.")),"en"}catch(t){return console.error(t),console.warn("Unexpected error while normalizing locale ".concat(e,", falling back to English.")),"en"}}var Yi=class{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;let e=this.image.width,g=this.image.height;this.width=e,this.height=g;let t=Math.floor(g/2),A=Math.floor(g/4),C=Math.floor(g/8),i=Math.floor(g/16),n=Math.floor(e/2),o=Math.floor(e/4),s=Math.floor(e/8),r=Math.floor(e/16);this.canvas.width=3*o,this.canvas.height=t,this.coordinates=[[0,0,n,t],[n,0,o,A],[n,A,s,C],[5*s,A,r,i]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){let e=this.canvas.getContext("2d"),g=this.coordinates[0];e.drawImage(this.image,g[0],g[1],g[2],g[3]);for(let t=1;t<this.NUM_ITERATIONS;t++){let A=this.coordinates[t-1],C=this.coordinates[t];e.drawImage(this.canvas,A[0],A[1],A[2],A[3],C[0],C[1],C[2],C[3])}}drawImageAtPosition(e,g,t,A,C,i){if(this.initialized())if(g>2){g*=.5;let n=0;for(;g>2&&n<this.NUM_ITERATIONS;)g*=.5,n+=1;n>=this.NUM_ITERATIONS&&(n=this.NUM_ITERATIONS-1);let o=this.coordinates[n];e.drawImage(this.canvas,o[0],o[1],o[2],o[3],t,A,C,i)}else e.drawImage(this.image,t,A,C,i)}},_i=class{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,g,t){if(!(e===void 0||t===void 0)){if(g===void 0){console.warn("No broken url image defined");return}t.image.onerror=()=>{console.error("Could not load brokenImage:",g)},t.image.src=g}}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,g){let t=this.images[e];if(t)return t;let A=new Yi;return this.images[e]=A,A.image.onload=()=>{this._fixImageCoordinates(A.image),A.init(),this._redrawWithImage(A)},A.image.onerror=()=>{console.error("Could not load image:",e),this._tryloadBrokenUrl(e,g,A)},A.image.src=e,A}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}},Xl={exports:{}},x1=z,O1=x1(function(){if(typeof ArrayBuffer=="function"){var I=new ArrayBuffer(8);Object.isExtensible(I)&&Object.defineProperty(I,"a",{value:8})}}),P1=z,D1=ce,N1=sg,Rr=O1,oI=Object.isExtensible,R1=P1(function(){oI(1)}),S1=R1||Rr?function(e){return!D1(e)||Rr&&N1(e)==="ArrayBuffer"?!1:oI?oI(e):!0}:oI,k1=z,Jl=!k1(function(){return Object.isExtensible(Object.preventExtensions({}))}),M1=N,F1=Z,B1=lA,z1=ce,wo=ne,Z1=Oe.f,Sr=mA,L1=XI,Eo=S1,G1=WI,V1=Jl,$l=!1,ng=G1("meta"),j1=0,To=function(I){Z1(I,ng,{value:{objectID:"O"+j1++,weakData:{}}})},W1=function(I,e){if(!z1(I))return typeof I=="symbol"?I:(typeof I=="string"?"S":"P")+I;if(!wo(I,ng)){if(!Eo(I))return"F";if(!e)return"E";To(I)}return I[ng].objectID},Y1=function(I,e){if(!wo(I,ng)){if(!Eo(I))return!0;if(!e)return!1;To(I)}return I[ng].weakData},_1=function(I){return V1&&$l&&Eo(I)&&!wo(I,ng)&&To(I),I},K1=function(){U1.enable=function(){},$l=!0;var I=Sr.f,e=F1([].splice),g={};g[ng]=1,I(g).length&&(Sr.f=function(t){for(var A=I(t),C=0,i=A.length;C<i;C++)if(A[C]===ng){e(A,C,1);break}return A},M1({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:L1.f}))},U1=Xl.exports={enable:K1,fastKey:W1,getWeakData:Y1,onFreeze:_1};B1[ng]=!0;var nC=Xl.exports,H1=ee,Q1=yt,X1=H1("iterator"),J1=Array.prototype,$1=function(I){return I!==void 0&&(Q1.Array===I||J1[X1]===I)},q1=ag,kr=Qn,eP=ft,gP=yt,tP=ee,AP=tP("iterator"),ql=function(I){if(!eP(I))return kr(I,AP)||kr(I,"@@iterator")||gP[q1(I)]},IP=je,CP=Yg,iP=rg,nP=sA,oP=ql,sP=TypeError,eh=function(I,e){var g=arguments.length<2?oP(I):e;if(CP(g))return iP(IP(g,I));throw new sP(nP(I)+" is not iterable")},rP=je,Mr=rg,aP=Qn,dP=function(I,e,g){var t,A;Mr(I);try{if(t=aP(I,"return"),!t){if(e==="throw")throw g;return g}t=rP(t,I)}catch(C){A=!0,t=C}if(e==="throw")throw g;if(A)throw t;return Mr(t),g},lP=aA,hP=je,cP=rg,uP=sA,fP=$1,pP=Se,Fr=J,mP=eh,vP=ql,Br=dP,bP=TypeError,sI=function(I,e){this.stopped=I,this.result=e},zr=sI.prototype,xo=function(I,e,g){var t=g&&g.that,A=!!(g&&g.AS_ENTRIES),C=!!(g&&g.IS_RECORD),i=!!(g&&g.IS_ITERATOR),n=!!(g&&g.INTERRUPTED),o=lP(e,t),s,r,a,d,l,h,c,p=function(m){return s&&Br(s,"normal",m),new sI(!0,m)},u=function(m){return A?(cP(m),n?o(m[0],m[1],p):o(m[0],m[1])):n?o(m,p):o(m)};if(C)s=I.iterator;else if(i)s=I;else{if(r=vP(I),!r)throw new bP(uP(I)+" is not iterable");if(fP(r)){for(a=0,d=pP(I);d>a;a++)if(l=u(I[a]),l&&Fr(zr,l))return l;return new sI(!1)}s=mP(I,r)}for(h=C?I.next:s.next;!(c=hP(h,s)).done;){try{l=u(c.value)}catch(m){Br(s,"throw",m)}if(typeof l=="object"&&l&&Fr(zr,l))return l}return new sI(!1)},yP=J,wP=TypeError,Oo=function(I,e){if(yP(e,I))return I;throw new wP("Incorrect invocation")},EP=N,TP=X,xP=nC,OP=z,PP=vt,DP=xo,NP=Oo,RP=le,SP=ce,kP=ft,MP=bt,FP=Oe.f,BP=Ng.forEach,zP=ie,gh=Kg,ZP=gh.set,LP=gh.getterFor,Po=function(I,e,g){var t=I.indexOf("Map")!==-1,A=I.indexOf("Weak")!==-1,C=t?"set":"add",i=TP[I],n=i&&i.prototype,o={},s;if(!zP||!RP(i)||!(A||n.forEach&&!OP(function(){new i().entries().next()})))s=g.getConstructor(e,I,t,C),xP.enable();else{s=e(function(d,l){ZP(NP(d,r),{type:I,collection:new i}),kP(l)||DP(l,d[C],{that:d,AS_ENTRIES:t})});var r=s.prototype,a=LP(I);BP(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(d){var l=d==="add"||d==="set";d in n&&!(A&&d==="clear")&&PP(r,d,function(h,c){var p=a(this).collection;if(!l&&A&&!SP(h))return d==="get"?void 0:!1;var u=p[d](h===0?0:h,c);return l?this:u})}),A||FP(r,"size",{configurable:!0,get:function(){return a(this).collection.size}})}return MP(s,I,!1,!0),o[I]=s,EP({global:!0,forced:!0},o),A||g.setStrong(s,I,t),s},GP=vA,Do=function(I,e,g){for(var t in e)g&&g.unsafe&&I[t]?I[t]=e[t]:GP(I,t,e[t],g);return I},VP=Ye,jP=Ao,WP=ee,YP=ie,Zr=WP("species"),_P=function(I){var e=VP(I);YP&&e&&!e[Zr]&&jP(e,Zr,{configurable:!0,get:function(){return this}})},KP=pA,UP=Ao,Lr=Do,HP=aA,QP=Oo,XP=ft,JP=xo,$P=so,QA=ro,qP=_P,Rt=ie,Gr=nC.fastKey,th=Kg,Vr=th.set,gi=th.getterFor,Ah={getConstructor:function(I,e,g,t){var A=I(function(s,r){QP(s,C),Vr(s,{type:e,index:KP(null),first:void 0,last:void 0,size:0}),Rt||(s.size=0),XP(r)||JP(r,s[t],{that:s,AS_ENTRIES:g})}),C=A.prototype,i=gi(e),n=function(s,r,a){var d=i(s),l=o(s,r),h,c;return l?l.value=a:(d.last=l={index:c=Gr(r,!0),key:r,value:a,previous:h=d.last,next:void 0,removed:!1},d.first||(d.first=l),h&&(h.next=l),Rt?d.size++:s.size++,c!=="F"&&(d.index[c]=l)),s},o=function(s,r){var a=i(s),d=Gr(r),l;if(d!=="F")return a.index[d];for(l=a.first;l;l=l.next)if(l.key===r)return l};return Lr(C,{clear:function(){for(var r=this,a=i(r),d=a.index,l=a.first;l;)l.removed=!0,l.previous&&(l.previous=l.previous.next=void 0),delete d[l.index],l=l.next;a.first=a.last=void 0,Rt?a.size=0:r.size=0},delete:function(s){var r=this,a=i(r),d=o(r,s);if(d){var l=d.next,h=d.previous;delete a.index[d.index],d.removed=!0,h&&(h.next=l),l&&(l.previous=h),a.first===d&&(a.first=l),a.last===d&&(a.last=h),Rt?a.size--:r.size--}return!!d},forEach:function(r){for(var a=i(this),d=HP(r,arguments.length>1?arguments[1]:void 0),l;l=l?l.next:a.first;)for(d(l.value,l.key,this);l&&l.removed;)l=l.previous},has:function(r){return!!o(this,r)}}),Lr(C,g?{get:function(r){var a=o(this,r);return a&&a.value},set:function(r,a){return n(this,r===0?0:r,a)}}:{add:function(r){return n(this,r=r===0?0:r,r)}}),Rt&&UP(C,"size",{configurable:!0,get:function(){return i(this).size}}),A},setStrong:function(I,e,g){var t=e+" Iterator",A=gi(e),C=gi(t);$P(I,e,function(i,n){Vr(this,{type:t,target:i,state:A(i),kind:n,last:void 0})},function(){for(var i=C(this),n=i.kind,o=i.last;o&&o.removed;)o=o.previous;return!i.target||!(i.last=o=o?o.next:i.state.first)?(i.target=void 0,QA(void 0,!0)):QA(n==="keys"?o.key:n==="values"?o.value:[o.key,o.value],!1)},g?"entries":"values",!g,!0),qP(e)}},eD=Po,gD=Ah;eD("Map",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},gD);var No=Z,tD=_I,AD=qe,ID=CA,CD=No("".charAt),jr=No("".charCodeAt),iD=No("".slice),Wr=function(I){return function(e,g){var t=AD(ID(e)),A=tD(g),C=t.length,i,n;return A<0||A>=C?I?"":void 0:(i=jr(t,A),i<55296||i>56319||A+1===C||(n=jr(t,A+1))<56320||n>57343?I?CD(t,A):i:I?iD(t,A,A+2):(i-55296<<10)+(n-56320)+65536)}},nD={codeAt:Wr(!1),charAt:Wr(!0)},oD=nD.charAt,sD=qe,Ih=Kg,rD=so,Yr=ro,Ch="String Iterator",aD=Ih.set,dD=Ih.getterFor(Ch);rD(String,"String",function(I){aD(this,{type:Ch,string:sD(I),index:0})},function(){var e=dD(this),g=e.string,t=e.index,A;return t>=g.length?Yr(void 0,!0):(A=oD(g,t),e.index+=A.length,Yr(A,!1))});var lD=L,hD=lD.Map,cD=hD,uD=cD,fD=uD,NA=D(fD),Ki=class{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},q(this.options,this.defaultOptions)}setOptions(e){let g=["useDefaultGroups"];if(e!==void 0){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&G(g).call(g,t)===-1){let A=e[t];this.add(t,A)}}}clear(){this._groups=new NA,this._groupNames=[]}get(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this._groups.get(e);if(t===void 0&&g)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){let A=this._groupIndex%this._groupNames.length;++this._groupIndex,t={},t.color=this._groups.get(this._groupNames[A]),this._groups.set(e,t)}else{let A=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,t={},t.color=this._defaultGroups[A],this._groups.set(e,t)}return t}add(e,g){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,g),g}},pD=N;pD({target:"Number",stat:!0},{isNaN:function(e){return e!==e}});var mD=L,vD=mD.Number.isNaN,bD=vD,yD=bD,wD=yD,Ui=D(wD),ED=X,TD=ED.isFinite,xD=Number.isFinite||function(e){return typeof e=="number"&&TD(e)},OD=N,PD=xD;OD({target:"Number",stat:!0},{isFinite:PD});var DD=L,ND=DD.Number.isFinite,RD=ND,SD=RD,kD=SD,Mg=D(kD),MD=N,FD=Ng.some,BD=wt,zD=BD("some");MD({target:"Array",proto:!0,forced:!zD},{some:function(e){return FD(this,e,arguments.length>1?arguments[1]:void 0)}});var ZD=Ie,LD=ZD("Array").some,GD=J,VD=LD,ti=Array.prototype,jD=function(I){var e=I.some;return I===ti||GD(ti,I)&&e===ti.some?VD:e},WD=jD,YD=WD,_D=YD,ih=D(_D),KD=L,UD=KD.Object.getOwnPropertySymbols,HD=UD,QD=HD,XD=QD,Xe=D(XD),nh={exports:{}},JD=N,$D=z,qD=We,oh=tA.f,sh=ie,e2=!sh||$D(function(){oh(1)});JD({target:"Object",stat:!0,forced:e2,sham:!sh},{getOwnPropertyDescriptor:function(e,g){return oh(qD(e),g)}});var g2=L,rh=g2.Object,t2=nh.exports=function(e,g){return rh.getOwnPropertyDescriptor(e,g)};rh.getOwnPropertyDescriptor.sham&&(t2.sham=!0);var A2=nh.exports,I2=A2,C2=I2,i2=C2,eg=D(i2),n2=N,o2=ie,s2=Ud,r2=We,a2=tA,d2=uA;n2({target:"Object",stat:!0,sham:!o2},{getOwnPropertyDescriptors:function(e){for(var g=r2(e),t=a2.f,A=s2(g),C={},i=0,n,o;A.length>i;)o=t(g,n=A[i++]),o!==void 0&&d2(C,n,o);return C}});var l2=L,h2=l2.Object.getOwnPropertyDescriptors,c2=h2,u2=c2,f2=u2,Je=D(f2),ah={exports:{}},p2=N,m2=ie,_r=HI.f;p2({target:"Object",stat:!0,forced:Object.defineProperties!==_r,sham:!m2},{defineProperties:_r});var v2=L,dh=v2.Object,b2=ah.exports=function(e,g){return dh.defineProperties(e,g)};dh.defineProperties.sham&&(b2.sham=!0);var y2=ah.exports,w2=y2,E2=w2,T2=E2,RA=D(T2),lh={exports:{}},x2=N,O2=ie,Kr=Oe.f;x2({target:"Object",stat:!0,forced:Object.defineProperty!==Kr,sham:!O2},{defineProperty:Kr});var P2=L,hh=P2.Object,D2=lh.exports=function(e,g,t){return hh.defineProperty(e,g,t)};hh.defineProperty.sham&&(D2.sham=!0);var N2=lh.exports,R2=N2,ch=R2,S2=ch,k2=S2,M2=k2,F2=M2,B2=F2,z2=D(B2),Z2=ee,L2=Oe.f,Ur=Z2("metadata"),Hr=Function.prototype;Hr[Ur]===void 0&&L2(Hr,Ur,{value:null});var G2=$;G2("asyncDispose");var V2=$;V2("dispose");var j2=$;j2("metadata");var W2=Kd,Y2=W2,_2=Ye,K2=Z,Ro=_2("Symbol"),U2=Ro.keyFor,H2=K2(Ro.prototype.valueOf),uh=Ro.isRegisteredSymbol||function(e){try{return U2(H2(e))!==void 0}catch(g){return!1}},Q2=N,X2=uh;Q2({target:"Symbol",stat:!0},{isRegisteredSymbol:X2});var J2=mt,fh=Ye,$2=Z,q2=oA,eN=ee,wI=fh("Symbol"),Qr=wI.isWellKnownSymbol,ph=fh("Object","getOwnPropertyNames"),gN=$2(wI.prototype.valueOf),Xr=J2("wks");for(XA=0,Ai=ph(wI),Jr=Ai.length;XA<Jr;XA++)try{Ii=Ai[XA],q2(wI[Ii])&&eN(Ii)}catch(I){}var Ii,XA,Ai,Jr,mh=function(e){if(Qr&&Qr(e))return!0;try{for(var g=gN(e),t=0,A=ph(Xr),C=A.length;t<C;t++)if(Xr[A[t]]==g)return!0}catch(i){}return!1},tN=N,AN=mh;tN({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:AN});var IN=$;IN("matcher");var CN=$;CN("observable");var iN=N,nN=uh;iN({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:nN});var oN=N,sN=mh;oN({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:sN});var rN=$;rN("metadataKey");var aN=$;aN("patternMatch");var dN=$;dN("replaceAll");var lN=Y2,hN=lN,cN=hN,JA=D(cN),uN=bA,fN=uN.f("iterator"),pN=fN,vh=pN,mN=vh,vN=mN,bN=vN,yN=bN,wN=yN,EN=D(wN);function $t(I){"@babel/helpers - typeof";return $t=typeof JA=="function"&&typeof EN=="symbol"?function(e){return typeof e}:function(e){return e&&typeof JA=="function"&&e.constructor===JA&&e!==JA.prototype?"symbol":typeof e},$t(I)}var TN=bA,xN=TN.f("toPrimitive"),ON=xN,PN=ON,DN=PN,NN=DN,RN=NN,SN=RN,kN=SN,MN=D(kN);function FN(I,e){if($t(I)!=="object"||I===null)return I;var g=I[MN];if(g!==void 0){var t=g.call(I,e||"default");if($t(t)!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(I)}function BN(I){var e=FN(I,"string");return $t(e)==="symbol"?e:String(e)}function ge(I,e,g){return e=BN(e),e in I?z2(I,e,{value:g,enumerable:!0,configurable:!0,writable:!0}):I[e]=g,I}var zN=Yg,ZN=xe,LN=jI,GN=Se,VN=TypeError,$r=function(I){return function(e,g,t,A){zN(g);var C=ZN(e),i=LN(C),n=GN(C),o=I?n-1:0,s=I?-1:1;if(t<2)for(;;){if(o in i){A=i[o],o+=s;break}if(o+=s,I?o<0:n<=o)throw new VN("Reduce of empty array with no initial value")}for(;I?o>=0:n>o;o+=s)o in i&&(A=g(A,i[o],o,C));return A}},jN={left:$r(!1),right:$r(!0)},WN=X,YN=sg,_N=YN(WN.process)==="process",KN=N,UN=jN.left,HN=wt,qr=nA,QN=_N,XN=!QN&&qr>79&&qr<83,JN=XN||!HN("reduce");KN({target:"Array",proto:!0,forced:JN},{reduce:function(e){var g=arguments.length;return UN(this,e,g,g>1?arguments[1]:void 0)}});var $N=Ie,qN=$N("Array").reduce,eR=J,gR=qN,Ci=Array.prototype,tR=function(I){var e=I.reduce;return I===Ci||eR(Ci,I)&&e===Ci.reduce?gR:e},AR=tR,IR=AR,CR=IR,So=D(CR),iR=Dg,nR=Se,oR=eo,sR=aA,bh=function(I,e,g,t,A,C,i,n){for(var o=A,s=0,r=i?sR(i,n):!1,a,d;s<t;)s in g&&(a=r?r(g[s],s,e):g[s],C>0&&iR(a)?(d=nR(a),o=bh(I,e,a,d,o,C-1)-1):(oR(o+1),I[o]=a),o++),s++;return o},rR=bh,aR=N,dR=rR,lR=Yg,hR=xe,cR=Se,uR=UI;aR({target:"Array",proto:!0},{flatMap:function(e){var g=hR(this),t=cR(g),A;return lR(e),A=uR(g,0),A.length=dR(A,g,g,t,0,1,e,arguments.length>1?arguments[1]:void 0),A}});var fR=Ie,gF=fR("Array").flatMap;var tF=Array.prototype;var pR=vh,nt=D(pR),mR=Po,vR=Ah;mR("Set",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},vR);var bR=L,yR=bR.Set,wR=yR,ER=wR,TR=ER,Le=D(TR),xR=eh,OR=xR,PR=OR,DR=PR,NR=DR,RR=NR,SR=RR,kR=SR,MR=kR,FR=MR,ii=D(FR),ea=rd,BR=Math.floor,Hi=function(I,e){var g=I.length,t=BR(g/2);return g<8?zR(I,e):ZR(I,Hi(ea(I,0,t),e),Hi(ea(I,t),e),e)},zR=function(I,e){for(var g=I.length,t=1,A,C;t<g;){for(C=t,A=I[t];C&&e(I[C-1],A)>0;)I[C]=I[--C];C!==t++&&(I[C]=A)}return I},ZR=function(I,e,g,t){for(var A=e.length,C=g.length,i=0,n=0;i<A||n<C;)I[i+n]=i<A&&n<C?t(e[i],g[n])<=0?e[i++]:g[n++]:i<A?e[i++]:g[n++];return I},LR=Hi,GR=iA,ga=GR.match(/firefox\/(\d+)/i),VR=!!ga&&+ga[1],jR=iA,WR=/MSIE|Trident/.test(jR),YR=iA,ta=YR.match(/AppleWebKit\/(\d+)\./),_R=!!ta&&+ta[1],KR=N,yh=Z,UR=Yg,HR=xe,Aa=Se,QR=Xd,Ia=qe,ko=z,XR=LR,JR=wt,Ca=VR,$R=WR,ia=nA,na=_R,vg=[],oa=yh(vg.sort),qR=yh(vg.push),eS=ko(function(){vg.sort(void 0)}),gS=ko(function(){vg.sort(null)}),tS=JR("sort"),wh=!ko(function(){if(ia)return ia<70;if(!(Ca&&Ca>3)){if($R)return!0;if(na)return na<603;var I="",e,g,t,A;for(e=65;e<76;e++){switch(g=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(A=0;A<47;A++)vg.push({k:g+A,v:t})}for(vg.sort(function(C,i){return i.v-C.v}),A=0;A<vg.length;A++)g=vg[A].k.charAt(0),I.charAt(I.length-1)!==g&&(I+=g);return I!=="DGBEFHACIJK"}}),AS=eS||!gS||!tS||!wh,IS=function(I){return function(e,g){return g===void 0?-1:e===void 0?1:I!==void 0?+I(e,g)||0:Ia(e)>Ia(g)?1:-1}};KR({target:"Array",proto:!0,forced:AS},{sort:function(e){e!==void 0&&UR(e);var g=HR(this);if(wh)return e===void 0?oa(g):oa(g,e);var t=[],A=Aa(g),C,i;for(i=0;i<A;i++)i in g&&qR(t,g[i]);for(XR(t,IS(e)),C=Aa(t),i=0;i<C;)g[i]=t[i++];for(;i<A;)QR(g,i++);return g}});var CS=Ie,iS=CS("Array").sort,nS=J,oS=iS,ni=Array.prototype,sS=function(I){var e=I.sort;return I===ni||nS(ni,I)&&e===ni.sort?oS:e},rS=sS,aS=rS,dS=aS,Cg=D(dS),lS=Ie,hS=lS("Array").keys,cS=hS,uS=cS,fS=ag,pS=ne,mS=J,vS=uS,oi=Array.prototype,bS={DOMTokenList:!0,NodeList:!0},yS=function(I){var e=I.keys;return I===oi||mS(oi,I)&&e===oi.keys||pS(bS,fS(I))?vS:e},wS=yS,tt=D(wS),ES=Ie,TS=ES("Array").values,xS=TS,OS=xS,PS=ag,DS=ne,NS=J,RS=OS,si=Array.prototype,SS={DOMTokenList:!0,NodeList:!0},kS=function(I){var e=I.values;return I===si||NS(si,I)&&e===si.values||DS(SS,PS(I))?RS:e},MS=kS,EI=D(MS),FS=Ie,BS=FS("Array").entries,zS=BS,ZS=zS,LS=ag,GS=ne,VS=J,jS=ZS,ri=Array.prototype,WS={DOMTokenList:!0,NodeList:!0},YS=function(I){var e=I.entries;return I===ri||VS(ri,I)&&e===ri.entries||GS(WS,LS(I))?jS:e},_S=YS,KS=D(_S),US=ch,SA=D(US),$A,HS=new Uint8Array(16);function QS(){if(!$A&&($A=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!$A))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return $A(HS)}var re=[];for(let I=0;I<256;++I)re.push((I+256).toString(16).slice(1));function XS(I,e=0){return re[I[e+0]]+re[I[e+1]]+re[I[e+2]]+re[I[e+3]]+"-"+re[I[e+4]]+re[I[e+5]]+"-"+re[I[e+6]]+re[I[e+7]]+"-"+re[I[e+8]]+re[I[e+9]]+"-"+re[I[e+10]]+re[I[e+11]]+re[I[e+12]]+re[I[e+13]]+re[I[e+14]]+re[I[e+15]]}var JS=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),sa={randomUUID:JS};function st(I,e,g){if(sa.randomUUID&&!e&&!I)return sa.randomUUID();I=I||{};let t=I.random||(I.rng||QS)();if(t[6]=t[6]&15|64,t[8]=t[8]&63|128,e){g=g||0;for(let A=0;A<16;++A)e[g+A]=t[A];return e}return XS(t)}function ra(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function aa(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=ra(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=ra(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}function da(I){return typeof I=="string"||typeof I=="number"}var Qi=class I{constructor(e){ge(this,"delay",void 0),ge(this,"max",void 0),ge(this,"_queue",[]),ge(this,"_timeout",null),ge(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(e)}setOptions(e){e&&typeof e.delay!="undefined"&&(this.delay=e.delay),e&&typeof e.max!="undefined"&&(this.max=e.max),this._flushIfNeeded()}static extend(e,g){let t=new I(g);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=()=>{t.flush()};let A=[{name:"flush",original:void 0}];if(g&&g.replace)for(let C=0;C<g.replace.length;C++){let i=g.replace[C];A.push({name:i,original:e[i]}),t.replace(e,i)}return t._extended={object:e,methods:A},t}destroy(){if(this.flush(),this._extended){let e=this._extended.object,g=this._extended.methods;for(let t=0;t<g.length;t++){let A=g[t];A.original?e[A.name]=A.original:delete e[A.name]}this._extended=null}}replace(e,g){let t=this,A=e[g];if(!A)throw new Error("Method "+g+" undefined");e[g]=function(){for(var C=arguments.length,i=new Array(C),n=0;n<C;n++)i[n]=arguments[n];t.queue({args:i,fn:A,context:this})}}queue(e){typeof e=="function"?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}_flushIfNeeded(){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=He(()=>{this.flush()},this.delay))}flush(){var e,g;F(e=Ue(g=this._queue).call(g,0)).call(e,t=>{t.fn.apply(t.context||t.fn,t.args||[])})}},Xi=class I{constructor(){ge(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),ge(this,"subscribe",I.prototype.on),ge(this,"unsubscribe",I.prototype.off)}_trigger(e,g,t){var A;if(e==="*")throw new Error("Cannot trigger event *");F(A=[...this._subscribers[e],...this._subscribers["*"]]).call(A,C=>{C(e,g,t!=null?t:null)})}on(e,g){typeof g=="function"&&this._subscribers[e].push(g)}off(e,g){var t;this._subscribers[e]=te(t=this._subscribers[e]).call(t,A=>A!==g)}},TI=class I{constructor(e){ge(this,"_pairs",void 0),this._pairs=e}*[nt](){for(let[e,g]of this._pairs)yield[e,g]}*entries(){for(let[e,g]of this._pairs)yield[e,g]}*keys(){for(let[e]of this._pairs)yield e}*values(){for(let[,e]of this._pairs)yield e}toIdArray(){var e;return ae(e=[...this._pairs]).call(e,g=>g[0])}toItemArray(){var e;return ae(e=[...this._pairs]).call(e,g=>g[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let e=wg(null);for(let[g,t]of this._pairs)e[g]=t;return e}toMap(){return new NA(this._pairs)}toIdSet(){return new Le(this.toIdArray())}toItemSet(){return new Le(this.toItemArray())}cache(){return new I([...this._pairs])}distinct(e){let g=new Le;for(let[t,A]of this._pairs)g.add(e(A,t));return g}filter(e){let g=this._pairs;return new I({*[nt](){for(let[t,A]of g)e(A,t)&&(yield[t,A])}})}forEach(e){for(let[g,t]of this._pairs)e(t,g)}map(e){let g=this._pairs;return new I({*[nt](){for(let[t,A]of g)yield[t,e(A,t)]}})}max(e){let g=ii(this._pairs),t=g.next();if(t.done)return null;let A=t.value[1],C=e(t.value[1],t.value[0]);for(;!(t=g.next()).done;){let[i,n]=t.value,o=e(n,i);o>C&&(C=o,A=n)}return A}min(e){let g=ii(this._pairs),t=g.next();if(t.done)return null;let A=t.value[1],C=e(t.value[1],t.value[0]);for(;!(t=g.next()).done;){let[i,n]=t.value,o=e(n,i);o<C&&(C=o,A=n)}return A}reduce(e,g){for(let[t,A]of this._pairs)g=e(g,A,t);return g}sort(e){return new I({[nt]:()=>{var g;return ii(Cg(g=[...this._pairs]).call(g,(t,A)=>{let[C,i]=t,[n,o]=A;return e(i,o,C,n)}))}})}};function $S(I,e){return I[e]==null&&(I[e]=st()),I}var Pg=class extends Xi{get idProp(){return this._idProp}constructor(e,g){super(),ge(this,"flush",void 0),ge(this,"length",void 0),ge(this,"_options",void 0),ge(this,"_data",void 0),ge(this,"_idProp",void 0),ge(this,"_queue",null),e&&!B(e)&&(g=e,e=[]),this._options=g||{},this._data=new NA,this.length=0,this._idProp=this._options.fieldId||"id",e&&e.length&&this.add(e),this.setOptions(g)}setOptions(e){e&&e.queue!==void 0&&(e.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=Qi.extend(this,{replace:["add","update","remove"]})),e.queue&&typeof e.queue=="object"&&this._queue.setOptions(e.queue)))}add(e,g){let t=[],A;if(B(e)){let C=ae(e).call(e,i=>i[this._idProp]);if(ih(C).call(C,i=>this._data.has(i)))throw new Error("A duplicate id was found in the parameter array.");for(let i=0,n=e.length;i<n;i++)A=this._addItem(e[i]),t.push(A)}else if(e&&typeof e=="object")A=this._addItem(e),t.push(A);else throw new Error("Unknown dataType");return t.length&&this._trigger("add",{items:t},g),t}update(e,g){let t=[],A=[],C=[],i=[],n=this._idProp,o=s=>{let r=s[n];if(r!=null&&this._data.has(r)){let a=s,d=q({},this._data.get(r)),l=this._updateItem(a);A.push(l),i.push(a),C.push(d)}else{let a=this._addItem(s);t.push(a)}};if(B(e))for(let s=0,r=e.length;s<r;s++)e[s]&&typeof e[s]=="object"?o(e[s]):console.warn("Ignoring input item, which is not an object at index "+s);else if(e&&typeof e=="object")o(e);else throw new Error("Unknown dataType");if(t.length&&this._trigger("add",{items:t},g),A.length){let s={items:A,oldData:C,data:i};this._trigger("update",s,g)}return $d(t).call(t,A)}updateOnly(e,g){var t;B(e)||(e=[e]);let A=ae(t=ae(e).call(e,C=>{let i=this._data.get(C[this._idProp]);if(i==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:i,update:C}})).call(t,C=>{let{oldData:i,update:n}=C,o=i[this._idProp],s=RO(i,n);return this._data.set(o,s),{id:o,oldData:i,updatedData:s}});if(A.length){let C={items:ae(A).call(A,i=>i.id),oldData:ae(A).call(A,i=>i.oldData),data:ae(A).call(A,i=>i.updatedData)};return this._trigger("update",C,g),C.items}else return[]}get(e,g){let t,A,C;da(e)?(t=e,C=g):B(e)?(A=e,C=g):C=e;let i=C&&C.returnType==="Object"?"Object":"Array",n=C&&te(C),o=[],s,r,a;if(t!=null)s=this._data.get(t),s&&n&&!n(s)&&(s=void 0);else if(A!=null)for(let h=0,c=A.length;h<c;h++)s=this._data.get(A[h]),s!=null&&(!n||n(s))&&o.push(s);else{var d;r=[...tt(d=this._data).call(d)];for(let h=0,c=r.length;h<c;h++)a=r[h],s=this._data.get(a),s!=null&&(!n||n(s))&&o.push(s)}if(C&&C.order&&t==null&&this._sort(o,C.order),C&&C.fields){let h=C.fields;if(t!=null&&s!=null)s=this._filterFields(s,h);else for(let c=0,p=o.length;c<p;c++)o[c]=this._filterFields(o[c],h)}if(i=="Object"){let h={};for(let c=0,p=o.length;c<p;c++){let u=o[c],m=u[this._idProp];h[m]=u}return h}else if(t!=null){var l;return(l=s)!==null&&l!==void 0?l:null}else return o}getIds(e){let g=this._data,t=e&&te(e),A=e&&e.order,C=[...tt(g).call(g)],i=[];if(t)if(A){let n=[];for(let o=0,s=C.length;o<s;o++){let r=C[o],a=this._data.get(r);a!=null&&t(a)&&n.push(a)}this._sort(n,A);for(let o=0,s=n.length;o<s;o++)i.push(n[o][this._idProp])}else for(let n=0,o=C.length;n<o;n++){let s=C[n],r=this._data.get(s);r!=null&&t(r)&&i.push(r[this._idProp])}else if(A){let n=[];for(let o=0,s=C.length;o<s;o++){let r=C[o];n.push(g.get(r))}this._sort(n,A);for(let o=0,s=n.length;o<s;o++)i.push(n[o][this._idProp])}else for(let n=0,o=C.length;n<o;n++){let s=C[n],r=g.get(s);r!=null&&i.push(r[this._idProp])}return i}getDataSet(){return this}forEach(e,g){let t=g&&te(g),A=this._data,C=[...tt(A).call(A)];if(g&&g.order){let i=this.get(g);for(let n=0,o=i.length;n<o;n++){let s=i[n],r=s[this._idProp];e(s,r)}}else for(let i=0,n=C.length;i<n;i++){let o=C[i],s=this._data.get(o);s!=null&&(!t||t(s))&&e(s,o)}}map(e,g){let t=g&&te(g),A=[],C=this._data,i=[...tt(C).call(C)];for(let n=0,o=i.length;n<o;n++){let s=i[n],r=this._data.get(s);r!=null&&(!t||t(r))&&A.push(e(r,s))}return g&&g.order&&this._sort(A,g.order),A}_filterFields(e,g){var t;return e&&So(t=B(g)?g:U(g)).call(t,(A,C)=>(A[C]=e[C],A),{})}_sort(e,g){if(typeof g=="string"){let t=g;Cg(e).call(e,(A,C)=>{let i=A[t],n=C[t];return i>n?1:i<n?-1:0})}else if(typeof g=="function")Cg(e).call(e,g);else throw new TypeError("Order must be a function or a string")}remove(e,g){let t=[],A=[],C=B(e)?e:[e];for(let i=0,n=C.length;i<n;i++){let o=this._remove(C[i]);if(o){let s=o[this._idProp];s!=null&&(t.push(s),A.push(o))}}return t.length&&this._trigger("remove",{items:t,oldData:A},g),t}_remove(e){let g;if(da(e)?g=e:e&&typeof e=="object"&&(g=e[this._idProp]),g!=null&&this._data.has(g)){let t=this._data.get(g)||null;return this._data.delete(g),--this.length,t}return null}clear(e){var g;let t=[...tt(g=this._data).call(g)],A=[];for(let C=0,i=t.length;C<i;C++)A.push(this._data.get(t[C]));return this._data.clear(),this.length=0,this._trigger("remove",{items:t,oldData:A},e),t}max(e){let g=null,t=null;for(let C of EI(A=this._data).call(A)){var A;let i=C[e];typeof i=="number"&&(t==null||i>t)&&(g=C,t=i)}return g||null}min(e){let g=null,t=null;for(let C of EI(A=this._data).call(A)){var A;let i=C[e];typeof i=="number"&&(t==null||i<t)&&(g=C,t=i)}return g||null}distinct(e){let g=this._data,t=[...tt(g).call(g)],A=[],C=0;for(let i=0,n=t.length;i<n;i++){let o=t[i],r=g.get(o)[e],a=!1;for(let d=0;d<C;d++)if(A[d]==r){a=!0;break}!a&&r!==void 0&&(A[C]=r,C++)}return A}_addItem(e){let g=$S(e,this._idProp),t=g[this._idProp];if(this._data.has(t))throw new Error("Cannot add item: item with id "+t+" already exists");return this._data.set(t,g),++this.length,t}_updateItem(e){let g=e[this._idProp];if(g==null)throw new Error("Cannot update item: item has no id (item: "+Et(e)+")");let t=this._data.get(g);if(!t)throw new Error("Cannot update item: no item with id "+g+" found");return this._data.set(g,aa(aa({},t),e)),g}stream(e){if(e){let t=this._data;return new TI({*[nt](){for(let A of e){let C=t.get(A);C!=null&&(yield[A,C])}}})}else{var g;return new TI({[nt]:b(g=KS(this._data)).call(g,this._data)})}}};function qS(I,e){return typeof e=="object"&&e!==null&&I===e.idProp&&typeof e.add=="function"&&typeof e.clear=="function"&&typeof e.distinct=="function"&&typeof F(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof ae(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 Eh(I,e){return typeof e=="object"&&e!==null&&I===e.idProp&&typeof F(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof ae(e)=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.stream=="function"&&qS(I,e.getDataSet())}var Th=X,ek=z,gk=Z,tk=qe,Ak=tl.trim,Ik=ao,Ck=gk("".charAt),xI=Th.parseFloat,la=Th.Symbol,ha=la&&la.iterator,ik=1/xI(Ik+"-0")!==-1/0||ha&&!ek(function(){xI(Object(ha))}),nk=ik?function(e){var g=Ak(tk(e)),t=xI(g);return t===0&&Ck(g,0)==="-"?-0:t}:xI,ok=N,ca=nk;ok({global:!0,forced:parseFloat!==ca},{parseFloat:ca});var sk=L,rk=sk.parseFloat,ak=rk,dk=ak,lk=dk,xh=D(lk),hk=N,ck=z,uk=XI.f,fk=ck(function(){return!Object.getOwnPropertyNames(1)});hk({target:"Object",stat:!0,forced:fk},{getOwnPropertyNames:uk});var pk=L,mk=pk.Object,vk=function(e){return mk.getOwnPropertyNames(e)},bk=vk,yk=bk,wk=yk,Ek=D(wk);function Mo(I,e){let g=["node","edge","label"],t=!0,A=fg(e,"chosen");if(typeof A=="boolean")t=A;else if(typeof A=="object"){if(G(g).call(g,I)===-1)throw new Error("choosify: subOption '"+I+"' should be one of '"+g.join("', '")+"'");let C=fg(e,["chosen",I]);(typeof C=="boolean"||typeof C=="function")&&(t=C)}return t}function Ji(I,e,g){if(I.width<=0||I.height<=0)return!1;if(g!==void 0){let C={x:e.x-g.x,y:e.y-g.y};if(g.angle!==0){let i=-g.angle;e={x:Math.cos(i)*C.x-Math.sin(i)*C.y,y:Math.sin(i)*C.x+Math.cos(i)*C.y}}else e=C}let t=I.x+I.width,A=I.y+I.width;return I.left<e.x&&t>e.x&&I.top<e.y&&A>e.y}function OI(I){return typeof I=="string"&&I!==""}function Oh(I,e,g,t){let A=t.x,C=t.y;if(typeof t.distanceToBorder=="function"){let i=t.distanceToBorder(I,e),n=Math.sin(e)*i,o=Math.cos(e)*i;o===i?(A+=i,C=t.y):n===i?(A=t.x,C-=i):(A+=o,C-=n)}else t.shape.width>t.shape.height?(A=t.x+t.shape.width*.5,C=t.y-g):(A=t.x+g,C=t.y-t.shape.height*.5);return{x:A,y:C}}var $i=class{constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let A=g;(g===void 0||g==="")&&(A=" ");let C=this.measureText(A,t),i=q({},EI(C));i.text=g,i.width=C.width,i.mod=t,(g===void 0||g==="")&&(i.width=0),this.lines[e].blocks.push(i),this.lines[e].width+=i.width}curWidth(){let e=this.lines[this.current];return e===void 0?0:e.width}append(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,g)}newLine(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,g),this.current++}determineLineHeights(){for(let e=0;e<this.lines.length;e++){let g=this.lines[e],t=0;if(g.blocks!==void 0)for(let A=0;A<g.blocks.length;A++){let C=g.blocks[A];t<C.height&&(t=C.height)}g.height=t}}determineLabelSize(){let e=0,g=0;for(let t=0;t<this.lines.length;t++){let A=this.lines[t];A.width>e&&(e=A.width),g+=A.height}this.width=e,this.height=g}removeEmptyBlocks(){let e=[];for(let g=0;g<this.lines.length;g++){let t=this.lines[g];if(t.blocks.length===0||g===this.lines.length-1&&t.width===0)continue;let A={};q(A,t),A.blocks=[];let C,i=[];for(let n=0;n<t.blocks.length;n++){let o=t.blocks[n];o.width!==0?i.push(o):C===void 0&&(C=o)}i.length===0&&C!==void 0&&i.push(C),A.blocks=i,e.push(A)}return e}finalize(){this.determineLineHeights(),this.determineLabelSize();let e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}},Tk={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},PI=class{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,g){return!this.mono&&!this[e]&&this.match(g)?(this.setTag(e),!0):!1}match(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,[t,A]=this.prepareRegExp(e),C=t.test(this.text.substr(this.position,A));return C&&g&&(this.position+=A-1),C}parseEndTag(e,g,t){let A=this.mod()===e;return e==="mono"?A=A&&this.mono:A=A&&!this.mono,A&&this.match(g)?(t!==void 0?(this.position===this.text.length-1||this.match(t,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}replace(e,g){return this.match(e)?(this.add(g),this.position+=length-1,!0):!1}prepareRegExp(e){let g,t;if(e instanceof RegExp)t=e,g=1;else{let A=Tk[e];A!==void 0?t=A:t=new RegExp(e),g=e.length}return[t,g]}},qi=class{constructor(e,g,t,A){this.ctx=e,this.parent=g,this.selected=t,this.hover=A;let C=(i,n)=>{if(i===void 0)return 0;let o=this.parent.getFormattingValues(e,t,A,n),s=0;return i!==""&&(s=this.ctx.measureText(i).width),{width:s,values:o}};this.lines=new $i(C)}process(e){if(!OI(e))return this.lines.finalize();let g=this.parent.fontOptions;e=e.replace(/\r\n/g,`
651
+ `),e=e.replace(/\r/g,`
652
+ `);let t=String(e).split(`
653
+ `),A=t.length;if(g.multi)for(let C=0;C<A;C++){let i=this.splitBlocks(t[C],g.multi);if(i!==void 0){if(i.length===0){this.lines.newLine("");continue}if(g.maxWdt>0)for(let n=0;n<i.length;n++){let o=i[n].mod,s=i[n].text;this.splitStringIntoLines(s,o,!0)}else for(let n=0;n<i.length;n++){let o=i[n].mod,s=i[n].text;this.lines.append(s,o)}this.lines.newLine()}}else if(g.maxWdt>0)for(let C=0;C<A;C++)this.splitStringIntoLines(t[C]);else for(let C=0;C<A;C++)this.lines.newLine(t[C]);return this.lines.finalize()}decodeMarkupSystem(e){let g="none";return e==="markdown"||e==="md"?g="markdown":(e===!0||e==="html")&&(g="html"),g}splitHtmlBlocks(e){let g=new PI(e),t=A=>/&/.test(A)?(g.replace(g.text,"&lt;","<")||g.replace(g.text,"&amp;","&")||g.add("&"),!0):!1;for(;g.position<g.text.length;){let A=g.text.charAt(g.position);g.parseWS(A)||/</.test(A)&&(g.parseStartTag("bold","<b>")||g.parseStartTag("ital","<i>")||g.parseStartTag("mono","<code>")||g.parseEndTag("bold","</b>")||g.parseEndTag("ital","</i>")||g.parseEndTag("mono","</code>"))||t(A)||g.add(A),g.position++}return g.emitBlock(),g.blocks}splitMarkdownBlocks(e){let g=new PI(e),t=!0,A=C=>/\\/.test(C)?(g.position<this.text.length+1&&(g.position++,C=this.text.charAt(g.position),/ \t/.test(C)?g.spacing=!0:(g.add(C),t=!1)),!0):!1;for(;g.position<g.text.length;){let C=g.text.charAt(g.position);g.parseWS(C)||A(C)||(t||g.spacing)&&(g.parseStartTag("bold","*")||g.parseStartTag("ital","_")||g.parseStartTag("mono","`"))||g.parseEndTag("bold","*","afterBold")||g.parseEndTag("ital","_","afterItal")||g.parseEndTag("mono","`","afterMono")||(g.add(C),t=!1),g.position++}return g.emitBlock(),g.blocks}splitBlocks(e,g){let t=this.decodeMarkupSystem(g);if(t==="none")return[{text:e,mod:"normal"}];if(t==="markdown")return this.splitMarkdownBlocks(e);if(t==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){let g=this.ctx.measureText(e).width;return this.lines.curWidth()+g>this.parent.fontOptions.maxWdt}getLongestFit(e){let g="",t=0;for(;t<e.length;){let C=g+(g===""?"":" ")+e[t];if(this.overMaxWidth(C))break;g=C,t++}return t}getLongestFitWord(e){let g=0;for(;g<e.length&&!this.overMaxWidth(Ze(e).call(e,0,g));)g++;return g}splitStringIntoLines(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,g),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let A=e.split("\r");for(;A.length>0;){let C=this.getLongestFit(A);if(C===0){let i=A[0],n=this.getLongestFitWord(i);this.lines.newLine(Ze(i).call(i,0,n),g),A[0]=Ze(i).call(i,n)}else{let i=C;A[C-1]===" "?C--:A[i]===" "&&i++;let n=Ze(A).call(A,0,C).join("");C==A.length&&t?this.lines.append(n,g):this.lines.newLine(n,g),A=Ze(A).call(A,i)}}}},St=["bold","ital","boldital","mono"],DI=class I{constructor(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(g),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=t}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),OI(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"){let g=e.font.size;g!==void 0&&(this.baseSize=g)}}}initFontOptions(e){if(S(St,g=>{this.fontOptions[g]={}}),I.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}S(e,(g,t)=>{g!=null&&typeof g!="object"&&(this.fontOptions[t]=g)})}static parseFontString(e,g){if(!g||typeof g!="string")return!1;let t=g.split(" ");return e.size=+t[0].replace("px",""),e.face=t[1],e.color=t[2],!0}constrain(e){let g={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},t=fg(e,"widthConstraint");if(typeof t=="number")g.maxWdt=Number(t),g.minWdt=Number(t);else if(typeof t=="object"){let C=fg(e,["widthConstraint","maximum"]);typeof C=="number"&&(g.maxWdt=Number(C));let i=fg(e,["widthConstraint","minimum"]);typeof i=="number"&&(g.minWdt=Number(i))}let A=fg(e,"heightConstraint");if(typeof A=="number")g.minHgt=Number(A);else if(typeof A=="object"){let C=fg(e,["heightConstraint","minimum"]);typeof C=="number"&&(g.minHgt=Number(C));let i=fg(e,["heightConstraint","valign"]);typeof i=="string"&&(i==="top"||i==="bottom")&&(g.valign=i)}return g}update(e,g){this.setOptions(e,!0),this.propagateFonts(g),_(this.fontOptions,this.constrain(g)),this.fontOptions.chooser=Mo("label",g)}adjustSizes(e){let g=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=g,this.fontOptions.minWdt-=g);let t=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=t)}addFontOptionsToPile(e,g){for(let t=0;t<g.length;++t)this.addFontToPile(e,g[t])}addFontToPile(e,g){if(g===void 0||g.font===void 0||g.font===null)return;let t=g.font;e.push(t)}getBasicOptions(e){let g={};for(let t=0;t<e.length;++t){let A=e[t],C={};I.parseFontString(C,A)&&(A=C),S(A,(i,n)=>{i!==void 0&&(Object.prototype.hasOwnProperty.call(g,n)||(G(St).call(St,n)!==-1?g[n]={}:g[n]=i))})}return g}getFontOption(e,g,t){let A;for(let C=0;C<e.length;++C){let i=e[C];if(Object.prototype.hasOwnProperty.call(i,g)){if(A=i[g],A==null)continue;let n={};if(I.parseFontString(n,A)&&(A=n),Object.prototype.hasOwnProperty.call(A,t))return A[t]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,t))return this.fontOptions[t];throw new Error("Did not find value for multi-font for property: '"+t+"'")}getFontOptions(e,g){let t={},A=["color","size","face","mod","vadjust"];for(let C=0;C<A.length;++C){let i=A[C];t[i]=this.getFontOption(e,g,i)}return t}propagateFonts(e){let g=[];this.addFontOptionsToPile(g,e),this.fontOptions=this.getBasicOptions(g);for(let t=0;t<St.length;++t){let A=St[t],C=this.fontOptions[A],i=this.getFontOptions(g,A);S(i,(n,o)=>{C[o]=n}),C.size=Number(C.size),C.vadjust=Number(C.vadjust)}}draw(e,g,t,A,C){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let n=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&n<this.elementOptions.scaling.label.drawThreshold-1||(n>=this.elementOptions.scaling.label.maxVisible&&(n=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,A,C,g,t,i),this._drawBackground(e),this._drawText(e,g,this.size.yLine,i,n))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;let g=this.getSize();e.fillRect(g.left,g.top,g.width,g.height)}}_drawText(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",C=arguments.length>4?arguments[4]:void 0;[g,t]=this._setAlignment(e,g,t,A),e.textAlign="left",g=g-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(t-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(t+=(this.size.height-this.size.labelHeight)/2));for(let i=0;i<this.lineCount;i++){let n=this.lines[i];if(n&&n.blocks){let o=0;this.isEdgeLabel||this.fontOptions.align==="center"?o+=(this.size.width-n.width)/2:this.fontOptions.align==="right"&&(o+=this.size.width-n.width);for(let s=0;s<n.blocks.length;s++){let r=n.blocks[s];e.font=r.font;let[a,d]=this._getColor(r.color,C,r.strokeColor);r.strokeWidth>0&&(e.lineWidth=r.strokeWidth,e.strokeStyle=d,e.lineJoin="round"),e.fillStyle=a,r.strokeWidth>0&&e.strokeText(r.text,g+o,t+r.vadjust),e.fillText(r.text,g+o,t+r.vadjust),o+=r.width}t+=n.height}}}_setAlignment(e,g,t,A){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){g=0,t=0;let C=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",t-=2*C):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",t+=2*C):e.textBaseline="middle"}else e.textBaseline=A;return[g,t]}_getColor(e,g,t){let A=e||"#000000",C=t||"#ffffff";if(g<=this.elementOptions.scaling.label.drawThreshold){let i=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-g)));A=Ne(A,i),C=Ne(C,i)}return[A,C]}getTextSize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,g,t),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let g=this.size.left,t=this.size.top-.5*2;if(this.isEdgeLabel){let C=-this.size.width*.5;switch(this.fontOptions.align){case"middle":g=C,t=-this.size.height*.5;break;case"top":g=C,t=-(this.size.height+2);break;case"bottom":g=C,t=2;break}}return{left:g,top:t,width:this.size.width,height:this.size.height}}calculateLabelSize(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,g,t),this.size.left=A-this.size.width*.5,this.size.top=C-this.size.height*.5,this.size.yLine=C+(1-this.lineCount)*.5*this.fontOptions.size,i==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,g,t,A){let C=function(o,s,r){return s==="normal"?r==="mod"?"":o[r]:o[s][r]!==void 0?o[s][r]:o[r]},i={color:C(this.fontOptions,A,"color"),size:C(this.fontOptions,A,"size"),face:C(this.fontOptions,A,"face"),mod:C(this.fontOptions,A,"mod"),vadjust:C(this.fontOptions,A,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(g||t)&&(A==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?i.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(i,this.elementOptions.id,g,t));let n="";return i.mod!==void 0&&i.mod!==""&&(n+=i.mod+" "),n+=i.size+"px "+i.face,e.font=n.replace(/"/g,""),i.font=e.font,i.height=i.size,i}differentState(e,g){return e!==this.selectedState||g!==this.hoverState}_processLabelText(e,g,t,A){return new qi(e,this,g,t).process(A)}_processLabel(e,g,t){if(this.labelDirty===!1&&!this.differentState(g,t))return;let A=this._processLabelText(e,g,t,this.elementOptions.label);this.fontOptions.minWdt>0&&A.width<this.fontOptions.minWdt&&(A.width=this.fontOptions.minWdt),this.size.labelHeight=A.height,this.fontOptions.minHgt>0&&A.height<this.fontOptions.minHgt&&(A.height=this.fontOptions.minHgt),this.lines=A.lines,this.lineCount=A.lines.length,this.size.width=A.width,this.size.height=A.height,this.selectedState=g,this.hoverState=t,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)}},og=class{constructor(e,g,t){this.body=g,this.labelModule=t,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,g){let t=this.options.borderWidth;return e&&this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(g)),Math.abs(this.height/2/Math.sin(g)))+t}enableShadow(e,g){g.shadow&&(e.shadowColor=g.shadowColor,e.shadowBlur=g.shadowSize,e.shadowOffsetX=g.shadowX,e.shadowOffsetY=g.shadowY)}disableShadow(e,g){g.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}enableBorderDashes(e,g){if(g.borderDashes!==!1)if(e.setLineDash!==void 0){let t=g.borderDashes;t===!0&&(t=[5,15]),e.setLineDash(t)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,g.borderDashes=!1}disableBorderDashes(e,g){g.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,g.borderDashes=!1))}needsRefresh(e,g){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,g)}initContextForDraw(e,g){let t=g.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,t),e.strokeStyle=g.borderColor,e.fillStyle=g.color}performStroke(e,g){let t=g.borderWidth/this.body.view.scale;e.save(),t>0&&(this.enableBorderDashes(e,g),e.stroke(),this.disableBorderDashes(e,g)),e.restore()}performFill(e,g){e.save(),e.fillStyle=g.color,this.enableShadow(e,g),EA(e).call(e),this.disableShadow(e,g),e.restore(),this.performStroke(e,g)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,g,t,A,C){t!==void 0&&this.resize(t,A,C),this.left=e-this.width/2,this.top=g-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,g,t,A,C){this._updateBoundingBox(e,g,t,A,C)}getDimensionsFromLabel(e,g,t){this.textSize=this.labelModule.getTextSize(e,g,t);let A=this.textSize.width,C=this.textSize.height,i=14;return A===0&&(A=i,C=i),{width:A,height:C}}},xk=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(g,t)){let A=this.getDimensionsFromLabel(e,g,t);this.width=A.width+this.margin.right+this.margin.left,this.height=A.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this.initContextForDraw(e,i),Xa(e,this.left,this.top,this.width,this.height,i.borderRadius),this.performFill(e,i),this.updateBoundingBox(g,t,e,A,C),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C)}updateBoundingBox(e,g,t,A,C){this._updateBoundingBox(e,g,t,A,C);let i=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(i)}distanceToBorder(e,g){e&&this.resize(e);let t=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(g)),Math.abs(this.height/2/Math.sin(g)))+t}},qt=class extends og{constructor(e,g,t){super(e,g,t),this.labelOffset=0,this.selected=!1}setOptions(e,g,t){this.options=e,g===void 0&&t===void 0||this.setImages(g,t)}setImages(e,g){g&&this.selected?(this.imageObj=g,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=g)}switchImages(e){let g=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&g){let t=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=t}}_getImagePadding(){let e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){let g=this.options.imagePadding;typeof g=="object"?(e.top=g.top,e.right=g.right,e.bottom=g.bottom,e.left=g.left):(e.top=g,e.right=g,e.bottom=g,e.left=g)}return e}_resizeImage(){let e,g;if(this.options.shapeProperties.useImageSize===!1){let t=1,A=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?t=this.imageObj.width/this.imageObj.height:A=this.imageObj.height/this.imageObj.width),e=this.options.size*2*t,g=this.options.size*2*A}else{let t=this._getImagePadding();e=this.imageObj.width+t.left+t.right,g=this.imageObj.height+t.top+t.bottom}this.width=e,this.height=g,this.radius=.5*this.width}_drawRawCircle(e,g,t,A){this.initContextForDraw(e,A),qn(e,g,t,A.size),this.performFill(e,A)}_drawImageAtPosition(e,g){if(this.imageObj.width!=0){e.globalAlpha=g.opacity!==void 0?g.opacity:1,this.enableShadow(e,g);let t=1;this.options.shapeProperties.interpolation===!0&&(t=this.imageObj.width/this.width/this.body.view.scale);let A=this._getImagePadding(),C=this.left+A.left,i=this.top+A.top,n=this.width-A.left-A.right,o=this.height-A.top-A.bottom;this.imageObj.drawImageAtPosition(e,t,C,i,n,o),this.disableShadow(e,g)}}_drawImageLabel(e,g,t,A,C){let i=0;if(this.height!==void 0){i=this.height*.5;let o=this.labelModule.getTextSize(e,A,C);o.lineCount>=1&&(i+=o.height/2)}let n=t+i;this.options.label&&(this.labelOffset=i),this.labelModule.draw(e,g,n,A,C,"hanging")}},Ok=class extends qt{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(g,t)){let A=this.getDimensionsFromLabel(e,g,t),C=Math.max(A.width+this.margin.right+this.margin.left,A.height+this.margin.top+this.margin.bottom);this.options.size=C/2,this.width=C,this.height=C,this.radius=this.width/2}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this._drawRawCircle(e,g,t,i),this.updateBoundingBox(g,t),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,t,A,C)}updateBoundingBox(e,g){this.boundingBox.top=g-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=g+this.options.size}distanceToBorder(e){return e&&this.resize(e),this.width*.5}},en=class extends qt{constructor(e,g,t,A,C){super(e,g,t),this.setImages(A,C)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let C=this.options.size*2;this.width=C,this.height=C,this.radius=.5*this.width;return}this.needsRefresh(g,t)&&this._resizeImage()}draw(e,g,t,A,C,i){this.switchImages(A),this.resize();let n=g,o=t;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=g,this.top=t,n+=this.width/2,o+=this.height/2):(this.left=g-this.width/2,this.top=t-this.height/2),this._drawRawCircle(e,n,o,i),e.save(),e.clip(),this._drawImageAtPosition(e,i),e.restore(),this._drawImageLabel(e,n,o,A,C),this.updateBoundingBox(g,t)}updateBoundingBox(e,g){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=g,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=g+this.options.size*2):(this.boundingBox.top=g-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=g+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}},$e=class extends og{constructor(e,g,t){super(e,g,t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(g,t)){var C,i;this.labelModule.getTextSize(e,g,t);let n=2*A.size;this.width=(C=this.customSizeWidth)!==null&&C!==void 0?C:n,this.height=(i=this.customSizeHeight)!==null&&i!==void 0?i:n,this.radius=.5*this.width}}_drawShape(e,g,t,A,C,i,n,o){return this.resize(e,i,n,o),this.left=A-this.width/2,this.top=C-this.height/2,this.initContextForDraw(e,o),sp(g)(e,A,C,o.size),this.performFill(e,o),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(i?"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,A,C)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,i,n,A,C,"hanging");let s=C+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,A,s,i,n,"hanging")}this.updateBoundingBox(A,C)}}}updateBoundingBox(e,g){this.boundingBox.top=g-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=g+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 ua(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function Pk(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=ua(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=ua(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}var gn=class extends $e{constructor(e,g,t,A){super(e,g,t,A),this.ctxRenderer=A}draw(e,g,t,A,C,i){this.resize(e,A,C,i),this.left=g-this.width/2,this.top=t-this.height/2,e.save();let n=this.ctxRenderer({ctx:e,id:this.options.id,x:g,y:t,state:{selected:A,hover:C},style:Pk({},i),label:this.options.label});if(n.drawNode!=null&&n.drawNode(),e.restore(),n.drawExternalLabel){let o=n.drawExternalLabel;n.drawExternalLabel=()=>{e.save(),o(),e.restore()}}return n.nodeDimensions&&(this.customSizeWidth=n.nodeDimensions.width,this.customSizeHeight=n.nodeDimensions.height),n}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},tn=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e,g,t){if(this.needsRefresh(g,t)){let C=this.getDimensionsFromLabel(e,g,t).width+this.margin.right+this.margin.left;this.width=C,this.height=C,this.radius=this.width/2}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this.initContextForDraw(e,i),Ja(e,g-this.width/2,t-this.height/2,this.width,this.height),this.performFill(e,i),this.updateBoundingBox(g,t,e,A,C),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},Dk=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"diamond",4,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},An=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"circle",2,g,t,A,C,i)}distanceToBorder(e){return e&&this.resize(e),this.options.size}},NI=class extends og{constructor(e,g,t){super(e,g,t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(g,t)){let A=this.getDimensionsFromLabel(e,g,t);this.height=A.height*2,this.width=A.width+A.height,this.radius=.5*this.width}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width*.5,this.top=t-this.height*.5,this.initContextForDraw(e,i),bi(e,this.left,this.top,this.width,this.height),this.performFill(e,i),this.updateBoundingBox(g,t,e,A,C),this.labelModule.draw(e,g,t,A,C)}distanceToBorder(e,g){e&&this.resize(e);let t=this.width*.5,A=this.height*.5,C=Math.sin(g)*t,i=Math.cos(g)*A;return t*A/Math.sqrt(C*C+i*i)}},In=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e,g,t){this.needsRefresh(g,t)&&(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,g,t,A,C,i){return this.resize(e,A,C),this.options.icon.size=this.options.icon.size||50,this.left=g-this.width/2,this.top=t-this.height/2,this._icon(e,g,t,A,C,i),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,t+this.height/2+5,A),this.updateBoundingBox(g,t)}}}updateBoundingBox(e,g){this.boundingBox.top=g-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=g+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,g,t,A,C,i){let n=Number(this.options.icon.size);this.options.icon.code!==void 0?(e.font=[this.options.icon.weight!=null?this.options.icon.weight:A?"bold":"",(this.options.icon.weight!=null&&A?5:0)+n+"px",this.options.icon.face].join(" "),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,i),e.fillText(this.options.icon.code,g,t),this.disableShadow(e,i)):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,g){return this._distanceToBorder(e,g)}},Nk=class extends qt{constructor(e,g,t,A,C){super(e,g,t),this.setImages(A,C)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let C=this.options.size*2;this.width=C,this.height=C;return}this.needsRefresh(g,t)&&this._resizeImage()}draw(e,g,t,A,C,i){e.save(),this.switchImages(A),this.resize();let n=g,o=t;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=g,this.top=t,n+=this.width/2,o+=this.height/2):(this.left=g-this.width/2,this.top=t-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){let s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,a=(A?r:s)/this.body.view.scale;e.lineWidth=Math.min(this.width,a),e.beginPath();let d=A?this.options.color.highlight.border:C?this.options.color.hover.border:this.options.color.border,l=A?this.options.color.highlight.background:C?this.options.color.hover.background:this.options.color.background;i.opacity!==void 0&&(d=Ne(d,i.opacity),l=Ne(l,i.opacity)),e.strokeStyle=d,e.fillStyle=l,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),EA(e).call(e),this.performStroke(e,i),e.closePath()}this._drawImageAtPosition(e,i),this._drawImageLabel(e,n,o,A,C),this.updateBoundingBox(g,t),e.restore()}updateBoundingBox(e,g){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=g):(this.left=e-this.width/2,this.top=g-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,g){return this._distanceToBorder(e,g)}},Cn=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"square",2,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},nn=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"hexagon",4,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},on=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"star",4,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},sn=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e,g,t){this.needsRefresh(g,t)&&(this.textSize=this.labelModule.getTextSize(e,g,t),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,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this.enableShadow(e,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C),this.disableShadow(e,i),this.updateBoundingBox(g,t,e,A,C)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},Rk=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"triangle",3,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},rn=class extends $e{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"triangleDown",3,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}};function fa(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function pa(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=fa(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=fa(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}var pe=class I{constructor(e,g,t,A,C,i){this.options=Tg(C),this.globalOptions=C,this.defaultOptions=i,this.body=g,this.edges=[],this.id=void 0,this.imagelist=t,this.grouplist=A,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 DI(this.body,this.options,!1),this.setOptions(e)}attachEdge(e){var g;G(g=this.edges).call(g,e)===-1&&this.edges.push(e)}detachEdge(e){var g;let t=G(g=this.edges).call(g,e);if(t!=-1){var A;Ue(A=this.edges).call(A,t,1)}}setOptions(e){let g=this.options.shape;if(!e)return;if(typeof e.color!="undefined"&&(this._localColor=e.color),e.id!==void 0&&(this.id=e.id),this.id===void 0)throw new Error("Node must have an id");I.checkMass(e,this.id),e.x!==void 0&&(e.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=ze(e.x),this.predefinedPosition=!0)),e.y!==void 0&&(e.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=ze(e.y),this.predefinedPosition=!0)),e.size!==void 0&&(this.baseSize=e.size),e.value!==void 0&&(e.value=xh(e.value)),I.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);let t=[e,this.options,this.defaultOptions];return this.chooser=Mo("node",t),this._load_images(),this.updateLabelModule(e),e.opacity!==void 0&&I.checkOpacity(e.opacity)&&(this.options.opacity=e.opacity),this.updateShape(g),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,g,t){var A;if(t===void 0)return;let C=e.group;if(g!==void 0&&g.group!==void 0&&C!==g.group)throw new Error("updateGroupOptions: group values in options don't match.");if(!(typeof C=="number"||typeof C=="string"&&C!=""))return;let n=t.get(C);n.opacity!==void 0&&g.opacity===void 0&&(I.checkOpacity(n.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+n.opacity),n.opacity=void 0));let o=te(A=Ek(g)).call(A,s=>g[s]!=null);o.push("font"),bI(o,e,n),e.color=Gi(e.color)}static parseOptions(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},C=arguments.length>4?arguments[4]:void 0;if(bI(["color","fixed","shadow"],e,g,t),I.checkMass(g),e.opacity!==void 0&&(I.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),g.opacity!==void 0&&(I.checkOpacity(g.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+g.opacity),g.opacity=void 0)),g.shapeProperties&&!I.checkCoordinateOrigin(g.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+g.shapeProperties.coordinateOrigin),De(e,g,"shadow",A),g.color!==void 0&&g.color!==null){let n=Gi(g.color);Zl(e.color,n)}else t===!0&&g.color===null&&(e.color=Tg(A.color));g.fixed!==void 0&&g.fixed!==null&&(typeof g.fixed=="boolean"?(e.fixed.x=g.fixed,e.fixed.y=g.fixed):(g.fixed.x!==void 0&&typeof g.fixed.x=="boolean"&&(e.fixed.x=g.fixed.x),g.fixed.y!==void 0&&typeof g.fixed.y=="boolean"&&(e.fixed.y=g.fixed.y))),t===!0&&g.font===null&&(e.font=Tg(A.font)),I.updateGroupOptions(e,g,C),g.scaling!==void 0&&De(e.scaling,g.scaling,"label",A.scaling)}getFormattingValues(){let 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){let g=this.options.opacity;e.borderColor=Ne(e.borderColor,g),e.color=Ne(e.color,g),e.shadowColor=Ne(e.shadowColor,g)}return e}updateLabelModule(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),I.updateGroupOptions(this.options,pa(pa({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);let g=this.grouplist.get(this.options.group,!1),t=[e,this.options,g,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),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 xk(this.options,this.body,this.labelModule);break;case"circle":this.shape=new Ok(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new en(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new gn(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new tn(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new Dk(this.options,this.body,this.labelModule);break;case"dot":this.shape=new An(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new NI(this.options,this.body,this.labelModule);break;case"icon":this.shape=new In(this.options,this.body,this.labelModule);break;case"image":this.shape=new Nk(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new Cn(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new nn(this.options,this.body,this.labelModule);break;case"star":this.shape=new on(this.options,this.body,this.labelModule);break;case"text":this.shape=new sn(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new Rk(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new rn(this.options,this.body,this.labelModule);break;default:this.shape=new NI(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,g){return this.shape.distanceToBorder(e,g)}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,g,t){if(this.options.value!==void 0){let A=this.options.scaling.customScalingFunction(e,g,t,this.options.value),C=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let i=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+A*i}this.options.size=this.options.scaling.min+A*C}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){let g=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,g)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){let g=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,g)}getItemsOnPoint(e){let g=[];return this.labelModule.visible()&&Ji(this.labelModule.getSize(),e)&&g.push({nodeId:this.id,labelId:0}),Ji(this.shape.boundingBox,e)&&g.push({nodeId:this.id}),g}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,g){if(e.mass!==void 0&&e.mass<=0){let t="";g!==void 0&&(t=" in node id: "+g),console.error("%cNegative or zero mass disallowed"+t+", setting mass to 1.",jl),e.mass=1}}},an=class{constructor(e,g,t,A){var C;if(this.body=e,this.images=g,this.groups=t,this.layoutEngine=A,this.body.functions.createNode=b(C=this.create).call(C,this),this.nodesListeners={add:(i,n)=>{this.add(n.items)},update:(i,n)=>{this.update(n.items,n.data,n.oldData)},remove:(i,n)=>{this.remove(n.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(i,n,o,s){if(n===i)return .5;{let r=1/(n-i);return Math.max(0,(s-i)*r)}}},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=Tg(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,g;this.body.emitter.on("refreshNodes",b(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",b(g=this.refresh).call(g,this)),this.body.emitter.on("destroy",()=>{S(this.nodesListeners,(t,A)=>{this.body.data.nodes&&this.body.data.nodes.off(A,t)}),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(pe.parseOptions(this.options,e),e.opacity!==void 0&&(Ui(e.opacity)||!Mg(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(let g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this.body.nodes[g].updateShape();if(typeof e.font!="undefined"||typeof e.widthConstraint!="undefined"||typeof e.heightConstraint!="undefined")for(let g of U(this.body.nodes))this.body.nodes[g].updateLabelModule(),this.body.nodes[g].needsRefresh();if(e.size!==void 0)for(let g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this.body.nodes[g].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.data.nodes;if(Eh("id",e))this.body.data.nodes=e;else if(B(e))this.body.data.nodes=new Pg,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new Pg;else throw new TypeError("Array or DataSet expected");if(t&&S(this.nodesListeners,function(A,C){t.off(C,A)}),this.body.nodes={},this.body.data.nodes){let A=this;S(this.nodesListeners,function(i,n){A.body.data.nodes.on(n,i)});let C=this.body.data.nodes.getIds();this.add(C,!0)}g===!1&&this.body.emitter.emit("_dataChanged")}add(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t,A=[];for(let C=0;C<e.length;C++){t=e[C];let i=this.body.data.nodes.get(t),n=this.create(i);A.push(n),this.body.nodes[t]=n}this.layoutEngine.positionInitially(A),g===!1&&this.body.emitter.emit("_dataChanged")}update(e,g,t){let A=this.body.nodes,C=!1;for(let i=0;i<e.length;i++){let n=e[i],o=A[n],s=g[i];o!==void 0?o.setOptions(s)&&(C=!0):(C=!0,o=this.create(s),A[n]=o)}!C&&t!==void 0&&(C=ih(g).call(g,function(i,n){let o=t[n];return o&&o.level!==i.level})),C===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}remove(e){let g=this.body.nodes;for(let t=0;t<e.length;t++){let A=e[t];delete g[A]}this.body.emitter.emit("_dataChanged")}create(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pe;return new g(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;S(this.body.nodes,(g,t)=>{let A=this.body.data.nodes.get(t);A!==void 0&&(e===!0&&g.setOptions({x:null,y:null}),g.setOptions({fixed:!1}),g.setOptions(A))})}getPositions(e){let g={};if(e!==void 0){if(B(e)===!0){for(let t=0;t<e.length;t++)if(this.body.nodes[e[t]]!==void 0){let A=this.body.nodes[e[t]];g[e[t]]={x:Math.round(A.x),y:Math.round(A.y)}}}else if(this.body.nodes[e]!==void 0){let t=this.body.nodes[e];g[e]={x:Math.round(t.x),y:Math.round(t.y)}}}else for(let t=0;t<this.body.nodeIndices.length;t++){let A=this.body.nodes[this.body.nodeIndices[t]];g[this.body.nodeIndices[t]]={x:Math.round(A.x),y:Math.round(A.y)}}return g}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(){let e=[],g=this.body.data.nodes.getDataSet();for(let t of g.get()){let A=t.id,C=this.body.nodes[A],i=Math.round(C.x),n=Math.round(C.y);(t.x!==i||t.y!==n)&&e.push({id:A,x:i,y:n})}g.update(e)}getBoundingBox(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}getConnectedNodes(e,g){let t=[];if(this.body.nodes[e]!==void 0){let A=this.body.nodes[e],C={};for(let i=0;i<A.edges.length;i++){let n=A.edges[i];g!=="to"&&n.toId==A.id?C[n.fromId]===void 0&&(t.push(n.fromId),C[n.fromId]=!0):g!=="from"&&n.fromId==A.id&&C[n.toId]===void 0&&(t.push(n.toId),C[n.toId]=!0)}}return t}getConnectedEdges(e){let g=[];if(this.body.nodes[e]!==void 0){let t=this.body.nodes[e];for(let A=0;A<t.edges.length;A++)g.push(t.edges[A].id)}else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return g}moveNode(e,g,t){this.body.nodes[e]!==void 0?(this.body.nodes[e].x=Number(g),this.body.nodes[e].y=Number(t),He(()=>{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}},Sk=N,ma=Math.hypot,kk=Math.abs,Mk=Math.sqrt,Fk=!!ma&&ma(1/0,NaN)!==1/0;Sk({target:"Math",stat:!0,arity:2,forced:Fk},{hypot:function(e,g){for(var t=0,A=0,C=arguments.length,i=0,n,o;A<C;)n=kk(arguments[A++]),i<n?(o=i/n,t=t*o*o+1,i=n):n>0?(o=n/i,t+=o*o):t+=n;return i===1/0?1/0:i*Mk(t)}});var Bk=L,zk=Bk.Math.hypot,Zk=zk,Lk=Zk,Gk=Lk,Vk=D(Gk),H=class{static transform(e,g){B(e)||(e=[e]);let t=g.point.x,A=g.point.y,C=g.angle,i=g.length;for(let n=0;n<e.length;++n){let o=e[n],s=o.x*Math.cos(C)-o.y*Math.sin(C),r=o.x*Math.sin(C)+o.y*Math.cos(C);o.x=t+i*s,o.y=A+i*r}}static drawPath(e,g){e.beginPath(),e.moveTo(g[0].x,g[0].y);for(let t=1;t<g.length;++t)e.lineTo(g[t].x,g[t].y);e.closePath()}},jk=class extends H{static draw(e,g){if(g.image){e.save(),e.translate(g.point.x,g.point.y),e.rotate(Math.PI/2+g.angle);let t=g.imageWidth!=null?g.imageWidth:g.image.width,A=g.imageHeight!=null?g.imageHeight:g.image.height;g.image.drawImageAtPosition(e,1,-t/2,0,t,A),e.restore()}return!1}},dn=class extends H{static draw(e,g){let t=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return H.transform(t,g),H.drawPath(e,t),!0}},ln=class{static draw(e,g){let t=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return H.transform(t,g),H.drawPath(e,t),!0}},hn=class{static draw(e,g){let t={x:-.4,y:0};H.transform(t,g),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";let A=Math.PI,C=g.angle-A/2,i=g.angle+A/2;return e.beginPath(),e.arc(t.x,t.y,g.length*.4,C,i,!1),e.stroke(),!0}},cn=class{static draw(e,g){let t={x:-.3,y:0};H.transform(t,g),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";let A=Math.PI,C=g.angle+A/2,i=g.angle+3*A/2;return e.beginPath(),e.arc(t.x,t.y,g.length*.4,C,i,!1),e.stroke(),!0}},un=class{static draw(e,g){let t=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return H.transform(t,g),H.drawPath(e,t),!0}},fn=class{static draw(e,g){let t=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return H.transform(t,g),H.drawPath(e,t),!0}},pn=class{static draw(e,g){let t={x:-.4,y:0};return H.transform(t,g),qn(e,t.x,t.y,g.length*.4),!0}},mn=class{static draw(e,g){let t=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return H.transform(t,g),H.drawPath(e,t),!0}},vn=class{static draw(e,g){let t=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return H.transform(t,g),H.drawPath(e,t),!0}},bn=class{static draw(e,g){let t=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return H.transform(t,g),H.drawPath(e,t),!0}},yn=class{static draw(e,g){let t=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return H.transform(t,g),H.drawPath(e,t),!0}},RI=class{static draw(e,g){let t;switch(g.type&&(t=g.type.toLowerCase()),t){case"image":return jk.draw(e,g);case"circle":return pn.draw(e,g);case"box":return vn.draw(e,g);case"crow":return ln.draw(e,g);case"curve":return hn.draw(e,g);case"diamond":return bn.draw(e,g);case"inv_curve":return cn.draw(e,g);case"triangle":return un.draw(e,g);case"inv_triangle":return fn.draw(e,g);case"bar":return mn.draw(e,g);case"vee":return yn.draw(e,g);case"arrow":default:return dn.draw(e,g)}}};function va(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function ba(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=va(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=va(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}var SI=class{constructor(e,g,t){this._body=g,this._labelModule=t,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(e),this.fromPoint=this.from,this.toPoint=this.to}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}cleanup(){return!1}setOptions(e){this.options=e,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}drawLine(e,g,t,A){let C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,g),e.lineWidth=g.width,g.dashes!==!1?this._drawDashedLine(e,g,C):this._drawLine(e,g,C)}_drawLine(e,g,t,A,C){if(this.from!=this.to)this._line(e,g,t,A,C);else{let[i,n,o]=this._getCircleData(e);this._circle(e,g,i,n,o)}}_drawDashedLine(e,g,t,A,C){e.lineCap="round";let i=B(g.dashes)?g.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(i),e.lineDashOffset=0,this.from!=this.to)this._line(e,g,t);else{let[n,o,s]=this._getCircleData(e);this._circle(e,g,n,o,s)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)$a(e,this.from.x,this.from.y,this.to.x,this.to.y,i);else{let[n,o,s]=this._getCircleData(e);this._circle(e,g,n,o,s)}this.enableShadow(e,g),e.stroke(),this.disableShadow(e,g)}}findBorderPosition(e,g,t){return this.from!=this.to?this._findBorderPosition(e,g,t):this._findBorderPositionCircle(e,g,t)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var g;let[t,A]=Ze(g=this._getCircleData(e)).call(g,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:.6,high:.8,direction:1})}}}_getCircleData(e){let g=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);let t=Oh(e,this.options.selfReference.angle,g,this.from);return[t.x,t.y,g]}_pointOnCircle(e,g,t,A){let C=A*2*Math.PI;return{x:e+t*Math.cos(C),y:g-t*Math.sin(C)}}_findBorderPositionCircle(e,g,t){let A=t.x,C=t.y,i=t.low,n=t.high,o=t.direction,s=10,r=this.options.selfReference.size,a=.05,d,l=(i+n)*.5,h=0;this.options.arrowStrikethrough===!0&&(o===-1?h=this.options.endPointOffset.from:o===1&&(h=this.options.endPointOffset.to));let c=0;do{l=(i+n)*.5,d=this._pointOnCircle(A,C,r,l);let p=Math.atan2(e.y-d.y,e.x-d.x),u=e.distanceToBorder(g,p)+h,m=Math.sqrt(Math.pow(d.x-e.x,2)+Math.pow(d.y-e.y,2)),E=u-m;if(Math.abs(E)<a)break;E>0?o>0?i=l:n=l:o>0?n=l:i=l,++c}while(i<=n&&c<s);return ba(ba({},d),{},{t:l})}getLineWidth(e,g){return e===!0?Math.max(this.selectionWidth,.3/this._body.view.scale):g===!0?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}getColor(e,g){if(g.inheritsColor!==!1){if(g.inheritsColor==="both"&&this.from.id!==this.to.id){let t=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),A=this.from.options.color.highlight.border,C=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(A=Ne(this.from.options.color.border,g.opacity),C=Ne(this.to.options.color.border,g.opacity)):this.from.selected===!0&&this.to.selected===!1?C=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(A=this.from.options.color.border),t.addColorStop(0,A),t.addColorStop(1,C),t}return g.inheritsColor==="to"?Ne(this.to.options.color.border,g.opacity):Ne(this.from.options.color.border,g.opacity)}else return Ne(g.color,g.opacity)}_circle(e,g,t,A,C){this.enableShadow(e,g);let i=0,n=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){let o=this.options.selfReference.angle,s=this.options.selfReference.angle+Math.PI,r=this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:o,high:s,direction:-1}),a=this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:o,high:s,direction:1});i=Math.atan2(r.y-A,r.x-t),n=Math.atan2(a.y-A,a.x-t)}e.beginPath(),e.arc(t,A,C,i,n,!1),e.stroke(),this.disableShadow(e,g)}getDistanceToEdge(e,g,t,A,C,i){if(this.from!=this.to)return this._getDistanceToEdge(e,g,t,A,C,i);{let[n,o,s]=this._getCircleData(void 0),r=n-C,a=o-i;return Math.abs(Math.sqrt(r*r+a*a)-s)}}_getDistanceToLine(e,g,t,A,C,i){let n=t-e,o=A-g,s=n*n+o*o,r=((C-e)*n+(i-g)*o)/s;r>1?r=1:r<0&&(r=0);let a=e+r*n,d=g+r*o,l=a-C,h=d-i;return Math.sqrt(l*l+h*h)}getArrowData(e,g,t,A,C,i){let n,o,s,r,a,d,l,h=i.width;g==="from"?(s=this.from,r=this.to,a=i.fromArrowScale<0,d=Math.abs(i.fromArrowScale),l=i.fromArrowType):g==="to"?(s=this.to,r=this.from,a=i.toArrowScale<0,d=Math.abs(i.toArrowScale),l=i.toArrowType):(s=this.to,r=this.from,a=i.middleArrowScale<0,d=Math.abs(i.middleArrowScale),l=i.middleArrowType);let c=15*d+3*h;if(s!=r){let E=Vk(s.x-r.x,s.y-r.y),w=c/E;if(g!=="middle")if(this.options.smooth.enabled===!0){let O=this._findBorderPosition(s,e,{via:t}),M=this.getPoint(O.t+w*(g==="from"?1:-1),t);n=Math.atan2(O.y-M.y,O.x-M.x),o=O}else n=Math.atan2(s.y-r.y,s.x-r.x),o=this._findBorderPosition(s,e);else{let O=(a?-w:w)/2,M=this.getPoint(.5+O,t),k=this.getPoint(.5-O,t);n=Math.atan2(M.y-k.y,M.x-k.x),o=this.getPoint(.5,t)}}else{let[E,w,O]=this._getCircleData(e);if(g==="from"){let M=this.options.selfReference.angle,k=this.options.selfReference.angle+Math.PI,V=this._findBorderPositionCircle(this.from,e,{x:E,y:w,low:M,high:k,direction:-1});n=V.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,o=V}else if(g==="to"){let M=this.options.selfReference.angle,k=this.options.selfReference.angle+Math.PI,V=this._findBorderPositionCircle(this.from,e,{x:E,y:w,low:M,high:k,direction:1});n=V.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,o=V}else{let M=this.options.selfReference.angle/(2*Math.PI);o=this._pointOnCircle(E,w,O,M),n=M*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}let p=o.x-c*.9*Math.cos(n),u=o.y-c*.9*Math.sin(n);return{point:o,core:{x:p,y:u},angle:n,length:c,type:l}}drawArrowHead(e,g,t,A,C){e.strokeStyle=this.getColor(e,g),e.fillStyle=e.strokeStyle,e.lineWidth=g.width,RI.draw(e,C)&&(this.enableShadow(e,g),EA(e).call(e),this.disableShadow(e,g))}enableShadow(e,g){g.shadow===!0&&(e.shadowColor=g.shadowColor,e.shadowBlur=g.shadowSize,e.shadowOffsetX=g.shadowX,e.shadowOffsetY=g.shadowY)}disableShadow(e,g){g.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,g){if(g.background!==!1){let t={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=g.backgroundColor,e.lineWidth=g.backgroundSize,this.setStrokeDashed(e,g.backgroundDashes),e.stroke(),e.strokeStyle=t.strokeStyle,e.lineWidth=t.lineWidth,e.dashes=t.dashes,this.setStrokeDashed(e,g.dashes)}}setStrokeDashed(e,g){if(g!==!1)if(e.setLineDash!==void 0){let t=B(g)?g:[5,5];e.setLineDash(t)}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 ya(I,e){var g=U(I);if(Xe){var t=Xe(I);e&&(t=te(t).call(t,function(A){return eg(I,A).enumerable})),g.push.apply(g,t)}return g}function wa(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=ya(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?RA(I,Je(A)):F(t=ya(Object(A))).call(t,function(C){SA(I,C,eg(A,C))})}return I}var eA=class extends SI{constructor(e,g,t){super(e,g,t)}_findBorderPositionBezier(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),A=10,C=.2,i=!1,n=1,o=0,s=this.to,r,a,d=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(s=this.from,i=!0,d=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(d=0);let l=0;do{a=(o+n)*.5,r=this.getPoint(a,t);let h=Math.atan2(s.y-r.y,s.x-r.x),c=s.distanceToBorder(g,h)+d,p=Math.sqrt(Math.pow(r.x-s.x,2)+Math.pow(r.y-s.y,2)),u=c-p;if(Math.abs(u)<C)break;u<0?i===!1?o=a:n=a:i===!1?n=a:o=a,++l}while(o<=n&&l<A);return wa(wa({},r),{},{t:a})}_getDistanceToBezierEdge(e,g,t,A,C,i,n){let o=1e9,s,r,a,d,l,h=e,c=g;for(r=1;r<10;r++)a=.1*r,d=Math.pow(1-a,2)*e+2*a*(1-a)*n.x+Math.pow(a,2)*t,l=Math.pow(1-a,2)*g+2*a*(1-a)*n.y+Math.pow(a,2)*A,r>0&&(s=this._getDistanceToLine(h,c,d,l,C,i),o=s<o?s:o),h=d,c=l;return o}_bezierCurve(e,g,t,A){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),t!=null&&t.x!=null?A!=null&&A.x!=null?e.bezierCurveTo(t.x,t.y,A.x,A.y,this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(t.x,t.y,this.toPoint.x,this.toPoint.y):e.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(e,g),this.enableShadow(e,g),e.stroke(),this.disableShadow(e,g)}getViaNode(){return this._getViaCoordinates()}},kI=class extends eA{constructor(e,g,t){super(e,g,t),this.via=this.via,this._boundFunction=()=>{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(e){super.setOptions(e);let g=!1;this.options.physics!==e.physics&&(g=!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(),g===!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){let e="edgeId:"+this.id,g=this._body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this._body.nodes[e]=g,this.via=g,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,g,t){this._bezierCurve(e,g,t)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){let[t,A,C]=this._getCircleData(),i=2*Math.PI*(1-e);return{x:t+C*Math.sin(i),y:A+C-C*(1-Math.cos(i))}}else return{x:Math.pow(1-e,2)*this.fromPoint.x+2*e*(1-e)*g.x+Math.pow(e,2)*this.toPoint.x,y:Math.pow(1-e,2)*this.fromPoint.y+2*e*(1-e)*g.y+Math.pow(e,2)*this.toPoint.y}}_findBorderPosition(e,g){return this._findBorderPositionBezier(e,g,this.via)}_getDistanceToEdge(e,g,t,A,C,i){return this._getDistanceToBezierEdge(e,g,t,A,C,i,this.via)}},MI=class extends eA{constructor(e,g,t){super(e,g,t)}_line(e,g,t){this._bezierCurve(e,g,t)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){let e=this.options.smooth.roundness,g=this.options.smooth.type,t=Math.abs(this.from.x-this.to.x),A=Math.abs(this.from.y-this.to.y);if(g==="discrete"||g==="diagonalCross"){let C,i;t<=A?C=i=e*A:C=i=e*t,this.from.x>this.to.x&&(C=-C),this.from.y>=this.to.y&&(i=-i);let n=this.from.x+C,o=this.from.y+i;return g==="discrete"&&(t<=A?n=t<e*A?this.from.x:n:o=A<e*t?this.from.y:o),{x:n,y:o}}else if(g==="straightCross"){let C=(1-e)*t,i=(1-e)*A;return t<=A?(C=0,this.from.y<this.to.y&&(i=-i)):(this.from.x<this.to.x&&(C=-C),i=0),{x:this.to.x+C,y:this.to.y+i}}else if(g==="horizontal"){let C=(1-e)*t;return this.from.x<this.to.x&&(C=-C),{x:this.to.x+C,y:this.from.y}}else if(g==="vertical"){let C=(1-e)*A;return this.from.y<this.to.y&&(C=-C),{x:this.from.x,y:this.to.y+C}}else if(g==="curvedCW"){t=this.to.x-this.from.x,A=this.from.y-this.to.y;let C=Math.sqrt(t*t+A*A),i=Math.PI,o=(Math.atan2(A,t)+(e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*C*Math.sin(o),y:this.from.y+(e*.5+.5)*C*Math.cos(o)}}else if(g==="curvedCCW"){t=this.to.x-this.from.x,A=this.from.y-this.to.y;let C=Math.sqrt(t*t+A*A),i=Math.PI,o=(Math.atan2(A,t)+(-e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*C*Math.sin(o),y:this.from.y+(e*.5+.5)*C*Math.cos(o)}}else{let C,i;t<=A?C=i=e*A:C=i=e*t,this.from.x>this.to.x&&(C=-C),this.from.y>=this.to.y&&(i=-i);let n=this.from.x+C,o=this.from.y+i;return t<=A?this.from.x<=this.to.x?n=this.to.x<n?this.to.x:n:n=this.to.x>n?this.to.x:n:this.from.y>=this.to.y?o=this.to.y>o?this.to.y:o:o=this.to.y<o?this.to.y:o,{x:n,y:o}}}_findBorderPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,g,t.via)}_getDistanceToEdge(e,g,t,A,C,i){let n=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,g,t,A,C,i,n)}getPoint(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),t=e,A=Math.pow(1-t,2)*this.fromPoint.x+2*t*(1-t)*g.x+Math.pow(t,2)*this.toPoint.x,C=Math.pow(1-t,2)*this.fromPoint.y+2*t*(1-t)*g.y+Math.pow(t,2)*this.toPoint.y;return{x:A,y:C}}},wn=class extends eA{constructor(e,g,t){super(e,g,t)}_getDistanceToBezierEdge2(e,g,t,A,C,i,n,o){let s=1e9,r=e,a=g,d=[0,0,0,0];for(let l=1;l<10;l++){let h=.1*l;d[0]=Math.pow(1-h,3),d[1]=3*h*Math.pow(1-h,2),d[2]=3*Math.pow(h,2)*(1-h),d[3]=Math.pow(h,3);let c=d[0]*e+d[1]*n.x+d[2]*o.x+d[3]*t,p=d[0]*g+d[1]*n.y+d[2]*o.y+d[3]*A;if(l>0){let u=this._getDistanceToLine(r,a,c,p,C,i);s=u<s?u:s}r=c,a=p}return s}},FI=class extends wn{constructor(e,g,t){super(e,g,t)}_line(e,g,t){let A=t[0],C=t[1];this._bezierCurve(e,g,A,C)}_getViaCoordinates(){let e=this.from.x-this.to.x,g=this.from.y-this.to.y,t,A,C,i,n=this.options.smooth.roundness;return(Math.abs(e)>Math.abs(g)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(A=this.from.y,i=this.to.y,t=this.from.x-n*e,C=this.to.x+n*e):(A=this.from.y-n*g,i=this.to.y+n*g,t=this.from.x,C=this.to.x),[{x:t,y:A},{x:C,y:i}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,g){return this._findBorderPositionBezier(e,g)}_getDistanceToEdge(e,g,t,A,C,i){let[n,o]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,g,t,A,C,i,n,o)}getPoint(e){let[g,t]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),A=e,C=[Math.pow(1-A,3),3*A*Math.pow(1-A,2),3*Math.pow(A,2)*(1-A),Math.pow(A,3)],i=C[0]*this.fromPoint.x+C[1]*g.x+C[2]*t.x+C[3]*this.toPoint.x,n=C[0]*this.fromPoint.y+C[1]*g.y+C[2]*t.y+C[3]*this.toPoint.y;return{x:i,y:n}}},BI=class extends SI{constructor(e,g,t){super(e,g,t)}_line(e,g){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,g),e.stroke(),this.disableShadow(e,g)}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,g){let t=this.to,A=this.from;e.id===this.from.id&&(t=this.from,A=this.to);let C=Math.atan2(t.y-A.y,t.x-A.x),i=t.x-A.x,n=t.y-A.y,o=Math.sqrt(i*i+n*n),s=e.distanceToBorder(g,C),r=(o-s)/o;return{x:(1-r)*A.x+r*t.x,y:(1-r)*A.y+r*t.y,t:0}}_getDistanceToEdge(e,g,t,A,C,i){return this._getDistanceToLine(e,g,t,A,C,i)}},xg=class I{constructor(e,g,t,A,C){if(g===void 0)throw new Error("No body provided");this.options=Tg(A),this.globalOptions=A,this.defaultOptions=C,this.body=g,this.imagelist=t,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 DI(this.body,this.options,!0),this.setOptions(e)}setOptions(e){if(!e)return;let g=typeof e.physics!="undefined"&&this.options.physics!==e.physics||typeof e.hidden!="undefined"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from!="undefined"&&this.options.from!==e.from||typeof e.to!="undefined"&&this.options.to!==e.to;I.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=xh(e.value));let t=[e,this.options,this.defaultOptions];return this.chooser=Mo("edge",t),this.updateLabelModule(e),g=this.updateEdgeType()||g,this._setInteractionWidths(),this.connect(),g}static parseOptions(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(xt(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],e,g,t),g.endPointOffset!==void 0&&g.endPointOffset.from!==void 0&&(Mg(g.endPointOffset.from)?e.endPointOffset.from=g.endPointOffset.from:(e.endPointOffset.from=A.endPointOffset.from!==void 0?A.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),g.endPointOffset!==void 0&&g.endPointOffset.to!==void 0&&(Mg(g.endPointOffset.to)?e.endPointOffset.to=g.endPointOffset.to:(e.endPointOffset.to=A.endPointOffset.to!==void 0?A.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),OI(g.label)?e.label=g.label:OI(e.label)||(e.label=void 0),De(e,g,"smooth",A),De(e,g,"shadow",A),De(e,g,"background",A),g.dashes!==void 0&&g.dashes!==null?e.dashes=g.dashes:t===!0&&g.dashes===null&&(e.dashes=wg(A.dashes)),g.scaling!==void 0&&g.scaling!==null?(g.scaling.min!==void 0&&(e.scaling.min=g.scaling.min),g.scaling.max!==void 0&&(e.scaling.max=g.scaling.max),De(e.scaling,g.scaling,"label",A.scaling)):t===!0&&g.scaling===null&&(e.scaling=wg(A.scaling)),g.arrows!==void 0&&g.arrows!==null)if(typeof g.arrows=="string"){let n=g.arrows.toLowerCase();e.arrows.to.enabled=G(n).call(n,"to")!=-1,e.arrows.middle.enabled=G(n).call(n,"middle")!=-1,e.arrows.from.enabled=G(n).call(n,"from")!=-1}else if(typeof g.arrows=="object")De(e.arrows,g.arrows,"to",A.arrows),De(e.arrows,g.arrows,"middle",A.arrows),De(e.arrows,g.arrows,"from",A.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+Et(g.arrows));else t===!0&&g.arrows===null&&(e.arrows=wg(A.arrows));if(g.color!==void 0&&g.color!==null){let n=pg(g.color)?{color:g.color,highlight:g.color,hover:g.color,inherit:!1,opacity:1}:g.color,o=e.color;if(C)_(o,A.color,!1,t);else for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&delete o[s];if(pg(o))o.color=o,o.highlight=o,o.hover=o,o.inherit=!1,n.opacity===void 0&&(o.opacity=1);else{let s=!1;n.color!==void 0&&(o.color=n.color,s=!0),n.highlight!==void 0&&(o.highlight=n.highlight,s=!0),n.hover!==void 0&&(o.hover=n.hover,s=!0),n.inherit!==void 0&&(o.inherit=n.inherit),n.opacity!==void 0&&(o.opacity=Math.min(1,Math.max(0,n.opacity))),s===!0?o.inherit=!1:o.inherit===void 0&&(o.inherit="from")}}else t===!0&&g.color===null&&(e.color=Tg(A.color));t===!0&&g.font===null&&(e.font=Tg(A.font)),Object.prototype.hasOwnProperty.call(g,"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=g.selfReferenceSize)}getFormattingValues(){let e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,g=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,t=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,A=this.options.color.inherit,C={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:t,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:g,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:A?void 0:this.options.color.color,inheritsColor:A,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){let i=this.options.selectionWidth;typeof i=="function"?C.width=i(C.width):typeof i=="number"&&(C.width+=i),C.width=Math.max(C.width,.3/this.body.view.scale),C.color=this.options.color.highlight,C.shadow=this.options.shadow.enabled}else if(this.hover){let i=this.options.hoverWidth;typeof i=="function"?C.width=i(C.width):typeof i=="number"&&(C.width+=i),C.width=Math.max(C.width,.3/this.body.view.scale),C.color=this.options.color.hover,C.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(C,this.options.id,this.selected,this.hover),C.color!==void 0&&(C.inheritsColor=!1),C.shadow===!1&&(C.shadowColor!==this.options.shadow.color||C.shadowSize!==this.options.shadow.size||C.shadowX!==this.options.shadow.x||C.shadowY!==this.options.shadow.y)&&(C.shadow=!0));else C.shadow=this.options.shadow.enabled,C.width=Math.max(C.width,.3/this.body.view.scale);return C}updateLabelModule(e){let g=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,g),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){let e=this.options.smooth,g=!1,t=!0;return this.edgeType!==void 0&&((this.edgeType instanceof kI&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof FI&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof MI&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof BI&&e.type.enabled===!1)&&(t=!1),t===!0&&(g=this.cleanup())),t===!0?e.enabled===!0?e.type==="dynamic"?(g=!0,this.edgeType=new kI(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new FI(this.options,this.body,this.labelModule):this.edgeType=new MI(this.options,this.body,this.labelModule):this.edgeType=new BI(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),g}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,g,t){if(this.options.value!==void 0){let A=this.options.scaling.customScalingFunction(e,g,t,this.options.value),C=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let i=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+A*i}this.options.width=this.options.scaling.min+A*C}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){let g=this.getFormattingValues();if(g.hidden)return;let t=this.edgeType.getViaNode();this.edgeType.drawLine(e,g,this.selected,this.hover,t),this.drawLabel(e,t)}drawArrows(e){let g=this.getFormattingValues();if(g.hidden)return;let t=this.edgeType.getViaNode(),A={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,g.fromArrow&&(A.from=this.edgeType.getArrowData(e,"from",t,this.selected,this.hover,g),g.arrowStrikethrough===!1&&(this.edgeType.fromPoint=A.from.core),g.fromArrowSrc&&(A.from.image=this.imagelist.load(g.fromArrowSrc)),g.fromArrowImageWidth&&(A.from.imageWidth=g.fromArrowImageWidth),g.fromArrowImageHeight&&(A.from.imageHeight=g.fromArrowImageHeight)),g.toArrow&&(A.to=this.edgeType.getArrowData(e,"to",t,this.selected,this.hover,g),g.arrowStrikethrough===!1&&(this.edgeType.toPoint=A.to.core),g.toArrowSrc&&(A.to.image=this.imagelist.load(g.toArrowSrc)),g.toArrowImageWidth&&(A.to.imageWidth=g.toArrowImageWidth),g.toArrowImageHeight&&(A.to.imageHeight=g.toArrowImageHeight)),g.middleArrow&&(A.middle=this.edgeType.getArrowData(e,"middle",t,this.selected,this.hover,g),g.middleArrowSrc&&(A.middle.image=this.imagelist.load(g.middleArrowSrc)),g.middleArrowImageWidth&&(A.middle.imageWidth=g.middleArrowImageWidth),g.middleArrowImageHeight&&(A.middle.imageHeight=g.middleArrowImageHeight)),g.fromArrow&&this.edgeType.drawArrowHead(e,g,this.selected,this.hover,A.from),g.middleArrow&&this.edgeType.drawArrowHead(e,g,this.selected,this.hover,A.middle),g.toArrow&&this.edgeType.drawArrowHead(e,g,this.selected,this.hover,A.to)}drawLabel(e,g){if(this.options.label!==void 0){let t=this.from,A=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let C;if(t.id!=A.id){this.labelModule.pointToSelf=!1,C=this.edgeType.getPoint(.5,g),e.save();let i=this._getRotation(e);i.angle!=0&&(e.translate(i.x,i.y),e.rotate(i.angle)),this.labelModule.draw(e,C.x,C.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;let i=Oh(e,this.options.selfReference.angle,this.options.selfReference.size,t);C=this._pointOnCircle(i.x,i.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,C.x,C.y,this.selected,this.hover)}}}getItemsOnPoint(e){let g=[];if(this.labelModule.visible()){let A=this._getRotation();Ji(this.labelModule.getSize(),e,A)&&g.push({edgeId:this.id,labelId:0})}let t={left:e.x,top:e.y};return this.isOverlappingWith(t)&&g.push({edgeId:this.id}),g}isOverlappingWith(e){if(this.connected){let t=this.from.x,A=this.from.y,C=this.to.x,i=this.to.y,n=e.left,o=e.top;return this.edgeType.getDistanceToEdge(t,A,C,i,n,o)<10}else return!1}_getRotation(e){let g=this.edgeType.getViaNode(),t=this.edgeType.getPoint(.5,g);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,t.x,t.y);let A={x:t.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return A;let C=this.from.y-this.to.y,i=this.from.x-this.to.x,n=Math.atan2(C,i);return(n<-1&&i<0||n>0&&i<0)&&(n+=Math.PI),A.angle=n,A}_pointOnCircle(e,g,t,A){return{x:e+t*Math.cos(A),y:g-t*Math.sin(A)}}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}},En=class{constructor(e,g,t){var A;this.body=e,this.images=g,this.groups=t,this.body.functions.createEdge=b(A=this.create).call(A,this),this.edgesListeners={add:(C,i)=>{this.add(i.items)},update:(C,i)=>{this.update(i.items)},remove:(C,i)=>{this.remove(i.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(C,i,n,o){if(i===C)return .5;{let s=1/(i-C);return Math.max(0,(o-C)*s)}}},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},_(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,g,t;this.body.emitter.on("_forceDisableDynamicCurves",function(A){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;A==="dynamic"&&(A="continuous");let i=!1;for(let n in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,n)){let o=e.body.edges[n],s=e.body.data.edges.get(n);if(s!=null){let r=s.smooth;r!==void 0&&r.enabled===!0&&r.type==="dynamic"&&(A===void 0?o.setOptions({smooth:!1}):o.setOptions({smooth:{type:A}}),i=!0)}}C===!0&&i===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",b(g=this.refresh).call(g,this)),this.body.emitter.on("refresh",b(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{S(this.edgesListeners,(A,C)=>{this.body.data.edges&&this.body.data.edges.off(C,A)}),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){xg.parseOptions(this.options,e,!0,this.defaultOptions,!0);let g=!1;if(e.smooth!==void 0)for(let t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&(g=this.body.edges[t].updateEdgeType()||g);if(e.font!==void 0)for(let t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&this.body.edges[t].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||g===!0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.data.edges;if(Eh("id",e))this.body.data.edges=e;else if(B(e))this.body.data.edges=new Pg,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new Pg;else throw new TypeError("Array or DataSet expected");if(t&&S(this.edgesListeners,(A,C)=>{t.off(C,A)}),this.body.edges={},this.body.data.edges){S(this.edgesListeners,(C,i)=>{this.body.data.edges.on(i,C)});let A=this.body.data.edges.getIds();this.add(A,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),g===!1&&this.body.emitter.emit("_dataChanged")}add(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.edges,A=this.body.data.edges;for(let C=0;C<e.length;C++){let i=e[C],n=t[i];n&&n.disconnect();let o=A.get(i,{showInternalIds:!0});t[i]=this.create(o)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),g===!1&&this.body.emitter.emit("_dataChanged")}update(e){let g=this.body.edges,t=this.body.data.edges,A=!1;for(let C=0;C<e.length;C++){let i=e[C],n=t.get(i),o=g[i];o!==void 0?(o.disconnect(),A=o.setOptions(n)||A,o.connect()):(this.body.edges[i]=this.create(n),A=!0)}A===!0?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}remove(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length===0)return;let t=this.body.edges;S(e,A=>{let C=t[A];C!==void 0&&C.remove()}),g&&this.body.emitter.emit("_dataChanged")}refresh(){S(this.body.edges,(e,g)=>{let t=this.body.data.edges.get(g);t!==void 0&&e.setOptions(t)})}create(e){return new xg(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e,g=this.body.nodes,t=this.body.edges;for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(g[e].edges=[]);for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let A=t[e];A.from=null,A.to=null,A.connect()}}getConnectedNodes(e){let g=[];if(this.body.edges[e]!==void 0){let t=this.body.edges[e];t.fromId!==void 0&&g.push(t.fromId),t.toId!==void 0&&g.push(t.toId)}return g}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){let e=[];S(this.body.edges,(g,t)=>{let A=this.body.nodes[g.toId],C=this.body.nodes[g.fromId];A!==void 0&&A.isCluster===!0||C!==void 0&&C.isCluster===!0||(A===void 0||C===void 0)&&e.push(t)}),this.remove(e,!1)}_addMissingEdges(){let e=this.body.data.edges;if(e==null)return;let g=this.body.edges,t=[];F(e).call(e,(A,C)=>{g[C]===void 0&&t.push(C)}),this.add(t,!0)}},zI=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.barnesHutTree,this.setOptions(t),this._rng=iC("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,g=this.body.nodes,t=this.physicsBody.physicsNodeIndices,A=t.length,C=this._formBarnesHutTree(g,t);this.barnesHutTree=C;for(let i=0;i<A;i++)e=g[t[i]],e.options.mass>0&&this._getForceContributions(C.root,e)}}_getForceContributions(e,g){this._getForceContribution(e.children.NW,g),this._getForceContribution(e.children.NE,g),this._getForceContribution(e.children.SW,g),this._getForceContribution(e.children.SE,g)}_getForceContribution(e,g){if(e.childrenCount>0){let t=e.centerOfMass.x-g.x,A=e.centerOfMass.y-g.y,C=Math.sqrt(t*t+A*A);C*e.calcSize>this.thetaInversed?this._calculateForces(C,t,A,g,e):e.childrenCount===4?this._getForceContributions(e,g):e.children.data.id!=g.id&&this._calculateForces(C,t,A,g,e)}}_calculateForces(e,g,t,A,C){e===0&&(e=.1,g=e),this.overlapAvoidanceFactor<1&&A.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*A.shape.radius,e-A.shape.radius));let i=this.options.gravitationalConstant*C.mass*A.options.mass/Math.pow(e,3),n=g*i,o=t*i;this.physicsBody.forces[A.id].x+=n,this.physicsBody.forces[A.id].y+=o}_formBarnesHutTree(e,g){let t,A=g.length,C=e[g[0]].x,i=e[g[0]].y,n=e[g[0]].x,o=e[g[0]].y;for(let p=1;p<A;p++){let u=e[g[p]],m=u.x,E=u.y;u.options.mass>0&&(m<C&&(C=m),m>n&&(n=m),E<i&&(i=E),E>o&&(o=E))}let s=Math.abs(n-C)-Math.abs(o-i);s>0?(i-=.5*s,o+=.5*s):(C+=.5*s,n-=.5*s);let a=Math.max(1e-5,Math.abs(n-C)),d=.5*a,l=.5*(C+n),h=.5*(i+o),c={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:l-d,maxX:l+d,minY:h-d,maxY:h+d},size:a,calcSize:1/a,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(c.root);for(let p=0;p<A;p++)t=e[g[p]],t.options.mass>0&&this._placeInTree(c.root,t);return c}_updateBranchMass(e,g){let t=e.centerOfMass,A=e.mass+g.options.mass,C=1/A;t.x=t.x*e.mass+g.x*g.options.mass,t.x*=C,t.y=t.y*e.mass+g.y*g.options.mass,t.y*=C,e.mass=A;let i=Math.max(Math.max(g.height,g.radius),g.width);e.maxWidth=e.maxWidth<i?i:e.maxWidth}_placeInTree(e,g,t){(t!=!0||t===void 0)&&this._updateBranchMass(e,g);let A=e.children.NW.range,C;A.maxX>g.x?A.maxY>g.y?C="NW":C="SW":A.maxY>g.y?C="NE":C="SE",this._placeInRegion(e,g,C)}_placeInRegion(e,g,t){let A=e.children[t];switch(A.childrenCount){case 0:A.children.data=g,A.childrenCount=1,this._updateBranchMass(A,g);break;case 1:A.children.data.x===g.x&&A.children.data.y===g.y?(g.x+=this._rng(),g.y+=this._rng()):(this._splitBranch(A),this._placeInTree(A,g));break;case 4:this._placeInTree(A,g);break}}_splitBranch(e){let g=null;e.childrenCount===1&&(g=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"),g!=null&&this._placeInTree(e,g)}_insertRegion(e,g){let t,A,C,i,n=.5*e.size;switch(g){case"NW":t=e.range.minX,A=e.range.minX+n,C=e.range.minY,i=e.range.minY+n;break;case"NE":t=e.range.minX+n,A=e.range.maxX,C=e.range.minY,i=e.range.minY+n;break;case"SW":t=e.range.minX,A=e.range.minX+n,C=e.range.minY+n,i=e.range.maxY;break;case"SE":t=e.range.minX+n,A=e.range.maxX,C=e.range.minY+n,i=e.range.maxY;break}e.children[g]={centerOfMass:{x:0,y:0},mass:0,range:{minX:t,maxX:A,minY:C,maxY:i},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,g){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,g))}_drawBranch(e,g,t){t===void 0&&(t="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,g),this._drawBranch(e.children.NE,g),this._drawBranch(e.children.SE,g),this._drawBranch(e.children.SW,g)),g.strokeStyle=t,g.beginPath(),g.moveTo(e.range.minX,e.range.minY),g.lineTo(e.range.maxX,e.range.minY),g.stroke(),g.beginPath(),g.moveTo(e.range.maxX,e.range.minY),g.lineTo(e.range.maxX,e.range.maxY),g.stroke(),g.beginPath(),g.moveTo(e.range.maxX,e.range.maxY),g.lineTo(e.range.minX,e.range.maxY),g.stroke(),g.beginPath(),g.moveTo(e.range.minX,e.range.maxY),g.lineTo(e.range.minX,e.range.minY),g.stroke()}},Tn=class{constructor(e,g,t){this._rng=iC("REPULSION SOLVER"),this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t,A,C,i,n,o,s=this.body.nodes,r=this.physicsBody.physicsNodeIndices,a=this.physicsBody.forces,d=this.options.nodeDistance,l=-2/3/d,h=4/3;for(let c=0;c<r.length-1;c++){n=s[r[c]];for(let p=c+1;p<r.length;p++)o=s[r[p]],e=o.x-n.x,g=o.y-n.y,t=Math.sqrt(e*e+g*g),t===0&&(t=.1*this._rng(),e=t),t<2*d&&(t<.5*d?i=1:i=l*t+h,i=i/t,A=e*i,C=g*i,a[n.id].x-=A,a[n.id].y-=C,a[o.id].x+=A,a[o.id].y+=C)}}},xn=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}solve(){let e=this.body.nodes,g=this.physicsBody.physicsNodeIndices,t=this.physicsBody.forces,A=this.options.nodeDistance;for(let C=0;C<g.length-1;C++){let i=e[g[C]];for(let n=C+1;n<g.length;n++){let o=e[g[n]];if(i.level===o.level){let s=A+this.overlapAvoidanceFactor*((i.shape.radius||0)/2+(o.shape.radius||0)/2),r=o.x-i.x,a=o.y-i.y,d=Math.sqrt(r*r+a*a),l=.05,h;d<s?h=-Math.pow(l*d,2)+Math.pow(l*s,2):h=0,d!==0&&(h=h/d);let c=r*h,p=a*h;t[i.id].x-=c,t[i.id].y-=p,t[o.id].x+=c,t[o.id].y+=p}}}}},jt=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t=this.physicsBody.physicsEdgeIndices,A=this.body.edges,C,i,n;for(let o=0;o<t.length;o++)g=A[t[o]],g.connected===!0&&g.toId!==g.fromId&&this.body.nodes[g.toId]!==void 0&&this.body.nodes[g.fromId]!==void 0&&(g.edgeType.via!==void 0?(e=g.options.length===void 0?this.options.springLength:g.options.length,C=g.to,i=g.edgeType.via,n=g.from,this._calculateSpringForce(C,i,.5*e),this._calculateSpringForce(i,n,.5*e)):(e=g.options.length===void 0?this.options.springLength*1.5:g.options.length,this._calculateSpringForce(g.from,g.to,e)))}_calculateSpringForce(e,g,t){let A=e.x-g.x,C=e.y-g.y,i=Math.max(Math.sqrt(A*A+C*C),.01),n=this.options.springConstant*(t-i)/i,o=A*n,s=C*n;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=o,this.physicsBody.forces[e.id].y+=s),this.physicsBody.forces[g.id]!==void 0&&(this.physicsBody.forces[g.id].x-=o,this.physicsBody.forces[g.id].y-=s)}},On=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t,A,C,i,n,o,s=this.body.edges,r=.5,a=this.physicsBody.physicsEdgeIndices,d=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces;for(let w=0;w<d.length;w++){let O=d[w];l[O].springFx=0,l[O].springFy=0}for(let w=0;w<a.length;w++)g=s[a[w]],g.connected===!0&&(e=g.options.length===void 0?this.options.springLength:g.options.length,t=g.from.x-g.to.x,A=g.from.y-g.to.y,o=Math.sqrt(t*t+A*A),o=o===0?.01:o,n=this.options.springConstant*(e-o)/o,C=t*n,i=A*n,g.to.level!=g.from.level?(l[g.toId]!==void 0&&(l[g.toId].springFx-=C,l[g.toId].springFy-=i),l[g.fromId]!==void 0&&(l[g.fromId].springFx+=C,l[g.fromId].springFy+=i)):(l[g.toId]!==void 0&&(l[g.toId].x-=r*C,l[g.toId].y-=r*i),l[g.fromId]!==void 0&&(l[g.fromId].x+=r*C,l[g.fromId].y+=r*i)));n=1;let h,c;for(let w=0;w<d.length;w++){let O=d[w];h=Math.min(n,Math.max(-n,l[O].springFx)),c=Math.min(n,Math.max(-n,l[O].springFy)),l[O].x+=h,l[O].y+=c}let p=0,u=0;for(let w=0;w<d.length;w++){let O=d[w];p+=l[O].x,u+=l[O].y}let m=p/d.length,E=u/d.length;for(let w=0;w<d.length;w++){let O=d[w];l[O].x-=m,l[O].y-=E}}},rt=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t,A,C=this.body.nodes,i=this.physicsBody.physicsNodeIndices,n=this.physicsBody.forces;for(let o=0;o<i.length;o++){let s=i[o];A=C[s],e=-A.x,g=-A.y,t=Math.sqrt(e*e+g*g),this._calculateForces(t,e,g,n,A)}}_calculateForces(e,g,t,A,C){let i=e===0?0:this.options.centralGravity/e;A[C.id].x=g*i,A[C.id].y=t*i}},Pn=class extends zI{constructor(e,g,t){super(e,g,t),this._rng=iC("FORCE ATLAS 2 BASED REPULSION SOLVER")}_calculateForces(e,g,t,A,C){e===0&&(e=.1*this._rng(),g=e),this.overlapAvoidanceFactor<1&&A.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*A.shape.radius,e-A.shape.radius));let i=A.edges.length+1,n=this.options.gravitationalConstant*C.mass*A.options.mass*i/Math.pow(e,2),o=g*n,s=t*n;this.physicsBody.forces[A.id].x+=o,this.physicsBody.forces[A.id].y+=s}},Dn=class extends rt{constructor(e,g,t){super(e,g,t)}_calculateForces(e,g,t,A,C){if(e>0){let i=C.edges.length+1,n=this.options.centralGravity*i*C.options.mass;A[C.id].x=g*n,A[C.id].y=t*n}}},Nn=class{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}},q(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,bI(["stabilization"],this.options,e),De(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());let g=this.options.wind;g&&((typeof g.x!="number"||Ui(g.x))&&(g.x=0),(typeof g.y!="number"||Ui(g.y))&&(g.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new Pn(this.body,this.physicsBody,e),this.edgesSolver=new jt(this.body,this.physicsBody,e),this.gravitySolver=new Dn(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new Tn(this.body,this.physicsBody,e),this.edgesSolver=new jt(this.body,this.physicsBody,e),this.gravitySolver=new rt(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new xn(this.body,this.physicsBody,e),this.edgesSolver=new On(this.body,this.physicsBody,e),this.gravitySolver=new rt(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new zI(this.body,this.physicsBody,e),this.edgesSolver=new jt(this.body,this.physicsBody,e),this.gravitySolver=new rt(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=b(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(){let e=uI();this.physicsTick(),(uI()-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)&&He(()=>{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=[];let e=this.body.nodes,g=this.body.edges;for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[t].id);for(let t in g)Object.prototype.hasOwnProperty.call(g,t)&&g[t].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(g[t].id);for(let t=0;t<this.physicsBody.physicsNodeIndices.length;t++){let A=this.physicsBody.physicsNodeIndices[t];this.physicsBody.forces[A]={x:0,y:0},this.physicsBody.velocities[A]===void 0&&(this.physicsBody.velocities[A]={x:0,y:0})}for(let t in this.physicsBody.velocities)e[t]===void 0&&delete this.physicsBody.velocities[t]}revert(){let e=U(this.previousStates),g=this.body.nodes,t=this.physicsBody.velocities;this.referenceState={};for(let A=0;A<e.length;A++){let C=e[A];g[C]!==void 0?g[C].options.physics===!0&&(this.referenceState[C]={positions:{x:g[C].x,y:g[C].y}},t[C].x=this.previousStates[C].vx,t[C].y=this.previousStates[C].vy,g[C].x=this.previousStates[C].x,g[C].y=this.previousStates[C].y):delete this.previousStates[C]}}_evaluateStepQuality(){let e,g,t,A=this.body.nodes,C=this.referenceState,i=.3;for(let n in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,n)&&A[n]!==void 0&&(e=A[n].x-C[n].positions.x,g=A[n].y-C[n].positions.y,t=Math.sqrt(Math.pow(e,2)+Math.pow(g,2)),t>i))return!1;return!0}moveNodes(){let e=this.physicsBody.physicsNodeIndices,g=0,t=0,A=5;for(let C=0;C<e.length;C++){let i=e[C],n=this._performStep(i);g=Math.max(g,n),t+=n}this.adaptiveTimestepEnabled=t/e.length<A,this.stabilized=g<this.options.minVelocity}calculateComponentVelocity(e,g,t){let A=this.modelOptions.damping*e,C=(g-A)/t;e+=C*this.timestep;let i=this.options.maxVelocity||1e9;return Math.abs(e)>i&&(e=e>0?i:-i),e}_performStep(e){let g=this.body.nodes[e],t=this.physicsBody.forces[e];this.options.wind&&(t.x+=this.options.wind.x,t.y+=this.options.wind.y);let A=this.physicsBody.velocities[e];return this.previousStates[e]={x:g.x,y:g.y,vx:A.x,vy:A.y},g.options.fixed.x===!1?(A.x=this.calculateComponentVelocity(A.x,t.x,g.options.mass),g.x+=A.x*this.timestep):(t.x=0,A.x=0),g.options.fixed.y===!1?(A.y=this.calculateComponentVelocity(A.y,t.y,g.options.mass),g.y+=A.y*this.timestep):(t.y=0,A.y=0),Math.sqrt(Math.pow(A.x,2)+Math.pow(A.y,2))}_freezeNodes(){let e=this.body.nodes;for(let g in e)if(Object.prototype.hasOwnProperty.call(e,g)&&e[g].x&&e[g].y){let t=e[g].options.fixed;this.freezeCache[g]={x:t.x,y:t.y},t.x=!0,t.y=!0}}_restoreFrozenNodes(){let e=this.body.nodes;for(let g in e)Object.prototype.hasOwnProperty.call(e,g)&&this.freezeCache[g]!==void 0&&(e[g].options.fixed.x=this.freezeCache[g].x,e[g].options.fixed.y=this.freezeCache[g].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,He(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){let e=()=>this.stabilized===!1&&this.stabilizationIterations<this.targetIterations,g=()=>{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&g();let t=0;for(;e()&&t<this.options.stabilization.updateInterval;)this.physicsTick(),t++;if(g(),e()){var A;He(b(A=this._stabilizationBatch).call(A,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 g=0;g<this.physicsBody.physicsNodeIndices.length;g++){let t=this.physicsBody.physicsNodeIndices[g],A=this.body.nodes[t],C=this.physicsBody.forces[t],i=20,n=.03,o=Math.sqrt(Math.pow(C.x,2)+Math.pow(C.x,2)),s=Math.min(Math.max(5,o),15),r=3*s,a=Vi((180-Math.min(1,Math.max(0,n*o))*180)/360,1,1),d={x:A.x+i*C.x,y:A.y+i*C.y};e.lineWidth=s,e.strokeStyle=a,e.beginPath(),e.moveTo(A.x,A.y),e.lineTo(d.x,d.y),e.stroke();let l=Math.atan2(C.y,C.x);e.fillStyle=a,RI.draw(e,{type:"arrow",point:d,angle:l,length:r}),EA(e).call(e)}}},de=class{constructor(){}static getRange(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=1e9,A=-1e9,C=1e9,i=-1e9,n;if(g.length>0)for(let o=0;o<g.length;o++)n=e[g[o]],C>n.shape.boundingBox.left&&(C=n.shape.boundingBox.left),i<n.shape.boundingBox.right&&(i=n.shape.boundingBox.right),t>n.shape.boundingBox.top&&(t=n.shape.boundingBox.top),A<n.shape.boundingBox.bottom&&(A=n.shape.boundingBox.bottom);return C===1e9&&i===-1e9&&t===1e9&&A===-1e9&&(t=0,A=0,C=0,i=0),{minX:C,maxX:i,minY:t,maxY:A}}static getRangeCore(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=1e9,A=-1e9,C=1e9,i=-1e9,n;if(g.length>0)for(let o=0;o<g.length;o++)n=e[g[o]],C>n.x&&(C=n.x),i<n.x&&(i=n.x),t>n.y&&(t=n.y),A<n.y&&(A=n.y);return C===1e9&&i===-1e9&&t===1e9&&A===-1e9&&(t=0,A=0,C=0,i=0),{minX:C,maxX:i,minY:t,maxY:A}}static findCenter(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}static cloneOptions(e,g){let t={};return g===void 0||g==="node"?(_(t,e.options,!0),t.x=e.x,t.y=e.y,t.amountOfConnections=e.edges.length):_(t,e.options,!0),t}},Rn=class extends pe{constructor(e,g,t,A,C,i){super(e,g,t,A,C,i),this.isCluster=!0,this.containedNodes={},this.containedEdges={}}_openChildCluster(e){let g=this.body.nodes[e];if(this.containedNodes[e]===void 0)throw new Error("node with id: "+e+" not in current cluster");if(!g.isCluster)throw new Error("node with id: "+e+" is not a cluster");delete this.containedNodes[e],S(g.edges,t=>{delete this.containedEdges[t.id]}),S(g.containedNodes,(t,A)=>{this.containedNodes[A]=t}),g.containedNodes={},S(g.containedEdges,(t,A)=>{this.containedEdges[A]=t}),g.containedEdges={},S(g.edges,t=>{S(this.edges,A=>{var C,i;let n=G(C=A.clusteringEdgeReplacingIds).call(C,t.id);n!==-1&&(S(t.clusteringEdgeReplacingIds,o=>{A.clusteringEdgeReplacingIds.push(o),this.body.edges[o].edgeReplacedById=A.id}),Ue(i=A.clusteringEdgeReplacingIds).call(i,n,1))})}),g.edges=[]}},Sn=class{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},q(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,g){e===void 0?e=this._getHubSize():typeof e=="object"&&(g=this._checkOptions(e),e=this._getHubSize());let t=[];for(let A=0;A<this.body.nodeIndices.length;A++){let C=this.body.nodes[this.body.nodeIndices[A]];C.edges.length>=e&&t.push(C.id)}for(let A=0;A<t.length;A++)this.clusterByConnection(t[A],g,!0);this.body.emitter.emit("_dataChanged")}cluster(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=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);let t={},A={};S(this.body.nodes,(C,i)=>{C.options&&e.joinCondition(C.options)===!0&&(t[i]=C,S(C.edges,n=>{this.clusteredEdges[n.id]===void 0&&(A[n.id]=n)}))}),this._cluster(t,A,e,g)}clusterByEdgeCount(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;g=this._checkOptions(g);let A=[],C={},i,n,o;for(let s=0;s<this.body.nodeIndices.length;s++){let r={},a={},d=this.body.nodeIndices[s],l=this.body.nodes[d];if(C[d]===void 0){o=0,n=[];for(let h=0;h<l.edges.length;h++)i=l.edges[h],this.clusteredEdges[i.id]===void 0&&(i.toId!==i.fromId&&o++,n.push(i));if(o===e){let h=function(p){if(g.joinCondition===void 0||g.joinCondition===null)return!0;let u=de.cloneOptions(p);return g.joinCondition(u)},c=!0;for(let p=0;p<n.length;p++){i=n[p];let u=this._getConnectedId(i,d);if(h(l))a[i.id]=i,r[d]=l,r[u]=this.body.nodes[u],C[d]=!0;else{c=!1;break}}if(U(r).length>0&&U(a).length>0&&c===!0){let u=function(){for(let m=0;m<A.length;++m)for(let E in r)if(A[m].nodes[E]!==void 0)return A[m]}();if(u!==void 0){for(let m in r)u.nodes[m]===void 0&&(u.nodes[m]=r[m]);for(let m in a)u.edges[m]===void 0&&(u.edges[m]=a[m])}else A.push({nodes:r,edges:a})}}}}for(let s=0;s<A.length;s++)this._cluster(A[s].nodes,A[s].edges,g,!1);t===!0&&this.body.emitter.emit("_dataChanged")}clusterOutliers(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,g)}clusterBridges(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,g)}clusterByConnection(e,g){var t;let A=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!");let C=this.body.nodes[e];g=this._checkOptions(g,C),g.clusterNodeProperties.x===void 0&&(g.clusterNodeProperties.x=C.x),g.clusterNodeProperties.y===void 0&&(g.clusterNodeProperties.y=C.y),g.clusterNodeProperties.fixed===void 0&&(g.clusterNodeProperties.fixed={},g.clusterNodeProperties.fixed.x=C.options.fixed.x,g.clusterNodeProperties.fixed.y=C.options.fixed.y);let i={},n={},o=C.id,s=de.cloneOptions(C);i[o]=C;for(let a=0;a<C.edges.length;a++){let d=C.edges[a];if(this.clusteredEdges[d.id]===void 0){let l=this._getConnectedId(d,o);if(this.clusteredNodes[l]===void 0)if(l!==o)if(g.joinCondition===void 0)n[d.id]=d,i[l]=this.body.nodes[l];else{let h=de.cloneOptions(this.body.nodes[l]);g.joinCondition(s,h)===!0&&(n[d.id]=d,i[l]=this.body.nodes[l])}else n[d.id]=d}}let r=ae(t=U(i)).call(t,function(a){return i[a].id});for(let a in i){if(!Object.prototype.hasOwnProperty.call(i,a))continue;let d=i[a];for(let l=0;l<d.edges.length;l++){let h=d.edges[l];G(r).call(r,this._getConnectedId(h,d.id))>-1&&(n[h.id]=h)}}this._cluster(i,n,g,A)}_createClusterEdges(e,g,t,A){let C,i,n,o,s,r,a=U(e),d=[];for(let c=0;c<a.length;c++){i=a[c],n=e[i];for(let p=0;p<n.edges.length;p++)C=n.edges[p],this.clusteredEdges[C.id]===void 0&&(C.toId==C.fromId?g[C.id]=C:C.toId==i?(o=t.id,s=C.fromId,r=s):(o=C.toId,s=t.id,r=o),e[r]===void 0&&d.push({edge:C,fromId:s,toId:o}))}let l=[],h=function(c){for(let p=0;p<l.length;p++){let u=l[p],m=c.fromId===u.fromId&&c.toId===u.toId,E=c.fromId===u.toId&&c.toId===u.fromId;if(m||E)return u}return null};for(let c=0;c<d.length;c++){let p=d[c],u=p.edge,m=h(p);m===null?(m=this._createClusteredEdge(p.fromId,p.toId,u,A),l.push(m)):m.clusteringEdgeReplacingIds.push(u.id),this.body.edges[u.id].edgeReplacedById=m.id,this._backupEdgeOptions(u),u.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,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,C=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.clusteredNodes[r]!==void 0&&C.push(r);for(let r=0;r<C.length;++r)delete e[C[r]];if(U(e).length==0||U(e).length==1&&t.clusterNodeProperties.allowSingleNodeCluster!=!0)return;let i=_({},t.clusterNodeProperties);if(t.processProperties!==void 0){let r=[];for(let d in e)if(Object.prototype.hasOwnProperty.call(e,d)){let l=de.cloneOptions(e[d]);r.push(l)}let a=[];for(let d in g)if(Object.prototype.hasOwnProperty.call(g,d)&&d.substr(0,12)!=="clusterEdge:"){let l=de.cloneOptions(g[d],"edge");a.push(l)}if(i=t.processProperties(i,r,a),!i)throw new Error("The processProperties function does not return properties!")}i.id===void 0&&(i.id="cluster:"+st());let n=i.id;i.label===void 0&&(i.label="cluster");let o;i.x===void 0&&(o=this._getClusterPosition(e),i.x=o.x),i.y===void 0&&(o===void 0&&(o=this._getClusterPosition(e)),i.y=o.y),i.id=n;let s=this.body.functions.createNode(i,Rn);s.containedNodes=e,s.containedEdges=g,s.clusterEdgeProperties=t.clusterEdgeProperties,this.body.nodes[i.id]=s,this._clusterEdges(e,g,i,t.clusterEdgeProperties),i.id=void 0,A===!0&&this.body.emitter.emit("_dataChanged")}_backupEdgeOptions(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}_restoreEdge(e){let g=this.clusteredEdges[e.id];g!==void 0&&(e.setOptions({physics:g.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){let g=U(e),t=e[g[0]].x,A=e[g[0]].x,C=e[g[0]].y,i=e[g[0]].y,n;for(let o=1;o<g.length;o++)n=e[g[o]],t=n.x<t?n.x:t,A=n.x>A?n.x:A,C=n.y<C?n.y:C,i=n.y>i?n.y:i;return{x:.5*(t+A),y:.5*(C+i)}}openCluster(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");let A=this.body.nodes[e];if(A===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(A.isCluster!==!0||A.containedNodes===void 0||A.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");let C=this.findNode(e),i=G(C).call(C,e)-1;if(i>=0){let r=C[i];this.body.nodes[r]._openChildCluster(e),delete this.body.nodes[e],t===!0&&this.body.emitter.emit("_dataChanged");return}let n=A.containedNodes,o=A.containedEdges;if(g!==void 0&&g.releaseFunction!==void 0&&typeof g.releaseFunction=="function"){let r={},a={x:A.x,y:A.y};for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){let h=this.body.nodes[l];r[l]={x:h.x,y:h.y}}let d=g.releaseFunction(a,r);for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){let h=this.body.nodes[l];d[l]!==void 0&&(h.x=d[l].x===void 0?A.x:d[l].x,h.y=d[l].y===void 0?A.y:d[l].y)}}else S(n,function(r){r.options.fixed.x===!1&&(r.x=A.x),r.options.fixed.y===!1&&(r.y=A.y)});for(let r in n)if(Object.prototype.hasOwnProperty.call(n,r)){let a=this.body.nodes[r];a.vx=A.vx,a.vy=A.vy,a.setOptions({physics:!0}),delete this.clusteredNodes[r]}let s=[];for(let r=0;r<A.edges.length;r++)s.push(A.edges[r]);for(let r=0;r<s.length;r++){let a=s[r],d=this._getConnectedId(a,e),l=this.clusteredNodes[d];for(let h=0;h<a.clusteringEdgeReplacingIds.length;h++){let c=a.clusteringEdgeReplacingIds[h],p=this.body.edges[c];if(p!==void 0)if(l!==void 0){let u=this.body.nodes[l.clusterId];u.containedEdges[p.id]=p,delete o[p.id];let m=p.fromId,E=p.toId;p.toId==d?E=l.clusterId:m=l.clusterId,this._createClusteredEdge(m,E,p,u.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(p)}a.remove()}for(let r in o)Object.prototype.hasOwnProperty.call(o,r)&&this._restoreEdge(o[r]);delete this.body.nodes[e],t===!0&&this.body.emitter.emit("_dataChanged")}getNodesInCluster(e){let g=[];if(this.isCluster(e)===!0){let t=this.body.nodes[e].containedNodes;for(let A in t)Object.prototype.hasOwnProperty.call(t,A)&&g.push(this.body.nodes[A].id)}return g}findNode(e){let g=[],A=0,C;for(;this.clusteredNodes[e]!==void 0&&A<100;){if(C=this.body.nodes[e],C===void 0)return[];g.push(C.id),e=this.clusteredNodes[e].clusterId,A++}return C=this.body.nodes[e],C===void 0?[]:(g.push(C.id),zg(g).call(g),g)}updateClusteredNode(e,g){if(e===void 0)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(g===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(g),this.body.emitter.emit("_dataChanged")}updateEdge(e,g){if(e===void 0)throw new Error("No startEdgeId supplied to updateEdge.");if(g===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.");let t=this.getClusteredEdges(e);for(let A=0;A<t.length;A++)this.body.edges[t[A]].setOptions(g);this.body.emitter.emit("_dataChanged")}getClusteredEdges(e){let g=[],A=0;for(;e!==void 0&&this.body.edges[e]!==void 0&&A<100;)g.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,A++;return zg(g).call(g),g}getBaseEdge(e){return this.getBaseEdges(e)[0]}getBaseEdges(e){let g=[e],t=[],A=[],C=100,i=0;for(;g.length>0&&i<C;){let n=g.pop();if(n===void 0)continue;let o=this.body.edges[n];if(o===void 0)continue;i++;let s=o.clusteringEdgeReplacingIds;if(s===void 0)A.push(n);else for(let r=0;r<s.length;++r){let a=s[r];G(g).call(g,s)!==-1||G(t).call(t,s)!==-1||g.push(a)}t.push(n)}return A}_getConnectedId(e,g){return e.toId!=g?e.toId:(e.fromId!=g,e.fromId)}_getHubSize(){let e=0,g=0,t=0,A=0;for(let o=0;o<this.body.nodeIndices.length;o++){let s=this.body.nodes[this.body.nodeIndices[o]];s.edges.length>A&&(A=s.edges.length),e+=s.edges.length,g+=Math.pow(s.edges.length,2),t+=1}e=e/t,g=g/t;let C=g-Math.pow(e,2),i=Math.sqrt(C),n=Math.floor(e+2*i);return n>A&&(n=A),n}_createClusteredEdge(e,g,t,A,C){let i=de.cloneOptions(t,"edge");_(i,A),i.from=e,i.to=g,i.id="clusterEdge:"+st(),C!==void 0&&_(i,C);let n=this.body.functions.createEdge(i);return n.clusteringEdgeReplacingIds=[t.id],n.connect(),this.body.edges[n.id]=n,n}_clusterEdges(e,g,t,A){if(g instanceof xg){let C=g,i={};i[C.id]=C,g=i}if(e instanceof pe){let C=e,i={};i[C.id]=C,e=i}if(t==null)throw new Error("_clusterEdges: parameter clusterNode required");A===void 0&&(A=t.clusterEdgeProperties),this._createClusterEdges(e,g,t,A);for(let C in g)if(Object.prototype.hasOwnProperty.call(g,C)&&this.body.edges[C]!==void 0){let i=this.body.edges[C];this._backupEdgeOptions(i),i.setOptions({physics:!1})}for(let C in e)Object.prototype.hasOwnProperty.call(e,C)&&(this.clusteredNodes[C]={clusterId:t.id,node:this.body.nodes[C]},this.body.nodes[C].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;let g=this.clusteredNodes[e];if(g===void 0)return;let t=g.clusterId;if(t!==void 0)return this.body.nodes[t]}_filter(e,g){let t=[];return S(e,A=>{g(A)&&t.push(A)}),t}_updateState(){let e,g=[],t={},A=o=>{S(this.body.nodes,s=>{s.isCluster===!0&&o(s)})};for(e in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,e))continue;this.body.nodes[e]===void 0&&g.push(e)}A(function(o){for(let s=0;s<g.length;s++)delete o.containedNodes[g[s]]});for(let o=0;o<g.length;o++)delete this.clusteredNodes[g[o]];S(this.clusteredEdges,o=>{let s=this.body.edges[o];(s===void 0||!s.endPointsValid())&&(t[o]=o)}),A(function(o){S(o.containedEdges,(s,r)=>{!s.endPointsValid()&&!t[r]&&(t[r]=r)})}),S(this.body.edges,(o,s)=>{let r=!0,a=o.clusteringEdgeReplacingIds;if(a!==void 0){let d=0;S(a,l=>{let h=this.body.edges[l];h!==void 0&&h.endPointsValid()&&(d+=1)}),r=d>0}(!o.endPointsValid()||!r)&&(t[s]=s)}),A(o=>{S(t,s=>{delete o.containedEdges[s],S(o.edges,(r,a)=>{if(r.id===s){o.edges[a]=null;return}r.clusteringEdgeReplacingIds=this._filter(r.clusteringEdgeReplacingIds,function(d){return!t[d]})}),o.edges=this._filter(o.edges,function(r){return r!==null})})}),S(t,o=>{delete this.clusteredEdges[o]}),S(t,o=>{delete this.body.edges[o]});let C=U(this.body.edges);S(C,o=>{let s=this.body.edges[o],r=this._isClusteredNode(s.fromId)||this._isClusteredNode(s.toId);if(r!==this._isClusteredEdge(s.id))if(r){let a=this._getClusterNodeForNode(s.fromId);a!==void 0&&this._clusterEdges(this.body.nodes[s.fromId],s,a);let d=this._getClusterNodeForNode(s.toId);d!==void 0&&this._clusterEdges(this.body.nodes[s.toId],s,d)}else delete this._clusterEdges[o],this._restoreEdge(s)});let i=!1,n=!0;for(;n;){let o=[];A(function(s){let r=U(s.containedNodes).length,a=s.options.allowSingleNodeCluster===!0;(a&&r<1||!a&&r<2)&&o.push(s.id)});for(let s=0;s<o.length;++s)this.openCluster(o[s],{},!1);n=o.length>0,i=i||n}i&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}},kn=class{constructor(e,g){this.body=e,this.canvas=g,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},q(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=He(()=>{var g;this.zooming=!1,b(g=this._requestRedraw).call(g,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",b(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&&xt(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var e;this.requestAnimationFrameRequestId=window.requestAnimationFrame(b(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;let g={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();let t=this.canvas.getContext(),A=this.canvas.frame.canvas.clientWidth,C=this.canvas.frame.canvas.clientHeight;if(t.clearRect(0,0,A,C),this.canvas.frame.clientWidth===0)return;if(t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale),t.beginPath(),this.body.emitter.emit("beforeDrawing",t),t.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(t),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){let{drawExternalLabels:i}=this._drawNodes(t,e);g.drawExternalLabels=i}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(t),g.drawExternalLabels!=null&&g.drawExternalLabels(),e===!1&&this._drawSelectionBox(t),t.beginPath(),this.body.emitter.emit("afterDrawing",t),t.closePath(),t.restore(),e===!0&&t.clearRect(0,0,A,C)}}_resizeNodes(){this.canvas.setTransform();let 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);let g=this.body.nodes,t;for(let A in g)Object.prototype.hasOwnProperty.call(g,A)&&(t=g[A],t.resize(e),t.updateBoundingBox(e,t.selected));e.restore()}_drawNodes(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.nodes,A=this.body.nodeIndices,C,i=[],n=[],o=20,s=this.canvas.DOMtoCanvas({x:-o,y:-o}),r=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+o,y:this.canvas.frame.canvas.clientHeight+o}),a={top:s.y,left:s.x,bottom:r.y,right:r.x},d=[];for(let p=0;p<A.length;p++)if(C=t[A[p]],C.hover)n.push(A[p]);else if(C.isSelected())i.push(A[p]);else if(g===!0){let u=C.draw(e);u.drawExternalLabel!=null&&d.push(u.drawExternalLabel)}else if(C.isBoundingBoxOverlappingWith(a)===!0){let u=C.draw(e);u.drawExternalLabel!=null&&d.push(u.drawExternalLabel)}else C.updateBoundingBox(e,C.selected);let l,h=i.length,c=n.length;for(l=0;l<h;l++){C=t[i[l]];let p=C.draw(e);p.drawExternalLabel!=null&&d.push(p.drawExternalLabel)}for(l=0;l<c;l++){C=t[n[l]];let p=C.draw(e);p.drawExternalLabel!=null&&d.push(p.drawExternalLabel)}return{drawExternalLabels:()=>{for(let p of d)p()}}}_drawEdges(e){let g=this.body.edges,t=this.body.edgeIndices;for(let A=0;A<t.length;A++){let C=g[t[A]];C.connected===!0&&C.draw(e)}}_drawArrows(e){let g=this.body.edges,t=this.body.edgeIndices;for(let A=0;A<t.length;A++){let C=g[t[A]];C.connected===!0&&C.drawArrows(e)}}_drawSelectionBox(e){if(this.body.selectionBox.show){e.beginPath();let g=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,t=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,g,t),e.fillStyle="rgba(151, 194, 252, 0.2)",e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,g,t),e.strokeStyle="rgba(151, 194, 252, 1)",e.stroke()}else e.closePath()}},Wk=L,Yk=Wk.setInterval,_k=Yk,Kk=D(_k);function ZI(I,e){e.inputHandler=function(g){g.isFirst&&e(g)},I.on("hammer.input",e.inputHandler)}function Ph(I,e){return e.inputHandler=function(g){g.isFinal&&e(g)},I.on("hammer.input",e.inputHandler)}var Mn=class{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%"},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.once("resize",g=>{g.width!==0&&(this.body.view.translation.x=g.width*.5),g.height!==0&&(this.body.view.translation.y=g.height*.5)}),this.body.emitter.on("setSize",b(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&&xt(["width","height","autoResize"],this.options,e),this._cleanUp(),this.options.autoResize===!0){var g;if(window.ResizeObserver){let A=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:C}=this;A.observe(C),this._cleanupCallbacks.push(()=>{A.unobserve(C)})}else{let A=Kk(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(A)})}let t=b(g=this._onResize).call(g,this);window.addEventListener("resize",t),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",t)})}}_cleanUp(){var e,g,t;F(e=zg(g=Ue(t=this._cleanupCallbacks).call(t,0)).call(g)).call(e,A=>{try{A()}catch(C){console.error(C)}})}_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){let e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,g=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,t=this.cameraState.scale;e!=1&&g!=1?t=this.cameraState.scale*.5*(e+g):e!=1?t=this.cameraState.scale*e:g!=1&&(t=this.cameraState.scale*g),this.body.view.scale=t;let A=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),C={x:A.x-this.cameraState.position.x,y:A.y-this.cameraState.position.y};this.body.view.translation.x+=C.x*this.body.view.scale,this.body.view.translation.y+=C.y*this.body.view.scale}}_prepareValue(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(G(e).call(e,"%")!==-1||G(e).call(e,"px")!==-1)return e;if(G(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{let 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 ot(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:ot.DIRECTION_ALL}),ZI(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 ot(this.frame),Ph(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),g=this._prepareValue(g);let t=!1,A=this.frame.canvas.width,C=this.frame.canvas.height,i=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||g!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=g)this._getCameraState(i),this.frame.style.width=e,this.frame.style.height=g,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=g,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},t=!0;else{let n=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),o=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==n||this.frame.canvas.height!==o)&&this._getCameraState(i),this.frame.canvas.width!==n&&(this.frame.canvas.width=n,t=!0),this.frame.canvas.height!==o&&(this.frame.canvas.height=o,t=!0)}return t===!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(A/this.pixelRatio),oldHeight:Math.round(C/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,t}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){let e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");let g=1;typeof window!="undefined"&&(g=window.devicePixelRatio||1);let t=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return g/t}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){let 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 Uk(I,e){let g=q({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},I!=null?I:{});if(!B(g.nodes))throw new TypeError("Nodes has to be an array of ids.");if(g.nodes.length===0&&(g.nodes=e),!(typeof g.minZoomLevel=="number"&&g.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof g.maxZoomLevel=="number"&&g.minZoomLevel<=g.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return g}var Fn=class{constructor(e,g){var t,A;this.body=e,this.canvas=g,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",b(t=this.fit).call(t,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",b(A=this.releaseNode).call(A,this))}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}fit(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=Uk(e,this.body.nodeIndices);let t=this.canvas.frame.canvas.clientWidth,A=this.canvas.frame.canvas.clientHeight,C,i;if(t===0||A===0)i=1,C=de.getRange(this.body.nodes,e.nodes);else if(g===!0){let s=0;for(let d in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,d)&&this.body.nodes[d].predefinedPosition===!0&&(s+=1);if(s>.5*this.body.nodeIndices.length){this.fit(e,!1);return}C=de.getRange(this.body.nodes,e.nodes),i=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;let a=Math.min(t/600,A/600);i*=a}else{this.body.emitter.emit("_resizeNodes"),C=de.getRange(this.body.nodes,e.nodes);let s=Math.abs(C.maxX-C.minX)*1.1,r=Math.abs(C.maxY-C.minY)*1.1,a=t/s,d=A/r;i=a<=d?a:d}i>e.maxZoomLevel?i=e.maxZoomLevel:i<e.minZoomLevel&&(i=e.minZoomLevel);let o={position:de.findCenter(C),scale:i,animation:e.animation};this.moveTo(o)}focus(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){let t={x:this.body.nodes[e].x,y:this.body.nodes[e].y};g.position=t,g.lockedOnNode=e,this.moveTo(g)}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,!Mg(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,!Mg(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,!Mg(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,!Mg(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;let g=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),t={x:g.x-e.position.x,y:g.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+t.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+t.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var A;this.viewFunction=b(A=this._lockedRedraw).call(A,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 C;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=b(C=this._transitionRedraw).call(C,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}_lockedRedraw(){let e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},g=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),t={x:g.x-e.x,y:g.y-e.y},A=this.body.view.translation,C={x:A.x+t.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:A.y+t.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=C}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;let g=KO[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*g,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*g,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*g},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var t;this.viewFunction=b(t=this._lockedRedraw).call(t,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})}},Hk=`div.vis-network div.vis-navigation div.vis-button {
654
654
  width: 34px;
655
655
  height: 34px;
656
656
  -moz-border-radius: 17px;
@@ -711,7 +711,7 @@ div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends {
711
711
  bottom: 50px;
712
712
  right: 15px;
713
713
  }
714
- `;_e(_k);function ya(I){var g=I&&I.preventDefault||!1,e=I&&I.container||window,t={},A={keydown:{},keyup:{}},C={},i;for(i=97;i<=122;i++)C[String.fromCharCode(i)]={code:65+(i-97),shift:!1};for(i=65;i<=90;i++)C[String.fromCharCode(i)]={code:i,shift:!0};for(i=0;i<=9;i++)C[""+i]={code:48+i,shift:!1};for(i=1;i<=12;i++)C["F"+i]={code:111+i,shift:!1};for(i=0;i<=9;i++)C["num"+i]={code:96+i,shift:!1};C["num*"]={code:106,shift:!1},C["num+"]={code:107,shift:!1},C["num-"]={code:109,shift:!1},C["num/"]={code:111,shift:!1},C["num."]={code:110,shift:!1},C.left={code:37,shift:!1},C.up={code:38,shift:!1},C.right={code:39,shift:!1},C.down={code:40,shift:!1},C.space={code:32,shift:!1},C.enter={code:13,shift:!1},C.shift={code:16,shift:void 0},C.esc={code:27,shift:!1},C.backspace={code:8,shift:!1},C.tab={code:9,shift:!1},C.ctrl={code:17,shift:!1},C.alt={code:18,shift:!1},C.delete={code:46,shift:!1},C.pageup={code:33,shift:!1},C.pagedown={code:34,shift:!1},C["="]={code:187,shift:!1},C["-"]={code:189,shift:!1},C["]"]={code:221,shift:!1},C["["]={code:219,shift:!1};var n=function(r){s(r,"keydown")},o=function(r){s(r,"keyup")},s=function(r,a){if(A[a][r.keyCode]!==void 0){for(var d=A[a][r.keyCode],l=0;l<d.length;l++)(d[l].shift===void 0||d[l].shift==!0&&r.shiftKey==!0||d[l].shift==!1&&r.shiftKey==!1)&&d[l].fn(r);g==!0&&r.preventDefault()}};return t.bind=function(r,a,d){if(d===void 0&&(d="keydown"),C[r]===void 0)throw new Error("unsupported key: "+r);A[d][C[r].code]===void 0&&(A[d][C[r].code]=[]),A[d][C[r].code].push({fn:a,shift:C[r].shift})},t.bindAll=function(r,a){a===void 0&&(a="keydown");for(var d in C)C.hasOwnProperty(d)&&t.bind(d,r,a)},t.getKey=function(r){for(var a in C)if(C.hasOwnProperty(a)){if(r.shiftKey==!0&&C[a].shift==!0&&r.keyCode==C[a].code)return a;if(r.shiftKey==!1&&C[a].shift==!1&&r.keyCode==C[a].code)return a;if(r.keyCode==C[a].code&&a=="shift")return a}return"unknown key, currently not supported"},t.unbind=function(r,a,d){if(d===void 0&&(d="keydown"),C[r]===void 0)throw new Error("unsupported key: "+r);if(a!==void 0){var l=[],h=A[d][C[r].code];if(h!==void 0)for(var c=0;c<h.length;c++)h[c].fn==a&&h[c].shift==C[r].shift||l.push(A[d][C[r].code][c]);A[d][C[r].code]=l}else A[d][C[r].code]=[]},t.reset=function(){A={keydown:{},keyup:{}}},t.destroy=function(){A={keydown:{},keyup:{}},e.removeEventListener("keydown",n,!0),e.removeEventListener("keyup",o,!0)},e.addEventListener("keydown",n,!0),e.addEventListener("keyup",o,!0),t}var kn=class{constructor(g,e){this.body=g,this.canvas=e,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(g){g!==void 0&&(this.options=g,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 g=0;g<this.navigationHammers.length;g++)this.navigationHammers[g].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={};let g=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],e=["_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 i=0;i<g.length;i++){this.navigationDOM[g[i]]=document.createElement("div"),this.navigationDOM[g[i]].className="vis-button vis-"+g[i],this.navigationDOM.wrapper.appendChild(this.navigationDOM[g[i]]);let n=new ot(this.navigationDOM[g[i]]);if(e[i]==="_fit"){var t;ZI(n,b(t=this._fit).call(t,this))}else{var A;ZI(n,b(A=this.bindToRedraw).call(A,this,e[i]))}this.navigationHammers.push(n)}let C=new ot(this.canvas.frame);xh(C,()=>{this._stopMovement()}),this.navigationHammers.push(C),this.iconsCreated=!0}bindToRedraw(g){if(this.boundFunctions[g]===void 0){var e;this.boundFunctions[g]=b(e=this[g]).call(e,this),this.body.emitter.on("initRedraw",this.boundFunctions[g]),this.body.emitter.emit("_startRendering")}}unbindFromRedraw(g){this.boundFunctions[g]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[g]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[g])}_fit(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}_stopMovement(){for(let g in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,g)&&(this.body.emitter.off("initRedraw",this.boundFunctions[g]),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(){let g=this.body.view.scale,e=this.body.view.scale*(1+this.options.keyboard.speed.zoom),t=this.body.view.translation,A=e/g,C=(1-A)*this.canvas.canvasViewCenter.x+t.x*A,i=(1-A)*this.canvas.canvasViewCenter.y+t.y*A;this.body.view.scale=e,this.body.view.translation={x:C,y:i},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){let g=this.body.view.scale,e=this.body.view.scale/(1+this.options.keyboard.speed.zoom),t=this.body.view.translation,A=e/g,C=(1-A)*this.canvas.canvasViewCenter.x+t.x*A,i=(1-A)*this.canvas.canvasViewCenter.y+t.y*A;this.body.view.scale=e,this.body.view.translation={x:C,y:i},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=ya({container:window,preventDefault:!0}):this.keycharm=ya({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var g,e,t,A,C,i,n,o,s,r,a,d,l,h,c,p,u,m,E,w,O,M,k,V;b(g=this.keycharm).call(g,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),b(e=this.keycharm).call(e,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),b(t=this.keycharm).call(t,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),b(A=this.keycharm).call(A,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),b(C=this.keycharm).call(C,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(i=this.keycharm).call(i,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(n=this.keycharm).call(n,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(o=this.keycharm).call(o,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(s=this.keycharm).call(s,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(r=this.keycharm).call(r,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(a=this.keycharm).call(a,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(d=this.keycharm).call(d,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(l=this.keycharm).call(l,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),b(h=this.keycharm).call(h,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),b(c=this.keycharm).call(c,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),b(p=this.keycharm).call(p,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),b(u=this.keycharm).call(u,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(m=this.keycharm).call(m,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(E=this.keycharm).call(E,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(w=this.keycharm).call(w,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(O=this.keycharm).call(O,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(M=this.keycharm).call(M,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(k=this.keycharm).call(k,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(V=this.keycharm).call(V,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}},Mn=class{constructor(g,e,t){var A,C,i,n,o,s,r,a,d,l,h,c,p;this.body=g,this.canvas=e,this.selectionHandler=t,this.navigationHandler=new kn(g,e),this.body.eventListeners.onTap=b(A=this.onTap).call(A,this),this.body.eventListeners.onTouch=b(C=this.onTouch).call(C,this),this.body.eventListeners.onDoubleTap=b(i=this.onDoubleTap).call(i,this),this.body.eventListeners.onHold=b(n=this.onHold).call(n,this),this.body.eventListeners.onDragStart=b(o=this.onDragStart).call(o,this),this.body.eventListeners.onDrag=b(s=this.onDrag).call(s,this),this.body.eventListeners.onDragEnd=b(r=this.onDragEnd).call(r,this),this.body.eventListeners.onMouseWheel=b(a=this.onMouseWheel).call(a,this),this.body.eventListeners.onPinch=b(d=this.onPinch).call(d,this),this.body.eventListeners.onMouseMove=b(l=this.onMouseMove).call(l,this),this.body.eventListeners.onRelease=b(h=this.onRelease).call(h,this),this.body.eventListeners.onContext=b(c=this.onContext).call(c,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=b(p=this.getPointer).call(p,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},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(g){g!==void 0&&(bI(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,g),Dg(this.options,g,"keyboard"),g.tooltip&&(q(this.options.tooltip,g.tooltip),g.tooltip.color&&(this.options.tooltip.color=zi(g.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(g){return{x:g.x-LO(this.canvas.frame.canvas),y:g.y-GO(this.canvas.frame.canvas)}}onTouch(g){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(g.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}onTap(g){let e=this.getPointer(g.center),t=this.selectionHandler.options.multiselect&&(g.changedPointers[0].ctrlKey||g.changedPointers[0].metaKey);this.checkSelectionChanges(e,t),this.selectionHandler.commitAndEmit(e,g),this.selectionHandler.generateClickEvent("click",g,e)}onDoubleTap(g){let e=this.getPointer(g.center);this.selectionHandler.generateClickEvent("doubleClick",g,e)}onHold(g){let e=this.getPointer(g.center),t=this.selectionHandler.options.multiselect;this.checkSelectionChanges(e,t),this.selectionHandler.commitAndEmit(e,g),this.selectionHandler.generateClickEvent("click",g,e),this.selectionHandler.generateClickEvent("hold",g,e)}onRelease(g){if(new Date().valueOf()-this.touchTime>10){let e=this.getPointer(g.center);this.selectionHandler.generateClickEvent("release",g,e),this.touchTime=new Date().valueOf()}}onContext(g){let e=this.getPointer({x:g.clientX,y:g.clientY});this.selectionHandler.generateClickEvent("oncontext",g,e)}checkSelectionChanges(g){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(g):this.selectionHandler.selectOnPoint(g)}_determineDifference(g,e){let t=function(A,C){let i=[];for(let n=0;n<A.length;n++){let o=A[n];G(C).call(C,o)===-1&&i.push(o)}return i};return{nodes:t(g.nodes,e.nodes),edges:t(g.edges,e.edges)}}onDragStart(g){if(this.drag.dragging)return;this.drag.pointer===void 0&&this.onTouch(g);let e=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=q({},this.body.view.translation),this.drag.nodeId=void 0,g.srcEvent.shiftKey){this.body.selectionBox.show=!0;let t=this.getPointer(g.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)}}else if(e!==void 0&&this.options.dragNodes===!0){this.drag.nodeId=e.id,e.isSelected()===!1&&this.selectionHandler.setSelection({nodes:[e.id]}),this.selectionHandler.generateClickEvent("dragStart",g,this.drag.pointer);for(let t of this.selectionHandler.getSelectedNodes()){let A={id:t.id,node:t,x:t.x,y:t.y,xFixed:t.options.fixed.x,yFixed:t.options.fixed.y};t.options.fixed.x=!0,t.options.fixed.y=!0,this.drag.selection.push(A)}}else this.selectionHandler.generateClickEvent("dragStart",g,this.drag.pointer,void 0,!0)}onDrag(g){if(this.drag.pinched===!0)return;this.body.emitter.emit("unlockNode");let e=this.getPointer(g.center),t=this.drag.selection;if(t&&t.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent("dragging",g,e);let A=e.x-this.drag.pointer.x,C=e.y-this.drag.pointer.y;F(t).call(t,i=>{let n=i.node;i.xFixed===!1&&(n.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(i.x)+A)),i.yFixed===!1&&(n.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(i.y)+C))}),this.body.emitter.emit("startSimulation")}else{if(g.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",g,e,void 0,!0),this.drag.pointer===void 0){this.onDragStart(g);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(e.x),y:this.canvas._YconvertDOMtoCanvas(e.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!g.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",g,e,void 0,!0),this.drag.pointer===void 0){this.onDragStart(g);return}let A=e.x-this.drag.pointer.x,C=e.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+A,y:this.drag.translation.y+C},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(g){if(this.drag.dragging=!1,this.body.selectionBox.show){var e;this.body.selectionBox.show=!1;let t=this.body.selectionBox.position,A={minX:Math.min(t.start.x,t.end.x),minY:Math.min(t.start.y,t.end.y),maxX:Math.max(t.start.x,t.end.x),maxY:Math.max(t.start.y,t.end.y)},C=tg(e=this.body.nodeIndices).call(e,n=>{let o=this.body.nodes[n];return o.x>=A.minX&&o.x<=A.maxX&&o.y>=A.minY&&o.y<=A.maxY});F(C).call(C,n=>this.selectionHandler.selectObject(this.body.nodes[n]));let i=this.getPointer(g.center);this.selectionHandler.commitAndEmit(i,g),this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{let t=this.drag.selection;t&&t.length?(F(t).call(t,function(A){A.node.options.fixed.x=A.xFixed,A.node.options.fixed.y=A.yFixed}),this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}onPinch(g){let e=this.getPointer(g.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);let t=this.pinch.scale*g.scale;this.zoom(t,e)}zoom(g,e){if(this.options.zoomView===!0){let t=this.body.view.scale;g<1e-5&&(g=1e-5),g>10&&(g=10);let A;this.drag!==void 0&&this.drag.dragging===!0&&(A=this.canvas.DOMtoCanvas(this.drag.pointer));let C=this.body.view.translation,i=g/t,n=(1-i)*e.x+C.x*i,o=(1-i)*e.y+C.y*i;if(this.body.view.scale=g,this.body.view.translation={x:n,y:o},A!=null){let s=this.canvas.canvasToDOM(A);this.drag.pointer.x=s.x,this.drag.pointer.y=s.y}this.body.emitter.emit("_requestRedraw"),t<g?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:e}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:e})}}onMouseWheel(g){if(this.options.zoomView===!0){if(g.deltaY!==0){let e=this.body.view.scale;e*=1+(g.deltaY<0?1:-1)*(this.options.zoomSpeed*.1);let t=this.getPointer({x:g.clientX,y:g.clientY});this.zoom(e,t)}g.preventDefault()}}onMouseMove(g){let e=this.getPointer({x:g.clientX,y:g.clientY}),t=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(e),this.popup.hidden===!1&&(t=!0,this.popup.setPosition(e.x+3,e.y-5),this.popup.show())),this.options.keyboard.autoFocus&&this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),t===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=Hg(()=>this._checkShowPopup(e),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(g,e)}_checkShowPopup(g){let e=this.canvas._XconvertDOMtoCanvas(g.x),t=this.canvas._YconvertDOMtoCanvas(g.y),A={left:e,top:t,right:e,bottom:t},C=this.popupObj===void 0?void 0:this.popupObj.id,i=!1,n="node";if(this.popupObj===void 0){let o=this.body.nodeIndices,s=this.body.nodes,r,a=[];for(let d=0;d<o.length;d++)r=s[o[d]],r.isOverlappingWith(A)===!0&&(i=!0,r.getTitle()!==void 0&&a.push(o[d]));a.length>0&&(this.popupObj=s[a[a.length-1]],i=!0)}if(this.popupObj===void 0&&i===!1){let o=this.body.edgeIndices,s=this.body.edges,r,a=[];for(let d=0;d<o.length;d++)r=s[o[d]],r.isOverlappingWith(A)===!0&&r.connected===!0&&r.getTitle()!==void 0&&a.push(o[d]);a.length>0&&(this.popupObj=s[a[a.length-1]],n="edge")}this.popupObj!==void 0?this.popupObj.id!==C&&(this.popup===void 0&&(this.popup=new JO(this.canvas.frame)),this.popup.popupTargetType=n,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(g.x+3,g.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(g){let e=this.selectionHandler._pointerToPositionObject(g),t=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(t=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(e),t===!0)){let A=this.selectionHandler.getNodeAt(g);t=A===void 0?!1:A.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(g)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(t=this.body.edges[this.popup.popupTargetId].isOverlappingWith(e));t===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}},Kk=Z,wa=xo,qA=nC.getWeakData,Uk=Eo,Hk=re,Qk=ft,oi=cg,Xk=wo,Oh=Re,Ea=ng,Ph=Ke,Jk=Ph.set,$k=Ph.getterFor,qk=Oh.find,gM=Oh.findIndex,eM=Kk([].splice),tM=0,gI=function(I){return I.frozen||(I.frozen=new Dh)},Dh=function(){this.entries=[]},si=function(I,g){return qk(I.entries,function(e){return e[0]===g})};Dh.prototype={get:function(I){var g=si(this,I);if(g)return g[1]},has:function(I){return!!si(this,I)},set:function(I,g){var e=si(this,I);e?e[1]=g:this.entries.push([I,g])},delete:function(I){var g=gM(this.entries,function(e){return e[0]===I});return~g&&eM(this.entries,g,1),!!~g}};var AM={getConstructor:function(I,g,e,t){var A=I(function(o,s){Uk(o,C),Jk(o,{type:g,id:tM++,frozen:void 0}),Qk(s)||Xk(s,o[t],{that:o,AS_ENTRIES:e})}),C=A.prototype,i=$k(g),n=function(o,s,r){var a=i(o),d=qA(Hk(s),!0);return d===!0?gI(a).set(s,r):d[a.id]=r,o};return wa(C,{delete:function(o){var s=i(this);if(!oi(o))return!1;var r=qA(o);return r===!0?gI(s).delete(o):r&&Ea(r,s.id)&&delete r[s.id]},has:function(s){var r=i(this);if(!oi(s))return!1;var a=qA(s);return a===!0?gI(r).has(s):a&&Ea(a,r.id)}}),wa(C,e?{get:function(s){var r=i(this);if(oi(s)){var a=qA(s);return a===!0?gI(r).get(s):a?a[r.id]:void 0}},set:function(s,r){return n(this,s,r)}}:{add:function(s){return n(this,s,!0)}}),A}},IM=Ql,Ta=X,rI=Z,xa=xo,CM=nC,iM=To,Rh=AM,eI=cg,tI=Ke.enforce,nM=z,oM=dd,kA=Object,sM=Array.isArray,AI=kA.isExtensible,Nh=kA.isFrozen,rM=kA.isSealed,Sh=kA.freeze,aM=kA.seal,Oa={},Pa={},dM=!Ta.ActiveXObject&&"ActiveXObject"in Ta,kt,kh=function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},Mh=iM("WeakMap",kh,Rh),At=Mh.prototype,aI=rI(At.set),lM=function(){return IM&&nM(function(){var I=Sh([]);return aI(new Mh,I,1),!Nh(I)})};oM&&(dM?(kt=Rh.getConstructor(kh,"WeakMap",!0),CM.enable(),ri=rI(At.delete),Mt=rI(At.has),ai=rI(At.get),xa(At,{delete:function(I){if(eI(I)&&!AI(I)){var g=tI(this);return g.frozen||(g.frozen=new kt),ri(this,I)||g.frozen.delete(I)}return ri(this,I)},has:function(g){if(eI(g)&&!AI(g)){var e=tI(this);return e.frozen||(e.frozen=new kt),Mt(this,g)||e.frozen.has(g)}return Mt(this,g)},get:function(g){if(eI(g)&&!AI(g)){var e=tI(this);return e.frozen||(e.frozen=new kt),Mt(this,g)?ai(this,g):e.frozen.get(g)}return ai(this,g)},set:function(g,e){if(eI(g)&&!AI(g)){var t=tI(this);t.frozen||(t.frozen=new kt),Mt(this,g)?aI(this,g,e):t.frozen.set(g,e)}else aI(this,g,e);return this}})):lM()&&xa(At,{set:function(g,e){var t;return sM(g)&&(Nh(g)?t=Oa:rM(g)&&(t=Pa)),aI(this,g,e),t===Oa&&Sh(g),t===Pa&&aM(g),this}}));var ri,Mt,ai,hM=L,cM=hM.WeakMap,uM=cM,fM=uM,pM=fM,Wt=D(pM);function Y(I,g,e,t){if(e==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof g=="function"?I!==g||!t:!g.has(I))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?t:e==="a"?t.call(I):t?t.value:g.get(I)}function Fn(I,g,e,t,A){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!A)throw new TypeError("Private accessor was defined without a setter");if(typeof g=="function"?I!==g||!A:!g.has(I))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?A.call(I,e):A?A.value=e:g.set(I,e),e}var Se,Pg,he,ce,dI;function Da(I,g){let e=new Lg;for(let t of g)I.has(t)||e.add(t);return e}var LI=class{constructor(){Se.set(this,new Lg),Pg.set(this,new Lg)}get size(){return Y(this,Pg,"f").size}add(){for(var g=arguments.length,e=new Array(g),t=0;t<g;t++)e[t]=arguments[t];for(let A of e)Y(this,Pg,"f").add(A)}delete(){for(var g=arguments.length,e=new Array(g),t=0;t<g;t++)e[t]=arguments[t];for(let A of e)Y(this,Pg,"f").delete(A)}clear(){Y(this,Pg,"f").clear()}getSelection(){return[...Y(this,Pg,"f")]}getChanges(){return{added:[...Da(Y(this,Se,"f"),Y(this,Pg,"f"))],deleted:[...Da(Y(this,Pg,"f"),Y(this,Se,"f"))],previous:[...new Lg(Y(this,Se,"f"))],current:[...new Lg(Y(this,Pg,"f"))]}}commit(){let g=this.getChanges();Fn(this,Se,Y(this,Pg,"f"),"f"),Fn(this,Pg,new Lg(Y(this,Se,"f")),"f");for(let e of g.added)e.select();for(let e of g.deleted)e.unselect();return g}};Se=new Wt,Pg=new Wt;var Bn=class{constructor(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};he.set(this,new LI),ce.set(this,new LI),dI.set(this,void 0),Fn(this,dI,g,"f")}get sizeNodes(){return Y(this,he,"f").size}get sizeEdges(){return Y(this,ce,"f").size}getNodes(){return Y(this,he,"f").getSelection()}getEdges(){return Y(this,ce,"f").getSelection()}addNodes(){Y(this,he,"f").add(...arguments)}addEdges(){Y(this,ce,"f").add(...arguments)}deleteNodes(g){Y(this,he,"f").delete(g)}deleteEdges(g){Y(this,ce,"f").delete(g)}clear(){Y(this,he,"f").clear(),Y(this,ce,"f").clear()}commit(){let g={nodes:Y(this,he,"f").commit(),edges:Y(this,ce,"f").commit()};for(var e=arguments.length,t=new Array(e),A=0;A<e;A++)t[A]=arguments[A];return Y(this,dI,"f").call(this,g,...t),g}};he=new Wt,ce=new Wt,dI=new Wt;var zn=class{constructor(g,e){this.body=g,this.canvas=e,this._selectionAccumulator=new Bn,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},q(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",()=>{this.updateSelection()})}setOptions(g){g!==void 0&&xt(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,g)}selectOnPoint(g){let e=!1;if(this.options.selectable===!0){let t=this.getNodeAt(g)||this.getEdgeAt(g);this.unselectAll(),t!==void 0&&(e=this.selectObject(t)),this.body.emitter.emit("_requestRedraw")}return e}selectAdditionalOnPoint(g){let e=!1;if(this.options.selectable===!0){let t=this.getNodeAt(g)||this.getEdgeAt(g);t!==void 0&&(e=!0,t.isSelected()===!0?this.deselectObject(t):this.selectObject(t),this.body.emitter.emit("_requestRedraw"))}return e}_initBaseEvent(g,e){let t={};return t.pointer={DOM:{x:e.x,y:e.y},canvas:this.canvas.DOMtoCanvas(e)},t.event=g,t}generateClickEvent(g,e,t,A){let C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,i=this._initBaseEvent(e,t);if(C===!0)i.nodes=[],i.edges=[];else{let n=this.getSelection();i.nodes=n.nodes,i.edges=n.edges}A!==void 0&&(i.previousSelection=A),g=="click"&&(i.items=this.getClickedItems(t)),e.controlEdge!==void 0&&(i.controlEdge=e.controlEdge),this.body.emitter.emit(g,i)}selectObject(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return g!==void 0?(g instanceof pg?(e===!0&&this._selectionAccumulator.addEdges(...g.edges),this._selectionAccumulator.addNodes(g)):this._selectionAccumulator.addEdges(g),!0):!1}deselectObject(g){g.isSelected()===!0&&(g.selected=!1,this._removeFromSelection(g))}_getAllNodesOverlappingWith(g){let e=[],t=this.body.nodes;for(let A=0;A<this.body.nodeIndices.length;A++){let C=this.body.nodeIndices[A];t[C].isOverlappingWith(g)&&e.push(C)}return e}_pointerToPositionObject(g){let e=this.canvas.DOMtoCanvas(g);return{left:e.x-1,top:e.y+1,right:e.x+1,bottom:e.y-1}}getNodeAt(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this._pointerToPositionObject(g),A=this._getAllNodesOverlappingWith(t);if(A.length>0)return e===!0?this.body.nodes[A[A.length-1]]:A[A.length-1]}_getEdgesOverlappingWith(g,e){let t=this.body.edges;for(let A=0;A<this.body.edgeIndices.length;A++){let C=this.body.edgeIndices[A];t[C].isOverlappingWith(g)&&e.push(C)}}_getAllEdgesOverlappingWith(g){let e=[];return this._getEdgesOverlappingWith(g,e),e}getEdgeAt(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this.canvas.DOMtoCanvas(g),A=10,C=null,i=this.body.edges;for(let n=0;n<this.body.edgeIndices.length;n++){let o=this.body.edgeIndices[n],s=i[o];if(s.connected){let r=s.from.x,a=s.from.y,d=s.to.x,l=s.to.y,h=s.edgeType.getDistanceToEdge(r,a,d,l,t.x,t.y);h<A&&(C=o,A=h)}}if(C!==null)return e===!0?this.body.edges[C]:C}_addToHover(g){g instanceof pg?this.hoverObj.nodes[g.id]=g:this.hoverObj.edges[g.id]=g}_removeFromSelection(g){g instanceof pg?(this._selectionAccumulator.deleteNodes(g),this._selectionAccumulator.deleteEdges(...g.edges)):this._selectionAccumulator.deleteEdges(g)}unselectAll(){this._selectionAccumulator.clear()}getSelectedNodeCount(){return this._selectionAccumulator.sizeNodes}getSelectedEdgeCount(){return this._selectionAccumulator.sizeEdges}_hoverConnectedEdges(g){for(let e=0;e<g.edges.length;e++){let t=g.edges[e];t.hover=!0,this._addToHover(t)}}emitBlurEvent(g,e,t){let A=this._initBaseEvent(g,e);t.hover===!0&&(t.hover=!1,t instanceof pg?(A.node=t.id,this.body.emitter.emit("blurNode",A)):(A.edge=t.id,this.body.emitter.emit("blurEdge",A)))}emitHoverEvent(g,e,t){let A=this._initBaseEvent(g,e),C=!1;return t.hover===!1&&(t.hover=!0,this._addToHover(t),C=!0,t instanceof pg?(A.node=t.id,this.body.emitter.emit("hoverNode",A)):(A.edge=t.id,this.body.emitter.emit("hoverEdge",A))),C}hoverObject(g,e){let t=this.getNodeAt(e);t===void 0&&(t=this.getEdgeAt(e));let A=!1;for(let C in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,C)&&(t===void 0||t instanceof pg&&t.id!=C||t instanceof xe)&&(this.emitBlurEvent(g,e,this.hoverObj.nodes[C]),delete this.hoverObj.nodes[C],A=!0);for(let C in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,C)&&(A===!0?(this.hoverObj.edges[C].hover=!1,delete this.hoverObj.edges[C]):(t===void 0||t instanceof xe&&t.id!=C||t instanceof pg&&!t.hover)&&(this.emitBlurEvent(g,e,this.hoverObj.edges[C]),delete this.hoverObj.edges[C],A=!0));if(t!==void 0){let C=U(this.hoverObj.edges).length,i=U(this.hoverObj.nodes).length,n=t instanceof xe&&C===0&&i===0,o=t instanceof pg&&C===0&&i===0;(A||n||o)&&(A=this.emitHoverEvent(g,e,t)),t instanceof pg&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(t)}A===!0&&this.body.emitter.emit("_requestRedraw")}commitWithoutEmitting(){this._selectionAccumulator.commit()}commitAndEmit(g,e){let t=!1,A=this._selectionAccumulator.commit(),C={nodes:A.nodes.previous,edges:A.edges.previous};A.edges.deleted.length>0&&(this.generateClickEvent("deselectEdge",e,g,C),t=!0),A.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",e,g,C),t=!0),A.nodes.added.length>0&&(this.generateClickEvent("selectNode",e,g),t=!0),A.edges.added.length>0&&(this.generateClickEvent("selectEdge",e,g),t=!0),t===!0&&this.generateClickEvent("select",e,g)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var g;return ag(g=this._selectionAccumulator.getNodes()).call(g,e=>e.id)}getSelectedEdgeIds(){var g;return ag(g=this._selectionAccumulator.getEdges()).call(g,e=>e.id)}setSelection(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!g||!g.nodes&&!g.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((e.unselectAll||e.unselectAll===void 0)&&this.unselectAll(),g.nodes)for(let t of g.nodes){let A=this.body.nodes[t];if(!A)throw new RangeError('Node with id "'+t+'" not found');this.selectObject(A,e.highlightEdges)}if(g.edges)for(let t of g.edges){let A=this.body.edges[t];if(!A)throw new RangeError('Edge with id "'+t+'" not found');this.selectObject(A)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(g){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!g||g.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:g},{highlightEdges:e})}selectEdges(g){if(!g||g.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:g})}updateSelection(){for(let g in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,g.id)||this._selectionAccumulator.deleteNodes(g);for(let g in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,g.id)||this._selectionAccumulator.deleteEdges(g)}getClickedItems(g){let e=this.canvas.DOMtoCanvas(g),t=[],A=this.body.nodeIndices,C=this.body.nodes;for(let o=A.length-1;o>=0;o--){let r=C[A[o]].getItemsOnPoint(e);t.push.apply(t,r)}let i=this.body.edgeIndices,n=this.body.edges;for(let o=i.length-1;o>=0;o--){let r=n[i[o]].getItemsOnPoint(e);t.push.apply(t,r)}return t}},GI=class{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(g){return this.fake_use(g),this.abstract()}setPosition(g,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(g,e,t),this.abstract()}getTreeSize(g){return this.fake_use(g),this.abstract()}sort(g){this.fake_use(g),this.abstract()}fix(g,e){this.fake_use(g,e),this.abstract()}shift(g,e){this.fake_use(g,e),this.abstract()}},Zn=class extends GI{constructor(g){super(),this.layout=g}curveType(){return"horizontal"}getPosition(g){return g.x}setPosition(g,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;t!==void 0&&this.layout.hierarchical.addToOrdering(g,t),g.x=e}getTreeSize(g){let e=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,g);return{min:e.min_x,max:e.max_x}}sort(g){Ce(g).call(g,function(e,t){return e.x-t.x})}fix(g,e){g.y=this.layout.options.hierarchical.levelSeparation*e,g.options.fixed.y=!0}shift(g,e){this.layout.body.nodes[g].x+=e}},Ln=class extends GI{constructor(g){super(),this.layout=g}curveType(){return"vertical"}getPosition(g){return g.y}setPosition(g,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;t!==void 0&&this.layout.hierarchical.addToOrdering(g,t),g.y=e}getTreeSize(g){let e=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,g);return{min:e.min_y,max:e.max_y}}sort(g){Ce(g).call(g,function(e,t){return e.y-t.y})}fix(g,e){g.x=this.layout.options.hierarchical.levelSeparation*e,g.options.fixed.x=!0}shift(g,e){this.layout.body.nodes[g].y+=e}},mM=R,vM=Re.every,bM=wt,yM=bM("every");mM({target:"Array",proto:!0,forced:!yM},{every:function(g){return vM(this,g,arguments.length>1?arguments[1]:void 0)}});var wM=Ig,EM=wM("Array").every,TM=J,xM=EM,di=Array.prototype,OM=function(I){var g=I.every;return I===di||TM(di,I)&&g===di.every?xM:g},PM=OM,DM=PM,RM=DM,Fh=D(RM);function NM(I,g){let e=new Lg;return F(I).call(I,t=>{var A;F(A=t.edges).call(A,C=>{C.connected&&e.add(C)})}),F(e).call(e,t=>{let A=t.from.id,C=t.to.id;g[A]==null&&(g[A]=0),(g[C]==null||g[A]>=g[C])&&(g[C]=g[A]+1)}),g}function SM(I){return Bh(g=>{var e,t;return Fh(e=tg(t=g.edges).call(t,A=>I.has(A.toId))).call(e,A=>A.to===g)},(g,e)=>e>g,"from",I)}function kM(I){return Bh(g=>{var e,t;return Fh(e=tg(t=g.edges).call(t,A=>I.has(A.toId))).call(e,A=>A.from===g)},(g,e)=>e<g,"to",I)}function Bh(I,g,e,t){var A;let C=we(null),i=Do(A=[...EI(t).call(t)]).call(A,(a,d)=>a+1+d.edges.length,0),n=e+"Id",o=e==="to"?1:-1;for(let[a,d]of t){if(!t.has(a)||!I(d))continue;C[a]=0;let l=[d],h=0,c;for(;c=l.pop();){var s,r;if(!t.has(a))continue;let p=C[c.id]+o;if(F(s=tg(r=c.edges).call(r,u=>u.connected&&u.to!==u.from&&u[e]!==c&&t.has(u.toId)&&t.has(u.fromId))).call(s,u=>{let m=u[n],E=C[m];(E==null||g(p,E))&&(C[m]=p,l.push(u[e]))}),h>i)return NM(t,C);++h}}return C}var Gn=class{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(g,e){this.childrenReference[g]===void 0&&(this.childrenReference[g]=[]),this.childrenReference[g].push(e),this.parentReference[e]===void 0&&(this.parentReference[e]=[]),this.parentReference[e].push(g)}checkIfTree(){for(let g in this.parentReference)if(this.parentReference[g].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(g,e){e!==void 0&&this.trees[g.id]===void 0&&(this.trees[g.id]=e,this.treeIndex=Math.max(e,this.treeIndex))}ensureLevel(g){this.levels[g]===void 0&&(this.levels[g]=0)}getMaxLevel(g){let e={},t=A=>{if(e[A]!==void 0)return e[A];let C=this.levels[A];if(this.childrenReference[A]){let i=this.childrenReference[A];if(i.length>0)for(let n=0;n<i.length;n++)C=Math.max(C,t(i[n]))}return e[A]=C,C};return t(g)}levelDownstream(g,e){this.levels[e.id]===void 0&&(this.levels[g.id]===void 0&&(this.levels[g.id]=0),this.levels[e.id]=this.levels[g.id]+1)}setMinLevelToZero(){var g;let e=new RA,t=0,A=Ce(g=[...new Lg(mT(this.levels))]).call(g,(C,i)=>C-i);for(let C of A)e.set(C,t++);for(let C in this.levels)Object.prototype.hasOwnProperty.call(this.levels,C)&&(this.levels[C]=e.get(this.levels[C]))}getTreeSize(g,e){let t=1e9,A=-1e9,C=1e9,i=-1e9;for(let n in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,n)&&this.trees[n]===e){let o=g[n];t=Math.min(o.x,t),A=Math.max(o.x,A),C=Math.min(o.y,C),i=Math.max(o.y,i)}return{min_x:t,max_x:A,min_y:C,max_y:i}}hasSameParent(g,e){let t=this.parentReference[g.id],A=this.parentReference[e.id];if(t===void 0||A===void 0)return!1;for(let C=0;C<t.length;C++)for(let i=0;i<A.length;i++)if(t[C]==A[i])return!0;return!1}inSameSubNetwork(g,e){return this.trees[g.id]===this.trees[e.id]}getLevels(){return U(this.distributionOrdering)}addToOrdering(g,e){this.distributionOrdering[e]===void 0&&(this.distributionOrdering[e]=[]);let t=!1,A=this.distributionOrdering[e];for(let C in A)if(A[C]===g){t=!0;break}t||(this.distributionOrdering[e].push(g),this.distributionIndex[g.id]=this.distributionOrdering[e].length-1)}},Vn=class{constructor(g){this.body=g,this._resetRNG(Math.random()+":"+uI()),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"}},q(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;let g=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",g,!1)})}setOptions(g,e){if(g!==void 0){let t=this.options.hierarchical,A=t.enabled;if(xt(["randomSeed","improvedLayout","clusterThreshold"],this.options,g),Dg(this.options,g,"hierarchical"),g.randomSeed!==void 0&&this._resetRNG(g.randomSeed),t.enabled===!0)return A===!0&&this.body.emitter.emit("refresh",!0),t.direction==="RL"||t.direction==="DU"?t.levelSeparation>0&&(t.levelSeparation*=-1):t.levelSeparation<0&&(t.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(e);if(A===!0)return this.body.emitter.emit("refresh"),_(e,this.optionsBackup)}return e}_resetRNG(g){this.initialRandomSeed=g,this._rng=iC(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(g){if(this.options.hierarchical.enabled===!0){let e=this.optionsBackup.physics;g.physics===void 0||g.physics===!0?(g.physics={enabled:e.enabled===void 0?!0:e.enabled,solver:"hierarchicalRepulsion"},e.enabled=e.enabled===void 0?!0:e.enabled,e.solver=e.solver||"barnesHut"):typeof g.physics=="object"?(e.enabled=g.physics.enabled===void 0?!0:g.physics.enabled,e.solver=g.physics.solver||"barnesHut",g.physics.solver="hierarchicalRepulsion"):g.physics!==!1&&(e.solver="barnesHut",g.physics={solver:"hierarchicalRepulsion"});let t=this.direction.curveType();if(g.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},g.edges={smooth:!1};else if(g.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},g.edges.smooth=!1;else if(typeof g.edges.smooth=="boolean")this.optionsBackup.edges={smooth:g.edges.smooth},g.edges.smooth={enabled:g.edges.smooth,type:t};else{let A=g.edges.smooth;A.type!==void 0&&A.type!=="dynamic"&&(t=A.type),this.optionsBackup.edges={smooth:{enabled:A.enabled===void 0?!0:A.enabled,type:A.type===void 0?"dynamic":A.type,roundness:A.roundness===void 0?.5:A.roundness,forceDirection:A.forceDirection===void 0?!1:A.forceDirection}},g.edges.smooth={enabled:A.enabled===void 0?!0:A.enabled,type:t,roundness:A.roundness===void 0?.5:A.roundness,forceDirection:A.forceDirection===void 0?!1:A.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",t)}return g}positionInitially(g){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);let e=g.length+50;for(let t=0;t<g.length;t++){let A=g[t],C=2*Math.PI*this._rng();A.x===void 0&&(A.x=e*Math.cos(C)),A.y===void 0&&(A.y=e*Math.sin(C))}}}layoutNetwork(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){let g=this.body.nodeIndices,e=0;for(let t=0;t<g.length;t++)this.body.nodes[g[t]].predefinedPosition===!0&&(e+=1);if(e<.5*g.length){let A=0,C=this.options.clusterThreshold,i={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(g.length>C){let o=g.length;for(;g.length>C&&A<=10;){A+=1;let s=g.length;A%3===0?this.body.modules.clustering.clusterBridges(i):this.body.modules.clustering.clusterOutliers(i);let r=g.length;if(s==r&&A%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*o)})}A>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(g,this.body.edgeIndices,!0),this._shiftToCenter();let n=70;for(let o=0;o<g.length;o++){let s=this.body.nodes[g[o]];s.predefinedPosition===!1&&(s.x+=(.5-this._rng())*n,s.y+=(.5-this._rng())*n)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}_shiftToCenter(){let g=dg.getRangeCore(this.body.nodes,this.body.nodeIndices),e=dg.findCenter(g);for(let t=0;t<this.body.nodeIndices.length;t++){let A=this.body.nodes[this.body.nodeIndices[t]];A.x-=e.x,A.y-=e.y}}_declusterAll(){let g=!0;for(;g===!0;){g=!1;for(let e=0;e<this.body.nodeIndices.length;e++)this.body.nodes[this.body.nodeIndices[e]].isCluster===!0&&(g=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[e],{},!1));g===!0&&this.body.emitter.emit("_dataChanged")}}getSeed(){return this.initialRandomSeed}setupHierarchicalLayout(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){let g,e,t=!1,A=!1;this.lastNodeOnLevel={},this.hierarchical=new Gn;for(e in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,e)&&(g=this.body.nodes[e],g.options.level!==void 0?(t=!0,this.hierarchical.levels[e]=g.options.level):A=!0);if(A===!0&&t===!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(A===!0){let i=this.options.hierarchical.sortMethod;i==="hubsize"?this._determineLevelsByHubsize():i==="directed"?this._determineLevelsDirected():i==="custom"&&this._determineLevelsCustomCallback()}for(let i in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,i)&&this.hierarchical.ensureLevel(i);let C=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(C),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var g=this;let e=!1,t={},A=()=>{let u=i(),m=0;for(let E=0;E<u.length-1;E++){let w=u[E].max-u[E+1].min;m+=w+this.options.hierarchical.treeSpacing,C(E+1,m)}},C=(u,m)=>{let E=this.hierarchical.trees;for(let w in E)Object.prototype.hasOwnProperty.call(E,w)&&E[w]===u&&this.direction.shift(w,m)},i=()=>{let u=[];for(let m=0;m<this.hierarchical.numTrees();m++)u.push(this.direction.getTreeSize(m));return u},n=(u,m)=>{if(!m[u.id]&&(m[u.id]=!0,this.hierarchical.childrenReference[u.id])){let E=this.hierarchical.childrenReference[u.id];if(E.length>0)for(let w=0;w<E.length;w++)n(this.body.nodes[E[w]],m)}},o=function(u){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,E=1e9,w=1e9,O=1e9,M=-1e9;for(let k in u)if(Object.prototype.hasOwnProperty.call(u,k)){let V=g.body.nodes[k],yg=g.hierarchical.levels[V.id],ug=g.direction.getPosition(V),[He,Qe]=g._getSpaceAroundNode(V,u);E=Math.min(He,E),w=Math.min(Qe,w),yg<=m&&(O=Math.min(ug,O),M=Math.max(ug,M))}return[O,M,E,w]},s=(u,m)=>{let E=this.hierarchical.getMaxLevel(u.id),w=this.hierarchical.getMaxLevel(m.id);return Math.min(E,w)},r=(u,m,E)=>{let w=this.hierarchical;for(let O=0;O<m.length;O++){let M=m[O],k=w.distributionOrdering[M];if(k.length>1)for(let V=0;V<k.length-1;V++){let yg=k[V],ug=k[V+1];w.hasSameParent(yg,ug)&&w.inSameSubNetwork(yg,ug)&&u(yg,ug,E)}}},a=function(u,m){let E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,w=g.direction.getPosition(u),O=g.direction.getPosition(m),M=Math.abs(O-w),k=g.options.hierarchical.nodeSpacing;if(M>k){let V={},yg={};n(u,V),n(m,yg);let ug=s(u,m),He=o(V,ug),Qe=o(yg,ug),MA=He[1],Xe=Qe[0],Cg=Qe[2];if(Math.abs(MA-Xe)>k){let W=MA-Xe+k;W<-Cg+k&&(W=-Cg+k),W<0&&(g._shiftBlock(m.id,W),e=!0,E===!0&&g._centerParent(m))}}},d=(u,m)=>{let E=m.id,w=m.edges,O=this.hierarchical.levels[m.id],M=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,k={},V=[];for(let Cg=0;Cg<w.length;Cg++){let j=w[Cg];if(j.toId!=j.fromId){let W=j.toId==E?j.from:j.to;k[w[Cg].id]=W,this.hierarchical.levels[W.id]<O&&V.push(j)}}let yg=(Cg,j)=>{let W=0;for(let hg=0;hg<j.length;hg++)if(k[j[hg].id]!==void 0){let fg=this.direction.getPosition(k[j[hg].id])-Cg;W+=fg/Math.sqrt(fg*fg+M)}return W},ug=(Cg,j)=>{let W=0;for(let hg=0;hg<j.length;hg++)if(k[j[hg].id]!==void 0){let fg=this.direction.getPosition(k[j[hg].id])-Cg;W-=M*Math.pow(fg*fg+M,-1.5)}return W},He=(Cg,j)=>{let W=this.direction.getPosition(m),hg={};for(let fg=0;fg<Cg;fg++){let Mg=yg(W,j),Je=ug(W,j),Ot=40,Lh=Math.max(-Ot,Math.min(Ot,Math.round(Mg/Je)));if(W=W-Lh,hg[W]!==void 0)break;hg[W]=fg}return W},Qe=Cg=>{let j=this.direction.getPosition(m);if(t[m.id]===void 0){let Ot={};n(m,Ot),t[m.id]=Ot}let W=o(t[m.id]),hg=W[2],fg=W[3],Mg=Cg-j,Je=0;Mg>0?Je=Math.min(Mg,fg-this.options.hierarchical.nodeSpacing):Mg<0&&(Je=-Math.min(-Mg,hg-this.options.hierarchical.nodeSpacing)),Je!=0&&(this._shiftBlock(m.id,Je),e=!0)},MA=Cg=>{let j=this.direction.getPosition(m),[W,hg]=this._getSpaceAroundNode(m),fg=Cg-j,Mg=j;fg>0?Mg=Math.min(j+(hg-this.options.hierarchical.nodeSpacing),Cg):fg<0&&(Mg=Math.max(j-(W-this.options.hierarchical.nodeSpacing),Cg)),Mg!==j&&(this.direction.setPosition(m,Mg),e=!0)},Xe=He(u,V);Qe(Xe),Xe=He(u,w),MA(Xe)},l=u=>{let m=this.hierarchical.getLevels();m=ze(m).call(m);for(let E=0;E<u;E++){e=!1;for(let w=0;w<m.length;w++){let O=m[w],M=this.hierarchical.distributionOrdering[O];for(let k=0;k<M.length;k++)d(1e3,M[k])}if(e!==!0)break}},h=u=>{let m=this.hierarchical.getLevels();m=ze(m).call(m);for(let E=0;E<u&&(e=!1,r(a,m,!0),e===!0);E++);},c=()=>{for(let u in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,u)&&this._centerParent(this.body.nodes[u])},p=()=>{let u=this.hierarchical.getLevels();u=ze(u).call(u);for(let m=0;m<u.length;m++){let E=u[m],w=this.hierarchical.distributionOrdering[E];for(let O=0;O<w.length;O++)this._centerParent(w[O])}};this.options.hierarchical.blockShifting===!0&&(h(5),c()),this.options.hierarchical.edgeMinimization===!0&&l(20),this.options.hierarchical.parentCentralization===!0&&p(),A()}_getSpaceAroundNode(g,e){let t=!0;e===void 0&&(t=!1);let A=this.hierarchical.levels[g.id];if(A!==void 0){let C=this.hierarchical.distributionIndex[g.id],i=this.direction.getPosition(g),n=this.hierarchical.distributionOrdering[A],o=1e9,s=1e9;if(C!==0){let r=n[C-1];if(t===!0&&e[r.id]===void 0||t===!1){let a=this.direction.getPosition(r);o=i-a}}if(C!=n.length-1){let r=n[C+1];if(t===!0&&e[r.id]===void 0||t===!1){let a=this.direction.getPosition(r);s=Math.min(s,a-i)}}return[o,s]}else return[0,0]}_centerParent(g){if(this.hierarchical.parentReference[g.id]){let e=this.hierarchical.parentReference[g.id];for(let t=0;t<e.length;t++){let A=e[t],C=this.body.nodes[A],i=this.hierarchical.childrenReference[A];if(i!==void 0){let n=this._getCenterPosition(i),o=this.direction.getPosition(C),[s,r]=this._getSpaceAroundNode(C),a=o-n;(a<0&&Math.abs(a)<r-this.options.hierarchical.nodeSpacing||a>0&&Math.abs(a)<s-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(C,n)}}}}_placeNodesByHierarchy(g){this.positionedNodes={};for(let t in g)if(Object.prototype.hasOwnProperty.call(g,t)){var e;let A=U(g[t]);A=this._indexArrayToNodes(A),Ce(e=this.direction).call(e,A);let C=0;for(let i=0;i<A.length;i++){let n=A[i];if(this.positionedNodes[n.id]===void 0){let o=this.options.hierarchical.nodeSpacing,s=o*C;C>0&&(s=this.direction.getPosition(A[i-1])+o),this.direction.setPosition(n,s,t),this._validatePositionAndContinue(n,t,s),C++}}}}_placeBranchNodes(g,e){var t;let A=this.hierarchical.childrenReference[g];if(A===void 0)return;let C=[];for(let n=0;n<A.length;n++)C.push(this.body.nodes[A[n]]);Ce(t=this.direction).call(t,C);for(let n=0;n<C.length;n++){let o=C[n],s=this.hierarchical.levels[o.id];if(s>e&&this.positionedNodes[o.id]===void 0){let r=this.options.hierarchical.nodeSpacing,a;n===0?a=this.direction.getPosition(this.body.nodes[g]):a=this.direction.getPosition(C[n-1])+r,this.direction.setPosition(o,a,s),this._validatePositionAndContinue(o,s,a)}else return}let i=this._getCenterPosition(C);this.direction.setPosition(this.body.nodes[g],i,e)}_validatePositionAndContinue(g,e,t){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[e]!==void 0){let A=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[e]]);if(t-A<this.options.hierarchical.nodeSpacing){let C=A+this.options.hierarchical.nodeSpacing-t,i=this._findCommonParent(this.lastNodeOnLevel[e],g.id);this._shiftBlock(i.withChild,C)}}this.lastNodeOnLevel[e]=g.id,this.positionedNodes[g.id]=!0,this._placeBranchNodes(g.id,e)}}_indexArrayToNodes(g){let e=[];for(let t=0;t<g.length;t++)e.push(this.body.nodes[g[t]]);return e}_getDistribution(){let g={},e,t;for(e in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,e)){t=this.body.nodes[e];let A=this.hierarchical.levels[e]===void 0?0:this.hierarchical.levels[e];this.direction.fix(t,A),g[A]===void 0&&(g[A]={}),g[A][e]=t}return g}_getActiveEdges(g){let e=[];return S(g.edges,t=>{var A;G(A=this.body.edgeIndices).call(A,t.id)!==-1&&e.push(t)}),e}_getHubSizes(){let g={},e=this.body.nodeIndices;S(e,A=>{let C=this.body.nodes[A],i=this._getActiveEdges(C).length;g[i]=!0});let t=[];return S(g,A=>{t.push(Number(A))}),Ce(t).call(t,function(A,C){return C-A}),t}_determineLevelsByHubsize(){let g=(t,A)=>{this.hierarchical.levelDownstream(t,A)},e=this._getHubSizes();for(let t=0;t<e.length;++t){let A=e[t];if(A===0)break;S(this.body.nodeIndices,C=>{let i=this.body.nodes[C];A===this._getActiveEdges(i).length&&this._crawlNetwork(g,C)})}}_determineLevelsCustomCallback(){let e=function(A,C,i){},t=(A,C,i)=>{let n=this.hierarchical.levels[A.id];n===void 0&&(n=this.hierarchical.levels[A.id]=1e5);let o=e(dg.cloneOptions(A,"node"),dg.cloneOptions(C,"node"),dg.cloneOptions(i,"edge"));this.hierarchical.levels[C.id]=n+o};this._crawlNetwork(t),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var g;let e=Do(g=this.body.nodeIndices).call(g,(t,A)=>(t.set(A,this.body.nodes[A]),t),new RA);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=kM(e):this.hierarchical.levels=SM(e),this.hierarchical.setMinLevelToZero()}_generateMap(){let g=(e,t)=>{this.hierarchical.levels[t.id]>this.hierarchical.levels[e.id]&&this.hierarchical.addRelation(e.id,t.id)};this._crawlNetwork(g),this.hierarchical.checkIfTree()}_crawlNetwork(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},e=arguments.length>1?arguments[1]:void 0,t={},A=(C,i)=>{if(t[C.id]===void 0){this.hierarchical.setTreeIndex(C,i),t[C.id]=!0;let n,o=this._getActiveEdges(C);for(let s=0;s<o.length;s++){let r=o[s];r.connected===!0&&(r.toId==C.id?n=r.from:n=r.to,C.id!=n.id&&(g(C,n,r),A(n,i)))}}};if(e===void 0){let C=0;for(let i=0;i<this.body.nodeIndices.length;i++){let n=this.body.nodeIndices[i];if(t[n]===void 0){let o=this.body.nodes[n];A(o,C),C+=1}}}else{let C=this.body.nodes[e];if(C===void 0){console.error("Node not found:",e);return}A(C)}}_shiftBlock(g,e){let t={},A=C=>{if(t[C])return;t[C]=!0,this.direction.shift(C,e);let i=this.hierarchical.childrenReference[C];if(i!==void 0)for(let n=0;n<i.length;n++)A(i[n])};A(g)}_findCommonParent(g,e){let t={},A=(i,n)=>{let o=this.hierarchical.parentReference[n];if(o!==void 0)for(let s=0;s<o.length;s++){let r=o[s];i[r]=!0,A(i,r)}},C=(i,n)=>{let o=this.hierarchical.parentReference[n];if(o!==void 0)for(let s=0;s<o.length;s++){let r=o[s];if(i[r]!==void 0)return{foundParent:r,withChild:n};let a=C(i,r);if(a.foundParent!==null)return a}return{foundParent:null,withChild:n}};return A(t,g),C(t,e)}setDirectionStrategy(){this.options.hierarchical.direction==="UD"||this.options.hierarchical.direction==="DU"?this.direction=new Zn(this):this.direction=new Ln(this)}_getCenterPosition(g){let e=1e9,t=-1e9;for(let A=0;A<g.length;A++){let C;if(g[A].id!==void 0)C=g[A];else{let n=g[A];C=this.body.nodes[n]}let i=this.direction.getPosition(C);e=Math.min(e,i),t=Math.max(t,i)}return .5*(e+t)}},MM=`div.vis-network div.vis-manipulation {
714
+ `;_g(Hk);function Ea(I){var e=I&&I.preventDefault||!1,g=I&&I.container||window,t={},A={keydown:{},keyup:{}},C={},i;for(i=97;i<=122;i++)C[String.fromCharCode(i)]={code:65+(i-97),shift:!1};for(i=65;i<=90;i++)C[String.fromCharCode(i)]={code:i,shift:!0};for(i=0;i<=9;i++)C[""+i]={code:48+i,shift:!1};for(i=1;i<=12;i++)C["F"+i]={code:111+i,shift:!1};for(i=0;i<=9;i++)C["num"+i]={code:96+i,shift:!1};C["num*"]={code:106,shift:!1},C["num+"]={code:107,shift:!1},C["num-"]={code:109,shift:!1},C["num/"]={code:111,shift:!1},C["num."]={code:110,shift:!1},C.left={code:37,shift:!1},C.up={code:38,shift:!1},C.right={code:39,shift:!1},C.down={code:40,shift:!1},C.space={code:32,shift:!1},C.enter={code:13,shift:!1},C.shift={code:16,shift:void 0},C.esc={code:27,shift:!1},C.backspace={code:8,shift:!1},C.tab={code:9,shift:!1},C.ctrl={code:17,shift:!1},C.alt={code:18,shift:!1},C.delete={code:46,shift:!1},C.pageup={code:33,shift:!1},C.pagedown={code:34,shift:!1},C["="]={code:187,shift:!1},C["-"]={code:189,shift:!1},C["]"]={code:221,shift:!1},C["["]={code:219,shift:!1};var n=function(r){s(r,"keydown")},o=function(r){s(r,"keyup")},s=function(r,a){if(A[a][r.keyCode]!==void 0){for(var d=A[a][r.keyCode],l=0;l<d.length;l++)(d[l].shift===void 0||d[l].shift==!0&&r.shiftKey==!0||d[l].shift==!1&&r.shiftKey==!1)&&d[l].fn(r);e==!0&&r.preventDefault()}};return t.bind=function(r,a,d){if(d===void 0&&(d="keydown"),C[r]===void 0)throw new Error("unsupported key: "+r);A[d][C[r].code]===void 0&&(A[d][C[r].code]=[]),A[d][C[r].code].push({fn:a,shift:C[r].shift})},t.bindAll=function(r,a){a===void 0&&(a="keydown");for(var d in C)C.hasOwnProperty(d)&&t.bind(d,r,a)},t.getKey=function(r){for(var a in C)if(C.hasOwnProperty(a)){if(r.shiftKey==!0&&C[a].shift==!0&&r.keyCode==C[a].code)return a;if(r.shiftKey==!1&&C[a].shift==!1&&r.keyCode==C[a].code)return a;if(r.keyCode==C[a].code&&a=="shift")return a}return"unknown key, currently not supported"},t.unbind=function(r,a,d){if(d===void 0&&(d="keydown"),C[r]===void 0)throw new Error("unsupported key: "+r);if(a!==void 0){var l=[],h=A[d][C[r].code];if(h!==void 0)for(var c=0;c<h.length;c++)h[c].fn==a&&h[c].shift==C[r].shift||l.push(A[d][C[r].code][c]);A[d][C[r].code]=l}else A[d][C[r].code]=[]},t.reset=function(){A={keydown:{},keyup:{}}},t.destroy=function(){A={keydown:{},keyup:{}},g.removeEventListener("keydown",n,!0),g.removeEventListener("keyup",o,!0)},g.addEventListener("keydown",n,!0),g.addEventListener("keyup",o,!0),t}var Bn=class{constructor(e,g){this.body=e,this.canvas=g,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={};let e=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],g=["_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 i=0;i<e.length;i++){this.navigationDOM[e[i]]=document.createElement("div"),this.navigationDOM[e[i]].className="vis-button vis-"+e[i],this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[i]]);let n=new ot(this.navigationDOM[e[i]]);if(g[i]==="_fit"){var t;ZI(n,b(t=this._fit).call(t,this))}else{var A;ZI(n,b(A=this.bindToRedraw).call(A,this,g[i]))}this.navigationHammers.push(n)}let C=new ot(this.canvas.frame);Ph(C,()=>{this._stopMovement()}),this.navigationHammers.push(C),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var g;this.boundFunctions[e]=b(g=this[e]).call(g,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(let 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(){let e=this.body.view.scale,g=this.body.view.scale*(1+this.options.keyboard.speed.zoom),t=this.body.view.translation,A=g/e,C=(1-A)*this.canvas.canvasViewCenter.x+t.x*A,i=(1-A)*this.canvas.canvasViewCenter.y+t.y*A;this.body.view.scale=g,this.body.view.translation={x:C,y:i},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){let e=this.body.view.scale,g=this.body.view.scale/(1+this.options.keyboard.speed.zoom),t=this.body.view.translation,A=g/e,C=(1-A)*this.canvas.canvasViewCenter.x+t.x*A,i=(1-A)*this.canvas.canvasViewCenter.y+t.y*A;this.body.view.scale=g,this.body.view.translation={x:C,y:i},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=Ea({container:window,preventDefault:!0}):this.keycharm=Ea({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,g,t,A,C,i,n,o,s,r,a,d,l,h,c,p,u,m,E,w,O,M,k,V;b(e=this.keycharm).call(e,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),b(g=this.keycharm).call(g,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),b(t=this.keycharm).call(t,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),b(A=this.keycharm).call(A,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),b(C=this.keycharm).call(C,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(i=this.keycharm).call(i,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(n=this.keycharm).call(n,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(o=this.keycharm).call(o,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(s=this.keycharm).call(s,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(r=this.keycharm).call(r,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(a=this.keycharm).call(a,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(d=this.keycharm).call(d,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(l=this.keycharm).call(l,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),b(h=this.keycharm).call(h,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),b(c=this.keycharm).call(c,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),b(p=this.keycharm).call(p,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),b(u=this.keycharm).call(u,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(m=this.keycharm).call(m,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(E=this.keycharm).call(E,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(w=this.keycharm).call(w,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(O=this.keycharm).call(O,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(M=this.keycharm).call(M,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(k=this.keycharm).call(k,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(V=this.keycharm).call(V,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}},zn=class{constructor(e,g,t){var A,C,i,n,o,s,r,a,d,l,h,c,p;this.body=e,this.canvas=g,this.selectionHandler=t,this.navigationHandler=new Bn(e,g),this.body.eventListeners.onTap=b(A=this.onTap).call(A,this),this.body.eventListeners.onTouch=b(C=this.onTouch).call(C,this),this.body.eventListeners.onDoubleTap=b(i=this.onDoubleTap).call(i,this),this.body.eventListeners.onHold=b(n=this.onHold).call(n,this),this.body.eventListeners.onDragStart=b(o=this.onDragStart).call(o,this),this.body.eventListeners.onDrag=b(s=this.onDrag).call(s,this),this.body.eventListeners.onDragEnd=b(r=this.onDragEnd).call(r,this),this.body.eventListeners.onMouseWheel=b(a=this.onMouseWheel).call(a,this),this.body.eventListeners.onPinch=b(d=this.onPinch).call(d,this),this.body.eventListeners.onMouseMove=b(l=this.onMouseMove).call(l,this),this.body.eventListeners.onRelease=b(h=this.onRelease).call(h,this),this.body.eventListeners.onContext=b(c=this.onContext).call(c,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=b(p=this.getPointer).call(p,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},q(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&&(bI(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),De(this.options,e,"keyboard"),e.tooltip&&(q(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=Gi(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-jO(this.canvas.frame.canvas),y:e.y-WO(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){let g=this.getPointer(e.center),t=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(g,t),this.selectionHandler.commitAndEmit(g,e),this.selectionHandler.generateClickEvent("click",e,g)}onDoubleTap(e){let g=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,g)}onHold(e){let g=this.getPointer(e.center),t=this.selectionHandler.options.multiselect;this.checkSelectionChanges(g,t),this.selectionHandler.commitAndEmit(g,e),this.selectionHandler.generateClickEvent("click",e,g),this.selectionHandler.generateClickEvent("hold",e,g)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){let g=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,g),this.touchTime=new Date().valueOf()}}onContext(e){let g=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,g)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,g){let t=function(A,C){let i=[];for(let n=0;n<A.length;n++){let o=A[n];G(C).call(C,o)===-1&&i.push(o)}return i};return{nodes:t(e.nodes,g.nodes),edges:t(e.edges,g.edges)}}onDragStart(e){if(this.drag.dragging)return;this.drag.pointer===void 0&&this.onTouch(e);let g=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=q({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;let t=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)}}else if(g!==void 0&&this.options.dragNodes===!0){this.drag.nodeId=g.id,g.isSelected()===!1&&this.selectionHandler.setSelection({nodes:[g.id]}),this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer);for(let t of this.selectionHandler.getSelectedNodes()){let A={id:t.id,node:t,x:t.x,y:t.y,xFixed:t.options.fixed.x,yFixed:t.options.fixed.y};t.options.fixed.x=!0,t.options.fixed.y=!0,this.drag.selection.push(A)}}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");let g=this.getPointer(e.center),t=this.drag.selection;if(t&&t.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent("dragging",e,g);let A=g.x-this.drag.pointer.x,C=g.y-this.drag.pointer.y;F(t).call(t,i=>{let n=i.node;i.xFixed===!1&&(n.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(i.x)+A)),i.yFixed===!1&&(n.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(i.y)+C))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,g,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(g.x),y:this.canvas._YconvertDOMtoCanvas(g.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,g,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}let A=g.x-this.drag.pointer.x,C=g.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+A,y:this.drag.translation.y+C},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var g;this.body.selectionBox.show=!1;let t=this.body.selectionBox.position,A={minX:Math.min(t.start.x,t.end.x),minY:Math.min(t.start.y,t.end.y),maxX:Math.max(t.start.x,t.end.x),maxY:Math.max(t.start.y,t.end.y)},C=te(g=this.body.nodeIndices).call(g,n=>{let o=this.body.nodes[n];return o.x>=A.minX&&o.x<=A.maxX&&o.y>=A.minY&&o.y<=A.maxY});F(C).call(C,n=>this.selectionHandler.selectObject(this.body.nodes[n]));let i=this.getPointer(e.center);this.selectionHandler.commitAndEmit(i,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{let t=this.drag.selection;t&&t.length?(F(t).call(t,function(A){A.node.options.fixed.x=A.xFixed,A.node.options.fixed.y=A.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){let g=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);let t=this.pinch.scale*e.scale;this.zoom(t,g)}zoom(e,g){if(this.options.zoomView===!0){let t=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let A;this.drag!==void 0&&this.drag.dragging===!0&&(A=this.canvas.DOMtoCanvas(this.drag.pointer));let C=this.body.view.translation,i=e/t,n=(1-i)*g.x+C.x*i,o=(1-i)*g.y+C.y*i;if(this.body.view.scale=e,this.body.view.translation={x:n,y:o},A!=null){let s=this.canvas.canvasToDOM(A);this.drag.pointer.x=s.x,this.drag.pointer.y=s.y}this.body.emitter.emit("_requestRedraw"),t<e?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:g}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:g})}}onMouseWheel(e){if(this.options.zoomView===!0){if(e.deltaY!==0){let g=this.body.view.scale;g*=1+(e.deltaY<0?1:-1)*(this.options.zoomSpeed*.1);let t=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(g,t)}e.preventDefault()}}onMouseMove(e){let g=this.getPointer({x:e.clientX,y:e.clientY}),t=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(g),this.popup.hidden===!1&&(t=!0,this.popup.setPosition(g.x+3,g.y-5),this.popup.show())),this.options.keyboard.autoFocus&&this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),t===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=He(()=>this._checkShowPopup(g),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,g)}_checkShowPopup(e){let g=this.canvas._XconvertDOMtoCanvas(e.x),t=this.canvas._YconvertDOMtoCanvas(e.y),A={left:g,top:t,right:g,bottom:t},C=this.popupObj===void 0?void 0:this.popupObj.id,i=!1,n="node";if(this.popupObj===void 0){let o=this.body.nodeIndices,s=this.body.nodes,r,a=[];for(let d=0;d<o.length;d++)r=s[o[d]],r.isOverlappingWith(A)===!0&&(i=!0,r.getTitle()!==void 0&&a.push(o[d]));a.length>0&&(this.popupObj=s[a[a.length-1]],i=!0)}if(this.popupObj===void 0&&i===!1){let o=this.body.edgeIndices,s=this.body.edges,r,a=[];for(let d=0;d<o.length;d++)r=s[o[d]],r.isOverlappingWith(A)===!0&&r.connected===!0&&r.getTitle()!==void 0&&a.push(o[d]);a.length>0&&(this.popupObj=s[a[a.length-1]],n="edge")}this.popupObj!==void 0?this.popupObj.id!==C&&(this.popup===void 0&&(this.popup=new e1(this.canvas.frame)),this.popup.popupTargetType=n,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){let g=this.selectionHandler._pointerToPositionObject(e),t=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(t=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(g),t===!0)){let A=this.selectionHandler.getNodeAt(e);t=A===void 0?!1:A.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(t=this.body.edges[this.popup.popupTargetId].isOverlappingWith(g));t===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}},Qk=Z,Ta=Do,qA=nC.getWeakData,Xk=Oo,Jk=rg,$k=ft,ai=ce,qk=xo,Dh=Ng,xa=ne,Nh=Kg,eM=Nh.set,gM=Nh.getterFor,tM=Dh.find,AM=Dh.findIndex,IM=Qk([].splice),CM=0,eI=function(I){return I.frozen||(I.frozen=new Rh)},Rh=function(){this.entries=[]},di=function(I,e){return tM(I.entries,function(g){return g[0]===e})};Rh.prototype={get:function(I){var e=di(this,I);if(e)return e[1]},has:function(I){return!!di(this,I)},set:function(I,e){var g=di(this,I);g?g[1]=e:this.entries.push([I,e])},delete:function(I){var e=AM(this.entries,function(g){return g[0]===I});return~e&&IM(this.entries,e,1),!!~e}};var iM={getConstructor:function(I,e,g,t){var A=I(function(o,s){Xk(o,C),eM(o,{type:e,id:CM++,frozen:void 0}),$k(s)||qk(s,o[t],{that:o,AS_ENTRIES:g})}),C=A.prototype,i=gM(e),n=function(o,s,r){var a=i(o),d=qA(Jk(s),!0);return d===!0?eI(a).set(s,r):d[a.id]=r,o};return Ta(C,{delete:function(o){var s=i(this);if(!ai(o))return!1;var r=qA(o);return r===!0?eI(s).delete(o):r&&xa(r,s.id)&&delete r[s.id]},has:function(s){var r=i(this);if(!ai(s))return!1;var a=qA(s);return a===!0?eI(r).has(s):a&&xa(a,r.id)}}),Ta(C,g?{get:function(s){var r=i(this);if(ai(s)){var a=qA(s);return a===!0?eI(r).get(s):a?a[r.id]:void 0}},set:function(s,r){return n(this,s,r)}}:{add:function(s){return n(this,s,!0)}}),A}},nM=Jl,Oa=X,rI=Z,Pa=Do,oM=nC,sM=Po,Sh=iM,gI=ce,tI=Kg.enforce,rM=z,aM=hd,kA=Object,dM=Array.isArray,AI=kA.isExtensible,kh=kA.isFrozen,lM=kA.isSealed,Mh=kA.freeze,hM=kA.seal,Da={},Na={},cM=!Oa.ActiveXObject&&"ActiveXObject"in Oa,kt,Fh=function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},Bh=sM("WeakMap",Fh,Sh),At=Bh.prototype,aI=rI(At.set),uM=function(){return nM&&rM(function(){var I=Mh([]);return aI(new Bh,I,1),!kh(I)})};aM&&(cM?(kt=Sh.getConstructor(Fh,"WeakMap",!0),oM.enable(),li=rI(At.delete),Mt=rI(At.has),hi=rI(At.get),Pa(At,{delete:function(I){if(gI(I)&&!AI(I)){var e=tI(this);return e.frozen||(e.frozen=new kt),li(this,I)||e.frozen.delete(I)}return li(this,I)},has:function(e){if(gI(e)&&!AI(e)){var g=tI(this);return g.frozen||(g.frozen=new kt),Mt(this,e)||g.frozen.has(e)}return Mt(this,e)},get:function(e){if(gI(e)&&!AI(e)){var g=tI(this);return g.frozen||(g.frozen=new kt),Mt(this,e)?hi(this,e):g.frozen.get(e)}return hi(this,e)},set:function(e,g){if(gI(e)&&!AI(e)){var t=tI(this);t.frozen||(t.frozen=new kt),Mt(this,e)?aI(this,e,g):t.frozen.set(e,g)}else aI(this,e,g);return this}})):uM()&&Pa(At,{set:function(e,g){var t;return dM(e)&&(kh(e)?t=Da:lM(e)&&(t=Na)),aI(this,e,g),t===Da&&Mh(e),t===Na&&hM(e),this}}));var li,Mt,hi,fM=L,pM=fM.WeakMap,mM=pM,vM=mM,bM=vM,Wt=D(bM);function Y(I,e,g,t){if(g==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?I!==e||!t:!e.has(I))throw new TypeError("Cannot read private member from an object whose class did not declare it");return g==="m"?t:g==="a"?t.call(I):t?t.value:e.get(I)}function Zn(I,e,g,t,A){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!A)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?I!==e||!A:!e.has(I))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?A.call(I,g):A?A.value=g:e.set(I,g),g}var Sg,Pe,hg,cg,dI;function Ra(I,e){let g=new Le;for(let t of e)I.has(t)||g.add(t);return g}var LI=class{constructor(){Sg.set(this,new Le),Pe.set(this,new Le)}get size(){return Y(this,Pe,"f").size}add(){for(var e=arguments.length,g=new Array(e),t=0;t<e;t++)g[t]=arguments[t];for(let A of g)Y(this,Pe,"f").add(A)}delete(){for(var e=arguments.length,g=new Array(e),t=0;t<e;t++)g[t]=arguments[t];for(let A of g)Y(this,Pe,"f").delete(A)}clear(){Y(this,Pe,"f").clear()}getSelection(){return[...Y(this,Pe,"f")]}getChanges(){return{added:[...Ra(Y(this,Sg,"f"),Y(this,Pe,"f"))],deleted:[...Ra(Y(this,Pe,"f"),Y(this,Sg,"f"))],previous:[...new Le(Y(this,Sg,"f"))],current:[...new Le(Y(this,Pe,"f"))]}}commit(){let e=this.getChanges();Zn(this,Sg,Y(this,Pe,"f"),"f"),Zn(this,Pe,new Le(Y(this,Sg,"f")),"f");for(let g of e.added)g.select();for(let g of e.deleted)g.unselect();return e}};Sg=new Wt,Pe=new Wt;var Ln=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};hg.set(this,new LI),cg.set(this,new LI),dI.set(this,void 0),Zn(this,dI,e,"f")}get sizeNodes(){return Y(this,hg,"f").size}get sizeEdges(){return Y(this,cg,"f").size}getNodes(){return Y(this,hg,"f").getSelection()}getEdges(){return Y(this,cg,"f").getSelection()}addNodes(){Y(this,hg,"f").add(...arguments)}addEdges(){Y(this,cg,"f").add(...arguments)}deleteNodes(e){Y(this,hg,"f").delete(e)}deleteEdges(e){Y(this,cg,"f").delete(e)}clear(){Y(this,hg,"f").clear(),Y(this,cg,"f").clear()}commit(){let e={nodes:Y(this,hg,"f").commit(),edges:Y(this,cg,"f").commit()};for(var g=arguments.length,t=new Array(g),A=0;A<g;A++)t[A]=arguments[A];return Y(this,dI,"f").call(this,e,...t),e}};hg=new Wt,cg=new Wt,dI=new Wt;var Gn=class{constructor(e,g){this.body=e,this.canvas=g,this._selectionAccumulator=new Ln,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},q(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",()=>{this.updateSelection()})}setOptions(e){e!==void 0&&xt(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}selectOnPoint(e){let g=!1;if(this.options.selectable===!0){let t=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),t!==void 0&&(g=this.selectObject(t)),this.body.emitter.emit("_requestRedraw")}return g}selectAdditionalOnPoint(e){let g=!1;if(this.options.selectable===!0){let t=this.getNodeAt(e)||this.getEdgeAt(e);t!==void 0&&(g=!0,t.isSelected()===!0?this.deselectObject(t):this.selectObject(t),this.body.emitter.emit("_requestRedraw"))}return g}_initBaseEvent(e,g){let t={};return t.pointer={DOM:{x:g.x,y:g.y},canvas:this.canvas.DOMtoCanvas(g)},t.event=e,t}generateClickEvent(e,g,t,A){let C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,i=this._initBaseEvent(g,t);if(C===!0)i.nodes=[],i.edges=[];else{let n=this.getSelection();i.nodes=n.nodes,i.edges=n.edges}A!==void 0&&(i.previousSelection=A),e=="click"&&(i.items=this.getClickedItems(t)),g.controlEdge!==void 0&&(i.controlEdge=g.controlEdge),this.body.emitter.emit(e,i)}selectObject(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e!==void 0?(e instanceof pe?(g===!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){let g=[],t=this.body.nodes;for(let A=0;A<this.body.nodeIndices.length;A++){let C=this.body.nodeIndices[A];t[C].isOverlappingWith(e)&&g.push(C)}return g}_pointerToPositionObject(e){let g=this.canvas.DOMtoCanvas(e);return{left:g.x-1,top:g.y+1,right:g.x+1,bottom:g.y-1}}getNodeAt(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this._pointerToPositionObject(e),A=this._getAllNodesOverlappingWith(t);if(A.length>0)return g===!0?this.body.nodes[A[A.length-1]]:A[A.length-1]}_getEdgesOverlappingWith(e,g){let t=this.body.edges;for(let A=0;A<this.body.edgeIndices.length;A++){let C=this.body.edgeIndices[A];t[C].isOverlappingWith(e)&&g.push(C)}}_getAllEdgesOverlappingWith(e){let g=[];return this._getEdgesOverlappingWith(e,g),g}getEdgeAt(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this.canvas.DOMtoCanvas(e),A=10,C=null,i=this.body.edges;for(let n=0;n<this.body.edgeIndices.length;n++){let o=this.body.edgeIndices[n],s=i[o];if(s.connected){let r=s.from.x,a=s.from.y,d=s.to.x,l=s.to.y,h=s.edgeType.getDistanceToEdge(r,a,d,l,t.x,t.y);h<A&&(C=o,A=h)}}if(C!==null)return g===!0?this.body.edges[C]:C}_addToHover(e){e instanceof pe?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}_removeFromSelection(e){e instanceof pe?(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 g=0;g<e.edges.length;g++){let t=e.edges[g];t.hover=!0,this._addToHover(t)}}emitBlurEvent(e,g,t){let A=this._initBaseEvent(e,g);t.hover===!0&&(t.hover=!1,t instanceof pe?(A.node=t.id,this.body.emitter.emit("blurNode",A)):(A.edge=t.id,this.body.emitter.emit("blurEdge",A)))}emitHoverEvent(e,g,t){let A=this._initBaseEvent(e,g),C=!1;return t.hover===!1&&(t.hover=!0,this._addToHover(t),C=!0,t instanceof pe?(A.node=t.id,this.body.emitter.emit("hoverNode",A)):(A.edge=t.id,this.body.emitter.emit("hoverEdge",A))),C}hoverObject(e,g){let t=this.getNodeAt(g);t===void 0&&(t=this.getEdgeAt(g));let A=!1;for(let C in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,C)&&(t===void 0||t instanceof pe&&t.id!=C||t instanceof xg)&&(this.emitBlurEvent(e,g,this.hoverObj.nodes[C]),delete this.hoverObj.nodes[C],A=!0);for(let C in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,C)&&(A===!0?(this.hoverObj.edges[C].hover=!1,delete this.hoverObj.edges[C]):(t===void 0||t instanceof xg&&t.id!=C||t instanceof pe&&!t.hover)&&(this.emitBlurEvent(e,g,this.hoverObj.edges[C]),delete this.hoverObj.edges[C],A=!0));if(t!==void 0){let C=U(this.hoverObj.edges).length,i=U(this.hoverObj.nodes).length,n=t instanceof xg&&C===0&&i===0,o=t instanceof pe&&C===0&&i===0;(A||n||o)&&(A=this.emitHoverEvent(e,g,t)),t instanceof pe&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(t)}A===!0&&this.body.emitter.emit("_requestRedraw")}commitWithoutEmitting(){this._selectionAccumulator.commit()}commitAndEmit(e,g){let t=!1,A=this._selectionAccumulator.commit(),C={nodes:A.nodes.previous,edges:A.edges.previous};A.edges.deleted.length>0&&(this.generateClickEvent("deselectEdge",g,e,C),t=!0),A.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",g,e,C),t=!0),A.nodes.added.length>0&&(this.generateClickEvent("selectNode",g,e),t=!0),A.edges.added.length>0&&(this.generateClickEvent("selectEdge",g,e),t=!0),t===!0&&this.generateClickEvent("select",g,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return ae(e=this._selectionAccumulator.getNodes()).call(e,g=>g.id)}getSelectedEdgeIds(){var e;return ae(e=this._selectionAccumulator.getEdges()).call(e,g=>g.id)}setSelection(e){let g=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((g.unselectAll||g.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(let t of e.nodes){let A=this.body.nodes[t];if(!A)throw new RangeError('Node with id "'+t+'" not found');this.selectObject(A,g.highlightEdges)}if(e.edges)for(let t of e.edges){let A=this.body.edges[t];if(!A)throw new RangeError('Edge with id "'+t+'" not found');this.selectObject(A)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(e){let g=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:g})}selectEdges(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}updateSelection(){for(let e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(let e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){let g=this.canvas.DOMtoCanvas(e),t=[],A=this.body.nodeIndices,C=this.body.nodes;for(let o=A.length-1;o>=0;o--){let r=C[A[o]].getItemsOnPoint(g);t.push.apply(t,r)}let i=this.body.edgeIndices,n=this.body.edges;for(let o=i.length-1;o>=0;o--){let r=n[i[o]].getItemsOnPoint(g);t.push.apply(t,r)}return t}},GI=class{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,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,g,t),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,g){this.fake_use(e,g),this.abstract()}shift(e,g){this.fake_use(e,g),this.abstract()}},Vn=class extends GI{constructor(e){super(),this.layout=e}curveType(){return"horizontal"}getPosition(e){return e.x}setPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;t!==void 0&&this.layout.hierarchical.addToOrdering(e,t),e.x=g}getTreeSize(e){let g=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:g.min_x,max:g.max_x}}sort(e){Cg(e).call(e,function(g,t){return g.x-t.x})}fix(e,g){e.y=this.layout.options.hierarchical.levelSeparation*g,e.options.fixed.y=!0}shift(e,g){this.layout.body.nodes[e].x+=g}},jn=class extends GI{constructor(e){super(),this.layout=e}curveType(){return"vertical"}getPosition(e){return e.y}setPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;t!==void 0&&this.layout.hierarchical.addToOrdering(e,t),e.y=g}getTreeSize(e){let g=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:g.min_y,max:g.max_y}}sort(e){Cg(e).call(e,function(g,t){return g.y-t.y})}fix(e,g){e.x=this.layout.options.hierarchical.levelSeparation*g,e.options.fixed.x=!0}shift(e,g){this.layout.body.nodes[e].y+=g}},yM=N,wM=Ng.every,EM=wt,TM=EM("every");yM({target:"Array",proto:!0,forced:!TM},{every:function(e){return wM(this,e,arguments.length>1?arguments[1]:void 0)}});var xM=Ie,OM=xM("Array").every,PM=J,DM=OM,ci=Array.prototype,NM=function(I){var e=I.every;return I===ci||PM(ci,I)&&e===ci.every?DM:e},RM=NM,SM=RM,kM=SM,zh=D(kM);function MM(I,e){let g=new Le;return F(I).call(I,t=>{var A;F(A=t.edges).call(A,C=>{C.connected&&g.add(C)})}),F(g).call(g,t=>{let A=t.from.id,C=t.to.id;e[A]==null&&(e[A]=0),(e[C]==null||e[A]>=e[C])&&(e[C]=e[A]+1)}),e}function FM(I){return Zh(e=>{var g,t;return zh(g=te(t=e.edges).call(t,A=>I.has(A.toId))).call(g,A=>A.to===e)},(e,g)=>g>e,"from",I)}function BM(I){return Zh(e=>{var g,t;return zh(g=te(t=e.edges).call(t,A=>I.has(A.toId))).call(g,A=>A.from===e)},(e,g)=>g<e,"to",I)}function Zh(I,e,g,t){var A;let C=wg(null),i=So(A=[...EI(t).call(t)]).call(A,(a,d)=>a+1+d.edges.length,0),n=g+"Id",o=g==="to"?1:-1;for(let[a,d]of t){if(!t.has(a)||!I(d))continue;C[a]=0;let l=[d],h=0,c;for(;c=l.pop();){var s,r;if(!t.has(a))continue;let p=C[c.id]+o;if(F(s=te(r=c.edges).call(r,u=>u.connected&&u.to!==u.from&&u[g]!==c&&t.has(u.toId)&&t.has(u.fromId))).call(s,u=>{let m=u[n],E=C[m];(E==null||e(p,E))&&(C[m]=p,l.push(u[g]))}),h>i)return MM(t,C);++h}}return C}var Wn=class{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(e,g){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(g),this.parentReference[g]===void 0&&(this.parentReference[g]=[]),this.parentReference[g].push(e)}checkIfTree(){for(let e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,g){g!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=g,this.treeIndex=Math.max(g,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){let g={},t=A=>{if(g[A]!==void 0)return g[A];let C=this.levels[A];if(this.childrenReference[A]){let i=this.childrenReference[A];if(i.length>0)for(let n=0;n<i.length;n++)C=Math.max(C,t(i[n]))}return g[A]=C,C};return t(e)}levelDownstream(e,g){this.levels[g.id]===void 0&&(this.levels[e.id]===void 0&&(this.levels[e.id]=0),this.levels[g.id]=this.levels[e.id]+1)}setMinLevelToZero(){var e;let g=new NA,t=0,A=Cg(e=[...new Le(yT(this.levels))]).call(e,(C,i)=>C-i);for(let C of A)g.set(C,t++);for(let C in this.levels)Object.prototype.hasOwnProperty.call(this.levels,C)&&(this.levels[C]=g.get(this.levels[C]))}getTreeSize(e,g){let t=1e9,A=-1e9,C=1e9,i=-1e9;for(let n in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,n)&&this.trees[n]===g){let o=e[n];t=Math.min(o.x,t),A=Math.max(o.x,A),C=Math.min(o.y,C),i=Math.max(o.y,i)}return{min_x:t,max_x:A,min_y:C,max_y:i}}hasSameParent(e,g){let t=this.parentReference[e.id],A=this.parentReference[g.id];if(t===void 0||A===void 0)return!1;for(let C=0;C<t.length;C++)for(let i=0;i<A.length;i++)if(t[C]==A[i])return!0;return!1}inSameSubNetwork(e,g){return this.trees[e.id]===this.trees[g.id]}getLevels(){return U(this.distributionOrdering)}addToOrdering(e,g){this.distributionOrdering[g]===void 0&&(this.distributionOrdering[g]=[]);let t=!1,A=this.distributionOrdering[g];for(let C in A)if(A[C]===e){t=!0;break}t||(this.distributionOrdering[g].push(e),this.distributionIndex[e.id]=this.distributionOrdering[g].length-1)}},Yn=class{constructor(e){this.body=e,this._resetRNG(Math.random()+":"+uI()),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"}},q(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;let e=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",e,!1)})}setOptions(e,g){if(e!==void 0){let t=this.options.hierarchical,A=t.enabled;if(xt(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),De(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),t.enabled===!0)return A===!0&&this.body.emitter.emit("refresh",!0),t.direction==="RL"||t.direction==="DU"?t.levelSeparation>0&&(t.levelSeparation*=-1):t.levelSeparation<0&&(t.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(g);if(A===!0)return this.body.emitter.emit("refresh"),_(g,this.optionsBackup)}return g}_resetRNG(e){this.initialRandomSeed=e,this._rng=iC(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){let g=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:g.enabled===void 0?!0:g.enabled,solver:"hierarchicalRepulsion"},g.enabled=g.enabled===void 0?!0:g.enabled,g.solver=g.solver||"barnesHut"):typeof e.physics=="object"?(g.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,g.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(g.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});let t=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:t};else{let A=e.edges.smooth;A.type!==void 0&&A.type!=="dynamic"&&(t=A.type),this.optionsBackup.edges={smooth:{enabled:A.enabled===void 0?!0:A.enabled,type:A.type===void 0?"dynamic":A.type,roundness:A.roundness===void 0?.5:A.roundness,forceDirection:A.forceDirection===void 0?!1:A.forceDirection}},e.edges.smooth={enabled:A.enabled===void 0?!0:A.enabled,type:t,roundness:A.roundness===void 0?.5:A.roundness,forceDirection:A.forceDirection===void 0?!1:A.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",t)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);let g=e.length+50;for(let t=0;t<e.length;t++){let A=e[t],C=2*Math.PI*this._rng();A.x===void 0&&(A.x=g*Math.cos(C)),A.y===void 0&&(A.y=g*Math.sin(C))}}}layoutNetwork(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){let e=this.body.nodeIndices,g=0;for(let t=0;t<e.length;t++)this.body.nodes[e[t]].predefinedPosition===!0&&(g+=1);if(g<.5*e.length){let A=0,C=this.options.clusterThreshold,i={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>C){let o=e.length;for(;e.length>C&&A<=10;){A+=1;let s=e.length;A%3===0?this.body.modules.clustering.clusterBridges(i):this.body.modules.clustering.clusterOutliers(i);let r=e.length;if(s==r&&A%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*o)})}A>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();let n=70;for(let o=0;o<e.length;o++){let s=this.body.nodes[e[o]];s.predefinedPosition===!1&&(s.x+=(.5-this._rng())*n,s.y+=(.5-this._rng())*n)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}_shiftToCenter(){let e=de.getRangeCore(this.body.nodes,this.body.nodeIndices),g=de.findCenter(e);for(let t=0;t<this.body.nodeIndices.length;t++){let A=this.body.nodes[this.body.nodeIndices[t]];A.x-=g.x,A.y-=g.y}}_declusterAll(){let e=!0;for(;e===!0;){e=!1;for(let g=0;g<this.body.nodeIndices.length;g++)this.body.nodes[this.body.nodeIndices[g]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[g],{},!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,g,t=!1,A=!1;this.lastNodeOnLevel={},this.hierarchical=new Wn;for(g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&(e=this.body.nodes[g],e.options.level!==void 0?(t=!0,this.hierarchical.levels[g]=e.options.level):A=!0);if(A===!0&&t===!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(A===!0){let i=this.options.hierarchical.sortMethod;i==="hubsize"?this._determineLevelsByHubsize():i==="directed"?this._determineLevelsDirected():i==="custom"&&this._determineLevelsCustomCallback()}for(let i in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,i)&&this.hierarchical.ensureLevel(i);let C=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(C),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let g=!1,t={},A=()=>{let u=i(),m=0;for(let E=0;E<u.length-1;E++){let w=u[E].max-u[E+1].min;m+=w+this.options.hierarchical.treeSpacing,C(E+1,m)}},C=(u,m)=>{let E=this.hierarchical.trees;for(let w in E)Object.prototype.hasOwnProperty.call(E,w)&&E[w]===u&&this.direction.shift(w,m)},i=()=>{let u=[];for(let m=0;m<this.hierarchical.numTrees();m++)u.push(this.direction.getTreeSize(m));return u},n=(u,m)=>{if(!m[u.id]&&(m[u.id]=!0,this.hierarchical.childrenReference[u.id])){let E=this.hierarchical.childrenReference[u.id];if(E.length>0)for(let w=0;w<E.length;w++)n(this.body.nodes[E[w]],m)}},o=function(u){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,E=1e9,w=1e9,O=1e9,M=-1e9;for(let k in u)if(Object.prototype.hasOwnProperty.call(u,k)){let V=e.body.nodes[k],ye=e.hierarchical.levels[V.id],ue=e.direction.getPosition(V),[Hg,Qg]=e._getSpaceAroundNode(V,u);E=Math.min(Hg,E),w=Math.min(Qg,w),ye<=m&&(O=Math.min(ue,O),M=Math.max(ue,M))}return[O,M,E,w]},s=(u,m)=>{let E=this.hierarchical.getMaxLevel(u.id),w=this.hierarchical.getMaxLevel(m.id);return Math.min(E,w)},r=(u,m,E)=>{let w=this.hierarchical;for(let O=0;O<m.length;O++){let M=m[O],k=w.distributionOrdering[M];if(k.length>1)for(let V=0;V<k.length-1;V++){let ye=k[V],ue=k[V+1];w.hasSameParent(ye,ue)&&w.inSameSubNetwork(ye,ue)&&u(ye,ue,E)}}},a=function(u,m){let E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,w=e.direction.getPosition(u),O=e.direction.getPosition(m),M=Math.abs(O-w),k=e.options.hierarchical.nodeSpacing;if(M>k){let V={},ye={};n(u,V),n(m,ye);let ue=s(u,m),Hg=o(V,ue),Qg=o(ye,ue),MA=Hg[1],Xg=Qg[0],Ce=Qg[2];if(Math.abs(MA-Xg)>k){let W=MA-Xg+k;W<-Ce+k&&(W=-Ce+k),W<0&&(e._shiftBlock(m.id,W),g=!0,E===!0&&e._centerParent(m))}}},d=(u,m)=>{let E=m.id,w=m.edges,O=this.hierarchical.levels[m.id],M=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,k={},V=[];for(let Ce=0;Ce<w.length;Ce++){let j=w[Ce];if(j.toId!=j.fromId){let W=j.toId==E?j.from:j.to;k[w[Ce].id]=W,this.hierarchical.levels[W.id]<O&&V.push(j)}}let ye=(Ce,j)=>{let W=0;for(let he=0;he<j.length;he++)if(k[j[he].id]!==void 0){let fe=this.direction.getPosition(k[j[he].id])-Ce;W+=fe/Math.sqrt(fe*fe+M)}return W},ue=(Ce,j)=>{let W=0;for(let he=0;he<j.length;he++)if(k[j[he].id]!==void 0){let fe=this.direction.getPosition(k[j[he].id])-Ce;W-=M*Math.pow(fe*fe+M,-1.5)}return W},Hg=(Ce,j)=>{let W=this.direction.getPosition(m),he={};for(let fe=0;fe<Ce;fe++){let Me=ye(W,j),Jg=ue(W,j),Ot=40,jh=Math.max(-Ot,Math.min(Ot,Math.round(Me/Jg)));if(W=W-jh,he[W]!==void 0)break;he[W]=fe}return W},Qg=Ce=>{let j=this.direction.getPosition(m);if(t[m.id]===void 0){let Ot={};n(m,Ot),t[m.id]=Ot}let W=o(t[m.id]),he=W[2],fe=W[3],Me=Ce-j,Jg=0;Me>0?Jg=Math.min(Me,fe-this.options.hierarchical.nodeSpacing):Me<0&&(Jg=-Math.min(-Me,he-this.options.hierarchical.nodeSpacing)),Jg!=0&&(this._shiftBlock(m.id,Jg),g=!0)},MA=Ce=>{let j=this.direction.getPosition(m),[W,he]=this._getSpaceAroundNode(m),fe=Ce-j,Me=j;fe>0?Me=Math.min(j+(he-this.options.hierarchical.nodeSpacing),Ce):fe<0&&(Me=Math.max(j-(W-this.options.hierarchical.nodeSpacing),Ce)),Me!==j&&(this.direction.setPosition(m,Me),g=!0)},Xg=Hg(u,V);Qg(Xg),Xg=Hg(u,w),MA(Xg)},l=u=>{let m=this.hierarchical.getLevels();m=zg(m).call(m);for(let E=0;E<u;E++){g=!1;for(let w=0;w<m.length;w++){let O=m[w],M=this.hierarchical.distributionOrdering[O];for(let k=0;k<M.length;k++)d(1e3,M[k])}if(g!==!0)break}},h=u=>{let m=this.hierarchical.getLevels();m=zg(m).call(m);for(let E=0;E<u&&(g=!1,r(a,m,!0),g===!0);E++);},c=()=>{for(let u in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,u)&&this._centerParent(this.body.nodes[u])},p=()=>{let u=this.hierarchical.getLevels();u=zg(u).call(u);for(let m=0;m<u.length;m++){let E=u[m],w=this.hierarchical.distributionOrdering[E];for(let O=0;O<w.length;O++)this._centerParent(w[O])}};this.options.hierarchical.blockShifting===!0&&(h(5),c()),this.options.hierarchical.edgeMinimization===!0&&l(20),this.options.hierarchical.parentCentralization===!0&&p(),A()}_getSpaceAroundNode(e,g){let t=!0;g===void 0&&(t=!1);let A=this.hierarchical.levels[e.id];if(A!==void 0){let C=this.hierarchical.distributionIndex[e.id],i=this.direction.getPosition(e),n=this.hierarchical.distributionOrdering[A],o=1e9,s=1e9;if(C!==0){let r=n[C-1];if(t===!0&&g[r.id]===void 0||t===!1){let a=this.direction.getPosition(r);o=i-a}}if(C!=n.length-1){let r=n[C+1];if(t===!0&&g[r.id]===void 0||t===!1){let a=this.direction.getPosition(r);s=Math.min(s,a-i)}}return[o,s]}else return[0,0]}_centerParent(e){if(this.hierarchical.parentReference[e.id]){let g=this.hierarchical.parentReference[e.id];for(let t=0;t<g.length;t++){let A=g[t],C=this.body.nodes[A],i=this.hierarchical.childrenReference[A];if(i!==void 0){let n=this._getCenterPosition(i),o=this.direction.getPosition(C),[s,r]=this._getSpaceAroundNode(C),a=o-n;(a<0&&Math.abs(a)<r-this.options.hierarchical.nodeSpacing||a>0&&Math.abs(a)<s-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(C,n)}}}}_placeNodesByHierarchy(e){this.positionedNodes={};for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var g;let A=U(e[t]);A=this._indexArrayToNodes(A),Cg(g=this.direction).call(g,A);let C=0;for(let i=0;i<A.length;i++){let n=A[i];if(this.positionedNodes[n.id]===void 0){let o=this.options.hierarchical.nodeSpacing,s=o*C;C>0&&(s=this.direction.getPosition(A[i-1])+o),this.direction.setPosition(n,s,t),this._validatePositionAndContinue(n,t,s),C++}}}}_placeBranchNodes(e,g){var t;let A=this.hierarchical.childrenReference[e];if(A===void 0)return;let C=[];for(let n=0;n<A.length;n++)C.push(this.body.nodes[A[n]]);Cg(t=this.direction).call(t,C);for(let n=0;n<C.length;n++){let o=C[n],s=this.hierarchical.levels[o.id];if(s>g&&this.positionedNodes[o.id]===void 0){let r=this.options.hierarchical.nodeSpacing,a;n===0?a=this.direction.getPosition(this.body.nodes[e]):a=this.direction.getPosition(C[n-1])+r,this.direction.setPosition(o,a,s),this._validatePositionAndContinue(o,s,a)}else return}let i=this._getCenterPosition(C);this.direction.setPosition(this.body.nodes[e],i,g)}_validatePositionAndContinue(e,g,t){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[g]!==void 0){let A=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[g]]);if(t-A<this.options.hierarchical.nodeSpacing){let C=A+this.options.hierarchical.nodeSpacing-t,i=this._findCommonParent(this.lastNodeOnLevel[g],e.id);this._shiftBlock(i.withChild,C)}}this.lastNodeOnLevel[g]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,g)}}_indexArrayToNodes(e){let g=[];for(let t=0;t<e.length;t++)g.push(this.body.nodes[e[t]]);return g}_getDistribution(){let e={},g,t;for(g in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,g)){t=this.body.nodes[g];let A=this.hierarchical.levels[g]===void 0?0:this.hierarchical.levels[g];this.direction.fix(t,A),e[A]===void 0&&(e[A]={}),e[A][g]=t}return e}_getActiveEdges(e){let g=[];return S(e.edges,t=>{var A;G(A=this.body.edgeIndices).call(A,t.id)!==-1&&g.push(t)}),g}_getHubSizes(){let e={},g=this.body.nodeIndices;S(g,A=>{let C=this.body.nodes[A],i=this._getActiveEdges(C).length;e[i]=!0});let t=[];return S(e,A=>{t.push(Number(A))}),Cg(t).call(t,function(A,C){return C-A}),t}_determineLevelsByHubsize(){let e=(t,A)=>{this.hierarchical.levelDownstream(t,A)},g=this._getHubSizes();for(let t=0;t<g.length;++t){let A=g[t];if(A===0)break;S(this.body.nodeIndices,C=>{let i=this.body.nodes[C];A===this._getActiveEdges(i).length&&this._crawlNetwork(e,C)})}}_determineLevelsCustomCallback(){let g=function(A,C,i){},t=(A,C,i)=>{let n=this.hierarchical.levels[A.id];n===void 0&&(n=this.hierarchical.levels[A.id]=1e5);let o=g(de.cloneOptions(A,"node"),de.cloneOptions(C,"node"),de.cloneOptions(i,"edge"));this.hierarchical.levels[C.id]=n+o};this._crawlNetwork(t),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;let g=So(e=this.body.nodeIndices).call(e,(t,A)=>(t.set(A,this.body.nodes[A]),t),new NA);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=BM(g):this.hierarchical.levels=FM(g),this.hierarchical.setMinLevelToZero()}_generateMap(){let e=(g,t)=>{this.hierarchical.levels[t.id]>this.hierarchical.levels[g.id]&&this.hierarchical.addRelation(g.id,t.id)};this._crawlNetwork(e),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},g=arguments.length>1?arguments[1]:void 0,t={},A=(C,i)=>{if(t[C.id]===void 0){this.hierarchical.setTreeIndex(C,i),t[C.id]=!0;let n,o=this._getActiveEdges(C);for(let s=0;s<o.length;s++){let r=o[s];r.connected===!0&&(r.toId==C.id?n=r.from:n=r.to,C.id!=n.id&&(e(C,n,r),A(n,i)))}}};if(g===void 0){let C=0;for(let i=0;i<this.body.nodeIndices.length;i++){let n=this.body.nodeIndices[i];if(t[n]===void 0){let o=this.body.nodes[n];A(o,C),C+=1}}}else{let C=this.body.nodes[g];if(C===void 0){console.error("Node not found:",g);return}A(C)}}_shiftBlock(e,g){let t={},A=C=>{if(t[C])return;t[C]=!0,this.direction.shift(C,g);let i=this.hierarchical.childrenReference[C];if(i!==void 0)for(let n=0;n<i.length;n++)A(i[n])};A(e)}_findCommonParent(e,g){let t={},A=(i,n)=>{let o=this.hierarchical.parentReference[n];if(o!==void 0)for(let s=0;s<o.length;s++){let r=o[s];i[r]=!0,A(i,r)}},C=(i,n)=>{let o=this.hierarchical.parentReference[n];if(o!==void 0)for(let s=0;s<o.length;s++){let r=o[s];if(i[r]!==void 0)return{foundParent:r,withChild:n};let a=C(i,r);if(a.foundParent!==null)return a}return{foundParent:null,withChild:n}};return A(t,e),C(t,g)}setDirectionStrategy(){this.options.hierarchical.direction==="UD"||this.options.hierarchical.direction==="DU"?this.direction=new Vn(this):this.direction=new jn(this)}_getCenterPosition(e){let g=1e9,t=-1e9;for(let A=0;A<e.length;A++){let C;if(e[A].id!==void 0)C=e[A];else{let n=e[A];C=this.body.nodes[n]}let i=this.direction.getPosition(C);g=Math.min(g,i),t=Math.max(t,i)}return .5*(g+t)}},zM=`div.vis-network div.vis-manipulation {
715
715
  box-sizing: content-box;
716
716
 
717
717
  border-width: 0;
@@ -905,7 +905,14 @@ div.network-navigation_wrapper {
905
905
  height: 100%;
906
906
  }
907
907
  */
908
- `;_e(MM);var jn=class{constructor(g,e,t,A){var C,i;this.body=g,this.canvas=e,this.selectionHandler=t,this.interactionHandler=A,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}},q(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",b(C=this._restore).call(C,this)),this.body.emitter.on("_resetData",b(i=this._restore).call(i,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(g,e,t){e!==void 0&&(e.locale!==void 0?this.options.locale=e.locale:this.options.locale=t.locale,e.locales!==void 0?this.options.locales=e.locales:this.options.locales=t.locales),g!==void 0&&(typeof g=="boolean"?this.options.enabled=g:(this.options.enabled=!0,_(this.options,g)),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 g,e;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";let t=this.selectionHandler.getSelectedNodeCount(),A=this.selectionHandler.getSelectedEdgeCount(),C=t+A,i=this.options.locales[this.options.locale],n=!1;this.options.addNode!==!1&&(this._createAddNodeButton(i),n=!0),this.options.addEdge!==!1&&(n===!0?this._createSeperator(1):n=!0,this._createAddEdgeButton(i)),t===1&&typeof this.options.editNode=="function"?(n===!0?this._createSeperator(2):n=!0,this._createEditNodeButton(i)):A===1&&t===0&&this.options.editEdge!==!1&&(n===!0?this._createSeperator(3):n=!0,this._createEditEdgeButton(i)),C!==0&&(t>0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(i)):t===0&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(i))),this._bindElementEvents(this.closeDiv,b(g=this.toggleEditMode).call(g,this)),this._temporaryBindEvent("select",b(e=this.showManipulatorToolbar).call(e,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var g;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var e;let t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,b(e=this.toggleEditMode).call(e,this))}this._temporaryBindEvent("click",b(g=this._performAddNode).call(g,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();let g=this.selectionHandler.getSelectedNodes()[0];if(g!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(g.isCluster!==!0){let e=_({},g.options,!1);if(e.x=g.x,e.y=g.y,this.options.editNode.length===2)this.options.editNode(e,t=>{t!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(t),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 g,e,t,A,C;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var i;let n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,b(i=this.toggleEditMode).call(i,this))}this._temporaryBindUI("onTouch",b(g=this._handleConnect).call(g,this)),this._temporaryBindUI("onDragEnd",b(e=this._finishConnect).call(e,this)),this._temporaryBindUI("onDrag",b(t=this._dragControlNode).call(t,this)),this._temporaryBindUI("onRelease",b(A=this._finishConnect).call(A,this)),this._temporaryBindUI("onDragStart",b(C=this._dragStartEdge).call(C,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)){let i=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(i.from.id,i.to.id);return}if(this.guiEnabled===!0){var g;let i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,b(g=this.toggleEditMode).call(g,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var e,t,A,C;let i=this.body.edges[this.edgeBeingEditedId],n=this._getNewTargetNode(i.from.x,i.from.y),o=this._getNewTargetNode(i.to.x,i.to.y);this.temporaryIds.nodes.push(n.id),this.temporaryIds.nodes.push(o.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id),this._temporaryBindUI("onTouch",b(e=this._controlNodeTouch).call(e,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",b(t=this._controlNodeDragStart).call(t,this)),this._temporaryBindUI("onDrag",b(A=this._controlNodeDrag).call(A,this)),this._temporaryBindUI("onDragEnd",b(C=this._controlNodeDragEnd).call(C,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",s=>{let r=i.edgeType.findBorderPositions(s);n.selected===!1&&(n.x=r.from.x,n.y=r.from.y),o.selected===!1&&(o.x=r.to.x,o.y=r.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";let g=this.selectionHandler.getSelectedNodeIds(),e=this.selectionHandler.getSelectedEdgeIds(),t;if(g.length>0){for(let A=0;A<g.length;A++)if(this.body.nodes[g[A]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(t=this.options.deleteNode)}else e.length>0&&typeof this.options.deleteEdge=="function"&&(t=this.options.deleteEdge);if(typeof t=="function"){let A={nodes:g,edges:e};if(t.length===2)t(A,C=>{C!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(C.edges),this.body.data.nodes.getDataSet().remove(C.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(e),this.body.data.nodes.getDataSet().remove(g),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 g,e;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(g=(e=this.options.locales[this.options.locale])===null||e===void 0?void 0:e.close)!==null&&g!==void 0?g:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}_getNewTargetNode(g,e){let t=_({},this.options.controlNodeStyle);t.id="targetNode"+st(),t.hidden=!1,t.physics=!1,t.x=g,t.y=e;let A=this.body.functions.createNode(t);return A.shape.boundingBox={left:g,right:g,top:e,bottom:e},A}_createEditButton(){var g;this._clean(),this.manipulationDOM={},ue(this.editModeDiv);let e=this.options.locales[this.options.locale],t=this._createButton("editMode","vis-edit vis-edit-mode",e.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(t),this._bindElementEvents(t,b(g=this.toggleEditMode).call(g,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(ue(this.editModeDiv),ue(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(let e of Ug(g=this._domEventListenerCleanupQueue).call(g,0)){var g;e()}}_removeManipulationDOM(){this._clean(),ue(this.manipulationDiv),ue(this.editModeDiv),ue(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 g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+g]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+g].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+g])}_createAddNodeButton(g){var e;let t=this._createButton("addNode","vis-add",g.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(e=this.addNodeMode).call(e,this))}_createAddEdgeButton(g){var e;let t=this._createButton("addEdge","vis-connect",g.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(e=this.addEdgeMode).call(e,this))}_createEditNodeButton(g){var e;let t=this._createButton("editNode","vis-edit",g.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(e=this.editNode).call(e,this))}_createEditEdgeButton(g){var e;let t=this._createButton("editEdge","vis-edit",g.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(e=this.editEdgeMode).call(e,this))}_createDeleteButton(g){var e;let t;this.options.rtl?t="vis-delete-rtl":t="vis-delete";let A=this._createButton("delete",t,g.del||this.options.locales.en.del);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,b(e=this.deleteSelected).call(e,this))}_createBackButton(g){var e;let t=this._createButton("back","vis-back",g.back||this.options.locales.en.back);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(e=this.showManipulatorToolbar).call(e,this))}_createButton(g,e,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[g+"Div"]=document.createElement("button"),this.manipulationDOM[g+"Div"].className="vis-button "+e,this.manipulationDOM[g+"Label"]=document.createElement("div"),this.manipulationDOM[g+"Label"].className=A,this.manipulationDOM[g+"Label"].innerText=t,this.manipulationDOM[g+"Div"].appendChild(this.manipulationDOM[g+"Label"]),this.manipulationDOM[g+"Div"]}_createDescription(g){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=g,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(g,e){this.temporaryEventFunctions.push({event:g,boundFunction:e}),this.body.emitter.on(g,e)}_temporaryBindUI(g,e){if(this.body.eventListeners[g]!==void 0)this.temporaryUIFunctions[g]=this.body.eventListeners[g],this.body.eventListeners[g]=e;else throw new Error("This UI function does not exist. Typo? You tried: "+g+" possible are: "+Et(U(this.body.eventListeners)))}_unbindTemporaryUIs(){for(let g in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,g)&&(this.body.eventListeners[g]=this.temporaryUIFunctions[g],delete this.temporaryUIFunctions[g]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let g=0;g<this.temporaryEventFunctions.length;g++){let e=this.temporaryEventFunctions[g].event,t=this.temporaryEventFunctions[g].boundFunction;this.body.emitter.off(e,t)}this.temporaryEventFunctions=[]}_bindElementEvents(g,e){let t=new ot(g,{});ZI(t,e),this._domEventListenerCleanupQueue.push(()=>{t.destroy()});let A=C=>{let{keyCode:i,key:n}=C;(n==="Enter"||n===" "||i===13||i===32)&&e()};g.addEventListener("keyup",A,!1),this._domEventListenerCleanupQueue.push(()=>{g.removeEventListener("keyup",A,!1)})}_cleanupTemporaryNodesAndEdges(){for(let C=0;C<this.temporaryIds.edges.length;C++){var g;this.body.edges[this.temporaryIds.edges[C]].disconnect(),delete this.body.edges[this.temporaryIds.edges[C]];let i=G(g=this.body.edgeIndices).call(g,this.temporaryIds.edges[C]);if(i!==-1){var e;Ug(e=this.body.edgeIndices).call(e,i,1)}}for(let C=0;C<this.temporaryIds.nodes.length;C++){var t;delete this.body.nodes[this.temporaryIds.nodes[C]];let i=G(t=this.body.nodeIndices).call(t,this.temporaryIds.nodes[C]);if(i!==-1){var A;Ug(A=this.body.nodeIndices).call(A,i,1)}}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(g){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(g.center),this.lastTouch.translation=q({},this.body.view.translation)}_controlNodeDragStart(){let g=this.lastTouch,e=this.selectionHandler._pointerToPositionObject(g),t=this.body.nodes[this.temporaryIds.nodes[0]],A=this.body.nodes[this.temporaryIds.nodes[1]],C=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;let i=t.isOverlappingWith(e),n=A.isOverlappingWith(e);i===!0?(this.selectedControlNode=t,C.edgeType.from=t):n===!0&&(this.selectedControlNode=A,C.edgeType.to=A),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}_controlNodeDrag(g){this.body.emitter.emit("disablePhysics");let e=this.body.functions.getPointer(g.center),t=this.canvas.DOMtoCanvas(e);this.selectedControlNode!==void 0?(this.selectedControlNode.x=t.x,this.selectedControlNode.y=t.y):this.interactionHandler.onDrag(g),this.body.emitter.emit("_redraw")}_controlNodeDragEnd(g){let e=this.body.functions.getPointer(g.center),t=this.selectionHandler._pointerToPositionObject(e),A=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let n=C.length-1;n>=0;n--)if(C[n]!==this.selectedControlNode.id){i=this.body.nodes[C[n]];break}if(i!==void 0&&this.selectedControlNode!==void 0)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let n=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===n.id?this._performEditEdge(i.id,A.to.id):this._performEditEdge(A.from.id,i.id)}else A.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(g){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(g.center),this.lastTouch.translation=q({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;let e=this.lastTouch,t=this.selectionHandler.getNodeAt(e);if(t!==void 0)if(t.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let A=this._getNewTargetNode(t.x,t.y);this.body.nodes[A.id]=A,this.body.nodeIndices.push(A.id);let C=this.body.functions.createEdge({id:"connectionEdge"+st(),from:t.id,to:A.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[C.id]=C,this.body.edgeIndices.push(C.id),this.temporaryIds.nodes.push(A.id),this.temporaryIds.edges.push(C.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(g){let e=this.body.functions.getPointer(g.center),t=this.selectionHandler._pointerToPositionObject(e),A;this.temporaryIds.edges[0]!==void 0&&(A=this.body.edges[this.temporaryIds.edges[0]].fromId);let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let o=C.length-1;o>=0;o--){var n;if(G(n=this.temporaryIds.nodes).call(n,C[o])===-1){i=this.body.nodes[C[o]];break}}if(g.controlEdge={from:A,to:i?i.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",g,e),this.temporaryIds.nodes[0]!==void 0){let o=this.body.nodes[this.temporaryIds.nodes[0]];o.x=this.canvas._XconvertDOMtoCanvas(e.x),o.y=this.canvas._YconvertDOMtoCanvas(e.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(g)}_finishConnect(g){let e=this.body.functions.getPointer(g.center),t=this.selectionHandler._pointerToPositionObject(e),A;this.temporaryIds.edges[0]!==void 0&&(A=this.body.edges[this.temporaryIds.edges[0]].fromId);let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let o=C.length-1;o>=0;o--){var n;if(G(n=this.temporaryIds.nodes).call(n,C[o])===-1){i=this.body.nodes[C[o]];break}}this._cleanupTemporaryNodesAndEdges(),i!==void 0&&(i.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[A]!==void 0&&this.body.nodes[i.id]!==void 0&&this._performAddEdge(A,i.id)),g.controlEdge={from:A,to:i?i.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",g,e),this.body.emitter.emit("_redraw")}_dragStartEdge(g){let e=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",g,e,void 0,!0)}_performAddNode(g){let e={id:st(),x:g.pointer.canvas.x,y:g.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(e,t=>{t!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(t),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(e),this.showManipulatorToolbar()}_performAddEdge(g,e){let t={from:g,to:e};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(t,A=>{A!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(A),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(t),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(g,e){let t={id:this.edgeBeingEditedId,from:g,to:e,label:this.body.data.edges.get(this.edgeBeingEditedId).label},A=this.options.editEdge;if(typeof A=="object"&&(A=A.editWithoutDrag),typeof A=="function")if(A.length===2)A(t,C=>{C==null||this.inMode!=="editEdge"?(this.body.edges[t.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(C),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(t),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},y="string",v="boolean",f="number",zt="array",x="object",zh="dom",FM="any",li=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],hi={borderWidth:{number:f},borderWidthSelected:{number:f,undefined:"undefined"},brokenImage:{string:y,undefined:"undefined"},chosen:{label:{boolean:v,function:"function"},node:{boolean:v,function:"function"},__type__:{object:x,boolean:v}},color:{border:{string:y},background:{string:y},highlight:{border:{string:y},background:{string:y},__type__:{object:x,string:y}},hover:{border:{string:y},background:{string:y},__type__:{object:x,string:y}},__type__:{object:x,string:y}},opacity:{number:f,undefined:"undefined"},fixed:{x:{boolean:v},y:{boolean:v},__type__:{object:x,boolean:v}},font:{align:{string:y},color:{string:y},size:{number:f},face:{string:y},background:{string:y},strokeWidth:{number:f},strokeColor:{string:y},vadjust:{number:f},multi:{boolean:v,string:y},bold:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},boldital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},ital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},mono:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},__type__:{object:x,string:y}},group:{string:y,number:f,undefined:"undefined"},heightConstraint:{minimum:{number:f},valign:{string:y},__type__:{object:x,boolean:v,number:f}},hidden:{boolean:v},icon:{face:{string:y},code:{string:y},size:{number:f},color:{string:y},weight:{string:y,number:f},__type__:{object:x}},id:{string:y,number:f},image:{selected:{string:y,undefined:"undefined"},unselected:{string:y,undefined:"undefined"},__type__:{object:x,string:y}},imagePadding:{top:{number:f},right:{number:f},bottom:{number:f},left:{number:f},__type__:{object:x,number:f}},label:{string:y,undefined:"undefined"},labelHighlightBold:{boolean:v},level:{number:f,undefined:"undefined"},margin:{top:{number:f},right:{number:f},bottom:{number:f},left:{number:f},__type__:{object:x,number:f}},mass:{number:f},physics:{boolean:v},scaling:{min:{number:f},max:{number:f},label:{enabled:{boolean:v},min:{number:f},max:{number:f},maxVisible:{number:f},drawThreshold:{number:f},__type__:{object:x,boolean:v}},customScalingFunction:{function:"function"},__type__:{object:x}},shadow:{enabled:{boolean:v},color:{string:y},size:{number:f},x:{number:f},y:{number:f},__type__:{object:x,boolean:v}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:v,array:zt},borderRadius:{number:f},interpolation:{boolean:v},useImageSize:{boolean:v},useBorderWithImage:{boolean:v},coordinateOrigin:{string:["center","top-left"]},__type__:{object:x}},size:{number:f},title:{string:y,dom:zh,undefined:"undefined"},value:{number:f,undefined:"undefined"},widthConstraint:{minimum:{number:f},maximum:{number:f},__type__:{object:x,boolean:v,number:f}},x:{number:f},y:{number:f},__type__:{object:x}},BM={configure:{enabled:{boolean:v},filter:{boolean:v,string:y,array:zt,function:"function"},container:{dom:zh},showButton:{boolean:v},__type__:{object:x,boolean:v,string:y,array:zt,function:"function"}},edges:{arrows:{to:{enabled:{boolean:v},scaleFactor:{number:f},type:{string:li},imageHeight:{number:f},imageWidth:{number:f},src:{string:y},__type__:{object:x,boolean:v}},middle:{enabled:{boolean:v},scaleFactor:{number:f},type:{string:li},imageWidth:{number:f},imageHeight:{number:f},src:{string:y},__type__:{object:x,boolean:v}},from:{enabled:{boolean:v},scaleFactor:{number:f},type:{string:li},imageWidth:{number:f},imageHeight:{number:f},src:{string:y},__type__:{object:x,boolean:v}},__type__:{string:["from","to","middle"],object:x}},endPointOffset:{from:{number:f},to:{number:f},__type__:{object:x,number:f}},arrowStrikethrough:{boolean:v},background:{enabled:{boolean:v},color:{string:y},size:{number:f},dashes:{boolean:v,array:zt},__type__:{object:x,boolean:v}},chosen:{label:{boolean:v,function:"function"},edge:{boolean:v,function:"function"},__type__:{object:x,boolean:v}},color:{color:{string:y},highlight:{string:y},hover:{string:y},inherit:{string:["from","to","both"],boolean:v},opacity:{number:f},__type__:{object:x,string:y}},dashes:{boolean:v,array:zt},font:{color:{string:y},size:{number:f},face:{string:y},background:{string:y},strokeWidth:{number:f},strokeColor:{string:y},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:f},multi:{boolean:v,string:y},bold:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},boldital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},ital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},mono:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},__type__:{object:x,string:y}},hidden:{boolean:v},hoverWidth:{function:"function",number:f},label:{string:y,undefined:"undefined"},labelHighlightBold:{boolean:v},length:{number:f,undefined:"undefined"},physics:{boolean:v},scaling:{min:{number:f},max:{number:f},label:{enabled:{boolean:v},min:{number:f},max:{number:f},maxVisible:{number:f},drawThreshold:{number:f},__type__:{object:x,boolean:v}},customScalingFunction:{function:"function"},__type__:{object:x}},selectionWidth:{function:"function",number:f},selfReferenceSize:{number:f},selfReference:{size:{number:f},angle:{number:f},renderBehindTheNode:{boolean:v},__type__:{object:x}},shadow:{enabled:{boolean:v},color:{string:y},size:{number:f},x:{number:f},y:{number:f},__type__:{object:x,boolean:v}},smooth:{enabled:{boolean:v},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:f},forceDirection:{string:["horizontal","vertical","none"],boolean:v},__type__:{object:x,boolean:v}},title:{string:y,undefined:"undefined"},width:{number:f},widthConstraint:{maximum:{number:f},__type__:{object:x,boolean:v,number:f}},value:{number:f,undefined:"undefined"},__type__:{object:x}},groups:{useDefaultGroups:{boolean:v},__any__:hi,__type__:{object:x}},interaction:{dragNodes:{boolean:v},dragView:{boolean:v},hideEdgesOnDrag:{boolean:v},hideEdgesOnZoom:{boolean:v},hideNodesOnDrag:{boolean:v},hover:{boolean:v},keyboard:{enabled:{boolean:v},speed:{x:{number:f},y:{number:f},zoom:{number:f},__type__:{object:x}},bindToWindow:{boolean:v},autoFocus:{boolean:v},__type__:{object:x,boolean:v}},multiselect:{boolean:v},navigationButtons:{boolean:v},selectable:{boolean:v},selectConnectedEdges:{boolean:v},hoverConnectedEdges:{boolean:v},tooltipDelay:{number:f},zoomView:{boolean:v},zoomSpeed:{number:f},__type__:{object:x}},layout:{randomSeed:{undefined:"undefined",number:f,string:y},improvedLayout:{boolean:v},clusterThreshold:{number:f},hierarchical:{enabled:{boolean:v},levelSeparation:{number:f},nodeSpacing:{number:f},treeSpacing:{number:f},blockShifting:{boolean:v},edgeMinimization:{boolean:v},parentCentralization:{boolean:v},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:x,boolean:v}},__type__:{object:x}},manipulation:{enabled:{boolean:v},initiallyActive:{boolean:v},addNode:{boolean:v,function:"function"},addEdge:{boolean:v,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:x,boolean:v,function:"function"}},deleteNode:{boolean:v,function:"function"},deleteEdge:{boolean:v,function:"function"},controlNodeStyle:hi,__type__:{object:x,boolean:v}},nodes:hi,physics:{enabled:{boolean:v},barnesHut:{theta:{number:f},gravitationalConstant:{number:f},centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},damping:{number:f},avoidOverlap:{number:f},__type__:{object:x}},forceAtlas2Based:{theta:{number:f},gravitationalConstant:{number:f},centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},damping:{number:f},avoidOverlap:{number:f},__type__:{object:x}},repulsion:{centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},nodeDistance:{number:f},damping:{number:f},__type__:{object:x}},hierarchicalRepulsion:{centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},nodeDistance:{number:f},damping:{number:f},avoidOverlap:{number:f},__type__:{object:x}},maxVelocity:{number:f},minVelocity:{number:f},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:v},iterations:{number:f},updateInterval:{number:f},onlyDynamicEdges:{boolean:v},fit:{boolean:v},__type__:{object:x,boolean:v}},timestep:{number:f},adaptiveTimestep:{boolean:v},wind:{x:{number:f},y:{number:f},__type__:{object:x}},__type__:{object:x,boolean:v}},autoResize:{boolean:v},clickToUse:{boolean:v},locale:{string:y},locales:{__any__:{any:FM},__type__:{object:x}},height:{string:y},width:{string:y},__type__:{object:x}},Zh={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]}}},zM=(I,g,e)=>{var t;return!!(ye(I).call(I,"physics")&&ye(t=Zh.physics.solver).call(t,g)&&e.physics.solver!==g&&g!=="wind")};var Wn=class{constructor(){}getDistances(g,e,t){let A={},C=g.edges;for(let n=0;n<e.length;n++){let o=e[n],s={};A[o]=s;for(let r=0;r<e.length;r++)s[e[r]]=n==r?0:1e9}for(let n=0;n<t.length;n++){let o=C[t[n]];o.connected===!0&&A[o.fromId]!==void 0&&A[o.toId]!==void 0&&(A[o.fromId][o.toId]=1,A[o.toId][o.fromId]=1)}let i=e.length;for(let n=0;n<i;n++){let o=e[n],s=A[o];for(let r=0;r<i-1;r++){let a=e[r],d=A[a];for(let l=r+1;l<i;l++){let h=e[l],c=A[h],p=Math.min(d[h],d[o]+s[h]);d[h]=p,c[a]=p}}}return A}},Yn=class{constructor(g,e,t){this.body=g,this.springLength=e,this.springConstant=t,this.distanceSolver=new Wn}setOptions(g){g&&(g.springLength&&(this.springLength=g.springLength),g.springConstant&&(this.springConstant=g.springConstant))}solve(g,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=this.distanceSolver.getDistances(this.body,g,e);this._createL_matrix(A),this._createK_matrix(A),this._createE_matrix();let C=.01,i=1,n=0,o=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),s=5,r=1e9,a=0,d=0,l=0,h=0,c=0;for(;r>C&&n<o;)for(n+=1,[a,r,d,l]=this._getHighestEnergyNode(t),h=r,c=0;h>i&&c<s;)c+=1,this._moveNode(a,d,l),[h,d,l]=this._getEnergy(a)}_getHighestEnergyNode(g){let e=this.body.nodeIndices,t=this.body.nodes,A=0,C=e[0],i=0,n=0;for(let o=0;o<e.length;o++){let s=e[o];if(t[s].predefinedPosition!==!0||t[s].isCluster===!0&&g===!0||t[s].options.fixed.x!==!0||t[s].options.fixed.y!==!0){let[r,a,d]=this._getEnergy(s);A<r&&(A=r,C=s,i=a,n=d)}}return[C,A,i,n]}_getEnergy(g){let[e,t]=this.E_sums[g];return[Math.sqrt(e**2+t**2),e,t]}_moveNode(g,e,t){let A=this.body.nodeIndices,C=this.body.nodes,i=0,n=0,o=0,s=C[g].x,r=C[g].y,a=this.K_matrix[g],d=this.L_matrix[g];for(let w=0;w<A.length;w++){let O=A[w];if(O!==g){let M=C[O].x,k=C[O].y,V=a[O],yg=d[O],ug=1/((s-M)**2+(r-k)**2)**1.5;i+=V*(1-yg*(r-k)**2*ug),n+=V*(yg*(s-M)*(r-k)*ug),o+=V*(1-yg*(s-M)**2*ug)}}let l=i,h=n,c=e,p=o,u=t,m=(c/l+u/h)/(h/l-p/h),E=-(h*m+c)/l;C[g].x+=E,C[g].y+=m,this._updateE_matrix(g)}_createL_matrix(g){let e=this.body.nodeIndices,t=this.springLength;this.L_matrix=[];for(let A=0;A<e.length;A++){this.L_matrix[e[A]]={};for(let C=0;C<e.length;C++)this.L_matrix[e[A]][e[C]]=t*g[e[A]][e[C]]}}_createK_matrix(g){let e=this.body.nodeIndices,t=this.springConstant;this.K_matrix=[];for(let A=0;A<e.length;A++){this.K_matrix[e[A]]={};for(let C=0;C<e.length;C++)this.K_matrix[e[A]][e[C]]=t*g[e[A]][e[C]]**-2}}_createE_matrix(){let g=this.body.nodeIndices,e=this.body.nodes;this.E_matrix={},this.E_sums={};for(let t=0;t<g.length;t++)this.E_matrix[g[t]]=[];for(let t=0;t<g.length;t++){let A=g[t],C=e[A].x,i=e[A].y,n=0,o=0;for(let s=t;s<g.length;s++){let r=g[s];if(r!==A){let a=e[r].x,d=e[r].y,l=1/Math.sqrt((C-a)**2+(i-d)**2);this.E_matrix[A][s]=[this.K_matrix[A][r]*(C-a-this.L_matrix[A][r]*(C-a)*l),this.K_matrix[A][r]*(i-d-this.L_matrix[A][r]*(i-d)*l)],this.E_matrix[r][t]=this.E_matrix[A][s],n+=this.E_matrix[A][s][0],o+=this.E_matrix[A][s][1]}}this.E_sums[A]=[n,o]}}_updateE_matrix(g){let e=this.body.nodeIndices,t=this.body.nodes,A=this.E_matrix[g],C=this.K_matrix[g],i=this.L_matrix[g],n=t[g].x,o=t[g].y,s=0,r=0;for(let a=0;a<e.length;a++){let d=e[a];if(d!==g){let l=A[a],h=l[0],c=l[1],p=t[d].x,u=t[d].y,m=1/Math.sqrt((n-p)**2+(o-u)**2),E=C[d]*(n-p-i[d]*(n-p)*m),w=C[d]*(o-u-i[d]*(o-u)*m);A[a]=[E,w],s+=E,r+=w;let O=this.E_sums[d];O[0]+=E-h,O[1]+=w-c}}this.E_sums[g]=[s,r]}};function T(I,g,e){var t,A,C,i;if(!(this instanceof T))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:b1,clickToUse:!1},q(this.options,this.defaultOptions),this.body={container:I,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:b(t=this.on).call(t,this),off:b(A=this.off).call(A,this),emit:b(C=this.emit).call(C,this),once:b(i=this.once).call(i,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 ji(()=>this.body.emitter.emit("_requestRedraw")),this.groups=new Wi,this.canvas=new Nn(this.body),this.selectionHandler=new zn(this.body,this.canvas),this.interactionHandler=new Mn(this.body,this.canvas,this.selectionHandler),this.view=new Sn(this.body,this.canvas),this.renderer=new Rn(this.body,this.canvas),this.physics=new On(this.body),this.layoutEngine=new Vn(this.body),this.clustering=new Dn(this.body),this.manipulation=new jn(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new on(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new bn(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new Yn(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(e),this.setData(g)}$a(T.prototype);T.prototype.setOptions=function(I){if(I===null&&(I=void 0),I!==void 0){if($O.validate(I,BM)===!0&&console.error("%cErrors have been found in the supplied options object.",Gl),xt(["locale","locales","clickToUse"],this.options,I),I.locale!==void 0&&(I.locale=y1(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 XO(this,this.body.container,Zh,this.canvas.pixelRatio,zM)),this.configurator.setOptions(I.configure)),this.configurator&&this.configurator.options.enabled===!0){let t={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};_(t.nodes,this.nodesHandler.options),_(t.edges,this.edgesHandler.options),_(t.layout,this.layoutEngine.options),_(t.interaction,this.selectionHandler.options),_(t.interaction,this.renderer.options),_(t.interaction,this.interactionHandler.options),_(t.manipulation,this.manipulation.options),_(t.physics,this.physics.options),_(t.global,this.canvas.options),_(t.global,this.options),this.configurator.setModuleOptions(t)}I.clickToUse!==void 0?I.clickToUse===!0?this.activator===void 0&&(this.activator=new QO(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")}};T.prototype._updateVisibleIndices=function(){let I=this.body.nodes,g=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(let e in I)Object.prototype.hasOwnProperty.call(I,e)&&!this.clustering._isClusteredNode(e)&&I[e].options.hidden===!1&&this.body.nodeIndices.push(I[e].id);for(let e in g)if(Object.prototype.hasOwnProperty.call(g,e)){let t=g[e],A=I[t.fromId],C=I[t.toId],i=A!==void 0&&C!==void 0;!this.clustering._isClusteredEdge(e)&&t.options.hidden===!1&&i&&A.options.hidden===!1&&C.options.hidden===!1&&this.body.edgeIndices.push(t.id)}};T.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")})};T.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);");let g=o1(I.dot);this.setData(g);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);");let g=s1(I.gephi);this.setData(g);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")};T.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(let I in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,I)&&delete this.body.nodes[I];for(let I in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,I)&&delete this.body.edges[I];ue(this.body.container)};T.prototype._updateValueRange=function(I){let g,e,t,A=0;for(g in I)if(Object.prototype.hasOwnProperty.call(I,g)){let C=I[g].getValue();C!==void 0&&(e=e===void 0?C:Math.min(C,e),t=t===void 0?C:Math.max(C,t),A+=C)}if(e!==void 0&&t!==void 0)for(g in I)Object.prototype.hasOwnProperty.call(I,g)&&I[g].setValueRange(e,t,A)};T.prototype.isActive=function(){return!this.activator||this.activator.active};T.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)};T.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)};T.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)};T.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)};T.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)};T.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)};T.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)};T.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)};T.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)};T.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)};T.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)};T.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)};T.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)};T.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)};T.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)};T.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)};T.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)};T.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)};T.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)};T.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)};T.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)};T.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)};T.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)};T.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)};T.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)};T.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)};T.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)};T.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)};T.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)};T.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)};T.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)};T.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)};T.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)};T.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)};T.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)};T.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)};T.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)};T.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)};T.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)};T.prototype.getNodeAt=function(){let I=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return I!==void 0&&I.id!==void 0?I.id:I};T.prototype.getEdgeAt=function(){let I=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return I!==void 0&&I.id!==void 0?I.id:I};T.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)};T.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)};T.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()};T.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)};T.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)};T.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)};T.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)};T.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)};T.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)};T.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)};T.prototype.getOptionsFromConfigurator=function(){let I={};return this.configurator&&(I=this.configurator.getOptions.apply(this.configurator)),I};function ZM(){return{Network:T,DataSet:Pe}}var So=class{constructor(g){this.yasr=g,this.network=null}static get priority(){return 20}static get label(){return"Graph"}canHandleResults(){if(!this.yasr||!this.yasr.results)return!1;let g=this.yasr.results;if(g.getBindings&&typeof g.getBindings=="function"){let e=g.getBindings();if(e&&e.length>0){let t=e[0];return t.subject!==void 0&&t.predicate!==void 0&&t.object!==void 0}}return!1}draw(){this.yasr.resultsEl.innerHTML="";try{let g=Bo(this.yasr.results);if(!g||g.length===0){this.yasr.resultsEl.innerHTML='<div style="padding: 20px; text-align: center; color: #666;">No graph data to visualize</div>';return}let e=Mo(this.yasr),{nodes:t,edges:A}=zo(g,e),C=document.createElement("div");C.style.width="100%",C.style.height="600px",C.style.position="relative",C.style.overflow="hidden",this.yasr.resultsEl.appendChild(C);let{Network:i,DataSet:n}=ZM(),o=new n(t),s=new n(A),r=Fo();this.network=new i(C,{nodes:o,edges:s},r),this.networkReady=!1,this.network.on("stabilizationIterationsDone",()=>{this.network.setOptions({physics:{enabled:!0}}),this.networkReady=!0});let a=document.createElement("div");a.style.position="absolute",a.style.top="10px",a.style.right="10px",a.style.zIndex="10000",a.style.display="flex",a.style.gap="10px",a.style.pointerEvents="auto",C.appendChild(a);let d=document.createElement("button");d.textContent="Zoom to Fit",d.style.padding="8px 12px",d.style.background="#4CAF50",d.style.color="white",d.style.border="none",d.style.borderRadius="4px",d.style.cursor="pointer",d.style.fontSize="14px",d.style.boxShadow="0 2px 4px rgba(0,0,0,0.2)",d.onmouseover=()=>d.style.background="#45a049",d.onmouseout=()=>d.style.background="#4CAF50",d.onclick=()=>{this.network&&this.network.fit({animation:{duration:300,easingFunction:"easeInOutQuad"}})},a.appendChild(d),g.length>1e3&&console.warn("Large graph detected (>1000 triples). Rendering may be slow.")}catch(g){console.error("Error rendering graph:",g),this.yasr.resultsEl.innerHTML='<div style="padding: 20px; color: red;">Error rendering graph. See console for details.</div>'}}getIcon(){let g=document.createElement("span");return g.className="fas fa-project-diagram",g.setAttribute("aria-label","Graph visualization"),g}},ko=So;typeof window!="undefined"&&window.Yasgui&&window.Yasgui.Yasr&&window.Yasgui.Yasr.registerPlugin("Graph",ko);var LM=ko;return _h(GM);})();
908
+ `;_g(zM);var _n=class{constructor(e,g,t,A){var C,i;this.body=e,this.canvas=g,this.selectionHandler=t,this.interactionHandler=A,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}},q(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",b(C=this._restore).call(C,this)),this.body.emitter.on("_resetData",b(i=this._restore).call(i,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,g,t){g!==void 0&&(g.locale!==void 0?this.options.locale=g.locale:this.options.locale=t.locale,g.locales!==void 0?this.options.locales=g.locales:this.options.locales=t.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,_(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,g;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";let t=this.selectionHandler.getSelectedNodeCount(),A=this.selectionHandler.getSelectedEdgeCount(),C=t+A,i=this.options.locales[this.options.locale],n=!1;this.options.addNode!==!1&&(this._createAddNodeButton(i),n=!0),this.options.addEdge!==!1&&(n===!0?this._createSeperator(1):n=!0,this._createAddEdgeButton(i)),t===1&&typeof this.options.editNode=="function"?(n===!0?this._createSeperator(2):n=!0,this._createEditNodeButton(i)):A===1&&t===0&&this.options.editEdge!==!1&&(n===!0?this._createSeperator(3):n=!0,this._createEditEdgeButton(i)),C!==0&&(t>0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(i)):t===0&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(i))),this._bindElementEvents(this.closeDiv,b(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",b(g=this.showManipulatorToolbar).call(g,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var g;let t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,b(g=this.toggleEditMode).call(g,this))}this._temporaryBindEvent("click",b(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();let e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(e.isCluster!==!0){let g=_({},e.options,!1);if(g.x=e.x,g.y=e.y,this.options.editNode.length===2)this.options.editNode(g,t=>{t!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(t),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,g,t,A,C;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var i;let n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,b(i=this.toggleEditMode).call(i,this))}this._temporaryBindUI("onTouch",b(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",b(g=this._finishConnect).call(g,this)),this._temporaryBindUI("onDrag",b(t=this._dragControlNode).call(t,this)),this._temporaryBindUI("onRelease",b(A=this._finishConnect).call(A,this)),this._temporaryBindUI("onDragStart",b(C=this._dragStartEdge).call(C,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)){let i=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(i.from.id,i.to.id);return}if(this.guiEnabled===!0){var e;let i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,b(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var g,t,A,C;let i=this.body.edges[this.edgeBeingEditedId],n=this._getNewTargetNode(i.from.x,i.from.y),o=this._getNewTargetNode(i.to.x,i.to.y);this.temporaryIds.nodes.push(n.id),this.temporaryIds.nodes.push(o.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id),this._temporaryBindUI("onTouch",b(g=this._controlNodeTouch).call(g,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",b(t=this._controlNodeDragStart).call(t,this)),this._temporaryBindUI("onDrag",b(A=this._controlNodeDrag).call(A,this)),this._temporaryBindUI("onDragEnd",b(C=this._controlNodeDragEnd).call(C,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",s=>{let r=i.edgeType.findBorderPositions(s);n.selected===!1&&(n.x=r.from.x,n.y=r.from.y),o.selected===!1&&(o.x=r.to.x,o.y=r.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";let e=this.selectionHandler.getSelectedNodeIds(),g=this.selectionHandler.getSelectedEdgeIds(),t;if(e.length>0){for(let A=0;A<e.length;A++)if(this.body.nodes[e[A]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(t=this.options.deleteNode)}else g.length>0&&typeof this.options.deleteEdge=="function"&&(t=this.options.deleteEdge);if(typeof t=="function"){let A={nodes:e,edges:g};if(t.length===2)t(A,C=>{C!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(C.edges),this.body.data.nodes.getDataSet().remove(C.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(g),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,g;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(g=this.options.locales[this.options.locale])===null||g===void 0?void 0:g.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,g){let t=_({},this.options.controlNodeStyle);t.id="targetNode"+st(),t.hidden=!1,t.physics=!1,t.x=e,t.y=g;let A=this.body.functions.createNode(t);return A.shape.boundingBox={left:e,right:e,top:g,bottom:g},A}_createEditButton(){var e;this._clean(),this.manipulationDOM={},ug(this.editModeDiv);let g=this.options.locales[this.options.locale],t=this._createButton("editMode","vis-edit vis-edit-mode",g.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(t),this._bindElementEvents(t,b(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(ug(this.editModeDiv),ug(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(let g of Ue(e=this._domEventListenerCleanupQueue).call(e,0)){var e;g()}}_removeManipulationDOM(){this._clean(),ug(this.manipulationDiv),ug(this.editModeDiv),ug(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 g;let t=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.addNodeMode).call(g,this))}_createAddEdgeButton(e){var g;let t=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.addEdgeMode).call(g,this))}_createEditNodeButton(e){var g;let t=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.editNode).call(g,this))}_createEditEdgeButton(e){var g;let t=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.editEdgeMode).call(g,this))}_createDeleteButton(e){var g;let t;this.options.rtl?t="vis-delete-rtl":t="vis-delete";let A=this._createButton("delete",t,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,b(g=this.deleteSelected).call(g,this))}_createBackButton(e){var g;let t=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.showManipulatorToolbar).call(g,this))}_createButton(e,g,t){let A=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 "+g,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=A,this.manipulationDOM[e+"Label"].innerText=t,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,g){this.temporaryEventFunctions.push({event:e,boundFunction:g}),this.body.emitter.on(e,g)}_temporaryBindUI(e,g){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=g;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+Et(U(this.body.eventListeners)))}_unbindTemporaryUIs(){for(let 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++){let g=this.temporaryEventFunctions[e].event,t=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(g,t)}this.temporaryEventFunctions=[]}_bindElementEvents(e,g){let t=new ot(e,{});ZI(t,g),this._domEventListenerCleanupQueue.push(()=>{t.destroy()});let A=C=>{let{keyCode:i,key:n}=C;(n==="Enter"||n===" "||i===13||i===32)&&g()};e.addEventListener("keyup",A,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener("keyup",A,!1)})}_cleanupTemporaryNodesAndEdges(){for(let C=0;C<this.temporaryIds.edges.length;C++){var e;this.body.edges[this.temporaryIds.edges[C]].disconnect(),delete this.body.edges[this.temporaryIds.edges[C]];let i=G(e=this.body.edgeIndices).call(e,this.temporaryIds.edges[C]);if(i!==-1){var g;Ue(g=this.body.edgeIndices).call(g,i,1)}}for(let C=0;C<this.temporaryIds.nodes.length;C++){var t;delete this.body.nodes[this.temporaryIds.nodes[C]];let i=G(t=this.body.nodeIndices).call(t,this.temporaryIds.nodes[C]);if(i!==-1){var A;Ue(A=this.body.nodeIndices).call(A,i,1)}}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=q({},this.body.view.translation)}_controlNodeDragStart(){let e=this.lastTouch,g=this.selectionHandler._pointerToPositionObject(e),t=this.body.nodes[this.temporaryIds.nodes[0]],A=this.body.nodes[this.temporaryIds.nodes[1]],C=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;let i=t.isOverlappingWith(g),n=A.isOverlappingWith(g);i===!0?(this.selectedControlNode=t,C.edgeType.from=t):n===!0&&(this.selectedControlNode=A,C.edgeType.to=A),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}_controlNodeDrag(e){this.body.emitter.emit("disablePhysics");let g=this.body.functions.getPointer(e.center),t=this.canvas.DOMtoCanvas(g);this.selectedControlNode!==void 0?(this.selectedControlNode.x=t.x,this.selectedControlNode.y=t.y):this.interactionHandler.onDrag(e),this.body.emitter.emit("_redraw")}_controlNodeDragEnd(e){let g=this.body.functions.getPointer(e.center),t=this.selectionHandler._pointerToPositionObject(g),A=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let n=C.length-1;n>=0;n--)if(C[n]!==this.selectedControlNode.id){i=this.body.nodes[C[n]];break}if(i!==void 0&&this.selectedControlNode!==void 0)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let n=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===n.id?this._performEditEdge(i.id,A.to.id):this._performEditEdge(A.from.id,i.id)}else A.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=q({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;let g=this.lastTouch,t=this.selectionHandler.getNodeAt(g);if(t!==void 0)if(t.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let A=this._getNewTargetNode(t.x,t.y);this.body.nodes[A.id]=A,this.body.nodeIndices.push(A.id);let C=this.body.functions.createEdge({id:"connectionEdge"+st(),from:t.id,to:A.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[C.id]=C,this.body.edgeIndices.push(C.id),this.temporaryIds.nodes.push(A.id),this.temporaryIds.edges.push(C.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){let g=this.body.functions.getPointer(e.center),t=this.selectionHandler._pointerToPositionObject(g),A;this.temporaryIds.edges[0]!==void 0&&(A=this.body.edges[this.temporaryIds.edges[0]].fromId);let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let o=C.length-1;o>=0;o--){var n;if(G(n=this.temporaryIds.nodes).call(n,C[o])===-1){i=this.body.nodes[C[o]];break}}if(e.controlEdge={from:A,to:i?i.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,g),this.temporaryIds.nodes[0]!==void 0){let o=this.body.nodes[this.temporaryIds.nodes[0]];o.x=this.canvas._XconvertDOMtoCanvas(g.x),o.y=this.canvas._YconvertDOMtoCanvas(g.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}_finishConnect(e){let g=this.body.functions.getPointer(e.center),t=this.selectionHandler._pointerToPositionObject(g),A;this.temporaryIds.edges[0]!==void 0&&(A=this.body.edges[this.temporaryIds.edges[0]].fromId);let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let o=C.length-1;o>=0;o--){var n;if(G(n=this.temporaryIds.nodes).call(n,C[o])===-1){i=this.body.nodes[C[o]];break}}this._cleanupTemporaryNodesAndEdges(),i!==void 0&&(i.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[A]!==void 0&&this.body.nodes[i.id]!==void 0&&this._performAddEdge(A,i.id)),e.controlEdge={from:A,to:i?i.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,g),this.body.emitter.emit("_redraw")}_dragStartEdge(e){let g=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,g,void 0,!0)}_performAddNode(e){let g={id:st(),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(g,t=>{t!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(t),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(g),this.showManipulatorToolbar()}_performAddEdge(e,g){let t={from:e,to:g};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(t,A=>{A!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(A),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(t),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,g){let t={id:this.edgeBeingEditedId,from:e,to:g,label:this.body.data.edges.get(this.edgeBeingEditedId).label},A=this.options.editEdge;if(typeof A=="object"&&(A=A.editWithoutDrag),typeof A=="function")if(A.length===2)A(t,C=>{C==null||this.inMode!=="editEdge"?(this.body.edges[t.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(C),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(t),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},y="string",v="boolean",f="number",zt="array",x="object",Lh="dom",ZM="any",ui=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],fi={borderWidth:{number:f},borderWidthSelected:{number:f,undefined:"undefined"},brokenImage:{string:y,undefined:"undefined"},chosen:{label:{boolean:v,function:"function"},node:{boolean:v,function:"function"},__type__:{object:x,boolean:v}},color:{border:{string:y},background:{string:y},highlight:{border:{string:y},background:{string:y},__type__:{object:x,string:y}},hover:{border:{string:y},background:{string:y},__type__:{object:x,string:y}},__type__:{object:x,string:y}},opacity:{number:f,undefined:"undefined"},fixed:{x:{boolean:v},y:{boolean:v},__type__:{object:x,boolean:v}},font:{align:{string:y},color:{string:y},size:{number:f},face:{string:y},background:{string:y},strokeWidth:{number:f},strokeColor:{string:y},vadjust:{number:f},multi:{boolean:v,string:y},bold:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},boldital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},ital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},mono:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},__type__:{object:x,string:y}},group:{string:y,number:f,undefined:"undefined"},heightConstraint:{minimum:{number:f},valign:{string:y},__type__:{object:x,boolean:v,number:f}},hidden:{boolean:v},icon:{face:{string:y},code:{string:y},size:{number:f},color:{string:y},weight:{string:y,number:f},__type__:{object:x}},id:{string:y,number:f},image:{selected:{string:y,undefined:"undefined"},unselected:{string:y,undefined:"undefined"},__type__:{object:x,string:y}},imagePadding:{top:{number:f},right:{number:f},bottom:{number:f},left:{number:f},__type__:{object:x,number:f}},label:{string:y,undefined:"undefined"},labelHighlightBold:{boolean:v},level:{number:f,undefined:"undefined"},margin:{top:{number:f},right:{number:f},bottom:{number:f},left:{number:f},__type__:{object:x,number:f}},mass:{number:f},physics:{boolean:v},scaling:{min:{number:f},max:{number:f},label:{enabled:{boolean:v},min:{number:f},max:{number:f},maxVisible:{number:f},drawThreshold:{number:f},__type__:{object:x,boolean:v}},customScalingFunction:{function:"function"},__type__:{object:x}},shadow:{enabled:{boolean:v},color:{string:y},size:{number:f},x:{number:f},y:{number:f},__type__:{object:x,boolean:v}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:v,array:zt},borderRadius:{number:f},interpolation:{boolean:v},useImageSize:{boolean:v},useBorderWithImage:{boolean:v},coordinateOrigin:{string:["center","top-left"]},__type__:{object:x}},size:{number:f},title:{string:y,dom:Lh,undefined:"undefined"},value:{number:f,undefined:"undefined"},widthConstraint:{minimum:{number:f},maximum:{number:f},__type__:{object:x,boolean:v,number:f}},x:{number:f},y:{number:f},__type__:{object:x}},LM={configure:{enabled:{boolean:v},filter:{boolean:v,string:y,array:zt,function:"function"},container:{dom:Lh},showButton:{boolean:v},__type__:{object:x,boolean:v,string:y,array:zt,function:"function"}},edges:{arrows:{to:{enabled:{boolean:v},scaleFactor:{number:f},type:{string:ui},imageHeight:{number:f},imageWidth:{number:f},src:{string:y},__type__:{object:x,boolean:v}},middle:{enabled:{boolean:v},scaleFactor:{number:f},type:{string:ui},imageWidth:{number:f},imageHeight:{number:f},src:{string:y},__type__:{object:x,boolean:v}},from:{enabled:{boolean:v},scaleFactor:{number:f},type:{string:ui},imageWidth:{number:f},imageHeight:{number:f},src:{string:y},__type__:{object:x,boolean:v}},__type__:{string:["from","to","middle"],object:x}},endPointOffset:{from:{number:f},to:{number:f},__type__:{object:x,number:f}},arrowStrikethrough:{boolean:v},background:{enabled:{boolean:v},color:{string:y},size:{number:f},dashes:{boolean:v,array:zt},__type__:{object:x,boolean:v}},chosen:{label:{boolean:v,function:"function"},edge:{boolean:v,function:"function"},__type__:{object:x,boolean:v}},color:{color:{string:y},highlight:{string:y},hover:{string:y},inherit:{string:["from","to","both"],boolean:v},opacity:{number:f},__type__:{object:x,string:y}},dashes:{boolean:v,array:zt},font:{color:{string:y},size:{number:f},face:{string:y},background:{string:y},strokeWidth:{number:f},strokeColor:{string:y},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:f},multi:{boolean:v,string:y},bold:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},boldital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},ital:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},mono:{color:{string:y},size:{number:f},face:{string:y},mod:{string:y},vadjust:{number:f},__type__:{object:x,string:y}},__type__:{object:x,string:y}},hidden:{boolean:v},hoverWidth:{function:"function",number:f},label:{string:y,undefined:"undefined"},labelHighlightBold:{boolean:v},length:{number:f,undefined:"undefined"},physics:{boolean:v},scaling:{min:{number:f},max:{number:f},label:{enabled:{boolean:v},min:{number:f},max:{number:f},maxVisible:{number:f},drawThreshold:{number:f},__type__:{object:x,boolean:v}},customScalingFunction:{function:"function"},__type__:{object:x}},selectionWidth:{function:"function",number:f},selfReferenceSize:{number:f},selfReference:{size:{number:f},angle:{number:f},renderBehindTheNode:{boolean:v},__type__:{object:x}},shadow:{enabled:{boolean:v},color:{string:y},size:{number:f},x:{number:f},y:{number:f},__type__:{object:x,boolean:v}},smooth:{enabled:{boolean:v},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:f},forceDirection:{string:["horizontal","vertical","none"],boolean:v},__type__:{object:x,boolean:v}},title:{string:y,undefined:"undefined"},width:{number:f},widthConstraint:{maximum:{number:f},__type__:{object:x,boolean:v,number:f}},value:{number:f,undefined:"undefined"},__type__:{object:x}},groups:{useDefaultGroups:{boolean:v},__any__:fi,__type__:{object:x}},interaction:{dragNodes:{boolean:v},dragView:{boolean:v},hideEdgesOnDrag:{boolean:v},hideEdgesOnZoom:{boolean:v},hideNodesOnDrag:{boolean:v},hover:{boolean:v},keyboard:{enabled:{boolean:v},speed:{x:{number:f},y:{number:f},zoom:{number:f},__type__:{object:x}},bindToWindow:{boolean:v},autoFocus:{boolean:v},__type__:{object:x,boolean:v}},multiselect:{boolean:v},navigationButtons:{boolean:v},selectable:{boolean:v},selectConnectedEdges:{boolean:v},hoverConnectedEdges:{boolean:v},tooltipDelay:{number:f},zoomView:{boolean:v},zoomSpeed:{number:f},__type__:{object:x}},layout:{randomSeed:{undefined:"undefined",number:f,string:y},improvedLayout:{boolean:v},clusterThreshold:{number:f},hierarchical:{enabled:{boolean:v},levelSeparation:{number:f},nodeSpacing:{number:f},treeSpacing:{number:f},blockShifting:{boolean:v},edgeMinimization:{boolean:v},parentCentralization:{boolean:v},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:x,boolean:v}},__type__:{object:x}},manipulation:{enabled:{boolean:v},initiallyActive:{boolean:v},addNode:{boolean:v,function:"function"},addEdge:{boolean:v,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:x,boolean:v,function:"function"}},deleteNode:{boolean:v,function:"function"},deleteEdge:{boolean:v,function:"function"},controlNodeStyle:fi,__type__:{object:x,boolean:v}},nodes:fi,physics:{enabled:{boolean:v},barnesHut:{theta:{number:f},gravitationalConstant:{number:f},centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},damping:{number:f},avoidOverlap:{number:f},__type__:{object:x}},forceAtlas2Based:{theta:{number:f},gravitationalConstant:{number:f},centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},damping:{number:f},avoidOverlap:{number:f},__type__:{object:x}},repulsion:{centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},nodeDistance:{number:f},damping:{number:f},__type__:{object:x}},hierarchicalRepulsion:{centralGravity:{number:f},springLength:{number:f},springConstant:{number:f},nodeDistance:{number:f},damping:{number:f},avoidOverlap:{number:f},__type__:{object:x}},maxVelocity:{number:f},minVelocity:{number:f},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:v},iterations:{number:f},updateInterval:{number:f},onlyDynamicEdges:{boolean:v},fit:{boolean:v},__type__:{object:x,boolean:v}},timestep:{number:f},adaptiveTimestep:{boolean:v},wind:{x:{number:f},y:{number:f},__type__:{object:x}},__type__:{object:x,boolean:v}},autoResize:{boolean:v},clickToUse:{boolean:v},locale:{string:y},locales:{__any__:{any:ZM},__type__:{object:x}},height:{string:y},width:{string:y},__type__:{object:x}},Gh={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]}}},GM=(I,e,g)=>{var t;return!!(yg(I).call(I,"physics")&&yg(t=Gh.physics.solver).call(t,e)&&g.physics.solver!==e&&e!=="wind")};var Kn=class{constructor(){}getDistances(e,g,t){let A={},C=e.edges;for(let n=0;n<g.length;n++){let o=g[n],s={};A[o]=s;for(let r=0;r<g.length;r++)s[g[r]]=n==r?0:1e9}for(let n=0;n<t.length;n++){let o=C[t[n]];o.connected===!0&&A[o.fromId]!==void 0&&A[o.toId]!==void 0&&(A[o.fromId][o.toId]=1,A[o.toId][o.fromId]=1)}let i=g.length;for(let n=0;n<i;n++){let o=g[n],s=A[o];for(let r=0;r<i-1;r++){let a=g[r],d=A[a];for(let l=r+1;l<i;l++){let h=g[l],c=A[h],p=Math.min(d[h],d[o]+s[h]);d[h]=p,c[a]=p}}}return A}},Un=class{constructor(e,g,t){this.body=e,this.springLength=g,this.springConstant=t,this.distanceSolver=new Kn}setOptions(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}solve(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=this.distanceSolver.getDistances(this.body,e,g);this._createL_matrix(A),this._createK_matrix(A),this._createE_matrix();let C=.01,i=1,n=0,o=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),s=5,r=1e9,a=0,d=0,l=0,h=0,c=0;for(;r>C&&n<o;)for(n+=1,[a,r,d,l]=this._getHighestEnergyNode(t),h=r,c=0;h>i&&c<s;)c+=1,this._moveNode(a,d,l),[h,d,l]=this._getEnergy(a)}_getHighestEnergyNode(e){let g=this.body.nodeIndices,t=this.body.nodes,A=0,C=g[0],i=0,n=0;for(let o=0;o<g.length;o++){let s=g[o];if(t[s].predefinedPosition!==!0||t[s].isCluster===!0&&e===!0||t[s].options.fixed.x!==!0||t[s].options.fixed.y!==!0){let[r,a,d]=this._getEnergy(s);A<r&&(A=r,C=s,i=a,n=d)}}return[C,A,i,n]}_getEnergy(e){let[g,t]=this.E_sums[e];return[Math.sqrt(g**2+t**2),g,t]}_moveNode(e,g,t){let A=this.body.nodeIndices,C=this.body.nodes,i=0,n=0,o=0,s=C[e].x,r=C[e].y,a=this.K_matrix[e],d=this.L_matrix[e];for(let w=0;w<A.length;w++){let O=A[w];if(O!==e){let M=C[O].x,k=C[O].y,V=a[O],ye=d[O],ue=1/((s-M)**2+(r-k)**2)**1.5;i+=V*(1-ye*(r-k)**2*ue),n+=V*(ye*(s-M)*(r-k)*ue),o+=V*(1-ye*(s-M)**2*ue)}}let l=i,h=n,c=g,p=o,u=t,m=(c/l+u/h)/(h/l-p/h),E=-(h*m+c)/l;C[e].x+=E,C[e].y+=m,this._updateE_matrix(e)}_createL_matrix(e){let g=this.body.nodeIndices,t=this.springLength;this.L_matrix=[];for(let A=0;A<g.length;A++){this.L_matrix[g[A]]={};for(let C=0;C<g.length;C++)this.L_matrix[g[A]][g[C]]=t*e[g[A]][g[C]]}}_createK_matrix(e){let g=this.body.nodeIndices,t=this.springConstant;this.K_matrix=[];for(let A=0;A<g.length;A++){this.K_matrix[g[A]]={};for(let C=0;C<g.length;C++)this.K_matrix[g[A]][g[C]]=t*e[g[A]][g[C]]**-2}}_createE_matrix(){let e=this.body.nodeIndices,g=this.body.nodes;this.E_matrix={},this.E_sums={};for(let t=0;t<e.length;t++)this.E_matrix[e[t]]=[];for(let t=0;t<e.length;t++){let A=e[t],C=g[A].x,i=g[A].y,n=0,o=0;for(let s=t;s<e.length;s++){let r=e[s];if(r!==A){let a=g[r].x,d=g[r].y,l=1/Math.sqrt((C-a)**2+(i-d)**2);this.E_matrix[A][s]=[this.K_matrix[A][r]*(C-a-this.L_matrix[A][r]*(C-a)*l),this.K_matrix[A][r]*(i-d-this.L_matrix[A][r]*(i-d)*l)],this.E_matrix[r][t]=this.E_matrix[A][s],n+=this.E_matrix[A][s][0],o+=this.E_matrix[A][s][1]}}this.E_sums[A]=[n,o]}}_updateE_matrix(e){let g=this.body.nodeIndices,t=this.body.nodes,A=this.E_matrix[e],C=this.K_matrix[e],i=this.L_matrix[e],n=t[e].x,o=t[e].y,s=0,r=0;for(let a=0;a<g.length;a++){let d=g[a];if(d!==e){let l=A[a],h=l[0],c=l[1],p=t[d].x,u=t[d].y,m=1/Math.sqrt((n-p)**2+(o-u)**2),E=C[d]*(n-p-i[d]*(n-p)*m),w=C[d]*(o-u-i[d]*(o-u)*m);A[a]=[E,w],s+=E,r+=w;let O=this.E_sums[d];O[0]+=E-h,O[1]+=w-c}}this.E_sums[e]=[s,r]}};function T(I,e,g){var t,A,C,i;if(!(this instanceof T))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:E1,clickToUse:!1},q(this.options,this.defaultOptions),this.body={container:I,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:b(t=this.on).call(t,this),off:b(A=this.off).call(A,this),emit:b(C=this.emit).call(C,this),once:b(i=this.once).call(i,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 _i(()=>this.body.emitter.emit("_requestRedraw")),this.groups=new Ki,this.canvas=new Mn(this.body),this.selectionHandler=new Gn(this.body,this.canvas),this.interactionHandler=new zn(this.body,this.canvas,this.selectionHandler),this.view=new Fn(this.body,this.canvas),this.renderer=new kn(this.body,this.canvas),this.physics=new Nn(this.body),this.layoutEngine=new Yn(this.body),this.clustering=new Sn(this.body),this.manipulation=new _n(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new an(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new En(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new Un(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(g),this.setData(e)}ed(T.prototype);T.prototype.setOptions=function(I){if(I===null&&(I=void 0),I!==void 0){if(g1.validate(I,LM)===!0&&console.error("%cErrors have been found in the supplied options object.",jl),xt(["locale","locales","clickToUse"],this.options,I),I.locale!==void 0&&(I.locale=T1(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 qO(this,this.body.container,Gh,this.canvas.pixelRatio,GM)),this.configurator.setOptions(I.configure)),this.configurator&&this.configurator.options.enabled===!0){let t={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};_(t.nodes,this.nodesHandler.options),_(t.edges,this.edgesHandler.options),_(t.layout,this.layoutEngine.options),_(t.interaction,this.selectionHandler.options),_(t.interaction,this.renderer.options),_(t.interaction,this.interactionHandler.options),_(t.manipulation,this.manipulation.options),_(t.physics,this.physics.options),_(t.global,this.canvas.options),_(t.global,this.options),this.configurator.setModuleOptions(t)}I.clickToUse!==void 0?I.clickToUse===!0?this.activator===void 0&&(this.activator=new $O(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")}};T.prototype._updateVisibleIndices=function(){let I=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(let g in I)Object.prototype.hasOwnProperty.call(I,g)&&!this.clustering._isClusteredNode(g)&&I[g].options.hidden===!1&&this.body.nodeIndices.push(I[g].id);for(let g in e)if(Object.prototype.hasOwnProperty.call(e,g)){let t=e[g],A=I[t.fromId],C=I[t.toId],i=A!==void 0&&C!==void 0;!this.clustering._isClusteredEdge(g)&&t.options.hidden===!1&&i&&A.options.hidden===!1&&C.options.hidden===!1&&this.body.edgeIndices.push(t.id)}};T.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")})};T.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);");let e=a1(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);");let e=d1(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")};T.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(let I in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,I)&&delete this.body.nodes[I];for(let I in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,I)&&delete this.body.edges[I];ug(this.body.container)};T.prototype._updateValueRange=function(I){let e,g,t,A=0;for(e in I)if(Object.prototype.hasOwnProperty.call(I,e)){let C=I[e].getValue();C!==void 0&&(g=g===void 0?C:Math.min(C,g),t=t===void 0?C:Math.max(C,t),A+=C)}if(g!==void 0&&t!==void 0)for(e in I)Object.prototype.hasOwnProperty.call(I,e)&&I[e].setValueRange(g,t,A)};T.prototype.isActive=function(){return!this.activator||this.activator.active};T.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)};T.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)};T.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)};T.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)};T.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)};T.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)};T.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)};T.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)};T.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)};T.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)};T.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)};T.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)};T.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)};T.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)};T.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)};T.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)};T.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)};T.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)};T.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)};T.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)};T.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)};T.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)};T.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)};T.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)};T.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)};T.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)};T.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)};T.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)};T.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)};T.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)};T.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)};T.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)};T.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)};T.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)};T.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)};T.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)};T.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)};T.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)};T.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)};T.prototype.getNodeAt=function(){let I=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return I!==void 0&&I.id!==void 0?I.id:I};T.prototype.getEdgeAt=function(){let I=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return I!==void 0&&I.id!==void 0?I.id:I};T.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)};T.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)};T.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()};T.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)};T.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)};T.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)};T.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)};T.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)};T.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)};T.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)};T.prototype.getOptionsFromConfigurator=function(){let I={};return this.configurator&&(I=this.configurator.getOptions.apply(this.configurator)),I};function oC(){return document.documentElement.getAttribute("data-theme")||"light"}function Fo(I){return I==="dark"?{uri:"#97C2FC",literal:"#a6c8a6ff",blankNode:"#888888",typeObject:"#e15b13ff",text:"#e0e0e0",edge:"#666666",edgeLabel:"#cccccc",edgeLabelBackground:"rgba(30, 30, 30, 0.8)"}:{uri:"#97C2FC",literal:"#a6c8a6ff",blankNode:"#c5c5c5ff",typeObject:"#e15b13ff",text:"#000000",edge:"#cccccc",edgeLabel:"#666666",edgeLabelBackground:"rgba(255, 255, 255, 0.8)"}}function Vh(I){let e=new MutationObserver(g=>{g.forEach(t=>{if(t.attributeName==="data-theme"){let A=oC();I(A)}})});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),e}function VM(){return{Network:T,DataSet:Pg}}var Bo=class{constructor(e){this.yasr=e,this.network=null,this.currentTheme=oC(),this.themeObserver=null}static get priority(){return 20}static get label(){return"Graph"}canHandleResults(){if(!this.yasr||!this.yasr.results)return!1;let e=this.yasr.results;if(e.getBindings&&typeof e.getBindings=="function"){let g=e.getBindings();if(g&&g.length>0){let t=g[0];return t.subject!==void 0&&t.predicate!==void 0&&t.object!==void 0}}return!1}draw(){this.yasr.resultsEl.innerHTML="";try{let e=Lo(this.yasr.results);if(!e||e.length===0){this.yasr.resultsEl.innerHTML='<div style="padding: 20px; text-align: center; color: #666;">No graph data to visualize</div>';return}let g=Zo(this.yasr);this.currentTheme=oC();let t=Fo(this.currentTheme),{nodes:A,edges:C}=dC(e,g,t),i=document.createElement("div");i.style.width="100%",i.style.height="600px",i.style.position="relative",i.style.overflow="hidden",this.yasr.resultsEl.appendChild(i);let{Network:n,DataSet:o}=VM(),s=new o(A),r=new o(C),a=rC(t);this.nodesDataSet=s,this.edgesDataSet=r,this.triples=e,this.prefixMap=g,this.network=new n(i,{nodes:s,edges:r},a),this.networkReady=!1,this.network.on("stabilizationIterationsDone",()=>{this.network.setOptions({physics:{enabled:!0}}),this.networkReady=!0}),this.themeObserver||(this.themeObserver=Vh(h=>{this.applyTheme(h)}));let d=document.createElement("div");d.style.position="absolute",d.style.top="10px",d.style.right="10px",d.style.zIndex="10000",d.style.display="flex",d.style.gap="10px",d.style.pointerEvents="auto",i.appendChild(d);let l=document.createElement("button");l.textContent="Zoom to Fit",l.style.padding="8px 12px",l.style.background="#4CAF50",l.style.color="white",l.style.border="none",l.style.borderRadius="4px",l.style.cursor="pointer",l.style.fontSize="14px",l.style.boxShadow="0 2px 4px rgba(0,0,0,0.2)",l.onmouseover=()=>l.style.background="#45a049",l.onmouseout=()=>l.style.background="#4CAF50",l.onclick=()=>{this.network&&this.network.fit({animation:{duration:300,easingFunction:"easeInOutQuad"}})},d.appendChild(l),e.length>1e3&&console.warn("Large graph detected (>1000 triples). Rendering may be slow.")}catch(e){console.error("Error rendering graph:",e),this.yasr.resultsEl.innerHTML='<div style="padding: 20px; color: red;">Error rendering graph. See console for details.</div>'}}applyTheme(e){if(!this.network||!this.nodesDataSet||!this.triples||!this.prefixMap)return;this.currentTheme=e;let g=Fo(e),{nodes:t,edges:A}=dC(this.triples,this.prefixMap,g);this.nodesDataSet.clear(),this.nodesDataSet.add(t),this.edgesDataSet.clear(),this.edgesDataSet.add(A);let C=rC(g);this.network.setOptions(C)}getIcon(){let e=document.createElement("div");return e.setAttribute("aria-label","Graph visualization"),e.style.display="inline-flex",e.style.alignItems="center",e.style.justifyContent="center",e.innerHTML=`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
909
+ <circle cx="3" cy="3" r="2" />
910
+ <circle cx="13" cy="3" r="2" />
911
+ <circle cx="8" cy="13" r="2" />
912
+ <line x1="4.5" y1="4" x2="7" y2="11.5" stroke="currentColor" stroke-width="1.5" />
913
+ <line x1="11.5" y1="4" x2="9" y2="11.5" stroke="currentColor" stroke-width="1.5" />
914
+ <line x1="5" y1="3" x2="11" y2="3" stroke="currentColor" stroke-width="1.5" />
915
+ </svg>`,e}destroy(){this.themeObserver&&(this.themeObserver.disconnect(),this.themeObserver=null),this.network&&(this.network.destroy(),this.network=null)}},zo=Bo;typeof window!="undefined"&&window.Yasgui&&window.Yasgui.Yasr&&window.Yasgui.Yasr.registerPlugin("Graph",zo);var jM=zo;return Hh(WM);})();
909
916
  /*! Bundled license information:
910
917
 
911
918
  vis-network/standalone/esm/vis-network.js: