@matdata/yasgui-graph-plugin 1.4.2 → 1.6.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,5 @@
1
- "use strict";var TablePlugin=(()=>{var sC=Object.defineProperty;var Yh=Object.getOwnPropertyDescriptor;var Wh=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 Wh(e))!_h.call(I,A)&&A!==g&&sC(I,A,{get:()=>e[A],enumerable:!(t=Yh(e,A))||t.enumerable});return I};var Hh=I=>Uh(sC({},"__esModule",{value:!0}),I);var jM={};Kh(jM,{default:()=>VM});function zr(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 lg(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 oC(I){return{configure:{enabled:!1},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",roundness:.5},font:{size:12,align:"middle",color:I.edgeLabel,background:I.edgeLabelBackground,strokeWidth:0},color:{color:I.edge}}}}function Zr(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("_:"),r=n?C.subject:Pt(lg(C.subject,e));t.set(C.subject,{id:A++,uri:C.subject,label:r,color:aC({uri:C.subject,type:"uri"},I,g),type:"uri",fullValue:C.subject,title:n?C.subject:lg(C.subject,e)})}let i=C.object.value;if(!t.has(i)){let n=C.object.type==="literal",r=!n&&i.startsWith("_:"),s,o,a;n?(s=Pt(i),o=i,a=C.object.datatype?`"${i}"^^${lg(C.object.datatype,e)}`:`"${i}"`):r?(s=i,o=i,a=i):(s=Pt(lg(i,e)),o=i,a=lg(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:o,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 r=`${i.id}-${C.predicate}-${n.id}`;A.has(r)||(A.add(r),t.push({id:`edge_${i.id}_${n.id}_${t.length}`,from:i.id,to:n.id,label:Pt(lg(C.predicate,g)),predicate:C.predicate,title:lg(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,Lr=Sa.apply,Gr=Sa.call,VI=typeof Reflect=="object"&&Reflect.apply||($h?Gr.bind(Lr):function(){return Gr.apply(Lr,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),og=function(I){return gc(ec(I),8,-1)},tc=og,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,rc=La&&!Za.call({1:2},1);AA.f=rc?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,oc=z,ac=og,hC=Object,dc=sc("".split),jI=oc(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,Ye=function(I){return cc(uc(I))},Vr=le,Ga=Ba,fc=Ga.all,ce=Ga.IS_HTMLDDA?function(I){return typeof I=="object"?I!==null:Vr(I)||I===fc}:function(I){return typeof I=="object"?I!==null:Vr(I)},L={},cC=L,uC=X,pc=le,jr=function(I){return pc(I)?I:void 0},We=function(I,e){return arguments.length<2?jr(cC[I])||jr(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,Yr=Va.process,Wr=Va.Deno,_r=Yr&&Yr.versions||Wr&&Wr.version,Kr=_r&&_r.v8,Be,lI;Kr&&(Be=Kr.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,Ur=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&&Ur&&Ur<41}),wc=pt,ja=wc&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ec=We,Tc=le,xc=J,Oc=ja,Pc=Object,rA=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"}},Rc=le,Nc=sA,Sc=TypeError,Wg=function(I){if(Rc(I))return I;throw new Sc(Nc(I)+" is not a function")},kc=Wg,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")},Ya={exports:{}},Hr=X,zc=Object.defineProperty,Zc=function(I,e){try{zc(Hr,I,{value:e,configurable:!0,writable:!0})}catch(g){Hr[I]=e}return e},Lc=X,Gc=Zc,Qr="__core-js_shared__",Vc=Lc[Qr]||Gc(Qr,{}),Xn=Vc,Xr=Xn;(Ya.exports=function(I,e){return Xr[I]||(Xr[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=Ya.exports,jc=CA,Yc=Object,xe=function(I){return Yc(jc(I))},Wc=Z,_c=xe,Kc=Wc({}.hasOwnProperty),ne=Object.hasOwn||function(e,g){return Kc(_c(e),g)},Uc=Z,Hc=0,Qc=Math.random(),Xc=Uc(1 .toString),YI=function(I){return"Symbol("+(I===void 0?"":I)+")_"+Xc(++Hc+Qc,36)},Jc=X,$c=mt,Jr=ne,qc=YI,eu=pt,gu=ja,It=Jc.Symbol,bC=$c("wks"),tu=gu?It.for||It:It&&It.withoutSetter||qc,ee=function(I){return Jr(bC,I)||(bC[I]=eu&&Jr(It,I)?It[I]:tu("Symbol."+I)),bC[I]},Au=je,$r=ce,qr=rA,Iu=Qn,Cu=Bc,iu=ee,nu=TypeError,ru=iu("toPrimitive"),su=function(I,e){if(!$r(I)||qr(I))return I;var g=Iu(I,ru),t;if(g){if(e===void 0&&(e="default"),t=Au(g,I,e),!$r(t)||qr(t))return t;throw new nu("Can't convert object to primitive value")}return e===void 0&&(e="number"),Cu(I,e)},ou=su,au=rA,WI=function(I){var e=ou(I,"string");return au(e)?e:e+""},du=X,es=ce,vi=du.document,lu=es(vi)&&es(vi.createElement),Wa=function(I){return lu?vi.createElement(I):{}},hu=ie,cu=z,uu=Wa,_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=Ye,yu=WI,wu=ne,Eu=_a,gs=Object.getOwnPropertyDescriptor;tA.f=fu?gs:function(e,g){if(e=bu(e),g=yu(g),Eu)try{return gs(e,g)}catch(t){}if(wu(e,g))return vu(!pu(mu.f,e,g),e[g])};var Tu=z,xu=le,Ou=/#|\.prototype\./,oA=function(I,e){var g=Du[Pu(I)];return g===Nu?!0:g===Ru?!1:xu(e)?Tu(e):!!e},Pu=oA.normalize=function(I){return String(I).replace(Ou,".").toLowerCase()},Du=oA.data={},Ru=oA.NATIVE="N",Nu=oA.POLYFILL="P",Su=oA,ts=Hn,ku=Wg,Mu=gA,Fu=ts(ts.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,ag=function(I){if(Zu(I))return I;throw new Gu(Lu(I)+" is not an object")},Vu=ie,ju=_a,Yu=Ka,zA=ag,As=WI,Wu=TypeError,yC=Object.defineProperty,_u=Object.getOwnPropertyDescriptor,wC="enumerable",EC="configurable",TC="writable";Oe.f=Vu?Yu?function(e,g,t){if(zA(e),g=As(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=As(g),zA(t),ju)try{return yC(e,g,t)}catch(A){}if("get"in t||"set"in t)throw new Wu("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,Is=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},R=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],r=n.prototype,s,o,a,d,l,h,c,p,u;for(d in e)s=qu(t?d:g+(A?".":"#")+d,I.forced),o=!s&&i&&Is(i,d),h=n[d],o&&(I.dontCallGetSet?(u=$u(i,d),c=u&&u.value):c=i[d]),l=o&&c?c:e[d],!(o&&typeof h==typeof l)&&(I.bind&&o?p=ef(l,ZA):I.wrap&&o?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",Is($g,a)||qg($g,a,{}),qg($g[a],d,l),I.real&&r&&(s||!r[d])&&qg(r,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,rf=Math.max,sf=Math.min,dA=function(I,e){var g=nf(I);return g<0?rf(g+e,0):sf(g,e)},of=_I,af=Math.min,df=function(I){return I>0?af(of(I),9007199254740991):0},lf=df,Se=function(I){return lf(I.length)},hf=Ye,cf=dA,uf=Se,Cs=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:Cs(!0),indexOf:Cs(!1)},lA={},ff=Z,xC=ne,pf=Ye,mf=Jn.indexOf,vf=lA,is=ff([].push),Ua=function(I,e){var g=pf(I),t=0,A=[],C;for(C in g)!xC(vf,C)&&xC(g,C)&&is(A,C);for(;e.length>t;)xC(g,C=e[t++])&&(~mf(A,C)||is(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 ns=ie,wf=Z,Ef=je,Tf=z,OC=hA,xf=cA,Of=AA,Pf=xe,Df=jI,et=Object.assign,rs=Object.defineProperty,Rf=wf([].concat),Nf=!et||Tf(function(){if(ns&&et({b:1},et(rs({},"a",{enumerable:!0,get:function(){rs(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 r=Df(arguments[C++]),s=i?Rf(OC(r),i(r)):OC(r),o=s.length,a=0,d;o>a;)d=s[a++],(!ns||Ef(n,r,d))&&(t[d]=r[d]);return t}:et,Sf=R,ss=Nf;Sf({target:"Object",stat:!0,arity:2,forced:Object.assign!==ss},{assign:ss});var kf=L,Mf=kf.Object.assign,Ff=Mf,Bf=Ff,zf=Bf,q=D(zf),Zf=Z,KI=Zf([].slice),Ha=Z,Lf=Wg,Gf=ce,Vf=ne,os=KI,jf=gA,Qa=Function,Yf=Ha([].concat),Wf=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("+Wf(t,",")+")")}return PC[e](I,g)},Kf=jf?Qa.bind:function(e){var g=Lf(this),t=g.prototype,A=os(arguments,1),C=function(){var n=Yf(A,os(arguments));return this instanceof C?_f(g,n.length,n):g.apply(e,n)};return Gf(t)&&(C.prototype=t),C},Uf=R,as=Kf;Uf({target:"Function",proto:!0,forced:Function.bind!==as},{bind:as});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,r=e+t,s=g+A,o=e+t/2,a=g+A/2;I.beginPath(),I.moveTo(e,a),I.bezierCurveTo(e,a-n,o-i,g,o,g),I.bezierCurveTo(o+i,g,r,a-n,r,a),I.bezierCurveTo(r,a+n,o+i,s,o,s),I.bezierCurveTo(o-i,s,e,a+n,e,a),I.closePath()}function Ja(I,e,g,t,A){let C=.3333333333333333,i=t,n=A*C,r=.5522848,s=i/2*r,o=n/2*r,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+o,l+s,d,l,d),I.bezierCurveTo(l-s,d,e,h+o,e,h),I.bezierCurveTo(e,h-o,l-s,g,l,g),I.bezierCurveTo(l+s,g,a,h-o,a,h),I.lineTo(a,c),I.bezierCurveTo(a,c+o,l+s,p,l,p),I.bezierCurveTo(l-s,p,e,c+o,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,r=A-g,s=r/n,o=Math.sqrt(n*n+r*r),a=0,d=!0,l=0,h=+C[0];for(;o>=.1;)h=+C[a++%i],h>o&&(h=o),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),o-=h,d=!d}function rp(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 ds={circle:qn,dashedLine:$a,database:Ja,diamond:np,ellipse:bi,ellipse_vis:bi,hexagon:rp,roundRect:Xa,square:Ap,star:ip,triangle:Ip,triangleDown:Cp};function sp(I){return Object.prototype.hasOwnProperty.call(ds,I)?ds[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 op=`.vis-overlay {
1
+ "use strict";var TablePlugin=(()=>{var hC=Object.defineProperty;var ic=Object.getOwnPropertyDescriptor;var nc=Object.getOwnPropertyNames;var rc=Object.prototype.hasOwnProperty;var sc=(I,e)=>{for(var g in e)hC(I,g,{get:e[g],enumerable:!0})},oc=(I,e,g,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let A of nc(e))!rc.call(I,A)&&A!==g&&hC(I,A,{get:()=>e[A],enumerable:!(t=ic(e,A))||t.enumerable});return I};var ac=I=>oc(hC({},"__esModule",{value:!0}),I);var d5={};sc(d5,{default:()=>a5});function Vr(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 hg(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 qg(I,e=50){return!I||typeof I!="string"||I.length<=e?I:I.substring(0,e-3)+"..."}function cC(I,e){let g=!e||e.edgeStyle!=="straight",t={small:6,medium:10,large:16},A=e!=null&&e.nodeSize?t[e.nodeSize]:10,C=(e==null?void 0:e.showNodeLabels)!==!1;return{configure:{enabled:!1},physics:{enabled:(e==null?void 0:e.physicsEnabled)!==!1,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,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1},nodes:{shape:"dot",size:A,font:{size:C?12:0,color:I.text},borderWidth:1,borderWidthSelected:2,labelHighlightBold:!0},edges:{arrows:{to:{enabled:!0,scaleFactor:.6}},smooth:{enabled:g,type:"dynamic",roundness:.5},font:{size:12,align:"middle",color:I.edgeLabel,background:I.edgeLabelBackground,strokeWidth:0},color:{color:I.edge}}}}async function Yr(I){var e,g;if(!I)return[];try{let t;if(typeof I.json=="function")t=await I.json();else if(typeof I.data=="string")t=JSON.parse(I.data);else if(typeof I=="object")t=I;else return[];let A=(g=(e=t==null?void 0:t.results)==null?void 0:e.bindings)!=null?g:[],C=[];for(let i of A)!i.subject||!i.predicate||!i.object||typeof i.subject.value!="string"||typeof i.predicate.value!="string"||typeof i.object.value!="string"||C.push({subject:i.subject.value,predicate:i.predicate.value,object:{value:i.object.value,type:i.object.type||"uri",datatype:i.object.datatype,lang:i.object["xml:lang"]}});return C}catch(t){return[]}}function Wr(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 uC(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}var dc={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"a","http://www.w3.org/1999/02/22-rdf-syntax-ns#value":"val","http://www.w3.org/2000/01/rdf-schema#label":"lbl","http://www.w3.org/2000/01/rdf-schema#comment":"cmt","http://www.w3.org/2000/01/rdf-schema#subClassOf":"\u2282","http://www.w3.org/2000/01/rdf-schema#subPropertyOf":"\u2286","http://www.w3.org/2000/01/rdf-schema#domain":"dom","http://www.w3.org/2000/01/rdf-schema#range":"rng","http://www.w3.org/2000/01/rdf-schema#seeAlso":"see","http://www.w3.org/2000/01/rdf-schema#isDefinedBy":"idb","http://www.w3.org/2002/07/owl#sameAs":"\u2261","http://www.w3.org/2002/07/owl#equivalentClass":"\u2245","http://www.w3.org/2002/07/owl#inverseOf":"\u21C4","http://www.w3.org/2002/07/owl#disjointWith":"\u2260","http://www.w3.org/2004/02/skos/core#prefLabel":"\u2605","http://www.w3.org/2004/02/skos/core#altLabel":"\u2606","http://www.w3.org/2004/02/skos/core#definition":"def","http://www.w3.org/2004/02/skos/core#broader":"\u2191","http://www.w3.org/2004/02/skos/core#narrower":"\u2193","http://www.w3.org/2004/02/skos/core#related":"\u2194","http://www.w3.org/2004/02/skos/core#note":"note","http://www.w3.org/2004/02/skos/core#exactMatch":"\u2261","http://www.w3.org/2004/02/skos/core#closeMatch":"\u2248","http://purl.org/dc/terms/title":"ttl","http://purl.org/dc/terms/description":"dsc","http://purl.org/dc/terms/created":"crt","http://purl.org/dc/terms/modified":"mod","http://purl.org/dc/terms/creator":"by","http://purl.org/dc/terms/subject":"sbj","http://xmlns.com/foaf/0.1/name":"nm","http://xmlns.com/foaf/0.1/knows":"\u27F7","http://xmlns.com/foaf/0.1/member":"mbr","http://schema.org/name":"nm","http://schema.org/description":"dsc"};function _r(I){return dc[I]}var Hr="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",Ur="https://schema.org/image",Kr="https://schema.org/icon",Qr="http://www.w3.org/2000/01/rdf-schema#label",lc="http://www.w3.org/2000/01/rdf-schema#subClassOf",Xr=new Set([Ur,Kr,Qr]);function fC(I,e){let g="</div>",t=I.lastIndexOf(g);return t===-1?I+e:I.slice(0,t)+e+g}function pC(I,e){return`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">${De(I)}</span><span class="yasgui-tooltip-val">${De(e)}</span></div>`}function De(I){return I.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function hc(I,e,g){let t=I.startsWith("_:"),A=`<div class="yasgui-tooltip-type">${t?"Blank Node":"URI"}</div>`;return A+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">${t?"Identifier":"Full URI"}</span><span class="yasgui-tooltip-val">${De(I)}</span></div>`,e.filter(C=>C.subject===I&&C.predicate===Hr).forEach(C=>{let i=hg(C.object.value,g);A+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">rdf:type</span><span class="yasgui-tooltip-val">${De(i)}</span></div>`}),e.filter(C=>C.subject===I&&C.object.type==="literal").forEach(C=>{let i=hg(C.predicate,g);A+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">${De(i)}</span><span class="yasgui-tooltip-val">${De(C.object.value)}</span></div>`}),`<div class="yasgui-graph-tooltip">${A}</div>`}function zA(I,e,g,t,A){let i=`<div class="yasgui-tooltip-type">${I==="uri"?"URI":I==="literal"?"Literal":"Blank Node"}</div>`;if(I==="literal"){if(i+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Value</span><span class="yasgui-tooltip-val">${De(e)}</span></div>`,g){let n=A?hg(g,A):g;i+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Datatype</span><span class="yasgui-tooltip-val">${De(n)}</span></div>`}t&&(i+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Language</span><span class="yasgui-tooltip-val">${De(t)}</span></div>`)}else I==="uri"?i+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Full URI</span><span class="yasgui-tooltip-val">${De(e)}</span></div>`:I==="bnode"&&(i+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Identifier</span><span class="yasgui-tooltip-val">${De(e)}</span></div>`);return`<div class="yasgui-graph-tooltip">${i}</div>`}function cc(I){return`<div class="yasgui-graph-tooltip">${`<div class="yasgui-tooltip-type">Predicate</div><div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Full URI</span><span class="yasgui-tooltip-val">${De(I)}</span></div>`}</div>`}function uc(I,e,g,t){let A=new Map,C=1,i=(t==null?void 0:t.nodeSize)==="small"?.5:(t==null?void 0:t.nodeSize)==="large"?2:1;return I.forEach(n=>{if(!A.has(n.subject)){let s=n.subject.startsWith("_:"),o=s?n.subject:qg(hg(n.subject,e));A.set(n.subject,{id:C++,uri:n.subject,label:o,color:uC({uri:n.subject,type:"uri"},I,g),type:"uri",fullValue:n.subject,size:10*i,title:zA(s?"bnode":"uri",n.subject,void 0,void 0,e)})}let r=n.object.value;if(!A.has(r)&&!Xr.has(n.predicate)){let s=n.object.type==="literal",o=!s&&r.startsWith("_:"),d,a,l;s?(d=qg(r),a=r,l=zA("literal",r,n.object.datatype,n.object.lang,e)):o?(d=r,a=r,l=zA("bnode",r)):(d=qg(hg(r,e)),a=r,l=zA("uri",r,void 0,void 0,e)),A.set(r,{id:C++,uri:s?null:r,label:d,color:uC({uri:r,type:s?"literal":"uri"},I,g),type:s?"literal":"uri",fullValue:a,size:(s?5:10)*i,title:l})}}),A}function fc(I,e,g,t){let A=[],C=new Set;return I.forEach(i=>{var o,d;if(Xr.has(i.predicate))return;let n=e.get(i.subject),r=e.get(i.object.value);if(!n||!r)return;let s=`${n.id}-${i.predicate}-${r.id}`;if(!C.has(s)){C.add(s);let a,l=(o=t==null?void 0:t.predicateDisplay)!=null?o:"label";l==="none"?a="":l==="icon"?a=(d=_r(i.predicate))!=null?d:qg(hg(i.predicate,g)):a=qg(hg(i.predicate,g)),A.push({id:`edge_${n.id}_${r.id}_${A.length}`,from:n.id,to:r.id,label:a,predicate:i.predicate,title:cc(i.predicate),arrows:"to"})}}),A}function pc(I,e,g){return I.uri&&I.uri.startsWith("_:")||!g.compactMode?!0:!(I.type==="literal"||e.some(A=>A.predicate==="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"&&A.object.value===I.uri))}function BA(I,e,g,t){let A=uc(I,e,g,t),C=(t==null?void 0:t.nodeSize)==="small"?.5:(t==null?void 0:t.nodeSize)==="large"?2:1,i=new Map;for(let a of I){i.has(a.subject)||i.set(a.subject,new Map);let l=i.get(a.subject);l.has(a.predicate)||l.set(a.predicate,[]),l.get(a.predicate).push(a.object.value)}function n(a){let l=i.get(a);if(!l)return{};let h=l.get(Kr);if(h!=null&&h.length)return{icon:h[0]};let c=l.get(Ur);return c!=null&&c.length?{image:c[0]}:{}}function r(a){var c,f,u,m;let l=n(a);if(l.icon||l.image)return l;let h=(f=(c=i.get(a))==null?void 0:c.get(Hr))!=null?f:[];for(let E of h){let w=n(E);if(w.icon||w.image)return w}for(let E of h){let w=(m=(u=i.get(E))==null?void 0:u.get(lc))!=null?m:[];for(let O of w){let R=n(O);if(R.icon||R.image)return R}}return{}}t!=null&&t.compactMode&&new Set(I.map(l=>l.subject)).forEach(l=>{let h=A.get(l);h&&(h.title=hc(l,I,e))}),A.forEach(a=>{var c,f;if(!a.uri||a.type==="literal")return;let l=t!=null&&t.compactMode?r(a.uri):n(a.uri),h=(f=(c=i.get(a.uri))==null?void 0:c.get(Qr))==null?void 0:f[0];if(l.icon)a.shape="text",a.label=h?`${l.icon}
2
+ ${h}`:l.icon,a.font={size:14*C},t!=null&&t.compactMode||(a.title=fC(a.title,pC("Icon",l.icon)));else if(l.image){let u=!1;try{let m=new URL(l.image);u=m.protocol==="http:"||m.protocol==="https:"}catch(m){}u&&(a.shape="circularImage",a.image=l.image),h&&(a.label=h,a.font={size:14*C}),t!=null&&t.compactMode||(a.title=fC(a.title,pC("Image",l.image)))}else h&&(a.label=h);h&&!(t!=null&&t.compactMode)&&(a.title=fC(a.title,pC("rdfs:label",h)))});let s=new Set;A.forEach(a=>{(!t||pc(a,I,t))&&s.add(a.id)});let o=fc(I,A,e,t).filter(a=>s.has(a.from)&&s.has(a.to));return{nodes:Array.from(A.values()).filter(a=>s.has(a.id)),edges:o}}var mC=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function P(I){return I&&I.__esModule&&Object.prototype.hasOwnProperty.call(I,"default")?I.default:I}var ZA=function(I){return I&&I.Math===Math&&I},X=ZA(typeof globalThis=="object"&&globalThis)||ZA(typeof window=="object"&&window)||ZA(typeof self=="object"&&self)||ZA(typeof mC=="object"&&mC)||(function(){return this})()||mC||Function("return this")(),B=function(I){try{return!!I()}catch(e){return!0}},mc=B,tA=!mc(function(){var I=(function(){}).bind();return typeof I!="function"||I.hasOwnProperty("prototype")}),vc=tA,Wa=Function.prototype,Jr=Wa.apply,$r=Wa.call,WI=typeof Reflect=="object"&&Reflect.apply||(vc?$r.bind(Jr):function(){return $r.apply(Jr,arguments)}),_a=tA,Ha=Function.prototype,Ei=Ha.call,bc=_a&&Ha.bind.bind(Ei,Ei),Z=_a?bc:function(I){return function(){return Ei.apply(I,arguments)}},Ua=Z,yc=Ua({}.toString),wc=Ua("".slice),ag=function(I){return wc(yc(I),8,-1)},Ec=ag,Tc=Z,er=function(I){if(Ec(I)==="Function")return Tc(I)},Ti=typeof document=="object"&&document.all,xc=typeof Ti=="undefined"&&Ti!==void 0,Ka={all:Ti,IS_HTMLDDA:xc},Qa=Ka,Oc=Qa.all,le=Qa.IS_HTMLDDA?function(I){return typeof I=="function"||I===Oc}:function(I){return typeof I=="function"},AA={},Dc=B,ie=!Dc(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Pc=tA,LA=Function.prototype.call,Ye=Pc?LA.bind(LA):function(){return LA.apply(LA,arguments)},IA={},Xa={}.propertyIsEnumerable,Ja=Object.getOwnPropertyDescriptor,Sc=Ja&&!Xa.call({1:2},1);IA.f=Sc?function(e){var g=Ja(this,e);return!!g&&g.enumerable}:Xa;var CA=function(I,e){return{enumerable:!(I&1),configurable:!(I&2),writable:!(I&4),value:e}},Nc=Z,Rc=B,kc=ag,vC=Object,Mc=Nc("".split),_I=Rc(function(){return!vC("z").propertyIsEnumerable(0)})?function(I){return kc(I)==="String"?Mc(I,""):vC(I)}:vC,mt=function(I){return I==null},Fc=mt,zc=TypeError,iA=function(I){if(Fc(I))throw new zc("Can't call method on "+I);return I},Bc=_I,Zc=iA,We=function(I){return Bc(Zc(I))},qr=le,$a=Ka,Lc=$a.all,ce=$a.IS_HTMLDDA?function(I){return typeof I=="object"?I!==null:qr(I)||I===Lc}:function(I){return typeof I=="object"?I!==null:qr(I)},L={},bC=L,yC=X,Gc=le,es=function(I){return Gc(I)?I:void 0},_e=function(I,e){return arguments.length<2?es(bC[I])||es(yC[I]):bC[I]&&bC[I][e]||yC[I]&&yC[I][e]},jc=Z,J=jc({}.isPrototypeOf),nA=typeof navigator!="undefined"&&String(navigator.userAgent)||"",qa=X,wC=nA,gs=qa.process,ts=qa.Deno,As=gs&&gs.versions||ts&&ts.version,Is=As&&As.v8,Be,uI;Is&&(Be=Is.split("."),uI=Be[0]>0&&Be[0]<4?1:+(Be[0]+Be[1]));!uI&&wC&&(Be=wC.match(/Edge\/(\d+)/),(!Be||Be[1]>=74)&&(Be=wC.match(/Chrome\/(\d+)/),Be&&(uI=+Be[1])));var rA=uI,Cs=rA,Vc=B,Yc=X,Wc=Yc.String,vt=!!Object.getOwnPropertySymbols&&!Vc(function(){var I=Symbol("symbol detection");return!Wc(I)||!(Object(I)instanceof Symbol)||!Symbol.sham&&Cs&&Cs<41}),_c=vt,ed=_c&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Hc=_e,Uc=le,Kc=J,Qc=ed,Xc=Object,sA=Qc?function(I){return typeof I=="symbol"}:function(I){var e=Hc("Symbol");return Uc(e)&&Kc(e.prototype,Xc(I))},Jc=String,oA=function(I){try{return Jc(I)}catch(e){return"Object"}},$c=le,qc=oA,eu=TypeError,_g=function(I){if($c(I))return I;throw new eu(qc(I)+" is not a function")},gu=_g,tu=mt,gr=function(I,e){var g=I[e];return tu(g)?void 0:gu(g)},EC=Ye,TC=le,xC=ce,Au=TypeError,Iu=function(I,e){var g,t;if(e==="string"&&TC(g=I.toString)&&!xC(t=EC(g,I))||TC(g=I.valueOf)&&!xC(t=EC(g,I))||e!=="string"&&TC(g=I.toString)&&!xC(t=EC(g,I)))return t;throw new Au("Can't convert object to primitive value")},gd={exports:{}},is=X,Cu=Object.defineProperty,iu=function(I,e){try{Cu(is,I,{value:e,configurable:!0,writable:!0})}catch(g){is[I]=e}return e},nu=X,ru=iu,ns="__core-js_shared__",su=nu[ns]||ru(ns,{}),tr=su,rs=tr;(gd.exports=function(I,e){return rs[I]||(rs[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 bt=gd.exports,ou=iA,au=Object,xe=function(I){return au(ou(I))},du=Z,lu=xe,hu=du({}.hasOwnProperty),ne=Object.hasOwn||function(e,g){return hu(lu(e),g)},cu=Z,uu=0,fu=Math.random(),pu=cu(1 .toString),HI=function(I){return"Symbol("+(I===void 0?"":I)+")_"+pu(++uu+fu,36)},mu=X,vu=bt,ss=ne,bu=HI,yu=vt,wu=ed,it=mu.Symbol,OC=vu("wks"),Eu=wu?it.for||it:it&&it.withoutSetter||bu,ee=function(I){return ss(OC,I)||(OC[I]=yu&&ss(it,I)?it[I]:Eu("Symbol."+I)),OC[I]},Tu=Ye,os=ce,as=sA,xu=gr,Ou=Iu,Du=ee,Pu=TypeError,Su=Du("toPrimitive"),Nu=function(I,e){if(!os(I)||as(I))return I;var g=xu(I,Su),t;if(g){if(e===void 0&&(e="default"),t=Tu(g,I,e),!os(t)||as(t))return t;throw new Pu("Can't convert object to primitive value")}return e===void 0&&(e="number"),Ou(I,e)},Ru=Nu,ku=sA,UI=function(I){var e=Ru(I,"string");return ku(e)?e:e+""},Mu=X,ds=ce,xi=Mu.document,Fu=ds(xi)&&ds(xi.createElement),td=function(I){return Fu?xi.createElement(I):{}},zu=ie,Bu=B,Zu=td,Ad=!zu&&!Bu(function(){return Object.defineProperty(Zu("div"),"a",{get:function(){return 7}}).a!==7}),Lu=ie,Gu=Ye,ju=IA,Vu=CA,Yu=We,Wu=UI,_u=ne,Hu=Ad,ls=Object.getOwnPropertyDescriptor;AA.f=Lu?ls:function(e,g){if(e=Yu(e),g=Wu(g),Hu)try{return ls(e,g)}catch(t){}if(_u(e,g))return Vu(!Gu(ju.f,e,g),e[g])};var Uu=B,Ku=le,Qu=/#|\.prototype\./,aA=function(I,e){var g=Ju[Xu(I)];return g===qu?!0:g===$u?!1:Ku(e)?Uu(e):!!e},Xu=aA.normalize=function(I){return String(I).replace(Qu,".").toLowerCase()},Ju=aA.data={},$u=aA.NATIVE="N",qu=aA.POLYFILL="P",ef=aA,hs=er,gf=_g,tf=tA,Af=hs(hs.bind),dA=function(I,e){return gf(I),e===void 0?I:tf?Af(I,e):function(){return I.apply(e,arguments)}},Oe={},If=ie,Cf=B,Id=If&&Cf(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),nf=ce,rf=String,sf=TypeError,dg=function(I){if(nf(I))return I;throw new sf(rf(I)+" is not an object")},of=ie,af=Ad,df=Id,GA=dg,cs=UI,lf=TypeError,DC=Object.defineProperty,hf=Object.getOwnPropertyDescriptor,PC="enumerable",SC="configurable",NC="writable";Oe.f=of?df?function(e,g,t){if(GA(e),g=cs(g),GA(t),typeof e=="function"&&g==="prototype"&&"value"in t&&NC in t&&!t[NC]){var A=hf(e,g);A&&A[NC]&&(e[g]=t.value,t={configurable:SC in t?t[SC]:A[SC],enumerable:PC in t?t[PC]:A[PC],writable:!1})}return DC(e,g,t)}:DC:function(e,g,t){if(GA(e),g=cs(g),GA(t),af)try{return DC(e,g,t)}catch(A){}if("get"in t||"set"in t)throw new lf("Accessors not supported");return"value"in t&&(e[g]=t.value),e};var cf=ie,uf=Oe,ff=CA,yt=cf?function(I,e,g){return uf.f(I,e,ff(1,g))}:function(I,e,g){return I[e]=g,I},jA=X,pf=WI,mf=er,vf=le,bf=AA.f,yf=ef,et=L,wf=dA,gt=yt,us=ne,Ef=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 pf(I,this,arguments)};return e.prototype=I.prototype,e},S=function(I,e){var g=I.target,t=I.global,A=I.stat,C=I.proto,i=t?jA:A?jA[g]:(jA[g]||{}).prototype,n=t?et:et[g]||gt(et,g,{})[g],r=n.prototype,s,o,d,a,l,h,c,f,u;for(a in e)s=yf(t?a:g+(A?".":"#")+a,I.forced),o=!s&&i&&us(i,a),h=n[a],o&&(I.dontCallGetSet?(u=bf(i,a),c=u&&u.value):c=i[a]),l=o&&c?c:e[a],!(o&&typeof h==typeof l)&&(I.bind&&o?f=wf(l,jA):I.wrap&&o?f=Ef(l):C&&vf(l)?f=mf(l):f=l,(I.sham||l&&l.sham||h&&h.sham)&&gt(f,"sham",!0),gt(n,a,f),C&&(d=g+"Prototype",us(et,d)||gt(et,d,{}),gt(et[d],a,l),I.real&&r&&(s||!r[a])&&gt(r,a,l)))},Tf=Math.ceil,xf=Math.floor,Of=Math.trunc||function(e){var g=+e;return(g>0?xf:Tf)(g)},Df=Of,KI=function(I){var e=+I;return e!==e||e===0?0:Df(e)},Pf=KI,Sf=Math.max,Nf=Math.min,lA=function(I,e){var g=Pf(I);return g<0?Sf(g+e,0):Nf(g,e)},Rf=KI,kf=Math.min,Mf=function(I){return I>0?kf(Rf(I),9007199254740991):0},Ff=Mf,ke=function(I){return Ff(I.length)},zf=We,Bf=lA,Zf=ke,fs=function(I){return function(e,g,t){var A=zf(e),C=Zf(A),i=Bf(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}},Ar={includes:fs(!0),indexOf:fs(!1)},hA={},Lf=Z,RC=ne,Gf=We,jf=Ar.indexOf,Vf=hA,ps=Lf([].push),Cd=function(I,e){var g=Gf(I),t=0,A=[],C;for(C in g)!RC(Vf,C)&&RC(g,C)&&ps(A,C);for(;e.length>t;)RC(g,C=e[t++])&&(~jf(A,C)||ps(A,C));return A},Ir=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Yf=Cd,Wf=Ir,cA=Object.keys||function(e){return Yf(e,Wf)},uA={};uA.f=Object.getOwnPropertySymbols;var ms=ie,_f=Z,Hf=Ye,Uf=B,kC=cA,Kf=uA,Qf=IA,Xf=xe,Jf=_I,tt=Object.assign,vs=Object.defineProperty,$f=_f([].concat),qf=!tt||Uf(function(){if(ms&&tt({b:1},tt(vs({},"a",{enumerable:!0,get:function(){vs(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}),tt({},I)[g]!==7||kC(tt({},e)).join("")!==t})?function(e,g){for(var t=Xf(e),A=arguments.length,C=1,i=Kf.f,n=Qf.f;A>C;)for(var r=Jf(arguments[C++]),s=i?$f(kC(r),i(r)):kC(r),o=s.length,d=0,a;o>d;)a=s[d++],(!ms||Hf(n,r,a))&&(t[a]=r[a]);return t}:tt,ep=S,bs=qf;ep({target:"Object",stat:!0,arity:2,forced:Object.assign!==bs},{assign:bs});var gp=L,tp=gp.Object.assign,Ap=tp,Ip=Ap,Cp=Ip,q=P(Cp),ip=Z,QI=ip([].slice),id=Z,np=_g,rp=ce,sp=ne,ys=QI,op=tA,nd=Function,ap=id([].concat),dp=id([].join),MC={},lp=function(I,e,g){if(!sp(MC,e)){for(var t=[],A=0;A<e;A++)t[A]="a["+A+"]";MC[e]=nd("C,a","return new C("+dp(t,",")+")")}return MC[e](I,g)},hp=op?nd.bind:function(e){var g=np(this),t=g.prototype,A=ys(arguments,1),C=function(){var n=ap(A,ys(arguments));return this instanceof C?lp(g,n.length,n):g.apply(e,n)};return rp(t)&&(C.prototype=t),C},cp=S,ws=hp;cp({target:"Function",proto:!0,forced:Function.bind!==ws},{bind:ws});var up=L,Ie=function(I){return up[I+"Prototype"]},fp=Ie,pp=fp("Function").bind,mp=J,vp=pp,FC=Function.prototype,bp=function(I){var e=I.bind;return I===FC||mp(FC,I)&&e===FC.bind?vp:e},yp=bp,wp=yp,Ep=wp,b=P(Ep);function Cr(I,e,g,t){I.beginPath(),I.arc(e,g,t,0,2*Math.PI,!1),I.closePath()}function Tp(I,e,g,t){I.beginPath(),I.rect(e-t,g-t,t*2,t*2),I.closePath()}function xp(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 Op(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 Dp(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 Pp(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 rd(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 Oi(I,e,g,t,A){let C=.5522848,i=t/2*C,n=A/2*C,r=e+t,s=g+A,o=e+t/2,d=g+A/2;I.beginPath(),I.moveTo(e,d),I.bezierCurveTo(e,d-n,o-i,g,o,g),I.bezierCurveTo(o+i,g,r,d-n,r,d),I.bezierCurveTo(r,d+n,o+i,s,o,s),I.bezierCurveTo(o-i,s,e,d+n,e,d),I.closePath()}function sd(I,e,g,t,A){let C=.3333333333333333,i=t,n=A*C,r=.5522848,s=i/2*r,o=n/2*r,d=e+i,a=g+n,l=e+i/2,h=g+n/2,c=g+(A-n/2),f=g+A;I.beginPath(),I.moveTo(d,h),I.bezierCurveTo(d,h+o,l+s,a,l,a),I.bezierCurveTo(l-s,a,e,h+o,e,h),I.bezierCurveTo(e,h-o,l-s,g,l,g),I.bezierCurveTo(l+s,g,d,h-o,d,h),I.lineTo(d,c),I.bezierCurveTo(d,c+o,l+s,f,l,f),I.bezierCurveTo(l-s,f,e,c+o,e,c),I.lineTo(e,h)}function od(I,e,g,t,A,C){I.beginPath(),I.moveTo(e,g);let i=C.length,n=t-e,r=A-g,s=r/n,o=Math.sqrt(n*n+r*r),d=0,a=!0,l=0,h=+C[0];for(;o>=.1;)h=+C[d++%i],h>o&&(h=o),l=Math.sqrt(h*h/(1+s*s)),l=n<0?-l:l,e+=l,g+=s*l,a===!0?I.lineTo(e,g):I.moveTo(e,g),o-=h,a=!a}function Sp(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 Es={circle:Cr,dashedLine:od,database:sd,diamond:Pp,ellipse:Oi,ellipse_vis:Oi,hexagon:Sp,roundRect:rd,square:Tp,star:Dp,triangle:xp,triangleDown:Op};function Np(I){return Object.prototype.hasOwnProperty.call(Es,I)?Es[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 Hg(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
3
  position: absolute;
3
4
  top: 0px;
4
5
  right: 0px;
@@ -12,13 +13,13 @@
12
13
  .vis-active {
13
14
  box-shadow: 0 0 10px #86d5f8;
14
15
  }
15
- `;_g(op);var ap=`/* override some bootstrap styles screwing up the timelines css */
16
+ `;Hg(Rp);var kp=`/* override some bootstrap styles screwing up the timelines css */
16
17
 
17
18
  .vis [class*="span"] {
18
19
  min-height: 0;
19
20
  width: auto;
20
21
  }
21
- `;_g(ap);var dp=`div.vis-color-picker {
22
+ `;Hg(kp);var Mp=`div.vis-color-picker {
22
23
  position: absolute;
23
24
  top: 0px;
24
25
  left: 30px;
@@ -263,7 +264,7 @@ div.vis-color-picker input.vis-range-brightness {
263
264
  div.vis-color-picker input.vis-saturation-range {
264
265
  width: 289px !important;
265
266
  }*/
266
- `;_g(dp);var lp=`div.vis-configuration {
267
+ `;Hg(Mp);var Fp=`div.vis-configuration {
267
268
  position: relative;
268
269
  display: block;
269
270
  float: left;
@@ -606,7 +607,7 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper {
606
607
  border-width: 12px;
607
608
  margin-top: -12px;
608
609
  }
609
- `;_g(lp);var hp=`div.vis-tooltip {
610
+ `;Hg(Fp);var zp=`div.vis-tooltip {
610
611
  position: absolute;
611
612
  visibility: hidden;
612
613
  padding: 5px;
@@ -627,12 +628,12 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper {
627
628
 
628
629
  z-index: 5;
629
630
  }
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=og,Dg=Array.isArray||function(e){return up(e)==="Array"},fp=TypeError,pp=9007199254740991,er=function(I){if(I>pp)throw fp("Maximum allowed index exceeded");return I},mp=WI,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 gr=String(gd)==="[object z]",Ep=gr,Tp=le,II=og,xp=ee,Op=xp("toStringTag"),Pp=Object,Dp=II((function(){return arguments})())==="Arguments",Rp=function(I,e){try{return I[e]}catch(g){}},dg=Ep?II:function(I){var e,g,t;return I===void 0?"Undefined":I===null?"Null":typeof(g=Rp(e=Pp(I),Op))=="string"?g:Dp?II(e):(t=II(e))==="Object"&&Tp(e.callee)?"Arguments":t},Np=Z,Sp=le,yi=Xn,kp=Np(Function.toString);Sp(yi.inspectSource)||(yi.inspectSource=function(I){return kp(I)});var Mp=yi.inspectSource,Fp=Z,Bp=z,td=le,zp=dg,Zp=We,Lp=Mp,Ad=function(){},Gp=[],Id=Zp("Reflect","construct"),tr=/^\s*(?:class|function)\b/,Vp=Fp(tr.exec),jp=!tr.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(tr,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,ls=Dg,Yp=id,Wp=ce,_p=ee,Kp=_p("species"),hs=Array,Up=function(I){var e;return ls(I)&&(e=I.constructor,Yp(e)&&(e===hs||ls(e.prototype))?e=void 0:Wp(e)&&(e=e[Kp],e===null&&(e=void 0))),e===void 0?hs: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=R,em=z,gm=Dg,tm=ce,Am=xe,Im=Se,cs=er,us=uA,Cm=UI,im=fA,nm=ee,rm=nA,nd=nm("isConcatSpreadable"),sm=rm>=51||!em(function(){var I=[];return I[nd]=!1,I.concat()[0]!==I}),om=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,r,s;for(C=-1,n=arguments.length;C<n;C++)if(s=C===-1?g:arguments[C],om(s))for(r=Im(s),cs(A+r),i=0;i<r;i++,A++)i in s&&us(t,A,s[i]);else cs(A+1),us(t,A++,s);return t.length=A,t}});var dm=dg,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=ag,pm=Ye,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=We,bm=vm("document","documentElement"),ym=mt,wm=YI,fs=ym("keys"),QI=function(I){return fs[I]||(fs[I]=wm(I))},Em=ag,Tm=HI,ps=$n,xm=lA,Om=bm,Pm=Wa,Dm=QI,ms=">",vs="<",wi="prototype",Ei="script",rd=Dm("IE_PROTO"),RC=function(){},sd=function(I){return vs+Ei+ms+I+vs+"/"+Ei+ms},bs=function(I){I.write(sd("")),I.close();var e=I.parentWindow.Object;return I=null,e},Rm=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?bs(LA):Rm():bs(LA);for(var I=ps.length;I--;)delete CI[wi][ps[I]];return CI()};xm[rd]=!0;var pA=Object.create||function(e,g){var t;return e!==null?(RC[wi]=Em(e),t=new RC,RC[wi]=null,t[rd]=e):t=CI(),g===void 0?t:Tm.f(t,g)},mA={},Nm=Ua,Sm=$n,km=Sm.concat("length","prototype");mA.f=Object.getOwnPropertyNames||function(e){return Nm(e,km)};var XI={},ys=dA,Mm=Se,Fm=uA,Bm=Array,zm=Math.max,od=function(I,e,g){for(var t=Mm(I),A=ys(e,t),C=ys(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=og,Lm=Ye,ad=mA.f,Gm=od,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},Ym=Oe,Ar=function(I,e,g){return Ym.f(I,e,g)},bA={},Wm=ee;bA.f=Wm;var ws=L,_m=ne,Km=bA,Um=Oe.f,$=function(I){var e=ws.Symbol||(ws.Symbol={});_m(e,I)||Um(e,I,{value:Km.f(I)})},Hm=je,Qm=We,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=gr,qm=dg,ev=$m?{}.toString:function(){return"[object "+qm(this)+"]"},gv=gr,tv=Oe.f,Av=vt,Iv=ne,Cv=ev,iv=ee,Es=iv("toStringTag"),bt=function(I,e,g,t){if(I){var A=g?I:I.prototype;Iv(A,Es)||tv(A,Es,{configurable:!0,value:e}),t&&!gv&&Av(A,"toString",Cv)}},nv=X,rv=le,Ts=nv.WeakMap,hd=rv(Ts)&&/native code/.test(String(Ts)),sv=hd,cd=X,ov=ce,av=vt,NC=ne,SC=Xn,dv=QI,lv=lA,xs="Object already initialized",Ti=cd.TypeError,hv=cd.WeakMap,hI,Wt,cI,cv=function(I){return cI(I)?Wt(I):hI(I,{})},uv=function(I){return function(e){var g;if(!ov(e)||(g=Wt(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(xs);return e.facade=I,Fe.set(I,e),e},Wt=function(I){return Fe.get(I)||{}},cI=function(I){return Fe.has(I)}):(Ng=dv("state"),lv[Ng]=!0,hI=function(I,e){if(NC(I,Ng))throw new Ti(xs);return e.facade=I,av(I,Ng,e),e},Wt=function(I){return NC(I,Ng)?I[Ng]:{}},cI=function(I){return NC(I,Ng)});var Fe,Ng,Kg={set:hI,get:Wt,has:cI,enforce:cv,getterFor:uv},fv=aA,pv=Z,mv=jI,vv=xe,bv=Se,yv=UI,Os=pv([].push),hg=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(r,s,o,a){for(var d=vv(r),l=mv(d),h=fv(s,o),c=bv(l),p=0,u=a||yv,m=e?u(r,c):g||i?u(r,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:Os(m,E)}else switch(I){case 4:return!1;case 7:Os(m,E)}return C?-1:t||A?A:m}},Rg={forEach:hg(0),map:hg(1),filter:hg(2),some:hg(3),every:hg(4),find:hg(5),findIndex:hg(6),filterReject:hg(7)},JI=R,$I=X,Ir=je,wv=Z,at=ie,dt=pt,Ev=z,se=ne,Tv=J,xi=ag,qI=Ye,Cr=WI,xv=qe,Oi=IA,_t=pA,ud=hA,Ov=mA,fd=XI,Pv=cA,pd=tA,md=Oe,Dv=HI,vd=AA,Ps=vA,Rv=Ar,ir=mt,Nv=QI,bd=lA,Ds=YI,Sv=ee,kv=bA,Mv=$,Fv=ld,Bv=bt,yd=Kg,eC=Rg.forEach,Ee=Nv("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=ir("symbols"),yA=ir("op-symbols"),Vv=ir("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=Cr(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)},nr=function(e,g){xi(e);var t=qI(g),A=ud(t).concat(Rd(t));return eC(A,function(C){(!at||Ir(Od,t,C))&&tC(e,C,t[C])}),e},jv=function(e,g){return g===void 0?_t(e):nr(_t(e),g)},Od=function(e){var g=Cr(e),t=Ir(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=Cr(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},Rd=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=Ds(e),t=function(A){this===Ge&&Ir(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],Ps(Ft,"toString",function(){return Rs(this).tag}),Ps(Fg,"withoutSetter",function(I){return MC(Ds(I),I)}),vd.f=Od,md.f=tC,Dv.f=nr,pd.f=Pd,Ov.f=fd.f=Dd,Pv.f=Rd,kv.f=function(I){return MC(Sv(I),I)},at&&Rv(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:nr,getOwnPropertyDescriptor:Pd});JI({target:"Object",stat:!0,forced:!dt},{getOwnPropertyNames:Dd});Fv();Bv(Fg,gC);bd[Ee]=!0;var Yv=pt,Nd=Yv&&!!Symbol.for&&!!Symbol.keyFor,Wv=R,_v=We,Kv=ne,Uv=qe,Sd=mt,Hv=Nd,FC=Sd("string-to-symbol-registry"),Qv=Sd("symbol-to-string-registry");Wv({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=R,Jv=ne,$v=rA,qv=sA,eb=mt,gb=Nd,Ns=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(Ns,e))return Ns[e]}});var tb=Z,Ss=Dg,Ab=le,ks=og,Ib=qe,Ms=tb([].push),Cb=function(I){if(Ab(I))return I;if(Ss(I)){for(var e=I.length,g=[],t=0;t<e;t++){var A=I[t];typeof A=="string"?Ms(g,A):(typeof A=="number"||ks(A)==="Number"||ks(A)==="String")&&Ms(g,Ib(A))}var C=g.length,i=!0;return function(n,r){if(i)return i=!1,r;if(Ss(this))return r;for(var s=0;s<C;s++)if(g[s]===n)return r}}},ib=R,kd=We,Md=VI,nb=je,wA=Z,Fd=z,Fs=le,Bs=rA,Bd=KI,rb=Cb,sb=pt,ob=String,yg=kd("JSON","stringify"),GA=wA(/./.exec),zs=wA("".charAt),ab=wA("".charCodeAt),db=wA("".replace),lb=wA(1 .toString),hb=/[\uD800-\uDFFF]/g,Zs=/^[\uD800-\uDBFF]$/,Ls=/^[\uDC00-\uDFFF]$/,Gs=!sb||Fd(function(){var I=kd("Symbol")("stringify detection");return yg([I])!=="[null]"||yg({a:I})!=="{}"||yg(Object(I))!=="{}"}),Vs=Fd(function(){return yg("\uDF06\uD834")!=='"\\udf06\\ud834"'||yg("\uDEAD")!=='"\\udead"'}),cb=function(I,e){var g=Bd(arguments),t=rb(e);if(!(!Fs(t)&&(I===void 0||Bs(I))))return g[1]=function(A,C){if(Fs(t)&&(C=nb(t,this,ob(A),C)),!Bs(C))return C},Md(yg,null,g)},ub=function(I,e,g){var t=zs(g,e-1),A=zs(g,e+1);return GA(Zs,I)&&!GA(Ls,A)||GA(Ls,I)&&!GA(Zs,t)?"\\u"+lb(ab(I,0),16):I};yg&&ib({target:"JSON",stat:!0,arity:3,forced:Gs||Vs},{stringify:function(e,g,t){var A=Bd(arguments),C=Md(Gs?cb:yg,null,A);return Vs&&typeof C=="string"?db(C,hb,ub):C}});var fb=R,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 Rb=$;Rb("species");var Nb=$;Nb("split");var Sb=$,kb=ld;Sb("toPrimitive");kb();var Mb=We,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={},Ri=ie,jb=ne,Zd=Function.prototype,Yb=Ri&&Object.getOwnPropertyDescriptor,rr=jb(Zd,"name"),Wb=rr&&(function(){}).name==="something",_b=rr&&(!Ri||Ri&&Yb(Zd,"name").configurable),Kb={EXISTS:rr,PROPER:Wb,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,js=Jb("IE_PROTO"),Ni=Object,qb=Ni.prototype,AC=$b?Ni.getPrototypeOf:function(I){var e=Xb(I);if(Hb(e,js))return e[js];var g=e.constructor;return Qb(g)&&e instanceof g?g.prototype:e instanceof Ni?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,ry=pA,sy=IA,oy=bt,ay=yt,dy=function(){return this},ly=function(I,e,g,t){var A=e+" Iterator";return I.prototype=ry(ny,{next:sy(+!t,g)}),oy(I,A,!1,!0),ay[A]=dy,I},hy=R,cy=je,jd=Kb,uy=ly,fy=AC,py=bt,Ws=vA,my=ee,_s=yt,Yd=Vd,vy=jd.PROPER;jd.CONFIGURABLE;Yd.IteratorPrototype;var VA=Yd.BUGGY_SAFARI_ITERATORS,ZC=my("iterator"),Ks="keys",jA="values",Us="entries",by=function(){return this},sr=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 o)return o[u];switch(u){case Ks:return function(){return new g(this,u)};case jA:return function(){return new g(this,u)};case Us:return function(){return new g(this,u)}}return function(){return new g(this)}},r=e+" Iterator",s=!1,o=I.prototype,a=o[ZC]||o["@@iterator"]||A&&o[A],d=!VA&&a||n(A),l=e==="Array"&&o.entries||a,h,c,p;if(l&&(h=fy(l.call(new I)),h!==Object.prototype&&h.next&&(py(h,r,!0,!0),_s[r]=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(Ks),entries:n(Us)},i)for(p in c)(VA||s||!(p in o))&&Ws(o,p,c[p]);else hy({target:e,proto:!0,forced:VA||s},c);return i&&o[ZC]!==d&&Ws(o,ZC,d,{name:A}),_s[e]=d,c},or=function(I,e){return{value:I,done:e}},yy=Ye,Hs=yt,Wd=Kg;Oe.f;var wy=sr,YA=or,_d="Array Iterator",Ey=Wd.set,Ty=Wd.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,YA(void 0,!0);switch(g){case"keys":return YA(t,!1);case"values":return YA(e[t],!1)}return YA([t,e[t]],!1)},"values");Hs.Arguments=Hs.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=dg,Ry=vt,Qs=yt,Ny=ee,Xs=Ny("toStringTag");for(WA in Oy)LC=Py[WA],_A=LC&&LC.prototype,_A&&Dy(_A)!==Xs&&Ry(_A,Xs,WA),Qs[WA]=Qs.Array;var LC,_A,WA,Sy=Vb,Kd=Sy,ky=Kd,My=D(ky),Fy=R,Js=Dg,By=id,zy=ce,$s=dA,Zy=Se,Ly=Ye,Gy=uA,Vy=ee,jy=fA,Yy=KI,Wy=jy("slice"),_y=Vy("species"),GC=Array,Ky=Math.max;Fy({target:"Array",proto:!0,forced:!Wy},{slice:function(e,g){var t=Ly(this),A=Zy(t),C=$s(e,A),i=$s(g===void 0?A:g,A),n,r,s;if(Js(t)&&(n=t.constructor,By(n)&&(n===GC||Js(n.prototype))?n=void 0:zy(n)&&(n=n[_y],n===null&&(n=void 0)),n===GC||n===void 0))return Yy(t,C,i);for(r=new(n===void 0?GC:n)(Ky(i-C,0)),s=0;C<i;C++,s++)C in t&&Gy(r,s,t[C]);return r.length=s,r}});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=We,t0=Z,A0=mA,I0=cA,C0=ag,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=R,r0=Ud;n0({target:"Reflect",stat:!0},{ownKeys:r0});var s0=L,o0=s0.Reflect.ownKeys,a0=o0,d0=a0,l0=d0,h0=D(l0),c0=R,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=R,w0=Rg.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,R0=function(I){var e=I.map;return I===jC||P0(jC,I)&&e===jC.map?D0:e},N0=R0,S0=N0,k0=S0,ae=D(k0),M0=R,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),Y0=R,W0=Z,Qd=Date,_0=W0(Qd.prototype.getTime);Y0({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=Rg.forEach,q0=wt,ew=q0("forEach"),gw=ew?[].forEach:function(e){return $0(this,e,arguments.length>1?arguments[1]:void 0)},tw=R,qs=gw;tw({target:"Array",proto:!0,forced:[].forEach!==qs},{forEach:qs});var Aw=Ie,Iw=Aw("Array").forEach,Cw=Iw,iw=Cw,nw=dg,rw=ne,sw=J,ow=iw,YC=Array.prototype,aw={DOMTokenList:!0,NodeList:!0},dw=function(I){var e=I.forEach;return I===YC||sw(YC,I)&&e===YC.forEach||rw(aw,nw(I))?ow:e},lw=dw,F=D(lw),hw=R,cw=Z,uw=Dg,fw=cw([].reverse),eo=[1,2];hw({target:"Array",proto:!0,forced:String(eo)===String(eo.reverse())},{reverse:function(){return uw(this)&&(this.length=this.length),fw(this)}});var pw=Ie,mw=pw("Array").reverse,vw=J,bw=mw,WC=Array.prototype,yw=function(I){var e=I.reverse;return I===WC||vw(WC,I)&&e===WC.reverse?bw:e},ww=yw,Ew=ww,Tw=Ew,zg=D(Tw),xw=ie,Ow=Dg,Pw=TypeError,Dw=Object.getOwnPropertyDescriptor,Rw=xw&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(I){return I instanceof TypeError}})(),Nw=Rw?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},go=sA,Sw=TypeError,Xd=function(I,e){if(!delete I[e])throw new Sw("Cannot delete property "+go(e)+" of "+go(I))},kw=R,Mw=xe,Fw=dA,Bw=_I,zw=Se,Zw=Nw,Lw=er,Gw=UI,Vw=uA,_C=Xd,jw=fA,Yw=jw("splice"),Ww=Math.max,_w=Math.min;kw({target:"Array",proto:!0,forced:!Yw},{splice:function(e,g){var t=Mw(this),A=zw(t),C=Fw(e,A),i=arguments.length,n,r,s,o,a,d;for(i===0?n=r=0:i===1?(n=0,r=A-C):(n=i-2,r=_w(Ww(Bw(g),0),A-C)),Lw(A+n-r),s=Gw(t,r),o=0;o<r;o++)a=C+o,a in t&&Vw(s,o,t[a]);if(s.length=r,n<r){for(o=C;o<A-r;o++)a=o+r,d=o+n,a in t?t[d]=t[a]:_C(t,d);for(o=A;o>A-r+n;o--)_C(t,o-1)}else if(n>r)for(o=A-r;o>C;o--)a=o+r-1,d=o+n-1,a in t?t[d]=t[a]:_C(t,d);for(o=0;o<n;o++)t[o+C]=arguments[o+2];return Zw(t,A-r+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=R,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=og,rE=ee,sE=rE("match"),oE=function(I){var e;return iE(I)&&((e=I[sE])!==void 0?!!e:nE(I)==="RegExp")},aE=oE,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=R,pE=Z,mE=lE,vE=CA,to=qe,bE=uE,yE=pE("".indexOf);fE({target:"String",proto:!0,forced:!bE("includes")},{includes:function(e){return!!~yE(to(vE(this)),to(mE(e)),arguments.length>1?arguments[1]:void 0)}});var wE=Ie,EE=wE("String").includes,Ao=J,TE=CE,xE=EE,UC=Array.prototype,HC=String.prototype,OE=function(I){var e=I.includes;return I===UC||Ao(UC,I)&&e===UC.includes?TE:typeof I=="string"||I===HC||Ao(HC,I)&&e===HC.includes?xE:e},PE=OE,DE=PE,RE=DE,wg=D(RE),NE=R,SE=z,kE=xe,Jd=AC,ME=Ld,FE=SE(function(){Jd(1)});NE({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,Io=D(GE),VE=Ie,jE=VE("Array").concat,YE=J,WE=jE,QC=Array.prototype,_E=function(I){var e=I.concat;return I===QC||YE(QC,I)&&e===QC.concat?WE:e},KE=_E,UE=KE,HE=UE,$d=D(HE),QE=R,XE=Rg.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,rT=AC,sT=hA,oT=Ye,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)}),Co=function(I){return function(e){for(var g=oT(e),t=sT(g),A=lT&&rT(g)===null,C=t.length,i=0,n=[],r;C>i;)r=t[i++],(!qd||(A?r in g:gl(g,r)))&&dT(n,I?[r,g[r]]:g[r]);return n}},hT={entries:Co(!0),values:Co(!1)},cT=R,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),ar=`
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=ar,io=wT("".replace),xT=RegExp("^["+ki+"]+"),OT=RegExp("(^|[^"+ki+"])["+ki+"]+$"),JC=function(I){return function(e){var g=TT(ET(e));return I&1&&(g=io(g,xT,"")),I&2&&(g=io(g,OT,"$1")),g}},tl={start:JC(1),end:JC(2),trim:JC(3)},Al=X,PT=z,DT=Z,RT=qe,NT=tl.trim,no=ar,Zt=Al.parseInt,ro=Al.Symbol,so=ro&&ro.iterator,Il=/^[+-]?0x/i,ST=DT(Il.exec),kT=Zt(no+"08")!==8||Zt(no+"0x16")!==22||so&&!PT(function(){Zt(Object(so))}),MT=kT?function(e,g){var t=NT(RT(e));return Zt(t,g>>>0||(ST(Il,t)?16:10))}:Zt,FT=R,oo=MT;FT({global:!0,forced:parseInt!==oo},{parseInt:oo});var BT=L,zT=BT.parseInt,ZT=zT,LT=ZT,GT=LT,ze=D(GT),VT=R,jT=Hn,YT=Jn.indexOf,WT=wt,Mi=jT([].indexOf),Cl=!!Mi&&1/Mi([1],1,-0)<0,_T=Cl||!WT("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:YT(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=R,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,rx=nx,Eg=D(rx),Fi=L,sx=VI;Fi.JSON||(Fi.JSON={stringify:JSON.stringify});var ox=function(e,g,t){return sx(Fi.JSON.stringify,null,arguments)},ax=ox,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):[],r=C?function(){fx(i,this,n)}:i;return e?I(r,A):I(r)}:I},Tx=R,rl=X,xx=nl,ao=xx(rl.setInterval,!0);Tx({global:!0,bind:!0,forced:rl.setInterval!==ao},{setInterval:ao});var Ox=R,sl=X,Px=nl,lo=Px(sl.setTimeout,!0);Ox({global:!0,bind:!0,forced:sl.setTimeout!==lo},{setTimeout:lo});var Dx=L,Rx=Dx.setTimeout,Nx=Rx,He=D(Nx),Sx=xe,ho=dA,kx=Se,Mx=function(e){for(var g=Sx(this),t=kx(g),A=arguments.length,C=ho(A>1?arguments[1]:void 0,t),i=A>2?arguments[2]:void 0,n=i===void 0?t:ho(i,t);n>C;)g[C++]=e;return g},Fx=R,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,Yx=jx,Wx=Yx,EA=D(Wx);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,co=["","webkit","Moz","MS","ms","o"],_x=typeof document=="undefined"?{style:{}}:document.createElement("div"),Kx="function",Ct=Math.round,Vg=Math.abs,dr=Date.now;function IC(I,e){for(var g,t,A=e[0].toUpperCase()+e.slice(1),C=0;C<co.length;){if(g=co[C],t=g?g+A:e,t in I)return t;C++}}var tg;typeof window=="undefined"?tg={}:tg=window;var ol=IC(_x.style,"touchAction"),al=ol!==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",lr="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[ol]=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],r=kg(i,Ht)&&!UA[Ht],s=kg(i,Ut)&&!UA[Ut];if(n){var o=t.pointers.length===1,a=t.distance<2,d=t.deltaTime<250;if(o&&a&&d)return}if(!(s&&r)&&(n||r&&C&Qe||s&&C&Lg))return this.preventSrc(A)},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},I})();function hr(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 uo(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:dr(),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 r=e.deltaX-g.deltaX,s=e.deltaY-g.deltaY,o=vl(t,r,s);C=o.x,i=o.y,A=Vg(o.x)>Vg(o.y)?o.x:o.y,n=ml(r,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=uo(e)),A>1&&!g.firstMultiple?g.firstMultiple=uo(e):A===1&&(g.firstMultiple=!1);var C=g.firstInput,i=g.firstMultiple,n=i?i.center:C.center,r=e.center=pl(t);e.timeStamp=dr(),e.deltaTime=e.timeStamp-C.timeStamp,e.angle=Zi(n,r),e.distance=mI(n,r),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 o=I.element,a=e.srcEvent,d;a.composedPath?d=a.composedPath()[0]:a.path?d=a.path[0]:d=a.target,hr(d,o)&&(o=d),e.target=o}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 fo(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(fo(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(fo(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},rO={2:TA,3:Jx,4:lr,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",""),r=nO[n],s=rO[A.pointerType]||A.pointerType,o=s===TA,a=jg(C,A.pointerId,"pointerId");r&be&&(A.button===0||o)?a<0&&(C.push(A),a=C.length-1):r&(Ae|Te)&&(i=!0),!(a<0)&&(C[a]=A,this.callback(this.manager,r,{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 cr(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,r){return n[e]>r[e]}):t=t.sort()),t}var sO={touchstart:be,touchmove:Ug,touchend:Ae,touchcancel:Te},oO="touchstart touchmove touchend touchcancel",ur=(function(I){ke(e,I);function e(){var t;return e.prototype.evTarget=oO,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=[],r=this.target;if(C=g.filter(function(s){return hr(s.target,r)}),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[cr(C.concat(n),"identifier",!0),n]}var dO={mousedown:be,mousemove:Ug,mouseup:Ae},lO="mousedown",hO="mousemove mouseup",fr=(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:lr,srcEvent:A}))},e})(Tt),cO=2500,po=25;function mo(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,mo.call(this,e)):I&(Ae|Te)&&mo.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<=po&&i<=po)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,r,s){var o=s.pointerType===TA,a=s.pointerType===lr;if(!(a&&s.sourceCapabilities&&s.sourceCapabilities.firesTouchEvents)){if(o)uO.call(KA(KA(i)),r,s);else if(a&&fO.call(KA(KA(i)),s))return;i.callback(n,r,s)}},i.touch=new ur(i.manager,i.handler),i.mouse=new fr(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=ur:hl?e=El:e=fr,new e(I,iO)}function it(I,e,g){return Array.isArray(I)?(Ag(I,g[e],g),!0):!1}var iI=1,Ne=2,ht=4,Tg=8,Ig=Tg,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 vo(I){return I&Jt?"cancel":I&Tg?"end":I&ht?"move":I&Ne?"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<Tg&&i(A.options.event+vo(C)),i(A.options.event),t.additionalEvent&&i(t.additionalEvent),C>=Tg&&i(A.options.event+vo(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&(Ne|ht|Tg|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,r=A.distance<i.threshold,s=A.deltaTime<i.time;if(this.reset(),A.eventType&be&&this.count===0)return this.failTimeout();if(r&&s&&n){if(A.eventType!==Ae)return this.failTimeout();var o=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||!o?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),Ne):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&(Ne|ht),r=this.attrTest(A);return n&&(i&Te||!r)?C|Jt:n||r?i&Ae?C|Tg:C&Ne?C|ht:Ne:_e},e})(DA);function Tl(I){return I===lt?"down":I===PA?"up":I===xA?"left":I===OA?"right":""}var pr=(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,r=A.direction,s=A.deltaX,o=A.deltaY;return r&C.direction||(C.direction&Qe?(r=s===0?fI:s<0?xA:OA,i=s!==this.pX,n=Math.abs(A.deltaX)):(r=o===0?fI:o<0?PA:lt,i=o!==this.pY,n=Math.abs(A.deltaY))),A.direction=r,i&&n>C.threshold&&r&C.direction},g.attrTest=function(A){return ct.prototype.attrTest.call(this,A)&&(this.state&Ne||!(this.state&Ne)&&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 pr.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&Ne)},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&Ne)},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,r=A.distance<i.threshold,s=A.deltaTime>i.time;if(this._input=A,!r||!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=dr(),this.manager.emit(this.options.event,this._input)))},e})(DA),Rl={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)"}},bo=[[Pl,{enable:!1}],[Ol,{enable:!1},["rotate"]],[xl,{direction:Qe}],[pr,{direction:Qe},["swipe"]],[Li],[Li,{event:"doubletap",taps:2},["tap"]],[Dl]],bO=1,yo=2;function wo(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 Eo=(function(){function I(g,t){var A=this;this.options=Gg({},Rl,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),wo(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?yo: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 r=0;r<i.length;)C=i[r],A.stopped!==yo&&(!n||C===n||C.canRecognizeWith(n))?C.recognize(t):C.reset(),!n&&C.state&(Ne|ht|Tg)&&(A.curRecognizer=C,n=C),r++}},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&&wo(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=cr(g.concat(t),"identifier",!0)),[g,t]}function Nl(I,e,g){var t="DEPRECATED METHOD: "+e+`
631
+ `;Hg(zp);var ad={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}})(ad);var Bp=ad.exports,dd=P(Bp),Zp=ag,Sg=Array.isArray||function(e){return Zp(e)==="Array"},Lp=TypeError,Gp=9007199254740991,ir=function(I){if(I>Gp)throw Lp("Maximum allowed index exceeded");return I},jp=UI,Vp=Oe,Yp=CA,fA=function(I,e,g){var t=jp(e);t in I?Vp.f(I,t,Yp(0,g)):I[t]=g},Wp=ee,_p=Wp("toStringTag"),ld={};ld[_p]="z";var nr=String(ld)==="[object z]",Hp=nr,Up=le,nI=ag,Kp=ee,Qp=Kp("toStringTag"),Xp=Object,Jp=nI((function(){return arguments})())==="Arguments",$p=function(I,e){try{return I[e]}catch(g){}},lg=Hp?nI:function(I){var e,g,t;return I===void 0?"Undefined":I===null?"Null":typeof(g=$p(e=Xp(I),Qp))=="string"?g:Jp?nI(e):(t=nI(e))==="Object"&&Up(e.callee)?"Arguments":t},qp=Z,em=le,Di=tr,gm=qp(Function.toString);em(Di.inspectSource)||(Di.inspectSource=function(I){return gm(I)});var tm=Di.inspectSource,Am=Z,Im=B,hd=le,Cm=lg,im=_e,nm=tm,cd=function(){},rm=[],ud=im("Reflect","construct"),rr=/^\s*(?:class|function)\b/,sm=Am(rr.exec),om=!rr.test(cd),St=function(e){if(!hd(e))return!1;try{return ud(cd,rm,e),!0}catch(g){return!1}},fd=function(e){if(!hd(e))return!1;switch(Cm(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return om||!!sm(rr,nm(e))}catch(g){return!0}};fd.sham=!0;var pd=!ud||Im(function(){var I;return St(St.call)||!St(Object)||!St(function(){I=!0})||I})?fd:St,Ts=Sg,am=pd,dm=ce,lm=ee,hm=lm("species"),xs=Array,cm=function(I){var e;return Ts(I)&&(e=I.constructor,am(e)&&(e===xs||Ts(e.prototype))?e=void 0:dm(e)&&(e=e[hm],e===null&&(e=void 0))),e===void 0?xs:e},um=cm,XI=function(I,e){return new(um(I))(e===0?0:e)},fm=B,pm=ee,mm=rA,vm=pm("species"),pA=function(I){return mm>=51||!fm(function(){var e=[],g=e.constructor={};return g[vm]=function(){return{foo:1}},e[I](Boolean).foo!==1})},bm=S,ym=B,wm=Sg,Em=ce,Tm=xe,xm=ke,Os=ir,Ds=fA,Om=XI,Dm=pA,Pm=ee,Sm=rA,md=Pm("isConcatSpreadable"),Nm=Sm>=51||!ym(function(){var I=[];return I[md]=!1,I.concat()[0]!==I}),Rm=function(I){if(!Em(I))return!1;var e=I[md];return e!==void 0?!!e:wm(I)},km=!Nm||!Dm("concat");bm({target:"Array",proto:!0,arity:1,forced:km},{concat:function(e){var g=Tm(this),t=Om(g,0),A=0,C,i,n,r,s;for(C=-1,n=arguments.length;C<n;C++)if(s=C===-1?g:arguments[C],Rm(s))for(r=xm(s),Os(A+r),i=0;i<r;i++,A++)i in s&&Ds(t,A,s[i]);else Os(A+1),Ds(t,A++,s);return t.length=A,t}});var Mm=lg,Fm=String,eg=function(I){if(Mm(I)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Fm(I)},JI={},zm=ie,Bm=Id,Zm=Oe,Lm=dg,Gm=We,jm=cA;JI.f=zm&&!Bm?Object.defineProperties:function(e,g){Lm(e);for(var t=Gm(g),A=jm(g),C=A.length,i=0,n;C>i;)Zm.f(e,n=A[i++],t[n]);return e};var Vm=_e,Ym=Vm("document","documentElement"),Wm=bt,_m=HI,Ps=Wm("keys"),$I=function(I){return Ps[I]||(Ps[I]=_m(I))},Hm=dg,Um=JI,Ss=Ir,Km=hA,Qm=Ym,Xm=td,Jm=$I,Ns=">",Rs="<",Pi="prototype",Si="script",vd=Jm("IE_PROTO"),zC=function(){},bd=function(I){return Rs+Si+Ns+I+Rs+"/"+Si+Ns},ks=function(I){I.write(bd("")),I.close();var e=I.parentWindow.Object;return I=null,e},$m=function(){var I=Xm("iframe"),e="java"+Si+":",g;return I.style.display="none",Qm.appendChild(I),I.src=String(e),g=I.contentWindow.document,g.open(),g.write(bd("document.F=Object")),g.close(),g.F},VA,rI=function(){try{VA=new ActiveXObject("htmlfile")}catch(e){}rI=typeof document!="undefined"?document.domain&&VA?ks(VA):$m():ks(VA);for(var I=Ss.length;I--;)delete rI[Pi][Ss[I]];return rI()};Km[vd]=!0;var mA=Object.create||function(e,g){var t;return e!==null?(zC[Pi]=Hm(e),t=new zC,zC[Pi]=null,t[vd]=e):t=rI(),g===void 0?t:Um.f(t,g)},vA={},qm=Cd,ev=Ir,gv=ev.concat("length","prototype");vA.f=Object.getOwnPropertyNames||function(e){return qm(e,gv)};var qI={},Ms=lA,tv=ke,Av=fA,Iv=Array,Cv=Math.max,yd=function(I,e,g){for(var t=tv(I),A=Ms(e,t),C=Ms(g===void 0?t:g,t),i=Iv(Cv(C-A,0)),n=0;A<C;A++,n++)Av(i,n,I[A]);return i.length=n,i},iv=ag,nv=We,wd=vA.f,rv=yd,Ed=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],sv=function(I){try{return wd(I)}catch(e){return rv(Ed)}};qI.f=function(e){return Ed&&iv(e)==="Window"?sv(e):wd(nv(e))};var ov=yt,bA=function(I,e,g,t){return t&&t.enumerable?I[e]=g:ov(I,e,g),I},av=Oe,sr=function(I,e,g){return av.f(I,e,g)},yA={},dv=ee;yA.f=dv;var Fs=L,lv=ne,hv=yA,cv=Oe.f,$=function(I){var e=Fs.Symbol||(Fs.Symbol={});lv(e,I)||cv(e,I,{value:hv.f(I)})},uv=Ye,fv=_e,pv=ee,mv=bA,Td=function(){var I=fv("Symbol"),e=I&&I.prototype,g=e&&e.valueOf,t=pv("toPrimitive");e&&!e[t]&&mv(e,t,function(A){return uv(g,this)},{arity:1})},vv=nr,bv=lg,yv=vv?{}.toString:function(){return"[object "+bv(this)+"]"},wv=nr,Ev=Oe.f,Tv=yt,xv=ne,Ov=yv,Dv=ee,zs=Dv("toStringTag"),wt=function(I,e,g,t){if(I){var A=g?I:I.prototype;xv(A,zs)||Ev(A,zs,{configurable:!0,value:e}),t&&!wv&&Tv(A,"toString",Ov)}},Pv=X,Sv=le,Bs=Pv.WeakMap,xd=Sv(Bs)&&/native code/.test(String(Bs)),Nv=xd,Od=X,Rv=ce,kv=yt,BC=ne,ZC=tr,Mv=$I,Fv=hA,Zs="Object already initialized",Ni=Od.TypeError,zv=Od.WeakMap,fI,_t,pI,Bv=function(I){return pI(I)?_t(I):fI(I,{})},Zv=function(I){return function(e){var g;if(!Rv(e)||(g=_t(e)).type!==I)throw new Ni("Incompatible receiver, "+I+" required");return g}};Nv||ZC.state?(ze=ZC.state||(ZC.state=new zv),ze.get=ze.get,ze.has=ze.has,ze.set=ze.set,fI=function(I,e){if(ze.has(I))throw new Ni(Zs);return e.facade=I,ze.set(I,e),e},_t=function(I){return ze.get(I)||{}},pI=function(I){return ze.has(I)}):(Rg=Mv("state"),Fv[Rg]=!0,fI=function(I,e){if(BC(I,Rg))throw new Ni(Zs);return e.facade=I,kv(I,Rg,e),e},_t=function(I){return BC(I,Rg)?I[Rg]:{}},pI=function(I){return BC(I,Rg)});var ze,Rg,Ug={set:fI,get:_t,has:pI,enforce:Bv,getterFor:Zv},Lv=dA,Gv=Z,jv=_I,Vv=xe,Yv=ke,Wv=XI,Ls=Gv([].push),cg=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(r,s,o,d){for(var a=Vv(r),l=jv(a),h=Lv(s,o),c=Yv(l),f=0,u=d||Wv,m=e?u(r,c):g||i?u(r,0):void 0,E,w;c>f;f++)if((n||f in l)&&(E=l[f],w=h(E,f,a),I))if(e)m[f]=w;else if(w)switch(I){case 3:return!0;case 5:return E;case 6:return f;case 2:Ls(m,E)}else switch(I){case 4:return!1;case 7:Ls(m,E)}return C?-1:t||A?A:m}},Ng={forEach:cg(0),map:cg(1),filter:cg(2),some:cg(3),every:cg(4),find:cg(5),findIndex:cg(6),filterReject:cg(7)},eC=S,gC=X,or=Ye,_v=Z,lt=ie,ht=vt,Hv=B,se=ne,Uv=J,Ri=dg,tC=We,ar=UI,Kv=eg,ki=CA,Ht=mA,Dd=cA,Qv=vA,Pd=qI,Xv=uA,Sd=AA,Nd=Oe,Jv=JI,Rd=IA,Gs=bA,$v=sr,dr=bt,qv=$I,kd=hA,js=HI,eb=ee,gb=yA,tb=$,Ab=Td,Ib=wt,Md=Ug,AC=Ng.forEach,Ee=qv("hidden"),IC="Symbol",Ut="prototype",Cb=Md.set,Vs=Md.getterFor(IC),je=Object[Ut],zg=gC.Symbol,zt=zg&&zg[Ut],ib=gC.RangeError,nb=gC.TypeError,LC=gC.QObject,Fd=Sd.f,Bg=Nd.f,zd=Pd.f,rb=Rd.f,Bd=_v([].push),ng=dr("symbols"),wA=dr("op-symbols"),sb=dr("wks"),Mi=!LC||!LC[Ut]||!LC[Ut].findChild,Zd=function(I,e,g){var t=Fd(je,e);t&&delete je[e],Bg(I,e,g),t&&I!==je&&Bg(je,e,t)},Fi=lt&&Hv(function(){return Ht(Bg({},"a",{get:function(){return Bg(this,"a",{value:7}).a}})).a!==7})?Zd:Bg,GC=function(I,e){var g=ng[I]=Ht(zt);return Cb(g,{type:IC,tag:I,description:e}),lt||(g.description=e),g},CC=function(e,g,t){e===je&&CC(wA,g,t),Ri(e);var A=ar(g);return Ri(t),se(ng,A)?(t.enumerable?(se(e,Ee)&&e[Ee][A]&&(e[Ee][A]=!1),t=Ht(t,{enumerable:ki(0,!1)})):(se(e,Ee)||Bg(e,Ee,ki(1,{})),e[Ee][A]=!0),Fi(e,A,t)):Bg(e,A,t)},lr=function(e,g){Ri(e);var t=tC(g),A=Dd(t).concat(Vd(t));return AC(A,function(C){(!lt||or(Ld,t,C))&&CC(e,C,t[C])}),e},ob=function(e,g){return g===void 0?Ht(e):lr(Ht(e),g)},Ld=function(e){var g=ar(e),t=or(rb,this,g);return this===je&&se(ng,g)&&!se(wA,g)?!1:t||!se(this,g)||!se(ng,g)||se(this,Ee)&&this[Ee][g]?t:!0},Gd=function(e,g){var t=tC(e),A=ar(g);if(!(t===je&&se(ng,A)&&!se(wA,A))){var C=Fd(t,A);return C&&se(ng,A)&&!(se(t,Ee)&&t[Ee][A])&&(C.enumerable=!0),C}},jd=function(e){var g=zd(tC(e)),t=[];return AC(g,function(A){!se(ng,A)&&!se(kd,A)&&Bd(t,A)}),t},Vd=function(I){var e=I===je,g=zd(e?wA:tC(I)),t=[];return AC(g,function(A){se(ng,A)&&(!e||se(je,A))&&Bd(t,ng[A])}),t};ht||(zg=function(){if(Uv(zt,this))throw new nb("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:Kv(arguments[0]),g=js(e),t=function(A){this===je&&or(t,wA,A),se(this,Ee)&&se(this[Ee],g)&&(this[Ee][g]=!1);var C=ki(1,A);try{Fi(this,g,C)}catch(i){if(!(i instanceof ib))throw i;Zd(this,g,C)}};return lt&&Mi&&Fi(je,g,{configurable:!0,set:t}),GC(g,e)},zt=zg[Ut],Gs(zt,"toString",function(){return Vs(this).tag}),Gs(zg,"withoutSetter",function(I){return GC(js(I),I)}),Rd.f=Ld,Nd.f=CC,Jv.f=lr,Sd.f=Gd,Qv.f=Pd.f=jd,Xv.f=Vd,gb.f=function(I){return GC(eb(I),I)},lt&&$v(zt,"description",{configurable:!0,get:function(){return Vs(this).description}}));eC({global:!0,constructor:!0,wrap:!0,forced:!ht,sham:!ht},{Symbol:zg});AC(Dd(sb),function(I){tb(I)});eC({target:IC,stat:!0,forced:!ht},{useSetter:function(){Mi=!0},useSimple:function(){Mi=!1}});eC({target:"Object",stat:!0,forced:!ht,sham:!lt},{create:ob,defineProperty:CC,defineProperties:lr,getOwnPropertyDescriptor:Gd});eC({target:"Object",stat:!0,forced:!ht},{getOwnPropertyNames:jd});Ab();Ib(zg,IC);kd[Ee]=!0;var ab=vt,Yd=ab&&!!Symbol.for&&!!Symbol.keyFor,db=S,lb=_e,hb=ne,cb=eg,Wd=bt,ub=Yd,jC=Wd("string-to-symbol-registry"),fb=Wd("symbol-to-string-registry");db({target:"Symbol",stat:!0,forced:!ub},{for:function(I){var e=cb(I);if(hb(jC,e))return jC[e];var g=lb("Symbol")(e);return jC[e]=g,fb[g]=e,g}});var pb=S,mb=ne,vb=sA,bb=oA,yb=bt,wb=Yd,Ys=yb("symbol-to-string-registry");pb({target:"Symbol",stat:!0,forced:!wb},{keyFor:function(e){if(!vb(e))throw new TypeError(bb(e)+" is not a symbol");if(mb(Ys,e))return Ys[e]}});var Eb=Z,Ws=Sg,Tb=le,_s=ag,xb=eg,Hs=Eb([].push),Ob=function(I){if(Tb(I))return I;if(Ws(I)){for(var e=I.length,g=[],t=0;t<e;t++){var A=I[t];typeof A=="string"?Hs(g,A):(typeof A=="number"||_s(A)==="Number"||_s(A)==="String")&&Hs(g,xb(A))}var C=g.length,i=!0;return function(n,r){if(i)return i=!1,r;if(Ws(this))return r;for(var s=0;s<C;s++)if(g[s]===n)return r}}},Db=S,_d=_e,Hd=WI,Pb=Ye,EA=Z,Ud=B,Us=le,Ks=sA,Kd=QI,Sb=Ob,Nb=vt,Rb=String,wg=_d("JSON","stringify"),YA=EA(/./.exec),Qs=EA("".charAt),kb=EA("".charCodeAt),Mb=EA("".replace),Fb=EA(1 .toString),zb=/[\uD800-\uDFFF]/g,Xs=/^[\uD800-\uDBFF]$/,Js=/^[\uDC00-\uDFFF]$/,$s=!Nb||Ud(function(){var I=_d("Symbol")("stringify detection");return wg([I])!=="[null]"||wg({a:I})!=="{}"||wg(Object(I))!=="{}"}),qs=Ud(function(){return wg("\uDF06\uD834")!=='"\\udf06\\ud834"'||wg("\uDEAD")!=='"\\udead"'}),Bb=function(I,e){var g=Kd(arguments),t=Sb(e);if(!(!Us(t)&&(I===void 0||Ks(I))))return g[1]=function(A,C){if(Us(t)&&(C=Pb(t,this,Rb(A),C)),!Ks(C))return C},Hd(wg,null,g)},Zb=function(I,e,g){var t=Qs(g,e-1),A=Qs(g,e+1);return YA(Xs,I)&&!YA(Js,A)||YA(Js,I)&&!YA(Xs,t)?"\\u"+Fb(kb(I,0),16):I};wg&&Db({target:"JSON",stat:!0,arity:3,forced:$s||qs},{stringify:function(e,g,t){var A=Kd(arguments),C=Hd($s?Bb:wg,null,A);return qs&&typeof C=="string"?Mb(C,zb,Zb):C}});var Lb=S,Gb=vt,jb=B,Qd=uA,Vb=xe,Yb=!Gb||jb(function(){Qd.f(1)});Lb({target:"Object",stat:!0,forced:Yb},{getOwnPropertySymbols:function(e){var g=Qd.f;return g?g(Vb(e)):[]}});var Wb=$;Wb("asyncIterator");var _b=$;_b("hasInstance");var Hb=$;Hb("isConcatSpreadable");var Ub=$;Ub("iterator");var Kb=$;Kb("match");var Qb=$;Qb("matchAll");var Xb=$;Xb("replace");var Jb=$;Jb("search");var $b=$;$b("species");var qb=$;qb("split");var ey=$,gy=Td;ey("toPrimitive");gy();var ty=_e,Ay=$,Iy=wt;Ay("toStringTag");Iy(ty("Symbol"),"Symbol");var Cy=$;Cy("unscopables");var iy=X,ny=wt;ny(iy.JSON,"JSON",!0);var ry=L,sy=ry.Symbol,Et={},zi=ie,oy=ne,Xd=Function.prototype,ay=zi&&Object.getOwnPropertyDescriptor,hr=oy(Xd,"name"),dy=hr&&(function(){}).name==="something",ly=hr&&(!zi||zi&&ay(Xd,"name").configurable),hy={EXISTS:hr,PROPER:dy,CONFIGURABLE:ly},cy=B,Jd=!cy(function(){function I(){}return I.prototype.constructor=null,Object.getPrototypeOf(new I)!==I.prototype}),uy=ne,fy=le,py=xe,my=$I,vy=Jd,eo=my("IE_PROTO"),Bi=Object,by=Bi.prototype,iC=vy?Bi.getPrototypeOf:function(I){var e=py(I);if(uy(e,eo))return e[eo];var g=e.constructor;return fy(g)&&e instanceof g?g.prototype:e instanceof Bi?by:null},yy=B,wy=le,Ey=ce,Ty=mA,go=iC,xy=bA,Oy=ee,Zi=Oy("iterator"),$d=!1,tg,VC,YC;[].keys&&(YC=[].keys(),"next"in YC?(VC=go(go(YC)),VC!==Object.prototype&&(tg=VC)):$d=!0);var Dy=!Ey(tg)||yy(function(){var I={};return tg[Zi].call(I)!==I});Dy?tg={}:tg=Ty(tg);wy(tg[Zi])||xy(tg,Zi,function(){return this});var qd={IteratorPrototype:tg,BUGGY_SAFARI_ITERATORS:$d},Py=qd.IteratorPrototype,Sy=mA,Ny=CA,Ry=wt,ky=Et,My=function(){return this},Fy=function(I,e,g,t){var A=e+" Iterator";return I.prototype=Sy(Py,{next:Ny(+!t,g)}),Ry(I,A,!1,!0),ky[A]=My,I},zy=S,By=Ye,el=hy,Zy=Fy,Ly=iC,Gy=wt,to=bA,jy=ee,Ao=Et,gl=qd,Vy=el.PROPER;el.CONFIGURABLE;gl.IteratorPrototype;var WA=gl.BUGGY_SAFARI_ITERATORS,WC=jy("iterator"),Io="keys",_A="values",Co="entries",Yy=function(){return this},cr=function(I,e,g,t,A,C,i){Zy(g,e,t);var n=function(u){if(u===A&&a)return a;if(!WA&&u&&u in o)return o[u];switch(u){case Io:return function(){return new g(this,u)};case _A:return function(){return new g(this,u)};case Co:return function(){return new g(this,u)}}return function(){return new g(this)}},r=e+" Iterator",s=!1,o=I.prototype,d=o[WC]||o["@@iterator"]||A&&o[A],a=!WA&&d||n(A),l=e==="Array"&&o.entries||d,h,c,f;if(l&&(h=Ly(l.call(new I)),h!==Object.prototype&&h.next&&(Gy(h,r,!0,!0),Ao[r]=Yy)),Vy&&A===_A&&d&&d.name!==_A&&(s=!0,a=function(){return By(d,this)}),A)if(c={values:n(_A),keys:C?a:n(Io),entries:n(Co)},i)for(f in c)(WA||s||!(f in o))&&to(o,f,c[f]);else zy({target:e,proto:!0,forced:WA||s},c);return i&&o[WC]!==a&&to(o,WC,a,{name:A}),Ao[e]=a,c},ur=function(I,e){return{value:I,done:e}},Wy=We,io=Et,tl=Ug;Oe.f;var _y=cr,HA=ur,Al="Array Iterator",Hy=tl.set,Uy=tl.getterFor(Al);_y(Array,"Array",function(I,e){Hy(this,{type:Al,target:Wy(I),index:0,kind:e})},function(){var I=Uy(this),e=I.target,g=I.kind,t=I.index++;if(!e||t>=e.length)return I.target=void 0,HA(void 0,!0);switch(g){case"keys":return HA(t,!1);case"values":return HA(e[t],!1)}return HA([t,e[t]],!1)},"values");io.Arguments=io.Array;var Ky={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},Qy=Ky,Xy=X,Jy=lg,$y=yt,no=Et,qy=ee,ro=qy("toStringTag");for(UA in Qy)_C=Xy[UA],KA=_C&&_C.prototype,KA&&Jy(KA)!==ro&&$y(KA,ro,UA),no[UA]=no.Array;var _C,KA,UA,e0=sy,Il=e0,g0=Il,t0=P(g0),A0=S,so=Sg,I0=pd,C0=ce,oo=lA,i0=ke,n0=We,r0=fA,s0=ee,o0=pA,a0=QI,d0=o0("slice"),l0=s0("species"),HC=Array,h0=Math.max;A0({target:"Array",proto:!0,forced:!d0},{slice:function(e,g){var t=n0(this),A=i0(t),C=oo(e,A),i=oo(g===void 0?A:g,A),n,r,s;if(so(t)&&(n=t.constructor,I0(n)&&(n===HC||so(n.prototype))?n=void 0:C0(n)&&(n=n[l0],n===null&&(n=void 0)),n===HC||n===void 0))return a0(t,C,i);for(r=new(n===void 0?HC:n)(h0(i-C,0)),s=0;C<i;C++,s++)C in t&&r0(r,s,t[C]);return r.length=s,r}});var c0=Ie,u0=c0("Array").slice,f0=J,p0=u0,UC=Array.prototype,m0=function(I){var e=I.slice;return I===UC||f0(UC,I)&&e===UC.slice?p0:e},v0=m0,b0=v0,y0=b0,Le=P(y0),w0=_e,E0=Z,T0=vA,x0=uA,O0=dg,D0=E0([].concat),Cl=w0("Reflect","ownKeys")||function(e){var g=T0.f(O0(e)),t=x0.f;return t?D0(g,t(e)):g},P0=S,S0=Cl;P0({target:"Reflect",stat:!0},{ownKeys:S0});var N0=L,R0=N0.Reflect.ownKeys,k0=R0,M0=k0,F0=M0,z0=P(F0),B0=S,Z0=Sg;B0({target:"Array",stat:!0},{isArray:Z0});var L0=L,G0=L0.Array.isArray,j0=G0,V0=j0,Y0=V0,z=P(Y0),W0=S,_0=Ng.map,H0=pA,U0=H0("map");W0({target:"Array",proto:!0,forced:!U0},{map:function(e){return _0(this,e,arguments.length>1?arguments[1]:void 0)}});var K0=Ie,Q0=K0("Array").map,X0=J,J0=Q0,KC=Array.prototype,$0=function(I){var e=I.map;return I===KC||X0(KC,I)&&e===KC.map?J0:e},q0=$0,ew=q0,gw=ew,ae=P(gw),tw=S,Aw=xe,il=cA,Iw=B,Cw=Iw(function(){il(1)});tw({target:"Object",stat:!0,forced:Cw},{keys:function(e){return il(Aw(e))}});var iw=L,nw=iw.Object.keys,rw=nw,sw=rw,ow=sw,U=P(ow),aw=S,dw=Z,nl=Date,lw=dw(nl.prototype.getTime);aw({target:"Date",stat:!0},{now:function(){return lw(new nl)}});var hw=L,cw=hw.Date.now,uw=cw,fw=uw,pw=fw,mI=P(pw),mw=B,Tt=function(I,e){var g=[][I];return!!g&&mw(function(){g.call(null,e||function(){return 1},1)})},vw=Ng.forEach,bw=Tt,yw=bw("forEach"),ww=yw?[].forEach:function(e){return vw(this,e,arguments.length>1?arguments[1]:void 0)},Ew=S,ao=ww;Ew({target:"Array",proto:!0,forced:[].forEach!==ao},{forEach:ao});var Tw=Ie,xw=Tw("Array").forEach,Ow=xw,Dw=Ow,Pw=lg,Sw=ne,Nw=J,Rw=Dw,QC=Array.prototype,kw={DOMTokenList:!0,NodeList:!0},Mw=function(I){var e=I.forEach;return I===QC||Nw(QC,I)&&e===QC.forEach||Sw(kw,Pw(I))?Rw:e},Fw=Mw,F=P(Fw),zw=S,Bw=Z,Zw=Sg,Lw=Bw([].reverse),lo=[1,2];zw({target:"Array",proto:!0,forced:String(lo)===String(lo.reverse())},{reverse:function(){return Zw(this)&&(this.length=this.length),Lw(this)}});var Gw=Ie,jw=Gw("Array").reverse,Vw=J,Yw=jw,XC=Array.prototype,Ww=function(I){var e=I.reverse;return I===XC||Vw(XC,I)&&e===XC.reverse?Yw:e},_w=Ww,Hw=_w,Uw=Hw,Zg=P(Uw),Kw=ie,Qw=Sg,Xw=TypeError,Jw=Object.getOwnPropertyDescriptor,$w=Kw&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(I){return I instanceof TypeError}})(),qw=$w?function(I,e){if(Qw(I)&&!Jw(I,"length").writable)throw new Xw("Cannot set read only .length");return I.length=e}:function(I,e){return I.length=e},ho=oA,eE=TypeError,rl=function(I,e){if(!delete I[e])throw new eE("Cannot delete property "+ho(e)+" of "+ho(I))},gE=S,tE=xe,AE=lA,IE=KI,CE=ke,iE=qw,nE=ir,rE=XI,sE=fA,JC=rl,oE=pA,aE=oE("splice"),dE=Math.max,lE=Math.min;gE({target:"Array",proto:!0,forced:!aE},{splice:function(e,g){var t=tE(this),A=CE(t),C=AE(e,A),i=arguments.length,n,r,s,o,d,a;for(i===0?n=r=0:i===1?(n=0,r=A-C):(n=i-2,r=lE(dE(IE(g),0),A-C)),nE(A+n-r),s=rE(t,r),o=0;o<r;o++)d=C+o,d in t&&sE(s,o,t[d]);if(s.length=r,n<r){for(o=C;o<A-r;o++)d=o+r,a=o+n,d in t?t[a]=t[d]:JC(t,a);for(o=A;o>A-r+n;o--)JC(t,o-1)}else if(n>r)for(o=A-r;o>C;o--)d=o+r-1,a=o+n-1,d in t?t[a]=t[d]:JC(t,a);for(o=0;o<n;o++)t[o+C]=arguments[o+2];return iE(t,A-r+n),s}});var hE=Ie,cE=hE("Array").splice,uE=J,fE=cE,$C=Array.prototype,pE=function(I){var e=I.splice;return I===$C||uE($C,I)&&e===$C.splice?fE:e},mE=pE,vE=mE,bE=vE,Ke=P(bE),yE=S,wE=Ar.includes,EE=B,TE=EE(function(){return!Array(1).includes()});yE({target:"Array",proto:!0,forced:TE},{includes:function(e){return wE(this,e,arguments.length>1?arguments[1]:void 0)}});var xE=Ie,OE=xE("Array").includes,DE=ce,PE=ag,SE=ee,NE=SE("match"),RE=function(I){var e;return DE(I)&&((e=I[NE])!==void 0?!!e:PE(I)==="RegExp")},kE=RE,ME=TypeError,FE=function(I){if(kE(I))throw new ME("The method doesn't accept regular expressions");return I},zE=ee,BE=zE("match"),ZE=function(I){var e=/./;try{"/./"[I](e)}catch(g){try{return e[BE]=!1,"/./"[I](e)}catch(t){}}return!1},LE=S,GE=Z,jE=FE,VE=iA,co=eg,YE=ZE,WE=GE("".indexOf);LE({target:"String",proto:!0,forced:!YE("includes")},{includes:function(e){return!!~WE(co(VE(this)),co(jE(e)),arguments.length>1?arguments[1]:void 0)}});var _E=Ie,HE=_E("String").includes,uo=J,UE=OE,KE=HE,qC=Array.prototype,ei=String.prototype,QE=function(I){var e=I.includes;return I===qC||uo(qC,I)&&e===qC.includes?UE:typeof I=="string"||I===ei||uo(ei,I)&&e===ei.includes?KE:e},XE=QE,JE=XE,$E=JE,Eg=P($E),qE=S,eT=B,gT=xe,sl=iC,tT=Jd,AT=eT(function(){sl(1)});qE({target:"Object",stat:!0,forced:AT,sham:!tT},{getPrototypeOf:function(e){return sl(gT(e))}});var IT=L,CT=IT.Object.getPrototypeOf,iT=CT,nT=iT,rT=nT,fo=P(rT),sT=Ie,oT=sT("Array").concat,aT=J,dT=oT,gi=Array.prototype,lT=function(I){var e=I.concat;return I===gi||aT(gi,I)&&e===gi.concat?dT:e},hT=lT,cT=hT,uT=cT,ol=P(uT),fT=S,pT=Ng.filter,mT=pA,vT=mT("filter");fT({target:"Array",proto:!0,forced:!vT},{filter:function(e){return pT(this,e,arguments.length>1?arguments[1]:void 0)}});var bT=Ie,yT=bT("Array").filter,wT=J,ET=yT,ti=Array.prototype,TT=function(I){var e=I.filter;return I===ti||wT(ti,I)&&e===ti.filter?ET:e},xT=TT,OT=xT,DT=OT,te=P(DT),al=ie,PT=B,dl=Z,ST=iC,NT=cA,RT=We,kT=IA.f,ll=dl(kT),MT=dl([].push),FT=al&&PT(function(){var I=Object.create(null);return I[2]=2,!ll(I,2)}),po=function(I){return function(e){for(var g=RT(e),t=NT(g),A=FT&&ST(g)===null,C=t.length,i=0,n=[],r;C>i;)r=t[i++],(!al||(A?r in g:ll(g,r)))&&MT(n,I?[r,g[r]]:g[r]);return n}},zT={entries:po(!0),values:po(!1)},BT=S,ZT=zT.values;BT({target:"Object",stat:!0},{values:function(e){return ZT(e)}});var LT=L,GT=LT.Object.values,jT=GT,VT=jT,YT=VT,WT=P(YT),fr=`
632
+ \v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,_T=Z,HT=iA,UT=eg,Li=fr,mo=_T("".replace),KT=RegExp("^["+Li+"]+"),QT=RegExp("(^|[^"+Li+"])["+Li+"]+$"),Ai=function(I){return function(e){var g=UT(HT(e));return I&1&&(g=mo(g,KT,"")),I&2&&(g=mo(g,QT,"$1")),g}},hl={start:Ai(1),end:Ai(2),trim:Ai(3)},cl=X,XT=B,JT=Z,$T=eg,qT=hl.trim,vo=fr,Lt=cl.parseInt,bo=cl.Symbol,yo=bo&&bo.iterator,ul=/^[+-]?0x/i,ex=JT(ul.exec),gx=Lt(vo+"08")!==8||Lt(vo+"0x16")!==22||yo&&!XT(function(){Lt(Object(yo))}),tx=gx?function(e,g){var t=qT($T(e));return Lt(t,g>>>0||(ex(ul,t)?16:10))}:Lt,Ax=S,wo=tx;Ax({global:!0,forced:parseInt!==wo},{parseInt:wo});var Ix=L,Cx=Ix.parseInt,ix=Cx,nx=ix,rx=nx,Ze=P(rx),sx=S,ox=er,ax=Ar.indexOf,dx=Tt,Gi=ox([].indexOf),fl=!!Gi&&1/Gi([1],1,-0)<0,lx=fl||!dx("indexOf");sx({target:"Array",proto:!0,forced:lx},{indexOf:function(e){var g=arguments.length>1?arguments[1]:void 0;return fl?Gi(this,e,g)||0:ax(this,e,g)}});var hx=Ie,cx=hx("Array").indexOf,ux=J,fx=cx,Ii=Array.prototype,px=function(I){var e=I.indexOf;return I===Ii||ux(Ii,I)&&e===Ii.indexOf?fx:e},mx=px,vx=mx,bx=vx,G=P(bx),yx=S,wx=ie,Ex=mA;yx({target:"Object",stat:!0,sham:!wx},{create:Ex});var Tx=L,xx=Tx.Object,Ox=function(e,g){return xx.create(e,g)},Dx=Ox,Px=Dx,Sx=Px,Tg=P(Sx),ji=L,Nx=WI;ji.JSON||(ji.JSON={stringify:JSON.stringify});var Rx=function(e,g,t){return Nx(ji.JSON.stringify,null,arguments)},kx=Rx,Mx=kx,Fx=Mx,xt=P(Fx),zx=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",Bx=TypeError,Zx=function(I,e){if(I<e)throw new Bx("Not enough arguments");return I},pl=X,Lx=WI,Gx=le,jx=zx,Vx=nA,Yx=QI,Wx=Zx,_x=pl.Function,Hx=/MSIE .\./.test(Vx)||jx&&(function(){var I=pl.Bun.version.split(".");return I.length<3||I[0]==="0"&&(I[1]<3||I[1]==="3"&&I[2]==="0")})(),ml=function(I,e){var g=e?2:1;return Hx?function(t,A){var C=Wx(arguments.length,1)>g,i=Gx(t)?t:_x(t),n=C?Yx(arguments,g):[],r=C?function(){Lx(i,this,n)}:i;return e?I(r,A):I(r)}:I},Ux=S,vl=X,Kx=ml,Eo=Kx(vl.setInterval,!0);Ux({global:!0,bind:!0,forced:vl.setInterval!==Eo},{setInterval:Eo});var Qx=S,bl=X,Xx=ml,To=Xx(bl.setTimeout,!0);Qx({global:!0,bind:!0,forced:bl.setTimeout!==To},{setTimeout:To});var Jx=L,$x=Jx.setTimeout,qx=$x,Qe=P(qx),e1=xe,xo=lA,g1=ke,t1=function(e){for(var g=e1(this),t=g1(g),A=arguments.length,C=xo(A>1?arguments[1]:void 0,t),i=A>2?arguments[2]:void 0,n=i===void 0?t:xo(i,t);n>C;)g[C++]=e;return g},A1=S,I1=t1;A1({target:"Array",proto:!0},{fill:I1});var C1=Ie,i1=C1("Array").fill,n1=J,r1=i1,Ci=Array.prototype,s1=function(I){var e=I.fill;return I===Ci||n1(Ci,I)&&e===Ci.fill?r1:e},o1=s1,a1=o1,d1=a1,TA=P(d1);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 Me(I,e){I.prototype=Object.create(e.prototype),I.prototype.constructor=I,I.__proto__=e}function QA(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}var Vi;typeof Object.assign!="function"?Vi=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}:Vi=Object.assign;var jg=Vi,Oo=["","webkit","Moz","MS","ms","o"],l1=typeof document=="undefined"?{style:{}}:document.createElement("div"),h1="function",nt=Math.round,Vg=Math.abs,pr=Date.now;function nC(I,e){for(var g,t,A=e[0].toUpperCase()+e.slice(1),C=0;C<Oo.length;){if(g=Oo[C],t=g?g+A:e,t in I)return t;C++}}var Ag;typeof window=="undefined"?Ag={}:Ag=window;var yl=nC(l1.style,"touchAction"),wl=yl!==void 0;function c1(){if(!wl)return!1;var I={},e=Ag.CSS&&Ag.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(g){return I[g]=e?Ag.CSS.supports("touch-action",g):!0}),I}var El="compute",Tl="auto",Yi="manipulation",Lg="none",Kt="pan-x",Qt="pan-y",XA=c1(),u1=/mobile|tablet|ip(ad|hone|od)|android/i,xl="ontouchstart"in Ag,f1=nC(Ag,"PointerEvent")!==void 0,p1=xl&&u1.test(navigator.userAgent),xA="touch",m1="pen",mr="mouse",v1="kinect",b1=25,be=1,Kg=2,Ae=4,Te=8,vI=1,OA=2,DA=4,PA=8,ct=16,Xe=OA|DA,Gg=PA|ct,Ol=Xe|Gg,Dl=["x","y"],bI=["clientX","clientY"];function Ig(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 rC(I,e){return typeof I===h1?I.apply(e&&e[0]||void 0,e):I}function Mg(I,e){return I.indexOf(e)>-1}function y1(I){if(Mg(I,Lg))return Lg;var e=Mg(I,Kt),g=Mg(I,Qt);return e&&g?Lg:e||g?e?Kt:Qt:Mg(I,Yi)?Yi:Tl}var Pl=(function(){function I(g,t){this.manager=g,this.set(t)}var e=I.prototype;return e.set=function(t){t===El&&(t=this.compute()),wl&&this.manager.element.style&&XA[t]&&(this.manager.element.style[yl]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return Ig(this.manager.recognizers,function(A){rC(A.options.enable,[A])&&(t=t.concat(A.getTouchAction()))}),y1(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=Mg(i,Lg)&&!XA[Lg],r=Mg(i,Qt)&&!XA[Qt],s=Mg(i,Kt)&&!XA[Kt];if(n){var o=t.pointers.length===1,d=t.distance<2,a=t.deltaTime<250;if(o&&d&&a)return}if(!(s&&r)&&(n||r&&C&Xe||s&&C&Gg))return this.preventSrc(A)},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},I})();function vr(I,e){for(;I;){if(I===e)return!0;I=I.parentNode}return!1}function Sl(I){var e=I.length;if(e===1)return{x:nt(I[0].clientX),y:nt(I[0].clientY)};for(var g=0,t=0,A=0;A<e;)g+=I[A].clientX,t+=I[A].clientY,A++;return{x:nt(g/e),y:nt(t/e)}}function Do(I){for(var e=[],g=0;g<I.pointers.length;)e[g]={clientX:nt(I.pointers[g].clientX),clientY:nt(I.pointers[g].clientY)},g++;return{timeStamp:pr(),pointers:e,center:Sl(e),deltaX:I.deltaX,deltaY:I.deltaY}}function yI(I,e,g){g||(g=Dl);var t=e[g[0]]-I[g[0]],A=e[g[1]]-I[g[1]];return Math.sqrt(t*t+A*A)}function Wi(I,e,g){g||(g=Dl);var t=e[g[0]]-I[g[0]],A=e[g[1]]-I[g[1]];return Math.atan2(A,t)*180/Math.PI}function Nl(I,e){return I===e?vI:Vg(I)>=Vg(e)?I<0?OA:DA:e<0?PA:ct}function w1(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 Rl(I,e,g){return{x:e/I||0,y:g/I||0}}function E1(I,e){return yI(e[0],e[1],bI)/yI(I[0],I[1],bI)}function T1(I,e){return Wi(e[1],e[0],bI)+Wi(I[1],I[0],bI)}function x1(I,e){var g=I.lastInterval||e,t=e.timeStamp-g.timeStamp,A,C,i,n;if(e.eventType!==Te&&(t>b1||g.velocity===void 0)){var r=e.deltaX-g.deltaX,s=e.deltaY-g.deltaY,o=Rl(t,r,s);C=o.x,i=o.y,A=Vg(o.x)>Vg(o.y)?o.x:o.y,n=Nl(r,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 O1(I,e){var g=I.session,t=e.pointers,A=t.length;g.firstInput||(g.firstInput=Do(e)),A>1&&!g.firstMultiple?g.firstMultiple=Do(e):A===1&&(g.firstMultiple=!1);var C=g.firstInput,i=g.firstMultiple,n=i?i.center:C.center,r=e.center=Sl(t);e.timeStamp=pr(),e.deltaTime=e.timeStamp-C.timeStamp,e.angle=Wi(n,r),e.distance=yI(n,r),w1(g,e),e.offsetDirection=Nl(e.deltaX,e.deltaY);var s=Rl(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?E1(i.pointers,t):1,e.rotation=i?T1(i.pointers,t):0,e.maxPointers=g.prevInput?e.pointers.length>g.prevInput.maxPointers?e.pointers.length:g.prevInput.maxPointers:e.pointers.length,x1(g,e);var o=I.element,d=e.srcEvent,a;d.composedPath?a=d.composedPath()[0]:d.path?a=d.path[0]:a=d.target,vr(a,o)&&(o=a),e.target=o}function D1(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,O1(I,g),I.emit("hammer.input",g),I.recognize(g),I.session.prevInput=g}function Xt(I){return I.trim().split(/\s+/g)}function Gt(I,e,g){Ig(Xt(e),function(t){I.addEventListener(t,g,!1)})}function jt(I,e,g){Ig(Xt(e),function(t){I.removeEventListener(t,g,!1)})}function Po(I){var e=I.ownerDocument||I;return e.defaultView||e.parentWindow||window}var Ot=(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){rC(g.options.enable,[g])&&A.handler(C)},this.init()}var e=I.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Gt(this.element,this.evEl,this.domHandler),this.evTarget&&Gt(this.target,this.evTarget,this.domHandler),this.evWin&&Gt(Po(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&jt(this.element,this.evEl,this.domHandler),this.evTarget&&jt(this.target,this.evTarget,this.domHandler),this.evWin&&jt(Po(this.element),this.evWin,this.domHandler)},I})();function Yg(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 P1={pointerdown:be,pointermove:Kg,pointerup:Ae,pointercancel:Te,pointerout:Te},S1={2:xA,3:m1,4:mr,5:v1},kl="pointerdown",Ml="pointermove pointerup pointercancel";Ag.MSPointerEvent&&!Ag.PointerEvent&&(kl="MSPointerDown",Ml="MSPointerMove MSPointerUp MSPointerCancel");var Fl=(function(I){Me(e,I);function e(){var t,A=e.prototype;return A.evEl=kl,A.evWin=Ml,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",""),r=P1[n],s=S1[A.pointerType]||A.pointerType,o=s===xA,d=Yg(C,A.pointerId,"pointerId");r&be&&(A.button===0||o)?d<0&&(C.push(A),d=C.length-1):r&(Ae|Te)&&(i=!0),!(d<0)&&(C[d]=A,this.callback(this.manager,r,{pointers:C,changedPointers:[A],pointerType:s,srcEvent:A}),i&&C.splice(d,1))},e})(Ot);function Jt(I){return Array.prototype.slice.call(I,0)}function br(I,e,g){for(var t=[],A=[],C=0;C<I.length;){var i=e?I[C][e]:I[C];Yg(A,i)<0&&t.push(I[C]),A[C]=i,C++}return g&&(e?t=t.sort(function(n,r){return n[e]>r[e]}):t=t.sort()),t}var N1={touchstart:be,touchmove:Kg,touchend:Ae,touchcancel:Te},R1="touchstart touchmove touchend touchcancel",yr=(function(I){Me(e,I);function e(){var t;return e.prototype.evTarget=R1,t=I.apply(this,arguments)||this,t.targetIds={},t}var g=e.prototype;return g.handler=function(A){var C=N1[A.type],i=k1.call(this,A,C);i&&this.callback(this.manager,C,{pointers:i[0],changedPointers:i[1],pointerType:xA,srcEvent:A})},e})(Ot);function k1(I,e){var g=Jt(I.touches),t=this.targetIds;if(e&(be|Kg)&&g.length===1)return t[g[0].identifier]=!0,[g,g];var A,C,i=Jt(I.changedTouches),n=[],r=this.target;if(C=g.filter(function(s){return vr(s.target,r)}),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[br(C.concat(n),"identifier",!0),n]}var M1={mousedown:be,mousemove:Kg,mouseup:Ae},F1="mousedown",z1="mousemove mouseup",wr=(function(I){Me(e,I);function e(){var t,A=e.prototype;return A.evEl=F1,A.evWin=z1,t=I.apply(this,arguments)||this,t.pressed=!1,t}var g=e.prototype;return g.handler=function(A){var C=M1[A.type];C&be&&A.button===0&&(this.pressed=!0),C&Kg&&A.which!==1&&(C=Ae),this.pressed&&(C&Ae&&(this.pressed=!1),this.callback(this.manager,C,{pointers:[A],changedPointers:[A],pointerType:mr,srcEvent:A}))},e})(Ot),B1=2500,So=25;function No(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,B1)}}function Z1(I,e){I&be?(this.primaryTouch=e.changedPointers[0].identifier,No.call(this,e)):I&(Ae|Te)&&No.call(this,e)}function L1(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<=So&&i<=So)return!0}return!1}var zl=(function(){var I=(function(e){Me(g,e);function g(A,C){var i;return i=e.call(this,A,C)||this,i.handler=function(n,r,s){var o=s.pointerType===xA,d=s.pointerType===mr;if(!(d&&s.sourceCapabilities&&s.sourceCapabilities.firesTouchEvents)){if(o)Z1.call(QA(QA(i)),r,s);else if(d&&L1.call(QA(QA(i)),s))return;i.callback(n,r,s)}},i.touch=new yr(i.manager,i.handler),i.mouse=new wr(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})(Ot);return I})();function G1(I){var e,g=I.options.inputClass;return g?e=g:f1?e=Fl:p1?e=yr:xl?e=zl:e=wr,new e(I,D1)}function rt(I,e,g){return Array.isArray(I)?(Ig(I,g[e],g),!0):!1}var sI=1,Re=2,ut=4,xg=8,Cg=xg,$t=16,He=32,j1=1;function V1(){return j1++}function JA(I,e){var g=e.manager;return g?g.get(I):I}function Ro(I){return I&$t?"cancel":I&xg?"end":I&ut?"move":I&Re?"start":""}var SA=(function(){function I(g){g===void 0&&(g={}),this.options=Ve({enable:!0},g),this.id=V1(),this.manager=null,this.state=sI,this.simultaneous={},this.requireFail=[]}var e=I.prototype;return e.set=function(t){return jg(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(rt(t,"recognizeWith",this))return this;var A=this.simultaneous;return t=JA(t,this),A[t.id]||(A[t.id]=t,t.recognizeWith(this)),this},e.dropRecognizeWith=function(t){return rt(t,"dropRecognizeWith",this)?this:(t=JA(t,this),delete this.simultaneous[t.id],this)},e.requireFailure=function(t){if(rt(t,"requireFailure",this))return this;var A=this.requireFail;return t=JA(t,this),Yg(A,t)===-1&&(A.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(rt(t,"dropRequireFailure",this))return this;t=JA(t,this);var A=Yg(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<xg&&i(A.options.event+Ro(C)),i(A.options.event),t.additionalEvent&&i(t.additionalEvent),C>=xg&&i(A.options.event+Ro(C))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=He},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(He|sI)))return!1;t++}return!0},e.recognize=function(t){var A=jg({},t);if(!rC(this.options.enable,[this,A])){this.reset(),this.state=He;return}this.state&(Cg|$t|He)&&(this.state=sI),this.state=this.process(A),this.state&(Re|ut|xg|$t)&&this.tryEmit(A)},e.process=function(t){},e.getTouchAction=function(){},e.reset=function(){},I})(),_i=(function(I){Me(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[Yi]},g.process=function(A){var C=this,i=this.options,n=A.pointers.length===i.pointers,r=A.distance<i.threshold,s=A.deltaTime<i.time;if(this.reset(),A.eventType&be&&this.count===0)return this.failTimeout();if(r&&s&&n){if(A.eventType!==Ae)return this.failTimeout();var o=this.pTime?A.timeStamp-this.pTime<i.interval:!0,d=!this.pCenter||yI(this.pCenter,A.center)<i.posThreshold;this.pTime=A.timeStamp,this.pCenter=A.center,!d||!o?this.count=1:this.count+=1,this._input=A;var a=this.count%i.taps;if(a===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){C.state=Cg,C.tryEmit()},i.interval),Re):Cg}return He},g.failTimeout=function(){var A=this;return this._timer=setTimeout(function(){A.state=He},this.options.interval),He},g.reset=function(){clearTimeout(this._timer)},g.emit=function(){this.state===Cg&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e})(SA),ft=(function(I){Me(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|ut),r=this.attrTest(A);return n&&(i&Te||!r)?C|$t:n||r?i&Ae?C|xg:C&Re?C|ut:Re:He},e})(SA);function Bl(I){return I===ct?"down":I===PA?"up":I===OA?"left":I===DA?"right":""}var Er=(function(I){Me(e,I);function e(t){var A;return t===void 0&&(t={}),A=I.call(this,Ve({event:"pan",threshold:10,pointers:1,direction:Ol},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&Xe&&C.push(Qt),A&Gg&&C.push(Kt),C},g.directionTest=function(A){var C=this.options,i=!0,n=A.distance,r=A.direction,s=A.deltaX,o=A.deltaY;return r&C.direction||(C.direction&Xe?(r=s===0?vI:s<0?OA:DA,i=s!==this.pX,n=Math.abs(A.deltaX)):(r=o===0?vI:o<0?PA:ct,i=o!==this.pY,n=Math.abs(A.deltaY))),A.direction=r,i&&n>C.threshold&&r&C.direction},g.attrTest=function(A){return ft.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=Bl(A.direction);C&&(A.additionalEvent=this.options.event+C),I.prototype.emit.call(this,A)},e})(ft),Zl=(function(I){Me(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({event:"swipe",threshold:10,velocity:.3,direction:Xe|Gg,pointers:1},t))||this}var g=e.prototype;return g.getTouchAction=function(){return Er.prototype.getTouchAction.call(this)},g.attrTest=function(A){var C=this.options.direction,i;return C&(Xe|Gg)?i=A.overallVelocity:C&Xe?i=A.overallVelocityX:C&Gg&&(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=Bl(A.offsetDirection);C&&this.manager.emit(this.options.event+C,A),this.manager.emit(this.options.event,A)},e})(ft),Ll=(function(I){Me(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[Lg]},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})(ft),Gl=(function(I){Me(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[Lg]},g.attrTest=function(A){return I.prototype.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||this.state&Re)},e})(ft),jl=(function(I){Me(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[Tl]},g.process=function(A){var C=this,i=this.options,n=A.pointers.length===i.pointers,r=A.distance<i.threshold,s=A.deltaTime>i.time;if(this._input=A,!r||!n||A.eventType&(Ae|Te)&&!s)this.reset();else if(A.eventType&be)this.reset(),this._timer=setTimeout(function(){C.state=Cg,C.tryEmit()},i.time);else if(A.eventType&Ae)return Cg;return He},g.reset=function(){clearTimeout(this._timer)},g.emit=function(A){this.state===Cg&&(A&&A.eventType&Ae?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=pr(),this.manager.emit(this.options.event,this._input)))},e})(SA),Vl={domEvents:!1,touchAction:El,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},ko=[[Gl,{enable:!1}],[Ll,{enable:!1},["rotate"]],[Zl,{direction:Xe}],[Er,{direction:Xe},["swipe"]],[_i],[_i,{event:"doubletap",taps:2},["tap"]],[jl]],Y1=1,Mo=2;function Fo(I,e){var g=I.element;if(g.style){var t;Ig(I.options.cssProps,function(A,C){t=nC(g.style,C),e?(I.oldCssProps[t]=g.style[t],g.style[t]=A):g.style[t]=I.oldCssProps[t]||""}),e||(I.oldCssProps={})}}function W1(I,e){var g=document.createEvent("Event");g.initEvent(I,!0,!0),g.gesture=e,e.target.dispatchEvent(g)}var zo=(function(){function I(g,t){var A=this;this.options=jg({},Vl,t||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=G1(this),this.touchAction=new Pl(this,this.options.touchAction),Fo(this,!0),Ig(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 jg(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?Mo:Y1},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&Cg)&&(A.curRecognizer=null,n=null);for(var r=0;r<i.length;)C=i[r],A.stopped!==Mo&&(!n||C===n||C.canRecognizeWith(n))?C.recognize(t):C.reset(),!n&&C.state&(Re|ut|xg)&&(A.curRecognizer=C,n=C),r++}},e.get=function(t){if(t instanceof SA)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(rt(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(rt(t,"remove",this))return this;var A=this.get(t);if(t){var C=this.recognizers,i=Yg(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 Ig(Xt(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 Ig(Xt(t),function(i){A?C[i]&&C[i].splice(Yg(C[i],A),1):delete C[i]}),this},e.emit=function(t,A){this.options.domEvents&&W1(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&&Fo(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},I})(),_1={touchstart:be,touchmove:Kg,touchend:Ae,touchcancel:Te},H1="touchstart",U1="touchstart touchmove touchend touchcancel",K1=(function(I){Me(e,I);function e(){var t,A=e.prototype;return A.evTarget=H1,A.evWin=U1,t=I.apply(this,arguments)||this,t.started=!1,t}var g=e.prototype;return g.handler=function(A){var C=_1[A.type];if(C===be&&(this.started=!0),!!this.started){var i=Q1.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:xA,srcEvent:A})}},e})(Ot);function Q1(I,e){var g=Jt(I.touches),t=Jt(I.changedTouches);return e&(Ae|Te)&&(g=br(g.concat(t),"identifier",!0)),[g,t]}function Yl(I,e,g){var t="DEPRECATED METHOD: "+e+`
632
633
  `+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=Nl(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=Nl(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 To(I,e){return function(){return I.apply(e,arguments)}}var kl=(function(){var I=function(g,t){return t===void 0&&(t={}),new Eo(g,Ve({recognizers:bo.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=Ne,I.STATE_CHANGED=ht,I.STATE_ENDED=Tg,I.STATE_RECOGNIZED=Ig,I.STATE_CANCELLED=Jt,I.STATE_FAILED=_e,I.Manager=Eo,I.Input=Tt,I.TouchAction=fl,I.TouchInput=ur,I.MouseInput=fr,I.PointerEventInput=wl,I.TouchMouseInput=El,I.SingleTouchInput=xO,I.Recognizer=DA,I.AttrRecognizer=ct,I.Tap=Li,I.Pan=pr,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=To,I.assign=Gg,I.inherit=DO,I.bindFn=To,I.prefixed=IC,I.toArray=Xt,I.inArray=jg,I.uniqueArray=cr,I.splitStr=Qt,I.boolOrFn=CC,I.hasParent=hr,I.addEventListeners=Lt,I.removeEventListeners=Gt,I.defaults=Gg({},Rl,{preset:bo}),I})();kl.defaults;var RO=kl,Ml=My("DELETE");function NO(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 mr=typeof window!="undefined"?window.Hammer||RO: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=mr(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 fg(I){if(I)for(;I.hasChildNodes()===!0;){let e=I.firstChild;e&&(fg(e),I.removeChild(e))}}function mg(I){return I instanceof String||typeof I=="string"}function xo(I){return typeof I=="object"&&I!==null}function Yg(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")Yg(I,e,t,g);else{let A=I[t],C=e[t];xo(A)&&xo(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):Yg(e,g,C,t);else{if(B(g[C]))throw new TypeError("Arrays are not supported by deepExtend");Yg(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)&&!wg(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]):Yg(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 Yg(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&&Io(e[C])===Object.prototype)I[C]===void 0?I[C]=_({},e[C],g):typeof I[C]=="object"&&I[C]!==null&&Io(I[C])===Object.prototype?_(I[C],e[C],g):Yg(I,e,C,t);else if(B(e[C])){var A;I[C]=Ze(A=e[C]).call(A)}else Yg(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 YO(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 vr(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 Re(I,e){if(wg(I).call(I,"rgba"))return I;if(wg(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=vr(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(mg(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=WO(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),r=Vi(C.h,C.s,C.v);return{background:t,border:n,highlight:{background:r,border:n},hover:{background:r,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:mg(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:mg(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:mg(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:mg(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,r=(A-t)/A;return{h:n,s:r,v:A}}function nI(I,e,g){let t,A,C,i=Math.floor(I*6),n=I*6-i,r=g*(1-e),s=g*(1-n*e),o=g*(1-(1-n)*e);switch(i%6){case 0:t=g,A=o,C=r;break;case 1:t=s,A=g,C=r;break;case 2:t=r,A=g,C=o;break;case 3:t=r,A=s,C=g;break;case 4:t=o,A=r,C=g;break;case 5:t=g,A=r,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 WO(I){let e=vr(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 xg(I){if(I===null||typeof I!="object")return null;if(I instanceof Element)return I;let e=Eg(I);for(let g in I)Object.prototype.hasOwnProperty.call(I,g)&&typeof I[g]=="object"&&(e[g]=xg(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])},r=e[g],o=C(t)&&!i(t)?t[g]:void 0,a=o?o.enabled:void 0;if(r===void 0)return;if(typeof r=="boolean"){C(I[g])||(I[g]={}),I[g].enabled=r;return}if(r===null&&!C(I[g]))if(A(o))I[g]=Eg(o);else return;if(!C(r))return;let d=!0;r.enabled!==void 0?d=r.enabled:a!==void 0&&(d=o.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 pg(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),mg(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=vr(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 mr(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 r=2*Math.PI/360,s=1/360,o=1/this.r,a;for(i=0;i<360;i++)for(n=0;n<this.r;n++)A=this.centerCoordinates.x+n*Math.sin(r*i),C=this.centerCoordinates.y+n*Math.cos(r*i),a=nI(i*s,n*o,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,r=A-C,s=Math.atan2(n,r),o=.98*Math.min(Math.sqrt(n*n+r*r),i),a=Math.cos(s)*o+C,d=Math.sin(s)*o+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=o/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 r=0;r<e.length;r++){let s=document.createElement("option");s.value=e[r],r===C&&(s.selected="selected"),s.innerText=e[r],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],r=document.createElement("input");r.className="vis-configuration vis-config-range";try{r.type="range",r.min=C,r.max=i}catch(c){}r.step=n;let s="",o=0;g!==void 0?(g<0&&g*1.2<C?(r.min=Math.ceil(g*1.2),o=r.min,s="range increased"):g/1.2<C&&(r.min=Math.ceil(g/1.2),o=r.min,s="range increased"),g*1.2>i&&i!==1&&(r.max=Math.ceil(g*1.2),o=r.max,s="range increased"),r.value=g):r.value=A;let a=document.createElement("input");a.className="vis-configuration vis-config-rangeinput",a.value=r.value;let d=this;r.onchange=function(){a.value=this.value,d._update(Number(this.value),t)},r.oninput=function(){a.value=this.value};let l=this._makeLabel(t[t.length-1],t),h=this._makeItem(t,l,r,a);s!==""&&this.popupHistory[h]!==o&&(this.popupHistory[h]=o,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 r=e[n],s=yI(g,n);if(typeof C=="function"&&(A=C(n,g),A===!1&&!B(r)&&typeof r!="string"&&typeof r!="boolean"&&r instanceof Object&&(this.allowCreation=!1,A=this._handleObject(r,s,!0),this.allowCreation=t===!1)),A!==!1){i=!0;let o=this._getValue(s);if(B(r))this._handleArray(r,o,s);else if(typeof r=="string")this._makeTextInput(r,o,s);else if(typeof r=="boolean")this._makeCheckbox(r,o,s);else if(r instanceof Object){if(!this.hideOption(g,n,this.moduleOptions))if(r.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(r,s)||i}else this._makeCheckbox(r,d,s)}else{let a=this._makeLabel(n,s,!0);this._makeItem(s,a),i=this._handleObject(r,s)||i}}else console.error("dont know how to handle",r,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 r=!1,s=!0;this.y-g<this.padding&&(s=!1),this.x+t>C-this.padding&&(r=!0),r?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)}},Rt=!1,Oo,Yi="background: #FFeeee; color: #dd0000",JO=class Q{static validate(e,g,t){Rt=!1,Oo=g;let A=g;return t!==void 0&&(A=g[t]),Q.parse(e,A,[]),Rt}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(o){console.error("%c"+o+Q.printLocation(i,e),Yi)},r=Q.getType(g[e]),s=C[r];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]+'". '),Rt=!0):r==="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 ["+r+'] "'+g[e]+'"'),Rt=!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,Oo,[],!0),i=8,n=4,r;A.indexMatch!==void 0?r=" in "+Q.printLocation(A.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+A.indexMatch+`"?
634
+ `;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 Wl=Yl(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`."),X1=Yl(function(I,e){return Wl(I,e,!0)},"merge","Use `assign`.");function J1(I,e,g){var t=e.prototype,A;A=I.prototype=Object.create(t),A.constructor=I,A._super=t,g&&jg(A,g)}function Bo(I,e){return function(){return I.apply(e,arguments)}}var _l=(function(){var I=function(g,t){return t===void 0&&(t={}),new zo(g,Ve({recognizers:ko.concat()},t))};return I.VERSION="2.0.17-rc",I.DIRECTION_ALL=Ol,I.DIRECTION_DOWN=ct,I.DIRECTION_LEFT=OA,I.DIRECTION_RIGHT=DA,I.DIRECTION_UP=PA,I.DIRECTION_HORIZONTAL=Xe,I.DIRECTION_VERTICAL=Gg,I.DIRECTION_NONE=vI,I.DIRECTION_DOWN=ct,I.INPUT_START=be,I.INPUT_MOVE=Kg,I.INPUT_END=Ae,I.INPUT_CANCEL=Te,I.STATE_POSSIBLE=sI,I.STATE_BEGAN=Re,I.STATE_CHANGED=ut,I.STATE_ENDED=xg,I.STATE_RECOGNIZED=Cg,I.STATE_CANCELLED=$t,I.STATE_FAILED=He,I.Manager=zo,I.Input=Ot,I.TouchAction=Pl,I.TouchInput=yr,I.MouseInput=wr,I.PointerEventInput=Fl,I.TouchMouseInput=zl,I.SingleTouchInput=K1,I.Recognizer=SA,I.AttrRecognizer=ft,I.Tap=_i,I.Pan=Er,I.Swipe=Zl,I.Pinch=Ll,I.Rotate=Gl,I.Press=jl,I.on=Gt,I.off=jt,I.each=Ig,I.merge=X1,I.extend=Wl,I.bindFn=Bo,I.assign=jg,I.inherit=J1,I.bindFn=Bo,I.prefixed=nC,I.toArray=Jt,I.inArray=Yg,I.uniqueArray=br,I.splitStr=Xt,I.boolOrFn=rC,I.hasParent=vr,I.addEventListeners=Gt,I.removeEventListeners=jt,I.defaults=jg({},Vl,{preset:ko}),I})();_l.defaults;var $1=_l,Hl=t0("DELETE");function q1(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 Ul({},I,...g)}function Ul(){let I=wI(...arguments);return Ql(I),I}function wI(){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 wI(Ul(e[0],e[1]),...Le(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 z0(A))Object.prototype.propertyIsEnumerable.call(A,C)&&(A[C]===Hl?delete t[C]:t[C]!==null&&A[C]!==null&&typeof t[C]=="object"&&typeof A[C]=="object"&&!z(t[C])&&!z(A[C])?t[C]=wI(t[C],A[C]):t[C]=Kl(A[C]));return t}function Kl(I){return z(I)?ae(I).call(I,e=>Kl(e)):typeof I=="object"&&I!==null?I instanceof Date?new Date(I.getTime()):wI({},I):I}function Ql(I){for(let e of U(I))I[e]===Hl?delete I[e]:typeof I[e]=="object"&&I[e]!==null&&Ql(I[e])}function sC(){for(var I=arguments.length,e=new Array(I),g=0;g<I;g++)e[g]=arguments[g];return eO(e.length?e:[mI()])}function eO(I){let[e,g,t]=gO(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 gO(){let I=tO(),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 tO(){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 AO(){let I=()=>{};return{on:I,off:I,destroy:I,emit:I,get(){return{set:I}}}}var Tr=typeof window!="undefined"?window.Hammer||$1:function(){return AO()};function Ue(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=Tr(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=>{IO(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()}}dd(Ue.prototype);Ue.current=null;Ue.prototype.destroy=function(){this.deactivate();for(let g of Zg(I=Ke(e=this._cleanupQueue).call(e,0)).call(I)){var I,e;g()}};Ue.prototype.activate=function(){Ue.current&&Ue.current.deactivate(),Ue.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)};Ue.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")};Ue.prototype._onTapOverlay=function(I){this.activate(),I.srcEvent.stopPropagation()};function IO(I,e){for(;I;){if(I===e)return!0;I=I.parentNode}return!1}var CO=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,iO=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,nO=/^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,rO=/^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 pg(I){if(I)for(;I.hasChildNodes()===!0;){let e=I.firstChild;e&&(pg(e),I.removeChild(e))}}function vg(I){return I instanceof String||typeof I=="string"}function Zo(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 Xl(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];Zo(A)&&Zo(C)&&Xl(A,C,g)}}function Dt(I,e,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(z(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(z(g[C]))throw new TypeError("Arrays are not supported by deepExtend");Wg(e,g,C,t)}}return e}function EI(I,e,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(z(g))throw new TypeError("Arrays are not supported by deepExtend");for(let A in g)if(Object.prototype.hasOwnProperty.call(g,A)&&!Eg(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(z(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&&fo(e[C])===Object.prototype)I[C]===void 0?I[C]=_({},e[C],g):typeof I[C]=="object"&&I[C]!==null&&fo(I[C])===Object.prototype?_(I[C],e[C],g):Wg(I,e,C,t);else if(z(e[C])){var A;I[C]=Le(A=e[C]).call(A)}else Wg(I,e,C,t);return I}function TI(I,e){return[...I,e]}function sO(I){return Le(I).call(I)}function oO(I){return I.getBoundingClientRect().left}function aO(I){return I.getBoundingClientRect().top}function k(I,e){if(z(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 xr(I){let e;switch(I.length){case 3:case 4:return e=iO.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=CO.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(Eg(I).call(I,"rgba"))return I;if(Eg(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=xr(I);return g==null?I:"rgba("+g.r+","+g.g+","+g.b+","+e+")"}}function Jl(I,e,g){var t;return"#"+Le(t=((1<<24)+(I<<16)+(e<<8)+g).toString(16)).call(t,1)}function Hi(I,e){if(vg(I)){let t=I;if(ql(t)){var g;let A=ae(g=t.substr(4).substr(0,t.length-5).split(",")).call(g,function(C){return Ze(C)});t=Jl(A[0],A[1],A[2])}if($l(t)===!0){let A=dO(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=Ui(i.h,i.s,i.v),r=Ui(C.h,C.s,C.v);return{background:t,border:n,highlight:{background:r,border:n},hover:{background:r,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:vg(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:vg(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:vg(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:vg(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,r=(A-t)/A;return{h:n,s:r,v:A}}function oI(I,e,g){let t,A,C,i=Math.floor(I*6),n=I*6-i,r=g*(1-e),s=g*(1-n*e),o=g*(1-(1-n)*e);switch(i%6){case 0:t=g,A=o,C=r;break;case 1:t=s,A=g,C=r;break;case 2:t=r,A=g,C=o;break;case 3:t=r,A=s,C=g;break;case 4:t=o,A=r,C=g;break;case 5:t=g,A=r,C=s;break}return{r:Math.floor(t*255),g:Math.floor(A*255),b:Math.floor(C*255)}}function Ui(I,e,g){let t=oI(I,e,g);return Jl(t.r,t.g,t.b)}function dO(I){let e=xr(I);if(!e)throw new TypeError("'".concat(I,"' is not a valid color."));return Bt(e.r,e.g,e.b)}function $l(I){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(I)}function ql(I){return nO.test(I)}function lO(I){return rO.test(I)}function Og(I){if(I===null||typeof I!="object")return null;if(I instanceof Element)return I;let e=Tg(I);for(let g in I)Object.prototype.hasOwnProperty.call(I,g)&&typeof I[g]=="object"&&(e[g]=Og(I[g]));return e}function Se(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 f=h[c],u=l[c];for(let m in f)Object.prototype.hasOwnProperty.call(f,m)&&(u[m]=f[m])},r=e[g],o=C(t)&&!i(t)?t[g]:void 0,d=o?o.enabled:void 0;if(r===void 0)return;if(typeof r=="boolean"){C(I[g])||(I[g]={}),I[g].enabled=r;return}if(r===null&&!C(I[g]))if(A(o))I[g]=Tg(o);else return;if(!C(r))return;let a=!0;r.enabled!==void 0?a=r.enabled:d!==void 0&&(a=o.enabled),n(I,e,g),I[g].enabled=a}var hO={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 mg(I,e){let g;z(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 cO={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"},uO=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 cO[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),vg(e)===!0){if(ql(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(lO(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($l(e)===!0){let C=xr(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: "+xt(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",Qe(()=>{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=oI(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),TA(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 Tr(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 r=2*Math.PI/360,s=1/360,o=1/this.r,d;for(i=0;i<360;i++)for(n=0;n<this.r;n++)A=this.centerCoordinates.x+n*Math.sin(r*i),C=this.centerCoordinates.y+n*Math.cos(r*i),d=oI(i*s,n*o,1),e.fillStyle="rgb("+d.r+","+d.g+","+d.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,r=A-C,s=Math.atan2(n,r),o=.98*Math.min(Math.sqrt(n*n+r*r),i),d=Math.cos(s)*o+C,a=Math.sin(s)*o+i;this.colorPickerSelector.style.top=d-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=a-.5*this.colorPickerSelector.clientWidth+"px";let l=s/(2*Math.PI);l=l<0?l+1:l;let h=o/this.r,c=Bt(this.color.r,this.color.g,this.color.b);c.h=l,c.s=h;let f=oI(c.h,c.s,c.v);f.a=this.color.a,this.color=f,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 Ki(){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(Ki(...Le(e).call(e,1))),t}}var fO=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 uO(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(z(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(Ki("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 r=0;r<e.length;r++){let s=document.createElement("option");s.value=e[r],r===C&&(s.selected="selected"),s.innerText=e[r],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],r=document.createElement("input");r.className="vis-configuration vis-config-range";try{r.type="range",r.min=C,r.max=i}catch(c){}r.step=n;let s="",o=0;g!==void 0?(g<0&&g*1.2<C?(r.min=Math.ceil(g*1.2),o=r.min,s="range increased"):g/1.2<C&&(r.min=Math.ceil(g/1.2),o=r.min,s="range increased"),g*1.2>i&&i!==1&&(r.max=Math.ceil(g*1.2),o=r.max,s="range increased"),r.value=g):r.value=A;let d=document.createElement("input");d.className="vis-configuration vis-config-rangeinput",d.value=r.value;let a=this;r.onchange=function(){d.value=this.value,a._update(Number(this.value),t)},r.oninput=function(){d.value=this.value};let l=this._makeLabel(t[t.length-1],t),h=this._makeItem(t,l,r,d);s!==""&&this.popupHistory[h]!==o&&(this.popupHistory[h]=o,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=Qe(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=Qe(()=>{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 r=e[n],s=TI(g,n);if(typeof C=="function"&&(A=C(n,g),A===!1&&!z(r)&&typeof r!="string"&&typeof r!="boolean"&&r instanceof Object&&(this.allowCreation=!1,A=this._handleObject(r,s,!0),this.allowCreation=t===!1)),A!==!1){i=!0;let o=this._getValue(s);if(z(r))this._handleArray(r,o,s);else if(typeof r=="string")this._makeTextInput(r,o,s);else if(typeof r=="boolean")this._makeCheckbox(r,o,s);else if(r instanceof Object){if(!this.hideOption(g,n,this.moduleOptions))if(r.enabled!==void 0){let d=TI(s,"enabled"),a=this._getValue(d);if(a===!0){let l=this._makeLabel(n,s,!0);this._makeItem(s,l),i=this._handleObject(r,s)||i}else this._makeCheckbox(r,a,s)}else{let d=this._makeLabel(n,s,!0);this._makeItem(s,d),i=this._handleObject(r,s)||i}}else console.error("dont know how to handle",r,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(Ki("pre","const options = "+xt(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}},pO=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 r=!1,s=!0;this.y-g<this.padding&&(s=!1),this.x+t>C-this.padding&&(r=!0),r?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,Lo,Qi="background: #FFeeee; color: #dd0000",mO=class Q{static validate(e,g,t){Nt=!1,Lo=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(o){console.error("%c"+o+Q.printLocation(i,e),Qi)},r=Q.getType(g[e]),s=C[r];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):r==="object"&&A!=="__any__"&&(i=TI(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 ["+r+'] "'+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":z(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,Lo,[],!0),i=8,n=4,r;A.indexMatch!==void 0?r=" in "+Q.printLocation(A.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+A.indexMatch+`"?
634
635
 
635
- `:C.distance<=n&&A.distance>C.distance?r=" in "+Q.printLocation(A.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+Q.printLocation(C.path,C.closestMatch,""):A.distance<=i?r='. Did you mean "'+A.closestMatch+'"?'+Q.printLocation(A.path,e):r=". Did you mean one of these: "+Q.print(U(g))+Q.printLocation(t,e),console.error('%cUnknown option detected: "'+e+'"'+r,Yi),Rt=!0}static findInOptions(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,C=1e9,i="",n=[],r=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 o;G(o=a.toLowerCase()).call(o,r)!==-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
+ `:C.distance<=n&&A.distance>C.distance?r=" in "+Q.printLocation(A.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+Q.printLocation(C.path,C.closestMatch,""):A.distance<=i?r='. Did you mean "'+A.closestMatch+'"?'+Q.printLocation(A.path,e):r=". Did you mean one of these: "+Q.print(U(g))+Q.printLocation(t,e),console.error('%cUnknown option detected: "'+e+'"'+r,Qi),Nt=!0}static findInOptions(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,C=1e9,i="",n=[],r=e.toLowerCase(),s;for(let d in g){let a;if(g[d].__type__!==void 0&&A===!0){let l=Q.findInOptions(e,g[d],TI(t,d));C>l.distance&&(i=l.closestMatch,n=l.path,C=l.distance,s=l.indexMatch)}else{var o;G(o=d.toLowerCase()).call(o,r)!==-1&&(s=d),a=Q.levenshteinDistance(e,d),C>a&&(i=d,n=sO(t),C=a)}}return{closestMatch:i,path:n,distance:C,indexMatch:s}}static printLocation(e,g){let A=`
636
637
 
637
638
  `+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at:
638
639
  `)+`options = {
@@ -641,16 +642,16 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper {
641
642
  `;for(let C=0;C<e.length+1;C++){for(let i=0;i<e.length-C;i++)A+=" ";A+=`}
642
643
  `}return A+`
643
644
 
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,rt=mr,e1=XO,jl=Yi,g1=JO;function t1(I){return vg=I,i1()}var Yl={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},br=Eg(Yl);br.color="color.color";br.style="dashes";var me={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},Po={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},vg="",ut=0,N="",P="",we=me.NULL;function A1(){ut=0,N=vg.charAt(0)}function re(){ut++,N=vg.charAt(ut)}function gt(){return vg.charAt(ut+1)}function Do(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 Pg(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 Wl(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=Pg(A.attr,I.node))),g=C.length-1;g>=0;g--){var n,r=C[g];r.nodes||(r.nodes=[]),G(n=r.nodes).call(n,A)===-1&&r.nodes.push(A)}e.attr&&(A.attr=Pg(A.attr,e.attr))}function C1(I,e){if(I.edges||(I.edges=[]),I.edges.push(e),I.edge){var g=Pg({},I.edge);e.attr=Pg(g,e.attr)}}function _l(I,e,g,t,A){var C={from:e,to:g,type:t};return I.edge&&(C.attr=Pg({},I.edge)),C.attr=Pg(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="";N===" "||N===" "||N===`
645
- `||N==="\r";)re();do{var I=!1;if(N==="#"){for(var e=ut-1;vg.charAt(e)===" "||vg.charAt(e)===" ";)e--;if(vg.charAt(e)===`
646
- `||vg.charAt(e)===""){for(;N!=""&&N!=`
647
- `;)re();I=!0}}if(N==="/"&&gt()==="/"){for(;N!=""&&N!=`
648
- `;)re();I=!0}if(N==="/"&&gt()==="*"){for(;N!="";)if(N==="*"&&gt()==="/"){re(),re();break}else re();I=!0}for(;N===" "||N===" "||N===`
649
- `||N==="\r";)re()}while(I);if(N===""){we=me.DELIMITER;return}var g=N+gt();if(Po[g]){we=me.DELIMITER,P=g,re(),re();return}if(Po[N]){we=me.DELIMITER,P=N,re();return}if(Do(N)||N==="-"){for(P+=N,re();Do(N);)P+=N,re();P==="false"?P=!1:P==="true"?P=!0:isNaN(Number(P))||(P=Number(P)),we=me.IDENTIFIER;return}if(N==='"'){for(re();N!=""&&(N!='"'||N==='"'&&gt()==='"');)N==='"'?(P+=N,re()):N==="\\"&&gt()==="n"?(P+=`
650
- `,re()):P+=N,re();if(N!='"')throw ve('End of string " expected');re(),we=me.IDENTIFIER;return}for(we=me.UNKNOWN;N!="";)P+=N,re();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=r1(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 r1(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),Wl(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,Wl(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 r;i==="arrowhead"&&(r=t[n],i="arrows",n={to:{enabled:!0,type:r}}),i==="arrowtail"&&(r=t[n],i="arrows",n={from:{enabled:!0,type:r}}),A.push({attr:e,name:i,value:n}),C.push(i),K(),P==","&&K()}if(P!="]")throw ve("Bracket ] expected");K()}if(wg(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 o=A[s.dir].value;if(!wg(C).call(C,"arrows"))if(o==="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(o==="forward")A.push({attr:A[s.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),s.arrows.to=A.length-1;else if(o==="back")A.push({attr:A[s.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),s.arrows.from=A.length-1;else if(o==="none")A.push({attr:A[s.dir].attr,name:"arrows",value:""}),s.arrows.to=A.length-1;else throw ve('Invalid dir type "'+o+'"');var a,d;if(o==="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(o==="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(o==="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(o==="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 "'+o+'"');Ue(A).call(A,s.dir,1)}var h;if(wg(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 o1(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 Ro(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)};Pg(n,Ro(i.attr,Yl)),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 Pg(n,Ro(i.attr,br)),n.arrows==null&&i.type==="->"&&(n.arrows="to"),n};F(A=e.edges).call(A,function(i){var n,r;if(i.from instanceof Object?n=i.from.nodes:n={id:i.from},i.to instanceof Object?r=i.to.nodes:r={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(o1(n,r,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 o;F(o=i.to.edges).call(o,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 r={from:n.source,id:n.id,to:n.target};return n.attributes!=null&&(r.attributes=n.attributes),n.label!=null&&(r.label=n.label),n.attributes!=null&&n.attributes.title!=null&&(r.title=n.attributes.title),n.type==="Directed"&&(r.arrows="to"),n.color&&t.edges.inheritColor===!1&&(r.color=n.color),r});return{nodes:ae(g=I.nodes).call(g,n=>{let r={id:n.id,fixed:t.nodes.fixed&&n.x!=null&&n.y!=null};return n.attributes!=null&&(r.attributes=n.attributes),n.label!=null&&(r.label=n.label),n.size!=null&&(r.size=n.size),n.attributes!=null&&n.attributes.title!=null&&(r.title=n.attributes.title),n.title!=null&&(r.title=n.title),n.x!=null&&(r.x=n.x),n.y!=null&&(r.y=n.y),n.color!=null&&(t.nodes.parseColor===!0?r.color=n.color:r.color={background:n.color,border:n.color,highlight:{background:n.color,border:n.color},hover:{background:n.color,border:n.color}}),r}),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 Wi=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),r=Math.floor(e/4),s=Math.floor(e/8),o=Math.floor(e/16);this.canvas.width=3*r,this.canvas.height=t,this.coordinates=[[0,0,n,t],[n,0,r,A],[n,A,s,C],[5*s,A,o,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 r=this.coordinates[n];e.drawImage(this.canvas,r[0],r[1],r[2],r[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 Wi;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,R1=og,No=O1,rI=Object.isExtensible,N1=P1(function(){rI(1)}),S1=N1||No?function(e){return!D1(e)||No&&R1(e)==="ArrayBuffer"?!1:rI?rI(e):!0}:rI,k1=z,Jl=!k1(function(){return Object.isExtensible(Object.preventExtensions({}))}),M1=R,F1=Z,B1=lA,z1=ce,yr=ne,Z1=Oe.f,So=mA,L1=XI,wr=S1,G1=YI,V1=Jl,$l=!1,ng=G1("meta"),j1=0,Er=function(I){Z1(I,ng,{value:{objectID:"O"+j1++,weakData:{}}})},Y1=function(I,e){if(!z1(I))return typeof I=="symbol"?I:(typeof I=="string"?"S":"P")+I;if(!yr(I,ng)){if(!wr(I))return"F";if(!e)return"E";Er(I)}return I[ng].objectID},W1=function(I,e){if(!yr(I,ng)){if(!wr(I))return!0;if(!e)return!1;Er(I)}return I[ng].weakData},_1=function(I){return V1&&$l&&wr(I)&&!yr(I,ng)&&Er(I),I},K1=function(){U1.enable=function(){},$l=!0;var I=So.f,e=F1([].splice),g={};g[ng]=1,I(g).length&&(So.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:Y1,getWeakData:W1,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=dg,ko=Qn,eP=ft,gP=yt,tP=ee,AP=tP("iterator"),ql=function(I){if(!eP(I))return ko(I,AP)||ko(I,"@@iterator")||gP[q1(I)]},IP=je,CP=Wg,iP=ag,nP=sA,rP=ql,sP=TypeError,eh=function(I,e){var g=arguments.length<2?rP(I):e;if(CP(g))return iP(IP(g,I));throw new sP(nP(I)+" is not iterable")},oP=je,Mo=ag,aP=Qn,dP=function(I,e,g){var t,A;Mo(I);try{if(t=aP(I,"return"),!t){if(e==="throw")throw g;return g}t=oP(t,I)}catch(C){A=!0,t=C}if(e==="throw")throw g;if(A)throw t;return Mo(t),g},lP=aA,hP=je,cP=ag,uP=sA,fP=$1,pP=Se,Fo=J,mP=eh,vP=ql,Bo=dP,bP=TypeError,sI=function(I,e){this.stopped=I,this.result=e},zo=sI.prototype,Tr=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),r=lP(e,t),s,o,a,d,l,h,c,p=function(m){return s&&Bo(s,"normal",m),new sI(!0,m)},u=function(m){return A?(cP(m),n?r(m[0],m[1],p):r(m[0],m[1])):n?r(m,p):r(m)};if(C)s=I.iterator;else if(i)s=I;else{if(o=vP(I),!o)throw new bP(uP(I)+" is not iterable");if(fP(o)){for(a=0,d=pP(I);d>a;a++)if(l=u(I[a]),l&&Fo(zo,l))return l;return new sI(!1)}s=mP(I,o)}for(h=C?I.next:s.next;!(c=hP(h,s)).done;){try{l=u(c.value)}catch(m){Bo(s,"throw",m)}if(typeof l=="object"&&l&&Fo(zo,l))return l}return new sI(!1)},yP=J,wP=TypeError,xr=function(I,e){if(yP(e,I))return I;throw new wP("Incorrect invocation")},EP=R,TP=X,xP=nC,OP=z,PP=vt,DP=Tr,RP=xr,NP=le,SP=ce,kP=ft,MP=bt,FP=Oe.f,BP=Rg.forEach,zP=ie,gh=Kg,ZP=gh.set,LP=gh.getterFor,Or=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,r={},s;if(!zP||!NP(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(RP(d,o),{type:I,collection:new i}),kP(l)||DP(l,d[C],{that:d,AS_ENTRIES:t})});var o=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(o,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(o,"size",{configurable:!0,get:function(){return a(this).collection.size}})}return MP(s,I,!1,!0),r[I]=s,EP({global:!0,forced:!0},r),A||g.setStrong(s,I,t),s},GP=vA,Pr=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=We,jP=Ar,YP=ee,WP=ie,Zo=YP("species"),_P=function(I){var e=VP(I);WP&&e&&!e[Zo]&&jP(e,Zo,{configurable:!0,get:function(){return this}})},KP=pA,UP=Ar,Lo=Pr,HP=aA,QP=xr,XP=ft,JP=Tr,$P=sr,QA=or,qP=_P,Nt=ie,Go=nC.fastKey,th=Kg,Vo=th.set,gi=th.getterFor,Ah={getConstructor:function(I,e,g,t){var A=I(function(s,o){QP(s,C),Vo(s,{type:e,index:KP(null),first:void 0,last:void 0,size:0}),Nt||(s.size=0),XP(o)||JP(o,s[t],{that:s,AS_ENTRIES:g})}),C=A.prototype,i=gi(e),n=function(s,o,a){var d=i(s),l=r(s,o),h,c;return l?l.value=a:(d.last=l={index:c=Go(o,!0),key:o,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},r=function(s,o){var a=i(s),d=Go(o),l;if(d!=="F")return a.index[d];for(l=a.first;l;l=l.next)if(l.key===o)return l};return Lo(C,{clear:function(){for(var o=this,a=i(o),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:o.size=0},delete:function(s){var o=this,a=i(o),d=r(o,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--:o.size--}return!!d},forEach:function(o){for(var a=i(this),d=HP(o,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(o){return!!r(this,o)}}),Lo(C,g?{get:function(o){var a=r(this,o);return a&&a.value},set:function(o,a){return n(this,o===0?0:o,a)}}:{add:function(o){return n(this,o=o===0?0:o,o)}}),Nt&&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){Vo(this,{type:t,target:i,state:A(i),kind:n,last:void 0})},function(){for(var i=C(this),n=i.kind,r=i.last;r&&r.removed;)r=r.previous;return!i.target||!(i.last=r=r?r.next:i.state.first)?(i.target=void 0,QA(void 0,!0)):QA(n==="keys"?r.key:n==="values"?r.value:[r.key,r.value],!1)},g?"entries":"values",!g,!0),qP(e)}},eD=Or,gD=Ah;eD("Map",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},gD);var Dr=Z,tD=_I,AD=qe,ID=CA,CD=Dr("".charAt),jo=Dr("".charCodeAt),iD=Dr("".slice),Yo=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=jo(t,A),i<55296||i>56319||A+1===C||(n=jo(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:Yo(!1),charAt:Yo(!0)},rD=nD.charAt,sD=qe,Ih=Kg,oD=sr,Wo=or,Ch="String Iterator",aD=Ih.set,dD=Ih.getterFor(Ch);oD(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?Wo(void 0,!0):(A=rD(g,t),e.index+=A.length,Wo(A,!1))});var lD=L,hD=lD.Map,cD=hD,uD=cD,fD=uD,RA=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 RA,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=R;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=R,PD=xD;OD({target:"Number",stat:!0},{isFinite:PD});var DD=L,RD=DD.Number.isFinite,ND=RD,SD=ND,kD=SD,Mg=D(kD),MD=R,FD=Rg.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},YD=jD,WD=YD,_D=WD,ih=D(_D),KD=L,UD=KD.Object.getOwnPropertySymbols,HD=UD,QD=HD,XD=QD,Xe=D(XD),nh={exports:{}},JD=R,$D=z,qD=Ye,rh=tA.f,sh=ie,e2=!sh||$D(function(){rh(1)});JD({target:"Object",stat:!0,forced:e2,sham:!sh},{getOwnPropertyDescriptor:function(e,g){return rh(qD(e),g)}});var g2=L,oh=g2.Object,t2=nh.exports=function(e,g){return oh.getOwnPropertyDescriptor(e,g)};oh.getOwnPropertyDescriptor.sham&&(t2.sham=!0);var A2=nh.exports,I2=A2,C2=I2,i2=C2,eg=D(i2),n2=R,r2=ie,s2=Ud,o2=Ye,a2=tA,d2=uA;n2({target:"Object",stat:!0,sham:!r2},{getOwnPropertyDescriptors:function(e){for(var g=o2(e),t=a2.f,A=s2(g),C={},i=0,n,r;A.length>i;)r=t(g,n=A[i++]),r!==void 0&&d2(C,n,r);return C}});var l2=L,h2=l2.Object.getOwnPropertyDescriptors,c2=h2,u2=c2,f2=u2,Je=D(f2),ah={exports:{}},p2=R,m2=ie,_o=HI.f;p2({target:"Object",stat:!0,forced:Object.defineProperties!==_o,sham:!m2},{defineProperties:_o});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,NA=D(T2),lh={exports:{}},x2=R,O2=ie,Ko=Oe.f;x2({target:"Object",stat:!0,forced:Object.defineProperty!==Ko,sham:!O2},{defineProperty:Ko});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 R2=lh.exports,N2=R2,ch=N2,S2=ch,k2=S2,M2=k2,F2=M2,B2=F2,z2=D(B2),Z2=ee,L2=Oe.f,Uo=Z2("metadata"),Ho=Function.prototype;Ho[Uo]===void 0&&L2(Ho,Uo,{value:null});var G2=$;G2("asyncDispose");var V2=$;V2("dispose");var j2=$;j2("metadata");var Y2=Kd,W2=Y2,_2=We,K2=Z,Rr=_2("Symbol"),U2=Rr.keyFor,H2=K2(Rr.prototype.valueOf),uh=Rr.isRegisteredSymbol||function(e){try{return U2(H2(e))!==void 0}catch(g){return!1}},Q2=R,X2=uh;Q2({target:"Symbol",stat:!0},{isRegisteredSymbol:X2});var J2=mt,fh=We,$2=Z,q2=rA,eR=ee,wI=fh("Symbol"),Qo=wI.isWellKnownSymbol,ph=fh("Object","getOwnPropertyNames"),gR=$2(wI.prototype.valueOf),Xo=J2("wks");for(XA=0,Ai=ph(wI),Jo=Ai.length;XA<Jo;XA++)try{Ii=Ai[XA],q2(wI[Ii])&&eR(Ii)}catch(I){}var Ii,XA,Ai,Jo,mh=function(e){if(Qo&&Qo(e))return!0;try{for(var g=gR(e),t=0,A=ph(Xo),C=A.length;t<C;t++)if(Xo[A[t]]==g)return!0}catch(i){}return!1},tR=R,AR=mh;tR({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:AR});var IR=$;IR("matcher");var CR=$;CR("observable");var iR=R,nR=uh;iR({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:nR});var rR=R,sR=mh;rR({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:sR});var oR=$;oR("metadataKey");var aR=$;aR("patternMatch");var dR=$;dR("replaceAll");var lR=W2,hR=lR,cR=hR,JA=D(cR),uR=bA,fR=uR.f("iterator"),pR=fR,vh=pR,mR=vh,vR=mR,bR=vR,yR=bR,wR=yR,ER=D(wR);function $t(I){"@babel/helpers - typeof";return $t=typeof JA=="function"&&typeof ER=="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 TR=bA,xR=TR.f("toPrimitive"),OR=xR,PR=OR,DR=PR,RR=DR,NR=RR,SR=NR,kR=SR,MR=D(kR);function FR(I,e){if($t(I)!=="object"||I===null)return I;var g=I[MR];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 BR(I){var e=FR(I,"string");return $t(e)==="symbol"?e:String(e)}function ge(I,e,g){return e=BR(e),e in I?z2(I,e,{value:g,enumerable:!0,configurable:!0,writable:!0}):I[e]=g,I}var zR=Wg,ZR=xe,LR=jI,GR=Se,VR=TypeError,$o=function(I){return function(e,g,t,A){zR(g);var C=ZR(e),i=LR(C),n=GR(C),r=I?n-1:0,s=I?-1:1;if(t<2)for(;;){if(r in i){A=i[r],r+=s;break}if(r+=s,I?r<0:n<=r)throw new VR("Reduce of empty array with no initial value")}for(;I?r>=0:n>r;r+=s)r in i&&(A=g(A,i[r],r,C));return A}},jR={left:$o(!1),right:$o(!0)},YR=X,WR=og,_R=WR(YR.process)==="process",KR=R,UR=jR.left,HR=wt,qo=nA,QR=_R,XR=!QR&&qo>79&&qo<83,JR=XR||!HR("reduce");KR({target:"Array",proto:!0,forced:JR},{reduce:function(e){var g=arguments.length;return UR(this,e,g,g>1?arguments[1]:void 0)}});var $R=Ie,qR=$R("Array").reduce,eN=J,gN=qR,Ci=Array.prototype,tN=function(I){var e=I.reduce;return I===Ci||eN(Ci,I)&&e===Ci.reduce?gN:e},AN=tN,IN=AN,CN=IN,Nr=D(CN),iN=Dg,nN=Se,rN=er,sN=aA,bh=function(I,e,g,t,A,C,i,n){for(var r=A,s=0,o=i?sN(i,n):!1,a,d;s<t;)s in g&&(a=o?o(g[s],s,e):g[s],C>0&&iN(a)?(d=nN(a),r=bh(I,e,a,d,r,C-1)-1):(rN(r+1),I[r]=a),r++),s++;return r},oN=bh,aN=R,dN=oN,lN=Wg,hN=xe,cN=Se,uN=UI;aN({target:"Array",proto:!0},{flatMap:function(e){var g=hN(this),t=cN(g),A;return lN(e),A=uN(g,0),A.length=dN(A,g,g,t,0,1,e,arguments.length>1?arguments[1]:void 0),A}});var fN=Ie,eF=fN("Array").flatMap;var gF=Array.prototype;var pN=vh,nt=D(pN),mN=Or,vN=Ah;mN("Set",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},vN);var bN=L,yN=bN.Set,wN=yN,EN=wN,TN=EN,Le=D(TN),xN=eh,ON=xN,PN=ON,DN=PN,RN=DN,NN=RN,SN=NN,kN=SN,MN=kN,FN=MN,ii=D(FN),ea=od,BN=Math.floor,Hi=function(I,e){var g=I.length,t=BN(g/2);return g<8?zN(I,e):ZN(I,Hi(ea(I,0,t),e),Hi(ea(I,t),e),e)},zN=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},ZN=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},LN=Hi,GN=iA,ga=GN.match(/firefox\/(\d+)/i),VN=!!ga&&+ga[1],jN=iA,YN=/MSIE|Trident/.test(jN),WN=iA,ta=WN.match(/AppleWebKit\/(\d+)\./),_N=!!ta&&+ta[1],KN=R,yh=Z,UN=Wg,HN=xe,Aa=Se,QN=Xd,Ia=qe,Sr=z,XN=LN,JN=wt,Ca=VN,$N=YN,ia=nA,na=_N,bg=[],ra=yh(bg.sort),qN=yh(bg.push),eS=Sr(function(){bg.sort(void 0)}),gS=Sr(function(){bg.sort(null)}),tS=JN("sort"),wh=!Sr(function(){if(ia)return ia<70;if(!(Ca&&Ca>3)){if($N)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++)bg.push({k:g+A,v:t})}for(bg.sort(function(C,i){return i.v-C.v}),A=0;A<bg.length;A++)g=bg[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}};KN({target:"Array",proto:!0,forced:AS},{sort:function(e){e!==void 0&&UN(e);var g=HN(this);if(wh)return e===void 0?ra(g):ra(g,e);var t=[],A=Aa(g),C,i;for(i=0;i<A;i++)i in g&&qN(t,g[i]);for(XN(t,IS(e)),C=Aa(t),i=0;i<C;)g[i]=t[i++];for(;i<A;)QN(g,i++);return g}});var CS=Ie,iS=CS("Array").sort,nS=J,rS=iS,ni=Array.prototype,sS=function(I){var e=I.sort;return I===ni||nS(ni,I)&&e===ni.sort?rS:e},oS=sS,aS=oS,dS=aS,Cg=D(dS),lS=Ie,hS=lS("Array").keys,cS=hS,uS=cS,fS=dg,pS=ne,mS=J,vS=uS,ri=Array.prototype,bS={DOMTokenList:!0,NodeList:!0},yS=function(I){var e=I.keys;return I===ri||mS(ri,I)&&e===ri.keys||pS(bS,fS(I))?vS:e},wS=yS,tt=D(wS),ES=Ie,TS=ES("Array").values,xS=TS,OS=xS,PS=dg,DS=ne,RS=J,NS=OS,si=Array.prototype,SS={DOMTokenList:!0,NodeList:!0},kS=function(I){var e=I.values;return I===si||RS(si,I)&&e===si.values||DS(SS,PS(I))?NS:e},MS=kS,EI=D(MS),FS=Ie,BS=FS("Array").entries,zS=BS,ZS=zS,LS=dg,GS=ne,VS=J,jS=ZS,oi=Array.prototype,YS={DOMTokenList:!0,NodeList:!0},WS=function(I){var e=I.entries;return I===oi||VS(oi,I)&&e===oi.entries||GS(YS,LS(I))?jS:e},_S=WS,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 oe=[];for(let I=0;I<256;++I)oe.push((I+256).toString(16).slice(1));function XS(I,e=0){return oe[I[e+0]]+oe[I[e+1]]+oe[I[e+2]]+oe[I[e+3]]+"-"+oe[I[e+4]]+oe[I[e+5]]+"-"+oe[I[e+6]]+oe[I[e+7]]+"-"+oe[I[e+8]]+oe[I[e+9]]+"-"+oe[I[e+10]]+oe[I[e+11]]+oe[I[e+12]]+oe[I[e+13]]+oe[I[e+14]]+oe[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 oa(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=oa(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):Je?NA(I,Je(A)):F(t=oa(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=Eg(null);for(let[g,t]of this._pairs)e[g]=t;return e}toMap(){return new RA(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,r=e(n,i);r>C&&(C=r,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,r=e(n,i);r<C&&(C=r,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,r]=A;return e(i,r,C,n)}))}})}};function $S(I,e){return I[e]==null&&(I[e]=st()),I}var rg=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 RA,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,r=s=>{let o=s[n];if(o!=null&&this._data.has(o)){let a=s,d=q({},this._data.get(o)),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,o=e.length;s<o;s++)e[s]&&typeof e[s]=="object"?r(e[s]):console.warn("Ignoring input item, which is not an object at index "+s);else if(e&&typeof e=="object")r(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,r=i[this._idProp],s=NO(i,n);return this._data.set(r,s),{id:r,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),r=[],s,o,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))&&r.push(s);else{var d;o=[...tt(d=this._data).call(d)];for(let h=0,c=o.length;h<c;h++)a=o[h],s=this._data.get(a),s!=null&&(!n||n(s))&&r.push(s)}if(C&&C.order&&t==null&&this._sort(r,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=r.length;c<p;c++)r[c]=this._filterFields(r[c],h)}if(i=="Object"){let h={};for(let c=0,p=r.length;c<p;c++){let u=r[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 r}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 r=0,s=C.length;r<s;r++){let o=C[r],a=this._data.get(o);a!=null&&t(a)&&n.push(a)}this._sort(n,A);for(let r=0,s=n.length;r<s;r++)i.push(n[r][this._idProp])}else for(let n=0,r=C.length;n<r;n++){let s=C[n],o=this._data.get(s);o!=null&&t(o)&&i.push(o[this._idProp])}else if(A){let n=[];for(let r=0,s=C.length;r<s;r++){let o=C[r];n.push(g.get(o))}this._sort(n,A);for(let r=0,s=n.length;r<s;r++)i.push(n[r][this._idProp])}else for(let n=0,r=C.length;n<r;n++){let s=C[n],o=g.get(s);o!=null&&i.push(o[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,r=i.length;n<r;n++){let s=i[n],o=s[this._idProp];e(s,o)}}else for(let i=0,n=C.length;i<n;i++){let r=C[i],s=this._data.get(r);s!=null&&(!t||t(s))&&e(s,r)}}map(e,g){let t=g&&te(g),A=[],C=this._data,i=[...tt(C).call(C)];for(let n=0,r=i.length;n<r;n++){let s=i[n],o=this._data.get(s);o!=null&&(!t||t(o))&&A.push(e(o,s))}return g&&g.order&&this._sort(A,g.order),A}_filterFields(e,g){var t;return e&&Nr(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 r=this._remove(C[i]);if(r){let s=r[this._idProp];s!=null&&(t.push(s),A.push(r))}}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 r=t[i],o=g.get(r)[e],a=!1;for(let d=0;d<C;d++)if(A[d]==o){a=!0;break}!a&&o!==void 0&&(A[C]=o,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=ar,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,rk=R,ca=nk;rk({global:!0,forced:parseFloat!==ca},{parseFloat:ca});var sk=L,ok=sk.parseFloat,ak=ok,dk=ak,lk=dk,xh=D(lk),hk=R,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 kr(I,e){let g=["node","edge","label"],t=!0,A=pg(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=pg(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,r=Math.cos(e)*i;r===i?(A+=i,C=t.y):n===i?(A=t.x,C-=i):(A+=r,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 r=t.blocks[n];r.width!==0?i.push(r):C===void 0&&(C=r)}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 r=this.parent.getFormattingValues(e,t,A,n),s=0;return i!==""&&(s=this.ctx.measureText(i).width),{width:s,values:r}};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,`
645
+ `}static print(e){return xt(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]}},vO=Ue,bO=fO,ot=Tr,yO=pO,eh=Qi,wO=mO;function EO(I){return bg=I,DO()}var gh={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},Or=Tg(gh);Or.color="color.color";Or.style="dashes";var me={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},Go={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},bg="",pt=0,N="",D="",we=me.NULL;function TO(){pt=0,N=bg.charAt(0)}function re(){pt++,N=bg.charAt(pt)}function At(){return bg.charAt(pt+1)}function jo(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 Pg(I,e){if(I||(I={}),e)for(var g in e)e.hasOwnProperty(g)&&(I[g]=e[g]);return I}function xO(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 th(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=Pg(A.attr,I.node))),g=C.length-1;g>=0;g--){var n,r=C[g];r.nodes||(r.nodes=[]),G(n=r.nodes).call(n,A)===-1&&r.nodes.push(A)}e.attr&&(A.attr=Pg(A.attr,e.attr))}function OO(I,e){if(I.edges||(I.edges=[]),I.edges.push(e),I.edge){var g=Pg({},I.edge);e.attr=Pg(g,e.attr)}}function Ah(I,e,g,t,A){var C={from:e,to:g,type:t};return I.edge&&(C.attr=Pg({},I.edge)),C.attr=Pg(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 H(){for(we=me.NULL,D="";N===" "||N===" "||N===`
646
+ `||N==="\r";)re();do{var I=!1;if(N==="#"){for(var e=pt-1;bg.charAt(e)===" "||bg.charAt(e)===" ";)e--;if(bg.charAt(e)===`
647
+ `||bg.charAt(e)===""){for(;N!=""&&N!=`
648
+ `;)re();I=!0}}if(N==="/"&&At()==="/"){for(;N!=""&&N!=`
649
+ `;)re();I=!0}if(N==="/"&&At()==="*"){for(;N!="";)if(N==="*"&&At()==="/"){re(),re();break}else re();I=!0}for(;N===" "||N===" "||N===`
650
+ `||N==="\r";)re()}while(I);if(N===""){we=me.DELIMITER;return}var g=N+At();if(Go[g]){we=me.DELIMITER,D=g,re(),re();return}if(Go[N]){we=me.DELIMITER,D=N,re();return}if(jo(N)||N==="-"){for(D+=N,re();jo(N);)D+=N,re();D==="false"?D=!1:D==="true"?D=!0:isNaN(Number(D))||(D=Number(D)),we=me.IDENTIFIER;return}if(N==='"'){for(re();N!=""&&(N!='"'||N==='"'&&At()==='"');)N==='"'?(D+=N,re()):N==="\\"&&At()==="n"?(D+=`
651
+ `,re()):D+=N,re();if(N!='"')throw ve('End of string " expected');re(),we=me.IDENTIFIER;return}for(we=me.UNKNOWN;N!="";)D+=N,re();throw new SyntaxError('Syntax error in part "'+nh(D,30)+'"')}function DO(){var I={};if(TO(),H(),D==="strict"&&(I.strict=!0,H()),(D==="graph"||D==="digraph")&&(I.type=D,H()),we===me.IDENTIFIER&&(I.id=D,H()),D!="{")throw ve("Angle bracket { expected");if(H(),Ih(I),D!="}")throw ve("Angle bracket } expected");if(H(),D!=="")throw ve("End of file expected");return H(),delete I.node,delete I.edge,delete I.graph,I}function Ih(I){for(;D!==""&&D!="}";)PO(I),D===";"&&H()}function PO(I){var e=Ch(I);if(e){ih(I,e);return}var g=SO(I);if(!g){if(we!=me.IDENTIFIER)throw ve("Identifier expected");var t=D;if(H(),D==="="){if(H(),we!=me.IDENTIFIER)throw ve("Identifier expected");I[t]=D,H()}else NO(I,t)}}function Ch(I){var e=null;if(D==="subgraph"&&(e={},e.type="subgraph",H(),we===me.IDENTIFIER&&(e.id=D,H())),D==="{"){if(H(),e||(e={}),e.parent=I,e.node=I.node,e.edge=I.edge,e.graph=I.graph,Ih(e),D!="}")throw ve("Angle bracket } expected");H(),delete e.node,delete e.edge,delete e.graph,delete e.parent,I.subgraphs||(I.subgraphs=[]),I.subgraphs.push(e)}return e}function SO(I){return D==="node"?(H(),I.node=Vt(),"node"):D==="edge"?(H(),I.edge=Vt(),"edge"):D==="graph"?(H(),I.graph=Vt(),"graph"):null}function NO(I,e){var g={id:e},t=Vt();t&&(g.attr=t),th(I,g),ih(I,e)}function ih(I,e){for(;D==="->"||D==="--";){var g,t=D;H();var A=Ch(I);if(A)g=A;else{if(we!=me.IDENTIFIER)throw ve("Identifier or subgraph expected");g=D,th(I,{id:g}),H()}var C=Vt(),i=Ah(I,e,g,t,C);OO(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;D==="[";){for(H(),e={};D!==""&&D!="]";){if(we!=me.IDENTIFIER)throw ve("Attribute name expected");var i=D;if(H(),D!="=")throw ve("Equal sign = expected");if(H(),we!=me.IDENTIFIER)throw ve("Attribute value expected");var n=D;i==="style"&&(n=g[n]);var r;i==="arrowhead"&&(r=t[n],i="arrows",n={to:{enabled:!0,type:r}}),i==="arrowtail"&&(r=t[n],i="arrows",n={from:{enabled:!0,type:r}}),A.push({attr:e,name:i,value:n}),C.push(i),H(),D==","&&H()}if(D!="]")throw ve("Bracket ] expected");H()}if(Eg(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 o=A[s.dir].value;if(!Eg(C).call(C,"arrows"))if(o==="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(o==="forward")A.push({attr:A[s.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),s.arrows.to=A.length-1;else if(o==="back")A.push({attr:A[s.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),s.arrows.from=A.length-1;else if(o==="none")A.push({attr:A[s.dir].attr,name:"arrows",value:""}),s.arrows.to=A.length-1;else throw ve('Invalid dir type "'+o+'"');var d,a;if(o==="both")s.arrows.to&&s.arrows.from?(a=A[s.arrows.to].value.to.type,d=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:a},from:{enabled:!0,type:d}}},Ke(A).call(A,s.arrows.from,1)):s.arrows.to?(a=A[s.arrows.to].value.to.type,d="arrow",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:a},from:{enabled:!0,type:d}}}):s.arrows.from&&(a="arrow",d=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:a},from:{enabled:!0,type:d}}});else if(o==="back")s.arrows.to&&s.arrows.from?(a="",d=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:a},from:{enabled:!0,type:d}}}):s.arrows.to?(a="",d="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:a},from:{enabled:!0,type:d}}}):s.arrows.from&&(a="",d=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:a},from:{enabled:!0,type:d}}}),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(o==="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(o==="forward")s.arrows.to&&s.arrows.from?(a=A[s.arrows.to].value.to.type,d="",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:a},from:{enabled:!0,type:d}}}):s.arrows.to?(a=A[s.arrows.to].value.to.type,d="",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:a},from:{enabled:!0,type:d}}}):s.arrows.from&&(a="arrow",d="",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:a},from:{enabled:!0,type:d}}}),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 "'+o+'"');Ke(A).call(A,s.dir,1)}var h;if(Eg(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++)xO(A[I].attr,A[I].name,A[I].value);return e}function ve(I){return new SyntaxError(I+', got "'+nh(D,30)+'" (char '+pt+")")}function nh(I,e){return I.length<=e?I:I.substr(0,27)+"..."}function RO(I,e,g){z(I)?F(I).call(I,function(t){z(e)?F(e).call(e,function(A){g(t,A)}):g(t,e)}):z(e)?F(e).call(e,function(t){g(I,t)}):g(I,e)}function ii(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 Vo(I,e){var g={};for(var t in I)if(I.hasOwnProperty(t)){var A=e[t];z(A)?F(A).call(A,function(C){ii(g,C,I[t])}):typeof A=="string"?ii(g,A,I[t]):ii(g,t,I[t])}return g}function kO(I){var e=EO(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)};Pg(n,Vo(i.attr,gh)),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 Pg(n,Vo(i.attr,Or)),n.arrows==null&&i.type==="->"&&(n.arrows="to"),n};F(A=e.edges).call(A,function(i){var n,r;if(i.from instanceof Object?n=i.from.nodes:n={id:i.from},i.to instanceof Object?r=i.to.nodes:r={id:i.to},i.from instanceof Object&&i.from.edges){var s;F(s=i.from.edges).call(s,function(d){var a=C(d);g.edges.push(a)})}if(RO(n,r,function(d,a){var l=Ah(g,d.id,a.id,i.type,i.attr),h=C(l);g.edges.push(h)}),i.to instanceof Object&&i.to.edges){var o;F(o=i.to.edges).call(o,function(d){var a=C(d);g.edges.push(a)})}})}return e.attr&&(g.options=e.attr),g}function MO(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 r={from:n.source,id:n.id,to:n.target};return n.attributes!=null&&(r.attributes=n.attributes),n.label!=null&&(r.label=n.label),n.attributes!=null&&n.attributes.title!=null&&(r.title=n.attributes.title),n.type==="Directed"&&(r.arrows="to"),n.color&&t.edges.inheritColor===!1&&(r.color=n.color),r});return{nodes:ae(g=I.nodes).call(g,n=>{let r={id:n.id,fixed:t.nodes.fixed&&n.x!=null&&n.y!=null};return n.attributes!=null&&(r.attributes=n.attributes),n.label!=null&&(r.label=n.label),n.size!=null&&(r.size=n.size),n.attributes!=null&&n.attributes.title!=null&&(r.title=n.attributes.title),n.title!=null&&(r.title=n.title),n.x!=null&&(r.x=n.x),n.y!=null&&(r.y=n.y),n.color!=null&&(t.nodes.parseColor===!0?r.color=n.color:r.color={background:n.color,border:n.color,highlight:{background:n.color,border:n.color},hover:{background:n.color,border:n.color}}),r}),edges:C}}var FO={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"},zO={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"},BO={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"},ZO={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"},LO={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"},GO={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"},jO={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"},VO={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"},YO={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"},WO={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"},_O={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"},HO=Object.freeze({__proto__:null,cn:VO,cs:_O,de:zO,en:FO,es:BO,fr:WO,it:ZO,nl:LO,pt:GO,ru:jO,uk:YO});function UO(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(ol(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 Xi=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),r=Math.floor(e/4),s=Math.floor(e/8),o=Math.floor(e/16);this.canvas.width=3*r,this.canvas.height=t,this.coordinates=[[0,0,n,t],[n,0,r,A],[n,A,s,C],[5*s,A,o,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 r=this.coordinates[n];e.drawImage(this.canvas,r[0],r[1],r[2],r[3],t,A,C,i)}else e.drawImage(this.image,t,A,C,i)}},Ji=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 Xi;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))}},rh={exports:{}},KO=B,QO=KO(function(){if(typeof ArrayBuffer=="function"){var I=new ArrayBuffer(8);Object.isExtensible(I)&&Object.defineProperty(I,"a",{value:8})}}),XO=B,JO=ce,$O=ag,Yo=QO,aI=Object.isExtensible,qO=XO(function(){aI(1)}),e2=qO||Yo?function(e){return!JO(e)||Yo&&$O(e)==="ArrayBuffer"?!1:aI?aI(e):!0}:aI,g2=B,sh=!g2(function(){return Object.isExtensible(Object.preventExtensions({}))}),t2=S,A2=Z,I2=hA,C2=ce,Dr=ne,i2=Oe.f,Wo=vA,n2=qI,Pr=e2,r2=HI,s2=sh,oh=!1,rg=r2("meta"),o2=0,Sr=function(I){i2(I,rg,{value:{objectID:"O"+o2++,weakData:{}}})},a2=function(I,e){if(!C2(I))return typeof I=="symbol"?I:(typeof I=="string"?"S":"P")+I;if(!Dr(I,rg)){if(!Pr(I))return"F";if(!e)return"E";Sr(I)}return I[rg].objectID},d2=function(I,e){if(!Dr(I,rg)){if(!Pr(I))return!0;if(!e)return!1;Sr(I)}return I[rg].weakData},l2=function(I){return s2&&oh&&Pr(I)&&!Dr(I,rg)&&Sr(I),I},h2=function(){c2.enable=function(){},oh=!0;var I=Wo.f,e=A2([].splice),g={};g[rg]=1,I(g).length&&(Wo.f=function(t){for(var A=I(t),C=0,i=A.length;C<i;C++)if(A[C]===rg){e(A,C,1);break}return A},t2({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:n2.f}))},c2=rh.exports={enable:h2,fastKey:a2,getWeakData:d2,onFreeze:l2};I2[rg]=!0;var oC=rh.exports,u2=ee,f2=Et,p2=u2("iterator"),m2=Array.prototype,v2=function(I){return I!==void 0&&(f2.Array===I||m2[p2]===I)},b2=lg,_o=gr,y2=mt,w2=Et,E2=ee,T2=E2("iterator"),ah=function(I){if(!y2(I))return _o(I,T2)||_o(I,"@@iterator")||w2[b2(I)]},x2=Ye,O2=_g,D2=dg,P2=oA,S2=ah,N2=TypeError,dh=function(I,e){var g=arguments.length<2?S2(I):e;if(O2(g))return D2(x2(g,I));throw new N2(P2(I)+" is not iterable")},R2=Ye,Ho=dg,k2=gr,M2=function(I,e,g){var t,A;Ho(I);try{if(t=k2(I,"return"),!t){if(e==="throw")throw g;return g}t=R2(t,I)}catch(C){A=!0,t=C}if(e==="throw")throw g;if(A)throw t;return Ho(t),g},F2=dA,z2=Ye,B2=dg,Z2=oA,L2=v2,G2=ke,Uo=J,j2=dh,V2=ah,Ko=M2,Y2=TypeError,dI=function(I,e){this.stopped=I,this.result=e},Qo=dI.prototype,Nr=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),r=F2(e,t),s,o,d,a,l,h,c,f=function(m){return s&&Ko(s,"normal",m),new dI(!0,m)},u=function(m){return A?(B2(m),n?r(m[0],m[1],f):r(m[0],m[1])):n?r(m,f):r(m)};if(C)s=I.iterator;else if(i)s=I;else{if(o=V2(I),!o)throw new Y2(Z2(I)+" is not iterable");if(L2(o)){for(d=0,a=G2(I);a>d;d++)if(l=u(I[d]),l&&Uo(Qo,l))return l;return new dI(!1)}s=j2(I,o)}for(h=C?I.next:s.next;!(c=z2(h,s)).done;){try{l=u(c.value)}catch(m){Ko(s,"throw",m)}if(typeof l=="object"&&l&&Uo(Qo,l))return l}return new dI(!1)},W2=J,_2=TypeError,Rr=function(I,e){if(W2(e,I))return I;throw new _2("Incorrect invocation")},H2=S,U2=X,K2=oC,Q2=B,X2=yt,J2=Nr,$2=Rr,q2=le,eD=ce,gD=mt,tD=wt,AD=Oe.f,ID=Ng.forEach,CD=ie,lh=Ug,iD=lh.set,nD=lh.getterFor,kr=function(I,e,g){var t=I.indexOf("Map")!==-1,A=I.indexOf("Weak")!==-1,C=t?"set":"add",i=U2[I],n=i&&i.prototype,r={},s;if(!CD||!q2(i)||!(A||n.forEach&&!Q2(function(){new i().entries().next()})))s=g.getConstructor(e,I,t,C),K2.enable();else{s=e(function(a,l){iD($2(a,o),{type:I,collection:new i}),gD(l)||J2(l,a[C],{that:a,AS_ENTRIES:t})});var o=s.prototype,d=nD(I);ID(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(a){var l=a==="add"||a==="set";a in n&&!(A&&a==="clear")&&X2(o,a,function(h,c){var f=d(this).collection;if(!l&&A&&!eD(h))return a==="get"?void 0:!1;var u=f[a](h===0?0:h,c);return l?this:u})}),A||AD(o,"size",{configurable:!0,get:function(){return d(this).collection.size}})}return tD(s,I,!1,!0),r[I]=s,H2({global:!0,forced:!0},r),A||g.setStrong(s,I,t),s},rD=bA,Mr=function(I,e,g){for(var t in e)g&&g.unsafe&&I[t]?I[t]=e[t]:rD(I,t,e[t],g);return I},sD=_e,oD=sr,aD=ee,dD=ie,Xo=aD("species"),lD=function(I){var e=sD(I);dD&&e&&!e[Xo]&&oD(e,Xo,{configurable:!0,get:function(){return this}})},hD=mA,cD=sr,Jo=Mr,uD=dA,fD=Rr,pD=mt,mD=Nr,vD=cr,$A=ur,bD=lD,Rt=ie,$o=oC.fastKey,hh=Ug,qo=hh.set,ni=hh.getterFor,ch={getConstructor:function(I,e,g,t){var A=I(function(s,o){fD(s,C),qo(s,{type:e,index:hD(null),first:void 0,last:void 0,size:0}),Rt||(s.size=0),pD(o)||mD(o,s[t],{that:s,AS_ENTRIES:g})}),C=A.prototype,i=ni(e),n=function(s,o,d){var a=i(s),l=r(s,o),h,c;return l?l.value=d:(a.last=l={index:c=$o(o,!0),key:o,value:d,previous:h=a.last,next:void 0,removed:!1},a.first||(a.first=l),h&&(h.next=l),Rt?a.size++:s.size++,c!=="F"&&(a.index[c]=l)),s},r=function(s,o){var d=i(s),a=$o(o),l;if(a!=="F")return d.index[a];for(l=d.first;l;l=l.next)if(l.key===o)return l};return Jo(C,{clear:function(){for(var o=this,d=i(o),a=d.index,l=d.first;l;)l.removed=!0,l.previous&&(l.previous=l.previous.next=void 0),delete a[l.index],l=l.next;d.first=d.last=void 0,Rt?d.size=0:o.size=0},delete:function(s){var o=this,d=i(o),a=r(o,s);if(a){var l=a.next,h=a.previous;delete d.index[a.index],a.removed=!0,h&&(h.next=l),l&&(l.previous=h),d.first===a&&(d.first=l),d.last===a&&(d.last=h),Rt?d.size--:o.size--}return!!a},forEach:function(o){for(var d=i(this),a=uD(o,arguments.length>1?arguments[1]:void 0),l;l=l?l.next:d.first;)for(a(l.value,l.key,this);l&&l.removed;)l=l.previous},has:function(o){return!!r(this,o)}}),Jo(C,g?{get:function(o){var d=r(this,o);return d&&d.value},set:function(o,d){return n(this,o===0?0:o,d)}}:{add:function(o){return n(this,o=o===0?0:o,o)}}),Rt&&cD(C,"size",{configurable:!0,get:function(){return i(this).size}}),A},setStrong:function(I,e,g){var t=e+" Iterator",A=ni(e),C=ni(t);vD(I,e,function(i,n){qo(this,{type:t,target:i,state:A(i),kind:n,last:void 0})},function(){for(var i=C(this),n=i.kind,r=i.last;r&&r.removed;)r=r.previous;return!i.target||!(i.last=r=r?r.next:i.state.first)?(i.target=void 0,$A(void 0,!0)):$A(n==="keys"?r.key:n==="values"?r.value:[r.key,r.value],!1)},g?"entries":"values",!g,!0),bD(e)}},yD=kr,wD=ch;yD("Map",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},wD);var Fr=Z,ED=KI,TD=eg,xD=iA,OD=Fr("".charAt),ea=Fr("".charCodeAt),DD=Fr("".slice),ga=function(I){return function(e,g){var t=TD(xD(e)),A=ED(g),C=t.length,i,n;return A<0||A>=C?I?"":void 0:(i=ea(t,A),i<55296||i>56319||A+1===C||(n=ea(t,A+1))<56320||n>57343?I?OD(t,A):i:I?DD(t,A,A+2):(i-55296<<10)+(n-56320)+65536)}},PD={codeAt:ga(!1),charAt:ga(!0)},SD=PD.charAt,ND=eg,uh=Ug,RD=cr,ta=ur,fh="String Iterator",kD=uh.set,MD=uh.getterFor(fh);RD(String,"String",function(I){kD(this,{type:fh,string:ND(I),index:0})},function(){var e=MD(this),g=e.string,t=e.index,A;return t>=g.length?ta(void 0,!0):(A=SD(g,t),e.index+=A.length,ta(A,!1))});var FD=L,zD=FD.Map,BD=zD,ZD=BD,LD=ZD,NA=P(LD),$i=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}},GD=S;GD({target:"Number",stat:!0},{isNaN:function(e){return e!==e}});var jD=L,VD=jD.Number.isNaN,YD=VD,WD=YD,_D=WD,qi=P(_D),HD=X,UD=HD.isFinite,KD=Number.isFinite||function(e){return typeof e=="number"&&UD(e)},QD=S,XD=KD;QD({target:"Number",stat:!0},{isFinite:XD});var JD=L,$D=JD.Number.isFinite,qD=$D,eP=qD,gP=eP,Fg=P(gP),tP=S,AP=Ng.some,IP=Tt,CP=IP("some");tP({target:"Array",proto:!0,forced:!CP},{some:function(e){return AP(this,e,arguments.length>1?arguments[1]:void 0)}});var iP=Ie,nP=iP("Array").some,rP=J,sP=nP,ri=Array.prototype,oP=function(I){var e=I.some;return I===ri||rP(ri,I)&&e===ri.some?sP:e},aP=oP,dP=aP,lP=dP,ph=P(lP),hP=L,cP=hP.Object.getOwnPropertySymbols,uP=cP,fP=uP,pP=fP,Je=P(pP),mh={exports:{}},mP=S,vP=B,bP=We,vh=AA.f,bh=ie,yP=!bh||vP(function(){vh(1)});mP({target:"Object",stat:!0,forced:yP,sham:!bh},{getOwnPropertyDescriptor:function(e,g){return vh(bP(e),g)}});var wP=L,yh=wP.Object,EP=mh.exports=function(e,g){return yh.getOwnPropertyDescriptor(e,g)};yh.getOwnPropertyDescriptor.sham&&(EP.sham=!0);var TP=mh.exports,xP=TP,OP=xP,DP=OP,gg=P(DP),PP=S,SP=ie,NP=Cl,RP=We,kP=AA,MP=fA;PP({target:"Object",stat:!0,sham:!SP},{getOwnPropertyDescriptors:function(e){for(var g=RP(e),t=kP.f,A=NP(g),C={},i=0,n,r;A.length>i;)r=t(g,n=A[i++]),r!==void 0&&MP(C,n,r);return C}});var FP=L,zP=FP.Object.getOwnPropertyDescriptors,BP=zP,ZP=BP,LP=ZP,$e=P(LP),wh={exports:{}},GP=S,jP=ie,Aa=JI.f;GP({target:"Object",stat:!0,forced:Object.defineProperties!==Aa,sham:!jP},{defineProperties:Aa});var VP=L,Eh=VP.Object,YP=wh.exports=function(e,g){return Eh.defineProperties(e,g)};Eh.defineProperties.sham&&(YP.sham=!0);var WP=wh.exports,_P=WP,HP=_P,UP=HP,RA=P(UP),Th={exports:{}},KP=S,QP=ie,Ia=Oe.f;KP({target:"Object",stat:!0,forced:Object.defineProperty!==Ia,sham:!QP},{defineProperty:Ia});var XP=L,xh=XP.Object,JP=Th.exports=function(e,g,t){return xh.defineProperty(e,g,t)};xh.defineProperty.sham&&(JP.sham=!0);var $P=Th.exports,qP=$P,Oh=qP,eS=Oh,gS=eS,tS=gS,AS=tS,IS=AS,CS=P(IS),iS=ee,nS=Oe.f,Ca=iS("metadata"),ia=Function.prototype;ia[Ca]===void 0&&nS(ia,Ca,{value:null});var rS=$;rS("asyncDispose");var sS=$;sS("dispose");var oS=$;oS("metadata");var aS=Il,dS=aS,lS=_e,hS=Z,zr=lS("Symbol"),cS=zr.keyFor,uS=hS(zr.prototype.valueOf),Dh=zr.isRegisteredSymbol||function(e){try{return cS(uS(e))!==void 0}catch(g){return!1}},fS=S,pS=Dh;fS({target:"Symbol",stat:!0},{isRegisteredSymbol:pS});var mS=bt,Ph=_e,vS=Z,bS=sA,yS=ee,xI=Ph("Symbol"),na=xI.isWellKnownSymbol,Sh=Ph("Object","getOwnPropertyNames"),wS=vS(xI.prototype.valueOf),ra=mS("wks");for(qA=0,si=Sh(xI),sa=si.length;qA<sa;qA++)try{oi=si[qA],bS(xI[oi])&&yS(oi)}catch(I){}var oi,qA,si,sa,Nh=function(e){if(na&&na(e))return!0;try{for(var g=wS(e),t=0,A=Sh(ra),C=A.length;t<C;t++)if(ra[A[t]]==g)return!0}catch(i){}return!1},ES=S,TS=Nh;ES({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:TS});var xS=$;xS("matcher");var OS=$;OS("observable");var DS=S,PS=Dh;DS({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:PS});var SS=S,NS=Nh;SS({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:NS});var RS=$;RS("metadataKey");var kS=$;kS("patternMatch");var MS=$;MS("replaceAll");var FS=dS,zS=FS,BS=zS,eI=P(BS),ZS=yA,LS=ZS.f("iterator"),GS=LS,Rh=GS,jS=Rh,VS=jS,YS=VS,WS=YS,_S=WS,HS=P(_S);function qt(I){"@babel/helpers - typeof";return qt=typeof eI=="function"&&typeof HS=="symbol"?function(e){return typeof e}:function(e){return e&&typeof eI=="function"&&e.constructor===eI&&e!==eI.prototype?"symbol":typeof e},qt(I)}var US=yA,KS=US.f("toPrimitive"),QS=KS,XS=QS,JS=XS,$S=JS,qS=$S,eN=qS,gN=eN,tN=P(gN);function AN(I,e){if(qt(I)!=="object"||I===null)return I;var g=I[tN];if(g!==void 0){var t=g.call(I,e||"default");if(qt(t)!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(I)}function IN(I){var e=AN(I,"string");return qt(e)==="symbol"?e:String(e)}function ge(I,e,g){return e=IN(e),e in I?CS(I,e,{value:g,enumerable:!0,configurable:!0,writable:!0}):I[e]=g,I}var CN=_g,iN=xe,nN=_I,rN=ke,sN=TypeError,oa=function(I){return function(e,g,t,A){CN(g);var C=iN(e),i=nN(C),n=rN(C),r=I?n-1:0,s=I?-1:1;if(t<2)for(;;){if(r in i){A=i[r],r+=s;break}if(r+=s,I?r<0:n<=r)throw new sN("Reduce of empty array with no initial value")}for(;I?r>=0:n>r;r+=s)r in i&&(A=g(A,i[r],r,C));return A}},oN={left:oa(!1),right:oa(!0)},aN=X,dN=ag,lN=dN(aN.process)==="process",hN=S,cN=oN.left,uN=Tt,aa=rA,fN=lN,pN=!fN&&aa>79&&aa<83,mN=pN||!uN("reduce");hN({target:"Array",proto:!0,forced:mN},{reduce:function(e){var g=arguments.length;return cN(this,e,g,g>1?arguments[1]:void 0)}});var vN=Ie,bN=vN("Array").reduce,yN=J,wN=bN,ai=Array.prototype,EN=function(I){var e=I.reduce;return I===ai||yN(ai,I)&&e===ai.reduce?wN:e},TN=EN,xN=TN,ON=xN,Br=P(ON),DN=Sg,PN=ke,SN=ir,NN=dA,kh=function(I,e,g,t,A,C,i,n){for(var r=A,s=0,o=i?NN(i,n):!1,d,a;s<t;)s in g&&(d=o?o(g[s],s,e):g[s],C>0&&DN(d)?(a=PN(d),r=kh(I,e,d,a,r,C-1)-1):(SN(r+1),I[r]=d),r++),s++;return r},RN=kh,kN=S,MN=RN,FN=_g,zN=xe,BN=ke,ZN=XI;kN({target:"Array",proto:!0},{flatMap:function(e){var g=zN(this),t=BN(g),A;return FN(e),A=ZN(g,0),A.length=MN(A,g,g,t,0,1,e,arguments.length>1?arguments[1]:void 0),A}});var LN=Ie,x5=LN("Array").flatMap;var O5=Array.prototype;var GN=Rh,st=P(GN),jN=kr,VN=ch;jN("Set",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},VN);var YN=L,WN=YN.Set,_N=WN,HN=_N,UN=HN,Ge=P(UN),KN=dh,QN=KN,XN=QN,JN=XN,$N=JN,qN=$N,eR=qN,gR=eR,tR=gR,AR=tR,di=P(AR),da=yd,IR=Math.floor,en=function(I,e){var g=I.length,t=IR(g/2);return g<8?CR(I,e):iR(I,en(da(I,0,t),e),en(da(I,t),e),e)},CR=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},iR=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},nR=en,rR=nA,la=rR.match(/firefox\/(\d+)/i),sR=!!la&&+la[1],oR=nA,aR=/MSIE|Trident/.test(oR),dR=nA,ha=dR.match(/AppleWebKit\/(\d+)\./),lR=!!ha&&+ha[1],hR=S,Mh=Z,cR=_g,uR=xe,ca=ke,fR=rl,ua=eg,Zr=B,pR=nR,mR=Tt,fa=sR,vR=aR,pa=rA,ma=lR,yg=[],va=Mh(yg.sort),bR=Mh(yg.push),yR=Zr(function(){yg.sort(void 0)}),wR=Zr(function(){yg.sort(null)}),ER=mR("sort"),Fh=!Zr(function(){if(pa)return pa<70;if(!(fa&&fa>3)){if(vR)return!0;if(ma)return ma<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++)yg.push({k:g+A,v:t})}for(yg.sort(function(C,i){return i.v-C.v}),A=0;A<yg.length;A++)g=yg[A].k.charAt(0),I.charAt(I.length-1)!==g&&(I+=g);return I!=="DGBEFHACIJK"}}),TR=yR||!wR||!ER||!Fh,xR=function(I){return function(e,g){return g===void 0?-1:e===void 0?1:I!==void 0?+I(e,g)||0:ua(e)>ua(g)?1:-1}};hR({target:"Array",proto:!0,forced:TR},{sort:function(e){e!==void 0&&cR(e);var g=uR(this);if(Fh)return e===void 0?va(g):va(g,e);var t=[],A=ca(g),C,i;for(i=0;i<A;i++)i in g&&bR(t,g[i]);for(pR(t,xR(e)),C=ca(t),i=0;i<C;)g[i]=t[i++];for(;i<A;)fR(g,i++);return g}});var OR=Ie,DR=OR("Array").sort,PR=J,SR=DR,li=Array.prototype,NR=function(I){var e=I.sort;return I===li||PR(li,I)&&e===li.sort?SR:e},RR=NR,kR=RR,MR=kR,ig=P(MR),FR=Ie,zR=FR("Array").keys,BR=zR,ZR=BR,LR=lg,GR=ne,jR=J,VR=ZR,hi=Array.prototype,YR={DOMTokenList:!0,NodeList:!0},WR=function(I){var e=I.keys;return I===hi||jR(hi,I)&&e===hi.keys||GR(YR,LR(I))?VR:e},_R=WR,It=P(_R),HR=Ie,UR=HR("Array").values,KR=UR,QR=KR,XR=lg,JR=ne,$R=J,qR=QR,ci=Array.prototype,ek={DOMTokenList:!0,NodeList:!0},gk=function(I){var e=I.values;return I===ci||$R(ci,I)&&e===ci.values||JR(ek,XR(I))?qR:e},tk=gk,OI=P(tk),Ak=Ie,Ik=Ak("Array").entries,Ck=Ik,ik=Ck,nk=lg,rk=ne,sk=J,ok=ik,ui=Array.prototype,ak={DOMTokenList:!0,NodeList:!0},dk=function(I){var e=I.entries;return I===ui||sk(ui,I)&&e===ui.entries||rk(ak,nk(I))?ok:e},lk=dk,hk=P(lk),ck=Oh,kA=P(ck),gI,uk=new Uint8Array(16);function fk(){if(!gI&&(gI=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gI))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gI(uk)}var oe=[];for(let I=0;I<256;++I)oe.push((I+256).toString(16).slice(1));function pk(I,e=0){return oe[I[e+0]]+oe[I[e+1]]+oe[I[e+2]]+oe[I[e+3]]+"-"+oe[I[e+4]]+oe[I[e+5]]+"-"+oe[I[e+6]]+oe[I[e+7]]+"-"+oe[I[e+8]]+oe[I[e+9]]+"-"+oe[I[e+10]]+oe[I[e+11]]+oe[I[e+12]]+oe[I[e+13]]+oe[I[e+14]]+oe[I[e+15]]}var mk=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ba={randomUUID:mk};function at(I,e,g){if(ba.randomUUID&&!e&&!I)return ba.randomUUID();I=I||{};let t=I.random||(I.rng||fk)();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 pk(t)}function ya(I,e){var g=U(I);if(Je){var t=Je(I);e&&(t=te(t).call(t,function(A){return gg(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])}):$e?RA(I,$e(A)):F(t=ya(Object(A))).call(t,function(C){kA(I,C,gg(A,C))})}return I}function Ea(I){return typeof I=="string"||typeof I=="number"}var gn=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=Qe(()=>{this.flush()},this.delay))}flush(){var e,g;F(e=Ke(g=this._queue).call(g,0)).call(e,t=>{t.fn.apply(t.context||t.fn,t.args||[])})}},tn=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)}},DI=class I{constructor(e){ge(this,"_pairs",void 0),this._pairs=e}*[st](){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=Tg(null);for(let[g,t]of this._pairs)e[g]=t;return e}toMap(){return new NA(this._pairs)}toIdSet(){return new Ge(this.toIdArray())}toItemSet(){return new Ge(this.toItemArray())}cache(){return new I([...this._pairs])}distinct(e){let g=new Ge;for(let[t,A]of this._pairs)g.add(e(A,t));return g}filter(e){let g=this._pairs;return new I({*[st](){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({*[st](){for(let[t,A]of g)yield[t,e(A,t)]}})}max(e){let g=di(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,r=e(n,i);r>C&&(C=r,A=n)}return A}min(e){let g=di(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,r=e(n,i);r<C&&(C=r,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({[st]:()=>{var g;return di(ig(g=[...this._pairs]).call(g,(t,A)=>{let[C,i]=t,[n,r]=A;return e(i,r,C,n)}))}})}};function vk(I,e){return I[e]==null&&(I[e]=at()),I}var sg=class extends tn{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&&!z(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=gn.extend(this,{replace:["add","update","remove"]})),e.queue&&typeof e.queue=="object"&&this._queue.setOptions(e.queue)))}add(e,g){let t=[],A;if(z(e)){let C=ae(e).call(e,i=>i[this._idProp]);if(ph(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,r=s=>{let o=s[n];if(o!=null&&this._data.has(o)){let d=s,a=q({},this._data.get(o)),l=this._updateItem(d);A.push(l),i.push(d),C.push(a)}else{let d=this._addItem(s);t.push(d)}};if(z(e))for(let s=0,o=e.length;s<o;s++)e[s]&&typeof e[s]=="object"?r(e[s]):console.warn("Ignoring input item, which is not an object at index "+s);else if(e&&typeof e=="object")r(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 ol(t).call(t,A)}updateOnly(e,g){var t;z(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,r=i[this._idProp],s=q1(i,n);return this._data.set(r,s),{id:r,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;Ea(e)?(t=e,C=g):z(e)?(A=e,C=g):C=e;let i=C&&C.returnType==="Object"?"Object":"Array",n=C&&te(C),r=[],s,o,d;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))&&r.push(s);else{var a;o=[...It(a=this._data).call(a)];for(let h=0,c=o.length;h<c;h++)d=o[h],s=this._data.get(d),s!=null&&(!n||n(s))&&r.push(s)}if(C&&C.order&&t==null&&this._sort(r,C.order),C&&C.fields){let h=C.fields;if(t!=null&&s!=null)s=this._filterFields(s,h);else for(let c=0,f=r.length;c<f;c++)r[c]=this._filterFields(r[c],h)}if(i=="Object"){let h={};for(let c=0,f=r.length;c<f;c++){let u=r[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 r}getIds(e){let g=this._data,t=e&&te(e),A=e&&e.order,C=[...It(g).call(g)],i=[];if(t)if(A){let n=[];for(let r=0,s=C.length;r<s;r++){let o=C[r],d=this._data.get(o);d!=null&&t(d)&&n.push(d)}this._sort(n,A);for(let r=0,s=n.length;r<s;r++)i.push(n[r][this._idProp])}else for(let n=0,r=C.length;n<r;n++){let s=C[n],o=this._data.get(s);o!=null&&t(o)&&i.push(o[this._idProp])}else if(A){let n=[];for(let r=0,s=C.length;r<s;r++){let o=C[r];n.push(g.get(o))}this._sort(n,A);for(let r=0,s=n.length;r<s;r++)i.push(n[r][this._idProp])}else for(let n=0,r=C.length;n<r;n++){let s=C[n],o=g.get(s);o!=null&&i.push(o[this._idProp])}return i}getDataSet(){return this}forEach(e,g){let t=g&&te(g),A=this._data,C=[...It(A).call(A)];if(g&&g.order){let i=this.get(g);for(let n=0,r=i.length;n<r;n++){let s=i[n],o=s[this._idProp];e(s,o)}}else for(let i=0,n=C.length;i<n;i++){let r=C[i],s=this._data.get(r);s!=null&&(!t||t(s))&&e(s,r)}}map(e,g){let t=g&&te(g),A=[],C=this._data,i=[...It(C).call(C)];for(let n=0,r=i.length;n<r;n++){let s=i[n],o=this._data.get(s);o!=null&&(!t||t(o))&&A.push(e(o,s))}return g&&g.order&&this._sort(A,g.order),A}_filterFields(e,g){var t;return e&&Br(t=z(g)?g:U(g)).call(t,(A,C)=>(A[C]=e[C],A),{})}_sort(e,g){if(typeof g=="string"){let t=g;ig(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")ig(e).call(e,g);else throw new TypeError("Order must be a function or a string")}remove(e,g){let t=[],A=[],C=z(e)?e:[e];for(let i=0,n=C.length;i<n;i++){let r=this._remove(C[i]);if(r){let s=r[this._idProp];s!=null&&(t.push(s),A.push(r))}}return t.length&&this._trigger("remove",{items:t,oldData:A},g),t}_remove(e){let g;if(Ea(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=[...It(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 OI(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 OI(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=[...It(g).call(g)],A=[],C=0;for(let i=0,n=t.length;i<n;i++){let r=t[i],o=g.get(r)[e],d=!1;for(let a=0;a<C;a++)if(A[a]==o){d=!0;break}!d&&o!==void 0&&(A[C]=o,C++)}return A}_addItem(e){let g=vk(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: "+xt(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,wa(wa({},t),e)),g}stream(e){if(e){let t=this._data;return new DI({*[st](){for(let A of e){let C=t.get(A);C!=null&&(yield[A,C])}}})}else{var g;return new DI({[st]:b(g=hk(this._data)).call(g,this._data)})}}};function bk(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 zh(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"&&bk(I,e.getDataSet())}var Bh=X,yk=B,wk=Z,Ek=eg,Tk=hl.trim,xk=fr,Ok=wk("".charAt),PI=Bh.parseFloat,Ta=Bh.Symbol,xa=Ta&&Ta.iterator,Dk=1/PI(xk+"-0")!==-1/0||xa&&!yk(function(){PI(Object(xa))}),Pk=Dk?function(e){var g=Tk(Ek(e)),t=PI(g);return t===0&&Ok(g,0)==="-"?-0:t}:PI,Sk=S,Oa=Pk;Sk({global:!0,forced:parseFloat!==Oa},{parseFloat:Oa});var Nk=L,Rk=Nk.parseFloat,kk=Rk,Mk=kk,Fk=Mk,Zh=P(Fk),zk=S,Bk=B,Zk=qI.f,Lk=Bk(function(){return!Object.getOwnPropertyNames(1)});zk({target:"Object",stat:!0,forced:Lk},{getOwnPropertyNames:Zk});var Gk=L,jk=Gk.Object,Vk=function(e){return jk.getOwnPropertyNames(e)},Yk=Vk,Wk=Yk,_k=Wk,Hk=P(_k);function Lr(I,e){let g=["node","edge","label"],t=!0,A=mg(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=mg(e,["chosen",I]);(typeof C=="boolean"||typeof C=="function")&&(t=C)}return t}function An(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 SI(I){return typeof I=="string"&&I!==""}function Lh(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,r=Math.cos(e)*i;r===i?(A+=i,C=t.y):n===i?(A=t.x,C-=i):(A+=r,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 In=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({},OI(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 r=t.blocks[n];r.width!==0?i.push(r):C===void 0&&(C=r)}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}}},Uk={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},NI=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=Uk[e];A!==void 0?t=A:t=new RegExp(e),g=e.length}return[t,g]}},Cn=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 r=this.parent.getFormattingValues(e,t,A,n),s=0;return i!==""&&(s=this.ctx.measureText(i).width),{width:s,values:r}};this.lines=new In(C)}process(e){if(!SI(e))return this.lines.finalize();let g=this.parent.fontOptions;e=e.replace(/\r\n/g,`
651
652
  `),e=e.replace(/\r/g,`
652
653
  `);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 r=i[n].mod,s=i[n].text;this.splitStringIntoLines(s,r,!0)}else for(let n=0;n<i.length;n++){let r=i[n].mod,s=i[n].text;this.lines.append(s,r)}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=pg(e,"widthConstraint");if(typeof t=="number")g.maxWdt=Number(t),g.minWdt=Number(t);else if(typeof t=="object"){let C=pg(e,["widthConstraint","maximum"]);typeof C=="number"&&(g.maxWdt=Number(C));let i=pg(e,["widthConstraint","minimum"]);typeof i=="number"&&(g.minWdt=Number(i))}let A=pg(e,"heightConstraint");if(typeof A=="number")g.minHgt=Number(A);else if(typeof A=="object"){let C=pg(e,["heightConstraint","minimum"]);typeof C=="number"&&(g.minHgt=Number(C));let i=pg(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=kr("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,r)=>{C[r]=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 r=0;this.isEdgeLabel||this.fontOptions.align==="center"?r+=(this.size.width-n.width)/2:this.fontOptions.align==="right"&&(r+=this.size.width-n.width);for(let s=0;s<n.blocks.length;s++){let o=n.blocks[s];e.font=o.font;let[a,d]=this._getColor(o.color,C,o.strokeColor);o.strokeWidth>0&&(e.lineWidth=o.strokeWidth,e.strokeStyle=d,e.lineJoin="round"),e.fillStyle=a,o.strokeWidth>0&&e.strokeText(o.text,g+r,t+o.vadjust),e.fillText(o.text,g+r,t+o.vadjust),r+=o.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=Re(A,i),C=Re(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(r,s,o){return s==="normal"?o==="mod"?"":r[o]:r[s][o]!==void 0?r[s][o]:r[o]},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)}},sg=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 sg{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 sg{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,r=this.height-A.top-A.bottom;this.imageObj.drawImageAtPosition(e,t,C,i,n,r),this.disableShadow(e,g)}}_drawImageLabel(e,g,t,A,C){let i=0;if(this.height!==void 0){i=this.height*.5;let r=this.labelModule.getTextSize(e,A,C);r.lineCount>=1&&(i+=r.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,r=t;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=g,this.top=t,n+=this.width/2,r+=this.height/2):(this.left=g-this.width/2,this.top=t-this.height/2),this._drawRawCircle(e,n,r,i),e.save(),e.clip(),this._drawImageAtPosition(e,i),e.restore(),this._drawImageLabel(e,n,r,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 sg{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,r){return this.resize(e,i,n,r),this.left=A-this.width/2,this.top=C-this.height/2,this.initContextForDraw(e,r),sp(g)(e,A,C,r.size),this.performFill(e,r),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?NA(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 r=n.drawExternalLabel;n.drawExternalLabel=()=>{e.save(),r(),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 sg{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}},RI=class extends sg{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 sg{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)}},Rk=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,r=t;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=g,this.top=t,n+=this.width/2,r+=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,o=this.options.borderWidthSelected||2*this.options.borderWidth,a=(A?o: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=Re(d,i.opacity),l=Re(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,r,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)}},rn=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 sg{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)}},Nk=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)}},on=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?NA(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=xg(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=kr("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 r=te(A=Ek(g)).call(A,s=>g[s]!=null);r.push("font"),bI(r,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=xg(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=xg(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=Re(e.borderColor,g),e.color=Re(e.color,g),e.shadowColor=Re(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 RI(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 Rk(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 rn(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 Nk(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new on(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(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,r,s){if(n===i)return .5;{let o=1/(n-i);return Math.max(0,(s-i)*o)}}},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=xg(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 rg,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new rg;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],r=A[n],s=g[i];r!==void 0?r.setOptions(s)&&(C=!0):(C=!0,r=this.create(s),A[n]=r)}!C&&t!==void 0&&(C=ih(g).call(g,function(i,n){let r=t[n];return r&&r.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=R,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,r;A<C;)n=kk(arguments[A++]),i<n?(r=i/n,t=t*r*r+1,i=n):n>0?(r=n/i,t+=r*r):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 r=e[n],s=r.x*Math.cos(C)-r.y*Math.sin(C),o=r.x*Math.sin(C)+r.y*Math.cos(C);r.x=t+i*s,r.y=A+i*o}}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}},NI=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);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?NA(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,r]=this._getCircleData(e);this._circle(e,g,i,n,r)}}_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,r,s]=this._getCircleData(e);this._circle(e,g,n,r,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,r,s]=this._getCircleData(e);this._circle(e,g,n,r,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,r=t.direction,s=10,o=this.options.selfReference.size,a=.05,d,l=(i+n)*.5,h=0;this.options.arrowStrikethrough===!0&&(r===-1?h=this.options.endPointOffset.from:r===1&&(h=this.options.endPointOffset.to));let c=0;do{l=(i+n)*.5,d=this._pointOnCircle(A,C,o,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?r>0?i=l:n=l:r>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=Re(this.from.options.color.border,g.opacity),C=Re(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"?Re(this.to.options.color.border,g.opacity):Re(this.from.options.color.border,g.opacity)}else return Re(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 r=this.options.selfReference.angle,s=this.options.selfReference.angle+Math.PI,o=this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:r,high:s,direction:-1}),a=this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:r,high:s,direction:1});i=Math.atan2(o.y-A,o.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,r,s]=this._getCircleData(void 0),o=n-C,a=r-i;return Math.abs(Math.sqrt(o*o+a*a)-s)}}_getDistanceToLine(e,g,t,A,C,i){let n=t-e,r=A-g,s=n*n+r*r,o=((C-e)*n+(i-g)*r)/s;o>1?o=1:o<0&&(o=0);let a=e+o*n,d=g+o*r,l=a-C,h=d-i;return Math.sqrt(l*l+h*h)}getArrowData(e,g,t,A,C,i){let n,r,s,o,a,d,l,h=i.width;g==="from"?(s=this.from,o=this.to,a=i.fromArrowScale<0,d=Math.abs(i.fromArrowScale),l=i.fromArrowType):g==="to"?(s=this.to,o=this.from,a=i.toArrowScale<0,d=Math.abs(i.toArrowScale),l=i.toArrowType):(s=this.to,o=this.from,a=i.middleArrowScale<0,d=Math.abs(i.middleArrowScale),l=i.middleArrowType);let c=15*d+3*h;if(s!=o){let E=Vk(s.x-o.x,s.y-o.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),r=O}else n=Math.atan2(s.y-o.y,s.x-o.x),r=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),r=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,r=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,r=V}else{let M=this.options.selfReference.angle/(2*Math.PI);r=this._pointOnCircle(E,w,O,M),n=M*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}let p=r.x-c*.9*Math.cos(n),u=r.y-c*.9*Math.sin(n);return{point:r,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,NI.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?NA(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,r=0,s=this.to,o,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=(r+n)*.5,o=this.getPoint(a,t);let h=Math.atan2(s.y-o.y,s.x-o.x),c=s.distanceToBorder(g,h)+d,p=Math.sqrt(Math.pow(o.x-s.x,2)+Math.pow(o.y-s.y,2)),u=c-p;if(Math.abs(u)<C)break;u<0?i===!1?r=a:n=a:i===!1?n=a:r=a,++l}while(r<=n&&l<A);return wa(wa({},o),{},{t:a})}_getDistanceToBezierEdge(e,g,t,A,C,i,n){let r=1e9,s,o,a,d,l,h=e,c=g;for(o=1;o<10;o++)a=.1*o,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,o>0&&(s=this._getDistanceToLine(h,c,d,l,C,i),r=s<r?s:r),h=d,c=l;return r}_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,r=this.from.y+i;return g==="discrete"&&(t<=A?n=t<e*A?this.from.x:n:r=A<e*t?this.from.y:r),{x:n,y:r}}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,r=(Math.atan2(A,t)+(e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*C*Math.sin(r),y:this.from.y+(e*.5+.5)*C*Math.cos(r)}}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,r=(Math.atan2(A,t)+(-e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*C*Math.sin(r),y:this.from.y+(e*.5+.5)*C*Math.cos(r)}}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,r=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?r=this.to.y>r?this.to.y:r:r=this.to.y<r?this.to.y:r,{x:n,y:r}}}_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,r){let s=1e9,o=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]*r.x+d[3]*t,p=d[0]*g+d[1]*n.y+d[2]*r.y+d[3]*A;if(l>0){let u=this._getDistanceToLine(o,a,c,p,C,i);s=u<s?u:s}o=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,r]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,g,t,A,C,i,n,r)}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,r=Math.sqrt(i*i+n*n),s=e.distanceToBorder(g,C),o=(r-s)/r;return{x:(1-o)*A.x+o*t.x,y:(1-o)*A.y+o*t.y,t:0}}_getDistanceToEdge(e,g,t,A,C,i){return this._getDistanceToLine(e,g,t,A,C,i)}},Og=class I{constructor(e,g,t,A,C){if(g===void 0)throw new Error("No body provided");this.options=xg(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=kr("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=Eg(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=Eg(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=Eg(A.arrows));if(g.color!==void 0&&g.color!==null){let n=mg(g.color)?{color:g.color,highlight:g.color,hover:g.color,inherit:!1,opacity:1}:g.color,r=e.color;if(C)_(r,A.color,!1,t);else for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&delete r[s];if(mg(r))r.color=r,r.highlight=r,r.hover=r,r.inherit=!1,n.opacity===void 0&&(r.opacity=1);else{let s=!1;n.color!==void 0&&(r.color=n.color,s=!0),n.highlight!==void 0&&(r.highlight=n.highlight,s=!0),n.hover!==void 0&&(r.hover=n.hover,s=!0),n.inherit!==void 0&&(r.inherit=n.inherit),n.opacity!==void 0&&(r.opacity=Math.min(1,Math.max(0,n.opacity))),s===!0?r.inherit=!1:r.inherit===void 0&&(r.inherit="from")}}else t===!0&&g.color===null&&(e.color=xg(A.color));t===!0&&g.font===null&&(e.font=xg(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,r=e.top;return this.edgeType.getDistanceToEdge(t,A,C,i,n,r)<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,r){if(i===C)return .5;{let s=1/(i-C);return Math.max(0,(r-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 r=e.body.edges[n],s=e.body.data.edges.get(n);if(s!=null){let o=s.smooth;o!==void 0&&o.enabled===!0&&o.type==="dynamic"&&(A===void 0?r.setOptions({smooth:!1}):r.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){Og.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 rg,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new rg;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 r=A.get(i,{showInternalIds:!0});t[i]=this.create(r)}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),r=g[i];r!==void 0?(r.disconnect(),A=r.setOptions(n)||A,r.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 Og(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,r=t*i;this.physicsBody.forces[A.id].x+=n,this.physicsBody.forces[A.id].y+=r}_formBarnesHutTree(e,g){let t,A=g.length,C=e[g[0]].x,i=e[g[0]].y,n=e[g[0]].x,r=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>r&&(r=E))}let s=Math.abs(n-C)-Math.abs(r-i);s>0?(i-=.5*s,r+=.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+r),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,r,s=this.body.nodes,o=this.physicsBody.physicsNodeIndices,a=this.physicsBody.forces,d=this.options.nodeDistance,l=-2/3/d,h=4/3;for(let c=0;c<o.length-1;c++){n=s[o[c]];for(let p=c+1;p<o.length;p++)r=s[o[p]],e=r.x-n.x,g=r.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[r.id].x+=A,a[r.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 r=e[g[n]];if(i.level===r.level){let s=A+this.overlapAvoidanceFactor*((i.shape.radius||0)/2+(r.shape.radius||0)/2),o=r.x-i.x,a=r.y-i.y,d=Math.sqrt(o*o+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=o*h,p=a*h;t[i.id].x-=c,t[i.id].y-=p,t[r.id].x+=c,t[r.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 r=0;r<t.length;r++)g=A[t[r]],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,r=A*n,s=C*n;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=r,this.physicsBody.forces[e.id].y+=s),this.physicsBody.forces[g.id]!==void 0&&(this.physicsBody.forces[g.id].x-=r,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,r,s=this.body.edges,o=.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,r=Math.sqrt(t*t+A*A),r=r===0?.01:r,n=this.options.springConstant*(e-r)/r,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-=o*C,l[g.toId].y-=o*i),l[g.fromId]!==void 0&&(l[g.fromId].x+=o*C,l[g.fromId].y+=o*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}}},ot=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 r=0;r<i.length;r++){let s=i[r];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),r=g*n,s=t*n;this.physicsBody.forces[A.id].x+=r,this.physicsBody.forces[A.id].y+=s}},Dn=class extends ot{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}}},Rn=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 ot(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 ot(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 ot(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,r=Math.sqrt(Math.pow(C.x,2)+Math.pow(C.x,2)),s=Math.min(Math.max(5,r),15),o=3*s,a=Vi((180-Math.min(1,Math.max(0,n*r))*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,NI.draw(e,{type:"arrow",point:d,angle:l,length:o}),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 r=0;r<g.length;r++)n=e[g[r]],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 r=0;r<g.length;r++)n=e[g[r]],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}},Nn=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,r=>{A.clusteringEdgeReplacingIds.push(r),this.body.edges[r].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,r;for(let s=0;s<this.body.nodeIndices.length;s++){let o={},a={},d=this.body.nodeIndices[s],l=this.body.nodes[d];if(C[d]===void 0){r=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&&r++,n.push(i));if(r===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,o[d]=l,o[u]=this.body.nodes[u],C[d]=!0;else{c=!1;break}}if(U(o).length>0&&U(a).length>0&&c===!0){let u=function(){for(let m=0;m<A.length;++m)for(let E in o)if(A[m].nodes[E]!==void 0)return A[m]}();if(u!==void 0){for(let m in o)u.nodes[m]===void 0&&(u.nodes[m]=o[m]);for(let m in a)u.edges[m]===void 0&&(u.edges[m]=a[m])}else A.push({nodes:o,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={},r=C.id,s=de.cloneOptions(C);i[r]=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,r);if(this.clusteredNodes[l]===void 0)if(l!==r)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 o=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(o).call(o,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,r,s,o,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?(r=t.id,s=C.fromId,o=s):(r=C.toId,s=t.id,o=r),e[o]===void 0&&d.push({edge:C,fromId:s,toId:r}))}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 o in e)Object.prototype.hasOwnProperty.call(e,o)&&this.clusteredNodes[o]!==void 0&&C.push(o);for(let o=0;o<C.length;++o)delete e[C[o]];if(U(e).length==0||U(e).length==1&&t.clusterNodeProperties.allowSingleNodeCluster!=!0)return;let i=_({},t.clusterNodeProperties);if(t.processProperties!==void 0){let o=[];for(let d in e)if(Object.prototype.hasOwnProperty.call(e,d)){let l=de.cloneOptions(e[d]);o.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,o,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 r;i.x===void 0&&(r=this._getClusterPosition(e),i.x=r.x),i.y===void 0&&(r===void 0&&(r=this._getClusterPosition(e)),i.y=r.y),i.id=n;let s=this.body.functions.createNode(i,Nn);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 r=1;r<g.length;r++)n=e[g[r]],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 o=C[i];this.body.nodes[o]._openChildCluster(e),delete this.body.nodes[e],t===!0&&this.body.emitter.emit("_dataChanged");return}let n=A.containedNodes,r=A.containedEdges;if(g!==void 0&&g.releaseFunction!==void 0&&typeof g.releaseFunction=="function"){let o={},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];o[l]={x:h.x,y:h.y}}let d=g.releaseFunction(a,o);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(o){o.options.fixed.x===!1&&(o.x=A.x),o.options.fixed.y===!1&&(o.y=A.y)});for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o)){let a=this.body.nodes[o];a.vx=A.vx,a.vy=A.vy,a.setOptions({physics:!0}),delete this.clusteredNodes[o]}let s=[];for(let o=0;o<A.edges.length;o++)s.push(A.edges[o]);for(let o=0;o<s.length;o++){let a=s[o],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 r[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 o in r)Object.prototype.hasOwnProperty.call(r,o)&&this._restoreEdge(r[o]);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 r=this.body.edges[n];if(r===void 0)continue;i++;let s=r.clusteringEdgeReplacingIds;if(s===void 0)A.push(n);else for(let o=0;o<s.length;++o){let a=s[o];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 r=0;r<this.body.nodeIndices.length;r++){let s=this.body.nodes[this.body.nodeIndices[r]];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 Og){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=r=>{S(this.body.nodes,s=>{s.isCluster===!0&&r(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(r){for(let s=0;s<g.length;s++)delete r.containedNodes[g[s]]});for(let r=0;r<g.length;r++)delete this.clusteredNodes[g[r]];S(this.clusteredEdges,r=>{let s=this.body.edges[r];(s===void 0||!s.endPointsValid())&&(t[r]=r)}),A(function(r){S(r.containedEdges,(s,o)=>{!s.endPointsValid()&&!t[o]&&(t[o]=o)})}),S(this.body.edges,(r,s)=>{let o=!0,a=r.clusteringEdgeReplacingIds;if(a!==void 0){let d=0;S(a,l=>{let h=this.body.edges[l];h!==void 0&&h.endPointsValid()&&(d+=1)}),o=d>0}(!r.endPointsValid()||!o)&&(t[s]=s)}),A(r=>{S(t,s=>{delete r.containedEdges[s],S(r.edges,(o,a)=>{if(o.id===s){r.edges[a]=null;return}o.clusteringEdgeReplacingIds=this._filter(o.clusteringEdgeReplacingIds,function(d){return!t[d]})}),r.edges=this._filter(r.edges,function(o){return o!==null})})}),S(t,r=>{delete this.clusteredEdges[r]}),S(t,r=>{delete this.body.edges[r]});let C=U(this.body.edges);S(C,r=>{let s=this.body.edges[r],o=this._isClusteredNode(s.fromId)||this._isClusteredNode(s.toId);if(o!==this._isClusteredEdge(s.id))if(o){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[r],this._restoreEdge(s)});let i=!1,n=!0;for(;n;){let r=[];A(function(s){let o=U(s.containedNodes).length,a=s.options.allowSingleNodeCluster===!0;(a&&o<1||!a&&o<2)&&r.push(s.id)});for(let s=0;s<r.length;++s)this.openCluster(r[s],{},!1);n=r.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=[],r=20,s=this.canvas.DOMtoCanvas({x:-r,y:-r}),o=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+r,y:this.canvas.frame.canvas.clientHeight+r}),a={top:s.y,left:s.x,bottom:o.y,right:o.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()}},Yk=L,Wk=Yk.setInterval,_k=Wk,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 rt(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:rt.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 rt(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),r=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==n||this.frame.canvas.height!==r)&&this._getCameraState(i),this.frame.canvas.width!==n&&(this.frame.canvas.width=n,t=!0),this.frame.canvas.height!==r&&(this.frame.canvas.height=r,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,o=Math.abs(C.maxY-C.minY)*1.1,a=t/s,d=A/o;i=a<=d?a:d}i>e.maxZoomLevel?i=e.maxZoomLevel:i<e.minZoomLevel&&(i=e.minZoomLevel);let r={position:de.findCenter(C),scale:i,animation:e.animation};this.moveTo(r)}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
+ `),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 r=i[n].mod,s=i[n].text;this.splitStringIntoLines(s,r,!0)}else for(let n=0;n<i.length;n++){let r=i[n].mod,s=i[n].text;this.lines.append(s,r)}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 NI(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 NI(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(Le(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(Le(i).call(i,0,n),g),A[0]=Le(i).call(i,n)}else{let i=C;A[C-1]===" "?C--:A[i]===" "&&i++;let n=Le(A).call(A,0,C).join("");C==A.length&&t?this.lines.append(n,g):this.lines.newLine(n,g),A=Le(A).call(A,i)}}}},kt=["bold","ital","boldital","mono"],RI=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),SI(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(k(kt,g=>{this.fontOptions[g]={}}),I.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}k(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=mg(e,"widthConstraint");if(typeof t=="number")g.maxWdt=Number(t),g.minWdt=Number(t);else if(typeof t=="object"){let C=mg(e,["widthConstraint","maximum"]);typeof C=="number"&&(g.maxWdt=Number(C));let i=mg(e,["widthConstraint","minimum"]);typeof i=="number"&&(g.minWdt=Number(i))}let A=mg(e,"heightConstraint");if(typeof A=="number")g.minHgt=Number(A);else if(typeof A=="object"){let C=mg(e,["heightConstraint","minimum"]);typeof C=="number"&&(g.minHgt=Number(C));let i=mg(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=Lr("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),k(A,(i,n)=>{i!==void 0&&(Object.prototype.hasOwnProperty.call(g,n)||(G(kt).call(kt,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<kt.length;++t){let A=kt[t],C=this.fontOptions[A],i=this.getFontOptions(g,A);k(i,(n,r)=>{C[r]=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 r=0;this.isEdgeLabel||this.fontOptions.align==="center"?r+=(this.size.width-n.width)/2:this.fontOptions.align==="right"&&(r+=this.size.width-n.width);for(let s=0;s<n.blocks.length;s++){let o=n.blocks[s];e.font=o.font;let[d,a]=this._getColor(o.color,C,o.strokeColor);o.strokeWidth>0&&(e.lineWidth=o.strokeWidth,e.strokeStyle=a,e.lineJoin="round"),e.fillStyle=d,o.strokeWidth>0&&e.strokeText(o.text,g+r,t+o.vadjust),e.fillText(o.text,g+r,t+o.vadjust),r+=o.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(r,s,o){return s==="normal"?o==="mod"?"":r[o]:r[s][o]!==void 0?r[s][o]:r[o]},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 Cn(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),TA(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}}},Kk=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),rd(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}},eA=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),Cr(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,r=this.height-A.top-A.bottom;this.imageObj.drawImageAtPosition(e,t,C,i,n,r),this.disableShadow(e,g)}}_drawImageLabel(e,g,t,A,C){let i=0;if(this.height!==void 0){i=this.height*.5;let r=this.labelModule.getTextSize(e,A,C);r.lineCount>=1&&(i+=r.height/2)}let n=t+i;this.options.label&&(this.labelOffset=i),this.labelModule.draw(e,g,n,A,C,"hanging")}},Qk=class extends eA{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}},nn=class extends eA{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,r=t;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=g,this.top=t,n+=this.width/2,r+=this.height/2):(this.left=g-this.width/2,this.top=t-this.height/2),this._drawRawCircle(e,n,r,i),e.save(),e.clip(),this._drawImageAtPosition(e,i),e.restore(),this._drawImageLabel(e,n,r,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}},qe=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,r){return this.resize(e,i,n,r),this.left=A-this.width/2,this.top=C-this.height/2,this.initContextForDraw(e,r),Np(g)(e,A,C,r.size),this.performFill(e,r),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 Da(I,e){var g=U(I);if(Je){var t=Je(I);e&&(t=te(t).call(t,function(A){return gg(I,A).enumerable})),g.push.apply(g,t)}return g}function Xk(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=Da(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):$e?RA(I,$e(A)):F(t=Da(Object(A))).call(t,function(C){kA(I,C,gg(A,C))})}return I}var rn=class extends qe{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:Xk({},i),label:this.options.label});if(n.drawNode!=null&&n.drawNode(),e.restore(),n.drawExternalLabel){let r=n.drawExternalLabel;n.drawExternalLabel=()=>{e.save(),r(),e.restore()}}return n.nodeDimensions&&(this.customSizeWidth=n.nodeDimensions.width,this.customSizeHeight=n.nodeDimensions.height),n}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){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),sd(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)}},Jk=class extends qe{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)}},on=class extends qe{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}},kI=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),Oi(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)}},an=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)}},$k=class extends eA{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,r=t;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=g,this.top=t,n+=this.width/2,r+=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,o=this.options.borderWidthSelected||2*this.options.borderWidth,d=(A?o:s)/this.body.view.scale;e.lineWidth=Math.min(this.width,d),e.beginPath();let a=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&&(a=Ne(a,i.opacity),l=Ne(l,i.opacity)),e.strokeStyle=a,e.fillStyle=l,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),TA(e).call(e),this.performStroke(e,i),e.closePath()}this._drawImageAtPosition(e,i),this._drawImageLabel(e,n,r,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)}},dn=class extends qe{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)}},ln=class extends qe{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)}},hn=class extends qe{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)}},cn=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)}},qk=class extends qe{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)}},un=class extends qe{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 Pa(I,e){var g=U(I);if(Je){var t=Je(I);e&&(t=te(t).call(t,function(A){return gg(I,A).enumerable})),g.push.apply(g,t)}return g}function Sa(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=Pa(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):$e?RA(I,$e(A)):F(t=Pa(Object(A))).call(t,function(C){kA(I,C,gg(A,C))})}return I}var pe=class I{constructor(e,g,t,A,C,i){this.options=Og(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 RI(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;Ke(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=Zh(e.value)),I.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);let t=[e,this.options,this.defaultOptions];return this.chooser=Lr("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 r=te(A=Hk(g)).call(A,s=>g[s]!=null);r.push("font"),EI(r,e,n),e.color=Hi(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(EI(["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),Se(e,g,"shadow",A),g.color!==void 0&&g.color!==null){let n=Hi(g.color);Xl(e.color,n)}else t===!0&&g.color===null&&(e.color=Og(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=Og(A.font)),I.updateGroupOptions(e,g,C),g.scaling!==void 0&&Se(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,Sa(Sa({},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 Kk(this.options,this.body,this.labelModule);break;case"circle":this.shape=new Qk(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new nn(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new rn(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new sn(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new Jk(this.options,this.body,this.labelModule);break;case"dot":this.shape=new on(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new kI(this.options,this.body,this.labelModule);break;case"icon":this.shape=new an(this.options,this.body,this.labelModule);break;case"image":this.shape=new $k(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new dn(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new ln(this.options,this.body,this.labelModule);break;case"star":this.shape=new hn(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 qk(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new un(this.options,this.body,this.labelModule);break;default:this.shape=new kI(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()&&An(this.labelModule.getSize(),e)&&g.push({nodeId:this.id,labelId:0}),An(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.",eh),e.mass=1}}},fn=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,r,s){if(n===i)return .5;{let o=1/(n-i);return Math.max(0,(s-i)*o)}}},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=Og(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",()=>{k(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&&(qi(e.opacity)||!Fg(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(zh("id",e))this.body.data.nodes=e;else if(z(e))this.body.data.nodes=new sg,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new sg;else throw new TypeError("Array or DataSet expected");if(t&&k(this.nodesListeners,function(A,C){t.off(C,A)}),this.body.nodes={},this.body.data.nodes){let A=this;k(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],r=A[n],s=g[i];r!==void 0?r.setOptions(s)&&(C=!0):(C=!0,r=this.create(s),A[n]=r)}!C&&t!==void 0&&(C=ph(g).call(g,function(i,n){let r=t[n];return r&&r.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;k(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(z(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),Qe(()=>{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}},eM=S,Na=Math.hypot,gM=Math.abs,tM=Math.sqrt,AM=!!Na&&Na(1/0,NaN)!==1/0;eM({target:"Math",stat:!0,arity:2,forced:AM},{hypot:function(e,g){for(var t=0,A=0,C=arguments.length,i=0,n,r;A<C;)n=gM(arguments[A++]),i<n?(r=i/n,t=t*r*r+1,i=n):n>0?(r=n/i,t+=r*r):t+=n;return i===1/0?1/0:i*tM(t)}});var IM=L,CM=IM.Math.hypot,iM=CM,nM=iM,rM=nM,sM=P(rM),K=class{static transform(e,g){z(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 r=e[n],s=r.x*Math.cos(C)-r.y*Math.sin(C),o=r.x*Math.sin(C)+r.y*Math.cos(C);r.x=t+i*s,r.y=A+i*o}}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()}},oM=class extends K{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}},pn=class extends K{static draw(e,g){let t=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return K.transform(t,g),K.drawPath(e,t),!0}},mn=class{static draw(e,g){let t=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return K.transform(t,g),K.drawPath(e,t),!0}},vn=class{static draw(e,g){let t={x:-.4,y:0};K.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}},bn=class{static draw(e,g){let t={x:-.3,y:0};K.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}},yn=class{static draw(e,g){let t=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return K.transform(t,g),K.drawPath(e,t),!0}},wn=class{static draw(e,g){let t=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return K.transform(t,g),K.drawPath(e,t),!0}},En=class{static draw(e,g){let t={x:-.4,y:0};return K.transform(t,g),Cr(e,t.x,t.y,g.length*.4),!0}},Tn=class{static draw(e,g){let t=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return K.transform(t,g),K.drawPath(e,t),!0}},xn=class{static draw(e,g){let t=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return K.transform(t,g),K.drawPath(e,t),!0}},On=class{static draw(e,g){let t=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return K.transform(t,g),K.drawPath(e,t),!0}},Dn=class{static draw(e,g){let t=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return K.transform(t,g),K.drawPath(e,t),!0}},MI=class{static draw(e,g){let t;switch(g.type&&(t=g.type.toLowerCase()),t){case"image":return oM.draw(e,g);case"circle":return En.draw(e,g);case"box":return xn.draw(e,g);case"crow":return mn.draw(e,g);case"curve":return vn.draw(e,g);case"diamond":return On.draw(e,g);case"inv_curve":return bn.draw(e,g);case"triangle":return yn.draw(e,g);case"inv_triangle":return wn.draw(e,g);case"bar":return Tn.draw(e,g);case"vee":return Dn.draw(e,g);default:return pn.draw(e,g)}}};function Ra(I,e){var g=U(I);if(Je){var t=Je(I);e&&(t=te(t).call(t,function(A){return gg(I,A).enumerable})),g.push.apply(g,t)}return g}function ka(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])}):$e?RA(I,$e(A)):F(t=Ra(Object(A))).call(t,function(C){kA(I,C,gg(A,C))})}return I}var FI=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,r]=this._getCircleData(e);this._circle(e,g,i,n,r)}}_drawDashedLine(e,g,t,A,C){e.lineCap="round";let i=z(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,r,s]=this._getCircleData(e);this._circle(e,g,n,r,s)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)od(e,this.from.x,this.from.y,this.to.x,this.to.y,i);else{let[n,r,s]=this._getCircleData(e);this._circle(e,g,n,r,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]=Le(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=Lh(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,r=t.direction,s=10,o=this.options.selfReference.size,d=.05,a,l=(i+n)*.5,h=0;this.options.arrowStrikethrough===!0&&(r===-1?h=this.options.endPointOffset.from:r===1&&(h=this.options.endPointOffset.to));let c=0;do{l=(i+n)*.5,a=this._pointOnCircle(A,C,o,l);let f=Math.atan2(e.y-a.y,e.x-a.x),u=e.distanceToBorder(g,f)+h,m=Math.sqrt(Math.pow(a.x-e.x,2)+Math.pow(a.y-e.y,2)),E=u-m;if(Math.abs(E)<d)break;E>0?r>0?i=l:n=l:r>0?n=l:i=l,++c}while(i<=n&&c<s);return ka(ka({},a),{},{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 r=this.options.selfReference.angle,s=this.options.selfReference.angle+Math.PI,o=this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:r,high:s,direction:-1}),d=this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:r,high:s,direction:1});i=Math.atan2(o.y-A,o.x-t),n=Math.atan2(d.y-A,d.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,r,s]=this._getCircleData(void 0),o=n-C,d=r-i;return Math.abs(Math.sqrt(o*o+d*d)-s)}}_getDistanceToLine(e,g,t,A,C,i){let n=t-e,r=A-g,s=n*n+r*r,o=((C-e)*n+(i-g)*r)/s;o>1?o=1:o<0&&(o=0);let d=e+o*n,a=g+o*r,l=d-C,h=a-i;return Math.sqrt(l*l+h*h)}getArrowData(e,g,t,A,C,i){let n,r,s,o,d,a,l,h=i.width;g==="from"?(s=this.from,o=this.to,d=i.fromArrowScale<0,a=Math.abs(i.fromArrowScale),l=i.fromArrowType):g==="to"?(s=this.to,o=this.from,d=i.toArrowScale<0,a=Math.abs(i.toArrowScale),l=i.toArrowType):(s=this.to,o=this.from,d=i.middleArrowScale<0,a=Math.abs(i.middleArrowScale),l=i.middleArrowType);let c=15*a+3*h;if(s!=o){let E=sM(s.x-o.x,s.y-o.y),w=c/E;if(g!=="middle")if(this.options.smooth.enabled===!0){let O=this._findBorderPosition(s,e,{via:t}),R=this.getPoint(O.t+w*(g==="from"?1:-1),t);n=Math.atan2(O.y-R.y,O.x-R.x),r=O}else n=Math.atan2(s.y-o.y,s.x-o.x),r=this._findBorderPosition(s,e);else{let O=(d?-w:w)/2,R=this.getPoint(.5+O,t),M=this.getPoint(.5-O,t);n=Math.atan2(R.y-M.y,R.x-M.x),r=this.getPoint(.5,t)}}else{let[E,w,O]=this._getCircleData(e);if(g==="from"){let R=this.options.selfReference.angle,M=this.options.selfReference.angle+Math.PI,j=this._findBorderPositionCircle(this.from,e,{x:E,y:w,low:R,high:M,direction:-1});n=j.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,r=j}else if(g==="to"){let R=this.options.selfReference.angle,M=this.options.selfReference.angle+Math.PI,j=this._findBorderPositionCircle(this.from,e,{x:E,y:w,low:R,high:M,direction:1});n=j.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,r=j}else{let R=this.options.selfReference.angle/(2*Math.PI);r=this._pointOnCircle(E,w,O,R),n=R*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}let f=r.x-c*.9*Math.cos(n),u=r.y-c*.9*Math.sin(n);return{point:r,core:{x:f,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,MI.draw(e,C)&&(this.enableShadow(e,g),TA(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=z(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 Ma(I,e){var g=U(I);if(Je){var t=Je(I);e&&(t=te(t).call(t,function(A){return gg(I,A).enumerable})),g.push.apply(g,t)}return g}function Fa(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=Ma(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):$e?RA(I,$e(A)):F(t=Ma(Object(A))).call(t,function(C){kA(I,C,gg(A,C))})}return I}var gA=class extends FI{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,r=0,s=this.to,o,d,a=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(s=this.from,i=!0,a=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(a=0);let l=0;do{d=(r+n)*.5,o=this.getPoint(d,t);let h=Math.atan2(s.y-o.y,s.x-o.x),c=s.distanceToBorder(g,h)+a,f=Math.sqrt(Math.pow(o.x-s.x,2)+Math.pow(o.y-s.y,2)),u=c-f;if(Math.abs(u)<C)break;u<0?i===!1?r=d:n=d:i===!1?n=d:r=d,++l}while(r<=n&&l<A);return Fa(Fa({},o),{},{t:d})}_getDistanceToBezierEdge(e,g,t,A,C,i,n){let r=1e9,s,o,d,a,l,h=e,c=g;for(o=1;o<10;o++)d=.1*o,a=Math.pow(1-d,2)*e+2*d*(1-d)*n.x+Math.pow(d,2)*t,l=Math.pow(1-d,2)*g+2*d*(1-d)*n.y+Math.pow(d,2)*A,o>0&&(s=this._getDistanceToLine(h,c,a,l,C,i),r=s<r?s:r),h=a,c=l;return r}_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()}},zI=class extends gA{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)}},BI=class extends gA{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,r=this.from.y+i;return g==="discrete"&&(t<=A?n=t<e*A?this.from.x:n:r=A<e*t?this.from.y:r),{x:n,y:r}}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,r=(Math.atan2(A,t)+(e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*C*Math.sin(r),y:this.from.y+(e*.5+.5)*C*Math.cos(r)}}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,r=(Math.atan2(A,t)+(-e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*C*Math.sin(r),y:this.from.y+(e*.5+.5)*C*Math.cos(r)}}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,r=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?r=this.to.y>r?this.to.y:r:r=this.to.y<r?this.to.y:r,{x:n,y:r}}}_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}}},Pn=class extends gA{constructor(e,g,t){super(e,g,t)}_getDistanceToBezierEdge2(e,g,t,A,C,i,n,r){let s=1e9,o=e,d=g,a=[0,0,0,0];for(let l=1;l<10;l++){let h=.1*l;a[0]=Math.pow(1-h,3),a[1]=3*h*Math.pow(1-h,2),a[2]=3*Math.pow(h,2)*(1-h),a[3]=Math.pow(h,3);let c=a[0]*e+a[1]*n.x+a[2]*r.x+a[3]*t,f=a[0]*g+a[1]*n.y+a[2]*r.y+a[3]*A;if(l>0){let u=this._getDistanceToLine(o,d,c,f,C,i);s=u<s?u:s}o=c,d=f}return s}},ZI=class extends Pn{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,r]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,g,t,A,C,i,n,r)}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}}},LI=class extends FI{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,r=Math.sqrt(i*i+n*n),s=e.distanceToBorder(g,C),o=(r-s)/r;return{x:(1-o)*A.x+o*t.x,y:(1-o)*A.y+o*t.y,t:0}}_getDistanceToEdge(e,g,t,A,C,i){return this._getDistanceToLine(e,g,t,A,C,i)}},Dg=class I{constructor(e,g,t,A,C){if(g===void 0)throw new Error("No body provided");this.options=Og(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 RI(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=Zh(e.value));let t=[e,this.options,this.defaultOptions];return this.chooser=Lr("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(Dt(["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&&(Fg(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&&(Fg(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"))),SI(g.label)?e.label=g.label:SI(e.label)||(e.label=void 0),Se(e,g,"smooth",A),Se(e,g,"shadow",A),Se(e,g,"background",A),g.dashes!==void 0&&g.dashes!==null?e.dashes=g.dashes:t===!0&&g.dashes===null&&(e.dashes=Tg(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),Se(e.scaling,g.scaling,"label",A.scaling)):t===!0&&g.scaling===null&&(e.scaling=Tg(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")Se(e.arrows,g.arrows,"to",A.arrows),Se(e.arrows,g.arrows,"middle",A.arrows),Se(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:"+xt(g.arrows));else t===!0&&g.arrows===null&&(e.arrows=Tg(A.arrows));if(g.color!==void 0&&g.color!==null){let n=vg(g.color)?{color:g.color,highlight:g.color,hover:g.color,inherit:!1,opacity:1}:g.color,r=e.color;if(C)_(r,A.color,!1,t);else for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&delete r[s];if(vg(r))r.color=r,r.highlight=r,r.hover=r,r.inherit=!1,n.opacity===void 0&&(r.opacity=1);else{let s=!1;n.color!==void 0&&(r.color=n.color,s=!0),n.highlight!==void 0&&(r.highlight=n.highlight,s=!0),n.hover!==void 0&&(r.hover=n.hover,s=!0),n.inherit!==void 0&&(r.inherit=n.inherit),n.opacity!==void 0&&(r.opacity=Math.min(1,Math.max(0,n.opacity))),s===!0?r.inherit=!1:r.inherit===void 0&&(r.inherit="from")}}else t===!0&&g.color===null&&(e.color=Og(A.color));t===!0&&g.font===null&&(e.font=Og(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 zI&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof ZI&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof BI&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof LI&&e.type.enabled===!1)&&(t=!1),t===!0&&(g=this.cleanup())),t===!0?e.enabled===!0?e.type==="dynamic"?(g=!0,this.edgeType=new zI(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new ZI(this.options,this.body,this.labelModule):this.edgeType=new BI(this.options,this.body,this.labelModule):this.edgeType=new LI(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=Lh(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();An(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,r=e.top;return this.edgeType.getDistanceToEdge(t,A,C,i,n,r)<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}},Sn=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,r){if(i===C)return .5;{let s=1/(i-C);return Math.max(0,(r-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 r=e.body.edges[n],s=e.body.data.edges.get(n);if(s!=null){let o=s.smooth;o!==void 0&&o.enabled===!0&&o.type==="dynamic"&&(A===void 0?r.setOptions({smooth:!1}):r.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",()=>{k(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){Dg.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(zh("id",e))this.body.data.edges=e;else if(z(e))this.body.data.edges=new sg,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new sg;else throw new TypeError("Array or DataSet expected");if(t&&k(this.edgesListeners,(A,C)=>{t.off(C,A)}),this.body.edges={},this.body.data.edges){k(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 r=A.get(i,{showInternalIds:!0});t[i]=this.create(r)}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),r=g[i];r!==void 0?(r.disconnect(),A=r.setOptions(n)||A,r.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;k(e,A=>{let C=t[A];C!==void 0&&C.remove()}),g&&this.body.emitter.emit("_dataChanged")}refresh(){k(this.body.edges,(e,g)=>{let t=this.body.data.edges.get(g);t!==void 0&&e.setOptions(t)})}create(e){return new Dg(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=[];k(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)}},GI=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.barnesHutTree,this.setOptions(t),this._rng=sC("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,r=t*i;this.physicsBody.forces[A.id].x+=n,this.physicsBody.forces[A.id].y+=r}_formBarnesHutTree(e,g){let t,A=g.length,C=e[g[0]].x,i=e[g[0]].y,n=e[g[0]].x,r=e[g[0]].y;for(let f=1;f<A;f++){let u=e[g[f]],m=u.x,E=u.y;u.options.mass>0&&(m<C&&(C=m),m>n&&(n=m),E<i&&(i=E),E>r&&(r=E))}let s=Math.abs(n-C)-Math.abs(r-i);s>0?(i-=.5*s,r+=.5*s):(C+=.5*s,n-=.5*s);let d=Math.max(1e-5,Math.abs(n-C)),a=.5*d,l=.5*(C+n),h=.5*(i+r),c={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:l-a,maxX:l+a,minY:h-a,maxY:h+a},size:d,calcSize:1/d,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(c.root);for(let f=0;f<A;f++)t=e[g[f]],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()}},Nn=class{constructor(e,g,t){this._rng=sC("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,r,s=this.body.nodes,o=this.physicsBody.physicsNodeIndices,d=this.physicsBody.forces,a=this.options.nodeDistance,l=-2/3/a,h=4/3;for(let c=0;c<o.length-1;c++){n=s[o[c]];for(let f=c+1;f<o.length;f++)r=s[o[f]],e=r.x-n.x,g=r.y-n.y,t=Math.sqrt(e*e+g*g),t===0&&(t=.1*this._rng(),e=t),t<2*a&&(t<.5*a?i=1:i=l*t+h,i=i/t,A=e*i,C=g*i,d[n.id].x-=A,d[n.id].y-=C,d[r.id].x+=A,d[r.id].y+=C)}}},Rn=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 r=e[g[n]];if(i.level===r.level){let s=A+this.overlapAvoidanceFactor*((i.shape.radius||0)/2+(r.shape.radius||0)/2),o=r.x-i.x,d=r.y-i.y,a=Math.sqrt(o*o+d*d),l=.05,h;a<s?h=-Math.pow(l*a,2)+Math.pow(l*s,2):h=0,a!==0&&(h=h/a);let c=o*h,f=d*h;t[i.id].x-=c,t[i.id].y-=f,t[r.id].x+=c,t[r.id].y+=f}}}}},Yt=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 r=0;r<t.length;r++)g=A[t[r]],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,r=A*n,s=C*n;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=r,this.physicsBody.forces[e.id].y+=s),this.physicsBody.forces[g.id]!==void 0&&(this.physicsBody.forces[g.id].x-=r,this.physicsBody.forces[g.id].y-=s)}},kn=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,r,s=this.body.edges,o=.5,d=this.physicsBody.physicsEdgeIndices,a=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces;for(let w=0;w<a.length;w++){let O=a[w];l[O].springFx=0,l[O].springFy=0}for(let w=0;w<d.length;w++)g=s[d[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,r=Math.sqrt(t*t+A*A),r=r===0?.01:r,n=this.options.springConstant*(e-r)/r,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-=o*C,l[g.toId].y-=o*i),l[g.fromId]!==void 0&&(l[g.fromId].x+=o*C,l[g.fromId].y+=o*i)));n=1;let h,c;for(let w=0;w<a.length;w++){let O=a[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 f=0,u=0;for(let w=0;w<a.length;w++){let O=a[w];f+=l[O].x,u+=l[O].y}let m=f/a.length,E=u/a.length;for(let w=0;w<a.length;w++){let O=a[w];l[O].x-=m,l[O].y-=E}}},dt=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 r=0;r<i.length;r++){let s=i[r];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}},Mn=class extends GI{constructor(e,g,t){super(e,g,t),this._rng=sC("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),r=g*n,s=t*n;this.physicsBody.forces[A.id].x+=r,this.physicsBody.forces[A.id].y+=s}},Fn=class extends dt{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}}},zn=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,EI(["stabilization"],this.options,e),Se(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"||qi(g.x))&&(g.x=0),(typeof g.y!="number"||qi(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 Mn(this.body,this.physicsBody,e),this.edgesSolver=new Yt(this.body,this.physicsBody,e),this.gravitySolver=new Fn(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new Nn(this.body,this.physicsBody,e),this.edgesSolver=new Yt(this.body,this.physicsBody,e),this.gravitySolver=new dt(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new Rn(this.body,this.physicsBody,e),this.edgesSolver=new kn(this.body,this.physicsBody,e),this.gravitySolver=new dt(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new GI(this.body,this.physicsBody,e),this.edgesSolver=new Yt(this.body,this.physicsBody,e),this.gravitySolver=new dt(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=mI();this.physicsTick(),(mI()-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)&&Qe(()=>{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,Qe(()=>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;Qe(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,r=Math.sqrt(Math.pow(C.x,2)+Math.pow(C.x,2)),s=Math.min(Math.max(5,r),15),o=3*s,d=Ui((180-Math.min(1,Math.max(0,n*r))*180)/360,1,1),a={x:A.x+i*C.x,y:A.y+i*C.y};e.lineWidth=s,e.strokeStyle=d,e.beginPath(),e.moveTo(A.x,A.y),e.lineTo(a.x,a.y),e.stroke();let l=Math.atan2(C.y,C.x);e.fillStyle=d,MI.draw(e,{type:"arrow",point:a,angle:l,length:o}),TA(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 r=0;r<g.length;r++)n=e[g[r]],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 r=0;r<g.length;r++)n=e[g[r]],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}},Bn=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],k(g.edges,t=>{delete this.containedEdges[t.id]}),k(g.containedNodes,(t,A)=>{this.containedNodes[A]=t}),g.containedNodes={},k(g.containedEdges,(t,A)=>{this.containedEdges[A]=t}),g.containedEdges={},k(g.edges,t=>{k(this.edges,A=>{var C,i;let n=G(C=A.clusteringEdgeReplacingIds).call(C,t.id);n!==-1&&(k(t.clusteringEdgeReplacingIds,r=>{A.clusteringEdgeReplacingIds.push(r),this.body.edges[r].edgeReplacedById=A.id}),Ke(i=A.clusteringEdgeReplacingIds).call(i,n,1))})}),g.edges=[]}},Zn=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={};k(this.body.nodes,(C,i)=>{C.options&&e.joinCondition(C.options)===!0&&(t[i]=C,k(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,r;for(let s=0;s<this.body.nodeIndices.length;s++){let o={},d={},a=this.body.nodeIndices[s],l=this.body.nodes[a];if(C[a]===void 0){r=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&&r++,n.push(i));if(r===e){let h=function(f){if(g.joinCondition===void 0||g.joinCondition===null)return!0;let u=de.cloneOptions(f);return g.joinCondition(u)},c=!0;for(let f=0;f<n.length;f++){i=n[f];let u=this._getConnectedId(i,a);if(h(l))d[i.id]=i,o[a]=l,o[u]=this.body.nodes[u],C[a]=!0;else{c=!1;break}}if(U(o).length>0&&U(d).length>0&&c===!0){let u=function(){for(let m=0;m<A.length;++m)for(let E in o)if(A[m].nodes[E]!==void 0)return A[m]}();if(u!==void 0){for(let m in o)u.nodes[m]===void 0&&(u.nodes[m]=o[m]);for(let m in d)u.edges[m]===void 0&&(u.edges[m]=d[m])}else A.push({nodes:o,edges:d})}}}}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={},r=C.id,s=de.cloneOptions(C);i[r]=C;for(let d=0;d<C.edges.length;d++){let a=C.edges[d];if(this.clusteredEdges[a.id]===void 0){let l=this._getConnectedId(a,r);if(this.clusteredNodes[l]===void 0)if(l!==r)if(g.joinCondition===void 0)n[a.id]=a,i[l]=this.body.nodes[l];else{let h=de.cloneOptions(this.body.nodes[l]);g.joinCondition(s,h)===!0&&(n[a.id]=a,i[l]=this.body.nodes[l])}else n[a.id]=a}}let o=ae(t=U(i)).call(t,function(d){return i[d].id});for(let d in i){if(!Object.prototype.hasOwnProperty.call(i,d))continue;let a=i[d];for(let l=0;l<a.edges.length;l++){let h=a.edges[l];G(o).call(o,this._getConnectedId(h,a.id))>-1&&(n[h.id]=h)}}this._cluster(i,n,g,A)}_createClusterEdges(e,g,t,A){let C,i,n,r,s,o,d=U(e),a=[];for(let c=0;c<d.length;c++){i=d[c],n=e[i];for(let f=0;f<n.edges.length;f++)C=n.edges[f],this.clusteredEdges[C.id]===void 0&&(C.toId==C.fromId?g[C.id]=C:C.toId==i?(r=t.id,s=C.fromId,o=s):(r=C.toId,s=t.id,o=r),e[o]===void 0&&a.push({edge:C,fromId:s,toId:r}))}let l=[],h=function(c){for(let f=0;f<l.length;f++){let u=l[f],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<a.length;c++){let f=a[c],u=f.edge,m=h(f);m===null?(m=this._createClusteredEdge(f.fromId,f.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 o in e)Object.prototype.hasOwnProperty.call(e,o)&&this.clusteredNodes[o]!==void 0&&C.push(o);for(let o=0;o<C.length;++o)delete e[C[o]];if(U(e).length==0||U(e).length==1&&t.clusterNodeProperties.allowSingleNodeCluster!=!0)return;let i=_({},t.clusterNodeProperties);if(t.processProperties!==void 0){let o=[];for(let a in e)if(Object.prototype.hasOwnProperty.call(e,a)){let l=de.cloneOptions(e[a]);o.push(l)}let d=[];for(let a in g)if(Object.prototype.hasOwnProperty.call(g,a)&&a.substr(0,12)!=="clusterEdge:"){let l=de.cloneOptions(g[a],"edge");d.push(l)}if(i=t.processProperties(i,o,d),!i)throw new Error("The processProperties function does not return properties!")}i.id===void 0&&(i.id="cluster:"+at());let n=i.id;i.label===void 0&&(i.label="cluster");let r;i.x===void 0&&(r=this._getClusterPosition(e),i.x=r.x),i.y===void 0&&(r===void 0&&(r=this._getClusterPosition(e)),i.y=r.y),i.id=n;let s=this.body.functions.createNode(i,Bn);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 r=1;r<g.length;r++)n=e[g[r]],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 o=C[i];this.body.nodes[o]._openChildCluster(e),delete this.body.nodes[e],t===!0&&this.body.emitter.emit("_dataChanged");return}let n=A.containedNodes,r=A.containedEdges;if(g!==void 0&&g.releaseFunction!==void 0&&typeof g.releaseFunction=="function"){let o={},d={x:A.x,y:A.y};for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){let h=this.body.nodes[l];o[l]={x:h.x,y:h.y}}let a=g.releaseFunction(d,o);for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){let h=this.body.nodes[l];a[l]!==void 0&&(h.x=a[l].x===void 0?A.x:a[l].x,h.y=a[l].y===void 0?A.y:a[l].y)}}else k(n,function(o){o.options.fixed.x===!1&&(o.x=A.x),o.options.fixed.y===!1&&(o.y=A.y)});for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o)){let d=this.body.nodes[o];d.vx=A.vx,d.vy=A.vy,d.setOptions({physics:!0}),delete this.clusteredNodes[o]}let s=[];for(let o=0;o<A.edges.length;o++)s.push(A.edges[o]);for(let o=0;o<s.length;o++){let d=s[o],a=this._getConnectedId(d,e),l=this.clusteredNodes[a];for(let h=0;h<d.clusteringEdgeReplacingIds.length;h++){let c=d.clusteringEdgeReplacingIds[h],f=this.body.edges[c];if(f!==void 0)if(l!==void 0){let u=this.body.nodes[l.clusterId];u.containedEdges[f.id]=f,delete r[f.id];let m=f.fromId,E=f.toId;f.toId==a?E=l.clusterId:m=l.clusterId,this._createClusteredEdge(m,E,f,u.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(f)}d.remove()}for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&this._restoreEdge(r[o]);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 r=this.body.edges[n];if(r===void 0)continue;i++;let s=r.clusteringEdgeReplacingIds;if(s===void 0)A.push(n);else for(let o=0;o<s.length;++o){let d=s[o];G(g).call(g,s)!==-1||G(t).call(t,s)!==-1||g.push(d)}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 r=0;r<this.body.nodeIndices.length;r++){let s=this.body.nodes[this.body.nodeIndices[r]];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:"+at(),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 Dg){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 k(e,A=>{g(A)&&t.push(A)}),t}_updateState(){let e,g=[],t={},A=r=>{k(this.body.nodes,s=>{s.isCluster===!0&&r(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(r){for(let s=0;s<g.length;s++)delete r.containedNodes[g[s]]});for(let r=0;r<g.length;r++)delete this.clusteredNodes[g[r]];k(this.clusteredEdges,r=>{let s=this.body.edges[r];(s===void 0||!s.endPointsValid())&&(t[r]=r)}),A(function(r){k(r.containedEdges,(s,o)=>{!s.endPointsValid()&&!t[o]&&(t[o]=o)})}),k(this.body.edges,(r,s)=>{let o=!0,d=r.clusteringEdgeReplacingIds;if(d!==void 0){let a=0;k(d,l=>{let h=this.body.edges[l];h!==void 0&&h.endPointsValid()&&(a+=1)}),o=a>0}(!r.endPointsValid()||!o)&&(t[s]=s)}),A(r=>{k(t,s=>{delete r.containedEdges[s],k(r.edges,(o,d)=>{if(o.id===s){r.edges[d]=null;return}o.clusteringEdgeReplacingIds=this._filter(o.clusteringEdgeReplacingIds,function(a){return!t[a]})}),r.edges=this._filter(r.edges,function(o){return o!==null})})}),k(t,r=>{delete this.clusteredEdges[r]}),k(t,r=>{delete this.body.edges[r]});let C=U(this.body.edges);k(C,r=>{let s=this.body.edges[r],o=this._isClusteredNode(s.fromId)||this._isClusteredNode(s.toId);if(o!==this._isClusteredEdge(s.id))if(o){let d=this._getClusterNodeForNode(s.fromId);d!==void 0&&this._clusterEdges(this.body.nodes[s.fromId],s,d);let a=this._getClusterNodeForNode(s.toId);a!==void 0&&this._clusterEdges(this.body.nodes[s.toId],s,a)}else delete this._clusterEdges[r],this._restoreEdge(s)});let i=!1,n=!0;for(;n;){let r=[];A(function(s){let o=U(s.containedNodes).length,d=s.options.allowSingleNodeCluster===!0;(d&&o<1||!d&&o<2)&&r.push(s.id)});for(let s=0;s<r.length;++s)this.openCluster(r[s],{},!1);n=r.length>0,i=i||n}i&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}},Ln=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=Qe(()=>{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&&Dt(["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=[],r=20,s=this.canvas.DOMtoCanvas({x:-r,y:-r}),o=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+r,y:this.canvas.frame.canvas.clientHeight+r}),d={top:s.y,left:s.x,bottom:o.y,right:o.x},a=[];for(let f=0;f<A.length;f++)if(C=t[A[f]],C.hover)n.push(A[f]);else if(C.isSelected())i.push(A[f]);else if(g===!0){let u=C.draw(e);u.drawExternalLabel!=null&&a.push(u.drawExternalLabel)}else if(C.isBoundingBoxOverlappingWith(d)===!0){let u=C.draw(e);u.drawExternalLabel!=null&&a.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 f=C.draw(e);f.drawExternalLabel!=null&&a.push(f.drawExternalLabel)}for(l=0;l<c;l++){C=t[n[l]];let f=C.draw(e);f.drawExternalLabel!=null&&a.push(f.drawExternalLabel)}return{drawExternalLabels:()=>{for(let f of a)f()}}}_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()}},aM=L,dM=aM.setInterval,lM=dM,hM=P(lM);function jI(I,e){e.inputHandler=function(g){g.isFirst&&e(g)},I.on("hammer.input",e.inputHandler)}function Gh(I,e){return e.inputHandler=function(g){g.isFinal&&e(g)},I.on("hammer.input",e.inputHandler)}var Gn=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&&Dt(["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=hM(()=>{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=Ke(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}),jI(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),Gh(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),r=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==n||this.frame.canvas.height!==r)&&this._getCameraState(i),this.frame.canvas.width!==n&&(this.frame.canvas.width=n,t=!0),this.frame.canvas.height!==r&&(this.frame.canvas.height=r,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 cM(I,e){let g=q({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},I!=null?I:{});if(!z(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 jn=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=cM(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 a in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,a)&&this.body.nodes[a].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 d=Math.min(t/600,A/600);i*=d}else{this.body.emitter.emit("_resizeNodes"),C=de.getRange(this.body.nodes,e.nodes);let s=Math.abs(C.maxX-C.minX)*1.1,o=Math.abs(C.maxY-C.minY)*1.1,d=t/s,a=A/o;i=d<=a?d:a}i>e.maxZoomLevel?i=e.maxZoomLevel:i<e.minZoomLevel&&(i=e.minZoomLevel);let r={position:de.findCenter(C),scale:i,animation:e.animation};this.moveTo(r)}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,!Fg(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,!Fg(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,!Fg(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,!Fg(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=hO[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})}},uM=`div.vis-network div.vis-navigation div.vis-button {
654
655
  width: 34px;
655
656
  height: 34px;
656
657
  -moz-border-radius: 17px;
@@ -711,7 +712,7 @@ div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends {
711
712
  bottom: 50px;
712
713
  right: 15px;
713
714
  }
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(o){s(o,"keydown")},r=function(o){s(o,"keyup")},s=function(o,a){if(A[a][o.keyCode]!==void 0){for(var d=A[a][o.keyCode],l=0;l<d.length;l++)(d[l].shift===void 0||d[l].shift==!0&&o.shiftKey==!0||d[l].shift==!1&&o.shiftKey==!1)&&d[l].fn(o);e==!0&&o.preventDefault()}};return t.bind=function(o,a,d){if(d===void 0&&(d="keydown"),C[o]===void 0)throw new Error("unsupported key: "+o);A[d][C[o].code]===void 0&&(A[d][C[o].code]=[]),A[d][C[o].code].push({fn:a,shift:C[o].shift})},t.bindAll=function(o,a){a===void 0&&(a="keydown");for(var d in C)C.hasOwnProperty(d)&&t.bind(d,o,a)},t.getKey=function(o){for(var a in C)if(C.hasOwnProperty(a)){if(o.shiftKey==!0&&C[a].shift==!0&&o.keyCode==C[a].code)return a;if(o.shiftKey==!1&&C[a].shift==!1&&o.keyCode==C[a].code)return a;if(o.keyCode==C[a].code&&a=="shift")return a}return"unknown key, currently not supported"},t.unbind=function(o,a,d){if(d===void 0&&(d="keydown"),C[o]===void 0)throw new Error("unsupported key: "+o);if(a!==void 0){var l=[],h=A[d][C[o].code];if(h!==void 0)for(var c=0;c<h.length;c++)h[c].fn==a&&h[c].shift==C[o].shift||l.push(A[d][C[o].code][c]);A[d][C[o].code]=l}else A[d][C[o].code]=[]},t.reset=function(){A={keydown:{},keyup:{}}},t.destroy=function(){A={keydown:{},keyup:{}},g.removeEventListener("keydown",n,!0),g.removeEventListener("keyup",r,!0)},g.addEventListener("keydown",n,!0),g.addEventListener("keyup",r,!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 rt(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 rt(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,r,s,o,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(r=this.keycharm).call(r,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(s=this.keycharm).call(s,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(o=this.keycharm).call(o,"]",()=>{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,r,s,o,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(r=this.onDragStart).call(r,this),this.body.eventListeners.onDrag=b(s=this.onDrag).call(s,this),this.body.eventListeners.onDragEnd=b(o=this.onDragEnd).call(o,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-YO(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 r=A[n];G(C).call(C,r)===-1&&i.push(r)}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 r=this.body.nodes[n];return r.x>=A.minX&&r.x<=A.maxX&&r.y>=A.minY&&r.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,r=(1-i)*g.y+C.y*i;if(this.body.view.scale=e,this.body.view.translation={x:n,y:r},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 r=this.body.nodeIndices,s=this.body.nodes,o,a=[];for(let d=0;d<r.length;d++)o=s[r[d]],o.isOverlappingWith(A)===!0&&(i=!0,o.getTitle()!==void 0&&a.push(r[d]));a.length>0&&(this.popupObj=s[a[a.length-1]],i=!0)}if(this.popupObj===void 0&&i===!1){let r=this.body.edgeIndices,s=this.body.edges,o,a=[];for(let d=0;d<r.length;d++)o=s[r[d]],o.isOverlappingWith(A)===!0&&o.connected===!0&&o.getTitle()!==void 0&&a.push(r[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=Pr,qA=nC.getWeakData,Xk=xr,Jk=ag,$k=ft,ai=ce,qk=Tr,Dh=Rg,xa=ne,Rh=Kg,eM=Rh.set,gM=Rh.getterFor,tM=Dh.find,AM=Dh.findIndex,IM=Qk([].splice),CM=0,eI=function(I){return I.frozen||(I.frozen=new Nh)},Nh=function(){this.entries=[]},di=function(I,e){return tM(I.entries,function(g){return g[0]===e})};Nh.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(r,s){Xk(r,C),eM(r,{type:e,id:CM++,frozen:void 0}),$k(s)||qk(s,r[t],{that:r,AS_ENTRIES:g})}),C=A.prototype,i=gM(e),n=function(r,s,o){var a=i(r),d=qA(Jk(s),!0);return d===!0?eI(a).set(s,o):d[a.id]=o,r};return Ta(C,{delete:function(r){var s=i(this);if(!ai(r))return!1;var o=qA(r);return o===!0?eI(s).delete(r):o&&xa(o,s.id)&&delete o[s.id]},has:function(s){var o=i(this);if(!ai(s))return!1;var a=qA(s);return a===!0?eI(o).has(s):a&&xa(a,o.id)}}),Ta(C,g?{get:function(s){var o=i(this);if(ai(s)){var a=qA(s);return a===!0?eI(o).get(s):a?a[o.id]:void 0}},set:function(s,o){return n(this,s,o)}}:{add:function(s){return n(this,s,!0)}}),A}},nM=Jl,Oa=X,oI=Z,Pa=Pr,rM=nC,sM=Or,Sh=iM,gI=ce,tI=Kg.enforce,oM=z,aM=hd,kA=Object,dM=Array.isArray,AI=kA.isExtensible,kh=kA.isFrozen,lM=kA.isSealed,Mh=kA.freeze,hM=kA.seal,Da={},Ra={},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=oI(At.set),uM=function(){return nM&&oM(function(){var I=Mh([]);return aI(new Bh,I,1),!kh(I)})};aM&&(cM?(kt=Sh.getConstructor(Fh,"WeakMap",!0),rM.enable(),li=oI(At.delete),Mt=oI(At.has),hi=oI(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=Ra)),aI(this,e,g),t===Da&&Mh(e),t===Ra&&hM(e),this}}));var li,Mt,hi,fM=L,pM=fM.WeakMap,mM=pM,vM=mM,bM=vM,Yt=D(bM);function W(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,cg,ug,dI;function Na(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 W(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)W(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)W(this,Pe,"f").delete(A)}clear(){W(this,Pe,"f").clear()}getSelection(){return[...W(this,Pe,"f")]}getChanges(){return{added:[...Na(W(this,Sg,"f"),W(this,Pe,"f"))],deleted:[...Na(W(this,Pe,"f"),W(this,Sg,"f"))],previous:[...new Le(W(this,Sg,"f"))],current:[...new Le(W(this,Pe,"f"))]}}commit(){let e=this.getChanges();Zn(this,Sg,W(this,Pe,"f"),"f"),Zn(this,Pe,new Le(W(this,Sg,"f")),"f");for(let g of e.added)g.select();for(let g of e.deleted)g.unselect();return e}};Sg=new Yt,Pe=new Yt;var Ln=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};cg.set(this,new LI),ug.set(this,new LI),dI.set(this,void 0),Zn(this,dI,e,"f")}get sizeNodes(){return W(this,cg,"f").size}get sizeEdges(){return W(this,ug,"f").size}getNodes(){return W(this,cg,"f").getSelection()}getEdges(){return W(this,ug,"f").getSelection()}addNodes(){W(this,cg,"f").add(...arguments)}addEdges(){W(this,ug,"f").add(...arguments)}deleteNodes(e){W(this,cg,"f").delete(e)}deleteEdges(e){W(this,ug,"f").delete(e)}clear(){W(this,cg,"f").clear(),W(this,ug,"f").clear()}commit(){let e={nodes:W(this,cg,"f").commit(),edges:W(this,ug,"f").commit()};for(var g=arguments.length,t=new Array(g),A=0;A<g;A++)t[A]=arguments[A];return W(this,dI,"f").call(this,e,...t),e}};cg=new Yt,ug=new Yt,dI=new Yt;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 r=this.body.edgeIndices[n],s=i[r];if(s.connected){let o=s.from.x,a=s.from.y,d=s.to.x,l=s.to.y,h=s.edgeType.getDistanceToEdge(o,a,d,l,t.x,t.y);h<A&&(C=r,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 Og)&&(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 Og&&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 Og&&C===0&&i===0,r=t instanceof pe&&C===0&&i===0;(A||n||r)&&(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 r=A.length-1;r>=0;r--){let o=C[A[r]].getItemsOnPoint(g);t.push.apply(t,o)}let i=this.body.edgeIndices,n=this.body.edges;for(let r=i.length-1;r>=0;r--){let o=n[i[r]].getItemsOnPoint(g);t.push.apply(t,o)}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=R,wM=Rg.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,RM=function(I){var e=I.every;return I===ci||PM(ci,I)&&e===ci.every?DM:e},NM=RM,SM=NM,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=Eg(null),i=Nr(A=[...EI(t).call(t)]).call(A,(a,d)=>a+1+d.edges.length,0),n=g+"Id",r=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,o;if(!t.has(a))continue;let p=C[c.id]+r;if(F(s=te(o=c.edges).call(o,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 Yn=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 RA,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 r=e[n];t=Math.min(r.x,t),A=Math.max(r.x,A),C=Math.min(r.y,C),i=Math.max(r.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)}},Wn=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 r=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 o=e.length;if(s==o&&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*r)})}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 r=0;r<e.length;r++){let s=this.body.nodes[e[r]];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 Yn;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)}},r=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)},o=(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=r(V,ue),Qg=r(ye,ue),MA=Hg[1],Xg=Qg[0],Ce=Qg[2];if(Math.abs(MA-Xg)>k){let Y=MA-Xg+k;Y<-Ce+k&&(Y=-Ce+k),Y<0&&(e._shiftBlock(m.id,Y),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 Y=j.toId==E?j.from:j.to;k[w[Ce].id]=Y,this.hierarchical.levels[Y.id]<O&&V.push(j)}}let ye=(Ce,j)=>{let Y=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;Y+=fe/Math.sqrt(fe*fe+M)}return Y},ue=(Ce,j)=>{let Y=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;Y-=M*Math.pow(fe*fe+M,-1.5)}return Y},Hg=(Ce,j)=>{let Y=this.direction.getPosition(m),he={};for(let fe=0;fe<Ce;fe++){let Me=ye(Y,j),Jg=ue(Y,j),Ot=40,jh=Math.max(-Ot,Math.min(Ot,Math.round(Me/Jg)));if(Y=Y-jh,he[Y]!==void 0)break;he[Y]=fe}return Y},Qg=Ce=>{let j=this.direction.getPosition(m);if(t[m.id]===void 0){let Ot={};n(m,Ot),t[m.id]=Ot}let Y=r(t[m.id]),he=Y[2],fe=Y[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),[Y,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-(Y-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,o(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],r=1e9,s=1e9;if(C!==0){let o=n[C-1];if(t===!0&&g[o.id]===void 0||t===!1){let a=this.direction.getPosition(o);r=i-a}}if(C!=n.length-1){let o=n[C+1];if(t===!0&&g[o.id]===void 0||t===!1){let a=this.direction.getPosition(o);s=Math.min(s,a-i)}}return[r,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),r=this.direction.getPosition(C),[s,o]=this._getSpaceAroundNode(C),a=r-n;(a<0&&Math.abs(a)<o-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 r=this.options.hierarchical.nodeSpacing,s=r*C;C>0&&(s=this.direction.getPosition(A[i-1])+r),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 r=C[n],s=this.hierarchical.levels[r.id];if(s>g&&this.positionedNodes[r.id]===void 0){let o=this.options.hierarchical.nodeSpacing,a;n===0?a=this.direction.getPosition(this.body.nodes[e]):a=this.direction.getPosition(C[n-1])+o,this.direction.setPosition(r,a,s),this._validatePositionAndContinue(r,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 r=g(de.cloneOptions(A,"node"),de.cloneOptions(C,"node"),de.cloneOptions(i,"edge"));this.hierarchical.levels[C.id]=n+r};this._crawlNetwork(t),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;let g=Nr(e=this.body.nodeIndices).call(e,(t,A)=>(t.set(A,this.body.nodes[A]),t),new RA);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,r=this._getActiveEdges(C);for(let s=0;s<r.length;s++){let o=r[s];o.connected===!0&&(o.toId==C.id?n=o.from:n=o.to,C.id!=n.id&&(e(C,n,o),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 r=this.body.nodes[n];A(r,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 r=this.hierarchical.parentReference[n];if(r!==void 0)for(let s=0;s<r.length;s++){let o=r[s];i[o]=!0,A(i,o)}},C=(i,n)=>{let r=this.hierarchical.parentReference[n];if(r!==void 0)for(let s=0;s<r.length;s++){let o=r[s];if(i[o]!==void 0)return{foundParent:o,withChild:n};let a=C(i,o);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
+ `;Hg(uM);function za(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(o){s(o,"keydown")},r=function(o){s(o,"keyup")},s=function(o,d){if(A[d][o.keyCode]!==void 0){for(var a=A[d][o.keyCode],l=0;l<a.length;l++)(a[l].shift===void 0||a[l].shift==!0&&o.shiftKey==!0||a[l].shift==!1&&o.shiftKey==!1)&&a[l].fn(o);e==!0&&o.preventDefault()}};return t.bind=function(o,d,a){if(a===void 0&&(a="keydown"),C[o]===void 0)throw new Error("unsupported key: "+o);A[a][C[o].code]===void 0&&(A[a][C[o].code]=[]),A[a][C[o].code].push({fn:d,shift:C[o].shift})},t.bindAll=function(o,d){d===void 0&&(d="keydown");for(var a in C)C.hasOwnProperty(a)&&t.bind(a,o,d)},t.getKey=function(o){for(var d in C)if(C.hasOwnProperty(d)){if(o.shiftKey==!0&&C[d].shift==!0&&o.keyCode==C[d].code)return d;if(o.shiftKey==!1&&C[d].shift==!1&&o.keyCode==C[d].code)return d;if(o.keyCode==C[d].code&&d=="shift")return d}return"unknown key, currently not supported"},t.unbind=function(o,d,a){if(a===void 0&&(a="keydown"),C[o]===void 0)throw new Error("unsupported key: "+o);if(d!==void 0){var l=[],h=A[a][C[o].code];if(h!==void 0)for(var c=0;c<h.length;c++)h[c].fn==d&&h[c].shift==C[o].shift||l.push(A[a][C[o].code][c]);A[a][C[o].code]=l}else A[a][C[o].code]=[]},t.reset=function(){A={keydown:{},keyup:{}}},t.destroy=function(){A={keydown:{},keyup:{}},g.removeEventListener("keydown",n,!0),g.removeEventListener("keyup",r,!0)},g.addEventListener("keydown",n,!0),g.addEventListener("keyup",r,!0),t}var Vn=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;jI(n,b(t=this._fit).call(t,this))}else{var A;jI(n,b(A=this.bindToRedraw).call(A,this,g[i]))}this.navigationHammers.push(n)}let C=new ot(this.canvas.frame);Gh(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=za({container:window,preventDefault:!0}):this.keycharm=za({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,g,t,A,C,i,n,r,s,o,d,a,l,h,c,f,u,m,E,w,O,R,M,j;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(r=this.keycharm).call(r,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(s=this.keycharm).call(s,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(o=this.keycharm).call(o,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(d=this.keycharm).call(d,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(a=this.keycharm).call(a,"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(f=this.keycharm).call(f,"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(R=this.keycharm).call(R,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(M=this.keycharm).call(M,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(j=this.keycharm).call(j,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}},Yn=class{constructor(e,g,t){var A,C,i,n,r,s,o,d,a,l,h,c,f;this.body=e,this.canvas=g,this.selectionHandler=t,this.navigationHandler=new Vn(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(r=this.onDragStart).call(r,this),this.body.eventListeners.onDrag=b(s=this.onDrag).call(s,this),this.body.eventListeners.onDragEnd=b(o=this.onDragEnd).call(o,this),this.body.eventListeners.onMouseWheel=b(d=this.onMouseWheel).call(d,this),this.body.eventListeners.onPinch=b(a=this.onPinch).call(a,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(f=this.getPointer).call(f,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&&(EI(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),Se(this.options,e,"keyboard"),e.tooltip&&(q(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=Hi(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-oO(this.canvas.frame.canvas),y:e.y-aO(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 r=A[n];G(C).call(C,r)===-1&&i.push(r)}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 r=this.body.nodes[n];return r.x>=A.minX&&r.x<=A.maxX&&r.y>=A.minY&&r.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,r=(1-i)*g.y+C.y*i;if(this.body.view.scale=e,this.body.view.translation={x:n,y:r},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=Qe(()=>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 r=this.body.nodeIndices,s=this.body.nodes,o,d=[];for(let a=0;a<r.length;a++)o=s[r[a]],o.isOverlappingWith(A)===!0&&(i=!0,o.getTitle()!==void 0&&d.push(r[a]));d.length>0&&(this.popupObj=s[d[d.length-1]],i=!0)}if(this.popupObj===void 0&&i===!1){let r=this.body.edgeIndices,s=this.body.edges,o,d=[];for(let a=0;a<r.length;a++)o=s[r[a]],o.isOverlappingWith(A)===!0&&o.connected===!0&&o.getTitle()!==void 0&&d.push(r[a]);d.length>0&&(this.popupObj=s[d[d.length-1]],n="edge")}this.popupObj!==void 0?this.popupObj.id!==C&&(this.popup===void 0&&(this.popup=new yO(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"))}},fM=Z,Ba=Mr,tI=oC.getWeakData,pM=Rr,mM=dg,vM=mt,fi=ce,bM=Nr,jh=Ng,Za=ne,Vh=Ug,yM=Vh.set,wM=Vh.getterFor,EM=jh.find,TM=jh.findIndex,xM=fM([].splice),OM=0,AI=function(I){return I.frozen||(I.frozen=new Yh)},Yh=function(){this.entries=[]},pi=function(I,e){return EM(I.entries,function(g){return g[0]===e})};Yh.prototype={get:function(I){var e=pi(this,I);if(e)return e[1]},has:function(I){return!!pi(this,I)},set:function(I,e){var g=pi(this,I);g?g[1]=e:this.entries.push([I,e])},delete:function(I){var e=TM(this.entries,function(g){return g[0]===I});return~e&&xM(this.entries,e,1),!!~e}};var DM={getConstructor:function(I,e,g,t){var A=I(function(r,s){pM(r,C),yM(r,{type:e,id:OM++,frozen:void 0}),vM(s)||bM(s,r[t],{that:r,AS_ENTRIES:g})}),C=A.prototype,i=wM(e),n=function(r,s,o){var d=i(r),a=tI(mM(s),!0);return a===!0?AI(d).set(s,o):a[d.id]=o,r};return Ba(C,{delete:function(r){var s=i(this);if(!fi(r))return!1;var o=tI(r);return o===!0?AI(s).delete(r):o&&Za(o,s.id)&&delete o[s.id]},has:function(s){var o=i(this);if(!fi(s))return!1;var d=tI(s);return d===!0?AI(o).has(s):d&&Za(d,o.id)}}),Ba(C,g?{get:function(s){var o=i(this);if(fi(s)){var d=tI(s);return d===!0?AI(o).get(s):d?d[o.id]:void 0}},set:function(s,o){return n(this,s,o)}}:{add:function(s){return n(this,s,!0)}}),A}},PM=sh,La=X,lI=Z,Ga=Mr,SM=oC,NM=kr,Wh=DM,II=ce,CI=Ug.enforce,RM=B,kM=xd,MA=Object,MM=Array.isArray,iI=MA.isExtensible,_h=MA.isFrozen,FM=MA.isSealed,Hh=MA.freeze,zM=MA.seal,ja={},Va={},BM=!La.ActiveXObject&&"ActiveXObject"in La,Mt,Uh=function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},Kh=NM("WeakMap",Uh,Wh),Ct=Kh.prototype,hI=lI(Ct.set),ZM=function(){return PM&&RM(function(){var I=Hh([]);return hI(new Kh,I,1),!_h(I)})};kM&&(BM?(Mt=Wh.getConstructor(Uh,"WeakMap",!0),SM.enable(),mi=lI(Ct.delete),Ft=lI(Ct.has),vi=lI(Ct.get),Ga(Ct,{delete:function(I){if(II(I)&&!iI(I)){var e=CI(this);return e.frozen||(e.frozen=new Mt),mi(this,I)||e.frozen.delete(I)}return mi(this,I)},has:function(e){if(II(e)&&!iI(e)){var g=CI(this);return g.frozen||(g.frozen=new Mt),Ft(this,e)||g.frozen.has(e)}return Ft(this,e)},get:function(e){if(II(e)&&!iI(e)){var g=CI(this);return g.frozen||(g.frozen=new Mt),Ft(this,e)?vi(this,e):g.frozen.get(e)}return vi(this,e)},set:function(e,g){if(II(e)&&!iI(e)){var t=CI(this);t.frozen||(t.frozen=new Mt),Ft(this,e)?hI(this,e,g):t.frozen.set(e,g)}else hI(this,e,g);return this}})):ZM()&&Ga(Ct,{set:function(e,g){var t;return MM(e)&&(_h(e)?t=ja:FM(e)&&(t=Va)),hI(this,e,g),t===ja&&Hh(e),t===Va&&zM(e),this}}));var mi,Ft,vi,LM=L,GM=LM.WeakMap,jM=GM,VM=jM,YM=VM,Wt=P(YM);function W(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 Wn(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 kg,Pe,ug,fg,cI;function Ya(I,e){let g=new Ge;for(let t of e)I.has(t)||g.add(t);return g}var VI=class{constructor(){kg.set(this,new Ge),Pe.set(this,new Ge)}get size(){return W(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)W(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)W(this,Pe,"f").delete(A)}clear(){W(this,Pe,"f").clear()}getSelection(){return[...W(this,Pe,"f")]}getChanges(){return{added:[...Ya(W(this,kg,"f"),W(this,Pe,"f"))],deleted:[...Ya(W(this,Pe,"f"),W(this,kg,"f"))],previous:[...new Ge(W(this,kg,"f"))],current:[...new Ge(W(this,Pe,"f"))]}}commit(){let e=this.getChanges();Wn(this,kg,W(this,Pe,"f"),"f"),Wn(this,Pe,new Ge(W(this,kg,"f")),"f");for(let g of e.added)g.select();for(let g of e.deleted)g.unselect();return e}};kg=new Wt,Pe=new Wt;var _n=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};ug.set(this,new VI),fg.set(this,new VI),cI.set(this,void 0),Wn(this,cI,e,"f")}get sizeNodes(){return W(this,ug,"f").size}get sizeEdges(){return W(this,fg,"f").size}getNodes(){return W(this,ug,"f").getSelection()}getEdges(){return W(this,fg,"f").getSelection()}addNodes(){W(this,ug,"f").add(...arguments)}addEdges(){W(this,fg,"f").add(...arguments)}deleteNodes(e){W(this,ug,"f").delete(e)}deleteEdges(e){W(this,fg,"f").delete(e)}clear(){W(this,ug,"f").clear(),W(this,fg,"f").clear()}commit(){let e={nodes:W(this,ug,"f").commit(),edges:W(this,fg,"f").commit()};for(var g=arguments.length,t=new Array(g),A=0;A<g;A++)t[A]=arguments[A];return W(this,cI,"f").call(this,e,...t),e}};ug=new Wt,fg=new Wt,cI=new Wt;var Hn=class{constructor(e,g){this.body=e,this.canvas=g,this._selectionAccumulator=new _n,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&&Dt(["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 r=this.body.edgeIndices[n],s=i[r];if(s.connected){let o=s.from.x,d=s.from.y,a=s.to.x,l=s.to.y,h=s.edgeType.getDistanceToEdge(o,d,a,l,t.x,t.y);h<A&&(C=r,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 Dg)&&(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 Dg&&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 Dg&&C===0&&i===0,r=t instanceof pe&&C===0&&i===0;(A||n||r)&&(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 r=A.length-1;r>=0;r--){let o=C[A[r]].getItemsOnPoint(g);t.push.apply(t,o)}let i=this.body.edgeIndices,n=this.body.edges;for(let r=i.length-1;r>=0;r--){let o=n[i[r]].getItemsOnPoint(g);t.push.apply(t,o)}return t}},YI=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()}},Un=class extends YI{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){ig(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}},Kn=class extends YI{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){ig(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}},WM=S,_M=Ng.every,HM=Tt,UM=HM("every");WM({target:"Array",proto:!0,forced:!UM},{every:function(e){return _M(this,e,arguments.length>1?arguments[1]:void 0)}});var KM=Ie,QM=KM("Array").every,XM=J,JM=QM,bi=Array.prototype,$M=function(I){var e=I.every;return I===bi||XM(bi,I)&&e===bi.every?JM:e},qM=$M,e5=qM,g5=e5,Qh=P(g5);function t5(I,e){let g=new Ge;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 A5(I){return Xh(e=>{var g,t;return Qh(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 I5(I){return Xh(e=>{var g,t;return Qh(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 Xh(I,e,g,t){var A;let C=Tg(null),i=Br(A=[...OI(t).call(t)]).call(A,(d,a)=>d+1+a.edges.length,0),n=g+"Id",r=g==="to"?1:-1;for(let[d,a]of t){if(!t.has(d)||!I(a))continue;C[d]=0;let l=[a],h=0,c;for(;c=l.pop();){var s,o;if(!t.has(d))continue;let f=C[c.id]+r;if(F(s=te(o=c.edges).call(o,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(f,E))&&(C[m]=f,l.push(u[g]))}),h>i)return t5(t,C);++h}}return C}var Qn=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=ig(e=[...new Ge(WT(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 r=e[n];t=Math.min(r.x,t),A=Math.max(r.x,A),C=Math.min(r.y,C),i=Math.max(r.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)}},Xn=class{constructor(e){this.body=e,this._resetRNG(Math.random()+":"+mI()),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(Dt(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),Se(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=sC(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 r=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 o=e.length;if(s==o&&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*r)})}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 r=0;r<e.length;r++){let s=this.body.nodes[e[r]];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 Qn;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)}},r=function(u){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,E=1e9,w=1e9,O=1e9,R=-1e9;for(let M in u)if(Object.prototype.hasOwnProperty.call(u,M)){let j=e.body.nodes[M],ye=e.hierarchical.levels[j.id],ue=e.direction.getPosition(j),[Qg,Xg]=e._getSpaceAroundNode(j,u);E=Math.min(Qg,E),w=Math.min(Xg,w),ye<=m&&(O=Math.min(ue,O),R=Math.max(ue,R))}return[O,R,E,w]},s=(u,m)=>{let E=this.hierarchical.getMaxLevel(u.id),w=this.hierarchical.getMaxLevel(m.id);return Math.min(E,w)},o=(u,m,E)=>{let w=this.hierarchical;for(let O=0;O<m.length;O++){let R=m[O],M=w.distributionOrdering[R];if(M.length>1)for(let j=0;j<M.length-1;j++){let ye=M[j],ue=M[j+1];w.hasSameParent(ye,ue)&&w.inSameSubNetwork(ye,ue)&&u(ye,ue,E)}}},d=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),R=Math.abs(O-w),M=e.options.hierarchical.nodeSpacing;if(R>M){let j={},ye={};n(u,j),n(m,ye);let ue=s(u,m),Qg=r(j,ue),Xg=r(ye,ue),FA=Qg[1],Jg=Xg[0],Ce=Xg[2];if(Math.abs(FA-Jg)>M){let Y=FA-Jg+M;Y<-Ce+M&&(Y=-Ce+M),Y<0&&(e._shiftBlock(m.id,Y),g=!0,E===!0&&e._centerParent(m))}}},a=(u,m)=>{let E=m.id,w=m.edges,O=this.hierarchical.levels[m.id],R=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,M={},j=[];for(let Ce=0;Ce<w.length;Ce++){let V=w[Ce];if(V.toId!=V.fromId){let Y=V.toId==E?V.from:V.to;M[w[Ce].id]=Y,this.hierarchical.levels[Y.id]<O&&j.push(V)}}let ye=(Ce,V)=>{let Y=0;for(let he=0;he<V.length;he++)if(M[V[he].id]!==void 0){let fe=this.direction.getPosition(M[V[he].id])-Ce;Y+=fe/Math.sqrt(fe*fe+R)}return Y},ue=(Ce,V)=>{let Y=0;for(let he=0;he<V.length;he++)if(M[V[he].id]!==void 0){let fe=this.direction.getPosition(M[V[he].id])-Ce;Y-=R*Math.pow(fe*fe+R,-1.5)}return Y},Qg=(Ce,V)=>{let Y=this.direction.getPosition(m),he={};for(let fe=0;fe<Ce;fe++){let Fe=ye(Y,V),$g=ue(Y,V),Pt=40,Cc=Math.max(-Pt,Math.min(Pt,Math.round(Fe/$g)));if(Y=Y-Cc,he[Y]!==void 0)break;he[Y]=fe}return Y},Xg=Ce=>{let V=this.direction.getPosition(m);if(t[m.id]===void 0){let Pt={};n(m,Pt),t[m.id]=Pt}let Y=r(t[m.id]),he=Y[2],fe=Y[3],Fe=Ce-V,$g=0;Fe>0?$g=Math.min(Fe,fe-this.options.hierarchical.nodeSpacing):Fe<0&&($g=-Math.min(-Fe,he-this.options.hierarchical.nodeSpacing)),$g!=0&&(this._shiftBlock(m.id,$g),g=!0)},FA=Ce=>{let V=this.direction.getPosition(m),[Y,he]=this._getSpaceAroundNode(m),fe=Ce-V,Fe=V;fe>0?Fe=Math.min(V+(he-this.options.hierarchical.nodeSpacing),Ce):fe<0&&(Fe=Math.max(V-(Y-this.options.hierarchical.nodeSpacing),Ce)),Fe!==V&&(this.direction.setPosition(m,Fe),g=!0)},Jg=Qg(u,j);Xg(Jg),Jg=Qg(u,w),FA(Jg)},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],R=this.hierarchical.distributionOrdering[O];for(let M=0;M<R.length;M++)a(1e3,R[M])}if(g!==!0)break}},h=u=>{let m=this.hierarchical.getLevels();m=Zg(m).call(m);for(let E=0;E<u&&(g=!1,o(d,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])},f=()=>{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&&f(),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],r=1e9,s=1e9;if(C!==0){let o=n[C-1];if(t===!0&&g[o.id]===void 0||t===!1){let d=this.direction.getPosition(o);r=i-d}}if(C!=n.length-1){let o=n[C+1];if(t===!0&&g[o.id]===void 0||t===!1){let d=this.direction.getPosition(o);s=Math.min(s,d-i)}}return[r,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),r=this.direction.getPosition(C),[s,o]=this._getSpaceAroundNode(C),d=r-n;(d<0&&Math.abs(d)<o-this.options.hierarchical.nodeSpacing||d>0&&Math.abs(d)<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),ig(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 r=this.options.hierarchical.nodeSpacing,s=r*C;C>0&&(s=this.direction.getPosition(A[i-1])+r),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]]);ig(t=this.direction).call(t,C);for(let n=0;n<C.length;n++){let r=C[n],s=this.hierarchical.levels[r.id];if(s>g&&this.positionedNodes[r.id]===void 0){let o=this.options.hierarchical.nodeSpacing,d;n===0?d=this.direction.getPosition(this.body.nodes[e]):d=this.direction.getPosition(C[n-1])+o,this.direction.setPosition(r,d,s),this._validatePositionAndContinue(r,s,d)}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 k(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;k(g,A=>{let C=this.body.nodes[A],i=this._getActiveEdges(C).length;e[i]=!0});let t=[];return k(e,A=>{t.push(Number(A))}),ig(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;k(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 r=g(de.cloneOptions(A,"node"),de.cloneOptions(C,"node"),de.cloneOptions(i,"edge"));this.hierarchical.levels[C.id]=n+r};this._crawlNetwork(t),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;let g=Br(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=I5(g):this.hierarchical.levels=A5(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,r=this._getActiveEdges(C);for(let s=0;s<r.length;s++){let o=r[s];o.connected===!0&&(o.toId==C.id?n=o.from:n=o.to,C.id!=n.id&&(e(C,n,o),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 r=this.body.nodes[n];A(r,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 r=this.hierarchical.parentReference[n];if(r!==void 0)for(let s=0;s<r.length;s++){let o=r[s];i[o]=!0,A(i,o)}},C=(i,n)=>{let r=this.hierarchical.parentReference[n];if(r!==void 0)for(let s=0;s<r.length;s++){let o=r[s];if(i[o]!==void 0)return{foundParent:o,withChild:n};let d=C(i,o);if(d.foundParent!==null)return d}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 Un(this):this.direction=new Kn(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)}},C5=`div.vis-network div.vis-manipulation {
715
716
  box-sizing: content-box;
716
717
 
717
718
  border-width: 0;
@@ -905,14 +906,17 @@ div.network-navigation_wrapper {
905
906
  height: 100%;
906
907
  }
907
908
  */
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),r=this._getNewTargetNode(i.to.x,i.to.y);this.temporaryIds.nodes.push(n.id),this.temporaryIds.nodes.push(r.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this.body.nodes[r.id]=r,this.body.nodeIndices.push(r.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 o=i.edgeType.findBorderPositions(s);n.selected===!1&&(n.x=o.from.x,n.y=o.from.y),r.selected===!1&&(r.x=o.to.x,r.y=o.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={},fg(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&&(fg(this.editModeDiv),fg(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(),fg(this.manipulationDiv),fg(this.editModeDiv),fg(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 rt(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 r=C.length-1;r>=0;r--){var n;if(G(n=this.temporaryIds.nodes).call(n,C[r])===-1){i=this.body.nodes[C[r]];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 r=this.body.nodes[this.temporaryIds.nodes[0]];r.x=this.canvas._XconvertDOMtoCanvas(g.x),r.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 r=C.length-1;r>=0;r--){var n;if(G(n=this.temporaryIds.nodes).call(n,C[r])===-1){i=this.body.nodes[C[r]];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!!(wg(I).call(I,"physics")&&wg(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 r=g[n],s={};A[r]=s;for(let o=0;o<g.length;o++)s[g[o]]=n==o?0:1e9}for(let n=0;n<t.length;n++){let r=C[t[n]];r.connected===!0&&A[r.fromId]!==void 0&&A[r.toId]!==void 0&&(A[r.fromId][r.toId]=1,A[r.toId][r.fromId]=1)}let i=g.length;for(let n=0;n<i;n++){let r=g[n],s=A[r];for(let o=0;o<i-1;o++){let a=g[o],d=A[a];for(let l=o+1;l<i;l++){let h=g[l],c=A[h],p=Math.min(d[h],d[r]+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,r=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),s=5,o=1e9,a=0,d=0,l=0,h=0,c=0;for(;o>C&&n<r;)for(n+=1,[a,o,d,l]=this._getHighestEnergyNode(t),h=o,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 r=0;r<g.length;r++){let s=g[r];if(t[s].predefinedPosition!==!0||t[s].isCluster===!0&&e===!0||t[s].options.fixed.x!==!0||t[s].options.fixed.y!==!0){let[o,a,d]=this._getEnergy(s);A<o&&(A=o,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,r=0,s=C[e].x,o=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+(o-k)**2)**1.5;i+=V*(1-ye*(o-k)**2*ue),n+=V*(ye*(s-M)*(o-k)*ue),r+=V*(1-ye*(s-M)**2*ue)}}let l=i,h=n,c=g,p=r,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,r=0;for(let s=t;s<e.length;s++){let o=e[s];if(o!==A){let a=g[o].x,d=g[o].y,l=1/Math.sqrt((C-a)**2+(i-d)**2);this.E_matrix[A][s]=[this.K_matrix[A][o]*(C-a-this.L_matrix[A][o]*(C-a)*l),this.K_matrix[A][o]*(i-d-this.L_matrix[A][o]*(i-d)*l)],this.E_matrix[o][t]=this.E_matrix[A][s],n+=this.E_matrix[A][s][0],r+=this.E_matrix[A][s][1]}}this.E_sums[A]=[n,r]}}_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,r=t[e].y,s=0,o=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+(r-u)**2),E=C[d]*(n-p-i[d]*(n-p)*m),w=C[d]*(r-u-i[d]*(r-u)*m);A[a]=[E,w],s+=E,o+=w;let O=this.E_sums[d];O[0]+=E-h,O[1]+=w-c}}this.E_sums[e]=[s,o]}};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 Rn(this.body),this.layoutEngine=new Wn(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];fg(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 rC(){return document.documentElement.getAttribute("data-theme")||"light"}function Mr(I){let e=getComputedStyle(document.documentElement);return{uri:e.getPropertyValue("--yasgui-graph-uri").trim()||"#97C2FC",literal:e.getPropertyValue("--yasgui-graph-literal").trim()||"#a6c8a6ff",blankNode:e.getPropertyValue("--yasgui-graph-blank-node").trim()||(I==="dark"?"#888888":"#c5c5c5ff"),typeObject:e.getPropertyValue("--yasgui-graph-type-object").trim()||"#e15b13ff",text:e.getPropertyValue("--yasgui-graph-text").trim()||(I==="dark"?"#e0e0e0":"#000000"),edge:e.getPropertyValue("--yasgui-graph-edge").trim()||(I==="dark"?"#666666":"#cccccc"),edgeLabel:e.getPropertyValue("--yasgui-graph-edge-label").trim()||(I==="dark"?"#cccccc":"#666666"),edgeLabelBackground:e.getPropertyValue("--yasgui-graph-edge-label-bg").trim()||(I==="dark"?"rgba(30, 30, 30, 0.8)":"rgba(255, 255, 255, 0.8)"),background:e.getPropertyValue("--yasgui-graph-background").trim()||(I==="dark"?"#1e1e1e":"#ffffff")}}function Vh(I){let e=new MutationObserver(g=>{g.forEach(t=>{if(t.attributeName==="data-theme"){let A=rC();I(A)}})});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),e}var Fr=class{constructor(e){this.yasr=e,this.network=null,this.currentTheme=rC(),this.themeObserver=null,this.resizeObserver=null,this.nodesDataSet=null,this.edgesDataSet=null,this.triples=null,this.prefixMap=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{if(this.triples=Zr(this.yasr.results),!this.triples||this.triples.length===0){let r=document.createElement("div");r.className="yasgui-graph-plugin-empty-state",r.textContent="No graph data to visualize",this.yasr.resultsEl.appendChild(r);return}this.triples.length>1e3&&console.warn("Large graph detected (>1000 triples). Rendering may be slow."),this.prefixMap=zr(this.yasr),this.currentTheme=rC();let e=Mr(this.currentTheme),{nodes:g,edges:t}=dC(this.triples,this.prefixMap,e),A=document.createElement("div");A.className="yasgui-graph-plugin-container",A.id="yasgui-graph-plugin-container",this.yasr.resultsEl.appendChild(A),this.nodesDataSet=new rg(g),this.edgesDataSet=new rg(t);let C=oC(e);this.network=new T(A,{nodes:this.nodesDataSet,edges:this.edgesDataSet},C),this.applyCanvasBackground(e.background),this.network.on("stabilizationIterationsDone",()=>{this.network.setOptions({physics:{enabled:!0}}),this.network.fit({maxZoomLevel:3}),this.setupContainerResize(A)}),this.themeObserver||(this.themeObserver=Vh(r=>{this.applyTheme(r)}));let i=document.createElement("div");i.className="yasgui-graph-controls",A.appendChild(i);let n=document.createElement("button");n.className="yasgui-graph-button",n.textContent="Zoom to Fit",n.onclick=()=>{this.network&&this.network.fit({maxZoomLevel:1e3,animation:{duration:300,easingFunction:"easeInOutQuad"}})},i.appendChild(n)}catch(e){console.error("Error rendering graph:",e);let g=document.createElement("div");g.className="yasgui-graph-plugin-error",g.textContent="Error rendering graph. See console for details.",this.yasr.resultsEl.appendChild(g)}}applyTheme(e){if(!this.network||!this.nodesDataSet||!this.triples||!this.prefixMap)return;this.currentTheme=e;let g=Mr(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=oC(g);this.network.setOptions(C),this.applyCanvasBackground(g.background)}applyCanvasBackground(e){this.network&&this.network.body&&this.network.body.container&&this.network.body.container.style.setProperty("--yasgui-graph-canvas-bg",e)}setupContainerResize(e){let g=e.parentElement;if(!g)return;let t=()=>{let A=g.clientHeight;A>0&&(e.style.height=`${A}px`,this.network&&this.network.fit({maxZoomLevel:1e3}))};t(),this.resizeObserver=new ResizeObserver(()=>{t()}),this.resizeObserver.observe(g)}getIcon(){let e=document.createElement("div");return e.className="yasgui-graph-icon",e.setAttribute("aria-label","Graph visualization"),e.innerHTML=`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
909
+ `;Hg(C5);var Jn=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),r=this._getNewTargetNode(i.to.x,i.to.y);this.temporaryIds.nodes.push(n.id),this.temporaryIds.nodes.push(r.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this.body.nodes[r.id]=r,this.body.nodeIndices.push(r.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 o=i.edgeType.findBorderPositions(s);n.selected===!1&&(n.x=o.from.x,n.y=o.from.y),r.selected===!1&&(r.x=o.to.x,r.y=o.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"+at(),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={},pg(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&&(pg(this.editModeDiv),pg(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(let g of Ke(e=this._domEventListenerCleanupQueue).call(e,0)){var e;g()}}_removeManipulationDOM(){this._clean(),pg(this.manipulationDiv),pg(this.editModeDiv),pg(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: "+xt(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,{});jI(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;Ke(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;Ke(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"+at(),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 r=C.length-1;r>=0;r--){var n;if(G(n=this.temporaryIds.nodes).call(n,C[r])===-1){i=this.body.nodes[C[r]];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 r=this.body.nodes[this.temporaryIds.nodes[0]];r.x=this.canvas._XconvertDOMtoCanvas(g.x),r.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 r=C.length-1;r>=0;r--){var n;if(G(n=this.temporaryIds.nodes).call(n,C[r])===-1){i=this.body.nodes[C[r]];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:at(),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",p="number",Zt="array",x="object",Jh="dom",i5="any",yi=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],wi={borderWidth:{number:p},borderWidthSelected:{number:p,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:p,undefined:"undefined"},fixed:{x:{boolean:v},y:{boolean:v},__type__:{object:x,boolean:v}},font:{align:{string:y},color:{string:y},size:{number:p},face:{string:y},background:{string:y},strokeWidth:{number:p},strokeColor:{string:y},vadjust:{number:p},multi:{boolean:v,string:y},bold:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},boldital:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},ital:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},mono:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},__type__:{object:x,string:y}},group:{string:y,number:p,undefined:"undefined"},heightConstraint:{minimum:{number:p},valign:{string:y},__type__:{object:x,boolean:v,number:p}},hidden:{boolean:v},icon:{face:{string:y},code:{string:y},size:{number:p},color:{string:y},weight:{string:y,number:p},__type__:{object:x}},id:{string:y,number:p},image:{selected:{string:y,undefined:"undefined"},unselected:{string:y,undefined:"undefined"},__type__:{object:x,string:y}},imagePadding:{top:{number:p},right:{number:p},bottom:{number:p},left:{number:p},__type__:{object:x,number:p}},label:{string:y,undefined:"undefined"},labelHighlightBold:{boolean:v},level:{number:p,undefined:"undefined"},margin:{top:{number:p},right:{number:p},bottom:{number:p},left:{number:p},__type__:{object:x,number:p}},mass:{number:p},physics:{boolean:v},scaling:{min:{number:p},max:{number:p},label:{enabled:{boolean:v},min:{number:p},max:{number:p},maxVisible:{number:p},drawThreshold:{number:p},__type__:{object:x,boolean:v}},customScalingFunction:{function:"function"},__type__:{object:x}},shadow:{enabled:{boolean:v},color:{string:y},size:{number:p},x:{number:p},y:{number:p},__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:p},interpolation:{boolean:v},useImageSize:{boolean:v},useBorderWithImage:{boolean:v},coordinateOrigin:{string:["center","top-left"]},__type__:{object:x}},size:{number:p},title:{string:y,dom:Jh,undefined:"undefined"},value:{number:p,undefined:"undefined"},widthConstraint:{minimum:{number:p},maximum:{number:p},__type__:{object:x,boolean:v,number:p}},x:{number:p},y:{number:p},__type__:{object:x}},n5={configure:{enabled:{boolean:v},filter:{boolean:v,string:y,array:Zt,function:"function"},container:{dom:Jh},showButton:{boolean:v},__type__:{object:x,boolean:v,string:y,array:Zt,function:"function"}},edges:{arrows:{to:{enabled:{boolean:v},scaleFactor:{number:p},type:{string:yi},imageHeight:{number:p},imageWidth:{number:p},src:{string:y},__type__:{object:x,boolean:v}},middle:{enabled:{boolean:v},scaleFactor:{number:p},type:{string:yi},imageWidth:{number:p},imageHeight:{number:p},src:{string:y},__type__:{object:x,boolean:v}},from:{enabled:{boolean:v},scaleFactor:{number:p},type:{string:yi},imageWidth:{number:p},imageHeight:{number:p},src:{string:y},__type__:{object:x,boolean:v}},__type__:{string:["from","to","middle"],object:x}},endPointOffset:{from:{number:p},to:{number:p},__type__:{object:x,number:p}},arrowStrikethrough:{boolean:v},background:{enabled:{boolean:v},color:{string:y},size:{number:p},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:p},__type__:{object:x,string:y}},dashes:{boolean:v,array:Zt},font:{color:{string:y},size:{number:p},face:{string:y},background:{string:y},strokeWidth:{number:p},strokeColor:{string:y},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:p},multi:{boolean:v,string:y},bold:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},boldital:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},ital:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},mono:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},__type__:{object:x,string:y}},hidden:{boolean:v},hoverWidth:{function:"function",number:p},label:{string:y,undefined:"undefined"},labelHighlightBold:{boolean:v},length:{number:p,undefined:"undefined"},physics:{boolean:v},scaling:{min:{number:p},max:{number:p},label:{enabled:{boolean:v},min:{number:p},max:{number:p},maxVisible:{number:p},drawThreshold:{number:p},__type__:{object:x,boolean:v}},customScalingFunction:{function:"function"},__type__:{object:x}},selectionWidth:{function:"function",number:p},selfReferenceSize:{number:p},selfReference:{size:{number:p},angle:{number:p},renderBehindTheNode:{boolean:v},__type__:{object:x}},shadow:{enabled:{boolean:v},color:{string:y},size:{number:p},x:{number:p},y:{number:p},__type__:{object:x,boolean:v}},smooth:{enabled:{boolean:v},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:p},forceDirection:{string:["horizontal","vertical","none"],boolean:v},__type__:{object:x,boolean:v}},title:{string:y,undefined:"undefined"},width:{number:p},widthConstraint:{maximum:{number:p},__type__:{object:x,boolean:v,number:p}},value:{number:p,undefined:"undefined"},__type__:{object:x}},groups:{useDefaultGroups:{boolean:v},__any__:wi,__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:p},y:{number:p},zoom:{number:p},__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:p},zoomView:{boolean:v},zoomSpeed:{number:p},__type__:{object:x}},layout:{randomSeed:{undefined:"undefined",number:p,string:y},improvedLayout:{boolean:v},clusterThreshold:{number:p},hierarchical:{enabled:{boolean:v},levelSeparation:{number:p},nodeSpacing:{number:p},treeSpacing:{number:p},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:wi,__type__:{object:x,boolean:v}},nodes:wi,physics:{enabled:{boolean:v},barnesHut:{theta:{number:p},gravitationalConstant:{number:p},centralGravity:{number:p},springLength:{number:p},springConstant:{number:p},damping:{number:p},avoidOverlap:{number:p},__type__:{object:x}},forceAtlas2Based:{theta:{number:p},gravitationalConstant:{number:p},centralGravity:{number:p},springLength:{number:p},springConstant:{number:p},damping:{number:p},avoidOverlap:{number:p},__type__:{object:x}},repulsion:{centralGravity:{number:p},springLength:{number:p},springConstant:{number:p},nodeDistance:{number:p},damping:{number:p},__type__:{object:x}},hierarchicalRepulsion:{centralGravity:{number:p},springLength:{number:p},springConstant:{number:p},nodeDistance:{number:p},damping:{number:p},avoidOverlap:{number:p},__type__:{object:x}},maxVelocity:{number:p},minVelocity:{number:p},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:v},iterations:{number:p},updateInterval:{number:p},onlyDynamicEdges:{boolean:v},fit:{boolean:v},__type__:{object:x,boolean:v}},timestep:{number:p},adaptiveTimestep:{boolean:v},wind:{x:{number:p},y:{number:p},__type__:{object:x}},__type__:{object:x,boolean:v}},autoResize:{boolean:v},clickToUse:{boolean:v},locale:{string:y},locales:{__any__:{any:i5},__type__:{object:x}},height:{string:y},width:{string:y},__type__:{object:x}},$h={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]}}},r5=(I,e,g)=>{var t;return!!(Eg(I).call(I,"physics")&&Eg(t=$h.physics.solver).call(t,e)&&g.physics.solver!==e&&e!=="wind")};var $n=class{constructor(){}getDistances(e,g,t){let A={},C=e.edges;for(let n=0;n<g.length;n++){let r=g[n],s={};A[r]=s;for(let o=0;o<g.length;o++)s[g[o]]=n==o?0:1e9}for(let n=0;n<t.length;n++){let r=C[t[n]];r.connected===!0&&A[r.fromId]!==void 0&&A[r.toId]!==void 0&&(A[r.fromId][r.toId]=1,A[r.toId][r.fromId]=1)}let i=g.length;for(let n=0;n<i;n++){let r=g[n],s=A[r];for(let o=0;o<i-1;o++){let d=g[o],a=A[d];for(let l=o+1;l<i;l++){let h=g[l],c=A[h],f=Math.min(a[h],a[r]+s[h]);a[h]=f,c[d]=f}}}return A}},qn=class{constructor(e,g,t){this.body=e,this.springLength=g,this.springConstant=t,this.distanceSolver=new $n}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,r=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),s=5,o=1e9,d=0,a=0,l=0,h=0,c=0;for(;o>C&&n<r;)for(n+=1,[d,o,a,l]=this._getHighestEnergyNode(t),h=o,c=0;h>i&&c<s;)c+=1,this._moveNode(d,a,l),[h,a,l]=this._getEnergy(d)}_getHighestEnergyNode(e){let g=this.body.nodeIndices,t=this.body.nodes,A=0,C=g[0],i=0,n=0;for(let r=0;r<g.length;r++){let s=g[r];if(t[s].predefinedPosition!==!0||t[s].isCluster===!0&&e===!0||t[s].options.fixed.x!==!0||t[s].options.fixed.y!==!0){let[o,d,a]=this._getEnergy(s);A<o&&(A=o,C=s,i=d,n=a)}}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,r=0,s=C[e].x,o=C[e].y,d=this.K_matrix[e],a=this.L_matrix[e];for(let w=0;w<A.length;w++){let O=A[w];if(O!==e){let R=C[O].x,M=C[O].y,j=d[O],ye=a[O],ue=1/((s-R)**2+(o-M)**2)**1.5;i+=j*(1-ye*(o-M)**2*ue),n+=j*(ye*(s-R)*(o-M)*ue),r+=j*(1-ye*(s-R)**2*ue)}}let l=i,h=n,c=g,f=r,u=t,m=(c/l+u/h)/(h/l-f/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,r=0;for(let s=t;s<e.length;s++){let o=e[s];if(o!==A){let d=g[o].x,a=g[o].y,l=1/Math.sqrt((C-d)**2+(i-a)**2);this.E_matrix[A][s]=[this.K_matrix[A][o]*(C-d-this.L_matrix[A][o]*(C-d)*l),this.K_matrix[A][o]*(i-a-this.L_matrix[A][o]*(i-a)*l)],this.E_matrix[o][t]=this.E_matrix[A][s],n+=this.E_matrix[A][s][0],r+=this.E_matrix[A][s][1]}}this.E_sums[A]=[n,r]}}_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,r=t[e].y,s=0,o=0;for(let d=0;d<g.length;d++){let a=g[d];if(a!==e){let l=A[d],h=l[0],c=l[1],f=t[a].x,u=t[a].y,m=1/Math.sqrt((n-f)**2+(r-u)**2),E=C[a]*(n-f-i[a]*(n-f)*m),w=C[a]*(r-u-i[a]*(r-u)*m);A[d]=[E,w],s+=E,o+=w;let O=this.E_sums[a];O[0]+=E-h,O[1]+=w-c}}this.E_sums[e]=[s,o]}};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:HO,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 $i,this.canvas=new Gn(this.body),this.selectionHandler=new Hn(this.body,this.canvas),this.interactionHandler=new Yn(this.body,this.canvas,this.selectionHandler),this.view=new jn(this.body,this.canvas),this.renderer=new Ln(this.body,this.canvas),this.physics=new zn(this.body),this.layoutEngine=new Xn(this.body),this.clustering=new Zn(this.body),this.manipulation=new Jn(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new fn(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new Sn(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new qn(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(g),this.setData(e)}dd(T.prototype);T.prototype.setOptions=function(I){if(I===null&&(I=void 0),I!==void 0){if(wO.validate(I,n5)===!0&&console.error("%cErrors have been found in the supplied options object.",eh),Dt(["locale","locales","clickToUse"],this.options,I),I.locale!==void 0&&(I.locale=UO(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 bO(this,this.body.container,$h,this.canvas.pixelRatio,r5)),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 vO(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=kO(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=MO(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];pg(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 aC(){return document.documentElement.getAttribute("data-theme")||"light"}function dC(I){let e=getComputedStyle(document.documentElement);return{uri:e.getPropertyValue("--yasgui-graph-uri").trim()||"#97C2FC",literal:e.getPropertyValue("--yasgui-graph-literal").trim()||"#a6c8a6ff",blankNode:e.getPropertyValue("--yasgui-graph-blank-node").trim()||(I==="dark"?"#888888":"#c5c5c5ff"),typeObject:e.getPropertyValue("--yasgui-graph-type-object").trim()||"#e15b13ff",text:e.getPropertyValue("--yasgui-graph-text").trim()||(I==="dark"?"#e0e0e0":"#000000"),edge:e.getPropertyValue("--yasgui-graph-edge").trim()||(I==="dark"?"#666666":"#cccccc"),edgeLabel:e.getPropertyValue("--yasgui-graph-edge-label").trim()||(I==="dark"?"#cccccc":"#666666"),edgeLabelBackground:e.getPropertyValue("--yasgui-graph-edge-label-bg").trim()||(I==="dark"?"rgba(30, 30, 30, 0.8)":"rgba(255, 255, 255, 0.8)"),background:e.getPropertyValue("--yasgui-graph-background").trim()||(I==="dark"?"#1e1e1e":"#ffffff")}}function qh(I){let e=new MutationObserver(g=>{g.forEach(t=>{if(t.attributeName==="data-theme"){let A=aC();I(A)}})});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),e}var ec={edgeStyle:"curved",compactMode:!1,predicateDisplay:"icon",showNodeLabels:!0,physicsEnabled:!0,nodeSize:"medium"},gc="yasgui-graph-plugin-settings";function tc(){try{let I=localStorage.getItem(gc);if(I)return{...ec,...JSON.parse(I)}}catch(I){}return{...ec}}function Ac(I){try{localStorage.setItem(gc,JSON.stringify(I))}catch(e){}}var s5=4,Ic="#ffa500",o5=3,lC=2,Gr=class{constructor(e){this.settingsPanelOpen=!1;this.clickOutsideHandler=null;this.expansionAbortController=null;this.uriToNodeId=new Map;this.yasr=e,this.network=null,this.currentTheme=aC(),this.themeObserver=null,this.resizeObserver=null,this.nodesDataSet=null,this.edgesDataSet=null,this.triples=null,this.prefixMap=null,this.settings=tc()}static get priority(){return 20}static get label(){return"Graph"}static get helpReference(){return"https://yasgui-doc.matdata.eu/docs/user-guide#graph-plugin"}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(){let e=this.settingsPanelOpen;this.expansionAbortController&&(this.expansionAbortController.abort(),this.expansionAbortController=null),this.expandedNodes=new Set,this.uriToNodeId=new Map,this.yasr.resultsEl.innerHTML="";try{if(this.triples=Wr(this.yasr.results),!this.triples||this.triples.length===0){let o=document.createElement("div");o.className="yasgui-graph-plugin-empty-state",o.textContent="No graph data to visualize",this.yasr.resultsEl.appendChild(o);return}this.triples.length>1e3&&console.warn("Large graph detected (>1000 triples). Rendering may be slow."),this.prefixMap=Vr(this.yasr),this.currentTheme=aC();let g=dC(this.currentTheme),{nodes:t,edges:A}=BA(this.triples,this.prefixMap,g,this.settings),C=document.createElement("div");C.className="yasgui-graph-plugin-container",C.id="yasgui-graph-plugin-container",this.yasr.resultsEl.appendChild(C),this.nodesDataSet=new sg(t),this.edgesDataSet=new sg(A);let i=cC(g,this.settings);this.network=new T(C,{nodes:this.nodesDataSet,edges:this.edgesDataSet},i),this.setupHtmlTooltips(C),this.applyCanvasBackground(g.background),this.setupContainerResize(C),this.settings.physicsEnabled?this.network.on("stabilizationIterationsDone",()=>{this.network.setOptions({physics:{enabled:!0}}),this.network.fit({maxZoomLevel:3})}):setTimeout(()=>{this.network&&this.network.fit({maxZoomLevel:3})},100),this.network.on("dragEnd",o=>{if(o.nodes.length>0){let d=this.network.getPositions(o.nodes),a=o.nodes.map(l=>({id:l,x:d[l].x,y:d[l].y,fixed:{x:!0,y:!0}}));this.nodesDataSet.update(a)}}),this.setupNodeExpansion(),this.uriToNodeId=new Map,this.nodesDataSet.get().forEach(o=>{o.uri&&this.uriToNodeId.set(o.uri,o.id)}),this.themeObserver||(this.themeObserver=qh(o=>{this.applyTheme(o)}));let n=document.createElement("div");n.className="yasgui-graph-controls",C.appendChild(n);let r=document.createElement("button");r.className="yasgui-graph-button",r.textContent="Zoom to Fit",r.onclick=()=>{this.network&&this.network.fit({maxZoomLevel:1e3,animation:{duration:300,easingFunction:"easeInOutQuad"}})},n.appendChild(r);let s=document.createElement("button");s.className="yasgui-graph-button yasgui-graph-settings-button",s.setAttribute("aria-label","Graph settings"),s.innerHTML=`<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
910
+ <path d="M8 10.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z"/>
911
+ <path d="M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.434.901-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.892 3.434-.901 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.892-1.64-.901-3.434-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52l-.094-.319zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.474l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115l.094-.319z"/>
912
+ </svg> Settings`,s.onclick=()=>{this.toggleSettingsPanel(C)},n.appendChild(s),e&&this.toggleSettingsPanel(C)}catch(g){console.error("Error rendering graph:",g);let t=document.createElement("div");t.className="yasgui-graph-plugin-error",t.textContent="Error rendering graph. See console for details.",this.yasr.resultsEl.appendChild(t)}}setupHtmlTooltips(e){if(!this.network)return;let g=null;this.network.on("hoverNode",t=>{g&&(clearTimeout(g),g=null);let A=t.node,C=this.nodesDataSet.get(A);C&&C.title&&this.showHtmlTooltip(e,C.title,t.pointer.DOM)}),this.network.on("hoverEdge",t=>{g&&(clearTimeout(g),g=null);let A=t.edge,C=this.edgesDataSet.get(A);C&&C.title&&this.showHtmlTooltip(e,C.title,t.pointer.DOM)}),this.network.on("blurNode",()=>{g=window.setTimeout(()=>{this.hideHtmlTooltipIfNotHovered(e)},200)}),this.network.on("blurEdge",()=>{g=window.setTimeout(()=>{this.hideHtmlTooltipIfNotHovered(e)},200)}),this.network.on("dragStart",()=>{g&&(clearTimeout(g),g=null),this.hideHtmlTooltip(e)}),this.network.on("zoom",()=>{g&&(clearTimeout(g),g=null),this.hideHtmlTooltip(e)})}showHtmlTooltip(e,g,t){this.hideHtmlTooltip(e);let A=document.createElement("div");A.className="yasgui-graph-tooltip-container",A.innerHTML=g,A.style.position="absolute",A.style.left=`${t.x+10}px`,A.style.top=`${t.y+10}px`,A.style.zIndex="1000",A.addEventListener("mouseleave",()=>{this.hideHtmlTooltip(e)}),e.appendChild(A);let C=A.getBoundingClientRect(),i=e.getBoundingClientRect();C.right>i.right&&(A.style.left=`${t.x-C.width-10}px`),C.bottom>i.bottom&&(A.style.top=`${t.y-C.height-10}px`)}hideHtmlTooltip(e){let g=e.querySelector(".yasgui-graph-tooltip-container");g&&g.remove()}hideHtmlTooltipIfNotHovered(e){let g=e.querySelector(".yasgui-graph-tooltip-container");g&&(g.matches(":hover")||g.remove())}applyTheme(e){if(!this.network||!this.nodesDataSet||!this.triples||!this.prefixMap)return;this.currentTheme=e;let g=dC(e),t={};this.nodesDataSet.get().forEach(r=>{var o,d;(r.fixed===!0||typeof r.fixed=="object"&&((o=r.fixed)!=null&&o.x)&&((d=r.fixed)!=null&&d.y))&&r.x!==void 0&&r.y!==void 0&&(t[r.id]={x:r.x,y:r.y})});let{nodes:A,edges:C}=BA(this.triples,this.prefixMap,g,this.settings);this.nodesDataSet.clear(),this.nodesDataSet.add(A),this.edgesDataSet.clear(),this.edgesDataSet.add(C);let i=Object.keys(t);if(i.length>0){let r=i.map(s=>({id:s,x:t[s].x,y:t[s].y,fixed:{x:!0,y:!0}}));this.nodesDataSet.update(r)}let n=cC(g,this.settings);this.network.setOptions(n),this.applyCanvasBackground(g.background)}applyCanvasBackground(e){this.network&&this.network.body&&this.network.body.container&&this.network.body.container.style.setProperty("--yasgui-graph-canvas-bg",e)}setupContainerResize(e){let g=e.parentElement;if(!g)return;let t=()=>{let A=g.clientHeight;A>0&&(e.style.height=`${A}px`,this.network&&this.network.fit({maxZoomLevel:1e3}))};t(),this.resizeObserver=new ResizeObserver(()=>{t()}),this.resizeObserver.observe(g)}toggleSettingsPanel(e){let g=e.querySelector(".yasgui-graph-settings-panel");if(g)g.remove(),this.settingsPanelOpen=!1,this.removeClickOutsideHandler();else{let t=this.createSettingsPanel(e);e.appendChild(t),this.settingsPanelOpen=!0,this.setupClickOutsideHandler(e,t)}}setupClickOutsideHandler(e,g){this.removeClickOutsideHandler(),this.clickOutsideHandler=t=>{let A=t.target;!g.contains(A)&&!this.isSettingsButton(A)&&this.toggleSettingsPanel(e)},setTimeout(()=>{document.addEventListener("click",this.clickOutsideHandler)},100)}removeClickOutsideHandler(){this.clickOutsideHandler&&(document.removeEventListener("click",this.clickOutsideHandler),this.clickOutsideHandler=null)}isSettingsButton(e){let g=e;for(;g;){if(g instanceof Element&&g.classList.contains("yasgui-graph-settings-button"))return!0;g=g.parentNode}return!1}createSettingsPanel(e){let g=document.createElement("div");g.className="yasgui-graph-settings-panel",g.setAttribute("role","dialog"),g.setAttribute("aria-label","Graph settings");let t=document.createElement("div");t.className="yasgui-graph-settings-title",t.textContent="Graph Settings",g.appendChild(t);let A=r=>{let s=document.createElement("div");s.className="yasgui-graph-settings-section",s.textContent=r,g.appendChild(s)},C=(r,s,o)=>{let d=document.createElement("label");d.className="yasgui-graph-settings-row";let a=document.createElement("input");a.type="checkbox",a.checked=s,a.addEventListener("change",()=>o(a.checked));let l=document.createElement("span");l.textContent=r,d.appendChild(a),d.appendChild(l),g.appendChild(d)},i=(r,s,o,d)=>{let a=document.createElement("div");a.className="yasgui-graph-settings-row";let l=document.createElement("span");l.textContent=r;let h=document.createElement("select");h.className="yasgui-graph-settings-select",s.forEach(c=>{let f=document.createElement("option");f.value=c.value,f.textContent=c.label,c.value===o&&(f.selected=!0),h.appendChild(f)}),h.addEventListener("change",()=>d(h.value)),a.appendChild(l),a.appendChild(h),g.appendChild(a)},n=()=>{Ac(this.settings),this.draw()};return A("Arrows"),i("Style",[{value:"curved",label:"Curved"},{value:"straight",label:"Straight"}],this.settings.edgeStyle,r=>{this.settings.edgeStyle=r,n()}),A("Predicate display"),i("Display",[{value:"label",label:"Label (prefixed URI)"},{value:"icon",label:"Icon / symbol"},{value:"none",label:"Hidden"}],this.settings.predicateDisplay,r=>{this.settings.predicateDisplay=r,n()}),A("Compact mode"),C("Compact mode",this.settings.compactMode,r=>{this.settings.compactMode=r,n()}),A("Display"),C("Show node labels",this.settings.showNodeLabels,r=>{this.settings.showNodeLabels=r,n()}),C("Enable physics",this.settings.physicsEnabled,r=>{this.settings.physicsEnabled=r,n()}),i("Node size",[{value:"small",label:"Small"},{value:"medium",label:"Medium"},{value:"large",label:"Large"}],this.settings.nodeSize,r=>{this.settings.nodeSize=r,n()}),g}setupNodeExpansion(){this.network&&this.network.on("doubleClick",e=>{if(e.nodes.length===0)return;let g=e.nodes[0],t=this.nodesDataSet.get(g);t&&t.uri&&!t.uri.startsWith("_:")&&this.expandNode(t.uri)})}async expandNode(e){if(!this.yasr.executeQuery){console.warn("yasgui-graph-plugin: background query execution not available (yasr.executeQuery is not configured)");return}if(!this.triples||!this.prefixMap)return;this.expansionAbortController&&this.expansionAbortController.abort();let g=new AbortController;this.expansionAbortController=g;let t=this.uriToNodeId.get(e),A,C;if(t!==void 0){let n=this.nodesDataSet.get(t);n&&(A=n.color,C=n.borderWidth),this.nodesDataSet.update({id:t,borderWidth:s5,color:typeof A=="object"&&A!==null?{...A,border:Ic}:{border:Ic,background:A!=null?A:void 0}})}let i=n=>{t!==void 0&&this.nodesDataSet.update({id:t,borderWidth:n,color:A})};try{let n=await this.yasr.executeQuery(`DESCRIBE <${e}>`,{acceptHeader:"application/sparql-results+json",signal:g.signal});if(g.signal.aborted){i(C!=null?C:lC);return}let r=await Yr(n);if(g.signal.aborted){i(C!=null?C:lC);return}let s=new Set(this.triples.map(d=>`${d.subject}|${d.predicate}|${d.object.value}`)),o=r.filter(d=>!s.has(`${d.subject}|${d.predicate}|${d.object.value}`));o.length>0&&(this.triples=[...this.triples,...o],this.mergeNewTriples()),i(o5)}catch(n){if((n==null?void 0:n.name)==="AbortError"){i(C!=null?C:lC);return}console.error("yasgui-graph-plugin: error expanding node",e,n),i(C!=null?C:lC)}}mergeNewTriples(){if(!this.triples||!this.prefixMap||!this.nodesDataSet||!this.edgesDataSet)return;let e=dC(this.currentTheme),{nodes:g,edges:t}=BA(this.triples,this.prefixMap,e,this.settings),A=new Set(this.nodesDataSet.get().map(r=>r.fullValue)),C=g.filter(r=>!A.has(r.fullValue)),i=new Set(this.edgesDataSet.get().map(r=>`${r.from}|${r.predicate}|${r.to}`)),n=t.filter(r=>!i.has(`${r.from}|${r.predicate}|${r.to}`));C.length>0&&(this.nodesDataSet.add(C),C.forEach(r=>{r.uri!=null&&this.uriToNodeId.set(r.uri,r.id)})),n.length>0&&this.edgesDataSet.add(n)}getIcon(){let e=document.createElement("div");return e.className="yasgui-graph-icon",e.setAttribute("aria-label","Graph visualization"),e.innerHTML=`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
909
913
  <circle cx="3" cy="3" r="2" />
910
914
  <circle cx="13" cy="3" r="2" />
911
915
  <circle cx="8" cy="13" r="2" />
912
916
  <line x1="4.5" y1="4" x2="7" y2="11.5" stroke="currentColor" stroke-width="1.5" />
913
917
  <line x1="11.5" y1="4" x2="9" y2="11.5" stroke="currentColor" stroke-width="1.5" />
914
918
  <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.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.network&&(this.network.destroy(),this.network=null)}},Br=Fr;typeof window!="undefined"&&window.Yasgui&&window.Yasgui.Yasr&&window.Yasgui.Yasr.registerPlugin("Graph",Br);var VM=Br;return Hh(jM);})();
919
+ </svg>`,e}destroy(){this.removeClickOutsideHandler(),this.expansionAbortController&&(this.expansionAbortController.abort(),this.expansionAbortController=null),this.themeObserver&&(this.themeObserver.disconnect(),this.themeObserver=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.network&&(this.network.destroy(),this.network=null)}},jr=Gr;typeof window!="undefined"&&window.Yasgui&&window.Yasgui.Yasr&&window.Yasgui.Yasr.registerPlugin("Graph",jr);var a5=jr;return ac(d5);})();
916
920
  /*! Bundled license information:
917
921
 
918
922
  vis-network/standalone/esm/vis-network.js: