orbitchat 3.10.7 → 3.10.9

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 (95) hide show
  1. package/LICENSE +201 -0
  2. package/dist/assets/ChartRenderer-Cbyse7LH.js +105 -0
  3. package/dist/assets/MermaidRenderer-yw6DgH3b.js +312 -0
  4. package/dist/assets/MusicRenderer-BSZsjBll.js +18 -0
  5. package/dist/assets/SVGRenderer-DfMpobkd.js +6 -0
  6. package/dist/assets/architectureDiagram-3BPJPVTR-e2_vf6sQ.js +36 -0
  7. package/dist/assets/blockDiagram-GPEHLZMM-SCn-DUpY.js +132 -0
  8. package/dist/assets/{c4Diagram-LMCZKHZV-BUftbNWY.js → c4Diagram-AAUBKEIU-CD0XXb4K.js} +2 -2
  9. package/dist/assets/channel-zV0lWbMa.js +1 -0
  10. package/dist/assets/{chunk-VR4S4FIN-uT68_7rT.js → chunk-2J33WTMH-D1ecF70l.js} +1 -1
  11. package/dist/assets/{chunk-JWPE2WC7-BjHi_aEM.js → chunk-4BX2VUAB-BdC2_BbM.js} +1 -1
  12. package/dist/assets/{chunk-XXDRQBXY-BrvJt-u-.js → chunk-55IACEB6-EK7W6T2M.js} +1 -1
  13. package/dist/assets/{chunk-V7JOEXUC-hSR6fEWT.js → chunk-727SXJPM-CcXyDAeg.js} +4 -4
  14. package/dist/assets/chunk-AQP2D5EJ-DW6XiznW.js +231 -0
  15. package/dist/assets/{chunk-5VM5RSS4-CQacO1HV.js → chunk-FMBD7UC4-CPehXR20.js} +1 -1
  16. package/dist/assets/{chunk-32BRIVSS-DnDG740s.js → chunk-ND2GUHAM-CSSdlZau.js} +1 -1
  17. package/dist/assets/{chunk-2Q5K7J3B-CdU2Q6YZ.js → chunk-QZHKN3VN-DqF1rB9S.js} +1 -1
  18. package/dist/assets/classDiagram-4FO5ZUOK-CcqSZVcR.js +1 -0
  19. package/dist/assets/classDiagram-v2-Q7XG4LA2-CcqSZVcR.js +1 -0
  20. package/dist/assets/cose-bilkent-S5V4N54A-eZksLHnB.js +1 -0
  21. package/dist/assets/{cynefin-VYW2F7L2-CyM6ijR6.js → cynefin-VYW2F7L2-CPNTSJVR.js} +1 -1
  22. package/dist/assets/dagre-BM42HDAG-28cMnF2H.js +4 -0
  23. package/dist/assets/diagram-2AECGRRQ-BO7iijXf.js +43 -0
  24. package/dist/assets/diagram-5GNKFQAL-DomATWxv.js +10 -0
  25. package/dist/assets/{diagram-FQU43EPY-IlESJ0wh.js → diagram-KO2AKTUF-PtoEeRz1.js} +3 -3
  26. package/dist/assets/diagram-LMA3HP47-CASxB1FB.js +24 -0
  27. package/dist/assets/diagram-OG6HWLK6-CyXBWSCx.js +24 -0
  28. package/dist/assets/erDiagram-TEJ5UH35-BsN2y1Xk.js +85 -0
  29. package/dist/assets/flowDiagram-I6XJVG4X-Cq2OCvg1.js +162 -0
  30. package/dist/assets/ganttDiagram-6RSMTGT7-jqEV7dNL.js +292 -0
  31. package/dist/assets/gitGraphDiagram-PVQCEYII-CZV87DUI.js +106 -0
  32. package/dist/assets/{graph-C9eacEi8.js → graph-CAnANduQ.js} +1 -1
  33. package/dist/assets/graphExportUtils-DrqBjeAI.js +1 -0
  34. package/dist/assets/index-ADlI5-NQ.css +1 -0
  35. package/dist/assets/{index-DfypiZL2.js → index-DJM2KXCF.js} +3 -3
  36. package/dist/assets/infoDiagram-5YYISTIA-BTT1LXE4.js +2 -0
  37. package/dist/assets/{ishikawaDiagram-FXEZZL3T-BEPnPebm.js → ishikawaDiagram-YF4QCWOH-D9KfSIa7.js} +5 -5
  38. package/dist/assets/{journeyDiagram-5HDEW3XC-B3Sx5g-O.js → journeyDiagram-JHISSGLW-tDXNol4d.js} +2 -2
  39. package/dist/assets/{kanban-definition-HUTT4EX6-BZwqoKM8.js → kanban-definition-UN3LZRKU-DBwlSBF_.js} +6 -6
  40. package/dist/assets/layout-DGIYPm2g.js +1 -0
  41. package/dist/assets/{mindmap-definition-LN4V7U3C-CyjRWos4.js → mindmap-definition-RKZ34NQL-DnqCIXkX.js} +10 -10
  42. package/dist/assets/pieDiagram-4H26LBE5-C4OTftBM.js +30 -0
  43. package/dist/assets/{quadrantDiagram-ABIIQ3AL-DW4gRbec.js → quadrantDiagram-W4KKPZXB-CAZOzJOz.js} +3 -3
  44. package/dist/assets/{requirementDiagram-TGXJPOKE-D898qBnU.js → requirementDiagram-4Y6WPE33-Ji0UfPIj.js} +2 -2
  45. package/dist/assets/sankeyDiagram-5OEKKPKP-Bw7GXHmh.js +40 -0
  46. package/dist/assets/sequenceDiagram-3UESZ5HK-m5wt325o.js +162 -0
  47. package/dist/assets/stateDiagram-AJRCARHV-BkfQ-aKY.js +1 -0
  48. package/dist/assets/stateDiagram-v2-BHNVJYJU-CrYKygqF.js +1 -0
  49. package/dist/assets/{timeline-definition-FHXFAJF6-CgFiawCT.js → timeline-definition-PNZ67QCA-f8uHcy4Y.js} +4 -4
  50. package/dist/assets/vennDiagram-CIIHVFJN-CuKQ09R1.js +34 -0
  51. package/dist/assets/{wardleyDiagram-EHGQE667-CtRzQ3q6.js → wardleyDiagram-YWT4CUSO-iQQlbl48.js} +4 -4
  52. package/dist/assets/xychartDiagram-2RQKCTM6-B4vp4-Xh.js +7 -0
  53. package/dist/index.html +2 -2
  54. package/package.json +2 -2
  55. package/dist/assets/ChartRenderer-9FnwPEBX.js +0 -105
  56. package/dist/assets/MermaidRenderer-CnzIvTlj.js +0 -317
  57. package/dist/assets/MusicRenderer-fgx5dq-k.js +0 -18
  58. package/dist/assets/SVGRenderer-CZNFFAA_.js +0 -6
  59. package/dist/assets/abnfDiagram-VRR7QNED-DChuAW5u.js +0 -1
  60. package/dist/assets/architectureDiagram-ZJ3FMSHR-DHJZWJhu.js +0 -36
  61. package/dist/assets/blockDiagram-677ZJIJ3-H_CNYF5m.js +0 -132
  62. package/dist/assets/channel-Cfw3OpIn.js +0 -1
  63. package/dist/assets/chunk-EX3LRPZG-Bq0HhB2B.js +0 -231
  64. package/dist/assets/chunk-MOJQB5TN-D2zfH4wm.js +0 -88
  65. package/dist/assets/chunk-RYQCIY6F-DSJh0d2F.js +0 -1
  66. package/dist/assets/classDiagram-OUVF2IWQ-BkFPBJiF.js +0 -1
  67. package/dist/assets/classDiagram-v2-EOCWNBFH-BkFPBJiF.js +0 -1
  68. package/dist/assets/cose-bilkent-JH36ORCC-C0vhiJLV.js +0 -1
  69. package/dist/assets/cynefinDiagram-TSTJHNR4-MevACWGH.js +0 -62
  70. package/dist/assets/dagre-VKFMJZFB-BqR7tzk8.js +0 -4
  71. package/dist/assets/diagram-G47NLZAW-Bqjk3ZYu.js +0 -24
  72. package/dist/assets/diagram-NH7WQ7WH-B63W-pyC.js +0 -24
  73. package/dist/assets/diagram-OA4YK3LP-B0THRF0G.js +0 -30
  74. package/dist/assets/diagram-WEI45ONY-IZZ69bsz.js +0 -41
  75. package/dist/assets/ebnfDiagram-CCIWWBDH-B_U7c6VT.js +0 -1
  76. package/dist/assets/erDiagram-Q63AITRT-oGWxlmE8.js +0 -85
  77. package/dist/assets/flowDiagram-23GEKE2U-0scCMi71.js +0 -156
  78. package/dist/assets/ganttDiagram-NO4QXBWP-DIS-iO_q.js +0 -292
  79. package/dist/assets/gitGraphDiagram-IHSO6WYX-DsT87XU7.js +0 -106
  80. package/dist/assets/index-DqIwGcah.css +0 -1
  81. package/dist/assets/infoDiagram-FWYZ7A6U-CkLm2oOh.js +0 -2
  82. package/dist/assets/layout-DEXfKzaS.js +0 -1
  83. package/dist/assets/map-Czzmt4hB.js +0 -1
  84. package/dist/assets/pegDiagram-2B236MQR-DItVX4G3.js +0 -1
  85. package/dist/assets/pieDiagram-ENE6RG2P-CTRyME0H.js +0 -39
  86. package/dist/assets/railroadDiagram-RFXS5EU6-_rBw9Q9b.js +0 -1
  87. package/dist/assets/sankeyDiagram-HTMAVEWB-doAkRLNI.js +0 -40
  88. package/dist/assets/sequenceDiagram-DBY2YBRQ-D4HUsfB2.js +0 -162
  89. package/dist/assets/sizeCapture-X5ZJPWSS-DJJLR6R7.js +0 -1
  90. package/dist/assets/stateDiagram-2N3HPSRC-0IOXcLaP.js +0 -1
  91. package/dist/assets/stateDiagram-v2-6OUMAXLB-BjcuRalB.js +0 -1
  92. package/dist/assets/swimlanes-5IMT3BWC-HIPL1mdx.js +0 -2
  93. package/dist/assets/swimlanesDiagram-G3AALYLV-usVEFD6y.js +0 -8
  94. package/dist/assets/vennDiagram-L72KCM5P-DiY3ySIT.js +0 -34
  95. package/dist/assets/xychartDiagram-FW5EYKEG-OjszPLMV.js +0 -7
@@ -1,18 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C0slAIYD.js","assets/vendor-markdown-BRX1CUPf.js"])))=>i.map(i=>d[i]);
2
- import{_ as A}from"./vendor-syntax-DG6Vo7Ci.js";import{r as n,j as e}from"./vendor-markdown-BRX1CUPf.js";let u=null;const E=async()=>{if(typeof window>"u")throw new Error("abcjs requires a browser environment");if(u)return u;try{const t=await A(()=>import("./index-C0slAIYD.js").then(a=>a.i),__vite__mapDeps([0,1])),r=t.default||t;if(!r)throw new Error("abcjs module is empty");if(typeof r.renderAbc!="function")throw new Error(`renderAbc is not a function. Available methods: ${Object.keys(r).join(", ")}`);return u=r,u}catch(t){const r=window;if(typeof window<"u"&&r.ABCJS)return u=r.ABCJS,u;const a=t instanceof Error?t.message:"Failed to load abcjs";throw new Error(`Failed to load abcjs: ${a}`)}},R=t=>{const r=t.trim();return/^[XMTLK]:/m.test(r)||/^X:\d+/m.test(r)},S=t=>{const r=t.trim();if(!r.includes("X:")||!/^K:/m.test(r))return!0;const i=r.split(`
3
- `),s=i[i.length-1].trim();return!!(s.match(/^[A-Z]:?\s*$/)&&s.length<3||s.endsWith("|")&&!s.endsWith("|]")&&!s.endsWith("||")&&s.replace(/\|/g,"").trim().length<2)},B=({code:t})=>{const r=n.useRef(null),[a,i]=n.useState(null),[s,c]=n.useState(!0),[l,f]=n.useState(!1),[p,j]=n.useState(!1),[x,k]=n.useState(!1),b=n.useRef(""),w=n.useRef(0),m=n.useRef(null);return n.useEffect(()=>{const g=t.trim();if(!g)return;const o=Date.now(),d=o-w.current,y=t!==b.current;b.current=t,w.current=o;const h=S(g),C=y&&d<500&&d>0,v=h||C;if(h){setTimeout(()=>{f(!0),c(!0),i(null)},0);return}R(t)?setTimeout(()=>{j(!0),i(null),v&&f(!0)},0):setTimeout(()=>{j(!1),v?(f(!0),i(null)):(i("Unable to detect ABC notation. Expected ABC notation starting with headers like X:, T:, M:, L:, or K:"),c(!1),f(!1))},0)},[t]),n.useEffect(()=>!p||!t.trim()?void 0:(l&&(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{f(!1)},400)),(async()=>{try{c(!0);let o=0;const d=10;for(;!r.current&&o<d;)await new Promise(h=>setTimeout(h,50)),o++;if(!r.current)throw new Error("Container element not found after waiting");const y=await E();r.current.innerHTML="",y.renderAbc(r.current,t,{responsive:"resize",staffwidth:740,paddingleft:0,paddingright:0,paddingtop:15,paddingbottom:15,scale:1}),i(null),c(!1)}catch(o){const d=o instanceof Error?o.message:"Failed to render ABC notation";i(d),c(!1)}})(),()=>{m.current&&clearTimeout(m.current)}),[t,p,l]),t.trim()?a?e.jsxs("div",{className:"graph-error",children:[e.jsxs("div",{className:"graph-error-header",children:[e.jsx("div",{className:"graph-error-icon",children:"⚠️"}),e.jsxs("div",{className:"graph-error-content",children:[e.jsx("div",{className:"graph-error-title",children:"ABC Notation Rendering Error"}),e.jsx("div",{className:"graph-error-message",children:a})]})]}),e.jsxs("button",{className:"graph-error-toggle",onClick:()=>k(!x),type:"button",children:[x?"Hide":"Show"," Details"]}),x&&e.jsxs("details",{className:"graph-error-details",open:!0,children:[e.jsx("summary",{style:{cursor:"pointer",marginBottom:"8px",fontWeight:500},children:"ABC Notation Code"}),e.jsx("pre",{style:{marginTop:"8px",fontSize:"0.8em",opacity:.8,padding:"8px",background:"rgba(0, 0, 0, 0.05)",borderRadius:"4px",overflow:"auto",maxHeight:"200px"},children:e.jsx("code",{children:t})})]})]}):(s||l)&&!p?e.jsx("div",{className:"graph-container music-container abc-container",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"30px 20px",color:"var(--md-text-secondary, #6b7280)",minHeight:"120px"},children:[e.jsx("svg",{style:{animation:"spin 1s linear infinite",marginBottom:"10px",width:"28px",height:"28px"},viewBox:"0 0 24 24",fill:"none",children:e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"32",strokeLinecap:"round"})}),e.jsx("span",{style:{fontWeight:500,fontSize:"14px"},children:l?"Receiving music notation...":"Loading music notation..."}),e.jsx("style",{children:`
4
- @keyframes spin {
5
- from { transform: rotate(0deg); }
6
- to { transform: rotate(360deg); }
7
- }
8
- `})]})}):p?e.jsxs("div",{className:"graph-container music-container abc-container",style:{padding:"16px",position:"relative"},children:[l&&e.jsxs("div",{style:{position:"absolute",top:"8px",right:"8px",display:"flex",alignItems:"center",padding:"4px 8px",backgroundColor:"rgba(59, 130, 246, 0.1)",borderRadius:"4px",fontSize:"12px",color:"#3b82f6",zIndex:10},children:[e.jsx("svg",{style:{animation:"spin 1s linear infinite",marginRight:"4px",width:"12px",height:"12px"},viewBox:"0 0 24 24",fill:"none",children:e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"32",strokeLinecap:"round"})}),"Updating...",e.jsx("style",{children:`
9
- @keyframes spin {
10
- from { transform: rotate(0deg); }
11
- to { transform: rotate(360deg); }
12
- }
13
- `})]}),s&&!l&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"20px",color:"var(--md-text-secondary, #6b7280)",minHeight:"80px"},children:[e.jsx("svg",{style:{animation:"spin 1s linear infinite",marginBottom:"8px",width:"24px",height:"24px"},viewBox:"0 0 24 24",fill:"none",children:e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"32",strokeLinecap:"round"})}),e.jsx("span",{style:{fontSize:"13px"},children:"Rendering notation..."}),e.jsx("style",{children:`
14
- @keyframes spin {
15
- from { transform: rotate(0deg); }
16
- to { transform: rotate(360deg); }
17
- }
18
- `})]}),e.jsx("div",{ref:r,style:{display:"flex",justifyContent:"center",overflow:"auto"}})]}):null:null};export{B as MusicRenderer};
@@ -1,6 +0,0 @@
1
- import{r as a,j as e}from"./vendor-markdown-BRX1CUPf.js";import{p as T}from"./purify.es-D6gMnemd.js";const w=["svg","g","defs","symbol","use","switch","desc","title","metadata","path","circle","ellipse","rect","line","polyline","polygon","text","tspan","textPath","linearGradient","radialGradient","stop","pattern","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","clipPath","mask","marker","animate","animateTransform","animateMotion","set","mpath","image","foreignObject"],b=["id","class","style","lang","tabindex","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","viewBox","preserveAspectRatio","d","pathLength","transform","transform-origin","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","opacity","visibility","display","color","color-interpolation","color-interpolation-filters","font-family","font-size","font-style","font-weight","font-variant","text-anchor","dominant-baseline","alignment-baseline","baseline-shift","letter-spacing","word-spacing","text-decoration","writing-mode","dx","dy","rotate","textLength","lengthAdjust","gradientUnits","gradientTransform","spreadMethod","offset","stop-color","stop-opacity","patternUnits","patternContentUnits","patternTransform","filterUnits","primitiveUnits","in","in2","result","stdDeviation","type","values","mode","operator","k1","k2","k3","k4","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","order","divisor","bias","targetX","targetY","edgeMode","kernelUnitLength","preserveAlpha","baseFrequency","numOctaves","seed","stitchTiles","scale","xChannelSelector","yChannelSelector","clipPathUnits","clip-path","clip-rule","mask","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","orient","refX","refY","marker-start","marker-mid","marker-end","href","xlink:href","xmlns","xmlns:xlink","version","points","overflow","vector-effect","attributeName","attributeType","begin","dur","end","min","max","restart","repeatCount","repeatDur","calcMode","keyTimes","keySplines","from","to","by","additive","accumulate"],j=r=>{const i=r.trim();if(i.includes("<svg")&&!i.includes("</svg>"))return!0;const d=(i.match(/<[a-zA-Z][^/>]*>/g)||[]).length,t=(i.match(/<\/[a-zA-Z][^>]*>/g)||[]).length,n=(i.match(/<[a-zA-Z][^>]*\/>/g)||[]).length;return!!(d>t+n||i.match(/\s+\w+\s*=\s*["'][^"']*$/)||i.match(/<[a-zA-Z][^>]*$/))},A=r=>{const t=new DOMParser().parseFromString(r,"image/svg+xml").querySelector("svg");if(!t)return r;const n=t.getAttribute("width"),l=t.getAttribute("height"),o=t.getAttribute("viewBox");if(n&&l&&!o){const c=parseFloat(n)||100,f=parseFloat(l)||100;t.setAttribute("viewBox",`0 0 ${c} ${f}`)}return t.style.maxWidth||(t.style.maxWidth="100%"),t.style.height||(t.style.height="auto"),t.outerHTML},C=({code:r})=>{const[i,d]=a.useState(null),[t,n]=a.useState(null),[l,o]=a.useState(!1),[c,f]=a.useState(!1),p=a.useRef(""),m=a.useRef(0);return a.useEffect(()=>{const g=r.trim();if(!g)return;const h=Date.now(),u=h-m.current,y=r!==p.current;p.current=r,m.current=h;const x=j(g),v=y&&u<500&&u>0,S=x||v;if(x){setTimeout(()=>{o(!0)},0);return}try{const s=T.sanitize(r,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:w,ADD_ATTR:b,ALLOW_DATA_ATTR:!1,FORBID_TAGS:["script","iframe","object","embed"],FORBID_ATTR:["onload","onerror","onclick","onmouseover"]});if(!s||s.trim().length===0)throw new Error("SVG sanitization resulted in empty content");if(!s.includes("<svg"))throw new Error("Content does not appear to be valid SVG");const k=A(s);setTimeout(()=>{d(k),n(null),o(!1)},0)}catch(s){setTimeout(S?()=>{o(!0),n(null)}:()=>{n(s instanceof Error?s.message:"Failed to process SVG"),o(!1)},0)}},[r]),r.trim()?t?e.jsxs("div",{className:"graph-error",children:[e.jsxs("div",{className:"graph-error-header",children:[e.jsx("div",{className:"graph-error-icon",children:"⚠️"}),e.jsxs("div",{className:"graph-error-content",children:[e.jsx("div",{className:"graph-error-title",children:"SVG Rendering Error"}),e.jsx("div",{className:"graph-error-message",children:t})]})]}),e.jsxs("button",{className:"graph-error-toggle",onClick:()=>f(!c),type:"button",children:[c?"Hide":"Show"," Details"]}),c&&e.jsx("pre",{style:{marginTop:"8px",fontSize:"0.8em",opacity:.8,padding:"8px",background:"rgba(0, 0, 0, 0.05)",borderRadius:"4px",overflow:"auto",maxHeight:"200px"},children:e.jsx("code",{children:r})})]}):!i||l?e.jsx("div",{className:"graph-container svg-container",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"30px 20px",color:"var(--md-text-secondary, #6b7280)",minHeight:"120px"},children:[e.jsx("svg",{style:{animation:"spin 1s linear infinite",marginBottom:"10px",width:"28px",height:"28px"},viewBox:"0 0 24 24",fill:"none",children:e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"32",strokeLinecap:"round"})}),e.jsx("span",{style:{fontWeight:500,fontSize:"14px"},children:l?"Receiving SVG data...":"Processing SVG..."}),e.jsx("style",{children:`
2
- @keyframes spin {
3
- from { transform: rotate(0deg); }
4
- to { transform: rotate(360deg); }
5
- }
6
- `})]})}):e.jsx("div",{className:"graph-container svg-container",style:{padding:"16px",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsx("div",{dangerouslySetInnerHTML:{__html:i},style:{display:"flex",justifyContent:"center",alignItems:"center",maxWidth:"100%",overflow:"auto"}})}):null};export{C as SVGRenderer};
@@ -1 +0,0 @@
1
- import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-D2zfH4wm.js";import{p as f}from"./chunk-JWPE2WC7-BjHi_aEM.js";import{_ as n,l as o}from"./MermaidRenderer-CnzIvTlj.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-CyM6ijR6.js";import"./vendor-markdown-BRX1CUPf.js";import"./vendor-syntax-DG6Vo7Ci.js";import"./purify.es-D6gMnemd.js";import"./isPrototype-DezZrpQP.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),m=t?parseInt(t,10):0,l=s?parseInt(s,10):1/0;return{min:m,max:l}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},C={parser:R,db:a,renderer:u,styles:p};export{C as diagram};
@@ -1,36 +0,0 @@
1
- import{p as Ze}from"./chunk-JWPE2WC7-BjHi_aEM.js";import{_ as gt,D as qe,U as Qe,l as Fe,b as Je,a as Ke,n as je,o as _e,g as tr,s as er,p as rr,A as ir,y as ar,B as nr,c as Ee,ak as Te,a1 as pe,i as or,d as sr,q as hr,a2 as lr,ar as fr}from"./MermaidRenderer-CnzIvTlj.js";import{p as cr}from"./cynefin-VYW2F7L2-CyM6ijR6.js";import{c as be}from"./cytoscape.esm-DTSO7Bv0.js";import{g as gr}from"./vendor-markdown-BRX1CUPf.js";import"./vendor-syntax-DG6Vo7Ci.js";import"./purify.es-D6gMnemd.js";import"./isPrototype-DezZrpQP.js";var he={exports:{}},le={exports:{}},fe={exports:{}},ur=fe.exports,Oe;function dr(){return Oe||(Oe=1,(function(I,M){(function(x,N){I.exports=N()})(ur,function(){return(function(w){var x={};function N(d){if(x[d])return x[d].exports;var l=x[d]={i:d,l:!1,exports:{}};return w[d].call(l.exports,l,l.exports,N),l.l=!0,l.exports}return N.m=w,N.c=x,N.i=function(d){return d},N.d=function(d,l,a){N.o(d,l)||Object.defineProperty(d,l,{configurable:!1,enumerable:!0,get:a})},N.n=function(d){var l=d&&d.__esModule?function(){return d.default}:function(){return d};return N.d(l,"a",l),l},N.o=function(d,l){return Object.prototype.hasOwnProperty.call(d,l)},N.p="",N(N.s=28)})([(function(w,x,N){function d(){}d.QUALITY=1,d.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,d.DEFAULT_INCREMENTAL=!1,d.DEFAULT_ANIMATION_ON_LAYOUT=!0,d.DEFAULT_ANIMATION_DURING_LAYOUT=!1,d.DEFAULT_ANIMATION_PERIOD=50,d.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,d.DEFAULT_GRAPH_MARGIN=15,d.NODE_DIMENSIONS_INCLUDE_LABELS=!1,d.SIMPLE_NODE_SIZE=40,d.SIMPLE_NODE_HALF_SIZE=d.SIMPLE_NODE_SIZE/2,d.EMPTY_COMPOUND_NODE_SIZE=40,d.MIN_EDGE_LENGTH=1,d.WORLD_BOUNDARY=1e6,d.INITIAL_WORLD_BOUNDARY=d.WORLD_BOUNDARY/1e3,d.WORLD_CENTER_X=1200,d.WORLD_CENTER_Y=900,w.exports=d}),(function(w,x,N){var d=N(2),l=N(8),a=N(9);function r(f,e,g){d.call(this,g),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=g,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(d.prototype);for(var i in d)r[i]=d[i];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var g=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(g.getOwner()==e)return g;if(g.getOwner()==t)break;g=g.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},w.exports=r}),(function(w,x,N){function d(l){this.vGraphObject=l}w.exports=d}),(function(w,x,N){var d=N(2),l=N(10),a=N(13),r=N(0),i=N(16),f=N(5);function e(t,s,o,c){o==null&&c==null&&(c=s),d.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new a(s.x,s.y,o.width,o.height):this.rect=new a}e.prototype=Object.create(d.prototype);for(var g in d)e[g]=d[g];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},e.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},e.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},e.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},e.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},e.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},e.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},e.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),h=0;h<c.length;h++)s=c[h],o=s.withChildren(),o.forEach(function(T){t.add(T)});return t},e.prototype.getNoOfChildren=function(){var t=0,s;if(this.child==null)t=1;else for(var o=this.child.getNodes(),c=0;c<o.length;c++)s=o[c],t+=s.getNoOfChildren();return t==0&&(t=1),t},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},e.prototype.scatter=function(){var t,s,o=-r.INITIAL_WORLD_BOUNDARY,c=r.INITIAL_WORLD_BOUNDARY;t=r.WORLD_CENTER_X+i.nextDouble()*(c-o)+o;var h=-r.INITIAL_WORLD_BOUNDARY,T=r.INITIAL_WORLD_BOUNDARY;s=r.WORLD_CENTER_Y+i.nextDouble()*(T-h)+h,this.rect.x=t,this.rect.y=s},e.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),r.NODE_DIMENSIONS_INCLUDE_LABELS){var s=t.getRight()-t.getLeft(),o=t.getBottom()-t.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(s+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>s?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),h=t.inverseTransformPoint(c);this.setLocation(h.x,h.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},w.exports=e}),(function(w,x,N){var d=N(0);function l(){}for(var a in d)l[a]=d[a];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,l.COOLING_ADAPTATION_FACTOR=.33,l.ADAPTATION_LOWER_NODE_LIMIT=1e3,l.ADAPTATION_UPPER_NODE_LIMIT=5e3,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,w.exports=l}),(function(w,x,N){function d(l,a){l==null&&a==null?(this.x=0,this.y=0):(this.x=l,this.y=a)}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.setX=function(l){this.x=l},d.prototype.setY=function(l){this.y=l},d.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},d.prototype.getCopy=function(){return new d(this.x,this.y)},d.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},w.exports=d}),(function(w,x,N){var d=N(2),l=N(10),a=N(0),r=N(7),i=N(3),f=N(1),e=N(13),g=N(12),t=N(11);function s(c,h,T){d.call(this,T),this.estimatedSize=l.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,h!=null&&h instanceof r?this.graphManager=h:h!=null&&h instanceof Layout&&(this.graphManager=h.graphManager)}s.prototype=Object.create(d.prototype);for(var o in d)s[o]=d[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,h,T){if(h==null&&T==null){var u=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var v=c;if(!(this.getNodes().indexOf(h)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(h.owner==T.owner&&h.owner==this))throw"Both owners must be this graph!";return h.owner!=T.owner?null:(v.source=h,v.target=T,v.isInterGraph=!1,this.getEdges().push(v),h.edges.push(v),T!=h&&T.edges.push(v),v)}},s.prototype.remove=function(c){var h=c;if(c instanceof i){if(h==null)throw"Node is null!";if(!(h.owner!=null&&h.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=h.edges.slice(),u,v=T.length,L=0;L<v;L++)u=T[L],u.isInterGraph?this.graphManager.remove(u):u.source.owner.remove(u);var P=this.nodes.indexOf(h);if(P==-1)throw"Node not in owner node list!";this.nodes.splice(P,1)}else if(c instanceof f){var u=c;if(u==null)throw"Edge is null!";if(!(u.source!=null&&u.target!=null))throw"Source and/or target is null!";if(!(u.source.owner!=null&&u.target.owner!=null&&u.source.owner==this&&u.target.owner==this))throw"Source and/or target owner is invalid!";var C=u.source.edges.indexOf(u),G=u.target.edges.indexOf(u);if(!(C>-1&&G>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(C,1),u.target!=u.source&&u.target.edges.splice(G,1);var P=u.source.owner.getEdges().indexOf(u);if(P==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(P,1)}},s.prototype.updateLeftTop=function(){for(var c=l.MAX_VALUE,h=l.MAX_VALUE,T,u,v,L=this.getNodes(),P=L.length,C=0;C<P;C++){var G=L[C];T=G.getTop(),u=G.getLeft(),c>T&&(c=T),h>u&&(h=u)}return c==l.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?v=L[0].getParent().paddingLeft:v=this.margin,this.left=h-v,this.top=c-v,new g(this.left,this.top))},s.prototype.updateBounds=function(c){for(var h=l.MAX_VALUE,T=-l.MAX_VALUE,u=l.MAX_VALUE,v=-l.MAX_VALUE,L,P,C,G,V,Y=this.nodes,$=Y.length,A=0;A<$;A++){var j=Y[A];c&&j.child!=null&&j.updateBounds(),L=j.getLeft(),P=j.getRight(),C=j.getTop(),G=j.getBottom(),h>L&&(h=L),T<P&&(T=P),u>C&&(u=C),v<G&&(v=G)}var n=new e(h,u,T-h,v-u);h==l.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),Y[0].getParent().paddingLeft!=null?V=Y[0].getParent().paddingLeft:V=this.margin,this.left=n.x-V,this.right=n.x+n.width+V,this.top=n.y-V,this.bottom=n.y+n.height+V},s.calculateBounds=function(c){for(var h=l.MAX_VALUE,T=-l.MAX_VALUE,u=l.MAX_VALUE,v=-l.MAX_VALUE,L,P,C,G,V=c.length,Y=0;Y<V;Y++){var $=c[Y];L=$.getLeft(),P=$.getRight(),C=$.getTop(),G=$.getBottom(),h>L&&(h=L),T<P&&(T=P),u>C&&(u=C),v<G&&(v=G)}var A=new e(h,u,T-h,v-u);return A},s.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},s.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},s.prototype.calcEstimatedSize=function(){for(var c=0,h=this.nodes,T=h.length,u=0;u<T;u++){var v=h[u];c+=v.calcEstimatedSize()}return c==0?this.estimatedSize=a.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=c/Math.sqrt(this.nodes.length),this.estimatedSize},s.prototype.updateConnected=function(){var c=this;if(this.nodes.length==0){this.isConnected=!0;return}var h=new t,T=new Set,u=this.nodes[0],v,L,P=u.withChildren();for(P.forEach(function(A){h.push(A),T.add(A)});h.length!==0;){u=h.shift(),v=u.getEdges();for(var C=v.length,G=0;G<C;G++){var V=v[G];if(L=V.getOtherEndInGraph(u,this),L!=null&&!T.has(L)){var Y=L.withChildren();Y.forEach(function(A){h.push(A),T.add(A)})}}}if(this.isConnected=!1,T.size>=this.nodes.length){var $=0;T.forEach(function(A){A.owner==c&&$++}),$==this.nodes.length&&(this.isConnected=!0)}},w.exports=s}),(function(w,x,N){var d,l=N(1);function a(r){d=N(6),this.layout=r,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var r=this.layout.newGraph(),i=this.layout.newNode(null),f=this.add(r,i);return this.setRootGraph(f),this.rootGraph},a.prototype.add=function(r,i,f,e,g){if(f==null&&e==null&&g==null){if(r==null)throw"Graph is null!";if(i==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(i.child!=null)throw"Already has a child!";return r.parent=i,i.child=r,r}else{g=f,e=i,f=r;var t=e.getOwner(),s=g.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,g);if(f.isInterGraph=!0,f.source=e,f.target=g,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},a.prototype.remove=function(r){if(r instanceof d){var i=r;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(i==this.rootGraph||i.parent!=null&&i.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(i.getEdges());for(var e,g=f.length,t=0;t<g;t++)e=f[t],i.remove(e);var s=[];s=s.concat(i.getNodes());var o;g=s.length;for(var t=0;t<g;t++)o=s[t],i.remove(o);i==this.rootGraph&&this.setRootGraph(null);var c=this.graphs.indexOf(i);this.graphs.splice(c,1),i.parent=null}else if(r instanceof l){if(e=r,e==null)throw"Edge is null!";if(!e.isInterGraph)throw"Not an inter-graph edge!";if(!(e.source!=null&&e.target!=null))throw"Source and/or target is null!";if(!(e.source.edges.indexOf(e)!=-1&&e.target.edges.indexOf(e)!=-1))throw"Source and/or target doesn't know this edge!";var c=e.source.edges.indexOf(e);if(e.source.edges.splice(c,1),c=e.target.edges.indexOf(e),e.target.edges.splice(c,1),!(e.source.owner!=null&&e.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(e.source.owner.getGraphManager().edges.indexOf(e)==-1)throw"Not in owner graph manager's edge list!";var c=e.source.owner.getGraphManager().edges.indexOf(e);e.source.owner.getGraphManager().edges.splice(c,1)}},a.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},a.prototype.getGraphs=function(){return this.graphs},a.prototype.getAllNodes=function(){if(this.allNodes==null){for(var r=[],i=this.getGraphs(),f=i.length,e=0;e<f;e++)r=r.concat(i[e].getNodes());this.allNodes=r}return this.allNodes},a.prototype.resetAllNodes=function(){this.allNodes=null},a.prototype.resetAllEdges=function(){this.allEdges=null},a.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},a.prototype.getAllEdges=function(){if(this.allEdges==null){var r=[],i=this.getGraphs();i.length;for(var f=0;f<i.length;f++)r=r.concat(i[f].getEdges());r=r.concat(this.edges),this.allEdges=r}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(r){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=r},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(r){if(r.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=r,r.parent==null&&(r.parent=this.layout.newNode("Root node"))},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(r,i){if(!(r!=null&&i!=null))throw"assert failed";if(r==i)return!0;var f=r.getOwner(),e;do{if(e=f.getParent(),e==null)break;if(e==i)return!0;if(f=e.getOwner(),f==null)break}while(!0);f=i.getOwner();do{if(e=f.getParent(),e==null)break;if(e==r)return!0;if(f=e.getOwner(),f==null)break}while(!0);return!1},a.prototype.calcLowestCommonAncestors=function(){for(var r,i,f,e,g,t=this.getAllEdges(),s=t.length,o=0;o<s;o++){if(r=t[o],i=r.source,f=r.target,r.lca=null,r.sourceInLca=i,r.targetInLca=f,i==f){r.lca=i.getOwner();continue}for(e=i.getOwner();r.lca==null;){for(r.targetInLca=f,g=f.getOwner();r.lca==null;){if(g==e){r.lca=g;break}if(g==this.rootGraph)break;if(r.lca!=null)throw"assert failed";r.targetInLca=g.getParent(),g=r.targetInLca.getOwner()}if(e==this.rootGraph)break;r.lca==null&&(r.sourceInLca=e.getParent(),e=r.sourceInLca.getOwner())}if(r.lca==null)throw"assert failed"}},a.prototype.calcLowestCommonAncestor=function(r,i){if(r==i)return r.getOwner();var f=r.getOwner();do{if(f==null)break;var e=i.getOwner();do{if(e==null)break;if(e==f)return e;e=e.getParent().getOwner()}while(!0);f=f.getParent().getOwner()}while(!0);return f},a.prototype.calcInclusionTreeDepths=function(r,i){r==null&&i==null&&(r=this.rootGraph,i=1);for(var f,e=r.getNodes(),g=e.length,t=0;t<g;t++)f=e[t],f.inclusionTreeDepth=i,f.child!=null&&this.calcInclusionTreeDepths(f.child,i+1)},a.prototype.includesInvalidEdge=function(){for(var r,i=[],f=this.edges.length,e=0;e<f;e++)r=this.edges[e],this.isOneAncestorOfOther(r.source,r.target)&&i.push(r);for(var e=0;e<i.length;e++)this.remove(i[e]);return!1},w.exports=a}),(function(w,x,N){var d=N(12);function l(){}l.calcSeparationAmount=function(a,r,i,f){if(!a.intersects(r))throw"assert failed";var e=new Array(2);this.decideDirectionsForOverlappingNodes(a,r,e),i[0]=Math.min(a.getRight(),r.getRight())-Math.max(a.x,r.x),i[1]=Math.min(a.getBottom(),r.getBottom())-Math.max(a.y,r.y),a.getX()<=r.getX()&&a.getRight()>=r.getRight()?i[0]+=Math.min(r.getX()-a.getX(),a.getRight()-r.getRight()):r.getX()<=a.getX()&&r.getRight()>=a.getRight()&&(i[0]+=Math.min(a.getX()-r.getX(),r.getRight()-a.getRight())),a.getY()<=r.getY()&&a.getBottom()>=r.getBottom()?i[1]+=Math.min(r.getY()-a.getY(),a.getBottom()-r.getBottom()):r.getY()<=a.getY()&&r.getBottom()>=a.getBottom()&&(i[1]+=Math.min(a.getY()-r.getY(),r.getBottom()-a.getBottom()));var g=Math.abs((r.getCenterY()-a.getCenterY())/(r.getCenterX()-a.getCenterX()));r.getCenterY()===a.getCenterY()&&r.getCenterX()===a.getCenterX()&&(g=1);var t=g*i[0],s=i[1]/g;i[0]<s?s=i[0]:t=i[1],i[0]=-1*e[0]*(s/2+f),i[1]=-1*e[1]*(t/2+f)},l.decideDirectionsForOverlappingNodes=function(a,r,i){a.getCenterX()<r.getCenterX()?i[0]=-1:i[0]=1,a.getCenterY()<r.getCenterY()?i[1]=-1:i[1]=1},l.getIntersection2=function(a,r,i){var f=a.getCenterX(),e=a.getCenterY(),g=r.getCenterX(),t=r.getCenterY();if(a.intersects(r))return i[0]=f,i[1]=e,i[2]=g,i[3]=t,!0;var s=a.getX(),o=a.getY(),c=a.getRight(),h=a.getX(),T=a.getBottom(),u=a.getRight(),v=a.getWidthHalf(),L=a.getHeightHalf(),P=r.getX(),C=r.getY(),G=r.getRight(),V=r.getX(),Y=r.getBottom(),$=r.getRight(),A=r.getWidthHalf(),j=r.getHeightHalf(),n=!1,E=!1;if(f===g){if(e>t)return i[0]=f,i[1]=o,i[2]=g,i[3]=Y,!1;if(e<t)return i[0]=f,i[1]=T,i[2]=g,i[3]=C,!1}else if(e===t){if(f>g)return i[0]=s,i[1]=e,i[2]=G,i[3]=t,!1;if(f<g)return i[0]=c,i[1]=e,i[2]=P,i[3]=t,!1}else{var p=a.height/a.width,m=r.height/r.width,y=(t-e)/(g-f),S=void 0,O=void 0,F=void 0,W=void 0,R=void 0,Q=void 0;if(-p===y?f>g?(i[0]=h,i[1]=T,n=!0):(i[0]=c,i[1]=o,n=!0):p===y&&(f>g?(i[0]=s,i[1]=o,n=!0):(i[0]=u,i[1]=T,n=!0)),-m===y?g>f?(i[2]=V,i[3]=Y,E=!0):(i[2]=G,i[3]=C,E=!0):m===y&&(g>f?(i[2]=P,i[3]=C,E=!0):(i[2]=$,i[3]=Y,E=!0)),n&&E)return!1;if(f>g?e>t?(S=this.getCardinalDirection(p,y,4),O=this.getCardinalDirection(m,y,2)):(S=this.getCardinalDirection(-p,y,3),O=this.getCardinalDirection(-m,y,1)):e>t?(S=this.getCardinalDirection(-p,y,1),O=this.getCardinalDirection(-m,y,3)):(S=this.getCardinalDirection(p,y,2),O=this.getCardinalDirection(m,y,4)),!n)switch(S){case 1:W=o,F=f+-L/y,i[0]=F,i[1]=W;break;case 2:F=u,W=e+v*y,i[0]=F,i[1]=W;break;case 3:W=T,F=f+L/y,i[0]=F,i[1]=W;break;case 4:F=h,W=e+-v*y,i[0]=F,i[1]=W;break}if(!E)switch(O){case 1:Q=C,R=g+-j/y,i[2]=R,i[3]=Q;break;case 2:R=$,Q=t+A*y,i[2]=R,i[3]=Q;break;case 3:Q=Y,R=g+j/y,i[2]=R,i[3]=Q;break;case 4:R=V,Q=t+-A*y,i[2]=R,i[3]=Q;break}}return!1},l.getCardinalDirection=function(a,r,i){return a>r?i:1+i%4},l.getIntersection=function(a,r,i,f){if(f==null)return this.getIntersection2(a,r,i);var e=a.x,g=a.y,t=r.x,s=r.y,o=i.x,c=i.y,h=f.x,T=f.y,u=void 0,v=void 0,L=void 0,P=void 0,C=void 0,G=void 0,V=void 0,Y=void 0,$=void 0;return L=s-g,C=e-t,V=t*g-e*s,P=T-c,G=o-h,Y=h*c-o*T,$=L*G-P*C,$===0?null:(u=(C*Y-G*V)/$,v=(P*V-L*Y)/$,new d(u,v))},l.angleOfVector=function(a,r,i,f){var e=void 0;return a!==i?(e=Math.atan((f-r)/(i-a)),i<a?e+=Math.PI:f<r&&(e+=this.TWO_PI)):f<r?e=this.ONE_AND_HALF_PI:e=this.HALF_PI,e},l.doIntersect=function(a,r,i,f){var e=a.x,g=a.y,t=r.x,s=r.y,o=i.x,c=i.y,h=f.x,T=f.y,u=(t-e)*(T-c)-(h-o)*(s-g);if(u===0)return!1;var v=((T-c)*(h-e)+(o-h)*(T-g))/u,L=((g-s)*(h-e)+(t-e)*(T-g))/u;return 0<v&&v<1&&0<L&&L<1},l.findCircleLineIntersections=function(a,r,i,f,e,g,t){var s=(i-a)*(i-a)+(f-r)*(f-r),o=2*((a-e)*(i-a)+(r-g)*(f-r)),c=(a-e)*(a-e)+(r-g)*(r-g)-t*t,h=o*o-4*s*c;if(h>=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),u=(-o-Math.sqrt(o*o-4*s*c))/(2*s),v=null;return T>=0&&T<=1?[T]:u>=0&&u<=1?[u]:v}else return null},l.HALF_PI=.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,w.exports=l}),(function(w,x,N){function d(){}d.sign=function(l){return l>0?1:l<0?-1:0},d.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},d.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},w.exports=d}),(function(w,x,N){function d(){}d.MAX_VALUE=2147483647,d.MIN_VALUE=-2147483648,w.exports=d}),(function(w,x,N){var d=(function(){function e(g,t){for(var s=0;s<t.length;s++){var o=t[s];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(g,o.key,o)}}return function(g,t,s){return t&&e(g.prototype,t),s&&e(g,s),g}})();function l(e,g){if(!(e instanceof g))throw new TypeError("Cannot call a class as a function")}var a=function(g){return{value:g,next:null,prev:null}},r=function(g,t,s,o){return g!==null?g.next=t:o.head=t,s!==null?s.prev=t:o.tail=t,t.prev=g,t.next=s,o.length++,t},i=function(g,t){var s=g.prev,o=g.next;return s!==null?s.next=o:t.head=o,o!==null?o.prev=s:t.tail=s,g.prev=g.next=null,t.length--,g},f=(function(){function e(g){var t=this;l(this,e),this.length=0,this.head=null,this.tail=null,g!=null&&g.forEach(function(s){return t.push(s)})}return d(e,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,s){return r(s.prev,a(t),s,this)}},{key:"insertAfter",value:function(t,s){return r(s,a(t),s.next,this)}},{key:"insertNodeBefore",value:function(t,s){return r(s.prev,t,s,this)}},{key:"insertNodeAfter",value:function(t,s){return r(s,t,s.next,this)}},{key:"push",value:function(t){return r(this.tail,a(t),null,this)}},{key:"unshift",value:function(t){return r(null,a(t),this.head,this)}},{key:"remove",value:function(t){return i(t,this)}},{key:"pop",value:function(){return i(this.tail,this).value}},{key:"popNode",value:function(){return i(this.tail,this)}},{key:"shift",value:function(){return i(this.head,this).value}},{key:"shiftNode",value:function(){return i(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var s=1,o=this.head;s<t;)o=o.next,s++;return o.value}}},{key:"set_object_at",value:function(t,s){if(t<=this.length()){for(var o=1,c=this.head;o<t;)c=c.next,o++;c.value=s}}}]),e})();w.exports=f}),(function(w,x,N){function d(l,a,r){this.x=null,this.y=null,l==null&&a==null&&r==null?(this.x=0,this.y=0):typeof l=="number"&&typeof a=="number"&&r==null?(this.x=l,this.y=a):l.constructor.name=="Point"&&a==null&&r==null&&(r=l,this.x=r.x,this.y=r.y)}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.getLocation=function(){return new d(this.x,this.y)},d.prototype.setLocation=function(l,a,r){l.constructor.name=="Point"&&a==null&&r==null?(r=l,this.setLocation(r.x,r.y)):typeof l=="number"&&typeof a=="number"&&r==null&&(parseInt(l)==l&&parseInt(a)==a?this.move(l,a):(this.x=Math.floor(l+.5),this.y=Math.floor(a+.5)))},d.prototype.move=function(l,a){this.x=l,this.y=a},d.prototype.translate=function(l,a){this.x+=l,this.y+=a},d.prototype.equals=function(l){if(l.constructor.name=="Point"){var a=l;return this.x==a.x&&this.y==a.y}return this==l},d.prototype.toString=function(){return new d().constructor.name+"[x="+this.x+",y="+this.y+"]"},w.exports=d}),(function(w,x,N){function d(l,a,r,i){this.x=0,this.y=0,this.width=0,this.height=0,l!=null&&a!=null&&r!=null&&i!=null&&(this.x=l,this.y=a,this.width=r,this.height=i)}d.prototype.getX=function(){return this.x},d.prototype.setX=function(l){this.x=l},d.prototype.getY=function(){return this.y},d.prototype.setY=function(l){this.y=l},d.prototype.getWidth=function(){return this.width},d.prototype.setWidth=function(l){this.width=l},d.prototype.getHeight=function(){return this.height},d.prototype.setHeight=function(l){this.height=l},d.prototype.getRight=function(){return this.x+this.width},d.prototype.getBottom=function(){return this.y+this.height},d.prototype.intersects=function(l){return!(this.getRight()<l.x||this.getBottom()<l.y||l.getRight()<this.x||l.getBottom()<this.y)},d.prototype.getCenterX=function(){return this.x+this.width/2},d.prototype.getMinX=function(){return this.getX()},d.prototype.getMaxX=function(){return this.getX()+this.width},d.prototype.getCenterY=function(){return this.y+this.height/2},d.prototype.getMinY=function(){return this.getY()},d.prototype.getMaxY=function(){return this.getY()+this.height},d.prototype.getWidthHalf=function(){return this.width/2},d.prototype.getHeightHalf=function(){return this.height/2},w.exports=d}),(function(w,x,N){var d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function l(){}l.lastID=0,l.createID=function(a){return l.isPrimitive(a)?a:(a.uniqueID!=null||(a.uniqueID=l.getString(),l.lastID++),a.uniqueID)},l.getString=function(a){return a==null&&(a=l.lastID),"Object#"+a},l.isPrimitive=function(a){var r=typeof a>"u"?"undefined":d(a);return a==null||r!="object"&&r!="function"},w.exports=l}),(function(w,x,N){function d(o){if(Array.isArray(o)){for(var c=0,h=Array(o.length);c<o.length;c++)h[c]=o[c];return h}else return Array.from(o)}var l=N(0),a=N(7),r=N(3),i=N(1),f=N(6),e=N(5),g=N(17),t=N(29);function s(o){t.call(this),this.layoutQuality=l.QUALITY,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=l.DEFAULT_INCREMENTAL,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new a(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,o!=null&&(this.isRemoteUse=o)}s.RANDOM_SEED=1,s.prototype=Object.create(t.prototype),s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},s.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},s.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},s.prototype.newGraphManager=function(){var o=new a(this);return this.graphManager=o,o},s.prototype.newGraph=function(o){return new f(null,this.graphManager,o)},s.prototype.newNode=function(o){return new r(this.graphManager,o)},s.prototype.newEdge=function(o){return new i(null,null,o)},s.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},s.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var o;return this.checkLayoutSuccess()?o=!1:o=this.layout(),l.ANIMATE==="during"?!1:(o&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,o)},s.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},s.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var o=this.graphManager.getAllEdges(),c=0;c<o.length;c++)o[c];for(var h=this.graphManager.getRoot().getNodes(),c=0;c<h.length;c++)h[c];this.update(this.graphManager.getRoot())}},s.prototype.update=function(o){if(o==null)this.update2();else if(o instanceof r){var c=o;if(c.getChild()!=null)for(var h=c.getChild().getNodes(),T=0;T<h.length;T++)update(h[T]);if(c.vGraphObject!=null){var u=c.vGraphObject;u.update(c)}}else if(o instanceof i){var v=o;if(v.vGraphObject!=null){var L=v.vGraphObject;L.update(v)}}else if(o instanceof f){var P=o;if(P.vGraphObject!=null){var C=P.vGraphObject;C.update(P)}}},s.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=l.QUALITY,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=l.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},s.prototype.transform=function(o){if(o==null)this.transform(new e(0,0));else{var c=new g,h=this.graphManager.getRoot().updateLeftTop();if(h!=null){c.setWorldOrgX(o.x),c.setWorldOrgY(o.y),c.setDeviceOrgX(h.x),c.setDeviceOrgY(h.y);for(var T=this.getAllNodes(),u,v=0;v<T.length;v++)u=T[v],u.transform(c)}}},s.prototype.positionNodesRandomly=function(o){if(o==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var c,h,T=o.getNodes(),u=0;u<T.length;u++)c=T[u],h=c.getChild(),h==null||h.getNodes().length==0?c.scatter():(this.positionNodesRandomly(h),c.updateBounds())},s.prototype.getFlatForest=function(){for(var o=[],c=!0,h=this.graphManager.getRoot().getNodes(),T=!0,u=0;u<h.length;u++)h[u].getChild()!=null&&(T=!1);if(!T)return o;var v=new Set,L=[],P=new Map,C=[];for(C=C.concat(h);C.length>0&&c;){for(L.push(C[0]);L.length>0&&c;){var G=L[0];L.splice(0,1),v.add(G);for(var V=G.getEdges(),u=0;u<V.length;u++){var Y=V[u].getOtherEnd(G);if(P.get(G)!=Y)if(!v.has(Y))L.push(Y),P.set(Y,G);else{c=!1;break}}}if(!c)o=[];else{var $=[].concat(d(v));o.push($);for(var u=0;u<$.length;u++){var A=$[u],j=C.indexOf(A);j>-1&&C.splice(j,1)}v=new Set,P=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],h=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),u=0;u<o.bendpoints.length;u++){var v=this.newNode(null);v.setRect(new Point(0,0),new Dimension(1,1)),T.add(v);var L=this.newEdge(null);this.graphManager.add(L,h,v),c.add(v),h=v}var L=this.newEdge(null);return this.graphManager.add(L,h,o.target),this.edgeToDummyNodes.set(o,c),o.isInterGraph()?this.graphManager.remove(o):T.remove(o),c},s.prototype.createBendpointsFromDummyNodes=function(){var o=[];o=o.concat(this.graphManager.getAllEdges()),o=[].concat(d(this.edgeToDummyNodes.keys())).concat(o);for(var c=0;c<o.length;c++){var h=o[c];if(h.bendpoints.length>0){for(var T=this.edgeToDummyNodes.get(h),u=0;u<T.length;u++){var v=T[u],L=new e(v.getCenterX(),v.getCenterY()),P=h.bendpoints.get(u);P.x=L.x,P.y=L.y,v.getOwner().remove(v)}this.graphManager.add(h,h.source,h.target)}}},s.transform=function(o,c,h,T){if(h!=null&&T!=null){var u=c;if(o<=50){var v=c/h;u-=(c-v)/50*(50-o)}else{var L=c*T;u+=(L-c)/50*(o-50)}return u}else{var P,C;return o<=50?(P=9*c/500,C=c/10):(P=9*c/50,C=-8*c),P*o+C}},s.findCenterOfTree=function(o){var c=[];c=c.concat(o);var h=[],T=new Map,u=!1,v=null;(c.length==1||c.length==2)&&(u=!0,v=c[0]);for(var L=0;L<c.length;L++){var P=c[L],C=P.getNeighborsList().size;T.set(P,P.getNeighborsList().size),C==1&&h.push(P)}var G=[];for(G=G.concat(h);!u;){var V=[];V=V.concat(G),G=[];for(var L=0;L<c.length;L++){var P=c[L],Y=c.indexOf(P);Y>=0&&c.splice(Y,1);var $=P.getNeighborsList();$.forEach(function(n){if(h.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&G.push(n),T.set(n,p)}})}h=h.concat(G),(c.length==1||c.length==2)&&(u=!0,v=c[0])}return v},s.prototype.setGraphManager=function(o){this.graphManager=o},w.exports=s}),(function(w,x,N){function d(){}d.seed=1,d.x=0,d.nextDouble=function(){return d.x=Math.sin(d.seed++)*1e4,d.x-Math.floor(d.x)},w.exports=d}),(function(w,x,N){var d=N(5);function l(a,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}l.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(a){this.lworldExtX=a},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(a){this.lworldExtY=a},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},l.prototype.transformX=function(a){var r=0,i=this.lworldExtX;return i!=0&&(r=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/i),r},l.prototype.transformY=function(a){var r=0,i=this.lworldExtY;return i!=0&&(r=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/i),r},l.prototype.inverseTransformX=function(a){var r=0,i=this.ldeviceExtX;return i!=0&&(r=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/i),r},l.prototype.inverseTransformY=function(a){var r=0,i=this.ldeviceExtY;return i!=0&&(r=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/i),r},l.prototype.inverseTransformPoint=function(a){var r=new d(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return r},w.exports=l}),(function(w,x,N){function d(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);s<t.length;s++)o[s]=t[s];return o}else return Array.from(t)}var l=N(15),a=N(4),r=N(0),i=N(8),f=N(9);function e(){l.call(this),this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=a.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=a.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=a.MAX_ITERATIONS}e.prototype=Object.create(l.prototype);for(var g in l)e[g]=l[g];e.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},e.prototype.calcIdealEdgeLengths=function(){for(var t,s,o,c,h,T,u,v=this.getGraphManager().getAllEdges(),L=0;L<v.length;L++)t=v[L],s=t.idealLength,t.isInterGraph&&(c=t.getSource(),h=t.getTarget(),T=t.getSourceInLca().getEstimatedSize(),u=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=T+u-2*r.SIMPLE_NODE_SIZE),o=t.getLca().getInclusionTreeDepth(),t.idealLength+=s*a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(c.getInclusionTreeDepth()+h.getInclusionTreeDepth()-2*o))},e.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>a.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o<t.length;o++)s=t[o],this.calcSpringForce(s,s.idealLength)},e.prototype.calcRepulsionForces=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,h,T,u=this.getAllNodes(),v;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),v=new Set,o=0;o<u.length;o++)h=u[o],this.calculateRepulsionForceOfANode(h,v,t,s),v.add(h);else for(o=0;o<u.length;o++)for(h=u[o],c=o+1;c<u.length;c++)T=u[c],h.getOwner()==T.getOwner()&&this.calcRepulsionForce(h,T)},e.prototype.calcGravitationalForces=function(){for(var t,s=this.getAllNodesToApplyGravitation(),o=0;o<s.length;o++)t=s[o],this.calcGravitationalForce(t)},e.prototype.moveNodes=function(){for(var t=this.getAllNodes(),s,o=0;o<t.length;o++)s=t[o],s.move()},e.prototype.calcSpringForce=function(t,s){var o=t.getSource(),c=t.getTarget(),h,T,u,v;if(this.uniformLeafNodeSizes&&o.getChild()==null&&c.getChild()==null)t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;h=t.getLength(),h!=0&&(T=t.edgeElasticity*(h-s),u=T*(t.lengthX/h),v=T*(t.lengthY/h),o.springForceX+=u,o.springForceY+=v,c.springForceX-=u,c.springForceY-=v)},e.prototype.calcRepulsionForce=function(t,s){var o=t.getRect(),c=s.getRect(),h=new Array(2),T=new Array(4),u,v,L,P,C,G,V;if(o.intersects(c)){i.calcSeparationAmount(o,c,h,a.DEFAULT_EDGE_LENGTH/2),G=2*h[0],V=2*h[1];var Y=t.noOfChildren*s.noOfChildren/(t.noOfChildren+s.noOfChildren);t.repulsionForceX-=Y*G,t.repulsionForceY-=Y*V,s.repulsionForceX+=Y*G,s.repulsionForceY+=Y*V}else this.uniformLeafNodeSizes&&t.getChild()==null&&s.getChild()==null?(u=c.getCenterX()-o.getCenterX(),v=c.getCenterY()-o.getCenterY()):(i.getIntersection(o,c,T),u=T[2]-T[0],v=T[3]-T[1]),Math.abs(u)<a.MIN_REPULSION_DIST&&(u=f.sign(u)*a.MIN_REPULSION_DIST),Math.abs(v)<a.MIN_REPULSION_DIST&&(v=f.sign(v)*a.MIN_REPULSION_DIST),L=u*u+v*v,P=Math.sqrt(L),C=(t.nodeRepulsion/2+s.nodeRepulsion/2)*t.noOfChildren*s.noOfChildren/L,G=C*u/P,V=C*v/P,t.repulsionForceX-=G,t.repulsionForceY-=V,s.repulsionForceX+=G,s.repulsionForceY+=V},e.prototype.calcGravitationalForce=function(t){var s,o,c,h,T,u,v,L;s=t.getOwner(),o=(s.getRight()+s.getLeft())/2,c=(s.getTop()+s.getBottom())/2,h=t.getCenterX()-o,T=t.getCenterY()-c,u=Math.abs(h)+t.getWidth()/2,v=Math.abs(T)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(L=s.getEstimatedSize()*this.gravityRangeFactor,(u>L||v>L)&&(t.gravitationForceX=-this.gravityConstant*h,t.gravitationForceY=-this.gravityConstant*T)):(L=s.getEstimatedSize()*this.compoundGravityRangeFactor,(u>L||v>L)&&(t.gravitationForceX=-this.gravityConstant*h*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||s},e.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},e.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,s=this.graphManager.getAllNodes(),o=0;o<s.length;o++)t=s[o],t.noOfChildren=t.getNoOfChildren()},e.prototype.calcGrid=function(t){var s=0,o=0;s=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),o=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var c=new Array(s),h=0;h<s;h++)c[h]=new Array(o);for(var h=0;h<s;h++)for(var T=0;T<o;T++)c[h][T]=new Array;return c},e.prototype.addNodeToGrid=function(t,s,o){var c=0,h=0,T=0,u=0;c=parseInt(Math.floor((t.getRect().x-s)/this.repulsionRange)),h=parseInt(Math.floor((t.getRect().width+t.getRect().x-s)/this.repulsionRange)),T=parseInt(Math.floor((t.getRect().y-o)/this.repulsionRange)),u=parseInt(Math.floor((t.getRect().height+t.getRect().y-o)/this.repulsionRange));for(var v=c;v<=h;v++)for(var L=T;L<=u;L++)this.grid[v][L].push(t),t.setGridCoordinates(c,h,T,u)},e.prototype.updateGrid=function(){var t,s,o=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<o.length;t++)s=o[t],this.addNodeToGrid(s,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},e.prototype.calculateRepulsionForceOfANode=function(t,s,o,c){if(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&o||c){var h=new Set;t.surrounding=new Array;for(var T,u=this.grid,v=t.startX-1;v<t.finishX+2;v++)for(var L=t.startY-1;L<t.finishY+2;L++)if(!(v<0||L<0||v>=u.length||L>=u[0].length)){for(var P=0;P<u[v][L].length;P++)if(T=u[v][L][P],!(t.getOwner()!=T.getOwner()||t==T)&&!s.has(T)&&!h.has(T)){var C=Math.abs(t.getCenterX()-T.getCenterX())-(t.getWidth()/2+T.getWidth()/2),G=Math.abs(t.getCenterY()-T.getCenterY())-(t.getHeight()/2+T.getHeight()/2);C<=this.repulsionRange&&G<=this.repulsionRange&&h.add(T)}}t.surrounding=[].concat(d(h))}for(v=0;v<t.surrounding.length;v++)this.calcRepulsionForce(t,t.surrounding[v])},e.prototype.calcRepulsionRange=function(){return 0},w.exports=e}),(function(w,x,N){var d=N(1),l=N(4);function a(i,f,e){d.call(this,i,f,e),this.idealLength=l.DEFAULT_EDGE_LENGTH,this.edgeElasticity=l.DEFAULT_SPRING_STRENGTH}a.prototype=Object.create(d.prototype);for(var r in d)a[r]=d[r];w.exports=a}),(function(w,x,N){var d=N(3),l=N(4);function a(i,f,e,g){d.call(this,i,f,e,g),this.nodeRepulsion=l.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}a.prototype=Object.create(d.prototype);for(var r in d)a[r]=d[r];a.prototype.setGridCoordinates=function(i,f,e,g){this.startX=i,this.finishX=f,this.startY=e,this.finishY=g},w.exports=a}),(function(w,x,N){function d(l,a){this.width=0,this.height=0,l!==null&&a!==null&&(this.height=a,this.width=l)}d.prototype.getWidth=function(){return this.width},d.prototype.setWidth=function(l){this.width=l},d.prototype.getHeight=function(){return this.height},d.prototype.setHeight=function(l){this.height=l},w.exports=d}),(function(w,x,N){var d=N(14);function l(){this.map={},this.keys=[]}l.prototype.put=function(a,r){var i=d.createID(a);this.contains(i)||(this.map[i]=r,this.keys.push(a))},l.prototype.contains=function(a){return d.createID(a),this.map[a]!=null},l.prototype.get=function(a){var r=d.createID(a);return this.map[r]},l.prototype.keySet=function(){return this.keys},w.exports=l}),(function(w,x,N){var d=N(14);function l(){this.set={}}l.prototype.add=function(a){var r=d.createID(a);this.contains(r)||(this.set[r]=a)},l.prototype.remove=function(a){delete this.set[d.createID(a)]},l.prototype.clear=function(){this.set={}},l.prototype.contains=function(a){return this.set[d.createID(a)]==a},l.prototype.isEmpty=function(){return this.size()===0},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAllTo=function(a){for(var r=Object.keys(this.set),i=r.length,f=0;f<i;f++)a.push(this.set[r[f]])},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAll=function(a){for(var r=a.length,i=0;i<r;i++){var f=a[i];this.add(f)}},w.exports=l}),(function(w,x,N){function d(){}d.multMat=function(l,a){for(var r=[],i=0;i<l.length;i++){r[i]=[];for(var f=0;f<a[0].length;f++){r[i][f]=0;for(var e=0;e<l[0].length;e++)r[i][f]+=l[i][e]*a[e][f]}}return r},d.transpose=function(l){for(var a=[],r=0;r<l[0].length;r++){a[r]=[];for(var i=0;i<l.length;i++)a[r][i]=l[i][r]}return a},d.multCons=function(l,a){for(var r=[],i=0;i<l.length;i++)r[i]=l[i]*a;return r},d.minusOp=function(l,a){for(var r=[],i=0;i<l.length;i++)r[i]=l[i]-a[i];return r},d.dotProduct=function(l,a){for(var r=0,i=0;i<l.length;i++)r+=l[i]*a[i];return r},d.mag=function(l){return Math.sqrt(this.dotProduct(l,l))},d.normalize=function(l){for(var a=[],r=this.mag(l),i=0;i<l.length;i++)a[i]=l[i]/r;return a},d.multGamma=function(l){for(var a=[],r=0,i=0;i<l.length;i++)r+=l[i];r*=-1/l.length;for(var f=0;f<l.length;f++)a[f]=r+l[f];return a},d.multL=function(l,a,r){for(var i=[],f=[],e=[],g=0;g<a[0].length;g++){for(var t=0,s=0;s<a.length;s++)t+=-.5*a[s][g]*l[s];f[g]=t}for(var o=0;o<r.length;o++){for(var c=0,h=0;h<r.length;h++)c+=r[o][h]*f[h];e[o]=c}for(var T=0;T<a.length;T++){for(var u=0,v=0;v<a[0].length;v++)u+=a[T][v]*e[v];i[T]=u}return i},w.exports=d}),(function(w,x,N){var d=(function(){function i(f,e){for(var g=0;g<e.length;g++){var t=e[g];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(f,t.key,t)}}return function(f,e,g){return e&&i(f.prototype,e),g&&i(f,g),f}})();function l(i,f){if(!(i instanceof f))throw new TypeError("Cannot call a class as a function")}var a=N(11),r=(function(){function i(f,e){l(this,i),(e!==null||e!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var g=void 0;f instanceof a?g=f.size():g=f.length,this._quicksort(f,0,g-1)}return d(i,[{key:"_quicksort",value:function(e,g,t){if(g<t){var s=this._partition(e,g,t);this._quicksort(e,g,s),this._quicksort(e,s+1,t)}}},{key:"_partition",value:function(e,g,t){for(var s=this._get(e,g),o=g,c=t;;){for(;this.compareFunction(s,this._get(e,c));)c--;for(;this.compareFunction(this._get(e,o),s);)o++;if(o<c)this._swap(e,o,c),o++,c--;else return c}}},{key:"_get",value:function(e,g){return e instanceof a?e.get_object_at(g):e[g]}},{key:"_set",value:function(e,g,t){e instanceof a?e.set_object_at(g,t):e[g]=t}},{key:"_swap",value:function(e,g,t){var s=this._get(e,g);this._set(e,g,this._get(e,t)),this._set(e,t,s)}},{key:"_defaultCompareFunction",value:function(e,g){return g>e}}]),i})();w.exports=r}),(function(w,x,N){function d(){}d.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var a=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St<bt[0];St++)zt.push(Bt(bt.slice(1)));return zt};return Ct(Tt)})([this.m,a]),this.V=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St<bt[0];St++)zt.push(Bt(bt.slice(1)));return zt};return Ct(Tt)})([this.n,this.n]);for(var r=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.n),i=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,e=Math.min(this.m-1,this.n),g=Math.max(0,Math.min(this.n-2,this.m)),t=0;t<Math.max(e,g);t++){if(t<e){this.s[t]=0;for(var s=t;s<this.m;s++)this.s[t]=d.hypot(this.s[t],l[s][t]);if(this.s[t]!==0){l[t][t]<0&&(this.s[t]=-this.s[t]);for(var o=t;o<this.m;o++)l[o][t]/=this.s[t];l[t][t]+=1}this.s[t]=-this.s[t]}for(var c=t+1;c<this.n;c++){if((function(Tt,Ct){return Tt&&Ct})(t<e,this.s[t]!==0)){for(var h=0,T=t;T<this.m;T++)h+=l[T][t]*l[T][c];h=-h/l[t][t];for(var u=t;u<this.m;u++)l[u][c]+=h*l[u][t]}r[c]=l[t][c]}if((function(Tt,Ct){return Ct})(f,t<e))for(var v=t;v<this.m;v++)this.U[v][t]=l[v][t];if(t<g){r[t]=0;for(var L=t+1;L<this.n;L++)r[t]=d.hypot(r[t],r[L]);if(r[t]!==0){r[t+1]<0&&(r[t]=-r[t]);for(var P=t+1;P<this.n;P++)r[P]/=r[t];r[t+1]+=1}if(r[t]=-r[t],(function(Tt,Ct){return Tt&&Ct})(t+1<this.m,r[t]!==0)){for(var C=t+1;C<this.m;C++)i[C]=0;for(var G=t+1;G<this.n;G++)for(var V=t+1;V<this.m;V++)i[V]+=r[G]*l[V][G];for(var Y=t+1;Y<this.n;Y++)for(var $=-r[Y]/r[t+1],A=t+1;A<this.m;A++)l[A][Y]+=$*i[A]}for(var j=t+1;j<this.n;j++)this.V[j][t]=r[j]}}var n=Math.min(this.n,this.m+1);e<this.n&&(this.s[e]=l[e][e]),this.m<n&&(this.s[n-1]=0),g+1<n&&(r[g]=l[g][n-1]),r[n-1]=0;{for(var E=e;E<a;E++){for(var p=0;p<this.m;p++)this.U[p][E]=0;this.U[E][E]=1}for(var m=e-1;m>=0;m--)if(this.s[m]!==0){for(var y=m+1;y<a;y++){for(var S=0,O=m;O<this.m;O++)S+=this.U[O][m]*this.U[O][y];S=-S/this.U[m][m];for(var F=m;F<this.m;F++)this.U[F][y]+=S*this.U[F][m]}for(var W=m;W<this.m;W++)this.U[W][m]=-this.U[W][m];this.U[m][m]=1+this.U[m][m];for(var R=0;R<m-1;R++)this.U[R][m]=0}else{for(var Q=0;Q<this.m;Q++)this.U[Q][m]=0;this.U[m][m]=1}}for(var z=this.n-1;z>=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z<g,r[z]!==0))for(var X=z+1;X<a;X++){for(var rt=0,B=z+1;B<this.n;B++)rt+=this.V[B][z]*this.V[B][X];rt=-rt/this.V[z+1][z];for(var D=z+1;D<this.n;D++)this.V[D][X]+=rt*this.V[D][z]}for(var H=0;H<this.n;H++)this.V[H][z]=0;this.V[z][z]=1}for(var k=n-1,tt=Math.pow(2,-52),ht=Math.pow(2,-966);n>0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=d.hypot(this.s[ut],it),wt=this.s[ut]/Et,Ot=it/Et;this.s[ut]=Et,ut!==J&&(it=-Ot*r[ut-1],r[ut-1]=wt*r[ut-1]);for(var mt=0;mt<this.n;mt++)Et=wt*this.V[mt][ut]+Ot*this.V[mt][n-1],this.V[mt][n-1]=-Ot*this.V[mt][ut]+wt*this.V[mt][n-1],this.V[mt][ut]=Et}}break;case 2:{var Dt=r[J-1];r[J-1]=0;for(var Rt=J;Rt<n;Rt++){var Ht=d.hypot(this.s[Rt],Dt),Ut=this.s[Rt]/Ht,Pt=Dt/Ht;this.s[Rt]=Ht,Dt=-Pt*r[Rt],r[Rt]=Ut*r[Rt];for(var Ft=0;Ft<this.m;Ft++)Ht=Ut*this.U[Ft][Rt]+Pt*this.U[Ft][J-1],this.U[Ft][J-1]=-Pt*this.U[Ft][Rt]+Ut*this.U[Ft][J-1],this.U[Ft][Rt]=Ht}}break;case 3:{var Yt=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[n-1]),Math.abs(this.s[n-2])),Math.abs(r[n-2])),Math.abs(this.s[J])),Math.abs(r[J])),Vt=this.s[n-1]/Yt,b=this.s[n-2]/Yt,U=r[n-2]/Yt,Z=this.s[J]/Yt,K=r[J]/Yt,q=((b+Vt)*(b-Vt)+U*U)/2,at=Vt*U*(Vt*U),ct=0;(function(Tt,Ct){return Tt||Ct})(q!==0,at!==0)&&(ct=Math.sqrt(q*q+at),q<0&&(ct=-ct),ct=at/(q+ct));for(var nt=(Z+Vt)*(Z-Vt)+ct,et=Z*K,_=J;_<n-1;_++){var dt=d.hypot(nt,et),Mt=nt/dt,pt=et/dt;_!==J&&(r[_-1]=dt),nt=Mt*this.s[_]+pt*r[_],r[_]=Mt*r[_]-pt*this.s[_],et=pt*this.s[_+1],this.s[_+1]=Mt*this.s[_+1];for(var xt=0;xt<this.n;xt++)dt=Mt*this.V[xt][_]+pt*this.V[xt][_+1],this.V[xt][_+1]=-pt*this.V[xt][_]+Mt*this.V[xt][_+1],this.V[xt][_]=dt;if(dt=d.hypot(nt,et),Mt=nt/dt,pt=et/dt,this.s[_]=dt,nt=Mt*r[_]+pt*this.s[_+1],this.s[_+1]=-pt*r[_]+Mt*this.s[_+1],et=pt*r[_+1],r[_+1]=Mt*r[_+1],_<this.m-1)for(var lt=0;lt<this.m;lt++)dt=Mt*this.U[lt][_]+pt*this.U[lt][_+1],this.U[lt][_+1]=-pt*this.U[lt][_]+Mt*this.U[lt][_+1],this.U[lt][_]=dt}r[n-2]=nt}break;case 4:{if(this.s[J]<=0){this.s[J]=this.s[J]<0?-this.s[J]:0;for(var ot=0;ot<=k;ot++)this.V[ot][J]=-this.V[ot][J]}for(;J<k&&!(this.s[J]>=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,J<this.n-1)for(var ft=0;ft<this.n;ft++)Lt=this.V[ft][J+1],this.V[ft][J+1]=this.V[ft][J],this.V[ft][J]=Lt;if(J<this.m-1)for(var st=0;st<this.m;st++)Lt=this.U[st][J+1],this.U[st][J+1]=this.U[st][J],this.U[st][J]=Lt;J++}n--}break}}var Xt={U:this.U,V:this.V,S:this.s};return Xt},d.hypot=function(l,a){var r=void 0;return Math.abs(l)>Math.abs(a)?(r=a/l,r=Math.abs(l)*Math.sqrt(1+r*r)):a!=0?(r=l/a,r=Math.abs(a)*Math.sqrt(1+r*r)):r=0,r},w.exports=d}),(function(w,x,N){var d=(function(){function r(i,f){for(var e=0;e<f.length;e++){var g=f[e];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(i,g.key,g)}}return function(i,f,e){return f&&r(i.prototype,f),e&&r(i,e),i}})();function l(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")}var a=(function(){function r(i,f){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,r),this.sequence1=i,this.sequence2=f,this.match_score=e,this.mismatch_penalty=g,this.gap_penalty=t,this.iMax=i.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=new Array(this.jMax);for(var o=0;o<this.jMax;o++)this.grid[s][o]=0}this.tracebackGrid=new Array(this.iMax);for(var c=0;c<this.iMax;c++){this.tracebackGrid[c]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.tracebackGrid[c][h]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return d(r,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var f=1;f<this.jMax;f++)this.grid[0][f]=this.grid[0][f-1]+this.gap_penalty,this.tracebackGrid[0][f]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var g=1;g<this.iMax;g++)for(var t=1;t<this.jMax;t++){var s=void 0;this.sequence1[g-1]===this.sequence2[t-1]?s=this.grid[g-1][t-1]+this.match_score:s=this.grid[g-1][t-1]+this.mismatch_penalty;var o=this.grid[g-1][t]+this.gap_penalty,c=this.grid[g][t-1]+this.gap_penalty,h=[s,o,c],T=this.arrayAllMaxIndexes(h);this.grid[g][t]=h[T[0]],this.tracebackGrid[g][t]=[T.includes(0),T.includes(1),T.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var f=[];for(f.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});f[0];){var e=f[0],g=this.tracebackGrid[e.pos[0]][e.pos[1]];g[0]&&f.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),g[1]&&f.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),g[2]&&f.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),e.pos[0]===0&&e.pos[1]===0&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),f.shift()}return this.alignments}},{key:"getAllIndexes",value:function(f,e){for(var g=[],t=-1;(t=f.indexOf(e,t+1))!==-1;)g.push(t);return g}},{key:"arrayAllMaxIndexes",value:function(f){return this.getAllIndexes(f,Math.max.apply(null,f))}}]),r})();w.exports=a}),(function(w,x,N){var d=function(){};d.FDLayout=N(18),d.FDLayoutConstants=N(4),d.FDLayoutEdge=N(19),d.FDLayoutNode=N(20),d.DimensionD=N(21),d.HashMap=N(22),d.HashSet=N(23),d.IGeometry=N(8),d.IMath=N(9),d.Integer=N(10),d.Point=N(12),d.PointD=N(5),d.RandomSeed=N(16),d.RectangleD=N(13),d.Transform=N(17),d.UniqueIDGeneretor=N(14),d.Quicksort=N(25),d.LinkedList=N(11),d.LGraphObject=N(2),d.LGraph=N(6),d.LEdge=N(1),d.LGraphManager=N(7),d.LNode=N(3),d.Layout=N(15),d.LayoutConstants=N(0),d.NeedlemanWunsch=N(27),d.Matrix=N(24),d.SVD=N(26),w.exports=d}),(function(w,x,N){function d(){this.listeners=[]}var l=d.prototype;l.addListener=function(a,r){this.listeners.push({event:a,callback:r})},l.removeListener=function(a,r){for(var i=this.listeners.length;i>=0;i--){var f=this.listeners[i];f.event===a&&f.callback===r&&this.listeners.splice(i,1)}},l.emit=function(a,r){for(var i=0;i<this.listeners.length;i++){var f=this.listeners[i];a===f.event&&f.callback(r)}},w.exports=d})])})})(fe)),fe.exports}var vr=le.exports,De;function pr(){return De||(De=1,(function(I,M){(function(x,N){I.exports=N(dr())})(vr,function(w){return(()=>{var x={45:((a,r,i)=>{var f={};f.layoutBase=i(551),f.CoSEConstants=i(806),f.CoSEEdge=i(767),f.CoSEGraph=i(880),f.CoSEGraphManager=i(578),f.CoSELayout=i(765),f.CoSENode=i(991),f.ConstraintHandler=i(902),a.exports=f}),806:((a,r,i)=>{var f=i(551).FDLayoutConstants;function e(){}for(var g in f)e[g]=f[g];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,a.exports=e}),767:((a,r,i)=>{var f=i(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];a.exports=e}),880:((a,r,i)=>{var f=i(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];a.exports=e}),578:((a,r,i)=>{var f=i(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];a.exports=e}),765:((a,r,i)=>{var f=i(551).FDLayout,e=i(578),g=i(880),t=i(991),s=i(767),o=i(806),c=i(902),h=i(551).FDLayoutConstants,T=i(551).LayoutConstants,u=i(551).Point,v=i(551).PointD,L=i(551).DimensionD,P=i(551).Layout,C=i(551).Integer,G=i(551).IGeometry,V=i(551).LGraph,Y=i(551).Transform,$=i(551).LinkedList;function A(){f.call(this),this.toBeTiled={},this.constraints={}}A.prototype=Object.create(f.prototype);for(var j in f)A[j]=f[j];A.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},A.prototype.newGraph=function(n){return new g(null,this.graphManager,n)},A.prototype.newNode=function(n){return new t(this.graphManager,n)},A.prototype.newEdge=function(n){return new s(null,null,n)},A.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=h.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=h.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/h.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(S){return E.has(S)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%h.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p<n.length;p++){var m=n[p].rect,y=n[p].id;E[y]={id:y,x:m.getCenterX(),y:m.getCenterY(),w:m.width,h:m.height}}return E},A.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var n=!1;if(h.ANIMATE==="during")this.emit("layoutstarted");else{for(;!n;)n=this.tick();this.graphManager.updateBounds()}},A.prototype.moveNodes=function(){for(var n=this.getAllNodes(),E,p=0;p<n.length;p++)E=n[p],E.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var p=0;p<n.length;p++)E=n[p],E.move()},A.prototype.initConstraintVariables=function(){var n=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var E=this.graphManager.getAllNodes(),p=0;p<E.length;p++){var m=E[p];this.idToNodeMap.set(m.id,m)}var y=function D(H){for(var k=H.getChild().getNodes(),tt,ht=0,J=0;J<k.length;J++)tt=k[J],tt.getChild()==null?n.fixedNodeSet.has(tt.id)&&(ht+=100):ht+=D(tt);return ht};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(k){n.fixedNodeSet.add(k.nodeId)});for(var E=this.graphManager.getAllNodes(),m,p=0;p<E.length;p++)if(m=E[p],m.getChild()!=null){var S=y(m);S>0&&(m.fixedNodeWeight=S)}}if(this.constraints.relativePlacementConstraint){var O=new Map,F=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p<W.length;p++)this.dummyToNodeForVerticalAlignment.set("dummy"+p,[]),W[p].forEach(function(H){O.set(H,"dummy"+p),n.dummyToNodeForVerticalAlignment.get("dummy"+p).push(H),n.fixedNodeSet.has(H)&&n.fixedNodesOnHorizontal.add("dummy"+p)});if(this.constraints.alignmentConstraint.horizontal)for(var R=this.constraints.alignmentConstraint.horizontal,p=0;p<R.length;p++)this.dummyToNodeForHorizontalAlignment.set("dummy"+p,[]),R[p].forEach(function(H){F.set(H,"dummy"+p),n.dummyToNodeForHorizontalAlignment.get("dummy"+p).push(H),n.fixedNodeSet.has(H)&&n.fixedNodesOnVertical.add("dummy"+p)})}if(o.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(D){var H,k,tt;for(tt=D.length-1;tt>=2*D.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=D[tt],D[tt]=D[H],D[H]=k;return D},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:D.gap})}else{var tt=F.has(D.top)?F.get(D.top):D.top,ht=F.has(D.bottom)?F.get(D.bottom):D.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:D.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:D.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=F.has(D.top)?F.get(D.top):D.top,ht=F.has(D.bottom)?F.get(D.bottom):D.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new $,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(wt){It.has(wt)||(J.push(wt),It.add(wt),tt[Nt].push(wt))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var B=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=B.components,this.fixedComponentsOnVertical=B.isFixed}}},A.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(B){var D=n.idToNodeMap.get(B.nodeId);D.displacementX=0,D.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p<E.length;p++){for(var m=0,y=0;y<E[p].length;y++){if(this.fixedNodeSet.has(E[p][y])){m=0;break}m+=this.idToNodeMap.get(E[p][y]).displacementX}for(var S=m/E[p].length,y=0;y<E[p].length;y++)this.idToNodeMap.get(E[p][y]).displacementX=S}if(this.constraints.alignmentConstraint.horizontal)for(var O=this.constraints.alignmentConstraint.horizontal,p=0;p<O.length;p++){for(var F=0,y=0;y<O[p].length;y++){if(this.fixedNodeSet.has(O[p][y])){F=0;break}F+=this.idToNodeMap.get(O[p][y]).displacementY}for(var W=F/O[p].length,y=0;y<O[p].length;y++)this.idToNodeMap.get(O[p][y]).displacementY=W}}if(this.constraints.relativePlacementConstraint)if(o.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(B){if(!n.fixedNodesOnHorizontal.has(B)){var D=0;n.dummyToNodeForVerticalAlignment.has(B)?D=n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(B)[0]).displacementX:D=n.idToNodeMap.get(B).displacementX,n.nodeToRelativeConstraintMapHorizontal.get(B).forEach(function(H){if(H.right){var k=n.nodeToTempPositionMapHorizontal.get(H.right)-n.nodeToTempPositionMapHorizontal.get(B)-D;k<H.gap&&(D-=H.gap-k)}else{var k=n.nodeToTempPositionMapHorizontal.get(B)-n.nodeToTempPositionMapHorizontal.get(H.left)+D;k<H.gap&&(D+=H.gap-k)}}),n.nodeToTempPositionMapHorizontal.set(B,n.nodeToTempPositionMapHorizontal.get(B)+D),n.dummyToNodeForVerticalAlignment.has(B)?n.dummyToNodeForVerticalAlignment.get(B).forEach(function(H){n.idToNodeMap.get(H).displacementX=D}):n.idToNodeMap.get(B).displacementX=D}}),this.nodesInRelativeVertical.forEach(function(B){if(!n.fixedNodesOnHorizontal.has(B)){var D=0;n.dummyToNodeForHorizontalAlignment.has(B)?D=n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(B)[0]).displacementY:D=n.idToNodeMap.get(B).displacementY,n.nodeToRelativeConstraintMapVertical.get(B).forEach(function(H){if(H.bottom){var k=n.nodeToTempPositionMapVertical.get(H.bottom)-n.nodeToTempPositionMapVertical.get(B)-D;k<H.gap&&(D-=H.gap-k)}else{var k=n.nodeToTempPositionMapVertical.get(B)-n.nodeToTempPositionMapVertical.get(H.top)+D;k<H.gap&&(D+=H.gap-k)}}),n.nodeToTempPositionMapVertical.set(B,n.nodeToTempPositionMapVertical.get(B)+D),n.dummyToNodeForHorizontalAlignment.has(B)?n.dummyToNodeForHorizontalAlignment.get(B).forEach(function(H){n.idToNodeMap.get(H).displacementY=D}):n.idToNodeMap.get(B).displacementY=D}});else{for(var p=0;p<this.componentsOnHorizontal.length;p++){var R=this.componentsOnHorizontal[p];if(this.fixedComponentsOnHorizontal[p])for(var y=0;y<R.length;y++)this.dummyToNodeForVerticalAlignment.has(R[y])?this.dummyToNodeForVerticalAlignment.get(R[y]).forEach(function(H){n.idToNodeMap.get(H).displacementX=0}):this.idToNodeMap.get(R[y]).displacementX=0;else{for(var Q=0,z=0,y=0;y<R.length;y++)if(this.dummyToNodeForVerticalAlignment.has(R[y])){var X=this.dummyToNodeForVerticalAlignment.get(R[y]);Q+=X.length*this.idToNodeMap.get(X[0]).displacementX,z+=X.length}else Q+=this.idToNodeMap.get(R[y]).displacementX,z++;for(var rt=Q/z,y=0;y<R.length;y++)this.dummyToNodeForVerticalAlignment.has(R[y])?this.dummyToNodeForVerticalAlignment.get(R[y]).forEach(function(H){n.idToNodeMap.get(H).displacementX=rt}):this.idToNodeMap.get(R[y]).displacementX=rt}}for(var p=0;p<this.componentsOnVertical.length;p++){var R=this.componentsOnVertical[p];if(this.fixedComponentsOnVertical[p])for(var y=0;y<R.length;y++)this.dummyToNodeForHorizontalAlignment.has(R[y])?this.dummyToNodeForHorizontalAlignment.get(R[y]).forEach(function(k){n.idToNodeMap.get(k).displacementY=0}):this.idToNodeMap.get(R[y]).displacementY=0;else{for(var Q=0,z=0,y=0;y<R.length;y++)if(this.dummyToNodeForHorizontalAlignment.has(R[y])){var X=this.dummyToNodeForHorizontalAlignment.get(R[y]);Q+=X.length*this.idToNodeMap.get(X[0]).displacementY,z+=X.length}else Q+=this.idToNodeMap.get(R[y]).displacementY,z++;for(var rt=Q/z,y=0;y<R.length;y++)this.dummyToNodeForHorizontalAlignment.has(R[y])?this.dummyToNodeForHorizontalAlignment.get(R[y]).forEach(function(J){n.idToNodeMap.get(J).displacementY=rt}):this.idToNodeMap.get(R[y]).displacementY=rt}}}},A.prototype.calculateNodesToApplyGravitationTo=function(){var n=[],E,p=this.graphManager.getGraphs(),m=p.length,y;for(y=0;y<m;y++)E=p[y],E.updateConnected(),E.isConnected||(n=n.concat(E.getNodes()));return n},A.prototype.createBendpoints=function(){var n=[];n=n.concat(this.graphManager.getAllEdges());var E=new Set,p;for(p=0;p<n.length;p++){var m=n[p];if(!E.has(m)){var y=m.getSource(),S=m.getTarget();if(y==S)m.getBendpoints().push(new v),m.getBendpoints().push(new v),this.createDummyNodesForBendpoints(m),E.add(m);else{var O=[];if(O=O.concat(y.getEdgeListToNode(S)),O=O.concat(S.getEdgeListToNode(y)),!E.has(O[0])){if(O.length>1){var F;for(F=0;F<O.length;F++){var W=O[F];W.getBendpoints().push(new v),this.createDummyNodesForBendpoints(W)}}O.forEach(function(R){E.add(R)})}}}if(E.size==n.length)break}},A.prototype.positionNodesRadially=function(n){for(var E=new u(0,0),p=Math.ceil(Math.sqrt(n.length)),m=0,y=0,S=0,O=new v(0,0),F=0;F<n.length;F++){F%p==0&&(S=0,y=m,F!=0&&(y+=o.DEFAULT_COMPONENT_SEPERATION),m=0);var W=n[F],R=P.findCenterOfTree(W);E.x=S,E.y=y,O=A.radialLayout(W,R,E),O.y>m&&(m=Math.floor(O.y)),S=Math.floor(O.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new v(T.WORLD_CENTER_X-O.x/2,T.WORLD_CENTER_Y-O.y/2))},A.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(E,null,0,359,0,m);var y=V.calculateBounds(n),S=new Y;S.setDeviceOrgX(y.getMinX()),S.setDeviceOrgY(y.getMinY()),S.setWorldOrgX(p.x),S.setWorldOrgY(p.y);for(var O=0;O<n.length;O++){var F=n[O];F.transform(S)}var W=new v(y.getMaxX(),y.getMaxY());return S.inverseTransformPoint(W)},A.branchRadialLayout=function(n,E,p,m,y,S){var O=(m-p+1)/2;O<0&&(O+=180);var F=(O+p)%360,W=F*G.TWO_PI/360,R=y*Math.cos(W),Q=y*Math.sin(W);n.setCenter(R,Q);var z=[];z=z.concat(n.getEdges());var X=z.length;E!=null&&X--;for(var rt=0,B=z.length,D,H=n.getEdgesBetween(E);H.length>1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),B--,X--}E!=null?D=(z.indexOf(H[0])+1)%B:D=0;for(var ht=Math.abs(m-p)/X,J=D;rt!=X;J=++J%B){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;A.branchRadialLayout(It,n,Nt,vt,y+S,S),rt++}}},A.maxDiagonalInTree=function(n){for(var E=C.MIN_VALUE,p=0;p<n.length;p++){var m=n[p],y=m.getDiagonal();y>E&&(E=y)}return E},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y<m.length;y++){var S=m[y],O=S.getParent();this.getNodeDegreeWithChildren(S)===0&&(O.id==null||!this.getToBeTiled(O))&&p.push(S)}for(var y=0;y<p.length;y++){var S=p[y],F=S.getParent().id;typeof E[F]>"u"&&(E[F]=[]),E[F]=E[F].concat(S)}Object.keys(E).forEach(function(W){if(E[W].length>1){var R="DummyCompound_"+W;n.memberGroups[R]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=R,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[R]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var B=0;B<E[W].length;B++){var D=E[W][B];rt.remove(D),X.add(D)}}})},A.prototype.clearCompounds=function(){var n={},E={};this.performDFSOnCompounds();for(var p=0;p<this.compoundOrder.length;p++)E[this.compoundOrder[p].id]=this.compoundOrder[p],n[this.compoundOrder[p].id]=[].concat(this.compoundOrder[p].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[p].getChild()),this.compoundOrder[p].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(n,E)},A.prototype.clearZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(p){var m=n.idToDummyNode[p];if(E[p]=n.tileNodes(n.memberGroups[p],m.paddingLeft+m.paddingRight),m.rect.width=E[p].width,m.rect.height=E[p].height,m.setCenter(E[p].centerX,E[p].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var y=m.rect.width,S=m.rect.height;m.labelWidth&&(m.labelPosHorizontal=="left"?(m.rect.x-=m.labelWidth,m.setWidth(y+m.labelWidth),m.labelMarginLeft=m.labelWidth):m.labelPosHorizontal=="center"&&m.labelWidth>y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(S+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>S?(m.rect.y-=(m.labelHeight-S)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-S)/2):m.labelPosVertical=="bottom"&&m.setHeight(S+m.labelHeight))}})},A.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,S=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,S,O)}},A.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,S=m.paddingTop,O=m.labelMarginLeft,F=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,S,O,F)})},A.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y<m.length;y++){var S=m[y];if(this.getNodeDegree(S)>0)return this.toBeTiled[E]=!1,!1;if(S.getChild()==null){this.toBeTiled[S.id]=!1;continue}if(!this.getToBeTiled(S))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},A.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;m<E.length;m++){var y=E[m];y.getSource().id!==y.getTarget().id&&(p=p+1)}return p},A.prototype.getNodeDegreeWithChildren=function(n){var E=this.getNodeDegree(n);if(n.getChild()==null)return E;for(var p=n.getChild().getNodes(),m=0;m<p.length;m++){var y=p[m];E+=this.getNodeDegreeWithChildren(y)}return E},A.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},A.prototype.fillCompexOrderByDFS=function(n){for(var E=0;E<n.length;E++){var p=n[E];p.getChild()!=null&&this.fillCompexOrderByDFS(p.getChild().getNodes()),this.getToBeTiled(p)&&this.compoundOrder.push(p)}},A.prototype.adjustLocations=function(n,E,p,m,y,S,O){E+=m+S,p+=y+O;for(var F=E,W=0;W<n.rows.length;W++){var R=n.rows[W];E=F;for(var Q=0,z=0;z<R.length;z++){var X=R[z];X.rect.x=E,X.rect.y=p,E+=X.rect.width+n.horizontalPadding,X.rect.height>Q&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},A.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var S=y.rect.width,O=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(S+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>S?(y.rect.x-=(y.labelWidth-S)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-S)/2):y.labelPosHorizontal=="right"&&y.setWidth(S+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(O+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>O?(y.rect.y-=(y.labelHeight-O)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-O)/2):y.labelPosVertical=="bottom"&&y.setHeight(O+y.labelHeight))}})},A.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),S=this.getOrgRatio(m),O;return S<y?O=m:O=p,O},A.prototype.getOrgRatio=function(n){var E=n.width,p=n.height,m=E/p;return m<1&&(m=1/m),m},A.prototype.calcIdealRowWidth=function(n,E){var p=o.TILING_PADDING_VERTICAL,m=o.TILING_PADDING_HORIZONTAL,y=n.length,S=0,O=0,F=0;n.forEach(function(B){S+=B.getWidth(),O+=B.getHeight(),B.getWidth()>F&&(F=B.getWidth())});var W=S/y,R=O/y,Q=Math.pow(p-m,2)+4*(W+m)*(R+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return F>rt&&(rt=F),rt+=m*2,rt},A.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,S=o.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};S&&(O.idealRowWidth=this.calcIdealRowWidth(n,p));var F=function(D){return D.rect.width*D.rect.height},W=function(D,H){return F(H)-F(D)};n.sort(function(B,D){var H=W;return O.idealRowWidth?(H=S,H(B.id,D.id)):H(B,D)});for(var R=0,Q=0,z=0;z<n.length;z++){var X=n[z];R+=X.getCenterX(),Q+=X.getCenterY()}O.centerX=R/n.length,O.centerY=Q/n.length;for(var z=0;z<n.length;z++){var X=n[z];if(O.rows.length==0)this.insertNodeToRow(O,X,0,E);else if(this.canAddHorizontal(O,X.rect.width,X.rect.height)){var rt=O.rows.length-1;O.idealRowWidth||(rt=this.getShortestRowIndex(O)),this.insertNodeToRow(O,X,rt,E)}else this.insertNodeToRow(O,X,O.rows.length,E);this.shiftToLastRow(O)}return O},A.prototype.insertNodeToRow=function(n,E,p,m){var y=m;if(p==n.rows.length){var S=[];n.rows.push(S),n.rowWidth.push(y),n.rowHeight.push(0)}var O=n.rowWidth[p]+E.rect.width;n.rows[p].length>0&&(O+=n.horizontalPadding),n.rowWidth[p]=O,n.width<O&&(n.width=O);var F=E.rect.height;p>0&&(F+=n.verticalPadding);var W=0;F>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=F,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},A.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;m<n.rows.length;m++)n.rowWidth[m]<p&&(E=m,p=n.rowWidth[m]);return E},A.prototype.getLongestRowIndex=function(n){for(var E=-1,p=Number.MIN_VALUE,m=0;m<n.rows.length;m++)n.rowWidth[m]>p&&(E=m,p=n.rowWidth[m]);return E},A.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var S=this.getShortestRowIndex(n);if(S<0)return!0;var O=n.rowWidth[S];if(O+n.horizontalPadding+E<=n.width)return!0;var F=0;n.rowHeight[S]<p&&S>0&&(F=p+n.verticalPadding-n.rowHeight[S]);var W;n.width-O>=E+n.horizontalPadding?W=(n.height+F)/(O+E+n.horizontalPadding):W=(n.height+F)/n.width,F=p+n.verticalPadding;var R;return n.width<E?R=(n.height+F)/E:R=(n.height+F)/n.width,R<1&&(R=1/R),W<1&&(W=1/W),W<R},A.prototype.shiftToLastRow=function(n){var E=this.getLongestRowIndex(n),p=n.rowWidth.length-1,m=n.rows[E],y=m[m.length-1],S=y.width+n.horizontalPadding;if(n.width-n.rowWidth[p]>S&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-S,n.rowWidth[p]=n.rowWidth[p]+S,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var O=Number.MIN_VALUE,F=0;F<m.length;F++)m[F].height>O&&(O=m[F].height);E>0&&(O+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=O,n.rowHeight[p]<y.height+n.verticalPadding&&(n.rowHeight[p]=y.height+n.verticalPadding);var R=n.rowHeight[E]+n.rowHeight[p];n.height+=R-W,this.shiftToLastRow(n)}},A.prototype.tilingPreLayout=function(){o.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},A.prototype.tilingPostLayout=function(){o.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},A.prototype.reduceTrees=function(){for(var n=[],E=!0,p;E;){var m=this.graphManager.getAllNodes(),y=[];E=!1;for(var S=0;S<m.length;S++)if(p=m[S],p.getEdges().length==1&&!p.getEdges()[0].isInterGraph&&p.getChild()==null){if(o.PURE_INCREMENTAL){var O=p.getEdges()[0].getOtherEnd(p),F=new L(p.getCenterX()-O.getCenterX(),p.getCenterY()-O.getCenterY());y.push([p,p.getEdges()[0],p.getOwner(),F])}else y.push([p,p.getEdges()[0],p.getOwner()]);E=!0}if(E==!0){for(var W=[],R=0;R<y.length;R++)y[R][0].getEdges().length==1&&(W.push(y[R]),y[R][0].getOwner().remove(y[R][0]));n.push(W),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=n},A.prototype.growTree=function(n){for(var E=n.length,p=n[E-1],m,y=0;y<p.length;y++)m=p[y],this.findPlaceforPrunedNode(m),m[2].add(m[0]),m[2].add(m[1],m[1].source,m[1].target);n.splice(n.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},A.prototype.findPlaceforPrunedNode=function(n){var E,p,m=n[0];if(m==n[1].source?p=n[1].target:p=n[1].source,o.PURE_INCREMENTAL)m.setCenter(p.getCenterX()+n[3].getWidth(),p.getCenterY()+n[3].getHeight());else{var y=p.startX,S=p.finishX,O=p.startY,F=p.finishY,W=0,R=0,Q=0,z=0,X=[W,Q,R,z];if(O>0)for(var rt=y;rt<=S;rt++)X[0]+=this.grid[rt][O-1].length+this.grid[rt][O].length-1;if(S<this.grid.length-1)for(var rt=O;rt<=F;rt++)X[1]+=this.grid[S+1][rt].length+this.grid[S][rt].length-1;if(F<this.grid[0].length-1)for(var rt=y;rt<=S;rt++)X[2]+=this.grid[rt][F+1].length+this.grid[rt][F].length-1;if(y>0)for(var rt=O;rt<=F;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var B=C.MAX_VALUE,D,H,k=0;k<X.length;k++)X[k]<B?(B=X[k],D=1,H=k):X[k]==B&&D++;if(D==3&&B==0)X[0]==0&&X[1]==0&&X[2]==0?E=1:X[0]==0&&X[1]==0&&X[3]==0?E=0:X[0]==0&&X[2]==0&&X[3]==0?E=3:X[1]==0&&X[2]==0&&X[3]==0&&(E=2);else if(D==2&&B==0){var tt=Math.floor(Math.random()*2);X[0]==0&&X[1]==0?tt==0?E=0:E=1:X[0]==0&&X[2]==0?tt==0?E=0:E=2:X[0]==0&&X[3]==0?tt==0?E=0:E=3:X[1]==0&&X[2]==0?tt==0?E=1:E=2:X[1]==0&&X[3]==0?tt==0?E=1:E=3:tt==0?E=2:E=3}else if(D==4&&B==0){var tt=Math.floor(Math.random()*4);E=tt}else E=H;E==0?m.setCenter(p.getCenterX(),p.getCenterY()-p.getHeight()/2-h.DEFAULT_EDGE_LENGTH-m.getHeight()/2):E==1?m.setCenter(p.getCenterX()+p.getWidth()/2+h.DEFAULT_EDGE_LENGTH+m.getWidth()/2,p.getCenterY()):E==2?m.setCenter(p.getCenterX(),p.getCenterY()+p.getHeight()/2+h.DEFAULT_EDGE_LENGTH+m.getHeight()/2):m.setCenter(p.getCenterX()-p.getWidth()/2-h.DEFAULT_EDGE_LENGTH-m.getWidth()/2,p.getCenterY())}},a.exports=A}),991:((a,r,i)=>{var f=i(551).FDLayoutNode,e=i(551).IMath;function g(s,o,c,h){f.call(this,s,o,c,h)}g.prototype=Object.create(f.prototype);for(var t in f)g[t]=f[t];g.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},g.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),h,T=0;T<c.length;T++)h=c[T],h.getChild()==null?(h.displacementX+=s,h.displacementY+=o):h.propogateDisplacementToChildren(s,o)},g.prototype.move=function(){var s=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),s.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},g.prototype.setPred1=function(s){this.pred1=s},g.prototype.getPred1=function(){return pred1},g.prototype.getPred2=function(){return pred2},g.prototype.setNext=function(s){this.next=s},g.prototype.getNext=function(){return next},g.prototype.setProcessed=function(s){this.processed=s},g.prototype.isProcessed=function(){return processed},a.exports=g}),902:((a,r,i)=>{function f(c){if(Array.isArray(c)){for(var h=0,T=Array(c.length);h<c.length;h++)T[h]=c[h];return T}else return Array.from(c)}var e=i(806),g=i(551).LinkedList,t=i(551).Matrix,s=i(551).SVD;function o(){}o.handleConstraints=function(c){var h={};h.fixedNodeConstraint=c.constraints.fixedNodeConstraint,h.alignmentConstraint=c.constraints.alignmentConstraint,h.relativePlacementConstraint=c.constraints.relativePlacementConstraint;for(var T=new Map,u=new Map,v=[],L=[],P=c.getAllNodes(),C=0,G=0;G<P.length;G++){var V=P[G];V.getChild()==null&&(u.set(V.id,C++),v.push(V.getCenterX()),L.push(V.getCenterY()),T.set(V.id,V))}h.relativePlacementConstraint&&h.relativePlacementConstraint.forEach(function(b){!b.gap&&b.gap!=0&&(b.left?b.gap=e.DEFAULT_EDGE_LENGTH+T.get(b.left).getWidth()/2+T.get(b.right).getWidth()/2:b.gap=e.DEFAULT_EDGE_LENGTH+T.get(b.top).getHeight()/2+T.get(b.bottom).getHeight()/2)});var Y=function(U,Z){return{x:U.x-Z.x,y:U.y-Z.y}},$=function(U){var Z=0,K=0;return U.forEach(function(q){Z+=v[u.get(q)],K+=L[u.get(q)]}),{x:Z/U.size,y:K/U.size}},A=function(U,Z,K,q,at){function ct(lt,ot){var Lt=new Set(lt),ft=!0,st=!1,Xt=void 0;try{for(var Tt=ot[Symbol.iterator](),Ct;!(ft=(Ct=Tt.next()).done);ft=!0){var Bt=Ct.value;Lt.add(Bt)}}catch(bt){st=!0,Xt=bt}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}return Lt}var nt=new Map;U.forEach(function(lt,ot){nt.set(ot,0)}),U.forEach(function(lt,ot){lt.forEach(function(Lt){nt.set(Lt.id,nt.get(Lt.id)+1)})});var et=new Map,_=new Map,dt=new g;nt.forEach(function(lt,ot){lt==0?(dt.push(ot),K||(Z=="horizontal"?et.set(ot,u.has(ot)?v[u.get(ot)]:q.get(ot)):et.set(ot,u.has(ot)?L[u.get(ot)]:q.get(ot)))):et.set(ot,Number.NEGATIVE_INFINITY),K&&_.set(ot,new Set([ot]))}),K&&at.forEach(function(lt){var ot=[];if(lt.forEach(function(st){K.has(st)&&ot.push(st)}),ot.length>0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,u.has(st)?v[u.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,u.has(st)?L[u.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=u.has(st)?v[u.get(st)]:q.get(st):ft+=u.has(st)?L[u.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var Mt=function(){var ot=dt.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)<et.get(ot)+ft.gap)if(K&&K.has(ft.id)){var st=void 0;if(Z=="horizontal"?st=u.has(ft.id)?v[u.get(ft.id)]:q.get(ft.id):st=u.has(ft.id)?L[u.get(ft.id)]:q.get(ft.id),et.set(ft.id,st),st<et.get(ot)+ft.gap){var Xt=et.get(ot)+ft.gap-st;_.get(ot).forEach(function(Tt){et.set(Tt,et.get(Tt)-Xt)})}}else et.set(ft.id,et.get(ot)+ft.gap);nt.set(ft.id,nt.get(ft.id)-1),nt.get(ft.id)==0&&dt.push(ft.id),K&&_.set(ft.id,ct(_.get(ot),_.get(ft.id)))})};dt.length!=0;)Mt();if(K){var pt=new Set;U.forEach(function(lt,ot){lt.length==0&&pt.add(ot)});var xt=[];_.forEach(function(lt,ot){if(pt.has(ot)){var Lt=!1,ft=!0,st=!1,Xt=void 0;try{for(var Tt=lt[Symbol.iterator](),Ct;!(ft=(Ct=Tt.next()).done);ft=!0){var Bt=Ct.value;K.has(Bt)&&(Lt=!0)}}catch(St){st=!0,Xt=St}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}if(!Lt){var bt=!1,zt=void 0;xt.forEach(function(St,kt){St.has([].concat(f(lt))[0])&&(bt=!0,zt=kt)}),bt?lt.forEach(function(St){xt[zt].add(St)}):xt.push(new Set(lt))}}}),xt.forEach(function(lt,ot){var Lt=Number.POSITIVE_INFINITY,ft=Number.POSITIVE_INFINITY,st=Number.NEGATIVE_INFINITY,Xt=Number.NEGATIVE_INFINITY,Tt=!0,Ct=!1,Bt=void 0;try{for(var bt=lt[Symbol.iterator](),zt;!(Tt=(zt=bt.next()).done);Tt=!0){var St=zt.value,kt=void 0;Z=="horizontal"?kt=u.has(St)?v[u.get(St)]:q.get(St):kt=u.has(St)?L[u.get(St)]:q.get(St);var Kt=et.get(St);kt<Lt&&(Lt=kt),kt>st&&(st=kt),Kt<ft&&(ft=Kt),Kt>Xt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var ce=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),oe;!(Qt=(oe=Jt.next()).done);Qt=!0){var te=oe.value;et.set(te,et.get(te)+ce)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},j=function(U){var Z=0,K=0,q=0,at=0;if(U.forEach(function(_){_.left?v[u.get(_.left)]-v[u.get(_.right)]>=0?Z++:K++:L[u.get(_.top)]-L[u.get(_.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var ct=0;ct<u.size;ct++)v[ct]=-1*v[ct],L[ct]=-1*L[ct];else if(Z>K)for(var nt=0;nt<u.size;nt++)v[nt]=-1*v[nt];else if(q>at)for(var et=0;et<u.size;et++)L[et]=-1*L[et]},n=function(U){var Z=[],K=new g,q=new Set,at=0;return U.forEach(function(ct,nt){if(!q.has(nt)){Z[at]=[];var et=nt;for(K.push(et),q.add(et),Z[at].push(et);K.length!=0;){et=K.shift();var _=U.get(et);_.forEach(function(dt){q.has(dt.id)||(K.push(dt.id),q.add(dt.id),Z[at].push(dt.id))})}at++}}),Z},E=function(U){var Z=new Map;return U.forEach(function(K,q){Z.set(q,[])}),U.forEach(function(K,q){K.forEach(function(at){Z.get(q).push(at),Z.get(at.id).push({id:q,gap:at.gap,direction:at.direction})})}),Z},p=function(U){var Z=new Map;return U.forEach(function(K,q){Z.set(q,[])}),U.forEach(function(K,q){K.forEach(function(at){Z.get(at.id).push({id:q,gap:at.gap,direction:at.direction})})}),Z},m=[],y=[],S=!1,O=!1,F=new Set,W=new Map,R=new Map,Q=[];if(h.fixedNodeConstraint&&h.fixedNodeConstraint.forEach(function(b){F.add(b.nodeId)}),h.relativePlacementConstraint&&(h.relativePlacementConstraint.forEach(function(b){b.left?(W.has(b.left)?W.get(b.left).push({id:b.right,gap:b.gap,direction:"horizontal"}):W.set(b.left,[{id:b.right,gap:b.gap,direction:"horizontal"}]),W.has(b.right)||W.set(b.right,[])):(W.has(b.top)?W.get(b.top).push({id:b.bottom,gap:b.gap,direction:"vertical"}):W.set(b.top,[{id:b.bottom,gap:b.gap,direction:"vertical"}]),W.has(b.bottom)||W.set(b.bottom,[]))}),R=E(W),Q=n(R)),e.TRANSFORM_ON_CONSTRAINT_HANDLING){if(h.fixedNodeConstraint&&h.fixedNodeConstraint.length>1)h.fixedNodeConstraint.forEach(function(b,U){m[U]=[b.position.x,b.position.y],y[U]=[v[u.get(b.nodeId)],L[u.get(b.nodeId)]]}),S=!0;else if(h.alignmentConstraint)(function(){var b=0;if(h.alignmentConstraint.vertical){for(var U=h.alignmentConstraint.vertical,Z=function(et){var _=new Set;U[et].forEach(function(pt){_.add(pt)});var dt=new Set([].concat(f(_)).filter(function(pt){return F.has(pt)})),Mt=void 0;dt.size>0?Mt=v[u.get(dt.values().next().value)]:Mt=$(_).x,U[et].forEach(function(pt){m[b]=[Mt,L[u.get(pt)]],y[b]=[v[u.get(pt)],L[u.get(pt)]],b++})},K=0;K<U.length;K++)Z(K);S=!0}if(h.alignmentConstraint.horizontal){for(var q=h.alignmentConstraint.horizontal,at=function(et){var _=new Set;q[et].forEach(function(pt){_.add(pt)});var dt=new Set([].concat(f(_)).filter(function(pt){return F.has(pt)})),Mt=void 0;dt.size>0?Mt=v[u.get(dt.values().next().value)]:Mt=$(_).y,q[et].forEach(function(pt){m[b]=[v[u.get(pt)],Mt],y[b]=[v[u.get(pt)],L[u.get(pt)]],b++})},ct=0;ct<q.length;ct++)at(ct);S=!0}h.relativePlacementConstraint&&(O=!0)})();else if(h.relativePlacementConstraint){for(var z=0,X=0,rt=0;rt<Q.length;rt++)Q[rt].length>z&&(z=Q[rt].length,X=rt);if(z<R.size/2)j(h.relativePlacementConstraint),S=!1,O=!1;else{var B=new Map,D=new Map,H=[];Q[X].forEach(function(b){W.get(b).forEach(function(U){U.direction=="horizontal"?(B.has(b)?B.get(b).push(U):B.set(b,[U]),B.has(U.id)||B.set(U.id,[]),H.push({left:b,right:U.id})):(D.has(b)?D.get(b).push(U):D.set(b,[U]),D.has(U.id)||D.set(U.id,[]),H.push({top:b,bottom:U.id}))})}),j(H),O=!1;var k=A(B,"horizontal"),tt=A(D,"vertical");Q[X].forEach(function(b,U){y[U]=[v[u.get(b)],L[u.get(b)]],m[U]=[],k.has(b)?m[U][0]=k.get(b):m[U][0]=v[u.get(b)],tt.has(b)?m[U][1]=tt.get(b):m[U][1]=L[u.get(b)]}),S=!0}}if(S){for(var ht=void 0,J=t.transpose(m),It=t.transpose(y),Nt=0;Nt<J.length;Nt++)J[Nt]=t.multGamma(J[Nt]),It[Nt]=t.multGamma(It[Nt]);var vt=t.multMat(J,t.transpose(It)),it=s.svd(vt);ht=t.multMat(it.V,t.transpose(it.U));for(var ut=0;ut<u.size;ut++){var Et=[v[ut],L[ut]],wt=[ht[0][0],ht[1][0]],Ot=[ht[0][1],ht[1][1]];v[ut]=t.dotProduct(Et,wt),L[ut]=t.dotProduct(Et,Ot)}O&&j(h.relativePlacementConstraint)}}if(e.ENFORCE_CONSTRAINTS){if(h.fixedNodeConstraint&&h.fixedNodeConstraint.length>0){var mt={x:0,y:0};h.fixedNodeConstraint.forEach(function(b,U){var Z={x:v[u.get(b.nodeId)],y:L[u.get(b.nodeId)]},K=b.position,q=Y(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=h.fixedNodeConstraint.length,mt.y/=h.fixedNodeConstraint.length,v.forEach(function(b,U){v[U]+=mt.x}),L.forEach(function(b,U){L[U]+=mt.y}),h.fixedNodeConstraint.forEach(function(b){v[u.get(b.nodeId)]=b.position.x,L[u.get(b.nodeId)]=b.position.y})}if(h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var Dt=h.alignmentConstraint.vertical,Rt=function(U){var Z=new Set;Dt[U].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return F.has(at)})),q=void 0;K.size>0?q=v[u.get(K.values().next().value)]:q=$(Z).x,Z.forEach(function(at){F.has(at)||(v[u.get(at)]=q)})},Ht=0;Ht<Dt.length;Ht++)Rt(Ht);if(h.alignmentConstraint.horizontal)for(var Ut=h.alignmentConstraint.horizontal,Pt=function(U){var Z=new Set;Ut[U].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return F.has(at)})),q=void 0;K.size>0?q=L[u.get(K.values().next().value)]:q=$(Z).y,Z.forEach(function(at){F.has(at)||(L[u.get(at)]=q)})},Ft=0;Ft<Ut.length;Ft++)Pt(Ft)}h.relativePlacementConstraint&&(function(){var b=new Map,U=new Map,Z=new Map,K=new Map,q=new Map,at=new Map,ct=new Set,nt=new Set;if(F.forEach(function(Gt){ct.add(Gt),nt.add(Gt)}),h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var et=h.alignmentConstraint.vertical,_=function(yt){Z.set("dummy"+yt,[]),et[yt].forEach(function(At){b.set(At,"dummy"+yt),Z.get("dummy"+yt).push(At),F.has(At)&&ct.add("dummy"+yt)}),q.set("dummy"+yt,v[u.get(et[yt][0])])},dt=0;dt<et.length;dt++)_(dt);if(h.alignmentConstraint.horizontal)for(var Mt=h.alignmentConstraint.horizontal,pt=function(yt){K.set("dummy"+yt,[]),Mt[yt].forEach(function(At){U.set(At,"dummy"+yt),K.get("dummy"+yt).push(At),F.has(At)&&nt.add("dummy"+yt)}),at.set("dummy"+yt,L[u.get(Mt[yt][0])])},xt=0;xt<Mt.length;xt++)pt(xt)}var lt=new Map,ot=new Map,Lt=function(yt){W.get(yt).forEach(function(At){var Zt=void 0,$t=void 0;At.direction=="horizontal"?(Zt=b.get(yt)?b.get(yt):yt,b.get(At.id)?$t={id:b.get(At.id),gap:At.gap,direction:At.direction}:$t=At,lt.has(Zt)?lt.get(Zt).push($t):lt.set(Zt,[$t]),lt.has($t.id)||lt.set($t.id,[])):(Zt=U.get(yt)?U.get(yt):yt,U.get(At.id)?$t={id:U.get(At.id),gap:At.gap,direction:At.direction}:$t=At,ot.has(Zt)?ot.get(Zt).push($t):ot.set(Zt,[$t]),ot.has($t.id)||ot.set($t.id,[]))})},ft=!0,st=!1,Xt=void 0;try{for(var Tt=W.keys()[Symbol.iterator](),Ct;!(ft=(Ct=Tt.next()).done);ft=!0){var Bt=Ct.value;Lt(Bt)}}catch(Gt){st=!0,Xt=Gt}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}var bt=E(lt),zt=E(ot),St=n(bt),kt=n(zt),Kt=p(lt),ce=p(ot),Qt=[],jt=[];St.forEach(function(Gt,yt){Qt[yt]=[],Gt.forEach(function(At){Kt.get(At).length==0&&Qt[yt].push(At)})}),kt.forEach(function(Gt,yt){jt[yt]=[],Gt.forEach(function(At){ce.get(At).length==0&&jt[yt].push(At)})});var _t=A(lt,"horizontal",ct,q,Qt),Jt=A(ot,"vertical",nt,at,jt),oe=function(yt){Z.get(yt)?Z.get(yt).forEach(function(At){v[u.get(At)]=_t.get(yt)}):v[u.get(yt)]=_t.get(yt)},te=!0,ee=!1,Le=void 0;try{for(var ge=_t.keys()[Symbol.iterator](),Ce;!(te=(Ce=ge.next()).done);te=!0){var ue=Ce.value;oe(ue)}}catch(Gt){ee=!0,Le=Gt}finally{try{!te&&ge.return&&ge.return()}finally{if(ee)throw Le}}var ke=function(yt){K.get(yt)?K.get(yt).forEach(function(At){L[u.get(At)]=Jt.get(yt)}):L[u.get(yt)]=Jt.get(yt)},de=!0,we=!1,Me=void 0;try{for(var ve=Jt.keys()[Symbol.iterator](),Ae;!(de=(Ae=ve.next()).done);de=!0){var ue=Ae.value;ke(ue)}}catch(Gt){we=!0,Me=Gt}finally{try{!de&&ve.return&&ve.return()}finally{if(we)throw Me}}})()}for(var Yt=0;Yt<P.length;Yt++){var Vt=P[Yt];Vt.getChild()==null&&Vt.setCenter(v[u.get(Vt.id)],L[u.get(Vt.id)])}},a.exports=o}),551:(a=>{a.exports=w})},N={};function d(a){var r=N[a];if(r!==void 0)return r.exports;var i=N[a]={exports:{}};return x[a](i,i.exports,d),i.exports}var l=d(45);return l})()})})(le)),le.exports}var yr=he.exports,xe;function mr(){return xe||(xe=1,(function(I,M){(function(x,N){I.exports=N(pr())})(yr,function(w){return(()=>{var x={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var i=arguments.length,f=Array(i>1?i-1:0),e=1;e<i;e++)f[e-1]=arguments[e];return f.forEach(function(g){Object.keys(g).forEach(function(t){return r[t]=g[t]})}),r}}),548:((a,r,i)=>{var f=(function(){function t(s,o){var c=[],h=!0,T=!1,u=void 0;try{for(var v=s[Symbol.iterator](),L;!(h=(L=v.next()).done)&&(c.push(L.value),!(o&&c.length===o));h=!0);}catch(P){T=!0,u=P}finally{try{!h&&v.return&&v.return()}finally{if(T)throw u}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=i(140).layoutBase.LinkedList,g={};g.getTopMostNodes=function(t){for(var s={},o=0;o<t.length;o++)s[t[o].id()]=!0;var c=t.filter(function(h,T){typeof h=="number"&&(h=T);for(var u=h.parent()[0];u!=null;){if(s[u.id()])return!1;u=u.parent()[0]}return!0});return c},g.connectComponents=function(t,s,o,c){var h=new e,T=new Set,u=[],v=void 0,L=void 0,P=void 0,C=!1,G=1,V=[],Y=[],$=function(){var j=t.collection();Y.push(j);var n=o[0],E=t.collection();E.merge(n).merge(n.descendants().intersection(s)),u.push(n),E.forEach(function(y){h.push(y),T.add(y),j.merge(y)});for(var p=function(){n=h.shift();var S=t.collection();n.neighborhood().nodes().forEach(function(R){s.intersection(n.edgesWith(R)).length>0&&S.merge(R)});for(var O=0;O<S.length;O++){var F=S[O];if(v=o.intersection(F.union(F.ancestors())),v!=null&&!T.has(v[0])){var W=v.union(v.descendants());W.forEach(function(R){h.push(R),T.add(R),j.merge(R),o.has(R)&&u.push(R)})}}};h.length!=0;)p();if(j.forEach(function(y){s.intersection(y.connectedEdges()).forEach(function(S){j.has(S.source())&&j.has(S.target())&&j.merge(S)})}),u.length==o.length&&(C=!0),!C||C&&G>1){L=u[0],P=L.connectedEdges().length,u.forEach(function(y){y.connectedEdges().length<P&&(P=y.connectedEdges().length,L=y)}),V.push(L.id());var m=t.collection();m.merge(u[0]),u.forEach(function(y){m.merge(y)}),u=[],o=o.difference(m),G++}};do $();while(!C);return c&&V.length>0&&c.set("dummy"+(c.size+1),V),Y},g.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var v=!0,L=!1,P=void 0;try{for(var C=s.nodeIndexes[Symbol.iterator](),G;!(v=(G=C.next()).done);v=!0){var V=G.value,Y=f(V,2),$=Y[0],A=Y[1],j=o.cy.getElementById($);if(j){var n=j.boundingBox(),E=s.xCoords[A]-n.w/2,p=s.xCoords[A]+n.w/2,m=s.yCoords[A]-n.h/2,y=s.yCoords[A]+n.h/2;E<c&&(c=E),p>h&&(h=p),m<T&&(T=m),y>u&&(u=y)}}}catch(R){L=!0,P=R}finally{try{!v&&C.return&&C.return()}finally{if(L)throw P}}var S=t.x-(h+c)/2,O=t.y-(u+T)/2;s.xCoords=s.xCoords.map(function(R){return R+S}),s.yCoords=s.yCoords.map(function(R){return R+O})}else{Object.keys(s).forEach(function(R){var Q=s[R],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,B=Q.getRect().y+Q.getRect().height;z<c&&(c=z),X>h&&(h=X),rt<T&&(T=rt),B>u&&(u=B)});var F=t.x-(h+c)/2,W=t.y-(u+T)/2;Object.keys(s).forEach(function(R){var Q=s[R];Q.setCenter(Q.getCenterX()+F,Q.getCenterY()+W)})}}},g.calcBoundingBox=function(t,s,o,c){for(var h=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER,v=Number.MIN_SAFE_INTEGER,L=void 0,P=void 0,C=void 0,G=void 0,V=t.descendants().not(":parent"),Y=V.length,$=0;$<Y;$++){var A=V[$];L=s[c.get(A.id())]-A.width()/2,P=s[c.get(A.id())]+A.width()/2,C=o[c.get(A.id())]-A.height()/2,G=o[c.get(A.id())]+A.height()/2,h>L&&(h=L),T<P&&(T=P),u>C&&(u=C),v<G&&(v=G)}var j={};return j.topLeftX=h,j.topLeftY=u,j.width=T-h,j.height=v-u,j},g.calcParentsWithoutChildren=function(t,s){var o=t.collection();return s.nodes(":parent").forEach(function(c){var h=!1;c.children().forEach(function(T){T.css("display")!="none"&&(h=!0)}),h||o.merge(c)}),o},a.exports=g}),816:((a,r,i)=>{var f=i(548),e=i(140).CoSELayout,g=i(140).CoSENode,t=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,o=i(140).layoutBase.LayoutConstants,c=i(140).layoutBase.FDLayoutConstants,h=i(140).CoSEConstants,T=function(v,L){var P=v.cy,C=v.eles,G=C.nodes(),V=C.edges(),Y=void 0,$=void 0,A=void 0,j={};v.randomize&&(Y=L.nodeIndexes,$=L.xCoords,A=L.yCoords);var n=function(R){return typeof R=="function"},E=function(R,Q){return n(R)?R(Q):R},p=f.calcParentsWithoutChildren(P,C),m=function W(R,Q,z,X){for(var rt=Q.length,B=0;B<rt;B++){var D=Q[B],H=null;D.intersection(p).length==0&&(H=D.children());var k=void 0,tt=D.layoutDimensions({nodeDimensionsIncludeLabels:X.nodeDimensionsIncludeLabels});if(D.outerWidth()!=null&&D.outerHeight()!=null)if(X.randomize)if(!D.isParent())k=R.add(new g(z.graphManager,new t($[Y.get(D.id())]-tt.w/2,A[Y.get(D.id())]-tt.h/2),new s(parseFloat(tt.w),parseFloat(tt.h))));else{var ht=f.calcBoundingBox(D,$,A,Y);D.intersection(p).length==0?k=R.add(new g(z.graphManager,new t(ht.topLeftX,ht.topLeftY),new s(ht.width,ht.height))):k=R.add(new g(z.graphManager,new t(ht.topLeftX,ht.topLeftY),new s(parseFloat(tt.w),parseFloat(tt.h))))}else k=R.add(new g(z.graphManager,new t(D.position("x")-tt.w/2,D.position("y")-tt.h/2),new s(parseFloat(tt.w),parseFloat(tt.h))));else k=R.add(new g(this.graphManager));if(k.id=D.data("id"),k.nodeRepulsion=E(X.nodeRepulsion,D),k.paddingLeft=parseInt(D.css("padding")),k.paddingTop=parseInt(D.css("padding")),k.paddingRight=parseInt(D.css("padding")),k.paddingBottom=parseInt(D.css("padding")),X.nodeDimensionsIncludeLabels&&(k.labelWidth=D.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,k.labelHeight=D.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,k.labelPosVertical=D.css("text-valign"),k.labelPosHorizontal=D.css("text-halign")),j[D.data("id")]=k,isNaN(k.rect.x)&&(k.rect.x=0),isNaN(k.rect.y)&&(k.rect.y=0),H!=null&&H.length>0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(R,Q,z){for(var X=0,rt=0,B=0;B<z.length;B++){var D=z[B],H=j[D.data("source")],k=j[D.data("target")];if(H&&k&&H!==k&&H.getEdgesBetween(k).length==0){var tt=Q.add(R.newEdge(),H,k);tt.id=D.id(),tt.idealLength=E(v.idealEdgeLength,D),tt.edgeElasticity=E(v.edgeElasticity,D),X+=tt.idealLength,rt++}}v.idealEdgeLength!=null&&(rt>0?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(v.idealEdgeLength)?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=v.idealEdgeLength,h.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,h.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},S=function(R,Q){Q.fixedNodeConstraint&&(R.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(R.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(R.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};v.nestingFactor!=null&&(h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.nestingFactor),v.gravity!=null&&(h.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=v.gravity),v.numIter!=null&&(h.MAX_ITERATIONS=c.MAX_ITERATIONS=v.numIter),v.gravityRange!=null&&(h.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=v.gravityRange),v.gravityCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.gravityCompound),v.gravityRangeCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.gravityRangeCompound),v.initialEnergyOnIncremental!=null&&(h.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.initialEnergyOnIncremental),v.tilingCompareBy!=null&&(h.TILING_COMPARE_BY=v.tilingCompareBy),v.quality=="proof"?o.QUALITY=2:o.QUALITY=0,h.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=v.nodeDimensionsIncludeLabels,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!v.randomize,h.ANIMATE=c.ANIMATE=o.ANIMATE=v.animate,h.TILE=v.tile,h.TILING_PADDING_VERTICAL=typeof v.tilingPaddingVertical=="function"?v.tilingPaddingVertical.call():v.tilingPaddingVertical,h.TILING_PADDING_HORIZONTAL=typeof v.tilingPaddingHorizontal=="function"?v.tilingPaddingHorizontal.call():v.tilingPaddingHorizontal,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,h.PURE_INCREMENTAL=!v.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=v.uniformNodeDimensions,v.step=="transformed"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!1),v.step=="enforced"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!1),v.step=="cose"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!0),v.step=="all"&&(v.randomize?h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!0),v.fixedNodeConstraint||v.alignmentConstraint||v.relativePlacementConstraint?h.TREE_REDUCTION_ON_INCREMENTAL=!1:h.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,F=O.newGraphManager();return m(F.addRoot(),f.getTopMostNodes(G),O,v),y(O,F,V),S(O,v),O.runLayout(),j};a.exports={coseLayout:T}}),212:((a,r,i)=>{var f=(function(){function v(L,P){for(var C=0;C<P.length;C++){var G=P[C];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(L,G.key,G)}}return function(L,P,C){return P&&v(L.prototype,P),C&&v(L,C),L}})();function e(v,L){if(!(v instanceof L))throw new TypeError("Cannot call a class as a function")}var g=i(658),t=i(548),s=i(657),o=s.spectralLayout,c=i(816),h=c.coseLayout,T=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(L){return 4500},idealEdgeLength:function(L){return 50},edgeElasticity:function(L){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),u=(function(){function v(L){e(this,v),this.options=g({},T,L)}return f(v,[{key:"run",value:function(){var P=this,C=this.options,G=C.cy,V=C.eles,Y=[],$=[],A=void 0,j=[];C.fixedNodeConstraint&&(!Array.isArray(C.fixedNodeConstraint)||C.fixedNodeConstraint.length==0)&&(C.fixedNodeConstraint=void 0),C.alignmentConstraint&&(C.alignmentConstraint.vertical&&(!Array.isArray(C.alignmentConstraint.vertical)||C.alignmentConstraint.vertical.length==0)&&(C.alignmentConstraint.vertical=void 0),C.alignmentConstraint.horizontal&&(!Array.isArray(C.alignmentConstraint.horizontal)||C.alignmentConstraint.horizontal.length==0)&&(C.alignmentConstraint.horizontal=void 0)),C.relativePlacementConstraint&&(!Array.isArray(C.relativePlacementConstraint)||C.relativePlacementConstraint.length==0)&&(C.relativePlacementConstraint=void 0);var n=C.fixedNodeConstraint||C.alignmentConstraint||C.relativePlacementConstraint;n&&(C.tile=!1,C.packComponents=!1);var E=void 0,p=!1;if(G.layoutUtilities&&C.packComponents&&(E=G.layoutUtilities("get"),E||(E=G.layoutUtilities()),p=!0),V.nodes().length>0)if(p){var S=t.getTopMostNodes(C.eles.nodes());if(A=t.connectComponents(G,C.eles,S),A.forEach(function(vt){var it=vt.boundingBox();j.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),C.randomize&&A.forEach(function(vt){C.eles=vt,Y.push(o(C))}),C.quality=="default"||C.quality=="proof"){var O=G.collection();if(C.tile){var F=new Map,W=[],R=[],Q=0,z={nodeIndexes:F,xCoords:W,yCoords:R},X=[];if(A.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){O.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),O.length>1){var rt=O.boundingBox();j.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),A.push(O),Y.push(z);for(var B=X.length-1;B>=0;B--)A.splice(X[B],1),Y.splice(X[B],1),j.splice(X[B],1)}}A.forEach(function(vt,it){C.eles=vt,$.push(h(C,Y[it])),t.relocateComponent(j[it],$[it],C)})}else A.forEach(function(vt,it){t.relocateComponent(j[it],Y[it],C)});var D=new Set;if(A.length>1){var H=[],k=V.filter(function(vt){return vt.css("display")=="none"});A.forEach(function(vt,it){var ut=void 0;if(C.quality=="draft"&&(ut=Y[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var wt=void 0;vt.nodes().not(k).forEach(function(Ot){if(C.quality=="draft")if(!Ot.isParent())wt=ut.get(Ot.id()),Et.nodes.push({x:Y[it].xCoords[wt]-Ot.boundingbox().w/2,y:Y[it].yCoords[wt]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var mt=t.calcBoundingBox(Ot,Y[it].xCoords,Y[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else $[it][Ot.id()]&&Et.nodes.push({x:$[it][Ot.id()].getLeft(),y:$[it][Ot.id()].getTop(),width:$[it][Ot.id()].getWidth(),height:$[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var mt=Ot.source(),Dt=Ot.target();if(mt.css("display")!="none"&&Dt.css("display")!="none")if(C.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Dt.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,Y[it].xCoords,Y[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[it].xCoords[Rt]),Ut.push(Y[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,Y[it].xCoords,Y[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(Y[it].xCoords[Ht]),Pt.push(Y[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else $[it][mt.id()]&&$[it][Dt.id()]&&Et.edges.push({startX:$[it][mt.id()].getCenterX(),startY:$[it][mt.id()].getCenterY(),endX:$[it][Dt.id()].getCenterX(),endY:$[it][Dt.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),D.add(it))}});var tt=E.packComponents(H,C.randomize).shifts;if(C.quality=="draft")Y.forEach(function(vt,it){var ut=vt.xCoords.map(function(wt){return wt+tt[it].dx}),Et=vt.yCoords.map(function(wt){return wt+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;D.forEach(function(vt){Object.keys($[vt]).forEach(function(it){var ut=$[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=C.eles.boundingBox();if(j.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),C.randomize){var y=o(C);Y.push(y)}C.quality=="default"||C.quality=="proof"?($.push(h(C,Y[0])),t.relocateComponent(j[0],$[0],C)):t.relocateComponent(j[0],Y[0],C)}var J=function(it,ut){if(C.quality=="default"||C.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,wt=void 0,Ot=it.data("id");return $.forEach(function(Dt){Ot in Dt&&(Et={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},wt=Dt[Ot])}),C.nodeDimensionsIncludeLabels&&(wt.labelWidth&&(wt.labelPosHorizontal=="left"?Et.x+=wt.labelWidth/2:wt.labelPosHorizontal=="right"&&(Et.x-=wt.labelWidth/2)),wt.labelHeight&&(wt.labelPosVertical=="top"?Et.y+=wt.labelHeight/2:wt.labelPosVertical=="bottom"&&(Et.y-=wt.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return Y.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var It=t.calcParentsWithoutChildren(G,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});C.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(P,C,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),v})();a.exports=u}),657:((a,r,i)=>{var f=i(548),e=i(140).layoutBase.Matrix,g=i(140).layoutBase.SVD,t=function(o){var c=o.cy,h=o.eles,T=h.nodes(),u=h.nodes(":parent"),v=new Map,L=new Map,P=new Map,C=[],G=[],V=[],Y=[],$=[],A=[],j=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,S=o.samplingType,O=o.nodeSeparation,F=void 0,W=function(){for(var U=0,Z=0,K=!1;Z<F;){U=Math.floor(Math.random()*E),K=!1;for(var q=0;q<Z;q++)if(Y[q]==U){K=!0;break}if(!K)Y[Z]=U,Z++;else continue}},R=function(U,Z,K){for(var q=[],at=0,ct=0,nt=0,et=void 0,_=[],dt=0,Mt=1,pt=0;pt<E;pt++)_[pt]=p;for(q[ct]=U,_[U]=0;ct>=at;){nt=q[at++];for(var xt=C[nt],lt=0;lt<xt.length;lt++)et=L.get(xt[lt]),_[et]==p&&(_[et]=_[nt]+1,q[++ct]=et);A[nt][Z]=_[nt]*O}if(K){for(var ot=0;ot<E;ot++)A[ot][Z]<$[ot]&&($[ot]=A[ot][Z]);for(var Lt=0;Lt<E;Lt++)$[Lt]>dt&&(dt=$[Lt],Mt=Lt)}return Mt},Q=function(U){var Z=void 0;if(U){Z=Math.floor(Math.random()*E);for(var q=0;q<E;q++)$[q]=p;for(var at=0;at<F;at++)Y[at]=Z,Z=R(Z,at,U)}else{W();for(var K=0;K<F;K++)R(Y[K],K,U)}for(var ct=0;ct<E;ct++)for(var nt=0;nt<F;nt++)A[ct][nt]*=A[ct][nt];for(var et=0;et<F;et++)j[et]=[];for(var _=0;_<F;_++)for(var dt=0;dt<F;dt++)j[_][dt]=A[Y[dt]][_]},z=function(){for(var U=g.svd(j),Z=U.S,K=U.U,q=U.V,at=Z[0]*Z[0]*Z[0],ct=[],nt=0;nt<F;nt++){ct[nt]=[];for(var et=0;et<F;et++)ct[nt][et]=0,nt==et&&(ct[nt][et]=Z[nt]/(Z[nt]*Z[nt]+at/(Z[nt]*Z[nt])))}n=e.multMat(e.multMat(q,ct),e.transpose(K))},X=function(){for(var U=void 0,Z=void 0,K=[],q=[],at=[],ct=[],nt=0;nt<E;nt++)K[nt]=Math.random(),q[nt]=Math.random();K=e.normalize(K),q=e.normalize(q);for(var et=m,_=m,dt=void 0;;){for(var Mt=0;Mt<E;Mt++)at[Mt]=K[Mt];if(K=e.multGamma(e.multL(e.multGamma(at),A,n)),U=e.dotProduct(at,K),K=e.normalize(K),et=e.dotProduct(at,K),dt=Math.abs(et/_),dt<=1+y&&dt>=1)break;_=et}for(var pt=0;pt<E;pt++)at[pt]=K[pt];for(_=m;;){for(var xt=0;xt<E;xt++)ct[xt]=q[xt];if(ct=e.minusOp(ct,e.multCons(at,e.dotProduct(at,ct))),q=e.multGamma(e.multL(e.multGamma(ct),A,n)),Z=e.dotProduct(ct,q),q=e.normalize(q),et=e.dotProduct(ct,q),dt=Math.abs(et/_),dt<=1+y&&dt>=1)break;_=et}for(var lt=0;lt<E;lt++)ct[lt]=q[lt];G=e.multCons(at,Math.sqrt(Math.abs(U))),V=e.multCons(ct,Math.sqrt(Math.abs(Z)))};f.connectComponents(c,h,f.getTopMostNodes(T),v),u.forEach(function(b){f.connectComponents(c,h,f.getTopMostNodes(b.descendants().intersection(h)),v)});for(var rt=0,B=0;B<T.length;B++)T[B].isParent()||L.set(T[B].id(),rt++);var D=!0,H=!1,k=void 0;try{for(var tt=v.keys()[Symbol.iterator](),ht;!(D=(ht=tt.next()).done);D=!0){var J=ht.value;L.set(J,rt++)}}catch(b){H=!0,k=b}finally{try{!D&&tt.return&&tt.return()}finally{if(H)throw k}}for(var It=0;It<L.size;It++)C[It]=[];u.forEach(function(b){for(var U=b.children().intersection(h);U.nodes(":childless").length==0;)U=U.nodes()[0].children().intersection(h);var Z=0,K=U.nodes(":childless")[0].connectedEdges().length;U.nodes(":childless").forEach(function(q,at){q.connectedEdges().length<K&&(K=q.connectedEdges().length,Z=at)}),P.set(b.id(),U.nodes(":childless")[Z].id())}),T.forEach(function(b){var U=void 0;b.isParent()?U=L.get(P.get(b.id())):U=L.get(b.id()),b.neighborhood().nodes().forEach(function(Z){h.intersection(b.edgesWith(Z)).length>0&&(Z.isParent()?C[U].push(P.get(Z.id())):C[U].push(Z.id()))})});var Nt=function(U){var Z=L.get(U),K=void 0;v.get(U).forEach(function(q){c.getElementById(q).isParent()?K=P.get(q):K=q,C[Z].push(K),C[L.get(K)].push(U)})},vt=!0,it=!1,ut=void 0;try{for(var Et=v.keys()[Symbol.iterator](),wt;!(vt=(wt=Et.next()).done);vt=!0){var Ot=wt.value;Nt(Ot)}}catch(b){it=!0,ut=b}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=L.size;var mt=void 0;if(E>2){F=E<o.sampleSize?E:o.sampleSize;for(var Dt=0;Dt<E;Dt++)A[Dt]=[];for(var Rt=0;Rt<F;Rt++)n[Rt]=[];return o.quality=="draft"||o.step=="all"?(Q(S),z(),X(),mt={nodeIndexes:L,xCoords:G,yCoords:V}):(L.forEach(function(b,U){G.push(c.getElementById(U).position("x")),V.push(c.getElementById(U).position("y"))}),mt={nodeIndexes:L,xCoords:G,yCoords:V}),mt}else{var Ht=L.keys(),Ut=c.getElementById(Ht.next().value),Pt=Ut.position(),Ft=Ut.outerWidth();if(G.push(Pt.x),V.push(Pt.y),E==2){var Yt=c.getElementById(Ht.next().value),Vt=Yt.outerWidth();G.push(Pt.x+Ft/2+Vt/2+o.idealEdgeLength),V.push(Pt.y)}return mt={nodeIndexes:L,xCoords:G,yCoords:V},mt}};a.exports={spectralLayout:t}}),579:((a,r,i)=>{var f=i(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),a.exports=e}),140:(a=>{a.exports=w})},N={};function d(a){var r=N[a];if(r!==void 0)return r.exports;var i=N[a]={exports:{}};return x[a](i,i.exports,d),i.exports}var l=d(579);return l})()})})(he)),he.exports}var Er=mr();const Tr=gr(Er);var Ie={L:"left",R:"right",T:"top",B:"bottom"},Re={L:gt(I=>`${I},${I/2} 0,${I} 0,0`,"L"),R:gt(I=>`0,${I/2} ${I},0 ${I},${I}`,"R"),T:gt(I=>`0,0 ${I},0 ${I/2},${I}`,"T"),B:gt(I=>`${I/2},0 ${I},${I} 0,${I}`,"B")},se={L:gt((I,M)=>I-M+2,"L"),R:gt((I,M)=>I-2,"R"),T:gt((I,M)=>I-M+2,"T"),B:gt((I,M)=>I-2,"B")},Nr=gt(function(I){return Wt(I)?I==="L"?"R":"L":I==="T"?"B":"T"},"getOppositeArchitectureDirection"),Se=gt(function(I){const M=I;return M==="L"||M==="R"||M==="T"||M==="B"},"isArchitectureDirection"),Wt=gt(function(I){const M=I;return M==="L"||M==="R"},"isArchitectureDirectionX"),qt=gt(function(I){const M=I;return M==="T"||M==="B"},"isArchitectureDirectionY"),Ne=gt(function(I,M){const w=Wt(I)&&qt(M),x=qt(I)&&Wt(M);return w||x},"isArchitectureDirectionXY"),Lr=gt(function(I){const M=I[0],w=I[1],x=Wt(M)&&qt(w),N=qt(M)&&Wt(w);return x||N},"isArchitecturePairXY"),Cr=gt(function(I){return I!=="LL"&&I!=="RR"&&I!=="TT"&&I!=="BB"},"isValidArchitectureDirectionPair"),ye=gt(function(I,M){const w=`${I}${M}`;return Cr(w)?w:void 0},"getArchitectureDirectionPair"),wr=gt(function([I,M],w){const x=w[0],N=w[1];return Wt(x)?qt(N)?[I+(x==="L"?-1:1),M+(N==="T"?1:-1)]:[I+(x==="L"?-1:1),M]:Wt(N)?[I+(N==="L"?1:-1),M+(x==="T"?1:-1)]:[I,M+(x==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Mr=gt(function(I){return I==="LT"||I==="TL"?[1,1]:I==="BL"||I==="LB"?[1,-1]:I==="BR"||I==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=gt(function(I,M){return Ne(I,M)?"bend":Wt(I)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Or=gt(function(I){return I.type==="service"},"isArchitectureService"),Dr=gt(function(I){return I.type==="junction"},"isArchitectureJunction"),Pe=gt(I=>I.data(),"edgeData"),ie=gt(I=>I.data(),"nodeData"),xr=nr.architecture,ae,Ge=(ae=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Je,this.getAccTitle=Ke,this.setDiagramTitle=je,this.getDiagramTitle=_e,this.getAccDescription=tr,this.setAccDescription=er,this.clear()}setDiagramId(M){this.diagramId=M}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",rr()}addService({id:M,icon:w,in:x,title:N,iconText:d}){if(this.registeredIds[M]!==void 0)throw new Error(`The service id [${M}] is already in use by another ${this.registeredIds[M]}`);if(x!==void 0){if(M===x)throw new Error(`The service [${M}] cannot be placed within itself`);if(this.registeredIds[x]===void 0)throw new Error(`The service [${M}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[x]==="node")throw new Error(`The service [${M}]'s parent is not a group`)}this.registeredIds[M]="node",this.nodes[M]={id:M,type:"service",icon:w,iconText:d,title:N,edges:[],in:x}}getServices(){return Object.values(this.nodes).filter(Or)}addJunction({id:M,in:w}){if(this.registeredIds[M]!==void 0)throw new Error(`The junction id [${M}] is already in use by another ${this.registeredIds[M]}`);if(w!==void 0){if(M===w)throw new Error(`The junction [${M}] cannot be placed within itself`);if(this.registeredIds[w]===void 0)throw new Error(`The junction [${M}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[w]==="node")throw new Error(`The junction [${M}]'s parent is not a group`)}this.registeredIds[M]="node",this.nodes[M]={id:M,type:"junction",edges:[],in:w}}getJunctions(){return Object.values(this.nodes).filter(Dr)}getNodes(){return Object.values(this.nodes)}getNode(M){return this.nodes[M]??null}addGroup({id:M,icon:w,in:x,title:N}){var d,l,a;if(((d=this.registeredIds)==null?void 0:d[M])!==void 0)throw new Error(`The group id [${M}] is already in use by another ${this.registeredIds[M]}`);if(x!==void 0){if(M===x)throw new Error(`The group [${M}] cannot be placed within itself`);if(((l=this.registeredIds)==null?void 0:l[x])===void 0)throw new Error(`The group [${M}]'s parent does not exist. Please make sure the parent is created before this group`);if(((a=this.registeredIds)==null?void 0:a[x])==="node")throw new Error(`The group [${M}]'s parent is not a group`)}this.registeredIds[M]="group",this.groups[M]={id:M,icon:w,title:N,in:x}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:M,rhsId:w,lhsDir:x,rhsDir:N,lhsInto:d,rhsInto:l,lhsGroup:a,rhsGroup:r,title:i}){if(!Se(x))throw new Error(`Invalid direction given for left hand side of edge ${M}--${w}. Expected (L,R,T,B) got ${String(x)}`);if(!Se(N))throw new Error(`Invalid direction given for right hand side of edge ${M}--${w}. Expected (L,R,T,B) got ${String(N)}`);if(this.nodes[M]===void 0&&this.groups[M]===void 0)throw new Error(`The left-hand id [${M}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[w]===void 0&&this.groups[w]===void 0)throw new Error(`The right-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);const f=this.nodes[M].in,e=this.nodes[w].in;if(a&&f&&e&&f==e)throw new Error(`The left-hand id [${M}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(r&&f&&e&&f==e)throw new Error(`The right-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const g={lhsId:M,lhsDir:x,lhsInto:d,lhsGroup:a,rhsId:w,rhsDir:N,rhsInto:l,rhsGroup:r,title:i};this.edges.push(g),this.nodes[M]&&this.nodes[w]&&(this.nodes[M].edges.push(this.edges[this.edges.length-1]),this.nodes[w].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(M){if(M.members.length<2)throw new Error(`An align directive requires at least two members; got ${M.members.length}`);const w=new Set;M.members.forEach(x=>{if(this.registeredIds[x]!=="node")throw new Error(`align ${M.direction} references [${x}], which is not a service or junction`);if(w.has(x))throw new Error(`align ${M.direction} lists [${x}] more than once`);w.add(x)}),this.layoutHints.push(M)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const M={},w=Object.entries(this.nodes).reduce((r,[i,f])=>(r[i]=f.edges.reduce((e,g)=>{var o,c;const t=(o=this.getNode(g.lhsId))==null?void 0:o.in,s=(c=this.getNode(g.rhsId))==null?void 0:c.in;if(t&&s&&t!==s){const h=Ar(g.lhsDir,g.rhsDir);h!=="bend"&&(M[t]??(M[t]={}),M[t][s]=h,M[s]??(M[s]={}),M[s][t]=h)}if(g.lhsId===i){const h=ye(g.lhsDir,g.rhsDir);h&&(e[h]=g.rhsId)}else{const h=ye(g.rhsDir,g.lhsDir);h&&(e[h]=g.lhsId)}return e},{}),r),{}),x=Object.keys(w)[0],N={[x]:1},d=Object.keys(w).reduce((r,i)=>i===x?r:{...r,[i]:1},{}),l=gt(r=>{const i={[r]:[0,0]},f=[r];for(;f.length>0;){const e=f.shift();if(e){N[e]=1,delete d[e];const g=w[e],[t,s]=i[e];Object.entries(g).forEach(([o,c])=>{N[c]||(i[c]=wr([t,s],o),f.push(c))})}}return i},"BFS"),a=[l(x)];for(;Object.keys(d).length>0;)a.push(l(Object.keys(d)[0]));this.dataStructures={adjList:w,spatialMaps:a,groupAlignments:M}}return this.dataStructures}setElementForId(M,w){this.elements[M]=w}getElementById(M){return this.elements[M]}getConfig(){return ir({...xr,...ar().architecture})}getConfigField(M){return this.getConfig()[M]}},gt(ae,"ArchitectureDB"),ae),Ir=gt((I,M)=>{var w;Ze(I,M),I.groups.map(x=>M.addGroup(x)),I.services.map(x=>M.addService({...x,type:"service"})),I.junctions.map(x=>M.addJunction({...x,type:"junction"})),I.edges.map(x=>M.addEdge(x)),(w=I.alignments)==null||w.map(x=>M.addLayoutHint({direction:x.direction,members:[...x.members]}))},"populateDb"),Ue={parser:{yy:void 0},parse:gt(async I=>{var x;const M=await cr("architecture",I);Fe.debug(M);const w=(x=Ue.parser)==null?void 0:x.yy;if(!(w instanceof Ge))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ir(M,w)},"parse")},Rr=gt(I=>`
2
- .edge {
3
- stroke-width: ${I.archEdgeWidth};
4
- stroke: ${I.archEdgeColor};
5
- fill: none;
6
- }
7
-
8
- .arrow {
9
- fill: ${I.archEdgeArrowColor};
10
- }
11
-
12
- .node-bkg {
13
- fill: none;
14
- stroke: ${I.archGroupBorderColor};
15
- stroke-width: ${I.archGroupBorderWidth};
16
- stroke-dasharray: 8;
17
- }
18
- .node-icon-text {
19
- display: flex;
20
- align-items: center;
21
- }
22
-
23
- .node-icon-text > div {
24
- color: #fff;
25
- margin: 1px;
26
- height: fit-content;
27
- text-align: center;
28
- overflow: hidden;
29
- display: -webkit-box;
30
- -webkit-box-orient: vertical;
31
- }
32
- `,"getStyles"),Sr=Rr;function me(I,M){if(I===0)return M();const w=Math.random;let x=I>>>0;Math.random=function(){x=x+1831565813>>>0;let N=x;return N=Math.imul(N^N>>>15,N|1),N^=N+Math.imul(N^N>>>7,N|61),((N^N>>>14)>>>0)/4294967296};try{return M()}finally{Math.random=w}}gt(me,"withSeededRandom");var re=gt(I=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${I}</g>`,"wrapIcon"),ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:re('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:re('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:re('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:re('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:fr,blank:{body:re("")}}},Fr=gt(async function(I,M,w,x){const N=w.getConfigField("padding"),d=w.getConfigField("iconSize"),l=d/2,a=d/6,r=a/2;await Promise.all(M.edges().map(async i=>{var Y,$;const{source:f,sourceDir:e,sourceArrow:g,sourceGroup:t,target:s,targetDir:o,targetArrow:c,targetGroup:h,label:T}=Pe(i);let{x:u,y:v}=i[0].sourceEndpoint();const{x:L,y:P}=i[0].midpoint();let{x:C,y:G}=i[0].targetEndpoint();const V=N+4;if(t&&(Wt(e)?u+=e==="L"?-V:V:v+=e==="T"?-V:V+18),h&&(Wt(o)?C+=o==="L"?-V:V:G+=o==="T"?-V:V+18),!t&&((Y=w.getNode(f))==null?void 0:Y.type)==="junction"&&(Wt(e)?u+=e==="L"?l:-l:v+=e==="T"?l:-l),!h&&(($=w.getNode(s))==null?void 0:$.type)==="junction"&&(Wt(o)?C+=o==="L"?l:-l:G+=o==="T"?l:-l),i[0]._private.rscratch){const A=I.insert("g");if(A.insert("path").attr("d",`M ${u},${v} L ${L},${P} L${C},${G} `).attr("class","edge").attr("id",`${x}-${hr(f,s,{prefix:"L"})}`),g){const j=Wt(e)?se[e](u,a):u-r,n=qt(e)?se[e](v,a):v-r;A.insert("polygon").attr("points",Re[e](a)).attr("transform",`translate(${j},${n})`).attr("class","arrow")}if(c){const j=Wt(o)?se[o](C,a):C-r,n=qt(o)?se[o](G,a):G-r;A.insert("polygon").attr("points",Re[o](a)).attr("transform",`translate(${j},${n})`).attr("class","arrow")}if(T){const j=Ne(e,o)?"XY":Wt(e)?"X":"Y";let n=0;j==="X"?n=Math.abs(u-C):j==="Y"?n=Math.abs(v-G)/1.5:n=Math.abs(u-C)/2;const E=A.append("g");if(await Te(E,T,{useHtmlLabels:!1,width:n,classes:"architecture-service-label"},Ee()),E.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),j==="X")E.attr("transform","translate("+L+", "+P+")");else if(j==="Y")E.attr("transform","translate("+L+", "+P+") rotate(-90)");else if(j==="XY"){const p=ye(e,o);if(p&&Lr(p)){const m=E.node().getBoundingClientRect(),[y,S]=Mr(p);E.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*y*S*45})`);const O=E.node().getBoundingClientRect();E.attr("transform",`
33
- translate(${L}, ${P-m.height/2})
34
- translate(${y*O.width/2}, ${S*O.height/2})
35
- rotate(${-1*y*S*45}, 0, ${m.height/2})
36
- `)}}}}}))},"drawEdges"),br=gt(async function(I,M,w,x){const d=w.getConfigField("padding")*.75,l=w.getConfigField("fontSize"),r=w.getConfigField("iconSize")/2;await Promise.all(M.nodes().map(async i=>{const f=ie(i);if(f.type==="group"){const{h:e,w:g,x1:t,y1:s}=i.boundingBox(),o=I.append("rect");o.attr("id",`${x}-group-${f.id}`).attr("x",t+r).attr("y",s+r).attr("width",g).attr("height",e).attr("class","node-bkg");const c=I.append("g");let h=t,T=s;if(f.icon){const u=c.append("g");u.html(`<g>${await pe(f.icon,{height:d,width:d,fallbackPrefix:ne.prefix})}</g>`),u.attr("transform","translate("+(h+r+1)+", "+(T+r+1)+")"),h+=d,T+=l/2-1-2}if(f.label){const u=c.append("g");await Te(u,f.label,{useHtmlLabels:!1,width:g,classes:"architecture-service-label"},Ee()),u.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),u.attr("transform","translate("+(h+r+4)+", "+(T+r+2)+")")}w.setElementForId(f.id,o)}}))},"drawGroups"),Pr=gt(async function(I,M,w,x){const N=Ee();for(const d of w){const l=M.append("g"),a=I.getConfigField("iconSize");if(d.title){const e=l.append("g");await Te(e,d.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},N),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),e.attr("transform","translate("+a/2+", "+a+")")}const r=l.append("g");if(d.icon)r.html(`<g>${await pe(d.icon,{height:a,width:a,fallbackPrefix:ne.prefix})}</g>`);else if(d.iconText){r.html(`<g>${await pe("blank",{height:a,width:a,fallbackPrefix:ne.prefix})}</g>`);const t=r.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(or(d.iconText,N)),s=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/s)};`)}else r.append("path").attr("class","node-bkg").attr("id",`${x}-node-${d.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);l.attr("id",`${x}-service-${d.id}`).attr("class","architecture-service");const{width:i,height:f}=l.node().getBBox();d.width=i,d.height=f,I.setElementForId(d.id,l)}return 0},"drawServices"),Gr=gt(function(I,M,w,x){w.forEach(N=>{const d=M.append("g"),l=I.getConfigField("iconSize");d.append("g").append("rect").attr("id",`${x}-node-${N.id}`).attr("fill-opacity","0").attr("width",l).attr("height",l),d.attr("class","architecture-junction");const{width:r,height:i}=d._groups[0][0].getBBox();d.width=r,d.height=i,I.setElementForId(N.id,d)})},"drawJunctions");lr([{name:ne.prefix,icons:ne}]);be.use(Tr);function Ye(I,M,w){I.forEach(x=>{M.add({group:"nodes",data:{type:"service",id:x.id,icon:x.icon,label:x.title,parent:x.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-service"})})}gt(Ye,"addServices");function Xe(I,M,w){I.forEach(x=>{M.add({group:"nodes",data:{type:"junction",id:x.id,parent:x.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-junction"})})}gt(Xe,"addJunctions");function He(I,M){M.nodes().map(w=>{const x=ie(w);if(x.type==="group")return;x.x=w.position().x,x.y=w.position().y,I.getElementById(x.id).attr("transform","translate("+(x.x||0)+","+(x.y||0)+")")})}gt(He,"positionNodes");function We(I,M){I.forEach(w=>{M.add({group:"nodes",data:{type:"group",id:w.id,icon:w.icon,label:w.title,parent:w.in},classes:"node-group"})})}gt(We,"addGroups");function Ve(I,M){I.forEach(w=>{const{lhsId:x,rhsId:N,lhsInto:d,lhsGroup:l,rhsInto:a,lhsDir:r,rhsDir:i,rhsGroup:f,title:e}=w,g=Ne(w.lhsDir,w.rhsDir)?"segments":"straight",t={id:`${x}-${N}`,label:e,source:x,sourceDir:r,sourceArrow:d,sourceGroup:l,sourceEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%",target:N,targetDir:i,targetArrow:a,targetGroup:f,targetEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%"};M.add({group:"edges",data:t,classes:g})})}gt(Ve,"addEdges");function ze(I,M,w,x=[]){const N=gt((g,t)=>Object.entries(g).reduce((s,[o,c])=>{var u;let h=0;const T=Object.entries(c);if(T.length===1)return s[o]=T[0][1],s;for(let v=0;v<T.length-1;v++)for(let L=v+1;L<T.length;L++){const[P,C]=T[v],[G,V]=T[L];if(((u=w[P])==null?void 0:u[G])===t)s[o]??(s[o]=[]),s[o]=[...s[o],...C,...V];else if(P==="default"||G==="default")s[o]??(s[o]=[]),s[o]=[...s[o],...C,...V];else{const $=`${o}-${h++}`;s[$]=C;const A=`${o}-${h++}`;s[A]=V}}return s},{}),"flattenAlignments"),d=M.map(g=>{const t={},s={};return Object.entries(g).forEach(([o,[c,h]])=>{var u,v,L;const T=((u=I.getNode(o))==null?void 0:u.in)??"default";t[h]??(t[h]={}),(v=t[h])[T]??(v[T]=[]),t[h][T].push(o),s[c]??(s[c]={}),(L=s[c])[T]??(L[T]=[]),s[c][T].push(o)}),{horiz:Object.values(N(t,"horizontal")).filter(o=>o.length>1),vert:Object.values(N(s,"vertical")).filter(o=>o.length>1)}}),[l,a]=d.reduce(([g,t],{horiz:s,vert:o})=>[[...g,...s],[...t,...o]],[[],[]]),r=new Set;x.forEach(g=>g.members.forEach(t=>r.add(t)));const i=gt(g=>g.filter(t=>!t.some(s=>r.has(s))),"dropOverlapping"),f=i(l),e=i(a);return x.forEach(g=>{g.members.length<2||(g.direction==="row"?f.push([...g.members]):e.push([...g.members]))}),{horizontal:f,vertical:e}}gt(ze,"getAlignments");function Be(I,M,w=[]){const x=[],N=M.getConfigField("iconSize"),d=M.getConfigField("idealEdgeLengthMultiplier"),l=d*N,a=new Set;w.forEach(f=>{for(let e=0;e<f.members.length-1;e++){const g=f.members[e],t=f.members[e+1];a.add(`${g}|${t}`),a.add(`${t}|${g}`),f.direction==="row"?x.push({left:g,right:t,gap:l}):x.push({top:g,bottom:t,gap:l})}});const r=gt(f=>`${f[0]},${f[1]}`,"posToStr"),i=gt(f=>f.split(",").map(e=>parseInt(e)),"strToPos");return I.forEach(f=>{const e=Object.fromEntries(Object.entries(f).map(([o,c])=>[r(c),o])),g=[r([0,0])],t={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;g.length>0;){const o=g.shift();if(o){t[o]=1;const c=e[o];if(c){const h=i(o);Object.entries(s).forEach(([T,u])=>{const v=r([h[0]+u[0],h[1]+u[1]]),L=e[v];if(L&&!t[v]){if(g.push(v),a.has(`${c}|${L}`))return;x.push({[Ie[T]]:L,[Ie[Nr(T)]]:c,gap:d*N})}})}}}}),x}gt(Be,"getRelativeConstraints");function $e(I,M,w,x,N,{spatialMaps:d,groupAlignments:l}){return new Promise(a=>{const r=sr("body").append("div").attr("id","cy").attr("style","display:none"),i=be({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${N.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${N.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});r.remove(),We(w,i),Ye(I,i,N),Xe(M,i,N),Ve(x,i);const f=N.getLayoutHints(),e=ze(N,d,l,f),g=Be(d,N,f),t=N.getConfigField("iconSize"),s=N.getConfigField("idealEdgeLengthMultiplier")*t,o=.5*t,c=N.getConfigField("edgeElasticity"),h=N.getConfigField("seed"),T=i.layout({name:"fcose",quality:"proof",randomize:N.getConfigField("randomize"),nodeSeparation:N.getConfigField("nodeSeparation"),numIter:N.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(u){const[v,L]=u.connectedNodes(),{parent:P}=ie(v),{parent:C}=ie(L);return P===C?s:o},edgeElasticity(u){const[v,L]=u.connectedNodes(),{parent:P}=ie(v),{parent:C}=ie(L);return P===C?c:.001},alignmentConstraint:e,relativePlacementConstraint:g});T.one("layoutstop",()=>{var v;function u(L,P,C,G){let V,Y;const{x:$,y:A}=L,{x:j,y:n}=P;Y=(G-A+($-C)*(A-n)/($-j))/Math.sqrt(1+Math.pow((A-n)/($-j),2)),V=Math.sqrt(Math.pow(G-A,2)+Math.pow(C-$,2)-Math.pow(Y,2));const E=Math.sqrt(Math.pow(j-$,2)+Math.pow(n-A,2));V=V/E;let p=(j-$)*(G-A)-(n-A)*(C-$);switch(!0){case p>=0:p=1;break;case p<0:p=-1;break}let m=(j-$)*(C-$)+(n-A)*(G-A);switch(!0){case m>=0:m=1;break;case m<0:m=-1;break}return Y=Math.abs(Y)*p,V=V*m,{distances:Y,weights:V}}gt(u,"getSegmentWeights"),i.startBatch();for(const L of Object.values(i.edges()))if((v=L.data)!=null&&v.call(L)){const{x:P,y:C}=L.source().position(),{x:G,y:V}=L.target().position();if(P!==G&&C!==V){const Y=L.sourceEndpoint(),$=L.targetEndpoint(),{sourceDir:A}=Pe(L),[j,n]=qt(A)?[Y.x,$.y]:[$.x,Y.y],{weights:E,distances:p}=u(Y,$,j,n);L.style("segment-distances",p),L.style("segment-weights",E)}}i.endBatch(),me(h,()=>T.run())});try{me(h,()=>T.run())}catch(u){throw u instanceof RangeError&&u.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):u}i.ready(u=>{Fe.info("Ready",u),a(i)})})}gt($e,"layoutArchitecture");var Ur=gt(async(I,M,w,x)=>{const N=x.db;N.setDiagramId(M);const d=N.getServices(),l=N.getJunctions(),a=N.getGroups(),r=N.getEdges(),i=N.getDataStructures(),f=qe(M),e=f.append("g");e.attr("class","architecture-edges");const g=f.append("g");g.attr("class","architecture-services");const t=f.append("g");t.attr("class","architecture-groups"),await Pr(N,g,d,M),Gr(N,g,l,M);const s=await $e(d,l,a,r,N,i);await Fr(e,s,N,M),await br(t,s,N,M),He(N,s),Qe(void 0,f,N.getConfigField("padding"),N.getConfigField("useMaxWidth"))},"draw"),Yr={draw:Ur},Zr={parser:Ue,get db(){return new Ge},renderer:Yr,styles:Sr};export{Zr as diagram};