@nuxt/devtools 0.6.7 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dist/chunks/module-main.mjs +126 -75
  2. package/dist/chunks/plugin-metrics.mjs +15 -12
  3. package/dist/chunks/timeline.mjs +69 -0
  4. package/dist/chunks/vscode.mjs +5 -5
  5. package/dist/client/200.html +2 -2
  6. package/dist/client/404.html +2 -2
  7. package/dist/client/_nuxt/AuthRequiredPanel.vue.d0cfb6b2.js +1 -0
  8. package/dist/client/_nuxt/Badge.51add8bd.js +1 -0
  9. package/dist/client/_nuxt/CodeDiff.vue.ef3840bb.js +3 -0
  10. package/dist/client/_nuxt/CodeSnippets.vue.ac1ba0c8.js +1 -0
  11. package/dist/client/_nuxt/ComposableItem.vue.a20c44a4.js +1 -0
  12. package/dist/client/_nuxt/DrawerRight.vue.53f21930.js +1 -0
  13. package/dist/client/_nuxt/DurationDisplay.vue.8283fdb3.js +1 -0
  14. package/dist/client/_nuxt/FilepathItem.vue.6f4d3680.js +1 -0
  15. package/dist/client/_nuxt/HelpFab.vue.58531843.js +1 -0
  16. package/dist/client/_nuxt/LaunchPage.vue.36ead88c.js +1 -0
  17. package/dist/client/_nuxt/NCheckbox.vue.a57ff0bb.js +1 -0
  18. package/dist/client/_nuxt/NCodeBlock.vue.2012eb81.js +2 -0
  19. package/dist/client/_nuxt/NIconTitle.vue.c1ac3b5f.js +1 -0
  20. package/dist/client/_nuxt/NLink.vue.c45070c9.js +1 -0
  21. package/dist/client/_nuxt/{NMarkdown.vue.31d61f61.js → NMarkdown.vue.6bccbb92.js} +1 -1
  22. package/dist/client/_nuxt/NSectionBlock.7613319f.js +1 -0
  23. package/dist/client/_nuxt/NSelect.vue.b9c29645.js +1 -0
  24. package/dist/client/_nuxt/NSwitch.vue.fa9b060a.js +1 -0
  25. package/dist/client/_nuxt/NTip.vue.95e4ec9e.js +1 -0
  26. package/dist/client/_nuxt/Navbar.vue.6c01dcab.js +1 -0
  27. package/dist/client/_nuxt/StateEditor.vue.c5cc22ae.js +1 -0
  28. package/dist/client/_nuxt/__blank.87af3281.js +1 -0
  29. package/dist/client/_nuxt/analyze-build.cf3dea6a.js +1 -0
  30. package/dist/client/_nuxt/assets.4f097b22.js +16 -0
  31. package/dist/client/_nuxt/client.247a64bd.js +1 -0
  32. package/dist/client/_nuxt/{components.3a437d73.js → components.07744e27.js} +6 -6
  33. package/dist/client/_nuxt/{constants.d7bcda3c.js → constants.2fec5dff.js} +1 -1
  34. package/dist/client/_nuxt/custom-_name_.6e463663.js +1 -0
  35. package/dist/client/_nuxt/default.3a13b5c9.js +1 -0
  36. package/dist/client/_nuxt/entry.185d6835.css +1 -0
  37. package/dist/client/_nuxt/entry.33b5be03.js +21 -0
  38. package/dist/client/_nuxt/{error-404.eb07c617.js → error-404.b216bd73.js} +1 -1
  39. package/dist/client/_nuxt/{error-500.8214e786.js → error-500.1bc58b0e.js} +1 -1
  40. package/dist/client/_nuxt/full.92d6a5f8.js +1 -0
  41. package/dist/client/_nuxt/hooks.259d0a69.js +1 -0
  42. package/dist/client/_nuxt/imports.cc27dbf7.js +1 -0
  43. package/dist/client/_nuxt/{index.98d48447.js → index.064a7a87.js} +1 -1
  44. package/dist/client/_nuxt/{index.6a0822c9.js → index.8f3e434d.js} +1 -1
  45. package/dist/client/_nuxt/{json-editor-vue.9acffc14.js → json-editor-vue.af845b1c.js} +1 -1
  46. package/dist/client/_nuxt/{middleware.c2f916df.js → middleware.fcdb1770.js} +1 -1
  47. package/dist/client/_nuxt/modules.5891e891.js +2 -0
  48. package/dist/client/_nuxt/none.e5b666cf.js +1 -0
  49. package/dist/client/_nuxt/open-graph.1141dd15.js +3 -0
  50. package/dist/client/_nuxt/overview.2af20256.js +1 -0
  51. package/dist/client/_nuxt/pages.b3fe162f.js +1 -0
  52. package/dist/client/_nuxt/payload.2d5cef36.js +1 -0
  53. package/dist/client/_nuxt/plugins.f25d8e7c.js +1 -0
  54. package/dist/client/_nuxt/runtime-configs.68765f10.js +1 -0
  55. package/dist/client/_nuxt/server-routes.ab41fbf6.js +9 -0
  56. package/dist/client/_nuxt/settings.cb26edfb.js +1 -0
  57. package/dist/client/_nuxt/{state-components.493c1b8d.js → state-components.3bf21c12.js} +1 -1
  58. package/dist/client/_nuxt/state-modules.dfd5fe81.js +1 -0
  59. package/dist/client/_nuxt/storage.921a198c.js +1 -0
  60. package/dist/client/_nuxt/{terminals.714ad795.js → terminals.67898f73.js} +7 -7
  61. package/dist/client/_nuxt/timeline.289e5c9e.css +1 -0
  62. package/dist/client/_nuxt/timeline.6b8e8f78.js +57 -0
  63. package/dist/client/_nuxt/{unocss-runtime.552cd61f.js → unocss-runtime.5034abfc.js} +2 -2
  64. package/dist/client/_nuxt/virtual-files.e3271a06.js +1 -0
  65. package/dist/client/index.html +2 -2
  66. package/dist/{global-20ccb74c.d.ts → global-ea55645c.d.ts} +7 -1
  67. package/dist/module.d.ts +1 -1
  68. package/dist/module.json +1 -1
  69. package/dist/module.mjs +1 -1
  70. package/dist/runtime/function-metrics-helpers.d.ts +3 -0
  71. package/dist/runtime/function-metrics-helpers.mjs +63 -0
  72. package/dist/runtime/plugins/devtools.client.mjs +2 -1
  73. package/dist/runtime/plugins/view/client.d.ts +3 -1
  74. package/dist/runtime/plugins/view/client.mjs +60 -23
  75. package/dist/runtime/plugins/view/state.mjs +1 -1
  76. package/dist/runtime/plugins/view/utils.d.ts +1 -1
  77. package/dist/runtime/plugins/view/utils.mjs +15 -15
  78. package/dist/shared/{devtools.ce3f2385.mjs → devtools.d198e7a9.mjs} +7 -1
  79. package/dist/types.d.ts +1 -1
  80. package/package.json +20 -19
  81. package/dist/client/__blank/index.html +0 -7
  82. package/dist/client/_nuxt/AuthRequiredPanel.vue.fc7f2968.js +0 -1
  83. package/dist/client/_nuxt/Badge.e05fc69f.js +0 -1
  84. package/dist/client/_nuxt/CodeSnippets.vue.a1fe908d.js +0 -1
  85. package/dist/client/_nuxt/DrawerRight.vue.3adebf89.js +0 -1
  86. package/dist/client/_nuxt/DurationDisplay.vue.c6aa67b3.js +0 -1
  87. package/dist/client/_nuxt/FilepathItem.vue.7520a5eb.js +0 -1
  88. package/dist/client/_nuxt/HelpFab.vue.6c2e0089.js +0 -1
  89. package/dist/client/_nuxt/LaunchPage.vue.ace7e996.js +0 -1
  90. package/dist/client/_nuxt/NCheckbox.vue.660c8c34.js +0 -1
  91. package/dist/client/_nuxt/NCodeBlock.vue.12f6d4d2.js +0 -2
  92. package/dist/client/_nuxt/NIconButton.vue.9dc5b644.js +0 -1
  93. package/dist/client/_nuxt/NIconTitle.vue.0db956c8.js +0 -1
  94. package/dist/client/_nuxt/NLink.vue.f3f95732.js +0 -1
  95. package/dist/client/_nuxt/NPanelGrids.cfd60e85.js +0 -1
  96. package/dist/client/_nuxt/NSectionBlock.216523d8.js +0 -1
  97. package/dist/client/_nuxt/NSelect.vue.38f0d91b.js +0 -1
  98. package/dist/client/_nuxt/NSwitch.vue.4e114eb7.js +0 -1
  99. package/dist/client/_nuxt/NTip.vue.d602d31e.js +0 -1
  100. package/dist/client/_nuxt/Navbar.vue.72301b0e.js +0 -1
  101. package/dist/client/_nuxt/PanelLeftRight.vue.d1539d19.js +0 -1
  102. package/dist/client/_nuxt/StateEditor.vue.c8fd02b3.js +0 -1
  103. package/dist/client/_nuxt/__blank.58b4eaa9.js +0 -1
  104. package/dist/client/_nuxt/analyze-build.66f9bc20.js +0 -1
  105. package/dist/client/_nuxt/assets.b60a4d67.js +0 -16
  106. package/dist/client/_nuxt/client.1e3208e3.js +0 -1
  107. package/dist/client/_nuxt/custom-_name_.1614dd97.js +0 -1
  108. package/dist/client/_nuxt/default.a69a326f.js +0 -1
  109. package/dist/client/_nuxt/entry.559460ac.js +0 -21
  110. package/dist/client/_nuxt/entry.e49b0ddd.css +0 -1
  111. package/dist/client/_nuxt/full.1f3e7ba7.js +0 -1
  112. package/dist/client/_nuxt/hooks.7a294c4b.js +0 -1
  113. package/dist/client/_nuxt/imports.8b3c700a.js +0 -1
  114. package/dist/client/_nuxt/modules.a1aceff5.js +0 -4
  115. package/dist/client/_nuxt/none.bf6672f1.js +0 -1
  116. package/dist/client/_nuxt/open-graph.f68f3562.js +0 -3
  117. package/dist/client/_nuxt/overview.9fbd51a4.js +0 -1
  118. package/dist/client/_nuxt/pages.8b6a187c.js +0 -1
  119. package/dist/client/_nuxt/payload.5851379a.js +0 -1
  120. package/dist/client/_nuxt/plugins.20750545.js +0 -1
  121. package/dist/client/_nuxt/runtime-configs.ce330378.js +0 -1
  122. package/dist/client/_nuxt/server-routes.08ebdd45.js +0 -9
  123. package/dist/client/_nuxt/settings.63ba52d8.js +0 -1
  124. package/dist/client/_nuxt/state-modules.c72270b1.js +0 -1
  125. package/dist/client/_nuxt/storage.d37c76d1.js +0 -1
  126. package/dist/client/_nuxt/virtual-files.7bf5357c.js +0 -1
  127. package/dist/client/modules/analyze-build/index.html +0 -7
  128. package/dist/client/modules/assets/index.html +0 -7
  129. package/dist/client/modules/components/index.html +0 -7
  130. package/dist/client/modules/hooks/index.html +0 -7
  131. package/dist/client/modules/imports/index.html +0 -7
  132. package/dist/client/modules/middleware/index.html +0 -7
  133. package/dist/client/modules/modules/index.html +0 -7
  134. package/dist/client/modules/open-graph/index.html +0 -7
  135. package/dist/client/modules/overview/index.html +0 -7
  136. package/dist/client/modules/pages/index.html +0 -7
  137. package/dist/client/modules/payload/index.html +0 -7
  138. package/dist/client/modules/plugins/index.html +0 -7
  139. package/dist/client/modules/runtime-configs/index.html +0 -7
  140. package/dist/client/modules/server-routes/index.html +0 -7
  141. package/dist/client/modules/storage/index.html +0 -7
  142. package/dist/client/modules/terminals/index.html +0 -7
  143. package/dist/client/modules/virtual-files/index.html +0 -7
  144. package/dist/client/settings/index.html +0 -7
@@ -1,4 +1,4 @@
1
- import{_ as g_}from"./NIconButton.vue.9dc5b644.js";import{o as fe,c as lt,a as te,d as ja,g as Gi,l as rn,t as ok,q as Z,W as sk,b as Be,h as $t,s as Qt,a1 as Vu,r as Sa,a2 as uk,a3 as lk,V as ck,a4 as hk,a5 as dk,a6 as fk,w as qe,F as Vr,a7 as y_,a8 as vk,I as pi,j as pk,a9 as gk,Z as yk,aa as mk,ab as $k,m as ga,ac as bk,ad as wk}from"./entry.559460ac.js";import{_ as _k}from"./HelpFab.vue.6c2e0089.js";import{u as Ek,a as Sk}from"./state-components.493c1b8d.js";import{_ as Ok}from"./NCheckbox.vue.660c8c34.js";import{_ as m_}from"./Navbar.vue.72301b0e.js";import{_ as $_}from"./Badge.e05fc69f.js";import{_ as b_}from"./FilepathItem.vue.7520a5eb.js";import{_ as Tk}from"./DrawerRight.vue.3adebf89.js";import{_ as xk}from"./NSectionBlock.216523d8.js";import{_ as Pk}from"./NIconTitle.vue.0db956c8.js";import{D as jl}from"./constants.d7bcda3c.js";const kk={class:"markdown-body"},Ik=te("h1",null,"Components",-1),Ck=te("p",null,[ja("Vue components under the "),te("code",null,"components/"),ja(" directory are automatically registered and can be used in your templates without importing them.")],-1),Ak=te("p",null,[te("a",{href:"https://nuxt.com/docs/guide/directory-structure/components",target:"_blank",rel:"noopener"},"Learn more on the documentation")],-1),Rk=[Ik,Ck,Ak],Dk={__name:"components",setup(t,{expose:i}){return i({frontmatter:{}}),(r,n)=>(fe(),lt("div",kk,Rk))}},Mk=/\d/,Nk=["-","_","/","."];function Fk(t=""){if(!Mk.test(t))return t.toUpperCase()===t}function Bk(t,i){const e=i??Nk,r=[];if(!t||typeof t!="string")return r;let n="",a,o;for(const s of t){const u=e.includes(s);if(u===!0){r.push(n),n="",a=void 0;continue}const l=Fk(s);if(o===!1){if(a===!1&&l===!0){r.push(n),n=s,a=l;continue}if(a===!0&&l===!1&&n.length>1){const c=n[n.length-1];r.push(n.slice(0,Math.max(0,n.length-1))),n=c+s,a=l;continue}}n+=s,a=l,o=u}return r.push(n),r}function Lk(t){return t?t[0].toUpperCase()+t.slice(1):""}function w_(t){return t?(Array.isArray(t)?t:Bk(t)).map(i=>Lk(i)).join(""):""}const jk={"text-sm":"","font-mono":""},zk=te("span",{mr1:"",op20:""},"<",-1),Hk=te("span",{ml1:"",op20:""},"/>",-1),__=Gi({__name:"ComponentName",props:{component:{}},setup(t){const i=t,e=rn(()=>i.component.pascalName||w_(i.component.name||i.component.__name||i.component.kebabName||""));return(r,n)=>(fe(),lt("code",jk,[zk,ja(ok(Z(e)),1),Hk]))}}),Wk={flex:"~ col gap1","items-start":"","of-hidden":""},Vk={flex:"~ gap2"},E_=Gi({__name:"ComponentDetails",props:{component:{}},setup(t){const i=t,e=rn(()=>i.component.pascalName||w_(i.component.name||i.component.__name||i.component.kebabName||"")),r=rn(()=>i.component.filePath||i.component.file||i.component.__file||""),n=sk();return(a,o)=>{const s=__,u=g_,l=$_,c=b_;return fe(),lt("div",Wk,[te("div",Vk,[Be(s,{component:a.component},null,8,["component"]),Be(u,{title:"Copy name","flex-none":"",icon:"carbon-copy",onClick:o[0]||(o[0]=h=>Z(n)(`<${Z(e)}></${Z(e)}>`))}),a.component.global?(fe(),$t(l,{key:0,"bg-green-400:10":"","text-green-400":"",title:"Registered at runtime as a global component",textContent:"runtime"})):Qt("",!0)]),te("div",null,[Z(r)?(fe(),$t(c,{key:0,filepath:Z(r),"w-full":"","text-sm":"",op25:"","group-hover:op75":""},null,8,["filepath"])):Qt("",!0)]),Vu(a.$slots,"default")])}}});/**
1
+ import{o as fe,c as lt,a as ee,d as ja,g as Gi,m as rn,t as ok,s as Z,a2 as sk,b as Be,h as $t,v as Qt,Y as Vu,S as g_,r as Sa,a7 as uk,a8 as lk,a1 as ck,a9 as hk,aa as dk,ab as fk,w as qe,F as Vr,ac as y_,ad as vk,L as pi,k as pk,ae as gk,a5 as yk,af as mk,ag as $k,n as ga,ah as bk,ai as wk}from"./entry.33b5be03.js";import{_ as _k}from"./HelpFab.vue.58531843.js";import{u as Ek,a as Sk}from"./state-components.3bf21c12.js";import{_ as Ok}from"./NCheckbox.vue.a57ff0bb.js";import{_ as m_}from"./Navbar.vue.6c01dcab.js";import{_ as $_}from"./Badge.51add8bd.js";import{_ as b_}from"./FilepathItem.vue.6f4d3680.js";import{_ as Tk}from"./DrawerRight.vue.53f21930.js";import{_ as xk}from"./NSectionBlock.7613319f.js";import{_ as Pk}from"./NIconTitle.vue.c1ac3b5f.js";import{D as jl}from"./constants.2fec5dff.js";const kk={class:"markdown-body"},Ik=ee("h1",null,"Components",-1),Ck=ee("p",null,[ja("Vue components under the "),ee("code",null,"components/"),ja(" directory are automatically registered and can be used in your templates without importing them.")],-1),Ak=ee("p",null,[ee("a",{href:"https://nuxt.com/docs/guide/directory-structure/components",target:"_blank",rel:"noopener"},"Learn more on the documentation")],-1),Rk=[Ik,Ck,Ak],Dk={__name:"components",setup(t,{expose:i}){return i({frontmatter:{}}),(r,n)=>(fe(),lt("div",kk,Rk))}},Mk=/\d/,Nk=["-","_","/","."];function Fk(t=""){if(!Mk.test(t))return t.toUpperCase()===t}function Bk(t,i){const e=i??Nk,r=[];if(!t||typeof t!="string")return r;let n="",a,o;for(const s of t){const u=e.includes(s);if(u===!0){r.push(n),n="",a=void 0;continue}const l=Fk(s);if(o===!1){if(a===!1&&l===!0){r.push(n),n=s,a=l;continue}if(a===!0&&l===!1&&n.length>1){const c=n[n.length-1];r.push(n.slice(0,Math.max(0,n.length-1))),n=c+s,a=l;continue}}n+=s,a=l,o=u}return r.push(n),r}function Lk(t){return t?t[0].toUpperCase()+t.slice(1):""}function w_(t){return t?(Array.isArray(t)?t:Bk(t)).map(i=>Lk(i)).join(""):""}const jk={"text-sm":"","font-mono":""},zk=ee("span",{mr1:"",op20:""},"<",-1),Hk=ee("span",{ml1:"",op20:""},"/>",-1),__=Gi({__name:"ComponentName",props:{component:{}},setup(t){const i=t,e=rn(()=>i.component.pascalName||w_(i.component.name||i.component.__name||i.component.kebabName||""));return(r,n)=>(fe(),lt("code",jk,[zk,ja(ok(Z(e)),1),Hk]))}}),Wk={flex:"~ col gap1","items-start":"","of-hidden":""},Vk={flex:"~ gap2"},E_=Gi({__name:"ComponentDetails",props:{component:{}},setup(t){const i=t,e=rn(()=>i.component.pascalName||w_(i.component.name||i.component.__name||i.component.kebabName||"")),r=rn(()=>i.component.filePath||i.component.file||i.component.__file||""),n=sk();return(a,o)=>{const s=__,u=g_,l=$_,c=b_;return fe(),lt("div",Wk,[ee("div",Vk,[Be(s,{component:a.component},null,8,["component"]),Be(u,{title:"Copy name","flex-none":"",icon:"carbon-copy",onClick:o[0]||(o[0]=h=>Z(n)(`<${Z(e)}></${Z(e)}>`))}),a.component.global?(fe(),$t(l,{key:0,"bg-green-400:10":"","text-green-400":"",title:"Registered at runtime as a global component",textContent:"runtime"})):Qt("",!0)]),ee("div",null,[Z(r)?(fe(),$t(c,{key:0,filepath:Z(r),"w-full":"","text-sm":"",op25:"","group-hover:op75":""},null,8,["filepath"])):Qt("",!0)]),Vu(a.$slots,"default")])}}});/**
2
2
  * vis-data
3
3
  * http://visjs.org/
4
4
  *
@@ -70,7 +70,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
70
70
  * Licensed under the MIT license */function tr(){return tr=Object.assign||function(t){for(var i=1;i<arguments.length;i++){var e=arguments[i];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},tr.apply(this,arguments)}function Gt(t,i){t.prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i}function Ns(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var hp;typeof Object.assign!="function"?hp=function(i){if(i==null)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(i),r=1;r<arguments.length;r++){var n=arguments[r];if(n!=null)for(var a in n)n.hasOwnProperty(a)&&(e[a]=n[a])}return e}:hp=Object.assign;var zn=hp,Vw=["","webkit","Moz","MS","ms","o"],Fle=typeof document>"u"?{style:{}}:document.createElement("div"),Ble="function",Ti=Math.round,Hn=Math.abs,uy=Date.now;function Fl(t,i){for(var e,r,n=i[0].toUpperCase()+i.slice(1),a=0;a<Vw.length;){if(e=Vw[a],r=e?e+n:i,r in t)return r;a++}}var Tr;typeof window>"u"?Tr={}:Tr=window;var Lx=Fl(Fle.style,"touchAction"),jx=Lx!==void 0;function Lle(){if(!jx)return!1;var t={},i=Tr.CSS&&Tr.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(e){return t[e]=i?Tr.CSS.supports("touch-action",e):!0}),t}var zx="compute",Hx="auto",dp="manipulation",Dn="none",eo="pan-x",to="pan-y",Fs=Lle(),jle=/mobile|tablet|ip(ad|hone|od)|android/i,Wx="ontouchstart"in Tr,zle=Fl(Tr,"PointerEvent")!==void 0,Hle=Wx&&jle.test(navigator.userAgent),rs="touch",Wle="pen",ly="mouse",Vle="kinect",Ule=25,vt=1,ri=2,ze=4,Tt=8,Nu=1,ns=2,is=4,as=8,zi=16,gr=ns|is,Mn=as|zi,Vx=gr|Mn,Ux=["x","y"],Fu=["clientX","clientY"];function xr(t,i,e){var r;if(t)if(t.forEach)t.forEach(i,e);else if(t.length!==void 0)for(r=0;r<t.length;)i.call(e,t[r],r,t),r++;else for(r in t)t.hasOwnProperty(r)&&i.call(e,t[r],r,t)}function Bl(t,i){return typeof t===Ble?t.apply(i&&i[0]||void 0,i):t}function Tn(t,i){return t.indexOf(i)>-1}function Gle(t){if(Tn(t,Dn))return Dn;var i=Tn(t,eo),e=Tn(t,to);return i&&e?Dn:i||e?i?eo:to:Tn(t,dp)?dp:Hx}var Gx=function(){function t(e,r){this.manager=e,this.set(r)}var i=t.prototype;return i.set=function(r){r===zx&&(r=this.compute()),jx&&this.manager.element.style&&Fs[r]&&(this.manager.element.style[Lx]=r),this.actions=r.toLowerCase().trim()},i.update=function(){this.set(this.manager.options.touchAction)},i.compute=function(){var r=[];return xr(this.manager.recognizers,function(n){Bl(n.options.enable,[n])&&(r=r.concat(n.getTouchAction()))}),Gle(r.join(" "))},i.preventDefaults=function(r){var n=r.srcEvent,a=r.offsetDirection;if(this.manager.session.prevented){n.preventDefault();return}var o=this.actions,s=Tn(o,Dn)&&!Fs[Dn],u=Tn(o,to)&&!Fs[to],l=Tn(o,eo)&&!Fs[eo];if(s){var c=r.pointers.length===1,h=r.distance<2,d=r.deltaTime<250;if(c&&h&&d)return}if(!(l&&u)&&(s||u&&a&gr||l&&a&Mn))return this.preventSrc(n)},i.preventSrc=function(r){this.manager.session.prevented=!0,r.preventDefault()},t}();function cy(t,i){for(;t;){if(t===i)return!0;t=t.parentNode}return!1}function Kx(t){var i=t.length;if(i===1)return{x:Ti(t[0].clientX),y:Ti(t[0].clientY)};for(var e=0,r=0,n=0;n<i;)e+=t[n].clientX,r+=t[n].clientY,n++;return{x:Ti(e/i),y:Ti(r/i)}}function Uw(t){for(var i=[],e=0;e<t.pointers.length;)i[e]={clientX:Ti(t.pointers[e].clientX),clientY:Ti(t.pointers[e].clientY)},e++;return{timeStamp:uy(),pointers:i,center:Kx(i),deltaX:t.deltaX,deltaY:t.deltaY}}function Bu(t,i,e){e||(e=Ux);var r=i[e[0]]-t[e[0]],n=i[e[1]]-t[e[1]];return Math.sqrt(r*r+n*n)}function fp(t,i,e){e||(e=Ux);var r=i[e[0]]-t[e[0]],n=i[e[1]]-t[e[1]];return Math.atan2(n,r)*180/Math.PI}function qx(t,i){return t===i?Nu:Hn(t)>=Hn(i)?t<0?ns:is:i<0?as:zi}function Kle(t,i){var e=i.center,r=t.offsetDelta||{},n=t.prevDelta||{},a=t.prevInput||{};(i.eventType===vt||a.eventType===ze)&&(n=t.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=t.offsetDelta={x:e.x,y:e.y}),i.deltaX=n.x+(e.x-r.x),i.deltaY=n.y+(e.y-r.y)}function Yx(t,i,e){return{x:i/t||0,y:e/t||0}}function qle(t,i){return Bu(i[0],i[1],Fu)/Bu(t[0],t[1],Fu)}function Yle(t,i){return fp(i[1],i[0],Fu)+fp(t[1],t[0],Fu)}function Xle(t,i){var e=t.lastInterval||i,r=i.timeStamp-e.timeStamp,n,a,o,s;if(i.eventType!==Tt&&(r>Ule||e.velocity===void 0)){var u=i.deltaX-e.deltaX,l=i.deltaY-e.deltaY,c=Yx(r,u,l);a=c.x,o=c.y,n=Hn(c.x)>Hn(c.y)?c.x:c.y,s=qx(u,l),t.lastInterval=i}else n=e.velocity,a=e.velocityX,o=e.velocityY,s=e.direction;i.velocity=n,i.velocityX=a,i.velocityY=o,i.direction=s}function Qle(t,i){var e=t.session,r=i.pointers,n=r.length;e.firstInput||(e.firstInput=Uw(i)),n>1&&!e.firstMultiple?e.firstMultiple=Uw(i):n===1&&(e.firstMultiple=!1);var a=e.firstInput,o=e.firstMultiple,s=o?o.center:a.center,u=i.center=Kx(r);i.timeStamp=uy(),i.deltaTime=i.timeStamp-a.timeStamp,i.angle=fp(s,u),i.distance=Bu(s,u),Kle(e,i),i.offsetDirection=qx(i.deltaX,i.deltaY);var l=Yx(i.deltaTime,i.deltaX,i.deltaY);i.overallVelocityX=l.x,i.overallVelocityY=l.y,i.overallVelocity=Hn(l.x)>Hn(l.y)?l.x:l.y,i.scale=o?qle(o.pointers,r):1,i.rotation=o?Yle(o.pointers,r):0,i.maxPointers=e.prevInput?i.pointers.length>e.prevInput.maxPointers?i.pointers.length:e.prevInput.maxPointers:i.pointers.length,Xle(e,i);var c=t.element,h=i.srcEvent,d;h.composedPath?d=h.composedPath()[0]:h.path?d=h.path[0]:d=h.target,cy(d,c)&&(c=d),i.target=c}function Zle(t,i,e){var r=e.pointers.length,n=e.changedPointers.length,a=i&vt&&r-n===0,o=i&(ze|Tt)&&r-n===0;e.isFirst=!!a,e.isFinal=!!o,a&&(t.session={}),e.eventType=i,Qle(t,e),t.emit("hammer.input",e),t.recognize(e),t.session.prevInput=e}function ro(t){return t.trim().split(/\s+/g)}function Ma(t,i,e){xr(ro(i),function(r){t.addEventListener(r,e,!1)})}function Na(t,i,e){xr(ro(i),function(r){t.removeEventListener(r,e,!1)})}function Gw(t){var i=t.ownerDocument||t;return i.defaultView||i.parentWindow||window}var va=function(){function t(e,r){var n=this;this.manager=e,this.callback=r,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(a){Bl(e.options.enable,[e])&&n.handler(a)},this.init()}var i=t.prototype;return i.handler=function(){},i.init=function(){this.evEl&&Ma(this.element,this.evEl,this.domHandler),this.evTarget&&Ma(this.target,this.evTarget,this.domHandler),this.evWin&&Ma(Gw(this.element),this.evWin,this.domHandler)},i.destroy=function(){this.evEl&&Na(this.element,this.evEl,this.domHandler),this.evTarget&&Na(this.target,this.evTarget,this.domHandler),this.evWin&&Na(Gw(this.element),this.evWin,this.domHandler)},t}();function Wn(t,i,e){if(t.indexOf&&!e)return t.indexOf(i);for(var r=0;r<t.length;){if(e&&t[r][e]==i||!e&&t[r]===i)return r;r++}return-1}var Jle={pointerdown:vt,pointermove:ri,pointerup:ze,pointercancel:Tt,pointerout:Tt},ece={2:rs,3:Wle,4:ly,5:Vle},Xx="pointerdown",Qx="pointermove pointerup pointercancel";Tr.MSPointerEvent&&!Tr.PointerEvent&&(Xx="MSPointerDown",Qx="MSPointerMove MSPointerUp MSPointerCancel");var Zx=function(t){Gt(i,t);function i(){var r,n=i.prototype;return n.evEl=Xx,n.evWin=Qx,r=t.apply(this,arguments)||this,r.store=r.manager.session.pointerEvents=[],r}var e=i.prototype;return e.handler=function(n){var a=this.store,o=!1,s=n.type.toLowerCase().replace("ms",""),u=Jle[s],l=ece[n.pointerType]||n.pointerType,c=l===rs,h=Wn(a,n.pointerId,"pointerId");u&vt&&(n.button===0||c)?h<0&&(a.push(n),h=a.length-1):u&(ze|Tt)&&(o=!0),!(h<0)&&(a[h]=n,this.callback(this.manager,u,{pointers:a,changedPointers:[n],pointerType:l,srcEvent:n}),o&&a.splice(h,1))},i}(va);function no(t){return Array.prototype.slice.call(t,0)}function hy(t,i,e){for(var r=[],n=[],a=0;a<t.length;){var o=i?t[a][i]:t[a];Wn(n,o)<0&&r.push(t[a]),n[a]=o,a++}return e&&(i?r=r.sort(function(s,u){return s[i]>u[i]}):r=r.sort()),r}var tce={touchstart:vt,touchmove:ri,touchend:ze,touchcancel:Tt},rce="touchstart touchmove touchend touchcancel",dy=function(t){Gt(i,t);function i(){var r;return i.prototype.evTarget=rce,r=t.apply(this,arguments)||this,r.targetIds={},r}var e=i.prototype;return e.handler=function(n){var a=tce[n.type],o=nce.call(this,n,a);o&&this.callback(this.manager,a,{pointers:o[0],changedPointers:o[1],pointerType:rs,srcEvent:n})},i}(va);function nce(t,i){var e=no(t.touches),r=this.targetIds;if(i&(vt|ri)&&e.length===1)return r[e[0].identifier]=!0,[e,e];var n,a,o=no(t.changedTouches),s=[],u=this.target;if(a=e.filter(function(l){return cy(l.target,u)}),i===vt)for(n=0;n<a.length;)r[a[n].identifier]=!0,n++;for(n=0;n<o.length;)r[o[n].identifier]&&s.push(o[n]),i&(ze|Tt)&&delete r[o[n].identifier],n++;if(s.length)return[hy(a.concat(s),"identifier",!0),s]}var ice={mousedown:vt,mousemove:ri,mouseup:ze},ace="mousedown",oce="mousemove mouseup",fy=function(t){Gt(i,t);function i(){var r,n=i.prototype;return n.evEl=ace,n.evWin=oce,r=t.apply(this,arguments)||this,r.pressed=!1,r}var e=i.prototype;return e.handler=function(n){var a=ice[n.type];a&vt&&n.button===0&&(this.pressed=!0),a&ri&&n.which!==1&&(a=ze),this.pressed&&(a&ze&&(this.pressed=!1),this.callback(this.manager,a,{pointers:[n],changedPointers:[n],pointerType:ly,srcEvent:n}))},i}(va),sce=2500,Kw=25;function qw(t){var i=t.changedPointers,e=i[0];if(e.identifier===this.primaryTouch){var r={x:e.clientX,y:e.clientY},n=this.lastTouches;this.lastTouches.push(r);var a=function(){var s=n.indexOf(r);s>-1&&n.splice(s,1)};setTimeout(a,sce)}}function uce(t,i){t&vt?(this.primaryTouch=i.changedPointers[0].identifier,qw.call(this,i)):t&(ze|Tt)&&qw.call(this,i)}function lce(t){for(var i=t.srcEvent.clientX,e=t.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var n=this.lastTouches[r],a=Math.abs(i-n.x),o=Math.abs(e-n.y);if(a<=Kw&&o<=Kw)return!0}return!1}var Jx=function(){var t=function(i){Gt(e,i);function e(n,a){var o;return o=i.call(this,n,a)||this,o.handler=function(s,u,l){var c=l.pointerType===rs,h=l.pointerType===ly;if(!(h&&l.sourceCapabilities&&l.sourceCapabilities.firesTouchEvents)){if(c)uce.call(Ns(Ns(o)),u,l);else if(h&&lce.call(Ns(Ns(o)),l))return;o.callback(s,u,l)}},o.touch=new dy(o.manager,o.handler),o.mouse=new fy(o.manager,o.handler),o.primaryTouch=null,o.lastTouches=[],o}var r=e.prototype;return r.destroy=function(){this.touch.destroy(),this.mouse.destroy()},e}(va);return t}();function cce(t){var i,e=t.options.inputClass;return e?i=e:zle?i=Zx:Hle?i=dy:Wx?i=Jx:i=fy,new i(t,Zle)}function xi(t,i,e){return Array.isArray(t)?(xr(t,e[i],e),!0):!1}var ru=1,Ht=2,Hi=4,en=8,Pr=en,io=16,hr=32,hce=1;function dce(){return hce++}function Bs(t,i){var e=i.manager;return e?e.get(t):t}function Yw(t){return t&io?"cancel":t&en?"end":t&Hi?"move":t&Ht?"start":""}var os=function(){function t(e){e===void 0&&(e={}),this.options=tr({enable:!0},e),this.id=dce(),this.manager=null,this.state=ru,this.simultaneous={},this.requireFail=[]}var i=t.prototype;return i.set=function(r){return zn(this.options,r),this.manager&&this.manager.touchAction.update(),this},i.recognizeWith=function(r){if(xi(r,"recognizeWith",this))return this;var n=this.simultaneous;return r=Bs(r,this),n[r.id]||(n[r.id]=r,r.recognizeWith(this)),this},i.dropRecognizeWith=function(r){return xi(r,"dropRecognizeWith",this)?this:(r=Bs(r,this),delete this.simultaneous[r.id],this)},i.requireFailure=function(r){if(xi(r,"requireFailure",this))return this;var n=this.requireFail;return r=Bs(r,this),Wn(n,r)===-1&&(n.push(r),r.requireFailure(this)),this},i.dropRequireFailure=function(r){if(xi(r,"dropRequireFailure",this))return this;r=Bs(r,this);var n=Wn(this.requireFail,r);return n>-1&&this.requireFail.splice(n,1),this},i.hasRequireFailures=function(){return this.requireFail.length>0},i.canRecognizeWith=function(r){return!!this.simultaneous[r.id]},i.emit=function(r){var n=this,a=this.state;function o(s){n.manager.emit(s,r)}a<en&&o(n.options.event+Yw(a)),o(n.options.event),r.additionalEvent&&o(r.additionalEvent),a>=en&&o(n.options.event+Yw(a))},i.tryEmit=function(r){if(this.canEmit())return this.emit(r);this.state=hr},i.canEmit=function(){for(var r=0;r<this.requireFail.length;){if(!(this.requireFail[r].state&(hr|ru)))return!1;r++}return!0},i.recognize=function(r){var n=zn({},r);if(!Bl(this.options.enable,[this,n])){this.reset(),this.state=hr;return}this.state&(Pr|io|hr)&&(this.state=ru),this.state=this.process(n),this.state&(Ht|Hi|en|io)&&this.tryEmit(n)},i.process=function(r){},i.getTouchAction=function(){},i.reset=function(){},t}(),vp=function(t){Gt(i,t);function i(r){var n;return r===void 0&&(r={}),n=t.call(this,tr({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},r))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var e=i.prototype;return e.getTouchAction=function(){return[dp]},e.process=function(n){var a=this,o=this.options,s=n.pointers.length===o.pointers,u=n.distance<o.threshold,l=n.deltaTime<o.time;if(this.reset(),n.eventType&vt&&this.count===0)return this.failTimeout();if(u&&l&&s){if(n.eventType!==ze)return this.failTimeout();var c=this.pTime?n.timeStamp-this.pTime<o.interval:!0,h=!this.pCenter||Bu(this.pCenter,n.center)<o.posThreshold;this.pTime=n.timeStamp,this.pCenter=n.center,!h||!c?this.count=1:this.count+=1,this._input=n;var d=this.count%o.taps;if(d===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){a.state=Pr,a.tryEmit()},o.interval),Ht):Pr}return hr},e.failTimeout=function(){var n=this;return this._timer=setTimeout(function(){n.state=hr},this.options.interval),hr},e.reset=function(){clearTimeout(this._timer)},e.emit=function(){this.state===Pr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},i}(os),Wi=function(t){Gt(i,t);function i(r){return r===void 0&&(r={}),t.call(this,tr({pointers:1},r))||this}var e=i.prototype;return e.attrTest=function(n){var a=this.options.pointers;return a===0||n.pointers.length===a},e.process=function(n){var a=this.state,o=n.eventType,s=a&(Ht|Hi),u=this.attrTest(n);return s&&(o&Tt||!u)?a|io:s||u?o&ze?a|en:a&Ht?a|Hi:Ht:hr},i}(os);function eP(t){return t===zi?"down":t===as?"up":t===ns?"left":t===is?"right":""}var vy=function(t){Gt(i,t);function i(r){var n;return r===void 0&&(r={}),n=t.call(this,tr({event:"pan",threshold:10,pointers:1,direction:Vx},r))||this,n.pX=null,n.pY=null,n}var e=i.prototype;return e.getTouchAction=function(){var n=this.options.direction,a=[];return n&gr&&a.push(to),n&Mn&&a.push(eo),a},e.directionTest=function(n){var a=this.options,o=!0,s=n.distance,u=n.direction,l=n.deltaX,c=n.deltaY;return u&a.direction||(a.direction&gr?(u=l===0?Nu:l<0?ns:is,o=l!==this.pX,s=Math.abs(n.deltaX)):(u=c===0?Nu:c<0?as:zi,o=c!==this.pY,s=Math.abs(n.deltaY))),n.direction=u,o&&s>a.threshold&&u&a.direction},e.attrTest=function(n){return Wi.prototype.attrTest.call(this,n)&&(this.state&Ht||!(this.state&Ht)&&this.directionTest(n))},e.emit=function(n){this.pX=n.deltaX,this.pY=n.deltaY;var a=eP(n.direction);a&&(n.additionalEvent=this.options.event+a),t.prototype.emit.call(this,n)},i}(Wi),tP=function(t){Gt(i,t);function i(r){return r===void 0&&(r={}),t.call(this,tr({event:"swipe",threshold:10,velocity:.3,direction:gr|Mn,pointers:1},r))||this}var e=i.prototype;return e.getTouchAction=function(){return vy.prototype.getTouchAction.call(this)},e.attrTest=function(n){var a=this.options.direction,o;return a&(gr|Mn)?o=n.overallVelocity:a&gr?o=n.overallVelocityX:a&Mn&&(o=n.overallVelocityY),t.prototype.attrTest.call(this,n)&&a&n.offsetDirection&&n.distance>this.options.threshold&&n.maxPointers===this.options.pointers&&Hn(o)>this.options.velocity&&n.eventType&ze},e.emit=function(n){var a=eP(n.offsetDirection);a&&this.manager.emit(this.options.event+a,n),this.manager.emit(this.options.event,n)},i}(Wi),rP=function(t){Gt(i,t);function i(r){return r===void 0&&(r={}),t.call(this,tr({event:"pinch",threshold:0,pointers:2},r))||this}var e=i.prototype;return e.getTouchAction=function(){return[Dn]},e.attrTest=function(n){return t.prototype.attrTest.call(this,n)&&(Math.abs(n.scale-1)>this.options.threshold||this.state&Ht)},e.emit=function(n){if(n.scale!==1){var a=n.scale<1?"in":"out";n.additionalEvent=this.options.event+a}t.prototype.emit.call(this,n)},i}(Wi),nP=function(t){Gt(i,t);function i(r){return r===void 0&&(r={}),t.call(this,tr({event:"rotate",threshold:0,pointers:2},r))||this}var e=i.prototype;return e.getTouchAction=function(){return[Dn]},e.attrTest=function(n){return t.prototype.attrTest.call(this,n)&&(Math.abs(n.rotation)>this.options.threshold||this.state&Ht)},i}(Wi),iP=function(t){Gt(i,t);function i(r){var n;return r===void 0&&(r={}),n=t.call(this,tr({event:"press",pointers:1,time:251,threshold:9},r))||this,n._timer=null,n._input=null,n}var e=i.prototype;return e.getTouchAction=function(){return[Hx]},e.process=function(n){var a=this,o=this.options,s=n.pointers.length===o.pointers,u=n.distance<o.threshold,l=n.deltaTime>o.time;if(this._input=n,!u||!s||n.eventType&(ze|Tt)&&!l)this.reset();else if(n.eventType&vt)this.reset(),this._timer=setTimeout(function(){a.state=Pr,a.tryEmit()},o.time);else if(n.eventType&ze)return Pr;return hr},e.reset=function(){clearTimeout(this._timer)},e.emit=function(n){this.state===Pr&&(n&&n.eventType&ze?this.manager.emit(this.options.event+"up",n):(this._input.timeStamp=uy(),this.manager.emit(this.options.event,this._input)))},i}(os),aP={domEvents:!1,touchAction:zx,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Xw=[[nP,{enable:!1}],[rP,{enable:!1},["rotate"]],[tP,{direction:gr}],[vy,{direction:gr},["swipe"]],[vp],[vp,{event:"doubletap",taps:2},["tap"]],[iP]],fce=1,Qw=2;function Zw(t,i){var e=t.element;if(e.style){var r;xr(t.options.cssProps,function(n,a){r=Fl(e.style,a),i?(t.oldCssProps[r]=e.style[r],e.style[r]=n):e.style[r]=t.oldCssProps[r]||""}),i||(t.oldCssProps={})}}function vce(t,i){var e=document.createEvent("Event");e.initEvent(t,!0,!0),e.gesture=i,i.target.dispatchEvent(e)}var Jw=function(){function t(e,r){var n=this;this.options=zn({},aP,r||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=cce(this),this.touchAction=new Gx(this,this.options.touchAction),Zw(this,!0),xr(this.options.recognizers,function(a){var o=n.add(new a[0](a[1]));a[2]&&o.recognizeWith(a[2]),a[3]&&o.requireFailure(a[3])},this)}var i=t.prototype;return i.set=function(r){return zn(this.options,r),r.touchAction&&this.touchAction.update(),r.inputTarget&&(this.input.destroy(),this.input.target=r.inputTarget,this.input.init()),this},i.stop=function(r){this.session.stopped=r?Qw:fce},i.recognize=function(r){var n=this.session;if(!n.stopped){this.touchAction.preventDefaults(r);var a,o=this.recognizers,s=n.curRecognizer;(!s||s&&s.state&Pr)&&(n.curRecognizer=null,s=null);for(var u=0;u<o.length;)a=o[u],n.stopped!==Qw&&(!s||a===s||a.canRecognizeWith(s))?a.recognize(r):a.reset(),!s&&a.state&(Ht|Hi|en)&&(n.curRecognizer=a,s=a),u++}},i.get=function(r){if(r instanceof os)return r;for(var n=this.recognizers,a=0;a<n.length;a++)if(n[a].options.event===r)return n[a];return null},i.add=function(r){if(xi(r,"add",this))return this;var n=this.get(r.options.event);return n&&this.remove(n),this.recognizers.push(r),r.manager=this,this.touchAction.update(),r},i.remove=function(r){if(xi(r,"remove",this))return this;var n=this.get(r);if(r){var a=this.recognizers,o=Wn(a,n);o!==-1&&(a.splice(o,1),this.touchAction.update())}return this},i.on=function(r,n){if(r===void 0||n===void 0)return this;var a=this.handlers;return xr(ro(r),function(o){a[o]=a[o]||[],a[o].push(n)}),this},i.off=function(r,n){if(r===void 0)return this;var a=this.handlers;return xr(ro(r),function(o){n?a[o]&&a[o].splice(Wn(a[o],n),1):delete a[o]}),this},i.emit=function(r,n){this.options.domEvents&&vce(r,n);var a=this.handlers[r]&&this.handlers[r].slice();if(!(!a||!a.length)){n.type=r,n.preventDefault=function(){n.srcEvent.preventDefault()};for(var o=0;o<a.length;)a[o](n),o++}},i.destroy=function(){this.element&&Zw(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},t}(),pce={touchstart:vt,touchmove:ri,touchend:ze,touchcancel:Tt},gce="touchstart",yce="touchstart touchmove touchend touchcancel",mce=function(t){Gt(i,t);function i(){var r,n=i.prototype;return n.evTarget=gce,n.evWin=yce,r=t.apply(this,arguments)||this,r.started=!1,r}var e=i.prototype;return e.handler=function(n){var a=pce[n.type];if(a===vt&&(this.started=!0),!!this.started){var o=$ce.call(this,n,a);a&(ze|Tt)&&o[0].length-o[1].length===0&&(this.started=!1),this.callback(this.manager,a,{pointers:o[0],changedPointers:o[1],pointerType:rs,srcEvent:n})}},i}(va);function $ce(t,i){var e=no(t.touches),r=no(t.changedTouches);return i&(ze|Tt)&&(e=hy(e.concat(r),"identifier",!0)),[e,r]}function oP(t,i,e){var r="DEPRECATED METHOD: "+i+`
71
71
  `+e+` AT
72
72
  `;return function(){var n=new Error("get-stack-trace"),a=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,r,a),t.apply(this,arguments)}}var sP=oP(function(t,i,e){for(var r=Object.keys(i),n=0;n<r.length;)(!e||e&&t[r[n]]===void 0)&&(t[r[n]]=i[r[n]]),n++;return t},"extend","Use `assign`."),bce=oP(function(t,i){return sP(t,i,!0)},"merge","Use `assign`.");function wce(t,i,e){var r=i.prototype,n;n=t.prototype=Object.create(r),n.constructor=t,n._super=r,e&&zn(n,e)}function e0(t,i){return function(){return t.apply(i,arguments)}}var uP=function(){var t=function(e,r){return r===void 0&&(r={}),new Jw(e,tr({recognizers:Xw.concat()},r))};return t.VERSION="2.0.17-rc",t.DIRECTION_ALL=Vx,t.DIRECTION_DOWN=zi,t.DIRECTION_LEFT=ns,t.DIRECTION_RIGHT=is,t.DIRECTION_UP=as,t.DIRECTION_HORIZONTAL=gr,t.DIRECTION_VERTICAL=Mn,t.DIRECTION_NONE=Nu,t.DIRECTION_DOWN=zi,t.INPUT_START=vt,t.INPUT_MOVE=ri,t.INPUT_END=ze,t.INPUT_CANCEL=Tt,t.STATE_POSSIBLE=ru,t.STATE_BEGAN=Ht,t.STATE_CHANGED=Hi,t.STATE_ENDED=en,t.STATE_RECOGNIZED=Pr,t.STATE_CANCELLED=io,t.STATE_FAILED=hr,t.Manager=Jw,t.Input=va,t.TouchAction=Gx,t.TouchInput=dy,t.MouseInput=fy,t.PointerEventInput=Zx,t.TouchMouseInput=Jx,t.SingleTouchInput=mce,t.Recognizer=os,t.AttrRecognizer=Wi,t.Tap=vp,t.Pan=vy,t.Swipe=tP,t.Pinch=rP,t.Rotate=nP,t.Press=iP,t.on=Ma,t.off=Na,t.each=xr,t.merge=bce,t.extend=sP,t.bindFn=e0,t.assign=zn,t.inherit=wce,t.bindFn=e0,t.prefixed=Fl,t.toArray=no,t.inArray=Wn,t.uniqueArray=hy,t.splitStr=ro,t.boolOrFn=Bl,t.hasParent=cy,t.addEventListeners=Ma,t.removeEventListeners=Na,t.defaults=zn({},aP,{preset:Xw}),t}();uP.defaults;var _ce=uP;function lP(t,i){var e=typeof pn<"u"&&Br(t)||t["@@iterator"];if(!e){if(ve(t)||(e=Ece(t))||i&&t&&typeof t.length=="number"){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
73
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Ece(t,i){var e;if(t){if(typeof t=="string")return t0(t,i);var r=st(e=Object.prototype.toString.call(t)).call(e,8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return ei(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t0(t,i)}}function t0(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,r=new Array(i);e<i;e++)r[e]=t[e];return r}pn("DELETE");function Ll(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];return Sce(i.length?i:[Mu()])}function Sce(t){var i=Oce(t),e=xe(i,3),r=e[0],n=e[1],a=e[2],o=1,s=function(){var l=2091639*r+o*23283064365386963e-26;return r=n,n=a,a=l-(o=l|0)};return s.uint32=function(){return s()*4294967296},s.fract53=function(){return s()+(s()*2097152|0)*11102230246251565e-32},s.algorithm="Alea",s.seed=t,s.version="0.9",s}function Oce(){for(var t=Tce(),i=t(" "),e=t(" "),r=t(" "),n=0;n<arguments.length;n++)i-=t(n<0||arguments.length<=n?void 0:arguments[n]),i<0&&(i+=1),e-=t(n<0||arguments.length<=n?void 0:arguments[n]),e<0&&(e+=1),r-=t(n<0||arguments.length<=n?void 0:arguments[n]),r<0&&(r+=1);return[i,e,r]}function Tce(){var t=4022871197;return function(i){for(var e=i.toString(),r=0;r<e.length;r++){t+=e.charCodeAt(r);var n=.02519603282416938*t;t=n>>>0,n-=t,n*=t,t=n>>>0,n-=t,t+=n*4294967296}return(t>>>0)*23283064365386963e-26}}function xce(){var t=function(){};return{on:t,off:t,destroy:t,emit:t,get:function(){return{set:t}}}}var py=typeof window<"u"?window.Hammer||_ce:function(){return xce()};function dr(t){var i=this,e;this._cleanupQueue=[],this.active=!1,this._dom={container:t,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(function(){i._dom.overlay.parentNode.removeChild(i._dom.overlay)});var r=py(this._dom.overlay);r.on("tap",A(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(function(){r.destroy()});var n=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];ge(n).call(n,function(a){r.on(a,function(o){o.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=function(a){Pce(a.target,t)||i.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(function(){document.body.removeEventListener("click",i._onClick)})),this._escListener=function(a){("key"in a?a.key==="Escape":a.keyCode===27)&&i.deactivate()}}lT(dr.prototype);dr.current=null;dr.prototype.destroy=function(){var t,i;this.deactivate();var e=lP(An(t=Or(i=this._cleanupQueue).call(i,0)).call(t)),r;try{for(e.s();!(r=e.n()).done;){var n=r.value;n()}}catch(a){e.e(a)}finally{e.f()}};dr.prototype.activate=function(){dr.current&&dr.current.deactivate(),dr.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)};dr.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")};dr.prototype._onTapOverlay=function(t){this.activate(),t.srcEvent.stopPropagation()};function Pce(t,i){for(;t;){if(t===i)return!0;t=t.parentNode}return!1}var kce=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Ice=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Cce=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,Ace=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function Ur(t){if(t)for(;t.hasChildNodes()===!0;){var i=t.firstChild;i&&(Ur(i),t.removeChild(i))}}function Kr(t){return t instanceof String||typeof t=="string"}function r0(t){return he(t)==="object"&&t!==null}function Vn(t,i,e,r){var n=!1;r===!0&&(n=i[e]===null&&t[e]!==void 0),n?delete t[e]:t[e]=i[e]}function cP(t,i){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(var r in t)if(i[r]!==void 0)if(i[r]===null||he(i[r])!=="object")Vn(t,i,r,e);else{var n=t[r],a=i[r];r0(n)&&r0(a)&&cP(n,a,e)}}function pa(t,i,e){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(ve(e))throw new TypeError("Arrays are not supported by deepExtend");for(var n=0;n<t.length;n++){var a=t[n];if(Object.prototype.hasOwnProperty.call(e,a))if(e[a]&&e[a].constructor===Object)i[a]===void 0&&(i[a]={}),i[a].constructor===Object?$e(i[a],e[a],!1,r):Vn(i,e,a,r);else{if(ve(e[a]))throw new TypeError("Arrays are not supported by deepExtend");Vn(i,e,a,r)}}return i}function Lu(t,i,e){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(ve(e))throw new TypeError("Arrays are not supported by deepExtend");for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&!vr(t).call(t,n))if(e[n]&&e[n].constructor===Object)i[n]===void 0&&(i[n]={}),i[n].constructor===Object?$e(i[n],e[n]):Vn(i,e,n,r);else if(ve(e[n])){i[n]=[];for(var a=0;a<e[n].length;a++)i[n].push(e[n][a])}else Vn(i,e,n,r);return i}function $e(t,i){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)||e===!0)if(he(i[n])==="object"&&i[n]!==null&&Iw(i[n])===Object.prototype)t[n]===void 0?t[n]=$e({},i[n],e):he(t[n])==="object"&&t[n]!==null&&Iw(t[n])===Object.prototype?$e(t[n],i[n],e):Vn(t,i,n,r);else if(ve(i[n])){var a;t[n]=st(a=i[n]).call(a)}else Vn(t,i,n,r);return t}function ju(t,i){var e;return oy(e=[]).call(e,lr(t),[i])}function Rce(t){return st(t).call(t)}function Dce(t){return t.getBoundingClientRect().left}function Mce(t){return t.getBoundingClientRect().top}function ee(t,i){if(ve(t))for(var e=t.length,r=0;r<e;r++)i(t[r],r,t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&i(t[n],n,t)}function Nce(t,i,e,r){if(t.addEventListener){var n;r===void 0&&(r=!1),i==="mousewheel"&&vr(n=navigator.userAgent).call(n,"Firefox")&&(i="DOMMouseScroll"),t.addEventListener(i,e,r)}else t.attachEvent("on"+i,e)}function Fce(t,i,e,r){if(t.removeEventListener){var n;r===void 0&&(r=!1),i==="mousewheel"&&vr(n=navigator.userAgent).call(n,"Firefox")&&(i="DOMMouseScroll"),t.removeEventListener(i,e,r)}else t.detachEvent("on"+i,e)}function gy(t){var i;switch(t.length){case 3:case 4:return i=Ice.exec(t),i?{r:Xt(i[1]+i[1],16),g:Xt(i[2]+i[2],16),b:Xt(i[3]+i[3],16)}:null;case 6:case 7:return i=kce.exec(t),i?{r:Xt(i[1],16),g:Xt(i[2],16),b:Xt(i[3],16)}:null;default:return null}}function jt(t,i){if(vr(t).call(t,"rgba"))return t;if(vr(t).call(t,"rgb")){var e=t.substr(ae(t).call(t,"(")+1).replace(")","").split(",");return"rgba("+e[0]+","+e[1]+","+e[2]+","+i+")"}else{var r=gy(t);return r==null?t:"rgba("+r.r+","+r.g+","+r.b+","+i+")"}}function hP(t,i,e){var r;return"#"+st(r=((1<<24)+(t<<16)+(i<<8)+e).toString(16)).call(r,1)}function pp(t,i){if(Kr(t)){var e=t;if(fP(e)){var r,n=ji(r=e.substr(4).substr(0,e.length-5).split(",")).call(r,function(d){return Xt(d)});e=hP(n[0],n[1],n[2])}if(dP(e)===!0){var a=Bce(e),o={h:a.h,s:a.s*.8,v:Math.min(1,a.v*1.02)},s={h:a.h,s:Math.min(1,a.s*1.25),v:a.v*.8},u=gp(s.h,s.s,s.v),l=gp(o.h,o.s,o.v);return{background:e,border:u,highlight:{background:l,border:u},hover:{background:l,border:u}}}else return{background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}else if(i){var c={background:t.background||i.background,border:t.border||i.border,highlight:Kr(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||i.highlight.background,border:t.highlight&&t.highlight.border||i.highlight.border},hover:Kr(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||i.hover.border,background:t.hover&&t.hover.background||i.hover.background}};return c}else{var h={background:t.background||void 0,border:t.border||void 0,highlight:Kr(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||void 0,border:t.highlight&&t.highlight.border||void 0},hover:Kr(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||void 0,background:t.hover&&t.hover.background||void 0}};return h}}function xa(t,i,e){t=t/255,i=i/255,e=e/255;var r=Math.min(t,Math.min(i,e)),n=Math.max(t,Math.max(i,e));if(r===n)return{h:0,s:0,v:r};var a=t===r?i-e:e===r?t-i:e-t,o=t===r?3:e===r?1:5,s=60*(o-a/(n-r))/360,u=(n-r)/n,l=n;return{h:s,s:u,v:l}}function nu(t,i,e){var r,n,a,o=Math.floor(t*6),s=t*6-o,u=e*(1-i),l=e*(1-s*i),c=e*(1-(1-s)*i);switch(o%6){case 0:r=e,n=c,a=u;break;case 1:r=l,n=e,a=u;break;case 2:r=u,n=e,a=c;break;case 3:r=u,n=l,a=e;break;case 4:r=c,n=u,a=e;break;case 5:r=e,n=u,a=l;break}return{r:Math.floor(r*255),g:Math.floor(n*255),b:Math.floor(a*255)}}function gp(t,i,e){var r=nu(t,i,e);return hP(r.r,r.g,r.b)}function Bce(t){var i=gy(t);if(!i)throw new TypeError("'".concat(t,"' is not a valid color."));return xa(i.r,i.g,i.b)}function dP(t){var i=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return i}function fP(t){return Cce.test(t)}function Lce(t){return Ace.test(t)}function tn(t){if(t===null||he(t)!=="object")return null;if(t instanceof Element)return t;var i=Rn(t);for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&he(t[e])=="object"&&(i[e]=tn(t[e]));return i}function Lt(t,i,e){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=function(v){return v!=null},a=function(v){return v!==null&&he(v)==="object"},o=function(v){for(var g in v)if(Object.prototype.hasOwnProperty.call(v,g))return!1;return!0};if(!a(t))throw new Error("Parameter mergeTarget must be an object");if(!a(i))throw new Error("Parameter options must be an object");if(!n(e))throw new Error("Parameter option must have a value");if(!a(r))throw new Error("Parameter globalOptions must be an object");var s=function(v,g,b){a(v[b])||(v[b]={});var p=g[b],$=v[b];for(var m in p)Object.prototype.hasOwnProperty.call(p,m)&&($[m]=p[m])},u=i[e],l=a(r)&&!o(r),c=l?r[e]:void 0,h=c?c.enabled:void 0;if(u!==void 0){if(typeof u=="boolean"){a(t[e])||(t[e]={}),t[e].enabled=u;return}if(u===null&&!a(t[e]))if(n(c))t[e]=Rn(c);else return;if(a(u)){var d=!0;u.enabled!==void 0?d=u.enabled:h!==void 0&&(d=c.enabled),s(t,i,e),t[e].enabled=d}}}var jce={linear:function(i){return i},easeInQuad:function(i){return i*i},easeOutQuad:function(i){return i*(2-i)},easeInOutQuad:function(i){return i<.5?2*i*i:-1+(4-2*i)*i},easeInCubic:function(i){return i*i*i},easeOutCubic:function(i){return--i*i*i+1},easeInOutCubic:function(i){return i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1},easeInQuart:function(i){return i*i*i*i},easeOutQuart:function(i){return 1- --i*i*i*i},easeInOutQuart:function(i){return i<.5?8*i*i*i*i:1-8*--i*i*i*i},easeInQuint:function(i){return i*i*i*i*i},easeOutQuint:function(i){return 1+--i*i*i*i*i},easeInOutQuint:function(i){return i<.5?16*i*i*i*i*i:1+16*--i*i*i*i*i}};function Gr(t,i){var e;ve(i)||(i=[i]);var r=lP(t),n;try{for(r.s();!(n=r.n()).done;){var a=n.value;if(a){e=a[i[0]];for(var o=1;o<i.length;o++)e&&(e=e[i[o]]);if(typeof e<"u")break}}}catch(s){r.e(s)}finally{r.f()}return e}var zce={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"},Hce=function(){function t(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;N(this,t),this.pixelRatio=i,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return F(t,[{key:"insertTo",value:function(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}},{key:"setCloseCallback",value:function(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}},{key:"_isColorString",value:function(e){if(typeof e=="string")return zce[e]}},{key:"setColor",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e!=="none"){var n,a=this._isColorString(e);if(a!==void 0&&(e=a),Kr(e)===!0){if(fP(e)===!0){var o=e.substr(4).substr(0,e.length-5).split(",");n={r:o[0],g:o[1],b:o[2],a:1}}else if(Lce(e)===!0){var s=e.substr(5).substr(0,e.length-6).split(",");n={r:s[0],g:s[1],b:s[2],a:s[3]}}else if(dP(e)===!0){var u=gy(e);n={r:u.r,g:u.g,b:u.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){var l=e.a!==void 0?e.a:"1.0";n={r:e.r,g:e.g,b:e.b,a:l}}if(n===void 0)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+es(e));this._setColor(n,r)}}},{key:"show",value:function(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;r===!0&&(this.previousColor=je({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",pr(function(){e.closeCallback!==void 0&&(e.closeCallback(),e.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(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;r===!0&&(this.initialColor=je({},e)),this.color=e;var n=xa(e.r,e.g,e.b),a=2*Math.PI,o=this.r*n.s,s=this.centerCoordinates.x+o*Math.sin(a*n.h),u=this.centerCoordinates.y+o*Math.cos(a*n.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=u-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}},{key:"_setOpacity",value:function(e){this.color.a=e/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(e){var r=xa(this.color.r,this.color.g,this.color.b);r.v=e/100;var n=nu(r.h,r.s,r.v);n.a=this.color.a,this.color=n,this._updatePicker()}},{key:"_updatePicker",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color,r=xa(e.r,e.g,e.b),n=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1)),n.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var a=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;n.clearRect(0,0,a,o),n.putImageData(this.hueCircle,0,0),n.fillStyle="rgba(0,0,0,"+(1-r.v)+")",n.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),ts(n).call(n),this.brightnessRange.value=100*r.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}},{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 e,r,n,a;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){var s=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var o=document.createElement("DIV");o.style.color="red",o.style.fontWeight="bold",o.style.padding="10px",o.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(o)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch{}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch{}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var u=this;this.opacityRange.onchange=function(){u._setOpacity(this.value)},this.opacityRange.oninput=function(){u._setOpacity(this.value)},this.brightnessRange.onchange=function(){u._setBrightness(this.value)},this.brightnessRange.oninput=function(){u._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=A(e=this._hide).call(e,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=A(r=this._apply).call(r,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=A(n=this._save).call(n,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=A(a=this._loadLast).call(a,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var e=this;this.drag={},this.pinch={},this.hammer=new py(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",function(r){r.isFirst&&e._moveSelector(r)}),this.hammer.on("tap",function(r){e._moveSelector(r)}),this.hammer.on("panstart",function(r){e._moveSelector(r)}),this.hammer.on("panmove",function(r){e._moveSelector(r)}),this.hammer.on("panend",function(r){e._moveSelector(r)})}},{key:"_generateHueCircle",value:function(){if(this.generated===!1){var e=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var r=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,r,n);var a,o,s,u;this.centerCoordinates={x:r*.5,y:n*.5},this.r=.49*r;var l=2*Math.PI/360,c=1/360,h=1/this.r,d;for(s=0;s<360;s++)for(u=0;u<this.r;u++)a=this.centerCoordinates.x+u*Math.sin(l*s),o=this.centerCoordinates.y+u*Math.cos(l*s),d=nu(s*c,u*h,1),e.fillStyle="rgb("+d.r+","+d.g+","+d.b+")",e.fillRect(a-.5,o-.5,2,2);e.strokeStyle="rgba(0,0,0,1)",e.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),e.stroke(),this.hueCircle=e.getImageData(0,0,r,n)}this.generated=!0}},{key:"_moveSelector",value:function(e){var r=this.colorPickerDiv.getBoundingClientRect(),n=e.center.x-r.left,a=e.center.y-r.top,o=.5*this.colorPickerDiv.clientHeight,s=.5*this.colorPickerDiv.clientWidth,u=n-s,l=a-o,c=Math.atan2(u,l),h=.98*Math.min(Math.sqrt(u*u+l*l),s),d=Math.cos(c)*h+o,f=Math.sin(c)*h+s;this.colorPickerSelector.style.top=d-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=f-.5*this.colorPickerSelector.clientWidth+"px";var v=c/(2*Math.PI);v=v<0?v+1:v;var g=h/this.r,b=xa(this.color.r,this.color.g,this.color.b);b.h=v,b.s=g;var p=nu(b.h,b.s,b.v);p.a=this.color.a,this.color=p,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}}]),t}();function yp(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];if(i.length<1)throw new TypeError("Invalid arguments.");if(i.length===1)return document.createTextNode(i[0]);var r=document.createElement(i[0]);return r.appendChild(yp.apply(void 0,lr(st(i).call(i,1)))),r}var Wce=function(){function t(i,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:function(){return!1};N(this,t),this.parent=i,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.hideOption=a,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},je(this.options,this.defaultOptions),this.configureOptions=r,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new Hce(n),this.wrapper=void 0}return F(t,[{key:"setOptions",value:function(e){if(e!==void 0){this.popupHistory={},this._removePopup();var r=!0;if(typeof e=="string")this.options.filter=e;else if(ve(e))this.options.filter=e.join();else if(he(e)==="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),St(e)!==void 0&&(this.options.filter=St(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(r=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,r=e):typeof e=="function"&&(this.options.filter=e,r=!0);St(this.options)===!1&&(r=!1),this.options.enabled=r}this._clean()}},{key:"setModuleOptions",value:function(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){this._clean(),this.changedOptions=[];var e=St(this.options),r=0,n=!1;for(var a in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,a)&&(this.allowCreation=!1,n=!1,typeof e=="function"?(n=e(a,[]),n=n||this._handleObject(this.configureOptions[a],[a],!0)):(e===!0||ae(e).call(e,a)!==-1)&&(n=!0),n!==!1&&(this.allowCreation=!0,r>0&&this._makeItem([]),this._makeHeader(a),this._handleObject(this.configureOptions[a],[a])),r++);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 e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}},{key:"_clean",value:function(){for(var e=0;e<this.domElements.length;e++)this.wrapper.removeChild(this.domElements[e]);this.wrapper!==void 0&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}},{key:"_getValue",value:function(e){for(var r=this.moduleOptions,n=0;n<e.length;n++)if(r[e[n]]!==void 0)r=r[e[n]];else{r=void 0;break}return r}},{key:"_makeItem",value:function(e){if(this.allowCreation===!0){var r=document.createElement("div");r.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var n=arguments.length,a=new Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=arguments[o];return ge(a).call(a,function(s){r.appendChild(s)}),this.domElements.push(r),this.domElements.length}return 0}},{key:"_makeHeader",value:function(e){var r=document.createElement("div");r.className="vis-configuration vis-config-header",r.innerText=e,this._makeItem([],r)}},{key:"_makeLabel",value:function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=document.createElement("div");if(a.className="vis-configuration vis-config-label vis-config-s"+r.length,n===!0){for(;a.firstChild;)a.removeChild(a.firstChild);a.appendChild(yp("i","b",e))}else a.innerText=e+":";return a}},{key:"_makeDropdown",value:function(e,r,n){var a=document.createElement("select");a.className="vis-configuration vis-config-select";var o=0;r!==void 0&&ae(e).call(e,r)!==-1&&(o=ae(e).call(e,r));for(var s=0;s<e.length;s++){var u=document.createElement("option");u.value=e[s],s===o&&(u.selected="selected"),u.innerText=e[s],a.appendChild(u)}var l=this;a.onchange=function(){l._update(this.value,n)};var c=this._makeLabel(n[n.length-1],n);this._makeItem(n,c,a)}},{key:"_makeRange",value:function(e,r,n){var a=e[0],o=e[1],s=e[2],u=e[3],l=document.createElement("input");l.className="vis-configuration vis-config-range";try{l.type="range",l.min=o,l.max=s}catch{}l.step=u;var c="",h=0;if(r!==void 0){var d=1.2;r<0&&r*d<o?(l.min=Math.ceil(r*d),h=l.min,c="range increased"):r/d<o&&(l.min=Math.ceil(r/d),h=l.min,c="range increased"),r*d>s&&s!==1&&(l.max=Math.ceil(r*d),h=l.max,c="range increased"),l.value=r}else l.value=a;var f=document.createElement("input");f.className="vis-configuration vis-config-rangeinput",f.value=l.value;var v=this;l.onchange=function(){f.value=this.value,v._update(Number(this.value),n)},l.oninput=function(){f.value=this.value};var g=this._makeLabel(n[n.length-1],n),b=this._makeItem(n,g,l,f);c!==""&&this.popupHistory[b]!==h&&(this.popupHistory[b]=h,this._setupPopup(c,b))}},{key:"_makeButton",value:function(){var e=this;if(this.options.showButton===!0){var r=document.createElement("div");r.className="vis-configuration vis-config-button",r.innerText="generate options",r.onclick=function(){e._printOptions()},r.onmouseover=function(){r.className="vis-configuration vis-config-button hover"},r.onmouseout=function(){r.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(r)}}},{key:"_setupPopup",value:function(e,r){var n=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){var a=document.createElement("div");a.id="vis-configuration-popup",a.className="vis-configuration-popup",a.innerText=e,a.onclick=function(){n._removePopup()},this.popupCounter+=1,this.popupDiv={html:a,index:r}}}},{key:"_removePopup",value:function(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}},{key:"_showPopupIfNeeded",value:function(){var e=this;if(this.popupDiv.html!==void 0){var r=this.domElements[this.popupDiv.index],n=r.getBoundingClientRect();this.popupDiv.html.style.left=n.left+"px",this.popupDiv.html.style.top=n.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=pr(function(){e.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=pr(function(){e._removePopup()},1800)}}},{key:"_makeCheckbox",value:function(e,r,n){var a=document.createElement("input");a.type="checkbox",a.className="vis-configuration vis-config-checkbox",a.checked=e,r!==void 0&&(a.checked=r,r!==e&&(he(e)==="object"?r!==e.enabled&&this.changedOptions.push({path:n,value:r}):this.changedOptions.push({path:n,value:r})));var o=this;a.onchange=function(){o._update(this.checked,n)};var s=this._makeLabel(n[n.length-1],n);this._makeItem(n,s,a)}},{key:"_makeTextInput",value:function(e,r,n){var a=document.createElement("input");a.type="text",a.className="vis-configuration vis-config-text",a.value=r,r!==e&&this.changedOptions.push({path:n,value:r});var o=this;a.onchange=function(){o._update(this.value,n)};var s=this._makeLabel(n[n.length-1],n);this._makeItem(n,s,a)}},{key:"_makeColorField",value:function(e,r,n){var a=this,o=e[1],s=document.createElement("div");r=r===void 0?o:r,r!=="none"?(s.className="vis-configuration vis-config-colorBlock",s.style.backgroundColor=r):s.className="vis-configuration vis-config-colorBlock none",r=r===void 0?o:r,s.onclick=function(){a._showColorPicker(r,s,n)};var u=this._makeLabel(n[n.length-1],n);this._makeItem(n,u,s)}},{key:"_showColorPicker",value:function(e,r,n){var a=this;r.onclick=function(){},this.colorPicker.insertTo(r),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(function(o){var s="rgba("+o.r+","+o.g+","+o.b+","+o.a+")";r.style.backgroundColor=s,a._update(s,n)}),this.colorPicker.setCloseCallback(function(){r.onclick=function(){a._showColorPicker(e,r,n)}})}},{key:"_handleObject",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=!1,o=St(this.options),s=!1;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){a=!0;var l=e[u],c=ju(r,u);if(typeof o=="function"&&(a=o(u,r),a===!1&&!ve(l)&&typeof l!="string"&&typeof l!="boolean"&&l instanceof Object&&(this.allowCreation=!1,a=this._handleObject(l,c,!0),this.allowCreation=n===!1)),a!==!1){s=!0;var h=this._getValue(c);if(ve(l))this._handleArray(l,h,c);else if(typeof l=="string")this._makeTextInput(l,h,c);else if(typeof l=="boolean")this._makeCheckbox(l,h,c);else if(l instanceof Object){if(!this.hideOption(r,u,this.moduleOptions))if(l.enabled!==void 0){var d=ju(c,"enabled"),f=this._getValue(d);if(f===!0){var v=this._makeLabel(u,c,!0);this._makeItem(c,v),s=this._handleObject(l,c)||s}else this._makeCheckbox(l,f,c)}else{var g=this._makeLabel(u,c,!0);this._makeItem(c,g),s=this._handleObject(l,c)||s}}else console.error("dont know how to handle",l,u,c)}}return s}},{key:"_handleArray",value:function(e,r,n){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,r,n),e[1]!==r&&this.changedOptions.push({path:n,value:r})):typeof e[0]=="string"?(this._makeDropdown(e,r,n),e[0]!==r&&this.changedOptions.push({path:n,value:r})):typeof e[0]=="number"&&(this._makeRange(e,r,n),e[0]!==r&&this.changedOptions.push({path:n,value:Number(r)}))}},{key:"_update",value:function(e,r){var n=this._constructOptions(e,r);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",n),this.initialized=!0,this.parent.setOptions(n)}},{key:"_constructOptions",value:function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=n;e=e==="true"?!0:e,e=e==="false"?!1:e;for(var o=0;o<r.length;o++)r[o]!=="global"&&(a[r[o]]===void 0&&(a[r[o]]={}),o!==r.length-1?a=a[r[o]]:a[r[o]]=e);return n}},{key:"_printOptions",value:function(){for(var e=this.getOptions();this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(yp("pre","const options = "+es(e,null,2)))}},{key:"getOptions",value:function(){for(var e={},r=0;r<this.changedOptions.length;r++)this._constructOptions(this.changedOptions[r].value,this.changedOptions[r].path,e);return e}}]),t}(),Vce=function(){function t(i,e){N(this,t),this.container=i,this.overflowMethod=e||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}return F(t,[{key:"setPosition",value:function(e,r){this.x=Xt(e),this.y=Xt(r)}},{key:"setText",value:function(e){if(e instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(e)}else this.frame.innerText=e}},{key:"show",value:function(e){if(e===void 0&&(e=!0),e===!0){var r=this.frame.clientHeight,n=this.frame.clientWidth,a=this.frame.parentNode.clientHeight,o=this.frame.parentNode.clientWidth,s=0,u=0;if(this.overflowMethod=="flip"){var l=!1,c=!0;this.y-r<this.padding&&(c=!1),this.x+n>o-this.padding&&(l=!0),l?s=this.x-n:s=this.x,c?u=this.y-r:u=this.y}else u=this.y-r,u+r+this.padding>a&&(u=a-r-this.padding),u<this.padding&&(u=this.padding),s=this.x,s+n+this.padding>o&&(s=o-n-this.padding),s<this.padding&&(s=this.padding);this.frame.style.left=s+"px",this.frame.style.top=u+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}},{key:"hide",value:function(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}},{key:"destroy",value:function(){this.frame.parentNode.removeChild(this.frame)}}]),t}(),ba=!1,n0,mp="background: #FFeeee; color: #dd0000",Uce=function(){function t(){N(this,t)}return F(t,null,[{key:"validate",value:function(e,r,n){ba=!1,n0=r;var a=r;return n!==void 0&&(a=r[n]),t.parse(e,a,[]),ba}},{key:"parse",value:function(e,r,n){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.check(a,e,r,n)}},{key:"check",value:function(e,r,n,a){if(n[e]===void 0&&n.__any__===void 0){t.getSuggestion(e,n,a);return}var o=e,s=!0;n[e]===void 0&&n.__any__!==void 0&&(o="__any__",s=t.getType(r[e])==="object");var u=n[o];s&&u.__type__!==void 0&&(u=u.__type__),t.checkFields(e,r,n,o,u,a)}},{key:"checkFields",value:function(e,r,n,a,o,s){var u=function(d){console.error("%c"+d+t.printLocation(s,e),mp)},l=t.getType(r[e]),c=o[l];c!==void 0?t.getType(c)==="array"&&ae(c).call(c,r[e])===-1?(u('Invalid option detected in "'+e+'". Allowed values are:'+t.print(c)+' not "'+r[e]+'". '),ba=!0):l==="object"&&a!=="__any__"&&(s=ju(s,e),t.parse(r[e],n[a],s)):o.any===void 0&&(u('Invalid type received for "'+e+'". Expected: '+t.print(Te(o))+". Received ["+l+'] "'+r[e]+'"'),ba=!0)}},{key:"getType",value:function(e){var r=he(e);return r==="object"?e===null?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":ve(e)?"array":e instanceof Date?"date":e.nodeType!==void 0?"dom":e._isAMomentObject===!0?"moment":"object":r==="number"?"number":r==="boolean"?"boolean":r==="string"?"string":r===void 0?"undefined":r}},{key:"getSuggestion",value:function(e,r,n){var a=t.findInOptions(e,r,n,!1),o=t.findInOptions(e,n0,[],!0),s=8,u=4,l;a.indexMatch!==void 0?l=" in "+t.printLocation(a.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+a.indexMatch+`"?
73
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Ece(t,i){var e;if(t){if(typeof t=="string")return t0(t,i);var r=st(e=Object.prototype.toString.call(t)).call(e,8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return ei(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t0(t,i)}}function t0(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,r=new Array(i);e<i;e++)r[e]=t[e];return r}pn("DELETE");function Ll(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];return Sce(i.length?i:[Mu()])}function Sce(t){var i=Oce(t),e=xe(i,3),r=e[0],n=e[1],a=e[2],o=1,s=function(){var l=2091639*r+o*23283064365386963e-26;return r=n,n=a,a=l-(o=l|0)};return s.uint32=function(){return s()*4294967296},s.fract53=function(){return s()+(s()*2097152|0)*11102230246251565e-32},s.algorithm="Alea",s.seed=t,s.version="0.9",s}function Oce(){for(var t=Tce(),i=t(" "),e=t(" "),r=t(" "),n=0;n<arguments.length;n++)i-=t(n<0||arguments.length<=n?void 0:arguments[n]),i<0&&(i+=1),e-=t(n<0||arguments.length<=n?void 0:arguments[n]),e<0&&(e+=1),r-=t(n<0||arguments.length<=n?void 0:arguments[n]),r<0&&(r+=1);return[i,e,r]}function Tce(){var t=4022871197;return function(i){for(var e=i.toString(),r=0;r<e.length;r++){t+=e.charCodeAt(r);var n=.02519603282416938*t;t=n>>>0,n-=t,n*=t,t=n>>>0,n-=t,t+=n*4294967296}return(t>>>0)*23283064365386963e-26}}function xce(){var t=function(){};return{on:t,off:t,destroy:t,emit:t,get:function(){return{set:t}}}}var py=typeof window<"u"?window.Hammer||_ce:function(){return xce()};function dr(t){var i=this,e;this._cleanupQueue=[],this.active=!1,this._dom={container:t,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(function(){i._dom.overlay.parentNode.removeChild(i._dom.overlay)});var r=py(this._dom.overlay);r.on("tap",A(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(function(){r.destroy()});var n=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];ge(n).call(n,function(a){r.on(a,function(o){o.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=function(a){Pce(a.target,t)||i.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(function(){document.body.removeEventListener("click",i._onClick)})),this._escListener=function(a){("key"in a?a.key==="Escape":a.keyCode===27)&&i.deactivate()}}lT(dr.prototype);dr.current=null;dr.prototype.destroy=function(){var t,i;this.deactivate();var e=lP(An(t=Or(i=this._cleanupQueue).call(i,0)).call(t)),r;try{for(e.s();!(r=e.n()).done;){var n=r.value;n()}}catch(a){e.e(a)}finally{e.f()}};dr.prototype.activate=function(){dr.current&&dr.current.deactivate(),dr.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)};dr.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")};dr.prototype._onTapOverlay=function(t){this.activate(),t.srcEvent.stopPropagation()};function Pce(t,i){for(;t;){if(t===i)return!0;t=t.parentNode}return!1}var kce=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Ice=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Cce=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,Ace=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function Ur(t){if(t)for(;t.hasChildNodes()===!0;){var i=t.firstChild;i&&(Ur(i),t.removeChild(i))}}function Kr(t){return t instanceof String||typeof t=="string"}function r0(t){return he(t)==="object"&&t!==null}function Vn(t,i,e,r){var n=!1;r===!0&&(n=i[e]===null&&t[e]!==void 0),n?delete t[e]:t[e]=i[e]}function cP(t,i){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(var r in t)if(i[r]!==void 0)if(i[r]===null||he(i[r])!=="object")Vn(t,i,r,e);else{var n=t[r],a=i[r];r0(n)&&r0(a)&&cP(n,a,e)}}function pa(t,i,e){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(ve(e))throw new TypeError("Arrays are not supported by deepExtend");for(var n=0;n<t.length;n++){var a=t[n];if(Object.prototype.hasOwnProperty.call(e,a))if(e[a]&&e[a].constructor===Object)i[a]===void 0&&(i[a]={}),i[a].constructor===Object?$e(i[a],e[a],!1,r):Vn(i,e,a,r);else{if(ve(e[a]))throw new TypeError("Arrays are not supported by deepExtend");Vn(i,e,a,r)}}return i}function Lu(t,i,e){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(ve(e))throw new TypeError("Arrays are not supported by deepExtend");for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&!vr(t).call(t,n))if(e[n]&&e[n].constructor===Object)i[n]===void 0&&(i[n]={}),i[n].constructor===Object?$e(i[n],e[n]):Vn(i,e,n,r);else if(ve(e[n])){i[n]=[];for(var a=0;a<e[n].length;a++)i[n].push(e[n][a])}else Vn(i,e,n,r);return i}function $e(t,i){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)||e===!0)if(he(i[n])==="object"&&i[n]!==null&&Iw(i[n])===Object.prototype)t[n]===void 0?t[n]=$e({},i[n],e):he(t[n])==="object"&&t[n]!==null&&Iw(t[n])===Object.prototype?$e(t[n],i[n],e):Vn(t,i,n,r);else if(ve(i[n])){var a;t[n]=st(a=i[n]).call(a)}else Vn(t,i,n,r);return t}function ju(t,i){var e;return oy(e=[]).call(e,lr(t),[i])}function Rce(t){return st(t).call(t)}function Dce(t){return t.getBoundingClientRect().left}function Mce(t){return t.getBoundingClientRect().top}function te(t,i){if(ve(t))for(var e=t.length,r=0;r<e;r++)i(t[r],r,t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&i(t[n],n,t)}function Nce(t,i,e,r){if(t.addEventListener){var n;r===void 0&&(r=!1),i==="mousewheel"&&vr(n=navigator.userAgent).call(n,"Firefox")&&(i="DOMMouseScroll"),t.addEventListener(i,e,r)}else t.attachEvent("on"+i,e)}function Fce(t,i,e,r){if(t.removeEventListener){var n;r===void 0&&(r=!1),i==="mousewheel"&&vr(n=navigator.userAgent).call(n,"Firefox")&&(i="DOMMouseScroll"),t.removeEventListener(i,e,r)}else t.detachEvent("on"+i,e)}function gy(t){var i;switch(t.length){case 3:case 4:return i=Ice.exec(t),i?{r:Xt(i[1]+i[1],16),g:Xt(i[2]+i[2],16),b:Xt(i[3]+i[3],16)}:null;case 6:case 7:return i=kce.exec(t),i?{r:Xt(i[1],16),g:Xt(i[2],16),b:Xt(i[3],16)}:null;default:return null}}function jt(t,i){if(vr(t).call(t,"rgba"))return t;if(vr(t).call(t,"rgb")){var e=t.substr(ae(t).call(t,"(")+1).replace(")","").split(",");return"rgba("+e[0]+","+e[1]+","+e[2]+","+i+")"}else{var r=gy(t);return r==null?t:"rgba("+r.r+","+r.g+","+r.b+","+i+")"}}function hP(t,i,e){var r;return"#"+st(r=((1<<24)+(t<<16)+(i<<8)+e).toString(16)).call(r,1)}function pp(t,i){if(Kr(t)){var e=t;if(fP(e)){var r,n=ji(r=e.substr(4).substr(0,e.length-5).split(",")).call(r,function(d){return Xt(d)});e=hP(n[0],n[1],n[2])}if(dP(e)===!0){var a=Bce(e),o={h:a.h,s:a.s*.8,v:Math.min(1,a.v*1.02)},s={h:a.h,s:Math.min(1,a.s*1.25),v:a.v*.8},u=gp(s.h,s.s,s.v),l=gp(o.h,o.s,o.v);return{background:e,border:u,highlight:{background:l,border:u},hover:{background:l,border:u}}}else return{background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}else if(i){var c={background:t.background||i.background,border:t.border||i.border,highlight:Kr(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||i.highlight.background,border:t.highlight&&t.highlight.border||i.highlight.border},hover:Kr(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||i.hover.border,background:t.hover&&t.hover.background||i.hover.background}};return c}else{var h={background:t.background||void 0,border:t.border||void 0,highlight:Kr(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||void 0,border:t.highlight&&t.highlight.border||void 0},hover:Kr(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||void 0,background:t.hover&&t.hover.background||void 0}};return h}}function xa(t,i,e){t=t/255,i=i/255,e=e/255;var r=Math.min(t,Math.min(i,e)),n=Math.max(t,Math.max(i,e));if(r===n)return{h:0,s:0,v:r};var a=t===r?i-e:e===r?t-i:e-t,o=t===r?3:e===r?1:5,s=60*(o-a/(n-r))/360,u=(n-r)/n,l=n;return{h:s,s:u,v:l}}function nu(t,i,e){var r,n,a,o=Math.floor(t*6),s=t*6-o,u=e*(1-i),l=e*(1-s*i),c=e*(1-(1-s)*i);switch(o%6){case 0:r=e,n=c,a=u;break;case 1:r=l,n=e,a=u;break;case 2:r=u,n=e,a=c;break;case 3:r=u,n=l,a=e;break;case 4:r=c,n=u,a=e;break;case 5:r=e,n=u,a=l;break}return{r:Math.floor(r*255),g:Math.floor(n*255),b:Math.floor(a*255)}}function gp(t,i,e){var r=nu(t,i,e);return hP(r.r,r.g,r.b)}function Bce(t){var i=gy(t);if(!i)throw new TypeError("'".concat(t,"' is not a valid color."));return xa(i.r,i.g,i.b)}function dP(t){var i=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return i}function fP(t){return Cce.test(t)}function Lce(t){return Ace.test(t)}function tn(t){if(t===null||he(t)!=="object")return null;if(t instanceof Element)return t;var i=Rn(t);for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&he(t[e])=="object"&&(i[e]=tn(t[e]));return i}function Lt(t,i,e){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=function(v){return v!=null},a=function(v){return v!==null&&he(v)==="object"},o=function(v){for(var g in v)if(Object.prototype.hasOwnProperty.call(v,g))return!1;return!0};if(!a(t))throw new Error("Parameter mergeTarget must be an object");if(!a(i))throw new Error("Parameter options must be an object");if(!n(e))throw new Error("Parameter option must have a value");if(!a(r))throw new Error("Parameter globalOptions must be an object");var s=function(v,g,b){a(v[b])||(v[b]={});var p=g[b],$=v[b];for(var m in p)Object.prototype.hasOwnProperty.call(p,m)&&($[m]=p[m])},u=i[e],l=a(r)&&!o(r),c=l?r[e]:void 0,h=c?c.enabled:void 0;if(u!==void 0){if(typeof u=="boolean"){a(t[e])||(t[e]={}),t[e].enabled=u;return}if(u===null&&!a(t[e]))if(n(c))t[e]=Rn(c);else return;if(a(u)){var d=!0;u.enabled!==void 0?d=u.enabled:h!==void 0&&(d=c.enabled),s(t,i,e),t[e].enabled=d}}}var jce={linear:function(i){return i},easeInQuad:function(i){return i*i},easeOutQuad:function(i){return i*(2-i)},easeInOutQuad:function(i){return i<.5?2*i*i:-1+(4-2*i)*i},easeInCubic:function(i){return i*i*i},easeOutCubic:function(i){return--i*i*i+1},easeInOutCubic:function(i){return i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1},easeInQuart:function(i){return i*i*i*i},easeOutQuart:function(i){return 1- --i*i*i*i},easeInOutQuart:function(i){return i<.5?8*i*i*i*i:1-8*--i*i*i*i},easeInQuint:function(i){return i*i*i*i*i},easeOutQuint:function(i){return 1+--i*i*i*i*i},easeInOutQuint:function(i){return i<.5?16*i*i*i*i*i:1+16*--i*i*i*i*i}};function Gr(t,i){var e;ve(i)||(i=[i]);var r=lP(t),n;try{for(r.s();!(n=r.n()).done;){var a=n.value;if(a){e=a[i[0]];for(var o=1;o<i.length;o++)e&&(e=e[i[o]]);if(typeof e<"u")break}}}catch(s){r.e(s)}finally{r.f()}return e}var zce={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"},Hce=function(){function t(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;N(this,t),this.pixelRatio=i,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return F(t,[{key:"insertTo",value:function(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}},{key:"setCloseCallback",value:function(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}},{key:"_isColorString",value:function(e){if(typeof e=="string")return zce[e]}},{key:"setColor",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e!=="none"){var n,a=this._isColorString(e);if(a!==void 0&&(e=a),Kr(e)===!0){if(fP(e)===!0){var o=e.substr(4).substr(0,e.length-5).split(",");n={r:o[0],g:o[1],b:o[2],a:1}}else if(Lce(e)===!0){var s=e.substr(5).substr(0,e.length-6).split(",");n={r:s[0],g:s[1],b:s[2],a:s[3]}}else if(dP(e)===!0){var u=gy(e);n={r:u.r,g:u.g,b:u.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){var l=e.a!==void 0?e.a:"1.0";n={r:e.r,g:e.g,b:e.b,a:l}}if(n===void 0)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+es(e));this._setColor(n,r)}}},{key:"show",value:function(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;r===!0&&(this.previousColor=je({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",pr(function(){e.closeCallback!==void 0&&(e.closeCallback(),e.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(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;r===!0&&(this.initialColor=je({},e)),this.color=e;var n=xa(e.r,e.g,e.b),a=2*Math.PI,o=this.r*n.s,s=this.centerCoordinates.x+o*Math.sin(a*n.h),u=this.centerCoordinates.y+o*Math.cos(a*n.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=u-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}},{key:"_setOpacity",value:function(e){this.color.a=e/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(e){var r=xa(this.color.r,this.color.g,this.color.b);r.v=e/100;var n=nu(r.h,r.s,r.v);n.a=this.color.a,this.color=n,this._updatePicker()}},{key:"_updatePicker",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color,r=xa(e.r,e.g,e.b),n=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1)),n.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var a=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;n.clearRect(0,0,a,o),n.putImageData(this.hueCircle,0,0),n.fillStyle="rgba(0,0,0,"+(1-r.v)+")",n.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),ts(n).call(n),this.brightnessRange.value=100*r.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}},{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 e,r,n,a;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){var s=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var o=document.createElement("DIV");o.style.color="red",o.style.fontWeight="bold",o.style.padding="10px",o.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(o)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch{}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch{}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var u=this;this.opacityRange.onchange=function(){u._setOpacity(this.value)},this.opacityRange.oninput=function(){u._setOpacity(this.value)},this.brightnessRange.onchange=function(){u._setBrightness(this.value)},this.brightnessRange.oninput=function(){u._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=A(e=this._hide).call(e,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=A(r=this._apply).call(r,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=A(n=this._save).call(n,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=A(a=this._loadLast).call(a,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var e=this;this.drag={},this.pinch={},this.hammer=new py(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",function(r){r.isFirst&&e._moveSelector(r)}),this.hammer.on("tap",function(r){e._moveSelector(r)}),this.hammer.on("panstart",function(r){e._moveSelector(r)}),this.hammer.on("panmove",function(r){e._moveSelector(r)}),this.hammer.on("panend",function(r){e._moveSelector(r)})}},{key:"_generateHueCircle",value:function(){if(this.generated===!1){var e=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var r=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,r,n);var a,o,s,u;this.centerCoordinates={x:r*.5,y:n*.5},this.r=.49*r;var l=2*Math.PI/360,c=1/360,h=1/this.r,d;for(s=0;s<360;s++)for(u=0;u<this.r;u++)a=this.centerCoordinates.x+u*Math.sin(l*s),o=this.centerCoordinates.y+u*Math.cos(l*s),d=nu(s*c,u*h,1),e.fillStyle="rgb("+d.r+","+d.g+","+d.b+")",e.fillRect(a-.5,o-.5,2,2);e.strokeStyle="rgba(0,0,0,1)",e.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),e.stroke(),this.hueCircle=e.getImageData(0,0,r,n)}this.generated=!0}},{key:"_moveSelector",value:function(e){var r=this.colorPickerDiv.getBoundingClientRect(),n=e.center.x-r.left,a=e.center.y-r.top,o=.5*this.colorPickerDiv.clientHeight,s=.5*this.colorPickerDiv.clientWidth,u=n-s,l=a-o,c=Math.atan2(u,l),h=.98*Math.min(Math.sqrt(u*u+l*l),s),d=Math.cos(c)*h+o,f=Math.sin(c)*h+s;this.colorPickerSelector.style.top=d-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=f-.5*this.colorPickerSelector.clientWidth+"px";var v=c/(2*Math.PI);v=v<0?v+1:v;var g=h/this.r,b=xa(this.color.r,this.color.g,this.color.b);b.h=v,b.s=g;var p=nu(b.h,b.s,b.v);p.a=this.color.a,this.color=p,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}}]),t}();function yp(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];if(i.length<1)throw new TypeError("Invalid arguments.");if(i.length===1)return document.createTextNode(i[0]);var r=document.createElement(i[0]);return r.appendChild(yp.apply(void 0,lr(st(i).call(i,1)))),r}var Wce=function(){function t(i,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:function(){return!1};N(this,t),this.parent=i,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.hideOption=a,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},je(this.options,this.defaultOptions),this.configureOptions=r,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new Hce(n),this.wrapper=void 0}return F(t,[{key:"setOptions",value:function(e){if(e!==void 0){this.popupHistory={},this._removePopup();var r=!0;if(typeof e=="string")this.options.filter=e;else if(ve(e))this.options.filter=e.join();else if(he(e)==="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),St(e)!==void 0&&(this.options.filter=St(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(r=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,r=e):typeof e=="function"&&(this.options.filter=e,r=!0);St(this.options)===!1&&(r=!1),this.options.enabled=r}this._clean()}},{key:"setModuleOptions",value:function(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){this._clean(),this.changedOptions=[];var e=St(this.options),r=0,n=!1;for(var a in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,a)&&(this.allowCreation=!1,n=!1,typeof e=="function"?(n=e(a,[]),n=n||this._handleObject(this.configureOptions[a],[a],!0)):(e===!0||ae(e).call(e,a)!==-1)&&(n=!0),n!==!1&&(this.allowCreation=!0,r>0&&this._makeItem([]),this._makeHeader(a),this._handleObject(this.configureOptions[a],[a])),r++);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 e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}},{key:"_clean",value:function(){for(var e=0;e<this.domElements.length;e++)this.wrapper.removeChild(this.domElements[e]);this.wrapper!==void 0&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}},{key:"_getValue",value:function(e){for(var r=this.moduleOptions,n=0;n<e.length;n++)if(r[e[n]]!==void 0)r=r[e[n]];else{r=void 0;break}return r}},{key:"_makeItem",value:function(e){if(this.allowCreation===!0){var r=document.createElement("div");r.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var n=arguments.length,a=new Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=arguments[o];return ge(a).call(a,function(s){r.appendChild(s)}),this.domElements.push(r),this.domElements.length}return 0}},{key:"_makeHeader",value:function(e){var r=document.createElement("div");r.className="vis-configuration vis-config-header",r.innerText=e,this._makeItem([],r)}},{key:"_makeLabel",value:function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=document.createElement("div");if(a.className="vis-configuration vis-config-label vis-config-s"+r.length,n===!0){for(;a.firstChild;)a.removeChild(a.firstChild);a.appendChild(yp("i","b",e))}else a.innerText=e+":";return a}},{key:"_makeDropdown",value:function(e,r,n){var a=document.createElement("select");a.className="vis-configuration vis-config-select";var o=0;r!==void 0&&ae(e).call(e,r)!==-1&&(o=ae(e).call(e,r));for(var s=0;s<e.length;s++){var u=document.createElement("option");u.value=e[s],s===o&&(u.selected="selected"),u.innerText=e[s],a.appendChild(u)}var l=this;a.onchange=function(){l._update(this.value,n)};var c=this._makeLabel(n[n.length-1],n);this._makeItem(n,c,a)}},{key:"_makeRange",value:function(e,r,n){var a=e[0],o=e[1],s=e[2],u=e[3],l=document.createElement("input");l.className="vis-configuration vis-config-range";try{l.type="range",l.min=o,l.max=s}catch{}l.step=u;var c="",h=0;if(r!==void 0){var d=1.2;r<0&&r*d<o?(l.min=Math.ceil(r*d),h=l.min,c="range increased"):r/d<o&&(l.min=Math.ceil(r/d),h=l.min,c="range increased"),r*d>s&&s!==1&&(l.max=Math.ceil(r*d),h=l.max,c="range increased"),l.value=r}else l.value=a;var f=document.createElement("input");f.className="vis-configuration vis-config-rangeinput",f.value=l.value;var v=this;l.onchange=function(){f.value=this.value,v._update(Number(this.value),n)},l.oninput=function(){f.value=this.value};var g=this._makeLabel(n[n.length-1],n),b=this._makeItem(n,g,l,f);c!==""&&this.popupHistory[b]!==h&&(this.popupHistory[b]=h,this._setupPopup(c,b))}},{key:"_makeButton",value:function(){var e=this;if(this.options.showButton===!0){var r=document.createElement("div");r.className="vis-configuration vis-config-button",r.innerText="generate options",r.onclick=function(){e._printOptions()},r.onmouseover=function(){r.className="vis-configuration vis-config-button hover"},r.onmouseout=function(){r.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(r)}}},{key:"_setupPopup",value:function(e,r){var n=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){var a=document.createElement("div");a.id="vis-configuration-popup",a.className="vis-configuration-popup",a.innerText=e,a.onclick=function(){n._removePopup()},this.popupCounter+=1,this.popupDiv={html:a,index:r}}}},{key:"_removePopup",value:function(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}},{key:"_showPopupIfNeeded",value:function(){var e=this;if(this.popupDiv.html!==void 0){var r=this.domElements[this.popupDiv.index],n=r.getBoundingClientRect();this.popupDiv.html.style.left=n.left+"px",this.popupDiv.html.style.top=n.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=pr(function(){e.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=pr(function(){e._removePopup()},1800)}}},{key:"_makeCheckbox",value:function(e,r,n){var a=document.createElement("input");a.type="checkbox",a.className="vis-configuration vis-config-checkbox",a.checked=e,r!==void 0&&(a.checked=r,r!==e&&(he(e)==="object"?r!==e.enabled&&this.changedOptions.push({path:n,value:r}):this.changedOptions.push({path:n,value:r})));var o=this;a.onchange=function(){o._update(this.checked,n)};var s=this._makeLabel(n[n.length-1],n);this._makeItem(n,s,a)}},{key:"_makeTextInput",value:function(e,r,n){var a=document.createElement("input");a.type="text",a.className="vis-configuration vis-config-text",a.value=r,r!==e&&this.changedOptions.push({path:n,value:r});var o=this;a.onchange=function(){o._update(this.value,n)};var s=this._makeLabel(n[n.length-1],n);this._makeItem(n,s,a)}},{key:"_makeColorField",value:function(e,r,n){var a=this,o=e[1],s=document.createElement("div");r=r===void 0?o:r,r!=="none"?(s.className="vis-configuration vis-config-colorBlock",s.style.backgroundColor=r):s.className="vis-configuration vis-config-colorBlock none",r=r===void 0?o:r,s.onclick=function(){a._showColorPicker(r,s,n)};var u=this._makeLabel(n[n.length-1],n);this._makeItem(n,u,s)}},{key:"_showColorPicker",value:function(e,r,n){var a=this;r.onclick=function(){},this.colorPicker.insertTo(r),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(function(o){var s="rgba("+o.r+","+o.g+","+o.b+","+o.a+")";r.style.backgroundColor=s,a._update(s,n)}),this.colorPicker.setCloseCallback(function(){r.onclick=function(){a._showColorPicker(e,r,n)}})}},{key:"_handleObject",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=!1,o=St(this.options),s=!1;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){a=!0;var l=e[u],c=ju(r,u);if(typeof o=="function"&&(a=o(u,r),a===!1&&!ve(l)&&typeof l!="string"&&typeof l!="boolean"&&l instanceof Object&&(this.allowCreation=!1,a=this._handleObject(l,c,!0),this.allowCreation=n===!1)),a!==!1){s=!0;var h=this._getValue(c);if(ve(l))this._handleArray(l,h,c);else if(typeof l=="string")this._makeTextInput(l,h,c);else if(typeof l=="boolean")this._makeCheckbox(l,h,c);else if(l instanceof Object){if(!this.hideOption(r,u,this.moduleOptions))if(l.enabled!==void 0){var d=ju(c,"enabled"),f=this._getValue(d);if(f===!0){var v=this._makeLabel(u,c,!0);this._makeItem(c,v),s=this._handleObject(l,c)||s}else this._makeCheckbox(l,f,c)}else{var g=this._makeLabel(u,c,!0);this._makeItem(c,g),s=this._handleObject(l,c)||s}}else console.error("dont know how to handle",l,u,c)}}return s}},{key:"_handleArray",value:function(e,r,n){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,r,n),e[1]!==r&&this.changedOptions.push({path:n,value:r})):typeof e[0]=="string"?(this._makeDropdown(e,r,n),e[0]!==r&&this.changedOptions.push({path:n,value:r})):typeof e[0]=="number"&&(this._makeRange(e,r,n),e[0]!==r&&this.changedOptions.push({path:n,value:Number(r)}))}},{key:"_update",value:function(e,r){var n=this._constructOptions(e,r);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",n),this.initialized=!0,this.parent.setOptions(n)}},{key:"_constructOptions",value:function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=n;e=e==="true"?!0:e,e=e==="false"?!1:e;for(var o=0;o<r.length;o++)r[o]!=="global"&&(a[r[o]]===void 0&&(a[r[o]]={}),o!==r.length-1?a=a[r[o]]:a[r[o]]=e);return n}},{key:"_printOptions",value:function(){for(var e=this.getOptions();this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(yp("pre","const options = "+es(e,null,2)))}},{key:"getOptions",value:function(){for(var e={},r=0;r<this.changedOptions.length;r++)this._constructOptions(this.changedOptions[r].value,this.changedOptions[r].path,e);return e}}]),t}(),Vce=function(){function t(i,e){N(this,t),this.container=i,this.overflowMethod=e||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}return F(t,[{key:"setPosition",value:function(e,r){this.x=Xt(e),this.y=Xt(r)}},{key:"setText",value:function(e){if(e instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(e)}else this.frame.innerText=e}},{key:"show",value:function(e){if(e===void 0&&(e=!0),e===!0){var r=this.frame.clientHeight,n=this.frame.clientWidth,a=this.frame.parentNode.clientHeight,o=this.frame.parentNode.clientWidth,s=0,u=0;if(this.overflowMethod=="flip"){var l=!1,c=!0;this.y-r<this.padding&&(c=!1),this.x+n>o-this.padding&&(l=!0),l?s=this.x-n:s=this.x,c?u=this.y-r:u=this.y}else u=this.y-r,u+r+this.padding>a&&(u=a-r-this.padding),u<this.padding&&(u=this.padding),s=this.x,s+n+this.padding>o&&(s=o-n-this.padding),s<this.padding&&(s=this.padding);this.frame.style.left=s+"px",this.frame.style.top=u+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}},{key:"hide",value:function(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}},{key:"destroy",value:function(){this.frame.parentNode.removeChild(this.frame)}}]),t}(),ba=!1,n0,mp="background: #FFeeee; color: #dd0000",Uce=function(){function t(){N(this,t)}return F(t,null,[{key:"validate",value:function(e,r,n){ba=!1,n0=r;var a=r;return n!==void 0&&(a=r[n]),t.parse(e,a,[]),ba}},{key:"parse",value:function(e,r,n){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.check(a,e,r,n)}},{key:"check",value:function(e,r,n,a){if(n[e]===void 0&&n.__any__===void 0){t.getSuggestion(e,n,a);return}var o=e,s=!0;n[e]===void 0&&n.__any__!==void 0&&(o="__any__",s=t.getType(r[e])==="object");var u=n[o];s&&u.__type__!==void 0&&(u=u.__type__),t.checkFields(e,r,n,o,u,a)}},{key:"checkFields",value:function(e,r,n,a,o,s){var u=function(d){console.error("%c"+d+t.printLocation(s,e),mp)},l=t.getType(r[e]),c=o[l];c!==void 0?t.getType(c)==="array"&&ae(c).call(c,r[e])===-1?(u('Invalid option detected in "'+e+'". Allowed values are:'+t.print(c)+' not "'+r[e]+'". '),ba=!0):l==="object"&&a!=="__any__"&&(s=ju(s,e),t.parse(r[e],n[a],s)):o.any===void 0&&(u('Invalid type received for "'+e+'". Expected: '+t.print(Te(o))+". Received ["+l+'] "'+r[e]+'"'),ba=!0)}},{key:"getType",value:function(e){var r=he(e);return r==="object"?e===null?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":ve(e)?"array":e instanceof Date?"date":e.nodeType!==void 0?"dom":e._isAMomentObject===!0?"moment":"object":r==="number"?"number":r==="boolean"?"boolean":r==="string"?"string":r===void 0?"undefined":r}},{key:"getSuggestion",value:function(e,r,n){var a=t.findInOptions(e,r,n,!1),o=t.findInOptions(e,n0,[],!0),s=8,u=4,l;a.indexMatch!==void 0?l=" in "+t.printLocation(a.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+a.indexMatch+`"?
74
74
 
75
75
  `:o.distance<=u&&a.distance>o.distance?l=" in "+t.printLocation(a.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+t.printLocation(o.path,o.closestMatch,""):a.distance<=s?l='. Did you mean "'+a.closestMatch+'"?'+t.printLocation(a.path,e):l=". Did you mean one of these: "+t.print(Te(r))+t.printLocation(n,e),console.error('%cUnknown option detected: "'+e+'"'+l,mp),ba=!0}},{key:"findInOptions",value:function(e,r,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=1e9,s="",u=[],l=e.toLowerCase(),c=void 0;for(var h in r){var d=void 0;if(r[h].__type__!==void 0&&a===!0){var f=t.findInOptions(e,r[h],ju(n,h));o>f.distance&&(s=f.closestMatch,u=f.path,o=f.distance,c=f.indexMatch)}else{var v;ae(v=h.toLowerCase()).call(v,l)!==-1&&(c=h),d=t.levenshteinDistance(e,h),o>d&&(s=h,u=Rce(n),o=d)}}return{closestMatch:s,path:u,distance:o,indexMatch:c}}},{key:"printLocation",value:function(e,r){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at:
76
76
  `,a=`
@@ -90,10 +90,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
90
90
  `,Ke()):K+=J,Ke();if(J!='"')throw ht('End of string " expected');Ke(),bt=ct.IDENTIFIER;return}for(bt=ct.UNKNOWN;J!="";)K+=J,Ke();throw new SyntaxError('Syntax error in part "'+wP(K,30)+'"')}function ehe(){var t={};if(Qce(),be(),K==="strict"&&(t.strict=!0,be()),(K==="graph"||K==="digraph")&&(t.type=K,be()),bt===ct.IDENTIFIER&&(t.id=K,be()),K!="{")throw ht("Angle bracket { expected");if(be(),mP(t),K!="}")throw ht("Angle bracket } expected");if(be(),K!=="")throw ht("End of file expected");return be(),delete t.node,delete t.edge,delete t.graph,t}function mP(t){for(;K!==""&&K!="}";)the(t),K===";"&&be()}function the(t){var i=$P(t);if(i){bP(t,i);return}var e=rhe(t);if(!e){if(bt!=ct.IDENTIFIER)throw ht("Identifier expected");var r=K;if(be(),K==="="){if(be(),bt!=ct.IDENTIFIER)throw ht("Identifier expected");t[r]=K,be()}else nhe(t,r)}}function $P(t){var i=null;if(K==="subgraph"&&(i={},i.type="subgraph",be(),bt===ct.IDENTIFIER&&(i.id=K,be())),K==="{"){if(be(),i||(i={}),i.parent=t,i.node=t.node,i.edge=t.edge,i.graph=t.graph,mP(i),K!="}")throw ht("Angle bracket } expected");be(),delete i.node,delete i.edge,delete i.graph,delete i.parent,t.subgraphs||(t.subgraphs=[]),t.subgraphs.push(i)}return i}function rhe(t){return K==="node"?(be(),t.node=Fa(),"node"):K==="edge"?(be(),t.edge=Fa(),"edge"):K==="graph"?(be(),t.graph=Fa(),"graph"):null}function nhe(t,i){var e={id:i},r=Fa();r&&(e.attr=r),gP(t,e),bP(t,i)}function bP(t,i){for(;K==="->"||K==="--";){var e,r=K;be();var n=$P(t);if(n)e=n;else{if(bt!=ct.IDENTIFIER)throw ht("Identifier or subgraph expected");e=K,gP(t,{id:e}),be()}var a=Fa(),o=yP(t,i,e,r,a);Jce(t,o),i=e}}function Fa(){for(var t,i=null,e={dashed:!0,solid:!1,dotted:[1,5]},r={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},n=new Array,a=new Array;K==="[";){for(be(),i={};K!==""&&K!="]";){if(bt!=ct.IDENTIFIER)throw ht("Attribute name expected");var o=K;if(be(),K!="=")throw ht("Equal sign = expected");if(be(),bt!=ct.IDENTIFIER)throw ht("Attribute value expected");var s=K;o==="style"&&(s=e[s]);var u;o==="arrowhead"&&(u=r[s],o="arrows",s={to:{enabled:!0,type:u}}),o==="arrowtail"&&(u=r[s],o="arrows",s={from:{enabled:!0,type:u}}),n.push({attr:i,name:o,value:s}),a.push(o),be(),K==","&&be()}if(K!="]")throw ht("Bracket ] expected");be()}if(vr(a).call(a,"dir")){var l={};for(l.arrows={},t=0;t<n.length;t++)if(n[t].name==="arrows")if(n[t].value.to!=null)l.arrows.to=t;else if(n[t].value.from!=null)l.arrows.from=t;else throw ht("Invalid value of arrows");else n[t].name==="dir"&&(l.dir=t);var c=n[l.dir].value;if(!vr(a).call(a,"arrows"))if(c==="both")n.push({attr:n[l.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),l.arrows.to=n.length-1,n.push({attr:n[l.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),l.arrows.from=n.length-1;else if(c==="forward")n.push({attr:n[l.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),l.arrows.to=n.length-1;else if(c==="back")n.push({attr:n[l.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),l.arrows.from=n.length-1;else if(c==="none")n.push({attr:n[l.dir].attr,name:"arrows",value:""}),l.arrows.to=n.length-1;else throw ht('Invalid dir type "'+c+'"');var h,d;if(c==="both")l.arrows.to&&l.arrows.from?(d=n[l.arrows.to].value.to.type,h=n[l.arrows.from].value.from.type,n[l.arrows.to]={attr:n[l.arrows.to].attr,name:n[l.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:h}}},Or(n).call(n,l.arrows.from,1)):l.arrows.to?(d=n[l.arrows.to].value.to.type,h="arrow",n[l.arrows.to]={attr:n[l.arrows.to].attr,name:n[l.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:h}}}):l.arrows.from&&(d="arrow",h=n[l.arrows.from].value.from.type,n[l.arrows.from]={attr:n[l.arrows.from].attr,name:n[l.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:h}}});else if(c==="back")l.arrows.to&&l.arrows.from?(d="",h=n[l.arrows.from].value.from.type,n[l.arrows.from]={attr:n[l.arrows.from].attr,name:n[l.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:h}}}):l.arrows.to?(d="",h="arrow",l.arrows.from=l.arrows.to,n[l.arrows.from]={attr:n[l.arrows.from].attr,name:n[l.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:h}}}):l.arrows.from&&(d="",h=n[l.arrows.from].value.from.type,n[l.arrows.to]={attr:n[l.arrows.from].attr,name:n[l.arrows.from].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:h}}}),n[l.arrows.from]={attr:n[l.arrows.from].attr,name:n[l.arrows.from].name,value:{from:{enabled:!0,type:n[l.arrows.from].value.from.type}}};else if(c==="none"){var f;l.arrows.to?f=l.arrows.to:f=l.arrows.from,n[f]={attr:n[f].attr,name:n[f].name,value:""}}else if(c==="forward")l.arrows.to&&l.arrows.from?(d=n[l.arrows.to].value.to.type,h="",n[l.arrows.to]={attr:n[l.arrows.to].attr,name:n[l.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:h}}}):l.arrows.to?(d=n[l.arrows.to].value.to.type,h="",n[l.arrows.to]={attr:n[l.arrows.to].attr,name:n[l.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:h}}}):l.arrows.from&&(d="arrow",h="",l.arrows.to=l.arrows.from,n[l.arrows.to]={attr:n[l.arrows.to].attr,name:n[l.arrows.to].name,value:{to:{enabled:!0,type:d},from:{enabled:!0,type:h}}}),n[l.arrows.to]={attr:n[l.arrows.to].attr,name:n[l.arrows.to].name,value:{to:{enabled:!0,type:n[l.arrows.to].value.to.type}}};else throw ht('Invalid dir type "'+c+'"');Or(n).call(n,l.dir,1)}var v;if(vr(a).call(a,"penwidth")){var g=[];for(v=n.length,t=0;t<v;t++)n[t].name!=="width"&&(n[t].name==="penwidth"&&(n[t].name="width"),g.push(n[t]));n=g}for(v=n.length,t=0;t<v;t++)Zce(n[t].attr,n[t].name,n[t].value);return i}function ht(t){return new SyntaxError(t+', got "'+wP(K,30)+'" (char '+Vi+")")}function wP(t,i){return t.length<=i?t:t.substr(0,27)+"..."}function ihe(t,i,e){ve(t)?ge(t).call(t,function(r){ve(i)?ge(i).call(i,function(n){e(r,n)}):e(r,i)}):ve(i)?ge(i).call(i,function(r){e(t,r)}):e(t,i)}function Gh(t,i,e){for(var r=i.split("."),n=r.pop(),a=t,o=0;o<r.length;o++){var s=r[o];s in a||(a[s]={}),a=a[s]}return a[n]=e,t}function o0(t,i){var e={};for(var r in t)if(t.hasOwnProperty(r)){var n=i[r];ve(n)?ge(n).call(n,function(a){Gh(e,a,t[r])}):typeof n=="string"?Gh(e,n,t[r]):Gh(e,r,t[r])}return e}function ahe(t){var i=Xce(t),e={nodes:[],edges:[],options:{}};if(i.nodes){var r;ge(r=i.nodes).call(r,function(o){var s={id:o.id,label:String(o.label||o.id)};ln(s,o0(o.attr,pP)),s.image&&(s.shape="image"),e.nodes.push(s)})}if(i.edges){var n,a=function(s){var u={from:s.from,to:s.to};return ln(u,o0(s.attr,yy)),u.arrows==null&&s.type==="->"&&(u.arrows="to"),u};ge(n=i.edges).call(n,function(o){var s,u;if(o.from instanceof Object?s=o.from.nodes:s={id:o.from},o.to instanceof Object?u=o.to.nodes:u={id:o.to},o.from instanceof Object&&o.from.edges){var l;ge(l=o.from.edges).call(l,function(h){var d=a(h);e.edges.push(d)})}if(ihe(s,u,function(h,d){var f=yP(e,h.id,d.id,o.type,o.attr),v=a(f);e.edges.push(v)}),o.to instanceof Object&&o.to.edges){var c;ge(c=o.to.edges).call(c,function(h){var d=a(h);e.edges.push(d)})}})}return i.attr&&(e.options=i.attr),e}function ohe(t,i){var e,r={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};i!=null&&(i.fixed!=null&&(r.nodes.fixed=i.fixed),i.parseColor!=null&&(r.nodes.parseColor=i.parseColor),i.inheritColor!=null&&(r.edges.inheritColor=i.inheritColor));var n=t.edges,a=ji(n).call(n,function(s){var u={from:s.source,id:s.id,to:s.target};return s.attributes!=null&&(u.attributes=s.attributes),s.label!=null&&(u.label=s.label),s.attributes!=null&&s.attributes.title!=null&&(u.title=s.attributes.title),s.type==="Directed"&&(u.arrows="to"),s.color&&r.edges.inheritColor===!1&&(u.color=s.color),u}),o=ji(e=t.nodes).call(e,function(s){var u={id:s.id,fixed:r.nodes.fixed&&s.x!=null&&s.y!=null};return s.attributes!=null&&(u.attributes=s.attributes),s.label!=null&&(u.label=s.label),s.size!=null&&(u.size=s.size),s.attributes!=null&&s.attributes.title!=null&&(u.title=s.attributes.title),s.title!=null&&(u.title=s.title),s.x!=null&&(u.x=s.x),s.y!=null&&(u.y=s.y),s.color!=null&&(r.nodes.parseColor===!0?u.color=s.color:u.color={background:s.color,border:s.color,highlight:{background:s.color,border:s.color},hover:{background:s.color,border:s.color}}),u});return{nodes:o,edges:a}}var she={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"},uhe={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"},lhe={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"},che={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"},hhe={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"},dhe={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ó"},fhe={addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},vhe={addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},phe={addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"},ghe={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"},yhe={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"},mhe=Object.freeze({__proto__:null,cn:vhe,cs:yhe,de:uhe,en:she,es:lhe,fr:ghe,it:che,nl:hhe,pt:dhe,ru:fhe,uk:phe});function $he(t,i){try{var e=i.split(/[-_ /]/,2),r=xe(e,2),n=r[0],a=r[1],o=n!=null?n.toLowerCase():null,s=a!=null?a.toUpperCase():null;if(o&&s){var u=o+"-"+s;if(Object.prototype.hasOwnProperty.call(t,u))return u;var l;console.warn(oy(l="Unknown variant ".concat(s," of language ")).call(l,o,"."))}if(o){var c=o;if(Object.prototype.hasOwnProperty.call(t,c))return c;console.warn("Unknown language ".concat(o))}return console.warn("Unknown locale ".concat(i,", falling back to English.")),"en"}catch(h){return console.error(h),console.warn("Unexpected error while normalizing locale ".concat(i,", falling back to English.")),"en"}}var bhe=function(){function t(){N(this,t),this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}return F(t,[{key:"init",value:function(){if(!this.initialized()){this.src=this.image.src;var e=this.image.width,r=this.image.height;this.width=e,this.height=r;var n=Math.floor(r/2),a=Math.floor(r/4),o=Math.floor(r/8),s=Math.floor(r/16),u=Math.floor(e/2),l=Math.floor(e/4),c=Math.floor(e/8),h=Math.floor(e/16);this.canvas.width=3*l,this.canvas.height=n,this.coordinates=[[0,0,u,n],[u,0,l,a],[u,a,c,o],[5*c,a,h,s]],this._fillMipMap()}}},{key:"initialized",value:function(){return this.coordinates!==void 0}},{key:"_fillMipMap",value:function(){var e=this.canvas.getContext("2d"),r=this.coordinates[0];e.drawImage(this.image,r[0],r[1],r[2],r[3]);for(var n=1;n<this.NUM_ITERATIONS;n++){var a=this.coordinates[n-1],o=this.coordinates[n];e.drawImage(this.canvas,a[0],a[1],a[2],a[3],o[0],o[1],o[2],o[3])}}},{key:"drawImageAtPosition",value:function(e,r,n,a,o,s){if(this.initialized())if(r>2){r*=.5;for(var u=0;r>2&&u<this.NUM_ITERATIONS;)r*=.5,u+=1;u>=this.NUM_ITERATIONS&&(u=this.NUM_ITERATIONS-1);var l=this.coordinates[u];e.drawImage(this.canvas,l[0],l[1],l[2],l[3],n,a,o,s)}else e.drawImage(this.image,n,a,o,s)}}]),t}(),whe=function(){function t(i){N(this,t),this.images={},this.imageBroken={},this.callback=i}return F(t,[{key:"_tryloadBrokenUrl",value:function(e,r,n){if(!(e===void 0||n===void 0)){if(r===void 0){console.warn("No broken url image defined");return}n.image.onerror=function(){console.error("Could not load brokenImage:",r)},n.image.src=r}}},{key:"_redrawWithImage",value:function(e){this.callback&&this.callback(e)}},{key:"load",value:function(e,r){var n=this,a=this.images[e];if(a)return a;var o=new bhe;return this.images[e]=o,o.image.onload=function(){n._fixImageCoordinates(o.image),o.init(),n._redrawWithImage(o)},o.image.onerror=function(){console.error("Could not load image:",e),n._tryloadBrokenUrl(e,r,o)},o.image.src=e,o}},{key:"_fixImageCoordinates",value:function(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}]),t}(),$p={},_he={get exports(){return $p},set exports(t){$p=t}},Ui={},Ehe={get exports(){return Ui},set exports(t){Ui=t}},She=se,Ohe=She(function(){if(typeof ArrayBuffer=="function"){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}),The=se,xhe=et,Phe=Fr,s0=Ohe,iu=Object.isExtensible,khe=The(function(){iu(1)}),Ihe=khe||s0?function(i){return!xhe(i)||s0&&Phe(i)=="ArrayBuffer"?!1:iu?iu(i):!0}:iu,Che=se,_P=!Che(function(){return Object.isExtensible(Object.preventExtensions({}))}),Ahe=q,Rhe=ue,Dhe=Uo,Mhe=et,my=tt,Nhe=Ut.f,u0=Yo,Fhe=Tl,$y=Ihe,Bhe=yl,Lhe=_P,EP=!1,Ar=Bhe("meta"),jhe=0,by=function(t){Nhe(t,Ar,{value:{objectID:"O"+jhe++,weakData:{}}})},zhe=function(t,i){if(!Mhe(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!my(t,Ar)){if(!$y(t))return"F";if(!i)return"E";by(t)}return t[Ar].objectID},Hhe=function(t,i){if(!my(t,Ar)){if(!$y(t))return!0;if(!i)return!1;by(t)}return t[Ar].weakData},Whe=function(t){return Lhe&&EP&&$y(t)&&!my(t,Ar)&&by(t),t},Vhe=function(){Uhe.enable=function(){},EP=!0;var t=u0.f,i=Rhe([].splice),e={};e[Ar]=1,t(e).length&&(u0.f=function(r){for(var n=t(r),a=0,o=n.length;a<o;a++)if(n[a]===Ar){i(n,a,1);break}return n},Ahe({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Fhe.f}))},Uhe=Ehe.exports={enable:Vhe,fastKey:zhe,getWeakData:Hhe,onFreeze:Whe};Dhe[Ar]=!0;var Ghe=Wo,Khe=Mt,qhe=Ft,Yhe=sa,Xhe=ET,Qhe=ir,l0=Ne,Zhe=PT,Jhe=Ol,c0=_T,ede=TypeError,au=function(t,i){this.stopped=t,this.result=i},h0=au.prototype,wy=function(t,i,e){var r=e&&e.that,n=!!(e&&e.AS_ENTRIES),a=!!(e&&e.IS_RECORD),o=!!(e&&e.IS_ITERATOR),s=!!(e&&e.INTERRUPTED),u=Ghe(i,r),l,c,h,d,f,v,g,b=function($){return l&&c0(l,"normal",$),new au(!0,$)},p=function($){return n?(qhe($),s?u($[0],$[1],b):u($[0],$[1])):s?u($,b):u($)};if(a)l=t.iterator;else if(o)l=t;else{if(c=Jhe(t),!c)throw ede(Yhe(t)+" is not iterable");if(Xhe(c)){for(h=0,d=Qhe(t);d>h;h++)if(f=p(t[h]),f&&l0(h0,f))return f;return new au(!1)}l=Zhe(t,c)}for(v=a?t.next:l.next;!(g=Khe(v,l)).done;){try{f=p(g.value)}catch($){c0(l,"throw",$)}if(typeof f=="object"&&f&&l0(h0,f))return f}return new au(!1)},tde=Ne,rde=TypeError,_y=function(t,i){if(tde(i,t))return t;throw rde("Incorrect invocation")},nde=q,ide=Ve,ade=Ui,ode=se,sde=ua,ude=wy,lde=_y,cde=Je,hde=et,dde=ca,fde=Ut.f,vde=fn.forEach,pde=Ge,SP=Jn,gde=SP.set,yde=SP.getterFor,Ey=function(t,i,e){var r=t.indexOf("Map")!==-1,n=t.indexOf("Weak")!==-1,a=r?"set":"add",o=ide[t],s=o&&o.prototype,u={},l;if(!pde||!cde(o)||!(n||s.forEach&&!ode(function(){new o().entries().next()})))l=e.getConstructor(i,t,r,a),ade.enable();else{l=i(function(d,f){gde(lde(d,c),{type:t,collection:new o}),f!=null&&ude(f,d[a],{that:d,AS_ENTRIES:r})});var c=l.prototype,h=yde(t);vde(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(d){var f=d=="add"||d=="set";d in s&&!(n&&d=="clear")&&sde(c,d,function(v,g){var b=h(this).collection;if(!f&&n&&!hde(v))return d=="get"?void 0:!1;var p=b[d](v===0?0:v,g);return f?this:p})}),n||fde(c,"size",{configurable:!0,get:function(){return h(this).collection.size}})}return dde(l,t,!1,!0),u[t]=l,nde({global:!0,forced:!0},u),n||e.setStrong(l,t,r),l},mde=qo,Sy=function(t,i,e){for(var r in i)e&&e.unsafe&&t[r]?t[r]=i[r]:mde(t,r,i[r],e);return t},$de=Vt,bde=Jg,wde=Fe,_de=Ge,d0=wde("species"),Ede=function(t){var i=$de(t);_de&&i&&!i[d0]&&bde(i,d0,{configurable:!0,get:function(){return this}})},Sde=la,Ode=Jg,f0=Sy,Tde=Wo,xde=_y,Pde=Fo,kde=wy,Ide=Xg,Ls=Qg,Cde=Ede,wa=Ge,v0=Ui.fastKey,OP=Jn,p0=OP.set,Kh=OP.getterFor,TP={getConstructor:function(t,i,e,r){var n=t(function(l,c){xde(l,a),p0(l,{type:i,index:Sde(null),first:void 0,last:void 0,size:0}),wa||(l.size=0),Pde(c)||kde(c,l[r],{that:l,AS_ENTRIES:e})}),a=n.prototype,o=Kh(i),s=function(l,c,h){var d=o(l),f=u(l,c),v,g;return f?f.value=h:(d.last=f={index:g=v0(c,!0),key:c,value:h,previous:v=d.last,next:void 0,removed:!1},d.first||(d.first=f),v&&(v.next=f),wa?d.size++:l.size++,g!=="F"&&(d.index[g]=f)),l},u=function(l,c){var h=o(l),d=v0(c),f;if(d!=="F")return h.index[d];for(f=h.first;f;f=f.next)if(f.key==c)return f};return f0(a,{clear:function(){for(var c=this,h=o(c),d=h.index,f=h.first;f;)f.removed=!0,f.previous&&(f.previous=f.previous.next=void 0),delete d[f.index],f=f.next;h.first=h.last=void 0,wa?h.size=0:c.size=0},delete:function(l){var c=this,h=o(c),d=u(c,l);if(d){var f=d.next,v=d.previous;delete h.index[d.index],d.removed=!0,v&&(v.next=f),f&&(f.previous=v),h.first==d&&(h.first=f),h.last==d&&(h.last=v),wa?h.size--:c.size--}return!!d},forEach:function(c){for(var h=o(this),d=Tde(c,arguments.length>1?arguments[1]:void 0),f;f=f?f.next:h.first;)for(d(f.value,f.key,this);f&&f.removed;)f=f.previous},has:function(c){return!!u(this,c)}}),f0(a,e?{get:function(c){var h=u(this,c);return h&&h.value},set:function(c,h){return s(this,c===0?0:c,h)}}:{add:function(c){return s(this,c=c===0?0:c,c)}}),wa&&Ode(a,"size",{configurable:!0,get:function(){return o(this).size}}),n},setStrong:function(t,i,e){var r=i+" Iterator",n=Kh(i),a=Kh(r);Ide(t,i,function(o,s){p0(this,{type:r,target:o,state:n(o),kind:s,last:void 0})},function(){for(var o=a(this),s=o.kind,u=o.last;u&&u.removed;)u=u.previous;return!o.target||!(o.last=u=u?u.next:o.state.first)?(o.target=void 0,Ls(void 0,!0)):s=="keys"?Ls(u.key,!1):s=="values"?Ls(u.value,!1):Ls([u.key,u.value],!1)},e?"entries":"values",!e,!0),Cde(i)}},Ade=Ey,Rde=TP;Ade("Map",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Rde);var Dde=ie,Mde=Dde.Map,Nde=Mde,Fde=Nde;(function(t){t.exports=Fde})(_he);var xP=V($p),Bde=function(){function t(){N(this,t),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},je(this.options,this.defaultOptions)}return F(t,[{key:"setOptions",value:function(e){var r=["useDefaultGroups"];if(e!==void 0){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ae(r).call(r,n)===-1){var a=e[n];this.add(n,a)}}}},{key:"clear",value:function(){this._groups=new xP,this._groupNames=[]}},{key:"get",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this._groups.get(e);if(n===void 0&&r)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){var a=this._groupIndex%this._groupNames.length;++this._groupIndex,n={},n.color=this._groups.get(this._groupNames[a]),this._groups.set(e,n)}else{var o=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,n={},n.color=this._defaultGroups[o],this._groups.set(e,n)}return n}},{key:"add",value:function(e,r){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,r),r}}]),t}(),bp={},Lde={get exports(){return bp},set exports(t){bp=t}},jde=q;jde({target:"Number",stat:!0},{isNaN:function(i){return i!=i}});var zde=ie,Hde=zde.Number.isNaN,Wde=Hde,Vde=Wde;(function(t){t.exports=Vde})(Lde);var wp=V(bp),_p={},Ude={get exports(){return _p},set exports(t){_p=t}},Gde=Ve,Kde=Gde.isFinite,qde=Number.isFinite||function(i){return typeof i=="number"&&Kde(i)},Yde=q,Xde=qde;Yde({target:"Number",stat:!0},{isFinite:Xde});var Qde=ie,Zde=Qde.Number.isFinite,Jde=Zde,efe=Jde;(function(t){t.exports=efe})(Ude);var xn=V(_p),Ep={},tfe={get exports(){return Ep},set exports(t){Ep=t}},rfe=q,nfe=fn.some,ife=fa,afe=ife("some");rfe({target:"Array",proto:!0,forced:!afe},{some:function(i){return nfe(this,i,arguments.length>1?arguments[1]:void 0)}});var ofe=rt,sfe=ofe("Array").some,ufe=Ne,lfe=sfe,qh=Array.prototype,cfe=function(t){var i=t.some;return t===qh||ufe(qh,t)&&i===qh.some?lfe:i},hfe=cfe,dfe=hfe;(function(t){t.exports=dfe})(tfe);var ffe=V(Ep),Sp={},vfe={get exports(){return Sp},set exports(t){Sp=t}},PP=Ve,pfe=se,gfe=ue,yfe=mr,mfe=sy.trim,$fe=Nl,bfe=gfe("".charAt),zu=PP.parseFloat,g0=PP.Symbol,y0=g0&&g0.iterator,wfe=1/zu($fe+"-0")!==-1/0||y0&&!pfe(function(){zu(Object(y0))}),_fe=wfe?function(i){var e=mfe(yfe(i)),r=zu(e);return r===0&&bfe(e,0)=="-"?-0:r}:zu,Efe=q,m0=_fe;Efe({global:!0,forced:parseFloat!=m0},{parseFloat:m0});var Sfe=ie,Ofe=Sfe.parseFloat,Tfe=Ofe,xfe=Tfe;(function(t){t.exports=xfe})(vfe);var kP=V(Sp),Op={},Pfe={get exports(){return Op},set exports(t){Op=t}},kfe=q,Ife=se,Cfe=Tl.f,Afe=Ife(function(){return!Object.getOwnPropertyNames(1)});kfe({target:"Object",stat:!0,forced:Afe},{getOwnPropertyNames:Cfe});var Rfe=ie,Dfe=Rfe.Object,Mfe=function(i){return Dfe.getOwnPropertyNames(i)},Nfe=Mfe,Ffe=Nfe;(function(t){t.exports=Ffe})(Pfe);var Bfe=V(Op);function Oy(t,i){var e=["node","edge","label"],r=!0,n=Gr(i,"chosen");if(typeof n=="boolean")r=n;else if(he(n)==="object"){if(ae(e).call(e,t)===-1)throw new Error("choosify: subOption '"+t+"' should be one of '"+e.join("', '")+"'");var a=Gr(i,["chosen",t]);(typeof a=="boolean"||typeof a=="function")&&(r=a)}return r}function Tp(t,i,e){if(t.width<=0||t.height<=0)return!1;if(e!==void 0){var r={x:i.x-e.x,y:i.y-e.y};if(e.angle!==0){var n=-e.angle,a={x:Math.cos(n)*r.x-Math.sin(n)*r.y,y:Math.sin(n)*r.x+Math.cos(n)*r.y};i=a}else i=r}var o=t.x+t.width,s=t.y+t.width;return t.left<i.x&&o>i.x&&t.top<i.y&&s>i.y}function Hu(t){return typeof t=="string"&&t!==""}function IP(t,i,e,r){var n=r.x,a=r.y;if(typeof r.distanceToBorder=="function"){var o=r.distanceToBorder(t,i),s=Math.sin(i)*o,u=Math.cos(i)*o;u===o?(n+=o,a=r.y):s===o?(n=r.x,a-=o):(n+=u,a-=s)}else r.shape.width>r.shape.height?(n=r.x+r.shape.width*.5,a=r.y-e):(n=r.x+e,a=r.y-r.shape.height*.5);return{x:n,y:a}}var xp={},Lfe={get exports(){return xp},set exports(t){xp=t}},jfe=rt,zfe=jfe("Array").values,Hfe=zfe,Wfe=Hfe,Vfe=Zn,Ufe=tt,Gfe=Ne,Kfe=Wfe,Yh=Array.prototype,qfe={DOMTokenList:!0,NodeList:!0},Yfe=function(t){var i=t.values;return t===Yh||Gfe(Yh,t)&&i===Yh.values||Ufe(qfe,Vfe(t))?Kfe:i};(function(t){t.exports=Yfe})(Lfe);var CP=V(xp),Xfe=function(){function t(i){N(this,t),this.measureText=i,this.current=0,this.width=0,this.height=0,this.lines=[]}return F(t,[{key:"_add",value:function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});var a=r;(r===void 0||r==="")&&(a=" ");var o=this.measureText(a,n),s=je({},CP(o));s.text=r,s.width=o.width,s.mod=n,(r===void 0||r==="")&&(s.width=0),this.lines[e].blocks.push(s),this.lines[e].width+=s.width}},{key:"curWidth",value:function(){var e=this.lines[this.current];return e===void 0?0:e.width}},{key:"append",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,r)}},{key:"newLine",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,r),this.current++}},{key:"determineLineHeights",value:function(){for(var e=0;e<this.lines.length;e++){var r=this.lines[e],n=0;if(r.blocks!==void 0)for(var a=0;a<r.blocks.length;a++){var o=r.blocks[a];n<o.height&&(n=o.height)}r.height=n}}},{key:"determineLabelSize",value:function(){for(var e=0,r=0,n=0;n<this.lines.length;n++){var a=this.lines[n];a.width>e&&(e=a.width),r+=a.height}this.width=e,this.height=r}},{key:"removeEmptyBlocks",value:function(){for(var e=[],r=0;r<this.lines.length;r++){var n=this.lines[r];if(n.blocks.length!==0&&!(r===this.lines.length-1&&n.width===0)){var a={};je(a,n),a.blocks=[];for(var o=void 0,s=[],u=0;u<n.blocks.length;u++){var l=n.blocks[u];l.width!==0?s.push(l):o===void 0&&(o=l)}s.length===0&&o!==void 0&&s.push(o),a.blocks=s,e.push(a)}}return e}},{key:"finalize",value:function(){this.determineLineHeights(),this.determineLabelSize();var e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}}]),t}(),Qfe={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},$0=function(){function t(i){N(this,t),this.text=i,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}return F(t,[{key:"mod",value:function(){return this.modStack.length===0?"normal":this.modStack[0]}},{key:"modName",value:function(){if(this.modStack.length===0)return"normal";if(this.modStack[0]==="mono")return"mono";if(this.bold&&this.ital)return"boldital";if(this.bold)return"bold";if(this.ital)return"ital"}},{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(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}},{key:"parseWS",value:function(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}},{key:"setTag",value:function(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}},{key:"unsetTag",value:function(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}},{key:"parseStartTag",value:function(e,r){return!this.mono&&!this[e]&&this.match(r)?(this.setTag(e),!0):!1}},{key:"match",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this.prepareRegExp(e),a=xe(n,2),o=a[0],s=a[1],u=o.test(this.text.substr(this.position,s));return u&&r&&(this.position+=s-1),u}},{key:"parseEndTag",value:function(e,r,n){var a=this.mod()===e;return e==="mono"?a=a&&this.mono:a=a&&!this.mono,a&&this.match(r)?(n!==void 0?(this.position===this.text.length-1||this.match(n,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}},{key:"replace",value:function(e,r){return this.match(e)?(this.add(r),this.position+=length-1,!0):!1}},{key:"prepareRegExp",value:function(e){var r,n;if(e instanceof RegExp)n=e,r=1;else{var a=Qfe[e];a!==void 0?n=a:n=new RegExp(e),r=e.length}return[n,r]}}]),t}(),Zfe=function(){function t(i,e,r,n){var a=this;N(this,t),this.ctx=i,this.parent=e,this.selected=r,this.hover=n;var o=function(u,l){if(u===void 0)return 0;var c=a.parent.getFormattingValues(i,r,n,l),h=0;if(u!==""){var d=a.ctx.measureText(u);h=d.width}return{width:h,values:c}};this.lines=new Xfe(o)}return F(t,[{key:"process",value:function(e){if(!Hu(e))return this.lines.finalize();var r=this.parent.fontOptions;e=e.replace(/\r\n/g,`
91
91
  `),e=e.replace(/\r/g,`
92
92
  `);var n=String(e).split(`
93
- `),a=n.length;if(r.multi)for(var o=0;o<a;o++){var s=this.splitBlocks(n[o],r.multi);if(s!==void 0){if(s.length===0){this.lines.newLine("");continue}if(r.maxWdt>0)for(var u=0;u<s.length;u++){var l=s[u].mod,c=s[u].text;this.splitStringIntoLines(c,l,!0)}else for(var h=0;h<s.length;h++){var d=s[h].mod,f=s[h].text;this.lines.append(f,d)}this.lines.newLine()}}else if(r.maxWdt>0)for(var v=0;v<a;v++)this.splitStringIntoLines(n[v]);else for(var g=0;g<a;g++)this.lines.newLine(n[g]);return this.lines.finalize()}},{key:"decodeMarkupSystem",value:function(e){var r="none";return e==="markdown"||e==="md"?r="markdown":(e===!0||e==="html")&&(r="html"),r}},{key:"splitHtmlBlocks",value:function(e){for(var r=new $0(e),n=function(u){if(/&/.test(u)){var l=r.replace(r.text,"&lt;","<")||r.replace(r.text,"&amp;","&");return l||r.add("&"),!0}return!1};r.position<r.text.length;){var a=r.text.charAt(r.position),o=r.parseWS(a)||/</.test(a)&&(r.parseStartTag("bold","<b>")||r.parseStartTag("ital","<i>")||r.parseStartTag("mono","<code>")||r.parseEndTag("bold","</b>")||r.parseEndTag("ital","</i>")||r.parseEndTag("mono","</code>"))||n(a);o||r.add(a),r.position++}return r.emitBlock(),r.blocks}},{key:"splitMarkdownBlocks",value:function(e){for(var r=this,n=new $0(e),a=!0,o=function(c){return/\\/.test(c)?(n.position<r.text.length+1&&(n.position++,c=r.text.charAt(n.position),/ \t/.test(c)?n.spacing=!0:(n.add(c),a=!1)),!0):!1};n.position<n.text.length;){var s=n.text.charAt(n.position),u=n.parseWS(s)||o(s)||(a||n.spacing)&&(n.parseStartTag("bold","*")||n.parseStartTag("ital","_")||n.parseStartTag("mono","`"))||n.parseEndTag("bold","*","afterBold")||n.parseEndTag("ital","_","afterItal")||n.parseEndTag("mono","`","afterMono");u||(n.add(s),a=!1),n.position++}return n.emitBlock(),n.blocks}},{key:"splitBlocks",value:function(e,r){var n=this.decodeMarkupSystem(r);if(n==="none")return[{text:e,mod:"normal"}];if(n==="markdown")return this.splitMarkdownBlocks(e);if(n==="html")return this.splitHtmlBlocks(e)}},{key:"overMaxWidth",value:function(e){var r=this.ctx.measureText(e).width;return this.lines.curWidth()+r>this.parent.fontOptions.maxWdt}},{key:"getLongestFit",value:function(e){for(var r="",n=0;n<e.length;){var a=r===""?"":" ",o=r+a+e[n];if(this.overMaxWidth(o))break;r=o,n++}return n}},{key:"getLongestFitWord",value:function(e){for(var r=0;r<e.length&&!this.overMaxWidth(st(e).call(e,0,r));)r++;return r}},{key:"splitStringIntoLines",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,r),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");for(var a=e.split("\r");a.length>0;){var o=this.getLongestFit(a);if(o===0){var s=a[0],u=this.getLongestFitWord(s);this.lines.newLine(st(s).call(s,0,u),r),a[0]=st(s).call(s,u)}else{var l=o;a[o-1]===" "?o--:a[l]===" "&&l++;var c=st(a).call(a,0,o).join("");o==a.length&&n?this.lines.append(c,r):this.lines.newLine(c,r),a=st(a).call(a,l)}}}}]),t}(),_a=["bold","ital","boldital","mono"],AP=function(){function t(i,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;N(this,t),this.body=i,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(e),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=r}return F(t,[{key:"setOptions",value:function(e){if(this.elementOptions=e,this.initFontOptions(e.font),Hu(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(he(e.font)==="object"){var r=e.font.size;r!==void 0&&(this.baseSize=r)}}}},{key:"initFontOptions",value:function(e){var r=this;if(ee(_a,function(n){r.fontOptions[n]={}}),t.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}ee(e,function(n,a){n!=null&&he(n)!=="object"&&(r.fontOptions[a]=n)})}},{key:"constrain",value:function(e){var r={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},n=Gr(e,"widthConstraint");if(typeof n=="number")r.maxWdt=Number(n),r.minWdt=Number(n);else if(he(n)==="object"){var a=Gr(e,["widthConstraint","maximum"]);typeof a=="number"&&(r.maxWdt=Number(a));var o=Gr(e,["widthConstraint","minimum"]);typeof o=="number"&&(r.minWdt=Number(o))}var s=Gr(e,"heightConstraint");if(typeof s=="number")r.minHgt=Number(s);else if(he(s)==="object"){var u=Gr(e,["heightConstraint","minimum"]);typeof u=="number"&&(r.minHgt=Number(u));var l=Gr(e,["heightConstraint","valign"]);typeof l=="string"&&(l==="top"||l==="bottom")&&(r.valign=l)}return r}},{key:"update",value:function(e,r){this.setOptions(e,!0),this.propagateFonts(r),$e(this.fontOptions,this.constrain(r)),this.fontOptions.chooser=Oy("label",r)}},{key:"adjustSizes",value:function(e){var r=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=r,this.fontOptions.minWdt-=r);var n=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=n)}},{key:"addFontOptionsToPile",value:function(e,r){for(var n=0;n<r.length;++n)this.addFontToPile(e,r[n])}},{key:"addFontToPile",value:function(e,r){if(r!==void 0&&!(r.font===void 0||r.font===null)){var n=r.font;e.push(n)}}},{key:"getBasicOptions",value:function(e){for(var r={},n=0;n<e.length;++n){var a=e[n],o={};t.parseFontString(o,a)&&(a=o),ee(a,function(s,u){s!==void 0&&(Object.prototype.hasOwnProperty.call(r,u)||(ae(_a).call(_a,u)!==-1?r[u]={}:r[u]=s))})}return r}},{key:"getFontOption",value:function(e,r,n){for(var a,o=0;o<e.length;++o){var s=e[o];if(Object.prototype.hasOwnProperty.call(s,r)){if(a=s[r],a==null)continue;var u={};if(t.parseFontString(u,a)&&(a=u),Object.prototype.hasOwnProperty.call(a,n))return a[n]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,n))return this.fontOptions[n];throw new Error("Did not find value for multi-font for property: '"+n+"'")}},{key:"getFontOptions",value:function(e,r){for(var n={},a=["color","size","face","mod","vadjust"],o=0;o<a.length;++o){var s=a[o];n[s]=this.getFontOption(e,r,s)}return n}},{key:"propagateFonts",value:function(e){var r=this,n=[];this.addFontOptionsToPile(n,e),this.fontOptions=this.getBasicOptions(n);for(var a=function(){var u=_a[o],l=r.fontOptions[u],c=r.getFontOptions(n,u);ee(c,function(h,d){l[d]=h}),l.size=Number(l.size),l.vadjust=Number(l.vadjust)},o=0;o<_a.length;++o)a()}},{key:"draw",value:function(e,r,n,a,o){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label!==void 0){var u=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&u<this.elementOptions.scaling.label.drawThreshold-1||(u>=this.elementOptions.scaling.label.maxVisible&&(u=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,a,o,r,n,s),this._drawBackground(e),this._drawText(e,r,this.size.yLine,s,u))}}},{key:"_drawBackground",value:function(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;var r=this.getSize();e.fillRect(r.left,r.top,r.width,r.height)}}},{key:"_drawText",value:function(e,r,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",o=arguments.length>4?arguments[4]:void 0,s=this._setAlignment(e,r,n,a),u=xe(s,2);r=u[0],n=u[1],e.textAlign="left",r=r-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(n-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(n+=(this.size.height-this.size.labelHeight)/2));for(var l=0;l<this.lineCount;l++){var c=this.lines[l];if(c&&c.blocks){var h=0;this.isEdgeLabel||this.fontOptions.align==="center"?h+=(this.size.width-c.width)/2:this.fontOptions.align==="right"&&(h+=this.size.width-c.width);for(var d=0;d<c.blocks.length;d++){var f=c.blocks[d];e.font=f.font;var v=this._getColor(f.color,o,f.strokeColor),g=xe(v,2),b=g[0],p=g[1];f.strokeWidth>0&&(e.lineWidth=f.strokeWidth,e.strokeStyle=p,e.lineJoin="round"),e.fillStyle=b,f.strokeWidth>0&&e.strokeText(f.text,r+h,n+f.vadjust),e.fillText(f.text,r+h,n+f.vadjust),h+=f.width}n+=c.height}}}},{key:"_setAlignment",value:function(e,r,n,a){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){r=0,n=0;var o=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",n-=2*o):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",n+=2*o):e.textBaseline="middle"}else e.textBaseline=a;return[r,n]}},{key:"_getColor",value:function(e,r,n){var a=e||"#000000",o=n||"#ffffff";if(r<=this.elementOptions.scaling.label.drawThreshold){var s=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-r)));a=jt(a,s),o=jt(o,s)}return[a,o]}},{key:"getTextSize",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,r,n),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"getSize",value:function(){var e=2,r=this.size.left,n=this.size.top-.5*e;if(this.isEdgeLabel){var a=-this.size.width*.5;switch(this.fontOptions.align){case"middle":r=a,n=-this.size.height*.5;break;case"top":r=a,n=-(this.size.height+e);break;case"bottom":r=a,n=e;break}}var o={left:r,top:n,width:this.size.width,height:this.size.height};return o}},{key:"calculateLabelSize",value:function(e,r,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,r,n),this.size.left=a-this.size.width*.5,this.size.top=o-this.size.height*.5,this.size.yLine=o+(1-this.lineCount)*.5*this.fontOptions.size,s==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:"getFormattingValues",value:function(e,r,n,a){var o=function(c,h,d){return h==="normal"?d==="mod"?"":c[d]:c[h][d]!==void 0?c[h][d]:c[d]},s={color:o(this.fontOptions,a,"color"),size:o(this.fontOptions,a,"size"),face:o(this.fontOptions,a,"face"),mod:o(this.fontOptions,a,"mod"),vadjust:o(this.fontOptions,a,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(r||n)&&(a==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?s.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(s,this.elementOptions.id,r,n));var u="";return s.mod!==void 0&&s.mod!==""&&(u+=s.mod+" "),u+=s.size+"px "+s.face,e.font=u.replace(/"/g,""),s.font=e.font,s.height=s.size,s}},{key:"differentState",value:function(e,r){return e!==this.selectedState||r!==this.hoverState}},{key:"_processLabelText",value:function(e,r,n,a){var o=new Zfe(e,this,r,n);return o.process(a)}},{key:"_processLabel",value:function(e,r,n){if(!(this.labelDirty===!1&&!this.differentState(r,n))){var a=this._processLabelText(e,r,n,this.elementOptions.label);this.fontOptions.minWdt>0&&a.width<this.fontOptions.minWdt&&(a.width=this.fontOptions.minWdt),this.size.labelHeight=a.height,this.fontOptions.minHgt>0&&a.height<this.fontOptions.minHgt&&(a.height=this.fontOptions.minHgt),this.lines=a.lines,this.lineCount=a.lines.length,this.size.width=a.width,this.size.height=a.height,this.selectedState=r,this.hoverState=n,this.labelDirty=!1}}},{key:"visible",value:function(){if(this.size.width===0||this.size.height===0||this.elementOptions.label===void 0)return!1;var e=this.fontOptions.size*this.body.view.scale;return!(e<this.elementOptions.scaling.label.drawThreshold-1)}}],[{key:"parseFontString",value:function(e,r){if(!r||typeof r!="string")return!1;var n=r.split(" ");return e.size=+n[0].replace("px",""),e.face=n[1],e.color=n[2],!0}}]),t}(),Pp={},Jfe={get exports(){return Pp},set exports(t){Pp=t}},eve=Sl,tve=sa,rve=TypeError,nve=function(t){if(eve(t))return t;throw rve(tve(t)+" is not a constructor")},ive=q,ave=Vt,Xh=Do,ove=iT,b0=nve,sve=Ft,w0=et,uve=la,RP=se,Ty=ave("Reflect","construct"),lve=Object.prototype,cve=[].push,DP=RP(function(){function t(){}return!(Ty(function(){},[],t)instanceof t)}),MP=!RP(function(){Ty(function(){})}),_0=DP||MP;ive({target:"Reflect",stat:!0,forced:_0,sham:_0},{construct:function(i,e){b0(i),sve(e);var r=arguments.length<3?i:b0(arguments[2]);if(MP&&!DP)return Ty(i,e,r);if(i==r){switch(e.length){case 0:return new i;case 1:return new i(e[0]);case 2:return new i(e[0],e[1]);case 3:return new i(e[0],e[1],e[2]);case 4:return new i(e[0],e[1],e[2],e[3])}var n=[null];return Xh(cve,n,e),new(Xh(ove,i,n))}var a=r.prototype,o=uve(w0(a)?a:lve),s=Xh(i,o,e);return w0(s)?s:o}});var hve=ie,dve=hve.Reflect.construct,fve=dve,vve=fve;(function(t){t.exports=vve})(Jfe);var P=V(Pp),kp={},pve={get exports(){return kp},set exports(t){kp=t}},Ip={},gve={get exports(){return Ip},set exports(t){Ip=t}},yve=Dx,mve=yve,$ve=mve,bve=$ve;(function(t){t.exports=bve})(gve);(function(t){t.exports=Ip})(pve);var wve=V(kp),Cp={},_ve={get exports(){return Cp},set exports(t){Cp=t}},Ap={},Eve={get exports(){return Ap},set exports(t){Ap=t}},Sve=q,Ove=sZ;Sve({target:"Object",stat:!0},{setPrototypeOf:Ove});var Tve=ie,xve=Tve.Object.setPrototypeOf,Pve=xve,kve=Pve,Ive=kve,Cve=Ive,Ave=Cve,Rve=Ave;(function(t){t.exports=Rve})(Eve);(function(t){t.exports=Ap})(_ve);var Rp=V(Cp),Dp={},Dve={get exports(){return Dp},set exports(t){Dp=t}},Mp={},Mve={get exports(){return Mp},set exports(t){Mp=t}},Nve=aT,Fve=Nve,Bve=Fve,Lve=Bve;(function(t){t.exports=Lve})(Mve);(function(t){t.exports=Mp})(Dve);var xy=V(Dp);function Np(t,i){var e;return Np=Rp?xy(e=Rp).call(e):function(n,a){return n.__proto__=a,n},Np(t,i)}function ce(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=wve(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Dl(t,"prototype",{writable:!1}),i&&Np(t,i)}function jve(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pe(t,i){if(i&&(he(i)==="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jve(t)}var Fp={},zve={get exports(){return Fp},set exports(t){Fp=t}},Bp={},Hve={get exports(){return Bp},set exports(t){Bp=t}},Wve=kx,Vve=Wve,Uve=Vve,Gve=Uve;(function(t){t.exports=Gve})(Hve);(function(t){t.exports=Bp})(zve);var E0=V(Fp);function z(t){var i;return z=Rp?xy(i=E0).call(i):function(r){return r.__proto__||E0(r)},z(t)}var ni=function(){function t(i,e,r){N(this,t),this.body=e,this.labelModule=r,this.setOptions(i),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}return F(t,[{key:"setOptions",value:function(e){this.options=e}},{key:"_setMargins",value:function(e){this.margin={},this.options.margin&&(he(this.options.margin)=="object"?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),e.adjustSizes(this.margin)}},{key:"_distanceToBorder",value:function(e,r){var n=this.options.borderWidth;return e&&this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(r)),Math.abs(this.height/2/Math.sin(r)))+n}},{key:"enableShadow",value:function(e,r){r.shadow&&(e.shadowColor=r.shadowColor,e.shadowBlur=r.shadowSize,e.shadowOffsetX=r.shadowX,e.shadowOffsetY=r.shadowY)}},{key:"disableShadow",value:function(e,r){r.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"enableBorderDashes",value:function(e,r){if(r.borderDashes!==!1)if(e.setLineDash!==void 0){var n=r.borderDashes;n===!0&&(n=[5,15]),e.setLineDash(n)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,r.borderDashes=!1}},{key:"disableBorderDashes",value:function(e,r){r.borderDashes!==!1&&(e.setLineDash!==void 0?e.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,r.borderDashes=!1))}},{key:"needsRefresh",value:function(e,r){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,r)}},{key:"initContextForDraw",value:function(e,r){var n=r.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,n),e.strokeStyle=r.borderColor,e.fillStyle=r.color}},{key:"performStroke",value:function(e,r){var n=r.borderWidth/this.body.view.scale;e.save(),n>0&&(this.enableBorderDashes(e,r),e.stroke(),this.disableBorderDashes(e,r)),e.restore()}},{key:"performFill",value:function(e,r){e.save(),e.fillStyle=r.color,this.enableShadow(e,r),ts(e).call(e),this.disableShadow(e,r),e.restore(),this.performStroke(e,r)}},{key:"_addBoundingBoxMargin",value:function(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}},{key:"_updateBoundingBox",value:function(e,r,n,a,o){n!==void 0&&this.resize(n,a,o),this.left=e-this.width/2,this.top=r-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(e,r,n,a,o){this._updateBoundingBox(e,r,n,a,o)}},{key:"getDimensionsFromLabel",value:function(e,r,n){this.textSize=this.labelModule.getTextSize(e,r,n);var a=this.textSize.width,o=this.textSize.height,s=14;return a===0&&(a=s,o=s),{width:a,height:o}}}]),t}();function Kve(t){var i=qve();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function qve(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Yve=function(t){ce(e,t);var i=Kve(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o._setMargins(a),o}return F(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o);this.width=s.width+this.margin.right+this.margin.left,this.height=s.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this.initContextForDraw(n,l),oT(n,this.left,this.top,this.width,this.height,l.borderRadius),this.performFill(n,l),this.updateBoundingBox(a,o,n,s,u),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,u)}},{key:"updateBoundingBox",value:function(n,a,o,s,u){this._updateBoundingBox(n,a,o,s,u);var l=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(l)}},{key:"distanceToBorder",value:function(n,a){n&&this.resize(n);var o=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(a)),Math.abs(this.height/2/Math.sin(a)))+o}}]),e}(ni);function Xve(t){var i=Qve();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Qve(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Py=function(t){ce(e,t);var i=Xve(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o.labelOffset=0,o.selected=!1,o}return F(e,[{key:"setOptions",value:function(n,a,o){this.options=n,a===void 0&&o===void 0||this.setImages(a,o)}},{key:"setImages",value:function(n,a){a&&this.selected?(this.imageObj=a,this.imageObjAlt=n):(this.imageObj=n,this.imageObjAlt=a)}},{key:"switchImages",value:function(n){var a=n&&!this.selected||!n&&this.selected;if(this.selected=n,this.imageObjAlt!==void 0&&a){var o=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=o}}},{key:"_getImagePadding",value:function(){var n={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){var a=this.options.imagePadding;he(a)=="object"?(n.top=a.top,n.right=a.right,n.bottom=a.bottom,n.left=a.left):(n.top=a,n.right=a,n.bottom=a,n.left=a)}return n}},{key:"_resizeImage",value:function(){var n,a;if(this.options.shapeProperties.useImageSize===!1){var o=1,s=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?o=this.imageObj.width/this.imageObj.height:s=this.imageObj.height/this.imageObj.width),n=this.options.size*2*o,a=this.options.size*2*s}else{var u=this._getImagePadding();n=this.imageObj.width+u.left+u.right,a=this.imageObj.height+u.top+u.bottom}this.width=n,this.height=a,this.radius=.5*this.width}},{key:"_drawRawCircle",value:function(n,a,o,s){this.initContextForDraw(n,s),Gg(n,a,o,s.size),this.performFill(n,s)}},{key:"_drawImageAtPosition",value:function(n,a){if(this.imageObj.width!=0){n.globalAlpha=a.opacity!==void 0?a.opacity:1,this.enableShadow(n,a);var o=1;this.options.shapeProperties.interpolation===!0&&(o=this.imageObj.width/this.width/this.body.view.scale);var s=this._getImagePadding(),u=this.left+s.left,l=this.top+s.top,c=this.width-s.left-s.right,h=this.height-s.top-s.bottom;this.imageObj.drawImageAtPosition(n,o,u,l,c,h),this.disableShadow(n,a)}}},{key:"_drawImageLabel",value:function(n,a,o,s,u){var l=0;if(this.height!==void 0){l=this.height*.5;var c=this.labelModule.getTextSize(n,s,u);c.lineCount>=1&&(l+=c.height/2)}var h=o+l;this.options.label&&(this.labelOffset=l),this.labelModule.draw(n,a,h,s,u,"hanging")}}]),e}(ni);function Zve(t){var i=Jve();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Jve(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var epe=function(t){ce(e,t);var i=Zve(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o._setMargins(a),o}return F(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o),u=Math.max(s.width+this.margin.right+this.margin.left,s.height+this.margin.top+this.margin.bottom);this.options.size=u/2,this.width=u,this.height=u,this.radius=this.width/2}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this._drawRawCircle(n,a,o,l),this.updateBoundingBox(a,o),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,o,s,u)}},{key:"updateBoundingBox",value:function(n,a){this.boundingBox.top=a-this.options.size,this.boundingBox.left=n-this.options.size,this.boundingBox.right=n+this.options.size,this.boundingBox.bottom=a+this.options.size}},{key:"distanceToBorder",value:function(n){return n&&this.resize(n),this.width*.5}}]),e}(Py);function tpe(t){var i=rpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function rpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var npe=function(t){ce(e,t);var i=tpe(e);function e(r,n,a,o,s){var u;return N(this,e),u=i.call(this,r,n,a),u.setImages(o,s),u}return F(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0;if(s){var u=this.options.size*2;this.width=u,this.height=u,this.radius=.5*this.width;return}this.needsRefresh(a,o)&&this._resizeImage()}},{key:"draw",value:function(n,a,o,s,u,l){this.switchImages(s),this.resize();var c=a,h=o;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=a,this.top=o,c+=this.width/2,h+=this.height/2):(this.left=a-this.width/2,this.top=o-this.height/2),this._drawRawCircle(n,c,h,l),n.save(),n.clip(),this._drawImageAtPosition(n,l),n.restore(),this._drawImageLabel(n,c,h,s,u),this.updateBoundingBox(a,o)}},{key:"updateBoundingBox",value:function(n,a){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=a,this.boundingBox.left=n,this.boundingBox.right=n+this.options.size*2,this.boundingBox.bottom=a+this.options.size*2):(this.boundingBox.top=a-this.options.size,this.boundingBox.left=n-this.options.size,this.boundingBox.right=n+this.options.size,this.boundingBox.bottom=a+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(n){return n&&this.resize(n),this.width*.5}}]),e}(Py);function ipe(t){var i=ape();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function ape(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var gn=function(t){ce(e,t);var i=ipe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(a,o)){var u,l;this.labelModule.getTextSize(n,a,o);var c=2*s.size;this.width=(u=this.customSizeWidth)!==null&&u!==void 0?u:c,this.height=(l=this.customSizeHeight)!==null&&l!==void 0?l:c,this.radius=.5*this.width}}},{key:"_drawShape",value:function(n,a,o,s,u,l,c,h){var d=this;return this.resize(n,l,c,h),this.left=s-this.width/2,this.top=u-this.height/2,this.initContextForDraw(n,h),EX(a)(n,s,u,h.size),this.performFill(n,h),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(n.font=(l?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),n.fillStyle=this.options.icon.color||"black",n.textAlign="center",n.textBaseline="middle",n.fillText(this.options.icon.code,s,u)),{drawExternalLabel:function(){if(d.options.label!==void 0){d.labelModule.calculateLabelSize(n,l,c,s,u,"hanging");var v=u+.5*d.height+.5*d.labelModule.size.height;d.labelModule.draw(n,s,v,l,c,"hanging")}d.updateBoundingBox(s,u)}}}},{key:"updateBoundingBox",value:function(n,a){this.boundingBox.top=a-this.options.size,this.boundingBox.left=n-this.options.size,this.boundingBox.right=n+this.options.size,this.boundingBox.bottom=a+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}]),e}(ni);function S0(t,i){var e=Te(t);if(sn){var r=sn(t);i&&(r=St(r).call(r,function(n){return vn(t,n).enumerable})),e.push.apply(e,r)}return e}function ope(t){for(var i=1;i<arguments.length;i++){var e,r,n=arguments[i]!=null?arguments[i]:{};i%2?ge(e=S0(Object(n),!0)).call(e,function(a){Ml(t,a,n[a])}):un?Al(t,un(n)):ge(r=S0(Object(n))).call(r,function(a){Rl(t,a,vn(n,a))})}return t}function spe(t){var i=upe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function upe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var lpe=function(t){ce(e,t);var i=spe(e);function e(r,n,a,o){var s;return N(this,e),s=i.call(this,r,n,a,o),s.ctxRenderer=o,s}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u,l),this.left=a-this.width/2,this.top=o-this.height/2,n.save();var c=this.ctxRenderer({ctx:n,id:this.options.id,x:a,y:o,state:{selected:s,hover:u},style:ope({},l),label:this.options.label});if(c.drawNode!=null&&c.drawNode(),n.restore(),c.drawExternalLabel){var h=c.drawExternalLabel;c.drawExternalLabel=function(){n.save(),h(),n.restore()}}return c.nodeDimensions&&(this.customSizeWidth=c.nodeDimensions.width,this.customSizeHeight=c.nodeDimensions.height),c}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(gn);function cpe(t){var i=hpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function hpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var dpe=function(t){ce(e,t);var i=cpe(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o._setMargins(a),o}return F(e,[{key:"resize",value:function(n,a,o){if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o),u=s.width+this.margin.right+this.margin.left;this.width=u,this.height=u,this.radius=this.width/2}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this.initContextForDraw(n,l),sT(n,a-this.width/2,o-this.height/2,this.width,this.height),this.performFill(n,l),this.updateBoundingBox(a,o,n,s,u),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,u)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(ni);function fpe(t){var i=vpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function vpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var ppe=function(t){ce(e,t);var i=fpe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"diamond",4,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(gn);function gpe(t){var i=ype();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function ype(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var mpe=function(t){ce(e,t);var i=gpe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"circle",2,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n){return n&&this.resize(n),this.options.size}}]),e}(gn);function $pe(t){var i=bpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function bpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var O0=function(t){ce(e,t);var i=$pe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o);this.height=s.height*2,this.width=s.width+s.height,this.radius=.5*this.width}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width*.5,this.top=o-this.height*.5,this.initContextForDraw(n,l),iv(n,this.left,this.top,this.width,this.height),this.performFill(n,l),this.updateBoundingBox(a,o,n,s,u),this.labelModule.draw(n,a,o,s,u)}},{key:"distanceToBorder",value:function(n,a){n&&this.resize(n);var o=this.width*.5,s=this.height*.5,u=Math.sin(a)*o,l=Math.cos(a)*s;return o*s/Math.sqrt(u*u+l*l)}}]),e}(ni);function wpe(t){var i=_pe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function _pe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Epe=function(t){ce(e,t);var i=wpe(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o._setMargins(a),o}return F(e,[{key:"resize",value:function(n,a,o){this.needsRefresh(a,o)&&(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(n,a,o,s,u,l){var c=this;return this.resize(n,s,u),this.options.icon.size=this.options.icon.size||50,this.left=a-this.width/2,this.top=o-this.height/2,this._icon(n,a,o,s,u,l),{drawExternalLabel:function(){if(c.options.label!==void 0){var d=5;c.labelModule.draw(n,c.left+c.iconSize.width/2+c.margin.left,o+c.height/2+d,s)}c.updateBoundingBox(a,o)}}}},{key:"updateBoundingBox",value:function(n,a){if(this.boundingBox.top=a-this.options.icon.size*.5,this.boundingBox.left=n-this.options.icon.size*.5,this.boundingBox.right=n+this.options.icon.size*.5,this.boundingBox.bottom=a+this.options.icon.size*.5,this.options.label!==void 0&&this.labelModule.size.width>0){var o=5;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+o)}}},{key:"_icon",value:function(n,a,o,s,u,l){var c=Number(this.options.icon.size);this.options.icon.code!==void 0?(n.font=[this.options.icon.weight!=null?this.options.icon.weight:s?"bold":"",(this.options.icon.weight!=null&&s?5:0)+c+"px",this.options.icon.face].join(" "),n.fillStyle=this.options.icon.color||"black",n.textAlign="center",n.textBaseline="middle",this.enableShadow(n,l),n.fillText(this.options.icon.code,a,o),this.disableShadow(n,l)):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(n,a){return this._distanceToBorder(n,a)}}]),e}(ni);function Spe(t){var i=Ope();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Ope(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Tpe=function(t){ce(e,t);var i=Spe(e);function e(r,n,a,o,s){var u;return N(this,e),u=i.call(this,r,n,a),u.setImages(o,s),u}return F(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0;if(s){var u=this.options.size*2;this.width=u,this.height=u;return}this.needsRefresh(a,o)&&this._resizeImage()}},{key:"draw",value:function(n,a,o,s,u,l){n.save(),this.switchImages(s),this.resize();var c=a,h=o;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=a,this.top=o,c+=this.width/2,h+=this.height/2):(this.left=a-this.width/2,this.top=o-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){var d=this.options.borderWidth,f=this.options.borderWidthSelected||2*this.options.borderWidth,v=(s?f:d)/this.body.view.scale;n.lineWidth=Math.min(this.width,v),n.beginPath();var g=s?this.options.color.highlight.border:u?this.options.color.hover.border:this.options.color.border,b=s?this.options.color.highlight.background:u?this.options.color.hover.background:this.options.color.background;l.opacity!==void 0&&(g=jt(g,l.opacity),b=jt(b,l.opacity)),n.strokeStyle=g,n.fillStyle=b,n.rect(this.left-.5*n.lineWidth,this.top-.5*n.lineWidth,this.width+n.lineWidth,this.height+n.lineWidth),ts(n).call(n),this.performStroke(n,l),n.closePath()}this._drawImageAtPosition(n,l),this._drawImageLabel(n,c,h,s,u),this.updateBoundingBox(a,o),n.restore()}},{key:"updateBoundingBox",value:function(n,a){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=n,this.top=a):(this.left=n-this.width/2,this.top=a-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(Py);function xpe(t){var i=Ppe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Ppe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var kpe=function(t){ce(e,t);var i=xpe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"square",2,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(gn);function Ipe(t){var i=Cpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Cpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Ape=function(t){ce(e,t);var i=Ipe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"hexagon",4,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(gn);function Rpe(t){var i=Dpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Dpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Mpe=function(t){ce(e,t);var i=Rpe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"star",4,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(gn);function Npe(t){var i=Fpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Fpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Bpe=function(t){ce(e,t);var i=Npe(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o._setMargins(a),o}return F(e,[{key:"resize",value:function(n,a,o){this.needsRefresh(a,o)&&(this.textSize=this.labelModule.getTextSize(n,a,o),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(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this.enableShadow(n,l),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,u),this.disableShadow(n,l),this.updateBoundingBox(a,o,n,s,u)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(ni);function Lpe(t){var i=jpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function jpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var zpe=function(t){ce(e,t);var i=Lpe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"triangle",3,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(gn);function Hpe(t){var i=Wpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Wpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Vpe=function(t){ce(e,t);var i=Hpe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"triangleDown",3,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(gn);function T0(t,i){var e=Te(t);if(sn){var r=sn(t);i&&(r=St(r).call(r,function(n){return vn(t,n).enumerable})),e.push.apply(e,r)}return e}function x0(t){for(var i=1;i<arguments.length;i++){var e,r,n=arguments[i]!=null?arguments[i]:{};i%2?ge(e=T0(Object(n),!0)).call(e,function(a){Ml(t,a,n[a])}):un?Al(t,un(n)):ge(r=T0(Object(n))).call(r,function(a){Rl(t,a,vn(n,a))})}return t}var kt=function(){function t(i,e,r,n,a,o){N(this,t),this.options=tn(a),this.globalOptions=a,this.defaultOptions=o,this.body=e,this.edges=[],this.id=void 0,this.imagelist=r,this.grouplist=n,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new AP(this.body,this.options,!1),this.setOptions(i)}return F(t,[{key:"attachEdge",value:function(e){var r;ae(r=this.edges).call(r,e)===-1&&this.edges.push(e)}},{key:"detachEdge",value:function(e){var r,n=ae(r=this.edges).call(r,e);if(n!=-1){var a;Or(a=this.edges).call(a,n,1)}}},{key:"setOptions",value:function(e){var r=this.options.shape;if(e){if(typeof e.color<"u"&&(this._localColor=e.color),e.id!==void 0&&(this.id=e.id),this.id===void 0)throw new Error("Node must have an id");t.checkMass(e,this.id),e.x!==void 0&&(e.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=Xt(e.x),this.predefinedPosition=!0)),e.y!==void 0&&(e.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=Xt(e.y),this.predefinedPosition=!0)),e.size!==void 0&&(this.baseSize=e.size),e.value!==void 0&&(e.value=kP(e.value)),t.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);var n=[e,this.options,this.defaultOptions];return this.chooser=Oy("node",n),this._load_images(),this.updateLabelModule(e),e.opacity!==void 0&&t.checkOpacity(e.opacity)&&(this.options.opacity=e.opacity),this.updateShape(r),e.hidden!==void 0||e.physics!==void 0}}},{key:"_load_images",value:function(){if((this.options.shape==="circularImage"||this.options.shape==="image")&&this.options.image===void 0)throw new Error("Option image must be defined for node type '"+this.options.shape+"'");if(this.options.image!==void 0){if(this.imagelist===void 0)throw new Error("Internal Error: No images provided");if(typeof this.options.image=="string")this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(this.options.image.unselected===void 0)throw new Error("No unselected image provided");this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),this.options.image.selected!==void 0?this.imageObjAlt=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id):this.imageObjAlt=void 0}}}},{key:"getFormattingValues",value:function(){var e={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?this.chooser===!0?this.selected?(this.options.borderWidthSelected!=null?e.borderWidth=this.options.borderWidthSelected:e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser=="function"&&(this.chooser(e,this.options.id,this.selected,this.hover),e.shadow===!1&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){var r=this.options.opacity;e.borderColor=jt(e.borderColor,r),e.color=jt(e.color,r),e.shadowColor=jt(e.shadowColor,r)}return e}},{key:"updateLabelModule",value:function(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),t.updateGroupOptions(this.options,x0(x0({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);var r=this.grouplist.get(this.options.group,!1),n=[e,this.options,r,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,n),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateShape",value:function(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new Yve(this.options,this.body,this.labelModule);break;case"circle":this.shape=new epe(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new npe(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new lpe(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new dpe(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new ppe(this.options,this.body,this.labelModule);break;case"dot":this.shape=new mpe(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new O0(this.options,this.body,this.labelModule);break;case"icon":this.shape=new Epe(this.options,this.body,this.labelModule);break;case"image":this.shape=new Tpe(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new kpe(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new Ape(this.options,this.body,this.labelModule);break;case"star":this.shape=new Mpe(this.options,this.body,this.labelModule);break;case"text":this.shape=new Bpe(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new zpe(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new Vpe(this.options,this.body,this.labelModule);break;default:this.shape=new O0(this.options,this.body,this.labelModule);break}this.needsRefresh()}},{key:"select",value:function(){this.selected=!0,this.needsRefresh()}},{key:"unselect",value:function(){this.selected=!1,this.needsRefresh()}},{key:"needsRefresh",value:function(){this.shape.refreshNeeded=!0}},{key:"getTitle",value:function(){return this.options.title}},{key:"distanceToBorder",value:function(e,r){return this.shape.distanceToBorder(e,r)}},{key:"isFixed",value:function(){return this.options.fixed.x&&this.options.fixed.y}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"getLabelSize",value:function(){return this.labelModule.size()}},{key:"setValueRange",value:function(e,r,n){if(this.options.value!==void 0){var a=this.options.scaling.customScalingFunction(e,r,n,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+a*s}this.options.size=this.options.scaling.min+a*o}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}},{key:"draw",value:function(e){var r=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,r)||{}}},{key:"updateBoundingBox",value:function(e){this.shape.updateBoundingBox(this.x,this.y,e)}},{key:"resize",value:function(e){var r=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,r)}},{key:"getItemsOnPoint",value:function(e){var r=[];return this.labelModule.visible()&&Tp(this.labelModule.getSize(),e)&&r.push({nodeId:this.id,labelId:0}),Tp(this.shape.boundingBox,e)&&r.push({nodeId:this.id}),r}},{key:"isOverlappingWith",value:function(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}},{key:"isBoundingBoxOverlappingWith",value:function(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}}],[{key:"checkOpacity",value:function(e){return 0<=e&&e<=1}},{key:"checkCoordinateOrigin",value:function(e){return e===void 0||e==="center"||e==="top-left"}},{key:"updateGroupOptions",value:function(e,r,n){var a;if(n!==void 0){var o=e.group;if(r!==void 0&&r.group!==void 0&&o!==r.group)throw new Error("updateGroupOptions: group values in options don't match.");var s=typeof o=="number"||typeof o=="string"&&o!="";if(s){var u=n.get(o);u.opacity!==void 0&&r.opacity===void 0&&(t.checkOpacity(u.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+u.opacity),u.opacity=void 0));var l=St(a=Bfe(r)).call(a,function(c){return r[c]!=null});l.push("font"),Lu(l,e,u),e.color=pp(e.color)}}}},{key:"parseOptions",value:function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0,s=["color","fixed","shadow"];if(Lu(s,e,r,n),t.checkMass(r),e.opacity!==void 0&&(t.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),r.opacity!==void 0&&(t.checkOpacity(r.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+r.opacity),r.opacity=void 0)),r.shapeProperties&&!t.checkCoordinateOrigin(r.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+r.shapeProperties.coordinateOrigin),Lt(e,r,"shadow",a),r.color!==void 0&&r.color!==null){var u=pp(r.color);cP(e.color,u)}else n===!0&&r.color===null&&(e.color=tn(a.color));r.fixed!==void 0&&r.fixed!==null&&(typeof r.fixed=="boolean"?(e.fixed.x=r.fixed,e.fixed.y=r.fixed):(r.fixed.x!==void 0&&typeof r.fixed.x=="boolean"&&(e.fixed.x=r.fixed.x),r.fixed.y!==void 0&&typeof r.fixed.y=="boolean"&&(e.fixed.y=r.fixed.y))),n===!0&&r.font===null&&(e.font=tn(a.font)),t.updateGroupOptions(e,r,o),r.scaling!==void 0&&Lt(e.scaling,r.scaling,"label",a.scaling)}},{key:"checkMass",value:function(e,r){if(e.mass!==void 0&&e.mass<=0){var n="";r!==void 0&&(n=" in node id: "+r),console.error("%cNegative or zero mass disallowed"+n+", setting mass to 1.",vP),e.mass=1}}}]),t}();function Upe(t,i){var e=typeof pn<"u"&&Br(t)||t["@@iterator"];if(!e){if(ve(t)||(e=Gpe(t))||i&&t&&typeof t.length=="number"){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
94
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Gpe(t,i){var e;if(t){if(typeof t=="string")return P0(t,i);var r=st(e=Object.prototype.toString.call(t)).call(e,8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return ei(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P0(t,i)}}function P0(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,r=new Array(i);e<i;e++)r[e]=t[e];return r}var Kpe=function(){function t(i,e,r,n){var a,o=this;if(N(this,t),this.body=i,this.images=e,this.groups=r,this.layoutEngine=n,this.body.functions.createNode=A(a=this.create).call(a,this),this.nodesListeners={add:function(u,l){o.add(l.items)},update:function(u,l){o.update(l.items,l.data,l.oldData)},remove:function(u,l){o.remove(l.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(u,l,c,h){if(l===u)return .5;var d=1/(l-u);return Math.max(0,(h-u)*d)}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:"center"},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=tn(this.defaultOptions),this.bindEventListeners()}return F(t,[{key:"bindEventListeners",value:function(){var e,r,n=this;this.body.emitter.on("refreshNodes",A(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",A(r=this.refresh).call(r,this)),this.body.emitter.on("destroy",function(){ee(n.nodesListeners,function(a,o){n.body.data.nodes&&n.body.data.nodes.off(o,a)}),delete n.body.functions.createNode,delete n.nodesListeners.add,delete n.nodesListeners.update,delete n.nodesListeners.remove,delete n.nodesListeners})}},{key:"setOptions",value:function(e){if(e!==void 0){if(kt.parseOptions(this.options,e),e.opacity!==void 0&&(wp(e.opacity)||!xn(e.opacity)||e.opacity<0||e.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(var r in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,r)&&this.body.nodes[r].updateShape();if(typeof e.font<"u"||typeof e.widthConstraint<"u"||typeof e.heightConstraint<"u")for(var n=0,a=Te(this.body.nodes);n<a.length;n++){var o=a[n];this.body.nodes[o].updateLabelModule(),this.body.nodes[o].needsRefresh()}if(e.size!==void 0)for(var s in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,s)&&this.body.nodes[s].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.data.nodes;if(jO("id",e))this.body.data.nodes=e;else if(ve(e))this.body.data.nodes=new Iu,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new Iu;else throw new TypeError("Array or DataSet expected");if(n&&ee(this.nodesListeners,function(s,u){n.off(u,s)}),this.body.nodes={},this.body.data.nodes){var a=this;ee(this.nodesListeners,function(s,u){a.body.data.nodes.on(u,s)});var o=this.body.data.nodes.getIds();this.add(o,!0)}r===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n,a=[],o=0;o<e.length;o++){n=e[o];var s=this.body.data.nodes.get(n),u=this.create(s);a.push(u),this.body.nodes[n]=u}this.layoutEngine.positionInitially(a),r===!1&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e,r,n){for(var a=this.body.nodes,o=!1,s=0;s<e.length;s++){var u=e[s],l=a[u],c=r[s];l!==void 0?l.setOptions(c)&&(o=!0):(o=!0,l=this.create(c),a[u]=l)}!o&&n!==void 0&&(o=ffe(r).call(r,function(h,d){var f=n[d];return f&&f.level!==h.level})),o===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){for(var r=this.body.nodes,n=0;n<e.length;n++){var a=e[n];delete r[a]}this.body.emitter.emit("_dataChanged")}},{key:"create",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kt;return new r(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:"refresh",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;ee(this.body.nodes,function(n,a){var o=e.body.data.nodes.get(a);o!==void 0&&(r===!0&&n.setOptions({x:null,y:null}),n.setOptions({fixed:!1}),n.setOptions(o))})}},{key:"getPositions",value:function(e){var r={};if(e!==void 0){if(ve(e)===!0){for(var n=0;n<e.length;n++)if(this.body.nodes[e[n]]!==void 0){var a=this.body.nodes[e[n]];r[e[n]]={x:Math.round(a.x),y:Math.round(a.y)}}}else if(this.body.nodes[e]!==void 0){var o=this.body.nodes[e];r[e]={x:Math.round(o.x),y:Math.round(o.y)}}}else for(var s=0;s<this.body.nodeIndices.length;s++){var u=this.body.nodes[this.body.nodeIndices[s]];r[this.body.nodeIndices[s]]={x:Math.round(u.x),y:Math.round(u.y)}}return r}},{key:"getPosition",value:function(e){if(e==null)throw new TypeError("No id was specified for getPosition method.");if(this.body.nodes[e]==null)throw new ReferenceError("NodeId provided for getPosition does not exist. Provided: ".concat(e));return{x:Math.round(this.body.nodes[e].x),y:Math.round(this.body.nodes[e].y)}}},{key:"storePositions",value:function(){var e=[],r=this.body.data.nodes.getDataSet(),n=Upe(r.get()),a;try{for(n.s();!(a=n.n()).done;){var o=a.value,s=o.id,u=this.body.nodes[s],l=Math.round(u.x),c=Math.round(u.y);(o.x!==l||o.y!==c)&&e.push({id:s,x:l,y:c})}}catch(h){n.e(h)}finally{n.f()}r.update(e)}},{key:"getBoundingBox",value:function(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}},{key:"getConnectedNodes",value:function(e,r){var n=[];if(this.body.nodes[e]!==void 0)for(var a=this.body.nodes[e],o={},s=0;s<a.edges.length;s++){var u=a.edges[s];r!=="to"&&u.toId==a.id?o[u.fromId]===void 0&&(n.push(u.fromId),o[u.fromId]=!0):r!=="from"&&u.fromId==a.id&&o[u.toId]===void 0&&(n.push(u.toId),o[u.toId]=!0)}return n}},{key:"getConnectedEdges",value:function(e){var r=[];if(this.body.nodes[e]!==void 0)for(var n=this.body.nodes[e],a=0;a<n.edges.length;a++)r.push(n.edges[a].id);else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return r}},{key:"moveNode",value:function(e,r,n){var a=this;this.body.nodes[e]!==void 0?(this.body.nodes[e].x=Number(r),this.body.nodes[e].y=Number(n),pr(function(){a.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}}]),t}(),Lp={},qpe={get exports(){return Lp},set exports(t){Lp=t}},jp={},Ype={get exports(){return jp},set exports(t){jp=t}},k0=tt,Xpe=function(t){return t!==void 0&&(k0(t,"value")||k0(t,"writable"))},Qpe=q,Zpe=Mt,Jpe=et,ege=Ft,tge=Xpe,rge=aa,nge=El;function NP(t,i){var e=arguments.length<3?t:arguments[2],r,n;if(ege(t)===e)return t[i];if(r=rge.f(t,i),r)return tge(r)?r.value:r.get===void 0?void 0:Zpe(r.get,e);if(Jpe(n=nge(t)))return NP(n,i,e)}Qpe({target:"Reflect",stat:!0},{get:NP});var ige=ie,age=ige.Reflect.get,oge=age,sge=oge,uge=sge,lge=uge,cge=lge,hge=cge;(function(t){t.exports=hge})(Ype);(function(t){t.exports=jp})(qpe);var I0=V(Lp),zp={},dge={get exports(){return zp},set exports(t){zp=t}},Hp={},fge={get exports(){return Hp},set exports(t){Hp=t}},vge=ux,pge=vge,gge=pge,yge=gge;(function(t){t.exports=yge})(fge);(function(t){t.exports=Hp})(dge);var mge=V(zp);function $ge(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=z(t),t!==null););return t}function ou(){if(typeof Reflect<"u"&&I0){var t;ou=xy(t=I0).call(t)}else ou=function(e,r,n){var a=$ge(e,r);if(a){var o=mge(a,r);return o.get?o.get.call(arguments.length<3?e:n):o.value}};return ou.apply(this,arguments)}var Wp={},bge={get exports(){return Wp},set exports(t){Wp=t}},wge=q,C0=Math.hypot,_ge=Math.abs,Ege=Math.sqrt,Sge=!!C0&&C0(1/0,NaN)!==1/0;wge({target:"Math",stat:!0,arity:2,forced:Sge},{hypot:function(i,e){for(var r=0,n=0,a=arguments.length,o=0,s,u;n<a;)s=_ge(arguments[n++]),o<s?(u=o/s,r=r*u*u+1,o=s):s>0?(u=s/o,r+=u*u):r+=s;return o===1/0?1/0:o*Ege(r)}});var Oge=ie,Tge=Oge.Math.hypot,xge=Tge,Pge=xge;(function(t){t.exports=Pge})(bge);var kge=V(Wp);function FP(t){var i=Ige();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Ige(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Me=function(){function t(){N(this,t)}return F(t,null,[{key:"transform",value:function(e,r){ve(e)||(e=[e]);for(var n=r.point.x,a=r.point.y,o=r.angle,s=r.length,u=0;u<e.length;++u){var l=e[u],c=l.x*Math.cos(o)-l.y*Math.sin(o),h=l.x*Math.sin(o)+l.y*Math.cos(o);l.x=n+s*c,l.y=a+s*h}}},{key:"drawPath",value:function(e,r){e.beginPath(),e.moveTo(r[0].x,r[0].y);for(var n=1;n<r.length;++n)e.lineTo(r[n].x,r[n].y);e.closePath()}}]),t}(),Cge=function(t){ce(e,t);var i=FP(e);function e(){return N(this,e),i.apply(this,arguments)}return F(e,null,[{key:"draw",value:function(n,a){if(a.image){n.save(),n.translate(a.point.x,a.point.y),n.rotate(Math.PI/2+a.angle);var o=a.imageWidth!=null?a.imageWidth:a.image.width,s=a.imageHeight!=null?a.imageHeight:a.image.height;a.image.drawImageAtPosition(n,1,-o/2,0,o,s),n.restore()}return!1}}]),e}(Me),Age=function(t){ce(e,t);var i=FP(e);function e(){return N(this,e),i.apply(this,arguments)}return F(e,null,[{key:"draw",value:function(n,a){var o=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return Me.transform(o,a),Me.drawPath(n,o),!0}}]),e}(Me),Rge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return Me.transform(n,r),Me.drawPath(e,n),!0}}]),t}(),Dge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n={x:-.4,y:0};Me.transform(n,r),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";var a=Math.PI,o=r.angle-a/2,s=r.angle+a/2;return e.beginPath(),e.arc(n.x,n.y,r.length*.4,o,s,!1),e.stroke(),!0}}]),t}(),Mge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n={x:-.3,y:0};Me.transform(n,r),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";var a=Math.PI,o=r.angle+a/2,s=r.angle+3*a/2;return e.beginPath(),e.arc(n.x,n.y,r.length*.4,o,s,!1),e.stroke(),!0}}]),t}(),Nge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return Me.transform(n,r),Me.drawPath(e,n),!0}}]),t}(),Fge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return Me.transform(n,r),Me.drawPath(e,n),!0}}]),t}(),Bge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n={x:-.4,y:0};return Me.transform(n,r),Gg(e,n.x,n.y,r.length*.4),!0}}]),t}(),Lge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return Me.transform(n,r),Me.drawPath(e,n),!0}}]),t}(),jge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return Me.transform(n,r),Me.drawPath(e,n),!0}}]),t}(),zge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return Me.transform(n,r),Me.drawPath(e,n),!0}}]),t}(),Hge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return Me.transform(n,r),Me.drawPath(e,n),!0}}]),t}(),BP=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n;switch(r.type&&(n=r.type.toLowerCase()),n){case"image":return Cge.draw(e,r);case"circle":return Bge.draw(e,r);case"box":return jge.draw(e,r);case"crow":return Rge.draw(e,r);case"curve":return Dge.draw(e,r);case"diamond":return zge.draw(e,r);case"inv_curve":return Mge.draw(e,r);case"triangle":return Nge.draw(e,r);case"inv_triangle":return Fge.draw(e,r);case"bar":return Lge.draw(e,r);case"vee":return Hge.draw(e,r);case"arrow":default:return Age.draw(e,r)}}}]),t}();function A0(t,i){var e=Te(t);if(sn){var r=sn(t);i&&(r=St(r).call(r,function(n){return vn(t,n).enumerable})),e.push.apply(e,r)}return e}function R0(t){for(var i=1;i<arguments.length;i++){var e,r,n=arguments[i]!=null?arguments[i]:{};i%2?ge(e=A0(Object(n),!0)).call(e,function(a){Ml(t,a,n[a])}):un?Al(t,un(n)):ge(r=A0(Object(n))).call(r,function(a){Rl(t,a,vn(n,a))})}return t}var LP=function(){function t(i,e,r){N(this,t),this._body=e,this._labelModule=r,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(i),this.fromPoint=this.from,this.toPoint=this.to}return F(t,[{key:"connect",value:function(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}},{key:"cleanup",value:function(){return!1}},{key:"setOptions",value:function(e){this.options=e,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}},{key:"drawLine",value:function(e,r,n,a){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,r),e.lineWidth=r.width,r.dashes!==!1?this._drawDashedLine(e,r,o):this._drawLine(e,r,o)}},{key:"_drawLine",value:function(e,r,n,a,o){if(this.from!=this.to)this._line(e,r,n,a,o);else{var s=this._getCircleData(e),u=xe(s,3),l=u[0],c=u[1],h=u[2];this._circle(e,r,l,c,h)}}},{key:"_drawDashedLine",value:function(e,r,n,a,o){e.lineCap="round";var s=ve(r.dashes)?r.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(s),e.lineDashOffset=0,this.from!=this.to)this._line(e,r,n);else{var u=this._getCircleData(e),l=xe(u,3),c=l[0],h=l[1],d=l[2];this._circle(e,r,c,h,d)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)uT(e,this.from.x,this.from.y,this.to.x,this.to.y,s);else{var f=this._getCircleData(e),v=xe(f,3),g=v[0],b=v[1],p=v[2];this._circle(e,r,g,b,p)}this.enableShadow(e,r),e.stroke(),this.disableShadow(e,r)}}},{key:"findBorderPosition",value:function(e,r,n){return this.from!=this.to?this._findBorderPosition(e,r,n):this._findBorderPositionCircle(e,r,n)}},{key:"findBorderPositions",value:function(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};var r,n=st(r=this._getCircleData(e)).call(r,0,2),a=xe(n,2),o=a[0],s=a[1];return{from:this._findBorderPositionCircle(this.from,e,{x:o,y:s,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:o,y:s,low:.6,high:.8,direction:1})}}},{key:"_getCircleData",value:function(e){var r=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);var n=IP(e,this.options.selfReference.angle,r,this.from);return[n.x,n.y,r]}},{key:"_pointOnCircle",value:function(e,r,n,a){var o=a*2*Math.PI;return{x:e+n*Math.cos(o),y:r-n*Math.sin(o)}}},{key:"_findBorderPositionCircle",value:function(e,r,n){var a=n.x,o=n.y,s=n.low,u=n.high,l=n.direction,c=10,h=this.options.selfReference.size,d=.05,f,v=(s+u)*.5,g=0;this.options.arrowStrikethrough===!0&&(l===-1?g=this.options.endPointOffset.from:l===1&&(g=this.options.endPointOffset.to));var b=0;do{v=(s+u)*.5,f=this._pointOnCircle(a,o,h,v);var p=Math.atan2(e.y-f.y,e.x-f.x),$=e.distanceToBorder(r,p)+g,m=Math.sqrt(Math.pow(f.x-e.x,2)+Math.pow(f.y-e.y,2)),y=$-m;if(Math.abs(y)<d)break;y>0?l>0?s=v:u=v:l>0?u=v:s=v,++b}while(s<=u&&b<c);return R0(R0({},f),{},{t:v})}},{key:"getLineWidth",value:function(e,r){return e===!0?Math.max(this.selectionWidth,.3/this._body.view.scale):r===!0?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}},{key:"getColor",value:function(e,r){if(r.inheritsColor!==!1){if(r.inheritsColor==="both"&&this.from.id!==this.to.id){var n=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),a=this.from.options.color.highlight.border,o=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(a=jt(this.from.options.color.border,r.opacity),o=jt(this.to.options.color.border,r.opacity)):this.from.selected===!0&&this.to.selected===!1?o=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(a=this.from.options.color.border),n.addColorStop(0,a),n.addColorStop(1,o),n}return r.inheritsColor==="to"?jt(this.to.options.color.border,r.opacity):jt(this.from.options.color.border,r.opacity)}else return jt(r.color,r.opacity)}},{key:"_circle",value:function(e,r,n,a,o){this.enableShadow(e,r);var s=0,u=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){var l=this.options.selfReference.angle,c=this.options.selfReference.angle+Math.PI,h=this._findBorderPositionCircle(this.from,e,{x:n,y:a,low:l,high:c,direction:-1}),d=this._findBorderPositionCircle(this.from,e,{x:n,y:a,low:l,high:c,direction:1});s=Math.atan2(h.y-a,h.x-n),u=Math.atan2(d.y-a,d.x-n)}e.beginPath(),e.arc(n,a,o,s,u,!1),e.stroke(),this.disableShadow(e,r)}},{key:"getDistanceToEdge",value:function(e,r,n,a,o,s){if(this.from!=this.to)return this._getDistanceToEdge(e,r,n,a,o,s);var u=this._getCircleData(void 0),l=xe(u,3),c=l[0],h=l[1],d=l[2],f=c-o,v=h-s;return Math.abs(Math.sqrt(f*f+v*v)-d)}},{key:"_getDistanceToLine",value:function(e,r,n,a,o,s){var u=n-e,l=a-r,c=u*u+l*l,h=((o-e)*u+(s-r)*l)/c;h>1?h=1:h<0&&(h=0);var d=e+h*u,f=r+h*l,v=d-o,g=f-s;return Math.sqrt(v*v+g*g)}},{key:"getArrowData",value:function(e,r,n,a,o,s){var u,l,c,h,d,f,v,g=s.width;r==="from"?(c=this.from,h=this.to,d=s.fromArrowScale<0,f=Math.abs(s.fromArrowScale),v=s.fromArrowType):r==="to"?(c=this.to,h=this.from,d=s.toArrowScale<0,f=Math.abs(s.toArrowScale),v=s.toArrowType):(c=this.to,h=this.from,d=s.middleArrowScale<0,f=Math.abs(s.middleArrowScale),v=s.middleArrowType);var b=15*f+3*g;if(c!=h){var p=kge(c.x-h.x,c.y-h.y),$=b/p;if(r!=="middle")if(this.options.smooth.enabled===!0){var m=this._findBorderPosition(c,e,{via:n}),y=this.getPoint(m.t+$*(r==="from"?1:-1),n);u=Math.atan2(m.y-y.y,m.x-y.x),l=m}else u=Math.atan2(c.y-h.y,c.x-h.x),l=this._findBorderPosition(c,e);else{var w=(d?-$:$)/2,S=this.getPoint(.5+w,n),T=this.getPoint(.5-w,n);u=Math.atan2(S.y-T.y,S.x-T.x),l=this.getPoint(.5,n)}}else{var O=this._getCircleData(e),_=xe(O,3),E=_[0],I=_[1],j=_[2];if(r==="from"){var B=this.options.selfReference.angle,X=this.options.selfReference.angle+Math.PI,ne=this._findBorderPositionCircle(this.from,e,{x:E,y:I,low:B,high:X,direction:-1});u=ne.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,l=ne}else if(r==="to"){var re=this.options.selfReference.angle,le=this.options.selfReference.angle+Math.PI,we=this._findBorderPositionCircle(this.from,e,{x:E,y:I,low:re,high:le,direction:1});u=we.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,l=we}else{var Oe=this.options.selfReference.angle/(2*Math.PI);l=this._pointOnCircle(E,I,j,Oe),u=Oe*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}var ar=l.x-b*.9*Math.cos(u),nt=l.y-b*.9*Math.sin(u),_e={x:ar,y:nt};return{point:l,core:_e,angle:u,length:b,type:v}}},{key:"drawArrowHead",value:function(e,r,n,a,o){e.strokeStyle=this.getColor(e,r),e.fillStyle=e.strokeStyle,e.lineWidth=r.width;var s=BP.draw(e,o);s&&(this.enableShadow(e,r),ts(e).call(e),this.disableShadow(e,r))}},{key:"enableShadow",value:function(e,r){r.shadow===!0&&(e.shadowColor=r.shadowColor,e.shadowBlur=r.shadowSize,e.shadowOffsetX=r.shadowX,e.shadowOffsetY=r.shadowY)}},{key:"disableShadow",value:function(e,r){r.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"drawBackground",value:function(e,r){if(r.background!==!1){var n={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=r.backgroundColor,e.lineWidth=r.backgroundSize,this.setStrokeDashed(e,r.backgroundDashes),e.stroke(),e.strokeStyle=n.strokeStyle,e.lineWidth=n.lineWidth,e.dashes=n.dashes,this.setStrokeDashed(e,r.dashes)}}},{key:"setStrokeDashed",value:function(e,r){if(r!==!1)if(e.setLineDash!==void 0){var n=ve(r)?r:[5,5];e.setLineDash(n)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}]),t}();function D0(t,i){var e=Te(t);if(sn){var r=sn(t);i&&(r=St(r).call(r,function(n){return vn(t,n).enumerable})),e.push.apply(e,r)}return e}function M0(t){for(var i=1;i<arguments.length;i++){var e,r,n=arguments[i]!=null?arguments[i]:{};i%2?ge(e=D0(Object(n),!0)).call(e,function(a){Ml(t,a,n[a])}):un?Al(t,un(n)):ge(r=D0(Object(n))).call(r,function(a){Rl(t,a,vn(n,a))})}return t}function Wge(t){var i=Vge();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Vge(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var ky=function(t){ce(e,t);var i=Wge(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"_findBorderPositionBezier",value:function(n,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),s=10,u=.2,l=!1,c=1,h=0,d=this.to,f,v,g=this.options.endPointOffset?this.options.endPointOffset.to:0;n.id===this.from.id&&(d=this.from,l=!0,g=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(g=0);var b=0;do{v=(h+c)*.5,f=this.getPoint(v,o);var p=Math.atan2(d.y-f.y,d.x-f.x),$=d.distanceToBorder(a,p)+g,m=Math.sqrt(Math.pow(f.x-d.x,2)+Math.pow(f.y-d.y,2)),y=$-m;if(Math.abs(y)<u)break;y<0?l===!1?h=v:c=v:l===!1?c=v:h=v,++b}while(h<=c&&b<s);return M0(M0({},f),{},{t:v})}},{key:"_getDistanceToBezierEdge",value:function(n,a,o,s,u,l,c){var h=1e9,d,f,v,g,b,p=n,$=a;for(f=1;f<10;f++)v=.1*f,g=Math.pow(1-v,2)*n+2*v*(1-v)*c.x+Math.pow(v,2)*o,b=Math.pow(1-v,2)*a+2*v*(1-v)*c.y+Math.pow(v,2)*s,f>0&&(d=this._getDistanceToLine(p,$,g,b,u,l),h=d<h?d:h),p=g,$=b;return h}},{key:"_bezierCurve",value:function(n,a,o,s){n.beginPath(),n.moveTo(this.fromPoint.x,this.fromPoint.y),o!=null&&o.x!=null?s!=null&&s.x!=null?n.bezierCurveTo(o.x,o.y,s.x,s.y,this.toPoint.x,this.toPoint.y):n.quadraticCurveTo(o.x,o.y,this.toPoint.x,this.toPoint.y):n.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(n,a),this.enableShadow(n,a),n.stroke(),this.disableShadow(n,a)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}}]),e}(LP);function Uge(t){var i=Gge();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Gge(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var N0=function(t){ce(e,t);var i=Uge(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o.via=o.via,o._boundFunction=function(){o.positionBezierNode()},o._body.emitter.on("_repositionBezierNodes",o._boundFunction),o}return F(e,[{key:"setOptions",value:function(n){ou(z(e.prototype),"setOptions",this).call(this,n);var a=!1;this.options.physics!==n.physics&&(a=!0),this.options=n,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),a===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}},{key:"connect",value:function(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}},{key:"cleanup",value:function(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),this.via!==void 0?(delete this._body.nodes[this.via.id],this.via=void 0,!0):!1}},{key:"setupSupportNode",value:function(){if(this.via===void 0){var n="edgeId:"+this.id,a=this._body.functions.createNode({id:n,shape:"circle",physics:!0,hidden:!0});this._body.nodes[n]=a,this.via=a,this.via.parentEdgeId=this.id,this.positionBezierNode()}}},{key:"positionBezierNode",value:function(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}},{key:"_line",value:function(n,a,o){this._bezierCurve(n,a,o)}},{key:"_getViaCoordinates",value:function(){return this.via}},{key:"getViaNode",value:function(){return this.via}},{key:"getPoint",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){var o=this._getCircleData(),s=xe(o,3),u=s[0],l=s[1],c=s[2],h=2*Math.PI*(1-n);return{x:u+c*Math.sin(h),y:l+c-c*(1-Math.cos(h))}}else return{x:Math.pow(1-n,2)*this.fromPoint.x+2*n*(1-n)*a.x+Math.pow(n,2)*this.toPoint.x,y:Math.pow(1-n,2)*this.fromPoint.y+2*n*(1-n)*a.y+Math.pow(n,2)*this.toPoint.y}}},{key:"_findBorderPosition",value:function(n,a){return this._findBorderPositionBezier(n,a,this.via)}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){return this._getDistanceToBezierEdge(n,a,o,s,u,l,this.via)}}]),e}(ky);function Kge(t){var i=qge();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function qge(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var F0=function(t){ce(e,t);var i=Kge(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"_line",value:function(n,a,o){this._bezierCurve(n,a,o)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var n=this.options.smooth.roundness,a=this.options.smooth.type,o=Math.abs(this.from.x-this.to.x),s=Math.abs(this.from.y-this.to.y);if(a==="discrete"||a==="diagonalCross"){var u,l;o<=s?u=l=n*s:u=l=n*o,this.from.x>this.to.x&&(u=-u),this.from.y>=this.to.y&&(l=-l);var c=this.from.x+u,h=this.from.y+l;return a==="discrete"&&(o<=s?c=o<n*s?this.from.x:c:h=s<n*o?this.from.y:h),{x:c,y:h}}else if(a==="straightCross"){var d=(1-n)*o,f=(1-n)*s;return o<=s?(d=0,this.from.y<this.to.y&&(f=-f)):(this.from.x<this.to.x&&(d=-d),f=0),{x:this.to.x+d,y:this.to.y+f}}else if(a==="horizontal"){var v=(1-n)*o;return this.from.x<this.to.x&&(v=-v),{x:this.to.x+v,y:this.from.y}}else if(a==="vertical"){var g=(1-n)*s;return this.from.y<this.to.y&&(g=-g),{x:this.from.x,y:this.to.y+g}}else if(a==="curvedCW"){o=this.to.x-this.from.x,s=this.from.y-this.to.y;var b=Math.sqrt(o*o+s*s),p=Math.PI,$=Math.atan2(s,o),m=($+(n*.5+.5)*p)%(2*p);return{x:this.from.x+(n*.5+.5)*b*Math.sin(m),y:this.from.y+(n*.5+.5)*b*Math.cos(m)}}else if(a==="curvedCCW"){o=this.to.x-this.from.x,s=this.from.y-this.to.y;var y=Math.sqrt(o*o+s*s),w=Math.PI,S=Math.atan2(s,o),T=(S+(-n*.5+.5)*w)%(2*w);return{x:this.from.x+(n*.5+.5)*y*Math.sin(T),y:this.from.y+(n*.5+.5)*y*Math.cos(T)}}else{var O,_;o<=s?O=_=n*s:O=_=n*o,this.from.x>this.to.x&&(O=-O),this.from.y>=this.to.y&&(_=-_);var E=this.from.x+O,I=this.from.y+_;return o<=s?this.from.x<=this.to.x?E=this.to.x<E?this.to.x:E:E=this.to.x>E?this.to.x:E:this.from.y>=this.to.y?I=this.to.y>I?this.to.y:I:I=this.to.y<I?this.to.y:I,{x:E,y:I}}}},{key:"_findBorderPosition",value:function(n,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(n,a,o.via)}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){var c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(n,a,o,s,u,l,c)}},{key:"getPoint",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),o=n,s=Math.pow(1-o,2)*this.fromPoint.x+2*o*(1-o)*a.x+Math.pow(o,2)*this.toPoint.x,u=Math.pow(1-o,2)*this.fromPoint.y+2*o*(1-o)*a.y+Math.pow(o,2)*this.toPoint.y;return{x:s,y:u}}}]),e}(ky);function Yge(t){var i=Xge();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Xge(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Qge=function(t){ce(e,t);var i=Yge(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"_getDistanceToBezierEdge2",value:function(n,a,o,s,u,l,c,h){for(var d=1e9,f=n,v=a,g=[0,0,0,0],b=1;b<10;b++){var p=.1*b;g[0]=Math.pow(1-p,3),g[1]=3*p*Math.pow(1-p,2),g[2]=3*Math.pow(p,2)*(1-p),g[3]=Math.pow(p,3);var $=g[0]*n+g[1]*c.x+g[2]*h.x+g[3]*o,m=g[0]*a+g[1]*c.y+g[2]*h.y+g[3]*s;if(b>0){var y=this._getDistanceToLine(f,v,$,m,u,l);d=y<d?y:d}f=$,v=m}return d}}]),e}(ky);function Zge(t){var i=Jge();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Jge(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var B0=function(t){ce(e,t);var i=Zge(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"_line",value:function(n,a,o){var s=o[0],u=o[1];this._bezierCurve(n,a,s,u)}},{key:"_getViaCoordinates",value:function(){var n=this.from.x-this.to.x,a=this.from.y-this.to.y,o,s,u,l,c=this.options.smooth.roundness;return(Math.abs(n)>Math.abs(a)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(s=this.from.y,l=this.to.y,o=this.from.x-c*n,u=this.to.x+c*n):(s=this.from.y-c*a,l=this.to.y+c*a,o=this.from.x,u=this.to.x),[{x:o,y:s},{x:u,y:l}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(n,a){return this._findBorderPositionBezier(n,a)}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){var c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates(),h=xe(c,2),d=h[0],f=h[1];return this._getDistanceToBezierEdge2(n,a,o,s,u,l,d,f)}},{key:"getPoint",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),o=xe(a,2),s=o[0],u=o[1],l=n,c=[Math.pow(1-l,3),3*l*Math.pow(1-l,2),3*Math.pow(l,2)*(1-l),Math.pow(l,3)],h=c[0]*this.fromPoint.x+c[1]*s.x+c[2]*u.x+c[3]*this.toPoint.x,d=c[0]*this.fromPoint.y+c[1]*s.y+c[2]*u.y+c[3]*this.toPoint.y;return{x:h,y:d}}}]),e}(Qge);function eye(t){var i=tye();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function tye(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var L0=function(t){ce(e,t);var i=eye(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"_line",value:function(n,a){n.beginPath(),n.moveTo(this.fromPoint.x,this.fromPoint.y),n.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(n,a),n.stroke(),this.disableShadow(n,a)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(n){return{x:(1-n)*this.fromPoint.x+n*this.toPoint.x,y:(1-n)*this.fromPoint.y+n*this.toPoint.y}}},{key:"_findBorderPosition",value:function(n,a){var o=this.to,s=this.from;n.id===this.from.id&&(o=this.from,s=this.to);var u=Math.atan2(o.y-s.y,o.x-s.x),l=o.x-s.x,c=o.y-s.y,h=Math.sqrt(l*l+c*c),d=n.distanceToBorder(a,u),f=(h-d)/h;return{x:(1-f)*s.x+f*o.x,y:(1-f)*s.y+f*o.y,t:0}}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){return this._getDistanceToLine(n,a,o,s,u,l)}}]),e}(LP),Ci=function(){function t(i,e,r,n,a){if(N(this,t),e===void 0)throw new Error("No body provided");this.options=tn(n),this.globalOptions=n,this.defaultOptions=a,this.body=e,this.imagelist=r,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new AP(this.body,this.options,!0),this.setOptions(i)}return F(t,[{key:"setOptions",value:function(e){if(e){var r=typeof e.physics<"u"&&this.options.physics!==e.physics||typeof e.hidden<"u"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from<"u"&&this.options.from!==e.from||typeof e.to<"u"&&this.options.to!==e.to;t.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=kP(e.value));var n=[e,this.options,this.defaultOptions];return this.chooser=Oy("edge",n),this.updateLabelModule(e),r=this.updateEdgeType()||r,this._setInteractionWidths(),this.connect(),r}}},{key:"getFormattingValues",value:function(){var e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,r=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,n=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,a=this.options.color.inherit,o={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:n,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:r,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:a?void 0:this.options.color.color,inheritsColor:a,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(this.chooser===!0){if(this.selected){var s=this.options.selectionWidth;typeof s=="function"?o.width=s(o.width):typeof s=="number"&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.highlight,o.shadow=this.options.shadow.enabled}else if(this.hover){var u=this.options.hoverWidth;typeof u=="function"?o.width=u(o.width):typeof u=="number"&&(o.width+=u),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.hover,o.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(o,this.options.id,this.selected,this.hover),o.color!==void 0&&(o.inheritsColor=!1),o.shadow===!1&&(o.shadowColor!==this.options.shadow.color||o.shadowSize!==this.options.shadow.size||o.shadowX!==this.options.shadow.x||o.shadowY!==this.options.shadow.y)&&(o.shadow=!0));else o.shadow=this.options.shadow.enabled,o.width=Math.max(o.width,.3/this.body.view.scale);return o}},{key:"updateLabelModule",value:function(e){var r=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,r),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var e=this.options.smooth,r=!1,n=!0;return this.edgeType!==void 0&&((this.edgeType instanceof N0&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof B0&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof F0&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof L0&&e.type.enabled===!1)&&(n=!1),n===!0&&(r=this.cleanup())),n===!0?e.enabled===!0?e.type==="dynamic"?(r=!0,this.edgeType=new N0(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new B0(this.options,this.body,this.labelModule):this.edgeType=new F0(this.options,this.body,this.labelModule):this.edgeType=new L0(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),r}},{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=this.from!==void 0&&this.to!==void 0,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{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(e,r,n){if(this.options.value!==void 0){var a=this.options.scaling.customScalingFunction(e,r,n,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+a*s}this.options.width=this.options.scaling.min+a*o}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){typeof this.options.hoverWidth=="function"?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth=="function"?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}},{key:"draw",value:function(e){var r=this.getFormattingValues();if(!r.hidden){var n=this.edgeType.getViaNode();this.edgeType.drawLine(e,r,this.selected,this.hover,n),this.drawLabel(e,n)}}},{key:"drawArrows",value:function(e){var r=this.getFormattingValues();if(!r.hidden){var n=this.edgeType.getViaNode(),a={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,r.fromArrow&&(a.from=this.edgeType.getArrowData(e,"from",n,this.selected,this.hover,r),r.arrowStrikethrough===!1&&(this.edgeType.fromPoint=a.from.core),r.fromArrowSrc&&(a.from.image=this.imagelist.load(r.fromArrowSrc)),r.fromArrowImageWidth&&(a.from.imageWidth=r.fromArrowImageWidth),r.fromArrowImageHeight&&(a.from.imageHeight=r.fromArrowImageHeight)),r.toArrow&&(a.to=this.edgeType.getArrowData(e,"to",n,this.selected,this.hover,r),r.arrowStrikethrough===!1&&(this.edgeType.toPoint=a.to.core),r.toArrowSrc&&(a.to.image=this.imagelist.load(r.toArrowSrc)),r.toArrowImageWidth&&(a.to.imageWidth=r.toArrowImageWidth),r.toArrowImageHeight&&(a.to.imageHeight=r.toArrowImageHeight)),r.middleArrow&&(a.middle=this.edgeType.getArrowData(e,"middle",n,this.selected,this.hover,r),r.middleArrowSrc&&(a.middle.image=this.imagelist.load(r.middleArrowSrc)),r.middleArrowImageWidth&&(a.middle.imageWidth=r.middleArrowImageWidth),r.middleArrowImageHeight&&(a.middle.imageHeight=r.middleArrowImageHeight)),r.fromArrow&&this.edgeType.drawArrowHead(e,r,this.selected,this.hover,a.from),r.middleArrow&&this.edgeType.drawArrowHead(e,r,this.selected,this.hover,a.middle),r.toArrow&&this.edgeType.drawArrowHead(e,r,this.selected,this.hover,a.to)}}},{key:"drawLabel",value:function(e,r){if(this.options.label!==void 0){var n=this.from,a=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);var o;if(n.id!=a.id){this.labelModule.pointToSelf=!1,o=this.edgeType.getPoint(.5,r),e.save();var s=this._getRotation(e);s.angle!=0&&(e.translate(s.x,s.y),e.rotate(s.angle)),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;var u=IP(e,this.options.selfReference.angle,this.options.selfReference.size,n);o=this._pointOnCircle(u.x,u.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover)}}}},{key:"getItemsOnPoint",value:function(e){var r=[];if(this.labelModule.visible()){var n=this._getRotation();Tp(this.labelModule.getSize(),e,n)&&r.push({edgeId:this.id,labelId:0})}var a={left:e.x,top:e.y};return this.isOverlappingWith(a)&&r.push({edgeId:this.id}),r}},{key:"isOverlappingWith",value:function(e){if(this.connected){var r=10,n=this.from.x,a=this.from.y,o=this.to.x,s=this.to.y,u=e.left,l=e.top,c=this.edgeType.getDistanceToEdge(n,a,o,s,u,l);return c<r}else return!1}},{key:"_getRotation",value:function(e){var r=this.edgeType.getViaNode(),n=this.edgeType.getPoint(.5,r);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,n.x,n.y);var a={x:n.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return a;var o=this.from.y-this.to.y,s=this.from.x-this.to.x,u=Math.atan2(o,s);return(u<-1&&s<0||u>0&&s<0)&&(u+=Math.PI),a.angle=u,a}},{key:"_pointOnCircle",value:function(e,r,n,a){return{x:e+n*Math.cos(a),y:r-n*Math.sin(a)}}},{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 this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}}],[{key:"parseOptions",value:function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,s=["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"];if(pa(s,e,r,n),r.endPointOffset!==void 0&&r.endPointOffset.from!==void 0&&(xn(r.endPointOffset.from)?e.endPointOffset.from=r.endPointOffset.from:(e.endPointOffset.from=a.endPointOffset.from!==void 0?a.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),r.endPointOffset!==void 0&&r.endPointOffset.to!==void 0&&(xn(r.endPointOffset.to)?e.endPointOffset.to=r.endPointOffset.to:(e.endPointOffset.to=a.endPointOffset.to!==void 0?a.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),Hu(r.label)?e.label=r.label:Hu(e.label)||(e.label=void 0),Lt(e,r,"smooth",a),Lt(e,r,"shadow",a),Lt(e,r,"background",a),r.dashes!==void 0&&r.dashes!==null?e.dashes=r.dashes:n===!0&&r.dashes===null&&(e.dashes=Rn(a.dashes)),r.scaling!==void 0&&r.scaling!==null?(r.scaling.min!==void 0&&(e.scaling.min=r.scaling.min),r.scaling.max!==void 0&&(e.scaling.max=r.scaling.max),Lt(e.scaling,r.scaling,"label",a.scaling)):n===!0&&r.scaling===null&&(e.scaling=Rn(a.scaling)),r.arrows!==void 0&&r.arrows!==null)if(typeof r.arrows=="string"){var u=r.arrows.toLowerCase();e.arrows.to.enabled=ae(u).call(u,"to")!=-1,e.arrows.middle.enabled=ae(u).call(u,"middle")!=-1,e.arrows.from.enabled=ae(u).call(u,"from")!=-1}else if(he(r.arrows)==="object")Lt(e.arrows,r.arrows,"to",a.arrows),Lt(e.arrows,r.arrows,"middle",a.arrows),Lt(e.arrows,r.arrows,"from",a.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+es(r.arrows));else n===!0&&r.arrows===null&&(e.arrows=Rn(a.arrows));if(r.color!==void 0&&r.color!==null){var l=Kr(r.color)?{color:r.color,highlight:r.color,hover:r.color,inherit:!1,opacity:1}:r.color,c=e.color;if(o)$e(c,a.color,!1,n);else for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&delete c[h];if(Kr(c))c.color=c,c.highlight=c,c.hover=c,c.inherit=!1,l.opacity===void 0&&(c.opacity=1);else{var d=!1;l.color!==void 0&&(c.color=l.color,d=!0),l.highlight!==void 0&&(c.highlight=l.highlight,d=!0),l.hover!==void 0&&(c.hover=l.hover,d=!0),l.inherit!==void 0&&(c.inherit=l.inherit),l.opacity!==void 0&&(c.opacity=Math.min(1,Math.max(0,l.opacity))),d===!0?c.inherit=!1:c.inherit===void 0&&(c.inherit="from")}}else n===!0&&r.color===null&&(e.color=tn(a.color));n===!0&&r.font===null&&(e.font=tn(a.font)),Object.prototype.hasOwnProperty.call(r,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),e.selfReference.size=r.selfReferenceSize)}}]),t}(),rye=function(){function t(i,e,r){var n,a=this;N(this,t),this.body=i,this.images=e,this.groups=r,this.body.functions.createEdge=A(n=this.create).call(n,this),this.edgesListeners={add:function(s,u){a.add(u.items)},update:function(s,u){a.update(u.items)},remove:function(s,u){a.remove(u.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(s,u,l,c){if(u===s)return .5;var h=1/(u-s);return Math.max(0,(c-s)*h)}},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},$e(this.options,this.defaultOptions),this.bindEventListeners()}return F(t,[{key:"bindEventListeners",value:function(){var e=this,r,n;this.body.emitter.on("_forceDisableDynamicCurves",function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;a==="dynamic"&&(a="continuous");var s=!1;for(var u in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,u)){var l=e.body.edges[u],c=e.body.data.edges.get(u);if(c!=null){var h=c.smooth;h!==void 0&&h.enabled===!0&&h.type==="dynamic"&&(a===void 0?l.setOptions({smooth:!1}):l.setOptions({smooth:{type:a}}),s=!0)}}o===!0&&s===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",function(){e.reconnectEdges()}),this.body.emitter.on("refreshEdges",A(r=this.refresh).call(r,this)),this.body.emitter.on("refresh",A(n=this.refresh).call(n,this)),this.body.emitter.on("destroy",function(){ee(e.edgesListeners,function(a,o){e.body.data.edges&&e.body.data.edges.off(o,a)}),delete e.body.functions.createEdge,delete e.edgesListeners.add,delete e.edgesListeners.update,delete e.edgesListeners.remove,delete e.edgesListeners})}},{key:"setOptions",value:function(e){if(e!==void 0){Ci.parseOptions(this.options,e,!0,this.defaultOptions,!0);var r=!1;if(e.smooth!==void 0)for(var n in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,n)&&(r=this.body.edges[n].updateEdgeType()||r);if(e.font!==void 0)for(var a in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,a)&&this.body.edges[a].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||r===!0)&&this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var r=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.body.data.edges;if(jO("id",e))this.body.data.edges=e;else if(ve(e))this.body.data.edges=new Iu,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new Iu;else throw new TypeError("Array or DataSet expected");if(a&&ee(this.edgesListeners,function(s,u){a.off(u,s)}),this.body.edges={},this.body.data.edges){ee(this.edgesListeners,function(s,u){r.body.data.edges.on(u,s)});var o=this.body.data.edges.getIds();this.add(o,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),n===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.edges,a=this.body.data.edges,o=0;o<e.length;o++){var s=e[o],u=n[s];u&&u.disconnect();var l=a.get(s,{showInternalIds:!0});n[s]=this.create(l)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),r===!1&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e){for(var r=this.body.edges,n=this.body.data.edges,a=!1,o=0;o<e.length;o++){var s=e[o],u=n.get(s),l=r[s];l!==void 0?(l.disconnect(),a=l.setOptions(u)||a,l.connect()):(this.body.edges[s]=this.create(u),a=!0)}a===!0?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length!==0){var n=this.body.edges;ee(e,function(a){var o=n[a];o!==void 0&&o.remove()}),r&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var e=this;ee(this.body.edges,function(r,n){var a=e.body.data.edges.get(n);a!==void 0&&r.setOptions(a)})}},{key:"create",value:function(e){return new Ci(e,this.body,this.images,this.options,this.defaultOptions)}},{key:"reconnectEdges",value:function(){var e,r=this.body.nodes,n=this.body.edges;for(e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e].edges=[]);for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){var a=n[e];a.from=null,a.to=null,a.connect()}}},{key:"getConnectedNodes",value:function(e){var r=[];if(this.body.edges[e]!==void 0){var n=this.body.edges[e];n.fromId!==void 0&&r.push(n.fromId),n.toId!==void 0&&r.push(n.toId)}return r}},{key:"_updateState",value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:"_removeInvalidEdges",value:function(){var e=this,r=[];ee(this.body.edges,function(n,a){var o=e.body.nodes[n.toId],s=e.body.nodes[n.fromId];o!==void 0&&o.isCluster===!0||s!==void 0&&s.isCluster===!0||(o===void 0||s===void 0)&&r.push(a)}),this.remove(r,!1)}},{key:"_addMissingEdges",value:function(){var e=this.body.data.edges;if(e!=null){var r=this.body.edges,n=[];ge(e).call(e,function(a,o){var s=r[o];s===void 0&&n.push(o)}),this.add(n,!0)}}}]),t}(),jP=function(){function t(i,e,r){N(this,t),this.body=i,this.physicsBody=e,this.barnesHutTree,this.setOptions(r),this._rng=Ll("BARNES HUT SOLVER")}return F(t,[{key:"setOptions",value:function(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}},{key:"solve",value:function(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){var e,r=this.body.nodes,n=this.physicsBody.physicsNodeIndices,a=n.length,o=this._formBarnesHutTree(r,n);this.barnesHutTree=o;for(var s=0;s<a;s++)e=r[n[s]],e.options.mass>0&&this._getForceContributions(o.root,e)}}},{key:"_getForceContributions",value:function(e,r){this._getForceContribution(e.children.NW,r),this._getForceContribution(e.children.NE,r),this._getForceContribution(e.children.SW,r),this._getForceContribution(e.children.SE,r)}},{key:"_getForceContribution",value:function(e,r){if(e.childrenCount>0){var n=e.centerOfMass.x-r.x,a=e.centerOfMass.y-r.y,o=Math.sqrt(n*n+a*a);o*e.calcSize>this.thetaInversed?this._calculateForces(o,n,a,r,e):e.childrenCount===4?this._getForceContributions(e,r):e.children.data.id!=r.id&&this._calculateForces(o,n,a,r,e)}}},{key:"_calculateForces",value:function(e,r,n,a,o){e===0&&(e=.1,r=e),this.overlapAvoidanceFactor<1&&a.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*a.shape.radius,e-a.shape.radius));var s=this.options.gravitationalConstant*o.mass*a.options.mass/Math.pow(e,3),u=r*s,l=n*s;this.physicsBody.forces[a.id].x+=u,this.physicsBody.forces[a.id].y+=l}},{key:"_formBarnesHutTree",value:function(e,r){for(var n,a=r.length,o=e[r[0]].x,s=e[r[0]].y,u=e[r[0]].x,l=e[r[0]].y,c=1;c<a;c++){var h=e[r[c]],d=h.x,f=h.y;h.options.mass>0&&(d<o&&(o=d),d>u&&(u=d),f<s&&(s=f),f>l&&(l=f))}var v=Math.abs(u-o)-Math.abs(l-s);v>0?(s-=.5*v,l+=.5*v):(o+=.5*v,u-=.5*v);var g=1e-5,b=Math.max(g,Math.abs(u-o)),p=.5*b,$=.5*(o+u),m=.5*(s+l),y={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:$-p,maxX:$+p,minY:m-p,maxY:m+p},size:b,calcSize:1/b,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(y.root);for(var w=0;w<a;w++)n=e[r[w]],n.options.mass>0&&this._placeInTree(y.root,n);return y}},{key:"_updateBranchMass",value:function(e,r){var n=e.centerOfMass,a=e.mass+r.options.mass,o=1/a;n.x=n.x*e.mass+r.x*r.options.mass,n.x*=o,n.y=n.y*e.mass+r.y*r.options.mass,n.y*=o,e.mass=a;var s=Math.max(Math.max(r.height,r.radius),r.width);e.maxWidth=e.maxWidth<s?s:e.maxWidth}},{key:"_placeInTree",value:function(e,r,n){(n!=!0||n===void 0)&&this._updateBranchMass(e,r);var a=e.children.NW.range,o;a.maxX>r.x?a.maxY>r.y?o="NW":o="SW":a.maxY>r.y?o="NE":o="SE",this._placeInRegion(e,r,o)}},{key:"_placeInRegion",value:function(e,r,n){var a=e.children[n];switch(a.childrenCount){case 0:a.children.data=r,a.childrenCount=1,this._updateBranchMass(a,r);break;case 1:a.children.data.x===r.x&&a.children.data.y===r.y?(r.x+=this._rng(),r.y+=this._rng()):(this._splitBranch(a),this._placeInTree(a,r));break;case 4:this._placeInTree(a,r);break}}},{key:"_splitBranch",value:function(e){var r=null;e.childrenCount===1&&(r=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),r!=null&&this._placeInTree(e,r)}},{key:"_insertRegion",value:function(e,r){var n,a,o,s,u=.5*e.size;switch(r){case"NW":n=e.range.minX,a=e.range.minX+u,o=e.range.minY,s=e.range.minY+u;break;case"NE":n=e.range.minX+u,a=e.range.maxX,o=e.range.minY,s=e.range.minY+u;break;case"SW":n=e.range.minX,a=e.range.minX+u,o=e.range.minY+u,s=e.range.maxY;break;case"SE":n=e.range.minX+u,a=e.range.maxX,o=e.range.minY+u,s=e.range.maxY;break}e.children[r]={centerOfMass:{x:0,y:0},mass:0,range:{minX:n,maxX:a,minY:o,maxY:s},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}},{key:"_debug",value:function(e,r){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,r))}},{key:"_drawBranch",value:function(e,r,n){n===void 0&&(n="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,r),this._drawBranch(e.children.NE,r),this._drawBranch(e.children.SE,r),this._drawBranch(e.children.SW,r)),r.strokeStyle=n,r.beginPath(),r.moveTo(e.range.minX,e.range.minY),r.lineTo(e.range.maxX,e.range.minY),r.stroke(),r.beginPath(),r.moveTo(e.range.maxX,e.range.minY),r.lineTo(e.range.maxX,e.range.maxY),r.stroke(),r.beginPath(),r.moveTo(e.range.maxX,e.range.maxY),r.lineTo(e.range.minX,e.range.maxY),r.stroke(),r.beginPath(),r.moveTo(e.range.minX,e.range.maxY),r.lineTo(e.range.minX,e.range.minY),r.stroke()}}]),t}(),nye=function(){function t(i,e,r){N(this,t),this._rng=Ll("REPULSION SOLVER"),this.body=i,this.physicsBody=e,this.setOptions(r)}return F(t,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,r,n,a,o,s,u,l,c=this.body.nodes,h=this.physicsBody.physicsNodeIndices,d=this.physicsBody.forces,f=this.options.nodeDistance,v=-2/3/f,g=4/3,b=0;b<h.length-1;b++){u=c[h[b]];for(var p=b+1;p<h.length;p++)l=c[h[p]],e=l.x-u.x,r=l.y-u.y,n=Math.sqrt(e*e+r*r),n===0&&(n=.1*this._rng(),e=n),n<2*f&&(n<.5*f?s=1:s=v*n+g,s=s/n,a=e*s,o=r*s,d[u.id].x-=a,d[u.id].y-=o,d[l.id].x+=a,d[l.id].y+=o)}}}]),t}(),iye=function(){function t(i,e,r){N(this,t),this.body=i,this.physicsBody=e,this.setOptions(r)}return F(t,[{key:"setOptions",value:function(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}},{key:"solve",value:function(){for(var e=this.body.nodes,r=this.physicsBody.physicsNodeIndices,n=this.physicsBody.forces,a=this.options.nodeDistance,o=0;o<r.length-1;o++)for(var s=e[r[o]],u=o+1;u<r.length;u++){var l=e[r[u]];if(s.level===l.level){var c=a+this.overlapAvoidanceFactor*((s.shape.radius||0)/2+(l.shape.radius||0)/2),h=l.x-s.x,d=l.y-s.y,f=Math.sqrt(h*h+d*d),v=.05,g=void 0;f<c?g=-Math.pow(v*f,2)+Math.pow(v*c,2):g=0,f!==0&&(g=g/f);var b=h*g,p=d*g;n[s.id].x-=b,n[s.id].y-=p,n[l.id].x+=b,n[l.id].y+=p}}}}]),t}(),Qh=function(){function t(i,e,r){N(this,t),this.body=i,this.physicsBody=e,this.setOptions(r)}return F(t,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,r,n=this.physicsBody.physicsEdgeIndices,a=this.body.edges,o,s,u,l=0;l<n.length;l++)r=a[n[l]],r.connected===!0&&r.toId!==r.fromId&&this.body.nodes[r.toId]!==void 0&&this.body.nodes[r.fromId]!==void 0&&(r.edgeType.via!==void 0?(e=r.options.length===void 0?this.options.springLength:r.options.length,o=r.to,s=r.edgeType.via,u=r.from,this._calculateSpringForce(o,s,.5*e),this._calculateSpringForce(s,u,.5*e)):(e=r.options.length===void 0?this.options.springLength*1.5:r.options.length,this._calculateSpringForce(r.from,r.to,e)))}},{key:"_calculateSpringForce",value:function(e,r,n){var a=e.x-r.x,o=e.y-r.y,s=Math.max(Math.sqrt(a*a+o*o),.01),u=this.options.springConstant*(n-s)/s,l=a*u,c=o*u;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=l,this.physicsBody.forces[e.id].y+=c),this.physicsBody.forces[r.id]!==void 0&&(this.physicsBody.forces[r.id].x-=l,this.physicsBody.forces[r.id].y-=c)}}]),t}(),aye=function(){function t(i,e,r){N(this,t),this.body=i,this.physicsBody=e,this.setOptions(r)}return F(t,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,r,n,a,o,s,u,l,c=this.body.edges,h=.5,d=this.physicsBody.physicsEdgeIndices,f=this.physicsBody.physicsNodeIndices,v=this.physicsBody.forces,g=0;g<f.length;g++){var b=f[g];v[b].springFx=0,v[b].springFy=0}for(var p=0;p<d.length;p++)r=c[d[p]],r.connected===!0&&(e=r.options.length===void 0?this.options.springLength:r.options.length,n=r.from.x-r.to.x,a=r.from.y-r.to.y,l=Math.sqrt(n*n+a*a),l=l===0?.01:l,u=this.options.springConstant*(e-l)/l,o=n*u,s=a*u,r.to.level!=r.from.level?(v[r.toId]!==void 0&&(v[r.toId].springFx-=o,v[r.toId].springFy-=s),v[r.fromId]!==void 0&&(v[r.fromId].springFx+=o,v[r.fromId].springFy+=s)):(v[r.toId]!==void 0&&(v[r.toId].x-=h*o,v[r.toId].y-=h*s),v[r.fromId]!==void 0&&(v[r.fromId].x+=h*o,v[r.fromId].y+=h*s)));u=1;for(var $,m,y=0;y<f.length;y++){var w=f[y];$=Math.min(u,Math.max(-u,v[w].springFx)),m=Math.min(u,Math.max(-u,v[w].springFy)),v[w].x+=$,v[w].y+=m}for(var S=0,T=0,O=0;O<f.length;O++){var _=f[O];S+=v[_].x,T+=v[_].y}for(var E=S/f.length,I=T/f.length,j=0;j<f.length;j++){var B=f[j];v[B].x-=E,v[B].y-=I}}}]),t}(),su=function(){function t(i,e,r){N(this,t),this.body=i,this.physicsBody=e,this.setOptions(r)}return F(t,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,r,n,a,o=this.body.nodes,s=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces,l=0;l<s.length;l++){var c=s[l];a=o[c],e=-a.x,r=-a.y,n=Math.sqrt(e*e+r*r),this._calculateForces(n,e,r,u,a)}}},{key:"_calculateForces",value:function(e,r,n,a,o){var s=e===0?0:this.options.centralGravity/e;a[o.id].x=r*s,a[o.id].y=n*s}}]),t}();function oye(t){var i=sye();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function sye(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var uye=function(t){ce(e,t);var i=oye(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o._rng=Ll("FORCE ATLAS 2 BASED REPULSION SOLVER"),o}return F(e,[{key:"_calculateForces",value:function(n,a,o,s,u){n===0&&(n=.1*this._rng(),a=n),this.overlapAvoidanceFactor<1&&s.shape.radius&&(n=Math.max(.1+this.overlapAvoidanceFactor*s.shape.radius,n-s.shape.radius));var l=s.edges.length+1,c=this.options.gravitationalConstant*u.mass*s.options.mass*l/Math.pow(n,2),h=a*c,d=o*c;this.physicsBody.forces[s.id].x+=h,this.physicsBody.forces[s.id].y+=d}}]),e}(jP);function lye(t){var i=cye();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function cye(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var hye=function(t){ce(e,t);var i=lye(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"_calculateForces",value:function(n,a,o,s,u){if(n>0){var l=u.edges.length+1,c=this.options.centralGravity*l*u.options.mass;s[u.id].x=a*c,s[u.id].y=o*c}}}]),e}(su),dye=function(){function t(i){N(this,t),this.body=i,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}},je(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return F(t,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("initPhysics",function(){e.initPhysics()}),this.body.emitter.on("_layoutFailed",function(){e.layoutFailed=!0}),this.body.emitter.on("resetPhysics",function(){e.stopSimulation(),e.ready=!1}),this.body.emitter.on("disablePhysics",function(){e.physicsEnabled=!1,e.stopSimulation()}),this.body.emitter.on("restorePhysics",function(){e.setOptions(e.options),e.ready===!0&&e.startSimulation()}),this.body.emitter.on("startSimulation",function(){e.ready===!0&&e.startSimulation()}),this.body.emitter.on("stopSimulation",function(){e.stopSimulation()}),this.body.emitter.on("destroy",function(){e.stopSimulation(!1),e.body.emitter.off()}),this.body.emitter.on("_dataChanged",function(){e.updatePhysicsData()})}},{key:"setOptions",value:function(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,Lu(["stabilization"],this.options,e),Lt(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());var r=this.options.wind;r&&((typeof r.x!="number"||wp(r.x))&&(r.x=0),(typeof r.y!="number"||wp(r.y))&&(r.y=0)),this.timestep=this.options.timestep}this.init()}},{key:"init",value:function(){var e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new uye(this.body,this.physicsBody,e),this.edgesSolver=new Qh(this.body,this.physicsBody,e),this.gravitySolver=new hye(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new nye(this.body,this.physicsBody,e),this.edgesSolver=new Qh(this.body,this.physicsBody,e),this.gravitySolver=new su(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new iye(this.body,this.physicsBody,e),this.edgesSolver=new aye(this.body,this.physicsBody,e),this.gravitySolver=new su(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new jP(this.body,this.physicsBody,e),this.edgesSolver=new Qh(this.body,this.physicsBody,e),this.gravitySolver=new su(this.body,this.physicsBody,e)),this.modelOptions=e}},{key:"initPhysics",value:function(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}},{key:"startSimulation",value:function(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=A(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var e=Mu();this.physicsTick();var r=Mu()-e;(r<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&pr(function(){e.body.emitter.emit("stabilized",{iterations:r}),e.startedStabilization=!1,e.stabilizationIterations=0},0)}},{key:"physicsStep",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:"adjustTimeStep",value:function(){var e=1.2;this._evaluateStepQuality()===!0?this.timestep=e*this.timestep:this.timestep/e<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/e))}},{key:"physicsTick",value:function(){if(this._startStabilizing(),this.stabilized!==!0){if(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0){var e=this.adaptiveCounter%this.adaptiveInterval===0;e?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1}else this.timestep=this.options.timestep,this.physicsStep();this.stabilized===!0&&this.revert(),this.stabilizationIterations++}}},{key:"updatePhysicsData",value:function(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];var e=this.body.nodes,r=this.body.edges;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&e[n].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[n].id);for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&r[a].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(r[a].id);for(var o=0;o<this.physicsBody.physicsNodeIndices.length;o++){var s=this.physicsBody.physicsNodeIndices[o];this.physicsBody.forces[s]={x:0,y:0},this.physicsBody.velocities[s]===void 0&&(this.physicsBody.velocities[s]={x:0,y:0})}for(var u in this.physicsBody.velocities)e[u]===void 0&&delete this.physicsBody.velocities[u]}},{key:"revert",value:function(){var e=Te(this.previousStates),r=this.body.nodes,n=this.physicsBody.velocities;this.referenceState={};for(var a=0;a<e.length;a++){var o=e[a];r[o]!==void 0?r[o].options.physics===!0&&(this.referenceState[o]={positions:{x:r[o].x,y:r[o].y}},n[o].x=this.previousStates[o].vx,n[o].y=this.previousStates[o].vy,r[o].x=this.previousStates[o].x,r[o].y=this.previousStates[o].y):delete this.previousStates[o]}}},{key:"_evaluateStepQuality",value:function(){var e,r,n,a=this.body.nodes,o=this.referenceState,s=.3;for(var u in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,u)&&a[u]!==void 0&&(e=a[u].x-o[u].positions.x,r=a[u].y-o[u].positions.y,n=Math.sqrt(Math.pow(e,2)+Math.pow(r,2)),n>s))return!1;return!0}},{key:"moveNodes",value:function(){for(var e=this.physicsBody.physicsNodeIndices,r=0,n=0,a=5,o=0;o<e.length;o++){var s=e[o],u=this._performStep(s);r=Math.max(r,u),n+=u}this.adaptiveTimestepEnabled=n/e.length<a,this.stabilized=r<this.options.minVelocity}},{key:"calculateComponentVelocity",value:function(e,r,n){var a=this.modelOptions.damping*e,o=(r-a)/n;e+=o*this.timestep;var s=this.options.maxVelocity||1e9;return Math.abs(e)>s&&(e=e>0?s:-s),e}},{key:"_performStep",value:function(e){var r=this.body.nodes[e],n=this.physicsBody.forces[e];this.options.wind&&(n.x+=this.options.wind.x,n.y+=this.options.wind.y);var a=this.physicsBody.velocities[e];this.previousStates[e]={x:r.x,y:r.y,vx:a.x,vy:a.y},r.options.fixed.x===!1?(a.x=this.calculateComponentVelocity(a.x,n.x,r.options.mass),r.x+=a.x*this.timestep):(n.x=0,a.x=0),r.options.fixed.y===!1?(a.y=this.calculateComponentVelocity(a.y,n.y,r.options.mass),r.y+=a.y*this.timestep):(n.y=0,a.y=0);var o=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2));return o}},{key:"_freezeNodes",value:function(){var e=this.body.nodes;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&e[r].x&&e[r].y){var n=e[r].options.fixed;this.freezeCache[r]={x:n.x,y:n.y},n.x=!0,n.y=!0}}},{key:"_restoreFrozenNodes",value:function(){var e=this.body.nodes;for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.freezeCache[r]!==void 0&&(e[r].options.fixed.x=this.freezeCache[r].x,e[r].options.fixed.y=this.freezeCache[r].y);this.freezeCache={}}},{key:"stabilize",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof r!="number"&&(r=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",r)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=r,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,pr(function(){return e._stabilizationBatch()},0)}},{key:"_startStabilizing",value:function(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}},{key:"_stabilizationBatch",value:function(){var e=this,r=function(){return e.stabilized===!1&&e.stabilizationIterations<e.targetIterations},n=function(){e.body.emitter.emit("stabilizationProgress",{iterations:e.stabilizationIterations,total:e.targetIterations})};this._startStabilizing()&&n();for(var a=0;r()&&a<this.options.stabilization.updateInterval;)this.physicsTick(),a++;if(n(),r()){var o;pr(A(o=this._stabilizationBatch).call(o,this),0)}else this._finalizeStabilization()}},{key:"_finalizeStabilization",value:function(){this.body.emitter.emit("_allowRedraw"),this.options.stabilization.fit===!0&&this.body.emitter.emit("fit"),this.options.stabilization.onlyDynamicEdges===!0&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),this.stabilized===!0?this._emitStabilized():this.startSimulation(),this.ready=!0}},{key:"_drawForces",value:function(e){for(var r=0;r<this.physicsBody.physicsNodeIndices.length;r++){var n=this.physicsBody.physicsNodeIndices[r],a=this.body.nodes[n],o=this.physicsBody.forces[n],s=20,u=.03,l=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.x,2)),c=Math.min(Math.max(5,l),15),h=3*c,d=gp((180-Math.min(1,Math.max(0,u*l))*180)/360,1,1),f={x:a.x+s*o.x,y:a.y+s*o.y};e.lineWidth=c,e.strokeStyle=d,e.beginPath(),e.moveTo(a.x,a.y),e.lineTo(f.x,f.y),e.stroke();var v=Math.atan2(o.y,o.x);e.fillStyle=d,BP.draw(e,{type:"arrow",point:f,angle:v,length:h}),ts(e).call(e)}}}]),t}();let js;const fye=new Uint8Array(16);function vye(){if(!js&&(js=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!js))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return js(fye)}const at=[];for(let t=0;t<256;++t)at.push((t+256).toString(16).slice(1));function pye(t,i=0){return(at[t[i+0]]+at[t[i+1]]+at[t[i+2]]+at[t[i+3]]+"-"+at[t[i+4]]+at[t[i+5]]+"-"+at[t[i+6]]+at[t[i+7]]+"-"+at[t[i+8]]+at[t[i+9]]+"-"+at[t[i+10]]+at[t[i+11]]+at[t[i+12]]+at[t[i+13]]+at[t[i+14]]+at[t[i+15]]).toLowerCase()}const gye=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var j0={randomUUID:gye};function Ba(t,i,e){if(j0.randomUUID&&!i&&!t)return j0.randomUUID();t=t||{};const r=t.random||(t.rng||vye)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,i){e=e||0;for(let n=0;n<16;++n)i[e+n]=r[n];return i}return pye(r)}var dt=function(){function t(){N(this,t)}return F(t,null,[{key:"getRange",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=1e9,a=-1e9,o=1e9,s=-1e9,u;if(r.length>0)for(var l=0;l<r.length;l++)u=e[r[l]],o>u.shape.boundingBox.left&&(o=u.shape.boundingBox.left),s<u.shape.boundingBox.right&&(s=u.shape.boundingBox.right),n>u.shape.boundingBox.top&&(n=u.shape.boundingBox.top),a<u.shape.boundingBox.bottom&&(a=u.shape.boundingBox.bottom);return o===1e9&&s===-1e9&&n===1e9&&a===-1e9&&(n=0,a=0,o=0,s=0),{minX:o,maxX:s,minY:n,maxY:a}}},{key:"getRangeCore",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=1e9,a=-1e9,o=1e9,s=-1e9,u;if(r.length>0)for(var l=0;l<r.length;l++)u=e[r[l]],o>u.x&&(o=u.x),s<u.x&&(s=u.x),n>u.y&&(n=u.y),a<u.y&&(a=u.y);return o===1e9&&s===-1e9&&n===1e9&&a===-1e9&&(n=0,a=0,o=0,s=0),{minX:o,maxX:s,minY:n,maxY:a}}},{key:"findCenter",value:function(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}},{key:"cloneOptions",value:function(e,r){var n={};return r===void 0||r==="node"?($e(n,e.options,!0),n.x=e.x,n.y=e.y,n.amountOfConnections=e.edges.length):$e(n,e.options,!0),n}}]),t}();function yye(t){var i=mye();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function mye(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var $ye=function(t){ce(e,t);var i=yye(e);function e(r,n,a,o,s,u){var l;return N(this,e),l=i.call(this,r,n,a,o,s,u),l.isCluster=!0,l.containedNodes={},l.containedEdges={},l}return F(e,[{key:"_openChildCluster",value:function(n){var a=this,o=this.body.nodes[n];if(this.containedNodes[n]===void 0)throw new Error("node with id: "+n+" not in current cluster");if(!o.isCluster)throw new Error("node with id: "+n+" is not a cluster");delete this.containedNodes[n],ee(o.edges,function(s){delete a.containedEdges[s.id]}),ee(o.containedNodes,function(s,u){a.containedNodes[u]=s}),o.containedNodes={},ee(o.containedEdges,function(s,u){a.containedEdges[u]=s}),o.containedEdges={},ee(o.edges,function(s){ee(a.edges,function(u){var l,c,h=ae(l=u.clusteringEdgeReplacingIds).call(l,s.id);h!==-1&&(ee(s.clusteringEdgeReplacingIds,function(d){u.clusteringEdgeReplacingIds.push(d),a.body.edges[d].edgeReplacedById=u.id}),Or(c=u.clusteringEdgeReplacingIds).call(c,h,1))})}),o.edges=[]}}]),e}(kt),bye=function(){function t(i){var e=this;N(this,t),this.body=i,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},je(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){e.clusteredNodes={},e.clusteredEdges={}})}return F(t,[{key:"clusterByHubsize",value:function(e,r){e===void 0?e=this._getHubSize():he(e)==="object"&&(r=this._checkOptions(e),e=this._getHubSize());for(var n=[],a=0;a<this.body.nodeIndices.length;a++){var o=this.body.nodes[this.body.nodeIndices[a]];o.edges.length>=e&&n.push(o.id)}for(var s=0;s<n.length;s++)this.clusterByConnection(n[s],r,!0);this.body.emitter.emit("_dataChanged")}},{key:"cluster",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(r.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");r=this._checkOptions(r);var a={},o={};ee(this.body.nodes,function(s,u){s.options&&r.joinCondition(s.options)===!0&&(a[u]=s,ee(s.edges,function(l){e.clusteredEdges[l.id]===void 0&&(o[l.id]=l)}))}),this._cluster(a,o,r,n)}},{key:"clusterByEdgeCount",value:function(e,r){var n=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;r=this._checkOptions(r);for(var o=[],s={},u,l,c,h=function(){var g={},b={},p=n.body.nodeIndices[d],$=n.body.nodes[p];if(s[p]===void 0){c=0,l=[];for(var m=0;m<$.edges.length;m++)u=$.edges[m],n.clusteredEdges[u.id]===void 0&&(u.toId!==u.fromId&&c++,l.push(u));if(c===e){for(var y=function(B){if(r.joinCondition===void 0||r.joinCondition===null)return!0;var X=dt.cloneOptions(B);return r.joinCondition(X)},w=!0,S=0;S<l.length;S++){u=l[S];var T=n._getConnectedId(u,p);if(y($))b[u.id]=u,g[p]=$,g[T]=n.body.nodes[T],s[p]=!0;else{w=!1;break}}if(Te(g).length>0&&Te(b).length>0&&w===!0){var O=function(){for(var B=0;B<o.length;++B)for(var X in g)if(o[B].nodes[X]!==void 0)return o[B]},_=O();if(_!==void 0){for(var E in g)_.nodes[E]===void 0&&(_.nodes[E]=g[E]);for(var I in b)_.edges[I]===void 0&&(_.edges[I]=b[I])}else o.push({nodes:g,edges:b})}}}},d=0;d<this.body.nodeIndices.length;d++)h();for(var f=0;f<o.length;f++)this._cluster(o[f].nodes,o[f].edges,r,!1);a===!0&&this.body.emitter.emit("_dataChanged")}},{key:"clusterOutliers",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,r)}},{key:"clusterBridges",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,r)}},{key:"clusterByConnection",value:function(e,r){var n,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");var o=this.body.nodes[e];r=this._checkOptions(r,o),r.clusterNodeProperties.x===void 0&&(r.clusterNodeProperties.x=o.x),r.clusterNodeProperties.y===void 0&&(r.clusterNodeProperties.y=o.y),r.clusterNodeProperties.fixed===void 0&&(r.clusterNodeProperties.fixed={},r.clusterNodeProperties.fixed.x=o.options.fixed.x,r.clusterNodeProperties.fixed.y=o.options.fixed.y);var s={},u={},l=o.id,c=dt.cloneOptions(o);s[l]=o;for(var h=0;h<o.edges.length;h++){var d=o.edges[h];if(this.clusteredEdges[d.id]===void 0){var f=this._getConnectedId(d,l);if(this.clusteredNodes[f]===void 0)if(f!==l)if(r.joinCondition===void 0)u[d.id]=d,s[f]=this.body.nodes[f];else{var v=dt.cloneOptions(this.body.nodes[f]);r.joinCondition(c,v)===!0&&(u[d.id]=d,s[f]=this.body.nodes[f])}else u[d.id]=d}}var g=ji(n=Te(s)).call(n,function(y){return s[y].id});for(var b in s)if(Object.prototype.hasOwnProperty.call(s,b))for(var p=s[b],$=0;$<p.edges.length;$++){var m=p.edges[$];ae(g).call(g,this._getConnectedId(m,p.id))>-1&&(u[m.id]=m)}this._cluster(s,u,r,a)}},{key:"_createClusterEdges",value:function(e,r,n,a){for(var o,s,u,l,c,h,d=Te(e),f=[],v=0;v<d.length;v++){s=d[v],u=e[s];for(var g=0;g<u.edges.length;g++)o=u.edges[g],this.clusteredEdges[o.id]===void 0&&(o.toId==o.fromId?r[o.id]=o:o.toId==s?(l=n.id,c=o.fromId,h=c):(l=o.toId,c=n.id,h=l),e[h]===void 0&&f.push({edge:o,fromId:c,toId:l}))}for(var b=[],p=function(T){for(var O=0;O<b.length;O++){var _=b[O],E=T.fromId===_.fromId&&T.toId===_.toId,I=T.fromId===_.toId&&T.toId===_.fromId;if(E||I)return _}return null},$=0;$<f.length;$++){var m=f[$],y=m.edge,w=p(m);w===null?(w=this._createClusteredEdge(m.fromId,m.toId,y,a),b.push(w)):w.clusteringEdgeReplacingIds.push(y.id),this.body.edges[y.id].edgeReplacedById=w.id,this._backupEdgeOptions(y),y.setOptions({physics:!1})}}},{key:"_checkOptions",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}},{key:"_cluster",value:function(e,r,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&this.clusteredNodes[s]!==void 0&&o.push(s);for(var u=0;u<o.length;++u)delete e[o[u]];if(Te(e).length!=0&&!(Te(e).length==1&&n.clusterNodeProperties.allowSingleNodeCluster!=!0)){var l=$e({},n.clusterNodeProperties);if(n.processProperties!==void 0){var c=[];for(var h in e)if(Object.prototype.hasOwnProperty.call(e,h)){var d=dt.cloneOptions(e[h]);c.push(d)}var f=[];for(var v in r)if(Object.prototype.hasOwnProperty.call(r,v)&&v.substr(0,12)!=="clusterEdge:"){var g=dt.cloneOptions(r[v],"edge");f.push(g)}if(l=n.processProperties(l,c,f),!l)throw new Error("The processProperties function does not return properties!")}l.id===void 0&&(l.id="cluster:"+Ba());var b=l.id;l.label===void 0&&(l.label="cluster");var p=void 0;l.x===void 0&&(p=this._getClusterPosition(e),l.x=p.x),l.y===void 0&&(p===void 0&&(p=this._getClusterPosition(e)),l.y=p.y),l.id=b;var $=this.body.functions.createNode(l,$ye);$.containedNodes=e,$.containedEdges=r,$.clusterEdgeProperties=n.clusterEdgeProperties,this.body.nodes[l.id]=$,this._clusterEdges(e,r,l,n.clusterEdgeProperties),l.id=void 0,a===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}},{key:"_restoreEdge",value:function(e){var r=this.clusteredEdges[e.id];r!==void 0&&(e.setOptions({physics:r.physics}),delete this.clusteredEdges[e.id])}},{key:"isCluster",value:function(e){return this.body.nodes[e]!==void 0?this.body.nodes[e].isCluster===!0:(console.error("Node does not exist."),!1)}},{key:"_getClusterPosition",value:function(e){for(var r=Te(e),n=e[r[0]].x,a=e[r[0]].x,o=e[r[0]].y,s=e[r[0]].y,u,l=1;l<r.length;l++)u=e[r[l]],n=u.x<n?u.x:n,a=u.x>a?u.x:a,o=u.y<o?u.y:o,s=u.y>s?u.y:s;return{x:.5*(n+a),y:.5*(o+s)}}},{key:"openCluster",value:function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");var a=this.body.nodes[e];if(a===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(a.isCluster!==!0||a.containedNodes===void 0||a.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");var o=this.findNode(e),s=ae(o).call(o,e)-1;if(s>=0){var u=o[s],l=this.body.nodes[u];l._openChildCluster(e),delete this.body.nodes[e],n===!0&&this.body.emitter.emit("_dataChanged");return}var c=a.containedNodes,h=a.containedEdges;if(r!==void 0&&r.releaseFunction!==void 0&&typeof r.releaseFunction=="function"){var d={},f={x:a.x,y:a.y};for(var v in c)if(Object.prototype.hasOwnProperty.call(c,v)){var g=this.body.nodes[v];d[v]={x:g.x,y:g.y}}var b=r.releaseFunction(f,d);for(var p in c)if(Object.prototype.hasOwnProperty.call(c,p)){var $=this.body.nodes[p];b[p]!==void 0&&($.x=b[p].x===void 0?a.x:b[p].x,$.y=b[p].y===void 0?a.y:b[p].y)}}else ee(c,function(we){we.options.fixed.x===!1&&(we.x=a.x),we.options.fixed.y===!1&&(we.y=a.y)});for(var m in c)if(Object.prototype.hasOwnProperty.call(c,m)){var y=this.body.nodes[m];y.vx=a.vx,y.vy=a.vy,y.setOptions({physics:!0}),delete this.clusteredNodes[m]}for(var w=[],S=0;S<a.edges.length;S++)w.push(a.edges[S]);for(var T=0;T<w.length;T++){for(var O=w[T],_=this._getConnectedId(O,e),E=this.clusteredNodes[_],I=0;I<O.clusteringEdgeReplacingIds.length;I++){var j=O.clusteringEdgeReplacingIds[I],B=this.body.edges[j];if(B!==void 0)if(E!==void 0){var X=this.body.nodes[E.clusterId];X.containedEdges[B.id]=B,delete h[B.id];var ne=B.fromId,re=B.toId;B.toId==_?re=E.clusterId:ne=E.clusterId,this._createClusteredEdge(ne,re,B,X.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(B)}O.remove()}for(var le in h)Object.prototype.hasOwnProperty.call(h,le)&&this._restoreEdge(h[le]);delete this.body.nodes[e],n===!0&&this.body.emitter.emit("_dataChanged")}},{key:"getNodesInCluster",value:function(e){var r=[];if(this.isCluster(e)===!0){var n=this.body.nodes[e].containedNodes;for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&r.push(this.body.nodes[a].id)}return r}},{key:"findNode",value:function(e){for(var r=[],n=100,a=0,o;this.clusteredNodes[e]!==void 0&&a<n;){if(o=this.body.nodes[e],o===void 0)return[];r.push(o.id),e=this.clusteredNodes[e].clusterId,a++}return o=this.body.nodes[e],o===void 0?[]:(r.push(o.id),An(r).call(r),r)}},{key:"updateClusteredNode",value:function(e,r){if(e===void 0)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(r===void 0)throw new Error("No newOptions supplied to updateClusteredNode.");if(this.body.nodes[e]===void 0)throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[e].setOptions(r),this.body.emitter.emit("_dataChanged")}},{key:"updateEdge",value:function(e,r){if(e===void 0)throw new Error("No startEdgeId supplied to updateEdge.");if(r===void 0)throw new Error("No newOptions supplied to updateEdge.");if(this.body.edges[e]===void 0)throw new Error("The startEdgeId supplied to updateEdge does not exist.");for(var n=this.getClusteredEdges(e),a=0;a<n.length;a++){var o=this.body.edges[n[a]];o.setOptions(r)}this.body.emitter.emit("_dataChanged")}},{key:"getClusteredEdges",value:function(e){for(var r=[],n=100,a=0;e!==void 0&&this.body.edges[e]!==void 0&&a<n;)r.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,a++;return An(r).call(r),r}},{key:"getBaseEdge",value:function(e){return this.getBaseEdges(e)[0]}},{key:"getBaseEdges",value:function(e){for(var r=[e],n=[],a=[],o=100,s=0;r.length>0&&s<o;){var u=r.pop();if(u!==void 0){var l=this.body.edges[u];if(l!==void 0){s++;var c=l.clusteringEdgeReplacingIds;if(c===void 0)a.push(u);else for(var h=0;h<c.length;++h){var d=c[h];ae(r).call(r,c)!==-1||ae(n).call(n,c)!==-1||r.push(d)}n.push(u)}}}return a}},{key:"_getConnectedId",value:function(e,r){return e.toId!=r?e.toId:(e.fromId!=r,e.fromId)}},{key:"_getHubSize",value:function(){for(var e=0,r=0,n=0,a=0,o=0;o<this.body.nodeIndices.length;o++){var s=this.body.nodes[this.body.nodeIndices[o]];s.edges.length>a&&(a=s.edges.length),e+=s.edges.length,r+=Math.pow(s.edges.length,2),n+=1}e=e/n,r=r/n;var u=r-Math.pow(e,2),l=Math.sqrt(u),c=Math.floor(e+2*l);return c>a&&(c=a),c}},{key:"_createClusteredEdge",value:function(e,r,n,a,o){var s=dt.cloneOptions(n,"edge");$e(s,a),s.from=e,s.to=r,s.id="clusterEdge:"+Ba(),o!==void 0&&$e(s,o);var u=this.body.functions.createEdge(s);return u.clusteringEdgeReplacingIds=[n.id],u.connect(),this.body.edges[u.id]=u,u}},{key:"_clusterEdges",value:function(e,r,n,a){if(r instanceof Ci){var o=r,s={};s[o.id]=o,r=s}if(e instanceof kt){var u=e,l={};l[u.id]=u,e=l}if(n==null)throw new Error("_clusterEdges: parameter clusterNode required");a===void 0&&(a=n.clusterEdgeProperties),this._createClusterEdges(e,r,n,a);for(var c in r)if(Object.prototype.hasOwnProperty.call(r,c)&&this.body.edges[c]!==void 0){var h=this.body.edges[c];this._backupEdgeOptions(h),h.setOptions({physics:!1})}for(var d in e)Object.prototype.hasOwnProperty.call(e,d)&&(this.clusteredNodes[d]={clusterId:n.id,node:this.body.nodes[d]},this.body.nodes[d].setOptions({physics:!1}))}},{key:"_getClusterNodeForNode",value:function(e){if(e!==void 0){var r=this.clusteredNodes[e];if(r!==void 0){var n=r.clusterId;if(n!==void 0)return this.body.nodes[n]}}}},{key:"_filter",value:function(e,r){var n=[];return ee(e,function(a){r(a)&&n.push(a)}),n}},{key:"_updateState",value:function(){var e=this,r,n=[],a={},o=function(v){ee(e.body.nodes,function(g){g.isCluster===!0&&v(g)})};for(r in this.clusteredNodes)if(Object.prototype.hasOwnProperty.call(this.clusteredNodes,r)){var s=this.body.nodes[r];s===void 0&&n.push(r)}o(function(f){for(var v=0;v<n.length;v++)delete f.containedNodes[n[v]]});for(var u=0;u<n.length;u++)delete this.clusteredNodes[n[u]];ee(this.clusteredEdges,function(f){var v=e.body.edges[f];(v===void 0||!v.endPointsValid())&&(a[f]=f)}),o(function(f){ee(f.containedEdges,function(v,g){!v.endPointsValid()&&!a[g]&&(a[g]=g)})}),ee(this.body.edges,function(f,v){var g=!0,b=f.clusteringEdgeReplacingIds;if(b!==void 0){var p=0;ee(b,function($){var m=e.body.edges[$];m!==void 0&&m.endPointsValid()&&(p+=1)}),g=p>0}(!f.endPointsValid()||!g)&&(a[v]=v)}),o(function(f){ee(a,function(v){delete f.containedEdges[v],ee(f.edges,function(g,b){if(g.id===v){f.edges[b]=null;return}g.clusteringEdgeReplacingIds=e._filter(g.clusteringEdgeReplacingIds,function(p){return!a[p]})}),f.edges=e._filter(f.edges,function(g){return g!==null})})}),ee(a,function(f){delete e.clusteredEdges[f]}),ee(a,function(f){delete e.body.edges[f]});var l=Te(this.body.edges);ee(l,function(f){var v=e.body.edges[f],g=e._isClusteredNode(v.fromId)||e._isClusteredNode(v.toId);if(g!==e._isClusteredEdge(v.id))if(g){var b=e._getClusterNodeForNode(v.fromId);b!==void 0&&e._clusterEdges(e.body.nodes[v.fromId],v,b);var p=e._getClusterNodeForNode(v.toId);p!==void 0&&e._clusterEdges(e.body.nodes[v.toId],v,p)}else delete e._clusterEdges[f],e._restoreEdge(v)});for(var c=!1,h=!0,d=function(){var v=[];o(function(b){var p=Te(b.containedNodes).length,$=b.options.allowSingleNodeCluster===!0;($&&p<1||!$&&p<2)&&v.push(b.id)});for(var g=0;g<v.length;++g)e.openCluster(v[g],{},!1);h=v.length>0,c=c||h};h;)d();c&&this._updateState()}},{key:"_isClusteredNode",value:function(e){return this.clusteredNodes[e]!==void 0}},{key:"_isClusteredEdge",value:function(e){return this.clusteredEdges[e]!==void 0}}]),t}();function wye(){var t;window!==void 0&&(t=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),t===void 0?window.requestAnimationFrame=function(i){i()}:window.requestAnimationFrame=t}var _ye=function(){function t(i,e){N(this,t),wye(),this.body=i,this.canvas=e,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},je(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return F(t,[{key:"bindEventListeners",value:function(){var e=this,r;this.body.emitter.on("dragStart",function(){e.dragging=!0}),this.body.emitter.on("dragEnd",function(){e.dragging=!1}),this.body.emitter.on("zoom",function(){e.zooming=!0,window.clearTimeout(e.zoomTimeoutId),e.zoomTimeoutId=pr(function(){var n;e.zooming=!1,A(n=e._requestRedraw).call(n,e)()},250)}),this.body.emitter.on("_resizeNodes",function(){e._resizeNodes()}),this.body.emitter.on("_redraw",function(){e.renderingActive===!1&&e._redraw()}),this.body.emitter.on("_blockRedraw",function(){e.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",function(){e.allowRedraw=!0,e.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",A(r=this._requestRedraw).call(r,this)),this.body.emitter.on("_startRendering",function(){e.renderRequests+=1,e.renderingActive=!0,e._startRendering()}),this.body.emitter.on("_stopRendering",function(){e.renderRequests-=1,e.renderingActive=e.renderRequests>0,e.renderTimer=void 0}),this.body.emitter.on("destroy",function(){e.renderRequests=0,e.allowRedraw=!1,e.renderingActive=!1,e.requiresTimeout===!0?clearTimeout(e.renderTimer):window.cancelAnimationFrame(e.renderTimer),e.body.emitter.off()})}},{key:"setOptions",value:function(e){if(e!==void 0){var r=["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"];pa(r,this.options,e)}}},{key:"_requestNextFrame",value:function(e,r){if(!(typeof window>"u")){var n,a=window;return this.requiresTimeout===!0?n=pr(e,r):a.requestAnimationFrame&&(n=a.requestAnimationFrame(e)),n}}},{key:"_startRendering",value:function(){if(this.renderingActive===!0&&this.renderTimer===void 0){var e;this.renderTimer=this._requestNextFrame(A(e=this._renderStep).call(e,this),this.simulationInterval)}}},{key:"_renderStep",value:function(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var e=this;this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this._requestNextFrame(function(){e._redraw(!1)},0))}},{key:"_redraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var r={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();var n=this.canvas.getContext(),a=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(n.clearRect(0,0,a,o),this.canvas.frame.clientWidth===0)return;if(n.save(),n.translate(this.body.view.translation.x,this.body.view.translation.y),n.scale(this.body.view.scale,this.body.view.scale),n.beginPath(),this.body.emitter.emit("beforeDrawing",n),n.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(n),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){var s=this._drawNodes(n,e),u=s.drawExternalLabels;r.drawExternalLabels=u}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(n),r.drawExternalLabels!=null&&r.drawExternalLabels(),e===!1&&this._drawSelectionBox(n),n.beginPath(),this.body.emitter.emit("afterDrawing",n),n.closePath(),n.restore(),e===!0&&n.clearRect(0,0,a,o)}}},{key:"_resizeNodes",value:function(){this.canvas.setTransform();var e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);var r=this.body.nodes,n;for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n=r[a],n.resize(e),n.updateBoundingBox(e,n.selected));e.restore()}},{key:"_drawNodes",value:function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.nodes,a=this.body.nodeIndices,o,s=[],u=[],l=20,c=this.canvas.DOMtoCanvas({x:-l,y:-l}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+l,y:this.canvas.frame.canvas.clientHeight+l}),d={top:c.y,left:c.x,bottom:h.y,right:h.x},f=[],v=0;v<a.length;v++)if(o=n[a[v]],o.hover)u.push(a[v]);else if(o.isSelected())s.push(a[v]);else if(r===!0){var g=o.draw(e);g.drawExternalLabel!=null&&f.push(g.drawExternalLabel)}else if(o.isBoundingBoxOverlappingWith(d)===!0){var b=o.draw(e);b.drawExternalLabel!=null&&f.push(b.drawExternalLabel)}else o.updateBoundingBox(e,o.selected);var p,$=s.length,m=u.length;for(p=0;p<$;p++){o=n[s[p]];var y=o.draw(e);y.drawExternalLabel!=null&&f.push(y.drawExternalLabel)}for(p=0;p<m;p++){o=n[u[p]];var w=o.draw(e);w.drawExternalLabel!=null&&f.push(w.drawExternalLabel)}return{drawExternalLabels:function(){for(var T=0,O=f;T<O.length;T++){var _=O[T];_()}}}}},{key:"_drawEdges",value:function(e){for(var r=this.body.edges,n=this.body.edgeIndices,a=0;a<n.length;a++){var o=r[n[a]];o.connected===!0&&o.draw(e)}}},{key:"_drawArrows",value:function(e){for(var r=this.body.edges,n=this.body.edgeIndices,a=0;a<n.length;a++){var o=r[n[a]];o.connected===!0&&o.drawArrows(e)}}},{key:"_determineBrowserMethod",value:function(){if(typeof window<"u"){var e=navigator.userAgent.toLowerCase();this.requiresTimeout=!1,ae(e).call(e,"msie 9.0")!=-1?this.requiresTimeout=!0:ae(e).call(e,"safari")!=-1&&ae(e).call(e,"chrome")<=-1&&(this.requiresTimeout=!0)}else this.requiresTimeout=!0}},{key:"_drawSelectionBox",value:function(e){if(this.body.selectionBox.show){e.beginPath();var r=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,n=this.body.selectionBox.position.end.y-this.body.selectionBox.position.start.y;e.rect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,r,n),e.fillStyle="rgba(151, 194, 252, 0.2)",e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,r,n),e.strokeStyle="rgba(151, 194, 252, 1)",e.stroke()}else e.closePath()}}]),t}(),Vp={},Eye={get exports(){return Vp},set exports(t){Vp=t}},Sye=ie,Oye=Sye.setInterval;(function(t){t.exports=Oye})(Eye);var Tye=V(Vp);function Wu(t,i){i.inputHandler=function(e){e.isFirst&&i(e)},t.on("hammer.input",i.inputHandler)}function zP(t,i){return i.inputHandler=function(e){e.isFinal&&i(e)},t.on("hammer.input",i.inputHandler)}var xye=function(){function t(i){N(this,t),this.body=i,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},je(this.options,this.defaultOptions),this.bindEventListeners()}return F(t,[{key:"bindEventListeners",value:function(){var e=this,r;this.body.emitter.once("resize",function(n){n.width!==0&&(e.body.view.translation.x=n.width*.5),n.height!==0&&(e.body.view.translation.y=n.height*.5)}),this.body.emitter.on("setSize",A(r=this.setSize).call(r,this)),this.body.emitter.on("destroy",function(){e.hammerFrame.destroy(),e.hammer.destroy(),e._cleanUp()})}},{key:"setOptions",value:function(e){var r=this;if(e!==void 0){var n=["width","height","autoResize"];pa(n,this.options,e)}if(this._cleanUp(),this.options.autoResize===!0){var a;if(window.ResizeObserver){var o=new ResizeObserver(function(){var c=r.setSize();c===!0&&r.body.emitter.emit("_requestRedraw")}),s=this.frame;o.observe(s),this._cleanupCallbacks.push(function(){o.unobserve(s)})}else{var u=Tye(function(){var c=r.setSize();c===!0&&r.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(function(){clearInterval(u)})}var l=A(a=this._onResize).call(a,this);Nce(window,"resize",l),this._cleanupCallbacks.push(function(){Fce(window,"resize",l)})}}},{key:"_cleanUp",value:function(){var e,r,n;ge(e=An(r=Or(n=this._cleanupCallbacks).call(n,0)).call(r)).call(e,function(a){try{a()}catch(o){console.error(o)}})}},{key:"_onResize",value:function(){this.setSize(),this.body.emitter.emit("_redraw")}},{key:"_getCameraState",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}},{key:"_setCameraState",value:function(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){var e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,r=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,n=this.cameraState.scale;e!=1&&r!=1?n=this.cameraState.scale*.5*(e+r):e!=1?n=this.cameraState.scale*e:r!=1&&(n=this.cameraState.scale*r),this.body.view.scale=n;var a=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),o={x:a.x-this.cameraState.position.x,y:a.y-this.cameraState.position.y};this.body.view.translation.x+=o.x*this.body.view.scale,this.body.view.translation.y+=o.y*this.body.view.scale}}},{key:"_prepareValue",value:function(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(ae(e).call(e,"%")!==-1||ae(e).call(e,"px")!==-1)return e;if(ae(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}},{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 e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var e=this;this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new Ii(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:Ii.DIRECTION_ALL}),Wu(this.hammer,function(r){e.body.eventListeners.onTouch(r)}),this.hammer.on("tap",function(r){e.body.eventListeners.onTap(r)}),this.hammer.on("doubletap",function(r){e.body.eventListeners.onDoubleTap(r)}),this.hammer.on("press",function(r){e.body.eventListeners.onHold(r)}),this.hammer.on("panstart",function(r){e.body.eventListeners.onDragStart(r)}),this.hammer.on("panmove",function(r){e.body.eventListeners.onDrag(r)}),this.hammer.on("panend",function(r){e.body.eventListeners.onDragEnd(r)}),this.hammer.on("pinch",function(r){e.body.eventListeners.onPinch(r)}),this.frame.canvas.addEventListener("wheel",function(r){e.body.eventListeners.onMouseWheel(r)}),this.frame.canvas.addEventListener("mousemove",function(r){e.body.eventListeners.onMouseMove(r)}),this.frame.canvas.addEventListener("contextmenu",function(r){e.body.eventListeners.onContext(r)}),this.hammerFrame=new Ii(this.frame),zP(this.hammerFrame,function(r){e.body.eventListeners.onRelease(r)})}},{key:"setSize",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),r=this._prepareValue(r);var n=!1,a=this.frame.canvas.width,o=this.frame.canvas.height,s=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||r!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=r)this._getCameraState(s),this.frame.style.width=e,this.frame.style.height=r,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=r,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},n=!0;else{var u=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),l=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==u||this.frame.canvas.height!==l)&&this._getCameraState(s),this.frame.canvas.width!==u&&(this.frame.canvas.width=u,n=!0),this.frame.canvas.height!==l&&(this.frame.canvas.height=l,n=!0)}return n===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(a/this.pixelRatio),oldHeight:Math.round(o/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,n}},{key:"getContext",value:function(){return this.frame.canvas.getContext("2d")}},{key:"_determinePixelRatio",value:function(){var e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");var r=1;typeof window<"u"&&(r=window.devicePixelRatio||1);var n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return r/n}},{key:"_setPixelRatio",value:function(){this.pixelRatio=this._determinePixelRatio()}},{key:"setTransform",value:function(){var e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}},{key:"_XconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}},{key:"DOMtoCanvas",value:function(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}]),t}();function Pye(t,i){var e=je({nodes:i,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},t??{});if(!ve(e.nodes))throw new TypeError("Nodes has to be an array of ids.");if(e.nodes.length===0&&(e.nodes=i),!(typeof e.minZoomLevel=="number"&&e.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof e.maxZoomLevel=="number"&&e.minZoomLevel<=e.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return e}var kye=function(){function t(i,e){var r,n=this,a;N(this,t),this.body=i,this.canvas=e,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",A(r=this.fit).call(r,this)),this.body.emitter.on("animationFinished",function(){n.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",A(a=this.releaseNode).call(a,this))}return F(t,[{key:"setOptions",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}},{key:"fit",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=Pye(e,this.body.nodeIndices);var n=this.canvas.frame.canvas.clientWidth,a=this.canvas.frame.canvas.clientHeight,o,s;if(n===0||a===0)s=1,o=dt.getRange(this.body.nodes,e.nodes);else if(r===!0){var u=0;for(var l in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,l)){var c=this.body.nodes[l];c.predefinedPosition===!0&&(u+=1)}if(u>.5*this.body.nodeIndices.length){this.fit(e,!1);return}o=dt.getRange(this.body.nodes,e.nodes);var h=this.body.nodeIndices.length;s=12.662/(h+7.4147)+.0964822;var d=Math.min(n/600,a/600);s*=d}else{this.body.emitter.emit("_resizeNodes"),o=dt.getRange(this.body.nodes,e.nodes);var f=Math.abs(o.maxX-o.minX)*1.1,v=Math.abs(o.maxY-o.minY)*1.1,g=n/f,b=a/v;s=g<=b?g:b}s>e.maxZoomLevel?s=e.maxZoomLevel:s<e.minZoomLevel&&(s=e.minZoomLevel);var p=dt.findCenter(o),$={position:p,scale:s,animation:e.animation};this.moveTo($)}},{key:"focus",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){var n={x:this.body.nodes[e].x,y:this.body.nodes[e].y};r.position=n,r.lockedOnNode=e,this.moveTo(r)}else console.error("Node: "+e+" cannot be found.")}},{key:"moveTo",value:function(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!xn(e.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!xn(e.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!xn(e.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!xn(e.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}},{key:"animateView",value:function(e){if(e!==void 0){this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;var r=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n={x:r.x-e.position.x,y:r.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+n.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+n.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var a;this.viewFunction=A(a=this._lockedRedraw).call(a,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var o;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=A(o=this._transitionRedraw).call(o,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}}},{key:"_lockedRedraw",value:function(){var e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},r=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n={x:r.x-e.x,y:r.y-e.y},a=this.body.view.translation,o={x:a.x+n.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:a.y+n.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=o}},{key:"releaseNode",value:function(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;var r=jce[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*r,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*r,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*r},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var n;this.viewFunction=A(n=this._lockedRedraw).call(n,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})}}]),t}();function z0(t){var i=t&&t.preventDefault||!1,e=t&&t.container||window,r={},n={keydown:{},keyup:{}},a={},o;for(o=97;o<=122;o++)a[String.fromCharCode(o)]={code:65+(o-97),shift:!1};for(o=65;o<=90;o++)a[String.fromCharCode(o)]={code:o,shift:!0};for(o=0;o<=9;o++)a[""+o]={code:48+o,shift:!1};for(o=1;o<=12;o++)a["F"+o]={code:111+o,shift:!1};for(o=0;o<=9;o++)a["num"+o]={code:96+o,shift:!1};a["num*"]={code:106,shift:!1},a["num+"]={code:107,shift:!1},a["num-"]={code:109,shift:!1},a["num/"]={code:111,shift:!1},a["num."]={code:110,shift:!1},a.left={code:37,shift:!1},a.up={code:38,shift:!1},a.right={code:39,shift:!1},a.down={code:40,shift:!1},a.space={code:32,shift:!1},a.enter={code:13,shift:!1},a.shift={code:16,shift:void 0},a.esc={code:27,shift:!1},a.backspace={code:8,shift:!1},a.tab={code:9,shift:!1},a.ctrl={code:17,shift:!1},a.alt={code:18,shift:!1},a.delete={code:46,shift:!1},a.pageup={code:33,shift:!1},a.pagedown={code:34,shift:!1},a["="]={code:187,shift:!1},a["-"]={code:189,shift:!1},a["]"]={code:221,shift:!1},a["["]={code:219,shift:!1};var s=function(c){l(c,"keydown")},u=function(c){l(c,"keyup")},l=function(c,h){if(n[h][c.keyCode]!==void 0){for(var d=n[h][c.keyCode],f=0;f<d.length;f++)(d[f].shift===void 0||d[f].shift==!0&&c.shiftKey==!0||d[f].shift==!1&&c.shiftKey==!1)&&d[f].fn(c);i==!0&&c.preventDefault()}};return r.bind=function(c,h,d){if(d===void 0&&(d="keydown"),a[c]===void 0)throw new Error("unsupported key: "+c);n[d][a[c].code]===void 0&&(n[d][a[c].code]=[]),n[d][a[c].code].push({fn:h,shift:a[c].shift})},r.bindAll=function(c,h){h===void 0&&(h="keydown");for(var d in a)a.hasOwnProperty(d)&&r.bind(d,c,h)},r.getKey=function(c){for(var h in a)if(a.hasOwnProperty(h)){if(c.shiftKey==!0&&a[h].shift==!0&&c.keyCode==a[h].code)return h;if(c.shiftKey==!1&&a[h].shift==!1&&c.keyCode==a[h].code)return h;if(c.keyCode==a[h].code&&h=="shift")return h}return"unknown key, currently not supported"},r.unbind=function(c,h,d){if(d===void 0&&(d="keydown"),a[c]===void 0)throw new Error("unsupported key: "+c);if(h!==void 0){var f=[],v=n[d][a[c].code];if(v!==void 0)for(var g=0;g<v.length;g++)v[g].fn==h&&v[g].shift==a[c].shift||f.push(n[d][a[c].code][g]);n[d][a[c].code]=f}else n[d][a[c].code]=[]},r.reset=function(){n={keydown:{},keyup:{}}},r.destroy=function(){n={keydown:{},keyup:{}},e.removeEventListener("keydown",s,!0),e.removeEventListener("keyup",u,!0)},e.addEventListener("keydown",s,!0),e.addEventListener("keyup",u,!0),r}var Iye=function(){function t(i,e){var r=this;N(this,t),this.body=i,this.canvas=e,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",function(){r.activated=!0,r.configureKeyboardBindings()}),this.body.emitter.on("deactivate",function(){r.activated=!1,r.configureKeyboardBindings()}),this.body.emitter.on("destroy",function(){r.keycharm!==void 0&&r.keycharm.destroy()}),this.options={}}return F(t,[{key:"setOptions",value:function(e){e!==void 0&&(this.options=e,this.create())}},{key:"create",value:function(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}},{key:"cleanNavigation",value:function(){if(this.navigationHammers.length!=0){for(var e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}},{key:"loadNavigationElements",value:function(){var e=this;this.cleanNavigation(),this.navigationDOM={};var r=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],n=["_moveUp","_moveDown","_moveLeft","_moveRight","_zoomIn","_zoomOut","_fit"];this.navigationDOM.wrapper=document.createElement("div"),this.navigationDOM.wrapper.className="vis-navigation",this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(var a=0;a<r.length;a++){this.navigationDOM[r[a]]=document.createElement("div"),this.navigationDOM[r[a]].className="vis-button vis-"+r[a],this.navigationDOM.wrapper.appendChild(this.navigationDOM[r[a]]);var o=new Ii(this.navigationDOM[r[a]]);if(n[a]==="_fit"){var s;Wu(o,A(s=this._fit).call(s,this))}else{var u;Wu(o,A(u=this.bindToRedraw).call(u,this,n[a]))}this.navigationHammers.push(o)}var l=new Ii(this.canvas.frame);zP(l,function(){e._stopMovement()}),this.navigationHammers.push(l),this.iconsCreated=!0}},{key:"bindToRedraw",value:function(e){if(this.boundFunctions[e]===void 0){var r;this.boundFunctions[e]=A(r=this[e]).call(r,this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering")}}},{key:"unbindFromRedraw",value:function(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}},{key:"_fit",value:function(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}},{key:"_stopMovement",value:function(){for(var e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{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 e=this.body.view.scale,r=this.body.view.scale*(1+this.options.keyboard.speed.zoom),n=this.body.view.translation,a=r/e,o=(1-a)*this.canvas.canvasViewCenter.x+n.x*a,s=(1-a)*this.canvas.canvasViewCenter.y+n.y*a;this.body.view.scale=r,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}},{key:"_zoomOut",value:function(){var e=this.body.view.scale,r=this.body.view.scale/(1+this.options.keyboard.speed.zoom),n=this.body.view.translation,a=r/e,o=(1-a)*this.canvas.canvasViewCenter.x+n.x*a,s=(1-a)*this.canvas.canvasViewCenter.y+n.y*a;this.body.view.scale=r,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}},{key:"configureKeyboardBindings",value:function(){var e=this;if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=z0({container:window,preventDefault:!0}):this.keycharm=z0({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var r,n,a,o,s,u,l,c,h,d,f,v,g,b,p,$,m,y,w,S,T,O,_,E;A(r=this.keycharm).call(r,"up",function(){e.bindToRedraw("_moveUp")},"keydown"),A(n=this.keycharm).call(n,"down",function(){e.bindToRedraw("_moveDown")},"keydown"),A(a=this.keycharm).call(a,"left",function(){e.bindToRedraw("_moveLeft")},"keydown"),A(o=this.keycharm).call(o,"right",function(){e.bindToRedraw("_moveRight")},"keydown"),A(s=this.keycharm).call(s,"=",function(){e.bindToRedraw("_zoomIn")},"keydown"),A(u=this.keycharm).call(u,"num+",function(){e.bindToRedraw("_zoomIn")},"keydown"),A(l=this.keycharm).call(l,"num-",function(){e.bindToRedraw("_zoomOut")},"keydown"),A(c=this.keycharm).call(c,"-",function(){e.bindToRedraw("_zoomOut")},"keydown"),A(h=this.keycharm).call(h,"[",function(){e.bindToRedraw("_zoomOut")},"keydown"),A(d=this.keycharm).call(d,"]",function(){e.bindToRedraw("_zoomIn")},"keydown"),A(f=this.keycharm).call(f,"pageup",function(){e.bindToRedraw("_zoomIn")},"keydown"),A(v=this.keycharm).call(v,"pagedown",function(){e.bindToRedraw("_zoomOut")},"keydown"),A(g=this.keycharm).call(g,"up",function(){e.unbindFromRedraw("_moveUp")},"keyup"),A(b=this.keycharm).call(b,"down",function(){e.unbindFromRedraw("_moveDown")},"keyup"),A(p=this.keycharm).call(p,"left",function(){e.unbindFromRedraw("_moveLeft")},"keyup"),A($=this.keycharm).call($,"right",function(){e.unbindFromRedraw("_moveRight")},"keyup"),A(m=this.keycharm).call(m,"=",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),A(y=this.keycharm).call(y,"num+",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),A(w=this.keycharm).call(w,"num-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),A(S=this.keycharm).call(S,"-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),A(T=this.keycharm).call(T,"[",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),A(O=this.keycharm).call(O,"]",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),A(_=this.keycharm).call(_,"pageup",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),A(E=this.keycharm).call(E,"pagedown",function(){e.unbindFromRedraw("_zoomOut")},"keyup")}}}]),t}();function Cye(t,i){var e=typeof pn<"u"&&Br(t)||t["@@iterator"];if(!e){if(ve(t)||(e=Aye(t))||i&&t&&typeof t.length=="number"){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
93
+ `),a=n.length;if(r.multi)for(var o=0;o<a;o++){var s=this.splitBlocks(n[o],r.multi);if(s!==void 0){if(s.length===0){this.lines.newLine("");continue}if(r.maxWdt>0)for(var u=0;u<s.length;u++){var l=s[u].mod,c=s[u].text;this.splitStringIntoLines(c,l,!0)}else for(var h=0;h<s.length;h++){var d=s[h].mod,f=s[h].text;this.lines.append(f,d)}this.lines.newLine()}}else if(r.maxWdt>0)for(var v=0;v<a;v++)this.splitStringIntoLines(n[v]);else for(var g=0;g<a;g++)this.lines.newLine(n[g]);return this.lines.finalize()}},{key:"decodeMarkupSystem",value:function(e){var r="none";return e==="markdown"||e==="md"?r="markdown":(e===!0||e==="html")&&(r="html"),r}},{key:"splitHtmlBlocks",value:function(e){for(var r=new $0(e),n=function(u){if(/&/.test(u)){var l=r.replace(r.text,"&lt;","<")||r.replace(r.text,"&amp;","&");return l||r.add("&"),!0}return!1};r.position<r.text.length;){var a=r.text.charAt(r.position),o=r.parseWS(a)||/</.test(a)&&(r.parseStartTag("bold","<b>")||r.parseStartTag("ital","<i>")||r.parseStartTag("mono","<code>")||r.parseEndTag("bold","</b>")||r.parseEndTag("ital","</i>")||r.parseEndTag("mono","</code>"))||n(a);o||r.add(a),r.position++}return r.emitBlock(),r.blocks}},{key:"splitMarkdownBlocks",value:function(e){for(var r=this,n=new $0(e),a=!0,o=function(c){return/\\/.test(c)?(n.position<r.text.length+1&&(n.position++,c=r.text.charAt(n.position),/ \t/.test(c)?n.spacing=!0:(n.add(c),a=!1)),!0):!1};n.position<n.text.length;){var s=n.text.charAt(n.position),u=n.parseWS(s)||o(s)||(a||n.spacing)&&(n.parseStartTag("bold","*")||n.parseStartTag("ital","_")||n.parseStartTag("mono","`"))||n.parseEndTag("bold","*","afterBold")||n.parseEndTag("ital","_","afterItal")||n.parseEndTag("mono","`","afterMono");u||(n.add(s),a=!1),n.position++}return n.emitBlock(),n.blocks}},{key:"splitBlocks",value:function(e,r){var n=this.decodeMarkupSystem(r);if(n==="none")return[{text:e,mod:"normal"}];if(n==="markdown")return this.splitMarkdownBlocks(e);if(n==="html")return this.splitHtmlBlocks(e)}},{key:"overMaxWidth",value:function(e){var r=this.ctx.measureText(e).width;return this.lines.curWidth()+r>this.parent.fontOptions.maxWdt}},{key:"getLongestFit",value:function(e){for(var r="",n=0;n<e.length;){var a=r===""?"":" ",o=r+a+e[n];if(this.overMaxWidth(o))break;r=o,n++}return n}},{key:"getLongestFitWord",value:function(e){for(var r=0;r<e.length&&!this.overMaxWidth(st(e).call(e,0,r));)r++;return r}},{key:"splitStringIntoLines",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,r),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");for(var a=e.split("\r");a.length>0;){var o=this.getLongestFit(a);if(o===0){var s=a[0],u=this.getLongestFitWord(s);this.lines.newLine(st(s).call(s,0,u),r),a[0]=st(s).call(s,u)}else{var l=o;a[o-1]===" "?o--:a[l]===" "&&l++;var c=st(a).call(a,0,o).join("");o==a.length&&n?this.lines.append(c,r):this.lines.newLine(c,r),a=st(a).call(a,l)}}}}]),t}(),_a=["bold","ital","boldital","mono"],AP=function(){function t(i,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;N(this,t),this.body=i,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(e),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=r}return F(t,[{key:"setOptions",value:function(e){if(this.elementOptions=e,this.initFontOptions(e.font),Hu(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(he(e.font)==="object"){var r=e.font.size;r!==void 0&&(this.baseSize=r)}}}},{key:"initFontOptions",value:function(e){var r=this;if(te(_a,function(n){r.fontOptions[n]={}}),t.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}te(e,function(n,a){n!=null&&he(n)!=="object"&&(r.fontOptions[a]=n)})}},{key:"constrain",value:function(e){var r={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},n=Gr(e,"widthConstraint");if(typeof n=="number")r.maxWdt=Number(n),r.minWdt=Number(n);else if(he(n)==="object"){var a=Gr(e,["widthConstraint","maximum"]);typeof a=="number"&&(r.maxWdt=Number(a));var o=Gr(e,["widthConstraint","minimum"]);typeof o=="number"&&(r.minWdt=Number(o))}var s=Gr(e,"heightConstraint");if(typeof s=="number")r.minHgt=Number(s);else if(he(s)==="object"){var u=Gr(e,["heightConstraint","minimum"]);typeof u=="number"&&(r.minHgt=Number(u));var l=Gr(e,["heightConstraint","valign"]);typeof l=="string"&&(l==="top"||l==="bottom")&&(r.valign=l)}return r}},{key:"update",value:function(e,r){this.setOptions(e,!0),this.propagateFonts(r),$e(this.fontOptions,this.constrain(r)),this.fontOptions.chooser=Oy("label",r)}},{key:"adjustSizes",value:function(e){var r=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=r,this.fontOptions.minWdt-=r);var n=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=n)}},{key:"addFontOptionsToPile",value:function(e,r){for(var n=0;n<r.length;++n)this.addFontToPile(e,r[n])}},{key:"addFontToPile",value:function(e,r){if(r!==void 0&&!(r.font===void 0||r.font===null)){var n=r.font;e.push(n)}}},{key:"getBasicOptions",value:function(e){for(var r={},n=0;n<e.length;++n){var a=e[n],o={};t.parseFontString(o,a)&&(a=o),te(a,function(s,u){s!==void 0&&(Object.prototype.hasOwnProperty.call(r,u)||(ae(_a).call(_a,u)!==-1?r[u]={}:r[u]=s))})}return r}},{key:"getFontOption",value:function(e,r,n){for(var a,o=0;o<e.length;++o){var s=e[o];if(Object.prototype.hasOwnProperty.call(s,r)){if(a=s[r],a==null)continue;var u={};if(t.parseFontString(u,a)&&(a=u),Object.prototype.hasOwnProperty.call(a,n))return a[n]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,n))return this.fontOptions[n];throw new Error("Did not find value for multi-font for property: '"+n+"'")}},{key:"getFontOptions",value:function(e,r){for(var n={},a=["color","size","face","mod","vadjust"],o=0;o<a.length;++o){var s=a[o];n[s]=this.getFontOption(e,r,s)}return n}},{key:"propagateFonts",value:function(e){var r=this,n=[];this.addFontOptionsToPile(n,e),this.fontOptions=this.getBasicOptions(n);for(var a=function(){var u=_a[o],l=r.fontOptions[u],c=r.getFontOptions(n,u);te(c,function(h,d){l[d]=h}),l.size=Number(l.size),l.vadjust=Number(l.vadjust)},o=0;o<_a.length;++o)a()}},{key:"draw",value:function(e,r,n,a,o){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label!==void 0){var u=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&u<this.elementOptions.scaling.label.drawThreshold-1||(u>=this.elementOptions.scaling.label.maxVisible&&(u=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,a,o,r,n,s),this._drawBackground(e),this._drawText(e,r,this.size.yLine,s,u))}}},{key:"_drawBackground",value:function(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;var r=this.getSize();e.fillRect(r.left,r.top,r.width,r.height)}}},{key:"_drawText",value:function(e,r,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",o=arguments.length>4?arguments[4]:void 0,s=this._setAlignment(e,r,n,a),u=xe(s,2);r=u[0],n=u[1],e.textAlign="left",r=r-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(n-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(n+=(this.size.height-this.size.labelHeight)/2));for(var l=0;l<this.lineCount;l++){var c=this.lines[l];if(c&&c.blocks){var h=0;this.isEdgeLabel||this.fontOptions.align==="center"?h+=(this.size.width-c.width)/2:this.fontOptions.align==="right"&&(h+=this.size.width-c.width);for(var d=0;d<c.blocks.length;d++){var f=c.blocks[d];e.font=f.font;var v=this._getColor(f.color,o,f.strokeColor),g=xe(v,2),b=g[0],p=g[1];f.strokeWidth>0&&(e.lineWidth=f.strokeWidth,e.strokeStyle=p,e.lineJoin="round"),e.fillStyle=b,f.strokeWidth>0&&e.strokeText(f.text,r+h,n+f.vadjust),e.fillText(f.text,r+h,n+f.vadjust),h+=f.width}n+=c.height}}}},{key:"_setAlignment",value:function(e,r,n,a){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){r=0,n=0;var o=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",n-=2*o):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",n+=2*o):e.textBaseline="middle"}else e.textBaseline=a;return[r,n]}},{key:"_getColor",value:function(e,r,n){var a=e||"#000000",o=n||"#ffffff";if(r<=this.elementOptions.scaling.label.drawThreshold){var s=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-r)));a=jt(a,s),o=jt(o,s)}return[a,o]}},{key:"getTextSize",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,r,n),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"getSize",value:function(){var e=2,r=this.size.left,n=this.size.top-.5*e;if(this.isEdgeLabel){var a=-this.size.width*.5;switch(this.fontOptions.align){case"middle":r=a,n=-this.size.height*.5;break;case"top":r=a,n=-(this.size.height+e);break;case"bottom":r=a,n=e;break}}var o={left:r,top:n,width:this.size.width,height:this.size.height};return o}},{key:"calculateLabelSize",value:function(e,r,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,r,n),this.size.left=a-this.size.width*.5,this.size.top=o-this.size.height*.5,this.size.yLine=o+(1-this.lineCount)*.5*this.fontOptions.size,s==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:"getFormattingValues",value:function(e,r,n,a){var o=function(c,h,d){return h==="normal"?d==="mod"?"":c[d]:c[h][d]!==void 0?c[h][d]:c[d]},s={color:o(this.fontOptions,a,"color"),size:o(this.fontOptions,a,"size"),face:o(this.fontOptions,a,"face"),mod:o(this.fontOptions,a,"mod"),vadjust:o(this.fontOptions,a,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(r||n)&&(a==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?s.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(s,this.elementOptions.id,r,n));var u="";return s.mod!==void 0&&s.mod!==""&&(u+=s.mod+" "),u+=s.size+"px "+s.face,e.font=u.replace(/"/g,""),s.font=e.font,s.height=s.size,s}},{key:"differentState",value:function(e,r){return e!==this.selectedState||r!==this.hoverState}},{key:"_processLabelText",value:function(e,r,n,a){var o=new Zfe(e,this,r,n);return o.process(a)}},{key:"_processLabel",value:function(e,r,n){if(!(this.labelDirty===!1&&!this.differentState(r,n))){var a=this._processLabelText(e,r,n,this.elementOptions.label);this.fontOptions.minWdt>0&&a.width<this.fontOptions.minWdt&&(a.width=this.fontOptions.minWdt),this.size.labelHeight=a.height,this.fontOptions.minHgt>0&&a.height<this.fontOptions.minHgt&&(a.height=this.fontOptions.minHgt),this.lines=a.lines,this.lineCount=a.lines.length,this.size.width=a.width,this.size.height=a.height,this.selectedState=r,this.hoverState=n,this.labelDirty=!1}}},{key:"visible",value:function(){if(this.size.width===0||this.size.height===0||this.elementOptions.label===void 0)return!1;var e=this.fontOptions.size*this.body.view.scale;return!(e<this.elementOptions.scaling.label.drawThreshold-1)}}],[{key:"parseFontString",value:function(e,r){if(!r||typeof r!="string")return!1;var n=r.split(" ");return e.size=+n[0].replace("px",""),e.face=n[1],e.color=n[2],!0}}]),t}(),Pp={},Jfe={get exports(){return Pp},set exports(t){Pp=t}},eve=Sl,tve=sa,rve=TypeError,nve=function(t){if(eve(t))return t;throw rve(tve(t)+" is not a constructor")},ive=q,ave=Vt,Xh=Do,ove=iT,b0=nve,sve=Ft,w0=et,uve=la,RP=se,Ty=ave("Reflect","construct"),lve=Object.prototype,cve=[].push,DP=RP(function(){function t(){}return!(Ty(function(){},[],t)instanceof t)}),MP=!RP(function(){Ty(function(){})}),_0=DP||MP;ive({target:"Reflect",stat:!0,forced:_0,sham:_0},{construct:function(i,e){b0(i),sve(e);var r=arguments.length<3?i:b0(arguments[2]);if(MP&&!DP)return Ty(i,e,r);if(i==r){switch(e.length){case 0:return new i;case 1:return new i(e[0]);case 2:return new i(e[0],e[1]);case 3:return new i(e[0],e[1],e[2]);case 4:return new i(e[0],e[1],e[2],e[3])}var n=[null];return Xh(cve,n,e),new(Xh(ove,i,n))}var a=r.prototype,o=uve(w0(a)?a:lve),s=Xh(i,o,e);return w0(s)?s:o}});var hve=ie,dve=hve.Reflect.construct,fve=dve,vve=fve;(function(t){t.exports=vve})(Jfe);var P=V(Pp),kp={},pve={get exports(){return kp},set exports(t){kp=t}},Ip={},gve={get exports(){return Ip},set exports(t){Ip=t}},yve=Dx,mve=yve,$ve=mve,bve=$ve;(function(t){t.exports=bve})(gve);(function(t){t.exports=Ip})(pve);var wve=V(kp),Cp={},_ve={get exports(){return Cp},set exports(t){Cp=t}},Ap={},Eve={get exports(){return Ap},set exports(t){Ap=t}},Sve=q,Ove=sZ;Sve({target:"Object",stat:!0},{setPrototypeOf:Ove});var Tve=ie,xve=Tve.Object.setPrototypeOf,Pve=xve,kve=Pve,Ive=kve,Cve=Ive,Ave=Cve,Rve=Ave;(function(t){t.exports=Rve})(Eve);(function(t){t.exports=Ap})(_ve);var Rp=V(Cp),Dp={},Dve={get exports(){return Dp},set exports(t){Dp=t}},Mp={},Mve={get exports(){return Mp},set exports(t){Mp=t}},Nve=aT,Fve=Nve,Bve=Fve,Lve=Bve;(function(t){t.exports=Lve})(Mve);(function(t){t.exports=Mp})(Dve);var xy=V(Dp);function Np(t,i){var e;return Np=Rp?xy(e=Rp).call(e):function(n,a){return n.__proto__=a,n},Np(t,i)}function ce(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=wve(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Dl(t,"prototype",{writable:!1}),i&&Np(t,i)}function jve(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pe(t,i){if(i&&(he(i)==="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jve(t)}var Fp={},zve={get exports(){return Fp},set exports(t){Fp=t}},Bp={},Hve={get exports(){return Bp},set exports(t){Bp=t}},Wve=kx,Vve=Wve,Uve=Vve,Gve=Uve;(function(t){t.exports=Gve})(Hve);(function(t){t.exports=Bp})(zve);var E0=V(Fp);function z(t){var i;return z=Rp?xy(i=E0).call(i):function(r){return r.__proto__||E0(r)},z(t)}var ni=function(){function t(i,e,r){N(this,t),this.body=e,this.labelModule=r,this.setOptions(i),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}return F(t,[{key:"setOptions",value:function(e){this.options=e}},{key:"_setMargins",value:function(e){this.margin={},this.options.margin&&(he(this.options.margin)=="object"?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),e.adjustSizes(this.margin)}},{key:"_distanceToBorder",value:function(e,r){var n=this.options.borderWidth;return e&&this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(r)),Math.abs(this.height/2/Math.sin(r)))+n}},{key:"enableShadow",value:function(e,r){r.shadow&&(e.shadowColor=r.shadowColor,e.shadowBlur=r.shadowSize,e.shadowOffsetX=r.shadowX,e.shadowOffsetY=r.shadowY)}},{key:"disableShadow",value:function(e,r){r.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"enableBorderDashes",value:function(e,r){if(r.borderDashes!==!1)if(e.setLineDash!==void 0){var n=r.borderDashes;n===!0&&(n=[5,15]),e.setLineDash(n)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,r.borderDashes=!1}},{key:"disableBorderDashes",value:function(e,r){r.borderDashes!==!1&&(e.setLineDash!==void 0?e.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,r.borderDashes=!1))}},{key:"needsRefresh",value:function(e,r){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,r)}},{key:"initContextForDraw",value:function(e,r){var n=r.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,n),e.strokeStyle=r.borderColor,e.fillStyle=r.color}},{key:"performStroke",value:function(e,r){var n=r.borderWidth/this.body.view.scale;e.save(),n>0&&(this.enableBorderDashes(e,r),e.stroke(),this.disableBorderDashes(e,r)),e.restore()}},{key:"performFill",value:function(e,r){e.save(),e.fillStyle=r.color,this.enableShadow(e,r),ts(e).call(e),this.disableShadow(e,r),e.restore(),this.performStroke(e,r)}},{key:"_addBoundingBoxMargin",value:function(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}},{key:"_updateBoundingBox",value:function(e,r,n,a,o){n!==void 0&&this.resize(n,a,o),this.left=e-this.width/2,this.top=r-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(e,r,n,a,o){this._updateBoundingBox(e,r,n,a,o)}},{key:"getDimensionsFromLabel",value:function(e,r,n){this.textSize=this.labelModule.getTextSize(e,r,n);var a=this.textSize.width,o=this.textSize.height,s=14;return a===0&&(a=s,o=s),{width:a,height:o}}}]),t}();function Kve(t){var i=qve();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function qve(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Yve=function(t){ce(e,t);var i=Kve(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o._setMargins(a),o}return F(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o);this.width=s.width+this.margin.right+this.margin.left,this.height=s.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this.initContextForDraw(n,l),oT(n,this.left,this.top,this.width,this.height,l.borderRadius),this.performFill(n,l),this.updateBoundingBox(a,o,n,s,u),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,u)}},{key:"updateBoundingBox",value:function(n,a,o,s,u){this._updateBoundingBox(n,a,o,s,u);var l=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(l)}},{key:"distanceToBorder",value:function(n,a){n&&this.resize(n);var o=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(a)),Math.abs(this.height/2/Math.sin(a)))+o}}]),e}(ni);function Xve(t){var i=Qve();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Qve(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Py=function(t){ce(e,t);var i=Xve(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o.labelOffset=0,o.selected=!1,o}return F(e,[{key:"setOptions",value:function(n,a,o){this.options=n,a===void 0&&o===void 0||this.setImages(a,o)}},{key:"setImages",value:function(n,a){a&&this.selected?(this.imageObj=a,this.imageObjAlt=n):(this.imageObj=n,this.imageObjAlt=a)}},{key:"switchImages",value:function(n){var a=n&&!this.selected||!n&&this.selected;if(this.selected=n,this.imageObjAlt!==void 0&&a){var o=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=o}}},{key:"_getImagePadding",value:function(){var n={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){var a=this.options.imagePadding;he(a)=="object"?(n.top=a.top,n.right=a.right,n.bottom=a.bottom,n.left=a.left):(n.top=a,n.right=a,n.bottom=a,n.left=a)}return n}},{key:"_resizeImage",value:function(){var n,a;if(this.options.shapeProperties.useImageSize===!1){var o=1,s=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?o=this.imageObj.width/this.imageObj.height:s=this.imageObj.height/this.imageObj.width),n=this.options.size*2*o,a=this.options.size*2*s}else{var u=this._getImagePadding();n=this.imageObj.width+u.left+u.right,a=this.imageObj.height+u.top+u.bottom}this.width=n,this.height=a,this.radius=.5*this.width}},{key:"_drawRawCircle",value:function(n,a,o,s){this.initContextForDraw(n,s),Gg(n,a,o,s.size),this.performFill(n,s)}},{key:"_drawImageAtPosition",value:function(n,a){if(this.imageObj.width!=0){n.globalAlpha=a.opacity!==void 0?a.opacity:1,this.enableShadow(n,a);var o=1;this.options.shapeProperties.interpolation===!0&&(o=this.imageObj.width/this.width/this.body.view.scale);var s=this._getImagePadding(),u=this.left+s.left,l=this.top+s.top,c=this.width-s.left-s.right,h=this.height-s.top-s.bottom;this.imageObj.drawImageAtPosition(n,o,u,l,c,h),this.disableShadow(n,a)}}},{key:"_drawImageLabel",value:function(n,a,o,s,u){var l=0;if(this.height!==void 0){l=this.height*.5;var c=this.labelModule.getTextSize(n,s,u);c.lineCount>=1&&(l+=c.height/2)}var h=o+l;this.options.label&&(this.labelOffset=l),this.labelModule.draw(n,a,h,s,u,"hanging")}}]),e}(ni);function Zve(t){var i=Jve();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Jve(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var epe=function(t){ce(e,t);var i=Zve(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o._setMargins(a),o}return F(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o),u=Math.max(s.width+this.margin.right+this.margin.left,s.height+this.margin.top+this.margin.bottom);this.options.size=u/2,this.width=u,this.height=u,this.radius=this.width/2}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this._drawRawCircle(n,a,o,l),this.updateBoundingBox(a,o),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,o,s,u)}},{key:"updateBoundingBox",value:function(n,a){this.boundingBox.top=a-this.options.size,this.boundingBox.left=n-this.options.size,this.boundingBox.right=n+this.options.size,this.boundingBox.bottom=a+this.options.size}},{key:"distanceToBorder",value:function(n){return n&&this.resize(n),this.width*.5}}]),e}(Py);function tpe(t){var i=rpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function rpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var npe=function(t){ce(e,t);var i=tpe(e);function e(r,n,a,o,s){var u;return N(this,e),u=i.call(this,r,n,a),u.setImages(o,s),u}return F(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0;if(s){var u=this.options.size*2;this.width=u,this.height=u,this.radius=.5*this.width;return}this.needsRefresh(a,o)&&this._resizeImage()}},{key:"draw",value:function(n,a,o,s,u,l){this.switchImages(s),this.resize();var c=a,h=o;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=a,this.top=o,c+=this.width/2,h+=this.height/2):(this.left=a-this.width/2,this.top=o-this.height/2),this._drawRawCircle(n,c,h,l),n.save(),n.clip(),this._drawImageAtPosition(n,l),n.restore(),this._drawImageLabel(n,c,h,s,u),this.updateBoundingBox(a,o)}},{key:"updateBoundingBox",value:function(n,a){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=a,this.boundingBox.left=n,this.boundingBox.right=n+this.options.size*2,this.boundingBox.bottom=a+this.options.size*2):(this.boundingBox.top=a-this.options.size,this.boundingBox.left=n-this.options.size,this.boundingBox.right=n+this.options.size,this.boundingBox.bottom=a+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(n){return n&&this.resize(n),this.width*.5}}]),e}(Py);function ipe(t){var i=ape();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function ape(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var gn=function(t){ce(e,t);var i=ipe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(a,o)){var u,l;this.labelModule.getTextSize(n,a,o);var c=2*s.size;this.width=(u=this.customSizeWidth)!==null&&u!==void 0?u:c,this.height=(l=this.customSizeHeight)!==null&&l!==void 0?l:c,this.radius=.5*this.width}}},{key:"_drawShape",value:function(n,a,o,s,u,l,c,h){var d=this;return this.resize(n,l,c,h),this.left=s-this.width/2,this.top=u-this.height/2,this.initContextForDraw(n,h),EX(a)(n,s,u,h.size),this.performFill(n,h),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(n.font=(l?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),n.fillStyle=this.options.icon.color||"black",n.textAlign="center",n.textBaseline="middle",n.fillText(this.options.icon.code,s,u)),{drawExternalLabel:function(){if(d.options.label!==void 0){d.labelModule.calculateLabelSize(n,l,c,s,u,"hanging");var v=u+.5*d.height+.5*d.labelModule.size.height;d.labelModule.draw(n,s,v,l,c,"hanging")}d.updateBoundingBox(s,u)}}}},{key:"updateBoundingBox",value:function(n,a){this.boundingBox.top=a-this.options.size,this.boundingBox.left=n-this.options.size,this.boundingBox.right=n+this.options.size,this.boundingBox.bottom=a+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}]),e}(ni);function S0(t,i){var e=Te(t);if(sn){var r=sn(t);i&&(r=St(r).call(r,function(n){return vn(t,n).enumerable})),e.push.apply(e,r)}return e}function ope(t){for(var i=1;i<arguments.length;i++){var e,r,n=arguments[i]!=null?arguments[i]:{};i%2?ge(e=S0(Object(n),!0)).call(e,function(a){Ml(t,a,n[a])}):un?Al(t,un(n)):ge(r=S0(Object(n))).call(r,function(a){Rl(t,a,vn(n,a))})}return t}function spe(t){var i=upe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function upe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var lpe=function(t){ce(e,t);var i=spe(e);function e(r,n,a,o){var s;return N(this,e),s=i.call(this,r,n,a,o),s.ctxRenderer=o,s}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u,l),this.left=a-this.width/2,this.top=o-this.height/2,n.save();var c=this.ctxRenderer({ctx:n,id:this.options.id,x:a,y:o,state:{selected:s,hover:u},style:ope({},l),label:this.options.label});if(c.drawNode!=null&&c.drawNode(),n.restore(),c.drawExternalLabel){var h=c.drawExternalLabel;c.drawExternalLabel=function(){n.save(),h(),n.restore()}}return c.nodeDimensions&&(this.customSizeWidth=c.nodeDimensions.width,this.customSizeHeight=c.nodeDimensions.height),c}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(gn);function cpe(t){var i=hpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function hpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var dpe=function(t){ce(e,t);var i=cpe(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o._setMargins(a),o}return F(e,[{key:"resize",value:function(n,a,o){if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o),u=s.width+this.margin.right+this.margin.left;this.width=u,this.height=u,this.radius=this.width/2}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this.initContextForDraw(n,l),sT(n,a-this.width/2,o-this.height/2,this.width,this.height),this.performFill(n,l),this.updateBoundingBox(a,o,n,s,u),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,u)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(ni);function fpe(t){var i=vpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function vpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var ppe=function(t){ce(e,t);var i=fpe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"diamond",4,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(gn);function gpe(t){var i=ype();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function ype(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var mpe=function(t){ce(e,t);var i=gpe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"circle",2,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n){return n&&this.resize(n),this.options.size}}]),e}(gn);function $pe(t){var i=bpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function bpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var O0=function(t){ce(e,t);var i=$pe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(n,a,o);this.height=s.height*2,this.width=s.width+s.height,this.radius=.5*this.width}}},{key:"draw",value:function(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width*.5,this.top=o-this.height*.5,this.initContextForDraw(n,l),iv(n,this.left,this.top,this.width,this.height),this.performFill(n,l),this.updateBoundingBox(a,o,n,s,u),this.labelModule.draw(n,a,o,s,u)}},{key:"distanceToBorder",value:function(n,a){n&&this.resize(n);var o=this.width*.5,s=this.height*.5,u=Math.sin(a)*o,l=Math.cos(a)*s;return o*s/Math.sqrt(u*u+l*l)}}]),e}(ni);function wpe(t){var i=_pe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function _pe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Epe=function(t){ce(e,t);var i=wpe(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o._setMargins(a),o}return F(e,[{key:"resize",value:function(n,a,o){this.needsRefresh(a,o)&&(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(n,a,o,s,u,l){var c=this;return this.resize(n,s,u),this.options.icon.size=this.options.icon.size||50,this.left=a-this.width/2,this.top=o-this.height/2,this._icon(n,a,o,s,u,l),{drawExternalLabel:function(){if(c.options.label!==void 0){var d=5;c.labelModule.draw(n,c.left+c.iconSize.width/2+c.margin.left,o+c.height/2+d,s)}c.updateBoundingBox(a,o)}}}},{key:"updateBoundingBox",value:function(n,a){if(this.boundingBox.top=a-this.options.icon.size*.5,this.boundingBox.left=n-this.options.icon.size*.5,this.boundingBox.right=n+this.options.icon.size*.5,this.boundingBox.bottom=a+this.options.icon.size*.5,this.options.label!==void 0&&this.labelModule.size.width>0){var o=5;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+o)}}},{key:"_icon",value:function(n,a,o,s,u,l){var c=Number(this.options.icon.size);this.options.icon.code!==void 0?(n.font=[this.options.icon.weight!=null?this.options.icon.weight:s?"bold":"",(this.options.icon.weight!=null&&s?5:0)+c+"px",this.options.icon.face].join(" "),n.fillStyle=this.options.icon.color||"black",n.textAlign="center",n.textBaseline="middle",this.enableShadow(n,l),n.fillText(this.options.icon.code,a,o),this.disableShadow(n,l)):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(n,a){return this._distanceToBorder(n,a)}}]),e}(ni);function Spe(t){var i=Ope();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Ope(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Tpe=function(t){ce(e,t);var i=Spe(e);function e(r,n,a,o,s){var u;return N(this,e),u=i.call(this,r,n,a),u.setImages(o,s),u}return F(e,[{key:"resize",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0;if(s){var u=this.options.size*2;this.width=u,this.height=u;return}this.needsRefresh(a,o)&&this._resizeImage()}},{key:"draw",value:function(n,a,o,s,u,l){n.save(),this.switchImages(s),this.resize();var c=a,h=o;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=a,this.top=o,c+=this.width/2,h+=this.height/2):(this.left=a-this.width/2,this.top=o-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){var d=this.options.borderWidth,f=this.options.borderWidthSelected||2*this.options.borderWidth,v=(s?f:d)/this.body.view.scale;n.lineWidth=Math.min(this.width,v),n.beginPath();var g=s?this.options.color.highlight.border:u?this.options.color.hover.border:this.options.color.border,b=s?this.options.color.highlight.background:u?this.options.color.hover.background:this.options.color.background;l.opacity!==void 0&&(g=jt(g,l.opacity),b=jt(b,l.opacity)),n.strokeStyle=g,n.fillStyle=b,n.rect(this.left-.5*n.lineWidth,this.top-.5*n.lineWidth,this.width+n.lineWidth,this.height+n.lineWidth),ts(n).call(n),this.performStroke(n,l),n.closePath()}this._drawImageAtPosition(n,l),this._drawImageLabel(n,c,h,s,u),this.updateBoundingBox(a,o),n.restore()}},{key:"updateBoundingBox",value:function(n,a){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=n,this.top=a):(this.left=n-this.width/2,this.top=a-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(Py);function xpe(t){var i=Ppe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Ppe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var kpe=function(t){ce(e,t);var i=xpe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"square",2,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(gn);function Ipe(t){var i=Cpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Cpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Ape=function(t){ce(e,t);var i=Ipe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"hexagon",4,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(gn);function Rpe(t){var i=Dpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Dpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Mpe=function(t){ce(e,t);var i=Rpe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"star",4,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(gn);function Npe(t){var i=Fpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Fpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Bpe=function(t){ce(e,t);var i=Npe(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o._setMargins(a),o}return F(e,[{key:"resize",value:function(n,a,o){this.needsRefresh(a,o)&&(this.textSize=this.labelModule.getTextSize(n,a,o),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(n,a,o,s,u,l){this.resize(n,s,u),this.left=a-this.width/2,this.top=o-this.height/2,this.enableShadow(n,l),this.labelModule.draw(n,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,u),this.disableShadow(n,l),this.updateBoundingBox(a,o,n,s,u)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(ni);function Lpe(t){var i=jpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function jpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var zpe=function(t){ce(e,t);var i=Lpe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"triangle",3,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(gn);function Hpe(t){var i=Wpe();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Wpe(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Vpe=function(t){ce(e,t);var i=Hpe(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"draw",value:function(n,a,o,s,u,l){return this._drawShape(n,"triangleDown",3,a,o,s,u,l)}},{key:"distanceToBorder",value:function(n,a){return this._distanceToBorder(n,a)}}]),e}(gn);function T0(t,i){var e=Te(t);if(sn){var r=sn(t);i&&(r=St(r).call(r,function(n){return vn(t,n).enumerable})),e.push.apply(e,r)}return e}function x0(t){for(var i=1;i<arguments.length;i++){var e,r,n=arguments[i]!=null?arguments[i]:{};i%2?ge(e=T0(Object(n),!0)).call(e,function(a){Ml(t,a,n[a])}):un?Al(t,un(n)):ge(r=T0(Object(n))).call(r,function(a){Rl(t,a,vn(n,a))})}return t}var kt=function(){function t(i,e,r,n,a,o){N(this,t),this.options=tn(a),this.globalOptions=a,this.defaultOptions=o,this.body=e,this.edges=[],this.id=void 0,this.imagelist=r,this.grouplist=n,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new AP(this.body,this.options,!1),this.setOptions(i)}return F(t,[{key:"attachEdge",value:function(e){var r;ae(r=this.edges).call(r,e)===-1&&this.edges.push(e)}},{key:"detachEdge",value:function(e){var r,n=ae(r=this.edges).call(r,e);if(n!=-1){var a;Or(a=this.edges).call(a,n,1)}}},{key:"setOptions",value:function(e){var r=this.options.shape;if(e){if(typeof e.color<"u"&&(this._localColor=e.color),e.id!==void 0&&(this.id=e.id),this.id===void 0)throw new Error("Node must have an id");t.checkMass(e,this.id),e.x!==void 0&&(e.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=Xt(e.x),this.predefinedPosition=!0)),e.y!==void 0&&(e.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=Xt(e.y),this.predefinedPosition=!0)),e.size!==void 0&&(this.baseSize=e.size),e.value!==void 0&&(e.value=kP(e.value)),t.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);var n=[e,this.options,this.defaultOptions];return this.chooser=Oy("node",n),this._load_images(),this.updateLabelModule(e),e.opacity!==void 0&&t.checkOpacity(e.opacity)&&(this.options.opacity=e.opacity),this.updateShape(r),e.hidden!==void 0||e.physics!==void 0}}},{key:"_load_images",value:function(){if((this.options.shape==="circularImage"||this.options.shape==="image")&&this.options.image===void 0)throw new Error("Option image must be defined for node type '"+this.options.shape+"'");if(this.options.image!==void 0){if(this.imagelist===void 0)throw new Error("Internal Error: No images provided");if(typeof this.options.image=="string")this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(this.options.image.unselected===void 0)throw new Error("No unselected image provided");this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),this.options.image.selected!==void 0?this.imageObjAlt=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id):this.imageObjAlt=void 0}}}},{key:"getFormattingValues",value:function(){var e={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?this.chooser===!0?this.selected?(this.options.borderWidthSelected!=null?e.borderWidth=this.options.borderWidthSelected:e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser=="function"&&(this.chooser(e,this.options.id,this.selected,this.hover),e.shadow===!1&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){var r=this.options.opacity;e.borderColor=jt(e.borderColor,r),e.color=jt(e.color,r),e.shadowColor=jt(e.shadowColor,r)}return e}},{key:"updateLabelModule",value:function(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),t.updateGroupOptions(this.options,x0(x0({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);var r=this.grouplist.get(this.options.group,!1),n=[e,this.options,r,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,n),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateShape",value:function(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new Yve(this.options,this.body,this.labelModule);break;case"circle":this.shape=new epe(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new npe(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new lpe(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new dpe(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new ppe(this.options,this.body,this.labelModule);break;case"dot":this.shape=new mpe(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new O0(this.options,this.body,this.labelModule);break;case"icon":this.shape=new Epe(this.options,this.body,this.labelModule);break;case"image":this.shape=new Tpe(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new kpe(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new Ape(this.options,this.body,this.labelModule);break;case"star":this.shape=new Mpe(this.options,this.body,this.labelModule);break;case"text":this.shape=new Bpe(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new zpe(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new Vpe(this.options,this.body,this.labelModule);break;default:this.shape=new O0(this.options,this.body,this.labelModule);break}this.needsRefresh()}},{key:"select",value:function(){this.selected=!0,this.needsRefresh()}},{key:"unselect",value:function(){this.selected=!1,this.needsRefresh()}},{key:"needsRefresh",value:function(){this.shape.refreshNeeded=!0}},{key:"getTitle",value:function(){return this.options.title}},{key:"distanceToBorder",value:function(e,r){return this.shape.distanceToBorder(e,r)}},{key:"isFixed",value:function(){return this.options.fixed.x&&this.options.fixed.y}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"getLabelSize",value:function(){return this.labelModule.size()}},{key:"setValueRange",value:function(e,r,n){if(this.options.value!==void 0){var a=this.options.scaling.customScalingFunction(e,r,n,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+a*s}this.options.size=this.options.scaling.min+a*o}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}},{key:"draw",value:function(e){var r=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,r)||{}}},{key:"updateBoundingBox",value:function(e){this.shape.updateBoundingBox(this.x,this.y,e)}},{key:"resize",value:function(e){var r=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,r)}},{key:"getItemsOnPoint",value:function(e){var r=[];return this.labelModule.visible()&&Tp(this.labelModule.getSize(),e)&&r.push({nodeId:this.id,labelId:0}),Tp(this.shape.boundingBox,e)&&r.push({nodeId:this.id}),r}},{key:"isOverlappingWith",value:function(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}},{key:"isBoundingBoxOverlappingWith",value:function(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}}],[{key:"checkOpacity",value:function(e){return 0<=e&&e<=1}},{key:"checkCoordinateOrigin",value:function(e){return e===void 0||e==="center"||e==="top-left"}},{key:"updateGroupOptions",value:function(e,r,n){var a;if(n!==void 0){var o=e.group;if(r!==void 0&&r.group!==void 0&&o!==r.group)throw new Error("updateGroupOptions: group values in options don't match.");var s=typeof o=="number"||typeof o=="string"&&o!="";if(s){var u=n.get(o);u.opacity!==void 0&&r.opacity===void 0&&(t.checkOpacity(u.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+u.opacity),u.opacity=void 0));var l=St(a=Bfe(r)).call(a,function(c){return r[c]!=null});l.push("font"),Lu(l,e,u),e.color=pp(e.color)}}}},{key:"parseOptions",value:function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0,s=["color","fixed","shadow"];if(Lu(s,e,r,n),t.checkMass(r),e.opacity!==void 0&&(t.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),r.opacity!==void 0&&(t.checkOpacity(r.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+r.opacity),r.opacity=void 0)),r.shapeProperties&&!t.checkCoordinateOrigin(r.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+r.shapeProperties.coordinateOrigin),Lt(e,r,"shadow",a),r.color!==void 0&&r.color!==null){var u=pp(r.color);cP(e.color,u)}else n===!0&&r.color===null&&(e.color=tn(a.color));r.fixed!==void 0&&r.fixed!==null&&(typeof r.fixed=="boolean"?(e.fixed.x=r.fixed,e.fixed.y=r.fixed):(r.fixed.x!==void 0&&typeof r.fixed.x=="boolean"&&(e.fixed.x=r.fixed.x),r.fixed.y!==void 0&&typeof r.fixed.y=="boolean"&&(e.fixed.y=r.fixed.y))),n===!0&&r.font===null&&(e.font=tn(a.font)),t.updateGroupOptions(e,r,o),r.scaling!==void 0&&Lt(e.scaling,r.scaling,"label",a.scaling)}},{key:"checkMass",value:function(e,r){if(e.mass!==void 0&&e.mass<=0){var n="";r!==void 0&&(n=" in node id: "+r),console.error("%cNegative or zero mass disallowed"+n+", setting mass to 1.",vP),e.mass=1}}}]),t}();function Upe(t,i){var e=typeof pn<"u"&&Br(t)||t["@@iterator"];if(!e){if(ve(t)||(e=Gpe(t))||i&&t&&typeof t.length=="number"){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
94
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Gpe(t,i){var e;if(t){if(typeof t=="string")return P0(t,i);var r=st(e=Object.prototype.toString.call(t)).call(e,8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return ei(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P0(t,i)}}function P0(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,r=new Array(i);e<i;e++)r[e]=t[e];return r}var Kpe=function(){function t(i,e,r,n){var a,o=this;if(N(this,t),this.body=i,this.images=e,this.groups=r,this.layoutEngine=n,this.body.functions.createNode=A(a=this.create).call(a,this),this.nodesListeners={add:function(u,l){o.add(l.items)},update:function(u,l){o.update(l.items,l.data,l.oldData)},remove:function(u,l){o.remove(l.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(u,l,c,h){if(l===u)return .5;var d=1/(l-u);return Math.max(0,(h-u)*d)}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:"center"},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=tn(this.defaultOptions),this.bindEventListeners()}return F(t,[{key:"bindEventListeners",value:function(){var e,r,n=this;this.body.emitter.on("refreshNodes",A(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",A(r=this.refresh).call(r,this)),this.body.emitter.on("destroy",function(){te(n.nodesListeners,function(a,o){n.body.data.nodes&&n.body.data.nodes.off(o,a)}),delete n.body.functions.createNode,delete n.nodesListeners.add,delete n.nodesListeners.update,delete n.nodesListeners.remove,delete n.nodesListeners})}},{key:"setOptions",value:function(e){if(e!==void 0){if(kt.parseOptions(this.options,e),e.opacity!==void 0&&(wp(e.opacity)||!xn(e.opacity)||e.opacity<0||e.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(var r in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,r)&&this.body.nodes[r].updateShape();if(typeof e.font<"u"||typeof e.widthConstraint<"u"||typeof e.heightConstraint<"u")for(var n=0,a=Te(this.body.nodes);n<a.length;n++){var o=a[n];this.body.nodes[o].updateLabelModule(),this.body.nodes[o].needsRefresh()}if(e.size!==void 0)for(var s in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,s)&&this.body.nodes[s].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.data.nodes;if(jO("id",e))this.body.data.nodes=e;else if(ve(e))this.body.data.nodes=new Iu,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new Iu;else throw new TypeError("Array or DataSet expected");if(n&&te(this.nodesListeners,function(s,u){n.off(u,s)}),this.body.nodes={},this.body.data.nodes){var a=this;te(this.nodesListeners,function(s,u){a.body.data.nodes.on(u,s)});var o=this.body.data.nodes.getIds();this.add(o,!0)}r===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n,a=[],o=0;o<e.length;o++){n=e[o];var s=this.body.data.nodes.get(n),u=this.create(s);a.push(u),this.body.nodes[n]=u}this.layoutEngine.positionInitially(a),r===!1&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e,r,n){for(var a=this.body.nodes,o=!1,s=0;s<e.length;s++){var u=e[s],l=a[u],c=r[s];l!==void 0?l.setOptions(c)&&(o=!0):(o=!0,l=this.create(c),a[u]=l)}!o&&n!==void 0&&(o=ffe(r).call(r,function(h,d){var f=n[d];return f&&f.level!==h.level})),o===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){for(var r=this.body.nodes,n=0;n<e.length;n++){var a=e[n];delete r[a]}this.body.emitter.emit("_dataChanged")}},{key:"create",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kt;return new r(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:"refresh",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;te(this.body.nodes,function(n,a){var o=e.body.data.nodes.get(a);o!==void 0&&(r===!0&&n.setOptions({x:null,y:null}),n.setOptions({fixed:!1}),n.setOptions(o))})}},{key:"getPositions",value:function(e){var r={};if(e!==void 0){if(ve(e)===!0){for(var n=0;n<e.length;n++)if(this.body.nodes[e[n]]!==void 0){var a=this.body.nodes[e[n]];r[e[n]]={x:Math.round(a.x),y:Math.round(a.y)}}}else if(this.body.nodes[e]!==void 0){var o=this.body.nodes[e];r[e]={x:Math.round(o.x),y:Math.round(o.y)}}}else for(var s=0;s<this.body.nodeIndices.length;s++){var u=this.body.nodes[this.body.nodeIndices[s]];r[this.body.nodeIndices[s]]={x:Math.round(u.x),y:Math.round(u.y)}}return r}},{key:"getPosition",value:function(e){if(e==null)throw new TypeError("No id was specified for getPosition method.");if(this.body.nodes[e]==null)throw new ReferenceError("NodeId provided for getPosition does not exist. Provided: ".concat(e));return{x:Math.round(this.body.nodes[e].x),y:Math.round(this.body.nodes[e].y)}}},{key:"storePositions",value:function(){var e=[],r=this.body.data.nodes.getDataSet(),n=Upe(r.get()),a;try{for(n.s();!(a=n.n()).done;){var o=a.value,s=o.id,u=this.body.nodes[s],l=Math.round(u.x),c=Math.round(u.y);(o.x!==l||o.y!==c)&&e.push({id:s,x:l,y:c})}}catch(h){n.e(h)}finally{n.f()}r.update(e)}},{key:"getBoundingBox",value:function(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}},{key:"getConnectedNodes",value:function(e,r){var n=[];if(this.body.nodes[e]!==void 0)for(var a=this.body.nodes[e],o={},s=0;s<a.edges.length;s++){var u=a.edges[s];r!=="to"&&u.toId==a.id?o[u.fromId]===void 0&&(n.push(u.fromId),o[u.fromId]=!0):r!=="from"&&u.fromId==a.id&&o[u.toId]===void 0&&(n.push(u.toId),o[u.toId]=!0)}return n}},{key:"getConnectedEdges",value:function(e){var r=[];if(this.body.nodes[e]!==void 0)for(var n=this.body.nodes[e],a=0;a<n.edges.length;a++)r.push(n.edges[a].id);else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return r}},{key:"moveNode",value:function(e,r,n){var a=this;this.body.nodes[e]!==void 0?(this.body.nodes[e].x=Number(r),this.body.nodes[e].y=Number(n),pr(function(){a.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}}]),t}(),Lp={},qpe={get exports(){return Lp},set exports(t){Lp=t}},jp={},Ype={get exports(){return jp},set exports(t){jp=t}},k0=tt,Xpe=function(t){return t!==void 0&&(k0(t,"value")||k0(t,"writable"))},Qpe=q,Zpe=Mt,Jpe=et,ege=Ft,tge=Xpe,rge=aa,nge=El;function NP(t,i){var e=arguments.length<3?t:arguments[2],r,n;if(ege(t)===e)return t[i];if(r=rge.f(t,i),r)return tge(r)?r.value:r.get===void 0?void 0:Zpe(r.get,e);if(Jpe(n=nge(t)))return NP(n,i,e)}Qpe({target:"Reflect",stat:!0},{get:NP});var ige=ie,age=ige.Reflect.get,oge=age,sge=oge,uge=sge,lge=uge,cge=lge,hge=cge;(function(t){t.exports=hge})(Ype);(function(t){t.exports=jp})(qpe);var I0=V(Lp),zp={},dge={get exports(){return zp},set exports(t){zp=t}},Hp={},fge={get exports(){return Hp},set exports(t){Hp=t}},vge=ux,pge=vge,gge=pge,yge=gge;(function(t){t.exports=yge})(fge);(function(t){t.exports=Hp})(dge);var mge=V(zp);function $ge(t,i){for(;!Object.prototype.hasOwnProperty.call(t,i)&&(t=z(t),t!==null););return t}function ou(){if(typeof Reflect<"u"&&I0){var t;ou=xy(t=I0).call(t)}else ou=function(e,r,n){var a=$ge(e,r);if(a){var o=mge(a,r);return o.get?o.get.call(arguments.length<3?e:n):o.value}};return ou.apply(this,arguments)}var Wp={},bge={get exports(){return Wp},set exports(t){Wp=t}},wge=q,C0=Math.hypot,_ge=Math.abs,Ege=Math.sqrt,Sge=!!C0&&C0(1/0,NaN)!==1/0;wge({target:"Math",stat:!0,arity:2,forced:Sge},{hypot:function(i,e){for(var r=0,n=0,a=arguments.length,o=0,s,u;n<a;)s=_ge(arguments[n++]),o<s?(u=o/s,r=r*u*u+1,o=s):s>0?(u=s/o,r+=u*u):r+=s;return o===1/0?1/0:o*Ege(r)}});var Oge=ie,Tge=Oge.Math.hypot,xge=Tge,Pge=xge;(function(t){t.exports=Pge})(bge);var kge=V(Wp);function FP(t){var i=Ige();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Ige(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Me=function(){function t(){N(this,t)}return F(t,null,[{key:"transform",value:function(e,r){ve(e)||(e=[e]);for(var n=r.point.x,a=r.point.y,o=r.angle,s=r.length,u=0;u<e.length;++u){var l=e[u],c=l.x*Math.cos(o)-l.y*Math.sin(o),h=l.x*Math.sin(o)+l.y*Math.cos(o);l.x=n+s*c,l.y=a+s*h}}},{key:"drawPath",value:function(e,r){e.beginPath(),e.moveTo(r[0].x,r[0].y);for(var n=1;n<r.length;++n)e.lineTo(r[n].x,r[n].y);e.closePath()}}]),t}(),Cge=function(t){ce(e,t);var i=FP(e);function e(){return N(this,e),i.apply(this,arguments)}return F(e,null,[{key:"draw",value:function(n,a){if(a.image){n.save(),n.translate(a.point.x,a.point.y),n.rotate(Math.PI/2+a.angle);var o=a.imageWidth!=null?a.imageWidth:a.image.width,s=a.imageHeight!=null?a.imageHeight:a.image.height;a.image.drawImageAtPosition(n,1,-o/2,0,o,s),n.restore()}return!1}}]),e}(Me),Age=function(t){ce(e,t);var i=FP(e);function e(){return N(this,e),i.apply(this,arguments)}return F(e,null,[{key:"draw",value:function(n,a){var o=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return Me.transform(o,a),Me.drawPath(n,o),!0}}]),e}(Me),Rge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return Me.transform(n,r),Me.drawPath(e,n),!0}}]),t}(),Dge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n={x:-.4,y:0};Me.transform(n,r),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";var a=Math.PI,o=r.angle-a/2,s=r.angle+a/2;return e.beginPath(),e.arc(n.x,n.y,r.length*.4,o,s,!1),e.stroke(),!0}}]),t}(),Mge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n={x:-.3,y:0};Me.transform(n,r),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";var a=Math.PI,o=r.angle+a/2,s=r.angle+3*a/2;return e.beginPath(),e.arc(n.x,n.y,r.length*.4,o,s,!1),e.stroke(),!0}}]),t}(),Nge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return Me.transform(n,r),Me.drawPath(e,n),!0}}]),t}(),Fge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return Me.transform(n,r),Me.drawPath(e,n),!0}}]),t}(),Bge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n={x:-.4,y:0};return Me.transform(n,r),Gg(e,n.x,n.y,r.length*.4),!0}}]),t}(),Lge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return Me.transform(n,r),Me.drawPath(e,n),!0}}]),t}(),jge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return Me.transform(n,r),Me.drawPath(e,n),!0}}]),t}(),zge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return Me.transform(n,r),Me.drawPath(e,n),!0}}]),t}(),Hge=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return Me.transform(n,r),Me.drawPath(e,n),!0}}]),t}(),BP=function(){function t(){N(this,t)}return F(t,null,[{key:"draw",value:function(e,r){var n;switch(r.type&&(n=r.type.toLowerCase()),n){case"image":return Cge.draw(e,r);case"circle":return Bge.draw(e,r);case"box":return jge.draw(e,r);case"crow":return Rge.draw(e,r);case"curve":return Dge.draw(e,r);case"diamond":return zge.draw(e,r);case"inv_curve":return Mge.draw(e,r);case"triangle":return Nge.draw(e,r);case"inv_triangle":return Fge.draw(e,r);case"bar":return Lge.draw(e,r);case"vee":return Hge.draw(e,r);case"arrow":default:return Age.draw(e,r)}}}]),t}();function A0(t,i){var e=Te(t);if(sn){var r=sn(t);i&&(r=St(r).call(r,function(n){return vn(t,n).enumerable})),e.push.apply(e,r)}return e}function R0(t){for(var i=1;i<arguments.length;i++){var e,r,n=arguments[i]!=null?arguments[i]:{};i%2?ge(e=A0(Object(n),!0)).call(e,function(a){Ml(t,a,n[a])}):un?Al(t,un(n)):ge(r=A0(Object(n))).call(r,function(a){Rl(t,a,vn(n,a))})}return t}var LP=function(){function t(i,e,r){N(this,t),this._body=e,this._labelModule=r,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(i),this.fromPoint=this.from,this.toPoint=this.to}return F(t,[{key:"connect",value:function(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}},{key:"cleanup",value:function(){return!1}},{key:"setOptions",value:function(e){this.options=e,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}},{key:"drawLine",value:function(e,r,n,a){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,r),e.lineWidth=r.width,r.dashes!==!1?this._drawDashedLine(e,r,o):this._drawLine(e,r,o)}},{key:"_drawLine",value:function(e,r,n,a,o){if(this.from!=this.to)this._line(e,r,n,a,o);else{var s=this._getCircleData(e),u=xe(s,3),l=u[0],c=u[1],h=u[2];this._circle(e,r,l,c,h)}}},{key:"_drawDashedLine",value:function(e,r,n,a,o){e.lineCap="round";var s=ve(r.dashes)?r.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(s),e.lineDashOffset=0,this.from!=this.to)this._line(e,r,n);else{var u=this._getCircleData(e),l=xe(u,3),c=l[0],h=l[1],d=l[2];this._circle(e,r,c,h,d)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)uT(e,this.from.x,this.from.y,this.to.x,this.to.y,s);else{var f=this._getCircleData(e),v=xe(f,3),g=v[0],b=v[1],p=v[2];this._circle(e,r,g,b,p)}this.enableShadow(e,r),e.stroke(),this.disableShadow(e,r)}}},{key:"findBorderPosition",value:function(e,r,n){return this.from!=this.to?this._findBorderPosition(e,r,n):this._findBorderPositionCircle(e,r,n)}},{key:"findBorderPositions",value:function(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};var r,n=st(r=this._getCircleData(e)).call(r,0,2),a=xe(n,2),o=a[0],s=a[1];return{from:this._findBorderPositionCircle(this.from,e,{x:o,y:s,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:o,y:s,low:.6,high:.8,direction:1})}}},{key:"_getCircleData",value:function(e){var r=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);var n=IP(e,this.options.selfReference.angle,r,this.from);return[n.x,n.y,r]}},{key:"_pointOnCircle",value:function(e,r,n,a){var o=a*2*Math.PI;return{x:e+n*Math.cos(o),y:r-n*Math.sin(o)}}},{key:"_findBorderPositionCircle",value:function(e,r,n){var a=n.x,o=n.y,s=n.low,u=n.high,l=n.direction,c=10,h=this.options.selfReference.size,d=.05,f,v=(s+u)*.5,g=0;this.options.arrowStrikethrough===!0&&(l===-1?g=this.options.endPointOffset.from:l===1&&(g=this.options.endPointOffset.to));var b=0;do{v=(s+u)*.5,f=this._pointOnCircle(a,o,h,v);var p=Math.atan2(e.y-f.y,e.x-f.x),$=e.distanceToBorder(r,p)+g,m=Math.sqrt(Math.pow(f.x-e.x,2)+Math.pow(f.y-e.y,2)),y=$-m;if(Math.abs(y)<d)break;y>0?l>0?s=v:u=v:l>0?u=v:s=v,++b}while(s<=u&&b<c);return R0(R0({},f),{},{t:v})}},{key:"getLineWidth",value:function(e,r){return e===!0?Math.max(this.selectionWidth,.3/this._body.view.scale):r===!0?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}},{key:"getColor",value:function(e,r){if(r.inheritsColor!==!1){if(r.inheritsColor==="both"&&this.from.id!==this.to.id){var n=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),a=this.from.options.color.highlight.border,o=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(a=jt(this.from.options.color.border,r.opacity),o=jt(this.to.options.color.border,r.opacity)):this.from.selected===!0&&this.to.selected===!1?o=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(a=this.from.options.color.border),n.addColorStop(0,a),n.addColorStop(1,o),n}return r.inheritsColor==="to"?jt(this.to.options.color.border,r.opacity):jt(this.from.options.color.border,r.opacity)}else return jt(r.color,r.opacity)}},{key:"_circle",value:function(e,r,n,a,o){this.enableShadow(e,r);var s=0,u=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){var l=this.options.selfReference.angle,c=this.options.selfReference.angle+Math.PI,h=this._findBorderPositionCircle(this.from,e,{x:n,y:a,low:l,high:c,direction:-1}),d=this._findBorderPositionCircle(this.from,e,{x:n,y:a,low:l,high:c,direction:1});s=Math.atan2(h.y-a,h.x-n),u=Math.atan2(d.y-a,d.x-n)}e.beginPath(),e.arc(n,a,o,s,u,!1),e.stroke(),this.disableShadow(e,r)}},{key:"getDistanceToEdge",value:function(e,r,n,a,o,s){if(this.from!=this.to)return this._getDistanceToEdge(e,r,n,a,o,s);var u=this._getCircleData(void 0),l=xe(u,3),c=l[0],h=l[1],d=l[2],f=c-o,v=h-s;return Math.abs(Math.sqrt(f*f+v*v)-d)}},{key:"_getDistanceToLine",value:function(e,r,n,a,o,s){var u=n-e,l=a-r,c=u*u+l*l,h=((o-e)*u+(s-r)*l)/c;h>1?h=1:h<0&&(h=0);var d=e+h*u,f=r+h*l,v=d-o,g=f-s;return Math.sqrt(v*v+g*g)}},{key:"getArrowData",value:function(e,r,n,a,o,s){var u,l,c,h,d,f,v,g=s.width;r==="from"?(c=this.from,h=this.to,d=s.fromArrowScale<0,f=Math.abs(s.fromArrowScale),v=s.fromArrowType):r==="to"?(c=this.to,h=this.from,d=s.toArrowScale<0,f=Math.abs(s.toArrowScale),v=s.toArrowType):(c=this.to,h=this.from,d=s.middleArrowScale<0,f=Math.abs(s.middleArrowScale),v=s.middleArrowType);var b=15*f+3*g;if(c!=h){var p=kge(c.x-h.x,c.y-h.y),$=b/p;if(r!=="middle")if(this.options.smooth.enabled===!0){var m=this._findBorderPosition(c,e,{via:n}),y=this.getPoint(m.t+$*(r==="from"?1:-1),n);u=Math.atan2(m.y-y.y,m.x-y.x),l=m}else u=Math.atan2(c.y-h.y,c.x-h.x),l=this._findBorderPosition(c,e);else{var w=(d?-$:$)/2,S=this.getPoint(.5+w,n),T=this.getPoint(.5-w,n);u=Math.atan2(S.y-T.y,S.x-T.x),l=this.getPoint(.5,n)}}else{var O=this._getCircleData(e),_=xe(O,3),E=_[0],I=_[1],j=_[2];if(r==="from"){var B=this.options.selfReference.angle,X=this.options.selfReference.angle+Math.PI,ne=this._findBorderPositionCircle(this.from,e,{x:E,y:I,low:B,high:X,direction:-1});u=ne.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,l=ne}else if(r==="to"){var re=this.options.selfReference.angle,le=this.options.selfReference.angle+Math.PI,we=this._findBorderPositionCircle(this.from,e,{x:E,y:I,low:re,high:le,direction:1});u=we.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,l=we}else{var Oe=this.options.selfReference.angle/(2*Math.PI);l=this._pointOnCircle(E,I,j,Oe),u=Oe*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}var ar=l.x-b*.9*Math.cos(u),nt=l.y-b*.9*Math.sin(u),_e={x:ar,y:nt};return{point:l,core:_e,angle:u,length:b,type:v}}},{key:"drawArrowHead",value:function(e,r,n,a,o){e.strokeStyle=this.getColor(e,r),e.fillStyle=e.strokeStyle,e.lineWidth=r.width;var s=BP.draw(e,o);s&&(this.enableShadow(e,r),ts(e).call(e),this.disableShadow(e,r))}},{key:"enableShadow",value:function(e,r){r.shadow===!0&&(e.shadowColor=r.shadowColor,e.shadowBlur=r.shadowSize,e.shadowOffsetX=r.shadowX,e.shadowOffsetY=r.shadowY)}},{key:"disableShadow",value:function(e,r){r.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"drawBackground",value:function(e,r){if(r.background!==!1){var n={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=r.backgroundColor,e.lineWidth=r.backgroundSize,this.setStrokeDashed(e,r.backgroundDashes),e.stroke(),e.strokeStyle=n.strokeStyle,e.lineWidth=n.lineWidth,e.dashes=n.dashes,this.setStrokeDashed(e,r.dashes)}}},{key:"setStrokeDashed",value:function(e,r){if(r!==!1)if(e.setLineDash!==void 0){var n=ve(r)?r:[5,5];e.setLineDash(n)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}]),t}();function D0(t,i){var e=Te(t);if(sn){var r=sn(t);i&&(r=St(r).call(r,function(n){return vn(t,n).enumerable})),e.push.apply(e,r)}return e}function M0(t){for(var i=1;i<arguments.length;i++){var e,r,n=arguments[i]!=null?arguments[i]:{};i%2?ge(e=D0(Object(n),!0)).call(e,function(a){Ml(t,a,n[a])}):un?Al(t,un(n)):ge(r=D0(Object(n))).call(r,function(a){Rl(t,a,vn(n,a))})}return t}function Wge(t){var i=Vge();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Vge(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var ky=function(t){ce(e,t);var i=Wge(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"_findBorderPositionBezier",value:function(n,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),s=10,u=.2,l=!1,c=1,h=0,d=this.to,f,v,g=this.options.endPointOffset?this.options.endPointOffset.to:0;n.id===this.from.id&&(d=this.from,l=!0,g=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(g=0);var b=0;do{v=(h+c)*.5,f=this.getPoint(v,o);var p=Math.atan2(d.y-f.y,d.x-f.x),$=d.distanceToBorder(a,p)+g,m=Math.sqrt(Math.pow(f.x-d.x,2)+Math.pow(f.y-d.y,2)),y=$-m;if(Math.abs(y)<u)break;y<0?l===!1?h=v:c=v:l===!1?c=v:h=v,++b}while(h<=c&&b<s);return M0(M0({},f),{},{t:v})}},{key:"_getDistanceToBezierEdge",value:function(n,a,o,s,u,l,c){var h=1e9,d,f,v,g,b,p=n,$=a;for(f=1;f<10;f++)v=.1*f,g=Math.pow(1-v,2)*n+2*v*(1-v)*c.x+Math.pow(v,2)*o,b=Math.pow(1-v,2)*a+2*v*(1-v)*c.y+Math.pow(v,2)*s,f>0&&(d=this._getDistanceToLine(p,$,g,b,u,l),h=d<h?d:h),p=g,$=b;return h}},{key:"_bezierCurve",value:function(n,a,o,s){n.beginPath(),n.moveTo(this.fromPoint.x,this.fromPoint.y),o!=null&&o.x!=null?s!=null&&s.x!=null?n.bezierCurveTo(o.x,o.y,s.x,s.y,this.toPoint.x,this.toPoint.y):n.quadraticCurveTo(o.x,o.y,this.toPoint.x,this.toPoint.y):n.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(n,a),this.enableShadow(n,a),n.stroke(),this.disableShadow(n,a)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}}]),e}(LP);function Uge(t){var i=Gge();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Gge(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var N0=function(t){ce(e,t);var i=Uge(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o.via=o.via,o._boundFunction=function(){o.positionBezierNode()},o._body.emitter.on("_repositionBezierNodes",o._boundFunction),o}return F(e,[{key:"setOptions",value:function(n){ou(z(e.prototype),"setOptions",this).call(this,n);var a=!1;this.options.physics!==n.physics&&(a=!0),this.options=n,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),a===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}},{key:"connect",value:function(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}},{key:"cleanup",value:function(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),this.via!==void 0?(delete this._body.nodes[this.via.id],this.via=void 0,!0):!1}},{key:"setupSupportNode",value:function(){if(this.via===void 0){var n="edgeId:"+this.id,a=this._body.functions.createNode({id:n,shape:"circle",physics:!0,hidden:!0});this._body.nodes[n]=a,this.via=a,this.via.parentEdgeId=this.id,this.positionBezierNode()}}},{key:"positionBezierNode",value:function(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}},{key:"_line",value:function(n,a,o){this._bezierCurve(n,a,o)}},{key:"_getViaCoordinates",value:function(){return this.via}},{key:"getViaNode",value:function(){return this.via}},{key:"getPoint",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){var o=this._getCircleData(),s=xe(o,3),u=s[0],l=s[1],c=s[2],h=2*Math.PI*(1-n);return{x:u+c*Math.sin(h),y:l+c-c*(1-Math.cos(h))}}else return{x:Math.pow(1-n,2)*this.fromPoint.x+2*n*(1-n)*a.x+Math.pow(n,2)*this.toPoint.x,y:Math.pow(1-n,2)*this.fromPoint.y+2*n*(1-n)*a.y+Math.pow(n,2)*this.toPoint.y}}},{key:"_findBorderPosition",value:function(n,a){return this._findBorderPositionBezier(n,a,this.via)}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){return this._getDistanceToBezierEdge(n,a,o,s,u,l,this.via)}}]),e}(ky);function Kge(t){var i=qge();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function qge(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var F0=function(t){ce(e,t);var i=Kge(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"_line",value:function(n,a,o){this._bezierCurve(n,a,o)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var n=this.options.smooth.roundness,a=this.options.smooth.type,o=Math.abs(this.from.x-this.to.x),s=Math.abs(this.from.y-this.to.y);if(a==="discrete"||a==="diagonalCross"){var u,l;o<=s?u=l=n*s:u=l=n*o,this.from.x>this.to.x&&(u=-u),this.from.y>=this.to.y&&(l=-l);var c=this.from.x+u,h=this.from.y+l;return a==="discrete"&&(o<=s?c=o<n*s?this.from.x:c:h=s<n*o?this.from.y:h),{x:c,y:h}}else if(a==="straightCross"){var d=(1-n)*o,f=(1-n)*s;return o<=s?(d=0,this.from.y<this.to.y&&(f=-f)):(this.from.x<this.to.x&&(d=-d),f=0),{x:this.to.x+d,y:this.to.y+f}}else if(a==="horizontal"){var v=(1-n)*o;return this.from.x<this.to.x&&(v=-v),{x:this.to.x+v,y:this.from.y}}else if(a==="vertical"){var g=(1-n)*s;return this.from.y<this.to.y&&(g=-g),{x:this.from.x,y:this.to.y+g}}else if(a==="curvedCW"){o=this.to.x-this.from.x,s=this.from.y-this.to.y;var b=Math.sqrt(o*o+s*s),p=Math.PI,$=Math.atan2(s,o),m=($+(n*.5+.5)*p)%(2*p);return{x:this.from.x+(n*.5+.5)*b*Math.sin(m),y:this.from.y+(n*.5+.5)*b*Math.cos(m)}}else if(a==="curvedCCW"){o=this.to.x-this.from.x,s=this.from.y-this.to.y;var y=Math.sqrt(o*o+s*s),w=Math.PI,S=Math.atan2(s,o),T=(S+(-n*.5+.5)*w)%(2*w);return{x:this.from.x+(n*.5+.5)*y*Math.sin(T),y:this.from.y+(n*.5+.5)*y*Math.cos(T)}}else{var O,_;o<=s?O=_=n*s:O=_=n*o,this.from.x>this.to.x&&(O=-O),this.from.y>=this.to.y&&(_=-_);var E=this.from.x+O,I=this.from.y+_;return o<=s?this.from.x<=this.to.x?E=this.to.x<E?this.to.x:E:E=this.to.x>E?this.to.x:E:this.from.y>=this.to.y?I=this.to.y>I?this.to.y:I:I=this.to.y<I?this.to.y:I,{x:E,y:I}}}},{key:"_findBorderPosition",value:function(n,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(n,a,o.via)}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){var c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(n,a,o,s,u,l,c)}},{key:"getPoint",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),o=n,s=Math.pow(1-o,2)*this.fromPoint.x+2*o*(1-o)*a.x+Math.pow(o,2)*this.toPoint.x,u=Math.pow(1-o,2)*this.fromPoint.y+2*o*(1-o)*a.y+Math.pow(o,2)*this.toPoint.y;return{x:s,y:u}}}]),e}(ky);function Yge(t){var i=Xge();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Xge(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var Qge=function(t){ce(e,t);var i=Yge(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"_getDistanceToBezierEdge2",value:function(n,a,o,s,u,l,c,h){for(var d=1e9,f=n,v=a,g=[0,0,0,0],b=1;b<10;b++){var p=.1*b;g[0]=Math.pow(1-p,3),g[1]=3*p*Math.pow(1-p,2),g[2]=3*Math.pow(p,2)*(1-p),g[3]=Math.pow(p,3);var $=g[0]*n+g[1]*c.x+g[2]*h.x+g[3]*o,m=g[0]*a+g[1]*c.y+g[2]*h.y+g[3]*s;if(b>0){var y=this._getDistanceToLine(f,v,$,m,u,l);d=y<d?y:d}f=$,v=m}return d}}]),e}(ky);function Zge(t){var i=Jge();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function Jge(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var B0=function(t){ce(e,t);var i=Zge(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"_line",value:function(n,a,o){var s=o[0],u=o[1];this._bezierCurve(n,a,s,u)}},{key:"_getViaCoordinates",value:function(){var n=this.from.x-this.to.x,a=this.from.y-this.to.y,o,s,u,l,c=this.options.smooth.roundness;return(Math.abs(n)>Math.abs(a)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(s=this.from.y,l=this.to.y,o=this.from.x-c*n,u=this.to.x+c*n):(s=this.from.y-c*a,l=this.to.y+c*a,o=this.from.x,u=this.to.x),[{x:o,y:s},{x:u,y:l}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(n,a){return this._findBorderPositionBezier(n,a)}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){var c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates(),h=xe(c,2),d=h[0],f=h[1];return this._getDistanceToBezierEdge2(n,a,o,s,u,l,d,f)}},{key:"getPoint",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),o=xe(a,2),s=o[0],u=o[1],l=n,c=[Math.pow(1-l,3),3*l*Math.pow(1-l,2),3*Math.pow(l,2)*(1-l),Math.pow(l,3)],h=c[0]*this.fromPoint.x+c[1]*s.x+c[2]*u.x+c[3]*this.toPoint.x,d=c[0]*this.fromPoint.y+c[1]*s.y+c[2]*u.y+c[3]*this.toPoint.y;return{x:h,y:d}}}]),e}(Qge);function eye(t){var i=tye();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function tye(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var L0=function(t){ce(e,t);var i=eye(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"_line",value:function(n,a){n.beginPath(),n.moveTo(this.fromPoint.x,this.fromPoint.y),n.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(n,a),n.stroke(),this.disableShadow(n,a)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(n){return{x:(1-n)*this.fromPoint.x+n*this.toPoint.x,y:(1-n)*this.fromPoint.y+n*this.toPoint.y}}},{key:"_findBorderPosition",value:function(n,a){var o=this.to,s=this.from;n.id===this.from.id&&(o=this.from,s=this.to);var u=Math.atan2(o.y-s.y,o.x-s.x),l=o.x-s.x,c=o.y-s.y,h=Math.sqrt(l*l+c*c),d=n.distanceToBorder(a,u),f=(h-d)/h;return{x:(1-f)*s.x+f*o.x,y:(1-f)*s.y+f*o.y,t:0}}},{key:"_getDistanceToEdge",value:function(n,a,o,s,u,l){return this._getDistanceToLine(n,a,o,s,u,l)}}]),e}(LP),Ci=function(){function t(i,e,r,n,a){if(N(this,t),e===void 0)throw new Error("No body provided");this.options=tn(n),this.globalOptions=n,this.defaultOptions=a,this.body=e,this.imagelist=r,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new AP(this.body,this.options,!0),this.setOptions(i)}return F(t,[{key:"setOptions",value:function(e){if(e){var r=typeof e.physics<"u"&&this.options.physics!==e.physics||typeof e.hidden<"u"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from<"u"&&this.options.from!==e.from||typeof e.to<"u"&&this.options.to!==e.to;t.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=kP(e.value));var n=[e,this.options,this.defaultOptions];return this.chooser=Oy("edge",n),this.updateLabelModule(e),r=this.updateEdgeType()||r,this._setInteractionWidths(),this.connect(),r}}},{key:"getFormattingValues",value:function(){var e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,r=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,n=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,a=this.options.color.inherit,o={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:n,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:r,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:a?void 0:this.options.color.color,inheritsColor:a,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(this.chooser===!0){if(this.selected){var s=this.options.selectionWidth;typeof s=="function"?o.width=s(o.width):typeof s=="number"&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.highlight,o.shadow=this.options.shadow.enabled}else if(this.hover){var u=this.options.hoverWidth;typeof u=="function"?o.width=u(o.width):typeof u=="number"&&(o.width+=u),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.hover,o.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(o,this.options.id,this.selected,this.hover),o.color!==void 0&&(o.inheritsColor=!1),o.shadow===!1&&(o.shadowColor!==this.options.shadow.color||o.shadowSize!==this.options.shadow.size||o.shadowX!==this.options.shadow.x||o.shadowY!==this.options.shadow.y)&&(o.shadow=!0));else o.shadow=this.options.shadow.enabled,o.width=Math.max(o.width,.3/this.body.view.scale);return o}},{key:"updateLabelModule",value:function(e){var r=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,r),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var e=this.options.smooth,r=!1,n=!0;return this.edgeType!==void 0&&((this.edgeType instanceof N0&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof B0&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof F0&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof L0&&e.type.enabled===!1)&&(n=!1),n===!0&&(r=this.cleanup())),n===!0?e.enabled===!0?e.type==="dynamic"?(r=!0,this.edgeType=new N0(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new B0(this.options,this.body,this.labelModule):this.edgeType=new F0(this.options,this.body,this.labelModule):this.edgeType=new L0(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),r}},{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=this.from!==void 0&&this.to!==void 0,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{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(e,r,n){if(this.options.value!==void 0){var a=this.options.scaling.customScalingFunction(e,r,n,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+a*s}this.options.width=this.options.scaling.min+a*o}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){typeof this.options.hoverWidth=="function"?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth=="function"?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}},{key:"draw",value:function(e){var r=this.getFormattingValues();if(!r.hidden){var n=this.edgeType.getViaNode();this.edgeType.drawLine(e,r,this.selected,this.hover,n),this.drawLabel(e,n)}}},{key:"drawArrows",value:function(e){var r=this.getFormattingValues();if(!r.hidden){var n=this.edgeType.getViaNode(),a={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,r.fromArrow&&(a.from=this.edgeType.getArrowData(e,"from",n,this.selected,this.hover,r),r.arrowStrikethrough===!1&&(this.edgeType.fromPoint=a.from.core),r.fromArrowSrc&&(a.from.image=this.imagelist.load(r.fromArrowSrc)),r.fromArrowImageWidth&&(a.from.imageWidth=r.fromArrowImageWidth),r.fromArrowImageHeight&&(a.from.imageHeight=r.fromArrowImageHeight)),r.toArrow&&(a.to=this.edgeType.getArrowData(e,"to",n,this.selected,this.hover,r),r.arrowStrikethrough===!1&&(this.edgeType.toPoint=a.to.core),r.toArrowSrc&&(a.to.image=this.imagelist.load(r.toArrowSrc)),r.toArrowImageWidth&&(a.to.imageWidth=r.toArrowImageWidth),r.toArrowImageHeight&&(a.to.imageHeight=r.toArrowImageHeight)),r.middleArrow&&(a.middle=this.edgeType.getArrowData(e,"middle",n,this.selected,this.hover,r),r.middleArrowSrc&&(a.middle.image=this.imagelist.load(r.middleArrowSrc)),r.middleArrowImageWidth&&(a.middle.imageWidth=r.middleArrowImageWidth),r.middleArrowImageHeight&&(a.middle.imageHeight=r.middleArrowImageHeight)),r.fromArrow&&this.edgeType.drawArrowHead(e,r,this.selected,this.hover,a.from),r.middleArrow&&this.edgeType.drawArrowHead(e,r,this.selected,this.hover,a.middle),r.toArrow&&this.edgeType.drawArrowHead(e,r,this.selected,this.hover,a.to)}}},{key:"drawLabel",value:function(e,r){if(this.options.label!==void 0){var n=this.from,a=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);var o;if(n.id!=a.id){this.labelModule.pointToSelf=!1,o=this.edgeType.getPoint(.5,r),e.save();var s=this._getRotation(e);s.angle!=0&&(e.translate(s.x,s.y),e.rotate(s.angle)),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;var u=IP(e,this.options.selfReference.angle,this.options.selfReference.size,n);o=this._pointOnCircle(u.x,u.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover)}}}},{key:"getItemsOnPoint",value:function(e){var r=[];if(this.labelModule.visible()){var n=this._getRotation();Tp(this.labelModule.getSize(),e,n)&&r.push({edgeId:this.id,labelId:0})}var a={left:e.x,top:e.y};return this.isOverlappingWith(a)&&r.push({edgeId:this.id}),r}},{key:"isOverlappingWith",value:function(e){if(this.connected){var r=10,n=this.from.x,a=this.from.y,o=this.to.x,s=this.to.y,u=e.left,l=e.top,c=this.edgeType.getDistanceToEdge(n,a,o,s,u,l);return c<r}else return!1}},{key:"_getRotation",value:function(e){var r=this.edgeType.getViaNode(),n=this.edgeType.getPoint(.5,r);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,n.x,n.y);var a={x:n.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return a;var o=this.from.y-this.to.y,s=this.from.x-this.to.x,u=Math.atan2(o,s);return(u<-1&&s<0||u>0&&s<0)&&(u+=Math.PI),a.angle=u,a}},{key:"_pointOnCircle",value:function(e,r,n,a){return{x:e+n*Math.cos(a),y:r-n*Math.sin(a)}}},{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 this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}}],[{key:"parseOptions",value:function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,s=["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"];if(pa(s,e,r,n),r.endPointOffset!==void 0&&r.endPointOffset.from!==void 0&&(xn(r.endPointOffset.from)?e.endPointOffset.from=r.endPointOffset.from:(e.endPointOffset.from=a.endPointOffset.from!==void 0?a.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),r.endPointOffset!==void 0&&r.endPointOffset.to!==void 0&&(xn(r.endPointOffset.to)?e.endPointOffset.to=r.endPointOffset.to:(e.endPointOffset.to=a.endPointOffset.to!==void 0?a.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),Hu(r.label)?e.label=r.label:Hu(e.label)||(e.label=void 0),Lt(e,r,"smooth",a),Lt(e,r,"shadow",a),Lt(e,r,"background",a),r.dashes!==void 0&&r.dashes!==null?e.dashes=r.dashes:n===!0&&r.dashes===null&&(e.dashes=Rn(a.dashes)),r.scaling!==void 0&&r.scaling!==null?(r.scaling.min!==void 0&&(e.scaling.min=r.scaling.min),r.scaling.max!==void 0&&(e.scaling.max=r.scaling.max),Lt(e.scaling,r.scaling,"label",a.scaling)):n===!0&&r.scaling===null&&(e.scaling=Rn(a.scaling)),r.arrows!==void 0&&r.arrows!==null)if(typeof r.arrows=="string"){var u=r.arrows.toLowerCase();e.arrows.to.enabled=ae(u).call(u,"to")!=-1,e.arrows.middle.enabled=ae(u).call(u,"middle")!=-1,e.arrows.from.enabled=ae(u).call(u,"from")!=-1}else if(he(r.arrows)==="object")Lt(e.arrows,r.arrows,"to",a.arrows),Lt(e.arrows,r.arrows,"middle",a.arrows),Lt(e.arrows,r.arrows,"from",a.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+es(r.arrows));else n===!0&&r.arrows===null&&(e.arrows=Rn(a.arrows));if(r.color!==void 0&&r.color!==null){var l=Kr(r.color)?{color:r.color,highlight:r.color,hover:r.color,inherit:!1,opacity:1}:r.color,c=e.color;if(o)$e(c,a.color,!1,n);else for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&delete c[h];if(Kr(c))c.color=c,c.highlight=c,c.hover=c,c.inherit=!1,l.opacity===void 0&&(c.opacity=1);else{var d=!1;l.color!==void 0&&(c.color=l.color,d=!0),l.highlight!==void 0&&(c.highlight=l.highlight,d=!0),l.hover!==void 0&&(c.hover=l.hover,d=!0),l.inherit!==void 0&&(c.inherit=l.inherit),l.opacity!==void 0&&(c.opacity=Math.min(1,Math.max(0,l.opacity))),d===!0?c.inherit=!1:c.inherit===void 0&&(c.inherit="from")}}else n===!0&&r.color===null&&(e.color=tn(a.color));n===!0&&r.font===null&&(e.font=tn(a.font)),Object.prototype.hasOwnProperty.call(r,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),e.selfReference.size=r.selfReferenceSize)}}]),t}(),rye=function(){function t(i,e,r){var n,a=this;N(this,t),this.body=i,this.images=e,this.groups=r,this.body.functions.createEdge=A(n=this.create).call(n,this),this.edgesListeners={add:function(s,u){a.add(u.items)},update:function(s,u){a.update(u.items)},remove:function(s,u){a.remove(u.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(s,u,l,c){if(u===s)return .5;var h=1/(u-s);return Math.max(0,(c-s)*h)}},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},$e(this.options,this.defaultOptions),this.bindEventListeners()}return F(t,[{key:"bindEventListeners",value:function(){var e=this,r,n;this.body.emitter.on("_forceDisableDynamicCurves",function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;a==="dynamic"&&(a="continuous");var s=!1;for(var u in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,u)){var l=e.body.edges[u],c=e.body.data.edges.get(u);if(c!=null){var h=c.smooth;h!==void 0&&h.enabled===!0&&h.type==="dynamic"&&(a===void 0?l.setOptions({smooth:!1}):l.setOptions({smooth:{type:a}}),s=!0)}}o===!0&&s===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",function(){e.reconnectEdges()}),this.body.emitter.on("refreshEdges",A(r=this.refresh).call(r,this)),this.body.emitter.on("refresh",A(n=this.refresh).call(n,this)),this.body.emitter.on("destroy",function(){te(e.edgesListeners,function(a,o){e.body.data.edges&&e.body.data.edges.off(o,a)}),delete e.body.functions.createEdge,delete e.edgesListeners.add,delete e.edgesListeners.update,delete e.edgesListeners.remove,delete e.edgesListeners})}},{key:"setOptions",value:function(e){if(e!==void 0){Ci.parseOptions(this.options,e,!0,this.defaultOptions,!0);var r=!1;if(e.smooth!==void 0)for(var n in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,n)&&(r=this.body.edges[n].updateEdgeType()||r);if(e.font!==void 0)for(var a in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,a)&&this.body.edges[a].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||r===!0)&&this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var r=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.body.data.edges;if(jO("id",e))this.body.data.edges=e;else if(ve(e))this.body.data.edges=new Iu,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new Iu;else throw new TypeError("Array or DataSet expected");if(a&&te(this.edgesListeners,function(s,u){a.off(u,s)}),this.body.edges={},this.body.data.edges){te(this.edgesListeners,function(s,u){r.body.data.edges.on(u,s)});var o=this.body.data.edges.getIds();this.add(o,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),n===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.edges,a=this.body.data.edges,o=0;o<e.length;o++){var s=e[o],u=n[s];u&&u.disconnect();var l=a.get(s,{showInternalIds:!0});n[s]=this.create(l)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),r===!1&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e){for(var r=this.body.edges,n=this.body.data.edges,a=!1,o=0;o<e.length;o++){var s=e[o],u=n.get(s),l=r[s];l!==void 0?(l.disconnect(),a=l.setOptions(u)||a,l.connect()):(this.body.edges[s]=this.create(u),a=!0)}a===!0?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length!==0){var n=this.body.edges;te(e,function(a){var o=n[a];o!==void 0&&o.remove()}),r&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var e=this;te(this.body.edges,function(r,n){var a=e.body.data.edges.get(n);a!==void 0&&r.setOptions(a)})}},{key:"create",value:function(e){return new Ci(e,this.body,this.images,this.options,this.defaultOptions)}},{key:"reconnectEdges",value:function(){var e,r=this.body.nodes,n=this.body.edges;for(e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e].edges=[]);for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){var a=n[e];a.from=null,a.to=null,a.connect()}}},{key:"getConnectedNodes",value:function(e){var r=[];if(this.body.edges[e]!==void 0){var n=this.body.edges[e];n.fromId!==void 0&&r.push(n.fromId),n.toId!==void 0&&r.push(n.toId)}return r}},{key:"_updateState",value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:"_removeInvalidEdges",value:function(){var e=this,r=[];te(this.body.edges,function(n,a){var o=e.body.nodes[n.toId],s=e.body.nodes[n.fromId];o!==void 0&&o.isCluster===!0||s!==void 0&&s.isCluster===!0||(o===void 0||s===void 0)&&r.push(a)}),this.remove(r,!1)}},{key:"_addMissingEdges",value:function(){var e=this.body.data.edges;if(e!=null){var r=this.body.edges,n=[];ge(e).call(e,function(a,o){var s=r[o];s===void 0&&n.push(o)}),this.add(n,!0)}}}]),t}(),jP=function(){function t(i,e,r){N(this,t),this.body=i,this.physicsBody=e,this.barnesHutTree,this.setOptions(r),this._rng=Ll("BARNES HUT SOLVER")}return F(t,[{key:"setOptions",value:function(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}},{key:"solve",value:function(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){var e,r=this.body.nodes,n=this.physicsBody.physicsNodeIndices,a=n.length,o=this._formBarnesHutTree(r,n);this.barnesHutTree=o;for(var s=0;s<a;s++)e=r[n[s]],e.options.mass>0&&this._getForceContributions(o.root,e)}}},{key:"_getForceContributions",value:function(e,r){this._getForceContribution(e.children.NW,r),this._getForceContribution(e.children.NE,r),this._getForceContribution(e.children.SW,r),this._getForceContribution(e.children.SE,r)}},{key:"_getForceContribution",value:function(e,r){if(e.childrenCount>0){var n=e.centerOfMass.x-r.x,a=e.centerOfMass.y-r.y,o=Math.sqrt(n*n+a*a);o*e.calcSize>this.thetaInversed?this._calculateForces(o,n,a,r,e):e.childrenCount===4?this._getForceContributions(e,r):e.children.data.id!=r.id&&this._calculateForces(o,n,a,r,e)}}},{key:"_calculateForces",value:function(e,r,n,a,o){e===0&&(e=.1,r=e),this.overlapAvoidanceFactor<1&&a.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*a.shape.radius,e-a.shape.radius));var s=this.options.gravitationalConstant*o.mass*a.options.mass/Math.pow(e,3),u=r*s,l=n*s;this.physicsBody.forces[a.id].x+=u,this.physicsBody.forces[a.id].y+=l}},{key:"_formBarnesHutTree",value:function(e,r){for(var n,a=r.length,o=e[r[0]].x,s=e[r[0]].y,u=e[r[0]].x,l=e[r[0]].y,c=1;c<a;c++){var h=e[r[c]],d=h.x,f=h.y;h.options.mass>0&&(d<o&&(o=d),d>u&&(u=d),f<s&&(s=f),f>l&&(l=f))}var v=Math.abs(u-o)-Math.abs(l-s);v>0?(s-=.5*v,l+=.5*v):(o+=.5*v,u-=.5*v);var g=1e-5,b=Math.max(g,Math.abs(u-o)),p=.5*b,$=.5*(o+u),m=.5*(s+l),y={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:$-p,maxX:$+p,minY:m-p,maxY:m+p},size:b,calcSize:1/b,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(y.root);for(var w=0;w<a;w++)n=e[r[w]],n.options.mass>0&&this._placeInTree(y.root,n);return y}},{key:"_updateBranchMass",value:function(e,r){var n=e.centerOfMass,a=e.mass+r.options.mass,o=1/a;n.x=n.x*e.mass+r.x*r.options.mass,n.x*=o,n.y=n.y*e.mass+r.y*r.options.mass,n.y*=o,e.mass=a;var s=Math.max(Math.max(r.height,r.radius),r.width);e.maxWidth=e.maxWidth<s?s:e.maxWidth}},{key:"_placeInTree",value:function(e,r,n){(n!=!0||n===void 0)&&this._updateBranchMass(e,r);var a=e.children.NW.range,o;a.maxX>r.x?a.maxY>r.y?o="NW":o="SW":a.maxY>r.y?o="NE":o="SE",this._placeInRegion(e,r,o)}},{key:"_placeInRegion",value:function(e,r,n){var a=e.children[n];switch(a.childrenCount){case 0:a.children.data=r,a.childrenCount=1,this._updateBranchMass(a,r);break;case 1:a.children.data.x===r.x&&a.children.data.y===r.y?(r.x+=this._rng(),r.y+=this._rng()):(this._splitBranch(a),this._placeInTree(a,r));break;case 4:this._placeInTree(a,r);break}}},{key:"_splitBranch",value:function(e){var r=null;e.childrenCount===1&&(r=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),r!=null&&this._placeInTree(e,r)}},{key:"_insertRegion",value:function(e,r){var n,a,o,s,u=.5*e.size;switch(r){case"NW":n=e.range.minX,a=e.range.minX+u,o=e.range.minY,s=e.range.minY+u;break;case"NE":n=e.range.minX+u,a=e.range.maxX,o=e.range.minY,s=e.range.minY+u;break;case"SW":n=e.range.minX,a=e.range.minX+u,o=e.range.minY+u,s=e.range.maxY;break;case"SE":n=e.range.minX+u,a=e.range.maxX,o=e.range.minY+u,s=e.range.maxY;break}e.children[r]={centerOfMass:{x:0,y:0},mass:0,range:{minX:n,maxX:a,minY:o,maxY:s},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}},{key:"_debug",value:function(e,r){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,r))}},{key:"_drawBranch",value:function(e,r,n){n===void 0&&(n="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,r),this._drawBranch(e.children.NE,r),this._drawBranch(e.children.SE,r),this._drawBranch(e.children.SW,r)),r.strokeStyle=n,r.beginPath(),r.moveTo(e.range.minX,e.range.minY),r.lineTo(e.range.maxX,e.range.minY),r.stroke(),r.beginPath(),r.moveTo(e.range.maxX,e.range.minY),r.lineTo(e.range.maxX,e.range.maxY),r.stroke(),r.beginPath(),r.moveTo(e.range.maxX,e.range.maxY),r.lineTo(e.range.minX,e.range.maxY),r.stroke(),r.beginPath(),r.moveTo(e.range.minX,e.range.maxY),r.lineTo(e.range.minX,e.range.minY),r.stroke()}}]),t}(),nye=function(){function t(i,e,r){N(this,t),this._rng=Ll("REPULSION SOLVER"),this.body=i,this.physicsBody=e,this.setOptions(r)}return F(t,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,r,n,a,o,s,u,l,c=this.body.nodes,h=this.physicsBody.physicsNodeIndices,d=this.physicsBody.forces,f=this.options.nodeDistance,v=-2/3/f,g=4/3,b=0;b<h.length-1;b++){u=c[h[b]];for(var p=b+1;p<h.length;p++)l=c[h[p]],e=l.x-u.x,r=l.y-u.y,n=Math.sqrt(e*e+r*r),n===0&&(n=.1*this._rng(),e=n),n<2*f&&(n<.5*f?s=1:s=v*n+g,s=s/n,a=e*s,o=r*s,d[u.id].x-=a,d[u.id].y-=o,d[l.id].x+=a,d[l.id].y+=o)}}}]),t}(),iye=function(){function t(i,e,r){N(this,t),this.body=i,this.physicsBody=e,this.setOptions(r)}return F(t,[{key:"setOptions",value:function(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}},{key:"solve",value:function(){for(var e=this.body.nodes,r=this.physicsBody.physicsNodeIndices,n=this.physicsBody.forces,a=this.options.nodeDistance,o=0;o<r.length-1;o++)for(var s=e[r[o]],u=o+1;u<r.length;u++){var l=e[r[u]];if(s.level===l.level){var c=a+this.overlapAvoidanceFactor*((s.shape.radius||0)/2+(l.shape.radius||0)/2),h=l.x-s.x,d=l.y-s.y,f=Math.sqrt(h*h+d*d),v=.05,g=void 0;f<c?g=-Math.pow(v*f,2)+Math.pow(v*c,2):g=0,f!==0&&(g=g/f);var b=h*g,p=d*g;n[s.id].x-=b,n[s.id].y-=p,n[l.id].x+=b,n[l.id].y+=p}}}}]),t}(),Qh=function(){function t(i,e,r){N(this,t),this.body=i,this.physicsBody=e,this.setOptions(r)}return F(t,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,r,n=this.physicsBody.physicsEdgeIndices,a=this.body.edges,o,s,u,l=0;l<n.length;l++)r=a[n[l]],r.connected===!0&&r.toId!==r.fromId&&this.body.nodes[r.toId]!==void 0&&this.body.nodes[r.fromId]!==void 0&&(r.edgeType.via!==void 0?(e=r.options.length===void 0?this.options.springLength:r.options.length,o=r.to,s=r.edgeType.via,u=r.from,this._calculateSpringForce(o,s,.5*e),this._calculateSpringForce(s,u,.5*e)):(e=r.options.length===void 0?this.options.springLength*1.5:r.options.length,this._calculateSpringForce(r.from,r.to,e)))}},{key:"_calculateSpringForce",value:function(e,r,n){var a=e.x-r.x,o=e.y-r.y,s=Math.max(Math.sqrt(a*a+o*o),.01),u=this.options.springConstant*(n-s)/s,l=a*u,c=o*u;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=l,this.physicsBody.forces[e.id].y+=c),this.physicsBody.forces[r.id]!==void 0&&(this.physicsBody.forces[r.id].x-=l,this.physicsBody.forces[r.id].y-=c)}}]),t}(),aye=function(){function t(i,e,r){N(this,t),this.body=i,this.physicsBody=e,this.setOptions(r)}return F(t,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,r,n,a,o,s,u,l,c=this.body.edges,h=.5,d=this.physicsBody.physicsEdgeIndices,f=this.physicsBody.physicsNodeIndices,v=this.physicsBody.forces,g=0;g<f.length;g++){var b=f[g];v[b].springFx=0,v[b].springFy=0}for(var p=0;p<d.length;p++)r=c[d[p]],r.connected===!0&&(e=r.options.length===void 0?this.options.springLength:r.options.length,n=r.from.x-r.to.x,a=r.from.y-r.to.y,l=Math.sqrt(n*n+a*a),l=l===0?.01:l,u=this.options.springConstant*(e-l)/l,o=n*u,s=a*u,r.to.level!=r.from.level?(v[r.toId]!==void 0&&(v[r.toId].springFx-=o,v[r.toId].springFy-=s),v[r.fromId]!==void 0&&(v[r.fromId].springFx+=o,v[r.fromId].springFy+=s)):(v[r.toId]!==void 0&&(v[r.toId].x-=h*o,v[r.toId].y-=h*s),v[r.fromId]!==void 0&&(v[r.fromId].x+=h*o,v[r.fromId].y+=h*s)));u=1;for(var $,m,y=0;y<f.length;y++){var w=f[y];$=Math.min(u,Math.max(-u,v[w].springFx)),m=Math.min(u,Math.max(-u,v[w].springFy)),v[w].x+=$,v[w].y+=m}for(var S=0,T=0,O=0;O<f.length;O++){var _=f[O];S+=v[_].x,T+=v[_].y}for(var E=S/f.length,I=T/f.length,j=0;j<f.length;j++){var B=f[j];v[B].x-=E,v[B].y-=I}}}]),t}(),su=function(){function t(i,e,r){N(this,t),this.body=i,this.physicsBody=e,this.setOptions(r)}return F(t,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,r,n,a,o=this.body.nodes,s=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces,l=0;l<s.length;l++){var c=s[l];a=o[c],e=-a.x,r=-a.y,n=Math.sqrt(e*e+r*r),this._calculateForces(n,e,r,u,a)}}},{key:"_calculateForces",value:function(e,r,n,a,o){var s=e===0?0:this.options.centralGravity/e;a[o.id].x=r*s,a[o.id].y=n*s}}]),t}();function oye(t){var i=sye();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function sye(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var uye=function(t){ce(e,t);var i=oye(e);function e(r,n,a){var o;return N(this,e),o=i.call(this,r,n,a),o._rng=Ll("FORCE ATLAS 2 BASED REPULSION SOLVER"),o}return F(e,[{key:"_calculateForces",value:function(n,a,o,s,u){n===0&&(n=.1*this._rng(),a=n),this.overlapAvoidanceFactor<1&&s.shape.radius&&(n=Math.max(.1+this.overlapAvoidanceFactor*s.shape.radius,n-s.shape.radius));var l=s.edges.length+1,c=this.options.gravitationalConstant*u.mass*s.options.mass*l/Math.pow(n,2),h=a*c,d=o*c;this.physicsBody.forces[s.id].x+=h,this.physicsBody.forces[s.id].y+=d}}]),e}(jP);function lye(t){var i=cye();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function cye(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var hye=function(t){ce(e,t);var i=lye(e);function e(r,n,a){return N(this,e),i.call(this,r,n,a)}return F(e,[{key:"_calculateForces",value:function(n,a,o,s,u){if(n>0){var l=u.edges.length+1,c=this.options.centralGravity*l*u.options.mass;s[u.id].x=a*c,s[u.id].y=o*c}}}]),e}(su),dye=function(){function t(i){N(this,t),this.body=i,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}},je(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return F(t,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("initPhysics",function(){e.initPhysics()}),this.body.emitter.on("_layoutFailed",function(){e.layoutFailed=!0}),this.body.emitter.on("resetPhysics",function(){e.stopSimulation(),e.ready=!1}),this.body.emitter.on("disablePhysics",function(){e.physicsEnabled=!1,e.stopSimulation()}),this.body.emitter.on("restorePhysics",function(){e.setOptions(e.options),e.ready===!0&&e.startSimulation()}),this.body.emitter.on("startSimulation",function(){e.ready===!0&&e.startSimulation()}),this.body.emitter.on("stopSimulation",function(){e.stopSimulation()}),this.body.emitter.on("destroy",function(){e.stopSimulation(!1),e.body.emitter.off()}),this.body.emitter.on("_dataChanged",function(){e.updatePhysicsData()})}},{key:"setOptions",value:function(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,Lu(["stabilization"],this.options,e),Lt(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());var r=this.options.wind;r&&((typeof r.x!="number"||wp(r.x))&&(r.x=0),(typeof r.y!="number"||wp(r.y))&&(r.y=0)),this.timestep=this.options.timestep}this.init()}},{key:"init",value:function(){var e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new uye(this.body,this.physicsBody,e),this.edgesSolver=new Qh(this.body,this.physicsBody,e),this.gravitySolver=new hye(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new nye(this.body,this.physicsBody,e),this.edgesSolver=new Qh(this.body,this.physicsBody,e),this.gravitySolver=new su(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new iye(this.body,this.physicsBody,e),this.edgesSolver=new aye(this.body,this.physicsBody,e),this.gravitySolver=new su(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new jP(this.body,this.physicsBody,e),this.edgesSolver=new Qh(this.body,this.physicsBody,e),this.gravitySolver=new su(this.body,this.physicsBody,e)),this.modelOptions=e}},{key:"initPhysics",value:function(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}},{key:"startSimulation",value:function(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=A(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var e=Mu();this.physicsTick();var r=Mu()-e;(r<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&pr(function(){e.body.emitter.emit("stabilized",{iterations:r}),e.startedStabilization=!1,e.stabilizationIterations=0},0)}},{key:"physicsStep",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:"adjustTimeStep",value:function(){var e=1.2;this._evaluateStepQuality()===!0?this.timestep=e*this.timestep:this.timestep/e<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/e))}},{key:"physicsTick",value:function(){if(this._startStabilizing(),this.stabilized!==!0){if(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0){var e=this.adaptiveCounter%this.adaptiveInterval===0;e?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1}else this.timestep=this.options.timestep,this.physicsStep();this.stabilized===!0&&this.revert(),this.stabilizationIterations++}}},{key:"updatePhysicsData",value:function(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];var e=this.body.nodes,r=this.body.edges;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&e[n].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[n].id);for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&r[a].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(r[a].id);for(var o=0;o<this.physicsBody.physicsNodeIndices.length;o++){var s=this.physicsBody.physicsNodeIndices[o];this.physicsBody.forces[s]={x:0,y:0},this.physicsBody.velocities[s]===void 0&&(this.physicsBody.velocities[s]={x:0,y:0})}for(var u in this.physicsBody.velocities)e[u]===void 0&&delete this.physicsBody.velocities[u]}},{key:"revert",value:function(){var e=Te(this.previousStates),r=this.body.nodes,n=this.physicsBody.velocities;this.referenceState={};for(var a=0;a<e.length;a++){var o=e[a];r[o]!==void 0?r[o].options.physics===!0&&(this.referenceState[o]={positions:{x:r[o].x,y:r[o].y}},n[o].x=this.previousStates[o].vx,n[o].y=this.previousStates[o].vy,r[o].x=this.previousStates[o].x,r[o].y=this.previousStates[o].y):delete this.previousStates[o]}}},{key:"_evaluateStepQuality",value:function(){var e,r,n,a=this.body.nodes,o=this.referenceState,s=.3;for(var u in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,u)&&a[u]!==void 0&&(e=a[u].x-o[u].positions.x,r=a[u].y-o[u].positions.y,n=Math.sqrt(Math.pow(e,2)+Math.pow(r,2)),n>s))return!1;return!0}},{key:"moveNodes",value:function(){for(var e=this.physicsBody.physicsNodeIndices,r=0,n=0,a=5,o=0;o<e.length;o++){var s=e[o],u=this._performStep(s);r=Math.max(r,u),n+=u}this.adaptiveTimestepEnabled=n/e.length<a,this.stabilized=r<this.options.minVelocity}},{key:"calculateComponentVelocity",value:function(e,r,n){var a=this.modelOptions.damping*e,o=(r-a)/n;e+=o*this.timestep;var s=this.options.maxVelocity||1e9;return Math.abs(e)>s&&(e=e>0?s:-s),e}},{key:"_performStep",value:function(e){var r=this.body.nodes[e],n=this.physicsBody.forces[e];this.options.wind&&(n.x+=this.options.wind.x,n.y+=this.options.wind.y);var a=this.physicsBody.velocities[e];this.previousStates[e]={x:r.x,y:r.y,vx:a.x,vy:a.y},r.options.fixed.x===!1?(a.x=this.calculateComponentVelocity(a.x,n.x,r.options.mass),r.x+=a.x*this.timestep):(n.x=0,a.x=0),r.options.fixed.y===!1?(a.y=this.calculateComponentVelocity(a.y,n.y,r.options.mass),r.y+=a.y*this.timestep):(n.y=0,a.y=0);var o=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2));return o}},{key:"_freezeNodes",value:function(){var e=this.body.nodes;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&e[r].x&&e[r].y){var n=e[r].options.fixed;this.freezeCache[r]={x:n.x,y:n.y},n.x=!0,n.y=!0}}},{key:"_restoreFrozenNodes",value:function(){var e=this.body.nodes;for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.freezeCache[r]!==void 0&&(e[r].options.fixed.x=this.freezeCache[r].x,e[r].options.fixed.y=this.freezeCache[r].y);this.freezeCache={}}},{key:"stabilize",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof r!="number"&&(r=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",r)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=r,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,pr(function(){return e._stabilizationBatch()},0)}},{key:"_startStabilizing",value:function(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}},{key:"_stabilizationBatch",value:function(){var e=this,r=function(){return e.stabilized===!1&&e.stabilizationIterations<e.targetIterations},n=function(){e.body.emitter.emit("stabilizationProgress",{iterations:e.stabilizationIterations,total:e.targetIterations})};this._startStabilizing()&&n();for(var a=0;r()&&a<this.options.stabilization.updateInterval;)this.physicsTick(),a++;if(n(),r()){var o;pr(A(o=this._stabilizationBatch).call(o,this),0)}else this._finalizeStabilization()}},{key:"_finalizeStabilization",value:function(){this.body.emitter.emit("_allowRedraw"),this.options.stabilization.fit===!0&&this.body.emitter.emit("fit"),this.options.stabilization.onlyDynamicEdges===!0&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),this.stabilized===!0?this._emitStabilized():this.startSimulation(),this.ready=!0}},{key:"_drawForces",value:function(e){for(var r=0;r<this.physicsBody.physicsNodeIndices.length;r++){var n=this.physicsBody.physicsNodeIndices[r],a=this.body.nodes[n],o=this.physicsBody.forces[n],s=20,u=.03,l=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.x,2)),c=Math.min(Math.max(5,l),15),h=3*c,d=gp((180-Math.min(1,Math.max(0,u*l))*180)/360,1,1),f={x:a.x+s*o.x,y:a.y+s*o.y};e.lineWidth=c,e.strokeStyle=d,e.beginPath(),e.moveTo(a.x,a.y),e.lineTo(f.x,f.y),e.stroke();var v=Math.atan2(o.y,o.x);e.fillStyle=d,BP.draw(e,{type:"arrow",point:f,angle:v,length:h}),ts(e).call(e)}}}]),t}();let js;const fye=new Uint8Array(16);function vye(){if(!js&&(js=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!js))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return js(fye)}const at=[];for(let t=0;t<256;++t)at.push((t+256).toString(16).slice(1));function pye(t,i=0){return(at[t[i+0]]+at[t[i+1]]+at[t[i+2]]+at[t[i+3]]+"-"+at[t[i+4]]+at[t[i+5]]+"-"+at[t[i+6]]+at[t[i+7]]+"-"+at[t[i+8]]+at[t[i+9]]+"-"+at[t[i+10]]+at[t[i+11]]+at[t[i+12]]+at[t[i+13]]+at[t[i+14]]+at[t[i+15]]).toLowerCase()}const gye=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var j0={randomUUID:gye};function Ba(t,i,e){if(j0.randomUUID&&!i&&!t)return j0.randomUUID();t=t||{};const r=t.random||(t.rng||vye)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,i){e=e||0;for(let n=0;n<16;++n)i[e+n]=r[n];return i}return pye(r)}var dt=function(){function t(){N(this,t)}return F(t,null,[{key:"getRange",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=1e9,a=-1e9,o=1e9,s=-1e9,u;if(r.length>0)for(var l=0;l<r.length;l++)u=e[r[l]],o>u.shape.boundingBox.left&&(o=u.shape.boundingBox.left),s<u.shape.boundingBox.right&&(s=u.shape.boundingBox.right),n>u.shape.boundingBox.top&&(n=u.shape.boundingBox.top),a<u.shape.boundingBox.bottom&&(a=u.shape.boundingBox.bottom);return o===1e9&&s===-1e9&&n===1e9&&a===-1e9&&(n=0,a=0,o=0,s=0),{minX:o,maxX:s,minY:n,maxY:a}}},{key:"getRangeCore",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=1e9,a=-1e9,o=1e9,s=-1e9,u;if(r.length>0)for(var l=0;l<r.length;l++)u=e[r[l]],o>u.x&&(o=u.x),s<u.x&&(s=u.x),n>u.y&&(n=u.y),a<u.y&&(a=u.y);return o===1e9&&s===-1e9&&n===1e9&&a===-1e9&&(n=0,a=0,o=0,s=0),{minX:o,maxX:s,minY:n,maxY:a}}},{key:"findCenter",value:function(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}},{key:"cloneOptions",value:function(e,r){var n={};return r===void 0||r==="node"?($e(n,e.options,!0),n.x=e.x,n.y=e.y,n.amountOfConnections=e.edges.length):$e(n,e.options,!0),n}}]),t}();function yye(t){var i=mye();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function mye(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var $ye=function(t){ce(e,t);var i=yye(e);function e(r,n,a,o,s,u){var l;return N(this,e),l=i.call(this,r,n,a,o,s,u),l.isCluster=!0,l.containedNodes={},l.containedEdges={},l}return F(e,[{key:"_openChildCluster",value:function(n){var a=this,o=this.body.nodes[n];if(this.containedNodes[n]===void 0)throw new Error("node with id: "+n+" not in current cluster");if(!o.isCluster)throw new Error("node with id: "+n+" is not a cluster");delete this.containedNodes[n],te(o.edges,function(s){delete a.containedEdges[s.id]}),te(o.containedNodes,function(s,u){a.containedNodes[u]=s}),o.containedNodes={},te(o.containedEdges,function(s,u){a.containedEdges[u]=s}),o.containedEdges={},te(o.edges,function(s){te(a.edges,function(u){var l,c,h=ae(l=u.clusteringEdgeReplacingIds).call(l,s.id);h!==-1&&(te(s.clusteringEdgeReplacingIds,function(d){u.clusteringEdgeReplacingIds.push(d),a.body.edges[d].edgeReplacedById=u.id}),Or(c=u.clusteringEdgeReplacingIds).call(c,h,1))})}),o.edges=[]}}]),e}(kt),bye=function(){function t(i){var e=this;N(this,t),this.body=i,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},je(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){e.clusteredNodes={},e.clusteredEdges={}})}return F(t,[{key:"clusterByHubsize",value:function(e,r){e===void 0?e=this._getHubSize():he(e)==="object"&&(r=this._checkOptions(e),e=this._getHubSize());for(var n=[],a=0;a<this.body.nodeIndices.length;a++){var o=this.body.nodes[this.body.nodeIndices[a]];o.edges.length>=e&&n.push(o.id)}for(var s=0;s<n.length;s++)this.clusterByConnection(n[s],r,!0);this.body.emitter.emit("_dataChanged")}},{key:"cluster",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(r.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");r=this._checkOptions(r);var a={},o={};te(this.body.nodes,function(s,u){s.options&&r.joinCondition(s.options)===!0&&(a[u]=s,te(s.edges,function(l){e.clusteredEdges[l.id]===void 0&&(o[l.id]=l)}))}),this._cluster(a,o,r,n)}},{key:"clusterByEdgeCount",value:function(e,r){var n=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;r=this._checkOptions(r);for(var o=[],s={},u,l,c,h=function(){var g={},b={},p=n.body.nodeIndices[d],$=n.body.nodes[p];if(s[p]===void 0){c=0,l=[];for(var m=0;m<$.edges.length;m++)u=$.edges[m],n.clusteredEdges[u.id]===void 0&&(u.toId!==u.fromId&&c++,l.push(u));if(c===e){for(var y=function(B){if(r.joinCondition===void 0||r.joinCondition===null)return!0;var X=dt.cloneOptions(B);return r.joinCondition(X)},w=!0,S=0;S<l.length;S++){u=l[S];var T=n._getConnectedId(u,p);if(y($))b[u.id]=u,g[p]=$,g[T]=n.body.nodes[T],s[p]=!0;else{w=!1;break}}if(Te(g).length>0&&Te(b).length>0&&w===!0){var O=function(){for(var B=0;B<o.length;++B)for(var X in g)if(o[B].nodes[X]!==void 0)return o[B]},_=O();if(_!==void 0){for(var E in g)_.nodes[E]===void 0&&(_.nodes[E]=g[E]);for(var I in b)_.edges[I]===void 0&&(_.edges[I]=b[I])}else o.push({nodes:g,edges:b})}}}},d=0;d<this.body.nodeIndices.length;d++)h();for(var f=0;f<o.length;f++)this._cluster(o[f].nodes,o[f].edges,r,!1);a===!0&&this.body.emitter.emit("_dataChanged")}},{key:"clusterOutliers",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,r)}},{key:"clusterBridges",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,r)}},{key:"clusterByConnection",value:function(e,r){var n,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");var o=this.body.nodes[e];r=this._checkOptions(r,o),r.clusterNodeProperties.x===void 0&&(r.clusterNodeProperties.x=o.x),r.clusterNodeProperties.y===void 0&&(r.clusterNodeProperties.y=o.y),r.clusterNodeProperties.fixed===void 0&&(r.clusterNodeProperties.fixed={},r.clusterNodeProperties.fixed.x=o.options.fixed.x,r.clusterNodeProperties.fixed.y=o.options.fixed.y);var s={},u={},l=o.id,c=dt.cloneOptions(o);s[l]=o;for(var h=0;h<o.edges.length;h++){var d=o.edges[h];if(this.clusteredEdges[d.id]===void 0){var f=this._getConnectedId(d,l);if(this.clusteredNodes[f]===void 0)if(f!==l)if(r.joinCondition===void 0)u[d.id]=d,s[f]=this.body.nodes[f];else{var v=dt.cloneOptions(this.body.nodes[f]);r.joinCondition(c,v)===!0&&(u[d.id]=d,s[f]=this.body.nodes[f])}else u[d.id]=d}}var g=ji(n=Te(s)).call(n,function(y){return s[y].id});for(var b in s)if(Object.prototype.hasOwnProperty.call(s,b))for(var p=s[b],$=0;$<p.edges.length;$++){var m=p.edges[$];ae(g).call(g,this._getConnectedId(m,p.id))>-1&&(u[m.id]=m)}this._cluster(s,u,r,a)}},{key:"_createClusterEdges",value:function(e,r,n,a){for(var o,s,u,l,c,h,d=Te(e),f=[],v=0;v<d.length;v++){s=d[v],u=e[s];for(var g=0;g<u.edges.length;g++)o=u.edges[g],this.clusteredEdges[o.id]===void 0&&(o.toId==o.fromId?r[o.id]=o:o.toId==s?(l=n.id,c=o.fromId,h=c):(l=o.toId,c=n.id,h=l),e[h]===void 0&&f.push({edge:o,fromId:c,toId:l}))}for(var b=[],p=function(T){for(var O=0;O<b.length;O++){var _=b[O],E=T.fromId===_.fromId&&T.toId===_.toId,I=T.fromId===_.toId&&T.toId===_.fromId;if(E||I)return _}return null},$=0;$<f.length;$++){var m=f[$],y=m.edge,w=p(m);w===null?(w=this._createClusteredEdge(m.fromId,m.toId,y,a),b.push(w)):w.clusteringEdgeReplacingIds.push(y.id),this.body.edges[y.id].edgeReplacedById=w.id,this._backupEdgeOptions(y),y.setOptions({physics:!1})}}},{key:"_checkOptions",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}},{key:"_cluster",value:function(e,r,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&this.clusteredNodes[s]!==void 0&&o.push(s);for(var u=0;u<o.length;++u)delete e[o[u]];if(Te(e).length!=0&&!(Te(e).length==1&&n.clusterNodeProperties.allowSingleNodeCluster!=!0)){var l=$e({},n.clusterNodeProperties);if(n.processProperties!==void 0){var c=[];for(var h in e)if(Object.prototype.hasOwnProperty.call(e,h)){var d=dt.cloneOptions(e[h]);c.push(d)}var f=[];for(var v in r)if(Object.prototype.hasOwnProperty.call(r,v)&&v.substr(0,12)!=="clusterEdge:"){var g=dt.cloneOptions(r[v],"edge");f.push(g)}if(l=n.processProperties(l,c,f),!l)throw new Error("The processProperties function does not return properties!")}l.id===void 0&&(l.id="cluster:"+Ba());var b=l.id;l.label===void 0&&(l.label="cluster");var p=void 0;l.x===void 0&&(p=this._getClusterPosition(e),l.x=p.x),l.y===void 0&&(p===void 0&&(p=this._getClusterPosition(e)),l.y=p.y),l.id=b;var $=this.body.functions.createNode(l,$ye);$.containedNodes=e,$.containedEdges=r,$.clusterEdgeProperties=n.clusterEdgeProperties,this.body.nodes[l.id]=$,this._clusterEdges(e,r,l,n.clusterEdgeProperties),l.id=void 0,a===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}},{key:"_restoreEdge",value:function(e){var r=this.clusteredEdges[e.id];r!==void 0&&(e.setOptions({physics:r.physics}),delete this.clusteredEdges[e.id])}},{key:"isCluster",value:function(e){return this.body.nodes[e]!==void 0?this.body.nodes[e].isCluster===!0:(console.error("Node does not exist."),!1)}},{key:"_getClusterPosition",value:function(e){for(var r=Te(e),n=e[r[0]].x,a=e[r[0]].x,o=e[r[0]].y,s=e[r[0]].y,u,l=1;l<r.length;l++)u=e[r[l]],n=u.x<n?u.x:n,a=u.x>a?u.x:a,o=u.y<o?u.y:o,s=u.y>s?u.y:s;return{x:.5*(n+a),y:.5*(o+s)}}},{key:"openCluster",value:function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");var a=this.body.nodes[e];if(a===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(a.isCluster!==!0||a.containedNodes===void 0||a.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");var o=this.findNode(e),s=ae(o).call(o,e)-1;if(s>=0){var u=o[s],l=this.body.nodes[u];l._openChildCluster(e),delete this.body.nodes[e],n===!0&&this.body.emitter.emit("_dataChanged");return}var c=a.containedNodes,h=a.containedEdges;if(r!==void 0&&r.releaseFunction!==void 0&&typeof r.releaseFunction=="function"){var d={},f={x:a.x,y:a.y};for(var v in c)if(Object.prototype.hasOwnProperty.call(c,v)){var g=this.body.nodes[v];d[v]={x:g.x,y:g.y}}var b=r.releaseFunction(f,d);for(var p in c)if(Object.prototype.hasOwnProperty.call(c,p)){var $=this.body.nodes[p];b[p]!==void 0&&($.x=b[p].x===void 0?a.x:b[p].x,$.y=b[p].y===void 0?a.y:b[p].y)}}else te(c,function(we){we.options.fixed.x===!1&&(we.x=a.x),we.options.fixed.y===!1&&(we.y=a.y)});for(var m in c)if(Object.prototype.hasOwnProperty.call(c,m)){var y=this.body.nodes[m];y.vx=a.vx,y.vy=a.vy,y.setOptions({physics:!0}),delete this.clusteredNodes[m]}for(var w=[],S=0;S<a.edges.length;S++)w.push(a.edges[S]);for(var T=0;T<w.length;T++){for(var O=w[T],_=this._getConnectedId(O,e),E=this.clusteredNodes[_],I=0;I<O.clusteringEdgeReplacingIds.length;I++){var j=O.clusteringEdgeReplacingIds[I],B=this.body.edges[j];if(B!==void 0)if(E!==void 0){var X=this.body.nodes[E.clusterId];X.containedEdges[B.id]=B,delete h[B.id];var ne=B.fromId,re=B.toId;B.toId==_?re=E.clusterId:ne=E.clusterId,this._createClusteredEdge(ne,re,B,X.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(B)}O.remove()}for(var le in h)Object.prototype.hasOwnProperty.call(h,le)&&this._restoreEdge(h[le]);delete this.body.nodes[e],n===!0&&this.body.emitter.emit("_dataChanged")}},{key:"getNodesInCluster",value:function(e){var r=[];if(this.isCluster(e)===!0){var n=this.body.nodes[e].containedNodes;for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&r.push(this.body.nodes[a].id)}return r}},{key:"findNode",value:function(e){for(var r=[],n=100,a=0,o;this.clusteredNodes[e]!==void 0&&a<n;){if(o=this.body.nodes[e],o===void 0)return[];r.push(o.id),e=this.clusteredNodes[e].clusterId,a++}return o=this.body.nodes[e],o===void 0?[]:(r.push(o.id),An(r).call(r),r)}},{key:"updateClusteredNode",value:function(e,r){if(e===void 0)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(r===void 0)throw new Error("No newOptions supplied to updateClusteredNode.");if(this.body.nodes[e]===void 0)throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[e].setOptions(r),this.body.emitter.emit("_dataChanged")}},{key:"updateEdge",value:function(e,r){if(e===void 0)throw new Error("No startEdgeId supplied to updateEdge.");if(r===void 0)throw new Error("No newOptions supplied to updateEdge.");if(this.body.edges[e]===void 0)throw new Error("The startEdgeId supplied to updateEdge does not exist.");for(var n=this.getClusteredEdges(e),a=0;a<n.length;a++){var o=this.body.edges[n[a]];o.setOptions(r)}this.body.emitter.emit("_dataChanged")}},{key:"getClusteredEdges",value:function(e){for(var r=[],n=100,a=0;e!==void 0&&this.body.edges[e]!==void 0&&a<n;)r.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,a++;return An(r).call(r),r}},{key:"getBaseEdge",value:function(e){return this.getBaseEdges(e)[0]}},{key:"getBaseEdges",value:function(e){for(var r=[e],n=[],a=[],o=100,s=0;r.length>0&&s<o;){var u=r.pop();if(u!==void 0){var l=this.body.edges[u];if(l!==void 0){s++;var c=l.clusteringEdgeReplacingIds;if(c===void 0)a.push(u);else for(var h=0;h<c.length;++h){var d=c[h];ae(r).call(r,c)!==-1||ae(n).call(n,c)!==-1||r.push(d)}n.push(u)}}}return a}},{key:"_getConnectedId",value:function(e,r){return e.toId!=r?e.toId:(e.fromId!=r,e.fromId)}},{key:"_getHubSize",value:function(){for(var e=0,r=0,n=0,a=0,o=0;o<this.body.nodeIndices.length;o++){var s=this.body.nodes[this.body.nodeIndices[o]];s.edges.length>a&&(a=s.edges.length),e+=s.edges.length,r+=Math.pow(s.edges.length,2),n+=1}e=e/n,r=r/n;var u=r-Math.pow(e,2),l=Math.sqrt(u),c=Math.floor(e+2*l);return c>a&&(c=a),c}},{key:"_createClusteredEdge",value:function(e,r,n,a,o){var s=dt.cloneOptions(n,"edge");$e(s,a),s.from=e,s.to=r,s.id="clusterEdge:"+Ba(),o!==void 0&&$e(s,o);var u=this.body.functions.createEdge(s);return u.clusteringEdgeReplacingIds=[n.id],u.connect(),this.body.edges[u.id]=u,u}},{key:"_clusterEdges",value:function(e,r,n,a){if(r instanceof Ci){var o=r,s={};s[o.id]=o,r=s}if(e instanceof kt){var u=e,l={};l[u.id]=u,e=l}if(n==null)throw new Error("_clusterEdges: parameter clusterNode required");a===void 0&&(a=n.clusterEdgeProperties),this._createClusterEdges(e,r,n,a);for(var c in r)if(Object.prototype.hasOwnProperty.call(r,c)&&this.body.edges[c]!==void 0){var h=this.body.edges[c];this._backupEdgeOptions(h),h.setOptions({physics:!1})}for(var d in e)Object.prototype.hasOwnProperty.call(e,d)&&(this.clusteredNodes[d]={clusterId:n.id,node:this.body.nodes[d]},this.body.nodes[d].setOptions({physics:!1}))}},{key:"_getClusterNodeForNode",value:function(e){if(e!==void 0){var r=this.clusteredNodes[e];if(r!==void 0){var n=r.clusterId;if(n!==void 0)return this.body.nodes[n]}}}},{key:"_filter",value:function(e,r){var n=[];return te(e,function(a){r(a)&&n.push(a)}),n}},{key:"_updateState",value:function(){var e=this,r,n=[],a={},o=function(v){te(e.body.nodes,function(g){g.isCluster===!0&&v(g)})};for(r in this.clusteredNodes)if(Object.prototype.hasOwnProperty.call(this.clusteredNodes,r)){var s=this.body.nodes[r];s===void 0&&n.push(r)}o(function(f){for(var v=0;v<n.length;v++)delete f.containedNodes[n[v]]});for(var u=0;u<n.length;u++)delete this.clusteredNodes[n[u]];te(this.clusteredEdges,function(f){var v=e.body.edges[f];(v===void 0||!v.endPointsValid())&&(a[f]=f)}),o(function(f){te(f.containedEdges,function(v,g){!v.endPointsValid()&&!a[g]&&(a[g]=g)})}),te(this.body.edges,function(f,v){var g=!0,b=f.clusteringEdgeReplacingIds;if(b!==void 0){var p=0;te(b,function($){var m=e.body.edges[$];m!==void 0&&m.endPointsValid()&&(p+=1)}),g=p>0}(!f.endPointsValid()||!g)&&(a[v]=v)}),o(function(f){te(a,function(v){delete f.containedEdges[v],te(f.edges,function(g,b){if(g.id===v){f.edges[b]=null;return}g.clusteringEdgeReplacingIds=e._filter(g.clusteringEdgeReplacingIds,function(p){return!a[p]})}),f.edges=e._filter(f.edges,function(g){return g!==null})})}),te(a,function(f){delete e.clusteredEdges[f]}),te(a,function(f){delete e.body.edges[f]});var l=Te(this.body.edges);te(l,function(f){var v=e.body.edges[f],g=e._isClusteredNode(v.fromId)||e._isClusteredNode(v.toId);if(g!==e._isClusteredEdge(v.id))if(g){var b=e._getClusterNodeForNode(v.fromId);b!==void 0&&e._clusterEdges(e.body.nodes[v.fromId],v,b);var p=e._getClusterNodeForNode(v.toId);p!==void 0&&e._clusterEdges(e.body.nodes[v.toId],v,p)}else delete e._clusterEdges[f],e._restoreEdge(v)});for(var c=!1,h=!0,d=function(){var v=[];o(function(b){var p=Te(b.containedNodes).length,$=b.options.allowSingleNodeCluster===!0;($&&p<1||!$&&p<2)&&v.push(b.id)});for(var g=0;g<v.length;++g)e.openCluster(v[g],{},!1);h=v.length>0,c=c||h};h;)d();c&&this._updateState()}},{key:"_isClusteredNode",value:function(e){return this.clusteredNodes[e]!==void 0}},{key:"_isClusteredEdge",value:function(e){return this.clusteredEdges[e]!==void 0}}]),t}();function wye(){var t;window!==void 0&&(t=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),t===void 0?window.requestAnimationFrame=function(i){i()}:window.requestAnimationFrame=t}var _ye=function(){function t(i,e){N(this,t),wye(),this.body=i,this.canvas=e,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},je(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return F(t,[{key:"bindEventListeners",value:function(){var e=this,r;this.body.emitter.on("dragStart",function(){e.dragging=!0}),this.body.emitter.on("dragEnd",function(){e.dragging=!1}),this.body.emitter.on("zoom",function(){e.zooming=!0,window.clearTimeout(e.zoomTimeoutId),e.zoomTimeoutId=pr(function(){var n;e.zooming=!1,A(n=e._requestRedraw).call(n,e)()},250)}),this.body.emitter.on("_resizeNodes",function(){e._resizeNodes()}),this.body.emitter.on("_redraw",function(){e.renderingActive===!1&&e._redraw()}),this.body.emitter.on("_blockRedraw",function(){e.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",function(){e.allowRedraw=!0,e.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",A(r=this._requestRedraw).call(r,this)),this.body.emitter.on("_startRendering",function(){e.renderRequests+=1,e.renderingActive=!0,e._startRendering()}),this.body.emitter.on("_stopRendering",function(){e.renderRequests-=1,e.renderingActive=e.renderRequests>0,e.renderTimer=void 0}),this.body.emitter.on("destroy",function(){e.renderRequests=0,e.allowRedraw=!1,e.renderingActive=!1,e.requiresTimeout===!0?clearTimeout(e.renderTimer):window.cancelAnimationFrame(e.renderTimer),e.body.emitter.off()})}},{key:"setOptions",value:function(e){if(e!==void 0){var r=["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"];pa(r,this.options,e)}}},{key:"_requestNextFrame",value:function(e,r){if(!(typeof window>"u")){var n,a=window;return this.requiresTimeout===!0?n=pr(e,r):a.requestAnimationFrame&&(n=a.requestAnimationFrame(e)),n}}},{key:"_startRendering",value:function(){if(this.renderingActive===!0&&this.renderTimer===void 0){var e;this.renderTimer=this._requestNextFrame(A(e=this._renderStep).call(e,this),this.simulationInterval)}}},{key:"_renderStep",value:function(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var e=this;this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this._requestNextFrame(function(){e._redraw(!1)},0))}},{key:"_redraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var r={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();var n=this.canvas.getContext(),a=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(n.clearRect(0,0,a,o),this.canvas.frame.clientWidth===0)return;if(n.save(),n.translate(this.body.view.translation.x,this.body.view.translation.y),n.scale(this.body.view.scale,this.body.view.scale),n.beginPath(),this.body.emitter.emit("beforeDrawing",n),n.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(n),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){var s=this._drawNodes(n,e),u=s.drawExternalLabels;r.drawExternalLabels=u}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(n),r.drawExternalLabels!=null&&r.drawExternalLabels(),e===!1&&this._drawSelectionBox(n),n.beginPath(),this.body.emitter.emit("afterDrawing",n),n.closePath(),n.restore(),e===!0&&n.clearRect(0,0,a,o)}}},{key:"_resizeNodes",value:function(){this.canvas.setTransform();var e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);var r=this.body.nodes,n;for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n=r[a],n.resize(e),n.updateBoundingBox(e,n.selected));e.restore()}},{key:"_drawNodes",value:function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.body.nodes,a=this.body.nodeIndices,o,s=[],u=[],l=20,c=this.canvas.DOMtoCanvas({x:-l,y:-l}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+l,y:this.canvas.frame.canvas.clientHeight+l}),d={top:c.y,left:c.x,bottom:h.y,right:h.x},f=[],v=0;v<a.length;v++)if(o=n[a[v]],o.hover)u.push(a[v]);else if(o.isSelected())s.push(a[v]);else if(r===!0){var g=o.draw(e);g.drawExternalLabel!=null&&f.push(g.drawExternalLabel)}else if(o.isBoundingBoxOverlappingWith(d)===!0){var b=o.draw(e);b.drawExternalLabel!=null&&f.push(b.drawExternalLabel)}else o.updateBoundingBox(e,o.selected);var p,$=s.length,m=u.length;for(p=0;p<$;p++){o=n[s[p]];var y=o.draw(e);y.drawExternalLabel!=null&&f.push(y.drawExternalLabel)}for(p=0;p<m;p++){o=n[u[p]];var w=o.draw(e);w.drawExternalLabel!=null&&f.push(w.drawExternalLabel)}return{drawExternalLabels:function(){for(var T=0,O=f;T<O.length;T++){var _=O[T];_()}}}}},{key:"_drawEdges",value:function(e){for(var r=this.body.edges,n=this.body.edgeIndices,a=0;a<n.length;a++){var o=r[n[a]];o.connected===!0&&o.draw(e)}}},{key:"_drawArrows",value:function(e){for(var r=this.body.edges,n=this.body.edgeIndices,a=0;a<n.length;a++){var o=r[n[a]];o.connected===!0&&o.drawArrows(e)}}},{key:"_determineBrowserMethod",value:function(){if(typeof window<"u"){var e=navigator.userAgent.toLowerCase();this.requiresTimeout=!1,ae(e).call(e,"msie 9.0")!=-1?this.requiresTimeout=!0:ae(e).call(e,"safari")!=-1&&ae(e).call(e,"chrome")<=-1&&(this.requiresTimeout=!0)}else this.requiresTimeout=!0}},{key:"_drawSelectionBox",value:function(e){if(this.body.selectionBox.show){e.beginPath();var r=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,n=this.body.selectionBox.position.end.y-this.body.selectionBox.position.start.y;e.rect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,r,n),e.fillStyle="rgba(151, 194, 252, 0.2)",e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,r,n),e.strokeStyle="rgba(151, 194, 252, 1)",e.stroke()}else e.closePath()}}]),t}(),Vp={},Eye={get exports(){return Vp},set exports(t){Vp=t}},Sye=ie,Oye=Sye.setInterval;(function(t){t.exports=Oye})(Eye);var Tye=V(Vp);function Wu(t,i){i.inputHandler=function(e){e.isFirst&&i(e)},t.on("hammer.input",i.inputHandler)}function zP(t,i){return i.inputHandler=function(e){e.isFinal&&i(e)},t.on("hammer.input",i.inputHandler)}var xye=function(){function t(i){N(this,t),this.body=i,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},je(this.options,this.defaultOptions),this.bindEventListeners()}return F(t,[{key:"bindEventListeners",value:function(){var e=this,r;this.body.emitter.once("resize",function(n){n.width!==0&&(e.body.view.translation.x=n.width*.5),n.height!==0&&(e.body.view.translation.y=n.height*.5)}),this.body.emitter.on("setSize",A(r=this.setSize).call(r,this)),this.body.emitter.on("destroy",function(){e.hammerFrame.destroy(),e.hammer.destroy(),e._cleanUp()})}},{key:"setOptions",value:function(e){var r=this;if(e!==void 0){var n=["width","height","autoResize"];pa(n,this.options,e)}if(this._cleanUp(),this.options.autoResize===!0){var a;if(window.ResizeObserver){var o=new ResizeObserver(function(){var c=r.setSize();c===!0&&r.body.emitter.emit("_requestRedraw")}),s=this.frame;o.observe(s),this._cleanupCallbacks.push(function(){o.unobserve(s)})}else{var u=Tye(function(){var c=r.setSize();c===!0&&r.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(function(){clearInterval(u)})}var l=A(a=this._onResize).call(a,this);Nce(window,"resize",l),this._cleanupCallbacks.push(function(){Fce(window,"resize",l)})}}},{key:"_cleanUp",value:function(){var e,r,n;ge(e=An(r=Or(n=this._cleanupCallbacks).call(n,0)).call(r)).call(e,function(a){try{a()}catch(o){console.error(o)}})}},{key:"_onResize",value:function(){this.setSize(),this.body.emitter.emit("_redraw")}},{key:"_getCameraState",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}},{key:"_setCameraState",value:function(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){var e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,r=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,n=this.cameraState.scale;e!=1&&r!=1?n=this.cameraState.scale*.5*(e+r):e!=1?n=this.cameraState.scale*e:r!=1&&(n=this.cameraState.scale*r),this.body.view.scale=n;var a=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),o={x:a.x-this.cameraState.position.x,y:a.y-this.cameraState.position.y};this.body.view.translation.x+=o.x*this.body.view.scale,this.body.view.translation.y+=o.y*this.body.view.scale}}},{key:"_prepareValue",value:function(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(ae(e).call(e,"%")!==-1||ae(e).call(e,"px")!==-1)return e;if(ae(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}},{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 e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var e=this;this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new Ii(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:Ii.DIRECTION_ALL}),Wu(this.hammer,function(r){e.body.eventListeners.onTouch(r)}),this.hammer.on("tap",function(r){e.body.eventListeners.onTap(r)}),this.hammer.on("doubletap",function(r){e.body.eventListeners.onDoubleTap(r)}),this.hammer.on("press",function(r){e.body.eventListeners.onHold(r)}),this.hammer.on("panstart",function(r){e.body.eventListeners.onDragStart(r)}),this.hammer.on("panmove",function(r){e.body.eventListeners.onDrag(r)}),this.hammer.on("panend",function(r){e.body.eventListeners.onDragEnd(r)}),this.hammer.on("pinch",function(r){e.body.eventListeners.onPinch(r)}),this.frame.canvas.addEventListener("wheel",function(r){e.body.eventListeners.onMouseWheel(r)}),this.frame.canvas.addEventListener("mousemove",function(r){e.body.eventListeners.onMouseMove(r)}),this.frame.canvas.addEventListener("contextmenu",function(r){e.body.eventListeners.onContext(r)}),this.hammerFrame=new Ii(this.frame),zP(this.hammerFrame,function(r){e.body.eventListeners.onRelease(r)})}},{key:"setSize",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),r=this._prepareValue(r);var n=!1,a=this.frame.canvas.width,o=this.frame.canvas.height,s=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||r!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=r)this._getCameraState(s),this.frame.style.width=e,this.frame.style.height=r,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=r,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},n=!0;else{var u=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),l=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==u||this.frame.canvas.height!==l)&&this._getCameraState(s),this.frame.canvas.width!==u&&(this.frame.canvas.width=u,n=!0),this.frame.canvas.height!==l&&(this.frame.canvas.height=l,n=!0)}return n===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(a/this.pixelRatio),oldHeight:Math.round(o/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,n}},{key:"getContext",value:function(){return this.frame.canvas.getContext("2d")}},{key:"_determinePixelRatio",value:function(){var e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");var r=1;typeof window<"u"&&(r=window.devicePixelRatio||1);var n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return r/n}},{key:"_setPixelRatio",value:function(){this.pixelRatio=this._determinePixelRatio()}},{key:"setTransform",value:function(){var e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}},{key:"_XconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}},{key:"DOMtoCanvas",value:function(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}]),t}();function Pye(t,i){var e=je({nodes:i,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},t??{});if(!ve(e.nodes))throw new TypeError("Nodes has to be an array of ids.");if(e.nodes.length===0&&(e.nodes=i),!(typeof e.minZoomLevel=="number"&&e.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof e.maxZoomLevel=="number"&&e.minZoomLevel<=e.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return e}var kye=function(){function t(i,e){var r,n=this,a;N(this,t),this.body=i,this.canvas=e,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",A(r=this.fit).call(r,this)),this.body.emitter.on("animationFinished",function(){n.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",A(a=this.releaseNode).call(a,this))}return F(t,[{key:"setOptions",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}},{key:"fit",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=Pye(e,this.body.nodeIndices);var n=this.canvas.frame.canvas.clientWidth,a=this.canvas.frame.canvas.clientHeight,o,s;if(n===0||a===0)s=1,o=dt.getRange(this.body.nodes,e.nodes);else if(r===!0){var u=0;for(var l in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,l)){var c=this.body.nodes[l];c.predefinedPosition===!0&&(u+=1)}if(u>.5*this.body.nodeIndices.length){this.fit(e,!1);return}o=dt.getRange(this.body.nodes,e.nodes);var h=this.body.nodeIndices.length;s=12.662/(h+7.4147)+.0964822;var d=Math.min(n/600,a/600);s*=d}else{this.body.emitter.emit("_resizeNodes"),o=dt.getRange(this.body.nodes,e.nodes);var f=Math.abs(o.maxX-o.minX)*1.1,v=Math.abs(o.maxY-o.minY)*1.1,g=n/f,b=a/v;s=g<=b?g:b}s>e.maxZoomLevel?s=e.maxZoomLevel:s<e.minZoomLevel&&(s=e.minZoomLevel);var p=dt.findCenter(o),$={position:p,scale:s,animation:e.animation};this.moveTo($)}},{key:"focus",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){var n={x:this.body.nodes[e].x,y:this.body.nodes[e].y};r.position=n,r.lockedOnNode=e,this.moveTo(r)}else console.error("Node: "+e+" cannot be found.")}},{key:"moveTo",value:function(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!xn(e.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!xn(e.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!xn(e.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!xn(e.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}},{key:"animateView",value:function(e){if(e!==void 0){this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;var r=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n={x:r.x-e.position.x,y:r.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+n.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+n.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var a;this.viewFunction=A(a=this._lockedRedraw).call(a,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var o;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=A(o=this._transitionRedraw).call(o,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}}},{key:"_lockedRedraw",value:function(){var e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},r=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n={x:r.x-e.x,y:r.y-e.y},a=this.body.view.translation,o={x:a.x+n.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:a.y+n.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=o}},{key:"releaseNode",value:function(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;var r=jce[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*r,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*r,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*r},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var n;this.viewFunction=A(n=this._lockedRedraw).call(n,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})}}]),t}();function z0(t){var i=t&&t.preventDefault||!1,e=t&&t.container||window,r={},n={keydown:{},keyup:{}},a={},o;for(o=97;o<=122;o++)a[String.fromCharCode(o)]={code:65+(o-97),shift:!1};for(o=65;o<=90;o++)a[String.fromCharCode(o)]={code:o,shift:!0};for(o=0;o<=9;o++)a[""+o]={code:48+o,shift:!1};for(o=1;o<=12;o++)a["F"+o]={code:111+o,shift:!1};for(o=0;o<=9;o++)a["num"+o]={code:96+o,shift:!1};a["num*"]={code:106,shift:!1},a["num+"]={code:107,shift:!1},a["num-"]={code:109,shift:!1},a["num/"]={code:111,shift:!1},a["num."]={code:110,shift:!1},a.left={code:37,shift:!1},a.up={code:38,shift:!1},a.right={code:39,shift:!1},a.down={code:40,shift:!1},a.space={code:32,shift:!1},a.enter={code:13,shift:!1},a.shift={code:16,shift:void 0},a.esc={code:27,shift:!1},a.backspace={code:8,shift:!1},a.tab={code:9,shift:!1},a.ctrl={code:17,shift:!1},a.alt={code:18,shift:!1},a.delete={code:46,shift:!1},a.pageup={code:33,shift:!1},a.pagedown={code:34,shift:!1},a["="]={code:187,shift:!1},a["-"]={code:189,shift:!1},a["]"]={code:221,shift:!1},a["["]={code:219,shift:!1};var s=function(c){l(c,"keydown")},u=function(c){l(c,"keyup")},l=function(c,h){if(n[h][c.keyCode]!==void 0){for(var d=n[h][c.keyCode],f=0;f<d.length;f++)(d[f].shift===void 0||d[f].shift==!0&&c.shiftKey==!0||d[f].shift==!1&&c.shiftKey==!1)&&d[f].fn(c);i==!0&&c.preventDefault()}};return r.bind=function(c,h,d){if(d===void 0&&(d="keydown"),a[c]===void 0)throw new Error("unsupported key: "+c);n[d][a[c].code]===void 0&&(n[d][a[c].code]=[]),n[d][a[c].code].push({fn:h,shift:a[c].shift})},r.bindAll=function(c,h){h===void 0&&(h="keydown");for(var d in a)a.hasOwnProperty(d)&&r.bind(d,c,h)},r.getKey=function(c){for(var h in a)if(a.hasOwnProperty(h)){if(c.shiftKey==!0&&a[h].shift==!0&&c.keyCode==a[h].code)return h;if(c.shiftKey==!1&&a[h].shift==!1&&c.keyCode==a[h].code)return h;if(c.keyCode==a[h].code&&h=="shift")return h}return"unknown key, currently not supported"},r.unbind=function(c,h,d){if(d===void 0&&(d="keydown"),a[c]===void 0)throw new Error("unsupported key: "+c);if(h!==void 0){var f=[],v=n[d][a[c].code];if(v!==void 0)for(var g=0;g<v.length;g++)v[g].fn==h&&v[g].shift==a[c].shift||f.push(n[d][a[c].code][g]);n[d][a[c].code]=f}else n[d][a[c].code]=[]},r.reset=function(){n={keydown:{},keyup:{}}},r.destroy=function(){n={keydown:{},keyup:{}},e.removeEventListener("keydown",s,!0),e.removeEventListener("keyup",u,!0)},e.addEventListener("keydown",s,!0),e.addEventListener("keyup",u,!0),r}var Iye=function(){function t(i,e){var r=this;N(this,t),this.body=i,this.canvas=e,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",function(){r.activated=!0,r.configureKeyboardBindings()}),this.body.emitter.on("deactivate",function(){r.activated=!1,r.configureKeyboardBindings()}),this.body.emitter.on("destroy",function(){r.keycharm!==void 0&&r.keycharm.destroy()}),this.options={}}return F(t,[{key:"setOptions",value:function(e){e!==void 0&&(this.options=e,this.create())}},{key:"create",value:function(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}},{key:"cleanNavigation",value:function(){if(this.navigationHammers.length!=0){for(var e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}},{key:"loadNavigationElements",value:function(){var e=this;this.cleanNavigation(),this.navigationDOM={};var r=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],n=["_moveUp","_moveDown","_moveLeft","_moveRight","_zoomIn","_zoomOut","_fit"];this.navigationDOM.wrapper=document.createElement("div"),this.navigationDOM.wrapper.className="vis-navigation",this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(var a=0;a<r.length;a++){this.navigationDOM[r[a]]=document.createElement("div"),this.navigationDOM[r[a]].className="vis-button vis-"+r[a],this.navigationDOM.wrapper.appendChild(this.navigationDOM[r[a]]);var o=new Ii(this.navigationDOM[r[a]]);if(n[a]==="_fit"){var s;Wu(o,A(s=this._fit).call(s,this))}else{var u;Wu(o,A(u=this.bindToRedraw).call(u,this,n[a]))}this.navigationHammers.push(o)}var l=new Ii(this.canvas.frame);zP(l,function(){e._stopMovement()}),this.navigationHammers.push(l),this.iconsCreated=!0}},{key:"bindToRedraw",value:function(e){if(this.boundFunctions[e]===void 0){var r;this.boundFunctions[e]=A(r=this[e]).call(r,this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering")}}},{key:"unbindFromRedraw",value:function(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}},{key:"_fit",value:function(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}},{key:"_stopMovement",value:function(){for(var e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{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 e=this.body.view.scale,r=this.body.view.scale*(1+this.options.keyboard.speed.zoom),n=this.body.view.translation,a=r/e,o=(1-a)*this.canvas.canvasViewCenter.x+n.x*a,s=(1-a)*this.canvas.canvasViewCenter.y+n.y*a;this.body.view.scale=r,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}},{key:"_zoomOut",value:function(){var e=this.body.view.scale,r=this.body.view.scale/(1+this.options.keyboard.speed.zoom),n=this.body.view.translation,a=r/e,o=(1-a)*this.canvas.canvasViewCenter.x+n.x*a,s=(1-a)*this.canvas.canvasViewCenter.y+n.y*a;this.body.view.scale=r,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}},{key:"configureKeyboardBindings",value:function(){var e=this;if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=z0({container:window,preventDefault:!0}):this.keycharm=z0({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var r,n,a,o,s,u,l,c,h,d,f,v,g,b,p,$,m,y,w,S,T,O,_,E;A(r=this.keycharm).call(r,"up",function(){e.bindToRedraw("_moveUp")},"keydown"),A(n=this.keycharm).call(n,"down",function(){e.bindToRedraw("_moveDown")},"keydown"),A(a=this.keycharm).call(a,"left",function(){e.bindToRedraw("_moveLeft")},"keydown"),A(o=this.keycharm).call(o,"right",function(){e.bindToRedraw("_moveRight")},"keydown"),A(s=this.keycharm).call(s,"=",function(){e.bindToRedraw("_zoomIn")},"keydown"),A(u=this.keycharm).call(u,"num+",function(){e.bindToRedraw("_zoomIn")},"keydown"),A(l=this.keycharm).call(l,"num-",function(){e.bindToRedraw("_zoomOut")},"keydown"),A(c=this.keycharm).call(c,"-",function(){e.bindToRedraw("_zoomOut")},"keydown"),A(h=this.keycharm).call(h,"[",function(){e.bindToRedraw("_zoomOut")},"keydown"),A(d=this.keycharm).call(d,"]",function(){e.bindToRedraw("_zoomIn")},"keydown"),A(f=this.keycharm).call(f,"pageup",function(){e.bindToRedraw("_zoomIn")},"keydown"),A(v=this.keycharm).call(v,"pagedown",function(){e.bindToRedraw("_zoomOut")},"keydown"),A(g=this.keycharm).call(g,"up",function(){e.unbindFromRedraw("_moveUp")},"keyup"),A(b=this.keycharm).call(b,"down",function(){e.unbindFromRedraw("_moveDown")},"keyup"),A(p=this.keycharm).call(p,"left",function(){e.unbindFromRedraw("_moveLeft")},"keyup"),A($=this.keycharm).call($,"right",function(){e.unbindFromRedraw("_moveRight")},"keyup"),A(m=this.keycharm).call(m,"=",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),A(y=this.keycharm).call(y,"num+",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),A(w=this.keycharm).call(w,"num-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),A(S=this.keycharm).call(S,"-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),A(T=this.keycharm).call(T,"[",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),A(O=this.keycharm).call(O,"]",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),A(_=this.keycharm).call(_,"pageup",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),A(E=this.keycharm).call(E,"pagedown",function(){e.unbindFromRedraw("_zoomOut")},"keyup")}}}]),t}();function Cye(t,i){var e=typeof pn<"u"&&Br(t)||t["@@iterator"];if(!e){if(ve(t)||(e=Aye(t))||i&&t&&typeof t.length=="number"){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
95
95
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Aye(t,i){var e;if(t){if(typeof t=="string")return H0(t,i);var r=st(e=Object.prototype.toString.call(t)).call(e,8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return ei(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return H0(t,i)}}function H0(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,r=new Array(i);e<i;e++)r[e]=t[e];return r}var Rye=function(){function t(i,e,r){var n,a,o,s,u,l,c,h,d,f,v,g,b;N(this,t),this.body=i,this.canvas=e,this.selectionHandler=r,this.navigationHandler=new Iye(i,e),this.body.eventListeners.onTap=A(n=this.onTap).call(n,this),this.body.eventListeners.onTouch=A(a=this.onTouch).call(a,this),this.body.eventListeners.onDoubleTap=A(o=this.onDoubleTap).call(o,this),this.body.eventListeners.onHold=A(s=this.onHold).call(s,this),this.body.eventListeners.onDragStart=A(u=this.onDragStart).call(u,this),this.body.eventListeners.onDrag=A(l=this.onDrag).call(l,this),this.body.eventListeners.onDragEnd=A(c=this.onDragEnd).call(c,this),this.body.eventListeners.onMouseWheel=A(h=this.onMouseWheel).call(h,this),this.body.eventListeners.onPinch=A(d=this.onPinch).call(d,this),this.body.eventListeners.onMouseMove=A(f=this.onMouseMove).call(f,this),this.body.eventListeners.onRelease=A(v=this.onRelease).call(v,this),this.body.eventListeners.onContext=A(g=this.onContext).call(g,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=A(b=this.getPointer).call(b,this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0,autoFocus:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},je(this.options,this.defaultOptions),this.bindEventListeners()}return F(t,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("destroy",function(){clearTimeout(e.popupTimer),delete e.body.functions.getPointer})}},{key:"setOptions",value:function(e){if(e!==void 0){var r=["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"];Lu(r,this.options,e),Lt(this.options,e,"keyboard"),e.tooltip&&(je(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=pp(e.tooltip.color)))}this.navigationHandler.setOptions(this.options)}},{key:"getPointer",value:function(e){return{x:e.x-Dce(this.canvas.frame.canvas),y:e.y-Mce(this.canvas.frame.canvas)}}},{key:"onTouch",value:function(e){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}},{key:"onTap",value:function(e){var r=this.getPointer(e.center),n=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(r,n),this.selectionHandler.commitAndEmit(r,e),this.selectionHandler.generateClickEvent("click",e,r)}},{key:"onDoubleTap",value:function(e){var r=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,r)}},{key:"onHold",value:function(e){var r=this.getPointer(e.center),n=this.selectionHandler.options.multiselect;this.checkSelectionChanges(r,n),this.selectionHandler.commitAndEmit(r,e),this.selectionHandler.generateClickEvent("click",e,r),this.selectionHandler.generateClickEvent("hold",e,r)}},{key:"onRelease",value:function(e){if(new Date().valueOf()-this.touchTime>10){var r=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,r),this.touchTime=new Date().valueOf()}}},{key:"onContext",value:function(e){var r=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,r)}},{key:"checkSelectionChanges",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;r===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}},{key:"_determineDifference",value:function(e,r){var n=function(o,s){for(var u=[],l=0;l<o.length;l++){var c=o[l];ae(s).call(s,c)===-1&&u.push(c)}return u};return{nodes:n(e.nodes,r.nodes),edges:n(e.edges,r.edges)}}},{key:"onDragStart",value:function(e){if(!this.drag.dragging){this.drag.pointer===void 0&&this.onTouch(e);var r=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=je({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;var n=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(n.x),y:this.canvas._YconvertDOMtoCanvas(n.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(n.x),y:this.canvas._YconvertDOMtoCanvas(n.y)}}else if(r!==void 0&&this.options.dragNodes===!0){this.drag.nodeId=r.id,r.isSelected()===!1&&this.selectionHandler.setSelection({nodes:[r.id]}),this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer);var a=Cye(this.selectionHandler.getSelectedNodes()),o;try{for(a.s();!(o=a.n()).done;){var s=o.value,u={id:s.id,node:s,x:s.x,y:s.y,xFixed:s.options.fixed.x,yFixed:s.options.fixed.y};s.options.fixed.x=!0,s.options.fixed.y=!0,this.drag.selection.push(u)}}catch(l){a.e(l)}finally{a.f()}}else this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}}},{key:"onDrag",value:function(e){var r=this;if(this.drag.pinched!==!0){this.body.emitter.emit("unlockNode");var n=this.getPointer(e.center),a=this.drag.selection;if(a&&a.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent("dragging",e,n);var o=n.x-this.drag.pointer.x,s=n.y-this.drag.pointer.y;ge(a).call(a,function(c){var h=c.node;c.xFixed===!1&&(h.x=r.canvas._XconvertDOMtoCanvas(r.canvas._XconvertCanvasToDOM(c.x)+o)),c.yFixed===!1&&(h.y=r.canvas._YconvertDOMtoCanvas(r.canvas._YconvertCanvasToDOM(c.y)+s))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,n,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(n.x),y:this.canvas._YconvertDOMtoCanvas(n.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,n,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}var u=n.x-this.drag.pointer.x,l=n.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+u,y:this.drag.translation.y+l},this.body.emitter.emit("_requestRedraw")}}}}},{key:"onDragEnd",value:function(e){var r=this;if(this.drag.dragging=!1,this.body.selectionBox.show){var n;this.body.selectionBox.show=!1;var a=this.body.selectionBox.position,o={minX:Math.min(a.start.x,a.end.x),minY:Math.min(a.start.y,a.end.y),maxX:Math.max(a.start.x,a.end.x),maxY:Math.max(a.start.y,a.end.y)},s=St(n=this.body.nodeIndices).call(n,function(c){var h=r.body.nodes[c];return h.x>=o.minX&&h.x<=o.maxX&&h.y>=o.minY&&h.y<=o.maxY});ge(s).call(s,function(c){return r.selectionHandler.selectObject(r.body.nodes[c])});var u=this.getPointer(e.center);this.selectionHandler.commitAndEmit(u,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{var l=this.drag.selection;l&&l.length?(ge(l).call(l,function(c){c.node.options.fixed.x=c.xFixed,c.node.options.fixed.y=c.yFixed}),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}},{key:"onPinch",value:function(e){var r=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);var n=this.pinch.scale*e.scale;this.zoom(n,r)}},{key:"zoom",value:function(e,r){if(this.options.zoomView===!0){var n=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);var a=void 0;this.drag!==void 0&&this.drag.dragging===!0&&(a=this.canvas.DOMtoCanvas(this.drag.pointer));var o=this.body.view.translation,s=e/n,u=(1-s)*r.x+o.x*s,l=(1-s)*r.y+o.y*s;if(this.body.view.scale=e,this.body.view.translation={x:u,y:l},a!=null){var c=this.canvas.canvasToDOM(a);this.drag.pointer.x=c.x,this.drag.pointer.y=c.y}this.body.emitter.emit("_requestRedraw"),n<e?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:r}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:r})}}},{key:"onMouseWheel",value:function(e){if(this.options.zoomView===!0){if(e.deltaY!==0){var r=this.body.view.scale;r*=1+(e.deltaY<0?1:-1)*(this.options.zoomSpeed*.1);var n=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(r,n)}e.preventDefault()}}},{key:"onMouseMove",value:function(e){var r=this,n=this.getPointer({x:e.clientX,y:e.clientY}),a=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(n),this.popup.hidden===!1&&(a=!0,this.popup.setPosition(n.x+3,n.y-5),this.popup.show())),this.options.keyboard.autoFocus&&this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),a===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=pr(function(){return r._checkShowPopup(n)},this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,n)}},{key:"_checkShowPopup",value:function(e){var r=this.canvas._XconvertDOMtoCanvas(e.x),n=this.canvas._YconvertDOMtoCanvas(e.y),a={left:r,top:n,right:r,bottom:n},o=this.popupObj===void 0?void 0:this.popupObj.id,s=!1,u="node";if(this.popupObj===void 0){for(var l=this.body.nodeIndices,c=this.body.nodes,h,d=[],f=0;f<l.length;f++)h=c[l[f]],h.isOverlappingWith(a)===!0&&(s=!0,h.getTitle()!==void 0&&d.push(l[f]));d.length>0&&(this.popupObj=c[d[d.length-1]],s=!0)}if(this.popupObj===void 0&&s===!1){for(var v=this.body.edgeIndices,g=this.body.edges,b,p=[],$=0;$<v.length;$++)b=g[v[$]],b.isOverlappingWith(a)===!0&&b.connected===!0&&b.getTitle()!==void 0&&p.push(v[$]);p.length>0&&(this.popupObj=g[p[p.length-1]],u="edge")}this.popupObj!==void 0?this.popupObj.id!==o&&(this.popup===void 0&&(this.popup=new qce(this.canvas.frame)),this.popup.popupTargetType=u,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}},{key:"_checkHidePopup",value:function(e){var r=this.selectionHandler._pointerToPositionObject(e),n=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(n=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(r),n===!0)){var a=this.selectionHandler.getNodeAt(e);n=a===void 0?!1:a.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(n=this.body.edges[this.popup.popupTargetId].isOverlappingWith(r));n===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),t}(),Up={},Dye={get exports(){return Up},set exports(t){Up=t}},Mye=Ey,Nye=TP;Mye("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Nye);var Fye=ie,Bye=Fye.Set,Lye=Bye,jye=Lye;(function(t){t.exports=jye})(Dye);var Sn=V(Up),Gp={},zye={get exports(){return Gp},set exports(t){Gp=t}},Hye=ue,W0=Sy,zs=Ui.getWeakData,Wye=_y,Vye=Ft,Uye=Fo,Zh=et,Gye=wy,HP=fn,V0=tt,WP=Jn,Kye=WP.set,qye=WP.getterFor,Yye=HP.find,Xye=HP.findIndex,Qye=Hye([].splice),Zye=0,Hs=function(t){return t.frozen||(t.frozen=new VP)},VP=function(){this.entries=[]},Jh=function(t,i){return Yye(t.entries,function(e){return e[0]===i})};VP.prototype={get:function(t){var i=Jh(this,t);if(i)return i[1]},has:function(t){return!!Jh(this,t)},set:function(t,i){var e=Jh(this,t);e?e[1]=i:this.entries.push([t,i])},delete:function(t){var i=Xye(this.entries,function(e){return e[0]===t});return~i&&Qye(this.entries,i,1),!!~i}};var Jye={getConstructor:function(t,i,e,r){var n=t(function(u,l){Wye(u,a),Kye(u,{type:i,id:Zye++,frozen:void 0}),Uye(l)||Gye(l,u[r],{that:u,AS_ENTRIES:e})}),a=n.prototype,o=qye(i),s=function(u,l,c){var h=o(u),d=zs(Vye(l),!0);return d===!0?Hs(h).set(l,c):d[h.id]=c,u};return W0(a,{delete:function(u){var l=o(this);if(!Zh(u))return!1;var c=zs(u);return c===!0?Hs(l).delete(u):c&&V0(c,l.id)&&delete c[l.id]},has:function(l){var c=o(this);if(!Zh(l))return!1;var h=zs(l);return h===!0?Hs(c).has(l):h&&V0(h,c.id)}}),W0(a,e?{get:function(l){var c=o(this);if(Zh(l)){var h=zs(l);return h===!0?Hs(c).get(l):h?h[c.id]:void 0}},set:function(l,c){return s(this,l,c)}}:{add:function(l){return s(this,l,!0)}}),n}},eme=_P,U0=Ve,uu=ue,G0=Sy,tme=Ui,rme=Ey,UP=Jye,Ws=et,Vs=Jn.enforce,nme=se,ime=hT,ss=Object,ame=Array.isArray,Us=ss.isExtensible,GP=ss.isFrozen,ome=ss.isSealed,KP=ss.freeze,sme=ss.seal,K0={},q0={},ume=!U0.ActiveXObject&&"ActiveXObject"in U0,Ea,qP=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},YP=rme("WeakMap",qP,UP),gi=YP.prototype,lu=uu(gi.set),lme=function(){return eme&&nme(function(){var t=KP([]);return lu(new YP,t,1),!GP(t)})};if(ime)if(ume){Ea=UP.getConstructor(qP,"WeakMap",!0),tme.enable();var Y0=uu(gi.delete),Gs=uu(gi.has),X0=uu(gi.get);G0(gi,{delete:function(t){if(Ws(t)&&!Us(t)){var i=Vs(this);return i.frozen||(i.frozen=new Ea),Y0(this,t)||i.frozen.delete(t)}return Y0(this,t)},has:function(i){if(Ws(i)&&!Us(i)){var e=Vs(this);return e.frozen||(e.frozen=new Ea),Gs(this,i)||e.frozen.has(i)}return Gs(this,i)},get:function(i){if(Ws(i)&&!Us(i)){var e=Vs(this);return e.frozen||(e.frozen=new Ea),Gs(this,i)?X0(this,i):e.frozen.get(i)}return X0(this,i)},set:function(i,e){if(Ws(i)&&!Us(i)){var r=Vs(this);r.frozen||(r.frozen=new Ea),Gs(this,i)?lu(this,i,e):r.frozen.set(i,e)}else lu(this,i,e);return this}})}else lme()&&G0(gi,{set:function(i,e){var r;return ame(i)&&(GP(i)?r=K0:ome(i)&&(r=q0)),lu(this,i,e),r==K0&&KP(i),r==q0&&sme(i),this}});var cme=ie,hme=cme.WeakMap,dme=hme,fme=dme;(function(t){t.exports=fme})(zye);var La=V(Gp);function me(t,i,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?t!==i||!r:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(t):r?r.value:i.get(t)}function Kp(t,i,e,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?t!==i||!n:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(t,e):n?n.value=e:i.set(t,e),e}function qp(t,i){var e=typeof pn<"u"&&Br(t)||t["@@iterator"];if(!e){if(ve(t)||(e=vme(t))||i&&t&&typeof t.length=="number"){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
96
96
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function vme(t,i){var e;if(t){if(typeof t=="string")return Q0(t,i);var r=st(e=Object.prototype.toString.call(t)).call(e,8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return ei(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Q0(t,i)}}function Q0(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,r=new Array(i);e<i;e++)r[e]=t[e];return r}var wn,Bt,Hr,Wr,cu;function Z0(t,i){var e=new Sn,r=qp(i),n;try{for(r.s();!(n=r.n()).done;){var a=n.value;t.has(a)||e.add(a)}}catch(o){r.e(o)}finally{r.f()}return e}var J0=function(){function t(){N(this,t),wn.set(this,new Sn),Bt.set(this,new Sn)}return F(t,[{key:"size",get:function(){return me(this,Bt,"f").size}},{key:"add",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(var a=0,o=r;a<o.length;a++){var s=o[a];me(this,Bt,"f").add(s)}}},{key:"delete",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(var a=0,o=r;a<o.length;a++){var s=o[a];me(this,Bt,"f").delete(s)}}},{key:"clear",value:function(){me(this,Bt,"f").clear()}},{key:"getSelection",value:function(){return lr(me(this,Bt,"f"))}},{key:"getChanges",value:function(){return{added:lr(Z0(me(this,wn,"f"),me(this,Bt,"f"))),deleted:lr(Z0(me(this,Bt,"f"),me(this,wn,"f"))),previous:lr(new Sn(me(this,wn,"f"))),current:lr(new Sn(me(this,Bt,"f")))}}},{key:"commit",value:function(){var e=this.getChanges();Kp(this,wn,me(this,Bt,"f"),"f"),Kp(this,Bt,new Sn(me(this,wn,"f")),"f");var r=qp(e.added),n;try{for(r.s();!(n=r.n()).done;){var a=n.value;a.select()}}catch(l){r.e(l)}finally{r.f()}var o=qp(e.deleted),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;u.unselect()}}catch(l){o.e(l)}finally{o.f()}return e}}]),t}();wn=new La,Bt=new La;var pme=function(){function t(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};N(this,t),Hr.set(this,new J0),Wr.set(this,new J0),cu.set(this,void 0),Kp(this,cu,i,"f")}return F(t,[{key:"sizeNodes",get:function(){return me(this,Hr,"f").size}},{key:"sizeEdges",get:function(){return me(this,Wr,"f").size}},{key:"getNodes",value:function(){return me(this,Hr,"f").getSelection()}},{key:"getEdges",value:function(){return me(this,Wr,"f").getSelection()}},{key:"addNodes",value:function(){var e;(e=me(this,Hr,"f")).add.apply(e,arguments)}},{key:"addEdges",value:function(){var e;(e=me(this,Wr,"f")).add.apply(e,arguments)}},{key:"deleteNodes",value:function(e){me(this,Hr,"f").delete(e)}},{key:"deleteEdges",value:function(e){me(this,Wr,"f").delete(e)}},{key:"clear",value:function(){me(this,Hr,"f").clear(),me(this,Wr,"f").clear()}},{key:"commit",value:function(){for(var e,r,n={nodes:me(this,Hr,"f").commit(),edges:me(this,Wr,"f").commit()},a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return(e=me(this,cu,"f")).call.apply(e,oy(r=[this,n]).call(r,o)),n}}]),t}();Hr=new La,Wr=new La,cu=new La;function e_(t,i){var e=typeof pn<"u"&&Br(t)||t["@@iterator"];if(!e){if(ve(t)||(e=gme(t))||i&&t&&typeof t.length=="number"){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
97
97
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function gme(t,i){var e;if(t){if(typeof t=="string")return t_(t,i);var r=st(e=Object.prototype.toString.call(t)).call(e,8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return ei(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t_(t,i)}}function t_(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,r=new Array(i);e<i;e++)r[e]=t[e];return r}var yme=function(){function t(i,e){var r=this;N(this,t),this.body=i,this.canvas=e,this._selectionAccumulator=new pme,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},je(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",function(){r.updateSelection()})}return F(t,[{key:"setOptions",value:function(e){if(e!==void 0){var r=["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"];pa(r,this.options,e)}}},{key:"selectOnPoint",value:function(e){var r=!1;if(this.options.selectable===!0){var n=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),n!==void 0&&(r=this.selectObject(n)),this.body.emitter.emit("_requestRedraw")}return r}},{key:"selectAdditionalOnPoint",value:function(e){var r=!1;if(this.options.selectable===!0){var n=this.getNodeAt(e)||this.getEdgeAt(e);n!==void 0&&(r=!0,n.isSelected()===!0?this.deselectObject(n):this.selectObject(n),this.body.emitter.emit("_requestRedraw"))}return r}},{key:"_initBaseEvent",value:function(e,r){var n={};return n.pointer={DOM:{x:r.x,y:r.y},canvas:this.canvas.DOMtoCanvas(r)},n.event=e,n}},{key:"generateClickEvent",value:function(e,r,n,a){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,s=this._initBaseEvent(r,n);if(o===!0)s.nodes=[],s.edges=[];else{var u=this.getSelection();s.nodes=u.nodes,s.edges=u.edges}a!==void 0&&(s.previousSelection=a),e=="click"&&(s.items=this.getClickedItems(n)),r.controlEdge!==void 0&&(s.controlEdge=r.controlEdge),this.body.emitter.emit(e,s)}},{key:"selectObject",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;if(e!==void 0){if(e instanceof kt){if(r===!0){var n;(n=this._selectionAccumulator).addEdges.apply(n,lr(e.edges))}this._selectionAccumulator.addNodes(e)}else this._selectionAccumulator.addEdges(e);return!0}return!1}},{key:"deselectObject",value:function(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}},{key:"_getAllNodesOverlappingWith",value:function(e){for(var r=[],n=this.body.nodes,a=0;a<this.body.nodeIndices.length;a++){var o=this.body.nodeIndices[a];n[o].isOverlappingWith(e)&&r.push(o)}return r}},{key:"_pointerToPositionObject",value:function(e){var r=this.canvas.DOMtoCanvas(e);return{left:r.x-1,top:r.y+1,right:r.x+1,bottom:r.y-1}}},{key:"getNodeAt",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this._pointerToPositionObject(e),a=this._getAllNodesOverlappingWith(n);if(a.length>0)return r===!0?this.body.nodes[a[a.length-1]]:a[a.length-1]}},{key:"_getEdgesOverlappingWith",value:function(e,r){for(var n=this.body.edges,a=0;a<this.body.edgeIndices.length;a++){var o=this.body.edgeIndices[a];n[o].isOverlappingWith(e)&&r.push(o)}}},{key:"_getAllEdgesOverlappingWith",value:function(e){var r=[];return this._getEdgesOverlappingWith(e,r),r}},{key:"getEdgeAt",value:function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this.canvas.DOMtoCanvas(e),a=10,o=null,s=this.body.edges,u=0;u<this.body.edgeIndices.length;u++){var l=this.body.edgeIndices[u],c=s[l];if(c.connected){var h=c.from.x,d=c.from.y,f=c.to.x,v=c.to.y,g=c.edgeType.getDistanceToEdge(h,d,f,v,n.x,n.y);g<a&&(o=l,a=g)}}if(o!==null)return r===!0?this.body.edges[o]:o}},{key:"_addToHover",value:function(e){e instanceof kt?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}},{key:"_removeFromSelection",value:function(e){if(e instanceof kt){var r;this._selectionAccumulator.deleteNodes(e),(r=this._selectionAccumulator).deleteEdges.apply(r,lr(e.edges))}else this._selectionAccumulator.deleteEdges(e)}},{key:"unselectAll",value:function(){this._selectionAccumulator.clear()}},{key:"getSelectedNodeCount",value:function(){return this._selectionAccumulator.sizeNodes}},{key:"getSelectedEdgeCount",value:function(){return this._selectionAccumulator.sizeEdges}},{key:"_hoverConnectedEdges",value:function(e){for(var r=0;r<e.edges.length;r++){var n=e.edges[r];n.hover=!0,this._addToHover(n)}}},{key:"emitBlurEvent",value:function(e,r,n){var a=this._initBaseEvent(e,r);n.hover===!0&&(n.hover=!1,n instanceof kt?(a.node=n.id,this.body.emitter.emit("blurNode",a)):(a.edge=n.id,this.body.emitter.emit("blurEdge",a)))}},{key:"emitHoverEvent",value:function(e,r,n){var a=this._initBaseEvent(e,r),o=!1;return n.hover===!1&&(n.hover=!0,this._addToHover(n),o=!0,n instanceof kt?(a.node=n.id,this.body.emitter.emit("hoverNode",a)):(a.edge=n.id,this.body.emitter.emit("hoverEdge",a))),o}},{key:"hoverObject",value:function(e,r){var n=this.getNodeAt(r);n===void 0&&(n=this.getEdgeAt(r));var a=!1;for(var o in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,o)&&(n===void 0||n instanceof kt&&n.id!=o||n instanceof Ci)&&(this.emitBlurEvent(e,r,this.hoverObj.nodes[o]),delete this.hoverObj.nodes[o],a=!0);for(var s in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,s)&&(a===!0?(this.hoverObj.edges[s].hover=!1,delete this.hoverObj.edges[s]):(n===void 0||n instanceof Ci&&n.id!=s||n instanceof kt&&!n.hover)&&(this.emitBlurEvent(e,r,this.hoverObj.edges[s]),delete this.hoverObj.edges[s],a=!0));if(n!==void 0){var u=Te(this.hoverObj.edges).length,l=Te(this.hoverObj.nodes).length,c=n instanceof Ci&&u===0&&l===0,h=n instanceof kt&&u===0&&l===0;(a||c||h)&&(a=this.emitHoverEvent(e,r,n)),n instanceof kt&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(n)}a===!0&&this.body.emitter.emit("_requestRedraw")}},{key:"commitWithoutEmitting",value:function(){this._selectionAccumulator.commit()}},{key:"commitAndEmit",value:function(e,r){var n=!1,a=this._selectionAccumulator.commit(),o={nodes:a.nodes.previous,edges:a.edges.previous};a.edges.deleted.length>0&&(this.generateClickEvent("deselectEdge",r,e,o),n=!0),a.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",r,e,o),n=!0),a.nodes.added.length>0&&(this.generateClickEvent("selectNode",r,e),n=!0),a.edges.added.length>0&&(this.generateClickEvent("selectEdge",r,e),n=!0),n===!0&&this.generateClickEvent("select",r,e)}},{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 e;return ji(e=this._selectionAccumulator.getNodes()).call(e,function(r){return r.id})}},{key:"getSelectedEdgeIds",value:function(){var e;return ji(e=this._selectionAccumulator.getEdges()).call(e,function(r){return r.id})}},{key:"setSelection",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((r.unselectAll||r.unselectAll===void 0)&&this.unselectAll(),e.nodes){var n=e_(e.nodes),a;try{for(n.s();!(a=n.n()).done;){var o=a.value,s=this.body.nodes[o];if(!s)throw new RangeError('Node with id "'+o+'" not found');this.selectObject(s,r.highlightEdges)}}catch(d){n.e(d)}finally{n.f()}}if(e.edges){var u=e_(e.edges),l;try{for(u.s();!(l=u.n()).done;){var c=l.value,h=this.body.edges[c];if(!h)throw new RangeError('Edge with id "'+c+'" not found');this.selectObject(h)}}catch(d){u.e(d)}finally{u.f()}}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}},{key:"selectNodes",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:r})}},{key:"selectEdges",value:function(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}},{key:"updateSelection",value:function(){for(var e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(var r in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,r.id)||this._selectionAccumulator.deleteEdges(r)}},{key:"getClickedItems",value:function(e){for(var r=this.canvas.DOMtoCanvas(e),n=[],a=this.body.nodeIndices,o=this.body.nodes,s=a.length-1;s>=0;s--){var u=o[a[s]],l=u.getItemsOnPoint(r);n.push.apply(n,l)}for(var c=this.body.edgeIndices,h=this.body.edges,d=c.length-1;d>=0;d--){var f=h[c[d]],v=f.getItemsOnPoint(r);n.push.apply(n,v)}return n}}]),t}(),Yp={},mme={get exports(){return Yp},set exports(t){Yp=t}},r_=DT,$me=Math.floor,Xp=function(t,i){var e=t.length,r=$me(e/2);return e<8?bme(t,i):wme(t,Xp(r_(t,0,r),i),Xp(r_(t,r),i),i)},bme=function(t,i){for(var e=t.length,r=1,n,a;r<e;){for(a=r,n=t[r];a&&i(t[a-1],n)>0;)t[a]=t[--a];a!==r++&&(t[a]=n)}return t},wme=function(t,i,e,r){for(var n=i.length,a=e.length,o=0,s=0;o<n||s<a;)t[o+s]=o<n&&s<a?r(i[o],e[s])<=0?i[o++]:e[s++]:o<n?i[o++]:e[s++];return t},_me=Xp,Eme=Lo,n_=Eme.match(/firefox\/(\d+)/i),Sme=!!n_&&+n_[1],Ome=Lo,Tme=/MSIE|Trident/.test(Ome),xme=Lo,i_=xme.match(/AppleWebKit\/(\d+)\./),Pme=!!i_&&+i_[1],kme=q,XP=ue,Ime=Qn,Cme=Nt,a_=ir,Ame=xx,o_=mr,Iy=se,Rme=_me,Dme=fa,s_=Sme,Mme=Tme,u_=jo,l_=Pme,Xr=[],c_=XP(Xr.sort),Nme=XP(Xr.push),Fme=Iy(function(){Xr.sort(void 0)}),Bme=Iy(function(){Xr.sort(null)}),Lme=Dme("sort"),QP=!Iy(function(){if(u_)return u_<70;if(!(s_&&s_>3)){if(Mme)return!0;if(l_)return l_<603;var t="",i,e,r,n;for(i=65;i<76;i++){switch(e=String.fromCharCode(i),i){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)Xr.push({k:e+n,v:r})}for(Xr.sort(function(a,o){return o.v-a.v}),n=0;n<Xr.length;n++)e=Xr[n].k.charAt(0),t.charAt(t.length-1)!==e&&(t+=e);return t!=="DGBEFHACIJK"}}),jme=Fme||!Bme||!Lme||!QP,zme=function(t){return function(i,e){return e===void 0?-1:i===void 0?1:t!==void 0?+t(i,e)||0:o_(i)>o_(e)?1:-1}};kme({target:"Array",proto:!0,forced:jme},{sort:function(i){i!==void 0&&Ime(i);var e=Cme(this);if(QP)return i===void 0?c_(e):c_(e,i);var r=[],n=a_(e),a,o;for(o=0;o<n;o++)o in e&&Nme(r,e[o]);for(Rme(r,zme(i)),a=a_(r),o=0;o<a;)e[o]=r[o++];for(;o<n;)Ame(e,o++);return e}});var Hme=rt,Wme=Hme("Array").sort,Vme=Ne,Ume=Wme,ed=Array.prototype,Gme=function(t){var i=t.sort;return t===ed||Vme(ed,t)&&i===ed.sort?Ume:i},Kme=Gme,qme=Kme;(function(t){t.exports=qme})(mme);var td=V(Yp),Qp={},Yme={get exports(){return Qp},set exports(t){Qp=t}},Xme=Qn,Qme=Nt,Zme=gl,Jme=ir,e$e=TypeError,h_=function(t){return function(i,e,r,n){Xme(e);var a=Qme(i),o=Zme(a),s=Jme(a),u=t?s-1:0,l=t?-1:1;if(r<2)for(;;){if(u in o){n=o[u],u+=l;break}if(u+=l,t?u<0:s<=u)throw e$e("Reduce of empty array with no initial value")}for(;t?u>=0:s>u;u+=l)u in o&&(n=e(n,o[u],u,a));return n}},t$e={left:h_(!1),right:h_(!0)},r$e=Fr,n$e=typeof process<"u"&&r$e(process)=="process",i$e=q,a$e=t$e.left,o$e=fa,d_=jo,s$e=n$e,u$e=!s$e&&d_>79&&d_<83,l$e=u$e||!o$e("reduce");i$e({target:"Array",proto:!0,forced:l$e},{reduce:function(i){var e=arguments.length;return a$e(this,i,e,e>1?arguments[1]:void 0)}});var c$e=rt,h$e=c$e("Array").reduce,d$e=Ne,f$e=h$e,rd=Array.prototype,v$e=function(t){var i=t.reduce;return t===rd||d$e(rd,t)&&i===rd.reduce?f$e:i},p$e=v$e,g$e=p$e;(function(t){t.exports=g$e})(Yme);var ZP=V(Qp),ao={},y$e={get exports(){return ao},set exports(t){ao=t}},JP={};(function(t){(function(i,e){e(t)})(Zf,function(i){i.__esModule=!0,i.sort=b;function e(p,$){if(!(p instanceof $))throw new TypeError("Cannot call a class as a function")}var r=32,n=7,a=256,o=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9];function s(p){return p<1e5?p<100?p<10?0:1:p<1e4?p<1e3?2:3:4:p<1e7?p<1e6?5:6:p<1e9?p<1e8?7:8:9}function u(p,$){if(p===$)return 0;if(~~p===p&&~~$===$){if(p===0||$===0)return p<$?-1:1;if(p<0||$<0){if($>=0)return-1;if(p>=0)return 1;p=-p,$=-$}var m=s(p),y=s($),w=0;return m<y?(p*=o[y-m-1],$/=10,w=-1):m>y&&($*=o[m-y-1],p/=10,w=1),p===$?w:p<$?-1:1}var S=String(p),T=String($);return S===T?0:S<T?-1:1}function l(p){for(var $=0;p>=r;)$|=p&1,p>>=1;return p+$}function c(p,$,m,y){var w=$+1;if(w===m)return 1;if(y(p[w++],p[$])<0){for(;w<m&&y(p[w],p[w-1])<0;)w++;h(p,$,w)}else for(;w<m&&y(p[w],p[w-1])>=0;)w++;return w-$}function h(p,$,m){for(m--;$<m;){var y=p[$];p[$++]=p[m],p[m--]=y}}function d(p,$,m,y,w){for(y===$&&y++;y<m;y++){for(var S=p[y],T=$,O=y;T<O;){var _=T+O>>>1;w(S,p[_])<0?O=_:T=_+1}var E=y-T;switch(E){case 3:p[T+3]=p[T+2];case 2:p[T+2]=p[T+1];case 1:p[T+1]=p[T];break;default:for(;E>0;)p[T+E]=p[T+E-1],E--}p[T]=S}}function f(p,$,m,y,w,S){var T=0,O=0,_=1;if(S(p,$[m+w])>0){for(O=y-w;_<O&&S(p,$[m+w+_])>0;)T=_,_=(_<<1)+1,_<=0&&(_=O);_>O&&(_=O),T+=w,_+=w}else{for(O=w+1;_<O&&S(p,$[m+w-_])<=0;)T=_,_=(_<<1)+1,_<=0&&(_=O);_>O&&(_=O);var E=T;T=w-_,_=w-E}for(T++;T<_;){var I=T+(_-T>>>1);S(p,$[m+I])>0?T=I+1:_=I}return _}function v(p,$,m,y,w,S){var T=0,O=0,_=1;if(S(p,$[m+w])<0){for(O=w+1;_<O&&S(p,$[m+w-_])<0;)T=_,_=(_<<1)+1,_<=0&&(_=O);_>O&&(_=O);var E=T;T=w-_,_=w-E}else{for(O=y-w;_<O&&S(p,$[m+w+_])>=0;)T=_,_=(_<<1)+1,_<=0&&(_=O);_>O&&(_=O),T+=w,_+=w}for(T++;T<_;){var I=T+(_-T>>>1);S(p,$[m+I])<0?_=I:T=I+1}return _}var g=function(){function p($,m){e(this,p),this.array=null,this.compare=null,this.minGallop=n,this.length=0,this.tmpStorageLength=a,this.stackLength=0,this.runStart=null,this.runLength=null,this.stackSize=0,this.array=$,this.compare=m,this.length=$.length,this.length<2*a&&(this.tmpStorageLength=this.length>>>1),this.tmp=new Array(this.tmpStorageLength),this.stackLength=this.length<120?5:this.length<1542?10:this.length<119151?19:40,this.runStart=new Array(this.stackLength),this.runLength=new Array(this.stackLength)}return p.prototype.pushRun=function(m,y){this.runStart[this.stackSize]=m,this.runLength[this.stackSize]=y,this.stackSize+=1},p.prototype.mergeRuns=function(){for(;this.stackSize>1;){var m=this.stackSize-2;if(m>=1&&this.runLength[m-1]<=this.runLength[m]+this.runLength[m+1]||m>=2&&this.runLength[m-2]<=this.runLength[m]+this.runLength[m-1])this.runLength[m-1]<this.runLength[m+1]&&m--;else if(this.runLength[m]>this.runLength[m+1])break;this.mergeAt(m)}},p.prototype.forceMergeRuns=function(){for(;this.stackSize>1;){var m=this.stackSize-2;m>0&&this.runLength[m-1]<this.runLength[m+1]&&m--,this.mergeAt(m)}},p.prototype.mergeAt=function(m){var y=this.compare,w=this.array,S=this.runStart[m],T=this.runLength[m],O=this.runStart[m+1],_=this.runLength[m+1];this.runLength[m]=T+_,m===this.stackSize-3&&(this.runStart[m+1]=this.runStart[m+2],this.runLength[m+1]=this.runLength[m+2]),this.stackSize--;var E=v(w[O],w,S,T,0,y);S+=E,T-=E,T!==0&&(_=f(w[S+T-1],w,O,_,_-1,y),_!==0&&(T<=_?this.mergeLow(S,T,O,_):this.mergeHigh(S,T,O,_)))},p.prototype.mergeLow=function(m,y,w,S){var T=this.compare,O=this.array,_=this.tmp,E=0;for(E=0;E<y;E++)_[E]=O[m+E];var I=0,j=w,B=m;if(O[B++]=O[j++],--S===0){for(E=0;E<y;E++)O[B+E]=_[I+E];return}if(y===1){for(E=0;E<S;E++)O[B+E]=O[j+E];O[B+S]=_[I];return}for(var X=this.minGallop;;){var ne=0,re=0,le=!1;do if(T(O[j],_[I])<0){if(O[B++]=O[j++],re++,ne=0,--S===0){le=!0;break}}else if(O[B++]=_[I++],ne++,re=0,--y===1){le=!0;break}while((ne|re)<X);if(le)break;do{if(ne=v(O[j],_,I,y,0,T),ne!==0){for(E=0;E<ne;E++)O[B+E]=_[I+E];if(B+=ne,I+=ne,y-=ne,y<=1){le=!0;break}}if(O[B++]=O[j++],--S===0){le=!0;break}if(re=f(_[I],O,j,S,0,T),re!==0){for(E=0;E<re;E++)O[B+E]=O[j+E];if(B+=re,j+=re,S-=re,S===0){le=!0;break}}if(O[B++]=_[I++],--y===1){le=!0;break}X--}while(ne>=n||re>=n);if(le)break;X<0&&(X=0),X+=2}if(this.minGallop=X,X<1&&(this.minGallop=1),y===1){for(E=0;E<S;E++)O[B+E]=O[j+E];O[B+S]=_[I]}else{if(y===0)throw new Error("mergeLow preconditions were not respected");for(E=0;E<y;E++)O[B+E]=_[I+E]}},p.prototype.mergeHigh=function(m,y,w,S){var T=this.compare,O=this.array,_=this.tmp,E=0;for(E=0;E<S;E++)_[E]=O[w+E];var I=m+y-1,j=S-1,B=w+S-1,X=0,ne=0;if(O[B--]=O[I--],--y===0){for(X=B-(S-1),E=0;E<S;E++)O[X+E]=_[E];return}if(S===1){for(B-=y,I-=y,ne=B+1,X=I+1,E=y-1;E>=0;E--)O[ne+E]=O[X+E];O[B]=_[j];return}for(var re=this.minGallop;;){var le=0,we=0,Oe=!1;do if(T(_[j],O[I])<0){if(O[B--]=O[I--],le++,we=0,--y===0){Oe=!0;break}}else if(O[B--]=_[j--],we++,le=0,--S===1){Oe=!0;break}while((le|we)<re);if(Oe)break;do{if(le=y-v(_[j],O,m,y,y-1,T),le!==0){for(B-=le,I-=le,y-=le,ne=B+1,X=I+1,E=le-1;E>=0;E--)O[ne+E]=O[X+E];if(y===0){Oe=!0;break}}if(O[B--]=_[j--],--S===1){Oe=!0;break}if(we=S-f(O[I],_,0,S,S-1,T),we!==0){for(B-=we,j-=we,S-=we,ne=B+1,X=j+1,E=0;E<we;E++)O[ne+E]=_[X+E];if(S<=1){Oe=!0;break}}if(O[B--]=O[I--],--y===0){Oe=!0;break}re--}while(le>=n||we>=n);if(Oe)break;re<0&&(re=0),re+=2}if(this.minGallop=re,re<1&&(this.minGallop=1),S===1){for(B-=y,I-=y,ne=B+1,X=I+1,E=y-1;E>=0;E--)O[ne+E]=O[X+E];O[B]=_[j]}else{if(S===0)throw new Error("mergeHigh preconditions were not respected");for(X=B-(S-1),E=0;E<S;E++)O[X+E]=_[E]}},p}();function b(p,$,m,y){if(!Array.isArray(p))throw new TypeError("Can only sort arrays");$?typeof $!="function"&&(y=m,m=$,$=u):$=u,m||(m=0),y||(y=p.length);var w=y-m;if(!(w<2)){var S=0;if(w<r){S=c(p,m,y,$),d(p,m,y,m+S,$);return}var T=new g(p,$),O=l(w);do{if(S=c(p,m,y,$),S<O){var _=w;_>O&&(_=O),d(p,m,m+_,m+S,$),S=_}T.pushRun(m,S),T.mergeRuns(),w-=S,m+=S}while(w!==0);T.forceMergeRuns()}}})})(JP);(function(t){t.exports=JP})(y$e);var f_=V(ao);function ek(t){var i=m$e();return function(){var r=z(t),n;if(i){var a=z(this).constructor;n=P(r,arguments,a)}else n=r.apply(this,arguments);return pe(this,n)}}function m$e(){if(typeof Reflect>"u"||!P||P.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(P(Boolean,[],function(){})),!0}catch{return!1}}var tk=function(){function t(){N(this,t)}return F(t,[{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(e){return this.fake_use(e),this.abstract()}},{key:"setPosition",value:function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,r,n),this.abstract()}},{key:"getTreeSize",value:function(e){return this.fake_use(e),this.abstract()}},{key:"sort",value:function(e){this.fake_use(e),this.abstract()}},{key:"fix",value:function(e,r){this.fake_use(e,r),this.abstract()}},{key:"shift",value:function(e,r){this.fake_use(e,r),this.abstract()}}]),t}(),$$e=function(t){ce(e,t);var i=ek(e);function e(r){var n;return N(this,e),n=i.call(this),n.layout=r,n}return F(e,[{key:"curveType",value:function(){return"horizontal"}},{key:"getPosition",value:function(n){return n.x}},{key:"setPosition",value:function(n,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;o!==void 0&&this.layout.hierarchical.addToOrdering(n,o),n.x=a}},{key:"getTreeSize",value:function(n){var a=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,n);return{min:a.min_x,max:a.max_x}}},{key:"sort",value:function(n){ao.sort(n,function(a,o){return a.x-o.x})}},{key:"fix",value:function(n,a){n.y=this.layout.options.hierarchical.levelSeparation*a,n.options.fixed.y=!0}},{key:"shift",value:function(n,a){this.layout.body.nodes[n].x+=a}}]),e}(tk),b$e=function(t){ce(e,t);var i=ek(e);function e(r){var n;return N(this,e),n=i.call(this),n.layout=r,n}return F(e,[{key:"curveType",value:function(){return"vertical"}},{key:"getPosition",value:function(n){return n.y}},{key:"setPosition",value:function(n,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;o!==void 0&&this.layout.hierarchical.addToOrdering(n,o),n.y=a}},{key:"getTreeSize",value:function(n){var a=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,n);return{min:a.min_y,max:a.max_y}}},{key:"sort",value:function(n){ao.sort(n,function(a,o){return a.y-o.y})}},{key:"fix",value:function(n,a){n.x=this.layout.options.hierarchical.levelSeparation*a,n.options.fixed.x=!0}},{key:"shift",value:function(n,a){this.layout.body.nodes[n].y+=a}}]),e}(tk),Zp={},w$e={get exports(){return Zp},set exports(t){Zp=t}},_$e=q,E$e=fn.every,S$e=fa,O$e=S$e("every");_$e({target:"Array",proto:!0,forced:!O$e},{every:function(i){return E$e(this,i,arguments.length>1?arguments[1]:void 0)}});var T$e=rt,x$e=T$e("Array").every,P$e=Ne,k$e=x$e,nd=Array.prototype,I$e=function(t){var i=t.every;return t===nd||P$e(nd,t)&&i===nd.every?k$e:i},C$e=I$e,A$e=C$e;(function(t){t.exports=A$e})(w$e);var rk=V(Zp);function R$e(t,i){var e=typeof pn<"u"&&Br(t)||t["@@iterator"];if(!e){if(ve(t)||(e=D$e(t))||i&&t&&typeof t.length=="number"){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
98
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function D$e(t,i){var e;if(t){if(typeof t=="string")return v_(t,i);var r=st(e=Object.prototype.toString.call(t)).call(e,8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return ei(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v_(t,i)}}function v_(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,r=new Array(i);e<i;e++)r[e]=t[e];return r}function M$e(t,i){var e=new Sn;return ge(t).call(t,function(r){var n;ge(n=r.edges).call(n,function(a){a.connected&&e.add(a)})}),ge(e).call(e,function(r){var n=r.from.id,a=r.to.id;i[n]==null&&(i[n]=0),(i[a]==null||i[n]>=i[a])&&(i[a]=i[n]+1)}),i}function N$e(t){return nk(function(i){var e,r;return rk(e=St(r=i.edges).call(r,function(n){return t.has(n.toId)})).call(e,function(n){return n.to===i})},function(i,e){return e>i},"from",t)}function F$e(t){return nk(function(i){var e,r;return rk(e=St(r=i.edges).call(r,function(n){return t.has(n.toId)})).call(e,function(n){return n.from===i})},function(i,e){return e<i},"to",t)}function nk(t,i,e,r){var n,a=Rn(null),o=ZP(n=lr(CP(r).call(r))).call(n,function(f,v){return f+1+v.edges.length},0),s=e+"Id",u=e==="to"?1:-1,l=R$e(r),c;try{var h=function(){var v=xe(c.value,2),g=v[0],b=v[1];if(!r.has(g)||!t(b))return"continue";a[g]=0;for(var p=[b],$=0,m,y=function(){var T,O;if(!r.has(g))return"continue";var _=a[m.id]+u;if(ge(T=St(O=m.edges).call(O,function(E){return E.connected&&E.to!==E.from&&E[e]!==m&&r.has(E.toId)&&r.has(E.fromId)})).call(T,function(E){var I=E[s],j=a[I];(j==null||i(_,j))&&(a[I]=_,p.push(E[e]))}),$>o)return{v:{v:M$e(r,a)}};++$};m=p.pop();){var w=y();if(w!=="continue"&&he(w)==="object")return w.v}};for(l.s();!(c=l.n()).done;){var d=h();if(d!=="continue"&&he(d)==="object")return d.v}}catch(f){l.e(f)}finally{l.f()}return a}var B$e=function(){function t(){N(this,t),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return F(t,[{key:"addRelation",value:function(e,r){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(r),this.parentReference[r]===void 0&&(this.parentReference[r]=[]),this.parentReference[r].push(e)}},{key:"checkIfTree",value:function(){for(var e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}},{key:"numTrees",value:function(){return this.treeIndex+1}},{key:"setTreeIndex",value:function(e,r){r!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=r,this.treeIndex=Math.max(r,this.treeIndex))}},{key:"ensureLevel",value:function(e){this.levels[e]===void 0&&(this.levels[e]=0)}},{key:"getMaxLevel",value:function(e){var r=this,n={},a=function o(s){if(n[s]!==void 0)return n[s];var u=r.levels[s];if(r.childrenReference[s]){var l=r.childrenReference[s];if(l.length>0)for(var c=0;c<l.length;c++)u=Math.max(u,o(l[c]))}return n[s]=u,u};return a(e)}},{key:"levelDownstream",value:function(e,r){this.levels[r.id]===void 0&&(this.levels[e.id]===void 0&&(this.levels[e.id]=0),this.levels[r.id]=this.levels[e.id]+1)}},{key:"setMinLevelToZero",value:function(e){var r=1e9;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.levels[n]!==void 0&&(r=Math.min(this.levels[n],r));for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&this.levels[a]!==void 0&&(this.levels[a]-=r)}},{key:"getTreeSize",value:function(e,r){var n=1e9,a=-1e9,o=1e9,s=-1e9;for(var u in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,u)&&this.trees[u]===r){var l=e[u];n=Math.min(l.x,n),a=Math.max(l.x,a),o=Math.min(l.y,o),s=Math.max(l.y,s)}return{min_x:n,max_x:a,min_y:o,max_y:s}}},{key:"hasSameParent",value:function(e,r){var n=this.parentReference[e.id],a=this.parentReference[r.id];if(n===void 0||a===void 0)return!1;for(var o=0;o<n.length;o++)for(var s=0;s<a.length;s++)if(n[o]==a[s])return!0;return!1}},{key:"inSameSubNetwork",value:function(e,r){return this.trees[e.id]===this.trees[r.id]}},{key:"getLevels",value:function(){return Te(this.distributionOrdering)}},{key:"addToOrdering",value:function(e,r){this.distributionOrdering[r]===void 0&&(this.distributionOrdering[r]=[]);var n=!1,a=this.distributionOrdering[r];for(var o in a)if(a[o]===e){n=!0;break}n||(this.distributionOrdering[r].push(e),this.distributionIndex[e.id]=this.distributionOrdering[r].length-1)}}]),t}(),L$e=function(){function t(i){N(this,t),this.body=i,this._resetRNG(Math.random()+":"+Mu()),this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,clusterThreshold:150,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:"UD",sortMethod:"hubsize"}},je(this.options,this.defaultOptions),this.bindEventListeners()}return F(t,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("_dataChanged",function(){e.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",function(){e.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",function(){e.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",function(){if(e.options.hierarchical.enabled===!0){var r=e.direction.curveType();e.body.emitter.emit("_forceDisableDynamicCurves",r,!1)}})}},{key:"setOptions",value:function(e,r){if(e!==void 0){var n=this.options.hierarchical,a=n.enabled;if(pa(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),Lt(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),n.enabled===!0)return a===!0&&this.body.emitter.emit("refresh",!0),n.direction==="RL"||n.direction==="DU"?n.levelSeparation>0&&(n.levelSeparation*=-1):n.levelSeparation<0&&(n.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(r);if(a===!0)return this.body.emitter.emit("refresh"),$e(r,this.optionsBackup)}return r}},{key:"_resetRNG",value:function(e){this.initialRandomSeed=e,this._rng=Ll(this.initialRandomSeed)}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(e){if(this.options.hierarchical.enabled===!0){var r=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:r.enabled===void 0?!0:r.enabled,solver:"hierarchicalRepulsion"},r.enabled=r.enabled===void 0?!0:r.enabled,r.solver=r.solver||"barnesHut"):he(e.physics)==="object"?(r.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,r.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(r.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});var n=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if(typeof e.edges.smooth=="boolean")this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:n};else{var a=e.edges.smooth;a.type!==void 0&&a.type!=="dynamic"&&(n=a.type),this.optionsBackup.edges={smooth:{enabled:a.enabled===void 0?!0:a.enabled,type:a.type===void 0?"dynamic":a.type,roundness:a.roundness===void 0?.5:a.roundness,forceDirection:a.forceDirection===void 0?!1:a.forceDirection}},e.edges.smooth={enabled:a.enabled===void 0?!0:a.enabled,type:n,roundness:a.roundness===void 0?.5:a.roundness,forceDirection:a.forceDirection===void 0?!1:a.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",n)}return e}},{key:"positionInitially",value:function(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);for(var r=e.length+50,n=0;n<e.length;n++){var a=e[n],o=2*Math.PI*this._rng();a.x===void 0&&(a.x=r*Math.cos(o)),a.y===void 0&&(a.y=r*Math.sin(o))}}}},{key:"layoutNetwork",value:function(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){for(var e=this.body.nodeIndices,r=0,n=0;n<e.length;n++){var a=this.body.nodes[e[n]];a.predefinedPosition===!0&&(r+=1)}if(r<.5*e.length){var o=10,s=0,u=this.options.clusterThreshold,l={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>u){for(var c=e.length;e.length>u&&s<=o;){s+=1;var h=e.length;s%3===0?this.body.modules.clustering.clusterBridges(l):this.body.modules.clustering.clusterOutliers(l);var d=e.length;if(h==d&&s%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*c)})}s>o&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();for(var f=70,v=0;v<e.length;v++){var g=this.body.nodes[e[v]];g.predefinedPosition===!1&&(g.x+=(.5-this._rng())*f,g.y+=(.5-this._rng())*f)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}},{key:"_shiftToCenter",value:function(){for(var e=dt.getRangeCore(this.body.nodes,this.body.nodeIndices),r=dt.findCenter(e),n=0;n<this.body.nodeIndices.length;n++){var a=this.body.nodes[this.body.nodeIndices[n]];a.x-=r.x,a.y-=r.y}}},{key:"_declusterAll",value:function(){for(var e=!0;e===!0;){e=!1;for(var r=0;r<this.body.nodeIndices.length;r++)this.body.nodes[this.body.nodeIndices[r]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[r],{},!1));e===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"getSeed",value:function(){return this.initialRandomSeed}},{key:"setupHierarchicalLayout",value:function(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){var e,r,n=!1,a=!1;this.lastNodeOnLevel={},this.hierarchical=new B$e;for(r in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,r)&&(e=this.body.nodes[r],e.options.level!==void 0?(n=!0,this.hierarchical.levels[r]=e.options.level):a=!0);if(a===!0&&n===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");if(a===!0){var o=this.options.hierarchical.sortMethod;o==="hubsize"?this._determineLevelsByHubsize():o==="directed"?this._determineLevelsDirected():o==="custom"&&this._determineLevelsCustomCallback()}for(var s in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,s)&&this.hierarchical.ensureLevel(s);var u=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(u),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var e=this,r=!1,n={},a=function(){for(var m=s(),y=0,w=0;w<m.length-1;w++){var S=m[w].max-m[w+1].min;y+=S+e.options.hierarchical.treeSpacing,o(w+1,y)}},o=function(m,y){var w=e.hierarchical.trees;for(var S in w)Object.prototype.hasOwnProperty.call(w,S)&&w[S]===m&&e.direction.shift(S,y)},s=function(){for(var m=[],y=0;y<e.hierarchical.numTrees();y++)m.push(e.direction.getTreeSize(y));return m},u=function $(m,y){if(!y[m.id]&&(y[m.id]=!0,e.hierarchical.childrenReference[m.id])){var w=e.hierarchical.childrenReference[m.id];if(w.length>0)for(var S=0;S<w.length;S++)$(e.body.nodes[w[S]],y)}},l=function(m){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,w=1e9,S=1e9,T=1e9,O=-1e9;for(var _ in m)if(Object.prototype.hasOwnProperty.call(m,_)){var E=e.body.nodes[_],I=e.hierarchical.levels[E.id],j=e.direction.getPosition(E),B=e._getSpaceAroundNode(E,m),X=xe(B,2),ne=X[0],re=X[1];w=Math.min(ne,w),S=Math.min(re,S),I<=y&&(T=Math.min(j,T),O=Math.max(j,O))}return[T,O,w,S]},c=function(m,y){var w=e.hierarchical.getMaxLevel(m.id),S=e.hierarchical.getMaxLevel(y.id);return Math.min(w,S)},h=function(m,y,w){for(var S=e.hierarchical,T=0;T<y.length;T++){var O=y[T],_=S.distributionOrdering[O];if(_.length>1)for(var E=0;E<_.length-1;E++){var I=_[E],j=_[E+1];S.hasSameParent(I,j)&&S.inSameSubNetwork(I,j)&&m(I,j,w)}}},d=function(m,y){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,S=e.direction.getPosition(m),T=e.direction.getPosition(y),O=Math.abs(T-S),_=e.options.hierarchical.nodeSpacing;if(O>_){var E={},I={};u(m,E),u(y,I);var j=c(m,y),B=l(E,j),X=l(I,j),ne=B[1],re=X[0],le=X[2],we=Math.abs(ne-re);if(we>_){var Oe=ne-re+_;Oe<-le+_&&(Oe=-le+_),Oe<0&&(e._shiftBlock(y.id,Oe),r=!0,w===!0&&e._centerParent(y))}}},f=function(m,y){for(var w=y.id,S=y.edges,T=e.hierarchical.levels[y.id],O=e.options.hierarchical.levelSeparation*e.options.hierarchical.levelSeparation,_={},E=[],I=0;I<S.length;I++){var j=S[I];if(j.toId!=j.fromId){var B=j.toId==w?j.from:j.to;_[S[I].id]=B,e.hierarchical.levels[B.id]<T&&E.push(j)}}var X=function(nt,_e){for(var Ae=0,R=0;R<_e.length;R++)if(_[_e[R].id]!==void 0){var k=e.direction.getPosition(_[_e[R].id])-nt;Ae+=k/Math.sqrt(k*k+O)}return Ae},ne=function(nt,_e){for(var Ae=0,R=0;R<_e.length;R++)if(_[_e[R].id]!==void 0){var k=e.direction.getPosition(_[_e[R].id])-nt;Ae-=O*Math.pow(k*k+O,-1.5)}return Ae},re=function(nt,_e){for(var Ae=e.direction.getPosition(y),R={},k=0;k<nt;k++){var D=X(Ae,_e),L=ne(Ae,_e),G=40,Y=Math.max(-G,Math.min(G,Math.round(D/L)));if(Ae=Ae-Y,R[Ae]!==void 0)break;R[Ae]=k}return Ae},le=function(nt){var _e=e.direction.getPosition(y);if(n[y.id]===void 0){var Ae={};u(y,Ae),n[y.id]=Ae}var R=l(n[y.id]),k=R[2],D=R[3],L=nt-_e,G=0;L>0?G=Math.min(L,D-e.options.hierarchical.nodeSpacing):L<0&&(G=-Math.min(-L,k-e.options.hierarchical.nodeSpacing)),G!=0&&(e._shiftBlock(y.id,G),r=!0)},we=function(nt){var _e=e.direction.getPosition(y),Ae=e._getSpaceAroundNode(y),R=xe(Ae,2),k=R[0],D=R[1],L=nt-_e,G=_e;L>0?G=Math.min(_e+(D-e.options.hierarchical.nodeSpacing),nt):L<0&&(G=Math.max(_e-(k-e.options.hierarchical.nodeSpacing),nt)),G!==_e&&(e.direction.setPosition(y,G),r=!0)},Oe=re(m,E);le(Oe),Oe=re(m,S),we(Oe)},v=function(m){var y=e.hierarchical.getLevels();y=An(y).call(y);for(var w=0;w<m;w++){r=!1;for(var S=0;S<y.length;S++)for(var T=y[S],O=e.hierarchical.distributionOrdering[T],_=0;_<O.length;_++)f(1e3,O[_]);if(r!==!0)break}},g=function(m){var y=e.hierarchical.getLevels();y=An(y).call(y);for(var w=0;w<m&&(r=!1,h(d,y,!0),r===!0);w++);},b=function(){for(var m in e.body.nodes)Object.prototype.hasOwnProperty.call(e.body.nodes,m)&&e._centerParent(e.body.nodes[m])},p=function(){var m=e.hierarchical.getLevels();m=An(m).call(m);for(var y=0;y<m.length;y++)for(var w=m[y],S=e.hierarchical.distributionOrdering[w],T=0;T<S.length;T++)e._centerParent(S[T])};this.options.hierarchical.blockShifting===!0&&(g(5),b()),this.options.hierarchical.edgeMinimization===!0&&v(20),this.options.hierarchical.parentCentralization===!0&&p(),a()}},{key:"_getSpaceAroundNode",value:function(e,r){var n=!0;r===void 0&&(n=!1);var a=this.hierarchical.levels[e.id];if(a!==void 0){var o=this.hierarchical.distributionIndex[e.id],s=this.direction.getPosition(e),u=this.hierarchical.distributionOrdering[a],l=1e9,c=1e9;if(o!==0){var h=u[o-1];if(n===!0&&r[h.id]===void 0||n===!1){var d=this.direction.getPosition(h);l=s-d}}if(o!=u.length-1){var f=u[o+1];if(n===!0&&r[f.id]===void 0||n===!1){var v=this.direction.getPosition(f);c=Math.min(c,v-s)}}return[l,c]}else return[0,0]}},{key:"_centerParent",value:function(e){if(this.hierarchical.parentReference[e.id])for(var r=this.hierarchical.parentReference[e.id],n=0;n<r.length;n++){var a=r[n],o=this.body.nodes[a],s=this.hierarchical.childrenReference[a];if(s!==void 0){var u=this._getCenterPosition(s),l=this.direction.getPosition(o),c=this._getSpaceAroundNode(o),h=xe(c,2),d=h[0],f=h[1],v=l-u;(v<0&&Math.abs(v)<f-this.options.hierarchical.nodeSpacing||v>0&&Math.abs(v)<d-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(o,u)}}}},{key:"_placeNodesByHierarchy",value:function(e){this.positionedNodes={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n,a=Te(e[r]);a=this._indexArrayToNodes(a),td(n=this.direction).call(n,a);for(var o=0,s=0;s<a.length;s++){var u=a[s];if(this.positionedNodes[u.id]===void 0){var l=this.options.hierarchical.nodeSpacing,c=l*o;o>0&&(c=this.direction.getPosition(a[s-1])+l),this.direction.setPosition(u,c,r),this._validatePositionAndContinue(u,r,c),o++}}}}},{key:"_placeBranchNodes",value:function(e,r){var n,a=this.hierarchical.childrenReference[e];if(a!==void 0){for(var o=[],s=0;s<a.length;s++)o.push(this.body.nodes[a[s]]);td(n=this.direction).call(n,o);for(var u=0;u<o.length;u++){var l=o[u],c=this.hierarchical.levels[l.id];if(c>r&&this.positionedNodes[l.id]===void 0){var h=this.options.hierarchical.nodeSpacing,d=void 0;u===0?d=this.direction.getPosition(this.body.nodes[e]):d=this.direction.getPosition(o[u-1])+h,this.direction.setPosition(l,d,c),this._validatePositionAndContinue(l,c,d)}else return}var f=this._getCenterPosition(o);this.direction.setPosition(this.body.nodes[e],f,r)}}},{key:"_validatePositionAndContinue",value:function(e,r,n){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[r]!==void 0){var a=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[r]]);if(n-a<this.options.hierarchical.nodeSpacing){var o=a+this.options.hierarchical.nodeSpacing-n,s=this._findCommonParent(this.lastNodeOnLevel[r],e.id);this._shiftBlock(s.withChild,o)}}this.lastNodeOnLevel[r]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,r)}}},{key:"_indexArrayToNodes",value:function(e){for(var r=[],n=0;n<e.length;n++)r.push(this.body.nodes[e[n]]);return r}},{key:"_getDistribution",value:function(){var e={},r,n;for(r in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,r)){n=this.body.nodes[r];var a=this.hierarchical.levels[r]===void 0?0:this.hierarchical.levels[r];this.direction.fix(n,a),e[a]===void 0&&(e[a]={}),e[a][r]=n}return e}},{key:"_getActiveEdges",value:function(e){var r=this,n=[];return ee(e.edges,function(a){var o;ae(o=r.body.edgeIndices).call(o,a.id)!==-1&&n.push(a)}),n}},{key:"_getHubSizes",value:function(){var e=this,r={},n=this.body.nodeIndices;ee(n,function(o){var s=e.body.nodes[o],u=e._getActiveEdges(s).length;r[u]=!0});var a=[];return ee(r,function(o){a.push(Number(o))}),td(f_).call(f_,a,function(o,s){return s-o}),a}},{key:"_determineLevelsByHubsize",value:function(){for(var e=this,r=function(l,c){e.hierarchical.levelDownstream(l,c)},n=this._getHubSizes(),a=function(){var l=n[o];if(l===0)return"break";ee(e.body.nodeIndices,function(c){var h=e.body.nodes[c];l===e._getActiveEdges(h).length&&e._crawlNetwork(r,c)})},o=0;o<n.length;++o){var s=a();if(s==="break")break}}},{key:"_determineLevelsCustomCallback",value:function(){var e=this,r=1e5,n=function(s,u,l){},a=function(s,u,l){var c=e.hierarchical.levels[s.id];c===void 0&&(c=e.hierarchical.levels[s.id]=r);var h=n(dt.cloneOptions(s,"node"),dt.cloneOptions(u,"node"),dt.cloneOptions(l,"edge"));e.hierarchical.levels[u.id]=c+h};this._crawlNetwork(a),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_determineLevelsDirected",value:function(){var e,r=this,n=ZP(e=this.body.nodeIndices).call(e,function(a,o){return a.set(o,r.body.nodes[o]),a},new xP);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=F$e(n):this.hierarchical.levels=N$e(n),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_generateMap",value:function(){var e=this,r=function(a,o){e.hierarchical.levels[o.id]>e.hierarchical.levels[a.id]&&e.hierarchical.addRelation(a.id,o.id)};this._crawlNetwork(r),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},n=arguments.length>1?arguments[1]:void 0,a={},o=function d(f,v){if(a[f.id]===void 0){e.hierarchical.setTreeIndex(f,v),a[f.id]=!0;for(var g,b=e._getActiveEdges(f),p=0;p<b.length;p++){var $=b[p];$.connected===!0&&($.toId==f.id?g=$.from:g=$.to,f.id!=g.id&&(r(f,g,$),d(g,v)))}}};if(n===void 0)for(var s=0,u=0;u<this.body.nodeIndices.length;u++){var l=this.body.nodeIndices[u];if(a[l]===void 0){var c=this.body.nodes[l];o(c,s),s+=1}}else{var h=this.body.nodes[n];if(h===void 0){console.error("Node not found:",n);return}o(h)}}},{key:"_shiftBlock",value:function(e,r){var n=this,a={},o=function s(u){if(!a[u]){a[u]=!0,n.direction.shift(u,r);var l=n.hierarchical.childrenReference[u];if(l!==void 0)for(var c=0;c<l.length;c++)s(l[c])}};o(e)}},{key:"_findCommonParent",value:function(e,r){var n=this,a={},o=function u(l,c){var h=n.hierarchical.parentReference[c];if(h!==void 0)for(var d=0;d<h.length;d++){var f=h[d];l[f]=!0,u(l,f)}},s=function u(l,c){var h=n.hierarchical.parentReference[c];if(h!==void 0)for(var d=0;d<h.length;d++){var f=h[d];if(l[f]!==void 0)return{foundParent:f,withChild:c};var v=u(l,f);if(v.foundParent!==null)return v}return{foundParent:null,withChild:c}};return o(a,e),s(a,r)}},{key:"setDirectionStrategy",value:function(){var e=this.options.hierarchical.direction==="UD"||this.options.hierarchical.direction==="DU";e?this.direction=new $$e(this):this.direction=new b$e(this)}},{key:"_getCenterPosition",value:function(e){for(var r=1e9,n=-1e9,a=0;a<e.length;a++){var o=void 0;if(e[a].id!==void 0)o=e[a];else{var s=e[a];o=this.body.nodes[s]}var u=this.direction.getPosition(o);r=Math.min(r,u),n=Math.max(n,u)}return .5*(r+n)}}]),t}();function j$e(t,i){var e=typeof pn<"u"&&Br(t)||t["@@iterator"];if(!e){if(ve(t)||(e=z$e(t))||i&&t&&typeof t.length=="number"){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
99
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function z$e(t,i){var e;if(t){if(typeof t=="string")return p_(t,i);var r=st(e=Object.prototype.toString.call(t)).call(e,8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return ei(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p_(t,i)}}function p_(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,r=new Array(i);e<i;e++)r[e]=t[e];return r}var H$e=function(){function t(i,e,r,n){var a=this,o,s;N(this,t),this.body=i,this.canvas=e,this.selectionHandler=r,this.interactionHandler=n,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},je(this.options,this.defaultOptions),this.body.emitter.on("destroy",function(){a._clean()}),this.body.emitter.on("_dataChanged",A(o=this._restore).call(o,this)),this.body.emitter.on("_resetData",A(s=this._restore).call(s,this))}return F(t,[{key:"_restore",value:function(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}},{key:"setOptions",value:function(e,r,n){r!==void 0&&(r.locale!==void 0?this.options.locale=r.locale:this.options.locale=n.locale,r.locales!==void 0?this.options.locales=r.locales:this.options.locales=n.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,$e(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}},{key:"toggleEditMode",value:function(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}},{key:"enableEditMode",value:function(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}},{key:"disableEditMode",value:function(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}},{key:"showManipulatorToolbar",value:function(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,r;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";var n=this.selectionHandler.getSelectedNodeCount(),a=this.selectionHandler.getSelectedEdgeCount(),o=n+a,s=this.options.locales[this.options.locale],u=!1;this.options.addNode!==!1&&(this._createAddNodeButton(s),u=!0),this.options.addEdge!==!1&&(u===!0?this._createSeperator(1):u=!0,this._createAddEdgeButton(s)),n===1&&typeof this.options.editNode=="function"?(u===!0?this._createSeperator(2):u=!0,this._createEditNodeButton(s)):a===1&&n===0&&this.options.editEdge!==!1&&(u===!0?this._createSeperator(3):u=!0,this._createEditEdgeButton(s)),o!==0&&(n>0&&this.options.deleteNode!==!1?(u===!0&&this._createSeperator(4),this._createDeleteButton(s)):n===0&&this.options.deleteEdge!==!1&&(u===!0&&this._createSeperator(4),this._createDeleteButton(s))),this._bindElementEvents(this.closeDiv,A(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",A(r=this.showManipulatorToolbar).call(r,this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var r,n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,A(r=this.toggleEditMode).call(r,this))}this._temporaryBindEvent("click",A(e=this._performAddNode).call(e,this))}},{key:"editNode",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean();var r=this.selectionHandler.getSelectedNodes()[0];if(r!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(r.isCluster!==!0){var n=$e({},r.options,!1);if(n.x=r.x,n.y=r.y,this.options.editNode.length===2)this.options.editNode(n,function(a){a!=null&&e.inMode==="editNode"&&e.body.data.nodes.getDataSet().update(a),e.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){var e,r,n,a,o;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var s,u=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(u),this._createSeperator(),this._createDescription(u.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,A(s=this.toggleEditMode).call(s,this))}this._temporaryBindUI("onTouch",A(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",A(r=this._finishConnect).call(r,this)),this._temporaryBindUI("onDrag",A(n=this._dragControlNode).call(n,this)),this._temporaryBindUI("onRelease",A(a=this._finishConnect).call(a,this)),this._temporaryBindUI("onDragStart",A(o=this._dragStartEdge).call(o,this)),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",he(this.options.editEdge)==="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){var e=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(e.from.id,e.to.id);return}if(this.guiEnabled===!0){var r,n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,A(r=this.toggleEditMode).call(r,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var a,o,s,u,l=this.body.edges[this.edgeBeingEditedId],c=this._getNewTargetNode(l.from.x,l.from.y),h=this._getNewTargetNode(l.to.x,l.to.y);this.temporaryIds.nodes.push(c.id),this.temporaryIds.nodes.push(h.id),this.body.nodes[c.id]=c,this.body.nodeIndices.push(c.id),this.body.nodes[h.id]=h,this.body.nodeIndices.push(h.id),this._temporaryBindUI("onTouch",A(a=this._controlNodeTouch).call(a,this)),this._temporaryBindUI("onTap",function(){}),this._temporaryBindUI("onHold",function(){}),this._temporaryBindUI("onDragStart",A(o=this._controlNodeDragStart).call(o,this)),this._temporaryBindUI("onDrag",A(s=this._controlNodeDrag).call(s,this)),this._temporaryBindUI("onDragEnd",A(u=this._controlNodeDragEnd).call(u,this)),this._temporaryBindUI("onMouseMove",function(){}),this._temporaryBindEvent("beforeDrawing",function(d){var f=l.edgeType.findBorderPositions(d);c.selected===!1&&(c.x=f.from.x,c.y=f.from.y),h.selected===!1&&(h.x=f.to.x,h.y=f.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";var r=this.selectionHandler.getSelectedNodeIds(),n=this.selectionHandler.getSelectedEdgeIds(),a=void 0;if(r.length>0){for(var o=0;o<r.length;o++)if(this.body.nodes[r[o]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(a=this.options.deleteNode)}else n.length>0&&typeof this.options.deleteEdge=="function"&&(a=this.options.deleteEdge);if(typeof a=="function"){var s={nodes:r,edges:n};if(a.length===2)a(s,function(u){u!=null&&e.inMode==="delete"?(e.body.data.edges.getDataSet().remove(u.edges),e.body.data.nodes.getDataSet().remove(u.nodes),e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar()):(e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(n),this.body.data.nodes.getDataSet().remove(r),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var e,r;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(r=this.options.locales[this.options.locale])===null||r===void 0?void 0:r.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}},{key:"_getNewTargetNode",value:function(e,r){var n=$e({},this.options.controlNodeStyle);n.id="targetNode"+Ba(),n.hidden=!1,n.physics=!1,n.x=e,n.y=r;var a=this.body.functions.createNode(n);return a.shape.boundingBox={left:e,right:e,top:r,bottom:r},a}},{key:"_createEditButton",value:function(){var e;this._clean(),this.manipulationDOM={},Ur(this.editModeDiv);var r=this.options.locales[this.options.locale],n=this._createButton("editMode","vis-edit vis-edit-mode",r.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(n),this._bindElementEvents(n,A(e=this.toggleEditMode).call(e,this))}},{key:"_clean",value:function(){this.inMode=!1,this.guiEnabled===!0&&(Ur(this.editModeDiv),Ur(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanupDOMEventListeners",value:function(){var e,r=j$e(Or(e=this._domEventListenerCleanupQueue).call(e,0)),n;try{for(r.s();!(n=r.n()).done;){var a=n.value;a()}}catch(o){r.e(o)}finally{r.f()}}},{key:"_removeManipulationDOM",value:function(){this._clean(),Ur(this.manipulationDiv),Ur(this.editModeDiv),Ur(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 e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}},{key:"_createAddNodeButton",value:function(e){var r,n=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,A(r=this.addNodeMode).call(r,this))}},{key:"_createAddEdgeButton",value:function(e){var r,n=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,A(r=this.addEdgeMode).call(r,this))}},{key:"_createEditNodeButton",value:function(e){var r,n=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,A(r=this.editNode).call(r,this))}},{key:"_createEditEdgeButton",value:function(e){var r,n=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,A(r=this.editEdgeMode).call(r,this))}},{key:"_createDeleteButton",value:function(e){var r,n;this.options.rtl?n="vis-delete-rtl":n="vis-delete";var a=this._createButton("delete",n,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(a),this._bindElementEvents(a,A(r=this.deleteSelected).call(r,this))}},{key:"_createBackButton",value:function(e){var r,n=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,A(r=this.showManipulatorToolbar).call(r,this))}},{key:"_createButton",value:function(e,r,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("button"),this.manipulationDOM[e+"Div"].className="vis-button "+r,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=a,this.manipulationDOM[e+"Label"].innerText=n,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}},{key:"_createDescription",value:function(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}},{key:"_temporaryBindEvent",value:function(e,r){this.temporaryEventFunctions.push({event:e,boundFunction:r}),this.body.emitter.on(e,r)}},{key:"_temporaryBindUI",value:function(e,r){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=r;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+es(Te(this.body.eventListeners)))}},{key:"_unbindTemporaryUIs",value:function(){for(var e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var e=0;e<this.temporaryEventFunctions.length;e++){var r=this.temporaryEventFunctions[e].event,n=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(r,n)}this.temporaryEventFunctions=[]}},{key:"_bindElementEvents",value:function(e,r){var n=new Ii(e,{});Wu(n,r),this._domEventListenerCleanupQueue.push(function(){n.destroy()});var a=function(s){var u=s.keyCode,l=s.key;(l==="Enter"||l===" "||u===13||u===32)&&r()};e.addEventListener("keyup",a,!1),this._domEventListenerCleanupQueue.push(function(){e.removeEventListener("keyup",a,!1)})}},{key:"_cleanupTemporaryNodesAndEdges",value:function(){for(var e=0;e<this.temporaryIds.edges.length;e++){var r;this.body.edges[this.temporaryIds.edges[e]].disconnect(),delete this.body.edges[this.temporaryIds.edges[e]];var n=ae(r=this.body.edgeIndices).call(r,this.temporaryIds.edges[e]);if(n!==-1){var a;Or(a=this.body.edgeIndices).call(a,n,1)}}for(var o=0;o<this.temporaryIds.nodes.length;o++){var s;delete this.body.nodes[this.temporaryIds.nodes[o]];var u=ae(s=this.body.nodeIndices).call(s,this.temporaryIds.nodes[o]);if(u!==-1){var l;Or(l=this.body.nodeIndices).call(l,u,1)}}this.temporaryIds={nodes:[],edges:[]}}},{key:"_controlNodeTouch",value:function(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=je({},this.body.view.translation)}},{key:"_controlNodeDragStart",value:function(){var e=this.lastTouch,r=this.selectionHandler._pointerToPositionObject(e),n=this.body.nodes[this.temporaryIds.nodes[0]],a=this.body.nodes[this.temporaryIds.nodes[1]],o=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;var s=n.isOverlappingWith(r),u=a.isOverlappingWith(r);s===!0?(this.selectedControlNode=n,o.edgeType.from=n):u===!0&&(this.selectedControlNode=a,o.edgeType.to=a),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}},{key:"_controlNodeDrag",value:function(e){this.body.emitter.emit("disablePhysics");var r=this.body.functions.getPointer(e.center),n=this.canvas.DOMtoCanvas(r);this.selectedControlNode!==void 0?(this.selectedControlNode.x=n.x,this.selectedControlNode.y=n.y):this.interactionHandler.onDrag(e),this.body.emitter.emit("_redraw")}},{key:"_controlNodeDragEnd",value:function(e){var r=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(r),a=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode!==void 0){this.selectionHandler.unselectAll();for(var o=this.selectionHandler._getAllNodesOverlappingWith(n),s=void 0,u=o.length-1;u>=0;u--)if(o[u]!==this.selectedControlNode.id){s=this.body.nodes[o[u]];break}if(s!==void 0&&this.selectedControlNode!==void 0)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var l=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===l.id?this._performEditEdge(s.id,a.to.id):this._performEditEdge(a.from.id,s.id)}else a.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=je({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;var r=this.lastTouch,n=this.selectionHandler.getNodeAt(r);if(n!==void 0)if(n.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var a=this._getNewTargetNode(n.x,n.y);this.body.nodes[a.id]=a,this.body.nodeIndices.push(a.id);var o=this.body.functions.createEdge({id:"connectionEdge"+Ba(),from:n.id,to:a.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[o.id]=o,this.body.edgeIndices.push(o.id),this.temporaryIds.nodes.push(a.id),this.temporaryIds.edges.push(o.id)}this.touchTime=new Date().valueOf()}}},{key:"_dragControlNode",value:function(e){var r=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(r),a=void 0;this.temporaryIds.edges[0]!==void 0&&(a=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(n),s=void 0,u=o.length-1;u>=0;u--){var l;if(ae(l=this.temporaryIds.nodes).call(l,o[u])===-1){s=this.body.nodes[o[u]];break}}if(e.controlEdge={from:a,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,r),this.temporaryIds.nodes[0]!==void 0){var c=this.body.nodes[this.temporaryIds.nodes[0]];c.x=this.canvas._XconvertDOMtoCanvas(r.x),c.y=this.canvas._YconvertDOMtoCanvas(r.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}},{key:"_finishConnect",value:function(e){var r=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(r),a=void 0;this.temporaryIds.edges[0]!==void 0&&(a=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(n),s=void 0,u=o.length-1;u>=0;u--){var l;if(ae(l=this.temporaryIds.nodes).call(l,o[u])===-1){s=this.body.nodes[o[u]];break}}this._cleanupTemporaryNodesAndEdges(),s!==void 0&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[a]!==void 0&&this.body.nodes[s.id]!==void 0&&this._performAddEdge(a,s.id)),e.controlEdge={from:a,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,r),this.body.emitter.emit("_redraw")}},{key:"_dragStartEdge",value:function(e){var r=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,r,void 0,!0)}},{key:"_performAddNode",value:function(e){var r=this,n={id:Ba(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(n,function(a){a!=null&&r.inMode==="addNode"&&r.body.data.nodes.getDataSet().add(a),r.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(n),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(e,r){var n=this,a={from:e,to:r};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(a,function(o){o!=null&&n.inMode==="addEdge"&&(n.body.data.edges.getDataSet().add(o),n.selectionHandler.unselectAll(),n.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(a),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(e,r){var n=this,a={id:this.edgeBeingEditedId,from:e,to:r,label:this.body.data.edges.get(this.edgeBeingEditedId).label},o=this.options.editEdge;if(he(o)==="object"&&(o=o.editWithoutDrag),typeof o=="function")if(o.length===2)o(a,function(s){s==null||n.inMode!=="editEdge"?(n.body.edges[a.id].updateEdgeType(),n.body.emitter.emit("_redraw"),n.showManipulatorToolbar()):(n.body.data.edges.getDataSet().update(s),n.selectionHandler.unselectAll(),n.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(a),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),t}(),M="string",C="boolean",x="number",Pa="array",W="object",ik="dom",W$e="any",id=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],ad={borderWidth:{number:x},borderWidthSelected:{number:x,undefined:"undefined"},brokenImage:{string:M,undefined:"undefined"},chosen:{label:{boolean:C,function:"function"},node:{boolean:C,function:"function"},__type__:{object:W,boolean:C}},color:{border:{string:M},background:{string:M},highlight:{border:{string:M},background:{string:M},__type__:{object:W,string:M}},hover:{border:{string:M},background:{string:M},__type__:{object:W,string:M}},__type__:{object:W,string:M}},opacity:{number:x,undefined:"undefined"},fixed:{x:{boolean:C},y:{boolean:C},__type__:{object:W,boolean:C}},font:{align:{string:M},color:{string:M},size:{number:x},face:{string:M},background:{string:M},strokeWidth:{number:x},strokeColor:{string:M},vadjust:{number:x},multi:{boolean:C,string:M},bold:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},boldital:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},ital:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},mono:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},__type__:{object:W,string:M}},group:{string:M,number:x,undefined:"undefined"},heightConstraint:{minimum:{number:x},valign:{string:M},__type__:{object:W,boolean:C,number:x}},hidden:{boolean:C},icon:{face:{string:M},code:{string:M},size:{number:x},color:{string:M},weight:{string:M,number:x},__type__:{object:W}},id:{string:M,number:x},image:{selected:{string:M,undefined:"undefined"},unselected:{string:M,undefined:"undefined"},__type__:{object:W,string:M}},imagePadding:{top:{number:x},right:{number:x},bottom:{number:x},left:{number:x},__type__:{object:W,number:x}},label:{string:M,undefined:"undefined"},labelHighlightBold:{boolean:C},level:{number:x,undefined:"undefined"},margin:{top:{number:x},right:{number:x},bottom:{number:x},left:{number:x},__type__:{object:W,number:x}},mass:{number:x},physics:{boolean:C},scaling:{min:{number:x},max:{number:x},label:{enabled:{boolean:C},min:{number:x},max:{number:x},maxVisible:{number:x},drawThreshold:{number:x},__type__:{object:W,boolean:C}},customScalingFunction:{function:"function"},__type__:{object:W}},shadow:{enabled:{boolean:C},color:{string:M},size:{number:x},x:{number:x},y:{number:x},__type__:{object:W,boolean:C}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:C,array:Pa},borderRadius:{number:x},interpolation:{boolean:C},useImageSize:{boolean:C},useBorderWithImage:{boolean:C},coordinateOrigin:{string:["center","top-left"]},__type__:{object:W}},size:{number:x},title:{string:M,dom:ik,undefined:"undefined"},value:{number:x,undefined:"undefined"},widthConstraint:{minimum:{number:x},maximum:{number:x},__type__:{object:W,boolean:C,number:x}},x:{number:x},y:{number:x},__type__:{object:W}},V$e={configure:{enabled:{boolean:C},filter:{boolean:C,string:M,array:Pa,function:"function"},container:{dom:ik},showButton:{boolean:C},__type__:{object:W,boolean:C,string:M,array:Pa,function:"function"}},edges:{arrows:{to:{enabled:{boolean:C},scaleFactor:{number:x},type:{string:id},imageHeight:{number:x},imageWidth:{number:x},src:{string:M},__type__:{object:W,boolean:C}},middle:{enabled:{boolean:C},scaleFactor:{number:x},type:{string:id},imageWidth:{number:x},imageHeight:{number:x},src:{string:M},__type__:{object:W,boolean:C}},from:{enabled:{boolean:C},scaleFactor:{number:x},type:{string:id},imageWidth:{number:x},imageHeight:{number:x},src:{string:M},__type__:{object:W,boolean:C}},__type__:{string:["from","to","middle"],object:W}},endPointOffset:{from:{number:x},to:{number:x},__type__:{object:W,number:x}},arrowStrikethrough:{boolean:C},background:{enabled:{boolean:C},color:{string:M},size:{number:x},dashes:{boolean:C,array:Pa},__type__:{object:W,boolean:C}},chosen:{label:{boolean:C,function:"function"},edge:{boolean:C,function:"function"},__type__:{object:W,boolean:C}},color:{color:{string:M},highlight:{string:M},hover:{string:M},inherit:{string:["from","to","both"],boolean:C},opacity:{number:x},__type__:{object:W,string:M}},dashes:{boolean:C,array:Pa},font:{color:{string:M},size:{number:x},face:{string:M},background:{string:M},strokeWidth:{number:x},strokeColor:{string:M},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:x},multi:{boolean:C,string:M},bold:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},boldital:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},ital:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},mono:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},__type__:{object:W,string:M}},hidden:{boolean:C},hoverWidth:{function:"function",number:x},label:{string:M,undefined:"undefined"},labelHighlightBold:{boolean:C},length:{number:x,undefined:"undefined"},physics:{boolean:C},scaling:{min:{number:x},max:{number:x},label:{enabled:{boolean:C},min:{number:x},max:{number:x},maxVisible:{number:x},drawThreshold:{number:x},__type__:{object:W,boolean:C}},customScalingFunction:{function:"function"},__type__:{object:W}},selectionWidth:{function:"function",number:x},selfReferenceSize:{number:x},selfReference:{size:{number:x},angle:{number:x},renderBehindTheNode:{boolean:C},__type__:{object:W}},shadow:{enabled:{boolean:C},color:{string:M},size:{number:x},x:{number:x},y:{number:x},__type__:{object:W,boolean:C}},smooth:{enabled:{boolean:C},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:x},forceDirection:{string:["horizontal","vertical","none"],boolean:C},__type__:{object:W,boolean:C}},title:{string:M,undefined:"undefined"},width:{number:x},widthConstraint:{maximum:{number:x},__type__:{object:W,boolean:C,number:x}},value:{number:x,undefined:"undefined"},__type__:{object:W}},groups:{useDefaultGroups:{boolean:C},__any__:ad,__type__:{object:W}},interaction:{dragNodes:{boolean:C},dragView:{boolean:C},hideEdgesOnDrag:{boolean:C},hideEdgesOnZoom:{boolean:C},hideNodesOnDrag:{boolean:C},hover:{boolean:C},keyboard:{enabled:{boolean:C},speed:{x:{number:x},y:{number:x},zoom:{number:x},__type__:{object:W}},bindToWindow:{boolean:C},autoFocus:{boolean:C},__type__:{object:W,boolean:C}},multiselect:{boolean:C},navigationButtons:{boolean:C},selectable:{boolean:C},selectConnectedEdges:{boolean:C},hoverConnectedEdges:{boolean:C},tooltipDelay:{number:x},zoomView:{boolean:C},zoomSpeed:{number:x},__type__:{object:W}},layout:{randomSeed:{undefined:"undefined",number:x,string:M},improvedLayout:{boolean:C},clusterThreshold:{number:x},hierarchical:{enabled:{boolean:C},levelSeparation:{number:x},nodeSpacing:{number:x},treeSpacing:{number:x},blockShifting:{boolean:C},edgeMinimization:{boolean:C},parentCentralization:{boolean:C},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:W,boolean:C}},__type__:{object:W}},manipulation:{enabled:{boolean:C},initiallyActive:{boolean:C},addNode:{boolean:C,function:"function"},addEdge:{boolean:C,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:W,boolean:C,function:"function"}},deleteNode:{boolean:C,function:"function"},deleteEdge:{boolean:C,function:"function"},controlNodeStyle:ad,__type__:{object:W,boolean:C}},nodes:ad,physics:{enabled:{boolean:C},barnesHut:{theta:{number:x},gravitationalConstant:{number:x},centralGravity:{number:x},springLength:{number:x},springConstant:{number:x},damping:{number:x},avoidOverlap:{number:x},__type__:{object:W}},forceAtlas2Based:{theta:{number:x},gravitationalConstant:{number:x},centralGravity:{number:x},springLength:{number:x},springConstant:{number:x},damping:{number:x},avoidOverlap:{number:x},__type__:{object:W}},repulsion:{centralGravity:{number:x},springLength:{number:x},springConstant:{number:x},nodeDistance:{number:x},damping:{number:x},__type__:{object:W}},hierarchicalRepulsion:{centralGravity:{number:x},springLength:{number:x},springConstant:{number:x},nodeDistance:{number:x},damping:{number:x},avoidOverlap:{number:x},__type__:{object:W}},maxVelocity:{number:x},minVelocity:{number:x},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:C},iterations:{number:x},updateInterval:{number:x},onlyDynamicEdges:{boolean:C},fit:{boolean:C},__type__:{object:W,boolean:C}},timestep:{number:x},adaptiveTimestep:{boolean:C},wind:{x:{number:x},y:{number:x},__type__:{object:W}},__type__:{object:W,boolean:C}},autoResize:{boolean:C},clickToUse:{boolean:C},locale:{string:M},locales:{__any__:{any:W$e},__type__:{object:W}},height:{string:M},width:{string:M},__type__:{object:W}},ak={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]}}},U$e=function(i,e,r){var n;return!!(vr(i).call(i,"physics")&&vr(n=ak.physics.solver).call(n,e)&&r.physics.solver!==e&&e!=="wind")},G$e=function(){function t(){N(this,t)}return F(t,[{key:"getDistances",value:function(e,r,n){for(var a={},o=e.edges,s=0;s<r.length;s++){var u=r[s],l={};a[u]=l;for(var c=0;c<r.length;c++)l[r[c]]=s==c?0:1e9}for(var h=0;h<n.length;h++){var d=o[n[h]];d.connected===!0&&a[d.fromId]!==void 0&&a[d.toId]!==void 0&&(a[d.fromId][d.toId]=1,a[d.toId][d.fromId]=1)}for(var f=r.length,v=0;v<f;v++)for(var g=r[v],b=a[g],p=0;p<f-1;p++)for(var $=r[p],m=a[$],y=p+1;y<f;y++){var w=r[y],S=a[w],T=Math.min(m[w],m[g]+b[w]);m[w]=T,S[$]=T}return a}}]),t}(),K$e=function(){function t(i,e,r){N(this,t),this.body=i,this.springLength=e,this.springConstant=r,this.distanceSolver=new G$e}return F(t,[{key:"setOptions",value:function(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}},{key:"solve",value:function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=this.distanceSolver.getDistances(this.body,e,r);this._createL_matrix(a),this._createK_matrix(a),this._createE_matrix();for(var o=.01,s=1,u=0,l=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),c=5,h=1e9,d=0,f=0,v=0,g=0,b=0;h>o&&u<l;){u+=1;var p=this._getHighestEnergyNode(n),$=xe(p,4);for(d=$[0],h=$[1],f=$[2],v=$[3],g=h,b=0;g>s&&b<c;){b+=1,this._moveNode(d,f,v);var m=this._getEnergy(d),y=xe(m,3);g=y[0],f=y[1],v=y[2]}}}},{key:"_getHighestEnergyNode",value:function(e){for(var r=this.body.nodeIndices,n=this.body.nodes,a=0,o=r[0],s=0,u=0,l=0;l<r.length;l++){var c=r[l];if(n[c].predefinedPosition!==!0||n[c].isCluster===!0&&e===!0||n[c].options.fixed.x!==!0||n[c].options.fixed.y!==!0){var h=this._getEnergy(c),d=xe(h,3),f=d[0],v=d[1],g=d[2];a<f&&(a=f,o=c,s=v,u=g)}}return[o,a,s,u]}},{key:"_getEnergy",value:function(e){var r=xe(this.E_sums[e],2),n=r[0],a=r[1],o=Math.sqrt(Math.pow(n,2)+Math.pow(a,2));return[o,n,a]}},{key:"_moveNode",value:function(e,r,n){for(var a=this.body.nodeIndices,o=this.body.nodes,s=0,u=0,l=0,c=o[e].x,h=o[e].y,d=this.K_matrix[e],f=this.L_matrix[e],v=0;v<a.length;v++){var g=a[v];if(g!==e){var b=o[g].x,p=o[g].y,$=d[g],m=f[g],y=1/Math.pow(Math.pow(c-b,2)+Math.pow(h-p,2),1.5);s+=$*(1-m*Math.pow(h-p,2)*y),u+=$*(m*(c-b)*(h-p)*y),l+=$*(1-m*Math.pow(c-b,2)*y)}}var w=s,S=u,T=r,O=l,_=n,E=(T/w+_/S)/(S/w-O/S),I=-(S*E+T)/w;o[e].x+=I,o[e].y+=E,this._updateE_matrix(e)}},{key:"_createL_matrix",value:function(e){var r=this.body.nodeIndices,n=this.springLength;this.L_matrix=[];for(var a=0;a<r.length;a++){this.L_matrix[r[a]]={};for(var o=0;o<r.length;o++)this.L_matrix[r[a]][r[o]]=n*e[r[a]][r[o]]}}},{key:"_createK_matrix",value:function(e){var r=this.body.nodeIndices,n=this.springConstant;this.K_matrix=[];for(var a=0;a<r.length;a++){this.K_matrix[r[a]]={};for(var o=0;o<r.length;o++)this.K_matrix[r[a]][r[o]]=n*Math.pow(e[r[a]][r[o]],-2)}}},{key:"_createE_matrix",value:function(){var e=this.body.nodeIndices,r=this.body.nodes;this.E_matrix={},this.E_sums={};for(var n=0;n<e.length;n++)this.E_matrix[e[n]]=[];for(var a=0;a<e.length;a++){for(var o=e[a],s=r[o].x,u=r[o].y,l=0,c=0,h=a;h<e.length;h++){var d=e[h];if(d!==o){var f=r[d].x,v=r[d].y,g=1/Math.sqrt(Math.pow(s-f,2)+Math.pow(u-v,2));this.E_matrix[o][h]=[this.K_matrix[o][d]*(s-f-this.L_matrix[o][d]*(s-f)*g),this.K_matrix[o][d]*(u-v-this.L_matrix[o][d]*(u-v)*g)],this.E_matrix[d][a]=this.E_matrix[o][h],l+=this.E_matrix[o][h][0],c+=this.E_matrix[o][h][1]}}this.E_sums[o]=[l,c]}}},{key:"_updateE_matrix",value:function(e){for(var r=this.body.nodeIndices,n=this.body.nodes,a=this.E_matrix[e],o=this.K_matrix[e],s=this.L_matrix[e],u=n[e].x,l=n[e].y,c=0,h=0,d=0;d<r.length;d++){var f=r[d];if(f!==e){var v=a[d],g=v[0],b=v[1],p=n[f].x,$=n[f].y,m=1/Math.sqrt(Math.pow(u-p,2)+Math.pow(l-$,2)),y=o[f]*(u-p-s[f]*(u-p)*m),w=o[f]*(l-$-s[f]*(l-$)*m);a[d]=[y,w],c+=y,h+=w;var S=this.E_sums[f];S[0]+=y-g,S[1]+=w-b}}this.E_sums[e]=[c,h]}}]),t}();function H(t,i,e){var r,n,a,o,s=this;if(!(this instanceof H))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:mhe,clickToUse:!1},je(this.options,this.defaultOptions),this.body={container:t,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:A(r=this.on).call(r,this),off:A(n=this.off).call(n,this),emit:A(a=this.emit).call(a,this),once:A(o=this.once).call(o,this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}},selectionBox:{show:!1,position:{start:{x:0,y:0},end:{x:0,y:0}}}},this.bindEventListeners(),this.images=new whe(function(){return s.body.emitter.emit("_requestRedraw")}),this.groups=new Bde,this.canvas=new xye(this.body),this.selectionHandler=new yme(this.body,this.canvas),this.interactionHandler=new Rye(this.body,this.canvas,this.selectionHandler),this.view=new kye(this.body,this.canvas),this.renderer=new _ye(this.body,this.canvas),this.physics=new dye(this.body),this.layoutEngine=new L$e(this.body),this.clustering=new bye(this.body),this.manipulation=new H$e(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new Kpe(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new rye(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new K$e(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(e),this.setData(i)}lT(H.prototype);H.prototype.setOptions=function(t){var i=this;if(t===null&&(t=void 0),t!==void 0){var e=Yce.validate(t,V$e);e===!0&&console.error("%cErrors have been found in the supplied options object.",vP);var r=["locale","locales","clickToUse"];if(pa(r,this.options,t),t.locale!==void 0&&(t.locale=$he(t.locales||this.options.locales,t.locale)),t=this.layoutEngine.setOptions(t.layout,t),this.canvas.setOptions(t),this.groups.setOptions(t.groups),this.nodesHandler.setOptions(t.nodes),this.edgesHandler.setOptions(t.edges),this.physics.setOptions(t.physics),this.manipulation.setOptions(t.manipulation,t,this.options),this.interactionHandler.setOptions(t.interaction),this.renderer.setOptions(t.interaction),this.selectionHandler.setOptions(t.interaction),t.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in t&&(this.configurator||(this.configurator=new Kce(this,this.body.container,ak,this.canvas.pixelRatio,U$e)),this.configurator.setOptions(t.configure)),this.configurator&&this.configurator.options.enabled===!0){var n={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};$e(n.nodes,this.nodesHandler.options),$e(n.edges,this.edgesHandler.options),$e(n.layout,this.layoutEngine.options),$e(n.interaction,this.selectionHandler.options),$e(n.interaction,this.renderer.options),$e(n.interaction,this.interactionHandler.options),$e(n.manipulation,this.manipulation.options),$e(n.physics,this.physics.options),$e(n.global,this.canvas.options),$e(n.global,this.options),this.configurator.setModuleOptions(n)}t.clickToUse!==void 0?t.clickToUse===!0?this.activator===void 0&&(this.activator=new Gce(this.canvas.frame),this.activator.on("change",function(){i.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}};H.prototype._updateVisibleIndices=function(){var t=this.body.nodes,i=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&!this.clustering._isClusteredNode(e)&&t[e].options.hidden===!1&&this.body.nodeIndices.push(t[e].id);for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)){var n=i[r],a=t[n.fromId],o=t[n.toId],s=a!==void 0&&o!==void 0,u=!this.clustering._isClusteredEdge(r)&&n.options.hidden===!1&&s&&a.options.hidden===!1&&o.options.hidden===!1;u&&this.body.edgeIndices.push(n.id)}};H.prototype.bindEventListeners=function(){var t=this;this.body.emitter.on("_dataChanged",function(){t.edgesHandler._updateState(),t.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",function(){t.clustering._updateState(),t._updateVisibleIndices(),t._updateValueRange(t.body.nodes),t._updateValueRange(t.body.edges),t.body.emitter.emit("startSimulation"),t.body.emitter.emit("_requestRedraw")})};H.prototype.setData=function(t){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),t&&t.dot&&(t.nodes||t.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(t&&t.options),t&&t.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");var i=ahe(t.dot);this.setData(i);return}else if(t&&t.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");var e=ohe(t.gephi);this.setData(e);return}else this.nodesHandler.setData(t&&t.nodes,!0),this.edgesHandler.setData(t&&t.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")};H.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(var t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&delete this.body.nodes[t];for(var i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&delete this.body.edges[i];Ur(this.body.container)};H.prototype._updateValueRange=function(t){var i,e=void 0,r=void 0,n=0;for(i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=t[i].getValue();a!==void 0&&(e=e===void 0?a:Math.min(a,e),r=r===void 0?a:Math.max(a,r),n+=a)}if(e!==void 0&&r!==void 0)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&t[i].setValueRange(e,r,n)};H.prototype.isActive=function(){return!this.activator||this.activator.active};H.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)};H.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)};H.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)};H.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)};H.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)};H.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)};H.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)};H.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)};H.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)};H.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)};H.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)};H.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)};H.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)};H.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)};H.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)};H.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)};H.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)};H.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)};H.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)};H.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)};H.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)};H.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)};H.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)};H.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)};H.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)};H.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)};H.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)};H.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)};H.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)};H.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)};H.prototype.getConnectedNodes=function(t){return this.body.nodes[t]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)};H.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)};H.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)};H.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)};H.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)};H.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)};H.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)};H.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)};H.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)};H.prototype.getNodeAt=function(){var t=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return t!==void 0&&t.id!==void 0?t.id:t};H.prototype.getEdgeAt=function(){var t=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return t!==void 0&&t.id!==void 0?t.id:t};H.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)};H.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)};H.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()};H.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)};H.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)};H.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)};H.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)};H.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)};H.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)};H.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)};H.prototype.getOptionsFromConfigurator=function(){var t={};return this.configurator&&(t=this.configurator.getOptions.apply(this.configurator)),t};const q$e=te("span",{op75:""},"Show pages",-1),Y$e=te("span",{op75:""},"Show layouts",-1),X$e=te("span",{op75:""},"Show workspace",-1),Q$e=te("span",{op75:""},"Show node_modules",-1),Z$e=te("span",{op75:""},"Show global components",-1),J$e=te("div",{"i-carbon-close":""},null,-1),ebe=te("div",{"flex-auto":""},null,-1),tbe={relative:"","h-full":"","w-full":""},rbe=te("div",{grid:"~ cols-[20px_1fr] items-center gap-y-1"},[te("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-42b883":""}),te("div",{op50:""}," Component "),te("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-97c2fc":""}),te("div",{op50:""}," Global Component "),te("div",{"h-3":"","w-3":"","bg-hex-42b2b8":""}),te("div",{op50:""}," Page "),te("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 726 628","ml--1px":"","h-3":""},[te("path",{fill:"#4256b8","stroke-width":"4",d:"M723 314 543 625.8H183L3 314 183 2.2h360L723 314z"})]),te("div",{op50:""}," Layout "),te("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-b4b842":""}),te("div",{op50:""}," Library Component "),te("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-b86542":""}),te("div",{op50:""}," Unknown ")],-1),nbe={key:0,p4:"",pr10:"",pt4:"",flex:"~ col gap4"},ibe=Gi({__name:"ComponentsGraph",props:{components:{}},setup(t){const i=t,e=Sa(),r=Sa(),n=uk(),a=Sa(),o=lk(),s=ck(),u=hk(),l=Ek(),{componentsGraphShowNodeModules:c,componentsGraphShowGlobalComponents:h,componentsGraphShowPages:d,componentsGraphShowLayouts:f,componentsGraphShowWorkspace:v}=y_(),g=Sa(),b=rn(()=>{const m=l.value||[];if(g.value){let y=function(S){!S||w.has(S)||(w.add(S),S.deps.forEach(T=>{y(m.find(O=>O.id===T))}))};const w=new Set;return m.find(S=>S.id===a.value?.id),y(g.value),Array.from(w)}return m}),p=rn(()=>{const m=b.value.map(w=>{const S=i.components.find(j=>j.filePath===w.id),T=o.value?.find(j=>j.file===w.id),O=u.value?.find(j=>j.file===w.id),_=w.id.replace(/\?.*$/,"").replace(/\#.*$/,""),E=w.id.includes("/node_modules/")?"lib":S?S.global?"global":"user":O?"layout":T?"page":"unknown";if(!c.value&&E==="lib"||!d.value&&E==="page"||!f.value&&E==="layout"||!v.value&&E==="user"&&s.value&&!w.id.startsWith(s.value.rootDir)||!h.value&&E==="global")return null;const I=E==="layout"?"hexagon":E==="page"?"square":"dot";return{id:w.id,label:_.split("/").splice(-1)[0].replace(/\.\w+$/,""),group:E,shape:I,size:15+Math.min(w.deps.length/2,8),font:{color:n.value==="dark"?"white":"black"},color:g.value?.id===w.id?"#82c742":void 0,extra:{id:w.id,component:S,page:T,layout:O,relationship:w}}}).filter(w=>!!w),y=b.value.flatMap(w=>w.deps.map(S=>({from:w.id,to:S,arrows:{to:{enabled:!0,scaleFactor:.8}}})));return{nodes:m,edges:y}});dk(()=>{const m={nodes:{shape:"dot",size:16},physics:{repulsion:{centralGravity:.7,springLength:100,springConstant:.01},maxVelocity:146,solver:"forceAtlas2Based",timestep:.35,stabilization:{enabled:!0,iterations:200}},groups:{user:{color:"#42b883"},unknown:{color:"#b86542"},lib:{color:"#b4b842"},page:{color:"#42b2b8"},layout:{color:"#4256b8"}}},y=new H(e.value,p.value,m);y.on("click",w=>{const S=w.nodes?.[0],T=p.value.nodes?.find(O=>O.id===S)?.extra;T&&(a.value=T)}),fk(p,()=>{y.setData(p.value)})});function $(){g.value=a.value?.relationship,a.value=void 0}return(m,y)=>{const w=Ok,S=m_,T=vk,O=E_,_=pk,E=Tk;return fe(),lt(Vr,null,[Be(S,{ref_key:"navbar",ref:r,absolute:"","left-0":"","right-0":"","top-0":""},{search:qe(()=>[Be(w,{modelValue:Z(d),"onUpdate:modelValue":y[0]||(y[0]=I=>pi(d)?d.value=I:null),n:"primary sm"},{default:qe(()=>[q$e]),_:1},8,["modelValue"]),Be(w,{modelValue:Z(f),"onUpdate:modelValue":y[1]||(y[1]=I=>pi(f)?f.value=I:null),n:"primary sm"},{default:qe(()=>[Y$e]),_:1},8,["modelValue"]),Be(w,{modelValue:Z(v),"onUpdate:modelValue":y[2]||(y[2]=I=>pi(v)?v.value=I:null),n:"primary sm"},{default:qe(()=>[X$e]),_:1},8,["modelValue"]),Be(w,{modelValue:Z(c),"onUpdate:modelValue":y[3]||(y[3]=I=>pi(c)?c.value=I:null),n:"primary sm"},{default:qe(()=>[Q$e]),_:1},8,["modelValue"]),Be(w,{modelValue:Z(h),"onUpdate:modelValue":y[4]||(y[4]=I=>pi(h)?h.value=I:null),n:"primary sm"},{default:qe(()=>[Z$e]),_:1},8,["modelValue"]),Z(g)?(fe(),lt("button",{key:0,flex:"~ gap-1","items-center":"","rounded-full":"","bg-gray:20":"",py1:"",pl3:"",pr2:"","text-xs":"",op50:"","hover:op100":"",onClick:y[5]||(y[5]=I=>g.value=void 0)},[ja(" Clear filter "),J$e])):Qt("",!0),ebe,Vu(m.$slots,"default")]),_:3},512),te("div",tbe,[te("div",{ref_key:"container",ref:e,"h-full":"","w-full":""},null,512),Be(T,{absolute:"","bottom-3":"","left-3":"","border-0":"",p2:"",px3:"","text-sm":"","glass-effect":""},{default:qe(()=>[rbe]),_:1}),Be(E,{"model-value":!!(Z(a)&&Z(a).component),navbar:Z(r),"w-80":"",onClose:y[7]||(y[7]=I=>a.value=void 0)},{default:qe(()=>[Z(a)&&Z(a).component?(fe(),lt("div",nbe,[Be(O,{component:Z(a).component},null,8,["component"]),te("div",null,[Be(_,{n:"primary solid",onClick:y[6]||(y[6]=I=>$())},{default:qe(()=>[ja(" Filter to this component ")]),_:1})])])):Qt("",!0)]),_:1},8,["model-value","navbar"])])],64)}}}),abe={hover:"bg-active",class:"group",flex:"~ gap2","w-full":"","items-center":"",rounded:"",px2:"",py1:""},obe={"hover:text-primary":""},sbe=Gi({__name:"ComponentItem",props:{component:{}},setup(t){const i=t,e=rn(()=>i.component.filePath||i.component.file||i.component.__file||"");return(r,n)=>{const a=__,o=E_,s=gk("VDropdown"),u=$_,l=b_;return fe(),lt("div",abe,[Be(s,null,{popper:qe(()=>[Be(o,{component:r.component,p4:""},null,8,["component"])]),default:qe(()=>[te("button",obe,[Be(a,{component:r.component},null,8,["component"])])]),_:1}),r.component.global?(fe(),$t(u,{key:0,"bg-green-400:10":"","text-green-400":"",title:"Registered at runtime as a global component",textContent:"runtime"})):Qt("",!0),Vu(r.$slots,"default"),Z(e)?(fe(),$t(l,{key:1,filepath:Z(e),"text-sm":"",op25:"","group-hover:op75":""},null,8,["filepath"])):Qt("",!0)])}}}),ube={pl4:""},lbe=Gi({__name:"ComponentsList",props:{components:{}},setup(t){const i=t,e=Sa(""),r=rn(()=>new yk(i.components,{keys:["pascalName","filePath","kebabName"]})),n=rn(()=>{const a=[],o=new Map,s=[],u=[],l={user:0,lib:0,builtin:0,runtime:0};return(e.value?r.value.search(e.value).map(h=>h.item):i.components).forEach(h=>{if(h.filePath&&mk(h.filePath)){const d=$k(h.filePath);if(!d)return;d==="nuxt"?(s.push(h),l.builtin++):(o.has(d)||o.set(d,[]),o.get(d).push(h),l.lib++)}else h.global&&!h.filePath?(u.push(h),l.runtime++):(a.push(h),l.user++)}),{count:l,user:a,builtin:s,lib:o,runtime:u}});return(a,o)=>{const s=m_,u=sbe,l=xk,c=Pk;return fe(),lt(Vr,null,[Be(s,{search:Z(e),"onUpdate:search":o[0]||(o[0]=h=>pi(e)?e.value=h:null)},{actions:qe(()=>[Vu(a.$slots,"default")]),_:3},8,["search"]),Z(n).user.length?(fe(),$t(l,{key:0,icon:"carbon-nominal",text:"User components",open:Z(n).user.length<=("DETAILS_MAX_ITEMS"in a?a.DETAILS_MAX_ITEMS:Z(jl)),description:`Total components: ${Z(n).count.user}`},{default:qe(()=>[(fe(!0),lt(Vr,null,ga(Z(n).user,h=>(fe(),$t(u,{key:h.filePath,component:h},null,8,["component"]))),128))]),_:1},8,["open","description"])):Qt("",!0),Z(n).runtime.length?(fe(),$t(l,{key:1,icon:"carbon-load-balancer-global",open:Z(n).runtime.length<=("DETAILS_MAX_ITEMS"in a?a.DETAILS_MAX_ITEMS:Z(jl)),text:"Runtime components",description:`Total components: ${Z(n).count.runtime}`},{default:qe(()=>[(fe(!0),lt(Vr,null,ga(Z(n).runtime,h=>(fe(),$t(u,{key:h.filePath,component:h},null,8,["component"]))),128))]),_:1},8,["open","description"])):Qt("",!0),Z(n).builtin.length?(fe(),$t(l,{key:2,icon:"simple-icons-nuxtdotjs",text:"Built-in components",description:`Total components: ${Z(n).count.builtin}`},{default:qe(()=>[(fe(!0),lt(Vr,null,ga(Z(n).builtin,h=>(fe(),$t(u,{key:h.filePath,component:h},null,8,["component"]))),128))]),_:1},8,["description"])):Qt("",!0),Z(n).lib.size?(fe(),$t(l,{key:3,open:Z(n).count.lib<=("DETAILS_MAX_ITEMS"in a?a.DETAILS_MAX_ITEMS:Z(jl)),icon:"carbon-3d-mpr-toggle",text:"Components from libraries",description:`${Z(n).count.lib} components from ${Z(n).lib.size} packages`},{default:qe(()=>[(fe(!0),lt(Vr,null,ga(Z(n).lib.entries(),([h,d])=>(fe(),lt("div",{key:h,"ml-2":""},[Be(c,{text:`${h} (${d.length})`,py1:"",op50:""},null,8,["text"]),te("div",ube,[(fe(!0),lt(Vr,null,ga(d,f=>(fe(),$t(u,{key:f.filePath,component:f},null,8,["component"]))),128))])]))),128))]),_:1},8,["open","description"])):Qt("",!0)],64)}}}),cbe={relative:"","h-full":"","of-auto":""},hbe={"flex-none":"",flex:"~ gap3"},Sbe=Gi({__name:"components",setup(t){const i=bk(),e=Sk(),{componentsView:r}=y_();function n(){i.value?.inspector?.instance&&i.value.inspector.enable()}function a(){r.value=r.value==="list"?"graph":"list"}return(o,s)=>{const u=g_,l=Dk,c=_k;return fe(),lt(Vr,null,[te("div",cbe,[(fe(),$t(wk(Z(r)==="list"?lbe:ibe),{components:Z(e)},{default:qe(()=>[te("div",hbe,[Be(u,{"text-lg":"",icon:Z(r)==="graph"?"i-carbon-list":"i-carbon-network-4",title:"Toggle view",onClick:a},null,8,["icon"]),Z(i)?.inspector?.instance?(fe(),$t(u,{key:0,"text-lg":"",icon:"i-tabler-focus-2",title:"Inspect Vue components",onClick:n})):Qt("",!0)])]),_:1},8,["components"]))]),Be(c,null,{default:qe(()=>[Be(l)]),_:1})],64)}}});export{Sbe as default};
98
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function D$e(t,i){var e;if(t){if(typeof t=="string")return v_(t,i);var r=st(e=Object.prototype.toString.call(t)).call(e,8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return ei(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v_(t,i)}}function v_(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,r=new Array(i);e<i;e++)r[e]=t[e];return r}function M$e(t,i){var e=new Sn;return ge(t).call(t,function(r){var n;ge(n=r.edges).call(n,function(a){a.connected&&e.add(a)})}),ge(e).call(e,function(r){var n=r.from.id,a=r.to.id;i[n]==null&&(i[n]=0),(i[a]==null||i[n]>=i[a])&&(i[a]=i[n]+1)}),i}function N$e(t){return nk(function(i){var e,r;return rk(e=St(r=i.edges).call(r,function(n){return t.has(n.toId)})).call(e,function(n){return n.to===i})},function(i,e){return e>i},"from",t)}function F$e(t){return nk(function(i){var e,r;return rk(e=St(r=i.edges).call(r,function(n){return t.has(n.toId)})).call(e,function(n){return n.from===i})},function(i,e){return e<i},"to",t)}function nk(t,i,e,r){var n,a=Rn(null),o=ZP(n=lr(CP(r).call(r))).call(n,function(f,v){return f+1+v.edges.length},0),s=e+"Id",u=e==="to"?1:-1,l=R$e(r),c;try{var h=function(){var v=xe(c.value,2),g=v[0],b=v[1];if(!r.has(g)||!t(b))return"continue";a[g]=0;for(var p=[b],$=0,m,y=function(){var T,O;if(!r.has(g))return"continue";var _=a[m.id]+u;if(ge(T=St(O=m.edges).call(O,function(E){return E.connected&&E.to!==E.from&&E[e]!==m&&r.has(E.toId)&&r.has(E.fromId)})).call(T,function(E){var I=E[s],j=a[I];(j==null||i(_,j))&&(a[I]=_,p.push(E[e]))}),$>o)return{v:{v:M$e(r,a)}};++$};m=p.pop();){var w=y();if(w!=="continue"&&he(w)==="object")return w.v}};for(l.s();!(c=l.n()).done;){var d=h();if(d!=="continue"&&he(d)==="object")return d.v}}catch(f){l.e(f)}finally{l.f()}return a}var B$e=function(){function t(){N(this,t),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return F(t,[{key:"addRelation",value:function(e,r){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(r),this.parentReference[r]===void 0&&(this.parentReference[r]=[]),this.parentReference[r].push(e)}},{key:"checkIfTree",value:function(){for(var e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}},{key:"numTrees",value:function(){return this.treeIndex+1}},{key:"setTreeIndex",value:function(e,r){r!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=r,this.treeIndex=Math.max(r,this.treeIndex))}},{key:"ensureLevel",value:function(e){this.levels[e]===void 0&&(this.levels[e]=0)}},{key:"getMaxLevel",value:function(e){var r=this,n={},a=function o(s){if(n[s]!==void 0)return n[s];var u=r.levels[s];if(r.childrenReference[s]){var l=r.childrenReference[s];if(l.length>0)for(var c=0;c<l.length;c++)u=Math.max(u,o(l[c]))}return n[s]=u,u};return a(e)}},{key:"levelDownstream",value:function(e,r){this.levels[r.id]===void 0&&(this.levels[e.id]===void 0&&(this.levels[e.id]=0),this.levels[r.id]=this.levels[e.id]+1)}},{key:"setMinLevelToZero",value:function(e){var r=1e9;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.levels[n]!==void 0&&(r=Math.min(this.levels[n],r));for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&this.levels[a]!==void 0&&(this.levels[a]-=r)}},{key:"getTreeSize",value:function(e,r){var n=1e9,a=-1e9,o=1e9,s=-1e9;for(var u in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,u)&&this.trees[u]===r){var l=e[u];n=Math.min(l.x,n),a=Math.max(l.x,a),o=Math.min(l.y,o),s=Math.max(l.y,s)}return{min_x:n,max_x:a,min_y:o,max_y:s}}},{key:"hasSameParent",value:function(e,r){var n=this.parentReference[e.id],a=this.parentReference[r.id];if(n===void 0||a===void 0)return!1;for(var o=0;o<n.length;o++)for(var s=0;s<a.length;s++)if(n[o]==a[s])return!0;return!1}},{key:"inSameSubNetwork",value:function(e,r){return this.trees[e.id]===this.trees[r.id]}},{key:"getLevels",value:function(){return Te(this.distributionOrdering)}},{key:"addToOrdering",value:function(e,r){this.distributionOrdering[r]===void 0&&(this.distributionOrdering[r]=[]);var n=!1,a=this.distributionOrdering[r];for(var o in a)if(a[o]===e){n=!0;break}n||(this.distributionOrdering[r].push(e),this.distributionIndex[e.id]=this.distributionOrdering[r].length-1)}}]),t}(),L$e=function(){function t(i){N(this,t),this.body=i,this._resetRNG(Math.random()+":"+Mu()),this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,clusterThreshold:150,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:"UD",sortMethod:"hubsize"}},je(this.options,this.defaultOptions),this.bindEventListeners()}return F(t,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("_dataChanged",function(){e.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",function(){e.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",function(){e.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",function(){if(e.options.hierarchical.enabled===!0){var r=e.direction.curveType();e.body.emitter.emit("_forceDisableDynamicCurves",r,!1)}})}},{key:"setOptions",value:function(e,r){if(e!==void 0){var n=this.options.hierarchical,a=n.enabled;if(pa(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),Lt(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),n.enabled===!0)return a===!0&&this.body.emitter.emit("refresh",!0),n.direction==="RL"||n.direction==="DU"?n.levelSeparation>0&&(n.levelSeparation*=-1):n.levelSeparation<0&&(n.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(r);if(a===!0)return this.body.emitter.emit("refresh"),$e(r,this.optionsBackup)}return r}},{key:"_resetRNG",value:function(e){this.initialRandomSeed=e,this._rng=Ll(this.initialRandomSeed)}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(e){if(this.options.hierarchical.enabled===!0){var r=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:r.enabled===void 0?!0:r.enabled,solver:"hierarchicalRepulsion"},r.enabled=r.enabled===void 0?!0:r.enabled,r.solver=r.solver||"barnesHut"):he(e.physics)==="object"?(r.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,r.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(r.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});var n=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if(typeof e.edges.smooth=="boolean")this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:n};else{var a=e.edges.smooth;a.type!==void 0&&a.type!=="dynamic"&&(n=a.type),this.optionsBackup.edges={smooth:{enabled:a.enabled===void 0?!0:a.enabled,type:a.type===void 0?"dynamic":a.type,roundness:a.roundness===void 0?.5:a.roundness,forceDirection:a.forceDirection===void 0?!1:a.forceDirection}},e.edges.smooth={enabled:a.enabled===void 0?!0:a.enabled,type:n,roundness:a.roundness===void 0?.5:a.roundness,forceDirection:a.forceDirection===void 0?!1:a.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",n)}return e}},{key:"positionInitially",value:function(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);for(var r=e.length+50,n=0;n<e.length;n++){var a=e[n],o=2*Math.PI*this._rng();a.x===void 0&&(a.x=r*Math.cos(o)),a.y===void 0&&(a.y=r*Math.sin(o))}}}},{key:"layoutNetwork",value:function(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){for(var e=this.body.nodeIndices,r=0,n=0;n<e.length;n++){var a=this.body.nodes[e[n]];a.predefinedPosition===!0&&(r+=1)}if(r<.5*e.length){var o=10,s=0,u=this.options.clusterThreshold,l={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>u){for(var c=e.length;e.length>u&&s<=o;){s+=1;var h=e.length;s%3===0?this.body.modules.clustering.clusterBridges(l):this.body.modules.clustering.clusterOutliers(l);var d=e.length;if(h==d&&s%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*c)})}s>o&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();for(var f=70,v=0;v<e.length;v++){var g=this.body.nodes[e[v]];g.predefinedPosition===!1&&(g.x+=(.5-this._rng())*f,g.y+=(.5-this._rng())*f)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}},{key:"_shiftToCenter",value:function(){for(var e=dt.getRangeCore(this.body.nodes,this.body.nodeIndices),r=dt.findCenter(e),n=0;n<this.body.nodeIndices.length;n++){var a=this.body.nodes[this.body.nodeIndices[n]];a.x-=r.x,a.y-=r.y}}},{key:"_declusterAll",value:function(){for(var e=!0;e===!0;){e=!1;for(var r=0;r<this.body.nodeIndices.length;r++)this.body.nodes[this.body.nodeIndices[r]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[r],{},!1));e===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"getSeed",value:function(){return this.initialRandomSeed}},{key:"setupHierarchicalLayout",value:function(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){var e,r,n=!1,a=!1;this.lastNodeOnLevel={},this.hierarchical=new B$e;for(r in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,r)&&(e=this.body.nodes[r],e.options.level!==void 0?(n=!0,this.hierarchical.levels[r]=e.options.level):a=!0);if(a===!0&&n===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");if(a===!0){var o=this.options.hierarchical.sortMethod;o==="hubsize"?this._determineLevelsByHubsize():o==="directed"?this._determineLevelsDirected():o==="custom"&&this._determineLevelsCustomCallback()}for(var s in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,s)&&this.hierarchical.ensureLevel(s);var u=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(u),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var e=this,r=!1,n={},a=function(){for(var m=s(),y=0,w=0;w<m.length-1;w++){var S=m[w].max-m[w+1].min;y+=S+e.options.hierarchical.treeSpacing,o(w+1,y)}},o=function(m,y){var w=e.hierarchical.trees;for(var S in w)Object.prototype.hasOwnProperty.call(w,S)&&w[S]===m&&e.direction.shift(S,y)},s=function(){for(var m=[],y=0;y<e.hierarchical.numTrees();y++)m.push(e.direction.getTreeSize(y));return m},u=function $(m,y){if(!y[m.id]&&(y[m.id]=!0,e.hierarchical.childrenReference[m.id])){var w=e.hierarchical.childrenReference[m.id];if(w.length>0)for(var S=0;S<w.length;S++)$(e.body.nodes[w[S]],y)}},l=function(m){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,w=1e9,S=1e9,T=1e9,O=-1e9;for(var _ in m)if(Object.prototype.hasOwnProperty.call(m,_)){var E=e.body.nodes[_],I=e.hierarchical.levels[E.id],j=e.direction.getPosition(E),B=e._getSpaceAroundNode(E,m),X=xe(B,2),ne=X[0],re=X[1];w=Math.min(ne,w),S=Math.min(re,S),I<=y&&(T=Math.min(j,T),O=Math.max(j,O))}return[T,O,w,S]},c=function(m,y){var w=e.hierarchical.getMaxLevel(m.id),S=e.hierarchical.getMaxLevel(y.id);return Math.min(w,S)},h=function(m,y,w){for(var S=e.hierarchical,T=0;T<y.length;T++){var O=y[T],_=S.distributionOrdering[O];if(_.length>1)for(var E=0;E<_.length-1;E++){var I=_[E],j=_[E+1];S.hasSameParent(I,j)&&S.inSameSubNetwork(I,j)&&m(I,j,w)}}},d=function(m,y){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,S=e.direction.getPosition(m),T=e.direction.getPosition(y),O=Math.abs(T-S),_=e.options.hierarchical.nodeSpacing;if(O>_){var E={},I={};u(m,E),u(y,I);var j=c(m,y),B=l(E,j),X=l(I,j),ne=B[1],re=X[0],le=X[2],we=Math.abs(ne-re);if(we>_){var Oe=ne-re+_;Oe<-le+_&&(Oe=-le+_),Oe<0&&(e._shiftBlock(y.id,Oe),r=!0,w===!0&&e._centerParent(y))}}},f=function(m,y){for(var w=y.id,S=y.edges,T=e.hierarchical.levels[y.id],O=e.options.hierarchical.levelSeparation*e.options.hierarchical.levelSeparation,_={},E=[],I=0;I<S.length;I++){var j=S[I];if(j.toId!=j.fromId){var B=j.toId==w?j.from:j.to;_[S[I].id]=B,e.hierarchical.levels[B.id]<T&&E.push(j)}}var X=function(nt,_e){for(var Ae=0,R=0;R<_e.length;R++)if(_[_e[R].id]!==void 0){var k=e.direction.getPosition(_[_e[R].id])-nt;Ae+=k/Math.sqrt(k*k+O)}return Ae},ne=function(nt,_e){for(var Ae=0,R=0;R<_e.length;R++)if(_[_e[R].id]!==void 0){var k=e.direction.getPosition(_[_e[R].id])-nt;Ae-=O*Math.pow(k*k+O,-1.5)}return Ae},re=function(nt,_e){for(var Ae=e.direction.getPosition(y),R={},k=0;k<nt;k++){var D=X(Ae,_e),L=ne(Ae,_e),G=40,Y=Math.max(-G,Math.min(G,Math.round(D/L)));if(Ae=Ae-Y,R[Ae]!==void 0)break;R[Ae]=k}return Ae},le=function(nt){var _e=e.direction.getPosition(y);if(n[y.id]===void 0){var Ae={};u(y,Ae),n[y.id]=Ae}var R=l(n[y.id]),k=R[2],D=R[3],L=nt-_e,G=0;L>0?G=Math.min(L,D-e.options.hierarchical.nodeSpacing):L<0&&(G=-Math.min(-L,k-e.options.hierarchical.nodeSpacing)),G!=0&&(e._shiftBlock(y.id,G),r=!0)},we=function(nt){var _e=e.direction.getPosition(y),Ae=e._getSpaceAroundNode(y),R=xe(Ae,2),k=R[0],D=R[1],L=nt-_e,G=_e;L>0?G=Math.min(_e+(D-e.options.hierarchical.nodeSpacing),nt):L<0&&(G=Math.max(_e-(k-e.options.hierarchical.nodeSpacing),nt)),G!==_e&&(e.direction.setPosition(y,G),r=!0)},Oe=re(m,E);le(Oe),Oe=re(m,S),we(Oe)},v=function(m){var y=e.hierarchical.getLevels();y=An(y).call(y);for(var w=0;w<m;w++){r=!1;for(var S=0;S<y.length;S++)for(var T=y[S],O=e.hierarchical.distributionOrdering[T],_=0;_<O.length;_++)f(1e3,O[_]);if(r!==!0)break}},g=function(m){var y=e.hierarchical.getLevels();y=An(y).call(y);for(var w=0;w<m&&(r=!1,h(d,y,!0),r===!0);w++);},b=function(){for(var m in e.body.nodes)Object.prototype.hasOwnProperty.call(e.body.nodes,m)&&e._centerParent(e.body.nodes[m])},p=function(){var m=e.hierarchical.getLevels();m=An(m).call(m);for(var y=0;y<m.length;y++)for(var w=m[y],S=e.hierarchical.distributionOrdering[w],T=0;T<S.length;T++)e._centerParent(S[T])};this.options.hierarchical.blockShifting===!0&&(g(5),b()),this.options.hierarchical.edgeMinimization===!0&&v(20),this.options.hierarchical.parentCentralization===!0&&p(),a()}},{key:"_getSpaceAroundNode",value:function(e,r){var n=!0;r===void 0&&(n=!1);var a=this.hierarchical.levels[e.id];if(a!==void 0){var o=this.hierarchical.distributionIndex[e.id],s=this.direction.getPosition(e),u=this.hierarchical.distributionOrdering[a],l=1e9,c=1e9;if(o!==0){var h=u[o-1];if(n===!0&&r[h.id]===void 0||n===!1){var d=this.direction.getPosition(h);l=s-d}}if(o!=u.length-1){var f=u[o+1];if(n===!0&&r[f.id]===void 0||n===!1){var v=this.direction.getPosition(f);c=Math.min(c,v-s)}}return[l,c]}else return[0,0]}},{key:"_centerParent",value:function(e){if(this.hierarchical.parentReference[e.id])for(var r=this.hierarchical.parentReference[e.id],n=0;n<r.length;n++){var a=r[n],o=this.body.nodes[a],s=this.hierarchical.childrenReference[a];if(s!==void 0){var u=this._getCenterPosition(s),l=this.direction.getPosition(o),c=this._getSpaceAroundNode(o),h=xe(c,2),d=h[0],f=h[1],v=l-u;(v<0&&Math.abs(v)<f-this.options.hierarchical.nodeSpacing||v>0&&Math.abs(v)<d-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(o,u)}}}},{key:"_placeNodesByHierarchy",value:function(e){this.positionedNodes={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n,a=Te(e[r]);a=this._indexArrayToNodes(a),td(n=this.direction).call(n,a);for(var o=0,s=0;s<a.length;s++){var u=a[s];if(this.positionedNodes[u.id]===void 0){var l=this.options.hierarchical.nodeSpacing,c=l*o;o>0&&(c=this.direction.getPosition(a[s-1])+l),this.direction.setPosition(u,c,r),this._validatePositionAndContinue(u,r,c),o++}}}}},{key:"_placeBranchNodes",value:function(e,r){var n,a=this.hierarchical.childrenReference[e];if(a!==void 0){for(var o=[],s=0;s<a.length;s++)o.push(this.body.nodes[a[s]]);td(n=this.direction).call(n,o);for(var u=0;u<o.length;u++){var l=o[u],c=this.hierarchical.levels[l.id];if(c>r&&this.positionedNodes[l.id]===void 0){var h=this.options.hierarchical.nodeSpacing,d=void 0;u===0?d=this.direction.getPosition(this.body.nodes[e]):d=this.direction.getPosition(o[u-1])+h,this.direction.setPosition(l,d,c),this._validatePositionAndContinue(l,c,d)}else return}var f=this._getCenterPosition(o);this.direction.setPosition(this.body.nodes[e],f,r)}}},{key:"_validatePositionAndContinue",value:function(e,r,n){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[r]!==void 0){var a=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[r]]);if(n-a<this.options.hierarchical.nodeSpacing){var o=a+this.options.hierarchical.nodeSpacing-n,s=this._findCommonParent(this.lastNodeOnLevel[r],e.id);this._shiftBlock(s.withChild,o)}}this.lastNodeOnLevel[r]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,r)}}},{key:"_indexArrayToNodes",value:function(e){for(var r=[],n=0;n<e.length;n++)r.push(this.body.nodes[e[n]]);return r}},{key:"_getDistribution",value:function(){var e={},r,n;for(r in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,r)){n=this.body.nodes[r];var a=this.hierarchical.levels[r]===void 0?0:this.hierarchical.levels[r];this.direction.fix(n,a),e[a]===void 0&&(e[a]={}),e[a][r]=n}return e}},{key:"_getActiveEdges",value:function(e){var r=this,n=[];return te(e.edges,function(a){var o;ae(o=r.body.edgeIndices).call(o,a.id)!==-1&&n.push(a)}),n}},{key:"_getHubSizes",value:function(){var e=this,r={},n=this.body.nodeIndices;te(n,function(o){var s=e.body.nodes[o],u=e._getActiveEdges(s).length;r[u]=!0});var a=[];return te(r,function(o){a.push(Number(o))}),td(f_).call(f_,a,function(o,s){return s-o}),a}},{key:"_determineLevelsByHubsize",value:function(){for(var e=this,r=function(l,c){e.hierarchical.levelDownstream(l,c)},n=this._getHubSizes(),a=function(){var l=n[o];if(l===0)return"break";te(e.body.nodeIndices,function(c){var h=e.body.nodes[c];l===e._getActiveEdges(h).length&&e._crawlNetwork(r,c)})},o=0;o<n.length;++o){var s=a();if(s==="break")break}}},{key:"_determineLevelsCustomCallback",value:function(){var e=this,r=1e5,n=function(s,u,l){},a=function(s,u,l){var c=e.hierarchical.levels[s.id];c===void 0&&(c=e.hierarchical.levels[s.id]=r);var h=n(dt.cloneOptions(s,"node"),dt.cloneOptions(u,"node"),dt.cloneOptions(l,"edge"));e.hierarchical.levels[u.id]=c+h};this._crawlNetwork(a),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_determineLevelsDirected",value:function(){var e,r=this,n=ZP(e=this.body.nodeIndices).call(e,function(a,o){return a.set(o,r.body.nodes[o]),a},new xP);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=F$e(n):this.hierarchical.levels=N$e(n),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_generateMap",value:function(){var e=this,r=function(a,o){e.hierarchical.levels[o.id]>e.hierarchical.levels[a.id]&&e.hierarchical.addRelation(a.id,o.id)};this._crawlNetwork(r),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},n=arguments.length>1?arguments[1]:void 0,a={},o=function d(f,v){if(a[f.id]===void 0){e.hierarchical.setTreeIndex(f,v),a[f.id]=!0;for(var g,b=e._getActiveEdges(f),p=0;p<b.length;p++){var $=b[p];$.connected===!0&&($.toId==f.id?g=$.from:g=$.to,f.id!=g.id&&(r(f,g,$),d(g,v)))}}};if(n===void 0)for(var s=0,u=0;u<this.body.nodeIndices.length;u++){var l=this.body.nodeIndices[u];if(a[l]===void 0){var c=this.body.nodes[l];o(c,s),s+=1}}else{var h=this.body.nodes[n];if(h===void 0){console.error("Node not found:",n);return}o(h)}}},{key:"_shiftBlock",value:function(e,r){var n=this,a={},o=function s(u){if(!a[u]){a[u]=!0,n.direction.shift(u,r);var l=n.hierarchical.childrenReference[u];if(l!==void 0)for(var c=0;c<l.length;c++)s(l[c])}};o(e)}},{key:"_findCommonParent",value:function(e,r){var n=this,a={},o=function u(l,c){var h=n.hierarchical.parentReference[c];if(h!==void 0)for(var d=0;d<h.length;d++){var f=h[d];l[f]=!0,u(l,f)}},s=function u(l,c){var h=n.hierarchical.parentReference[c];if(h!==void 0)for(var d=0;d<h.length;d++){var f=h[d];if(l[f]!==void 0)return{foundParent:f,withChild:c};var v=u(l,f);if(v.foundParent!==null)return v}return{foundParent:null,withChild:c}};return o(a,e),s(a,r)}},{key:"setDirectionStrategy",value:function(){var e=this.options.hierarchical.direction==="UD"||this.options.hierarchical.direction==="DU";e?this.direction=new $$e(this):this.direction=new b$e(this)}},{key:"_getCenterPosition",value:function(e){for(var r=1e9,n=-1e9,a=0;a<e.length;a++){var o=void 0;if(e[a].id!==void 0)o=e[a];else{var s=e[a];o=this.body.nodes[s]}var u=this.direction.getPosition(o);r=Math.min(r,u),n=Math.max(n,u)}return .5*(r+n)}}]),t}();function j$e(t,i){var e=typeof pn<"u"&&Br(t)||t["@@iterator"];if(!e){if(ve(t)||(e=z$e(t))||i&&t&&typeof t.length=="number"){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
99
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function z$e(t,i){var e;if(t){if(typeof t=="string")return p_(t,i);var r=st(e=Object.prototype.toString.call(t)).call(e,8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return ei(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p_(t,i)}}function p_(t,i){(i==null||i>t.length)&&(i=t.length);for(var e=0,r=new Array(i);e<i;e++)r[e]=t[e];return r}var H$e=function(){function t(i,e,r,n){var a=this,o,s;N(this,t),this.body=i,this.canvas=e,this.selectionHandler=r,this.interactionHandler=n,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},je(this.options,this.defaultOptions),this.body.emitter.on("destroy",function(){a._clean()}),this.body.emitter.on("_dataChanged",A(o=this._restore).call(o,this)),this.body.emitter.on("_resetData",A(s=this._restore).call(s,this))}return F(t,[{key:"_restore",value:function(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}},{key:"setOptions",value:function(e,r,n){r!==void 0&&(r.locale!==void 0?this.options.locale=r.locale:this.options.locale=n.locale,r.locales!==void 0?this.options.locales=r.locales:this.options.locales=n.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,$e(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}},{key:"toggleEditMode",value:function(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}},{key:"enableEditMode",value:function(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}},{key:"disableEditMode",value:function(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}},{key:"showManipulatorToolbar",value:function(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,r;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";var n=this.selectionHandler.getSelectedNodeCount(),a=this.selectionHandler.getSelectedEdgeCount(),o=n+a,s=this.options.locales[this.options.locale],u=!1;this.options.addNode!==!1&&(this._createAddNodeButton(s),u=!0),this.options.addEdge!==!1&&(u===!0?this._createSeperator(1):u=!0,this._createAddEdgeButton(s)),n===1&&typeof this.options.editNode=="function"?(u===!0?this._createSeperator(2):u=!0,this._createEditNodeButton(s)):a===1&&n===0&&this.options.editEdge!==!1&&(u===!0?this._createSeperator(3):u=!0,this._createEditEdgeButton(s)),o!==0&&(n>0&&this.options.deleteNode!==!1?(u===!0&&this._createSeperator(4),this._createDeleteButton(s)):n===0&&this.options.deleteEdge!==!1&&(u===!0&&this._createSeperator(4),this._createDeleteButton(s))),this._bindElementEvents(this.closeDiv,A(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",A(r=this.showManipulatorToolbar).call(r,this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var r,n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,A(r=this.toggleEditMode).call(r,this))}this._temporaryBindEvent("click",A(e=this._performAddNode).call(e,this))}},{key:"editNode",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean();var r=this.selectionHandler.getSelectedNodes()[0];if(r!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(r.isCluster!==!0){var n=$e({},r.options,!1);if(n.x=r.x,n.y=r.y,this.options.editNode.length===2)this.options.editNode(n,function(a){a!=null&&e.inMode==="editNode"&&e.body.data.nodes.getDataSet().update(a),e.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){var e,r,n,a,o;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var s,u=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(u),this._createSeperator(),this._createDescription(u.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,A(s=this.toggleEditMode).call(s,this))}this._temporaryBindUI("onTouch",A(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",A(r=this._finishConnect).call(r,this)),this._temporaryBindUI("onDrag",A(n=this._dragControlNode).call(n,this)),this._temporaryBindUI("onRelease",A(a=this._finishConnect).call(a,this)),this._temporaryBindUI("onDragStart",A(o=this._dragStartEdge).call(o,this)),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",he(this.options.editEdge)==="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){var e=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(e.from.id,e.to.id);return}if(this.guiEnabled===!0){var r,n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,A(r=this.toggleEditMode).call(r,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var a,o,s,u,l=this.body.edges[this.edgeBeingEditedId],c=this._getNewTargetNode(l.from.x,l.from.y),h=this._getNewTargetNode(l.to.x,l.to.y);this.temporaryIds.nodes.push(c.id),this.temporaryIds.nodes.push(h.id),this.body.nodes[c.id]=c,this.body.nodeIndices.push(c.id),this.body.nodes[h.id]=h,this.body.nodeIndices.push(h.id),this._temporaryBindUI("onTouch",A(a=this._controlNodeTouch).call(a,this)),this._temporaryBindUI("onTap",function(){}),this._temporaryBindUI("onHold",function(){}),this._temporaryBindUI("onDragStart",A(o=this._controlNodeDragStart).call(o,this)),this._temporaryBindUI("onDrag",A(s=this._controlNodeDrag).call(s,this)),this._temporaryBindUI("onDragEnd",A(u=this._controlNodeDragEnd).call(u,this)),this._temporaryBindUI("onMouseMove",function(){}),this._temporaryBindEvent("beforeDrawing",function(d){var f=l.edgeType.findBorderPositions(d);c.selected===!1&&(c.x=f.from.x,c.y=f.from.y),h.selected===!1&&(h.x=f.to.x,h.y=f.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";var r=this.selectionHandler.getSelectedNodeIds(),n=this.selectionHandler.getSelectedEdgeIds(),a=void 0;if(r.length>0){for(var o=0;o<r.length;o++)if(this.body.nodes[r[o]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(a=this.options.deleteNode)}else n.length>0&&typeof this.options.deleteEdge=="function"&&(a=this.options.deleteEdge);if(typeof a=="function"){var s={nodes:r,edges:n};if(a.length===2)a(s,function(u){u!=null&&e.inMode==="delete"?(e.body.data.edges.getDataSet().remove(u.edges),e.body.data.nodes.getDataSet().remove(u.nodes),e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar()):(e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(n),this.body.data.nodes.getDataSet().remove(r),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var e,r;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(r=this.options.locales[this.options.locale])===null||r===void 0?void 0:r.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}},{key:"_getNewTargetNode",value:function(e,r){var n=$e({},this.options.controlNodeStyle);n.id="targetNode"+Ba(),n.hidden=!1,n.physics=!1,n.x=e,n.y=r;var a=this.body.functions.createNode(n);return a.shape.boundingBox={left:e,right:e,top:r,bottom:r},a}},{key:"_createEditButton",value:function(){var e;this._clean(),this.manipulationDOM={},Ur(this.editModeDiv);var r=this.options.locales[this.options.locale],n=this._createButton("editMode","vis-edit vis-edit-mode",r.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(n),this._bindElementEvents(n,A(e=this.toggleEditMode).call(e,this))}},{key:"_clean",value:function(){this.inMode=!1,this.guiEnabled===!0&&(Ur(this.editModeDiv),Ur(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanupDOMEventListeners",value:function(){var e,r=j$e(Or(e=this._domEventListenerCleanupQueue).call(e,0)),n;try{for(r.s();!(n=r.n()).done;){var a=n.value;a()}}catch(o){r.e(o)}finally{r.f()}}},{key:"_removeManipulationDOM",value:function(){this._clean(),Ur(this.manipulationDiv),Ur(this.editModeDiv),Ur(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 e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}},{key:"_createAddNodeButton",value:function(e){var r,n=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,A(r=this.addNodeMode).call(r,this))}},{key:"_createAddEdgeButton",value:function(e){var r,n=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,A(r=this.addEdgeMode).call(r,this))}},{key:"_createEditNodeButton",value:function(e){var r,n=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,A(r=this.editNode).call(r,this))}},{key:"_createEditEdgeButton",value:function(e){var r,n=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,A(r=this.editEdgeMode).call(r,this))}},{key:"_createDeleteButton",value:function(e){var r,n;this.options.rtl?n="vis-delete-rtl":n="vis-delete";var a=this._createButton("delete",n,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(a),this._bindElementEvents(a,A(r=this.deleteSelected).call(r,this))}},{key:"_createBackButton",value:function(e){var r,n=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(n),this._bindElementEvents(n,A(r=this.showManipulatorToolbar).call(r,this))}},{key:"_createButton",value:function(e,r,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("button"),this.manipulationDOM[e+"Div"].className="vis-button "+r,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=a,this.manipulationDOM[e+"Label"].innerText=n,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}},{key:"_createDescription",value:function(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}},{key:"_temporaryBindEvent",value:function(e,r){this.temporaryEventFunctions.push({event:e,boundFunction:r}),this.body.emitter.on(e,r)}},{key:"_temporaryBindUI",value:function(e,r){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=r;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+es(Te(this.body.eventListeners)))}},{key:"_unbindTemporaryUIs",value:function(){for(var e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var e=0;e<this.temporaryEventFunctions.length;e++){var r=this.temporaryEventFunctions[e].event,n=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(r,n)}this.temporaryEventFunctions=[]}},{key:"_bindElementEvents",value:function(e,r){var n=new Ii(e,{});Wu(n,r),this._domEventListenerCleanupQueue.push(function(){n.destroy()});var a=function(s){var u=s.keyCode,l=s.key;(l==="Enter"||l===" "||u===13||u===32)&&r()};e.addEventListener("keyup",a,!1),this._domEventListenerCleanupQueue.push(function(){e.removeEventListener("keyup",a,!1)})}},{key:"_cleanupTemporaryNodesAndEdges",value:function(){for(var e=0;e<this.temporaryIds.edges.length;e++){var r;this.body.edges[this.temporaryIds.edges[e]].disconnect(),delete this.body.edges[this.temporaryIds.edges[e]];var n=ae(r=this.body.edgeIndices).call(r,this.temporaryIds.edges[e]);if(n!==-1){var a;Or(a=this.body.edgeIndices).call(a,n,1)}}for(var o=0;o<this.temporaryIds.nodes.length;o++){var s;delete this.body.nodes[this.temporaryIds.nodes[o]];var u=ae(s=this.body.nodeIndices).call(s,this.temporaryIds.nodes[o]);if(u!==-1){var l;Or(l=this.body.nodeIndices).call(l,u,1)}}this.temporaryIds={nodes:[],edges:[]}}},{key:"_controlNodeTouch",value:function(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=je({},this.body.view.translation)}},{key:"_controlNodeDragStart",value:function(){var e=this.lastTouch,r=this.selectionHandler._pointerToPositionObject(e),n=this.body.nodes[this.temporaryIds.nodes[0]],a=this.body.nodes[this.temporaryIds.nodes[1]],o=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;var s=n.isOverlappingWith(r),u=a.isOverlappingWith(r);s===!0?(this.selectedControlNode=n,o.edgeType.from=n):u===!0&&(this.selectedControlNode=a,o.edgeType.to=a),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}},{key:"_controlNodeDrag",value:function(e){this.body.emitter.emit("disablePhysics");var r=this.body.functions.getPointer(e.center),n=this.canvas.DOMtoCanvas(r);this.selectedControlNode!==void 0?(this.selectedControlNode.x=n.x,this.selectedControlNode.y=n.y):this.interactionHandler.onDrag(e),this.body.emitter.emit("_redraw")}},{key:"_controlNodeDragEnd",value:function(e){var r=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(r),a=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode!==void 0){this.selectionHandler.unselectAll();for(var o=this.selectionHandler._getAllNodesOverlappingWith(n),s=void 0,u=o.length-1;u>=0;u--)if(o[u]!==this.selectedControlNode.id){s=this.body.nodes[o[u]];break}if(s!==void 0&&this.selectedControlNode!==void 0)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var l=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===l.id?this._performEditEdge(s.id,a.to.id):this._performEditEdge(a.from.id,s.id)}else a.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=je({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;var r=this.lastTouch,n=this.selectionHandler.getNodeAt(r);if(n!==void 0)if(n.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var a=this._getNewTargetNode(n.x,n.y);this.body.nodes[a.id]=a,this.body.nodeIndices.push(a.id);var o=this.body.functions.createEdge({id:"connectionEdge"+Ba(),from:n.id,to:a.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[o.id]=o,this.body.edgeIndices.push(o.id),this.temporaryIds.nodes.push(a.id),this.temporaryIds.edges.push(o.id)}this.touchTime=new Date().valueOf()}}},{key:"_dragControlNode",value:function(e){var r=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(r),a=void 0;this.temporaryIds.edges[0]!==void 0&&(a=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(n),s=void 0,u=o.length-1;u>=0;u--){var l;if(ae(l=this.temporaryIds.nodes).call(l,o[u])===-1){s=this.body.nodes[o[u]];break}}if(e.controlEdge={from:a,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,r),this.temporaryIds.nodes[0]!==void 0){var c=this.body.nodes[this.temporaryIds.nodes[0]];c.x=this.canvas._XconvertDOMtoCanvas(r.x),c.y=this.canvas._YconvertDOMtoCanvas(r.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}},{key:"_finishConnect",value:function(e){var r=this.body.functions.getPointer(e.center),n=this.selectionHandler._pointerToPositionObject(r),a=void 0;this.temporaryIds.edges[0]!==void 0&&(a=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(n),s=void 0,u=o.length-1;u>=0;u--){var l;if(ae(l=this.temporaryIds.nodes).call(l,o[u])===-1){s=this.body.nodes[o[u]];break}}this._cleanupTemporaryNodesAndEdges(),s!==void 0&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[a]!==void 0&&this.body.nodes[s.id]!==void 0&&this._performAddEdge(a,s.id)),e.controlEdge={from:a,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,r),this.body.emitter.emit("_redraw")}},{key:"_dragStartEdge",value:function(e){var r=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,r,void 0,!0)}},{key:"_performAddNode",value:function(e){var r=this,n={id:Ba(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(n,function(a){a!=null&&r.inMode==="addNode"&&r.body.data.nodes.getDataSet().add(a),r.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(n),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(e,r){var n=this,a={from:e,to:r};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(a,function(o){o!=null&&n.inMode==="addEdge"&&(n.body.data.edges.getDataSet().add(o),n.selectionHandler.unselectAll(),n.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(a),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(e,r){var n=this,a={id:this.edgeBeingEditedId,from:e,to:r,label:this.body.data.edges.get(this.edgeBeingEditedId).label},o=this.options.editEdge;if(he(o)==="object"&&(o=o.editWithoutDrag),typeof o=="function")if(o.length===2)o(a,function(s){s==null||n.inMode!=="editEdge"?(n.body.edges[a.id].updateEdgeType(),n.body.emitter.emit("_redraw"),n.showManipulatorToolbar()):(n.body.data.edges.getDataSet().update(s),n.selectionHandler.unselectAll(),n.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(a),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),t}(),M="string",C="boolean",x="number",Pa="array",W="object",ik="dom",W$e="any",id=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],ad={borderWidth:{number:x},borderWidthSelected:{number:x,undefined:"undefined"},brokenImage:{string:M,undefined:"undefined"},chosen:{label:{boolean:C,function:"function"},node:{boolean:C,function:"function"},__type__:{object:W,boolean:C}},color:{border:{string:M},background:{string:M},highlight:{border:{string:M},background:{string:M},__type__:{object:W,string:M}},hover:{border:{string:M},background:{string:M},__type__:{object:W,string:M}},__type__:{object:W,string:M}},opacity:{number:x,undefined:"undefined"},fixed:{x:{boolean:C},y:{boolean:C},__type__:{object:W,boolean:C}},font:{align:{string:M},color:{string:M},size:{number:x},face:{string:M},background:{string:M},strokeWidth:{number:x},strokeColor:{string:M},vadjust:{number:x},multi:{boolean:C,string:M},bold:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},boldital:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},ital:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},mono:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},__type__:{object:W,string:M}},group:{string:M,number:x,undefined:"undefined"},heightConstraint:{minimum:{number:x},valign:{string:M},__type__:{object:W,boolean:C,number:x}},hidden:{boolean:C},icon:{face:{string:M},code:{string:M},size:{number:x},color:{string:M},weight:{string:M,number:x},__type__:{object:W}},id:{string:M,number:x},image:{selected:{string:M,undefined:"undefined"},unselected:{string:M,undefined:"undefined"},__type__:{object:W,string:M}},imagePadding:{top:{number:x},right:{number:x},bottom:{number:x},left:{number:x},__type__:{object:W,number:x}},label:{string:M,undefined:"undefined"},labelHighlightBold:{boolean:C},level:{number:x,undefined:"undefined"},margin:{top:{number:x},right:{number:x},bottom:{number:x},left:{number:x},__type__:{object:W,number:x}},mass:{number:x},physics:{boolean:C},scaling:{min:{number:x},max:{number:x},label:{enabled:{boolean:C},min:{number:x},max:{number:x},maxVisible:{number:x},drawThreshold:{number:x},__type__:{object:W,boolean:C}},customScalingFunction:{function:"function"},__type__:{object:W}},shadow:{enabled:{boolean:C},color:{string:M},size:{number:x},x:{number:x},y:{number:x},__type__:{object:W,boolean:C}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:C,array:Pa},borderRadius:{number:x},interpolation:{boolean:C},useImageSize:{boolean:C},useBorderWithImage:{boolean:C},coordinateOrigin:{string:["center","top-left"]},__type__:{object:W}},size:{number:x},title:{string:M,dom:ik,undefined:"undefined"},value:{number:x,undefined:"undefined"},widthConstraint:{minimum:{number:x},maximum:{number:x},__type__:{object:W,boolean:C,number:x}},x:{number:x},y:{number:x},__type__:{object:W}},V$e={configure:{enabled:{boolean:C},filter:{boolean:C,string:M,array:Pa,function:"function"},container:{dom:ik},showButton:{boolean:C},__type__:{object:W,boolean:C,string:M,array:Pa,function:"function"}},edges:{arrows:{to:{enabled:{boolean:C},scaleFactor:{number:x},type:{string:id},imageHeight:{number:x},imageWidth:{number:x},src:{string:M},__type__:{object:W,boolean:C}},middle:{enabled:{boolean:C},scaleFactor:{number:x},type:{string:id},imageWidth:{number:x},imageHeight:{number:x},src:{string:M},__type__:{object:W,boolean:C}},from:{enabled:{boolean:C},scaleFactor:{number:x},type:{string:id},imageWidth:{number:x},imageHeight:{number:x},src:{string:M},__type__:{object:W,boolean:C}},__type__:{string:["from","to","middle"],object:W}},endPointOffset:{from:{number:x},to:{number:x},__type__:{object:W,number:x}},arrowStrikethrough:{boolean:C},background:{enabled:{boolean:C},color:{string:M},size:{number:x},dashes:{boolean:C,array:Pa},__type__:{object:W,boolean:C}},chosen:{label:{boolean:C,function:"function"},edge:{boolean:C,function:"function"},__type__:{object:W,boolean:C}},color:{color:{string:M},highlight:{string:M},hover:{string:M},inherit:{string:["from","to","both"],boolean:C},opacity:{number:x},__type__:{object:W,string:M}},dashes:{boolean:C,array:Pa},font:{color:{string:M},size:{number:x},face:{string:M},background:{string:M},strokeWidth:{number:x},strokeColor:{string:M},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:x},multi:{boolean:C,string:M},bold:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},boldital:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},ital:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},mono:{color:{string:M},size:{number:x},face:{string:M},mod:{string:M},vadjust:{number:x},__type__:{object:W,string:M}},__type__:{object:W,string:M}},hidden:{boolean:C},hoverWidth:{function:"function",number:x},label:{string:M,undefined:"undefined"},labelHighlightBold:{boolean:C},length:{number:x,undefined:"undefined"},physics:{boolean:C},scaling:{min:{number:x},max:{number:x},label:{enabled:{boolean:C},min:{number:x},max:{number:x},maxVisible:{number:x},drawThreshold:{number:x},__type__:{object:W,boolean:C}},customScalingFunction:{function:"function"},__type__:{object:W}},selectionWidth:{function:"function",number:x},selfReferenceSize:{number:x},selfReference:{size:{number:x},angle:{number:x},renderBehindTheNode:{boolean:C},__type__:{object:W}},shadow:{enabled:{boolean:C},color:{string:M},size:{number:x},x:{number:x},y:{number:x},__type__:{object:W,boolean:C}},smooth:{enabled:{boolean:C},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:x},forceDirection:{string:["horizontal","vertical","none"],boolean:C},__type__:{object:W,boolean:C}},title:{string:M,undefined:"undefined"},width:{number:x},widthConstraint:{maximum:{number:x},__type__:{object:W,boolean:C,number:x}},value:{number:x,undefined:"undefined"},__type__:{object:W}},groups:{useDefaultGroups:{boolean:C},__any__:ad,__type__:{object:W}},interaction:{dragNodes:{boolean:C},dragView:{boolean:C},hideEdgesOnDrag:{boolean:C},hideEdgesOnZoom:{boolean:C},hideNodesOnDrag:{boolean:C},hover:{boolean:C},keyboard:{enabled:{boolean:C},speed:{x:{number:x},y:{number:x},zoom:{number:x},__type__:{object:W}},bindToWindow:{boolean:C},autoFocus:{boolean:C},__type__:{object:W,boolean:C}},multiselect:{boolean:C},navigationButtons:{boolean:C},selectable:{boolean:C},selectConnectedEdges:{boolean:C},hoverConnectedEdges:{boolean:C},tooltipDelay:{number:x},zoomView:{boolean:C},zoomSpeed:{number:x},__type__:{object:W}},layout:{randomSeed:{undefined:"undefined",number:x,string:M},improvedLayout:{boolean:C},clusterThreshold:{number:x},hierarchical:{enabled:{boolean:C},levelSeparation:{number:x},nodeSpacing:{number:x},treeSpacing:{number:x},blockShifting:{boolean:C},edgeMinimization:{boolean:C},parentCentralization:{boolean:C},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:W,boolean:C}},__type__:{object:W}},manipulation:{enabled:{boolean:C},initiallyActive:{boolean:C},addNode:{boolean:C,function:"function"},addEdge:{boolean:C,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:W,boolean:C,function:"function"}},deleteNode:{boolean:C,function:"function"},deleteEdge:{boolean:C,function:"function"},controlNodeStyle:ad,__type__:{object:W,boolean:C}},nodes:ad,physics:{enabled:{boolean:C},barnesHut:{theta:{number:x},gravitationalConstant:{number:x},centralGravity:{number:x},springLength:{number:x},springConstant:{number:x},damping:{number:x},avoidOverlap:{number:x},__type__:{object:W}},forceAtlas2Based:{theta:{number:x},gravitationalConstant:{number:x},centralGravity:{number:x},springLength:{number:x},springConstant:{number:x},damping:{number:x},avoidOverlap:{number:x},__type__:{object:W}},repulsion:{centralGravity:{number:x},springLength:{number:x},springConstant:{number:x},nodeDistance:{number:x},damping:{number:x},__type__:{object:W}},hierarchicalRepulsion:{centralGravity:{number:x},springLength:{number:x},springConstant:{number:x},nodeDistance:{number:x},damping:{number:x},avoidOverlap:{number:x},__type__:{object:W}},maxVelocity:{number:x},minVelocity:{number:x},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:C},iterations:{number:x},updateInterval:{number:x},onlyDynamicEdges:{boolean:C},fit:{boolean:C},__type__:{object:W,boolean:C}},timestep:{number:x},adaptiveTimestep:{boolean:C},wind:{x:{number:x},y:{number:x},__type__:{object:W}},__type__:{object:W,boolean:C}},autoResize:{boolean:C},clickToUse:{boolean:C},locale:{string:M},locales:{__any__:{any:W$e},__type__:{object:W}},height:{string:M},width:{string:M},__type__:{object:W}},ak={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]}}},U$e=function(i,e,r){var n;return!!(vr(i).call(i,"physics")&&vr(n=ak.physics.solver).call(n,e)&&r.physics.solver!==e&&e!=="wind")},G$e=function(){function t(){N(this,t)}return F(t,[{key:"getDistances",value:function(e,r,n){for(var a={},o=e.edges,s=0;s<r.length;s++){var u=r[s],l={};a[u]=l;for(var c=0;c<r.length;c++)l[r[c]]=s==c?0:1e9}for(var h=0;h<n.length;h++){var d=o[n[h]];d.connected===!0&&a[d.fromId]!==void 0&&a[d.toId]!==void 0&&(a[d.fromId][d.toId]=1,a[d.toId][d.fromId]=1)}for(var f=r.length,v=0;v<f;v++)for(var g=r[v],b=a[g],p=0;p<f-1;p++)for(var $=r[p],m=a[$],y=p+1;y<f;y++){var w=r[y],S=a[w],T=Math.min(m[w],m[g]+b[w]);m[w]=T,S[$]=T}return a}}]),t}(),K$e=function(){function t(i,e,r){N(this,t),this.body=i,this.springLength=e,this.springConstant=r,this.distanceSolver=new G$e}return F(t,[{key:"setOptions",value:function(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}},{key:"solve",value:function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=this.distanceSolver.getDistances(this.body,e,r);this._createL_matrix(a),this._createK_matrix(a),this._createE_matrix();for(var o=.01,s=1,u=0,l=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),c=5,h=1e9,d=0,f=0,v=0,g=0,b=0;h>o&&u<l;){u+=1;var p=this._getHighestEnergyNode(n),$=xe(p,4);for(d=$[0],h=$[1],f=$[2],v=$[3],g=h,b=0;g>s&&b<c;){b+=1,this._moveNode(d,f,v);var m=this._getEnergy(d),y=xe(m,3);g=y[0],f=y[1],v=y[2]}}}},{key:"_getHighestEnergyNode",value:function(e){for(var r=this.body.nodeIndices,n=this.body.nodes,a=0,o=r[0],s=0,u=0,l=0;l<r.length;l++){var c=r[l];if(n[c].predefinedPosition!==!0||n[c].isCluster===!0&&e===!0||n[c].options.fixed.x!==!0||n[c].options.fixed.y!==!0){var h=this._getEnergy(c),d=xe(h,3),f=d[0],v=d[1],g=d[2];a<f&&(a=f,o=c,s=v,u=g)}}return[o,a,s,u]}},{key:"_getEnergy",value:function(e){var r=xe(this.E_sums[e],2),n=r[0],a=r[1],o=Math.sqrt(Math.pow(n,2)+Math.pow(a,2));return[o,n,a]}},{key:"_moveNode",value:function(e,r,n){for(var a=this.body.nodeIndices,o=this.body.nodes,s=0,u=0,l=0,c=o[e].x,h=o[e].y,d=this.K_matrix[e],f=this.L_matrix[e],v=0;v<a.length;v++){var g=a[v];if(g!==e){var b=o[g].x,p=o[g].y,$=d[g],m=f[g],y=1/Math.pow(Math.pow(c-b,2)+Math.pow(h-p,2),1.5);s+=$*(1-m*Math.pow(h-p,2)*y),u+=$*(m*(c-b)*(h-p)*y),l+=$*(1-m*Math.pow(c-b,2)*y)}}var w=s,S=u,T=r,O=l,_=n,E=(T/w+_/S)/(S/w-O/S),I=-(S*E+T)/w;o[e].x+=I,o[e].y+=E,this._updateE_matrix(e)}},{key:"_createL_matrix",value:function(e){var r=this.body.nodeIndices,n=this.springLength;this.L_matrix=[];for(var a=0;a<r.length;a++){this.L_matrix[r[a]]={};for(var o=0;o<r.length;o++)this.L_matrix[r[a]][r[o]]=n*e[r[a]][r[o]]}}},{key:"_createK_matrix",value:function(e){var r=this.body.nodeIndices,n=this.springConstant;this.K_matrix=[];for(var a=0;a<r.length;a++){this.K_matrix[r[a]]={};for(var o=0;o<r.length;o++)this.K_matrix[r[a]][r[o]]=n*Math.pow(e[r[a]][r[o]],-2)}}},{key:"_createE_matrix",value:function(){var e=this.body.nodeIndices,r=this.body.nodes;this.E_matrix={},this.E_sums={};for(var n=0;n<e.length;n++)this.E_matrix[e[n]]=[];for(var a=0;a<e.length;a++){for(var o=e[a],s=r[o].x,u=r[o].y,l=0,c=0,h=a;h<e.length;h++){var d=e[h];if(d!==o){var f=r[d].x,v=r[d].y,g=1/Math.sqrt(Math.pow(s-f,2)+Math.pow(u-v,2));this.E_matrix[o][h]=[this.K_matrix[o][d]*(s-f-this.L_matrix[o][d]*(s-f)*g),this.K_matrix[o][d]*(u-v-this.L_matrix[o][d]*(u-v)*g)],this.E_matrix[d][a]=this.E_matrix[o][h],l+=this.E_matrix[o][h][0],c+=this.E_matrix[o][h][1]}}this.E_sums[o]=[l,c]}}},{key:"_updateE_matrix",value:function(e){for(var r=this.body.nodeIndices,n=this.body.nodes,a=this.E_matrix[e],o=this.K_matrix[e],s=this.L_matrix[e],u=n[e].x,l=n[e].y,c=0,h=0,d=0;d<r.length;d++){var f=r[d];if(f!==e){var v=a[d],g=v[0],b=v[1],p=n[f].x,$=n[f].y,m=1/Math.sqrt(Math.pow(u-p,2)+Math.pow(l-$,2)),y=o[f]*(u-p-s[f]*(u-p)*m),w=o[f]*(l-$-s[f]*(l-$)*m);a[d]=[y,w],c+=y,h+=w;var S=this.E_sums[f];S[0]+=y-g,S[1]+=w-b}}this.E_sums[e]=[c,h]}}]),t}();function H(t,i,e){var r,n,a,o,s=this;if(!(this instanceof H))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:mhe,clickToUse:!1},je(this.options,this.defaultOptions),this.body={container:t,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:A(r=this.on).call(r,this),off:A(n=this.off).call(n,this),emit:A(a=this.emit).call(a,this),once:A(o=this.once).call(o,this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}},selectionBox:{show:!1,position:{start:{x:0,y:0},end:{x:0,y:0}}}},this.bindEventListeners(),this.images=new whe(function(){return s.body.emitter.emit("_requestRedraw")}),this.groups=new Bde,this.canvas=new xye(this.body),this.selectionHandler=new yme(this.body,this.canvas),this.interactionHandler=new Rye(this.body,this.canvas,this.selectionHandler),this.view=new kye(this.body,this.canvas),this.renderer=new _ye(this.body,this.canvas),this.physics=new dye(this.body),this.layoutEngine=new L$e(this.body),this.clustering=new bye(this.body),this.manipulation=new H$e(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new Kpe(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new rye(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new K$e(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(e),this.setData(i)}lT(H.prototype);H.prototype.setOptions=function(t){var i=this;if(t===null&&(t=void 0),t!==void 0){var e=Yce.validate(t,V$e);e===!0&&console.error("%cErrors have been found in the supplied options object.",vP);var r=["locale","locales","clickToUse"];if(pa(r,this.options,t),t.locale!==void 0&&(t.locale=$he(t.locales||this.options.locales,t.locale)),t=this.layoutEngine.setOptions(t.layout,t),this.canvas.setOptions(t),this.groups.setOptions(t.groups),this.nodesHandler.setOptions(t.nodes),this.edgesHandler.setOptions(t.edges),this.physics.setOptions(t.physics),this.manipulation.setOptions(t.manipulation,t,this.options),this.interactionHandler.setOptions(t.interaction),this.renderer.setOptions(t.interaction),this.selectionHandler.setOptions(t.interaction),t.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in t&&(this.configurator||(this.configurator=new Kce(this,this.body.container,ak,this.canvas.pixelRatio,U$e)),this.configurator.setOptions(t.configure)),this.configurator&&this.configurator.options.enabled===!0){var n={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};$e(n.nodes,this.nodesHandler.options),$e(n.edges,this.edgesHandler.options),$e(n.layout,this.layoutEngine.options),$e(n.interaction,this.selectionHandler.options),$e(n.interaction,this.renderer.options),$e(n.interaction,this.interactionHandler.options),$e(n.manipulation,this.manipulation.options),$e(n.physics,this.physics.options),$e(n.global,this.canvas.options),$e(n.global,this.options),this.configurator.setModuleOptions(n)}t.clickToUse!==void 0?t.clickToUse===!0?this.activator===void 0&&(this.activator=new Gce(this.canvas.frame),this.activator.on("change",function(){i.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}};H.prototype._updateVisibleIndices=function(){var t=this.body.nodes,i=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&!this.clustering._isClusteredNode(e)&&t[e].options.hidden===!1&&this.body.nodeIndices.push(t[e].id);for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)){var n=i[r],a=t[n.fromId],o=t[n.toId],s=a!==void 0&&o!==void 0,u=!this.clustering._isClusteredEdge(r)&&n.options.hidden===!1&&s&&a.options.hidden===!1&&o.options.hidden===!1;u&&this.body.edgeIndices.push(n.id)}};H.prototype.bindEventListeners=function(){var t=this;this.body.emitter.on("_dataChanged",function(){t.edgesHandler._updateState(),t.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",function(){t.clustering._updateState(),t._updateVisibleIndices(),t._updateValueRange(t.body.nodes),t._updateValueRange(t.body.edges),t.body.emitter.emit("startSimulation"),t.body.emitter.emit("_requestRedraw")})};H.prototype.setData=function(t){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),t&&t.dot&&(t.nodes||t.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(t&&t.options),t&&t.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");var i=ahe(t.dot);this.setData(i);return}else if(t&&t.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");var e=ohe(t.gephi);this.setData(e);return}else this.nodesHandler.setData(t&&t.nodes,!0),this.edgesHandler.setData(t&&t.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")};H.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(var t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&delete this.body.nodes[t];for(var i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&delete this.body.edges[i];Ur(this.body.container)};H.prototype._updateValueRange=function(t){var i,e=void 0,r=void 0,n=0;for(i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=t[i].getValue();a!==void 0&&(e=e===void 0?a:Math.min(a,e),r=r===void 0?a:Math.max(a,r),n+=a)}if(e!==void 0&&r!==void 0)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&t[i].setValueRange(e,r,n)};H.prototype.isActive=function(){return!this.activator||this.activator.active};H.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)};H.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)};H.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)};H.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)};H.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)};H.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)};H.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)};H.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)};H.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)};H.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)};H.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)};H.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)};H.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)};H.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)};H.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)};H.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)};H.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)};H.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)};H.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)};H.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)};H.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)};H.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)};H.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)};H.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)};H.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)};H.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)};H.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)};H.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)};H.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)};H.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)};H.prototype.getConnectedNodes=function(t){return this.body.nodes[t]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)};H.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)};H.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)};H.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)};H.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)};H.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)};H.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)};H.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)};H.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)};H.prototype.getNodeAt=function(){var t=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return t!==void 0&&t.id!==void 0?t.id:t};H.prototype.getEdgeAt=function(){var t=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return t!==void 0&&t.id!==void 0?t.id:t};H.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)};H.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)};H.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()};H.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)};H.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)};H.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)};H.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)};H.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)};H.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)};H.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)};H.prototype.getOptionsFromConfigurator=function(){var t={};return this.configurator&&(t=this.configurator.getOptions.apply(this.configurator)),t};const q$e={flex:"~ gap-4 wrap","w-full":""},Y$e=ee("span",{op75:""},"Show pages",-1),X$e=ee("span",{op75:""},"Show layouts",-1),Q$e=ee("span",{op75:""},"Show workspace",-1),Z$e=ee("span",{op75:""},"Show node_modules",-1),J$e=ee("span",{op75:""},"Show global components",-1),ebe=ee("div",{"i-carbon-close":""},null,-1),tbe=ee("div",{"flex-auto":""},null,-1),rbe={relative:"","h-full":"","w-full":""},nbe=ee("div",{grid:"~ cols-[20px_1fr] items-center gap-y-1"},[ee("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-42b883":""}),ee("div",{op50:""}," Component "),ee("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-97c2fc":""}),ee("div",{op50:""}," Global Component "),ee("div",{"h-3":"","w-3":"","bg-hex-42b2b8":""}),ee("div",{op50:""}," Page "),ee("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 726 628","ml--1px":"","h-3":""},[ee("path",{fill:"#4256b8","stroke-width":"4",d:"M723 314 543 625.8H183L3 314 183 2.2h360L723 314z"})]),ee("div",{op50:""}," Layout "),ee("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-b4b842":""}),ee("div",{op50:""}," Library Component "),ee("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-b86542":""}),ee("div",{op50:""}," Unknown ")],-1),ibe={key:0,p4:"",pr10:"",pt4:"",flex:"~ col gap4"},abe=Gi({__name:"ComponentsGraph",props:{components:{}},setup(t){const i=t,e=Sa(),r=Sa(),n=uk(),a=Sa(),o=lk(),s=ck(),u=hk(),l=Ek(),{componentsGraphShowNodeModules:c,componentsGraphShowGlobalComponents:h,componentsGraphShowPages:d,componentsGraphShowLayouts:f,componentsGraphShowWorkspace:v}=y_(),g=Sa(),b=rn(()=>{const m=l.value||[];if(g.value){let y=function(S){!S||w.has(S)||(w.add(S),S.deps.forEach(T=>{y(m.find(O=>O.id===T))}))};const w=new Set;return m.find(S=>S.id===a.value?.id),y(g.value),Array.from(w)}return m}),p=rn(()=>{const m=b.value.map(w=>{const S=i.components.find(j=>j.filePath===w.id),T=o.value?.find(j=>j.file===w.id),O=u.value?.find(j=>j.file===w.id),_=w.id.replace(/\?.*$/,"").replace(/\#.*$/,""),E=w.id.includes("/node_modules/")?"lib":S?S.global?"global":"user":O?"layout":T?"page":"unknown";if(!c.value&&E==="lib"||!d.value&&E==="page"||!f.value&&E==="layout"||!v.value&&E==="user"&&s.value&&!w.id.startsWith(s.value.rootDir)||!h.value&&E==="global")return null;const I=E==="layout"?"hexagon":E==="page"?"square":"dot";return{id:w.id,label:_.split("/").splice(-1)[0].replace(/\.\w+$/,""),group:E,shape:I,size:15+Math.min(w.deps.length/2,8),font:{color:n.value==="dark"?"white":"black"},color:g.value?.id===w.id?"#82c742":void 0,extra:{id:w.id,component:S,page:T,layout:O,relationship:w}}}).filter(w=>!!w),y=b.value.flatMap(w=>w.deps.map(S=>({from:w.id,to:S,arrows:{to:{enabled:!0,scaleFactor:.8}}})));return{nodes:m,edges:y}});dk(()=>{const m={nodes:{shape:"dot",size:16},physics:{repulsion:{centralGravity:.7,springLength:100,springConstant:.01},maxVelocity:146,solver:"forceAtlas2Based",timestep:.35,stabilization:{enabled:!0,iterations:200}},groups:{user:{color:"#42b883"},unknown:{color:"#b86542"},lib:{color:"#b4b842"},page:{color:"#42b2b8"},layout:{color:"#4256b8"}}},y=new H(e.value,p.value,m);y.on("click",w=>{const S=w.nodes?.[0],T=p.value.nodes?.find(O=>O.id===S)?.extra;T&&(a.value=T)}),fk(p,()=>{y.setData(p.value)})});function $(){g.value=a.value?.relationship,a.value=void 0}return(m,y)=>{const w=Ok,S=m_,T=vk,O=E_,_=pk,E=Tk;return fe(),lt(Vr,null,[Be(S,{ref_key:"navbar",ref:r,absolute:"","left-0":"","right-0":"","top-0":""},{search:qe(()=>[ee("div",q$e,[Be(w,{modelValue:Z(d),"onUpdate:modelValue":y[0]||(y[0]=I=>pi(d)?d.value=I:null),n:"primary sm"},{default:qe(()=>[Y$e]),_:1},8,["modelValue"]),Be(w,{modelValue:Z(f),"onUpdate:modelValue":y[1]||(y[1]=I=>pi(f)?f.value=I:null),n:"primary sm"},{default:qe(()=>[X$e]),_:1},8,["modelValue"]),Be(w,{modelValue:Z(v),"onUpdate:modelValue":y[2]||(y[2]=I=>pi(v)?v.value=I:null),n:"primary sm"},{default:qe(()=>[Q$e]),_:1},8,["modelValue"]),Be(w,{modelValue:Z(c),"onUpdate:modelValue":y[3]||(y[3]=I=>pi(c)?c.value=I:null),n:"primary sm"},{default:qe(()=>[Z$e]),_:1},8,["modelValue"]),Be(w,{modelValue:Z(h),"onUpdate:modelValue":y[4]||(y[4]=I=>pi(h)?h.value=I:null),n:"primary sm"},{default:qe(()=>[J$e]),_:1},8,["modelValue"])]),Z(g)?(fe(),lt("button",{key:0,flex:"~ gap-1","items-center":"","rounded-full":"","bg-gray:20":"",py1:"",pl3:"",pr2:"","text-xs":"",op50:"","hover:op100":"",onClick:y[5]||(y[5]=I=>g.value=void 0)},[ja(" Clear filter "),ebe])):Qt("",!0),tbe,Vu(m.$slots,"default")]),_:3},512),ee("div",rbe,[ee("div",{ref_key:"container",ref:e,"h-full":"","w-full":""},null,512),Be(T,{absolute:"","bottom-3":"","left-3":"","border-0":"",p2:"",px3:"","text-sm":"","glass-effect":""},{default:qe(()=>[nbe]),_:1}),Be(E,{"model-value":!!(Z(a)&&Z(a).component),navbar:Z(r),"w-80":"",onClose:y[7]||(y[7]=I=>a.value=void 0)},{default:qe(()=>[Z(a)&&Z(a).component?(fe(),lt("div",ibe,[Be(O,{component:Z(a).component},null,8,["component"]),ee("div",null,[Be(_,{n:"primary solid",onClick:y[6]||(y[6]=I=>$())},{default:qe(()=>[ja(" Filter to this component ")]),_:1})])])):Qt("",!0)]),_:1},8,["model-value","navbar"])])],64)}}}),obe={hover:"bg-active",class:"group",flex:"~ gap2","w-full":"","items-center":"",rounded:"",px2:"",py1:""},sbe={"hover:text-primary":""},ube=Gi({__name:"ComponentItem",props:{component:{}},setup(t){const i=t,e=rn(()=>i.component.filePath||i.component.file||i.component.__file||"");return(r,n)=>{const a=__,o=E_,s=gk("VDropdown"),u=$_,l=b_;return fe(),lt("div",obe,[Be(s,null,{popper:qe(()=>[Be(o,{component:r.component,p4:""},null,8,["component"])]),default:qe(()=>[ee("button",sbe,[Be(a,{component:r.component},null,8,["component"])])]),_:1}),r.component.global?(fe(),$t(u,{key:0,"bg-green-400:10":"","text-green-400":"",title:"Registered at runtime as a global component",textContent:"runtime"})):Qt("",!0),Vu(r.$slots,"default"),Z(e)?(fe(),$t(l,{key:1,filepath:Z(e),"text-sm":"",op25:"","group-hover:op75":""},null,8,["filepath"])):Qt("",!0)])}}}),lbe={pl4:""},cbe=Gi({__name:"ComponentsList",props:{components:{}},setup(t){const i=t,e=Sa(""),r=rn(()=>new yk(i.components,{keys:["pascalName","filePath","kebabName"]})),n=rn(()=>{const a=[],o=new Map,s=[],u=[],l={user:0,lib:0,builtin:0,runtime:0};return(e.value?r.value.search(e.value).map(h=>h.item):i.components).forEach(h=>{if(h.filePath&&mk(h.filePath)){const d=$k(h.filePath);if(!d)return;d==="nuxt"?(s.push(h),l.builtin++):(o.has(d)||o.set(d,[]),o.get(d).push(h),l.lib++)}else h.global&&!h.filePath?(u.push(h),l.runtime++):(a.push(h),l.user++)}),{count:l,user:a,builtin:s,lib:o,runtime:u}});return(a,o)=>{const s=m_,u=ube,l=xk,c=Pk;return fe(),lt(Vr,null,[Be(s,{search:Z(e),"onUpdate:search":o[0]||(o[0]=h=>pi(e)?e.value=h:null)},{actions:qe(()=>[Vu(a.$slots,"default")]),_:3},8,["search"]),Z(n).user.length?(fe(),$t(l,{key:0,icon:"carbon-nominal",text:"User components",open:Z(n).user.length<=("DETAILS_MAX_ITEMS"in a?a.DETAILS_MAX_ITEMS:Z(jl)),description:`Total components: ${Z(n).count.user}`},{default:qe(()=>[(fe(!0),lt(Vr,null,ga(Z(n).user,h=>(fe(),$t(u,{key:h.filePath,component:h},null,8,["component"]))),128))]),_:1},8,["open","description"])):Qt("",!0),Z(n).runtime.length?(fe(),$t(l,{key:1,icon:"carbon-load-balancer-global",open:Z(n).runtime.length<=("DETAILS_MAX_ITEMS"in a?a.DETAILS_MAX_ITEMS:Z(jl)),text:"Runtime components",description:`Total components: ${Z(n).count.runtime}`},{default:qe(()=>[(fe(!0),lt(Vr,null,ga(Z(n).runtime,h=>(fe(),$t(u,{key:h.filePath,component:h},null,8,["component"]))),128))]),_:1},8,["open","description"])):Qt("",!0),Z(n).builtin.length?(fe(),$t(l,{key:2,icon:"simple-icons-nuxtdotjs",text:"Built-in components",description:`Total components: ${Z(n).count.builtin}`},{default:qe(()=>[(fe(!0),lt(Vr,null,ga(Z(n).builtin,h=>(fe(),$t(u,{key:h.filePath,component:h},null,8,["component"]))),128))]),_:1},8,["description"])):Qt("",!0),Z(n).lib.size?(fe(),$t(l,{key:3,open:Z(n).count.lib<=("DETAILS_MAX_ITEMS"in a?a.DETAILS_MAX_ITEMS:Z(jl)),icon:"carbon-3d-mpr-toggle",text:"Components from libraries",description:`${Z(n).count.lib} components from ${Z(n).lib.size} packages`},{default:qe(()=>[(fe(!0),lt(Vr,null,ga(Z(n).lib.entries(),([h,d])=>(fe(),lt("div",{key:h,"ml-2":""},[Be(c,{text:`${h} (${d.length})`,py1:"",op50:""},null,8,["text"]),ee("div",lbe,[(fe(!0),lt(Vr,null,ga(d,f=>(fe(),$t(u,{key:f.filePath,component:f},null,8,["component"]))),128))])]))),128))]),_:1},8,["open","description"])):Qt("",!0)],64)}}}),hbe={relative:"","h-full":"","of-auto":""},dbe={"flex-none":"",flex:"~ gap3"},Sbe=Gi({__name:"components",setup(t){const i=bk(),e=Sk(),{componentsView:r}=y_();function n(){i.value?.inspector?.instance&&i.value.inspector.enable()}function a(){r.value=r.value==="list"?"graph":"list"}return(o,s)=>{const u=g_,l=Dk,c=_k;return fe(),lt(Vr,null,[ee("div",hbe,[(fe(),$t(wk(Z(r)==="list"?cbe:abe),{components:Z(e)},{default:qe(()=>[ee("div",dbe,[Be(u,{"text-lg":"",icon:Z(r)==="graph"?"i-carbon-list":"i-carbon-network-4",title:"Toggle view",onClick:a},null,8,["icon"]),Z(i)?.inspector?.instance?(fe(),$t(u,{key:0,"text-lg":"",icon:"i-tabler-focus-2",title:"Inspect Vue components",onClick:n})):Qt("",!0)])]),_:1},8,["components"]))]),Be(c,null,{default:qe(()=>[Be(l)]),_:1})],64)}}});export{Sbe as default};