/** * vis-network * https://visjs.github.io/vis-network/ * * A dynamic, browser-based visualization library. * * @version 9.1.8 * @date 2023-10-15T18:19:22.998Z * * @copyright (c) 2011-2017 Almende B.V, http://almende.com * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs * * @license * vis.js is dual licensed under both * * 1. The Apache 2.0 License * http://www.apache.org/licenses/LICENSE-2.0 * * and * * 2. The MIT License * http://opensource.org/licenses/MIT * * vis.js may be distributed under either license. */ !function(g,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((g="undefined"!=typeof globalThis?globalThis:g||self).vis=g.vis||{})}(this,(function(g){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function A(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}var e=function(g){return g&&g.Math===Math&&g},C=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||function(){return this}()||t||Function("return this")(),I=function(g){try{return!!g()}catch(g){return!0}},i=!I((function(){var g=function(){}.bind();return"function"!=typeof g||g.hasOwnProperty("prototype")})),o=i,n=Function.prototype,r=n.apply,s=n.call,a="object"==typeof Reflect&&Reflect.apply||(o?s.bind(r):function(){return s.apply(r,arguments)}),d=i,h=Function.prototype,l=h.call,c=d&&h.bind.bind(l,l),u=d?c:function(g){return function(){return l.apply(g,arguments)}},f=u,p=f({}.toString),v=f("".slice),y=function(g){return v(p(g),8,-1)},m=y,b=u,w=function(g){if("Function"===m(g))return b(g)},k="object"==typeof document&&document.all,x={all:k,IS_HTMLDDA:void 0===k&&void 0!==k},E=x.all,O=x.IS_HTMLDDA?function(g){return"function"==typeof g||g===E}:function(g){return"function"==typeof g},T={},D=!I((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),N=i,R=Function.prototype.call,P=N?R.bind(R):function(){return R.apply(R,arguments)},M={},B={}.propertyIsEnumerable,z=Object.getOwnPropertyDescriptor,S=z&&!B.call({1:2},1);M.f=S?function(g){var t=z(this,g);return!!t&&t.enumerable}:B;var Z,F,G=function(g,t){return{enumerable:!(1&g),configurable:!(2&g),writable:!(4&g),value:t}},j=I,L=y,V=Object,Y=u("".split),W=j((function(){return!V("z").propertyIsEnumerable(0)}))?function(g){return"String"===L(g)?Y(g,""):V(g)}:V,Q=function(g){return null==g},U=Q,_=TypeError,K=function(g){if(U(g))throw new _("Can't call method on "+g);return g},H=W,X=K,J=function(g){return H(X(g))},q=O,$=x.all,gg=x.IS_HTMLDDA?function(g){return"object"==typeof g?null!==g:q(g)||g===$}:function(g){return"object"==typeof g?null!==g:q(g)},tg={},Ag=tg,eg=C,Cg=O,Ig=function(g){return Cg(g)?g:void 0},ig=function(g,t){return arguments.length<2?Ig(Ag[g])||Ig(eg[g]):Ag[g]&&Ag[g][t]||eg[g]&&eg[g][t]},og=u({}.isPrototypeOf),ng="undefined"!=typeof navigator&&String(navigator.userAgent)||"",rg=C,sg=ng,ag=rg.process,dg=rg.Deno,hg=ag&&ag.versions||dg&&dg.version,lg=hg&&hg.v8;lg&&(F=(Z=lg.split("."))[0]>0&&Z[0]<4?1:+(Z[0]+Z[1])),!F&&sg&&(!(Z=sg.match(/Edge\/(\d+)/))||Z[1]>=74)&&(Z=sg.match(/Chrome\/(\d+)/))&&(F=+Z[1]);var cg=F,ug=cg,fg=I,pg=C.String,vg=!!Object.getOwnPropertySymbols&&!fg((function(){var g=Symbol("symbol detection");return!pg(g)||!(Object(g)instanceof Symbol)||!Symbol.sham&&ug&&ug<41})),yg=vg&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,mg=ig,bg=O,wg=og,kg=Object,xg=yg?function(g){return"symbol"==typeof g}:function(g){var t=mg("Symbol");return bg(t)&&wg(t.prototype,kg(g))},Eg=String,Og=function(g){try{return Eg(g)}catch(g){return"Object"}},Tg=O,Dg=Og,Ng=TypeError,Rg=function(g){if(Tg(g))return g;throw new Ng(Dg(g)+" is not a function")},Pg=Rg,Mg=Q,Bg=function(g,t){var A=g[t];return Mg(A)?void 0:Pg(A)},zg=P,Sg=O,Zg=gg,Fg=TypeError,Gg={exports:{}},jg=C,Lg=Object.defineProperty,Vg=function(g,t){try{Lg(jg,g,{value:t,configurable:!0,writable:!0})}catch(A){jg[g]=t}return t},Yg="__core-js_shared__",Wg=C[Yg]||Vg(Yg,{}),Qg=Wg;(Gg.exports=function(g,t){return Qg[g]||(Qg[g]=void 0!==t?t:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"© 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 Ug=Gg.exports,_g=K,Kg=Object,Hg=function(g){return Kg(_g(g))},Xg=Hg,Jg=u({}.hasOwnProperty),qg=Object.hasOwn||function(g,t){return Jg(Xg(g),t)},$g=u,gt=0,tt=Math.random(),At=$g(1..toString),et=function(g){return"Symbol("+(void 0===g?"":g)+")_"+At(++gt+tt,36)},Ct=Ug,It=qg,it=et,ot=vg,nt=yg,rt=C.Symbol,st=Ct("wks"),at=nt?rt.for||rt:rt&&rt.withoutSetter||it,dt=function(g){return It(st,g)||(st[g]=ot&&It(rt,g)?rt[g]:at("Symbol."+g)),st[g]},ht=P,lt=gg,ct=xg,ut=Bg,ft=function(g,t){var A,e;if("string"===t&&Sg(A=g.toString)&&!Zg(e=zg(A,g)))return e;if(Sg(A=g.valueOf)&&!Zg(e=zg(A,g)))return e;if("string"!==t&&Sg(A=g.toString)&&!Zg(e=zg(A,g)))return e;throw new Fg("Can't convert object to primitive value")},pt=TypeError,vt=dt("toPrimitive"),yt=function(g,t){if(!lt(g)||ct(g))return g;var A,e=ut(g,vt);if(e){if(void 0===t&&(t="default"),A=ht(e,g,t),!lt(A)||ct(A))return A;throw new pt("Can't convert object to primitive value")}return void 0===t&&(t="number"),ft(g,t)},mt=xg,bt=function(g){var t=yt(g,"string");return mt(t)?t:t+""},wt=gg,kt=C.document,xt=wt(kt)&&wt(kt.createElement),Et=function(g){return xt?kt.createElement(g):{}},Ot=Et,Tt=!D&&!I((function(){return 7!==Object.defineProperty(Ot("div"),"a",{get:function(){return 7}}).a})),Dt=D,Nt=P,Rt=M,Pt=G,Mt=J,Bt=bt,zt=qg,St=Tt,Zt=Object.getOwnPropertyDescriptor;T.f=Dt?Zt:function(g,t){if(g=Mt(g),t=Bt(t),St)try{return Zt(g,t)}catch(g){}if(zt(g,t))return Pt(!Nt(Rt.f,g,t),g[t])};var Ft=I,Gt=O,jt=/#|\.prototype\./,Lt=function(g,t){var A=Yt[Vt(g)];return A===Qt||A!==Wt&&(Gt(t)?Ft(t):!!t)},Vt=Lt.normalize=function(g){return String(g).replace(jt,".").toLowerCase()},Yt=Lt.data={},Wt=Lt.NATIVE="N",Qt=Lt.POLYFILL="P",Ut=Lt,_t=Rg,Kt=i,Ht=w(w.bind),Xt=function(g,t){return _t(g),void 0===t?g:Kt?Ht(g,t):function(){return g.apply(t,arguments)}},Jt={},qt=D&&I((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),$t=gg,gA=String,tA=TypeError,AA=function(g){if($t(g))return g;throw new tA(gA(g)+" is not an object")},eA=D,CA=Tt,IA=qt,iA=AA,oA=bt,nA=TypeError,rA=Object.defineProperty,sA=Object.getOwnPropertyDescriptor,aA="enumerable",dA="configurable",hA="writable";Jt.f=eA?IA?function(g,t,A){if(iA(g),t=oA(t),iA(A),"function"==typeof g&&"prototype"===t&&"value"in A&&hA in A&&!A[hA]){var e=sA(g,t);e&&e[hA]&&(g[t]=A.value,A={configurable:dA in A?A[dA]:e[dA],enumerable:aA in A?A[aA]:e[aA],writable:!1})}return rA(g,t,A)}:rA:function(g,t,A){if(iA(g),t=oA(t),iA(A),CA)try{return rA(g,t,A)}catch(g){}if("get"in A||"set"in A)throw new nA("Accessors not supported");return"value"in A&&(g[t]=A.value),g};var lA=Jt,cA=G,uA=D?function(g,t,A){return lA.f(g,t,cA(1,A))}:function(g,t,A){return g[t]=A,g},fA=C,pA=a,vA=w,yA=O,mA=T.f,bA=Ut,wA=tg,kA=Xt,xA=uA,EA=qg,OA=function(g){var t=function(A,e,C){if(this instanceof t){switch(arguments.length){case 0:return new g;case 1:return new g(A);case 2:return new g(A,e)}return new g(A,e,C)}return pA(g,this,arguments)};return t.prototype=g.prototype,t},TA=function(g,t){var A,e,C,I,i,o,n,r,s,a=g.target,d=g.global,h=g.stat,l=g.proto,c=d?fA:h?fA[a]:(fA[a]||{}).prototype,u=d?wA:wA[a]||xA(wA,a,{})[a],f=u.prototype;for(I in t)e=!(A=bA(d?I:a+(h?".":"#")+I,g.forced))&&c&&EA(c,I),o=u[I],e&&(n=g.dontCallGetSet?(s=mA(c,I))&&s.value:c[I]),i=e&&n?n:t[I],e&&typeof o==typeof i||(r=g.bind&&e?kA(i,fA):g.wrap&&e?OA(i):l&&yA(i)?vA(i):i,(g.sham||i&&i.sham||o&&o.sham)&&xA(r,"sham",!0),xA(u,I,r),l&&(EA(wA,C=a+"Prototype")||xA(wA,C,{}),xA(wA[C],I,i),g.real&&f&&(A||!f[I])&&xA(f,I,i)))},DA=Math.ceil,NA=Math.floor,RA=Math.trunc||function(g){var t=+g;return(t>0?NA:DA)(t)},PA=function(g){var t=+g;return t!=t||0===t?0:RA(t)},MA=PA,BA=Math.max,zA=Math.min,SA=function(g,t){var A=MA(g);return A<0?BA(A+t,0):zA(A,t)},ZA=PA,FA=Math.min,GA=function(g){return g>0?FA(ZA(g),9007199254740991):0},jA=function(g){return GA(g.length)},LA=J,VA=SA,YA=jA,WA=function(g){return function(t,A,e){var C,I=LA(t),i=YA(I),o=VA(e,i);if(g&&A!=A){for(;i>o;)if((C=I[o++])!=C)return!0}else for(;i>o;o++)if((g||o in I)&&I[o]===A)return g||o||0;return!g&&-1}},QA={includes:WA(!0),indexOf:WA(!1)},UA={},_A=qg,KA=J,HA=QA.indexOf,XA=UA,JA=u([].push),qA=function(g,t){var A,e=KA(g),C=0,I=[];for(A in e)!_A(XA,A)&&_A(e,A)&&JA(I,A);for(;t.length>C;)_A(e,A=t[C++])&&(~HA(I,A)||JA(I,A));return I},$A=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ge=qA,te=$A,Ae=Object.keys||function(g){return ge(g,te)},ee={};ee.f=Object.getOwnPropertySymbols;var Ce=D,Ie=u,ie=P,oe=I,ne=Ae,re=ee,se=M,ae=Hg,de=W,he=Object.assign,le=Object.defineProperty,ce=Ie([].concat),ue=!he||oe((function(){if(Ce&&1!==he({b:1},he(le({},"a",{enumerable:!0,get:function(){le(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var g={},t={},A=Symbol("assign detection"),e="abcdefghijklmnopqrst";return g[A]=7,e.split("").forEach((function(g){t[g]=g})),7!==he({},g)[A]||ne(he({},t)).join("")!==e}))?function(g,t){for(var A=ae(g),e=arguments.length,C=1,I=re.f,i=se.f;e>C;)for(var o,n=de(arguments[C++]),r=I?ce(ne(n),I(n)):ne(n),s=r.length,a=0;s>a;)o=r[a++],Ce&&!ie(i,n,o)||(A[o]=n[o]);return A}:he,fe=ue;TA({target:"Object",stat:!0,arity:2,forced:Object.assign!==fe},{assign:fe});var pe=A(tg.Object.assign),ve=u([].slice),ye=u,me=Rg,be=gg,we=qg,ke=ve,xe=i,Ee=Function,Oe=ye([].concat),Te=ye([].join),De={},Ne=xe?Ee.bind:function(g){var t=me(this),A=t.prototype,e=ke(arguments,1),C=function(){var A=Oe(e,ke(arguments));return this instanceof C?function(g,t,A){if(!we(De,t)){for(var e=[],C=0;C=.1;)(l=+I[a++%i])>s&&(l=s),h=Math.sqrt(l*l/(1+r*r)),t+=h=o<0?-h:h,A+=r*h,!0===d?g.lineTo(t,A):g.moveTo(t,A),s-=l,d=!d}var Ue={circle:Le,dashedLine:Qe,database:We,diamond:function(g,t,A,e){g.beginPath(),g.lineTo(t,A+e),g.lineTo(t+e,A),g.lineTo(t,A-e),g.lineTo(t-e,A),g.closePath()},ellipse:Ye,ellipse_vis:Ye,hexagon:function(g,t,A,e){g.beginPath();var C=2*Math.PI/6;g.moveTo(t+e,A);for(var I=1;I<6;I++)g.lineTo(t+e*Math.cos(C*I),A+e*Math.sin(C*I));g.closePath()},roundRect:Ve,square:function(g,t,A,e){g.beginPath(),g.rect(t-e,A-e,2*e,2*e),g.closePath()},star:function(g,t,A,e){g.beginPath(),A+=.1*(e*=.82);for(var C=0;C<10;C++){var I=C%2==0?1.3*e:.5*e;g.lineTo(t+I*Math.sin(2*C*Math.PI/10),A-I*Math.cos(2*C*Math.PI/10))}g.closePath()},triangle:function(g,t,A,e){g.beginPath(),A+=.275*(e*=1.15);var C=2*e,I=C/2,i=Math.sqrt(3)/6*C,o=Math.sqrt(C*C-I*I);g.moveTo(t,A-(o-i)),g.lineTo(t+I,A+i),g.lineTo(t-I,A+i),g.lineTo(t,A-(o-i)),g.closePath()},triangleDown:function(g,t,A,e){g.beginPath(),A-=.275*(e*=1.15);var C=2*e,I=C/2,i=Math.sqrt(3)/6*C,o=Math.sqrt(C*C-I*I);g.moveTo(t,A+(o-i)),g.lineTo(t+I,A-i),g.lineTo(t-I,A-i),g.lineTo(t,A+(o-i)),g.closePath()}};function _e(g,t){void 0===t&&(t={});var A=t.insertAt;if(g&&"undefined"!=typeof document){var e=document.head||document.getElementsByTagName("head")[0],C=document.createElement("style");C.type="text/css","top"===A&&e.firstChild?e.insertBefore(C,e.firstChild):e.appendChild(C),C.styleSheet?C.styleSheet.cssText=g:C.appendChild(document.createTextNode(g))}}_e(".vis-overlay{bottom:0;left:0;position:absolute;right:0;top:0;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}");_e(".vis [class*=span]{min-height:0;width:auto}");_e('div.vis-color-picker{background-color:#fff;border-radius:15px;box-shadow:0 0 10px 0 rgba(0,0,0,.5);display:none;height:444px;left:30px;margin-left:30px;margin-top:-140px;padding:10px;position:absolute;top:0;width:310px;z-index:1}div.vis-color-picker div.vis-arrow{left:5px;position:absolute;top:147px}div.vis-color-picker div.vis-arrow:after,div.vis-color-picker div.vis-arrow:before{border:solid transparent;content:" ";height:0;pointer-events:none;position:absolute;right:100%;top:50%;width:0}div.vis-color-picker div.vis-arrow:after{border-color:hsla(0,0%,100%,0) #fff hsla(0,0%,100%,0) hsla(0,0%,100%,0);border-width:30px;margin-top:-30px}div.vis-color-picker div.vis-color{cursor:pointer;height:289px;position:absolute;width:289px}div.vis-color-picker div.vis-brightness{position:absolute;top:313px}div.vis-color-picker div.vis-opacity{position:absolute;top:350px}div.vis-color-picker div.vis-selector{background:#4c4c4c;background:-moz-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4c4c4c),color-stop(12%,#595959),color-stop(25%,#666),color-stop(39%,#474747),color-stop(50%,#2c2c2c),color-stop(51%,#000),color-stop(60%,#111),color-stop(76%,#2b2b2b),color-stop(91%,#1c1c1c),color-stop(100%,#131313));background:-webkit-linear-gradient(top,#4c4c4c,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313);background:-o-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-ms-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:linear-gradient(180deg,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313);border:1px solid #fff;border-radius:15px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#4c4c4c",endColorstr="#131313",GradientType=0);height:15px;left:137px;position:absolute;top:137px;width:15px}div.vis-color-picker div.vis-new-color{left:159px;padding-right:2px;text-align:right}div.vis-color-picker div.vis-initial-color,div.vis-color-picker div.vis-new-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;color:rgba(0,0,0,.4);font-size:10px;height:20px;line-height:20px;position:absolute;top:380px;vertical-align:middle;width:140px}div.vis-color-picker div.vis-initial-color{left:10px;padding-left:2px;text-align:left}div.vis-color-picker div.vis-label{left:10px;position:absolute;width:300px}div.vis-color-picker div.vis-label.vis-brightness{top:300px}div.vis-color-picker div.vis-label.vis-opacity{top:338px}div.vis-color-picker div.vis-button{background-color:#f7f7f7;border:2px solid #d9d9d9;border-radius:10px;cursor:pointer;height:25px;line-height:25px;position:absolute;text-align:center;top:410px;vertical-align:middle;width:68px}div.vis-color-picker div.vis-button.vis-cancel{left:5px}div.vis-color-picker div.vis-button.vis-load{left:82px}div.vis-color-picker div.vis-button.vis-apply{left:159px}div.vis-color-picker div.vis-button.vis-save{left:236px}div.vis-color-picker input.vis-range{height:20px;width:290px}');_e('div.vis-configuration{display:block;float:left;font-size:12px;position:relative}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper:after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;display:block;left:10px;margin-top:20px;padding-left:5px;width:495px}div.vis-configuration.vis-config-button{background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;cursor:pointer;display:block;height:25px;left:10px;line-height:25px;margin-bottom:30px;margin-top:20px;padding-left:5px;vertical-align:middle;width:495px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;height:25px;line-height:25px;vertical-align:middle;width:495px}div.vis-configuration.vis-config-item.vis-config-s2{background-color:#f7f8fa;border-radius:3px;left:10px;padding-left:5px}div.vis-configuration.vis-config-item.vis-config-s3{background-color:#e4e9f0;border-radius:3px;left:20px;padding-left:5px}div.vis-configuration.vis-config-item.vis-config-s4{background-color:#cfd8e6;border-radius:3px;left:30px;padding-left:5px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{height:25px;line-height:25px;width:120px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{border:1px solid #444;border-radius:2px;cursor:pointer;height:19px;margin:0;padding:0;top:1px;width:30px}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{margin:0;padding:1px;pointer-events:none;position:relative;top:-5px;width:60px}input.vis-configuration.vis-config-range{-webkit-appearance:none;background-color:transparent;border:0 solid #fff;height:20px;width:300px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(180deg,#dedede 0,#c8c8c8 99%);border:1px solid #999;border-radius:3px;box-shadow:0 0 3px 0 #aaa;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#dedede",endColorstr="#c8c8c8",GradientType=0);height:5px;width:300px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2,#385380);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(180deg,#3876c2 0,#385380);border:1px solid #14334b;border-radius:50%;box-shadow:0 0 1px 0 #111927;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#3876c2",endColorstr="#385380",GradientType=0);height:17px;margin-top:-7px;width:17px}input.vis-configuration.vis-config-range:focus{outline:none}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(180deg,#9d9d9d 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#9d9d9d",endColorstr="#c8c8c8",GradientType=0)}input.vis-configuration.vis-config-range::-moz-range-track{background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(180deg,#dedede 0,#c8c8c8 99%);border:1px solid #999;border-radius:3px;box-shadow:0 0 3px 0 #aaa;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#dedede",endColorstr="#c8c8c8",GradientType=0);height:10px;width:300px}input.vis-configuration.vis-config-range::-moz-range-thumb{background:#385380;border:none;border-radius:50%;height:16px;width:16px}input.vis-configuration.vis-config-range:-moz-focusring{outline:1px solid #fff;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{background:transparent;border-color:transparent;border-width:6px 0;color:transparent;height:5px;width:300px}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-config-range::-ms-thumb{background:#385380;border:none;border-radius:50%;height:16px;width:16px}input.vis-configuration.vis-config-range:focus::-ms-fill-lower{background:#888}input.vis-configuration.vis-config-range:focus::-ms-fill-upper{background:#ccc}.vis-configuration-popup{background:rgba(57,76,89,.85);border:2px solid #f2faff;border-radius:4px;color:#fff;font-size:14px;height:30px;line-height:30px;position:absolute;text-align:center;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out;width:150px}.vis-configuration-popup:after,.vis-configuration-popup:before{border:solid transparent;content:" ";height:0;left:100%;pointer-events:none;position:absolute;top:50%;width:0}.vis-configuration-popup:after{border-color:rgba(136,183,213,0) rgba(136,183,213,0) rgba(136,183,213,0) rgba(57,76,89,.85);border-width:8px;margin-top:-8px}.vis-configuration-popup:before{border-color:rgba(194,225,245,0) rgba(194,225,245,0) rgba(194,225,245,0) #f2faff;border-width:12px;margin-top:-12px}');_e("div.vis-tooltip{background-color:#f5f4ed;border:1px solid #808074;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;box-shadow:3px 3px 10px rgba(0,0,0,.2);color:#000;font-family:verdana;font-size:14px;padding:5px;pointer-events:none;position:absolute;visibility:hidden;white-space:nowrap;z-index:5}");var Ke={exports:{}};!function(g){function t(g){if(g)return function(g){for(var A in t.prototype)g[A]=t.prototype[A];return g}(g)}g.exports=t,t.prototype.on=t.prototype.addEventListener=function(g,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+g]=this._callbacks["$"+g]||[]).push(t),this},t.prototype.once=function(g,t){function A(){this.off(g,A),t.apply(this,arguments)}return A.fn=t,this.on(g,A),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(g,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var A,e=this._callbacks["$"+g];if(!e)return this;if(1==arguments.length)return delete this._callbacks["$"+g],this;for(var C=0;C=o?g?"":void 0:(e=uC(I,i))<55296||e>56319||i+1===o||(C=uC(I,i+1))<56320||C>57343?g?cC(I,i):e:g?fC(I,i,i+2):C-56320+(e-55296<<10)+65536}},vC={codeAt:pC(!1),charAt:pC(!0)},yC=O,mC=C.WeakMap,bC=yC(mC)&&/native code/.test(String(mC)),wC=et,kC=Ug("keys"),xC=function(g){return kC[g]||(kC[g]=wC(g))},EC=bC,OC=C,TC=gg,DC=uA,NC=qg,RC=Wg,PC=xC,MC=UA,BC="Object already initialized",zC=OC.TypeError,SC=OC.WeakMap;if(EC||RC.state){var ZC=RC.state||(RC.state=new SC);ZC.get=ZC.get,ZC.has=ZC.has,ZC.set=ZC.set,Je=function(g,t){if(ZC.has(g))throw new zC(BC);return t.facade=g,ZC.set(g,t),t},qe=function(g){return ZC.get(g)||{}},$e=function(g){return ZC.has(g)}}else{var FC=PC("state");MC[FC]=!0,Je=function(g,t){if(NC(g,FC))throw new zC(BC);return t.facade=g,DC(g,FC,t),t},qe=function(g){return NC(g,FC)?g[FC]:{}},$e=function(g){return NC(g,FC)}}var GC={set:Je,get:qe,has:$e,enforce:function(g){return $e(g)?qe(g):Je(g,{})},getterFor:function(g){return function(t){var A;if(!TC(t)||(A=qe(t)).type!==g)throw new zC("Incompatible receiver, "+g+" required");return A}}},jC=D,LC=qg,VC=Function.prototype,YC=jC&&Object.getOwnPropertyDescriptor,WC=LC(VC,"name"),QC={EXISTS:WC,PROPER:WC&&"something"===function(){}.name,CONFIGURABLE:WC&&(!jC||jC&&YC(VC,"name").configurable)},UC={},_C=D,KC=qt,HC=Jt,XC=AA,JC=J,qC=Ae;UC.f=_C&&!KC?Object.defineProperties:function(g,t){XC(g);for(var A,e=JC(t),C=qC(t),I=C.length,i=0;I>i;)HC.f(g,A=C[i++],e[A]);return g};var $C,gI=ig("document","documentElement"),tI=AA,AI=UC,eI=$A,CI=UA,II=gI,iI=Et,oI="prototype",nI="script",rI=xC("IE_PROTO"),sI=function(){},aI=function(g){return"<"+nI+">"+g+""},dI=function(g){g.write(aI("")),g.close();var t=g.parentWindow.Object;return g=null,t},hI=function(){try{$C=new ActiveXObject("htmlfile")}catch(g){}var g,t,A;hI="undefined"!=typeof document?document.domain&&$C?dI($C):(t=iI("iframe"),A="java"+nI+":",t.style.display="none",II.appendChild(t),t.src=String(A),(g=t.contentWindow.document).open(),g.write(aI("document.F=Object")),g.close(),g.F):dI($C);for(var e=eI.length;e--;)delete hI[oI][eI[e]];return hI()};CI[rI]=!0;var lI,cI,uI,fI=Object.create||function(g,t){var A;return null!==g?(sI[oI]=tI(g),A=new sI,sI[oI]=null,A[rI]=g):A=hI(),void 0===t?A:AI.f(A,t)},pI=!I((function(){function g(){}return g.prototype.constructor=null,Object.getPrototypeOf(new g)!==g.prototype})),vI=qg,yI=O,mI=Hg,bI=pI,wI=xC("IE_PROTO"),kI=Object,xI=kI.prototype,EI=bI?kI.getPrototypeOf:function(g){var t=mI(g);if(vI(t,wI))return t[wI];var A=t.constructor;return yI(A)&&t instanceof A?A.prototype:t instanceof kI?xI:null},OI=uA,TI=function(g,t,A,e){return e&&e.enumerable?g[t]=A:OI(g,t,A),g},DI=I,NI=O,RI=gg,PI=fI,MI=EI,BI=TI,zI=dt("iterator"),SI=!1;[].keys&&("next"in(uI=[].keys())?(cI=MI(MI(uI)))!==Object.prototype&&(lI=cI):SI=!0);var ZI=!RI(lI)||DI((function(){var g={};return lI[zI].call(g)!==g}));NI((lI=ZI?{}:PI(lI))[zI])||BI(lI,zI,(function(){return this}));var FI={IteratorPrototype:lI,BUGGY_SAFARI_ITERATORS:SI},GI=oC,jI=gC?{}.toString:function(){return"[object "+GI(this)+"]"},LI=gC,VI=Jt.f,YI=uA,WI=qg,QI=jI,UI=dt("toStringTag"),_I=function(g,t,A,e){if(g){var C=A?g:g.prototype;WI(C,UI)||VI(C,UI,{configurable:!0,value:t}),e&&!LI&&YI(C,"toString",QI)}},KI={},HI=FI.IteratorPrototype,XI=fI,JI=G,qI=_I,$I=KI,gi=function(){return this},ti=u,Ai=Rg,ei=O,Ci=String,Ii=TypeError,ii=function(g,t,A){try{return ti(Ai(Object.getOwnPropertyDescriptor(g,t)[A]))}catch(g){}},oi=AA,ni=function(g){if("object"==typeof g||ei(g))return g;throw new Ii("Can't set "+Ci(g)+" as a prototype")},ri=Object.setPrototypeOf||("__proto__"in{}?function(){var g,t=!1,A={};try{(g=ii(Object.prototype,"__proto__","set"))(A,[]),t=A instanceof Array}catch(g){}return function(A,e){return oi(A),ni(e),t?g(A,e):A.__proto__=e,A}}():void 0),si=TA,ai=P,di=QC,hi=function(g,t,A,e){var C=t+" Iterator";return g.prototype=XI(HI,{next:JI(+!e,A)}),qI(g,C,!1,!0),$I[C]=gi,g},li=EI,ci=_I,ui=TI,fi=KI,pi=FI,vi=di.PROPER,yi=pi.BUGGY_SAFARI_ITERATORS,mi=dt("iterator"),bi="keys",wi="values",ki="entries",xi=function(){return this},Ei=function(g,t,A,e,C,I,i){hi(A,t,e);var o,n,r,s=function(g){if(g===C&&c)return c;if(!yi&&g&&g in h)return h[g];switch(g){case bi:case wi:case ki:return function(){return new A(this,g)}}return function(){return new A(this)}},a=t+" Iterator",d=!1,h=g.prototype,l=h[mi]||h["@@iterator"]||C&&h[C],c=!yi&&l||s(C),u="Array"===t&&h.entries||l;if(u&&(o=li(u.call(new g)))!==Object.prototype&&o.next&&(ci(o,a,!0,!0),fi[a]=xi),vi&&C===wi&&l&&l.name!==wi&&(d=!0,c=function(){return ai(l,this)}),C)if(n={values:s(wi),keys:I?c:s(bi),entries:s(ki)},i)for(r in n)(yi||d||!(r in h))&&ui(h,r,n[r]);else si({target:t,proto:!0,forced:yi||d},n);return i&&h[mi]!==c&&ui(h,mi,c,{name:C}),fi[t]=c,n},Oi=function(g,t){return{value:g,done:t}},Ti=vC.charAt,Di=sC,Ni=GC,Ri=Ei,Pi=Oi,Mi="String Iterator",Bi=Ni.set,zi=Ni.getterFor(Mi);Ri(String,"String",(function(g){Bi(this,{type:Mi,string:Di(g),index:0})}),(function(){var g,t=zi(this),A=t.string,e=t.index;return e>=A.length?Pi(void 0,!0):(g=Ti(A,e),t.index+=g.length,Pi(g,!1))}));var Si=P,Zi=AA,Fi=Bg,Gi=function(g,t,A){var e,C;Zi(g);try{if(!(e=Fi(g,"return"))){if("throw"===t)throw A;return A}e=Si(e,g)}catch(g){C=!0,e=g}if("throw"===t)throw A;if(C)throw e;return Zi(e),A},ji=AA,Li=Gi,Vi=KI,Yi=dt("iterator"),Wi=Array.prototype,Qi=function(g){return void 0!==g&&(Vi.Array===g||Wi[Yi]===g)},Ui=O,_i=Wg,Ki=u(Function.toString);Ui(_i.inspectSource)||(_i.inspectSource=function(g){return Ki(g)});var Hi=_i.inspectSource,Xi=u,Ji=I,qi=O,$i=oC,go=Hi,to=function(){},Ao=[],eo=ig("Reflect","construct"),Co=/^\s*(?:class|function)\b/,Io=Xi(Co.exec),io=!Co.test(to),oo=function(g){if(!qi(g))return!1;try{return eo(to,Ao,g),!0}catch(g){return!1}},no=function(g){if(!qi(g))return!1;switch($i(g)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return io||!!Io(Co,go(g))}catch(g){return!0}};no.sham=!0;var ro=!eo||Ji((function(){var g;return oo(oo.call)||!oo(Object)||!oo((function(){g=!0}))||g}))?no:oo,so=bt,ao=Jt,ho=G,lo=function(g,t,A){var e=so(t);e in g?ao.f(g,e,ho(0,A)):g[e]=A},co=oC,uo=Bg,fo=Q,po=KI,vo=dt("iterator"),yo=function(g){if(!fo(g))return uo(g,vo)||uo(g,"@@iterator")||po[co(g)]},mo=P,bo=Rg,wo=AA,ko=Og,xo=yo,Eo=TypeError,Oo=function(g,t){var A=arguments.length<2?xo(g):t;if(bo(A))return wo(mo(A,g));throw new Eo(ko(g)+" is not iterable")},To=Xt,Do=P,No=Hg,Ro=function(g,t,A,e){try{return e?t(ji(A)[0],A[1]):t(A)}catch(t){Li(g,"throw",t)}},Po=Qi,Mo=ro,Bo=jA,zo=lo,So=Oo,Zo=yo,Fo=Array,Go=dt("iterator"),jo=!1;try{var Lo=0,Vo={next:function(){return{done:!!Lo++}},return:function(){jo=!0}};Vo[Go]=function(){return this},Array.from(Vo,(function(){throw 2}))}catch(g){}var Yo=function(g,t){try{if(!t&&!jo)return!1}catch(g){return!1}var A=!1;try{var e={};e[Go]=function(){return{next:function(){return{done:A=!0}}}},g(e)}catch(g){}return A},Wo=function(g){var t=No(g),A=Mo(this),e=arguments.length,C=e>1?arguments[1]:void 0,I=void 0!==C;I&&(C=To(C,e>2?arguments[2]:void 0));var i,o,n,r,s,a,d=Zo(t),h=0;if(!d||this===Fo&&Po(d))for(i=Bo(t),o=A?new this(i):Fo(i);i>h;h++)a=I?C(t[h],h):t[h],zo(o,h,a);else for(s=(r=So(t,d)).next,o=A?new this:[];!(n=Do(s,r)).done;h++)a=I?Ro(r,C,[n.value,h],!0):n.value,zo(o,h,a);return o.length=h,o};TA({target:"Array",stat:!0,forced:!Yo((function(g){Array.from(g)}))},{from:Wo});var Qo=tg.Array.from,Uo=A(Qo),_o=J,Ko=KI,Ho=GC;Jt.f;var Xo=Ei,Jo=Oi,qo="Array Iterator",$o=Ho.set,gn=Ho.getterFor(qo);Xo(Array,"Array",(function(g,t){$o(this,{type:qo,target:_o(g),index:0,kind:t})}),(function(){var g=gn(this),t=g.target,A=g.kind,e=g.index++;if(!t||e>=t.length)return g.target=void 0,Jo(void 0,!0);switch(A){case"keys":return Jo(e,!1);case"values":return Jo(t[e],!1)}return Jo([e,t[e]],!1)}),"values"),Ko.Arguments=Ko.Array;var tn=yo,An={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},en=C,Cn=oC,In=uA,on=KI,nn=dt("toStringTag");for(var rn in An){var sn=en[rn],an=sn&&sn.prototype;an&&Cn(an)!==nn&&In(an,nn,rn),on[rn]=on.Array}var dn=tn,hn=A(dn),ln=A(dn);function cn(g,t){if(!(g instanceof t))throw new TypeError("Cannot call a class as a function")}var un={exports:{}},fn=TA,pn=D,vn=Jt.f;fn({target:"Object",stat:!0,forced:Object.defineProperty!==vn,sham:!pn},{defineProperty:vn});var yn=tg.Object,mn=un.exports=function(g,t,A){return yn.defineProperty(g,t,A)};yn.defineProperty.sham&&(mn.sham=!0);var bn=un.exports,wn=bn,kn=A(wn),xn=y,En=Array.isArray||function(g){return"Array"===xn(g)},On=TypeError,Tn=function(g){if(g>9007199254740991)throw On("Maximum allowed index exceeded");return g},Dn=En,Nn=ro,Rn=gg,Pn=dt("species"),Mn=Array,Bn=function(g){var t;return Dn(g)&&(t=g.constructor,(Nn(t)&&(t===Mn||Dn(t.prototype))||Rn(t)&&null===(t=t[Pn]))&&(t=void 0)),void 0===t?Mn:t},zn=function(g,t){return new(Bn(g))(0===t?0:t)},Sn=I,Zn=cg,Fn=dt("species"),Gn=function(g){return Zn>=51||!Sn((function(){var t=[];return(t.constructor={})[Fn]=function(){return{foo:1}},1!==t[g](Boolean).foo}))},jn=TA,Ln=I,Vn=En,Yn=gg,Wn=Hg,Qn=jA,Un=Tn,_n=lo,Kn=zn,Hn=Gn,Xn=cg,Jn=dt("isConcatSpreadable"),qn=Xn>=51||!Ln((function(){var g=[];return g[Jn]=!1,g.concat()[0]!==g})),$n=function(g){if(!Yn(g))return!1;var t=g[Jn];return void 0!==t?!!t:Vn(g)};jn({target:"Array",proto:!0,arity:1,forced:!qn||!Hn("concat")},{concat:function(g){var t,A,e,C,I,i=Wn(this),o=Kn(i,0),n=0;for(t=-1,e=arguments.length;tp;p++)if((o||p in c)&&(h=u(d=c[p],p,l),g))if(t)y[p]=h;else if(h)switch(g){case 3:return!0;case 5:return d;case 6:return p;case 2:Br(y,d)}else switch(g){case 4:return!1;case 7:Br(y,d)}return I?-1:e||C?C:y}},Sr={forEach:zr(0),map:zr(1),filter:zr(2),some:zr(3),every:zr(4),find:zr(5),findIndex:zr(6),filterReject:zr(7)},Zr=TA,Fr=C,Gr=P,jr=u,Lr=D,Vr=vg,Yr=I,Wr=qg,Qr=og,Ur=AA,_r=J,Kr=bt,Hr=sC,Xr=G,Jr=fI,qr=Ae,$r=gr,gs=er,ts=ee,As=T,es=Jt,Cs=UC,Is=M,is=TI,os=ur,ns=Ug,rs=UA,ss=et,as=dt,ds=fr,hs=wr,ls=Tr,cs=_I,us=GC,fs=Sr.forEach,ps=xC("hidden"),vs="Symbol",ys="prototype",ms=us.set,bs=us.getterFor(vs),ws=Object[ys],ks=Fr.Symbol,xs=ks&&ks[ys],Es=Fr.RangeError,Os=Fr.TypeError,Ts=Fr.QObject,Ds=As.f,Ns=es.f,Rs=gs.f,Ps=Is.f,Ms=jr([].push),Bs=ns("symbols"),zs=ns("op-symbols"),Ss=ns("wks"),Zs=!Ts||!Ts[ys]||!Ts[ys].findChild,Fs=function(g,t,A){var e=Ds(ws,t);e&&delete ws[t],Ns(g,t,A),e&&g!==ws&&Ns(ws,t,e)},Gs=Lr&&Yr((function(){return 7!==Jr(Ns({},"a",{get:function(){return Ns(this,"a",{value:7}).a}})).a}))?Fs:Ns,js=function(g,t){var A=Bs[g]=Jr(xs);return ms(A,{type:vs,tag:g,description:t}),Lr||(A.description=t),A},Ls=function(g,t,A){g===ws&&Ls(zs,t,A),Ur(g);var e=Kr(t);return Ur(A),Wr(Bs,e)?(A.enumerable?(Wr(g,ps)&&g[ps][e]&&(g[ps][e]=!1),A=Jr(A,{enumerable:Xr(0,!1)})):(Wr(g,ps)||Ns(g,ps,Xr(1,{})),g[ps][e]=!0),Gs(g,e,A)):Ns(g,e,A)},Vs=function(g,t){Ur(g);var A=_r(t),e=qr(A).concat(Us(A));return fs(e,(function(t){Lr&&!Gr(Ys,A,t)||Ls(g,t,A[t])})),g},Ys=function(g){var t=Kr(g),A=Gr(Ps,this,t);return!(this===ws&&Wr(Bs,t)&&!Wr(zs,t))&&(!(A||!Wr(this,t)||!Wr(Bs,t)||Wr(this,ps)&&this[ps][t])||A)},Ws=function(g,t){var A=_r(g),e=Kr(t);if(A!==ws||!Wr(Bs,e)||Wr(zs,e)){var C=Ds(A,e);return!C||!Wr(Bs,e)||Wr(A,ps)&&A[ps][e]||(C.enumerable=!0),C}},Qs=function(g){var t=Rs(_r(g)),A=[];return fs(t,(function(g){Wr(Bs,g)||Wr(rs,g)||Ms(A,g)})),A},Us=function(g){var t=g===ws,A=Rs(t?zs:_r(g)),e=[];return fs(A,(function(g){!Wr(Bs,g)||t&&!Wr(ws,g)||Ms(e,Bs[g])})),e};Vr||(ks=function(){if(Qr(xs,this))throw new Os("Symbol is not a constructor");var g=arguments.length&&void 0!==arguments[0]?Hr(arguments[0]):void 0,t=ss(g),A=function(g){this===ws&&Gr(A,zs,g),Wr(this,ps)&&Wr(this[ps],t)&&(this[ps][t]=!1);var e=Xr(1,g);try{Gs(this,t,e)}catch(g){if(!(g instanceof Es))throw g;Fs(this,t,e)}};return Lr&&Zs&&Gs(ws,t,{configurable:!0,set:A}),js(t,g)},is(xs=ks[ys],"toString",(function(){return bs(this).tag})),is(ks,"withoutSetter",(function(g){return js(ss(g),g)})),Is.f=Ys,es.f=Ls,Cs.f=Vs,As.f=Ws,$r.f=gs.f=Qs,ts.f=Us,ds.f=function(g){return js(as(g),g)},Lr&&os(xs,"description",{configurable:!0,get:function(){return bs(this).description}})),Zr({global:!0,constructor:!0,wrap:!0,forced:!Vr,sham:!Vr},{Symbol:ks}),fs(qr(Ss),(function(g){hs(g)})),Zr({target:vs,stat:!0,forced:!Vr},{useSetter:function(){Zs=!0},useSimple:function(){Zs=!1}}),Zr({target:"Object",stat:!0,forced:!Vr,sham:!Lr},{create:function(g,t){return void 0===t?Jr(g):Vs(Jr(g),t)},defineProperty:Ls,defineProperties:Vs,getOwnPropertyDescriptor:Ws}),Zr({target:"Object",stat:!0,forced:!Vr},{getOwnPropertyNames:Qs}),ls(),cs(ks,vs),rs[ps]=!0;var _s=vg&&!!Symbol.for&&!!Symbol.keyFor,Ks=TA,Hs=ig,Xs=qg,Js=sC,qs=Ug,$s=_s,ga=qs("string-to-symbol-registry"),ta=qs("symbol-to-string-registry");Ks({target:"Symbol",stat:!0,forced:!$s},{for:function(g){var t=Js(g);if(Xs(ga,t))return ga[t];var A=Hs("Symbol")(t);return ga[t]=A,ta[A]=t,A}});var Aa=TA,ea=qg,Ca=xg,Ia=Og,ia=_s,oa=Ug("symbol-to-string-registry");Aa({target:"Symbol",stat:!0,forced:!ia},{keyFor:function(g){if(!Ca(g))throw new TypeError(Ia(g)+" is not a symbol");if(ea(oa,g))return oa[g]}});var na=En,ra=O,sa=y,aa=sC,da=u([].push),ha=TA,la=ig,ca=a,ua=P,fa=u,pa=I,va=O,ya=xg,ma=ve,ba=function(g){if(ra(g))return g;if(na(g)){for(var t=g.length,A=[],e=0;eg.length)&&(t=g.length);for(var A=0,e=new Array(t);A1?arguments[1]:void 0)}});var Mh=Me("Array").map,Bh=og,zh=Mh,Sh=Array.prototype,Zh=function(g){var t=g.map;return g===Sh||Bh(Sh,g)&&t===Sh.map?zh:t},Fh=A(Zh),Gh=Hg,jh=Ae;TA({target:"Object",stat:!0,forced:I((function(){jh(1)}))},{keys:function(g){return jh(Gh(g))}});var Lh=A(tg.Object.keys),Vh=TA,Yh=Date,Wh=u(Yh.prototype.getTime);Vh({target:"Date",stat:!0},{now:function(){return Wh(new Yh)}});var Qh=A(tg.Date.now),Uh=I,_h=function(g,t){var A=[][g];return!!A&&Uh((function(){A.call(null,t||function(){return 1},1)}))},Kh=Sr.forEach,Hh=_h("forEach")?[].forEach:function(g){return Kh(this,g,arguments.length>1?arguments[1]:void 0)};TA({target:"Array",proto:!0,forced:[].forEach!==Hh},{forEach:Hh});var Xh=Me("Array").forEach,Jh=oC,qh=qg,$h=og,gl=Xh,tl=Array.prototype,Al={DOMTokenList:!0,NodeList:!0},el=function(g){var t=g.forEach;return g===tl||$h(tl,g)&&t===tl.forEach||qh(Al,Jh(g))?gl:t},Cl=A(el),Il=TA,il=En,ol=u([].reverse),nl=[1,2];Il({target:"Array",proto:!0,forced:String(nl)===String(nl.reverse())},{reverse:function(){return il(this)&&(this.length=this.length),ol(this)}});var rl=Me("Array").reverse,sl=og,al=rl,dl=Array.prototype,hl=function(g){var t=g.reverse;return g===dl||sl(dl,g)&&t===dl.reverse?al:t},ll=hl,cl=A(ll),ul=Og,fl=TypeError,pl=function(g,t){if(!delete g[t])throw new fl("Cannot delete property "+ul(t)+" of "+ul(g))},vl=TA,yl=Hg,ml=SA,bl=PA,wl=jA,kl=Rd,xl=Tn,El=zn,Ol=lo,Tl=pl,Dl=Gn("splice"),Nl=Math.max,Rl=Math.min;vl({target:"Array",proto:!0,forced:!Dl},{splice:function(g,t){var A,e,C,I,i,o,n=yl(this),r=wl(n),s=ml(g,r),a=arguments.length;for(0===a?A=e=0:1===a?(A=0,e=r-s):(A=a-2,e=Rl(Nl(bl(t),0),r-s)),xl(r+A-e),C=El(n,e),I=0;Ir-e+A;I--)Tl(n,I-1)}else if(A>e)for(I=r-e;I>s;I--)o=I+A-1,(i=I+e-1)in n?n[o]=n[i]:Tl(n,o);for(I=0;I1?arguments[1]:void 0)}});var Gl=Me("Array").includes,jl=gg,Ll=y,Vl=dt("match"),Yl=function(g){var t;return jl(g)&&(void 0!==(t=g[Vl])?!!t:"RegExp"===Ll(g))},Wl=TypeError,Ql=dt("match"),Ul=TA,_l=function(g){if(Yl(g))throw new Wl("The method doesn't accept regular expressions");return g},Kl=K,Hl=sC,Xl=function(g){var t=/./;try{"/./"[g](t)}catch(A){try{return t[Ql]=!1,"/./"[g](t)}catch(g){}}return!1},Jl=u("".indexOf);Ul({target:"String",proto:!0,forced:!Xl("includes")},{includes:function(g){return!!~Jl(Hl(Kl(this)),Hl(_l(g)),arguments.length>1?arguments[1]:void 0)}});var ql=Me("String").includes,$l=og,gc=Gl,tc=ql,Ac=Array.prototype,ec=String.prototype,Cc=function(g){var t=g.includes;return g===Ac||$l(Ac,g)&&t===Ac.includes?gc:"string"==typeof g||g===ec||$l(ec,g)&&t===ec.includes?tc:t},Ic=A(Cc),ic=Hg,oc=EI,nc=pI;TA({target:"Object",stat:!0,forced:I((function(){oc(1)})),sham:!nc},{getPrototypeOf:function(g){return oc(ic(g))}});var rc=tg.Object.getPrototypeOf,sc=A(rc),ac=Sr.filter;TA({target:"Array",proto:!0,forced:!Gn("filter")},{filter:function(g){return ac(this,g,arguments.length>1?arguments[1]:void 0)}});var dc=Me("Array").filter,hc=og,lc=dc,cc=Array.prototype,uc=function(g){var t=g.filter;return g===cc||hc(cc,g)&&t===cc.filter?lc:t},fc=A(uc),pc="\t\n\v\f\r                 \u2028\u2029\ufeff",vc=K,yc=sC,mc=pc,bc=u("".replace),wc=RegExp("^["+mc+"]+"),kc=RegExp("(^|[^"+mc+"])["+mc+"]+$"),xc=function(g){return function(t){var A=yc(vc(t));return 1&g&&(A=bc(A,wc,"")),2&g&&(A=bc(A,kc,"$1")),A}},Ec={start:xc(1),end:xc(2),trim:xc(3)},Oc=C,Tc=I,Dc=u,Nc=sC,Rc=Ec.trim,Pc=pc,Mc=Oc.parseInt,Bc=Oc.Symbol,zc=Bc&&Bc.iterator,Sc=/^[+-]?0x/i,Zc=Dc(Sc.exec),Fc=8!==Mc(Pc+"08")||22!==Mc(Pc+"0x16")||zc&&!Tc((function(){Mc(Object(zc))}))?function(g,t){var A=Rc(Nc(g));return Mc(A,t>>>0||(Zc(Sc,A)?16:10))}:Mc;TA({global:!0,forced:parseInt!==Fc},{parseInt:Fc});var Gc=A(tg.parseInt),jc=TA,Lc=QA.indexOf,Vc=_h,Yc=w([].indexOf),Wc=!!Yc&&1/Yc([1],1,-0)<0;jc({target:"Array",proto:!0,forced:Wc||!Vc("indexOf")},{indexOf:function(g){var t=arguments.length>1?arguments[1]:void 0;return Wc?Yc(this,g,t)||0:Lc(this,g,t)}});var Qc=Me("Array").indexOf,Uc=og,_c=Qc,Kc=Array.prototype,Hc=function(g){var t=g.indexOf;return g===Kc||Uc(Kc,g)&&t===Kc.indexOf?_c:t},Xc=A(Hc);TA({target:"Object",stat:!0,sham:!D},{create:fI});var Jc=tg.Object,qc=function(g,t){return Jc.create(g,t)},$c=A(qc),gu=tg,tu=a;gu.JSON||(gu.JSON={stringify:JSON.stringify});var Au=function(g,t,A){return tu(gu.JSON.stringify,null,arguments)},eu=A(Au),Cu="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,Iu=TypeError,iu=function(g,t){if(gA,i=ru(e)?e:lu(e),o=I?du(arguments,A):[],n=I?function(){nu(i,this,o)}:i;return t?g(n,C):g(n)}:g},fu=TA,pu=C,vu=uu(pu.setInterval,!0);fu({global:!0,bind:!0,forced:pu.setInterval!==vu},{setInterval:vu});var yu=TA,mu=C,bu=uu(mu.setTimeout,!0);yu({global:!0,bind:!0,forced:mu.setTimeout!==bu},{setTimeout:bu});var wu=A(tg.setTimeout),ku=Hg,xu=SA,Eu=jA,Ou=function(g){for(var t=ku(this),A=Eu(t),e=arguments.length,C=xu(e>1?arguments[1]:void 0,A),I=e>2?arguments[2]:void 0,i=void 0===I?A:xu(I,A);i>C;)t[C++]=g;return t};TA({target:"Array",proto:!0},{fill:Ou});var Tu,Du=Me("Array").fill,Nu=og,Ru=Du,Pu=Array.prototype,Mu=function(g){var t=g.fill;return g===Pu||Nu(Pu,g)&&t===Pu.fill?Ru:t},Bu=A(Mu); /*! Hammer.JS - v2.0.17-rc - 2019-12-16 * http://naver.github.io/egjs * * Forked By Naver egjs * Copyright (c) hammerjs * Licensed under the MIT license */ function zu(){return zu=Object.assign||function(g){for(var t=1;t-1}var kf=function(){function g(g,t){this.manager=g,this.set(t)}var t=g.prototype;return t.set=function(g){g===Ku&&(g=this.compute()),_u&&this.manager.element.style&&gf[g]&&(this.manager.element.style[Uu]=g),this.actions=g.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var g=[];return mf(this.manager.recognizers,(function(t){bf(t.options.enable,[t])&&(g=g.concat(t.getTouchAction()))})),function(g){if(wf(g,Ju))return Ju;var t=wf(g,qu),A=wf(g,$u);return t&&A?Ju:t||A?t?qu:$u:wf(g,Xu)?Xu:Hu}(g.join(" "))},t.preventDefaults=function(g){var t=g.srcEvent,A=g.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var e=this.actions,C=wf(e,Ju)&&!gf[Ju],I=wf(e,$u)&&!gf[$u],i=wf(e,qu)&&!gf[qu];if(C){var o=1===g.pointers.length,n=g.distance<2,r=g.deltaTime<250;if(o&&n&&r)return}if(!i||!I)return C||I&&A&uf||i&&A&ff?this.preventSrc(t):void 0}},t.preventSrc=function(g){this.manager.session.prevented=!0,g.preventDefault()},g}();function xf(g,t){for(;g;){if(g===t)return!0;g=g.parentNode}return!1}function Ef(g){var t=g.length;if(1===t)return{x:Vu(g[0].clientX),y:Vu(g[0].clientY)};for(var A=0,e=0,C=0;C=Yu(t)?g<0?df:hf:t<0?lf:cf}function Rf(g,t,A){return{x:t/g||0,y:A/g||0}}function Pf(g,t){var A=g.session,e=t.pointers,C=e.length;A.firstInput||(A.firstInput=Of(t)),C>1&&!A.firstMultiple?A.firstMultiple=Of(t):1===C&&(A.firstMultiple=!1);var I=A.firstInput,i=A.firstMultiple,o=i?i.center:I.center,n=t.center=Ef(e);t.timeStamp=Wu(),t.deltaTime=t.timeStamp-I.timeStamp,t.angle=Df(o,n),t.distance=Tf(o,n),function(g,t){var A=t.center,e=g.offsetDelta||{},C=g.prevDelta||{},I=g.prevInput||{};t.eventType!==nf&&I.eventType!==rf||(C=g.prevDelta={x:I.deltaX||0,y:I.deltaY||0},e=g.offsetDelta={x:A.x,y:A.y}),t.deltaX=C.x+(A.x-e.x),t.deltaY=C.y+(A.y-e.y)}(A,t),t.offsetDirection=Nf(t.deltaX,t.deltaY);var r,s,a=Rf(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=a.x,t.overallVelocityY=a.y,t.overallVelocity=Yu(a.x)>Yu(a.y)?a.x:a.y,t.scale=i?(r=i.pointers,Tf((s=e)[0],s[1],yf)/Tf(r[0],r[1],yf)):1,t.rotation=i?function(g,t){return Df(t[1],t[0],yf)+Df(g[1],g[0],yf)}(i.pointers,e):0,t.maxPointers=A.prevInput?t.pointers.length>A.prevInput.maxPointers?t.pointers.length:A.prevInput.maxPointers:t.pointers.length,function(g,t){var A,e,C,I,i=g.lastInterval||t,o=t.timeStamp-i.timeStamp;if(t.eventType!==sf&&(o>of||void 0===i.velocity)){var n=t.deltaX-i.deltaX,r=t.deltaY-i.deltaY,s=Rf(o,n,r);e=s.x,C=s.y,A=Yu(s.x)>Yu(s.y)?s.x:s.y,I=Nf(n,r),g.lastInterval=t}else A=i.velocity,e=i.velocityX,C=i.velocityY,I=i.direction;t.velocity=A,t.velocityX=e,t.velocityY=C,t.direction=I}(A,t);var d,h=g.element,l=t.srcEvent;xf(d=l.composedPath?l.composedPath()[0]:l.path?l.path[0]:l.target,h)&&(h=d),t.target=h}function Mf(g,t,A){var e=A.pointers.length,C=A.changedPointers.length,I=t&nf&&e-C==0,i=t&(rf|sf)&&e-C==0;A.isFirst=!!I,A.isFinal=!!i,I&&(g.session={}),A.eventType=t,Pf(g,A),g.emit("hammer.input",A),g.recognize(A),g.session.prevInput=A}function Bf(g){return g.trim().split(/\s+/g)}function zf(g,t,A){mf(Bf(t),(function(t){g.addEventListener(t,A,!1)}))}function Sf(g,t,A){mf(Bf(t),(function(t){g.removeEventListener(t,A,!1)}))}function Zf(g){var t=g.ownerDocument||g;return t.defaultView||t.parentWindow||window}var Ff=function(){function g(g,t){var A=this;this.manager=g,this.callback=t,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(t){bf(g.options.enable,[g])&&A.handler(t)},this.init()}var t=g.prototype;return t.handler=function(){},t.init=function(){this.evEl&&zf(this.element,this.evEl,this.domHandler),this.evTarget&&zf(this.target,this.evTarget,this.domHandler),this.evWin&&zf(Zf(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&Sf(this.element,this.evEl,this.domHandler),this.evTarget&&Sf(this.target,this.evTarget,this.domHandler),this.evWin&&Sf(Zf(this.element),this.evWin,this.domHandler)},g}();function Gf(g,t,A){if(g.indexOf&&!A)return g.indexOf(t);for(var e=0;eA[t]})):e.sort()),e}var _f={touchstart:nf,touchmove:2,touchend:rf,touchcancel:sf},Kf=function(g){function t(){var A;return t.prototype.evTarget="touchstart touchmove touchend touchcancel",(A=g.apply(this,arguments)||this).targetIds={},A}return Su(t,g),t.prototype.handler=function(g){var t=_f[g.type],A=Hf.call(this,g,t);A&&this.callback(this.manager,t,{pointers:A[0],changedPointers:A[1],pointerType:Cf,srcEvent:g})},t}(Ff);function Hf(g,t){var A,e,C=Qf(g.touches),I=this.targetIds;if(t&(2|nf)&&1===C.length)return I[C[0].identifier]=!0,[C,C];var i=Qf(g.changedTouches),o=[],n=this.target;if(e=C.filter((function(g){return xf(g.target,n)})),t===nf)for(A=0;A-1&&e.splice(g,1)}),qf)}}function gp(g,t){g&nf?(this.primaryTouch=t.changedPointers[0].identifier,$f.call(this,t)):g&(rf|sf)&&$f.call(this,t)}function tp(g){for(var t=g.srcEvent.clientX,A=g.srcEvent.clientY,e=0;e-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(g){return!!this.simultaneous[g.id]},t.emit=function(g){var t=this,A=this.state;function e(A){t.manager.emit(A,g)}A<8&&e(t.options.event+op(A)),e(t.options.event),g.additionalEvent&&e(g.additionalEvent),A>=8&&e(t.options.event+op(A))},t.tryEmit=function(g){if(this.canEmit())return this.emit(g);this.state=Cp},t.canEmit=function(){for(var g=0;gt.threshold&&C&t.direction},A.attrTest=function(g){return sp.prototype.attrTest.call(this,g)&&(2&this.state||!(2&this.state)&&this.directionTest(g))},A.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var A=ap(t.direction);A&&(t.additionalEvent=this.options.event+A),g.prototype.emit.call(this,t)},t}(sp),hp=function(g){function t(t){return void 0===t&&(t={}),g.call(this,zu({event:"swipe",threshold:10,velocity:.3,direction:uf|ff,pointers:1},t))||this}Su(t,g);var A=t.prototype;return A.getTouchAction=function(){return dp.prototype.getTouchAction.call(this)},A.attrTest=function(t){var A,e=this.options.direction;return e&(uf|ff)?A=t.overallVelocity:e&uf?A=t.overallVelocityX:e&ff&&(A=t.overallVelocityY),g.prototype.attrTest.call(this,t)&&e&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&Yu(A)>this.options.velocity&&t.eventType&rf},A.emit=function(g){var t=ap(g.offsetDirection);t&&this.manager.emit(this.options.event+t,g),this.manager.emit(this.options.event,g)},t}(sp),lp=function(g){function t(t){return void 0===t&&(t={}),g.call(this,zu({event:"pinch",threshold:0,pointers:2},t))||this}Su(t,g);var A=t.prototype;return A.getTouchAction=function(){return[Ju]},A.attrTest=function(t){return g.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},A.emit=function(t){if(1!==t.scale){var A=t.scale<1?"in":"out";t.additionalEvent=this.options.event+A}g.prototype.emit.call(this,t)},t}(sp),cp=function(g){function t(t){return void 0===t&&(t={}),g.call(this,zu({event:"rotate",threshold:0,pointers:2},t))||this}Su(t,g);var A=t.prototype;return A.getTouchAction=function(){return[Ju]},A.attrTest=function(t){return g.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)},t}(sp),up=function(g){function t(t){var A;return void 0===t&&(t={}),(A=g.call(this,zu({event:"press",pointers:1,time:251,threshold:9},t))||this)._timer=null,A._input=null,A}Su(t,g);var A=t.prototype;return A.getTouchAction=function(){return[Hu]},A.process=function(g){var t=this,A=this.options,e=g.pointers.length===A.pointers,C=g.distanceA.time;if(this._input=g,!C||!e||g.eventType&(rf|sf)&&!I)this.reset();else if(g.eventType&nf)this.reset(),this._timer=setTimeout((function(){t.state=8,t.tryEmit()}),A.time);else if(g.eventType&rf)return 8;return Cp},A.reset=function(){clearTimeout(this._timer)},A.emit=function(g){8===this.state&&(g&&g.eventType&rf?this.manager.emit(this.options.event+"up",g):(this._input.timeStamp=Wu(),this.manager.emit(this.options.event,this._input)))},t}(np),fp={domEvents:!1,touchAction:Ku,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},pp=[[cp,{enable:!1}],[lp,{enable:!1},["rotate"]],[hp,{direction:uf}],[dp,{direction:uf},["swipe"]],[rp],[rp,{event:"doubletap",taps:2},["tap"]],[up]];function vp(g,t){var A,e=g.element;e.style&&(mf(g.options.cssProps,(function(C,I){A=Qu(e.style,I),t?(g.oldCssProps[A]=e.style[A],e.style[A]=C):e.style[A]=g.oldCssProps[A]||""})),t||(g.oldCssProps={}))}var yp=function(){function g(g,t){var A,e=this;this.options=Gu({},fp,t||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=new((A=this).options.inputClass||(Af?Wf:ef?Kf:tf?Ap:Jf))(A,Mf),this.touchAction=new kf(this,this.options.touchAction),vp(this,!0),mf(this.options.recognizers,(function(g){var t=e.add(new g[0](g[1]));g[2]&&t.recognizeWith(g[2]),g[3]&&t.requireFailure(g[3])}),this)}var t=g.prototype;return t.set=function(g){return Gu(this.options,g),g.touchAction&&this.touchAction.update(),g.inputTarget&&(this.input.destroy(),this.input.target=g.inputTarget,this.input.init()),this},t.stop=function(g){this.session.stopped=g?2:1},t.recognize=function(g){var t=this.session;if(!t.stopped){var A;this.touchAction.preventDefaults(g);var e=this.recognizers,C=t.curRecognizer;(!C||C&&8&C.state)&&(t.curRecognizer=null,C=null);for(var I=0;I\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",C=window.console&&(window.console.warn||window.console.log);return C&&C.call(window.console,e,A),g.apply(this,arguments)}}var xp=kp((function(g,t,A){for(var e=Object.keys(t),C=0;C=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function Pp(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A2)return zp.apply(void 0,bh(e=[Bp(t[0],t[1])]).call(e,ch(wh(t).call(t,2))));var C=t[0],I=t[1];if(C instanceof Date&&I instanceof Date)return C.setTime(I.getTime()),C;var i,o=Rp(Nh(I));try{for(o.s();!(i=o.n()).done;){var n=i.value;Object.prototype.propertyIsEnumerable.call(I,n)&&(I[n]===Mp?delete C[n]:null===C[n]||null===I[n]||"object"!==yd(C[n])||"object"!==yd(I[n])||Rh(C[n])||Rh(I[n])?C[n]=Sp(I[n]):C[n]=zp(C[n],I[n]))}}catch(g){o.e(g)}finally{o.f()}return C}function Sp(g){return Rh(g)?Fh(g).call(g,(function(g){return Sp(g)})):"object"===yd(g)&&null!==g?g instanceof Date?new Date(g.getTime()):zp({},g):g}function Zp(g){for(var t=0,A=Lh(g);t>>0,g=(C*=g)>>>0,g+=4294967296*(C-=g)}return 2.3283064365386963e-10*(g>>>0)}}(),t=g(" "),A=g(" "),e=g(" "),C=0;C2&&void 0!==arguments[2]&&arguments[2];for(var e in g)if(void 0!==t[e])if(null===t[e]||"object"!==yd(t[e]))Kp(g,t,e,A);else{var C=g[e],I=t[e];_p(C)&&_p(I)&&Hp(C,I,A)}}function Xp(g,t,A){var e=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rh(A))throw new TypeError("Arrays are not supported by deepExtend");for(var C=0;C3&&void 0!==arguments[3]&&arguments[3];if(Rh(A))throw new TypeError("Arrays are not supported by deepExtend");for(var C in A)if(Object.prototype.hasOwnProperty.call(A,C)&&!Ic(g).call(g,C))if(A[C]&&A[C].constructor===Object)void 0===t[C]&&(t[C]={}),t[C].constructor===Object?qp(t[C],A[C]):Kp(t,A,C,e);else if(Rh(A[C])){t[C]=[];for(var I=0;I2&&void 0!==arguments[2]&&arguments[2],e=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(var C in t)if(Object.prototype.hasOwnProperty.call(t,C)||!0===A)if("object"===yd(t[C])&&null!==t[C]&&sc(t[C])===Object.prototype)void 0===g[C]?g[C]=qp({},t[C],A):"object"===yd(g[C])&&null!==g[C]&&sc(g[C])===Object.prototype?qp(g[C],t[C],A):Kp(g,t,C,e);else if(Rh(t[C])){var I;g[C]=wh(I=t[C]).call(I)}else Kp(g,t,C,e);return g}function $p(g,t){var A;return bh(A=[]).call(A,ch(g),[t])}function gv(g){return g.getBoundingClientRect().top}function tv(g,t){if(Rh(g))for(var A=g.length,e=0;e3&&void 0!==arguments[3]?arguments[3]:{},C=function(g){return null!=g},I=function(g){return null!==g&&"object"===yd(g)};if(!I(g))throw new Error("Parameter mergeTarget must be an object");if(!I(t))throw new Error("Parameter options must be an object");if(!C(A))throw new Error("Parameter option must have a value");if(!I(e))throw new Error("Parameter globalOptions must be an object");var i=t[A],o=I(e)&&!function(g){for(var t in g)if(Object.prototype.hasOwnProperty.call(g,t))return!1;return!0}(e)?e[A]:void 0,n=o?o.enabled:void 0;if(void 0!==i){if("boolean"==typeof i)return I(g[A])||(g[A]={}),void(g[A].enabled=i);if(null===i&&!I(g[A])){if(!C(o))return;g[A]=$c(o)}if(I(i)){var r=!0;void 0!==i.enabled?r=i.enabled:void 0!==n&&(r=o.enabled),function(g,t,A){I(g[A])||(g[A]={});var e=t[A],C=g[A];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(C[i]=e[i])}(g,t,A),g[A].enabled=r}}}var hv={linear:function(g){return g},easeInQuad:function(g){return g*g},easeOutQuad:function(g){return g*(2-g)},easeInOutQuad:function(g){return g<.5?2*g*g:(4-2*g)*g-1},easeInCubic:function(g){return g*g*g},easeOutCubic:function(g){return--g*g*g+1},easeInOutCubic:function(g){return g<.5?4*g*g*g:(g-1)*(2*g-2)*(2*g-2)+1},easeInQuart:function(g){return g*g*g*g},easeOutQuart:function(g){return 1- --g*g*g*g},easeInOutQuart:function(g){return g<.5?8*g*g*g*g:1-8*--g*g*g*g},easeInQuint:function(g){return g*g*g*g*g},easeOutQuint:function(g){return 1+--g*g*g*g*g},easeInOutQuint:function(g){return g<.5?16*g*g*g*g*g:1+16*--g*g*g*g*g}};function lv(g,t){var A;Rh(t)||(t=[t]);var e,C=Rp(g);try{for(C.s();!(e=C.n()).done;){var I=e.value;if(I){A=I[t[0]];for(var i=1;i0&&void 0!==arguments[0]?arguments[0]:1;cn(this,g),this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return kd(g,[{key:"insertTo",value:function(g){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=g,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(g){if("function"!=typeof g)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=g}},{key:"setCloseCallback",value:function(g){if("function"!=typeof g)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=g}},{key:"_isColorString",value:function(g){if("string"==typeof g)return cv[g]}},{key:"setColor",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==g){var A,e=this._isColorString(g);if(void 0!==e&&(g=e),!0===Up(g)){if(!0===sv(g)){var C=g.substr(4).substr(0,g.length-5).split(",");A={r:C[0],g:C[1],b:C[2],a:1}}else if(!0===function(g){return Wp.test(g)}(g)){var I=g.substr(5).substr(0,g.length-6).split(",");A={r:I[0],g:I[1],b:I[2],a:I[3]}}else if(!0===rv(g)){var i=Av(g);A={r:i.r,g:i.g,b:i.b,a:1}}}else if(g instanceof Object&&void 0!==g.r&&void 0!==g.g&&void 0!==g.b){var o=void 0!==g.a?g.a:"1.0";A={r:g.r,g:g.g,b:g.b,a:o}}if(void 0===A)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: "+eu(g));this._setColor(A,t)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var g=this;!0===(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.previousColor=pe({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",wu((function(){void 0!==g.closeCallback&&(g.closeCallback(),g.closeCallback=void 0)}),0)}},{key:"_save",value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:"_apply",value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:"_loadLast",value:function(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(g){!0===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&(this.initialColor=pe({},g)),this.color=g;var t=iv(g.r,g.g,g.b),A=2*Math.PI,e=this.r*t.s,C=this.centerCoordinates.x+e*Math.sin(A*t.h),I=this.centerCoordinates.y+e*Math.cos(A*t.h);this.colorPickerSelector.style.left=C-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=I-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(g)}},{key:"_setOpacity",value:function(g){this.color.a=g/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(g){var t=iv(this.color.r,this.color.g,this.color.b);t.v=g/100;var A=ov(t.h,t.s,t.v);A.a=this.color.a,this.color=A,this._updatePicker()}},{key:"_updatePicker",value:function(){var g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=iv(g.r,g.g,g.b),A=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(A.webkitBackingStorePixelRatio||A.mozBackingStorePixelRatio||A.msBackingStorePixelRatio||A.oBackingStorePixelRatio||A.backingStorePixelRatio||1)),A.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var e=this.colorPickerCanvas.clientWidth,C=this.colorPickerCanvas.clientHeight;A.clearRect(0,0,e,C),A.putImageData(this.hueCircle,0,0),A.fillStyle="rgba(0,0,0,"+(1-t.v)+")",A.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),Bu(A).call(A),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*g.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}},{key:"_setSize",value:function(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:"_create",value:function(){var g,t,A,e;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){var C=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(C.webkitBackingStorePixelRatio||C.mozBackingStorePixelRatio||C.msBackingStorePixelRatio||C.oBackingStorePixelRatio||C.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var 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(g){}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(g){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var i=this;this.opacityRange.onchange=function(){i._setOpacity(this.value)},this.opacityRange.oninput=function(){i._setOpacity(this.value)},this.brightnessRange.onchange=function(){i._setBrightness(this.value)},this.brightnessRange.oninput=function(){i._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=je(g=this._hide).call(g,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=je(t=this._apply).call(t,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=je(A=this._save).call(A,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=je(e=this._loadLast).call(e,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)}},{key:"_bindHammer",value:function(){var g=this;this.drag={},this.pinch={},this.hammer=new Gp(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",(function(t){t.isFirst&&g._moveSelector(t)})),this.hammer.on("tap",(function(t){g._moveSelector(t)})),this.hammer.on("panstart",(function(t){g._moveSelector(t)})),this.hammer.on("panmove",(function(t){g._moveSelector(t)})),this.hammer.on("panend",(function(t){g._moveSelector(t)}))}},{key:"_generateHueCircle",value:function(){if(!1===this.generated){var g=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1)),g.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var t,A,e,C,I=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;g.clearRect(0,0,I,i),this.centerCoordinates={x:.5*I,y:.5*i},this.r=.49*I;var o,n=2*Math.PI/360,r=1/this.r;for(e=0;e<360;e++)for(C=0;C3&&void 0!==arguments[3]?arguments[3]:1,I=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return!1};cn(this,g),this.parent=t,this.changedOptions=[],this.container=A,this.allowCreation=!1,this.hideOption=I,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},pe(this.options,this.defaultOptions),this.configureOptions=e,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new uv(C),this.wrapper=void 0}return kd(g,[{key:"setOptions",value:function(g){if(void 0!==g){this.popupHistory={},this._removePopup();var t=!0;if("string"==typeof g)this.options.filter=g;else if(Rh(g))this.options.filter=g.join();else if("object"===yd(g)){if(null==g)throw new TypeError("options cannot be null");void 0!==g.container&&(this.options.container=g.container),void 0!==fc(g)&&(this.options.filter=fc(g)),void 0!==g.showButton&&(this.options.showButton=g.showButton),void 0!==g.enabled&&(t=g.enabled)}else"boolean"==typeof g?(this.options.filter=!0,t=g):"function"==typeof g&&(this.options.filter=g,t=!0);!1===fc(this.options)&&(t=!1),this.options.enabled=t}this._clean()}},{key:"setModuleOptions",value:function(g){this.moduleOptions=g,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){this._clean(),this.changedOptions=[];var g=fc(this.options),t=0,A=!1;for(var e in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,e)&&(this.allowCreation=!1,A=!1,"function"==typeof g?A=(A=g(e,[]))||this._handleObject(this.configureOptions[e],[e],!0):!0!==g&&-1===Xc(g).call(g,e)||(A=!0),!1!==A&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(e),this._handleObject(this.configureOptions[e],[e])),t++);this._makeButton(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var g=0;g1?A-1:0),C=1;C2&&void 0!==arguments[2]&&arguments[2],e=document.createElement("div");if(e.className="vis-configuration vis-config-label vis-config-s"+t.length,!0===A){for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(fv("i","b",g))}else e.innerText=g+":";return e}},{key:"_makeDropdown",value:function(g,t,A){var e=document.createElement("select");e.className="vis-configuration vis-config-select";var C=0;void 0!==t&&-1!==Xc(g).call(g,t)&&(C=Xc(g).call(g,t));for(var I=0;II&&1!==I&&(o.max=Math.ceil(t*s),r=o.max,n="range increased"),o.value=t}else o.value=e;var a=document.createElement("input");a.className="vis-configuration vis-config-rangeinput",a.value=o.value;var d=this;o.onchange=function(){a.value=this.value,d._update(Number(this.value),A)},o.oninput=function(){a.value=this.value};var h=this._makeLabel(A[A.length-1],A),l=this._makeItem(A,h,o,a);""!==n&&this.popupHistory[l]!==r&&(this.popupHistory[l]=r,this._setupPopup(n,l))}},{key:"_makeButton",value:function(){var g=this;if(!0===this.options.showButton){var t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerText="generate options",t.onclick=function(){g._printOptions()},t.onmouseover=function(){t.className="vis-configuration vis-config-button hover"},t.onmouseout=function(){t.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(t)}}},{key:"_setupPopup",value:function(g,t){var A=this;if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter1&&void 0!==arguments[1]?arguments[1]:[],A=arguments.length>2&&void 0!==arguments[2]&&arguments[2],e=!1,C=fc(this.options),I=!1;for(var i in g)if(Object.prototype.hasOwnProperty.call(g,i)){e=!0;var o=g[i],n=$p(t,i);if("function"==typeof C&&!1===(e=C(i,t))&&!Rh(o)&&"string"!=typeof o&&"boolean"!=typeof o&&o instanceof Object&&(this.allowCreation=!1,e=this._handleObject(o,n,!0),this.allowCreation=!1===A),!1!==e){I=!0;var r=this._getValue(n);if(Rh(o))this._handleArray(o,r,n);else if("string"==typeof o)this._makeTextInput(o,r,n);else if("boolean"==typeof o)this._makeCheckbox(o,r,n);else if(o instanceof Object){if(!this.hideOption(t,i,this.moduleOptions))if(void 0!==o.enabled){var s=$p(n,"enabled"),a=this._getValue(s);if(!0===a){var d=this._makeLabel(i,n,!0);this._makeItem(n,d),I=this._handleObject(o,n)||I}else this._makeCheckbox(o,a,n)}else{var h=this._makeLabel(i,n,!0);this._makeItem(n,h),I=this._handleObject(o,n)||I}}else console.error("dont know how to handle",o,i,n)}}return I}},{key:"_handleArray",value:function(g,t,A){"string"==typeof g[0]&&"color"===g[0]?(this._makeColorField(g,t,A),g[1]!==t&&this.changedOptions.push({path:A,value:t})):"string"==typeof g[0]?(this._makeDropdown(g,t,A),g[0]!==t&&this.changedOptions.push({path:A,value:t})):"number"==typeof g[0]&&(this._makeRange(g,t,A),g[0]!==t&&this.changedOptions.push({path:A,value:Number(t)}))}},{key:"_update",value:function(g,t){var A=this._constructOptions(g,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",A),this.initialized=!0,this.parent.setOptions(A)}},{key:"_constructOptions",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=A;g="false"!==(g="true"===g||g)&&g;for(var C=0;CC-this.padding&&(o=!0),I=o?this.x-A:this.x,i=n?this.y-t:this.y}else(i=this.y-t)+t+this.padding>e&&(i=e-t-this.padding),iC&&(I=C-A-this.padding),Ii.distance?" in "+g.printLocation(I.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+g.printLocation(i.path,i.closestMatch,""):I.distance<=8?'. Did you mean "'+I.closestMatch+'"?'+g.printLocation(I.path,t):". Did you mean one of these: "+g.print(Lh(A))+g.printLocation(e,t),console.error('%cUnknown option detected: "'+t+'"'+C,bv),mv=!0}},{key:"findInOptions",value:function(t,A,e){var C,I=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=1e9,o="",n=[],r=t.toLowerCase(),s=void 0;for(var a in A){var d=void 0;if(void 0!==A[a].__type__&&!0===I){var h=g.findInOptions(t,A[a],$p(e,a));i>h.distance&&(o=h.closestMatch,n=h.path,i=h.distance,s=h.indexMatch)}else{var l;-1!==Xc(l=a.toLowerCase()).call(l,r)&&(s=a),i>(d=g.levenshteinDistance(t,a))&&(o=a,n=wh(C=e).call(C),i=d)}}return{closestMatch:o,path:n,distance:i,indexMatch:s}}},{key:"printLocation",value:function(g,t){for(var A="\n\n"+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n")+"options = {\n",e=0;e":!0,"--":!0},zv="",Sv=0,Zv="",Fv="",Gv=Mv.NULL;function jv(){Sv++,Zv=zv.charAt(Sv)}function Lv(){return zv.charAt(Sv+1)}function Vv(g){var t=g.charCodeAt(0);return t<47?35===t||46===t:t<59?t>47:t<91?t>64:t<96?95===t:t<123&&t>96}function Yv(g,t){if(g||(g={}),t)for(var A in t)t.hasOwnProperty(A)&&(g[A]=t[A]);return g}function Wv(g,t,A){for(var e=t.split("."),C=g;e.length;){var I=e.shift();e.length?(C[I]||(C[I]={}),C=C[I]):C[I]=A}}function Qv(g,t){for(var A,e,C=null,I=[g],i=g;i.parent;)I.push(i.parent),i=i.parent;if(i.nodes)for(A=0,e=i.nodes.length;A=0;A--){var o,n=I[A];n.nodes||(n.nodes=[]),-1===Xc(o=n.nodes).call(o,C)&&n.nodes.push(C)}t.attr&&(C.attr=Yv(C.attr,t.attr))}function Uv(g,t){if(g.edges||(g.edges=[]),g.edges.push(t),g.edge){var A=Yv({},g.edge);t.attr=Yv(A,t.attr)}}function _v(g,t,A,e,C){var I={from:t,to:A,type:e};return g.edge&&(I.attr=Yv({},g.edge)),I.attr=Yv(I.attr||{},C),null!=C&&C.hasOwnProperty("arrows")&&null!=C.arrows&&(I.arrows={to:{enabled:!0,type:C.arrows.type}},C.arrows=null),I}function Kv(){for(Gv=Mv.NULL,Fv="";" "===Zv||"\t"===Zv||"\n"===Zv||"\r"===Zv;)jv();do{var g=!1;if("#"===Zv){for(var t=Sv-1;" "===zv.charAt(t)||"\t"===zv.charAt(t);)t--;if("\n"===zv.charAt(t)||""===zv.charAt(t)){for(;""!=Zv&&"\n"!=Zv;)jv();g=!0}}if("/"===Zv&&"/"===Lv()){for(;""!=Zv&&"\n"!=Zv;)jv();g=!0}if("/"===Zv&&"*"===Lv()){for(;""!=Zv;){if("*"===Zv&&"/"===Lv()){jv(),jv();break}jv()}g=!0}for(;" "===Zv||"\t"===Zv||"\n"===Zv||"\r"===Zv;)jv()}while(g);if(""!==Zv){var A=Zv+Lv();if(Bv[A])return Gv=Mv.DELIMITER,Fv=A,jv(),void jv();if(Bv[Zv])return Gv=Mv.DELIMITER,Fv=Zv,void jv();if(Vv(Zv)||"-"===Zv){for(Fv+=Zv,jv();Vv(Zv);)Fv+=Zv,jv();return"false"===Fv?Fv=!1:"true"===Fv?Fv=!0:isNaN(Number(Fv))||(Fv=Number(Fv)),void(Gv=Mv.IDENTIFIER)}if('"'===Zv){for(jv();""!=Zv&&('"'!=Zv||'"'===Zv&&'"'===Lv());)'"'===Zv?(Fv+=Zv,jv()):"\\"===Zv&&"n"===Lv()?(Fv+="\n",jv()):Fv+=Zv,jv();if('"'!=Zv)throw gy('End of string " expected');return jv(),void(Gv=Mv.IDENTIFIER)}for(Gv=Mv.UNKNOWN;""!=Zv;)Fv+=Zv,jv();throw new SyntaxError('Syntax error in part "'+ty(Fv,30)+'"')}Gv=Mv.DELIMITER}function Hv(g){for(;""!==Fv&&"}"!=Fv;)Xv(g),";"===Fv&&Kv()}function Xv(g){var t=Jv(g);if(t)qv(g,t);else{var A=function(g){if("node"===Fv)return Kv(),g.node=$v(),"node";if("edge"===Fv)return Kv(),g.edge=$v(),"edge";if("graph"===Fv)return Kv(),g.graph=$v(),"graph";return null}(g);if(!A){if(Gv!=Mv.IDENTIFIER)throw gy("Identifier expected");var e=Fv;if(Kv(),"="===Fv){if(Kv(),Gv!=Mv.IDENTIFIER)throw gy("Identifier expected");g[e]=Fv,Kv()}else!function(g,t){var A={id:t},e=$v();e&&(A.attr=e);Qv(g,A),qv(g,t)}(g,e)}}}function Jv(g){var t=null;if("subgraph"===Fv&&((t={}).type="subgraph",Kv(),Gv===Mv.IDENTIFIER&&(t.id=Fv,Kv())),"{"===Fv){if(Kv(),t||(t={}),t.parent=g,t.node=g.node,t.edge=g.edge,t.graph=g.graph,Hv(t),"}"!=Fv)throw gy("Angle bracket } expected");Kv(),delete t.node,delete t.edge,delete t.graph,delete t.parent,g.subgraphs||(g.subgraphs=[]),g.subgraphs.push(t)}return t}function qv(g,t){for(;"->"===Fv||"--"===Fv;){var A,e=Fv;Kv();var C=Jv(g);if(C)A=C;else{if(Gv!=Mv.IDENTIFIER)throw gy("Identifier or subgraph expected");Qv(g,{id:A=Fv}),Kv()}Uv(g,_v(g,t,A,e,$v())),t=A}}function $v(){for(var g,t,A=null,e={dashed:!0,solid:!1,dotted:[1,5]},C={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},I=new Array,i=new Array;"["===Fv;){for(Kv(),A={};""!==Fv&&"]"!=Fv;){if(Gv!=Mv.IDENTIFIER)throw gy("Attribute name expected");var o=Fv;if(Kv(),"="!=Fv)throw gy("Equal sign = expected");if(Kv(),Gv!=Mv.IDENTIFIER)throw gy("Attribute value expected");var n=Fv;"style"===o&&(n=e[n]),"arrowhead"===o&&(o="arrows",n={to:{enabled:!0,type:C[n]}}),"arrowtail"===o&&(o="arrows",n={from:{enabled:!0,type:C[n]}}),I.push({attr:A,name:o,value:n}),i.push(o),Kv(),","==Fv&&Kv()}if("]"!=Fv)throw gy("Bracket ] expected");Kv()}if(Ic(i).call(i,"dir")){var r={arrows:{}};for(g=0;g"===g.type&&(t.arrows="to"),t};Cl(C=A.edges).call(C,(function(g){var t,A,C,i,o,n,r;(t=g.from instanceof Object?g.from.nodes:{id:g.from},A=g.to instanceof Object?g.to.nodes:{id:g.to},g.from instanceof Object&&g.from.edges)&&Cl(C=g.from.edges).call(C,(function(g){var t=I(g);e.edges.push(t)}));(o=A,n=function(t,A){var C=_v(e,t.id,A.id,g.type,g.attr),i=I(C);e.edges.push(i)},Rh(i=t)?Cl(i).call(i,(function(g){Rh(o)?Cl(o).call(o,(function(t){n(g,t)})):n(g,o)})):Rh(o)?Cl(o).call(o,(function(g){n(i,g)})):n(i,o),g.to instanceof Object&&g.to.edges)&&Cl(r=g.to.edges).call(r,(function(g){var t=I(g);e.edges.push(t)}))}))}return A.attr&&(e.options=A.attr),e}var Iy=Object.freeze({__proto__:null,DOTToGraph:Cy,parseDOT:Nv});function iy(g,t){var A,e={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};null!=t&&(null!=t.fixed&&(e.nodes.fixed=t.fixed),null!=t.parseColor&&(e.nodes.parseColor=t.parseColor),null!=t.inheritColor&&(e.edges.inheritColor=t.inheritColor));var C=g.edges,I=Fh(C).call(C,(function(g){var t={from:g.source,id:g.id,to:g.target};return null!=g.attributes&&(t.attributes=g.attributes),null!=g.label&&(t.label=g.label),null!=g.attributes&&null!=g.attributes.title&&(t.title=g.attributes.title),"Directed"===g.type&&(t.arrows="to"),g.color&&!1===e.edges.inheritColor&&(t.color=g.color),t}));return{nodes:Fh(A=g.nodes).call(A,(function(g){var t={id:g.id,fixed:e.nodes.fixed&&null!=g.x&&null!=g.y};return null!=g.attributes&&(t.attributes=g.attributes),null!=g.label&&(t.label=g.label),null!=g.size&&(t.size=g.size),null!=g.attributes&&null!=g.attributes.title&&(t.title=g.attributes.title),null!=g.title&&(t.title=g.title),null!=g.x&&(t.x=g.x),null!=g.y&&(t.y=g.y),null!=g.color&&(!0===e.nodes.parseColor?t.color=g.color:t.color={background:g.color,border:g.color,highlight:{background:g.color,border:g.color},hover:{background:g.color,border:g.color}}),t})),edges:I}}var oy=Object.freeze({__proto__:null,parseGephi:iy}),ny=Object.freeze({__proto__:null,cn:{addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},cs:{addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"},de:{addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},en:{addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},es:{addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},fr:{addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},it:{addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},nl:{addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},pt:{addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},ru:{addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},uk:{addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"}});var ry=function(){function g(){cn(this,g),this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}return kd(g,[{key:"init",value:function(){if(!this.initialized()){this.src=this.image.src;var g=this.image.width,t=this.image.height;this.width=g,this.height=t;var A=Math.floor(t/2),e=Math.floor(t/4),C=Math.floor(t/8),I=Math.floor(t/16),i=Math.floor(g/2),o=Math.floor(g/4),n=Math.floor(g/8),r=Math.floor(g/16);this.canvas.width=3*o,this.canvas.height=A,this.coordinates=[[0,0,i,A],[i,0,o,e],[i,e,n,C],[5*n,e,r,I]],this._fillMipMap()}}},{key:"initialized",value:function(){return void 0!==this.coordinates}},{key:"_fillMipMap",value:function(){var g=this.canvas.getContext("2d"),t=this.coordinates[0];g.drawImage(this.image,t[0],t[1],t[2],t[3]);for(var A=1;A2){t*=.5;for(var i=0;t>2&&i=this.NUM_ITERATIONS&&(i=this.NUM_ITERATIONS-1);var o=this.coordinates[i];g.drawImage(this.canvas,o[0],o[1],o[2],o[3],A,e,C,I)}else g.drawImage(this.image,A,e,C,I)}}]),g}(),sy=function(){function g(t){cn(this,g),this.images={},this.imageBroken={},this.callback=t}return kd(g,[{key:"_tryloadBrokenUrl",value:function(g,t,A){void 0!==g&&void 0!==A&&(void 0!==t?(A.image.onerror=function(){console.error("Could not load brokenImage:",t)},A.image.src=t):console.warn("No broken url image defined"))}},{key:"_redrawWithImage",value:function(g){this.callback&&this.callback(g)}},{key:"load",value:function(g,t){var A=this,e=this.images[g];if(e)return e;var C=new ry;return this.images[g]=C,C.image.onload=function(){A._fixImageCoordinates(C.image),C.init(),A._redrawWithImage(C)},C.image.onerror=function(){console.error("Could not load image:",g),A._tryloadBrokenUrl(g,t,C)},C.image.src=g,C}},{key:"_fixImageCoordinates",value:function(g){0===g.width&&(document.body.appendChild(g),g.width=g.offsetWidth,g.height=g.offsetHeight,document.body.removeChild(g))}}]),g}(),ay={exports:{}},dy=I((function(){if("function"==typeof ArrayBuffer){var g=new ArrayBuffer(8);Object.isExtensible(g)&&Object.defineProperty(g,"a",{value:8})}})),hy=I,ly=gg,cy=y,uy=dy,fy=Object.isExtensible,py=hy((function(){fy(1)}))||uy?function(g){return!!ly(g)&&((!uy||"ArrayBuffer"!==cy(g))&&(!fy||fy(g)))}:fy,vy=!I((function(){return Object.isExtensible(Object.preventExtensions({}))})),yy=TA,my=u,by=UA,wy=gg,ky=qg,xy=Jt.f,Ey=gr,Oy=er,Ty=py,Dy=vy,Ny=!1,Ry=et("meta"),Py=0,My=function(g){xy(g,Ry,{value:{objectID:"O"+Py++,weakData:{}}})},By=ay.exports={enable:function(){By.enable=function(){},Ny=!0;var g=Ey.f,t=my([].splice),A={};A[Ry]=1,g(A).length&&(Ey.f=function(A){for(var e=g(A),C=0,I=e.length;CI;I++)if((o=f(g[I]))&&Vy(Ky,o))return o;return new _y(!1)}e=Yy(g,C)}for(n=d?g.next:e.next;!(r=Zy(n,e)).done;){try{o=f(r.value)}catch(g){Qy(e,"throw",g)}if("object"==typeof o&&o&&Vy(Ky,o))return o}return new _y(!1)},Xy=og,Jy=TypeError,qy=function(g,t){if(Xy(t,g))return g;throw new Jy("Incorrect invocation")},$y=TA,gm=C,tm=zy,Am=I,em=uA,Cm=Hy,Im=qy,im=O,om=gg,nm=Q,rm=_I,sm=Jt.f,am=Sr.forEach,dm=D,hm=GC.set,lm=GC.getterFor,cm=function(g,t,A){var e,C=-1!==g.indexOf("Map"),I=-1!==g.indexOf("Weak"),i=C?"set":"add",o=gm[g],n=o&&o.prototype,r={};if(dm&&im(o)&&(I||n.forEach&&!Am((function(){(new o).entries().next()})))){var s=(e=t((function(t,A){hm(Im(t,s),{type:g,collection:new o}),nm(A)||Cm(A,t[i],{that:t,AS_ENTRIES:C})}))).prototype,a=lm(g);am(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(g){var t="add"===g||"set"===g;!(g in n)||I&&"clear"===g||em(s,g,(function(A,e){var C=a(this).collection;if(!t&&I&&!om(A))return"get"===g&&void 0;var i=C[g](0===A?0:A,e);return t?this:i}))})),I||sm(s,"size",{configurable:!0,get:function(){return a(this).collection.size}})}else e=A.getConstructor(t,g,C,i),tm.enable();return rm(e,g,!1,!0),r[g]=e,$y({global:!0,forced:!0},r),I||A.setStrong(e,g,C),e},um=TI,fm=function(g,t,A){for(var e in t)A&&A.unsafe&&g[e]?g[e]=t[e]:um(g,e,t[e],A);return g},pm=ig,vm=ur,ym=D,mm=dt("species"),bm=function(g){var t=pm(g);ym&&t&&!t[mm]&&vm(t,mm,{configurable:!0,get:function(){return this}})},wm=fI,km=ur,xm=fm,Em=Xt,Om=qy,Tm=Q,Dm=Hy,Nm=Ei,Rm=Oi,Pm=bm,Mm=D,Bm=zy.fastKey,zm=GC.set,Sm=GC.getterFor,Zm={getConstructor:function(g,t,A,e){var C=g((function(g,C){Om(g,I),zm(g,{type:t,index:wm(null),first:void 0,last:void 0,size:0}),Mm||(g.size=0),Tm(C)||Dm(C,g[e],{that:g,AS_ENTRIES:A})})),I=C.prototype,i=Sm(t),o=function(g,t,A){var e,C,I=i(g),o=n(g,t);return o?o.value=A:(I.last=o={index:C=Bm(t,!0),key:t,value:A,previous:e=I.last,next:void 0,removed:!1},I.first||(I.first=o),e&&(e.next=o),Mm?I.size++:g.size++,"F"!==C&&(I.index[C]=o)),g},n=function(g,t){var A,e=i(g),C=Bm(t);if("F"!==C)return e.index[C];for(A=e.first;A;A=A.next)if(A.key===t)return A};return xm(I,{clear:function(){for(var g=i(this),t=g.index,A=g.first;A;)A.removed=!0,A.previous&&(A.previous=A.previous.next=void 0),delete t[A.index],A=A.next;g.first=g.last=void 0,Mm?g.size=0:this.size=0},delete:function(g){var t=this,A=i(t),e=n(t,g);if(e){var C=e.next,I=e.previous;delete A.index[e.index],e.removed=!0,I&&(I.next=C),C&&(C.previous=I),A.first===e&&(A.first=C),A.last===e&&(A.last=I),Mm?A.size--:t.size--}return!!e},forEach:function(g){for(var t,A=i(this),e=Em(g,arguments.length>1?arguments[1]:void 0);t=t?t.next:A.first;)for(e(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(g){return!!n(this,g)}}),xm(I,A?{get:function(g){var t=n(this,g);return t&&t.value},set:function(g,t){return o(this,0===g?0:g,t)}}:{add:function(g){return o(this,g=0===g?0:g,g)}}),Mm&&km(I,"size",{configurable:!0,get:function(){return i(this).size}}),C},setStrong:function(g,t,A){var e=t+" Iterator",C=Sm(t),I=Sm(e);Nm(g,t,(function(g,t){zm(this,{type:e,target:g,state:C(g),kind:t,last:void 0})}),(function(){for(var g=I(this),t=g.kind,A=g.last;A&&A.removed;)A=A.previous;return g.target&&(g.last=A=A?A.next:g.state.first)?Rm("keys"===t?A.key:"values"===t?A.value:[A.key,A.value],!1):(g.target=void 0,Rm(void 0,!0))}),A?"entries":"values",!A,!0),Pm(t)}};cm("Map",(function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}}),Zm);var Fm=A(tg.Map),Gm=function(){function g(){cn(this,g),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},pe(this.options,this.defaultOptions)}return kd(g,[{key:"setOptions",value:function(g){var t=["useDefaultGroups"];if(void 0!==g)for(var A in g)if(Object.prototype.hasOwnProperty.call(g,A)&&-1===Xc(t).call(t,A)){var e=g[A];this.add(A,e)}}},{key:"clear",value:function(){this._groups=new Fm,this._groupNames=[]}},{key:"get",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],A=this._groups.get(g);if(void 0===A&&t)if(!1===this.options.useDefaultGroups&&this._groupNames.length>0){var e=this._groupIndex%this._groupNames.length;++this._groupIndex,(A={}).color=this._groups.get(this._groupNames[e]),this._groups.set(g,A)}else{var C=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,(A={}).color=this._defaultGroups[C],this._groups.set(g,A)}return A}},{key:"add",value:function(g,t){return this._groups.has(g)||this._groupNames.push(g),this._groups.set(g,t),t}}]),g}();TA({target:"Number",stat:!0},{isNaN:function(g){return g!=g}});var jm=A(tg.Number.isNaN),Lm=C.isFinite,Vm=Number.isFinite||function(g){return"number"==typeof g&&Lm(g)};TA({target:"Number",stat:!0},{isFinite:Vm});var Ym=A(tg.Number.isFinite),Wm=Sr.some;TA({target:"Array",proto:!0,forced:!_h("some")},{some:function(g){return Wm(this,g,arguments.length>1?arguments[1]:void 0)}});var Qm=Me("Array").some,Um=og,_m=Qm,Km=Array.prototype,Hm=function(g){var t=g.some;return g===Km||Um(Km,g)&&t===Km.some?_m:t},Xm=A(Hm);function Jm(g){if(void 0===g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}var qm=qc,$m=A(qm);TA({target:"Object",stat:!0},{setPrototypeOf:ri});var gb=tg.Object.setPrototypeOf,tb=A(gb),Ab=A(Ge);function eb(g,t){var A;return eb=tb?Ab(A=tb).call(A):function(g,t){return g.__proto__=t,g},eb(g,t)}function Cb(g,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");g.prototype=$m(t&&t.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),kn(g,"prototype",{writable:!1}),t&&eb(g,t)}function Ib(g,t){if(t&&("object"===yd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Jm(g)}var ib=rc,ob=A(ib);function nb(g){var t;return nb=tb?Ab(t=ob).call(t):function(g){return g.__proto__||ob(g)},nb(g)}function rb(g,t,A){return(t=bd(t))in g?kn(g,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):g[t]=A,g}var sb={exports:{}},ab={exports:{}};!function(g){var t=cd,A=pd;function e(C){return g.exports=e="function"==typeof t&&"symbol"==typeof A?function(g){return typeof g}:function(g){return g&&"function"==typeof t&&g.constructor===t&&g!==t.prototype?"symbol":typeof g},g.exports.__esModule=!0,g.exports.default=g.exports,e(C)}g.exports=e,g.exports.__esModule=!0,g.exports.default=g.exports}(ab);var db=ab.exports,hb=el,lb=qg,cb=Dh,ub=T,fb=Jt,pb=gg,vb=uA,yb=Error,mb=u("".replace),bb=String(new yb("zxcasd").stack),wb=/\n\s*at [^:]*:[^\n]*/,kb=wb.test(bb),xb=G,Eb=!I((function(){var g=new Error("a");return!("stack"in g)||(Object.defineProperty(g,"stack",xb(1,7)),7!==g.stack)})),Ob=uA,Tb=function(g,t){if(kb&&"string"==typeof g&&!yb.prepareStackTrace)for(;t--;)g=mb(g,wb,"");return g},Db=Eb,Nb=Error.captureStackTrace,Rb=sC,Pb=TA,Mb=og,Bb=EI,zb=ri,Sb=function(g,t,A){for(var e=cb(t),C=fb.f,I=ub.f,i=0;i2&&jb(A,arguments[2]);var C=[];return Vb(g,Ub,{that:C}),Fb(A,"errors",C),A};zb?zb(_b,Qb):Sb(_b,Qb,{name:!0});var Kb=_b.prototype=Zb(Qb.prototype,{constructor:Gb(1,_b),message:Gb(1,""),name:Gb(1,"AggregateError")});Pb({global:!0,constructor:!0,arity:2},{AggregateError:_b});var Hb,Xb,Jb,qb,$b="process"===y(C.process),gw=ro,tw=Og,Aw=TypeError,ew=function(g){if(gw(g))return g;throw new Aw(tw(g)+" is not a constructor")},Cw=AA,Iw=ew,iw=Q,ow=dt("species"),nw=function(g,t){var A,e=Cw(g).constructor;return void 0===e||iw(A=Cw(e)[ow])?t:Iw(A)},rw=/(?:ipad|iphone|ipod).*applewebkit/i.test(ng),sw=C,aw=a,dw=Xt,hw=O,lw=qg,cw=I,uw=gI,fw=ve,pw=Et,vw=iu,yw=rw,mw=$b,bw=sw.setImmediate,ww=sw.clearImmediate,kw=sw.process,xw=sw.Dispatch,Ew=sw.Function,Ow=sw.MessageChannel,Tw=sw.String,Dw=0,Nw={},Rw="onreadystatechange";cw((function(){Hb=sw.location}));var Pw=function(g){if(lw(Nw,g)){var t=Nw[g];delete Nw[g],t()}},Mw=function(g){return function(){Pw(g)}},Bw=function(g){Pw(g.data)},zw=function(g){sw.postMessage(Tw(g),Hb.protocol+"//"+Hb.host)};bw&&ww||(bw=function(g){vw(arguments.length,1);var t=hw(g)?g:Ew(g),A=fw(arguments,1);return Nw[++Dw]=function(){aw(t,void 0,A)},Xb(Dw),Dw},ww=function(g){delete Nw[g]},mw?Xb=function(g){kw.nextTick(Mw(g))}:xw&&xw.now?Xb=function(g){xw.now(Mw(g))}:Ow&&!yw?(qb=(Jb=new Ow).port2,Jb.port1.onmessage=Bw,Xb=dw(qb.postMessage,qb)):sw.addEventListener&&hw(sw.postMessage)&&!sw.importScripts&&Hb&&"file:"!==Hb.protocol&&!cw(zw)?(Xb=zw,sw.addEventListener("message",Bw,!1)):Xb=Rw in pw("script")?function(g){uw.appendChild(pw("script"))[Rw]=function(){uw.removeChild(this),Pw(g)}}:function(g){setTimeout(Mw(g),0)});var Sw={set:bw,clear:ww},Zw=function(){this.head=null,this.tail=null};Zw.prototype={add:function(g){var t={item:g,next:null},A=this.tail;A?A.next=t:this.head=t,this.tail=t},get:function(){var g=this.head;if(g)return null===(this.head=g.next)&&(this.tail=null),g.item}};var Fw,Gw,jw,Lw,Vw,Yw=Zw,Ww=/ipad|iphone|ipod/i.test(ng)&&"undefined"!=typeof Pebble,Qw=/web0s(?!.*chrome)/i.test(ng),Uw=C,_w=Xt,Kw=T.f,Hw=Sw.set,Xw=Yw,Jw=rw,qw=Ww,$w=Qw,gk=$b,tk=Uw.MutationObserver||Uw.WebKitMutationObserver,Ak=Uw.document,ek=Uw.process,Ck=Uw.Promise,Ik=Kw(Uw,"queueMicrotask"),ik=Ik&&Ik.value;if(!ik){var ok=new Xw,nk=function(){var g,t;for(gk&&(g=ek.domain)&&g.exit();t=ok.get();)try{t()}catch(g){throw ok.head&&Fw(),g}g&&g.enter()};Jw||gk||$w||!tk||!Ak?!qw&&Ck&&Ck.resolve?((Lw=Ck.resolve(void 0)).constructor=Ck,Vw=_w(Lw.then,Lw),Fw=function(){Vw(nk)}):gk?Fw=function(){ek.nextTick(nk)}:(Hw=_w(Hw,Uw),Fw=function(){Hw(nk)}):(Gw=!0,jw=Ak.createTextNode(""),new tk(nk).observe(jw,{characterData:!0}),Fw=function(){jw.data=Gw=!Gw}),ik=function(g){ok.head||Fw(),ok.add(g)}}var rk=ik,sk=function(g){try{return{error:!1,value:g()}}catch(g){return{error:!0,value:g}}},ak=C.Promise,dk="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,hk=!dk&&!$b&&"object"==typeof window&&"object"==typeof document,lk=C,ck=ak,uk=O,fk=Ut,pk=Hi,vk=dt,yk=hk,mk=dk,bk=cg,wk=ck&&ck.prototype,kk=vk("species"),xk=!1,Ek=uk(lk.PromiseRejectionEvent),Ok=fk("Promise",(function(){var g=pk(ck),t=g!==String(ck);if(!t&&66===bk)return!0;if(!wk.catch||!wk.finally)return!0;if(!bk||bk<51||!/native code/.test(g)){var A=new ck((function(g){g(1)})),e=function(g){g((function(){}),(function(){}))};if((A.constructor={})[kk]=e,!(xk=A.then((function(){}))instanceof e))return!0}return!t&&(yk||mk)&&!Ek})),Tk={CONSTRUCTOR:Ok,REJECTION_EVENT:Ek,SUBCLASSING:xk},Dk={},Nk=Rg,Rk=TypeError,Pk=function(g){var t,A;this.promise=new g((function(g,e){if(void 0!==t||void 0!==A)throw new Rk("Bad Promise constructor");t=g,A=e})),this.resolve=Nk(t),this.reject=Nk(A)};Dk.f=function(g){return new Pk(g)};var Mk,Bk,zk=TA,Sk=$b,Zk=C,Fk=P,Gk=TI,jk=_I,Lk=bm,Vk=Rg,Yk=O,Wk=gg,Qk=qy,Uk=nw,_k=Sw.set,Kk=rk,Hk=function(g,t){try{1===arguments.length?console.error(g):console.error(g,t)}catch(g){}},Xk=sk,Jk=Yw,qk=GC,$k=ak,gx=Tk,tx=Dk,Ax="Promise",ex=gx.CONSTRUCTOR,Cx=gx.REJECTION_EVENT,Ix=qk.getterFor(Ax),ix=qk.set,ox=$k&&$k.prototype,nx=$k,rx=ox,sx=Zk.TypeError,ax=Zk.document,dx=Zk.process,hx=tx.f,lx=hx,cx=!!(ax&&ax.createEvent&&Zk.dispatchEvent),ux="unhandledrejection",fx=function(g){var t;return!(!Wk(g)||!Yk(t=g.then))&&t},px=function(g,t){var A,e,C,I=t.value,i=1===t.state,o=i?g.ok:g.fail,n=g.resolve,r=g.reject,s=g.domain;try{o?(i||(2===t.rejection&&wx(t),t.rejection=1),!0===o?A=I:(s&&s.enter(),A=o(I),s&&(s.exit(),C=!0)),A===g.promise?r(new sx("Promise-chain cycle")):(e=fx(A))?Fk(e,A,n,r):n(A)):r(I)}catch(g){s&&!C&&s.exit(),r(g)}},vx=function(g,t){g.notified||(g.notified=!0,Kk((function(){for(var A,e=g.reactions;A=e.get();)px(A,g);g.notified=!1,t&&!g.rejection&&mx(g)})))},yx=function(g,t,A){var e,C;cx?((e=ax.createEvent("Event")).promise=t,e.reason=A,e.initEvent(g,!1,!0),Zk.dispatchEvent(e)):e={promise:t,reason:A},!Cx&&(C=Zk["on"+g])?C(e):g===ux&&Hk("Unhandled promise rejection",A)},mx=function(g){Fk(_k,Zk,(function(){var t,A=g.facade,e=g.value;if(bx(g)&&(t=Xk((function(){Sk?dx.emit("unhandledRejection",e,A):yx(ux,A,e)})),g.rejection=Sk||bx(g)?2:1,t.error))throw t.value}))},bx=function(g){return 1!==g.rejection&&!g.parent},wx=function(g){Fk(_k,Zk,(function(){var t=g.facade;Sk?dx.emit("rejectionHandled",t):yx("rejectionhandled",t,g.value)}))},kx=function(g,t,A){return function(e){g(t,e,A)}},xx=function(g,t,A){g.done||(g.done=!0,A&&(g=A),g.value=t,g.state=2,vx(g,!0))},Ex=function(g,t,A){if(!g.done){g.done=!0,A&&(g=A);try{if(g.facade===t)throw new sx("Promise can't be resolved itself");var e=fx(t);e?Kk((function(){var A={done:!1};try{Fk(e,t,kx(Ex,A,g),kx(xx,A,g))}catch(t){xx(A,t,g)}})):(g.value=t,g.state=1,vx(g,!1))}catch(t){xx({done:!1},t,g)}}};ex&&(rx=(nx=function(g){Qk(this,rx),Vk(g),Fk(Mk,this);var t=Ix(this);try{g(kx(Ex,t),kx(xx,t))}catch(g){xx(t,g)}}).prototype,(Mk=function(g){ix(this,{type:Ax,done:!1,notified:!1,parent:!1,reactions:new Jk,rejection:!1,state:0,value:void 0})}).prototype=Gk(rx,"then",(function(g,t){var A=Ix(this),e=hx(Uk(this,nx));return A.parent=!0,e.ok=!Yk(g)||g,e.fail=Yk(t)&&t,e.domain=Sk?dx.domain:void 0,0===A.state?A.reactions.add(e):Kk((function(){px(e,A)})),e.promise})),Bk=function(){var g=new Mk,t=Ix(g);this.promise=g,this.resolve=kx(Ex,t),this.reject=kx(xx,t)},tx.f=hx=function(g){return g===nx||undefined===g?new Bk(g):lx(g)}),zk({global:!0,constructor:!0,wrap:!0,forced:ex},{Promise:nx}),jk(nx,Ax,!1,!0),Lk(Ax);var Ox=ak,Tx=Tk.CONSTRUCTOR||!Yo((function(g){Ox.all(g).then(void 0,(function(){}))})),Dx=P,Nx=Rg,Rx=Dk,Px=sk,Mx=Hy;TA({target:"Promise",stat:!0,forced:Tx},{all:function(g){var t=this,A=Rx.f(t),e=A.resolve,C=A.reject,I=Px((function(){var A=Nx(t.resolve),I=[],i=0,o=1;Mx(g,(function(g){var n=i++,r=!1;o++,Dx(A,t,g).then((function(g){r||(r=!0,I[n]=g,--o||e(I))}),C)})),--o||e(I)}));return I.error&&C(I.value),A.promise}});var Bx=TA,zx=Tk.CONSTRUCTOR;ak&&ak.prototype,Bx({target:"Promise",proto:!0,forced:zx,real:!0},{catch:function(g){return this.then(void 0,g)}});var Sx=P,Zx=Rg,Fx=Dk,Gx=sk,jx=Hy;TA({target:"Promise",stat:!0,forced:Tx},{race:function(g){var t=this,A=Fx.f(t),e=A.reject,C=Gx((function(){var C=Zx(t.resolve);jx(g,(function(g){Sx(C,t,g).then(A.resolve,e)}))}));return C.error&&e(C.value),A.promise}});var Lx=P,Vx=Dk;TA({target:"Promise",stat:!0,forced:Tk.CONSTRUCTOR},{reject:function(g){var t=Vx.f(this);return Lx(t.reject,void 0,g),t.promise}});var Yx=AA,Wx=gg,Qx=Dk,Ux=function(g,t){if(Yx(g),Wx(t)&&t.constructor===g)return t;var A=Qx.f(g);return(0,A.resolve)(t),A.promise},_x=TA,Kx=ak,Hx=Tk.CONSTRUCTOR,Xx=Ux,Jx=ig("Promise"),qx=!Hx;_x({target:"Promise",stat:!0,forced:true},{resolve:function(g){return Xx(qx&&this===Jx?Kx:this,g)}});var $x=P,gE=Rg,tE=Dk,AE=sk,eE=Hy;TA({target:"Promise",stat:!0,forced:Tx},{allSettled:function(g){var t=this,A=tE.f(t),e=A.resolve,C=A.reject,I=AE((function(){var A=gE(t.resolve),C=[],I=0,i=1;eE(g,(function(g){var o=I++,n=!1;i++,$x(A,t,g).then((function(g){n||(n=!0,C[o]={status:"fulfilled",value:g},--i||e(C))}),(function(g){n||(n=!0,C[o]={status:"rejected",reason:g},--i||e(C))}))})),--i||e(C)}));return I.error&&C(I.value),A.promise}});var CE=P,IE=Rg,iE=ig,oE=Dk,nE=sk,rE=Hy,sE="No one promise resolved";TA({target:"Promise",stat:!0,forced:Tx},{any:function(g){var t=this,A=iE("AggregateError"),e=oE.f(t),C=e.resolve,I=e.reject,i=nE((function(){var e=IE(t.resolve),i=[],o=0,n=1,r=!1;rE(g,(function(g){var s=o++,a=!1;n++,CE(e,t,g).then((function(g){a||r||(r=!0,C(g))}),(function(g){a||r||(a=!0,i[s]=g,--n||I(new A(i,sE)))}))})),--n||I(new A(i,sE))}));return i.error&&I(i.value),e.promise}});var aE=TA,dE=ak,hE=I,lE=ig,cE=O,uE=nw,fE=Ux,pE=dE&&dE.prototype;aE({target:"Promise",proto:!0,real:!0,forced:!!dE&&hE((function(){pE.finally.call({then:function(){}},(function(){}))}))},{finally:function(g){var t=uE(this,lE("Promise")),A=cE(g);return this.then(A?function(A){return fE(t,g()).then((function(){return A}))}:g,A?function(A){return fE(t,g()).then((function(){throw A}))}:g)}});var vE=tg.Promise,yE=Dk;TA({target:"Promise",stat:!0},{withResolvers:function(){var g=yE.f(this);return{promise:g.promise,resolve:g.resolve,reject:g.reject}}});var mE=vE,bE=Dk,wE=sk;TA({target:"Promise",stat:!0,forced:!0},{try:function(g){var t=bE.f(this),A=wE(g);return(A.error?t.reject:t.resolve)(A.value),t.promise}});var kE=mE,xE=ll;!function(g){var t=db.default,A=wn,e=cd,C=qm,I=ib,i=hb,o=Ld,n=gb,r=kE,s=xE,a=rh;function d(){g.exports=d=function(){return l},g.exports.__esModule=!0,g.exports.default=g.exports;var h,l={},c=Object.prototype,u=c.hasOwnProperty,f=A||function(g,t,A){g[t]=A.value},p="function"==typeof e?e:{},v=p.iterator||"@@iterator",y=p.asyncIterator||"@@asyncIterator",m=p.toStringTag||"@@toStringTag";function b(g,t,e){return A(g,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),g[t]}try{b({},"")}catch(h){b=function(g,t,A){return g[t]=A}}function w(g,t,A,e){var I=t&&t.prototype instanceof N?t:N,i=C(I.prototype),o=new V(e||[]);return f(i,"_invoke",{value:F(g,A,o)}),i}function k(g,t,A){try{return{type:"normal",arg:g.call(t,A)}}catch(g){return{type:"throw",arg:g}}}l.wrap=w;var x="suspendedStart",E="suspendedYield",O="executing",T="completed",D={};function N(){}function R(){}function P(){}var M={};b(M,v,(function(){return this}));var B=I&&I(I(Y([])));B&&B!==c&&u.call(B,v)&&(M=B);var z=P.prototype=N.prototype=C(M);function S(g){var t;i(t=["next","throw","return"]).call(t,(function(t){b(g,t,(function(g){return this._invoke(t,g)}))}))}function Z(g,A){function e(C,I,i,o){var n=k(g[C],g,I);if("throw"!==n.type){var r=n.arg,s=r.value;return s&&"object"==t(s)&&u.call(s,"__await")?A.resolve(s.__await).then((function(g){e("next",g,i,o)}),(function(g){e("throw",g,i,o)})):A.resolve(s).then((function(g){r.value=g,i(r)}),(function(g){return e("throw",g,i,o)}))}o(n.arg)}var C;f(this,"_invoke",{value:function(g,t){function I(){return new A((function(A,C){e(g,t,A,C)}))}return C=C?C.then(I,I):I()}})}function F(g,t,A){var e=x;return function(C,I){if(e===O)throw new Error("Generator is already running");if(e===T){if("throw"===C)throw I;return{value:h,done:!0}}for(A.method=C,A.arg=I;;){var i=A.delegate;if(i){var o=G(i,A);if(o){if(o===D)continue;return o}}if("next"===A.method)A.sent=A._sent=A.arg;else if("throw"===A.method){if(e===x)throw e=T,A.arg;A.dispatchException(A.arg)}else"return"===A.method&&A.abrupt("return",A.arg);e=O;var n=k(g,t,A);if("normal"===n.type){if(e=A.done?T:E,n.arg===D)continue;return{value:n.arg,done:A.done}}"throw"===n.type&&(e=T,A.method="throw",A.arg=n.arg)}}}function G(g,t){var A=t.method,e=g.iterator[A];if(e===h)return t.delegate=null,"throw"===A&&g.iterator.return&&(t.method="return",t.arg=h,G(g,t),"throw"===t.method)||"return"!==A&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+A+"' method")),D;var C=k(e,g.iterator,t.arg);if("throw"===C.type)return t.method="throw",t.arg=C.arg,t.delegate=null,D;var I=C.arg;return I?I.done?(t[g.resultName]=I.value,t.next=g.nextLoc,"return"!==t.method&&(t.method="next",t.arg=h),t.delegate=null,D):I:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,D)}function j(g){var t,A={tryLoc:g[0]};1 in g&&(A.catchLoc=g[1]),2 in g&&(A.finallyLoc=g[2],A.afterLoc=g[3]),o(t=this.tryEntries).call(t,A)}function L(g){var t=g.completion||{};t.type="normal",delete t.arg,g.completion=t}function V(g){this.tryEntries=[{tryLoc:"root"}],i(g).call(g,j,this),this.reset(!0)}function Y(g){if(g||""===g){var A=g[v];if(A)return A.call(g);if("function"==typeof g.next)return g;if(!isNaN(g.length)){var e=-1,C=function t(){for(;++e=0;--e){var C=this.tryEntries[e],I=C.completion;if("root"===C.tryLoc)return A("end");if(C.tryLoc<=this.prev){var i=u.call(C,"catchLoc"),o=u.call(C,"finallyLoc");if(i&&o){if(this.prev=0;--A){var e=this.tryEntries[A];if(e.tryLoc<=this.prev&&u.call(e,"finallyLoc")&&this.prev=0;--t){var A=this.tryEntries[t];if(A.finallyLoc===g)return this.complete(A.completion,A.afterLoc),L(A),D}},catch:function(g){for(var t=this.tryEntries.length-1;t>=0;--t){var A=this.tryEntries[t];if(A.tryLoc===g){var e=A.completion;if("throw"===e.type){var C=e.arg;L(A)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(g,t,A){return this.delegate={iterator:Y(g),resultName:t,nextLoc:A},"next"===this.method&&(this.arg=h),D}},l}g.exports=d,g.exports.__esModule=!0,g.exports.default=g.exports}(sb);var EE=(0,sb.exports)(),OE=EE;try{regeneratorRuntime=EE}catch(g){"object"==typeof globalThis?globalThis.regeneratorRuntime=EE:Function("r","regeneratorRuntime = r")(EE)}var TE=A(OE),DE=Rg,NE=Hg,RE=W,PE=jA,ME=TypeError,BE=function(g){return function(t,A,e,C){DE(A);var I=NE(t),i=RE(I),o=PE(I),n=g?o-1:0,r=g?-1:1;if(e<2)for(;;){if(n in i){C=i[n],n+=r;break}if(n+=r,g?n<0:o<=n)throw new ME("Reduce of empty array with no initial value")}for(;g?n>=0:o>n;n+=r)n in i&&(C=A(C,i[n],n,I));return C}},zE={left:BE(!1),right:BE(!0)}.left;TA({target:"Array",proto:!0,forced:!$b&&cg>79&&cg<83||!_h("reduce")},{reduce:function(g){var t=arguments.length;return zE(this,g,t,t>1?arguments[1]:void 0)}});var SE=Me("Array").reduce,ZE=og,FE=SE,GE=Array.prototype,jE=function(g){var t=g.reduce;return g===GE||ZE(GE,g)&&t===GE.reduce?FE:t},LE=A(jE),VE=En,YE=jA,WE=Tn,QE=Xt,UE=function(g,t,A,e,C,I,i,o){for(var n,r,s=C,a=0,d=!!i&&QE(i,o);a0&&VE(n)?(r=YE(n),s=UE(g,t,n,r,s,I-1)-1):(WE(s+1),g[s]=n),s++),a++;return s},_E=UE,KE=Rg,HE=Hg,XE=jA,JE=zn;TA({target:"Array",proto:!0},{flatMap:function(g){var t,A=HE(this),e=XE(A);return KE(g),(t=JE(A,0)).length=_E(t,A,A,e,0,1,g,arguments.length>1?arguments[1]:void 0),t}});var qE=Me("Array").flatMap,$E=og,gO=qE,tO=Array.prototype,AO=function(g){var t=g.flatMap;return g===tO||$E(tO,g)&&t===tO.flatMap?gO:t},eO=A(AO);cm("Set",(function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}}),Zm);var CO=A(tg.Set),IO=A(fd),iO=A(Oo),oO=rr,nO=Math.floor,rO=function(g,t){var A=g.length,e=nO(A/2);return A<8?sO(g,t):aO(g,rO(oO(g,0,e),t),rO(oO(g,e),t),t)},sO=function(g,t){for(var A,e,C=g.length,I=1;I0;)g[e]=g[--e];e!==I++&&(g[e]=A)}return g},aO=function(g,t,A,e){for(var C=t.length,I=A.length,i=0,o=0;i3)){if(DO)return!0;if(RO)return RO<603;var g,t,A,e,C="";for(g=65;g<76;g++){switch(t=String.fromCharCode(g),g){case 66:case 69:case 70:case 72:A=3;break;case 68:case 71:A=4;break;default:A=2}for(e=0;e<47;e++)PO.push({k:t+e,v:A})}for(PO.sort((function(g,t){return t.v-g.v})),e=0;ekO(A)?1:-1}}(g)),A=bO(C),e=0;eo;)void 0!==(A=C(e,t=I[o++]))&&KT(i,t,A);return i}});var HT=A(tg.Object.getOwnPropertyDescriptors),XT={exports:{}},JT=TA,qT=D,$T=UC.f;JT({target:"Object",stat:!0,forced:Object.defineProperties!==$T,sham:!qT},{defineProperties:$T});var gD=tg.Object,tD=XT.exports=function(g,t){return gD.defineProperties(g,t)};gD.defineProperties.sham&&(tD.sham=!0);var AD=A(XT.exports);let eD;const CD=new Uint8Array(16);function ID(){if(!eD&&(eD="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!eD))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return eD(CD)}const iD=[];for(let g=0;g<256;++g)iD.push((g+256).toString(16).slice(1));var oD,nD={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function rD(g,t,A){if(nD.randomUUID&&!t&&!g)return nD.randomUUID();const e=(g=g||{}).random||(g.rng||ID)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,t){A=A||0;for(let g=0;g<16;++g)t[A+g]=e[g];return t}return function(g,t=0){return iD[g[t+0]]+iD[g[t+1]]+iD[g[t+2]]+iD[g[t+3]]+"-"+iD[g[t+4]]+iD[g[t+5]]+"-"+iD[g[t+6]]+iD[g[t+7]]+"-"+iD[g[t+8]]+iD[g[t+9]]+"-"+iD[g[t+10]]+iD[g[t+11]]+iD[g[t+12]]+iD[g[t+13]]+iD[g[t+14]]+iD[g[t+15]]}(e)}function sD(g,t){var A=Lh(g);if(BT){var e=BT(g);t&&(e=fc(e).call(e,(function(t){return WT(g,t).enumerable}))),A.push.apply(A,e)}return A}function aD(g){for(var t=1;t=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function lD(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);Athis.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&"number"==typeof this.delay&&(this._timeout=wu((function(){g.flush()}),this.delay))}},{key:"flush",value:function(){var g,t;Cl(g=Zl(t=this._queue).call(t,0)).call(g,(function(g){g.fn.apply(g.context||g.fn,g.args||[])}))}}],[{key:"extend",value:function(t,A){var e=new g(A);if(void 0!==t.flush)throw new Error("Target object already has a property flush");t.flush=function(){e.flush()};var C=[{name:"flush",original:void 0}];if(A&&A.replace)for(var I=0;IC&&(C=n,e=o)}return e}},{key:"min",value:function(g){var t=iO(this._pairs),A=t.next();if(A.done)return null;for(var e=A.value[1],C=g(A.value[1],A.value[0]);!(A=t.next()).done;){var I=lh(A.value,2),i=I[0],o=I[1],n=g(o,i);n1?A-1:0),C=1;CC?1:eC)&&(e=i,C=o)}}catch(g){I.e(g)}finally{I.f()}return e||null}},{key:"min",value:function(g){var t,A,e=null,C=null,I=hD(nT(t=this._data).call(t));try{for(I.s();!(A=I.n()).done;){var i=A.value,o=i[g];"number"==typeof o&&(null==C||ot.x&&g.topt.y}function QD(g){return"string"==typeof g&&""!==g}function UD(g,t,A,e){var C=e.x,I=e.y;if("function"==typeof e.distanceToBorder){var i=e.distanceToBorder(g,t),o=Math.sin(t)*i,n=Math.cos(t)*i;n===i?(C+=i,I=e.y):o===i?(C=e.x,I-=i):(C+=n,I-=o)}else e.shape.width>e.shape.height?(C=e.x+.5*e.shape.width,I=e.y-A):(C=e.x+A,I=e.y-.5*e.shape.height);return{x:C,y:I}}var _D=function(){function g(t){cn(this,g),this.measureText=t,this.current=0,this.width=0,this.height=0,this.lines=[]}return kd(g,[{key:"_add",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal";void 0===this.lines[g]&&(this.lines[g]={width:0,height:0,blocks:[]});var e=t;void 0!==t&&""!==t||(e=" ");var C=this.measureText(e,A),I=pe({},nT(C));I.text=t,I.width=C.width,I.mod=A,void 0!==t&&""!==t||(I.width=0),this.lines[g].blocks.push(I),this.lines[g].width+=I.width}},{key:"curWidth",value:function(){var g=this.lines[this.current];return void 0===g?0:g.width}},{key:"append",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,g,t)}},{key:"newLine",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,g,t),this.current++}},{key:"determineLineHeights",value:function(){for(var g=0;gg&&(g=e.width),t+=e.height}this.width=g,this.height=t}},{key:"removeEmptyBlocks",value:function(){for(var g=[],t=0;t"://,""://,""://,"":/<\/b>/,"":/<\/i>/,"":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},HD=function(){function g(t){cn(this,g),this.text=t,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}return kd(g,[{key:"mod",value:function(){return 0===this.modStack.length?"normal":this.modStack[0]}},{key:"modName",value:function(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":this.bold&&this.ital?"boldital":this.bold?"bold":this.ital?"ital":void 0}},{key:"emitBlock",value:function(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}},{key:"add",value:function(g){" "===g&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=g&&(this.buffer+=g)}},{key:"parseWS",value:function(g){return!!/[ \t]/.test(g)&&(this.mono?this.add(g):this.spacing=!0,!0)}},{key:"setTag",value:function(g){this.emitBlock(),this[g]=!0,this.modStack.unshift(g)}},{key:"unsetTag",value:function(g){this.emitBlock(),this[g]=!1,this.modStack.shift()}},{key:"parseStartTag",value:function(g,t){return!(this.mono||this[g]||!this.match(t))&&(this.setTag(g),!0)}},{key:"match",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],A=lh(this.prepareRegExp(g),2),e=A[0],C=A[1],I=e.test(this.text.substr(this.position,C));return I&&t&&(this.position+=C-1),I}},{key:"parseEndTag",value:function(g,t,A){var e=this.mod()===g;return!(!(e="mono"===g?e&&this.mono:e&&!this.mono)||!this.match(t))&&(void 0!==A?(this.position===this.text.length-1||this.match(A,!1))&&this.unsetTag(g):this.unsetTag(g),!0)}},{key:"replace",value:function(g,t){return!!this.match(g)&&(this.add(t),this.position+=length-1,!0)}},{key:"prepareRegExp",value:function(g){var t,A;if(g instanceof RegExp)A=g,t=1;else{var e=KD[g];A=void 0!==e?e:new RegExp(g),t=g.length}return[A,t]}}]),g}(),XD=function(){function g(t,A,e,C){var I=this;cn(this,g),this.ctx=t,this.parent=A,this.selected=e,this.hover=C;this.lines=new _D((function(g,A){if(void 0===g)return 0;var i=I.parent.getFormattingValues(t,e,C,A),o=0;""!==g&&(o=I.ctx.measureText(g).width);return{width:o,values:i}}))}return kd(g,[{key:"process",value:function(g){if(!QD(g))return this.lines.finalize();var t=this.parent.fontOptions;g=(g=g.replace(/\r\n/g,"\n")).replace(/\r/g,"\n");var A=String(g).split("\n"),e=A.length;if(t.multi)for(var C=0;C0)for(var i=0;i0)for(var d=0;d")||t.parseStartTag("ital","")||t.parseStartTag("mono","")||t.parseEndTag("bold","")||t.parseEndTag("ital","")||t.parseEndTag("mono",""))||A(e)||t.add(e),t.position++}return t.emitBlock(),t.blocks}},{key:"splitMarkdownBlocks",value:function(g){for(var t=this,A=new HD(g),e=!0,C=function(g){return!!/\\/.test(g)&&(A.positionthis.parent.fontOptions.maxWdt}},{key:"getLongestFit",value:function(g){for(var t="",A=0;A1&&void 0!==arguments[1]?arguments[1]:"normal",A=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t);for(var e=(g=(g=g.replace(/^( +)/g,"$1\r")).replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r")).split("\r");e.length>0;){var C=this.getLongestFit(e);if(0===C){var I=e[0],i=this.getLongestFitWord(I);this.lines.newLine(wh(I).call(I,0,i),t),e[0]=wh(I).call(I,i)}else{var o=C;" "===e[C-1]?C--:" "===e[o]&&o++;var n=wh(e).call(e,0,C).join("");C==e.length&&A?this.lines.append(n,t):this.lines.newLine(n,t),e=wh(e).call(e,o)}}}}]),g}(),JD=["bold","ital","boldital","mono"],qD=function(){function g(t,A){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];cn(this,g),this.body=t,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(A),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=e}return kd(g,[{key:"setOptions",value:function(g){if(this.elementOptions=g,this.initFontOptions(g.font),QD(g.label)?this.labelDirty=!0:g.label=void 0,void 0!==g.font&&null!==g.font)if("string"==typeof g.font)this.baseSize=this.fontOptions.size;else if("object"===yd(g.font)){var t=g.font.size;void 0!==t&&(this.baseSize=t)}}},{key:"initFontOptions",value:function(t){var A=this;tv(JD,(function(g){A.fontOptions[g]={}})),g.parseFontString(this.fontOptions,t)?this.fontOptions.vadjust=0:tv(t,(function(g,t){null!=g&&"object"!==yd(g)&&(A.fontOptions[t]=g)}))}},{key:"constrain",value:function(g){var t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},A=lv(g,"widthConstraint");if("number"==typeof A)t.maxWdt=Number(A),t.minWdt=Number(A);else if("object"===yd(A)){var e=lv(g,["widthConstraint","maximum"]);"number"==typeof e&&(t.maxWdt=Number(e));var C=lv(g,["widthConstraint","minimum"]);"number"==typeof C&&(t.minWdt=Number(C))}var I=lv(g,"heightConstraint");if("number"==typeof I)t.minHgt=Number(I);else if("object"===yd(I)){var i=lv(g,["heightConstraint","minimum"]);"number"==typeof i&&(t.minHgt=Number(i));var o=lv(g,["heightConstraint","valign"]);"string"==typeof o&&("top"!==o&&"bottom"!==o||(t.valign=o))}return t}},{key:"update",value:function(g,t){this.setOptions(g,!0),this.propagateFonts(t),qp(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=YD("label",t)}},{key:"adjustSizes",value:function(g){var t=g?g.right+g.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);var A=g?g.top+g.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=A)}},{key:"addFontOptionsToPile",value:function(g,t){for(var A=0;A5&&void 0!==arguments[5]?arguments[5]:"middle";if(void 0!==this.elementOptions.label){var i=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&i=this.elementOptions.scaling.label.maxVisible&&(i=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(g,e,C,t,A,I),this._drawBackground(g),this._drawText(g,t,this.size.yLine,I,i))}}},{key:"_drawBackground",value:function(g){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){g.fillStyle=this.fontOptions.background;var t=this.getSize();g.fillRect(t.left,t.top,t.width,t.height)}}},{key:"_drawText",value:function(g,t,A){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle",C=arguments.length>4?arguments[4]:void 0,I=lh(this._setAlignment(g,t,A,e),2);t=I[0],A=I[1],g.textAlign="left",t-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&("top"===this.fontOptions.valign&&(A-=(this.size.height-this.size.labelHeight)/2),"bottom"===this.fontOptions.valign&&(A+=(this.size.height-this.size.labelHeight)/2));for(var i=0;i0&&(g.lineWidth=s.strokeWidth,g.strokeStyle=h,g.lineJoin="round"),g.fillStyle=d,s.strokeWidth>0&&g.strokeText(s.text,t+n,A+s.vadjust),g.fillText(s.text,t+n,A+s.vadjust),n+=s.width}A+=o.height}}}},{key:"_setAlignment",value:function(g,t,A,e){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&!1===this.pointToSelf){t=0,A=0;"top"===this.fontOptions.align?(g.textBaseline="alphabetic",A-=4):"bottom"===this.fontOptions.align?(g.textBaseline="hanging",A+=4):g.textBaseline="middle"}else g.textBaseline=e;return[t,A]}},{key:"_getColor",value:function(g,t,A){var e=g||"#000000",C=A||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){var I=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));e=ev(e,I),C=ev(C,I)}return[e,C]}},{key:"getTextSize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],A=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._processLabel(g,t,A),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"getSize",value:function(){var g=this.size.left,t=this.size.top-1;if(this.isEdgeLabel){var A=.5*-this.size.width;switch(this.fontOptions.align){case"middle":g=A,t=.5*-this.size.height;break;case"top":g=A,t=-(this.size.height+2);break;case"bottom":g=A,t=2}}return{left:g,top:t,width:this.size.width,height:this.size.height}}},{key:"calculateLabelSize",value:function(g,t,A){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,C=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,I=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";this._processLabel(g,t,A),this.size.left=e-.5*this.size.width,this.size.top=C-.5*this.size.height,this.size.yLine=C+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===I&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:"getFormattingValues",value:function(g,t,A,e){var C=function(g,t,A){return"normal"===t?"mod"===A?"":g[A]:void 0!==g[t][A]?g[t][A]:g[A]},I={color:C(this.fontOptions,e,"color"),size:C(this.fontOptions,e,"size"),face:C(this.fontOptions,e,"face"),mod:C(this.fontOptions,e,"mod"),vadjust:C(this.fontOptions,e,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||A)&&("normal"===e&&!0===this.fontOptions.chooser&&this.elementOptions.labelHighlightBold?I.mod="bold":"function"==typeof this.fontOptions.chooser&&this.fontOptions.chooser(I,this.elementOptions.id,t,A));var i="";return void 0!==I.mod&&""!==I.mod&&(i+=I.mod+" "),i+=I.size+"px "+I.face,g.font=i.replace(/"/g,""),I.font=g.font,I.height=I.size,I}},{key:"differentState",value:function(g,t){return g!==this.selectedState||t!==this.hoverState}},{key:"_processLabelText",value:function(g,t,A,e){return new XD(g,this,t,A).process(e)}},{key:"_processLabel",value:function(g,t,A){if(!1!==this.labelDirty||this.differentState(t,A)){var e=this._processLabelText(g,t,A,this.elementOptions.label);this.fontOptions.minWdt>0&&e.width0&&e.height0&&(this.enableBorderDashes(g,t),g.stroke(),this.disableBorderDashes(g,t)),g.restore()}},{key:"performFill",value:function(g,t){g.save(),g.fillStyle=t.color,this.enableShadow(g,t),Bu(g).call(g),this.disableShadow(g,t),g.restore(),this.performStroke(g,t)}},{key:"_addBoundingBoxMargin",value:function(g){this.boundingBox.left-=g,this.boundingBox.top-=g,this.boundingBox.bottom+=g,this.boundingBox.right+=g}},{key:"_updateBoundingBox",value:function(g,t,A,e,C){void 0!==A&&this.resize(A,e,C),this.left=g-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"updateBoundingBox",value:function(g,t,A,e,C){this._updateBoundingBox(g,t,A,e,C)}},{key:"getDimensionsFromLabel",value:function(g,t,A){this.textSize=this.labelModule.getTextSize(g,t,A);var e=this.textSize.width,C=this.textSize.height;return 0===e&&(e=14,C=14),{width:e,height:C}}}]),g}();function gN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var tN=function(g){Cb(A,g);var t=gN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C))._setMargins(C),I}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,A)){var e=this.getDimensionsFromLabel(g,t,A);this.width=e.width+this.margin.right+this.margin.left,this.height=e.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}},{key:"draw",value:function(g,t,A,e,C,I){this.resize(g,e,C),this.left=t-this.width/2,this.top=A-this.height/2,this.initContextForDraw(g,I),Ve(g,this.left,this.top,this.width,this.height,I.borderRadius),this.performFill(g,I),this.updateBoundingBox(t,A,g,e,C),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,e,C)}},{key:"updateBoundingBox",value:function(g,t,A,e,C){this._updateBoundingBox(g,t,A,e,C);var I=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(I)}},{key:"distanceToBorder",value:function(g,t){g&&this.resize(g);var A=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+A}}]),A}($D);function AN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var eN=function(g){Cb(A,g);var t=AN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C)).labelOffset=0,I.selected=!1,I}return kd(A,[{key:"setOptions",value:function(g,t,A){this.options=g,void 0===t&&void 0===A||this.setImages(t,A)}},{key:"setImages",value:function(g,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=g):(this.imageObj=g,this.imageObjAlt=t)}},{key:"switchImages",value:function(g){var t=g&&!this.selected||!g&&this.selected;if(this.selected=g,void 0!==this.imageObjAlt&&t){var A=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=A}}},{key:"_getImagePadding",value:function(){var g={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){var t=this.options.imagePadding;"object"==yd(t)?(g.top=t.top,g.right=t.right,g.bottom=t.bottom,g.left=t.left):(g.top=t,g.right=t,g.bottom=t,g.left=t)}return g}},{key:"_resizeImage",value:function(){var g,t;if(!1===this.options.shapeProperties.useImageSize){var A=1,e=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?A=this.imageObj.width/this.imageObj.height:e=this.imageObj.height/this.imageObj.width),g=2*this.options.size*A,t=2*this.options.size*e}else{var C=this._getImagePadding();g=this.imageObj.width+C.left+C.right,t=this.imageObj.height+C.top+C.bottom}this.width=g,this.height=t,this.radius=.5*this.width}},{key:"_drawRawCircle",value:function(g,t,A,e){this.initContextForDraw(g,e),Le(g,t,A,e.size),this.performFill(g,e)}},{key:"_drawImageAtPosition",value:function(g,t){if(0!=this.imageObj.width){g.globalAlpha=void 0!==t.opacity?t.opacity:1,this.enableShadow(g,t);var A=1;!0===this.options.shapeProperties.interpolation&&(A=this.imageObj.width/this.width/this.body.view.scale);var e=this._getImagePadding(),C=this.left+e.left,I=this.top+e.top,i=this.width-e.left-e.right,o=this.height-e.top-e.bottom;this.imageObj.drawImageAtPosition(g,A,C,I,i,o),this.disableShadow(g,t)}}},{key:"_drawImageLabel",value:function(g,t,A,e,C){var I=0;if(void 0!==this.height){I=.5*this.height;var i=this.labelModule.getTextSize(g,e,C);i.lineCount>=1&&(I+=i.height/2)}var o=A+I;this.options.label&&(this.labelOffset=I),this.labelModule.draw(g,t,o,e,C,"hanging")}}]),A}($D);function CN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var IN=function(g){Cb(A,g);var t=CN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C))._setMargins(C),I}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,A)){var e=this.getDimensionsFromLabel(g,t,A),C=Math.max(e.width+this.margin.right+this.margin.left,e.height+this.margin.top+this.margin.bottom);this.options.size=C/2,this.width=C,this.height=C,this.radius=this.width/2}}},{key:"draw",value:function(g,t,A,e,C,I){this.resize(g,e,C),this.left=t-this.width/2,this.top=A-this.height/2,this._drawRawCircle(g,t,A,I),this.updateBoundingBox(t,A),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,A,e,C)}},{key:"updateBoundingBox",value:function(g,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=t+this.options.size}},{key:"distanceToBorder",value:function(g){return g&&this.resize(g),.5*this.width}}]),A}(eN);function iN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var oN=function(g){Cb(A,g);var t=iN(A);function A(g,e,C,I,i){var o;return cn(this,A),(o=t.call(this,g,e,C)).setImages(I,i),o}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){var e=2*this.options.size;return this.width=e,this.height=e,void(this.radius=.5*this.width)}this.needsRefresh(t,A)&&this._resizeImage()}},{key:"draw",value:function(g,t,A,e,C,I){this.switchImages(e),this.resize();var i=t,o=A;"top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=t,this.top=A,i+=this.width/2,o+=this.height/2):(this.left=t-this.width/2,this.top=A-this.height/2),this._drawRawCircle(g,i,o,I),g.save(),g.clip(),this._drawImageAtPosition(g,I),g.restore(),this._drawImageLabel(g,i,o,e,C),this.updateBoundingBox(t,A)}},{key:"updateBoundingBox",value:function(g,t){"top-left"===this.options.shapeProperties.coordinateOrigin?(this.boundingBox.top=t,this.boundingBox.left=g,this.boundingBox.right=g+2*this.options.size,this.boundingBox.bottom=t+2*this.options.size):(this.boundingBox.top=t-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=t+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}},{key:"distanceToBorder",value:function(g){return g&&this.resize(g),.5*this.width}}]),A}(eN);function nN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var rN=function(g){Cb(A,g);var t=nN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover,e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,A)){var C,I;this.labelModule.getTextSize(g,t,A);var i=2*e.size;this.width=null!==(C=this.customSizeWidth)&&void 0!==C?C:i,this.height=null!==(I=this.customSizeHeight)&&void 0!==I?I:i,this.radius=.5*this.width}}},{key:"_drawShape",value:function(g,t,A,e,C,I,i,o){var n,r=this;return this.resize(g,I,i,o),this.left=e-this.width/2,this.top=C-this.height/2,this.initContextForDraw(g,o),(n=t,Object.prototype.hasOwnProperty.call(Ue,n)?Ue[n]:function(g){for(var t=arguments.length,A=new Array(t>1?t-1:0),e=1;e0&&(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))}}]),A}($D);function sN(g,t){var A=Lh(g);if(BT){var e=BT(g);t&&(e=fc(e).call(e,(function(t){return WT(g,t).enumerable}))),A.push.apply(A,e)}return A}function aN(g){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,A)){var e=this.getDimensionsFromLabel(g,t,A);this.height=2*e.height,this.width=e.width+e.height,this.radius=.5*this.width}}},{key:"draw",value:function(g,t,A,e,C,I){this.resize(g,e,C),this.left=t-.5*this.width,this.top=A-.5*this.height,this.initContextForDraw(g,I),Ye(g,this.left,this.top,this.width,this.height),this.performFill(g,I),this.updateBoundingBox(t,A,g,e,C),this.labelModule.draw(g,t,A,e,C)}},{key:"distanceToBorder",value:function(g,t){g&&this.resize(g);var A=.5*this.width,e=.5*this.height,C=Math.sin(t)*A,I=Math.cos(t)*e;return A*e/Math.sqrt(C*C+I*I)}}]),A}($D);function bN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var wN=function(g){Cb(A,g);var t=bN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C))._setMargins(C),I}return kd(A,[{key:"resize",value:function(g,t,A){this.needsRefresh(t,A)&&(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)}},{key:"draw",value:function(g,t,A,e,C,I){var i=this;return this.resize(g,e,C),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=A-this.height/2,this._icon(g,t,A,e,C,I),{drawExternalLabel:function(){if(void 0!==i.options.label){i.labelModule.draw(g,i.left+i.iconSize.width/2+i.margin.left,A+i.height/2+5,e)}i.updateBoundingBox(t,A)}}}},{key:"updateBoundingBox",value:function(g,t){if(this.boundingBox.top=t-.5*this.options.icon.size,this.boundingBox.left=g-.5*this.options.icon.size,this.boundingBox.right=g+.5*this.options.icon.size,this.boundingBox.bottom=t+.5*this.options.icon.size,void 0!==this.options.label&&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)}}},{key:"_icon",value:function(g,t,A,e,C,I){var i=Number(this.options.icon.size);void 0!==this.options.icon.code?(g.font=[null!=this.options.icon.weight?this.options.icon.weight:e?"bold":"",(null!=this.options.icon.weight&&e?5:0)+i+"px",this.options.icon.face].join(" "),g.fillStyle=this.options.icon.color||"black",g.textAlign="center",g.textBaseline="middle",this.enableShadow(g,I),g.fillText(this.options.icon.code,t,A),this.disableShadow(g,I)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}($D);function kN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var xN=function(g){Cb(A,g);var t=kN(A);function A(g,e,C,I,i){var o;return cn(this,A),(o=t.call(this,g,e,C)).setImages(I,i),o}return kd(A,[{key:"resize",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){var e=2*this.options.size;return this.width=e,void(this.height=e)}this.needsRefresh(t,A)&&this._resizeImage()}},{key:"draw",value:function(g,t,A,e,C,I){g.save(),this.switchImages(e),this.resize();var i=t,o=A;if("top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=t,this.top=A,i+=this.width/2,o+=this.height/2):(this.left=t-this.width/2,this.top=A-this.height/2),!0===this.options.shapeProperties.useBorderWithImage){var n=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,s=(e?r:n)/this.body.view.scale;g.lineWidth=Math.min(this.width,s),g.beginPath();var a=e?this.options.color.highlight.border:C?this.options.color.hover.border:this.options.color.border,d=e?this.options.color.highlight.background:C?this.options.color.hover.background:this.options.color.background;void 0!==I.opacity&&(a=ev(a,I.opacity),d=ev(d,I.opacity)),g.strokeStyle=a,g.fillStyle=d,g.rect(this.left-.5*g.lineWidth,this.top-.5*g.lineWidth,this.width+g.lineWidth,this.height+g.lineWidth),Bu(g).call(g),this.performStroke(g,I),g.closePath()}this._drawImageAtPosition(g,I),this._drawImageLabel(g,i,o,e,C),this.updateBoundingBox(t,A),g.restore()}},{key:"updateBoundingBox",value:function(g,t){this.resize(),"top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=g,this.top=t):(this.left=g-this.width/2,this.top=t-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,void 0!==this.options.label&&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))}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(eN);function EN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var ON=function(g){Cb(A,g);var t=EN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"square",2,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function TN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var DN=function(g){Cb(A,g);var t=TN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"hexagon",4,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function NN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var RN=function(g){Cb(A,g);var t=NN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"star",4,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function PN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var MN=function(g){Cb(A,g);var t=PN(A);function A(g,e,C){var I;return cn(this,A),(I=t.call(this,g,e,C))._setMargins(C),I}return kd(A,[{key:"resize",value:function(g,t,A){this.needsRefresh(t,A)&&(this.textSize=this.labelModule.getTextSize(g,t,A),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)}},{key:"draw",value:function(g,t,A,e,C,I){this.resize(g,e,C),this.left=t-this.width/2,this.top=A-this.height/2,this.enableShadow(g,I),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,e,C),this.disableShadow(g,I),this.updateBoundingBox(t,A,g,e,C)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}($D);function BN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var zN=function(g){Cb(A,g);var t=BN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"triangle",3,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function SN(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var ZN=function(g){Cb(A,g);var t=SN(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"draw",value:function(g,t,A,e,C,I){return this._drawShape(g,"triangleDown",3,t,A,e,C,I)}},{key:"distanceToBorder",value:function(g,t){return this._distanceToBorder(g,t)}}]),A}(rN);function FN(g,t){var A=Lh(g);if(BT){var e=BT(g);t&&(e=fc(e).call(e,(function(t){return WT(g,t).enumerable}))),A.push.apply(A,e)}return A}function GN(g){for(var t=1;tg.left&&this.shape.topg.top}},{key:"isBoundingBoxOverlappingWith",value:function(g){return this.shape.boundingBox.leftg.left&&this.shape.boundingBox.topg.top}}],[{key:"checkOpacity",value:function(g){return 0<=g&&g<=1}},{key:"checkCoordinateOrigin",value:function(g){return void 0===g||"center"===g||"top-left"===g}},{key:"updateGroupOptions",value:function(t,A,e){var C;if(void 0!==e){var I=t.group;if(void 0!==A&&void 0!==A.group&&I!==A.group)throw new Error("updateGroupOptions: group values in options don't match.");if("number"==typeof I||"string"==typeof I&&""!=I){var i=e.get(I);void 0!==i.opacity&&void 0===A.opacity&&(g.checkOpacity(i.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+i.opacity),i.opacity=void 0));var o=fc(C=VD(A)).call(C,(function(g){return null!=A[g]}));o.push("font"),Jp(o,t,i),t.color=Iv(t.color)}}}},{key:"parseOptions",value:function(t,A){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],C=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},I=arguments.length>4?arguments[4]:void 0;if(Jp(["color","fixed","shadow"],t,A,e),g.checkMass(A),void 0!==t.opacity&&(g.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),void 0!==A.opacity&&(g.checkOpacity(A.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+A.opacity),A.opacity=void 0)),A.shapeProperties&&!g.checkCoordinateOrigin(A.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+A.shapeProperties.coordinateOrigin),dv(t,A,"shadow",C),void 0!==A.color&&null!==A.color){var i=Iv(A.color);Hp(t.color,i)}else!0===e&&null===A.color&&(t.color=av(C.color));void 0!==A.fixed&&null!==A.fixed&&("boolean"==typeof A.fixed?(t.fixed.x=A.fixed,t.fixed.y=A.fixed):(void 0!==A.fixed.x&&"boolean"==typeof A.fixed.x&&(t.fixed.x=A.fixed.x),void 0!==A.fixed.y&&"boolean"==typeof A.fixed.y&&(t.fixed.y=A.fixed.y))),!0===e&&null===A.font&&(t.font=av(C.font)),g.updateGroupOptions(t,A,I),void 0!==A.scaling&&dv(t.scaling,A.scaling,"label",C.scaling)}},{key:"checkMass",value:function(g,t){if(void 0!==g.mass&&g.mass<=0){var A="";void 0!==t&&(A=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+A+", setting mass to 1.",Tv),g.mass=1}}}]),g}();function LN(g,t){var A=void 0!==uh&&ln(g)||g["@@iterator"];if(!A){if(Rh(g)||(A=function(g,t){var A;if(!g)return;if("string"==typeof g)return VN(g,t);var e=wh(A=Object.prototype.toString.call(g)).call(A,8,-1);"Object"===e&&g.constructor&&(e=g.constructor.name);if("Map"===e||"Set"===e)return Uo(g);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return VN(g,t)}(g))||t&&g&&"number"==typeof g.length){A&&(g=A);var e=0,C=function(){};return{s:C,n:function(){return e>=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function VN(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+g.opacity):this.options.opacity=g.opacity),void 0!==g.shape)for(var t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(void 0!==g.font||void 0!==g.widthConstraint||void 0!==g.heightConstraint)for(var A=0,e=Lh(this.body.nodes);A1&&void 0!==arguments[1]&&arguments[1],A=this.body.data.nodes;if(kD("id",g))this.body.data.nodes=g;else if(Rh(g))this.body.data.nodes=new mD,this.body.data.nodes.add(g);else{if(g)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new mD}if(A&&tv(this.nodesListeners,(function(g,t){A.off(t,g)})),this.body.nodes={},this.body.data.nodes){var e=this;tv(this.nodesListeners,(function(g,t){e.body.data.nodes.on(t,g)}));var C=this.body.data.nodes.getIds();this.add(C,!0)}!1===t&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(g){for(var t,A=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=[],C=0;C1&&void 0!==arguments[1]?arguments[1]:jN)(g,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:"refresh",value:function(){var g=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];tv(this.body.nodes,(function(A,e){var C=g.body.data.nodes.get(e);void 0!==C&&(!0===t&&A.setOptions({x:null,y:null}),A.setOptions({fixed:!1}),A.setOptions(C))}))}},{key:"getPositions",value:function(g){var t={};if(void 0!==g){if(!0===Rh(g)){for(var A=0;A0?(e=A/o)*e:A;return o===1/0?1/0:o*eR(C)}});var CR=A(tg.Math.hypot);function IR(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var iR=function(){function g(){cn(this,g)}return kd(g,null,[{key:"transform",value:function(g,t){Rh(g)||(g=[g]);for(var A=t.point.x,e=t.point.y,C=t.angle,I=t.length,i=0;i4&&void 0!==arguments[4]?arguments[4]:this.getViaNode();g.strokeStyle=this.getColor(g,t),g.lineWidth=t.width,!1!==t.dashes?this._drawDashedLine(g,t,C):this._drawLine(g,t,C)}},{key:"_drawLine",value:function(g,t,A,e,C){if(this.from!=this.to)this._line(g,t,A,e,C);else{var I=lh(this._getCircleData(g),3),i=I[0],o=I[1],n=I[2];this._circle(g,t,i,o,n)}}},{key:"_drawDashedLine",value:function(g,t,A,e,C){g.lineCap="round";var I=Rh(t.dashes)?t.dashes:[5,5];if(void 0!==g.setLineDash){if(g.save(),g.setLineDash(I),g.lineDashOffset=0,this.from!=this.to)this._line(g,t,A);else{var i=lh(this._getCircleData(g),3),o=i[0],n=i[1],r=i[2];this._circle(g,t,o,n,r)}g.setLineDash([0]),g.lineDashOffset=0,g.restore()}else{if(this.from!=this.to)Qe(g,this.from.x,this.from.y,this.to.x,this.to.y,I);else{var s=lh(this._getCircleData(g),3),a=s[0],d=s[1],h=s[2];this._circle(g,t,a,d,h)}this.enableShadow(g,t),g.stroke(),this.disableShadow(g,t)}}},{key:"findBorderPosition",value:function(g,t,A){return this.from!=this.to?this._findBorderPosition(g,t,A):this._findBorderPositionCircle(g,t,A)}},{key:"findBorderPositions",value:function(g){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,g),to:this._findBorderPosition(this.to,g)};var t,A=lh(wh(t=this._getCircleData(g)).call(t,0,2),2),e=A[0],C=A[1];return{from:this._findBorderPositionCircle(this.from,g,{x:e,y:C,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,g,{x:e,y:C,low:.6,high:.8,direction:1})}}},{key:"_getCircleData",value:function(g){var t=this.options.selfReference.size;void 0!==g&&void 0===this.from.shape.width&&this.from.shape.resize(g);var A=UD(g,this.options.selfReference.angle,t,this.from);return[A.x,A.y,t]}},{key:"_pointOnCircle",value:function(g,t,A,e){var C=2*e*Math.PI;return{x:g+A*Math.cos(C),y:t-A*Math.sin(C)}}},{key:"_findBorderPositionCircle",value:function(g,t,A){var e,C=A.x,I=A.y,i=A.low,o=A.high,n=A.direction,r=this.options.selfReference.size,s=.5*(i+o),a=0;!0===this.options.arrowStrikethrough&&(-1===n?a=this.options.endPointOffset.from:1===n&&(a=this.options.endPointOffset.to));var d=0;do{s=.5*(i+o),e=this._pointOnCircle(C,I,r,s);var h=Math.atan2(g.y-e.y,g.x-e.x),l=g.distanceToBorder(t,h)+a-Math.sqrt(Math.pow(e.x-g.x,2)+Math.pow(e.y-g.y,2));if(Math.abs(l)<.05)break;l>0?n>0?i=s:o=s:n>0?o=s:i=s,++d}while(i<=o&&d<10);return mR(mR({},e),{},{t:s})}},{key:"getLineWidth",value:function(g,t){return!0===g?Math.max(this.selectionWidth,.3/this._body.view.scale):!0===t?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}},{key:"getColor",value:function(g,t){if(!1!==t.inheritsColor){if("both"===t.inheritsColor&&this.from.id!==this.to.id){var A=g.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),e=this.from.options.color.highlight.border,C=this.to.options.color.highlight.border;return!1===this.from.selected&&!1===this.to.selected?(e=ev(this.from.options.color.border,t.opacity),C=ev(this.to.options.color.border,t.opacity)):!0===this.from.selected&&!1===this.to.selected?C=this.to.options.color.border:!1===this.from.selected&&!0===this.to.selected&&(e=this.from.options.color.border),A.addColorStop(0,e),A.addColorStop(1,C),A}return"to"===t.inheritsColor?ev(this.to.options.color.border,t.opacity):ev(this.from.options.color.border,t.opacity)}return ev(t.color,t.opacity)}},{key:"_circle",value:function(g,t,A,e,C){this.enableShadow(g,t);var I=0,i=2*Math.PI;if(!this.options.selfReference.renderBehindTheNode){var o=this.options.selfReference.angle,n=this.options.selfReference.angle+Math.PI,r=this._findBorderPositionCircle(this.from,g,{x:A,y:e,low:o,high:n,direction:-1}),s=this._findBorderPositionCircle(this.from,g,{x:A,y:e,low:o,high:n,direction:1});I=Math.atan2(r.y-e,r.x-A),i=Math.atan2(s.y-e,s.x-A)}g.beginPath(),g.arc(A,e,C,I,i,!1),g.stroke(),this.disableShadow(g,t)}},{key:"getDistanceToEdge",value:function(g,t,A,e,C,I){if(this.from!=this.to)return this._getDistanceToEdge(g,t,A,e,C,I);var i=lh(this._getCircleData(void 0),3),o=i[0],n=i[1],r=i[2],s=o-C,a=n-I;return Math.abs(Math.sqrt(s*s+a*a)-r)}},{key:"_getDistanceToLine",value:function(g,t,A,e,C,I){var i=A-g,o=e-t,n=((C-g)*i+(I-t)*o)/(i*i+o*o);n>1?n=1:n<0&&(n=0);var r=g+n*i-C,s=t+n*o-I;return Math.sqrt(r*r+s*s)}},{key:"getArrowData",value:function(g,t,A,e,C,I){var i,o,n,r,s,a,d,h=I.width;"from"===t?(n=this.from,r=this.to,s=I.fromArrowScale<0,a=Math.abs(I.fromArrowScale),d=I.fromArrowType):"to"===t?(n=this.to,r=this.from,s=I.toArrowScale<0,a=Math.abs(I.toArrowScale),d=I.toArrowType):(n=this.to,r=this.from,s=I.middleArrowScale<0,a=Math.abs(I.middleArrowScale),d=I.middleArrowType);var l=15*a+3*h;if(n!=r){var c=l/CR(n.x-r.x,n.y-r.y);if("middle"!==t)if(!0===this.options.smooth.enabled){var u=this._findBorderPosition(n,g,{via:A}),f=this.getPoint(u.t+c*("from"===t?1:-1),A);i=Math.atan2(u.y-f.y,u.x-f.x),o=u}else i=Math.atan2(n.y-r.y,n.x-r.x),o=this._findBorderPosition(n,g);else{var p=(s?-c:c)/2,v=this.getPoint(.5+p,A),y=this.getPoint(.5-p,A);i=Math.atan2(v.y-y.y,v.x-y.x),o=this.getPoint(.5,A)}}else{var m=lh(this._getCircleData(g),3),b=m[0],w=m[1],k=m[2];if("from"===t){var x=this.options.selfReference.angle,E=this.options.selfReference.angle+Math.PI,O=this._findBorderPositionCircle(this.from,g,{x:b,y:w,low:x,high:E,direction:-1});i=-2*O.t*Math.PI+1.5*Math.PI+.1*Math.PI,o=O}else if("to"===t){var T=this.options.selfReference.angle,D=this.options.selfReference.angle+Math.PI,N=this._findBorderPositionCircle(this.from,g,{x:b,y:w,low:T,high:D,direction:1});i=-2*N.t*Math.PI+1.5*Math.PI-1.1*Math.PI,o=N}else{var R=this.options.selfReference.angle/(2*Math.PI);o=this._pointOnCircle(b,w,k,R),i=-2*R*Math.PI+1.5*Math.PI+.1*Math.PI}}return{point:o,core:{x:o.x-.9*l*Math.cos(i),y:o.y-.9*l*Math.sin(i)},angle:i,length:l,type:d}}},{key:"drawArrowHead",value:function(g,t,A,e,C){g.strokeStyle=this.getColor(g,t),g.fillStyle=g.strokeStyle,g.lineWidth=t.width,vR.draw(g,C)&&(this.enableShadow(g,t),Bu(g).call(g),this.disableShadow(g,t))}},{key:"enableShadow",value:function(g,t){!0===t.shadow&&(g.shadowColor=t.shadowColor,g.shadowBlur=t.shadowSize,g.shadowOffsetX=t.shadowX,g.shadowOffsetY=t.shadowY)}},{key:"disableShadow",value:function(g,t){!0===t.shadow&&(g.shadowColor="rgba(0,0,0,0)",g.shadowBlur=0,g.shadowOffsetX=0,g.shadowOffsetY=0)}},{key:"drawBackground",value:function(g,t){if(!1!==t.background){var A={strokeStyle:g.strokeStyle,lineWidth:g.lineWidth,dashes:g.dashes};g.strokeStyle=t.backgroundColor,g.lineWidth=t.backgroundSize,this.setStrokeDashed(g,t.backgroundDashes),g.stroke(),g.strokeStyle=A.strokeStyle,g.lineWidth=A.lineWidth,g.dashes=A.dashes,this.setStrokeDashed(g,t.dashes)}}},{key:"setStrokeDashed",value:function(g,t){if(!1!==t)if(void 0!==g.setLineDash){var A=Rh(t)?t:[5,5];g.setLineDash(A)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else void 0!==g.setLineDash?g.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}]),g}();function wR(g,t){var A=Lh(g);if(BT){var e=BT(g);t&&(e=fc(e).call(e,(function(t){return WT(g,t).enumerable}))),A.push.apply(A,e)}return A}function kR(g){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates(),I=!1,i=1,o=0,n=this.to,r=this.options.endPointOffset?this.options.endPointOffset.to:0;g.id===this.from.id&&(n=this.from,I=!0,r=this.options.endPointOffset?this.options.endPointOffset.from:0),!1===this.options.arrowStrikethrough&&(r=0);var s=0;do{e=.5*(o+i),A=this.getPoint(e,C);var a=Math.atan2(n.y-A.y,n.x-A.x),d=n.distanceToBorder(t,a)+r-Math.sqrt(Math.pow(A.x-n.x,2)+Math.pow(A.y-n.y,2));if(Math.abs(d)<.2)break;d<0?!1===I?o=e:i=e:!1===I?i=e:o=e,++s}while(o<=i&&s<10);return kR(kR({},A),{},{t:e})}},{key:"_getDistanceToBezierEdge",value:function(g,t,A,e,C,I,i){var o,n,r,s,a,d=1e9,h=g,l=t;for(n=1;n<10;n++)r=.1*n,s=Math.pow(1-r,2)*g+2*r*(1-r)*i.x+Math.pow(r,2)*A,a=Math.pow(1-r,2)*t+2*r*(1-r)*i.y+Math.pow(r,2)*e,n>0&&(d=(o=this._getDistanceToLine(h,l,s,a,C,I))1&&void 0!==arguments[1]?arguments[1]:this.via;if(this.from===this.to){var A=lh(this._getCircleData(),3),e=A[0],C=A[1],I=A[2],i=2*Math.PI*(1-g);return{x:e+I*Math.sin(i),y:C+I-I*(1-Math.cos(i))}}return{x:Math.pow(1-g,2)*this.fromPoint.x+2*g*(1-g)*t.x+Math.pow(g,2)*this.toPoint.x,y:Math.pow(1-g,2)*this.fromPoint.y+2*g*(1-g)*t.y+Math.pow(g,2)*this.toPoint.y}}},{key:"_findBorderPosition",value:function(g,t){return this._findBorderPositionBezier(g,t,this.via)}},{key:"_getDistanceToEdge",value:function(g,t,A,e,C,I){return this._getDistanceToBezierEdge(g,t,A,e,C,I,this.via)}}]),A}(ER);function DR(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var NR=function(g){Cb(A,g);var t=DR(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"_line",value:function(g,t,A){this._bezierCurve(g,t,A)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var g,t,A=this.options.smooth.roundness,e=this.options.smooth.type,C=Math.abs(this.from.x-this.to.x),I=Math.abs(this.from.y-this.to.y);if("discrete"===e||"diagonalCross"===e){var i,o;i=o=C<=I?A*I:A*C,this.from.x>this.to.x&&(i=-i),this.from.y>=this.to.y&&(o=-o);var n=this.from.x+i,r=this.from.y+o;return"discrete"===e&&(C<=I?n=Cthis.to.x&&(g=-g),this.from.y>=this.to.y&&(t=-t);var y=this.from.x+g,m=this.from.y+t;return C<=I?y=this.from.x<=this.to.x?this.to.xy?this.to.x:y:m=this.from.y>=this.to.y?this.to.y>m?this.to.y:m:this.to.y2&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(g,t,A.via)}},{key:"_getDistanceToEdge",value:function(g,t,A,e,C,I){var i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(g,t,A,e,C,I,i)}},{key:"getPoint",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),A=g;return{x:Math.pow(1-A,2)*this.fromPoint.x+2*A*(1-A)*t.x+Math.pow(A,2)*this.toPoint.x,y:Math.pow(1-A,2)*this.fromPoint.y+2*A*(1-A)*t.y+Math.pow(A,2)*this.toPoint.y}}}]),A}(ER);function RR(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var PR=function(g){Cb(A,g);var t=RR(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"_getDistanceToBezierEdge2",value:function(g,t,A,e,C,I,i,o){for(var n=1e9,r=g,s=t,a=[0,0,0,0],d=1;d<10;d++){var h=.1*d;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);var l=a[0]*g+a[1]*i.x+a[2]*o.x+a[3]*A,c=a[0]*t+a[1]*i.y+a[2]*o.y+a[3]*e;if(d>0){var u=this._getDistanceToLine(r,s,l,c,C,I);n=uMath.abs(I)||!0===this.options.smooth.forceDirection||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(t=this.from.y,e=this.to.y,g=this.from.x-i*C,A=this.to.x+i*C):(t=this.from.y-i*I,e=this.to.y+i*I,g=this.from.x,A=this.to.x),[{x:g,y:t},{x:A,y:e}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(g,t){return this._findBorderPositionBezier(g,t)}},{key:"_getDistanceToEdge",value:function(g,t,A,e,C,I){var i=lh(arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates(),2),o=i[0],n=i[1];return this._getDistanceToBezierEdge2(g,t,A,e,C,I,o,n)}},{key:"getPoint",value:function(g){var t=lh(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),2),A=t[0],e=t[1],C=g,I=[Math.pow(1-C,3),3*C*Math.pow(1-C,2),3*Math.pow(C,2)*(1-C),Math.pow(C,3)];return{x:I[0]*this.fromPoint.x+I[1]*A.x+I[2]*e.x+I[3]*this.toPoint.x,y:I[0]*this.fromPoint.y+I[1]*A.y+I[2]*e.y+I[3]*this.toPoint.y}}}]),A}(PR);function zR(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var SR=function(g){Cb(A,g);var t=zR(A);function A(g,e,C){return cn(this,A),t.call(this,g,e,C)}return kd(A,[{key:"_line",value:function(g,t){g.beginPath(),g.moveTo(this.fromPoint.x,this.fromPoint.y),g.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(g,t),g.stroke(),this.disableShadow(g,t)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(g){return{x:(1-g)*this.fromPoint.x+g*this.toPoint.x,y:(1-g)*this.fromPoint.y+g*this.toPoint.y}}},{key:"_findBorderPosition",value:function(g,t){var A=this.to,e=this.from;g.id===this.from.id&&(A=this.from,e=this.to);var C=Math.atan2(A.y-e.y,A.x-e.x),I=A.x-e.x,i=A.y-e.y,o=Math.sqrt(I*I+i*i),n=(o-g.distanceToBorder(t,C))/o;return{x:(1-n)*e.x+n*A.x,y:(1-n)*e.y+n*A.y,t:0}}},{key:"_getDistanceToEdge",value:function(g,t,A,e,C,I){return this._getDistanceToLine(g,t,A,e,C,I)}}]),A}(bR),ZR=function(){function g(t,A,e,C,I){if(cn(this,g),void 0===A)throw new Error("No body provided");this.options=av(C),this.globalOptions=C,this.defaultOptions=I,this.body=A,this.imagelist=e,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 qD(this.body,this.options,!0),this.setOptions(t)}return kd(g,[{key:"setOptions",value:function(t){if(t){var A=void 0!==t.physics&&this.options.physics!==t.physics||void 0!==t.hidden&&(this.options.hidden||!1)!==(t.hidden||!1)||void 0!==t.from&&this.options.from!==t.from||void 0!==t.to&&this.options.to!==t.to;g.parseOptions(this.options,t,!0,this.globalOptions),void 0!==t.id&&(this.id=t.id),void 0!==t.from&&(this.fromId=t.from),void 0!==t.to&&(this.toId=t.to),void 0!==t.title&&(this.title=t.title),void 0!==t.value&&(t.value=SD(t.value));var e=[t,this.options,this.defaultOptions];return this.chooser=YD("edge",e),this.updateLabelModule(t),A=this.updateEdgeType()||A,this._setInteractionWidths(),this.connect(),A}}},{key:"getFormattingValues",value:function(){var g=!0===this.options.arrows.to||!0===this.options.arrows.to.enabled,t=!0===this.options.arrows.from||!0===this.options.arrows.from.enabled,A=!0===this.options.arrows.middle||!0===this.options.arrows.middle.enabled,e=this.options.color.inherit,C={toArrow:g,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:A,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:e?void 0:this.options.color.color,inheritsColor:e,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(!0===this.chooser){if(this.selected){var I=this.options.selectionWidth;"function"==typeof I?C.width=I(C.width):"number"==typeof I&&(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){var i=this.options.hoverWidth;"function"==typeof i?C.width=i(C.width):"number"==typeof i&&(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"function"==typeof this.chooser&&(this.chooser(C,this.options.id,this.selected,this.hover),void 0!==C.color&&(C.inheritsColor=!1),!1===C.shadow&&(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}},{key:"updateLabelModule",value:function(g){var t=[g,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var g=this.options.smooth,t=!1,A=!0;return void 0!==this.edgeType&&((this.edgeType instanceof TR&&!0===g.enabled&&"dynamic"===g.type||this.edgeType instanceof BR&&!0===g.enabled&&"cubicBezier"===g.type||this.edgeType instanceof NR&&!0===g.enabled&&"dynamic"!==g.type&&"cubicBezier"!==g.type||this.edgeType instanceof SR&&!1===g.type.enabled)&&(A=!1),!0===A&&(t=this.cleanup())),!0===A?!0===g.enabled?"dynamic"===g.type?(t=!0,this.edgeType=new TR(this.options,this.body,this.labelModule)):"cubicBezier"===g.type?this.edgeType=new BR(this.options,this.body,this.labelModule):this.edgeType=new NR(this.options,this.body,this.labelModule):this.edgeType=new SR(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}},{key:"connect",value:function(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=void 0!==this.from&&void 0!==this.to,!0===this.connected?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{key:"disconnect",value:function(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}},{key:"getTitle",value:function(){return this.title}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(g,t,A){if(void 0!==this.options.value){var e=this.options.scaling.customScalingFunction(g,t,A,this.options.value),C=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){var I=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+e*I}this.options.width=this.options.scaling.min+e*C}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){"function"==typeof this.options.hoverWidth?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,"function"==typeof this.options.selectionWidth?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}},{key:"draw",value:function(g){var t=this.getFormattingValues();if(!t.hidden){var A=this.edgeType.getViaNode();this.edgeType.drawLine(g,t,this.selected,this.hover,A),this.drawLabel(g,A)}}},{key:"drawArrows",value:function(g){var t=this.getFormattingValues();if(!t.hidden){var A=this.edgeType.getViaNode(),e={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(e.from=this.edgeType.getArrowData(g,"from",A,this.selected,this.hover,t),!1===t.arrowStrikethrough&&(this.edgeType.fromPoint=e.from.core),t.fromArrowSrc&&(e.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(e.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(e.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(e.to=this.edgeType.getArrowData(g,"to",A,this.selected,this.hover,t),!1===t.arrowStrikethrough&&(this.edgeType.toPoint=e.to.core),t.toArrowSrc&&(e.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(e.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(e.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(e.middle=this.edgeType.getArrowData(g,"middle",A,this.selected,this.hover,t),t.middleArrowSrc&&(e.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(e.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(e.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(g,t,this.selected,this.hover,e.from),t.middleArrow&&this.edgeType.drawArrowHead(g,t,this.selected,this.hover,e.middle),t.toArrow&&this.edgeType.drawArrowHead(g,t,this.selected,this.hover,e.to)}}},{key:"drawLabel",value:function(g,t){if(void 0!==this.options.label){var A,e=this.from,C=this.to;if(this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(g,this.selected,this.hover),e.id!=C.id){this.labelModule.pointToSelf=!1,A=this.edgeType.getPoint(.5,t),g.save();var I=this._getRotation(g);0!=I.angle&&(g.translate(I.x,I.y),g.rotate(I.angle)),this.labelModule.draw(g,A.x,A.y,this.selected,this.hover),g.restore()}else{this.labelModule.pointToSelf=!0;var i=UD(g,this.options.selfReference.angle,this.options.selfReference.size,e);A=this._pointOnCircle(i.x,i.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(g,A.x,A.y,this.selected,this.hover)}}}},{key:"getItemsOnPoint",value:function(g){var t=[];if(this.labelModule.visible()){var A=this._getRotation();WD(this.labelModule.getSize(),g,A)&&t.push({edgeId:this.id,labelId:0})}var e={left:g.x,top:g.y};return this.isOverlappingWith(e)&&t.push({edgeId:this.id}),t}},{key:"isOverlappingWith",value:function(g){if(this.connected){var t=this.from.x,A=this.from.y,e=this.to.x,C=this.to.y,I=g.left,i=g.top;return this.edgeType.getDistanceToEdge(t,A,e,C,I,i)<10}return!1}},{key:"_getRotation",value:function(g){var t=this.edgeType.getViaNode(),A=this.edgeType.getPoint(.5,t);void 0!==g&&this.labelModule.calculateLabelSize(g,this.selected,this.hover,A.x,A.y);var e={x:A.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible())return e;if("horizontal"===this.options.font.align)return e;var C=this.from.y-this.to.y,I=this.from.x-this.to.x,i=Math.atan2(C,I);return(i<-1&&I<0||i>0&&I<0)&&(i+=Math.PI),e.angle=i,e}},{key:"_pointOnCircle",value:function(g,t,A,e){return{x:g+A*Math.cos(e),y:t-A*Math.sin(e)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}},{key:"remove",value:function(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}},{key:"endPointsValid",value:function(){return void 0!==this.body.nodes[this.fromId]&&void 0!==this.body.nodes[this.toId]}}],[{key:"parseOptions",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]&&arguments[2],e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},C=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Xp(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],g,t,A),void 0!==t.endPointOffset&&void 0!==t.endPointOffset.from&&(Ym(t.endPointOffset.from)?g.endPointOffset.from=t.endPointOffset.from:(g.endPointOffset.from=void 0!==e.endPointOffset.from?e.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),void 0!==t.endPointOffset&&void 0!==t.endPointOffset.to&&(Ym(t.endPointOffset.to)?g.endPointOffset.to=t.endPointOffset.to:(g.endPointOffset.to=void 0!==e.endPointOffset.to?e.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),QD(t.label)?g.label=t.label:QD(g.label)||(g.label=void 0),dv(g,t,"smooth",e),dv(g,t,"shadow",e),dv(g,t,"background",e),void 0!==t.dashes&&null!==t.dashes?g.dashes=t.dashes:!0===A&&null===t.dashes&&(g.dashes=$c(e.dashes)),void 0!==t.scaling&&null!==t.scaling?(void 0!==t.scaling.min&&(g.scaling.min=t.scaling.min),void 0!==t.scaling.max&&(g.scaling.max=t.scaling.max),dv(g.scaling,t.scaling,"label",e.scaling)):!0===A&&null===t.scaling&&(g.scaling=$c(e.scaling)),void 0!==t.arrows&&null!==t.arrows)if("string"==typeof t.arrows){var I=t.arrows.toLowerCase();g.arrows.to.enabled=-1!=Xc(I).call(I,"to"),g.arrows.middle.enabled=-1!=Xc(I).call(I,"middle"),g.arrows.from.enabled=-1!=Xc(I).call(I,"from")}else{if("object"!==yd(t.arrows))throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+eu(t.arrows));dv(g.arrows,t.arrows,"to",e.arrows),dv(g.arrows,t.arrows,"middle",e.arrows),dv(g.arrows,t.arrows,"from",e.arrows)}else!0===A&&null===t.arrows&&(g.arrows=$c(e.arrows));if(void 0!==t.color&&null!==t.color){var i=Up(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,o=g.color;if(C)qp(o,e.color,!1,A);else for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&delete o[n];if(Up(o))o.color=o,o.highlight=o,o.hover=o,o.inherit=!1,void 0===i.opacity&&(o.opacity=1);else{var r=!1;void 0!==i.color&&(o.color=i.color,r=!0),void 0!==i.highlight&&(o.highlight=i.highlight,r=!0),void 0!==i.hover&&(o.hover=i.hover,r=!0),void 0!==i.inherit&&(o.inherit=i.inherit),void 0!==i.opacity&&(o.opacity=Math.min(1,Math.max(0,i.opacity))),!0===r?o.inherit=!1:void 0===o.inherit&&(o.inherit="from")}}else!0===A&&null===t.color&&(g.color=av(e.color));!0===A&&null===t.font&&(g.font=av(e.font)),Object.prototype.hasOwnProperty.call(t,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),g.selfReference.size=t.selfReferenceSize)}}]),g}(),FR=function(){function g(t,A,e){var C,I=this;cn(this,g),this.body=t,this.images=A,this.groups=e,this.body.functions.createEdge=je(C=this.create).call(C,this),this.edgesListeners={add:function(g,t){I.add(t.items)},update:function(g,t){I.update(t.items)},remove:function(g,t){I.remove(t.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(g,t,A,e){if(t===g)return.5;var C=1/(t-g);return Math.max(0,(e-g)*C)}},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},qp(this.options,this.defaultOptions),this.bindEventListeners()}return kd(g,[{key:"bindEventListeners",value:function(){var g,t,A=this;this.body.emitter.on("_forceDisableDynamicCurves",(function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];"dynamic"===g&&(g="continuous");var e=!1;for(var C in A.body.edges)if(Object.prototype.hasOwnProperty.call(A.body.edges,C)){var I=A.body.edges[C],i=A.body.data.edges.get(C);if(null!=i){var o=i.smooth;void 0!==o&&!0===o.enabled&&"dynamic"===o.type&&(void 0===g?I.setOptions({smooth:!1}):I.setOptions({smooth:{type:g}}),e=!0)}}!0===t&&!0===e&&A.body.emitter.emit("_dataChanged")})),this.body.emitter.on("_dataUpdated",(function(){A.reconnectEdges()})),this.body.emitter.on("refreshEdges",je(g=this.refresh).call(g,this)),this.body.emitter.on("refresh",je(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",(function(){tv(A.edgesListeners,(function(g,t){A.body.data.edges&&A.body.data.edges.off(t,g)})),delete A.body.functions.createEdge,delete A.edgesListeners.add,delete A.edgesListeners.update,delete A.edgesListeners.remove,delete A.edgesListeners}))}},{key:"setOptions",value:function(g){if(void 0!==g){ZR.parseOptions(this.options,g,!0,this.defaultOptions,!0);var t=!1;if(void 0!==g.smooth)for(var A in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,A)&&(t=this.body.edges[A].updateEdgeType()||t);if(void 0!==g.font)for(var e in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,e)&&this.body.edges[e].updateLabelModule();void 0===g.hidden&&void 0===g.physics&&!0!==t||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(g){var t=this,A=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=this.body.data.edges;if(kD("id",g))this.body.data.edges=g;else if(Rh(g))this.body.data.edges=new mD,this.body.data.edges.add(g);else{if(g)throw new TypeError("Array or DataSet expected");this.body.data.edges=new mD}if(e&&tv(this.edgesListeners,(function(g,t){e.off(t,g)})),this.body.edges={},this.body.data.edges){tv(this.edgesListeners,(function(g,A){t.body.data.edges.on(A,g)}));var C=this.body.data.edges.getIds();this.add(C,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===A&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(g){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],A=this.body.edges,e=this.body.data.edges,C=0;C1&&void 0!==arguments[1])||arguments[1];if(0!==g.length){var A=this.body.edges;tv(g,(function(g){var t=A[g];void 0!==t&&t.remove()})),t&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var g=this;tv(this.body.edges,(function(t,A){var e=g.body.data.edges.get(A);void 0!==e&&t.setOptions(e)}))}},{key:"create",value:function(g){return new ZR(g,this.body,this.images,this.options,this.defaultOptions)}},{key:"reconnectEdges",value:function(){var g,t=this.body.nodes,A=this.body.edges;for(g in t)Object.prototype.hasOwnProperty.call(t,g)&&(t[g].edges=[]);for(g in A)if(Object.prototype.hasOwnProperty.call(A,g)){var e=A[g];e.from=null,e.to=null,e.connect()}}},{key:"getConnectedNodes",value:function(g){var t=[];if(void 0!==this.body.edges[g]){var A=this.body.edges[g];void 0!==A.fromId&&t.push(A.fromId),void 0!==A.toId&&t.push(A.toId)}return t}},{key:"_updateState",value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:"_removeInvalidEdges",value:function(){var g=this,t=[];tv(this.body.edges,(function(A,e){var C=g.body.nodes[A.toId],I=g.body.nodes[A.fromId];void 0!==C&&!0===C.isCluster||void 0!==I&&!0===I.isCluster||void 0!==C&&void 0!==I||t.push(e)})),this.remove(t,!1)}},{key:"_addMissingEdges",value:function(){var g=this.body.data.edges;if(null!=g){var t=this.body.edges,A=[];Cl(g).call(g,(function(g,e){void 0===t[e]&&A.push(e)})),this.add(A,!0)}}}]),g}(),GR=function(){function g(t,A,e){cn(this,g),this.body=t,this.physicsBody=A,this.barnesHutTree,this.setOptions(e),this._rng=Fp("BARNES HUT SOLVER")}return kd(g,[{key:"setOptions",value:function(g){this.options=g,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}},{key:"solve",value:function(){if(0!==this.options.gravitationalConstant&&this.physicsBody.physicsNodeIndices.length>0){var g,t=this.body.nodes,A=this.physicsBody.physicsNodeIndices,e=A.length,C=this._formBarnesHutTree(t,A);this.barnesHutTree=C;for(var I=0;I0&&this._getForceContributions(C.root,g)}}},{key:"_getForceContributions",value:function(g,t){this._getForceContribution(g.children.NW,t),this._getForceContribution(g.children.NE,t),this._getForceContribution(g.children.SW,t),this._getForceContribution(g.children.SE,t)}},{key:"_getForceContribution",value:function(g,t){if(g.childrenCount>0){var A=g.centerOfMass.x-t.x,e=g.centerOfMass.y-t.y,C=Math.sqrt(A*A+e*e);C*g.calcSize>this.thetaInversed?this._calculateForces(C,A,e,t,g):4===g.childrenCount?this._getForceContributions(g,t):g.children.data.id!=t.id&&this._calculateForces(C,A,e,t,g)}}},{key:"_calculateForces",value:function(g,t,A,e,C){0===g&&(t=g=.1),this.overlapAvoidanceFactor<1&&e.shape.radius&&(g=Math.max(.1+this.overlapAvoidanceFactor*e.shape.radius,g-e.shape.radius));var I=this.options.gravitationalConstant*C.mass*e.options.mass/Math.pow(g,3),i=t*I,o=A*I;this.physicsBody.forces[e.id].x+=i,this.physicsBody.forces[e.id].y+=o}},{key:"_formBarnesHutTree",value:function(g,t){for(var A,e=t.length,C=g[t[0]].x,I=g[t[0]].y,i=g[t[0]].x,o=g[t[0]].y,n=1;n0&&(si&&(i=s),ao&&(o=a))}var d=Math.abs(i-C)-Math.abs(o-I);d>0?(I-=.5*d,o+=.5*d):(C+=.5*d,i-=.5*d);var h=Math.max(1e-5,Math.abs(i-C)),l=.5*h,c=.5*(C+i),u=.5*(I+o),f={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:c-l,maxX:c+l,minY:u-l,maxY:u+l},size:h,calcSize:1/h,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(f.root);for(var p=0;p0&&this._placeInTree(f.root,A);return f}},{key:"_updateBranchMass",value:function(g,t){var A=g.centerOfMass,e=g.mass+t.options.mass,C=1/e;A.x=A.x*g.mass+t.x*t.options.mass,A.x*=C,A.y=A.y*g.mass+t.y*t.options.mass,A.y*=C,g.mass=e;var I=Math.max(Math.max(t.height,t.radius),t.width);g.maxWidth=g.maxWidtht.x?C.maxY>t.y?"NW":"SW":C.maxY>t.y?"NE":"SE",this._placeInRegion(g,t,e)}},{key:"_placeInRegion",value:function(g,t,A){var e=g.children[A];switch(e.childrenCount){case 0:e.children.data=t,e.childrenCount=1,this._updateBranchMass(e,t);break;case 1:e.children.data.x===t.x&&e.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(e),this._placeInTree(e,t));break;case 4:this._placeInTree(e,t)}}},{key:"_splitBranch",value:function(g){var t=null;1===g.childrenCount&&(t=g.children.data,g.mass=0,g.centerOfMass.x=0,g.centerOfMass.y=0),g.childrenCount=4,g.children.data=null,this._insertRegion(g,"NW"),this._insertRegion(g,"NE"),this._insertRegion(g,"SW"),this._insertRegion(g,"SE"),null!=t&&this._placeInTree(g,t)}},{key:"_insertRegion",value:function(g,t){var A,e,C,I,i=.5*g.size;switch(t){case"NW":A=g.range.minX,e=g.range.minX+i,C=g.range.minY,I=g.range.minY+i;break;case"NE":A=g.range.minX+i,e=g.range.maxX,C=g.range.minY,I=g.range.minY+i;break;case"SW":A=g.range.minX,e=g.range.minX+i,C=g.range.minY+i,I=g.range.maxY;break;case"SE":A=g.range.minX+i,e=g.range.maxX,C=g.range.minY+i,I=g.range.maxY}g.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:A,maxX:e,minY:C,maxY:I},size:.5*g.size,calcSize:2*g.calcSize,children:{data:null},maxWidth:0,level:g.level+1,childrenCount:0}}},{key:"_debug",value:function(g,t){void 0!==this.barnesHutTree&&(g.lineWidth=1,this._drawBranch(this.barnesHutTree.root,g,t))}},{key:"_drawBranch",value:function(g,t,A){void 0===A&&(A="#FF0000"),4===g.childrenCount&&(this._drawBranch(g.children.NW,t),this._drawBranch(g.children.NE,t),this._drawBranch(g.children.SE,t),this._drawBranch(g.children.SW,t)),t.strokeStyle=A,t.beginPath(),t.moveTo(g.range.minX,g.range.minY),t.lineTo(g.range.maxX,g.range.minY),t.stroke(),t.beginPath(),t.moveTo(g.range.maxX,g.range.minY),t.lineTo(g.range.maxX,g.range.maxY),t.stroke(),t.beginPath(),t.moveTo(g.range.maxX,g.range.maxY),t.lineTo(g.range.minX,g.range.maxY),t.stroke(),t.beginPath(),t.moveTo(g.range.minX,g.range.maxY),t.lineTo(g.range.minX,g.range.minY),t.stroke()}}]),g}(),jR=function(){function g(t,A,e){cn(this,g),this._rng=Fp("REPULSION SOLVER"),this.body=t,this.physicsBody=A,this.setOptions(e)}return kd(g,[{key:"setOptions",value:function(g){this.options=g}},{key:"solve",value:function(){for(var g,t,A,e,C,I,i,o,n=this.body.nodes,r=this.physicsBody.physicsNodeIndices,s=this.physicsBody.forces,a=this.options.nodeDistance,d=-2/3/a,h=0;h0){var I=C.edges.length+1,i=this.options.centralGravity*I*C.options.mass;e[C.id].x=t*i,e[C.id].y=A*i}}}]),A}(WR),HR=function(){function g(t){cn(this,g),this.body=t,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}},pe(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return kd(g,[{key:"bindEventListeners",value:function(){var g=this;this.body.emitter.on("initPhysics",(function(){g.initPhysics()})),this.body.emitter.on("_layoutFailed",(function(){g.layoutFailed=!0})),this.body.emitter.on("resetPhysics",(function(){g.stopSimulation(),g.ready=!1})),this.body.emitter.on("disablePhysics",(function(){g.physicsEnabled=!1,g.stopSimulation()})),this.body.emitter.on("restorePhysics",(function(){g.setOptions(g.options),!0===g.ready&&g.startSimulation()})),this.body.emitter.on("startSimulation",(function(){!0===g.ready&&g.startSimulation()})),this.body.emitter.on("stopSimulation",(function(){g.stopSimulation()})),this.body.emitter.on("destroy",(function(){g.stopSimulation(!1),g.body.emitter.off()})),this.body.emitter.on("_dataChanged",(function(){g.updatePhysicsData()}))}},{key:"setOptions",value:function(g){if(void 0!==g)if(!1===g)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(!0===g)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,Jp(["stabilization"],this.options,g),dv(this.options,g,"stabilization"),void 0===g.enabled&&(this.options.enabled=!0),!1===this.options.enabled&&(this.physicsEnabled=!1,this.stopSimulation());var t=this.options.wind;t&&(("number"!=typeof t.x||jm(t.x))&&(t.x=0),("number"!=typeof t.y||jm(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}},{key:"init",value:function(){var g;"forceAtlas2Based"===this.options.solver?(g=this.options.forceAtlas2Based,this.nodesSolver=new UR(this.body,this.physicsBody,g),this.edgesSolver=new VR(this.body,this.physicsBody,g),this.gravitySolver=new KR(this.body,this.physicsBody,g)):"repulsion"===this.options.solver?(g=this.options.repulsion,this.nodesSolver=new jR(this.body,this.physicsBody,g),this.edgesSolver=new VR(this.body,this.physicsBody,g),this.gravitySolver=new WR(this.body,this.physicsBody,g)):"hierarchicalRepulsion"===this.options.solver?(g=this.options.hierarchicalRepulsion,this.nodesSolver=new LR(this.body,this.physicsBody,g),this.edgesSolver=new YR(this.body,this.physicsBody,g),this.gravitySolver=new WR(this.body,this.physicsBody,g)):(g=this.options.barnesHut,this.nodesSolver=new GR(this.body,this.physicsBody,g),this.edgesSolver=new VR(this.body,this.physicsBody,g),this.gravitySolver=new WR(this.body,this.physicsBody,g)),this.modelOptions=g}},{key:"initPhysics",value:function(){!0===this.physicsEnabled&&!0===this.options.enabled?!0===this.options.stabilization.enabled?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"))}},{key:"startSimulation",value:function(){var g;!0===this.physicsEnabled&&!0===this.options.enabled?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=je(g=this.simulationStep).call(g,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var g=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,!0===g&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,!0===g&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var g=Qh();this.physicsTick(),(Qh()-g<.4*this.simulationInterval||!0===this.runDoubleSpeed)&&!1===this.stabilized&&(this.physicsTick(),this.runDoubleSpeed=!0),!0===this.stabilized&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var g=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||!0===this.startedStabilization)&&wu((function(){g.body.emitter.emit("stabilized",{iterations:t}),g.startedStabilization=!1,g.stabilizationIterations=0}),0)}},{key:"physicsStep",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:"adjustTimeStep",value:function(){!0===this._evaluateStepQuality()?this.timestep=1.2*this.timestep:this.timestep/1.2.3))return!1;return!0}},{key:"moveNodes",value:function(){for(var g=this.physicsBody.physicsNodeIndices,t=0,A=0,e=0;ee&&(g=g>0?e:-e),g}},{key:"_performStep",value:function(g){var t=this.body.nodes[g],A=this.physicsBody.forces[g];this.options.wind&&(A.x+=this.options.wind.x,A.y+=this.options.wind.y);var e=this.physicsBody.velocities[g];return this.previousStates[g]={x:t.x,y:t.y,vx:e.x,vy:e.y},!1===t.options.fixed.x?(e.x=this.calculateComponentVelocity(e.x,A.x,t.options.mass),t.x+=e.x*this.timestep):(A.x=0,e.x=0),!1===t.options.fixed.y?(e.y=this.calculateComponentVelocity(e.y,A.y,t.options.mass),t.y+=e.y*this.timestep):(A.y=0,e.y=0),Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}},{key:"_freezeNodes",value:function(){var g=this.body.nodes;for(var t in g)if(Object.prototype.hasOwnProperty.call(g,t)&&g[t].x&&g[t].y){var A=g[t].options.fixed;this.freezeCache[t]={x:A.x,y:A.y},A.x=!0,A.y=!0}}},{key:"_restoreFrozenNodes",value:function(){var g=this.body.nodes;for(var t in g)Object.prototype.hasOwnProperty.call(g,t)&&void 0!==this.freezeCache[t]&&(g[t].options.fixed.x=this.freezeCache[t].x,g[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}},{key:"stabilize",value:function(){var g=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;"number"!=typeof t&&(t=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",t)),0!==this.physicsBody.physicsNodeIndices.length?(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=t,!0===this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationIterations=0,wu((function(){return g._stabilizationBatch()}),0)):this.ready=!0}},{key:"_startStabilizing",value:function(){return!0!==this.startedStabilization&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}},{key:"_stabilizationBatch",value:function(){var g=this,t=function(){return!1===g.stabilized&&g.stabilizationIterations1&&void 0!==arguments[1]?arguments[1]:[],e=1e9,C=-1e9,I=1e9,i=-1e9;if(A.length>0)for(var o=0;o(t=g[A[o]]).shape.boundingBox.left&&(I=t.shape.boundingBox.left),it.shape.boundingBox.top&&(e=t.shape.boundingBox.top),C1&&void 0!==arguments[1]?arguments[1]:[],e=1e9,C=-1e9,I=1e9,i=-1e9;if(A.length>0)for(var o=0;o(t=g[A[o]]).x&&(I=t.x),it.y&&(e=t.y),C=g&&A.push(C.id)}for(var I=0;I0&&void 0!==arguments[0]?arguments[0]:{},A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===t.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");t=this._checkOptions(t);var e={},C={};tv(this.body.nodes,(function(A,I){A.options&&!0===t.joinCondition(A.options)&&(e[I]=A,tv(A.edges,(function(t){void 0===g.clusteredEdges[t.id]&&(C[t.id]=t)})))})),this._cluster(e,C,t,A)}},{key:"clusterByEdgeCount",value:function(g,t){var A=this,e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t=this._checkOptions(t);for(var C,I,i,o=[],n={},r=function(){var e={},r={},a=A.body.nodeIndices[s],d=A.body.nodes[a];if(void 0===n[a]){i=0,I=[];for(var h=0;h0&&Lh(r).length>0&&!0===c){var p=function(){for(var g=0;g1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,g,t)}},{key:"clusterBridges",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,g,t)}},{key:"clusterByConnection",value:function(g,t){var A,e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===g)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[g])throw new Error("The nodeId given to clusterByConnection does not exist!");var C=this.body.nodes[g];void 0===(t=this._checkOptions(t,C)).clusterNodeProperties.x&&(t.clusterNodeProperties.x=C.x),void 0===t.clusterNodeProperties.y&&(t.clusterNodeProperties.y=C.y),void 0===t.clusterNodeProperties.fixed&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=C.options.fixed.x,t.clusterNodeProperties.fixed.y=C.options.fixed.y);var I={},i={},o=C.id,n=XR.cloneOptions(C);I[o]=C;for(var r=0;r-1&&(i[f.id]=f)}this._cluster(I,i,t,e)}},{key:"_createClusterEdges",value:function(g,t,A,e){for(var C,I,i,o,n,r,s=Lh(g),a=[],d=0;d0&&void 0!==arguments[0]?arguments[0]:{};return void 0===g.clusterEdgeProperties&&(g.clusterEdgeProperties={}),void 0===g.clusterNodeProperties&&(g.clusterNodeProperties={}),g}},{key:"_cluster",value:function(g,t,A){var e=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],C=[];for(var I in g)Object.prototype.hasOwnProperty.call(g,I)&&void 0!==this.clusteredNodes[I]&&C.push(I);for(var i=0;iC?t.x:C,I=t.yi?t.y:i;return{x:.5*(e+C),y:.5*(I+i)}}},{key:"openCluster",value:function(g,t){var A=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===g)throw new Error("No clusterNodeId supplied to openCluster.");var e=this.body.nodes[g];if(void 0===e)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(!0!==e.isCluster||void 0===e.containedNodes||void 0===e.containedEdges)throw new Error("The node:"+g+" is not a valid cluster.");var C=this.findNode(g),I=Xc(C).call(C,g)-1;if(I>=0){var i=C[I];return this.body.nodes[i]._openChildCluster(g),delete this.body.nodes[g],void(!0===A&&this.body.emitter.emit("_dataChanged"))}var o=e.containedNodes,n=e.containedEdges;if(void 0!==t&&void 0!==t.releaseFunction&&"function"==typeof t.releaseFunction){var r={},s={x:e.x,y:e.y};for(var a in o)if(Object.prototype.hasOwnProperty.call(o,a)){var d=this.body.nodes[a];r[a]={x:d.x,y:d.y}}var h=t.releaseFunction(s,r);for(var l in o)if(Object.prototype.hasOwnProperty.call(o,l)){var c=this.body.nodes[l];void 0!==h[l]&&(c.x=void 0===h[l].x?e.x:h[l].x,c.y=void 0===h[l].y?e.y:h[l].y)}}else tv(o,(function(g){!1===g.options.fixed.x&&(g.x=e.x),!1===g.options.fixed.y&&(g.y=e.y)}));for(var u in o)if(Object.prototype.hasOwnProperty.call(o,u)){var f=this.body.nodes[u];f.vx=e.vx,f.vy=e.vy,f.setOptions({physics:!0}),delete this.clusteredNodes[u]}for(var p=[],v=0;v0&&C<100;){var I=t.pop();if(void 0!==I){var i=this.body.edges[I];if(void 0!==i){C++;var o=i.clusteringEdgeReplacingIds;if(void 0===o)e.push(I);else for(var n=0;ne&&(e=I.edges.length),g+=I.edges.length,t+=Math.pow(I.edges.length,2),A+=1}g/=A;var i=(t/=A)-Math.pow(g,2),o=Math.sqrt(i),n=Math.floor(g+2*o);return n>e&&(n=e),n}},{key:"_createClusteredEdge",value:function(g,t,A,e,C){var I=XR.cloneOptions(A,"edge");qp(I,e),I.from=g,I.to=t,I.id="clusterEdge:"+rD(),void 0!==C&&qp(I,C);var i=this.body.functions.createEdge(I);return i.clusteringEdgeReplacingIds=[A.id],i.connect(),this.body.edges[i.id]=i,i}},{key:"_clusterEdges",value:function(g,t,A,e){if(t instanceof ZR){var C=t,I={};I[C.id]=C,t=I}if(g instanceof jN){var i=g,o={};o[i.id]=i,g=o}if(null==A)throw new Error("_clusterEdges: parameter clusterNode required");for(var n in void 0===e&&(e=A.clusterEdgeProperties),this._createClusterEdges(g,t,A,e),t)if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==this.body.edges[n]){var r=this.body.edges[n];this._backupEdgeOptions(r),r.setOptions({physics:!1})}for(var s in g)Object.prototype.hasOwnProperty.call(g,s)&&(this.clusteredNodes[s]={clusterId:A.id,node:this.body.nodes[s]},this.body.nodes[s].setOptions({physics:!1}))}},{key:"_getClusterNodeForNode",value:function(g){if(void 0!==g){var t=this.clusteredNodes[g];if(void 0!==t){var A=t.clusterId;if(void 0!==A)return this.body.nodes[A]}}}},{key:"_filter",value:function(g,t){var A=[];return tv(g,(function(g){t(g)&&A.push(g)})),A}},{key:"_updateState",value:function(){var g,t=this,A=[],e={},C=function(g){tv(t.body.nodes,(function(t){!0===t.isCluster&&g(t)}))};for(g in this.clusteredNodes){if(Object.prototype.hasOwnProperty.call(this.clusteredNodes,g))void 0===this.body.nodes[g]&&A.push(g)}C((function(g){for(var t=0;t0}g.endPointsValid()&&C||(e[A]=A)})),C((function(g){tv(e,(function(A){delete g.containedEdges[A],tv(g.edges,(function(C,I){C.id!==A?C.clusteringEdgeReplacingIds=t._filter(C.clusteringEdgeReplacingIds,(function(g){return!e[g]})):g.edges[I]=null})),g.edges=t._filter(g.edges,(function(g){return null!==g}))}))})),tv(e,(function(g){delete t.clusteredEdges[g]})),tv(e,(function(g){delete t.body.edges[g]})),tv(Lh(this.body.edges),(function(g){var A=t.body.edges[g],e=t._isClusteredNode(A.fromId)||t._isClusteredNode(A.toId);if(e!==t._isClusteredEdge(A.id))if(e){var C=t._getClusterNodeForNode(A.fromId);void 0!==C&&t._clusterEdges(t.body.nodes[A.fromId],A,C);var I=t._getClusterNodeForNode(A.toId);void 0!==I&&t._clusterEdges(t.body.nodes[A.toId],A,I)}else delete t._clusterEdges[g],t._restoreEdge(A)}));for(var i=!1,o=!0,n=function(){var g=[];C((function(t){var A=Lh(t.containedNodes).length,e=!0===t.options.allowSingleNodeCluster;(e&&A<1||!e&&A<2)&&g.push(t.id)}));for(var A=0;A0,i=i||o};o;)n();i&&this._updateState()}},{key:"_isClusteredNode",value:function(g){return void 0!==this.clusteredNodes[g]}},{key:"_isClusteredEdge",value:function(g){return void 0!==this.clusteredEdges[g]}}]),g}();var gP=function(){function g(t,A){var e;cn(this,g),void 0!==window&&(e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),window.requestAnimationFrame=void 0===e?function(g){g()}:e,this.body=t,this.canvas=A,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!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},pe(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return kd(g,[{key:"bindEventListeners",value:function(){var g,t=this;this.body.emitter.on("dragStart",(function(){t.dragging=!0})),this.body.emitter.on("dragEnd",(function(){t.dragging=!1})),this.body.emitter.on("zoom",(function(){t.zooming=!0,window.clearTimeout(t.zoomTimeoutId),t.zoomTimeoutId=wu((function(){var g;t.zooming=!1,je(g=t._requestRedraw).call(g,t)()}),250)})),this.body.emitter.on("_resizeNodes",(function(){t._resizeNodes()})),this.body.emitter.on("_redraw",(function(){!1===t.renderingActive&&t._redraw()})),this.body.emitter.on("_blockRedraw",(function(){t.allowRedraw=!1})),this.body.emitter.on("_allowRedraw",(function(){t.allowRedraw=!0,t.redrawRequested=!1})),this.body.emitter.on("_requestRedraw",je(g=this._requestRedraw).call(g,this)),this.body.emitter.on("_startRendering",(function(){t.renderRequests+=1,t.renderingActive=!0,t._startRendering()})),this.body.emitter.on("_stopRendering",(function(){t.renderRequests-=1,t.renderingActive=t.renderRequests>0,t.renderTimer=void 0})),this.body.emitter.on("destroy",(function(){t.renderRequests=0,t.allowRedraw=!1,t.renderingActive=!1,!0===t.requiresTimeout?clearTimeout(t.renderTimer):window.cancelAnimationFrame(t.renderTimer),t.body.emitter.off()}))}},{key:"setOptions",value:function(g){if(void 0!==g){Xp(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,g)}}},{key:"_requestNextFrame",value:function(g,t){if("undefined"!=typeof window){var A,e=window;return!0===this.requiresTimeout?A=wu(g,t):e.requestAnimationFrame&&(A=e.requestAnimationFrame(g)),A}}},{key:"_startRendering",value:function(){var g;!0===this.renderingActive&&(void 0===this.renderTimer&&(this.renderTimer=this._requestNextFrame(je(g=this._renderStep).call(g,this),this.simulationInterval)))}},{key:"_renderStep",value:function(){!0===this.renderingActive&&(this.renderTimer=void 0,!0===this.requiresTimeout&&this._startRendering(),this._redraw(),!1===this.requiresTimeout&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var g=this;!0!==this.redrawRequested&&!1===this.renderingActive&&!0===this.allowRedraw&&(this.redrawRequested=!0,this._requestNextFrame((function(){g._redraw(!1)}),0))}},{key:"_redraw",value:function(){var g=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!0===this.allowRedraw){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var t={drawExternalLabels:null};0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.canvas.setTransform();var A=this.canvas.getContext(),e=this.canvas.frame.canvas.clientWidth,C=this.canvas.frame.canvas.clientHeight;if(A.clearRect(0,0,e,C),0===this.canvas.frame.clientWidth)return;if(A.save(),A.translate(this.body.view.translation.x,this.body.view.translation.y),A.scale(this.body.view.scale,this.body.view.scale),A.beginPath(),this.body.emitter.emit("beforeDrawing",A),A.closePath(),!1===g&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawEdges(A),!1===this.dragging||!0===this.dragging&&!1===this.options.hideNodesOnDrag){var I=this._drawNodes(A,g).drawExternalLabels;t.drawExternalLabels=I}!1===g&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawArrows(A),null!=t.drawExternalLabels&&t.drawExternalLabels(),!1===g&&this._drawSelectionBox(A),A.beginPath(),this.body.emitter.emit("afterDrawing",A),A.closePath(),A.restore(),!0===g&&A.clearRect(0,0,e,C)}}},{key:"_resizeNodes",value:function(){this.canvas.setTransform();var g=this.canvas.getContext();g.save(),g.translate(this.body.view.translation.x,this.body.view.translation.y),g.scale(this.body.view.scale,this.body.view.scale);var t,A=this.body.nodes;for(var e in A)Object.prototype.hasOwnProperty.call(A,e)&&((t=A[e]).resize(g),t.updateBoundingBox(g,t.selected));g.restore()}},{key:"_drawNodes",value:function(g){for(var t,A,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],C=this.body.nodes,I=this.body.nodeIndices,i=[],o=[],n=this.canvas.DOMtoCanvas({x:-20,y:-20}),r=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+20,y:this.canvas.frame.canvas.clientHeight+20}),s={top:n.y,left:n.x,bottom:r.y,right:r.x},a=[],d=0;d0&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;!0===this.initialized&&(this.cameraState.previousWidth=this.frame.canvas.width/g,this.cameraState.previousHeight=this.frame.canvas.height/g,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/g,y:.5*this.frame.canvas.height/g}))}},{key:"_setCameraState",value:function(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){var g=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,A=this.cameraState.scale;1!=g&&1!=t?A=.5*this.cameraState.scale*(g+t):1!=g?A=this.cameraState.scale*g:1!=t&&(A=this.cameraState.scale*t),this.body.view.scale=A;var e=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),C={x:e.x-this.cameraState.position.x,y:e.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}}},{key:"_prepareValue",value:function(g){if("number"==typeof g)return g+"px";if("string"==typeof g){if(-1!==Xc(g).call(g,"%")||-1!==Xc(g).call(g,"px"))return g;if(-1===Xc(g).call(g,"%"))return g+"px"}throw new Error("Could not use the value supplied for width or height:"+g)}},{key:"_create",value:function(){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{var g=document.createElement("DIV");g.style.color="red",g.style.fontWeight="bold",g.style.padding="10px",g.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(g)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var g=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new Ev(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:Ev.DIRECTION_ALL}),AP(this.hammer,(function(t){g.body.eventListeners.onTouch(t)})),this.hammer.on("tap",(function(t){g.body.eventListeners.onTap(t)})),this.hammer.on("doubletap",(function(t){g.body.eventListeners.onDoubleTap(t)})),this.hammer.on("press",(function(t){g.body.eventListeners.onHold(t)})),this.hammer.on("panstart",(function(t){g.body.eventListeners.onDragStart(t)})),this.hammer.on("panmove",(function(t){g.body.eventListeners.onDrag(t)})),this.hammer.on("panend",(function(t){g.body.eventListeners.onDragEnd(t)})),this.hammer.on("pinch",(function(t){g.body.eventListeners.onPinch(t)})),this.frame.canvas.addEventListener("wheel",(function(t){g.body.eventListeners.onMouseWheel(t)})),this.frame.canvas.addEventListener("mousemove",(function(t){g.body.eventListeners.onMouseMove(t)})),this.frame.canvas.addEventListener("contextmenu",(function(t){g.body.eventListeners.onContext(t)})),this.hammerFrame=new Ev(this.frame),eP(this.hammerFrame,(function(t){g.body.eventListeners.onRelease(t)}))}},{key:"setSize",value:function(){var g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.width,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.height;g=this._prepareValue(g),t=this._prepareValue(t);var A=!1,e=this.frame.canvas.width,C=this.frame.canvas.height,I=this.pixelRatio;if(this._setPixelRatio(),g!=this.options.width||t!=this.options.height||this.frame.style.width!=g||this.frame.style.height!=t)this._getCameraState(I),this.frame.style.width=g,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=g,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},A=!0;else{var i=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),o=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);this.frame.canvas.width===i&&this.frame.canvas.height===o||this._getCameraState(I),this.frame.canvas.width!==i&&(this.frame.canvas.width=i,A=!0),this.frame.canvas.height!==o&&(this.frame.canvas.height=o,A=!0)}return!0===A&&(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(e/this.pixelRatio),oldHeight:Math.round(C/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,A}},{key:"getContext",value:function(){return this.frame.canvas.getContext("2d")}},{key:"_determinePixelRatio",value:function(){var g=this.getContext();if(void 0===g)throw new Error("Could not get canvax context");var t=1;return"undefined"!=typeof window&&(t=window.devicePixelRatio||1),t/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1)}},{key:"_setPixelRatio",value:function(){this.pixelRatio=this._determinePixelRatio()}},{key:"setTransform",value:function(){var g=this.getContext();if(void 0===g)throw new Error("Could not get canvax context");g.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}},{key:"_XconvertDOMtoCanvas",value:function(g){return(g-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(g){return g*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(g){return(g-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(g){return g*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(g){return{x:this._XconvertCanvasToDOM(g.x),y:this._YconvertCanvasToDOM(g.y)}}},{key:"DOMtoCanvas",value:function(g){return{x:this._XconvertDOMtoCanvas(g.x),y:this._YconvertDOMtoCanvas(g.y)}}}]),g}();var IP=function(){function g(t,A){var e,C,I=this;cn(this,g),this.body=t,this.canvas=A,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",je(e=this.fit).call(e,this)),this.body.emitter.on("animationFinished",(function(){I.body.emitter.emit("_stopRendering")})),this.body.emitter.on("unlockNode",je(C=this.releaseNode).call(C,this))}return kd(g,[{key:"setOptions",value:function(){var g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=g}},{key:"fit",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];g=function(g,t){var A=pe({nodes:t,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},null!=g?g:{});if(!Rh(A.nodes))throw new TypeError("Nodes has to be an array of ids.");if(0===A.nodes.length&&(A.nodes=t),!("number"==typeof A.minZoomLevel&&A.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!("number"==typeof A.maxZoomLevel&&A.minZoomLevel<=A.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return A}(g,this.body.nodeIndices);var A,e,C=this.canvas.frame.canvas.clientWidth,I=this.canvas.frame.canvas.clientHeight;if(0===C||0===I)e=1,A=XR.getRange(this.body.nodes,g.nodes);else if(!0===t){var i=0;for(var o in this.body.nodes){if(Object.prototype.hasOwnProperty.call(this.body.nodes,o))!0===this.body.nodes[o].predefinedPosition&&(i+=1)}if(i>.5*this.body.nodeIndices.length)return void this.fit(g,!1);A=XR.getRange(this.body.nodes,g.nodes),e=12.662/(this.body.nodeIndices.length+7.4147)+.0964822,e*=Math.min(C/600,I/600)}else{this.body.emitter.emit("_resizeNodes"),A=XR.getRange(this.body.nodes,g.nodes);var n=C/(1.1*Math.abs(A.maxX-A.minX)),r=I/(1.1*Math.abs(A.maxY-A.minY));e=n<=r?n:r}e>g.maxZoomLevel?e=g.maxZoomLevel:e1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[g]){var A={x:this.body.nodes[g].x,y:this.body.nodes[g].y};t.position=A,t.lockedOnNode=g,this.moveTo(t)}else console.error("Node: "+g+" cannot be found.")}},{key:"moveTo",value:function(g){if(void 0!==g){if(null!=g.offset){if(null!=g.offset.x){if(g.offset.x=+g.offset.x,!Ym(g.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else g.offset.x=0;if(null!=g.offset.y){if(g.offset.y=+g.offset.y,!Ym(g.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else g.offset.x=0}else g.offset={x:0,y:0};if(null!=g.position){if(null!=g.position.x){if(g.position.x=+g.position.x,!Ym(g.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else g.position.x=0;if(null!=g.position.y){if(g.position.y=+g.position.y,!Ym(g.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else g.position.x=0}else g.position=this.getViewPosition();if(null!=g.scale){if(g.scale=+g.scale,!(g.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else g.scale=this.body.view.scale;void 0===g.animation&&(g.animation={duration:0}),!1===g.animation&&(g.animation={duration:0}),!0===g.animation&&(g.animation={}),void 0===g.animation.duration&&(g.animation.duration=1e3),void 0===g.animation.easingFunction&&(g.animation.easingFunction="easeInOutQuad"),this.animateView(g)}else g={}}},{key:"animateView",value:function(g){if(void 0!==g){this.animationEasingFunction=g.animation.easingFunction,this.releaseNode(),!0===g.locked&&(this.lockedOnNodeId=g.lockedOnNode,this.lockedOnNodeOffset=g.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=g.scale,this.body.view.scale=this.targetScale;var t,A,e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),C=e.x-g.position.x,I=e.y-g.position.y;if(this.targetTranslation={x:this.sourceTranslation.x+C*this.targetScale+g.offset.x,y:this.sourceTranslation.y+I*this.targetScale+g.offset.y},0===g.animation.duration)if(null!=this.lockedOnNodeId)this.viewFunction=je(t=this._lockedRedraw).call(t,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 this.animationSpeed=1/(60*g.animation.duration*.001)||1/60,this.animationEasingFunction=g.animation.easingFunction,this.viewFunction=je(A=this._transitionRedraw).call(A,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}},{key:"_lockedRedraw",value:function(){var g=this.body.nodes[this.lockedOnNodeId].x,t=this.body.nodes[this.lockedOnNodeId].y,A=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),e=A.x-g,C=A.y-t,I=this.body.view.translation,i={x:I.x+e*this.body.view.scale+this.lockedOnNodeOffset.x,y:I.y+C*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=i}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var g=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=!0===g?1:this.easingTime;var t=hv[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){var A;if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,null!=this.lockedOnNodeId)this.viewFunction=je(A=this._lockedRedraw).call(A,this),this.body.emitter.on("initRedraw",this.viewFunction);this.body.emitter.emit("animationFinished")}}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),g}();function iP(g){var t,A=g&&g.preventDefault||!1,e=g&&g.container||window,C={},I={keydown:{},keyup:{}},i={};for(t=97;t<=122;t++)i[String.fromCharCode(t)]={code:t-97+65,shift:!1};for(t=65;t<=90;t++)i[String.fromCharCode(t)]={code:t,shift:!0};for(t=0;t<=9;t++)i[""+t]={code:48+t,shift:!1};for(t=1;t<=12;t++)i["F"+t]={code:111+t,shift:!1};for(t=0;t<=9;t++)i["num"+t]={code:96+t,shift:!1};i["num*"]={code:106,shift:!1},i["num+"]={code:107,shift:!1},i["num-"]={code:109,shift:!1},i["num/"]={code:111,shift:!1},i["num."]={code:110,shift:!1},i.left={code:37,shift:!1},i.up={code:38,shift:!1},i.right={code:39,shift:!1},i.down={code:40,shift:!1},i.space={code:32,shift:!1},i.enter={code:13,shift:!1},i.shift={code:16,shift:void 0},i.esc={code:27,shift:!1},i.backspace={code:8,shift:!1},i.tab={code:9,shift:!1},i.ctrl={code:17,shift:!1},i.alt={code:18,shift:!1},i.delete={code:46,shift:!1},i.pageup={code:33,shift:!1},i.pagedown={code:34,shift:!1},i["="]={code:187,shift:!1},i["-"]={code:189,shift:!1},i["]"]={code:221,shift:!1},i["["]={code:219,shift:!1};var o=function(g){r(g,"keydown")},n=function(g){r(g,"keyup")},r=function(g,t){if(void 0!==I[t][g.keyCode]){for(var e=I[t][g.keyCode],C=0;C700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}},{key:"_stopMovement",value:function(){for(var g in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,g)&&(this.body.emitter.off("initRedraw",this.boundFunctions[g]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{key:"_moveUp",value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:"_moveDown",value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:"_moveLeft",value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:"_moveRight",value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:"_zoomIn",value:function(){var g=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),A=this.body.view.translation,e=t/g,C=(1-e)*this.canvas.canvasViewCenter.x+A.x*e,I=(1-e)*this.canvas.canvasViewCenter.y+A.y*e;this.body.view.scale=t,this.body.view.translation={x:C,y:I},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}},{key:"_zoomOut",value:function(){var g=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),A=this.body.view.translation,e=t/g,C=(1-e)*this.canvas.canvasViewCenter.x+A.x*e,I=(1-e)*this.canvas.canvasViewCenter.y+A.y*e;this.body.view.scale=t,this.body.view.translation={x:C,y:I},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}},{key:"configureKeyboardBindings",value:function(){var g,t,A,e,C,I,i,o,n,r,s,a,d,h,l,c,u,f,p,v,y,m,b,w,k=this;(void 0!==this.keycharm&&this.keycharm.destroy(),!0===this.options.keyboard.enabled)&&(!0===this.options.keyboard.bindToWindow?this.keycharm=iP({container:window,preventDefault:!0}):this.keycharm=iP({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),!0===this.activated&&(je(g=this.keycharm).call(g,"up",(function(){k.bindToRedraw("_moveUp")}),"keydown"),je(t=this.keycharm).call(t,"down",(function(){k.bindToRedraw("_moveDown")}),"keydown"),je(A=this.keycharm).call(A,"left",(function(){k.bindToRedraw("_moveLeft")}),"keydown"),je(e=this.keycharm).call(e,"right",(function(){k.bindToRedraw("_moveRight")}),"keydown"),je(C=this.keycharm).call(C,"=",(function(){k.bindToRedraw("_zoomIn")}),"keydown"),je(I=this.keycharm).call(I,"num+",(function(){k.bindToRedraw("_zoomIn")}),"keydown"),je(i=this.keycharm).call(i,"num-",(function(){k.bindToRedraw("_zoomOut")}),"keydown"),je(o=this.keycharm).call(o,"-",(function(){k.bindToRedraw("_zoomOut")}),"keydown"),je(n=this.keycharm).call(n,"[",(function(){k.bindToRedraw("_zoomOut")}),"keydown"),je(r=this.keycharm).call(r,"]",(function(){k.bindToRedraw("_zoomIn")}),"keydown"),je(s=this.keycharm).call(s,"pageup",(function(){k.bindToRedraw("_zoomIn")}),"keydown"),je(a=this.keycharm).call(a,"pagedown",(function(){k.bindToRedraw("_zoomOut")}),"keydown"),je(d=this.keycharm).call(d,"up",(function(){k.unbindFromRedraw("_moveUp")}),"keyup"),je(h=this.keycharm).call(h,"down",(function(){k.unbindFromRedraw("_moveDown")}),"keyup"),je(l=this.keycharm).call(l,"left",(function(){k.unbindFromRedraw("_moveLeft")}),"keyup"),je(c=this.keycharm).call(c,"right",(function(){k.unbindFromRedraw("_moveRight")}),"keyup"),je(u=this.keycharm).call(u,"=",(function(){k.unbindFromRedraw("_zoomIn")}),"keyup"),je(f=this.keycharm).call(f,"num+",(function(){k.unbindFromRedraw("_zoomIn")}),"keyup"),je(p=this.keycharm).call(p,"num-",(function(){k.unbindFromRedraw("_zoomOut")}),"keyup"),je(v=this.keycharm).call(v,"-",(function(){k.unbindFromRedraw("_zoomOut")}),"keyup"),je(y=this.keycharm).call(y,"[",(function(){k.unbindFromRedraw("_zoomOut")}),"keyup"),je(m=this.keycharm).call(m,"]",(function(){k.unbindFromRedraw("_zoomIn")}),"keyup"),je(b=this.keycharm).call(b,"pageup",(function(){k.unbindFromRedraw("_zoomIn")}),"keyup"),je(w=this.keycharm).call(w,"pagedown",(function(){k.unbindFromRedraw("_zoomOut")}),"keyup")))}}]),g}();function nP(g,t){var A=void 0!==uh&&ln(g)||g["@@iterator"];if(!A){if(Rh(g)||(A=function(g,t){var A;if(!g)return;if("string"==typeof g)return rP(g,t);var e=wh(A=Object.prototype.toString.call(g)).call(A,8,-1);"Object"===e&&g.constructor&&(e=g.constructor.name);if("Map"===e||"Set"===e)return Uo(g);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return rP(g,t)}(g))||t&&g&&"number"==typeof g.length){A&&(g=A);var e=0,C=function(){};return{s:C,n:function(){return e>=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function rP(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A50&&(this.drag.pointer=this.getPointer(g.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}},{key:"onTap",value:function(g){var t=this.getPointer(g.center),A=this.selectionHandler.options.multiselect&&(g.changedPointers[0].ctrlKey||g.changedPointers[0].metaKey);this.checkSelectionChanges(t,A),this.selectionHandler.commitAndEmit(t,g),this.selectionHandler.generateClickEvent("click",g,t)}},{key:"onDoubleTap",value:function(g){var t=this.getPointer(g.center);this.selectionHandler.generateClickEvent("doubleClick",g,t)}},{key:"onHold",value:function(g){var t=this.getPointer(g.center),A=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,A),this.selectionHandler.commitAndEmit(t,g),this.selectionHandler.generateClickEvent("click",g,t),this.selectionHandler.generateClickEvent("hold",g,t)}},{key:"onRelease",value:function(g){if((new Date).valueOf()-this.touchTime>10){var t=this.getPointer(g.center);this.selectionHandler.generateClickEvent("release",g,t),this.touchTime=(new Date).valueOf()}}},{key:"onContext",value:function(g){var t=this.getPointer({x:g.clientX,y:g.clientY});this.selectionHandler.generateClickEvent("oncontext",g,t)}},{key:"checkSelectionChanges",value:function(g){!0===(arguments.length>1&&void 0!==arguments[1]&&arguments[1])?this.selectionHandler.selectAdditionalOnPoint(g):this.selectionHandler.selectOnPoint(g)}},{key:"_determineDifference",value:function(g,t){var A=function(g,t){for(var A=[],e=0;e=C.minX&&A.x<=C.maxX&&A.y>=C.minY&&A.y<=C.maxY}));Cl(I).call(I,(function(g){return t.selectionHandler.selectObject(t.body.nodes[g])}));var i=this.getPointer(g.center);this.selectionHandler.commitAndEmit(i,g),this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{var o=this.drag.selection;o&&o.length?(Cl(o).call(o,(function(g){g.node.options.fixed.x=g.xFixed,g.node.options.fixed.y=g.yFixed})),this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}},{key:"onPinch",value:function(g){var t=this.getPointer(g.center);this.drag.pinched=!0,void 0===this.pinch.scale&&(this.pinch.scale=1);var A=this.pinch.scale*g.scale;this.zoom(A,t)}},{key:"zoom",value:function(g,t){if(!0===this.options.zoomView){var A=this.body.view.scale;g<1e-5&&(g=1e-5),g>10&&(g=10);var e=void 0;void 0!==this.drag&&!0===this.drag.dragging&&(e=this.canvas.DOMtoCanvas(this.drag.pointer));var C=this.body.view.translation,I=g/A,i=(1-I)*t.x+C.x*I,o=(1-I)*t.y+C.y*I;if(this.body.view.scale=g,this.body.view.translation={x:i,y:o},null!=e){var n=this.canvas.canvasToDOM(e);this.drag.pointer.x=n.x,this.drag.pointer.y=n.y}this.body.emitter.emit("_requestRedraw"),A0&&(this.popupObj=r[s[s.length-1]],I=!0)}if(void 0===this.popupObj&&!1===I){for(var d,h=this.body.edgeIndices,l=this.body.edges,c=[],u=0;u0&&(this.popupObj=l[c[c.length-1]],i="edge")}void 0!==this.popupObj?this.popupObj.id!==C&&(void 0===this.popup&&(this.popup=new Ov(this.canvas.frame)),this.popup.popupTargetType=i,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(g.x+3,g.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}},{key:"_checkHidePopup",value:function(g){var t=this.selectionHandler._pointerToPositionObject(g),A=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&!0===(A=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t))){var e=this.selectionHandler.getNodeAt(g);A=void 0!==e&&e.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(g)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(A=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));!1===A&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),g}(),aP=u,dP=fm,hP=zy.getWeakData,lP=qy,cP=AA,uP=Q,fP=gg,pP=Hy,vP=qg,yP=GC.set,mP=GC.getterFor,bP=Sr.find,wP=Sr.findIndex,kP=aP([].splice),xP=0,EP=function(g){return g.frozen||(g.frozen=new OP)},OP=function(){this.entries=[]},TP=function(g,t){return bP(g.entries,(function(g){return g[0]===t}))};OP.prototype={get:function(g){var t=TP(this,g);if(t)return t[1]},has:function(g){return!!TP(this,g)},set:function(g,t){var A=TP(this,g);A?A[1]=t:this.entries.push([g,t])},delete:function(g){var t=wP(this.entries,(function(t){return t[0]===g}));return~t&&kP(this.entries,t,1),!!~t}};var DP,NP={getConstructor:function(g,t,A,e){var C=g((function(g,C){lP(g,I),yP(g,{type:t,id:xP++,frozen:void 0}),uP(C)||pP(C,g[e],{that:g,AS_ENTRIES:A})})),I=C.prototype,i=mP(t),o=function(g,t,A){var e=i(g),C=hP(cP(t),!0);return!0===C?EP(e).set(t,A):C[e.id]=A,g};return dP(I,{delete:function(g){var t=i(this);if(!fP(g))return!1;var A=hP(g);return!0===A?EP(t).delete(g):A&&vP(A,t.id)&&delete A[t.id]},has:function(g){var t=i(this);if(!fP(g))return!1;var A=hP(g);return!0===A?EP(t).has(g):A&&vP(A,t.id)}}),dP(I,A?{get:function(g){var t=i(this);if(fP(g)){var A=hP(g);return!0===A?EP(t).get(g):A?A[t.id]:void 0}},set:function(g,t){return o(this,g,t)}}:{add:function(g){return o(this,g,!0)}}),C}},RP=vy,PP=C,MP=u,BP=fm,zP=zy,SP=cm,ZP=NP,FP=gg,GP=GC.enforce,jP=I,LP=bC,VP=Object,YP=Array.isArray,WP=VP.isExtensible,QP=VP.isFrozen,UP=VP.isSealed,_P=VP.freeze,KP=VP.seal,HP={},XP={},JP=!PP.ActiveXObject&&"ActiveXObject"in PP,qP=function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}},$P=SP("WeakMap",qP,ZP),gM=$P.prototype,tM=MP(gM.set);if(LP)if(JP){DP=ZP.getConstructor(qP,"WeakMap",!0),zP.enable();var AM=MP(gM.delete),eM=MP(gM.has),CM=MP(gM.get);BP(gM,{delete:function(g){if(FP(g)&&!WP(g)){var t=GP(this);return t.frozen||(t.frozen=new DP),AM(this,g)||t.frozen.delete(g)}return AM(this,g)},has:function(g){if(FP(g)&&!WP(g)){var t=GP(this);return t.frozen||(t.frozen=new DP),eM(this,g)||t.frozen.has(g)}return eM(this,g)},get:function(g){if(FP(g)&&!WP(g)){var t=GP(this);return t.frozen||(t.frozen=new DP),eM(this,g)?CM(this,g):t.frozen.get(g)}return CM(this,g)},set:function(g,t){if(FP(g)&&!WP(g)){var A=GP(this);A.frozen||(A.frozen=new DP),eM(this,g)?tM(this,g,t):A.frozen.set(g,t)}else tM(this,g,t);return this}})}else RP&&jP((function(){var g=_P([]);return tM(new $P,g,1),!QP(g)}))&&BP(gM,{set:function(g,t){var A;return YP(g)&&(QP(g)?A=HP:UP(g)&&(A=XP)),tM(this,g,t),A===HP&&_P(g),A===XP&&KP(g),this}});var IM,iM,oM,nM,rM,sM=A(tg.WeakMap);function aM(g,t,A,e){if("a"===A&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?g!==t||!e:!t.has(g))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===A?e:"a"===A?e.call(g):e?e.value:t.get(g)}function dM(g,t,A,e,C){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!C)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?g!==t||!C:!t.has(g))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?C.call(g,A):C?C.value=A:t.set(g,A),A}function hM(g,t){var A=void 0!==uh&&ln(g)||g["@@iterator"];if(!A){if(Rh(g)||(A=function(g,t){var A;if(!g)return;if("string"==typeof g)return lM(g,t);var e=wh(A=Object.prototype.toString.call(g)).call(A,8,-1);"Object"===e&&g.constructor&&(e=g.constructor.name);if("Map"===e||"Set"===e)return Uo(g);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return lM(g,t)}(g))||t&&g&&"number"==typeof g.length){A&&(g=A);var e=0,C=function(){};return{s:C,n:function(){return e>=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function lM(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A0&&void 0!==arguments[0]?arguments[0]:function(){};cn(this,g),oM.set(this,new uM),nM.set(this,new uM),rM.set(this,void 0),dM(this,rM,t,"f")}return kd(g,[{key:"sizeNodes",get:function(){return aM(this,oM,"f").size}},{key:"sizeEdges",get:function(){return aM(this,nM,"f").size}},{key:"getNodes",value:function(){return aM(this,oM,"f").getSelection()}},{key:"getEdges",value:function(){return aM(this,nM,"f").getSelection()}},{key:"addNodes",value:function(){var g;(g=aM(this,oM,"f")).add.apply(g,arguments)}},{key:"addEdges",value:function(){var g;(g=aM(this,nM,"f")).add.apply(g,arguments)}},{key:"deleteNodes",value:function(g){aM(this,oM,"f").delete(g)}},{key:"deleteEdges",value:function(g){aM(this,nM,"f").delete(g)}},{key:"clear",value:function(){aM(this,oM,"f").clear(),aM(this,nM,"f").clear()}},{key:"commit",value:function(){for(var g,t,A={nodes:aM(this,oM,"f").commit(),edges:aM(this,nM,"f").commit()},e=arguments.length,C=new Array(e),I=0;I=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function vM(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A4&&void 0!==arguments[4]&&arguments[4],I=this._initBaseEvent(t,A);if(!0===C)I.nodes=[],I.edges=[];else{var i=this.getSelection();I.nodes=i.nodes,I.edges=i.edges}void 0!==e&&(I.previousSelection=e),"click"==g&&(I.items=this.getClickedItems(A)),void 0!==t.controlEdge&&(I.controlEdge=t.controlEdge),this.body.emitter.emit(g,I)}},{key:"selectObject",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;if(void 0!==g){if(g instanceof jN){var A;if(!0===t)(A=this._selectionAccumulator).addEdges.apply(A,ch(g.edges));this._selectionAccumulator.addNodes(g)}else this._selectionAccumulator.addEdges(g);return!0}return!1}},{key:"deselectObject",value:function(g){!0===g.isSelected()&&(g.selected=!1,this._removeFromSelection(g))}},{key:"_getAllNodesOverlappingWith",value:function(g){for(var t=[],A=this.body.nodes,e=0;e1&&void 0!==arguments[1])||arguments[1],A=this._pointerToPositionObject(g),e=this._getAllNodesOverlappingWith(A);return e.length>0?!0===t?this.body.nodes[e[e.length-1]]:e[e.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(g,t){for(var A=this.body.edges,e=0;e1&&void 0!==arguments[1])||arguments[1],A=this.canvas.DOMtoCanvas(g),e=10,C=null,I=this.body.edges,i=0;i0&&(this.generateClickEvent("deselectEdge",t,g,C),A=!0),e.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,g,C),A=!0),e.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,g),A=!0),e.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,g),A=!0),!0===A&&this.generateClickEvent("select",t,g)}},{key:"getSelection",value:function(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}},{key:"getSelectedNodes",value:function(){return this._selectionAccumulator.getNodes()}},{key:"getSelectedEdges",value:function(){return this._selectionAccumulator.getEdges()}},{key:"getSelectedNodeIds",value:function(){var g;return Fh(g=this._selectionAccumulator.getNodes()).call(g,(function(g){return g.id}))}},{key:"getSelectedEdgeIds",value:function(){var g;return Fh(g=this._selectionAccumulator.getEdges()).call(g,(function(g){return g.id}))}},{key:"setSelection",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!g||!g.nodes&&!g.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((t.unselectAll||void 0===t.unselectAll)&&this.unselectAll(),g.nodes){var A,e=pM(g.nodes);try{for(e.s();!(A=e.n()).done;){var C=A.value,I=this.body.nodes[C];if(!I)throw new RangeError('Node with id "'+C+'" not found');this.selectObject(I,t.highlightEdges)}}catch(g){e.e(g)}finally{e.f()}}if(g.edges){var i,o=pM(g.edges);try{for(o.s();!(i=o.n()).done;){var n=i.value,r=this.body.edges[n];if(!r)throw new RangeError('Edge with id "'+n+'" not found');this.selectObject(r)}}catch(g){o.e(g)}finally{o.f()}}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}},{key:"selectNodes",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!g||void 0===g.length)throw"Selection must be an array with ids";this.setSelection({nodes:g},{highlightEdges:t})}},{key:"selectEdges",value:function(g){if(!g||void 0===g.length)throw"Selection must be an array with ids";this.setSelection({edges:g})}},{key:"updateSelection",value:function(){for(var g in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,g.id)||this._selectionAccumulator.deleteNodes(g);for(var t in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,t.id)||this._selectionAccumulator.deleteEdges(t)}},{key:"getClickedItems",value:function(g){for(var t=this.canvas.DOMtoCanvas(g),A=[],e=this.body.nodeIndices,C=this.body.nodes,I=e.length-1;I>=0;I--){var i=C[e[I]].getItemsOnPoint(t);A.push.apply(A,i)}for(var o=this.body.edgeIndices,n=this.body.edges,r=o.length-1;r>=0;r--){var s=n[o[r]].getItemsOnPoint(t);A.push.apply(A,s)}return A}}]),g}();function mM(g){var t=function(){if("undefined"==typeof Reflect||!MT)return!1;if(MT.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(MT(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=nb(g);if(t){var C=nb(this).constructor;A=MT(e,arguments,C)}else A=e.apply(this,arguments);return Ib(this,A)}}var bM=function(){function g(){cn(this,g)}return kd(g,[{key:"abstract",value:function(){throw new Error("Can't instantiate abstract class!")}},{key:"fake_use",value:function(){}},{key:"curveType",value:function(){return this.abstract()}},{key:"getPosition",value:function(g){return this.fake_use(g),this.abstract()}},{key:"setPosition",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.fake_use(g,t,A),this.abstract()}},{key:"getTreeSize",value:function(g){return this.fake_use(g),this.abstract()}},{key:"sort",value:function(g){this.fake_use(g),this.abstract()}},{key:"fix",value:function(g,t){this.fake_use(g,t),this.abstract()}},{key:"shift",value:function(g,t){this.fake_use(g,t),this.abstract()}}]),g}(),wM=function(g){Cb(A,g);var t=mM(A);function A(g){var e;return cn(this,A),(e=t.call(this)).layout=g,e}return kd(A,[{key:"curveType",value:function(){return"horizontal"}},{key:"getPosition",value:function(g){return g.x}},{key:"setPosition",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==A&&this.layout.hierarchical.addToOrdering(g,A),g.x=t}},{key:"getTreeSize",value:function(g){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,g);return{min:t.min_x,max:t.max_x}}},{key:"sort",value:function(g){WO(g).call(g,(function(g,t){return g.x-t.x}))}},{key:"fix",value:function(g,t){g.y=this.layout.options.hierarchical.levelSeparation*t,g.options.fixed.y=!0}},{key:"shift",value:function(g,t){this.layout.body.nodes[g].x+=t}}]),A}(bM),kM=function(g){Cb(A,g);var t=mM(A);function A(g){var e;return cn(this,A),(e=t.call(this)).layout=g,e}return kd(A,[{key:"curveType",value:function(){return"vertical"}},{key:"getPosition",value:function(g){return g.y}},{key:"setPosition",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==A&&this.layout.hierarchical.addToOrdering(g,A),g.y=t}},{key:"getTreeSize",value:function(g){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,g);return{min:t.min_y,max:t.max_y}}},{key:"sort",value:function(g){WO(g).call(g,(function(g,t){return g.y-t.y}))}},{key:"fix",value:function(g,t){g.x=this.layout.options.hierarchical.levelSeparation*t,g.options.fixed.x=!0}},{key:"shift",value:function(g,t){this.layout.body.nodes[g].y+=t}}]),A}(bM),xM=Sr.every;TA({target:"Array",proto:!0,forced:!_h("every")},{every:function(g){return xM(this,g,arguments.length>1?arguments[1]:void 0)}});var EM=Me("Array").every,OM=og,TM=EM,DM=Array.prototype,NM=function(g){var t=g.every;return g===DM||OM(DM,g)&&t===DM.every?TM:t},RM=A(NM);function PM(g,t){var A=void 0!==uh&&ln(g)||g["@@iterator"];if(!A){if(Rh(g)||(A=function(g,t){var A;if(!g)return;if("string"==typeof g)return MM(g,t);var e=wh(A=Object.prototype.toString.call(g)).call(A,8,-1);"Object"===e&&g.constructor&&(e=g.constructor.name);if("Map"===e||"Set"===e)return Uo(g);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return MM(g,t)}(g))||t&&g&&"number"==typeof g.length){A&&(g=A);var e=0,C=function(){};return{s:C,n:function(){return e>=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function MM(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A=t[e])&&(t[e]=t[A]+1)})),t}function zM(g,t,A,e){var C,I,i=$c(null),o=LE(C=ch(nT(e).call(e))).call(C,(function(g,t){return g+1+t.edges.length}),0),n=A+"Id",r="to"===A?1:-1,s=PM(e);try{var a,d=function(){var C=lh(I.value,2),s=C[0],a=C[1];if(!e.has(s)||!g(a))return 0;i[s]=0;for(var d,h,l=[a],c=0,u=function(){var g,C;if(!e.has(s))return 0;var I=i[d.id]+r;if(Cl(g=fc(C=d.edges).call(C,(function(g){return g.connected&&g.to!==g.from&&g[A]!==d&&e.has(g.toId)&&e.has(g.fromId)}))).call(g,(function(g){var e=g[n],C=i[e];(null==C||t(I,C))&&(i[e]=I,l.push(g[A]))})),c>o)return{v:{v:BM(e,i)}};++c};d=l.pop();)if(0!==(h=u())&&h)return h.v};for(s.s();!(I=s.n()).done;)if(0!==(a=d())&&a)return a.v}catch(g){s.e(g)}finally{s.f()}return i}var SM=function(){function g(){cn(this,g),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return kd(g,[{key:"addRelation",value:function(g,t){void 0===this.childrenReference[g]&&(this.childrenReference[g]=[]),this.childrenReference[g].push(t),void 0===this.parentReference[t]&&(this.parentReference[t]=[]),this.parentReference[t].push(g)}},{key:"checkIfTree",value:function(){for(var g in this.parentReference)if(this.parentReference[g].length>1)return void(this.isTree=!1);this.isTree=!0}},{key:"numTrees",value:function(){return this.treeIndex+1}},{key:"setTreeIndex",value:function(g,t){void 0!==t&&void 0===this.trees[g.id]&&(this.trees[g.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}},{key:"ensureLevel",value:function(g){void 0===this.levels[g]&&(this.levels[g]=0)}},{key:"getMaxLevel",value:function(g){var t=this,A={};return function g(e){if(void 0!==A[e])return A[e];var C=t.levels[e];if(t.childrenReference[e]){var I=t.childrenReference[e];if(I.length>0)for(var i=0;i0&&(A.levelSeparation*=-1):A.levelSeparation<0&&(A.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(!0===e)return this.body.emitter.emit("refresh"),qp(t,this.optionsBackup)}return t}},{key:"_resetRNG",value:function(g){this.initialRandomSeed=g,this._rng=Fp(this.initialRandomSeed)}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(g){if(!0===this.options.hierarchical.enabled){var t=this.optionsBackup.physics;void 0===g.physics||!0===g.physics?(g.physics={enabled:void 0===t.enabled||t.enabled,solver:"hierarchicalRepulsion"},t.enabled=void 0===t.enabled||t.enabled,t.solver=t.solver||"barnesHut"):"object"===yd(g.physics)?(t.enabled=void 0===g.physics.enabled||g.physics.enabled,t.solver=g.physics.solver||"barnesHut",g.physics.solver="hierarchicalRepulsion"):!1!==g.physics&&(t.solver="barnesHut",g.physics={solver:"hierarchicalRepulsion"});var A=this.direction.curveType();if(void 0===g.edges)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},g.edges={smooth:!1};else if(void 0===g.edges.smooth)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},g.edges.smooth=!1;else if("boolean"==typeof g.edges.smooth)this.optionsBackup.edges={smooth:g.edges.smooth},g.edges.smooth={enabled:g.edges.smooth,type:A};else{var e=g.edges.smooth;void 0!==e.type&&"dynamic"!==e.type&&(A=e.type),this.optionsBackup.edges={smooth:{enabled:void 0===e.enabled||e.enabled,type:void 0===e.type?"dynamic":e.type,roundness:void 0===e.roundness?.5:e.roundness,forceDirection:void 0!==e.forceDirection&&e.forceDirection}},g.edges.smooth={enabled:void 0===e.enabled||e.enabled,type:A,roundness:void 0===e.roundness?.5:e.roundness,forceDirection:void 0!==e.forceDirection&&e.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",A)}return g}},{key:"positionInitially",value:function(g){if(!0!==this.options.hierarchical.enabled){this._resetRNG(this.initialRandomSeed);for(var t=g.length+50,A=0;AC){for(var i=g.length;g.length>C&&e<=10;){e+=1;var o=g.length;if(e%3==0?this.body.modules.clustering.clusterBridges(I):this.body.modules.clustering.clusterOutliers(I),o==g.length&&e%3!=0)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*i)})}e>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(g,this.body.edgeIndices,!0),this._shiftToCenter();for(var n=0;n0){var g,t,A=!1,e=!1;for(t in this.lastNodeOnLevel={},this.hierarchical=new SM,this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(void 0!==(g=this.body.nodes[t]).options.level?(A=!0,this.hierarchical.levels[t]=g.options.level):e=!0);if(!0===e&&!0===A)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");if(!0===e){var C=this.options.hierarchical.sortMethod;"hubsize"===C?this._determineLevelsByHubsize():"directed"===C?this._determineLevelsDirected():"custom"===C&&this._determineLevelsCustomCallback()}for(var I in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,I)&&this.hierarchical.ensureLevel(I);var i=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(i),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var g=this,t=!1,A={},e=function(t,A){var e=g.hierarchical.trees;for(var C in e)Object.prototype.hasOwnProperty.call(e,C)&&e[C]===t&&g.direction.shift(C,A)},C=function(){for(var t=[],A=0;A0)for(var I=0;I1&&void 0!==arguments[1]?arguments[1]:1e9,e=1e9,C=1e9,I=1e9,i=-1e9;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var n=g.body.nodes[o],r=g.hierarchical.levels[n.id],s=g.direction.getPosition(n),a=lh(g._getSpaceAroundNode(n,t),2),d=a[0],h=a[1];e=Math.min(d,e),C=Math.min(h,C),r<=A&&(I=Math.min(s,I),i=Math.max(s,i))}return[I,i,e,C]},o=function(t,A,e){for(var C=g.hierarchical,I=0;I1)for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],o=g.direction.getPosition(A),n=g.direction.getPosition(e),r=Math.abs(n-o),s=g.options.hierarchical.nodeSpacing;if(r>s){var a={},d={};I(A,a),I(e,d);var h=function(t,A){var e=g.hierarchical.getMaxLevel(t.id),C=g.hierarchical.getMaxLevel(A.id);return Math.min(e,C)}(A,e),l=i(a,h),c=i(d,h),u=l[1],f=c[0],p=c[2];if(Math.abs(u-f)>s){var v=u-f+s;v<-p+s&&(v=-p+s),v<0&&(g._shiftBlock(e.id,v),t=!0,!0===C&&g._centerParent(e))}}},r=function(e,C){for(var o=C.id,n=C.edges,r=g.hierarchical.levels[C.id],s=g.options.hierarchical.levelSeparation*g.options.hierarchical.levelSeparation,a={},d=[],h=0;h0?h=Math.min(d,a-g.options.hierarchical.nodeSpacing):d<0&&(h=-Math.min(-d,s-g.options.hierarchical.nodeSpacing)),0!=h&&(g._shiftBlock(C.id,h),t=!0)}(v),function(A){var e=g.direction.getPosition(C),I=lh(g._getSpaceAroundNode(C),2),i=I[0],o=I[1],n=A-e,r=e;n>0?r=Math.min(e+(o-g.options.hierarchical.nodeSpacing),A):n<0&&(r=Math.max(e-(i-g.options.hierarchical.nodeSpacing),A)),r!==e&&(g.direction.setPosition(C,r),t=!0)}(v=p(e,n))};!0===this.options.hierarchical.blockShifting&&(function(A){var e=g.hierarchical.getLevels();e=cl(e).call(e);for(var C=0;C0&&Math.abs(a)0&&(n=this.direction.getPosition(e[I-1])+o),this.direction.setPosition(i,n,t),this._validatePositionAndContinue(i,t,n),C++}}}}},{key:"_placeBranchNodes",value:function(g,t){var A,e=this.hierarchical.childrenReference[g];if(void 0!==e){for(var C=[],I=0;It&&void 0===this.positionedNodes[o.id]))return;var r=this.options.hierarchical.nodeSpacing,s=void 0;s=0===i?this.direction.getPosition(this.body.nodes[g]):this.direction.getPosition(C[i-1])+r,this.direction.setPosition(o,s,n),this._validatePositionAndContinue(o,n,s)}var a=this._getCenterPosition(C);this.direction.setPosition(this.body.nodes[g],a,t)}}},{key:"_validatePositionAndContinue",value:function(g,t,A){if(this.hierarchical.isTree){if(void 0!==this.lastNodeOnLevel[t]){var e=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(A-eg}),"from",g)}(A),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_generateMap",value:function(){var g=this;this._crawlNetwork((function(t,A){g.hierarchical.levels[A.id]>g.hierarchical.levels[t.id]&&g.hierarchical.addRelation(t.id,A.id)})),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(){var g=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},A=arguments.length>1?arguments[1]:void 0,e={},C=function A(C,I){if(void 0===e[C.id]){var i;g.hierarchical.setTreeIndex(C,I),e[C.id]=!0;for(var o=g._getActiveEdges(C),n=0;n=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function GM(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A0&&!1!==this.options.deleteNode||0===A&&!1!==this.options.deleteEdge)&&(!0===i&&this._createSeperator(4),this._createDeleteButton(I)),this._bindElementEvents(this.closeDiv,je(g=this.toggleEditMode).call(g,this)),this._temporaryBindEvent("select",je(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){var g;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addNode",!0===this.guiEnabled){var t,A=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(A),this._createSeperator(),this._createDescription(A.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,je(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",je(g=this._performAddNode).call(g,this))}},{key:"editNode",value:function(){var g=this;!0!==this.editMode&&this.enableEditMode(),this._clean();var t=this.selectionHandler.getSelectedNodes()[0];if(void 0!==t){if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");if(!0!==t.isCluster){var A=qp({},t.options,!1);if(A.x=t.x,A.y=t.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(A,(function(t){null!=t&&"editNode"===g.inMode&&g.body.data.nodes.getDataSet().update(t),g.showManipulatorToolbar()}))}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){var g,t,A,e,C;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addEdge",!0===this.guiEnabled){var I,i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,je(I=this.toggleEditMode).call(I,this))}this._temporaryBindUI("onTouch",je(g=this._handleConnect).call(g,this)),this._temporaryBindUI("onDragEnd",je(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",je(A=this._dragControlNode).call(A,this)),this._temporaryBindUI("onRelease",je(e=this._finishConnect).call(e,this)),this._temporaryBindUI("onDragStart",je(C=this._dragStartEdge).call(C,this)),this._temporaryBindUI("onHold",(function(){}))}},{key:"editEdgeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="editEdge","object"!==yd(this.options.editEdge)||"function"!=typeof this.options.editEdge.editWithoutDrag||(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0===this.edgeBeingEditedId)){if(!0===this.guiEnabled){var g,t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,je(g=this.toggleEditMode).call(g,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0!==this.edgeBeingEditedId){var A,e,C,I,i=this.body.edges[this.edgeBeingEditedId],o=this._getNewTargetNode(i.from.x,i.from.y),n=this._getNewTargetNode(i.to.x,i.to.y);this.temporaryIds.nodes.push(o.id),this.temporaryIds.nodes.push(n.id),this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this._temporaryBindUI("onTouch",je(A=this._controlNodeTouch).call(A,this)),this._temporaryBindUI("onTap",(function(){})),this._temporaryBindUI("onHold",(function(){})),this._temporaryBindUI("onDragStart",je(e=this._controlNodeDragStart).call(e,this)),this._temporaryBindUI("onDrag",je(C=this._controlNodeDrag).call(C,this)),this._temporaryBindUI("onDragEnd",je(I=this._controlNodeDragEnd).call(I,this)),this._temporaryBindUI("onMouseMove",(function(){})),this._temporaryBindEvent("beforeDrawing",(function(g){var t=i.edgeType.findBorderPositions(g);!1===o.selected&&(o.x=t.from.x,o.y=t.from.y),!1===n.selected&&(n.x=t.to.x,n.y=t.to.y)})),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}else{var r=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(r.from.id,r.to.id)}}},{key:"deleteSelected",value:function(){var g=this;!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="delete";var t=this.selectionHandler.getSelectedNodeIds(),A=this.selectionHandler.getSelectedEdgeIds(),e=void 0;if(t.length>0){for(var C=0;C0&&"function"==typeof this.options.deleteEdge&&(e=this.options.deleteEdge);if("function"==typeof e){var I={nodes:t,edges:A};if(2!==e.length)throw new Error("The function for delete does not support two arguments (data, callback)");e(I,(function(t){null!=t&&"delete"===g.inMode?(g.body.data.edges.getDataSet().remove(t.edges),g.body.data.nodes.getDataSet().remove(t.nodes),g.body.emitter.emit("startSimulation"),g.showManipulatorToolbar()):(g.body.emitter.emit("startSimulation"),g.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().remove(A),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){!0===this.options.enabled?(this.guiEnabled=!0,this._createWrappers(),!1===this.editMode?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){var g,t;(void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",!0===this.editMode?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",!0===this.editMode?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv)&&(this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",null!==(g=null===(t=this.options.locales[this.options.locale])||void 0===t?void 0:t.close)&&void 0!==g?g:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(g,t){var A=qp({},this.options.controlNodeStyle);A.id="targetNode"+rD(),A.hidden=!1,A.physics=!1,A.x=g,A.y=t;var e=this.body.functions.createNode(A);return e.shape.boundingBox={left:g,right:g,top:t,bottom:t},e}},{key:"_createEditButton",value:function(){var g;this._clean(),this.manipulationDOM={},Qp(this.editModeDiv);var t=this.options.locales[this.options.locale],A=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(A),this._bindElementEvents(A,je(g=this.toggleEditMode).call(g,this))}},{key:"_clean",value:function(){this.inMode=!1,!0===this.guiEnabled&&(Qp(this.editModeDiv),Qp(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanupDOMEventListeners",value:function(){var g,t,A=FM(Zl(g=this._domEventListenerCleanupQueue).call(g,0));try{for(A.s();!(t=A.n()).done;){(0,t.value)()}}catch(g){A.e(g)}finally{A.f()}}},{key:"_removeManipulationDOM",value:function(){this._clean(),Qp(this.manipulationDiv),Qp(this.editModeDiv),Qp(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}},{key:"_createSeperator",value:function(){var g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+g]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+g].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+g])}},{key:"_createAddNodeButton",value:function(g){var t,A=this._createButton("addNode","vis-add",g.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.addNodeMode).call(t,this))}},{key:"_createAddEdgeButton",value:function(g){var t,A=this._createButton("addEdge","vis-connect",g.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.addEdgeMode).call(t,this))}},{key:"_createEditNodeButton",value:function(g){var t,A=this._createButton("editNode","vis-edit",g.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.editNode).call(t,this))}},{key:"_createEditEdgeButton",value:function(g){var t,A=this._createButton("editEdge","vis-edit",g.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.editEdgeMode).call(t,this))}},{key:"_createDeleteButton",value:function(g){var t,A;A=this.options.rtl?"vis-delete-rtl":"vis-delete";var e=this._createButton("delete",A,g.del||this.options.locales.en.del);this.manipulationDiv.appendChild(e),this._bindElementEvents(e,je(t=this.deleteSelected).call(t,this))}},{key:"_createBackButton",value:function(g){var t,A=this._createButton("back","vis-back",g.back||this.options.locales.en.back);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,je(t=this.showManipulatorToolbar).call(t,this))}},{key:"_createButton",value:function(g,t,A){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[g+"Div"]=document.createElement("button"),this.manipulationDOM[g+"Div"].className="vis-button "+t,this.manipulationDOM[g+"Label"]=document.createElement("div"),this.manipulationDOM[g+"Label"].className=e,this.manipulationDOM[g+"Label"].innerText=A,this.manipulationDOM[g+"Div"].appendChild(this.manipulationDOM[g+"Label"]),this.manipulationDOM[g+"Div"]}},{key:"_createDescription",value:function(g){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=g,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}},{key:"_temporaryBindEvent",value:function(g,t){this.temporaryEventFunctions.push({event:g,boundFunction:t}),this.body.emitter.on(g,t)}},{key:"_temporaryBindUI",value:function(g,t){if(void 0===this.body.eventListeners[g])throw new Error("This UI function does not exist. Typo? You tried: "+g+" possible are: "+eu(Lh(this.body.eventListeners)));this.temporaryUIFunctions[g]=this.body.eventListeners[g],this.body.eventListeners[g]=t}},{key:"_unbindTemporaryUIs",value:function(){for(var g in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,g)&&(this.body.eventListeners[g]=this.temporaryUIFunctions[g],delete this.temporaryUIFunctions[g]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var g=0;g=0;i--)if(C[i]!==this.selectedControlNode.id){I=this.body.nodes[C[i]];break}if(void 0!==I&&void 0!==this.selectedControlNode)if(!0===I.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var o=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===o.id?this._performEditEdge(I.id,e.to.id):this._performEditEdge(e.from.id,I.id)}else e.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(g){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(g.center),this.lastTouch.translation=pe({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;var t=this.lastTouch,A=this.selectionHandler.getNodeAt(t);if(void 0!==A)if(!0===A.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var e=this._getNewTargetNode(A.x,A.y);this.body.nodes[e.id]=e,this.body.nodeIndices.push(e.id);var C=this.body.functions.createEdge({id:"connectionEdge"+rD(),from:A.id,to:e.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(e.id),this.temporaryIds.edges.push(C.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(g){var t=this.body.functions.getPointer(g.center),A=this.selectionHandler._pointerToPositionObject(t),e=void 0;void 0!==this.temporaryIds.edges[0]&&(e=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var C=this.selectionHandler._getAllNodesOverlappingWith(A),I=void 0,i=C.length-1;i>=0;i--){var o;if(-1===Xc(o=this.temporaryIds.nodes).call(o,C[i])){I=this.body.nodes[C[i]];break}}if(g.controlEdge={from:e,to:I?I.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",g,t),void 0!==this.temporaryIds.nodes[0]){var n=this.body.nodes[this.temporaryIds.nodes[0]];n.x=this.canvas._XconvertDOMtoCanvas(t.x),n.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(g)}},{key:"_finishConnect",value:function(g){var t=this.body.functions.getPointer(g.center),A=this.selectionHandler._pointerToPositionObject(t),e=void 0;void 0!==this.temporaryIds.edges[0]&&(e=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var C=this.selectionHandler._getAllNodesOverlappingWith(A),I=void 0,i=C.length-1;i>=0;i--){var o;if(-1===Xc(o=this.temporaryIds.nodes).call(o,C[i])){I=this.body.nodes[C[i]];break}}this._cleanupTemporaryNodesAndEdges(),void 0!==I&&(!0===I.isCluster?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[e]&&void 0!==this.body.nodes[I.id]&&this._performAddEdge(e,I.id)),g.controlEdge={from:e,to:I?I.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",g,t),this.body.emitter.emit("_redraw")}},{key:"_dragStartEdge",value:function(g){var t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",g,t,void 0,!0)}},{key:"_performAddNode",value:function(g){var t=this,A={id:rD(),x:g.pointer.canvas.x,y:g.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(A,(function(g){null!=g&&"addNode"===t.inMode&&t.body.data.nodes.getDataSet().add(g),t.showManipulatorToolbar()}))}else this.body.data.nodes.getDataSet().add(A),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(g,t){var A=this,e={from:g,to:t};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(e,(function(g){null!=g&&"addEdge"===A.inMode&&(A.body.data.edges.getDataSet().add(g),A.selectionHandler.unselectAll(),A.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().add(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(g,t){var A=this,e={id:this.edgeBeingEditedId,from:g,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label},C=this.options.editEdge;if("object"===yd(C)&&(C=C.editWithoutDrag),"function"==typeof C){if(2!==C.length)throw new Error("The function for edit does not support two arguments (data, callback)");C(e,(function(g){null==g||"editEdge"!==A.inMode?(A.body.edges[e.id].updateEdgeType(),A.body.emitter.emit("_redraw"),A.showManipulatorToolbar()):(A.body.data.edges.getDataSet().update(g),A.selectionHandler.unselectAll(),A.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().update(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),g}(),LM="string",VM="boolean",YM="number",WM="array",QM="object",UM=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],_M={borderWidth:{number:YM},borderWidthSelected:{number:YM,undefined:"undefined"},brokenImage:{string:LM,undefined:"undefined"},chosen:{label:{boolean:VM,function:"function"},node:{boolean:VM,function:"function"},__type__:{object:QM,boolean:VM}},color:{border:{string:LM},background:{string:LM},highlight:{border:{string:LM},background:{string:LM},__type__:{object:QM,string:LM}},hover:{border:{string:LM},background:{string:LM},__type__:{object:QM,string:LM}},__type__:{object:QM,string:LM}},opacity:{number:YM,undefined:"undefined"},fixed:{x:{boolean:VM},y:{boolean:VM},__type__:{object:QM,boolean:VM}},font:{align:{string:LM},color:{string:LM},size:{number:YM},face:{string:LM},background:{string:LM},strokeWidth:{number:YM},strokeColor:{string:LM},vadjust:{number:YM},multi:{boolean:VM,string:LM},bold:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},boldital:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},ital:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},mono:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},__type__:{object:QM,string:LM}},group:{string:LM,number:YM,undefined:"undefined"},heightConstraint:{minimum:{number:YM},valign:{string:LM},__type__:{object:QM,boolean:VM,number:YM}},hidden:{boolean:VM},icon:{face:{string:LM},code:{string:LM},size:{number:YM},color:{string:LM},weight:{string:LM,number:YM},__type__:{object:QM}},id:{string:LM,number:YM},image:{selected:{string:LM,undefined:"undefined"},unselected:{string:LM,undefined:"undefined"},__type__:{object:QM,string:LM}},imagePadding:{top:{number:YM},right:{number:YM},bottom:{number:YM},left:{number:YM},__type__:{object:QM,number:YM}},label:{string:LM,undefined:"undefined"},labelHighlightBold:{boolean:VM},level:{number:YM,undefined:"undefined"},margin:{top:{number:YM},right:{number:YM},bottom:{number:YM},left:{number:YM},__type__:{object:QM,number:YM}},mass:{number:YM},physics:{boolean:VM},scaling:{min:{number:YM},max:{number:YM},label:{enabled:{boolean:VM},min:{number:YM},max:{number:YM},maxVisible:{number:YM},drawThreshold:{number:YM},__type__:{object:QM,boolean:VM}},customScalingFunction:{function:"function"},__type__:{object:QM}},shadow:{enabled:{boolean:VM},color:{string:LM},size:{number:YM},x:{number:YM},y:{number:YM},__type__:{object:QM,boolean:VM}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:VM,array:WM},borderRadius:{number:YM},interpolation:{boolean:VM},useImageSize:{boolean:VM},useBorderWithImage:{boolean:VM},coordinateOrigin:{string:["center","top-left"]},__type__:{object:QM}},size:{number:YM},title:{string:LM,dom:"dom",undefined:"undefined"},value:{number:YM,undefined:"undefined"},widthConstraint:{minimum:{number:YM},maximum:{number:YM},__type__:{object:QM,boolean:VM,number:YM}},x:{number:YM},y:{number:YM},__type__:{object:QM}},KM={configure:{enabled:{boolean:VM},filter:{boolean:VM,string:LM,array:WM,function:"function"},container:{dom:"dom"},showButton:{boolean:VM},__type__:{object:QM,boolean:VM,string:LM,array:WM,function:"function"}},edges:{arrows:{to:{enabled:{boolean:VM},scaleFactor:{number:YM},type:{string:UM},imageHeight:{number:YM},imageWidth:{number:YM},src:{string:LM},__type__:{object:QM,boolean:VM}},middle:{enabled:{boolean:VM},scaleFactor:{number:YM},type:{string:UM},imageWidth:{number:YM},imageHeight:{number:YM},src:{string:LM},__type__:{object:QM,boolean:VM}},from:{enabled:{boolean:VM},scaleFactor:{number:YM},type:{string:UM},imageWidth:{number:YM},imageHeight:{number:YM},src:{string:LM},__type__:{object:QM,boolean:VM}},__type__:{string:["from","to","middle"],object:QM}},endPointOffset:{from:{number:YM},to:{number:YM},__type__:{object:QM,number:YM}},arrowStrikethrough:{boolean:VM},background:{enabled:{boolean:VM},color:{string:LM},size:{number:YM},dashes:{boolean:VM,array:WM},__type__:{object:QM,boolean:VM}},chosen:{label:{boolean:VM,function:"function"},edge:{boolean:VM,function:"function"},__type__:{object:QM,boolean:VM}},color:{color:{string:LM},highlight:{string:LM},hover:{string:LM},inherit:{string:["from","to","both"],boolean:VM},opacity:{number:YM},__type__:{object:QM,string:LM}},dashes:{boolean:VM,array:WM},font:{color:{string:LM},size:{number:YM},face:{string:LM},background:{string:LM},strokeWidth:{number:YM},strokeColor:{string:LM},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:YM},multi:{boolean:VM,string:LM},bold:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},boldital:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},ital:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},mono:{color:{string:LM},size:{number:YM},face:{string:LM},mod:{string:LM},vadjust:{number:YM},__type__:{object:QM,string:LM}},__type__:{object:QM,string:LM}},hidden:{boolean:VM},hoverWidth:{function:"function",number:YM},label:{string:LM,undefined:"undefined"},labelHighlightBold:{boolean:VM},length:{number:YM,undefined:"undefined"},physics:{boolean:VM},scaling:{min:{number:YM},max:{number:YM},label:{enabled:{boolean:VM},min:{number:YM},max:{number:YM},maxVisible:{number:YM},drawThreshold:{number:YM},__type__:{object:QM,boolean:VM}},customScalingFunction:{function:"function"},__type__:{object:QM}},selectionWidth:{function:"function",number:YM},selfReferenceSize:{number:YM},selfReference:{size:{number:YM},angle:{number:YM},renderBehindTheNode:{boolean:VM},__type__:{object:QM}},shadow:{enabled:{boolean:VM},color:{string:LM},size:{number:YM},x:{number:YM},y:{number:YM},__type__:{object:QM,boolean:VM}},smooth:{enabled:{boolean:VM},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:YM},forceDirection:{string:["horizontal","vertical","none"],boolean:VM},__type__:{object:QM,boolean:VM}},title:{string:LM,undefined:"undefined"},width:{number:YM},widthConstraint:{maximum:{number:YM},__type__:{object:QM,boolean:VM,number:YM}},value:{number:YM,undefined:"undefined"},__type__:{object:QM}},groups:{useDefaultGroups:{boolean:VM},__any__:_M,__type__:{object:QM}},interaction:{dragNodes:{boolean:VM},dragView:{boolean:VM},hideEdgesOnDrag:{boolean:VM},hideEdgesOnZoom:{boolean:VM},hideNodesOnDrag:{boolean:VM},hover:{boolean:VM},keyboard:{enabled:{boolean:VM},speed:{x:{number:YM},y:{number:YM},zoom:{number:YM},__type__:{object:QM}},bindToWindow:{boolean:VM},autoFocus:{boolean:VM},__type__:{object:QM,boolean:VM}},multiselect:{boolean:VM},navigationButtons:{boolean:VM},selectable:{boolean:VM},selectConnectedEdges:{boolean:VM},hoverConnectedEdges:{boolean:VM},tooltipDelay:{number:YM},zoomView:{boolean:VM},zoomSpeed:{number:YM},__type__:{object:QM}},layout:{randomSeed:{undefined:"undefined",number:YM,string:LM},improvedLayout:{boolean:VM},clusterThreshold:{number:YM},hierarchical:{enabled:{boolean:VM},levelSeparation:{number:YM},nodeSpacing:{number:YM},treeSpacing:{number:YM},blockShifting:{boolean:VM},edgeMinimization:{boolean:VM},parentCentralization:{boolean:VM},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:QM,boolean:VM}},__type__:{object:QM}},manipulation:{enabled:{boolean:VM},initiallyActive:{boolean:VM},addNode:{boolean:VM,function:"function"},addEdge:{boolean:VM,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:QM,boolean:VM,function:"function"}},deleteNode:{boolean:VM,function:"function"},deleteEdge:{boolean:VM,function:"function"},controlNodeStyle:_M,__type__:{object:QM,boolean:VM}},nodes:_M,physics:{enabled:{boolean:VM},barnesHut:{theta:{number:YM},gravitationalConstant:{number:YM},centralGravity:{number:YM},springLength:{number:YM},springConstant:{number:YM},damping:{number:YM},avoidOverlap:{number:YM},__type__:{object:QM}},forceAtlas2Based:{theta:{number:YM},gravitationalConstant:{number:YM},centralGravity:{number:YM},springLength:{number:YM},springConstant:{number:YM},damping:{number:YM},avoidOverlap:{number:YM},__type__:{object:QM}},repulsion:{centralGravity:{number:YM},springLength:{number:YM},springConstant:{number:YM},nodeDistance:{number:YM},damping:{number:YM},__type__:{object:QM}},hierarchicalRepulsion:{centralGravity:{number:YM},springLength:{number:YM},springConstant:{number:YM},nodeDistance:{number:YM},damping:{number:YM},avoidOverlap:{number:YM},__type__:{object:QM}},maxVelocity:{number:YM},minVelocity:{number:YM},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:VM},iterations:{number:YM},updateInterval:{number:YM},onlyDynamicEdges:{boolean:VM},fit:{boolean:VM},__type__:{object:QM,boolean:VM}},timestep:{number:YM},adaptiveTimestep:{boolean:VM},wind:{x:{number:YM},y:{number:YM},__type__:{object:QM}},__type__:{object:QM,boolean:VM}},autoResize:{boolean:VM},clickToUse:{boolean:VM},locale:{string:LM},locales:{__any__:{any:"any"},__type__:{object:QM}},height:{string:LM},width:{string:LM},__type__:{object:QM}},HM={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]}}},XM=function(g,t,A){var e;return!(!Ic(g).call(g,"physics")||!Ic(e=HM.physics.solver).call(e,t)||A.physics.solver===t||"wind"===t)},JM=Object.freeze({__proto__:null,allOptions:KM,configuratorHideOption:XM,configureOptions:HM}),qM=function(){function g(){cn(this,g)}return kd(g,[{key:"getDistances",value:function(g,t,A){for(var e={},C=g.edges,I=0;I2&&void 0!==arguments[2]&&arguments[2],e=this.distanceSolver.getDistances(this.body,g,t);this._createL_matrix(e),this._createK_matrix(e),this._createE_matrix();for(var C=0,I=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),i=1e9,o=0,n=0,r=0,s=0,a=0;i>.01&&C1&&a<5;){a+=1,this._moveNode(o,n,r);var h=lh(this._getEnergy(o),3);s=h[0],n=h[1],r=h[2]}}}},{key:"_getHighestEnergyNode",value:function(g){for(var t=this.body.nodeIndices,A=this.body.nodes,e=0,C=t[0],I=0,i=0,o=0;o