pmx-canvas 0.11.0 → 0.12.1

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 (300) hide show
  1. package/.github/extensions/pmx-canvas/extension.mjs +4 -1
  2. package/.github/extensions/pmx-canvas/runtime.json +1 -1
  3. package/.github/extensions/pmx-canvas/tools.json +440 -18
  4. package/CHANGELOG.md +51 -0
  5. package/dist/amp-plugin/pmx-canvas/LICENSE +21 -0
  6. package/dist/amp-plugin/pmx-canvas/THIRD_PARTY_LICENSES.txt +331 -0
  7. package/dist/amp-plugin/pmx-canvas/index.js +5445 -0
  8. package/dist/amp-plugin/pmx-canvas/runtime.json +3 -0
  9. package/dist/amp-plugin/pmx-canvas/shared-runtime.mjs +194 -0
  10. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/SKILL.md +267 -0
  11. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/evals.json +1168 -0
  12. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/jwt.ts +17 -0
  13. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/login.ts +12 -0
  14. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/middleware.ts +13 -0
  15. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/routes/auth.ts +13 -0
  16. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/investigation-board/src/handlers/users.ts +27 -0
  17. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/mcp.json +36 -0
  18. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/ax-html-control-surface.md +101 -0
  19. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/codex-app-adapter.md +151 -0
  20. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/excalidraw-diagram-authoring.md +150 -0
  21. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/full-reference.md +1839 -0
  22. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/github-copilot-app-adapter.md +223 -0
  23. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/html-primitives.md +139 -0
  24. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/importing-context.md +132 -0
  25. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/installing-pmx-canvas.md +301 -0
  26. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/tours-and-recording.md +117 -0
  27. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/workbench-workflows.md +908 -0
  28. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas-orchestration/SKILL.md +141 -0
  29. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas-testing/SKILL.md +266 -0
  30. package/dist/amp-plugin/pmx-canvas/start-mcp.mjs +14857 -0
  31. package/dist/amp-plugin/pmx-canvas/tools.json +10963 -0
  32. package/dist/canvas/chunks/{abnfDiagram-N423BO3Z-p8dtp6va.js → abnfDiagram-N423BO3Z-cwtsds5d.js} +1 -1
  33. package/dist/canvas/chunks/architecture-TIHT7OUA-x63cwejs.js +1 -0
  34. package/dist/canvas/chunks/{architectureDiagram-T3A2C74G-5jhmxrzf.js → architectureDiagram-T3A2C74G-b4xc9tpz.js} +3 -3
  35. package/dist/canvas/chunks/{blockDiagram-VBNYF7ZC-pw1fa9yb.js → blockDiagram-VBNYF7ZC-ahp3yxxs.js} +7 -7
  36. package/dist/canvas/chunks/{c4Diagram-5PPSVZJV-x07nq0tt.js → c4Diagram-5PPSVZJV-nappnay7.js} +4 -4
  37. package/dist/canvas/chunks/classDiagram-JCYQIIEL-k1j2xc1t.js +1 -0
  38. package/dist/canvas/chunks/classDiagram-v2-OCEON4UE-33x08xf2.js +1 -0
  39. package/dist/canvas/chunks/{cose-bilkent-JH36ORCC-nm39npq0.js → cose-bilkent-JH36ORCC-a428syda.js} +1 -1
  40. package/dist/canvas/chunks/cynefin-VYW2F7L2-8v6jxfz8.js +1 -0
  41. package/dist/canvas/chunks/{cynefinDiagram-MW4NZA55-vdxrwahz.js → cynefinDiagram-MW4NZA55-nspsqebj.js} +1 -1
  42. package/dist/canvas/chunks/{dagre-VZM6K2ZE-bqdm7wpd.js → dagre-VZM6K2ZE-8y6177fh.js} +2 -2
  43. package/dist/canvas/chunks/{diagram-7IWD3JNH-gs5gpr93.js → diagram-7IWD3JNH-vym028wn.js} +4 -4
  44. package/dist/canvas/chunks/{diagram-B4RE2ZJO-cgwjg47s.js → diagram-B4RE2ZJO-jddqb8sy.js} +1 -1
  45. package/dist/canvas/chunks/{diagram-LBJQPF4R-w3vahpav.js → diagram-LBJQPF4R-bjwbpkrn.js} +1 -1
  46. package/dist/canvas/chunks/{diagram-Q27KOJAE-42837z6h.js → diagram-Q27KOJAE-j6ph6hcx.js} +2 -2
  47. package/dist/canvas/chunks/{diagram-UB23O5K3-4fz83q59.js → diagram-UB23O5K3-p09w8jej.js} +1 -1
  48. package/dist/canvas/chunks/{ebnfDiagram-BXEA7PRR-zphtgegj.js → ebnfDiagram-BXEA7PRR-j975ycq5.js} +1 -1
  49. package/dist/canvas/chunks/{erDiagram-JOGREHBK-zvbbdxp4.js → erDiagram-JOGREHBK-sxp6hjn8.js} +5 -5
  50. package/dist/canvas/chunks/eventmodeling-45OFAUF4-xzfgn6xg.js +1 -0
  51. package/dist/canvas/chunks/flowDiagram-UKHOOZJN-2nsmkskb.js +1 -0
  52. package/dist/canvas/chunks/{ganttDiagram-PKOTCBZU-282jzycm.js → ganttDiagram-PKOTCBZU-4tv230y2.js} +2 -2
  53. package/dist/canvas/chunks/gitGraph-TEB2WS4Q-macbhand.js +1 -0
  54. package/dist/canvas/chunks/{gitGraphDiagram-DS77QQ5N-vqqy6p1b.js → gitGraphDiagram-DS77QQ5N-mqgmnw9g.js} +1 -1
  55. package/dist/canvas/chunks/{index-wgv7en21.js → index-037z5dz2.js} +2 -2
  56. package/dist/canvas/chunks/{index-w2mra17t.js → index-081n3har.js} +1 -1
  57. package/dist/canvas/chunks/{index-353m7b0p.js → index-5n03dmb9.js} +1 -1
  58. package/dist/canvas/chunks/{index-yw8h9vha.js → index-60pgzdqe.js} +1 -1
  59. package/dist/canvas/chunks/index-8g1vb57n.js +2 -0
  60. package/dist/canvas/chunks/{index-vv56h019.js → index-8rjes9r6.js} +1 -1
  61. package/dist/canvas/chunks/{index-nprm96xp.js → index-9022d1n9.js} +1 -1
  62. package/dist/canvas/chunks/{index-194m3hc3.js → index-9b02042t.js} +1 -1
  63. package/dist/canvas/chunks/{index-0rk4gp1g.js → index-ap4q4vez.js} +1 -1
  64. package/dist/canvas/chunks/{index-rh7nv68n.js → index-dyp2nhd3.js} +1 -1
  65. package/dist/canvas/chunks/index-frvta4tm.js +2 -0
  66. package/dist/canvas/chunks/{index-s4j678gj.js → index-h9ycj8n2.js} +1 -1
  67. package/dist/canvas/chunks/{index-fjtdggjn.js → index-mergmj97.js} +2 -2
  68. package/dist/canvas/chunks/index-nwsya6dj.js +301 -0
  69. package/dist/canvas/chunks/{index-3cy1bzwh.js → index-nz8qbd1p.js} +1 -1
  70. package/dist/canvas/chunks/{index-d3b3gqe9.js → index-qhfrazv3.js} +1 -1
  71. package/dist/canvas/chunks/{index-6qmsnxwy.js → index-v119nznk.js} +4 -4
  72. package/dist/canvas/chunks/{index-r2fyc9w1.js → index-vpt37m3d.js} +6 -6
  73. package/dist/canvas/chunks/{index-qj8fxwsf.js → index-y9ma6azy.js} +1 -1
  74. package/dist/canvas/chunks/{index-tb1wf525.js → index-zx0j3a2z.js} +26 -26
  75. package/dist/canvas/chunks/info-DKCQHKI2-a0ykzs9z.js +1 -0
  76. package/dist/canvas/chunks/{infoDiagram-6WML65LV-v1yvggqj.js → infoDiagram-6WML65LV-qv97qq6a.js} +2 -2
  77. package/dist/canvas/chunks/ishikawaDiagram-WSZJBQD7-p9306gh0.js +70 -0
  78. package/dist/canvas/chunks/{journeyDiagram-NVQOT4AX-zjcffveh.js → journeyDiagram-NVQOT4AX-sv67zats.js} +5 -5
  79. package/dist/canvas/chunks/{kanban-definition-27J2QSJJ-dakqtfp1.js → kanban-definition-27J2QSJJ-k2pfam6p.js} +1 -1
  80. package/dist/canvas/chunks/{mermaid.core-j2geswrd.js → mermaid.core-83r0fdce.js} +4 -4
  81. package/dist/canvas/chunks/{mindmap-definition-FAOFIHXS-142xhr3k.js → mindmap-definition-FAOFIHXS-vg2newm1.js} +1 -1
  82. package/dist/canvas/chunks/packet-7NZHBO7P-tqnabcdv.js +1 -0
  83. package/dist/canvas/chunks/{pegDiagram-VL7TDLO6-5wvk7vsd.js → pegDiagram-VL7TDLO6-k2h7zc5n.js} +1 -1
  84. package/dist/canvas/chunks/pie-RZYD4A2V-wke6gyhe.js +1 -0
  85. package/dist/canvas/chunks/{pieDiagram-7S7Q4E2Y-ztdhwycc.js → pieDiagram-7S7Q4E2Y-hg169p1v.js} +2 -2
  86. package/dist/canvas/chunks/{quadrantDiagram-CIZ2JOQS-c5p9gmg6.js → quadrantDiagram-CIZ2JOQS-bxtvsq0b.js} +5 -5
  87. package/dist/canvas/chunks/radar-I7S5WNFK-w7ka0drw.js +1 -0
  88. package/dist/canvas/chunks/railroad-3IZDKUUU-y3vg318x.js +1 -0
  89. package/dist/canvas/chunks/railroad-abnf-AHOZXSZD-6hqvcz3c.js +1 -0
  90. package/dist/canvas/chunks/railroad-ebnf-EBAXGLYW-vcae260m.js +1 -0
  91. package/dist/canvas/chunks/railroad-peg-LSFZ7HO6-0dbyme23.js +1 -0
  92. package/dist/canvas/chunks/{railroadDiagram-AXF67PYL-xkmqkjwf.js → railroadDiagram-AXF67PYL-njyhcp4p.js} +1 -1
  93. package/dist/canvas/chunks/{requirementDiagram-LRYGKXZP-9wm2dyaw.js → requirementDiagram-LRYGKXZP-2z6v09gm.js} +4 -4
  94. package/dist/canvas/chunks/{sankeyDiagram-W5VNT64P-2w19etgb.js → sankeyDiagram-W5VNT64P-15mzam0e.js} +1 -1
  95. package/dist/canvas/chunks/{sequenceDiagram-SI44F4Z6-0jn0vwmz.js → sequenceDiagram-SI44F4Z6-rbshyd2c.js} +12 -12
  96. package/dist/canvas/chunks/{sizeCapture-X5ZJPWSS-x75epwdq.js → sizeCapture-X5ZJPWSS-sg26xwts.js} +1 -1
  97. package/dist/canvas/chunks/{stateDiagram-OKZ733FA-schjpy6d.js → stateDiagram-OKZ733FA-6eahp98e.js} +1 -1
  98. package/dist/canvas/chunks/stateDiagram-v2-UEYNNEHI-tty0ggn5.js +1 -0
  99. package/dist/canvas/chunks/{swimlanes-SLNWSIFB-gkw4xce3.js → swimlanes-SLNWSIFB-ze5db10t.js} +1 -1
  100. package/dist/canvas/chunks/swimlanesDiagram-ULZ7WXOC-thze75gq.js +8 -0
  101. package/dist/canvas/chunks/{timeline-definition-Z64GVDOM-x7nkcy01.js → timeline-definition-Z64GVDOM-vnp7jyy8.js} +3 -3
  102. package/dist/canvas/chunks/treeView-QDETBFTQ-6ysffnm6.js +1 -0
  103. package/dist/canvas/chunks/treemap-6X3UGDF4-m3h9p066.js +1 -0
  104. package/dist/canvas/chunks/vennDiagram-T6HMQDX7-0qrnb7mj.js +34 -0
  105. package/dist/canvas/chunks/wardley-OPB4EBWU-dp37drwx.js +1 -0
  106. package/dist/canvas/chunks/{wardleyDiagram-T6FBY63Y-t1j52t9r.js → wardleyDiagram-T6FBY63Y-8nxg8wqt.js} +4 -4
  107. package/dist/canvas/chunks/{xychartDiagram-ELKLHX3M-38t16pme.js → xychartDiagram-ELKLHX3M-nj921e7s.js} +5 -5
  108. package/dist/canvas/global.css +94 -1
  109. package/dist/canvas/index.js +154 -145
  110. package/dist/canvas/mcp-app.html +600 -498
  111. package/dist/json-render/index.css +1 -1
  112. package/dist/types/client/canvas/BoardMoveDialog.d.ts +2 -0
  113. package/dist/types/client/canvas/EdgeEditor.d.ts +19 -0
  114. package/dist/types/client/canvas/GroupNavigation.d.ts +2 -0
  115. package/dist/types/client/canvas/TextPrompt.d.ts +4 -0
  116. package/dist/types/client/nodes/PromptNode.d.ts +1 -0
  117. package/dist/types/client/nodes/ViewerFrame.d.ts +1 -1
  118. package/dist/types/client/nodes/WorkCard.d.ts +7 -0
  119. package/dist/types/client/nodes/use-ax-surface-bridge.d.ts +1 -0
  120. package/dist/types/client/state/canvas-store.d.ts +15 -0
  121. package/dist/types/client/state/human-store.d.ts +2 -0
  122. package/dist/types/client/state/intent-bridge.d.ts +4 -2
  123. package/dist/types/client/state/relation-store.d.ts +11 -0
  124. package/dist/types/client/types.d.ts +1 -1
  125. package/dist/types/json-render/catalog.d.ts +2 -2
  126. package/dist/types/server/agent-presence.d.ts +1 -0
  127. package/dist/types/server/ax-interaction.d.ts +1 -0
  128. package/dist/types/server/ax-state-manager.d.ts +10 -2
  129. package/dist/types/server/board-local.d.ts +4 -0
  130. package/dist/types/server/board-move.d.ts +38 -0
  131. package/dist/types/server/canvas-db.d.ts +12 -2
  132. package/dist/types/server/canvas-operations.d.ts +5 -6
  133. package/dist/types/server/canvas-provenance.d.ts +1 -1
  134. package/dist/types/server/canvas-serialization.d.ts +1 -0
  135. package/dist/types/server/canvas-state.d.ts +84 -20
  136. package/dist/types/server/card-relocation.d.ts +6 -0
  137. package/dist/types/server/context-reads.d.ts +3 -1
  138. package/dist/types/server/human-presence.d.ts +1 -1
  139. package/dist/types/server/index.d.ts +16 -5
  140. package/dist/types/server/intent-registry.d.ts +8 -4
  141. package/dist/types/server/knowledge-lifecycle.d.ts +4 -2
  142. package/dist/types/server/mutation-history.d.ts +7 -5
  143. package/dist/types/server/operations/registry.d.ts +2 -0
  144. package/dist/types/server/trace-manager.d.ts +1 -0
  145. package/dist/types/shared/ax-kinds.d.ts +6 -0
  146. package/dist/types/shared/ax-surface-protocol.d.ts +8 -0
  147. package/dist/types/shared/human-presence.d.ts +1 -0
  148. package/dist/types/shared/lifecycle-status.d.ts +2 -0
  149. package/docs/RELEASE.md +21 -14
  150. package/docs/agent-plugin.md +22 -2
  151. package/docs/amp-plugin.md +270 -0
  152. package/docs/cli.md +42 -3
  153. package/docs/design/GuestName.dc.html +50 -0
  154. package/docs/design/PluginLogo.svg +7 -0
  155. package/docs/design/WorkCards.dc.html +39 -0
  156. package/docs/design/canvas.json +16 -0
  157. package/docs/design/plugin-logo.png +0 -0
  158. package/docs/design.md +111 -8
  159. package/docs/evals/agents-md-sections.md +38 -0
  160. package/docs/http-api.md +128 -10
  161. package/docs/mcp.md +61 -9
  162. package/docs/node-types.md +71 -1
  163. package/docs/plans/plan-009-tech-debt-backlog.md +1 -1
  164. package/docs/plans/plan-019-post-0.9-roadmap.md +44 -20
  165. package/docs/plans/plan-020-wave-5-work-planning.md +553 -0
  166. package/docs/product-vision-2026-09.md +33 -17
  167. package/docs/sdk.md +18 -0
  168. package/package.json +6 -3
  169. package/plugins/pmx-canvas/assets/preview.png +0 -0
  170. package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/extension.mjs +4 -1
  171. package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/runtime.json +1 -1
  172. package/plugins/pmx-canvas/plugin.json +2 -2
  173. package/plugins/pmx-canvas/runtime.json +1 -1
  174. package/plugins/pmx-canvas/tools.json +440 -18
  175. package/skills/data-analysis/SKILL.md +13 -26
  176. package/skills/frontend-design/LICENSE.txt +177 -0
  177. package/skills/frontend-design/SKILL.md +3 -0
  178. package/skills/pmx-canvas/SKILL.md +248 -842
  179. package/skills/pmx-canvas/evals/evals.json +110 -5
  180. package/skills/pmx-canvas/references/full-reference.md +142 -28
  181. package/skills/pmx-canvas/references/html-primitives.md +7 -0
  182. package/skills/pmx-canvas/references/installing-pmx-canvas.md +61 -11
  183. package/skills/pmx-canvas/references/tours-and-recording.md +39 -6
  184. package/skills/pmx-canvas/references/workbench-workflows.md +908 -0
  185. package/skills/pmx-canvas-testing/SKILL.md +7 -5
  186. package/skills/published-consumer-e2e/SKILL.md +25 -8
  187. package/skills/published-consumer-e2e/scripts/run-published-consumer-e2e.sh +51 -75
  188. package/skills/web-artifacts-builder/LICENSE.txt +202 -0
  189. package/skills/web-artifacts-builder/SKILL.md +6 -0
  190. package/skills/web-artifacts-builder/scripts/bundle-artifact.sh +2 -2
  191. package/skills/web-artifacts-builder/scripts/init-artifact.sh +8 -8
  192. package/src/cli/commands/apps.ts +1 -0
  193. package/src/cli/commands/boards.ts +30 -0
  194. package/src/client/App.tsx +20 -4
  195. package/src/client/canvas/AttentionHistory.tsx +10 -2
  196. package/src/client/canvas/BoardMoveDialog.tsx +225 -0
  197. package/src/client/canvas/CanvasNode.tsx +45 -2
  198. package/src/client/canvas/CanvasViewport.tsx +38 -9
  199. package/src/client/canvas/ContextMenu.tsx +34 -12
  200. package/src/client/canvas/EdgeEditor.tsx +149 -0
  201. package/src/client/canvas/EdgeLayer.tsx +87 -16
  202. package/src/client/canvas/ExpandedNodeOverlay.tsx +4 -0
  203. package/src/client/canvas/GroupNavigation.tsx +85 -0
  204. package/src/client/canvas/RelationsPanel.tsx +9 -0
  205. package/src/client/canvas/SelectionBar.tsx +21 -0
  206. package/src/client/canvas/SessionPanel.tsx +35 -1
  207. package/src/client/canvas/TextPrompt.tsx +18 -1
  208. package/src/client/canvas/TopBar.tsx +30 -0
  209. package/src/client/canvas/canvas-area.ts +1 -1
  210. package/src/client/nodes/ExtAppFrame.tsx +26 -10
  211. package/src/client/nodes/MarkdownNode.tsx +6 -7
  212. package/src/client/nodes/PromptNode.tsx +32 -3
  213. package/src/client/nodes/StatusNode.tsx +12 -0
  214. package/src/client/nodes/StatusSummary.tsx +11 -0
  215. package/src/client/nodes/ViewerFrame.tsx +21 -10
  216. package/src/client/nodes/WorkCard.tsx +175 -0
  217. package/src/client/nodes/use-ax-surface-bridge.ts +18 -14
  218. package/src/client/state/attention-bridge.ts +5 -0
  219. package/src/client/state/attention-store.ts +1 -0
  220. package/src/client/state/canvas-store.ts +185 -15
  221. package/src/client/state/human-store.ts +22 -2
  222. package/src/client/state/intent-bridge.ts +19 -5
  223. package/src/client/state/relation-store.ts +127 -1
  224. package/src/client/theme/global.css +94 -1
  225. package/src/client/types.ts +1 -0
  226. package/src/mcp/server.ts +13 -3
  227. package/src/server/agent-presence.ts +43 -23
  228. package/src/server/ax-flow-loop.ts +6 -0
  229. package/src/server/ax-gate-ttl.ts +8 -1
  230. package/src/server/ax-interaction.ts +16 -10
  231. package/src/server/ax-state-manager.ts +17 -4
  232. package/src/server/ax-wait.ts +20 -6
  233. package/src/server/board-export.ts +19 -6
  234. package/src/server/board-local.ts +20 -0
  235. package/src/server/board-move.ts +297 -0
  236. package/src/server/canvas-db.ts +262 -160
  237. package/src/server/canvas-operations.ts +139 -109
  238. package/src/server/canvas-schema.ts +21 -0
  239. package/src/server/canvas-serialization.ts +2 -0
  240. package/src/server/canvas-state.ts +792 -159
  241. package/src/server/card-relocation.ts +53 -0
  242. package/src/server/code-graph.ts +4 -3
  243. package/src/server/context-reads.ts +83 -55
  244. package/src/server/demo-state.json +35 -15
  245. package/src/server/file-watcher.ts +30 -10
  246. package/src/server/human-presence.ts +18 -5
  247. package/src/server/index.ts +35 -15
  248. package/src/server/intent-registry.ts +43 -5
  249. package/src/server/knowledge-lifecycle.ts +32 -9
  250. package/src/server/lifecycle-status.ts +29 -1
  251. package/src/server/mcp-app-runtime.ts +26 -7
  252. package/src/server/mutation-history.ts +37 -8
  253. package/src/server/operations/composites.ts +6 -3
  254. package/src/server/operations/mcp-contracts.ts +15 -0
  255. package/src/server/operations/mcp.ts +36 -9
  256. package/src/server/operations/ops/annotation.ts +22 -1
  257. package/src/server/operations/ops/ax-await.ts +1 -0
  258. package/src/server/operations/ops/ax-timeline.ts +28 -2
  259. package/src/server/operations/ops/batch.ts +25 -11
  260. package/src/server/operations/ops/boards.ts +44 -3
  261. package/src/server/operations/ops/nodes.ts +70 -0
  262. package/src/server/operations/ops/query.ts +32 -3
  263. package/src/server/operations/ops/snapshots.ts +1 -0
  264. package/src/server/operations/registry.ts +49 -4
  265. package/src/server/server.ts +62 -16
  266. package/src/server/tour-control.ts +37 -12
  267. package/src/server/trace-manager.ts +4 -0
  268. package/src/server/web-artifacts/scripts/bundle-artifact.sh +2 -2
  269. package/src/server/web-artifacts/scripts/init-artifact.sh +8 -8
  270. package/src/shared/agent-context.ts +7 -1
  271. package/src/shared/auto-arrange.ts +5 -4
  272. package/src/shared/ax-kinds.ts +13 -0
  273. package/src/shared/ax-surface-protocol.ts +22 -0
  274. package/src/shared/human-presence.ts +1 -0
  275. package/src/shared/lifecycle-status.ts +2 -0
  276. package/dist/canvas/chunks/architecture-TIHT7OUA-9tffvpsv.js +0 -1
  277. package/dist/canvas/chunks/classDiagram-JCYQIIEL-nc6g5x1r.js +0 -1
  278. package/dist/canvas/chunks/classDiagram-v2-OCEON4UE-0qnbpwvh.js +0 -1
  279. package/dist/canvas/chunks/cynefin-VYW2F7L2-ys8p46ts.js +0 -1
  280. package/dist/canvas/chunks/eventmodeling-45OFAUF4-v9q6dn4c.js +0 -1
  281. package/dist/canvas/chunks/flowDiagram-UKHOOZJN-yrr5z8tc.js +0 -1
  282. package/dist/canvas/chunks/gitGraph-TEB2WS4Q-kdwb8m0a.js +0 -1
  283. package/dist/canvas/chunks/index-1r72hdzb.js +0 -301
  284. package/dist/canvas/chunks/index-g3pwnqeb.js +0 -2
  285. package/dist/canvas/chunks/index-rft2hcz5.js +0 -2
  286. package/dist/canvas/chunks/info-DKCQHKI2-wpzs6sz3.js +0 -1
  287. package/dist/canvas/chunks/ishikawaDiagram-WSZJBQD7-5hnq1a9p.js +0 -70
  288. package/dist/canvas/chunks/packet-7NZHBO7P-xn439f0s.js +0 -1
  289. package/dist/canvas/chunks/pie-RZYD4A2V-0kf16rwh.js +0 -1
  290. package/dist/canvas/chunks/radar-I7S5WNFK-0g2pz36t.js +0 -1
  291. package/dist/canvas/chunks/railroad-3IZDKUUU-fcaran6j.js +0 -1
  292. package/dist/canvas/chunks/railroad-abnf-AHOZXSZD-wgdya41q.js +0 -1
  293. package/dist/canvas/chunks/railroad-ebnf-EBAXGLYW-gy07a4ka.js +0 -1
  294. package/dist/canvas/chunks/railroad-peg-LSFZ7HO6-ewk6wtkh.js +0 -1
  295. package/dist/canvas/chunks/stateDiagram-v2-UEYNNEHI-k8sfp2e7.js +0 -1
  296. package/dist/canvas/chunks/swimlanesDiagram-ULZ7WXOC-nqysw67j.js +0 -8
  297. package/dist/canvas/chunks/treeView-QDETBFTQ-cesw6gp0.js +0 -1
  298. package/dist/canvas/chunks/treemap-6X3UGDF4-zdv4knp9.js +0 -1
  299. package/dist/canvas/chunks/vennDiagram-T6HMQDX7-x8dqn9yf.js +0 -34
  300. package/dist/canvas/chunks/wardley-OPB4EBWU-44pdddez.js +0 -1
@@ -1,4 +1,4 @@
1
- import{R}from"./index-353m7b0p.js";import{e,t,x,u,w,Ie,d,f,p,m,g,b,v,r,n,A,E,Me,Si,Bt,ke,Z}from"./index-1r72hdzb.js";import{K,se}from"./index-6qmsnxwy.js";import{D}from"./index-tb1wf525.js";import{Re}from"./index-6ceya556.js";var Xe=se(function(Ce,Ye){(function(z,X){if(typeof Ce==="object"&&typeof Ye==="object")Ye.exports=X();else if(typeof define==="function"&&define.amd)define([],X);else if(typeof Ce==="object")Ce.layoutBase=X();else z.layoutBase=X()})(Ce,function(){return function(U){var z={};function X(C){if(z[C])return z[C].exports;var y=z[C]={i:C,l:!1,exports:{}};return U[C].call(y.exports,y,y.exports,X),y.l=!0,y.exports}return X.m=U,X.c=z,X.i=function(C){return C},X.d=function(C,y,l){if(!X.o(C,y))Object.defineProperty(C,y,{configurable:!1,enumerable:!0,get:l})},X.n=function(C){var y=C&&C.__esModule?function(){return C.default}:function(){return C};return X.d(y,"a",y),y},X.o=function(C,y){return Object.prototype.hasOwnProperty.call(C,y)},X.p="",X(X.s=28)}([function(U,z,X){function C(){}C.QUALITY=1,C.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,C.DEFAULT_INCREMENTAL=!1,C.DEFAULT_ANIMATION_ON_LAYOUT=!0,C.DEFAULT_ANIMATION_DURING_LAYOUT=!1,C.DEFAULT_ANIMATION_PERIOD=50,C.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,C.DEFAULT_GRAPH_MARGIN=15,C.NODE_DIMENSIONS_INCLUDE_LABELS=!1,C.SIMPLE_NODE_SIZE=40,C.SIMPLE_NODE_HALF_SIZE=C.SIMPLE_NODE_SIZE/2,C.EMPTY_COMPOUND_NODE_SIZE=40,C.MIN_EDGE_LENGTH=1,C.WORLD_BOUNDARY=1e6,C.INITIAL_WORLD_BOUNDARY=C.WORLD_BOUNDARY/1000,C.WORLD_CENTER_X=1200,C.WORLD_CENTER_Y=900,U.exports=C},function(U,z,X){var C=X(2),y=X(8),l=X(9);function s(L,a,O){C.call(this,O),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=O,this.bendpoints=[],this.source=L,this.target=a}s.prototype=Object.create(C.prototype);for(var h in C)s[h]=C[h];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(L){if(this.source===L)return this.target;else if(this.target===L)return this.source;else throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(L,a){var O=this.getOtherEnd(L),o=a.getGraphManager().getRoot();while(!0){if(O.getOwner()==a)return O;if(O.getOwner()==o)break;O=O.getOwner().getParent()}return null},s.prototype.updateLength=function(){var L=[,,,,];if(this.isOverlapingSourceAndTarget=y.getIntersection(this.target.getRect(),this.source.getRect(),L),!this.isOverlapingSourceAndTarget){if(this.lengthX=L[0]-L[2],this.lengthY=L[1]-L[3],Math.abs(this.lengthX)<1)this.lengthX=l.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=l.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},s.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=l.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=l.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},U.exports=s},function(U,z,X){function C(y){this.vGraphObject=y}U.exports=C},function(U,z,X){var C=X(2),y=X(10),l=X(13),s=X(0),h=X(16),L=X(5);function a(o,i,N,M){if(N==null&&M==null)M=i;if(C.call(this,M),o.graphManager!=null)o=o.graphManager;if(this.estimatedSize=y.MIN_VALUE,this.inclusionTreeDepth=y.MAX_VALUE,this.vGraphObject=M,this.edges=[],this.graphManager=o,N!=null&&i!=null)this.rect=new l(i.x,i.y,N.width,N.height);else this.rect=new l}a.prototype=Object.create(C.prototype);for(var O in C)a[O]=C[O];a.prototype.getEdges=function(){return this.edges},a.prototype.getChild=function(){return this.child},a.prototype.getOwner=function(){return this.owner},a.prototype.getWidth=function(){return this.rect.width},a.prototype.setWidth=function(o){this.rect.width=o},a.prototype.getHeight=function(){return this.rect.height},a.prototype.setHeight=function(o){this.rect.height=o},a.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},a.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},a.prototype.getCenter=function(){return new L(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},a.prototype.getLocation=function(){return new L(this.rect.x,this.rect.y)},a.prototype.getRect=function(){return this.rect},a.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},a.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},a.prototype.setRect=function(o,i){this.rect.x=o.x,this.rect.y=o.y,this.rect.width=i.width,this.rect.height=i.height},a.prototype.setCenter=function(o,i){this.rect.x=o-this.rect.width/2,this.rect.y=i-this.rect.height/2},a.prototype.setLocation=function(o,i){this.rect.x=o,this.rect.y=i},a.prototype.moveBy=function(o,i){this.rect.x+=o,this.rect.y+=i},a.prototype.getEdgeListToNode=function(o){var i=[],N,M=this;return M.edges.forEach(function(T){if(T.target==o){if(T.source!=M)throw"Incorrect edge source!";i.push(T)}}),i},a.prototype.getEdgesBetween=function(o){var i=[],N,M=this;return M.edges.forEach(function(T){if(!(T.source==M||T.target==M))throw"Incorrect edge source and/or target";if(T.target==o||T.source==o)i.push(T)}),i},a.prototype.getNeighborsList=function(){var o=new Set,i=this;return i.edges.forEach(function(N){if(N.source==i)o.add(N.target);else{if(N.target!=i)throw"Incorrect incidency!";o.add(N.source)}}),o},a.prototype.withChildren=function(){var o=new Set,i,N;if(o.add(this),this.child!=null){var M=this.child.getNodes();for(var T=0;T<M.length;T++)i=M[T],N=i.withChildren(),N.forEach(function(W){o.add(W)})}return o},a.prototype.getNoOfChildren=function(){var o=0,i;if(this.child==null)o=1;else{var N=this.child.getNodes();for(var M=0;M<N.length;M++)i=N[M],o+=i.getNoOfChildren()}if(o==0)o=1;return o},a.prototype.getEstimatedSize=function(){if(this.estimatedSize==y.MIN_VALUE)throw"assert failed";return this.estimatedSize},a.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},a.prototype.scatter=function(){var o,i,N=-s.INITIAL_WORLD_BOUNDARY,M=s.INITIAL_WORLD_BOUNDARY;o=s.WORLD_CENTER_X+h.nextDouble()*(M-N)+N;var T=-s.INITIAL_WORLD_BOUNDARY,W=s.INITIAL_WORLD_BOUNDARY;i=s.WORLD_CENTER_Y+h.nextDouble()*(W-T)+T,this.rect.x=o,this.rect.y=i},a.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var o=this.getChild();if(o.updateBounds(!0),this.rect.x=o.getLeft(),this.rect.y=o.getTop(),this.setWidth(o.getRight()-o.getLeft()),this.setHeight(o.getBottom()-o.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var i=o.getRight()-o.getLeft(),N=o.getBottom()-o.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(i+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>i)this.rect.x-=(this.labelWidth-i)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(i+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(N+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>N)this.rect.y-=(this.labelHeight-N)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(N+this.labelHeight)}}}},a.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==y.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},a.prototype.transform=function(o){var i=this.rect.x;if(i>s.WORLD_BOUNDARY)i=s.WORLD_BOUNDARY;else if(i<-s.WORLD_BOUNDARY)i=-s.WORLD_BOUNDARY;var N=this.rect.y;if(N>s.WORLD_BOUNDARY)N=s.WORLD_BOUNDARY;else if(N<-s.WORLD_BOUNDARY)N=-s.WORLD_BOUNDARY;var M=new L(i,N),T=o.inverseTransformPoint(M);this.setLocation(T.x,T.y)},a.prototype.getLeft=function(){return this.rect.x},a.prototype.getRight=function(){return this.rect.x+this.rect.width},a.prototype.getTop=function(){return this.rect.y},a.prototype.getBottom=function(){return this.rect.y+this.rect.height},a.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},U.exports=a},function(U,z,X){var C=X(0);function y(){}for(var l in C)y[l]=C[l];y.MAX_ITERATIONS=2500,y.DEFAULT_EDGE_LENGTH=50,y.DEFAULT_SPRING_STRENGTH=0.45,y.DEFAULT_REPULSION_STRENGTH=4500,y.DEFAULT_GRAVITY_STRENGTH=0.4,y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,y.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,y.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,y.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,y.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,y.COOLING_ADAPTATION_FACTOR=0.33,y.ADAPTATION_LOWER_NODE_LIMIT=1000,y.ADAPTATION_UPPER_NODE_LIMIT=5000,y.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,y.MAX_NODE_DISPLACEMENT=y.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,y.CONVERGENCE_CHECK_PERIOD=100,y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,y.MIN_EDGE_LENGTH=1,y.GRID_CALCULATION_CHECK_PERIOD=10,U.exports=y},function(U,z,X){function C(y,l){if(y==null&&l==null)this.x=0,this.y=0;else this.x=y,this.y=l}C.prototype.getX=function(){return this.x},C.prototype.getY=function(){return this.y},C.prototype.setX=function(y){this.x=y},C.prototype.setY=function(y){this.y=y},C.prototype.getDifference=function(y){return new DimensionD(this.x-y.x,this.y-y.y)},C.prototype.getCopy=function(){return new C(this.x,this.y)},C.prototype.translate=function(y){return this.x+=y.width,this.y+=y.height,this},U.exports=C},function(U,z,X){var C=X(2),y=X(10),l=X(0),s=X(7),h=X(3),L=X(1),a=X(13),O=X(12),o=X(11);function i(M,T,W){if(C.call(this,W),this.estimatedSize=y.MIN_VALUE,this.margin=l.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=M,T!=null&&T instanceof s)this.graphManager=T;else if(T!=null&&T instanceof Layout)this.graphManager=T.graphManager}i.prototype=Object.create(C.prototype);for(var N in C)i[N]=C[N];i.prototype.getNodes=function(){return this.nodes},i.prototype.getEdges=function(){return this.edges},i.prototype.getGraphManager=function(){return this.graphManager},i.prototype.getParent=function(){return this.parent},i.prototype.getLeft=function(){return this.left},i.prototype.getRight=function(){return this.right},i.prototype.getTop=function(){return this.top},i.prototype.getBottom=function(){return this.bottom},i.prototype.isConnected=function(){return this.isConnected},i.prototype.add=function(M,T,W){if(T==null&&W==null){var F=M;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(F)>-1)throw"Node already in graph!";return F.owner=this,this.getNodes().push(F),F}else{var P=M;if(!(this.getNodes().indexOf(T)>-1&&this.getNodes().indexOf(W)>-1))throw"Source or target not in graph!";if(!(T.owner==W.owner&&T.owner==this))throw"Both owners must be this graph!";if(T.owner!=W.owner)return null;if(P.source=T,P.target=W,P.isInterGraph=!1,this.getEdges().push(P),T.edges.push(P),W!=T)W.edges.push(P);return P}},i.prototype.remove=function(M){var T=M;if(M instanceof h){if(T==null)throw"Node is null!";if(!(T.owner!=null&&T.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var W=T.edges.slice(),F,P=W.length;for(var H=0;H<P;H++)if(F=W[H],F.isInterGraph)this.graphManager.remove(F);else F.source.owner.remove(F);var J=this.nodes.indexOf(T);if(J==-1)throw"Node not in owner node list!";this.nodes.splice(J,1)}else if(M instanceof L){var F=M;if(F==null)throw"Edge is null!";if(!(F.source!=null&&F.target!=null))throw"Source and/or target is null!";if(!(F.source.owner!=null&&F.target.owner!=null&&F.source.owner==this&&F.target.owner==this))throw"Source and/or target owner is invalid!";var V=F.source.edges.indexOf(F),_=F.target.edges.indexOf(F);if(!(V>-1&&_>-1))throw"Source and/or target doesn't know this edge!";if(F.source.edges.splice(V,1),F.target!=F.source)F.target.edges.splice(_,1);var J=F.source.owner.getEdges().indexOf(F);if(J==-1)throw"Not in owner's edge list!";F.source.owner.getEdges().splice(J,1)}},i.prototype.updateLeftTop=function(){var{MAX_VALUE:M,MAX_VALUE:T}=y,W,F,P,H=this.getNodes(),J=H.length;for(var V=0;V<J;V++){var _=H[V];if(W=_.getTop(),F=_.getLeft(),M>W)M=W;if(T>F)T=F}if(M==y.MAX_VALUE)return null;if(H[0].getParent().paddingLeft!=null)P=H[0].getParent().paddingLeft;else P=this.margin;return this.left=T-P,this.top=M-P,new O(this.left,this.top)},i.prototype.updateBounds=function(M){var T=y.MAX_VALUE,W=-y.MAX_VALUE,F=y.MAX_VALUE,P=-y.MAX_VALUE,H,J,V,_,ot,it=this.nodes,pt=it.length;for(var q=0;q<pt;q++){var st=it[q];if(M&&st.child!=null)st.updateBounds();if(H=st.getLeft(),J=st.getRight(),V=st.getTop(),_=st.getBottom(),T>H)T=H;if(W<J)W=J;if(F>V)F=V;if(P<_)P=_}var c=new a(T,F,W-T,P-F);if(T==y.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(it[0].getParent().paddingLeft!=null)ot=it[0].getParent().paddingLeft;else ot=this.margin;this.left=c.x-ot,this.right=c.x+c.width+ot,this.top=c.y-ot,this.bottom=c.y+c.height+ot},i.calculateBounds=function(M){var T=y.MAX_VALUE,W=-y.MAX_VALUE,F=y.MAX_VALUE,P=-y.MAX_VALUE,H,J,V,_,ot=M.length;for(var it=0;it<ot;it++){var pt=M[it];if(H=pt.getLeft(),J=pt.getRight(),V=pt.getTop(),_=pt.getBottom(),T>H)T=H;if(W<J)W=J;if(F>V)F=V;if(P<_)P=_}var q=new a(T,F,W-T,P-F);return q},i.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},i.prototype.getEstimatedSize=function(){if(this.estimatedSize==y.MIN_VALUE)throw"assert failed";return this.estimatedSize},i.prototype.calcEstimatedSize=function(){var M=0,T=this.nodes,W=T.length;for(var F=0;F<W;F++){var P=T[F];M+=P.calcEstimatedSize()}if(M==0)this.estimatedSize=l.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=M/Math.sqrt(this.nodes.length);return this.estimatedSize},i.prototype.updateConnected=function(){var M=this;if(this.nodes.length==0){this.isConnected=!0;return}var T=new o,W=new Set,F=this.nodes[0],P,H,J=F.withChildren();J.forEach(function(q){T.push(q),W.add(q)});while(T.length!==0){F=T.shift(),P=F.getEdges();var V=P.length;for(var _=0;_<V;_++){var ot=P[_];if(H=ot.getOtherEndInGraph(F,this),H!=null&&!W.has(H)){var it=H.withChildren();it.forEach(function(q){T.push(q),W.add(q)})}}}if(this.isConnected=!1,W.size>=this.nodes.length){var pt=0;if(W.forEach(function(q){if(q.owner==M)pt++}),pt==this.nodes.length)this.isConnected=!0}},U.exports=i},function(U,z,X){var C,y=X(1);function l(s){C=X(6),this.layout=s,this.graphs=[],this.edges=[]}l.prototype.addRoot=function(){var s=this.layout.newGraph(),h=this.layout.newNode(null),L=this.add(s,h);return this.setRootGraph(L),this.rootGraph},l.prototype.add=function(s,h,L,a,O){if(L==null&&a==null&&O==null){if(s==null)throw"Graph is null!";if(h==null)throw"Parent node is null!";if(this.graphs.indexOf(s)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(s),s.parent!=null)throw"Already has a parent!";if(h.child!=null)throw"Already has a child!";return s.parent=h,h.child=s,s}else{O=L,a=h,L=s;var o=a.getOwner(),i=O.getOwner();if(!(o!=null&&o.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(i!=null&&i.getGraphManager()==this))throw"Target not in this graph mgr!";if(o==i)return L.isInterGraph=!1,o.add(L,a,O);else{if(L.isInterGraph=!0,L.source=a,L.target=O,this.edges.indexOf(L)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(L),!(L.source!=null&&L.target!=null))throw"Edge source and/or target is null!";if(!(L.source.edges.indexOf(L)==-1&&L.target.edges.indexOf(L)==-1))throw"Edge already in source and/or target incidency list!";return L.source.edges.push(L),L.target.edges.push(L),L}}},l.prototype.remove=function(s){if(s instanceof C){var h=s;if(h.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(h==this.rootGraph||h.parent!=null&&h.parent.graphManager==this))throw"Invalid parent node!";var L=[];L=L.concat(h.getEdges());var a,O=L.length;for(var o=0;o<O;o++)a=L[o],h.remove(a);var i=[];i=i.concat(h.getNodes());var N;O=i.length;for(var o=0;o<O;o++)N=i[o],h.remove(N);if(h==this.rootGraph)this.setRootGraph(null);var M=this.graphs.indexOf(h);this.graphs.splice(M,1),h.parent=null}else if(s instanceof y){if(a=s,a==null)throw"Edge is null!";if(!a.isInterGraph)throw"Not an inter-graph edge!";if(!(a.source!=null&&a.target!=null))throw"Source and/or target is null!";if(!(a.source.edges.indexOf(a)!=-1&&a.target.edges.indexOf(a)!=-1))throw"Source and/or target doesn't know this edge!";var M=a.source.edges.indexOf(a);if(a.source.edges.splice(M,1),M=a.target.edges.indexOf(a),a.target.edges.splice(M,1),!(a.source.owner!=null&&a.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(a.source.owner.getGraphManager().edges.indexOf(a)==-1)throw"Not in owner graph manager's edge list!";var M=a.source.owner.getGraphManager().edges.indexOf(a);a.source.owner.getGraphManager().edges.splice(M,1)}},l.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},l.prototype.getGraphs=function(){return this.graphs},l.prototype.getAllNodes=function(){if(this.allNodes==null){var s=[],h=this.getGraphs(),L=h.length;for(var a=0;a<L;a++)s=s.concat(h[a].getNodes());this.allNodes=s}return this.allNodes},l.prototype.resetAllNodes=function(){this.allNodes=null},l.prototype.resetAllEdges=function(){this.allEdges=null},l.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},l.prototype.getAllEdges=function(){if(this.allEdges==null){var s=[],h=this.getGraphs(),L=h.length;for(var a=0;a<h.length;a++)s=s.concat(h[a].getEdges());s=s.concat(this.edges),this.allEdges=s}return this.allEdges},l.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},l.prototype.setAllNodesToApplyGravitation=function(s){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=s},l.prototype.getRoot=function(){return this.rootGraph},l.prototype.setRootGraph=function(s){if(s.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=s,s.parent==null)s.parent=this.layout.newNode("Root node")},l.prototype.getLayout=function(){return this.layout},l.prototype.isOneAncestorOfOther=function(s,h){if(!(s!=null&&h!=null))throw"assert failed";if(s==h)return!0;var L=s.getOwner(),a;do{if(a=L.getParent(),a==null)break;if(a==h)return!0;if(L=a.getOwner(),L==null)break}while(!0);L=h.getOwner();do{if(a=L.getParent(),a==null)break;if(a==s)return!0;if(L=a.getOwner(),L==null)break}while(!0);return!1},l.prototype.calcLowestCommonAncestors=function(){var s,h,L,a,O,o=this.getAllEdges(),i=o.length;for(var N=0;N<i;N++){if(s=o[N],h=s.source,L=s.target,s.lca=null,s.sourceInLca=h,s.targetInLca=L,h==L){s.lca=h.getOwner();continue}a=h.getOwner();while(s.lca==null){s.targetInLca=L,O=L.getOwner();while(s.lca==null){if(O==a){s.lca=O;break}if(O==this.rootGraph)break;if(s.lca!=null)throw"assert failed";s.targetInLca=O.getParent(),O=s.targetInLca.getOwner()}if(a==this.rootGraph)break;if(s.lca==null)s.sourceInLca=a.getParent(),a=s.sourceInLca.getOwner()}if(s.lca==null)throw"assert failed"}},l.prototype.calcLowestCommonAncestor=function(s,h){if(s==h)return s.getOwner();var L=s.getOwner();do{if(L==null)break;var a=h.getOwner();do{if(a==null)break;if(a==L)return a;a=a.getParent().getOwner()}while(!0);L=L.getParent().getOwner()}while(!0);return L},l.prototype.calcInclusionTreeDepths=function(s,h){if(s==null&&h==null)s=this.rootGraph,h=1;var L,a=s.getNodes(),O=a.length;for(var o=0;o<O;o++)if(L=a[o],L.inclusionTreeDepth=h,L.child!=null)this.calcInclusionTreeDepths(L.child,h+1)},l.prototype.includesInvalidEdge=function(){var s,h=[],L=this.edges.length;for(var a=0;a<L;a++)if(s=this.edges[a],this.isOneAncestorOfOther(s.source,s.target))h.push(s);for(var a=0;a<h.length;a++)this.remove(h[a]);return!1},U.exports=l},function(U,z,X){var C=X(12);function y(){}y.calcSeparationAmount=function(l,s,h,L){if(!l.intersects(s))throw"assert failed";var a=[,,];if(this.decideDirectionsForOverlappingNodes(l,s,a),h[0]=Math.min(l.getRight(),s.getRight())-Math.max(l.x,s.x),h[1]=Math.min(l.getBottom(),s.getBottom())-Math.max(l.y,s.y),l.getX()<=s.getX()&&l.getRight()>=s.getRight())h[0]+=Math.min(s.getX()-l.getX(),l.getRight()-s.getRight());else if(s.getX()<=l.getX()&&s.getRight()>=l.getRight())h[0]+=Math.min(l.getX()-s.getX(),s.getRight()-l.getRight());if(l.getY()<=s.getY()&&l.getBottom()>=s.getBottom())h[1]+=Math.min(s.getY()-l.getY(),l.getBottom()-s.getBottom());else if(s.getY()<=l.getY()&&s.getBottom()>=l.getBottom())h[1]+=Math.min(l.getY()-s.getY(),s.getBottom()-l.getBottom());var O=Math.abs((s.getCenterY()-l.getCenterY())/(s.getCenterX()-l.getCenterX()));if(s.getCenterY()===l.getCenterY()&&s.getCenterX()===l.getCenterX())O=1;var o=O*h[0],i=h[1]/O;if(h[0]<i)i=h[0];else o=h[1];h[0]=-1*a[0]*(i/2+L),h[1]=-1*a[1]*(o/2+L)},y.decideDirectionsForOverlappingNodes=function(l,s,h){if(l.getCenterX()<s.getCenterX())h[0]=-1;else h[0]=1;if(l.getCenterY()<s.getCenterY())h[1]=-1;else h[1]=1},y.getIntersection2=function(l,s,h){var L=l.getCenterX(),a=l.getCenterY(),O=s.getCenterX(),o=s.getCenterY();if(l.intersects(s))return h[0]=L,h[1]=a,h[2]=O,h[3]=o,!0;var i=l.getX(),N=l.getY(),M=l.getRight(),T=l.getX(),W=l.getBottom(),F=l.getRight(),P=l.getWidthHalf(),H=l.getHeightHalf(),J=s.getX(),V=s.getY(),_=s.getRight(),ot=s.getX(),it=s.getBottom(),pt=s.getRight(),q=s.getWidthHalf(),st=s.getHeightHalf(),c=!1,G=!1;if(L===O){if(a>o)return h[0]=L,h[1]=N,h[2]=O,h[3]=it,!1;else if(a<o)return h[0]=L,h[1]=W,h[2]=O,h[3]=V,!1}else if(a===o){if(L>O)return h[0]=i,h[1]=a,h[2]=_,h[3]=o,!1;else if(L<O)return h[0]=M,h[1]=a,h[2]=J,h[3]=o,!1}else{var S=l.height/l.width,Y=s.height/s.width,I=(o-a)/(O-L),Q=void 0,k=void 0,rt=void 0,tt=void 0,j=void 0,dt=void 0;if(-S===I)if(L>O)h[0]=T,h[1]=W,c=!0;else h[0]=M,h[1]=N,c=!0;else if(S===I)if(L>O)h[0]=i,h[1]=N,c=!0;else h[0]=F,h[1]=W,c=!0;if(-Y===I)if(O>L)h[2]=ot,h[3]=it,G=!0;else h[2]=_,h[3]=V,G=!0;else if(Y===I)if(O>L)h[2]=J,h[3]=V,G=!0;else h[2]=pt,h[3]=it,G=!0;if(c&&G)return!1;if(L>O)if(a>o)Q=this.getCardinalDirection(S,I,4),k=this.getCardinalDirection(Y,I,2);else Q=this.getCardinalDirection(-S,I,3),k=this.getCardinalDirection(-Y,I,1);else if(a>o)Q=this.getCardinalDirection(-S,I,1),k=this.getCardinalDirection(-Y,I,3);else Q=this.getCardinalDirection(S,I,2),k=this.getCardinalDirection(Y,I,4);if(!c)switch(Q){case 1:tt=N,rt=L+-H/I,h[0]=rt,h[1]=tt;break;case 2:rt=F,tt=a+P*I,h[0]=rt,h[1]=tt;break;case 3:tt=W,rt=L+H/I,h[0]=rt,h[1]=tt;break;case 4:rt=T,tt=a+-P*I,h[0]=rt,h[1]=tt;break}if(!G)switch(k){case 1:dt=V,j=O+-st/I,h[2]=j,h[3]=dt;break;case 2:j=pt,dt=o+q*I,h[2]=j,h[3]=dt;break;case 3:dt=it,j=O+st/I,h[2]=j,h[3]=dt;break;case 4:j=ot,dt=o+-q*I,h[2]=j,h[3]=dt;break}}return!1},y.getCardinalDirection=function(l,s,h){if(l>s)return h;else return 1+h%4},y.getIntersection=function(l,s,h,L){if(L==null)return this.getIntersection2(l,s,h);var{x:a,y:O}=l,{x:o,y:i}=s,{x:N,y:M}=h,{x:T,y:W}=L,F=void 0,P=void 0,H=void 0,J=void 0,V=void 0,_=void 0,ot=void 0,it=void 0,pt=void 0;if(H=i-O,V=a-o,ot=o*O-a*i,J=W-M,_=N-T,it=T*M-N*W,pt=H*_-J*V,pt===0)return null;return F=(V*it-_*ot)/pt,P=(J*ot-H*it)/pt,new C(F,P)},y.angleOfVector=function(l,s,h,L){var a=void 0;if(l!==h){if(a=Math.atan((L-s)/(h-l)),h<l)a+=Math.PI;else if(L<s)a+=this.TWO_PI}else if(L<s)a=this.ONE_AND_HALF_PI;else a=this.HALF_PI;return a},y.doIntersect=function(l,s,h,L){var{x:a,y:O}=l,{x:o,y:i}=s,{x:N,y:M}=h,{x:T,y:W}=L,F=(o-a)*(W-M)-(T-N)*(i-O);if(F===0)return!1;else{var P=((W-M)*(T-a)+(N-T)*(W-O))/F,H=((O-i)*(T-a)+(o-a)*(W-O))/F;return 0<P&&P<1&&0<H&&H<1}},y.findCircleLineIntersections=function(l,s,h,L,a,O,o){var i=(h-l)*(h-l)+(L-s)*(L-s),N=2*((l-a)*(h-l)+(s-O)*(L-s)),M=(l-a)*(l-a)+(s-O)*(s-O)-o*o,T=N*N-4*i*M;if(T>=0){var W=(-N+Math.sqrt(N*N-4*i*M))/(2*i),F=(-N-Math.sqrt(N*N-4*i*M))/(2*i),P=null;if(W>=0&&W<=1)return[W];if(F>=0&&F<=1)return[F];return P}else return null},y.HALF_PI=0.5*Math.PI,y.ONE_AND_HALF_PI=1.5*Math.PI,y.TWO_PI=2*Math.PI,y.THREE_PI=3*Math.PI,U.exports=y},function(U,z,X){function C(){}C.sign=function(y){if(y>0)return 1;else if(y<0)return-1;else return 0},C.floor=function(y){return y<0?Math.ceil(y):Math.floor(y)},C.ceil=function(y){return y<0?Math.floor(y):Math.ceil(y)},U.exports=C},function(U,z,X){function C(){}C.MAX_VALUE=2147483647,C.MIN_VALUE=-2147483648,U.exports=C},function(U,z,X){var C=function(){function a(O,o){for(var i=0;i<o.length;i++){var N=o[i];if(N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N)N.writable=!0;Object.defineProperty(O,N.key,N)}}return function(O,o,i){if(o)a(O.prototype,o);if(i)a(O,i);return O}}();function y(a,O){if(!(a instanceof O))throw TypeError("Cannot call a class as a function")}var l=function(O){return{value:O,next:null,prev:null}},s=function(O,o,i,N){if(O!==null)O.next=o;else N.head=o;if(i!==null)i.prev=o;else N.tail=o;return o.prev=O,o.next=i,N.length++,o},h=function(O,o){var{prev:i,next:N}=O;if(i!==null)i.next=N;else o.head=N;if(N!==null)N.prev=i;else o.tail=i;return O.prev=O.next=null,o.length--,O},L=function(){function a(O){var o=this;if(y(this,a),this.length=0,this.head=null,this.tail=null,O!=null)O.forEach(function(i){return o.push(i)})}return C(a,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(o,i){return s(i.prev,l(o),i,this)}},{key:"insertAfter",value:function(o,i){return s(i,l(o),i.next,this)}},{key:"insertNodeBefore",value:function(o,i){return s(i.prev,o,i,this)}},{key:"insertNodeAfter",value:function(o,i){return s(i,o,i.next,this)}},{key:"push",value:function(o){return s(this.tail,l(o),null,this)}},{key:"unshift",value:function(o){return s(null,l(o),this.head,this)}},{key:"remove",value:function(o){return h(o,this)}},{key:"pop",value:function(){return h(this.tail,this).value}},{key:"popNode",value:function(){return h(this.tail,this)}},{key:"shift",value:function(){return h(this.head,this).value}},{key:"shiftNode",value:function(){return h(this.head,this)}},{key:"get_object_at",value:function(o){if(o<=this.length()){var i=1,N=this.head;while(i<o)N=N.next,i++;return N.value}}},{key:"set_object_at",value:function(o,i){if(o<=this.length()){var N=1,M=this.head;while(N<o)M=M.next,N++;M.value=i}}}]),a}();U.exports=L},function(U,z,X){function C(y,l,s){if(this.x=null,this.y=null,y==null&&l==null&&s==null)this.x=0,this.y=0;else if(typeof y=="number"&&typeof l=="number"&&s==null)this.x=y,this.y=l;else if(y.constructor.name=="Point"&&l==null&&s==null)s=y,this.x=s.x,this.y=s.y}C.prototype.getX=function(){return this.x},C.prototype.getY=function(){return this.y},C.prototype.getLocation=function(){return new C(this.x,this.y)},C.prototype.setLocation=function(y,l,s){if(y.constructor.name=="Point"&&l==null&&s==null)s=y,this.setLocation(s.x,s.y);else if(typeof y=="number"&&typeof l=="number"&&s==null)if(parseInt(y)==y&&parseInt(l)==l)this.move(y,l);else this.x=Math.floor(y+0.5),this.y=Math.floor(l+0.5)},C.prototype.move=function(y,l){this.x=y,this.y=l},C.prototype.translate=function(y,l){this.x+=y,this.y+=l},C.prototype.equals=function(y){if(y.constructor.name=="Point"){var l=y;return this.x==l.x&&this.y==l.y}return this==y},C.prototype.toString=function(){return new C().constructor.name+"[x="+this.x+",y="+this.y+"]"},U.exports=C},function(U,z,X){function C(y,l,s,h){if(this.x=0,this.y=0,this.width=0,this.height=0,y!=null&&l!=null&&s!=null&&h!=null)this.x=y,this.y=l,this.width=s,this.height=h}C.prototype.getX=function(){return this.x},C.prototype.setX=function(y){this.x=y},C.prototype.getY=function(){return this.y},C.prototype.setY=function(y){this.y=y},C.prototype.getWidth=function(){return this.width},C.prototype.setWidth=function(y){this.width=y},C.prototype.getHeight=function(){return this.height},C.prototype.setHeight=function(y){this.height=y},C.prototype.getRight=function(){return this.x+this.width},C.prototype.getBottom=function(){return this.y+this.height},C.prototype.intersects=function(y){if(this.getRight()<y.x)return!1;if(this.getBottom()<y.y)return!1;if(y.getRight()<this.x)return!1;if(y.getBottom()<this.y)return!1;return!0},C.prototype.getCenterX=function(){return this.x+this.width/2},C.prototype.getMinX=function(){return this.getX()},C.prototype.getMaxX=function(){return this.getX()+this.width},C.prototype.getCenterY=function(){return this.y+this.height/2},C.prototype.getMinY=function(){return this.getY()},C.prototype.getMaxY=function(){return this.getY()+this.height},C.prototype.getWidthHalf=function(){return this.width/2},C.prototype.getHeightHalf=function(){return this.height/2},U.exports=C},function(U,z,X){var C=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol==="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function y(){}y.lastID=0,y.createID=function(l){if(y.isPrimitive(l))return l;if(l.uniqueID!=null)return l.uniqueID;return l.uniqueID=y.getString(),y.lastID++,l.uniqueID},y.getString=function(l){if(l==null)l=y.lastID;return"Object#"+l},y.isPrimitive=function(l){var s=typeof l>"u"?"undefined":C(l);return l==null||s!="object"&&s!="function"},U.exports=y},function(U,z,X){function C(N){if(Array.isArray(N)){for(var M=0,T=Array(N.length);M<N.length;M++)T[M]=N[M];return T}else return Array.from(N)}var y=X(0),l=X(7),s=X(3),h=X(1),L=X(6),a=X(5),O=X(17),o=X(29);function i(N){if(o.call(this),this.layoutQuality=y.QUALITY,this.createBendsAsNeeded=y.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=y.DEFAULT_INCREMENTAL,this.animationOnLayout=y.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=y.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=y.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=y.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new l(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,N!=null)this.isRemoteUse=N}i.RANDOM_SEED=1,i.prototype=Object.create(o.prototype),i.prototype.getGraphManager=function(){return this.graphManager},i.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},i.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},i.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},i.prototype.newGraphManager=function(){var N=new l(this);return this.graphManager=N,N},i.prototype.newGraph=function(N){return new L(null,this.graphManager,N)},i.prototype.newNode=function(N){return new s(this.graphManager,N)},i.prototype.newEdge=function(N){return new h(null,null,N)},i.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},i.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var N;if(this.checkLayoutSuccess())N=!1;else N=this.layout();if(y.ANIMATE==="during")return!1;if(N){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,N},i.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},i.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var N,M=this.graphManager.getAllEdges();for(var T=0;T<M.length;T++)N=M[T];var W,F=this.graphManager.getRoot().getNodes();for(var T=0;T<F.length;T++)W=F[T];this.update(this.graphManager.getRoot())}},i.prototype.update=function(N){if(N==null)this.update2();else if(N instanceof s){var M=N;if(M.getChild()!=null){var T=M.getChild().getNodes();for(var W=0;W<T.length;W++)update(T[W])}if(M.vGraphObject!=null){var F=M.vGraphObject;F.update(M)}}else if(N instanceof h){var P=N;if(P.vGraphObject!=null){var H=P.vGraphObject;H.update(P)}}else if(N instanceof L){var J=N;if(J.vGraphObject!=null){var V=J.vGraphObject;V.update(J)}}},i.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=y.QUALITY,this.animationDuringLayout=y.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=y.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=y.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=y.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=y.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=y.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},i.prototype.transform=function(N){if(N==null)this.transform(new a(0,0));else{var M=new O,T=this.graphManager.getRoot().updateLeftTop();if(T!=null){M.setWorldOrgX(N.x),M.setWorldOrgY(N.y),M.setDeviceOrgX(T.x),M.setDeviceOrgY(T.y);var W=this.getAllNodes(),F;for(var P=0;P<W.length;P++)F=W[P],F.transform(M)}}},i.prototype.positionNodesRandomly=function(N){if(N==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var M,T,W=N.getNodes();for(var F=0;F<W.length;F++)if(M=W[F],T=M.getChild(),T==null)M.scatter();else if(T.getNodes().length==0)M.scatter();else this.positionNodesRandomly(T),M.updateBounds()}},i.prototype.getFlatForest=function(){var N=[],M=!0,T=this.graphManager.getRoot().getNodes(),W=!0;for(var F=0;F<T.length;F++)if(T[F].getChild()!=null)W=!1;if(!W)return N;var P=new Set,H=[],J=new Map,V=[];V=V.concat(T);while(V.length>0&&M){H.push(V[0]);while(H.length>0&&M){var _=H[0];H.splice(0,1),P.add(_);var ot=_.getEdges();for(var F=0;F<ot.length;F++){var it=ot[F].getOtherEnd(_);if(J.get(_)!=it)if(!P.has(it))H.push(it),J.set(it,_);else{M=!1;break}}}if(!M)N=[];else{var pt=[].concat(C(P));N.push(pt);for(var F=0;F<pt.length;F++){var q=pt[F],st=V.indexOf(q);if(st>-1)V.splice(st,1)}P=new Set,J=new Map}}return N},i.prototype.createDummyNodesForBendpoints=function(N){var M=[],T=N.source,W=this.graphManager.calcLowestCommonAncestor(N.source,N.target);for(var F=0;F<N.bendpoints.length;F++){var P=this.newNode(null);P.setRect(new Point(0,0),new Dimension(1,1)),W.add(P);var H=this.newEdge(null);this.graphManager.add(H,T,P),M.add(P),T=P}var H=this.newEdge(null);if(this.graphManager.add(H,T,N.target),this.edgeToDummyNodes.set(N,M),N.isInterGraph())this.graphManager.remove(N);else W.remove(N);return M},i.prototype.createBendpointsFromDummyNodes=function(){var N=[];N=N.concat(this.graphManager.getAllEdges()),N=[].concat(C(this.edgeToDummyNodes.keys())).concat(N);for(var M=0;M<N.length;M++){var T=N[M];if(T.bendpoints.length>0){var W=this.edgeToDummyNodes.get(T);for(var F=0;F<W.length;F++){var P=W[F],H=new a(P.getCenterX(),P.getCenterY()),J=T.bendpoints.get(F);J.x=H.x,J.y=H.y,P.getOwner().remove(P)}this.graphManager.add(T,T.source,T.target)}}},i.transform=function(N,M,T,W){if(T!=null&&W!=null){var F=M;if(N<=50){var P=M/T;F-=(M-P)/50*(50-N)}else{var H=M*W;F+=(H-M)/50*(N-50)}return F}else{var J,V;if(N<=50)J=9*M/500,V=M/10;else J=9*M/50,V=-8*M;return J*N+V}},i.findCenterOfTree=function(N){var M=[];M=M.concat(N);var T=[],W=new Map,F=!1,P=null;if(M.length==1||M.length==2)F=!0,P=M[0];for(var H=0;H<M.length;H++){var J=M[H],V=J.getNeighborsList().size;if(W.set(J,J.getNeighborsList().size),V==1)T.push(J)}var _=[];_=_.concat(T);while(!F){var ot=[];ot=ot.concat(_),_=[];for(var H=0;H<M.length;H++){var J=M[H],it=M.indexOf(J);if(it>=0)M.splice(it,1);var pt=J.getNeighborsList();pt.forEach(function(c){if(T.indexOf(c)<0){var G=W.get(c),S=G-1;if(S==1)_.push(c);W.set(c,S)}})}if(T=T.concat(_),M.length==1||M.length==2)F=!0,P=M[0]}return P},i.prototype.setGraphManager=function(N){this.graphManager=N},U.exports=i},function(U,z,X){function C(){}C.seed=1,C.x=0,C.nextDouble=function(){return C.x=Math.sin(C.seed++)*1e4,C.x-Math.floor(C.x)},U.exports=C},function(U,z,X){var C=X(5);function y(l,s){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}y.prototype.getWorldOrgX=function(){return this.lworldOrgX},y.prototype.setWorldOrgX=function(l){this.lworldOrgX=l},y.prototype.getWorldOrgY=function(){return this.lworldOrgY},y.prototype.setWorldOrgY=function(l){this.lworldOrgY=l},y.prototype.getWorldExtX=function(){return this.lworldExtX},y.prototype.setWorldExtX=function(l){this.lworldExtX=l},y.prototype.getWorldExtY=function(){return this.lworldExtY},y.prototype.setWorldExtY=function(l){this.lworldExtY=l},y.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},y.prototype.setDeviceOrgX=function(l){this.ldeviceOrgX=l},y.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},y.prototype.setDeviceOrgY=function(l){this.ldeviceOrgY=l},y.prototype.getDeviceExtX=function(){return this.ldeviceExtX},y.prototype.setDeviceExtX=function(l){this.ldeviceExtX=l},y.prototype.getDeviceExtY=function(){return this.ldeviceExtY},y.prototype.setDeviceExtY=function(l){this.ldeviceExtY=l},y.prototype.transformX=function(l){var s=0,h=this.lworldExtX;if(h!=0)s=this.ldeviceOrgX+(l-this.lworldOrgX)*this.ldeviceExtX/h;return s},y.prototype.transformY=function(l){var s=0,h=this.lworldExtY;if(h!=0)s=this.ldeviceOrgY+(l-this.lworldOrgY)*this.ldeviceExtY/h;return s},y.prototype.inverseTransformX=function(l){var s=0,h=this.ldeviceExtX;if(h!=0)s=this.lworldOrgX+(l-this.ldeviceOrgX)*this.lworldExtX/h;return s},y.prototype.inverseTransformY=function(l){var s=0,h=this.ldeviceExtY;if(h!=0)s=this.lworldOrgY+(l-this.ldeviceOrgY)*this.lworldExtY/h;return s},y.prototype.inverseTransformPoint=function(l){var s=new C(this.inverseTransformX(l.x),this.inverseTransformY(l.y));return s},U.exports=y},function(U,z,X){function C(o){if(Array.isArray(o)){for(var i=0,N=Array(o.length);i<o.length;i++)N[i]=o[i];return N}else return Array.from(o)}var y=X(15),l=X(4),s=X(0),h=X(8),L=X(9);function a(){y.call(this),this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*l.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=l.MAX_ITERATIONS}a.prototype=Object.create(y.prototype);for(var O in y)a[O]=y[O];a.prototype.initParameters=function(){y.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},a.prototype.calcIdealEdgeLengths=function(){var o,i,N,M,T,W,F,P=this.getGraphManager().getAllEdges();for(var H=0;H<P.length;H++)if(o=P[H],i=o.idealLength,o.isInterGraph){if(M=o.getSource(),T=o.getTarget(),W=o.getSourceInLca().getEstimatedSize(),F=o.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)o.idealLength+=W+F-2*s.SIMPLE_NODE_SIZE;N=o.getLca().getInclusionTreeDepth(),o.idealLength+=i*l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(M.getInclusionTreeDepth()+T.getInclusionTreeDepth()-2*N)}},a.prototype.initSpringEmbedder=function(){var o=this.getAllNodes().length;if(this.incremental){if(o>l.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*l.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(o-l.ADAPTATION_LOWER_NODE_LIMIT)/(l.ADAPTATION_UPPER_NODE_LIMIT-l.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-l.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=l.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(o>l.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(l.COOLING_ADAPTATION_FACTOR,1-(o-l.ADAPTATION_LOWER_NODE_LIMIT)/(l.ADAPTATION_UPPER_NODE_LIMIT-l.ADAPTATION_LOWER_NODE_LIMIT)*(1-l.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=l.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*l.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},a.prototype.calcSpringForces=function(){var o=this.getAllEdges(),i;for(var N=0;N<o.length;N++)i=o[N],this.calcSpringForce(i,i.idealLength)},a.prototype.calcRepulsionForces=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,N,M,T,W,F=this.getAllNodes(),P;if(this.useFRGridVariant){if(this.totalIterations%l.GRID_CALCULATION_CHECK_PERIOD==1&&o)this.updateGrid();P=new Set;for(N=0;N<F.length;N++)T=F[N],this.calculateRepulsionForceOfANode(T,P,o,i),P.add(T)}else for(N=0;N<F.length;N++){T=F[N];for(M=N+1;M<F.length;M++){if(W=F[M],T.getOwner()!=W.getOwner())continue;this.calcRepulsionForce(T,W)}}},a.prototype.calcGravitationalForces=function(){var o,i=this.getAllNodesToApplyGravitation();for(var N=0;N<i.length;N++)o=i[N],this.calcGravitationalForce(o)},a.prototype.moveNodes=function(){var o=this.getAllNodes(),i;for(var N=0;N<o.length;N++)i=o[N],i.move()},a.prototype.calcSpringForce=function(o,i){var N=o.getSource(),M=o.getTarget(),T,W,F,P;if(this.uniformLeafNodeSizes&&N.getChild()==null&&M.getChild()==null)o.updateLengthSimple();else if(o.updateLength(),o.isOverlapingSourceAndTarget)return;if(T=o.getLength(),T==0)return;W=o.edgeElasticity*(T-i),F=W*(o.lengthX/T),P=W*(o.lengthY/T),N.springForceX+=F,N.springForceY+=P,M.springForceX-=F,M.springForceY-=P},a.prototype.calcRepulsionForce=function(o,i){var N=o.getRect(),M=i.getRect(),T=[,,],W=[,,,,],F,P,H,J,V,_,ot;if(N.intersects(M)){h.calcSeparationAmount(N,M,T,l.DEFAULT_EDGE_LENGTH/2),_=2*T[0],ot=2*T[1];var it=o.noOfChildren*i.noOfChildren/(o.noOfChildren+i.noOfChildren);o.repulsionForceX-=it*_,o.repulsionForceY-=it*ot,i.repulsionForceX+=it*_,i.repulsionForceY+=it*ot}else{if(this.uniformLeafNodeSizes&&o.getChild()==null&&i.getChild()==null)F=M.getCenterX()-N.getCenterX(),P=M.getCenterY()-N.getCenterY();else h.getIntersection(N,M,W),F=W[2]-W[0],P=W[3]-W[1];if(Math.abs(F)<l.MIN_REPULSION_DIST)F=L.sign(F)*l.MIN_REPULSION_DIST;if(Math.abs(P)<l.MIN_REPULSION_DIST)P=L.sign(P)*l.MIN_REPULSION_DIST;H=F*F+P*P,J=Math.sqrt(H),V=(o.nodeRepulsion/2+i.nodeRepulsion/2)*o.noOfChildren*i.noOfChildren/H,_=V*F/J,ot=V*P/J,o.repulsionForceX-=_,o.repulsionForceY-=ot,i.repulsionForceX+=_,i.repulsionForceY+=ot}},a.prototype.calcGravitationalForce=function(o){var i,N,M,T,W,F,P,H;if(i=o.getOwner(),N=(i.getRight()+i.getLeft())/2,M=(i.getTop()+i.getBottom())/2,T=o.getCenterX()-N,W=o.getCenterY()-M,F=Math.abs(T)+o.getWidth()/2,P=Math.abs(W)+o.getHeight()/2,o.getOwner()==this.graphManager.getRoot()){if(H=i.getEstimatedSize()*this.gravityRangeFactor,F>H||P>H)o.gravitationForceX=-this.gravityConstant*T,o.gravitationForceY=-this.gravityConstant*W}else if(H=i.getEstimatedSize()*this.compoundGravityRangeFactor,F>H||P>H)o.gravitationForceX=-this.gravityConstant*T*this.compoundGravityConstant,o.gravitationForceY=-this.gravityConstant*W*this.compoundGravityConstant},a.prototype.isConverged=function(){var o,i=!1;if(this.totalIterations>this.maxIterations/3)i=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return o=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,o||i},a.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},a.prototype.calcNoOfChildrenForAllNodes=function(){var o,i=this.graphManager.getAllNodes();for(var N=0;N<i.length;N++)o=i[N],o.noOfChildren=o.getNoOfChildren()},a.prototype.calcGrid=function(o){var i=0,N=0;i=parseInt(Math.ceil((o.getRight()-o.getLeft())/this.repulsionRange)),N=parseInt(Math.ceil((o.getBottom()-o.getTop())/this.repulsionRange));var M=Array(i);for(var T=0;T<i;T++)M[T]=Array(N);for(var T=0;T<i;T++)for(var W=0;W<N;W++)M[T][W]=[];return M},a.prototype.addNodeToGrid=function(o,i,N){var M=0,T=0,W=0,F=0;M=parseInt(Math.floor((o.getRect().x-i)/this.repulsionRange)),T=parseInt(Math.floor((o.getRect().width+o.getRect().x-i)/this.repulsionRange)),W=parseInt(Math.floor((o.getRect().y-N)/this.repulsionRange)),F=parseInt(Math.floor((o.getRect().height+o.getRect().y-N)/this.repulsionRange));for(var P=M;P<=T;P++)for(var H=W;H<=F;H++)this.grid[P][H].push(o),o.setGridCoordinates(M,T,W,F)},a.prototype.updateGrid=function(){var o,i,N=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(o=0;o<N.length;o++)i=N[o],this.addNodeToGrid(i,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},a.prototype.calculateRepulsionForceOfANode=function(o,i,N,M){if(this.totalIterations%l.GRID_CALCULATION_CHECK_PERIOD==1&&N||M){var T=new Set;o.surrounding=[];var W,F=this.grid;for(var P=o.startX-1;P<o.finishX+2;P++)for(var H=o.startY-1;H<o.finishY+2;H++)if(!(P<0||H<0||P>=F.length||H>=F[0].length))for(var J=0;J<F[P][H].length;J++){if(W=F[P][H][J],o.getOwner()!=W.getOwner()||o==W)continue;if(!i.has(W)&&!T.has(W)){var V=Math.abs(o.getCenterX()-W.getCenterX())-(o.getWidth()/2+W.getWidth()/2),_=Math.abs(o.getCenterY()-W.getCenterY())-(o.getHeight()/2+W.getHeight()/2);if(V<=this.repulsionRange&&_<=this.repulsionRange)T.add(W)}}o.surrounding=[].concat(C(T))}for(P=0;P<o.surrounding.length;P++)this.calcRepulsionForce(o,o.surrounding[P])},a.prototype.calcRepulsionRange=function(){return 0},U.exports=a},function(U,z,X){var C=X(1),y=X(4);function l(h,L,a){C.call(this,h,L,a),this.idealLength=y.DEFAULT_EDGE_LENGTH,this.edgeElasticity=y.DEFAULT_SPRING_STRENGTH}l.prototype=Object.create(C.prototype);for(var s in C)l[s]=C[s];U.exports=l},function(U,z,X){var C=X(3),y=X(4);function l(h,L,a,O){C.call(this,h,L,a,O),this.nodeRepulsion=y.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=[]}l.prototype=Object.create(C.prototype);for(var s in C)l[s]=C[s];l.prototype.setGridCoordinates=function(h,L,a,O){this.startX=h,this.finishX=L,this.startY=a,this.finishY=O},U.exports=l},function(U,z,X){function C(y,l){if(this.width=0,this.height=0,y!==null&&l!==null)this.height=l,this.width=y}C.prototype.getWidth=function(){return this.width},C.prototype.setWidth=function(y){this.width=y},C.prototype.getHeight=function(){return this.height},C.prototype.setHeight=function(y){this.height=y},U.exports=C},function(U,z,X){var C=X(14);function y(){this.map={},this.keys=[]}y.prototype.put=function(l,s){var h=C.createID(l);if(!this.contains(h))this.map[h]=s,this.keys.push(l)},y.prototype.contains=function(l){var s=C.createID(l);return this.map[l]!=null},y.prototype.get=function(l){var s=C.createID(l);return this.map[s]},y.prototype.keySet=function(){return this.keys},U.exports=y},function(U,z,X){var C=X(14);function y(){this.set={}}y.prototype.add=function(l){var s=C.createID(l);if(!this.contains(s))this.set[s]=l},y.prototype.remove=function(l){delete this.set[C.createID(l)]},y.prototype.clear=function(){this.set={}},y.prototype.contains=function(l){return this.set[C.createID(l)]==l},y.prototype.isEmpty=function(){return this.size()===0},y.prototype.size=function(){return Object.keys(this.set).length},y.prototype.addAllTo=function(l){var s=Object.keys(this.set),h=s.length;for(var L=0;L<h;L++)l.push(this.set[s[L]])},y.prototype.size=function(){return Object.keys(this.set).length},y.prototype.addAll=function(l){var s=l.length;for(var h=0;h<s;h++){var L=l[h];this.add(L)}},U.exports=y},function(U,z,X){function C(){}C.multMat=function(y,l){var s=[];for(var h=0;h<y.length;h++){s[h]=[];for(var L=0;L<l[0].length;L++){s[h][L]=0;for(var a=0;a<y[0].length;a++)s[h][L]+=y[h][a]*l[a][L]}}return s},C.transpose=function(y){var l=[];for(var s=0;s<y[0].length;s++){l[s]=[];for(var h=0;h<y.length;h++)l[s][h]=y[h][s]}return l},C.multCons=function(y,l){var s=[];for(var h=0;h<y.length;h++)s[h]=y[h]*l;return s},C.minusOp=function(y,l){var s=[];for(var h=0;h<y.length;h++)s[h]=y[h]-l[h];return s},C.dotProduct=function(y,l){var s=0;for(var h=0;h<y.length;h++)s+=y[h]*l[h];return s},C.mag=function(y){return Math.sqrt(this.dotProduct(y,y))},C.normalize=function(y){var l=[],s=this.mag(y);for(var h=0;h<y.length;h++)l[h]=y[h]/s;return l},C.multGamma=function(y){var l=[],s=0;for(var h=0;h<y.length;h++)s+=y[h];s*=-1/y.length;for(var L=0;L<y.length;L++)l[L]=s+y[L];return l},C.multL=function(y,l,s){var h=[],L=[],a=[];for(var O=0;O<l[0].length;O++){var o=0;for(var i=0;i<l.length;i++)o+=-0.5*l[i][O]*y[i];L[O]=o}for(var N=0;N<s.length;N++){var M=0;for(var T=0;T<s.length;T++)M+=s[N][T]*L[T];a[N]=M}for(var W=0;W<l.length;W++){var F=0;for(var P=0;P<l[0].length;P++)F+=l[W][P]*a[P];h[W]=F}return h},U.exports=C},function(U,z,X){var C=function(){function h(L,a){for(var O=0;O<a.length;O++){var o=a[O];if(o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o)o.writable=!0;Object.defineProperty(L,o.key,o)}}return function(L,a,O){if(a)h(L.prototype,a);if(O)h(L,O);return L}}();function y(h,L){if(!(h instanceof L))throw TypeError("Cannot call a class as a function")}var l=X(11),s=function(){function h(L,a){if(y(this,h),a!==null||a!==void 0)this.compareFunction=this._defaultCompareFunction;var O=void 0;if(L instanceof l)O=L.size();else O=L.length;this._quicksort(L,0,O-1)}return C(h,[{key:"_quicksort",value:function(a,O,o){if(O<o){var i=this._partition(a,O,o);this._quicksort(a,O,i),this._quicksort(a,i+1,o)}}},{key:"_partition",value:function(a,O,o){var i=this._get(a,O),N=O,M=o;while(!0){while(this.compareFunction(i,this._get(a,M)))M--;while(this.compareFunction(this._get(a,N),i))N++;if(N<M)this._swap(a,N,M),N++,M--;else return M}}},{key:"_get",value:function(a,O){if(a instanceof l)return a.get_object_at(O);else return a[O]}},{key:"_set",value:function(a,O,o){if(a instanceof l)a.set_object_at(O,o);else a[O]=o}},{key:"_swap",value:function(a,O,o){var i=this._get(a,O);this._set(a,O,this._get(a,o)),this._set(a,o,i)}},{key:"_defaultCompareFunction",value:function(a,O){return O>a}}]),h}();U.exports=s},function(U,z,X){function C(){}C.svd=function(y){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=y.length,this.n=y[0].length;var l=Math.min(this.m,this.n);this.s=function(Qt){var Wt=[];while(Qt-- >0)Wt.push(0);return Wt}(Math.min(this.m+1,this.n)),this.U=function(Qt){var Wt=function ue(jt){if(jt.length==0)return 0;else{var oe=[];for(var ce=0;ce<jt[0];ce++)oe.push(ue(jt.slice(1)));return oe}};return Wt(Qt)}([this.m,l]),this.V=function(Qt){var Wt=function ue(jt){if(jt.length==0)return 0;else{var oe=[];for(var ce=0;ce<jt[0];ce++)oe.push(ue(jt.slice(1)));return oe}};return Wt(Qt)}([this.n,this.n]);var s=function(Qt){var Wt=[];while(Qt-- >0)Wt.push(0);return Wt}(this.n),h=function(Qt){var Wt=[];while(Qt-- >0)Wt.push(0);return Wt}(this.m),L=!0,a=!0,O=Math.min(this.m-1,this.n),o=Math.max(0,Math.min(this.n-2,this.m));for(var i=0;i<Math.max(O,o);i++){if(i<O){this.s[i]=0;for(var N=i;N<this.m;N++)this.s[i]=C.hypot(this.s[i],y[N][i]);if(this.s[i]!==0){if(y[i][i]<0)this.s[i]=-this.s[i];for(var M=i;M<this.m;M++)y[M][i]/=this.s[i];y[i][i]+=1}this.s[i]=-this.s[i]}for(var T=i+1;T<this.n;T++){if(function(Qt,Wt){return Qt&&Wt}(i<O,this.s[i]!==0)){var W=0;for(var F=i;F<this.m;F++)W+=y[F][i]*y[F][T];W=-W/y[i][i];for(var P=i;P<this.m;P++)y[P][T]+=W*y[P][i]}s[T]=y[i][T]}if(function(Qt,Wt){return Qt&&Wt}(L,i<O))for(var H=i;H<this.m;H++)this.U[H][i]=y[H][i];if(i<o){s[i]=0;for(var J=i+1;J<this.n;J++)s[i]=C.hypot(s[i],s[J]);if(s[i]!==0){if(s[i+1]<0)s[i]=-s[i];for(var V=i+1;V<this.n;V++)s[V]/=s[i];s[i+1]+=1}if(s[i]=-s[i],function(Qt,Wt){return Qt&&Wt}(i+1<this.m,s[i]!==0)){for(var _=i+1;_<this.m;_++)h[_]=0;for(var ot=i+1;ot<this.n;ot++)for(var it=i+1;it<this.m;it++)h[it]+=s[ot]*y[it][ot];for(var pt=i+1;pt<this.n;pt++){var q=-s[pt]/s[i+1];for(var st=i+1;st<this.m;st++)y[st][pt]+=q*h[st]}}if(a)for(var c=i+1;c<this.n;c++)this.V[c][i]=s[c]}}var G=Math.min(this.n,this.m+1);if(O<this.n)this.s[O]=y[O][O];if(this.m<G)this.s[G-1]=0;if(o+1<G)s[o]=y[o][G-1];if(s[G-1]=0,L){for(var S=O;S<l;S++){for(var Y=0;Y<this.m;Y++)this.U[Y][S]=0;this.U[S][S]=1}for(var I=O-1;I>=0;I--)if(this.s[I]!==0){for(var Q=I+1;Q<l;Q++){var k=0;for(var rt=I;rt<this.m;rt++)k+=this.U[rt][I]*this.U[rt][Q];k=-k/this.U[I][I];for(var tt=I;tt<this.m;tt++)this.U[tt][Q]+=k*this.U[tt][I]}for(var j=I;j<this.m;j++)this.U[j][I]=-this.U[j][I];this.U[I][I]=1+this.U[I][I];for(var dt=0;dt<I-1;dt++)this.U[dt][I]=0}else{for(var Nt=0;Nt<this.m;Nt++)this.U[Nt][I]=0;this.U[I][I]=1}}if(a)for(var et=this.n-1;et>=0;et--){if(function(Qt,Wt){return Qt&&Wt}(et<o,s[et]!==0))for(var Tt=et+1;Tt<l;Tt++){var ct=0;for(var B=et+1;B<this.n;B++)ct+=this.V[B][et]*this.V[B][Tt];ct=-ct/this.V[et+1][et];for(var at=et+1;at<this.n;at++)this.V[at][Tt]+=ct*this.V[at][et]}for(var ht=0;ht<this.n;ht++)this.V[ht][et]=0;this.V[et][et]=1}var mt=G-1,Ot=0,Vt=Math.pow(2,-52),_t=Math.pow(2,-966);while(G>0){var yt=void 0,ne=void 0;for(yt=G-2;yt>=-1;yt--){if(yt===-1)break;if(Math.abs(s[yt])<=_t+Vt*(Math.abs(this.s[yt])+Math.abs(this.s[yt+1]))){s[yt]=0;break}}if(yt===G-2)ne=4;else{var kt=void 0;for(kt=G-1;kt>=yt;kt--){if(kt===yt)break;var At=(kt!==G?Math.abs(s[kt]):0)+(kt!==yt+1?Math.abs(s[kt-1]):0);if(Math.abs(this.s[kt])<=_t+Vt*At){this.s[kt]=0;break}}if(kt===yt)ne=3;else if(kt===G-1)ne=1;else ne=2,yt=kt}switch(yt++,ne){case 1:{var Lt=s[G-2];s[G-2]=0;for(var Gt=G-2;Gt>=yt;Gt--){var Yt=C.hypot(this.s[Gt],Lt),zt=this.s[Gt]/Yt,Xt=Lt/Yt;if(this.s[Gt]=Yt,Gt!==yt)Lt=-Xt*s[Gt-1],s[Gt-1]=zt*s[Gt-1];if(a)for(var Ht=0;Ht<this.n;Ht++)Yt=zt*this.V[Ht][Gt]+Xt*this.V[Ht][G-1],this.V[Ht][G-1]=-Xt*this.V[Ht][Gt]+zt*this.V[Ht][G-1],this.V[Ht][Gt]=Yt}}break;case 2:{var qt=s[yt-1];s[yt-1]=0;for(var Kt=yt;Kt<G;Kt++){var le=C.hypot(this.s[Kt],qt),re=this.s[Kt]/le,ae=qt/le;if(this.s[Kt]=le,qt=-ae*s[Kt],s[Kt]=re*s[Kt],L)for(var ee=0;ee<this.m;ee++)le=re*this.U[ee][Kt]+ae*this.U[ee][yt-1],this.U[ee][yt-1]=-ae*this.U[ee][Kt]+re*this.U[ee][yt-1],this.U[ee][Kt]=le}}break;case 3:{var nt=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[G-1]),Math.abs(this.s[G-2])),Math.abs(s[G-2])),Math.abs(this.s[yt])),Math.abs(s[yt])),lt=this.s[G-1]/nt,ft=this.s[G-2]/nt,gt=s[G-2]/nt,ut=this.s[yt]/nt,Et=s[yt]/nt,Ft=((ft+lt)*(ft-lt)+gt*gt)/2,Rt=lt*gt*(lt*gt),vt=0;if(function(Qt,Wt){return Qt||Wt}(Ft!==0,Rt!==0)){if(vt=Math.sqrt(Ft*Ft+Rt),Ft<0)vt=-vt;vt=Rt/(Ft+vt)}var xt=(ut+lt)*(ut-lt)+vt,St=ut*Et;for(var wt=yt;wt<G-1;wt++){var Pt=C.hypot(xt,St),$t=xt/Pt,Dt=St/Pt;if(wt!==yt)s[wt-1]=Pt;if(xt=$t*this.s[wt]+Dt*s[wt],s[wt]=$t*s[wt]-Dt*this.s[wt],St=Dt*this.s[wt+1],this.s[wt+1]=$t*this.s[wt+1],a)for(var Mt=0;Mt<this.n;Mt++)Pt=$t*this.V[Mt][wt]+Dt*this.V[Mt][wt+1],this.V[Mt][wt+1]=-Dt*this.V[Mt][wt]+$t*this.V[Mt][wt+1],this.V[Mt][wt]=Pt;if(Pt=C.hypot(xt,St),$t=xt/Pt,Dt=St/Pt,this.s[wt]=Pt,xt=$t*s[wt]+Dt*this.s[wt+1],this.s[wt+1]=-Dt*s[wt]+$t*this.s[wt+1],St=Dt*s[wt+1],s[wt+1]=$t*s[wt+1],L&&wt<this.m-1)for(var bt=0;bt<this.m;bt++)Pt=$t*this.U[bt][wt]+Dt*this.U[bt][wt+1],this.U[bt][wt+1]=-Dt*this.U[bt][wt]+$t*this.U[bt][wt+1],this.U[bt][wt]=Pt}s[G-2]=xt,Ot=Ot+1}break;case 4:{if(this.s[yt]<=0){if(this.s[yt]=this.s[yt]<0?-this.s[yt]:0,a)for(var Ct=0;Ct<=mt;Ct++)this.V[Ct][yt]=-this.V[Ct][yt]}while(yt<mt){if(this.s[yt]>=this.s[yt+1])break;var It=this.s[yt];if(this.s[yt]=this.s[yt+1],this.s[yt+1]=It,a&&yt<this.n-1)for(var te=0;te<this.n;te++)It=this.V[te][yt+1],this.V[te][yt+1]=this.V[te][yt],this.V[te][yt]=It;if(L&&yt<this.m-1)for(var Jt=0;Jt<this.m;Jt++)It=this.U[Jt][yt+1],this.U[Jt][yt+1]=this.U[Jt][yt],this.U[Jt][yt]=It;yt++}Ot=0,G--}break}}var fe={U:this.U,V:this.V,S:this.s};return fe},C.hypot=function(y,l){var s=void 0;if(Math.abs(y)>Math.abs(l))s=l/y,s=Math.abs(y)*Math.sqrt(1+s*s);else if(l!=0)s=y/l,s=Math.abs(l)*Math.sqrt(1+s*s);else s=0;return s},U.exports=C},function(U,z,X){var C=function(){function s(h,L){for(var a=0;a<L.length;a++){var O=L[a];if(O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O)O.writable=!0;Object.defineProperty(h,O.key,O)}}return function(h,L,a){if(L)s(h.prototype,L);if(a)s(h,a);return h}}();function y(s,h){if(!(s instanceof h))throw TypeError("Cannot call a class as a function")}var l=function(){function s(h,L){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,O=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;y(this,s),this.sequence1=h,this.sequence2=L,this.match_score=a,this.mismatch_penalty=O,this.gap_penalty=o,this.iMax=h.length+1,this.jMax=L.length+1,this.grid=Array(this.iMax);for(var i=0;i<this.iMax;i++){this.grid[i]=Array(this.jMax);for(var N=0;N<this.jMax;N++)this.grid[i][N]=0}this.tracebackGrid=Array(this.iMax);for(var M=0;M<this.iMax;M++){this.tracebackGrid[M]=Array(this.jMax);for(var T=0;T<this.jMax;T++)this.tracebackGrid[M][T]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return C(s,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var L=1;L<this.jMax;L++)this.grid[0][L]=this.grid[0][L-1]+this.gap_penalty,this.tracebackGrid[0][L]=[!1,!1,!0];for(var a=1;a<this.iMax;a++)this.grid[a][0]=this.grid[a-1][0]+this.gap_penalty,this.tracebackGrid[a][0]=[!1,!0,!1];for(var O=1;O<this.iMax;O++)for(var o=1;o<this.jMax;o++){var i=void 0;if(this.sequence1[O-1]===this.sequence2[o-1])i=this.grid[O-1][o-1]+this.match_score;else i=this.grid[O-1][o-1]+this.mismatch_penalty;var N=this.grid[O-1][o]+this.gap_penalty,M=this.grid[O][o-1]+this.gap_penalty,T=[i,N,M],W=this.arrayAllMaxIndexes(T);this.grid[O][o]=T[W[0]],this.tracebackGrid[O][o]=[W.includes(0),W.includes(1),W.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var L=[];L.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(L[0]){var a=L[0],O=this.tracebackGrid[a.pos[0]][a.pos[1]];if(O[0])L.push({pos:[a.pos[0]-1,a.pos[1]-1],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2});if(O[1])L.push({pos:[a.pos[0]-1,a.pos[1]],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:"-"+a.seq2});if(O[2])L.push({pos:[a.pos[0],a.pos[1]-1],seq1:"-"+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2});if(a.pos[0]===0&&a.pos[1]===0)this.alignments.push({sequence1:a.seq1,sequence2:a.seq2});L.shift()}return this.alignments}},{key:"getAllIndexes",value:function(L,a){var O=[],o=-1;while((o=L.indexOf(a,o+1))!==-1)O.push(o);return O}},{key:"arrayAllMaxIndexes",value:function(L){return this.getAllIndexes(L,Math.max.apply(null,L))}}]),s}();U.exports=l},function(U,z,X){var C=function(){return};C.FDLayout=X(18),C.FDLayoutConstants=X(4),C.FDLayoutEdge=X(19),C.FDLayoutNode=X(20),C.DimensionD=X(21),C.HashMap=X(22),C.HashSet=X(23),C.IGeometry=X(8),C.IMath=X(9),C.Integer=X(10),C.Point=X(12),C.PointD=X(5),C.RandomSeed=X(16),C.RectangleD=X(13),C.Transform=X(17),C.UniqueIDGeneretor=X(14),C.Quicksort=X(25),C.LinkedList=X(11),C.LGraphObject=X(2),C.LGraph=X(6),C.LEdge=X(1),C.LGraphManager=X(7),C.LNode=X(3),C.Layout=X(15),C.LayoutConstants=X(0),C.NeedlemanWunsch=X(27),C.Matrix=X(24),C.SVD=X(26),U.exports=C},function(U,z,X){function C(){this.listeners=[]}var y=C.prototype;y.addListener=function(l,s){this.listeners.push({event:l,callback:s})},y.removeListener=function(l,s){for(var h=this.listeners.length;h>=0;h--){var L=this.listeners[h];if(L.event===l&&L.callback===s)this.listeners.splice(h,1)}},y.emit=function(l,s){for(var h=0;h<this.listeners.length;h++){var L=this.listeners[h];if(l===L.event)L.callback(s)}},U.exports=C}])})});var We=se(function(Ae,He){(function(z,X){if(typeof Ae==="object"&&typeof He==="object")He.exports=X(Xe());else if(typeof define==="function"&&define.amd)define(["layout-base"],X);else if(typeof Ae==="object")Ae.coseBase=X(Xe());else z.coseBase=X(z.layoutBase)})(Ae,function(U){return(()=>{var z={45:(l,s,h)=>{var L={};L.layoutBase=h(551),L.CoSEConstants=h(806),L.CoSEEdge=h(767),L.CoSEGraph=h(880),L.CoSEGraphManager=h(578),L.CoSELayout=h(765),L.CoSENode=h(991),L.ConstraintHandler=h(902),l.exports=L},806:(l,s,h)=>{var L=h(551).FDLayoutConstants;function a(){}for(var O in L)a[O]=L[O];a.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,a.DEFAULT_RADIAL_SEPARATION=L.DEFAULT_EDGE_LENGTH,a.DEFAULT_COMPONENT_SEPERATION=60,a.TILE=!0,a.TILING_PADDING_VERTICAL=10,a.TILING_PADDING_HORIZONTAL=10,a.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,a.ENFORCE_CONSTRAINTS=!0,a.APPLY_LAYOUT=!0,a.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,a.TREE_REDUCTION_ON_INCREMENTAL=!0,a.PURE_INCREMENTAL=a.DEFAULT_INCREMENTAL,l.exports=a},767:(l,s,h)=>{var L=h(551).FDLayoutEdge;function a(o,i,N){L.call(this,o,i,N)}a.prototype=Object.create(L.prototype);for(var O in L)a[O]=L[O];l.exports=a},880:(l,s,h)=>{var L=h(551).LGraph;function a(o,i,N){L.call(this,o,i,N)}a.prototype=Object.create(L.prototype);for(var O in L)a[O]=L[O];l.exports=a},578:(l,s,h)=>{var L=h(551).LGraphManager;function a(o){L.call(this,o)}a.prototype=Object.create(L.prototype);for(var O in L)a[O]=L[O];l.exports=a},765:(l,s,h)=>{var L=h(551).FDLayout,a=h(578),O=h(880),o=h(991),i=h(767),N=h(806),M=h(902),T=h(551).FDLayoutConstants,W=h(551).LayoutConstants,F=h(551).Point,P=h(551).PointD,H=h(551).DimensionD,J=h(551).Layout,V=h(551).Integer,_=h(551).IGeometry,ot=h(551).LGraph,it=h(551).Transform,pt=h(551).LinkedList;function q(){L.call(this),this.toBeTiled={},this.constraints={}}q.prototype=Object.create(L.prototype);for(var st in L)q[st]=L[st];q.prototype.newGraphManager=function(){var c=new a(this);return this.graphManager=c,c},q.prototype.newGraph=function(c){return new O(null,this.graphManager,c)},q.prototype.newNode=function(c){return new o(this.graphManager,c)},q.prototype.newEdge=function(c){return new i(null,null,c)},q.prototype.initParameters=function(){if(L.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(N.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=N.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=N.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=T.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=T.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=T.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=T.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},q.prototype.initSpringEmbedder=function(){L.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/T.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},q.prototype.layout=function(){var c=W.DEFAULT_CREATE_BENDS_AS_NEEDED;if(c)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},q.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){var c=this.getFlatForest();if(c.length>0)this.positionNodesRadially(c);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var G=new Set(this.getAllNodes()),S=this.nodesWithGravity.filter(function(Y){return G.has(Y)});this.graphManager.setAllNodesToApplyGravitation(S),this.positionNodesRandomly()}}else if(N.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var G=new Set(this.getAllNodes()),S=this.nodesWithGravity.filter(function(Q){return G.has(Q)});this.graphManager.setAllNodesToApplyGravitation(S)}if(Object.keys(this.constraints).length>0)M.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),N.APPLY_LAYOUT)this.runSpringEmbedder();return!0},q.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%T.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(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 c=new Set(this.getAllNodes()),G=this.nodesWithGravity.filter(function(I){return c.has(I)});if(this.graphManager.setAllNodesToApplyGravitation(G),this.graphManager.updateBounds(),this.updateGrid(),N.PURE_INCREMENTAL)this.coolingFactor=T.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=T.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();if(N.PURE_INCREMENTAL)this.coolingFactor=T.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=T.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var S=!this.isTreeGrowing&&!this.isGrowthFinished,Y=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(S,Y),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},q.prototype.getPositionsData=function(){var c=this.graphManager.getAllNodes(),G={};for(var S=0;S<c.length;S++){var Y=c[S].rect,I=c[S].id;G[I]={id:I,x:Y.getCenterX(),y:Y.getCenterY(),w:Y.width,h:Y.height}}return G},q.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var c=!1;if(T.ANIMATE==="during")this.emit("layoutstarted");else{while(!c)c=this.tick();this.graphManager.updateBounds()}},q.prototype.moveNodes=function(){var c=this.getAllNodes(),G;for(var S=0;S<c.length;S++)G=c[S],G.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var S=0;S<c.length;S++)G=c[S],G.move()},q.prototype.initConstraintVariables=function(){var c=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var G=this.graphManager.getAllNodes();for(var S=0;S<G.length;S++){var Y=G[S];this.idToNodeMap.set(Y.id,Y)}var I=function B(at){var ht=at.getChild().getNodes(),mt,Ot=0;for(var Vt=0;Vt<ht.length;Vt++)if(mt=ht[Vt],mt.getChild()==null){if(c.fixedNodeSet.has(mt.id))Ot+=100}else Ot+=B(mt);return Ot};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(ht){c.fixedNodeSet.add(ht.nodeId)});var G=this.graphManager.getAllNodes(),Y;for(var S=0;S<G.length;S++)if(Y=G[S],Y.getChild()!=null){var Q=I(Y);if(Q>0)Y.fixedNodeWeight=Q}}if(this.constraints.relativePlacementConstraint){var k=new Map,rt=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(B){c.fixedNodesOnHorizontal.add(B),c.fixedNodesOnVertical.add(B)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var tt=this.constraints.alignmentConstraint.vertical;for(var S=0;S<tt.length;S++)this.dummyToNodeForVerticalAlignment.set("dummy"+S,[]),tt[S].forEach(function(at){if(k.set(at,"dummy"+S),c.dummyToNodeForVerticalAlignment.get("dummy"+S).push(at),c.fixedNodeSet.has(at))c.fixedNodesOnHorizontal.add("dummy"+S)})}if(this.constraints.alignmentConstraint.horizontal){var j=this.constraints.alignmentConstraint.horizontal;for(var S=0;S<j.length;S++)this.dummyToNodeForHorizontalAlignment.set("dummy"+S,[]),j[S].forEach(function(at){if(rt.set(at,"dummy"+S),c.dummyToNodeForHorizontalAlignment.get("dummy"+S).push(at),c.fixedNodeSet.has(at))c.fixedNodesOnVertical.add("dummy"+S)})}}if(N.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(B){var at,ht,mt;for(mt=B.length-1;mt>=2*B.length/3;mt--)at=Math.floor(Math.random()*(mt+1)),ht=B[mt],B[mt]=B[at],B[at]=ht;return B},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(B){if(B.left){var at=k.has(B.left)?k.get(B.left):B.left,ht=k.has(B.right)?k.get(B.right):B.right;if(!c.nodesInRelativeHorizontal.includes(at))if(c.nodesInRelativeHorizontal.push(at),c.nodeToRelativeConstraintMapHorizontal.set(at,[]),c.dummyToNodeForVerticalAlignment.has(at))c.nodeToTempPositionMapHorizontal.set(at,c.idToNodeMap.get(c.dummyToNodeForVerticalAlignment.get(at)[0]).getCenterX());else c.nodeToTempPositionMapHorizontal.set(at,c.idToNodeMap.get(at).getCenterX());if(!c.nodesInRelativeHorizontal.includes(ht))if(c.nodesInRelativeHorizontal.push(ht),c.nodeToRelativeConstraintMapHorizontal.set(ht,[]),c.dummyToNodeForVerticalAlignment.has(ht))c.nodeToTempPositionMapHorizontal.set(ht,c.idToNodeMap.get(c.dummyToNodeForVerticalAlignment.get(ht)[0]).getCenterX());else c.nodeToTempPositionMapHorizontal.set(ht,c.idToNodeMap.get(ht).getCenterX());c.nodeToRelativeConstraintMapHorizontal.get(at).push({right:ht,gap:B.gap}),c.nodeToRelativeConstraintMapHorizontal.get(ht).push({left:at,gap:B.gap})}else{var mt=rt.has(B.top)?rt.get(B.top):B.top,Ot=rt.has(B.bottom)?rt.get(B.bottom):B.bottom;if(!c.nodesInRelativeVertical.includes(mt))if(c.nodesInRelativeVertical.push(mt),c.nodeToRelativeConstraintMapVertical.set(mt,[]),c.dummyToNodeForHorizontalAlignment.has(mt))c.nodeToTempPositionMapVertical.set(mt,c.idToNodeMap.get(c.dummyToNodeForHorizontalAlignment.get(mt)[0]).getCenterY());else c.nodeToTempPositionMapVertical.set(mt,c.idToNodeMap.get(mt).getCenterY());if(!c.nodesInRelativeVertical.includes(Ot))if(c.nodesInRelativeVertical.push(Ot),c.nodeToRelativeConstraintMapVertical.set(Ot,[]),c.dummyToNodeForHorizontalAlignment.has(Ot))c.nodeToTempPositionMapVertical.set(Ot,c.idToNodeMap.get(c.dummyToNodeForHorizontalAlignment.get(Ot)[0]).getCenterY());else c.nodeToTempPositionMapVertical.set(Ot,c.idToNodeMap.get(Ot).getCenterY());c.nodeToRelativeConstraintMapVertical.get(mt).push({bottom:Ot,gap:B.gap}),c.nodeToRelativeConstraintMapVertical.get(Ot).push({top:mt,gap:B.gap})}});else{var dt=new Map,Nt=new Map;this.constraints.relativePlacementConstraint.forEach(function(B){if(B.left){var at=k.has(B.left)?k.get(B.left):B.left,ht=k.has(B.right)?k.get(B.right):B.right;if(dt.has(at))dt.get(at).push(ht);else dt.set(at,[ht]);if(dt.has(ht))dt.get(ht).push(at);else dt.set(ht,[at])}else{var mt=rt.has(B.top)?rt.get(B.top):B.top,Ot=rt.has(B.bottom)?rt.get(B.bottom):B.bottom;if(Nt.has(mt))Nt.get(mt).push(Ot);else Nt.set(mt,[Ot]);if(Nt.has(Ot))Nt.get(Ot).push(mt);else Nt.set(Ot,[mt])}});var et=function(at,ht){var mt=[],Ot=[],Vt=new pt,_t=new Set,yt=0;return at.forEach(function(ne,kt){if(!_t.has(kt)){mt[yt]=[],Ot[yt]=!1;var At=kt;Vt.push(At),_t.add(At),mt[yt].push(At);while(Vt.length!=0){if(At=Vt.shift(),ht.has(At))Ot[yt]=!0;var Lt=at.get(At);Lt.forEach(function(Gt){if(!_t.has(Gt))Vt.push(Gt),_t.add(Gt),mt[yt].push(Gt)})}yt++}}),{components:mt,isFixed:Ot}},Tt=et(dt,c.fixedNodesOnHorizontal);this.componentsOnHorizontal=Tt.components,this.fixedComponentsOnHorizontal=Tt.isFixed;var ct=et(Nt,c.fixedNodesOnVertical);this.componentsOnVertical=ct.components,this.fixedComponentsOnVertical=ct.isFixed}}},q.prototype.updateDisplacements=function(){var c=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(ct){var B=c.idToNodeMap.get(ct.nodeId);B.displacementX=0,B.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var G=this.constraints.alignmentConstraint.vertical;for(var S=0;S<G.length;S++){var Y=0;for(var I=0;I<G[S].length;I++){if(this.fixedNodeSet.has(G[S][I])){Y=0;break}Y+=this.idToNodeMap.get(G[S][I]).displacementX}var Q=Y/G[S].length;for(var I=0;I<G[S].length;I++)this.idToNodeMap.get(G[S][I]).displacementX=Q}}if(this.constraints.alignmentConstraint.horizontal){var k=this.constraints.alignmentConstraint.horizontal;for(var S=0;S<k.length;S++){var rt=0;for(var I=0;I<k[S].length;I++){if(this.fixedNodeSet.has(k[S][I])){rt=0;break}rt+=this.idToNodeMap.get(k[S][I]).displacementY}var tt=rt/k[S].length;for(var I=0;I<k[S].length;I++)this.idToNodeMap.get(k[S][I]).displacementY=tt}}}if(this.constraints.relativePlacementConstraint)if(N.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(ct){if(!c.fixedNodesOnHorizontal.has(ct)){var B=0;if(c.dummyToNodeForVerticalAlignment.has(ct))B=c.idToNodeMap.get(c.dummyToNodeForVerticalAlignment.get(ct)[0]).displacementX;else B=c.idToNodeMap.get(ct).displacementX;if(c.nodeToRelativeConstraintMapHorizontal.get(ct).forEach(function(at){if(at.right){var ht=c.nodeToTempPositionMapHorizontal.get(at.right)-c.nodeToTempPositionMapHorizontal.get(ct)-B;if(ht<at.gap)B-=at.gap-ht}else{var ht=c.nodeToTempPositionMapHorizontal.get(ct)-c.nodeToTempPositionMapHorizontal.get(at.left)+B;if(ht<at.gap)B+=at.gap-ht}}),c.nodeToTempPositionMapHorizontal.set(ct,c.nodeToTempPositionMapHorizontal.get(ct)+B),c.dummyToNodeForVerticalAlignment.has(ct))c.dummyToNodeForVerticalAlignment.get(ct).forEach(function(at){c.idToNodeMap.get(at).displacementX=B});else c.idToNodeMap.get(ct).displacementX=B}}),this.nodesInRelativeVertical.forEach(function(ct){if(!c.fixedNodesOnHorizontal.has(ct)){var B=0;if(c.dummyToNodeForHorizontalAlignment.has(ct))B=c.idToNodeMap.get(c.dummyToNodeForHorizontalAlignment.get(ct)[0]).displacementY;else B=c.idToNodeMap.get(ct).displacementY;if(c.nodeToRelativeConstraintMapVertical.get(ct).forEach(function(at){if(at.bottom){var ht=c.nodeToTempPositionMapVertical.get(at.bottom)-c.nodeToTempPositionMapVertical.get(ct)-B;if(ht<at.gap)B-=at.gap-ht}else{var ht=c.nodeToTempPositionMapVertical.get(ct)-c.nodeToTempPositionMapVertical.get(at.top)+B;if(ht<at.gap)B+=at.gap-ht}}),c.nodeToTempPositionMapVertical.set(ct,c.nodeToTempPositionMapVertical.get(ct)+B),c.dummyToNodeForHorizontalAlignment.has(ct))c.dummyToNodeForHorizontalAlignment.get(ct).forEach(function(at){c.idToNodeMap.get(at).displacementY=B});else c.idToNodeMap.get(ct).displacementY=B}})}else{for(var S=0;S<this.componentsOnHorizontal.length;S++){var j=this.componentsOnHorizontal[S];if(this.fixedComponentsOnHorizontal[S])for(var I=0;I<j.length;I++)if(this.dummyToNodeForVerticalAlignment.has(j[I]))this.dummyToNodeForVerticalAlignment.get(j[I]).forEach(function(at){c.idToNodeMap.get(at).displacementX=0});else this.idToNodeMap.get(j[I]).displacementX=0;else{var dt=0,Nt=0;for(var I=0;I<j.length;I++)if(this.dummyToNodeForVerticalAlignment.has(j[I])){var et=this.dummyToNodeForVerticalAlignment.get(j[I]);dt+=et.length*this.idToNodeMap.get(et[0]).displacementX,Nt+=et.length}else dt+=this.idToNodeMap.get(j[I]).displacementX,Nt++;var Tt=dt/Nt;for(var I=0;I<j.length;I++)if(this.dummyToNodeForVerticalAlignment.has(j[I]))this.dummyToNodeForVerticalAlignment.get(j[I]).forEach(function(at){c.idToNodeMap.get(at).displacementX=Tt});else this.idToNodeMap.get(j[I]).displacementX=Tt}}for(var S=0;S<this.componentsOnVertical.length;S++){var j=this.componentsOnVertical[S];if(this.fixedComponentsOnVertical[S])for(var I=0;I<j.length;I++)if(this.dummyToNodeForHorizontalAlignment.has(j[I]))this.dummyToNodeForHorizontalAlignment.get(j[I]).forEach(function(ht){c.idToNodeMap.get(ht).displacementY=0});else this.idToNodeMap.get(j[I]).displacementY=0;else{var dt=0,Nt=0;for(var I=0;I<j.length;I++)if(this.dummyToNodeForHorizontalAlignment.has(j[I])){var et=this.dummyToNodeForHorizontalAlignment.get(j[I]);dt+=et.length*this.idToNodeMap.get(et[0]).displacementY,Nt+=et.length}else dt+=this.idToNodeMap.get(j[I]).displacementY,Nt++;var Tt=dt/Nt;for(var I=0;I<j.length;I++)if(this.dummyToNodeForHorizontalAlignment.has(j[I]))this.dummyToNodeForHorizontalAlignment.get(j[I]).forEach(function(Vt){c.idToNodeMap.get(Vt).displacementY=Tt});else this.idToNodeMap.get(j[I]).displacementY=Tt}}}},q.prototype.calculateNodesToApplyGravitationTo=function(){var c=[],G,S=this.graphManager.getGraphs(),Y=S.length,I;for(I=0;I<Y;I++)if(G=S[I],G.updateConnected(),!G.isConnected)c=c.concat(G.getNodes());return c},q.prototype.createBendpoints=function(){var c=[];c=c.concat(this.graphManager.getAllEdges());var G=new Set,S;for(S=0;S<c.length;S++){var Y=c[S];if(!G.has(Y)){var I=Y.getSource(),Q=Y.getTarget();if(I==Q)Y.getBendpoints().push(new P),Y.getBendpoints().push(new P),this.createDummyNodesForBendpoints(Y),G.add(Y);else{var k=[];if(k=k.concat(I.getEdgeListToNode(Q)),k=k.concat(Q.getEdgeListToNode(I)),!G.has(k[0])){if(k.length>1){var rt;for(rt=0;rt<k.length;rt++){var tt=k[rt];tt.getBendpoints().push(new P),this.createDummyNodesForBendpoints(tt)}}k.forEach(function(j){G.add(j)})}}}if(G.size==c.length)break}},q.prototype.positionNodesRadially=function(c){var G=new F(0,0),S=Math.ceil(Math.sqrt(c.length)),Y=0,I=0,Q=0,k=new P(0,0);for(var rt=0;rt<c.length;rt++){if(rt%S==0){if(Q=0,I=Y,rt!=0)I+=N.DEFAULT_COMPONENT_SEPERATION;Y=0}var tt=c[rt],j=J.findCenterOfTree(tt);if(G.x=Q,G.y=I,k=q.radialLayout(tt,j,G),k.y>Y)Y=Math.floor(k.y);Q=Math.floor(k.x+N.DEFAULT_COMPONENT_SEPERATION)}this.transform(new P(W.WORLD_CENTER_X-k.x/2,W.WORLD_CENTER_Y-k.y/2))},q.radialLayout=function(c,G,S){var Y=Math.max(this.maxDiagonalInTree(c),N.DEFAULT_RADIAL_SEPARATION);q.branchRadialLayout(G,null,0,359,0,Y);var I=ot.calculateBounds(c),Q=new it;Q.setDeviceOrgX(I.getMinX()),Q.setDeviceOrgY(I.getMinY()),Q.setWorldOrgX(S.x),Q.setWorldOrgY(S.y);for(var k=0;k<c.length;k++){var rt=c[k];rt.transform(Q)}var tt=new P(I.getMaxX(),I.getMaxY());return Q.inverseTransformPoint(tt)},q.branchRadialLayout=function(c,G,S,Y,I,Q){var k=(Y-S+1)/2;if(k<0)k+=180;var rt=(k+S)%360,tt=rt*_.TWO_PI/360,j=Math.cos(tt),dt=I*Math.cos(tt),Nt=I*Math.sin(tt);c.setCenter(dt,Nt);var et=[];et=et.concat(c.getEdges());var Tt=et.length;if(G!=null)Tt--;var ct=0,B=et.length,at,ht=c.getEdgesBetween(G);while(ht.length>1){var mt=ht[0];ht.splice(0,1);var Ot=et.indexOf(mt);if(Ot>=0)et.splice(Ot,1);B--,Tt--}if(G!=null)at=(et.indexOf(ht[0])+1)%B;else at=0;var Vt=Math.abs(Y-S)/Tt;for(var _t=at;ct!=Tt;_t=++_t%B){var yt=et[_t].getOtherEnd(c);if(yt==G)continue;var ne=(S+ct*Vt)%360,kt=(ne+Vt)%360;q.branchRadialLayout(yt,c,ne,kt,I+Q,Q),ct++}},q.maxDiagonalInTree=function(c){var G=V.MIN_VALUE;for(var S=0;S<c.length;S++){var Y=c[S],I=Y.getDiagonal();if(I>G)G=I}return G},q.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},q.prototype.groupZeroDegreeMembers=function(){var c=this,G={};this.memberGroups={},this.idToDummyNode={};var S=[],Y=this.graphManager.getAllNodes();for(var I=0;I<Y.length;I++){var Q=Y[I],k=Q.getParent();if(this.getNodeDegreeWithChildren(Q)===0&&(k.id==null||!this.getToBeTiled(k)))S.push(Q)}for(var I=0;I<S.length;I++){var Q=S[I],rt=Q.getParent().id;if(typeof G[rt]>"u")G[rt]=[];G[rt]=G[rt].concat(Q)}Object.keys(G).forEach(function(tt){if(G[tt].length>1){var j="DummyCompound_"+tt;c.memberGroups[j]=G[tt];var dt=G[tt][0].getParent(),Nt=new o(c.graphManager);Nt.id=j,Nt.paddingLeft=dt.paddingLeft||0,Nt.paddingRight=dt.paddingRight||0,Nt.paddingBottom=dt.paddingBottom||0,Nt.paddingTop=dt.paddingTop||0,c.idToDummyNode[j]=Nt;var et=c.getGraphManager().add(c.newGraph(),Nt),Tt=dt.getChild();Tt.add(Nt);for(var ct=0;ct<G[tt].length;ct++){var B=G[tt][ct];Tt.remove(B),et.add(B)}}})},q.prototype.clearCompounds=function(){var c={},G={};this.performDFSOnCompounds();for(var S=0;S<this.compoundOrder.length;S++)G[this.compoundOrder[S].id]=this.compoundOrder[S],c[this.compoundOrder[S].id]=[].concat(this.compoundOrder[S].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[S].getChild()),this.compoundOrder[S].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(c,G)},q.prototype.clearZeroDegreeMembers=function(){var c=this,G=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(S){var Y=c.idToDummyNode[S];if(G[S]=c.tileNodes(c.memberGroups[S],Y.paddingLeft+Y.paddingRight),Y.rect.width=G[S].width,Y.rect.height=G[S].height,Y.setCenter(G[S].centerX,G[S].centerY),Y.labelMarginLeft=0,Y.labelMarginTop=0,N.NODE_DIMENSIONS_INCLUDE_LABELS){var I=Y.rect.width,Q=Y.rect.height;if(Y.labelWidth){if(Y.labelPosHorizontal=="left")Y.rect.x-=Y.labelWidth,Y.setWidth(I+Y.labelWidth),Y.labelMarginLeft=Y.labelWidth;else if(Y.labelPosHorizontal=="center"&&Y.labelWidth>I)Y.rect.x-=(Y.labelWidth-I)/2,Y.setWidth(Y.labelWidth),Y.labelMarginLeft=(Y.labelWidth-I)/2;else if(Y.labelPosHorizontal=="right")Y.setWidth(I+Y.labelWidth)}if(Y.labelHeight){if(Y.labelPosVertical=="top")Y.rect.y-=Y.labelHeight,Y.setHeight(Q+Y.labelHeight),Y.labelMarginTop=Y.labelHeight;else if(Y.labelPosVertical=="center"&&Y.labelHeight>Q)Y.rect.y-=(Y.labelHeight-Q)/2,Y.setHeight(Y.labelHeight),Y.labelMarginTop=(Y.labelHeight-Q)/2;else if(Y.labelPosVertical=="bottom")Y.setHeight(Q+Y.labelHeight)}}})},q.prototype.repopulateCompounds=function(){for(var c=this.compoundOrder.length-1;c>=0;c--){var G=this.compoundOrder[c],{id:S,paddingLeft:Y,paddingTop:I,labelMarginLeft:Q,labelMarginTop:k}=G;this.adjustLocations(this.tiledMemberPack[S],G.rect.x,G.rect.y,Y,I,Q,k)}},q.prototype.repopulateZeroDegreeMembers=function(){var c=this,G=this.tiledZeroDegreePack;Object.keys(G).forEach(function(S){var Y=c.idToDummyNode[S],{paddingLeft:I,paddingTop:Q,labelMarginLeft:k,labelMarginTop:rt}=Y;c.adjustLocations(G[S],Y.rect.x,Y.rect.y,I,Q,k,rt)})},q.prototype.getToBeTiled=function(c){var G=c.id;if(this.toBeTiled[G]!=null)return this.toBeTiled[G];var S=c.getChild();if(S==null)return this.toBeTiled[G]=!1,!1;var Y=S.getNodes();for(var I=0;I<Y.length;I++){var Q=Y[I];if(this.getNodeDegree(Q)>0)return this.toBeTiled[G]=!1,!1;if(Q.getChild()==null){this.toBeTiled[Q.id]=!1;continue}if(!this.getToBeTiled(Q))return this.toBeTiled[G]=!1,!1}return this.toBeTiled[G]=!0,!0},q.prototype.getNodeDegree=function(c){var G=c.id,S=c.getEdges(),Y=0;for(var I=0;I<S.length;I++){var Q=S[I];if(Q.getSource().id!==Q.getTarget().id)Y=Y+1}return Y},q.prototype.getNodeDegreeWithChildren=function(c){var G=this.getNodeDegree(c);if(c.getChild()==null)return G;var S=c.getChild().getNodes();for(var Y=0;Y<S.length;Y++){var I=S[Y];G+=this.getNodeDegreeWithChildren(I)}return G},q.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},q.prototype.fillCompexOrderByDFS=function(c){for(var G=0;G<c.length;G++){var S=c[G];if(S.getChild()!=null)this.fillCompexOrderByDFS(S.getChild().getNodes());if(this.getToBeTiled(S))this.compoundOrder.push(S)}},q.prototype.adjustLocations=function(c,G,S,Y,I,Q,k){G+=Y+Q,S+=I+k;var rt=G;for(var tt=0;tt<c.rows.length;tt++){var j=c.rows[tt];G=rt;var dt=0;for(var Nt=0;Nt<j.length;Nt++){var et=j[Nt];if(et.rect.x=G,et.rect.y=S,G+=et.rect.width+c.horizontalPadding,et.rect.height>dt)dt=et.rect.height}S+=dt+c.verticalPadding}},q.prototype.tileCompoundMembers=function(c,G){var S=this;this.tiledMemberPack=[],Object.keys(c).forEach(function(Y){var I=G[Y];if(S.tiledMemberPack[Y]=S.tileNodes(c[Y],I.paddingLeft+I.paddingRight),I.rect.width=S.tiledMemberPack[Y].width,I.rect.height=S.tiledMemberPack[Y].height,I.setCenter(S.tiledMemberPack[Y].centerX,S.tiledMemberPack[Y].centerY),I.labelMarginLeft=0,I.labelMarginTop=0,N.NODE_DIMENSIONS_INCLUDE_LABELS){var Q=I.rect.width,k=I.rect.height;if(I.labelWidth){if(I.labelPosHorizontal=="left")I.rect.x-=I.labelWidth,I.setWidth(Q+I.labelWidth),I.labelMarginLeft=I.labelWidth;else if(I.labelPosHorizontal=="center"&&I.labelWidth>Q)I.rect.x-=(I.labelWidth-Q)/2,I.setWidth(I.labelWidth),I.labelMarginLeft=(I.labelWidth-Q)/2;else if(I.labelPosHorizontal=="right")I.setWidth(Q+I.labelWidth)}if(I.labelHeight){if(I.labelPosVertical=="top")I.rect.y-=I.labelHeight,I.setHeight(k+I.labelHeight),I.labelMarginTop=I.labelHeight;else if(I.labelPosVertical=="center"&&I.labelHeight>k)I.rect.y-=(I.labelHeight-k)/2,I.setHeight(I.labelHeight),I.labelMarginTop=(I.labelHeight-k)/2;else if(I.labelPosVertical=="bottom")I.setHeight(k+I.labelHeight)}}})},q.prototype.tileNodes=function(c,G){var S=this.tileNodesByFavoringDim(c,G,!0),Y=this.tileNodesByFavoringDim(c,G,!1),I=this.getOrgRatio(S),Q=this.getOrgRatio(Y),k;if(Q<I)k=Y;else k=S;return k},q.prototype.getOrgRatio=function(c){var{width:G,height:S}=c,Y=G/S;if(Y<1)Y=1/Y;return Y},q.prototype.calcIdealRowWidth=function(c,G){var{TILING_PADDING_VERTICAL:S,TILING_PADDING_HORIZONTAL:Y}=N,I=c.length,Q=0,k=0,rt=0;c.forEach(function(ct){if(Q+=ct.getWidth(),k+=ct.getHeight(),ct.getWidth()>rt)rt=ct.getWidth()});var tt=Q/I,j=k/I,dt=Math.pow(S-Y,2)+4*(tt+Y)*(j+S)*I,Nt=(Y-S+Math.sqrt(dt))/(2*(tt+Y)),et;if(G){if(et=Math.ceil(Nt),et==Nt)et++}else et=Math.floor(Nt);var Tt=et*(tt+Y)-Y;if(rt>Tt)Tt=rt;return Tt+=Y*2,Tt},q.prototype.tileNodesByFavoringDim=function(c,G,S){var{TILING_PADDING_VERTICAL:Y,TILING_PADDING_HORIZONTAL:I,TILING_COMPARE_BY:Q}=N,k={rows:[],rowWidth:[],rowHeight:[],width:0,height:G,verticalPadding:Y,horizontalPadding:I,centerX:0,centerY:0};if(Q)k.idealRowWidth=this.calcIdealRowWidth(c,S);var rt=function(B){return B.rect.width*B.rect.height},tt=function(B,at){return rt(at)-rt(B)};c.sort(function(ct,B){var at=tt;if(k.idealRowWidth)return at=Q,at(ct.id,B.id);return at(ct,B)});var j=0,dt=0;for(var Nt=0;Nt<c.length;Nt++){var et=c[Nt];j+=et.getCenterX(),dt+=et.getCenterY()}k.centerX=j/c.length,k.centerY=dt/c.length;for(var Nt=0;Nt<c.length;Nt++){var et=c[Nt];if(k.rows.length==0)this.insertNodeToRow(k,et,0,G);else if(this.canAddHorizontal(k,et.rect.width,et.rect.height)){var Tt=k.rows.length-1;if(!k.idealRowWidth)Tt=this.getShortestRowIndex(k);this.insertNodeToRow(k,et,Tt,G)}else this.insertNodeToRow(k,et,k.rows.length,G);this.shiftToLastRow(k)}return k},q.prototype.insertNodeToRow=function(c,G,S,Y){var I=Y;if(S==c.rows.length){var Q=[];c.rows.push(Q),c.rowWidth.push(I),c.rowHeight.push(0)}var k=c.rowWidth[S]+G.rect.width;if(c.rows[S].length>0)k+=c.horizontalPadding;if(c.rowWidth[S]=k,c.width<k)c.width=k;var rt=G.rect.height;if(S>0)rt+=c.verticalPadding;var tt=0;if(rt>c.rowHeight[S])tt=c.rowHeight[S],c.rowHeight[S]=rt,tt=c.rowHeight[S]-tt;c.height+=tt,c.rows[S].push(G)},q.prototype.getShortestRowIndex=function(c){var G=-1,S=Number.MAX_VALUE;for(var Y=0;Y<c.rows.length;Y++)if(c.rowWidth[Y]<S)G=Y,S=c.rowWidth[Y];return G},q.prototype.getLongestRowIndex=function(c){var G=-1,S=Number.MIN_VALUE;for(var Y=0;Y<c.rows.length;Y++)if(c.rowWidth[Y]>S)G=Y,S=c.rowWidth[Y];return G},q.prototype.canAddHorizontal=function(c,G,S){if(c.idealRowWidth){var Y=c.rows.length-1,I=c.rowWidth[Y];return I+G+c.horizontalPadding<=c.idealRowWidth}var Q=this.getShortestRowIndex(c);if(Q<0)return!0;var k=c.rowWidth[Q];if(k+c.horizontalPadding+G<=c.width)return!0;var rt=0;if(c.rowHeight[Q]<S){if(Q>0)rt=S+c.verticalPadding-c.rowHeight[Q]}var tt;if(c.width-k>=G+c.horizontalPadding)tt=(c.height+rt)/(k+G+c.horizontalPadding);else tt=(c.height+rt)/c.width;rt=S+c.verticalPadding;var j;if(c.width<G)j=(c.height+rt)/G;else j=(c.height+rt)/c.width;if(j<1)j=1/j;if(tt<1)tt=1/tt;return tt<j},q.prototype.shiftToLastRow=function(c){var G=this.getLongestRowIndex(c),S=c.rowWidth.length-1,Y=c.rows[G],I=Y[Y.length-1],Q=I.width+c.horizontalPadding;if(c.width-c.rowWidth[S]>Q&&G!=S){Y.splice(-1,1),c.rows[S].push(I),c.rowWidth[G]=c.rowWidth[G]-Q,c.rowWidth[S]=c.rowWidth[S]+Q,c.width=c.rowWidth[instance.getLongestRowIndex(c)];var k=Number.MIN_VALUE;for(var rt=0;rt<Y.length;rt++)if(Y[rt].height>k)k=Y[rt].height;if(G>0)k+=c.verticalPadding;var tt=c.rowHeight[G]+c.rowHeight[S];if(c.rowHeight[G]=k,c.rowHeight[S]<I.height+c.verticalPadding)c.rowHeight[S]=I.height+c.verticalPadding;var j=c.rowHeight[G]+c.rowHeight[S];c.height+=j-tt,this.shiftToLastRow(c)}},q.prototype.tilingPreLayout=function(){if(N.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},q.prototype.tilingPostLayout=function(){if(N.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},q.prototype.reduceTrees=function(){var c=[],G=!0,S;while(G){var Y=this.graphManager.getAllNodes(),I=[];G=!1;for(var Q=0;Q<Y.length;Q++)if(S=Y[Q],S.getEdges().length==1&&!S.getEdges()[0].isInterGraph&&S.getChild()==null){if(N.PURE_INCREMENTAL){var k=S.getEdges()[0].getOtherEnd(S),rt=new H(S.getCenterX()-k.getCenterX(),S.getCenterY()-k.getCenterY());I.push([S,S.getEdges()[0],S.getOwner(),rt])}else I.push([S,S.getEdges()[0],S.getOwner()]);G=!0}if(G==!0){var tt=[];for(var j=0;j<I.length;j++)if(I[j][0].getEdges().length==1)tt.push(I[j]),I[j][0].getOwner().remove(I[j][0]);c.push(tt),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=c},q.prototype.growTree=function(c){var G=c.length,S=c[G-1],Y;for(var I=0;I<S.length;I++)Y=S[I],this.findPlaceforPrunedNode(Y),Y[2].add(Y[0]),Y[2].add(Y[1],Y[1].source,Y[1].target);c.splice(c.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},q.prototype.findPlaceforPrunedNode=function(c){var G,S,Y=c[0];if(Y==c[1].source)S=c[1].target;else S=c[1].source;if(N.PURE_INCREMENTAL)Y.setCenter(S.getCenterX()+c[3].getWidth(),S.getCenterY()+c[3].getHeight());else{var I=S.startX,Q=S.finishX,k=S.startY,rt=S.finishY,tt=0,j=0,dt=0,Nt=0,et=[tt,dt,j,Nt];if(k>0)for(var Tt=I;Tt<=Q;Tt++)et[0]+=this.grid[Tt][k-1].length+this.grid[Tt][k].length-1;if(Q<this.grid.length-1)for(var Tt=k;Tt<=rt;Tt++)et[1]+=this.grid[Q+1][Tt].length+this.grid[Q][Tt].length-1;if(rt<this.grid[0].length-1)for(var Tt=I;Tt<=Q;Tt++)et[2]+=this.grid[Tt][rt+1].length+this.grid[Tt][rt].length-1;if(I>0)for(var Tt=k;Tt<=rt;Tt++)et[3]+=this.grid[I-1][Tt].length+this.grid[I][Tt].length-1;var ct=V.MAX_VALUE,B,at;for(var ht=0;ht<et.length;ht++)if(et[ht]<ct)ct=et[ht],B=1,at=ht;else if(et[ht]==ct)B++;if(B==3&&ct==0){if(et[0]==0&&et[1]==0&&et[2]==0)G=1;else if(et[0]==0&&et[1]==0&&et[3]==0)G=0;else if(et[0]==0&&et[2]==0&&et[3]==0)G=3;else if(et[1]==0&&et[2]==0&&et[3]==0)G=2}else if(B==2&&ct==0){var mt=Math.floor(Math.random()*2);if(et[0]==0&&et[1]==0)if(mt==0)G=0;else G=1;else if(et[0]==0&&et[2]==0)if(mt==0)G=0;else G=2;else if(et[0]==0&&et[3]==0)if(mt==0)G=0;else G=3;else if(et[1]==0&&et[2]==0)if(mt==0)G=1;else G=2;else if(et[1]==0&&et[3]==0)if(mt==0)G=1;else G=3;else if(mt==0)G=2;else G=3}else if(B==4&&ct==0){var mt=Math.floor(Math.random()*4);G=mt}else G=at;if(G==0)Y.setCenter(S.getCenterX(),S.getCenterY()-S.getHeight()/2-T.DEFAULT_EDGE_LENGTH-Y.getHeight()/2);else if(G==1)Y.setCenter(S.getCenterX()+S.getWidth()/2+T.DEFAULT_EDGE_LENGTH+Y.getWidth()/2,S.getCenterY());else if(G==2)Y.setCenter(S.getCenterX(),S.getCenterY()+S.getHeight()/2+T.DEFAULT_EDGE_LENGTH+Y.getHeight()/2);else Y.setCenter(S.getCenterX()-S.getWidth()/2-T.DEFAULT_EDGE_LENGTH-Y.getWidth()/2,S.getCenterY())}},l.exports=q},991:(l,s,h)=>{var L=h(551).FDLayoutNode,a=h(551).IMath;function O(i,N,M,T){L.call(this,i,N,M,T)}O.prototype=Object.create(L.prototype);for(var o in L)O[o]=L[o];O.prototype.calculateDisplacement=function(){var i=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=i.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=i.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=i.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=i.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>i.coolingFactor*i.maxNodeDisplacement)this.displacementX=i.coolingFactor*i.maxNodeDisplacement*a.sign(this.displacementX);if(Math.abs(this.displacementY)>i.coolingFactor*i.maxNodeDisplacement)this.displacementY=i.coolingFactor*i.maxNodeDisplacement*a.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},O.prototype.propogateDisplacementToChildren=function(i,N){var M=this.getChild().getNodes(),T;for(var W=0;W<M.length;W++)if(T=M[W],T.getChild()==null)T.displacementX+=i,T.displacementY+=N;else T.propogateDisplacementToChildren(i,N)},O.prototype.move=function(){var i=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),i.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},O.prototype.setPred1=function(i){this.pred1=i},O.prototype.getPred1=function(){return pred1},O.prototype.getPred2=function(){return pred2},O.prototype.setNext=function(i){this.next=i},O.prototype.getNext=function(){return next},O.prototype.setProcessed=function(i){this.processed=i},O.prototype.isProcessed=function(){return processed},l.exports=O},902:(l,s,h)=>{function L(M){if(Array.isArray(M)){for(var T=0,W=Array(M.length);T<M.length;T++)W[T]=M[T];return W}else return Array.from(M)}var a=h(806),O=h(551).LinkedList,o=h(551).Matrix,i=h(551).SVD;function N(){}N.handleConstraints=function(M){var T={};T.fixedNodeConstraint=M.constraints.fixedNodeConstraint,T.alignmentConstraint=M.constraints.alignmentConstraint,T.relativePlacementConstraint=M.constraints.relativePlacementConstraint;var W=new Map,F=new Map,P=[],H=[],J=M.getAllNodes(),V=0;for(var _=0;_<J.length;_++){var ot=J[_];if(ot.getChild()==null)F.set(ot.id,V++),P.push(ot.getCenterX()),H.push(ot.getCenterY()),W.set(ot.id,ot)}if(T.relativePlacementConstraint)T.relativePlacementConstraint.forEach(function(nt){if(!nt.gap&&nt.gap!=0)if(nt.left)nt.gap=a.DEFAULT_EDGE_LENGTH+W.get(nt.left).getWidth()/2+W.get(nt.right).getWidth()/2;else nt.gap=a.DEFAULT_EDGE_LENGTH+W.get(nt.top).getHeight()/2+W.get(nt.bottom).getHeight()/2});var it=function(lt,ft){return{x:lt.x-ft.x,y:lt.y-ft.y}},pt=function(lt){var ft=0,gt=0;return lt.forEach(function(ut){ft+=P[F.get(ut)],gt+=H[F.get(ut)]}),{x:ft/lt.size,y:gt/lt.size}},q=function(lt,ft,gt,ut,Et){function Ft(Dt,Mt){var bt=new Set(Dt),Ct=!0,It=!1,te=void 0;try{for(var Jt=Mt[Symbol.iterator](),fe;!(Ct=(fe=Jt.next()).done);Ct=!0){var Qt=fe.value;bt.add(Qt)}}catch(Wt){It=!0,te=Wt}finally{try{if(!Ct&&Jt.return)Jt.return()}finally{if(It)throw te}}return bt}var Rt=new Map;lt.forEach(function(Dt,Mt){Rt.set(Mt,0)}),lt.forEach(function(Dt,Mt){Dt.forEach(function(bt){Rt.set(bt.id,Rt.get(bt.id)+1)})});var vt=new Map,xt=new Map,St=new O;if(Rt.forEach(function(Dt,Mt){if(Dt==0){if(St.push(Mt),!gt)if(ft=="horizontal")vt.set(Mt,F.has(Mt)?P[F.get(Mt)]:ut.get(Mt));else vt.set(Mt,F.has(Mt)?H[F.get(Mt)]:ut.get(Mt))}else vt.set(Mt,Number.NEGATIVE_INFINITY);if(gt)xt.set(Mt,new Set([Mt]))}),gt)Et.forEach(function(Dt){var Mt=[];if(Dt.forEach(function(It){if(gt.has(It))Mt.push(It)}),Mt.length>0){var bt=0;Mt.forEach(function(It){if(ft=="horizontal")vt.set(It,F.has(It)?P[F.get(It)]:ut.get(It)),bt+=vt.get(It);else vt.set(It,F.has(It)?H[F.get(It)]:ut.get(It)),bt+=vt.get(It)}),bt=bt/Mt.length,Dt.forEach(function(It){if(!gt.has(It))vt.set(It,bt)})}else{var Ct=0;Dt.forEach(function(It){if(ft=="horizontal")Ct+=F.has(It)?P[F.get(It)]:ut.get(It);else Ct+=F.has(It)?H[F.get(It)]:ut.get(It)}),Ct=Ct/Dt.length,Dt.forEach(function(It){vt.set(It,Ct)})}});var wt=function(){var Mt=St.shift(),bt=lt.get(Mt);bt.forEach(function(Ct){if(vt.get(Ct.id)<vt.get(Mt)+Ct.gap)if(gt&&gt.has(Ct.id)){var It=void 0;if(ft=="horizontal")It=F.has(Ct.id)?P[F.get(Ct.id)]:ut.get(Ct.id);else It=F.has(Ct.id)?H[F.get(Ct.id)]:ut.get(Ct.id);if(vt.set(Ct.id,It),It<vt.get(Mt)+Ct.gap){var te=vt.get(Mt)+Ct.gap-It;xt.get(Mt).forEach(function(Jt){vt.set(Jt,vt.get(Jt)-te)})}}else vt.set(Ct.id,vt.get(Mt)+Ct.gap);if(Rt.set(Ct.id,Rt.get(Ct.id)-1),Rt.get(Ct.id)==0)St.push(Ct.id);if(gt)xt.set(Ct.id,Ft(xt.get(Mt),xt.get(Ct.id)))})};while(St.length!=0)wt();if(gt){var Pt=new Set;lt.forEach(function(Dt,Mt){if(Dt.length==0)Pt.add(Mt)});var $t=[];xt.forEach(function(Dt,Mt){if(Pt.has(Mt)){var bt=!1,Ct=!0,It=!1,te=void 0;try{for(var Jt=Dt[Symbol.iterator](),fe;!(Ct=(fe=Jt.next()).done);Ct=!0){var Qt=fe.value;if(gt.has(Qt))bt=!0}}catch(jt){It=!0,te=jt}finally{try{if(!Ct&&Jt.return)Jt.return()}finally{if(It)throw te}}if(!bt){var Wt=!1,ue=void 0;if($t.forEach(function(jt,oe){if(jt.has([].concat(L(Dt))[0]))Wt=!0,ue=oe}),!Wt)$t.push(new Set(Dt));else Dt.forEach(function(jt){$t[ue].add(jt)})}}}),$t.forEach(function(Dt,Mt){var{POSITIVE_INFINITY:bt,POSITIVE_INFINITY:Ct,NEGATIVE_INFINITY:It,NEGATIVE_INFINITY:te}=Number,Jt=!0,fe=!1,Qt=void 0;try{for(var Wt=Dt[Symbol.iterator](),ue;!(Jt=(ue=Wt.next()).done);Jt=!0){var jt=ue.value,oe=void 0;if(ft=="horizontal")oe=F.has(jt)?P[F.get(jt)]:ut.get(jt);else oe=F.has(jt)?H[F.get(jt)]:ut.get(jt);var ce=vt.get(jt);if(oe<bt)bt=oe;if(oe>It)It=oe;if(ce<Ct)Ct=ce;if(ce>te)te=ce}}catch(Ne){fe=!0,Qt=Ne}finally{try{if(!Jt&&Wt.return)Wt.return()}finally{if(fe)throw Qt}}var Fe=(bt+It)/2-(Ct+te)/2,pe=!0,me=!1,Ee=void 0;try{for(var ye=Dt[Symbol.iterator](),xe;!(pe=(xe=ye.next()).done);pe=!0){var Te=xe.value;vt.set(Te,vt.get(Te)+Fe)}}catch(Ne){me=!0,Ee=Ne}finally{try{if(!pe&&ye.return)ye.return()}finally{if(me)throw Ee}}})}return vt},st=function(lt){var ft=0,gt=0,ut=0,Et=0;if(lt.forEach(function(xt){if(xt.left)P[F.get(xt.left)]-P[F.get(xt.right)]>=0?ft++:gt++;else H[F.get(xt.top)]-H[F.get(xt.bottom)]>=0?ut++:Et++}),ft>gt&&ut>Et)for(var Ft=0;Ft<F.size;Ft++)P[Ft]=-1*P[Ft],H[Ft]=-1*H[Ft];else if(ft>gt)for(var Rt=0;Rt<F.size;Rt++)P[Rt]=-1*P[Rt];else if(ut>Et)for(var vt=0;vt<F.size;vt++)H[vt]=-1*H[vt]},c=function(lt){var ft=[],gt=new O,ut=new Set,Et=0;return lt.forEach(function(Ft,Rt){if(!ut.has(Rt)){ft[Et]=[];var vt=Rt;gt.push(vt),ut.add(vt),ft[Et].push(vt);while(gt.length!=0){vt=gt.shift();var xt=lt.get(vt);xt.forEach(function(St){if(!ut.has(St.id))gt.push(St.id),ut.add(St.id),ft[Et].push(St.id)})}Et++}}),ft},G=function(lt){var ft=new Map;return lt.forEach(function(gt,ut){ft.set(ut,[])}),lt.forEach(function(gt,ut){gt.forEach(function(Et){ft.get(ut).push(Et),ft.get(Et.id).push({id:ut,gap:Et.gap,direction:Et.direction})})}),ft},S=function(lt){var ft=new Map;return lt.forEach(function(gt,ut){ft.set(ut,[])}),lt.forEach(function(gt,ut){gt.forEach(function(Et){ft.get(Et.id).push({id:ut,gap:Et.gap,direction:Et.direction})})}),ft},Y=[],I=[],Q=!1,k=!1,rt=new Set,tt=new Map,j=new Map,dt=[];if(T.fixedNodeConstraint)T.fixedNodeConstraint.forEach(function(nt){rt.add(nt.nodeId)});if(T.relativePlacementConstraint)T.relativePlacementConstraint.forEach(function(nt){if(nt.left){if(tt.has(nt.left))tt.get(nt.left).push({id:nt.right,gap:nt.gap,direction:"horizontal"});else tt.set(nt.left,[{id:nt.right,gap:nt.gap,direction:"horizontal"}]);if(!tt.has(nt.right))tt.set(nt.right,[])}else{if(tt.has(nt.top))tt.get(nt.top).push({id:nt.bottom,gap:nt.gap,direction:"vertical"});else tt.set(nt.top,[{id:nt.bottom,gap:nt.gap,direction:"vertical"}]);if(!tt.has(nt.bottom))tt.set(nt.bottom,[])}}),j=G(tt),dt=c(j);if(a.TRANSFORM_ON_CONSTRAINT_HANDLING){if(T.fixedNodeConstraint&&T.fixedNodeConstraint.length>1)T.fixedNodeConstraint.forEach(function(nt,lt){Y[lt]=[nt.position.x,nt.position.y],I[lt]=[P[F.get(nt.nodeId)],H[F.get(nt.nodeId)]]}),Q=!0;else if(T.alignmentConstraint)(function(){var nt=0;if(T.alignmentConstraint.vertical){var lt=T.alignmentConstraint.vertical,ft=function(vt){var xt=new Set;lt[vt].forEach(function(Pt){xt.add(Pt)});var St=new Set([].concat(L(xt)).filter(function(Pt){return rt.has(Pt)})),wt=void 0;if(St.size>0)wt=P[F.get(St.values().next().value)];else wt=pt(xt).x;lt[vt].forEach(function(Pt){Y[nt]=[wt,H[F.get(Pt)]],I[nt]=[P[F.get(Pt)],H[F.get(Pt)]],nt++})};for(var gt=0;gt<lt.length;gt++)ft(gt);Q=!0}if(T.alignmentConstraint.horizontal){var ut=T.alignmentConstraint.horizontal,Et=function(vt){var xt=new Set;ut[vt].forEach(function(Pt){xt.add(Pt)});var St=new Set([].concat(L(xt)).filter(function(Pt){return rt.has(Pt)})),wt=void 0;if(St.size>0)wt=P[F.get(St.values().next().value)];else wt=pt(xt).y;ut[vt].forEach(function(Pt){Y[nt]=[P[F.get(Pt)],wt],I[nt]=[P[F.get(Pt)],H[F.get(Pt)]],nt++})};for(var Ft=0;Ft<ut.length;Ft++)Et(Ft);Q=!0}if(T.relativePlacementConstraint)k=!0})();else if(T.relativePlacementConstraint){var Nt=0,et=0;for(var Tt=0;Tt<dt.length;Tt++)if(dt[Tt].length>Nt)Nt=dt[Tt].length,et=Tt;if(Nt<j.size/2)st(T.relativePlacementConstraint),Q=!1,k=!1;else{var ct=new Map,B=new Map,at=[];dt[et].forEach(function(nt){tt.get(nt).forEach(function(lt){if(lt.direction=="horizontal"){if(ct.has(nt))ct.get(nt).push(lt);else ct.set(nt,[lt]);if(!ct.has(lt.id))ct.set(lt.id,[]);at.push({left:nt,right:lt.id})}else{if(B.has(nt))B.get(nt).push(lt);else B.set(nt,[lt]);if(!B.has(lt.id))B.set(lt.id,[]);at.push({top:nt,bottom:lt.id})}})}),st(at),k=!1;var ht=q(ct,"horizontal"),mt=q(B,"vertical");dt[et].forEach(function(nt,lt){if(I[lt]=[P[F.get(nt)],H[F.get(nt)]],Y[lt]=[],ht.has(nt))Y[lt][0]=ht.get(nt);else Y[lt][0]=P[F.get(nt)];if(mt.has(nt))Y[lt][1]=mt.get(nt);else Y[lt][1]=H[F.get(nt)]}),Q=!0}}if(Q){var Ot=void 0,Vt=o.transpose(Y),_t=o.transpose(I);for(var yt=0;yt<Vt.length;yt++)Vt[yt]=o.multGamma(Vt[yt]),_t[yt]=o.multGamma(_t[yt]);var ne=o.multMat(Vt,o.transpose(_t)),kt=i.svd(ne);Ot=o.multMat(kt.V,o.transpose(kt.U));for(var At=0;At<F.size;At++){var Lt=[P[At],H[At]],Gt=[Ot[0][0],Ot[1][0]],Yt=[Ot[0][1],Ot[1][1]];P[At]=o.dotProduct(Lt,Gt),H[At]=o.dotProduct(Lt,Yt)}if(k)st(T.relativePlacementConstraint)}}if(a.ENFORCE_CONSTRAINTS){if(T.fixedNodeConstraint&&T.fixedNodeConstraint.length>0){var zt={x:0,y:0};T.fixedNodeConstraint.forEach(function(nt,lt){var ft={x:P[F.get(nt.nodeId)],y:H[F.get(nt.nodeId)]},gt=nt.position,ut=it(gt,ft);zt.x+=ut.x,zt.y+=ut.y}),zt.x/=T.fixedNodeConstraint.length,zt.y/=T.fixedNodeConstraint.length,P.forEach(function(nt,lt){P[lt]+=zt.x}),H.forEach(function(nt,lt){H[lt]+=zt.y}),T.fixedNodeConstraint.forEach(function(nt){P[F.get(nt.nodeId)]=nt.position.x,H[F.get(nt.nodeId)]=nt.position.y})}if(T.alignmentConstraint){if(T.alignmentConstraint.vertical){var Xt=T.alignmentConstraint.vertical,Ht=function(lt){var ft=new Set;Xt[lt].forEach(function(Et){ft.add(Et)});var gt=new Set([].concat(L(ft)).filter(function(Et){return rt.has(Et)})),ut=void 0;if(gt.size>0)ut=P[F.get(gt.values().next().value)];else ut=pt(ft).x;ft.forEach(function(Et){if(!rt.has(Et))P[F.get(Et)]=ut})};for(var qt=0;qt<Xt.length;qt++)Ht(qt)}if(T.alignmentConstraint.horizontal){var Kt=T.alignmentConstraint.horizontal,le=function(lt){var ft=new Set;Kt[lt].forEach(function(Et){ft.add(Et)});var gt=new Set([].concat(L(ft)).filter(function(Et){return rt.has(Et)})),ut=void 0;if(gt.size>0)ut=H[F.get(gt.values().next().value)];else ut=pt(ft).y;ft.forEach(function(Et){if(!rt.has(Et))H[F.get(Et)]=ut})};for(var re=0;re<Kt.length;re++)le(re)}}if(T.relativePlacementConstraint)(function(){var nt=new Map,lt=new Map,ft=new Map,gt=new Map,ut=new Map,Et=new Map,Ft=new Set,Rt=new Set;if(rt.forEach(function(ie){Ft.add(ie),Rt.add(ie)}),T.alignmentConstraint){if(T.alignmentConstraint.vertical){var vt=T.alignmentConstraint.vertical,xt=function(Ut){ft.set("dummy"+Ut,[]),vt[Ut].forEach(function(Zt){if(nt.set(Zt,"dummy"+Ut),ft.get("dummy"+Ut).push(Zt),rt.has(Zt))Ft.add("dummy"+Ut)}),ut.set("dummy"+Ut,P[F.get(vt[Ut][0])])};for(var St=0;St<vt.length;St++)xt(St)}if(T.alignmentConstraint.horizontal){var wt=T.alignmentConstraint.horizontal,Pt=function(Ut){gt.set("dummy"+Ut,[]),wt[Ut].forEach(function(Zt){if(lt.set(Zt,"dummy"+Ut),gt.get("dummy"+Ut).push(Zt),rt.has(Zt))Rt.add("dummy"+Ut)}),Et.set("dummy"+Ut,H[F.get(wt[Ut][0])])};for(var $t=0;$t<wt.length;$t++)Pt($t)}}var Dt=new Map,Mt=new Map,bt=function(Ut){tt.get(Ut).forEach(function(Zt){var de=void 0,ge=void 0;if(Zt.direction=="horizontal"){if(de=nt.get(Ut)?nt.get(Ut):Ut,nt.get(Zt.id))ge={id:nt.get(Zt.id),gap:Zt.gap,direction:Zt.direction};else ge=Zt;if(Dt.has(de))Dt.get(de).push(ge);else Dt.set(de,[ge]);if(!Dt.has(ge.id))Dt.set(ge.id,[])}else{if(de=lt.get(Ut)?lt.get(Ut):Ut,lt.get(Zt.id))ge={id:lt.get(Zt.id),gap:Zt.gap,direction:Zt.direction};else ge=Zt;if(Mt.has(de))Mt.get(de).push(ge);else Mt.set(de,[ge]);if(!Mt.has(ge.id))Mt.set(ge.id,[])}})},Ct=!0,It=!1,te=void 0;try{for(var Jt=tt.keys()[Symbol.iterator](),fe;!(Ct=(fe=Jt.next()).done);Ct=!0){var Qt=fe.value;bt(Qt)}}catch(ie){It=!0,te=ie}finally{try{if(!Ct&&Jt.return)Jt.return()}finally{if(It)throw te}}var Wt=G(Dt),ue=G(Mt),jt=c(Wt),oe=c(ue),ce=S(Dt),Fe=S(Mt),pe=[],me=[];jt.forEach(function(ie,Ut){pe[Ut]=[],ie.forEach(function(Zt){if(ce.get(Zt).length==0)pe[Ut].push(Zt)})}),oe.forEach(function(ie,Ut){me[Ut]=[],ie.forEach(function(Zt){if(Fe.get(Zt).length==0)me[Ut].push(Zt)})});var Ee=q(Dt,"horizontal",Ft,ut,pe),ye=q(Mt,"vertical",Rt,Et,me),xe=function(Ut){if(ft.get(Ut))ft.get(Ut).forEach(function(Zt){P[F.get(Zt)]=Ee.get(Ut)});else P[F.get(Ut)]=Ee.get(Ut)},Te=!0,Ne=!1,Ze=void 0;try{for(var be=Ee.keys()[Symbol.iterator](),qe;!(Te=(qe=be.next()).done);Te=!0){var Pe=qe.value;xe(Pe)}}catch(ie){Ne=!0,Ze=ie}finally{try{if(!Te&&be.return)be.return()}finally{if(Ne)throw Ze}}var vr=function(Ut){if(gt.get(Ut))gt.get(Ut).forEach(function(Zt){H[F.get(Zt)]=ye.get(Ut)});else H[F.get(Ut)]=ye.get(Ut)},Ge=!0,Qe=!1,Je=void 0;try{for(var Ue=ye.keys()[Symbol.iterator](),Ke;!(Ge=(Ke=Ue.next()).done);Ge=!0){var Pe=Ke.value;vr(Pe)}}catch(ie){Qe=!0,Je=ie}finally{try{if(!Ge&&Ue.return)Ue.return()}finally{if(Qe)throw Je}}})()}for(var ae=0;ae<J.length;ae++){var ee=J[ae];if(ee.getChild()==null)ee.setCenter(P[F.get(ee.id)],H[F.get(ee.id)])}},l.exports=N},551:(l)=>{l.exports=U}},X={};function C(l){var s=X[l];if(s!==void 0)return s.exports;var h=X[l]={exports:{}};return z[l](h,h.exports,C),h.exports}var y=C(45);return y})()})});var je=se(function(De,Ve){(function(z,X){if(typeof De==="object"&&typeof Ve==="object")Ve.exports=X(We());else if(typeof define==="function"&&define.amd)define(["cose-base"],X);else if(typeof De==="object")De.cytoscapeFcose=X(We());else z.cytoscapeFcose=X(z.coseBase)})(De,function(U){return(()=>{var z={658:(l)=>{l.exports=Object.assign!=null?Object.assign.bind(Object):function(s){for(var h=arguments.length,L=Array(h>1?h-1:0),a=1;a<h;a++)L[a-1]=arguments[a];return L.forEach(function(O){Object.keys(O).forEach(function(o){return s[o]=O[o]})}),s}},548:(l,s,h)=>{var L=function(){function o(i,N){var M=[],T=!0,W=!1,F=void 0;try{for(var P=i[Symbol.iterator](),H;!(T=(H=P.next()).done);T=!0)if(M.push(H.value),N&&M.length===N)break}catch(J){W=!0,F=J}finally{try{if(!T&&P.return)P.return()}finally{if(W)throw F}}return M}return function(i,N){if(Array.isArray(i))return i;else if(Symbol.iterator in Object(i))return o(i,N);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=h(140).layoutBase.LinkedList,O={};O.getTopMostNodes=function(o){var i={};for(var N=0;N<o.length;N++)i[o[N].id()]=!0;var M=o.filter(function(T,W){if(typeof T==="number")T=W;var F=T.parent()[0];while(F!=null){if(i[F.id()])return!1;F=F.parent()[0]}return!0});return M},O.connectComponents=function(o,i,N,M){var T=new a,W=new Set,F=[],P=void 0,H=void 0,J=void 0,V=!1,_=1,ot=[],it=[],pt=function(){var st=o.collection();it.push(st);var c=N[0],G=o.collection();G.merge(c).merge(c.descendants().intersection(i)),F.push(c),G.forEach(function(I){T.push(I),W.add(I),st.merge(I)});var S=function(){c=T.shift();var Q=o.collection();c.neighborhood().nodes().forEach(function(j){if(i.intersection(c.edgesWith(j)).length>0)Q.merge(j)});for(var k=0;k<Q.length;k++){var rt=Q[k];if(P=N.intersection(rt.union(rt.ancestors())),P!=null&&!W.has(P[0])){var tt=P.union(P.descendants());tt.forEach(function(j){if(T.push(j),W.add(j),st.merge(j),N.has(j))F.push(j)})}}};while(T.length!=0)S();if(st.forEach(function(I){i.intersection(I.connectedEdges()).forEach(function(Q){if(st.has(Q.source())&&st.has(Q.target()))st.merge(Q)})}),F.length==N.length)V=!0;if(!V||V&&_>1){H=F[0],J=H.connectedEdges().length,F.forEach(function(I){if(I.connectedEdges().length<J)J=I.connectedEdges().length,H=I}),ot.push(H.id());var Y=o.collection();Y.merge(F[0]),F.forEach(function(I){Y.merge(I)}),F=[],N=N.difference(Y),_++}};do pt();while(!V);if(M){if(ot.length>0)M.set("dummy"+(M.size+1),ot)}return it},O.relocateComponent=function(o,i,N){if(!N.fixedNodeConstraint){var{POSITIVE_INFINITY:M,NEGATIVE_INFINITY:T,POSITIVE_INFINITY:W,NEGATIVE_INFINITY:F}=Number;if(N.quality=="draft"){var P=!0,H=!1,J=void 0;try{for(var V=i.nodeIndexes[Symbol.iterator](),_;!(P=(_=V.next()).done);P=!0){var ot=_.value,it=L(ot,2),pt=it[0],q=it[1],st=N.cy.getElementById(pt);if(st){var c=st.boundingBox(),G=i.xCoords[q]-c.w/2,S=i.xCoords[q]+c.w/2,Y=i.yCoords[q]-c.h/2,I=i.yCoords[q]+c.h/2;if(G<M)M=G;if(S>T)T=S;if(Y<W)W=Y;if(I>F)F=I}}}catch(j){H=!0,J=j}finally{try{if(!P&&V.return)V.return()}finally{if(H)throw J}}var Q=o.x-(T+M)/2,k=o.y-(F+W)/2;i.xCoords=i.xCoords.map(function(j){return j+Q}),i.yCoords=i.yCoords.map(function(j){return j+k})}else{Object.keys(i).forEach(function(j){var dt=i[j],Nt=dt.getRect().x,et=dt.getRect().x+dt.getRect().width,Tt=dt.getRect().y,ct=dt.getRect().y+dt.getRect().height;if(Nt<M)M=Nt;if(et>T)T=et;if(Tt<W)W=Tt;if(ct>F)F=ct});var rt=o.x-(T+M)/2,tt=o.y-(F+W)/2;Object.keys(i).forEach(function(j){var dt=i[j];dt.setCenter(dt.getCenterX()+rt,dt.getCenterY()+tt)})}}},O.calcBoundingBox=function(o,i,N,M){var{MAX_SAFE_INTEGER:T,MIN_SAFE_INTEGER:W,MAX_SAFE_INTEGER:F,MIN_SAFE_INTEGER:P}=Number,H=void 0,J=void 0,V=void 0,_=void 0,ot=o.descendants().not(":parent"),it=ot.length;for(var pt=0;pt<it;pt++){var q=ot[pt];if(H=i[M.get(q.id())]-q.width()/2,J=i[M.get(q.id())]+q.width()/2,V=N[M.get(q.id())]-q.height()/2,_=N[M.get(q.id())]+q.height()/2,T>H)T=H;if(W<J)W=J;if(F>V)F=V;if(P<_)P=_}var st={};return st.topLeftX=T,st.topLeftY=F,st.width=W-T,st.height=P-F,st},O.calcParentsWithoutChildren=function(o,i){var N=o.collection();return i.nodes(":parent").forEach(function(M){var T=!1;if(M.children().forEach(function(W){if(W.css("display")!="none")T=!0}),!T)N.merge(M)}),N},l.exports=O},816:(l,s,h)=>{var L=h(548),a=h(140).CoSELayout,O=h(140).CoSENode,o=h(140).layoutBase.PointD,i=h(140).layoutBase.DimensionD,N=h(140).layoutBase.LayoutConstants,M=h(140).layoutBase.FDLayoutConstants,T=h(140).CoSEConstants,W=function(P,H){var{cy:J,eles:V}=P,_=V.nodes(),ot=V.edges(),it=void 0,pt=void 0,q=void 0,st={};if(P.randomize)it=H.nodeIndexes,pt=H.xCoords,q=H.yCoords;var c=function(j){return typeof j==="function"},G=function(j,dt){if(c(j))return j(dt);else return j},S=L.calcParentsWithoutChildren(J,V),Y=function tt(j,dt,Nt,et){var Tt=dt.length;for(var ct=0;ct<Tt;ct++){var B=dt[ct],at=null;if(B.intersection(S).length==0)at=B.children();var ht=void 0,mt=B.layoutDimensions({nodeDimensionsIncludeLabels:et.nodeDimensionsIncludeLabels});if(B.outerWidth()!=null&&B.outerHeight()!=null)if(et.randomize)if(!B.isParent())ht=j.add(new O(Nt.graphManager,new o(pt[it.get(B.id())]-mt.w/2,q[it.get(B.id())]-mt.h/2),new i(parseFloat(mt.w),parseFloat(mt.h))));else{var Ot=L.calcBoundingBox(B,pt,q,it);if(B.intersection(S).length==0)ht=j.add(new O(Nt.graphManager,new o(Ot.topLeftX,Ot.topLeftY),new i(Ot.width,Ot.height)));else ht=j.add(new O(Nt.graphManager,new o(Ot.topLeftX,Ot.topLeftY),new i(parseFloat(mt.w),parseFloat(mt.h))))}else ht=j.add(new O(Nt.graphManager,new o(B.position("x")-mt.w/2,B.position("y")-mt.h/2),new i(parseFloat(mt.w),parseFloat(mt.h))));else ht=j.add(new O(this.graphManager));if(ht.id=B.data("id"),ht.nodeRepulsion=G(et.nodeRepulsion,B),ht.paddingLeft=parseInt(B.css("padding")),ht.paddingTop=parseInt(B.css("padding")),ht.paddingRight=parseInt(B.css("padding")),ht.paddingBottom=parseInt(B.css("padding")),et.nodeDimensionsIncludeLabels)ht.labelWidth=B.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,ht.labelHeight=B.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,ht.labelPosVertical=B.css("text-valign"),ht.labelPosHorizontal=B.css("text-halign");if(st[B.data("id")]=ht,isNaN(ht.rect.x))ht.rect.x=0;if(isNaN(ht.rect.y))ht.rect.y=0;if(at!=null&&at.length>0){var Vt=void 0;Vt=Nt.getGraphManager().add(Nt.newGraph(),ht),tt(Vt,at,Nt,et)}}},I=function(j,dt,Nt){var et=0,Tt=0;for(var ct=0;ct<Nt.length;ct++){var B=Nt[ct],at=st[B.data("source")],ht=st[B.data("target")];if(at&&ht&&at!==ht&&at.getEdgesBetween(ht).length==0){var mt=dt.add(j.newEdge(),at,ht);mt.id=B.id(),mt.idealLength=G(P.idealEdgeLength,B),mt.edgeElasticity=G(P.edgeElasticity,B),et+=mt.idealLength,Tt++}}if(P.idealEdgeLength!=null){if(Tt>0)T.DEFAULT_EDGE_LENGTH=M.DEFAULT_EDGE_LENGTH=et/Tt;else if(!c(P.idealEdgeLength))T.DEFAULT_EDGE_LENGTH=M.DEFAULT_EDGE_LENGTH=P.idealEdgeLength;else T.DEFAULT_EDGE_LENGTH=M.DEFAULT_EDGE_LENGTH=50;T.MIN_REPULSION_DIST=M.MIN_REPULSION_DIST=M.DEFAULT_EDGE_LENGTH/10,T.DEFAULT_RADIAL_SEPARATION=M.DEFAULT_EDGE_LENGTH}},Q=function(j,dt){if(dt.fixedNodeConstraint)j.constraints.fixedNodeConstraint=dt.fixedNodeConstraint;if(dt.alignmentConstraint)j.constraints.alignmentConstraint=dt.alignmentConstraint;if(dt.relativePlacementConstraint)j.constraints.relativePlacementConstraint=dt.relativePlacementConstraint};if(P.nestingFactor!=null)T.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=M.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=P.nestingFactor;if(P.gravity!=null)T.DEFAULT_GRAVITY_STRENGTH=M.DEFAULT_GRAVITY_STRENGTH=P.gravity;if(P.numIter!=null)T.MAX_ITERATIONS=M.MAX_ITERATIONS=P.numIter;if(P.gravityRange!=null)T.DEFAULT_GRAVITY_RANGE_FACTOR=M.DEFAULT_GRAVITY_RANGE_FACTOR=P.gravityRange;if(P.gravityCompound!=null)T.DEFAULT_COMPOUND_GRAVITY_STRENGTH=M.DEFAULT_COMPOUND_GRAVITY_STRENGTH=P.gravityCompound;if(P.gravityRangeCompound!=null)T.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=M.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=P.gravityRangeCompound;if(P.initialEnergyOnIncremental!=null)T.DEFAULT_COOLING_FACTOR_INCREMENTAL=M.DEFAULT_COOLING_FACTOR_INCREMENTAL=P.initialEnergyOnIncremental;if(P.tilingCompareBy!=null)T.TILING_COMPARE_BY=P.tilingCompareBy;if(P.quality=="proof")N.QUALITY=2;else N.QUALITY=0;if(T.NODE_DIMENSIONS_INCLUDE_LABELS=M.NODE_DIMENSIONS_INCLUDE_LABELS=N.NODE_DIMENSIONS_INCLUDE_LABELS=P.nodeDimensionsIncludeLabels,T.DEFAULT_INCREMENTAL=M.DEFAULT_INCREMENTAL=N.DEFAULT_INCREMENTAL=!P.randomize,T.ANIMATE=M.ANIMATE=N.ANIMATE=P.animate,T.TILE=P.tile,T.TILING_PADDING_VERTICAL=typeof P.tilingPaddingVertical==="function"?P.tilingPaddingVertical.call():P.tilingPaddingVertical,T.TILING_PADDING_HORIZONTAL=typeof P.tilingPaddingHorizontal==="function"?P.tilingPaddingHorizontal.call():P.tilingPaddingHorizontal,T.DEFAULT_INCREMENTAL=M.DEFAULT_INCREMENTAL=N.DEFAULT_INCREMENTAL=!0,T.PURE_INCREMENTAL=!P.randomize,N.DEFAULT_UNIFORM_LEAF_NODE_SIZES=P.uniformNodeDimensions,P.step=="transformed")T.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,T.ENFORCE_CONSTRAINTS=!1,T.APPLY_LAYOUT=!1;if(P.step=="enforced")T.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,T.ENFORCE_CONSTRAINTS=!0,T.APPLY_LAYOUT=!1;if(P.step=="cose")T.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,T.ENFORCE_CONSTRAINTS=!1,T.APPLY_LAYOUT=!0;if(P.step=="all"){if(P.randomize)T.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else T.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;T.ENFORCE_CONSTRAINTS=!0,T.APPLY_LAYOUT=!0}if(P.fixedNodeConstraint||P.alignmentConstraint||P.relativePlacementConstraint)T.TREE_REDUCTION_ON_INCREMENTAL=!1;else T.TREE_REDUCTION_ON_INCREMENTAL=!0;var k=new a,rt=k.newGraphManager();return Y(rt.addRoot(),L.getTopMostNodes(_),k,P),I(k,rt,ot),Q(k,P),k.runLayout(),st};l.exports={coseLayout:W}},212:(l,s,h)=>{var L=function(){function P(H,J){for(var V=0;V<J.length;V++){var _=J[V];if(_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _)_.writable=!0;Object.defineProperty(H,_.key,_)}}return function(H,J,V){if(J)P(H.prototype,J);if(V)P(H,V);return H}}();function a(P,H){if(!(P instanceof H))throw TypeError("Cannot call a class as a function")}var O=h(658),o=h(548),i=h(657),N=i.spectralLayout,M=h(816),T=M.coseLayout,W=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function(H){return 4500},idealEdgeLength:function(H){return 50},edgeElasticity:function(H){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),F=function(){function P(H){a(this,P),this.options=O({},W,H)}return L(P,[{key:"run",value:function(){var J=this,V=this.options,{cy:_,eles:ot}=V,it=[],pt=void 0,q=void 0,st=[],c=void 0,G=[];if(V.fixedNodeConstraint&&(!Array.isArray(V.fixedNodeConstraint)||V.fixedNodeConstraint.length==0))V.fixedNodeConstraint=void 0;if(V.alignmentConstraint){if(V.alignmentConstraint.vertical&&(!Array.isArray(V.alignmentConstraint.vertical)||V.alignmentConstraint.vertical.length==0))V.alignmentConstraint.vertical=void 0;if(V.alignmentConstraint.horizontal&&(!Array.isArray(V.alignmentConstraint.horizontal)||V.alignmentConstraint.horizontal.length==0))V.alignmentConstraint.horizontal=void 0}if(V.relativePlacementConstraint&&(!Array.isArray(V.relativePlacementConstraint)||V.relativePlacementConstraint.length==0))V.relativePlacementConstraint=void 0;var S=V.fixedNodeConstraint||V.alignmentConstraint||V.relativePlacementConstraint;if(S)V.tile=!1,V.packComponents=!1;var Y=void 0,I=!1;if(_.layoutUtilities&&V.packComponents){if(Y=_.layoutUtilities("get"),!Y)Y=_.layoutUtilities();I=!0}if(ot.nodes().length>0)if(!I){var Q=V.eles.boundingBox();if(G.push({x:Q.x1+Q.w/2,y:Q.y1+Q.h/2}),V.randomize){var k=N(V);it.push(k)}if(V.quality=="default"||V.quality=="proof")st.push(T(V,it[0])),o.relocateComponent(G[0],st[0],V);else o.relocateComponent(G[0],it[0],V)}else{var rt=o.getTopMostNodes(V.eles.nodes());if(c=o.connectComponents(_,V.eles,rt),c.forEach(function(At){var Lt=At.boundingBox();G.push({x:Lt.x1+Lt.w/2,y:Lt.y1+Lt.h/2})}),V.randomize)c.forEach(function(At){V.eles=At,it.push(N(V))});if(V.quality=="default"||V.quality=="proof"){var tt=_.collection();if(V.tile){var j=new Map,dt=[],Nt=[],et=0,Tt={nodeIndexes:j,xCoords:dt,yCoords:Nt},ct=[];if(c.forEach(function(At,Lt){if(At.edges().length==0)At.nodes().forEach(function(Gt,Yt){if(tt.merge(At.nodes()[Yt]),!Gt.isParent())Tt.nodeIndexes.set(At.nodes()[Yt].id(),et++),Tt.xCoords.push(At.nodes()[0].position().x),Tt.yCoords.push(At.nodes()[0].position().y)}),ct.push(Lt)}),tt.length>1){var B=tt.boundingBox();G.push({x:B.x1+B.w/2,y:B.y1+B.h/2}),c.push(tt),it.push(Tt);for(var at=ct.length-1;at>=0;at--)c.splice(ct[at],1),it.splice(ct[at],1),G.splice(ct[at],1)}}c.forEach(function(At,Lt){V.eles=At,st.push(T(V,it[Lt])),o.relocateComponent(G[Lt],st[Lt],V)})}else c.forEach(function(At,Lt){o.relocateComponent(G[Lt],it[Lt],V)});var ht=new Set;if(c.length>1){var mt=[],Ot=ot.filter(function(At){return At.css("display")=="none"});c.forEach(function(At,Lt){var Gt=void 0;if(V.quality=="draft")Gt=it[Lt].nodeIndexes;if(At.nodes().not(Ot).length>0){var Yt={};Yt.edges=[],Yt.nodes=[];var zt=void 0;if(At.nodes().not(Ot).forEach(function(Xt){if(V.quality=="draft")if(!Xt.isParent())zt=Gt.get(Xt.id()),Yt.nodes.push({x:it[Lt].xCoords[zt]-Xt.boundingbox().w/2,y:it[Lt].yCoords[zt]-Xt.boundingbox().h/2,width:Xt.boundingbox().w,height:Xt.boundingbox().h});else{var Ht=o.calcBoundingBox(Xt,it[Lt].xCoords,it[Lt].yCoords,Gt);Yt.nodes.push({x:Ht.topLeftX,y:Ht.topLeftY,width:Ht.width,height:Ht.height})}else if(st[Lt][Xt.id()])Yt.nodes.push({x:st[Lt][Xt.id()].getLeft(),y:st[Lt][Xt.id()].getTop(),width:st[Lt][Xt.id()].getWidth(),height:st[Lt][Xt.id()].getHeight()})}),At.edges().forEach(function(Xt){var Ht=Xt.source(),qt=Xt.target();if(Ht.css("display")!="none"&&qt.css("display")!="none"){if(V.quality=="draft"){var Kt=Gt.get(Ht.id()),le=Gt.get(qt.id()),re=[],ae=[];if(Ht.isParent()){var ee=o.calcBoundingBox(Ht,it[Lt].xCoords,it[Lt].yCoords,Gt);re.push(ee.topLeftX+ee.width/2),re.push(ee.topLeftY+ee.height/2)}else re.push(it[Lt].xCoords[Kt]),re.push(it[Lt].yCoords[Kt]);if(qt.isParent()){var nt=o.calcBoundingBox(qt,it[Lt].xCoords,it[Lt].yCoords,Gt);ae.push(nt.topLeftX+nt.width/2),ae.push(nt.topLeftY+nt.height/2)}else ae.push(it[Lt].xCoords[le]),ae.push(it[Lt].yCoords[le]);Yt.edges.push({startX:re[0],startY:re[1],endX:ae[0],endY:ae[1]})}else if(st[Lt][Ht.id()]&&st[Lt][qt.id()])Yt.edges.push({startX:st[Lt][Ht.id()].getCenterX(),startY:st[Lt][Ht.id()].getCenterY(),endX:st[Lt][qt.id()].getCenterX(),endY:st[Lt][qt.id()].getCenterY()})}}),Yt.nodes.length>0)mt.push(Yt),ht.add(Lt)}});var Vt=Y.packComponents(mt,V.randomize).shifts;if(V.quality=="draft")it.forEach(function(At,Lt){var Gt=At.xCoords.map(function(zt){return zt+Vt[Lt].dx}),Yt=At.yCoords.map(function(zt){return zt+Vt[Lt].dy});At.xCoords=Gt,At.yCoords=Yt});else{var _t=0;ht.forEach(function(At){Object.keys(st[At]).forEach(function(Lt){var Gt=st[At][Lt];Gt.setCenter(Gt.getCenterX()+Vt[_t].dx,Gt.getCenterY()+Vt[_t].dy)}),_t++})}}}var yt=function(Lt,Gt){if(V.quality=="default"||V.quality=="proof"){if(typeof Lt==="number")Lt=Gt;var Yt=void 0,zt=void 0,Xt=Lt.data("id");if(st.forEach(function(qt){if(Xt in qt)Yt={x:qt[Xt].getRect().getCenterX(),y:qt[Xt].getRect().getCenterY()},zt=qt[Xt]}),V.nodeDimensionsIncludeLabels){if(zt.labelWidth){if(zt.labelPosHorizontal=="left")Yt.x+=zt.labelWidth/2;else if(zt.labelPosHorizontal=="right")Yt.x-=zt.labelWidth/2}if(zt.labelHeight){if(zt.labelPosVertical=="top")Yt.y+=zt.labelHeight/2;else if(zt.labelPosVertical=="bottom")Yt.y-=zt.labelHeight/2}}if(Yt==null)Yt={x:Lt.position("x"),y:Lt.position("y")};return{x:Yt.x,y:Yt.y}}else{var Ht=void 0;if(it.forEach(function(qt){var Kt=qt.nodeIndexes.get(Lt.id());if(Kt!=null)Ht={x:qt.xCoords[Kt],y:qt.yCoords[Kt]}}),Ht==null)Ht={x:Lt.position("x"),y:Lt.position("y")};return{x:Ht.x,y:Ht.y}}};if(V.quality=="default"||V.quality=="proof"||V.randomize){var ne=o.calcParentsWithoutChildren(_,ot),kt=ot.filter(function(At){return At.css("display")=="none"});if(V.eles=ot.not(kt),ot.nodes().not(":parent").not(kt).layoutPositions(J,V,yt),ne.length>0)ne.forEach(function(At){At.position(yt(At))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),P}();l.exports=F},657:(l,s,h)=>{var L=h(548),a=h(140).layoutBase.Matrix,O=h(140).layoutBase.SVD,o=function(N){var{cy:M,eles:T}=N,W=T.nodes(),F=T.nodes(":parent"),P=new Map,H=new Map,J=new Map,V=[],_=[],ot=[],it=[],pt=[],q=[],st=[],c=[],G=void 0,S=void 0,Y=1e8,I=0.000000001,{piTol:Q,samplingType:k,nodeSeparation:rt}=N,tt=void 0,j=function(){var ft=0,gt=0,ut=!1;while(gt<tt){ft=Math.floor(Math.random()*S),ut=!1;for(var Et=0;Et<gt;Et++)if(it[Et]==ft){ut=!0;break}if(!ut)it[gt]=ft,gt++;else continue}},dt=function(ft,gt,ut){var Et=[],Ft=0,Rt=0,vt=0,xt=void 0,St=[],wt=0,Pt=1;for(var $t=0;$t<S;$t++)St[$t]=Y;Et[Rt]=ft,St[ft]=0;while(Rt>=Ft){vt=Et[Ft++];var Dt=V[vt];for(var Mt=0;Mt<Dt.length;Mt++)if(xt=H.get(Dt[Mt]),St[xt]==Y)St[xt]=St[vt]+1,Et[++Rt]=xt;q[vt][gt]=St[vt]*rt}if(ut){for(var bt=0;bt<S;bt++)if(q[bt][gt]<pt[bt])pt[bt]=q[bt][gt];for(var Ct=0;Ct<S;Ct++)if(pt[Ct]>wt)wt=pt[Ct],Pt=Ct}return Pt},Nt=function(ft){var gt=void 0;if(!ft){j();for(var ut=0;ut<tt;ut++)dt(it[ut],ut,ft,!1)}else{gt=Math.floor(Math.random()*S),G=gt;for(var Et=0;Et<S;Et++)pt[Et]=Y;for(var Ft=0;Ft<tt;Ft++)it[Ft]=gt,gt=dt(gt,Ft,ft)}for(var Rt=0;Rt<S;Rt++)for(var vt=0;vt<tt;vt++)q[Rt][vt]*=q[Rt][vt];for(var xt=0;xt<tt;xt++)st[xt]=[];for(var St=0;St<tt;St++)for(var wt=0;wt<tt;wt++)st[St][wt]=q[it[wt]][St]},et=function(){var ft=O.svd(st),{S:gt,U:ut,V:Et}=ft,Ft=gt[0]*gt[0]*gt[0],Rt=[];for(var vt=0;vt<tt;vt++){Rt[vt]=[];for(var xt=0;xt<tt;xt++)if(Rt[vt][xt]=0,vt==xt)Rt[vt][xt]=gt[vt]/(gt[vt]*gt[vt]+Ft/(gt[vt]*gt[vt]))}c=a.multMat(a.multMat(Et,Rt),a.transpose(ut))},Tt=function(){var ft=void 0,gt=void 0,ut=[],Et=[],Ft=[],Rt=[];for(var vt=0;vt<S;vt++)ut[vt]=Math.random(),Et[vt]=Math.random();ut=a.normalize(ut),Et=a.normalize(Et);var xt=0,St=I,wt=I,Pt=void 0;while(!0){xt++;for(var $t=0;$t<S;$t++)Ft[$t]=ut[$t];if(ut=a.multGamma(a.multL(a.multGamma(Ft),q,c)),ft=a.dotProduct(Ft,ut),ut=a.normalize(ut),St=a.dotProduct(Ft,ut),Pt=Math.abs(St/wt),Pt<=1+Q&&Pt>=1)break;wt=St}for(var Dt=0;Dt<S;Dt++)Ft[Dt]=ut[Dt];xt=0,wt=I;while(!0){xt++;for(var Mt=0;Mt<S;Mt++)Rt[Mt]=Et[Mt];if(Rt=a.minusOp(Rt,a.multCons(Ft,a.dotProduct(Ft,Rt))),Et=a.multGamma(a.multL(a.multGamma(Rt),q,c)),gt=a.dotProduct(Rt,Et),Et=a.normalize(Et),St=a.dotProduct(Rt,Et),Pt=Math.abs(St/wt),Pt<=1+Q&&Pt>=1)break;wt=St}for(var bt=0;bt<S;bt++)Rt[bt]=Et[bt];_=a.multCons(Ft,Math.sqrt(Math.abs(ft))),ot=a.multCons(Rt,Math.sqrt(Math.abs(gt)))};L.connectComponents(M,T,L.getTopMostNodes(W),P),F.forEach(function(lt){L.connectComponents(M,T,L.getTopMostNodes(lt.descendants().intersection(T)),P)});var ct=0;for(var B=0;B<W.length;B++)if(!W[B].isParent())H.set(W[B].id(),ct++);var at=!0,ht=!1,mt=void 0;try{for(var Ot=P.keys()[Symbol.iterator](),Vt;!(at=(Vt=Ot.next()).done);at=!0){var _t=Vt.value;H.set(_t,ct++)}}catch(lt){ht=!0,mt=lt}finally{try{if(!at&&Ot.return)Ot.return()}finally{if(ht)throw mt}}for(var yt=0;yt<H.size;yt++)V[yt]=[];F.forEach(function(lt){var ft=lt.children().intersection(T);while(ft.nodes(":childless").length==0)ft=ft.nodes()[0].children().intersection(T);var gt=0,ut=ft.nodes(":childless")[0].connectedEdges().length;ft.nodes(":childless").forEach(function(Et,Ft){if(Et.connectedEdges().length<ut)ut=Et.connectedEdges().length,gt=Ft}),J.set(lt.id(),ft.nodes(":childless")[gt].id())}),W.forEach(function(lt){var ft=void 0;if(lt.isParent())ft=H.get(J.get(lt.id()));else ft=H.get(lt.id());lt.neighborhood().nodes().forEach(function(gt){if(T.intersection(lt.edgesWith(gt)).length>0)if(gt.isParent())V[ft].push(J.get(gt.id()));else V[ft].push(gt.id())})});var ne=function(ft){var gt=H.get(ft),ut=void 0;P.get(ft).forEach(function(Et){if(M.getElementById(Et).isParent())ut=J.get(Et);else ut=Et;V[gt].push(ut),V[H.get(ut)].push(ft)})},kt=!0,At=!1,Lt=void 0;try{for(var Gt=P.keys()[Symbol.iterator](),Yt;!(kt=(Yt=Gt.next()).done);kt=!0){var zt=Yt.value;ne(zt)}}catch(lt){At=!0,Lt=lt}finally{try{if(!kt&&Gt.return)Gt.return()}finally{if(At)throw Lt}}S=H.size;var Xt=void 0;if(S>2){tt=S<N.sampleSize?S:N.sampleSize;for(var Ht=0;Ht<S;Ht++)q[Ht]=[];for(var qt=0;qt<tt;qt++)c[qt]=[];if(N.quality=="draft"||N.step=="all")Nt(k),et(),Tt(),Xt={nodeIndexes:H,xCoords:_,yCoords:ot};else H.forEach(function(lt,ft){_.push(M.getElementById(ft).position("x")),ot.push(M.getElementById(ft).position("y"))}),Xt={nodeIndexes:H,xCoords:_,yCoords:ot};return Xt}else{var Kt=H.keys(),le=M.getElementById(Kt.next().value),re=le.position(),ae=le.outerWidth();if(_.push(re.x),ot.push(re.y),S==2){var ee=M.getElementById(Kt.next().value),nt=ee.outerWidth();_.push(re.x+ae/2+nt/2+N.idealEdgeLength),ot.push(re.y)}return Xt={nodeIndexes:H,xCoords:_,yCoords:ot},Xt}};l.exports={spectralLayout:o}},579:(l,s,h)=>{var L=h(212),a=function(o){if(!o)return;o("layout","fcose",L)};if(typeof cytoscape<"u")a(cytoscape);l.exports=a},140:(l)=>{l.exports=U}},X={};function C(l){var s=X[l];if(s!==void 0)return s.exports;var h=X[l]={exports:{}};return z[l](h,h.exports,C),h.exports}var y=C(579);return y})()})});var or=K(je(),1);var _e={L:"left",R:"right",T:"top",B:"bottom"},tr={L:e((U)=>`${U},${U/2} 0,${U} 0,0`,"L"),R:e((U)=>`0,${U/2} ${U},0 ${U},${U}`,"R"),T:e((U)=>`0,0 ${U},0 ${U/2},${U}`,"T"),B:e((U)=>`${U/2},0 ${U},${U} 0,${U}`,"B")},Se={L:e((U,z)=>U-z+2,"L"),R:e((U,z)=>U-2,"R"),T:e((U,z)=>U-z+2,"T"),B:e((U,z)=>U-2,"B")},pr=e(function(U){if(he(U))return U==="L"?"R":"L";else return U==="T"?"B":"T"},"getOppositeArchitectureDirection"),er=e(function(U){let z=U;return z==="L"||z==="R"||z==="T"||z==="B"},"isArchitectureDirection"),he=e(function(U){let z=U;return z==="L"||z==="R"},"isArchitectureDirectionX"),ve=e(function(U){let z=U;return z==="T"||z==="B"},"isArchitectureDirectionY"),Be=e(function(U,z){let X=he(U)&&ve(z),C=ve(U)&&he(z);return X||C},"isArchitectureDirectionXY"),yr=e(function(U){let z=U[0],X=U[1],C=he(z)&&ve(X),y=ve(z)&&he(X);return C||y},"isArchitecturePairXY"),mr=e(function(U){return U!=="LL"&&U!=="RR"&&U!=="TT"&&U!=="BB"},"isValidArchitectureDirectionPair"),ze=e(function(U,z){let X=`${U}${z}`;return mr(X)?X:void 0},"getArchitectureDirectionPair"),Er=e(function([U,z],X){let C=X[0],y=X[1];if(he(C))if(ve(y))return[U+(C==="L"?-1:1),z+(y==="T"?1:-1)];else return[U+(C==="L"?-1:1),z];else if(he(y))return[U+(y==="L"?1:-1),z+(C==="T"?1:-1)];else return[U,z+(C==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Tr=e(function(U){if(U==="LT"||U==="TL")return[1,1];else if(U==="BL"||U==="LB")return[1,-1];else if(U==="BR"||U==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),Nr=e(function(U,z){if(Be(U,z))return"bend";else if(he(U))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),Lr=e(function(U){return U.type==="service"},"isArchitectureService"),wr=e(function(U){return U.type==="junction"},"isArchitectureJunction"),rr=e((U,z)=>{let[X,C]=[U,z].sort();return`${JSON.stringify(X)}-${JSON.stringify(C)}`},"architectureGroupAlignmentKey"),ir=e((U)=>U.data(),"edgeData"),we=e((U)=>U.data(),"nodeData"),Mr=x.architecture,nr=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=f,this.getAccTitle=p,this.setDiagramTitle=b,this.getDiagramTitle=v,this.getAccDescription=g,this.setAccDescription=m,this.clear()}static{e(this,"ArchitectureDB")}setDiagramId(U){this.diagramId=U}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",d()}addService({id:U,icon:z,in:X,title:C,iconText:y}){if(this.registeredIds.has(U))throw Error(`The service id [${U}] is already in use by another ${this.registeredIds.get(U)}`);if(X!==void 0){if(U===X)throw Error(`The service [${U}] cannot be placed within itself`);if(!this.registeredIds.has(X))throw Error(`The service [${U}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(X)==="node")throw Error(`The service [${U}]'s parent is not a group`)}this.registeredIds.set(U,"node"),this.nodes.set(U,{id:U,type:"service",icon:z,iconText:y,title:C,edges:[],in:X})}getServices(){return[...this.nodes.values()].filter(Lr)}addJunction({id:U,in:z}){if(this.registeredIds.has(U))throw Error(`The junction id [${U}] is already in use by another ${this.registeredIds.get(U)}`);if(z!==void 0){if(U===z)throw Error(`The junction [${U}] cannot be placed within itself`);if(!this.registeredIds.has(z))throw Error(`The junction [${U}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(z)==="node")throw Error(`The junction [${U}]'s parent is not a group`)}this.registeredIds.set(U,"node"),this.nodes.set(U,{id:U,type:"junction",edges:[],in:z})}getJunctions(){return[...this.nodes.values()].filter(wr)}getNodes(){return[...this.nodes.values()]}getNode(U){return this.nodes.get(U)??null}addGroup({id:U,icon:z,in:X,title:C}){if(this.registeredIds.has(U))throw Error(`The group id [${U}] is already in use by another ${this.registeredIds.get(U)}`);if(X!==void 0){if(U===X)throw Error(`The group [${U}] cannot be placed within itself`);if(!this.registeredIds.has(X))throw Error(`The group [${U}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(X)==="node")throw Error(`The group [${U}]'s parent is not a group`)}this.registeredIds.set(U,"group"),this.groups.set(U,{id:U,icon:z,title:C,in:X})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:U,rhsId:z,lhsDir:X,rhsDir:C,lhsInto:y,rhsInto:l,lhsGroup:s,rhsGroup:h,title:L}){if(!er(X))throw Error(`Invalid direction given for left hand side of edge ${U}--${z}. Expected (L,R,T,B) got ${String(X)}`);if(!er(C))throw Error(`Invalid direction given for right hand side of edge ${U}--${z}. Expected (L,R,T,B) got ${String(C)}`);if(!this.nodes.has(U)&&!this.groups.has(U))throw Error(`The left-hand id [${U}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(z)&&!this.groups.has(z))throw Error(`The right-hand id [${z}] does not yet exist. Please create the service/group before declaring an edge to it.`);let a=this.nodes.get(U).in,O=this.nodes.get(z).in;if(s&&a&&O&&a==O)throw Error(`The left-hand id [${U}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(h&&a&&O&&a==O)throw Error(`The right-hand id [${z}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let o={lhsId:U,lhsDir:X,lhsInto:y,lhsGroup:s,rhsId:z,rhsDir:C,rhsInto:l,rhsGroup:h,title:L};this.edges.push(o);let i=this.nodes.get(U),N=this.nodes.get(z);if(i&&N)i.edges.push(this.edges[this.edges.length-1]),N.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(U){if(U.members.length<2)throw Error(`An align directive requires at least two members; got ${U.members.length}`);let z=new Set;U.members.forEach((X)=>{if(this.registeredIds.get(X)!=="node")throw Error(`align ${U.direction} references [${X}], which is not a service or junction`);if(z.has(X))throw Error(`align ${U.direction} lists [${X}] more than once`);z.add(X)}),this.layoutHints.push(U)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let U=new Map,z=new Map;for(let[s,h]of this.nodes.entries()){let L=new Map;for(let a of h.edges){let O=this.getNode(a.lhsId)?.in,o=this.getNode(a.rhsId)?.in;if(O&&o&&O!==o){let i=Nr(a.lhsDir,a.rhsDir);if(i!=="bend")U.set(rr(O,o),i)}if(a.lhsId===s){let i=ze(a.lhsDir,a.rhsDir);if(i)L.set(i,a.rhsId)}else{let i=ze(a.rhsDir,a.lhsDir);if(i)L.set(i,a.lhsId)}}z.set(s,L)}let X=new Set,C=new Set(z.keys()),y=e((s)=>{let h=new Map([[s,[0,0]]]),L=[s];while(L.length>0){let a=L.shift();if(a){X.add(a),C.delete(a);let O=z.get(a);if(!O)throw Error(`BFS error: adjacency list for id ${a} not found. Please report this as a bug.`);let o=h.get(a);if(!o)throw Error(`BFS error: position for id ${a} not found in spatial map. Please report this as a bug.`);let[i,N]=o;O.forEach((M,T)=>{if(!X.has(M))h.set(M,Er([i,N],T)),L.push(M)})}}return h},"BFS"),l=[];while(C.size>0){let s=C.values().next().value;l.push(y(s))}this.dataStructures={adjList:z,spatialMaps:l,groupAlignments:U}}return this.dataStructures}setElementForId(U,z){this.elements.set(U,z)}getElementById(U){return this.elements.get(U)}getConfig(){return E({...Mr,...u().architecture})}getConfigField(U){return this.getConfig()[U]}},Cr=e((U,z)=>{R(U,z),U.groups.map((X)=>z.addGroup(X)),U.services.map((X)=>z.addService({...X,type:"service"})),U.junctions.map((X)=>z.addJunction({...X,type:"junction"})),U.edges.map((X)=>z.addEdge(X)),U.alignments?.map((X)=>z.addLayoutHint({direction:X.direction,members:[...X.members]}))},"populateDb"),ar={parser:{yy:void 0},parse:e(async(U)=>{let z=await D("architecture",U);t.debug(z);let X=ar.parser?.yy;if(!(X instanceof nr))throw 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.");Cr(z,X)},"parse")},Ar=e((U)=>`
1
+ import{R}from"./index-5n03dmb9.js";import{e,t,x,u,w,Ie,d,f,p,m,g,b,v,r,n,A,E,Me,Si,Bt,Te,Z}from"./index-nwsya6dj.js";import{K,oe}from"./index-v119nznk.js";import{D}from"./index-zx0j3a2z.js";import{Re}from"./index-6ceya556.js";var He=oe(function(Ae,Xe){(function(z,X){if(typeof Ae==="object"&&typeof Xe==="object")Xe.exports=X();else if(typeof define==="function"&&define.amd)define([],X);else if(typeof Ae==="object")Ae.layoutBase=X();else z.layoutBase=X()})(Ae,function(){return function(U){var z={};function X(C){if(z[C])return z[C].exports;var y=z[C]={i:C,l:!1,exports:{}};return U[C].call(y.exports,y,y.exports,X),y.l=!0,y.exports}return X.m=U,X.c=z,X.i=function(C){return C},X.d=function(C,y,l){if(!X.o(C,y))Object.defineProperty(C,y,{configurable:!1,enumerable:!0,get:l})},X.n=function(C){var y=C&&C.__esModule?function(){return C.default}:function(){return C};return X.d(y,"a",y),y},X.o=function(C,y){return Object.prototype.hasOwnProperty.call(C,y)},X.p="",X(X.s=28)}([function(U,z,X){function C(){}C.QUALITY=1,C.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,C.DEFAULT_INCREMENTAL=!1,C.DEFAULT_ANIMATION_ON_LAYOUT=!0,C.DEFAULT_ANIMATION_DURING_LAYOUT=!1,C.DEFAULT_ANIMATION_PERIOD=50,C.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,C.DEFAULT_GRAPH_MARGIN=15,C.NODE_DIMENSIONS_INCLUDE_LABELS=!1,C.SIMPLE_NODE_SIZE=40,C.SIMPLE_NODE_HALF_SIZE=C.SIMPLE_NODE_SIZE/2,C.EMPTY_COMPOUND_NODE_SIZE=40,C.MIN_EDGE_LENGTH=1,C.WORLD_BOUNDARY=1e6,C.INITIAL_WORLD_BOUNDARY=C.WORLD_BOUNDARY/1000,C.WORLD_CENTER_X=1200,C.WORLD_CENTER_Y=900,U.exports=C},function(U,z,X){var C=X(2),y=X(8),l=X(9);function s(L,a,O){C.call(this,O),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=O,this.bendpoints=[],this.source=L,this.target=a}s.prototype=Object.create(C.prototype);for(var h in C)s[h]=C[h];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(L){if(this.source===L)return this.target;else if(this.target===L)return this.source;else throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(L,a){var O=this.getOtherEnd(L),o=a.getGraphManager().getRoot();while(!0){if(O.getOwner()==a)return O;if(O.getOwner()==o)break;O=O.getOwner().getParent()}return null},s.prototype.updateLength=function(){var L=[,,,,];if(this.isOverlapingSourceAndTarget=y.getIntersection(this.target.getRect(),this.source.getRect(),L),!this.isOverlapingSourceAndTarget){if(this.lengthX=L[0]-L[2],this.lengthY=L[1]-L[3],Math.abs(this.lengthX)<1)this.lengthX=l.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=l.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},s.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=l.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=l.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},U.exports=s},function(U,z,X){function C(y){this.vGraphObject=y}U.exports=C},function(U,z,X){var C=X(2),y=X(10),l=X(13),s=X(0),h=X(16),L=X(5);function a(o,i,N,M){if(N==null&&M==null)M=i;if(C.call(this,M),o.graphManager!=null)o=o.graphManager;if(this.estimatedSize=y.MIN_VALUE,this.inclusionTreeDepth=y.MAX_VALUE,this.vGraphObject=M,this.edges=[],this.graphManager=o,N!=null&&i!=null)this.rect=new l(i.x,i.y,N.width,N.height);else this.rect=new l}a.prototype=Object.create(C.prototype);for(var O in C)a[O]=C[O];a.prototype.getEdges=function(){return this.edges},a.prototype.getChild=function(){return this.child},a.prototype.getOwner=function(){return this.owner},a.prototype.getWidth=function(){return this.rect.width},a.prototype.setWidth=function(o){this.rect.width=o},a.prototype.getHeight=function(){return this.rect.height},a.prototype.setHeight=function(o){this.rect.height=o},a.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},a.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},a.prototype.getCenter=function(){return new L(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},a.prototype.getLocation=function(){return new L(this.rect.x,this.rect.y)},a.prototype.getRect=function(){return this.rect},a.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},a.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},a.prototype.setRect=function(o,i){this.rect.x=o.x,this.rect.y=o.y,this.rect.width=i.width,this.rect.height=i.height},a.prototype.setCenter=function(o,i){this.rect.x=o-this.rect.width/2,this.rect.y=i-this.rect.height/2},a.prototype.setLocation=function(o,i){this.rect.x=o,this.rect.y=i},a.prototype.moveBy=function(o,i){this.rect.x+=o,this.rect.y+=i},a.prototype.getEdgeListToNode=function(o){var i=[],N,M=this;return M.edges.forEach(function(T){if(T.target==o){if(T.source!=M)throw"Incorrect edge source!";i.push(T)}}),i},a.prototype.getEdgesBetween=function(o){var i=[],N,M=this;return M.edges.forEach(function(T){if(!(T.source==M||T.target==M))throw"Incorrect edge source and/or target";if(T.target==o||T.source==o)i.push(T)}),i},a.prototype.getNeighborsList=function(){var o=new Set,i=this;return i.edges.forEach(function(N){if(N.source==i)o.add(N.target);else{if(N.target!=i)throw"Incorrect incidency!";o.add(N.source)}}),o},a.prototype.withChildren=function(){var o=new Set,i,N;if(o.add(this),this.child!=null){var M=this.child.getNodes();for(var T=0;T<M.length;T++)i=M[T],N=i.withChildren(),N.forEach(function(W){o.add(W)})}return o},a.prototype.getNoOfChildren=function(){var o=0,i;if(this.child==null)o=1;else{var N=this.child.getNodes();for(var M=0;M<N.length;M++)i=N[M],o+=i.getNoOfChildren()}if(o==0)o=1;return o},a.prototype.getEstimatedSize=function(){if(this.estimatedSize==y.MIN_VALUE)throw"assert failed";return this.estimatedSize},a.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},a.prototype.scatter=function(){var o,i,N=-s.INITIAL_WORLD_BOUNDARY,M=s.INITIAL_WORLD_BOUNDARY;o=s.WORLD_CENTER_X+h.nextDouble()*(M-N)+N;var T=-s.INITIAL_WORLD_BOUNDARY,W=s.INITIAL_WORLD_BOUNDARY;i=s.WORLD_CENTER_Y+h.nextDouble()*(W-T)+T,this.rect.x=o,this.rect.y=i},a.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var o=this.getChild();if(o.updateBounds(!0),this.rect.x=o.getLeft(),this.rect.y=o.getTop(),this.setWidth(o.getRight()-o.getLeft()),this.setHeight(o.getBottom()-o.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var i=o.getRight()-o.getLeft(),N=o.getBottom()-o.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(i+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>i)this.rect.x-=(this.labelWidth-i)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(i+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(N+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>N)this.rect.y-=(this.labelHeight-N)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(N+this.labelHeight)}}}},a.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==y.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},a.prototype.transform=function(o){var i=this.rect.x;if(i>s.WORLD_BOUNDARY)i=s.WORLD_BOUNDARY;else if(i<-s.WORLD_BOUNDARY)i=-s.WORLD_BOUNDARY;var N=this.rect.y;if(N>s.WORLD_BOUNDARY)N=s.WORLD_BOUNDARY;else if(N<-s.WORLD_BOUNDARY)N=-s.WORLD_BOUNDARY;var M=new L(i,N),T=o.inverseTransformPoint(M);this.setLocation(T.x,T.y)},a.prototype.getLeft=function(){return this.rect.x},a.prototype.getRight=function(){return this.rect.x+this.rect.width},a.prototype.getTop=function(){return this.rect.y},a.prototype.getBottom=function(){return this.rect.y+this.rect.height},a.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},U.exports=a},function(U,z,X){var C=X(0);function y(){}for(var l in C)y[l]=C[l];y.MAX_ITERATIONS=2500,y.DEFAULT_EDGE_LENGTH=50,y.DEFAULT_SPRING_STRENGTH=0.45,y.DEFAULT_REPULSION_STRENGTH=4500,y.DEFAULT_GRAVITY_STRENGTH=0.4,y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,y.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,y.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,y.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,y.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,y.COOLING_ADAPTATION_FACTOR=0.33,y.ADAPTATION_LOWER_NODE_LIMIT=1000,y.ADAPTATION_UPPER_NODE_LIMIT=5000,y.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,y.MAX_NODE_DISPLACEMENT=y.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,y.CONVERGENCE_CHECK_PERIOD=100,y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,y.MIN_EDGE_LENGTH=1,y.GRID_CALCULATION_CHECK_PERIOD=10,U.exports=y},function(U,z,X){function C(y,l){if(y==null&&l==null)this.x=0,this.y=0;else this.x=y,this.y=l}C.prototype.getX=function(){return this.x},C.prototype.getY=function(){return this.y},C.prototype.setX=function(y){this.x=y},C.prototype.setY=function(y){this.y=y},C.prototype.getDifference=function(y){return new DimensionD(this.x-y.x,this.y-y.y)},C.prototype.getCopy=function(){return new C(this.x,this.y)},C.prototype.translate=function(y){return this.x+=y.width,this.y+=y.height,this},U.exports=C},function(U,z,X){var C=X(2),y=X(10),l=X(0),s=X(7),h=X(3),L=X(1),a=X(13),O=X(12),o=X(11);function i(M,T,W){if(C.call(this,W),this.estimatedSize=y.MIN_VALUE,this.margin=l.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=M,T!=null&&T instanceof s)this.graphManager=T;else if(T!=null&&T instanceof Layout)this.graphManager=T.graphManager}i.prototype=Object.create(C.prototype);for(var N in C)i[N]=C[N];i.prototype.getNodes=function(){return this.nodes},i.prototype.getEdges=function(){return this.edges},i.prototype.getGraphManager=function(){return this.graphManager},i.prototype.getParent=function(){return this.parent},i.prototype.getLeft=function(){return this.left},i.prototype.getRight=function(){return this.right},i.prototype.getTop=function(){return this.top},i.prototype.getBottom=function(){return this.bottom},i.prototype.isConnected=function(){return this.isConnected},i.prototype.add=function(M,T,W){if(T==null&&W==null){var F=M;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(F)>-1)throw"Node already in graph!";return F.owner=this,this.getNodes().push(F),F}else{var P=M;if(!(this.getNodes().indexOf(T)>-1&&this.getNodes().indexOf(W)>-1))throw"Source or target not in graph!";if(!(T.owner==W.owner&&T.owner==this))throw"Both owners must be this graph!";if(T.owner!=W.owner)return null;if(P.source=T,P.target=W,P.isInterGraph=!1,this.getEdges().push(P),T.edges.push(P),W!=T)W.edges.push(P);return P}},i.prototype.remove=function(M){var T=M;if(M instanceof h){if(T==null)throw"Node is null!";if(!(T.owner!=null&&T.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var W=T.edges.slice(),F,P=W.length;for(var H=0;H<P;H++)if(F=W[H],F.isInterGraph)this.graphManager.remove(F);else F.source.owner.remove(F);var J=this.nodes.indexOf(T);if(J==-1)throw"Node not in owner node list!";this.nodes.splice(J,1)}else if(M instanceof L){var F=M;if(F==null)throw"Edge is null!";if(!(F.source!=null&&F.target!=null))throw"Source and/or target is null!";if(!(F.source.owner!=null&&F.target.owner!=null&&F.source.owner==this&&F.target.owner==this))throw"Source and/or target owner is invalid!";var V=F.source.edges.indexOf(F),_=F.target.edges.indexOf(F);if(!(V>-1&&_>-1))throw"Source and/or target doesn't know this edge!";if(F.source.edges.splice(V,1),F.target!=F.source)F.target.edges.splice(_,1);var J=F.source.owner.getEdges().indexOf(F);if(J==-1)throw"Not in owner's edge list!";F.source.owner.getEdges().splice(J,1)}},i.prototype.updateLeftTop=function(){var{MAX_VALUE:M,MAX_VALUE:T}=y,W,F,P,H=this.getNodes(),J=H.length;for(var V=0;V<J;V++){var _=H[V];if(W=_.getTop(),F=_.getLeft(),M>W)M=W;if(T>F)T=F}if(M==y.MAX_VALUE)return null;if(H[0].getParent().paddingLeft!=null)P=H[0].getParent().paddingLeft;else P=this.margin;return this.left=T-P,this.top=M-P,new O(this.left,this.top)},i.prototype.updateBounds=function(M){var T=y.MAX_VALUE,W=-y.MAX_VALUE,F=y.MAX_VALUE,P=-y.MAX_VALUE,H,J,V,_,ot,it=this.nodes,pt=it.length;for(var q=0;q<pt;q++){var st=it[q];if(M&&st.child!=null)st.updateBounds();if(H=st.getLeft(),J=st.getRight(),V=st.getTop(),_=st.getBottom(),T>H)T=H;if(W<J)W=J;if(F>V)F=V;if(P<_)P=_}var c=new a(T,F,W-T,P-F);if(T==y.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(it[0].getParent().paddingLeft!=null)ot=it[0].getParent().paddingLeft;else ot=this.margin;this.left=c.x-ot,this.right=c.x+c.width+ot,this.top=c.y-ot,this.bottom=c.y+c.height+ot},i.calculateBounds=function(M){var T=y.MAX_VALUE,W=-y.MAX_VALUE,F=y.MAX_VALUE,P=-y.MAX_VALUE,H,J,V,_,ot=M.length;for(var it=0;it<ot;it++){var pt=M[it];if(H=pt.getLeft(),J=pt.getRight(),V=pt.getTop(),_=pt.getBottom(),T>H)T=H;if(W<J)W=J;if(F>V)F=V;if(P<_)P=_}var q=new a(T,F,W-T,P-F);return q},i.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},i.prototype.getEstimatedSize=function(){if(this.estimatedSize==y.MIN_VALUE)throw"assert failed";return this.estimatedSize},i.prototype.calcEstimatedSize=function(){var M=0,T=this.nodes,W=T.length;for(var F=0;F<W;F++){var P=T[F];M+=P.calcEstimatedSize()}if(M==0)this.estimatedSize=l.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=M/Math.sqrt(this.nodes.length);return this.estimatedSize},i.prototype.updateConnected=function(){var M=this;if(this.nodes.length==0){this.isConnected=!0;return}var T=new o,W=new Set,F=this.nodes[0],P,H,J=F.withChildren();J.forEach(function(q){T.push(q),W.add(q)});while(T.length!==0){F=T.shift(),P=F.getEdges();var V=P.length;for(var _=0;_<V;_++){var ot=P[_];if(H=ot.getOtherEndInGraph(F,this),H!=null&&!W.has(H)){var it=H.withChildren();it.forEach(function(q){T.push(q),W.add(q)})}}}if(this.isConnected=!1,W.size>=this.nodes.length){var pt=0;if(W.forEach(function(q){if(q.owner==M)pt++}),pt==this.nodes.length)this.isConnected=!0}},U.exports=i},function(U,z,X){var C,y=X(1);function l(s){C=X(6),this.layout=s,this.graphs=[],this.edges=[]}l.prototype.addRoot=function(){var s=this.layout.newGraph(),h=this.layout.newNode(null),L=this.add(s,h);return this.setRootGraph(L),this.rootGraph},l.prototype.add=function(s,h,L,a,O){if(L==null&&a==null&&O==null){if(s==null)throw"Graph is null!";if(h==null)throw"Parent node is null!";if(this.graphs.indexOf(s)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(s),s.parent!=null)throw"Already has a parent!";if(h.child!=null)throw"Already has a child!";return s.parent=h,h.child=s,s}else{O=L,a=h,L=s;var o=a.getOwner(),i=O.getOwner();if(!(o!=null&&o.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(i!=null&&i.getGraphManager()==this))throw"Target not in this graph mgr!";if(o==i)return L.isInterGraph=!1,o.add(L,a,O);else{if(L.isInterGraph=!0,L.source=a,L.target=O,this.edges.indexOf(L)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(L),!(L.source!=null&&L.target!=null))throw"Edge source and/or target is null!";if(!(L.source.edges.indexOf(L)==-1&&L.target.edges.indexOf(L)==-1))throw"Edge already in source and/or target incidency list!";return L.source.edges.push(L),L.target.edges.push(L),L}}},l.prototype.remove=function(s){if(s instanceof C){var h=s;if(h.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(h==this.rootGraph||h.parent!=null&&h.parent.graphManager==this))throw"Invalid parent node!";var L=[];L=L.concat(h.getEdges());var a,O=L.length;for(var o=0;o<O;o++)a=L[o],h.remove(a);var i=[];i=i.concat(h.getNodes());var N;O=i.length;for(var o=0;o<O;o++)N=i[o],h.remove(N);if(h==this.rootGraph)this.setRootGraph(null);var M=this.graphs.indexOf(h);this.graphs.splice(M,1),h.parent=null}else if(s instanceof y){if(a=s,a==null)throw"Edge is null!";if(!a.isInterGraph)throw"Not an inter-graph edge!";if(!(a.source!=null&&a.target!=null))throw"Source and/or target is null!";if(!(a.source.edges.indexOf(a)!=-1&&a.target.edges.indexOf(a)!=-1))throw"Source and/or target doesn't know this edge!";var M=a.source.edges.indexOf(a);if(a.source.edges.splice(M,1),M=a.target.edges.indexOf(a),a.target.edges.splice(M,1),!(a.source.owner!=null&&a.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(a.source.owner.getGraphManager().edges.indexOf(a)==-1)throw"Not in owner graph manager's edge list!";var M=a.source.owner.getGraphManager().edges.indexOf(a);a.source.owner.getGraphManager().edges.splice(M,1)}},l.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},l.prototype.getGraphs=function(){return this.graphs},l.prototype.getAllNodes=function(){if(this.allNodes==null){var s=[],h=this.getGraphs(),L=h.length;for(var a=0;a<L;a++)s=s.concat(h[a].getNodes());this.allNodes=s}return this.allNodes},l.prototype.resetAllNodes=function(){this.allNodes=null},l.prototype.resetAllEdges=function(){this.allEdges=null},l.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},l.prototype.getAllEdges=function(){if(this.allEdges==null){var s=[],h=this.getGraphs(),L=h.length;for(var a=0;a<h.length;a++)s=s.concat(h[a].getEdges());s=s.concat(this.edges),this.allEdges=s}return this.allEdges},l.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},l.prototype.setAllNodesToApplyGravitation=function(s){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=s},l.prototype.getRoot=function(){return this.rootGraph},l.prototype.setRootGraph=function(s){if(s.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=s,s.parent==null)s.parent=this.layout.newNode("Root node")},l.prototype.getLayout=function(){return this.layout},l.prototype.isOneAncestorOfOther=function(s,h){if(!(s!=null&&h!=null))throw"assert failed";if(s==h)return!0;var L=s.getOwner(),a;do{if(a=L.getParent(),a==null)break;if(a==h)return!0;if(L=a.getOwner(),L==null)break}while(!0);L=h.getOwner();do{if(a=L.getParent(),a==null)break;if(a==s)return!0;if(L=a.getOwner(),L==null)break}while(!0);return!1},l.prototype.calcLowestCommonAncestors=function(){var s,h,L,a,O,o=this.getAllEdges(),i=o.length;for(var N=0;N<i;N++){if(s=o[N],h=s.source,L=s.target,s.lca=null,s.sourceInLca=h,s.targetInLca=L,h==L){s.lca=h.getOwner();continue}a=h.getOwner();while(s.lca==null){s.targetInLca=L,O=L.getOwner();while(s.lca==null){if(O==a){s.lca=O;break}if(O==this.rootGraph)break;if(s.lca!=null)throw"assert failed";s.targetInLca=O.getParent(),O=s.targetInLca.getOwner()}if(a==this.rootGraph)break;if(s.lca==null)s.sourceInLca=a.getParent(),a=s.sourceInLca.getOwner()}if(s.lca==null)throw"assert failed"}},l.prototype.calcLowestCommonAncestor=function(s,h){if(s==h)return s.getOwner();var L=s.getOwner();do{if(L==null)break;var a=h.getOwner();do{if(a==null)break;if(a==L)return a;a=a.getParent().getOwner()}while(!0);L=L.getParent().getOwner()}while(!0);return L},l.prototype.calcInclusionTreeDepths=function(s,h){if(s==null&&h==null)s=this.rootGraph,h=1;var L,a=s.getNodes(),O=a.length;for(var o=0;o<O;o++)if(L=a[o],L.inclusionTreeDepth=h,L.child!=null)this.calcInclusionTreeDepths(L.child,h+1)},l.prototype.includesInvalidEdge=function(){var s,h=[],L=this.edges.length;for(var a=0;a<L;a++)if(s=this.edges[a],this.isOneAncestorOfOther(s.source,s.target))h.push(s);for(var a=0;a<h.length;a++)this.remove(h[a]);return!1},U.exports=l},function(U,z,X){var C=X(12);function y(){}y.calcSeparationAmount=function(l,s,h,L){if(!l.intersects(s))throw"assert failed";var a=[,,];if(this.decideDirectionsForOverlappingNodes(l,s,a),h[0]=Math.min(l.getRight(),s.getRight())-Math.max(l.x,s.x),h[1]=Math.min(l.getBottom(),s.getBottom())-Math.max(l.y,s.y),l.getX()<=s.getX()&&l.getRight()>=s.getRight())h[0]+=Math.min(s.getX()-l.getX(),l.getRight()-s.getRight());else if(s.getX()<=l.getX()&&s.getRight()>=l.getRight())h[0]+=Math.min(l.getX()-s.getX(),s.getRight()-l.getRight());if(l.getY()<=s.getY()&&l.getBottom()>=s.getBottom())h[1]+=Math.min(s.getY()-l.getY(),l.getBottom()-s.getBottom());else if(s.getY()<=l.getY()&&s.getBottom()>=l.getBottom())h[1]+=Math.min(l.getY()-s.getY(),s.getBottom()-l.getBottom());var O=Math.abs((s.getCenterY()-l.getCenterY())/(s.getCenterX()-l.getCenterX()));if(s.getCenterY()===l.getCenterY()&&s.getCenterX()===l.getCenterX())O=1;var o=O*h[0],i=h[1]/O;if(h[0]<i)i=h[0];else o=h[1];h[0]=-1*a[0]*(i/2+L),h[1]=-1*a[1]*(o/2+L)},y.decideDirectionsForOverlappingNodes=function(l,s,h){if(l.getCenterX()<s.getCenterX())h[0]=-1;else h[0]=1;if(l.getCenterY()<s.getCenterY())h[1]=-1;else h[1]=1},y.getIntersection2=function(l,s,h){var L=l.getCenterX(),a=l.getCenterY(),O=s.getCenterX(),o=s.getCenterY();if(l.intersects(s))return h[0]=L,h[1]=a,h[2]=O,h[3]=o,!0;var i=l.getX(),N=l.getY(),M=l.getRight(),T=l.getX(),W=l.getBottom(),F=l.getRight(),P=l.getWidthHalf(),H=l.getHeightHalf(),J=s.getX(),V=s.getY(),_=s.getRight(),ot=s.getX(),it=s.getBottom(),pt=s.getRight(),q=s.getWidthHalf(),st=s.getHeightHalf(),c=!1,G=!1;if(L===O){if(a>o)return h[0]=L,h[1]=N,h[2]=O,h[3]=it,!1;else if(a<o)return h[0]=L,h[1]=W,h[2]=O,h[3]=V,!1}else if(a===o){if(L>O)return h[0]=i,h[1]=a,h[2]=_,h[3]=o,!1;else if(L<O)return h[0]=M,h[1]=a,h[2]=J,h[3]=o,!1}else{var S=l.height/l.width,Y=s.height/s.width,I=(o-a)/(O-L),Q=void 0,k=void 0,rt=void 0,tt=void 0,j=void 0,dt=void 0;if(-S===I)if(L>O)h[0]=T,h[1]=W,c=!0;else h[0]=M,h[1]=N,c=!0;else if(S===I)if(L>O)h[0]=i,h[1]=N,c=!0;else h[0]=F,h[1]=W,c=!0;if(-Y===I)if(O>L)h[2]=ot,h[3]=it,G=!0;else h[2]=_,h[3]=V,G=!0;else if(Y===I)if(O>L)h[2]=J,h[3]=V,G=!0;else h[2]=pt,h[3]=it,G=!0;if(c&&G)return!1;if(L>O)if(a>o)Q=this.getCardinalDirection(S,I,4),k=this.getCardinalDirection(Y,I,2);else Q=this.getCardinalDirection(-S,I,3),k=this.getCardinalDirection(-Y,I,1);else if(a>o)Q=this.getCardinalDirection(-S,I,1),k=this.getCardinalDirection(-Y,I,3);else Q=this.getCardinalDirection(S,I,2),k=this.getCardinalDirection(Y,I,4);if(!c)switch(Q){case 1:tt=N,rt=L+-H/I,h[0]=rt,h[1]=tt;break;case 2:rt=F,tt=a+P*I,h[0]=rt,h[1]=tt;break;case 3:tt=W,rt=L+H/I,h[0]=rt,h[1]=tt;break;case 4:rt=T,tt=a+-P*I,h[0]=rt,h[1]=tt;break}if(!G)switch(k){case 1:dt=V,j=O+-st/I,h[2]=j,h[3]=dt;break;case 2:j=pt,dt=o+q*I,h[2]=j,h[3]=dt;break;case 3:dt=it,j=O+st/I,h[2]=j,h[3]=dt;break;case 4:j=ot,dt=o+-q*I,h[2]=j,h[3]=dt;break}}return!1},y.getCardinalDirection=function(l,s,h){if(l>s)return h;else return 1+h%4},y.getIntersection=function(l,s,h,L){if(L==null)return this.getIntersection2(l,s,h);var{x:a,y:O}=l,{x:o,y:i}=s,{x:N,y:M}=h,{x:T,y:W}=L,F=void 0,P=void 0,H=void 0,J=void 0,V=void 0,_=void 0,ot=void 0,it=void 0,pt=void 0;if(H=i-O,V=a-o,ot=o*O-a*i,J=W-M,_=N-T,it=T*M-N*W,pt=H*_-J*V,pt===0)return null;return F=(V*it-_*ot)/pt,P=(J*ot-H*it)/pt,new C(F,P)},y.angleOfVector=function(l,s,h,L){var a=void 0;if(l!==h){if(a=Math.atan((L-s)/(h-l)),h<l)a+=Math.PI;else if(L<s)a+=this.TWO_PI}else if(L<s)a=this.ONE_AND_HALF_PI;else a=this.HALF_PI;return a},y.doIntersect=function(l,s,h,L){var{x:a,y:O}=l,{x:o,y:i}=s,{x:N,y:M}=h,{x:T,y:W}=L,F=(o-a)*(W-M)-(T-N)*(i-O);if(F===0)return!1;else{var P=((W-M)*(T-a)+(N-T)*(W-O))/F,H=((O-i)*(T-a)+(o-a)*(W-O))/F;return 0<P&&P<1&&0<H&&H<1}},y.findCircleLineIntersections=function(l,s,h,L,a,O,o){var i=(h-l)*(h-l)+(L-s)*(L-s),N=2*((l-a)*(h-l)+(s-O)*(L-s)),M=(l-a)*(l-a)+(s-O)*(s-O)-o*o,T=N*N-4*i*M;if(T>=0){var W=(-N+Math.sqrt(N*N-4*i*M))/(2*i),F=(-N-Math.sqrt(N*N-4*i*M))/(2*i),P=null;if(W>=0&&W<=1)return[W];if(F>=0&&F<=1)return[F];return P}else return null},y.HALF_PI=0.5*Math.PI,y.ONE_AND_HALF_PI=1.5*Math.PI,y.TWO_PI=2*Math.PI,y.THREE_PI=3*Math.PI,U.exports=y},function(U,z,X){function C(){}C.sign=function(y){if(y>0)return 1;else if(y<0)return-1;else return 0},C.floor=function(y){return y<0?Math.ceil(y):Math.floor(y)},C.ceil=function(y){return y<0?Math.floor(y):Math.ceil(y)},U.exports=C},function(U,z,X){function C(){}C.MAX_VALUE=2147483647,C.MIN_VALUE=-2147483648,U.exports=C},function(U,z,X){var C=function(){function a(O,o){for(var i=0;i<o.length;i++){var N=o[i];if(N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N)N.writable=!0;Object.defineProperty(O,N.key,N)}}return function(O,o,i){if(o)a(O.prototype,o);if(i)a(O,i);return O}}();function y(a,O){if(!(a instanceof O))throw TypeError("Cannot call a class as a function")}var l=function(O){return{value:O,next:null,prev:null}},s=function(O,o,i,N){if(O!==null)O.next=o;else N.head=o;if(i!==null)i.prev=o;else N.tail=o;return o.prev=O,o.next=i,N.length++,o},h=function(O,o){var{prev:i,next:N}=O;if(i!==null)i.next=N;else o.head=N;if(N!==null)N.prev=i;else o.tail=i;return O.prev=O.next=null,o.length--,O},L=function(){function a(O){var o=this;if(y(this,a),this.length=0,this.head=null,this.tail=null,O!=null)O.forEach(function(i){return o.push(i)})}return C(a,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(o,i){return s(i.prev,l(o),i,this)}},{key:"insertAfter",value:function(o,i){return s(i,l(o),i.next,this)}},{key:"insertNodeBefore",value:function(o,i){return s(i.prev,o,i,this)}},{key:"insertNodeAfter",value:function(o,i){return s(i,o,i.next,this)}},{key:"push",value:function(o){return s(this.tail,l(o),null,this)}},{key:"unshift",value:function(o){return s(null,l(o),this.head,this)}},{key:"remove",value:function(o){return h(o,this)}},{key:"pop",value:function(){return h(this.tail,this).value}},{key:"popNode",value:function(){return h(this.tail,this)}},{key:"shift",value:function(){return h(this.head,this).value}},{key:"shiftNode",value:function(){return h(this.head,this)}},{key:"get_object_at",value:function(o){if(o<=this.length()){var i=1,N=this.head;while(i<o)N=N.next,i++;return N.value}}},{key:"set_object_at",value:function(o,i){if(o<=this.length()){var N=1,M=this.head;while(N<o)M=M.next,N++;M.value=i}}}]),a}();U.exports=L},function(U,z,X){function C(y,l,s){if(this.x=null,this.y=null,y==null&&l==null&&s==null)this.x=0,this.y=0;else if(typeof y=="number"&&typeof l=="number"&&s==null)this.x=y,this.y=l;else if(y.constructor.name=="Point"&&l==null&&s==null)s=y,this.x=s.x,this.y=s.y}C.prototype.getX=function(){return this.x},C.prototype.getY=function(){return this.y},C.prototype.getLocation=function(){return new C(this.x,this.y)},C.prototype.setLocation=function(y,l,s){if(y.constructor.name=="Point"&&l==null&&s==null)s=y,this.setLocation(s.x,s.y);else if(typeof y=="number"&&typeof l=="number"&&s==null)if(parseInt(y)==y&&parseInt(l)==l)this.move(y,l);else this.x=Math.floor(y+0.5),this.y=Math.floor(l+0.5)},C.prototype.move=function(y,l){this.x=y,this.y=l},C.prototype.translate=function(y,l){this.x+=y,this.y+=l},C.prototype.equals=function(y){if(y.constructor.name=="Point"){var l=y;return this.x==l.x&&this.y==l.y}return this==y},C.prototype.toString=function(){return new C().constructor.name+"[x="+this.x+",y="+this.y+"]"},U.exports=C},function(U,z,X){function C(y,l,s,h){if(this.x=0,this.y=0,this.width=0,this.height=0,y!=null&&l!=null&&s!=null&&h!=null)this.x=y,this.y=l,this.width=s,this.height=h}C.prototype.getX=function(){return this.x},C.prototype.setX=function(y){this.x=y},C.prototype.getY=function(){return this.y},C.prototype.setY=function(y){this.y=y},C.prototype.getWidth=function(){return this.width},C.prototype.setWidth=function(y){this.width=y},C.prototype.getHeight=function(){return this.height},C.prototype.setHeight=function(y){this.height=y},C.prototype.getRight=function(){return this.x+this.width},C.prototype.getBottom=function(){return this.y+this.height},C.prototype.intersects=function(y){if(this.getRight()<y.x)return!1;if(this.getBottom()<y.y)return!1;if(y.getRight()<this.x)return!1;if(y.getBottom()<this.y)return!1;return!0},C.prototype.getCenterX=function(){return this.x+this.width/2},C.prototype.getMinX=function(){return this.getX()},C.prototype.getMaxX=function(){return this.getX()+this.width},C.prototype.getCenterY=function(){return this.y+this.height/2},C.prototype.getMinY=function(){return this.getY()},C.prototype.getMaxY=function(){return this.getY()+this.height},C.prototype.getWidthHalf=function(){return this.width/2},C.prototype.getHeightHalf=function(){return this.height/2},U.exports=C},function(U,z,X){var C=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol==="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function y(){}y.lastID=0,y.createID=function(l){if(y.isPrimitive(l))return l;if(l.uniqueID!=null)return l.uniqueID;return l.uniqueID=y.getString(),y.lastID++,l.uniqueID},y.getString=function(l){if(l==null)l=y.lastID;return"Object#"+l},y.isPrimitive=function(l){var s=typeof l>"u"?"undefined":C(l);return l==null||s!="object"&&s!="function"},U.exports=y},function(U,z,X){function C(N){if(Array.isArray(N)){for(var M=0,T=Array(N.length);M<N.length;M++)T[M]=N[M];return T}else return Array.from(N)}var y=X(0),l=X(7),s=X(3),h=X(1),L=X(6),a=X(5),O=X(17),o=X(29);function i(N){if(o.call(this),this.layoutQuality=y.QUALITY,this.createBendsAsNeeded=y.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=y.DEFAULT_INCREMENTAL,this.animationOnLayout=y.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=y.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=y.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=y.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new l(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,N!=null)this.isRemoteUse=N}i.RANDOM_SEED=1,i.prototype=Object.create(o.prototype),i.prototype.getGraphManager=function(){return this.graphManager},i.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},i.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},i.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},i.prototype.newGraphManager=function(){var N=new l(this);return this.graphManager=N,N},i.prototype.newGraph=function(N){return new L(null,this.graphManager,N)},i.prototype.newNode=function(N){return new s(this.graphManager,N)},i.prototype.newEdge=function(N){return new h(null,null,N)},i.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},i.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var N;if(this.checkLayoutSuccess())N=!1;else N=this.layout();if(y.ANIMATE==="during")return!1;if(N){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,N},i.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},i.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var N,M=this.graphManager.getAllEdges();for(var T=0;T<M.length;T++)N=M[T];var W,F=this.graphManager.getRoot().getNodes();for(var T=0;T<F.length;T++)W=F[T];this.update(this.graphManager.getRoot())}},i.prototype.update=function(N){if(N==null)this.update2();else if(N instanceof s){var M=N;if(M.getChild()!=null){var T=M.getChild().getNodes();for(var W=0;W<T.length;W++)update(T[W])}if(M.vGraphObject!=null){var F=M.vGraphObject;F.update(M)}}else if(N instanceof h){var P=N;if(P.vGraphObject!=null){var H=P.vGraphObject;H.update(P)}}else if(N instanceof L){var J=N;if(J.vGraphObject!=null){var V=J.vGraphObject;V.update(J)}}},i.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=y.QUALITY,this.animationDuringLayout=y.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=y.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=y.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=y.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=y.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=y.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},i.prototype.transform=function(N){if(N==null)this.transform(new a(0,0));else{var M=new O,T=this.graphManager.getRoot().updateLeftTop();if(T!=null){M.setWorldOrgX(N.x),M.setWorldOrgY(N.y),M.setDeviceOrgX(T.x),M.setDeviceOrgY(T.y);var W=this.getAllNodes(),F;for(var P=0;P<W.length;P++)F=W[P],F.transform(M)}}},i.prototype.positionNodesRandomly=function(N){if(N==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var M,T,W=N.getNodes();for(var F=0;F<W.length;F++)if(M=W[F],T=M.getChild(),T==null)M.scatter();else if(T.getNodes().length==0)M.scatter();else this.positionNodesRandomly(T),M.updateBounds()}},i.prototype.getFlatForest=function(){var N=[],M=!0,T=this.graphManager.getRoot().getNodes(),W=!0;for(var F=0;F<T.length;F++)if(T[F].getChild()!=null)W=!1;if(!W)return N;var P=new Set,H=[],J=new Map,V=[];V=V.concat(T);while(V.length>0&&M){H.push(V[0]);while(H.length>0&&M){var _=H[0];H.splice(0,1),P.add(_);var ot=_.getEdges();for(var F=0;F<ot.length;F++){var it=ot[F].getOtherEnd(_);if(J.get(_)!=it)if(!P.has(it))H.push(it),J.set(it,_);else{M=!1;break}}}if(!M)N=[];else{var pt=[].concat(C(P));N.push(pt);for(var F=0;F<pt.length;F++){var q=pt[F],st=V.indexOf(q);if(st>-1)V.splice(st,1)}P=new Set,J=new Map}}return N},i.prototype.createDummyNodesForBendpoints=function(N){var M=[],T=N.source,W=this.graphManager.calcLowestCommonAncestor(N.source,N.target);for(var F=0;F<N.bendpoints.length;F++){var P=this.newNode(null);P.setRect(new Point(0,0),new Dimension(1,1)),W.add(P);var H=this.newEdge(null);this.graphManager.add(H,T,P),M.add(P),T=P}var H=this.newEdge(null);if(this.graphManager.add(H,T,N.target),this.edgeToDummyNodes.set(N,M),N.isInterGraph())this.graphManager.remove(N);else W.remove(N);return M},i.prototype.createBendpointsFromDummyNodes=function(){var N=[];N=N.concat(this.graphManager.getAllEdges()),N=[].concat(C(this.edgeToDummyNodes.keys())).concat(N);for(var M=0;M<N.length;M++){var T=N[M];if(T.bendpoints.length>0){var W=this.edgeToDummyNodes.get(T);for(var F=0;F<W.length;F++){var P=W[F],H=new a(P.getCenterX(),P.getCenterY()),J=T.bendpoints.get(F);J.x=H.x,J.y=H.y,P.getOwner().remove(P)}this.graphManager.add(T,T.source,T.target)}}},i.transform=function(N,M,T,W){if(T!=null&&W!=null){var F=M;if(N<=50){var P=M/T;F-=(M-P)/50*(50-N)}else{var H=M*W;F+=(H-M)/50*(N-50)}return F}else{var J,V;if(N<=50)J=9*M/500,V=M/10;else J=9*M/50,V=-8*M;return J*N+V}},i.findCenterOfTree=function(N){var M=[];M=M.concat(N);var T=[],W=new Map,F=!1,P=null;if(M.length==1||M.length==2)F=!0,P=M[0];for(var H=0;H<M.length;H++){var J=M[H],V=J.getNeighborsList().size;if(W.set(J,J.getNeighborsList().size),V==1)T.push(J)}var _=[];_=_.concat(T);while(!F){var ot=[];ot=ot.concat(_),_=[];for(var H=0;H<M.length;H++){var J=M[H],it=M.indexOf(J);if(it>=0)M.splice(it,1);var pt=J.getNeighborsList();pt.forEach(function(c){if(T.indexOf(c)<0){var G=W.get(c),S=G-1;if(S==1)_.push(c);W.set(c,S)}})}if(T=T.concat(_),M.length==1||M.length==2)F=!0,P=M[0]}return P},i.prototype.setGraphManager=function(N){this.graphManager=N},U.exports=i},function(U,z,X){function C(){}C.seed=1,C.x=0,C.nextDouble=function(){return C.x=Math.sin(C.seed++)*1e4,C.x-Math.floor(C.x)},U.exports=C},function(U,z,X){var C=X(5);function y(l,s){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}y.prototype.getWorldOrgX=function(){return this.lworldOrgX},y.prototype.setWorldOrgX=function(l){this.lworldOrgX=l},y.prototype.getWorldOrgY=function(){return this.lworldOrgY},y.prototype.setWorldOrgY=function(l){this.lworldOrgY=l},y.prototype.getWorldExtX=function(){return this.lworldExtX},y.prototype.setWorldExtX=function(l){this.lworldExtX=l},y.prototype.getWorldExtY=function(){return this.lworldExtY},y.prototype.setWorldExtY=function(l){this.lworldExtY=l},y.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},y.prototype.setDeviceOrgX=function(l){this.ldeviceOrgX=l},y.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},y.prototype.setDeviceOrgY=function(l){this.ldeviceOrgY=l},y.prototype.getDeviceExtX=function(){return this.ldeviceExtX},y.prototype.setDeviceExtX=function(l){this.ldeviceExtX=l},y.prototype.getDeviceExtY=function(){return this.ldeviceExtY},y.prototype.setDeviceExtY=function(l){this.ldeviceExtY=l},y.prototype.transformX=function(l){var s=0,h=this.lworldExtX;if(h!=0)s=this.ldeviceOrgX+(l-this.lworldOrgX)*this.ldeviceExtX/h;return s},y.prototype.transformY=function(l){var s=0,h=this.lworldExtY;if(h!=0)s=this.ldeviceOrgY+(l-this.lworldOrgY)*this.ldeviceExtY/h;return s},y.prototype.inverseTransformX=function(l){var s=0,h=this.ldeviceExtX;if(h!=0)s=this.lworldOrgX+(l-this.ldeviceOrgX)*this.lworldExtX/h;return s},y.prototype.inverseTransformY=function(l){var s=0,h=this.ldeviceExtY;if(h!=0)s=this.lworldOrgY+(l-this.ldeviceOrgY)*this.lworldExtY/h;return s},y.prototype.inverseTransformPoint=function(l){var s=new C(this.inverseTransformX(l.x),this.inverseTransformY(l.y));return s},U.exports=y},function(U,z,X){function C(o){if(Array.isArray(o)){for(var i=0,N=Array(o.length);i<o.length;i++)N[i]=o[i];return N}else return Array.from(o)}var y=X(15),l=X(4),s=X(0),h=X(8),L=X(9);function a(){y.call(this),this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*l.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=l.MAX_ITERATIONS}a.prototype=Object.create(y.prototype);for(var O in y)a[O]=y[O];a.prototype.initParameters=function(){y.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},a.prototype.calcIdealEdgeLengths=function(){var o,i,N,M,T,W,F,P=this.getGraphManager().getAllEdges();for(var H=0;H<P.length;H++)if(o=P[H],i=o.idealLength,o.isInterGraph){if(M=o.getSource(),T=o.getTarget(),W=o.getSourceInLca().getEstimatedSize(),F=o.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)o.idealLength+=W+F-2*s.SIMPLE_NODE_SIZE;N=o.getLca().getInclusionTreeDepth(),o.idealLength+=i*l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(M.getInclusionTreeDepth()+T.getInclusionTreeDepth()-2*N)}},a.prototype.initSpringEmbedder=function(){var o=this.getAllNodes().length;if(this.incremental){if(o>l.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*l.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(o-l.ADAPTATION_LOWER_NODE_LIMIT)/(l.ADAPTATION_UPPER_NODE_LIMIT-l.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-l.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=l.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(o>l.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(l.COOLING_ADAPTATION_FACTOR,1-(o-l.ADAPTATION_LOWER_NODE_LIMIT)/(l.ADAPTATION_UPPER_NODE_LIMIT-l.ADAPTATION_LOWER_NODE_LIMIT)*(1-l.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=l.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*l.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},a.prototype.calcSpringForces=function(){var o=this.getAllEdges(),i;for(var N=0;N<o.length;N++)i=o[N],this.calcSpringForce(i,i.idealLength)},a.prototype.calcRepulsionForces=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,N,M,T,W,F=this.getAllNodes(),P;if(this.useFRGridVariant){if(this.totalIterations%l.GRID_CALCULATION_CHECK_PERIOD==1&&o)this.updateGrid();P=new Set;for(N=0;N<F.length;N++)T=F[N],this.calculateRepulsionForceOfANode(T,P,o,i),P.add(T)}else for(N=0;N<F.length;N++){T=F[N];for(M=N+1;M<F.length;M++){if(W=F[M],T.getOwner()!=W.getOwner())continue;this.calcRepulsionForce(T,W)}}},a.prototype.calcGravitationalForces=function(){var o,i=this.getAllNodesToApplyGravitation();for(var N=0;N<i.length;N++)o=i[N],this.calcGravitationalForce(o)},a.prototype.moveNodes=function(){var o=this.getAllNodes(),i;for(var N=0;N<o.length;N++)i=o[N],i.move()},a.prototype.calcSpringForce=function(o,i){var N=o.getSource(),M=o.getTarget(),T,W,F,P;if(this.uniformLeafNodeSizes&&N.getChild()==null&&M.getChild()==null)o.updateLengthSimple();else if(o.updateLength(),o.isOverlapingSourceAndTarget)return;if(T=o.getLength(),T==0)return;W=o.edgeElasticity*(T-i),F=W*(o.lengthX/T),P=W*(o.lengthY/T),N.springForceX+=F,N.springForceY+=P,M.springForceX-=F,M.springForceY-=P},a.prototype.calcRepulsionForce=function(o,i){var N=o.getRect(),M=i.getRect(),T=[,,],W=[,,,,],F,P,H,J,V,_,ot;if(N.intersects(M)){h.calcSeparationAmount(N,M,T,l.DEFAULT_EDGE_LENGTH/2),_=2*T[0],ot=2*T[1];var it=o.noOfChildren*i.noOfChildren/(o.noOfChildren+i.noOfChildren);o.repulsionForceX-=it*_,o.repulsionForceY-=it*ot,i.repulsionForceX+=it*_,i.repulsionForceY+=it*ot}else{if(this.uniformLeafNodeSizes&&o.getChild()==null&&i.getChild()==null)F=M.getCenterX()-N.getCenterX(),P=M.getCenterY()-N.getCenterY();else h.getIntersection(N,M,W),F=W[2]-W[0],P=W[3]-W[1];if(Math.abs(F)<l.MIN_REPULSION_DIST)F=L.sign(F)*l.MIN_REPULSION_DIST;if(Math.abs(P)<l.MIN_REPULSION_DIST)P=L.sign(P)*l.MIN_REPULSION_DIST;H=F*F+P*P,J=Math.sqrt(H),V=(o.nodeRepulsion/2+i.nodeRepulsion/2)*o.noOfChildren*i.noOfChildren/H,_=V*F/J,ot=V*P/J,o.repulsionForceX-=_,o.repulsionForceY-=ot,i.repulsionForceX+=_,i.repulsionForceY+=ot}},a.prototype.calcGravitationalForce=function(o){var i,N,M,T,W,F,P,H;if(i=o.getOwner(),N=(i.getRight()+i.getLeft())/2,M=(i.getTop()+i.getBottom())/2,T=o.getCenterX()-N,W=o.getCenterY()-M,F=Math.abs(T)+o.getWidth()/2,P=Math.abs(W)+o.getHeight()/2,o.getOwner()==this.graphManager.getRoot()){if(H=i.getEstimatedSize()*this.gravityRangeFactor,F>H||P>H)o.gravitationForceX=-this.gravityConstant*T,o.gravitationForceY=-this.gravityConstant*W}else if(H=i.getEstimatedSize()*this.compoundGravityRangeFactor,F>H||P>H)o.gravitationForceX=-this.gravityConstant*T*this.compoundGravityConstant,o.gravitationForceY=-this.gravityConstant*W*this.compoundGravityConstant},a.prototype.isConverged=function(){var o,i=!1;if(this.totalIterations>this.maxIterations/3)i=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return o=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,o||i},a.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},a.prototype.calcNoOfChildrenForAllNodes=function(){var o,i=this.graphManager.getAllNodes();for(var N=0;N<i.length;N++)o=i[N],o.noOfChildren=o.getNoOfChildren()},a.prototype.calcGrid=function(o){var i=0,N=0;i=parseInt(Math.ceil((o.getRight()-o.getLeft())/this.repulsionRange)),N=parseInt(Math.ceil((o.getBottom()-o.getTop())/this.repulsionRange));var M=Array(i);for(var T=0;T<i;T++)M[T]=Array(N);for(var T=0;T<i;T++)for(var W=0;W<N;W++)M[T][W]=[];return M},a.prototype.addNodeToGrid=function(o,i,N){var M=0,T=0,W=0,F=0;M=parseInt(Math.floor((o.getRect().x-i)/this.repulsionRange)),T=parseInt(Math.floor((o.getRect().width+o.getRect().x-i)/this.repulsionRange)),W=parseInt(Math.floor((o.getRect().y-N)/this.repulsionRange)),F=parseInt(Math.floor((o.getRect().height+o.getRect().y-N)/this.repulsionRange));for(var P=M;P<=T;P++)for(var H=W;H<=F;H++)this.grid[P][H].push(o),o.setGridCoordinates(M,T,W,F)},a.prototype.updateGrid=function(){var o,i,N=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(o=0;o<N.length;o++)i=N[o],this.addNodeToGrid(i,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},a.prototype.calculateRepulsionForceOfANode=function(o,i,N,M){if(this.totalIterations%l.GRID_CALCULATION_CHECK_PERIOD==1&&N||M){var T=new Set;o.surrounding=[];var W,F=this.grid;for(var P=o.startX-1;P<o.finishX+2;P++)for(var H=o.startY-1;H<o.finishY+2;H++)if(!(P<0||H<0||P>=F.length||H>=F[0].length))for(var J=0;J<F[P][H].length;J++){if(W=F[P][H][J],o.getOwner()!=W.getOwner()||o==W)continue;if(!i.has(W)&&!T.has(W)){var V=Math.abs(o.getCenterX()-W.getCenterX())-(o.getWidth()/2+W.getWidth()/2),_=Math.abs(o.getCenterY()-W.getCenterY())-(o.getHeight()/2+W.getHeight()/2);if(V<=this.repulsionRange&&_<=this.repulsionRange)T.add(W)}}o.surrounding=[].concat(C(T))}for(P=0;P<o.surrounding.length;P++)this.calcRepulsionForce(o,o.surrounding[P])},a.prototype.calcRepulsionRange=function(){return 0},U.exports=a},function(U,z,X){var C=X(1),y=X(4);function l(h,L,a){C.call(this,h,L,a),this.idealLength=y.DEFAULT_EDGE_LENGTH,this.edgeElasticity=y.DEFAULT_SPRING_STRENGTH}l.prototype=Object.create(C.prototype);for(var s in C)l[s]=C[s];U.exports=l},function(U,z,X){var C=X(3),y=X(4);function l(h,L,a,O){C.call(this,h,L,a,O),this.nodeRepulsion=y.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=[]}l.prototype=Object.create(C.prototype);for(var s in C)l[s]=C[s];l.prototype.setGridCoordinates=function(h,L,a,O){this.startX=h,this.finishX=L,this.startY=a,this.finishY=O},U.exports=l},function(U,z,X){function C(y,l){if(this.width=0,this.height=0,y!==null&&l!==null)this.height=l,this.width=y}C.prototype.getWidth=function(){return this.width},C.prototype.setWidth=function(y){this.width=y},C.prototype.getHeight=function(){return this.height},C.prototype.setHeight=function(y){this.height=y},U.exports=C},function(U,z,X){var C=X(14);function y(){this.map={},this.keys=[]}y.prototype.put=function(l,s){var h=C.createID(l);if(!this.contains(h))this.map[h]=s,this.keys.push(l)},y.prototype.contains=function(l){var s=C.createID(l);return this.map[l]!=null},y.prototype.get=function(l){var s=C.createID(l);return this.map[s]},y.prototype.keySet=function(){return this.keys},U.exports=y},function(U,z,X){var C=X(14);function y(){this.set={}}y.prototype.add=function(l){var s=C.createID(l);if(!this.contains(s))this.set[s]=l},y.prototype.remove=function(l){delete this.set[C.createID(l)]},y.prototype.clear=function(){this.set={}},y.prototype.contains=function(l){return this.set[C.createID(l)]==l},y.prototype.isEmpty=function(){return this.size()===0},y.prototype.size=function(){return Object.keys(this.set).length},y.prototype.addAllTo=function(l){var s=Object.keys(this.set),h=s.length;for(var L=0;L<h;L++)l.push(this.set[s[L]])},y.prototype.size=function(){return Object.keys(this.set).length},y.prototype.addAll=function(l){var s=l.length;for(var h=0;h<s;h++){var L=l[h];this.add(L)}},U.exports=y},function(U,z,X){function C(){}C.multMat=function(y,l){var s=[];for(var h=0;h<y.length;h++){s[h]=[];for(var L=0;L<l[0].length;L++){s[h][L]=0;for(var a=0;a<y[0].length;a++)s[h][L]+=y[h][a]*l[a][L]}}return s},C.transpose=function(y){var l=[];for(var s=0;s<y[0].length;s++){l[s]=[];for(var h=0;h<y.length;h++)l[s][h]=y[h][s]}return l},C.multCons=function(y,l){var s=[];for(var h=0;h<y.length;h++)s[h]=y[h]*l;return s},C.minusOp=function(y,l){var s=[];for(var h=0;h<y.length;h++)s[h]=y[h]-l[h];return s},C.dotProduct=function(y,l){var s=0;for(var h=0;h<y.length;h++)s+=y[h]*l[h];return s},C.mag=function(y){return Math.sqrt(this.dotProduct(y,y))},C.normalize=function(y){var l=[],s=this.mag(y);for(var h=0;h<y.length;h++)l[h]=y[h]/s;return l},C.multGamma=function(y){var l=[],s=0;for(var h=0;h<y.length;h++)s+=y[h];s*=-1/y.length;for(var L=0;L<y.length;L++)l[L]=s+y[L];return l},C.multL=function(y,l,s){var h=[],L=[],a=[];for(var O=0;O<l[0].length;O++){var o=0;for(var i=0;i<l.length;i++)o+=-0.5*l[i][O]*y[i];L[O]=o}for(var N=0;N<s.length;N++){var M=0;for(var T=0;T<s.length;T++)M+=s[N][T]*L[T];a[N]=M}for(var W=0;W<l.length;W++){var F=0;for(var P=0;P<l[0].length;P++)F+=l[W][P]*a[P];h[W]=F}return h},U.exports=C},function(U,z,X){var C=function(){function h(L,a){for(var O=0;O<a.length;O++){var o=a[O];if(o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o)o.writable=!0;Object.defineProperty(L,o.key,o)}}return function(L,a,O){if(a)h(L.prototype,a);if(O)h(L,O);return L}}();function y(h,L){if(!(h instanceof L))throw TypeError("Cannot call a class as a function")}var l=X(11),s=function(){function h(L,a){if(y(this,h),a!==null||a!==void 0)this.compareFunction=this._defaultCompareFunction;var O=void 0;if(L instanceof l)O=L.size();else O=L.length;this._quicksort(L,0,O-1)}return C(h,[{key:"_quicksort",value:function(a,O,o){if(O<o){var i=this._partition(a,O,o);this._quicksort(a,O,i),this._quicksort(a,i+1,o)}}},{key:"_partition",value:function(a,O,o){var i=this._get(a,O),N=O,M=o;while(!0){while(this.compareFunction(i,this._get(a,M)))M--;while(this.compareFunction(this._get(a,N),i))N++;if(N<M)this._swap(a,N,M),N++,M--;else return M}}},{key:"_get",value:function(a,O){if(a instanceof l)return a.get_object_at(O);else return a[O]}},{key:"_set",value:function(a,O,o){if(a instanceof l)a.set_object_at(O,o);else a[O]=o}},{key:"_swap",value:function(a,O,o){var i=this._get(a,O);this._set(a,O,this._get(a,o)),this._set(a,o,i)}},{key:"_defaultCompareFunction",value:function(a,O){return O>a}}]),h}();U.exports=s},function(U,z,X){function C(){}C.svd=function(y){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=y.length,this.n=y[0].length;var l=Math.min(this.m,this.n);this.s=function(Qt){var Wt=[];while(Qt-- >0)Wt.push(0);return Wt}(Math.min(this.m+1,this.n)),this.U=function(Qt){var Wt=function ue(jt){if(jt.length==0)return 0;else{var se=[];for(var ce=0;ce<jt[0];ce++)se.push(ue(jt.slice(1)));return se}};return Wt(Qt)}([this.m,l]),this.V=function(Qt){var Wt=function ue(jt){if(jt.length==0)return 0;else{var se=[];for(var ce=0;ce<jt[0];ce++)se.push(ue(jt.slice(1)));return se}};return Wt(Qt)}([this.n,this.n]);var s=function(Qt){var Wt=[];while(Qt-- >0)Wt.push(0);return Wt}(this.n),h=function(Qt){var Wt=[];while(Qt-- >0)Wt.push(0);return Wt}(this.m),L=!0,a=!0,O=Math.min(this.m-1,this.n),o=Math.max(0,Math.min(this.n-2,this.m));for(var i=0;i<Math.max(O,o);i++){if(i<O){this.s[i]=0;for(var N=i;N<this.m;N++)this.s[i]=C.hypot(this.s[i],y[N][i]);if(this.s[i]!==0){if(y[i][i]<0)this.s[i]=-this.s[i];for(var M=i;M<this.m;M++)y[M][i]/=this.s[i];y[i][i]+=1}this.s[i]=-this.s[i]}for(var T=i+1;T<this.n;T++){if(function(Qt,Wt){return Qt&&Wt}(i<O,this.s[i]!==0)){var W=0;for(var F=i;F<this.m;F++)W+=y[F][i]*y[F][T];W=-W/y[i][i];for(var P=i;P<this.m;P++)y[P][T]+=W*y[P][i]}s[T]=y[i][T]}if(function(Qt,Wt){return Qt&&Wt}(L,i<O))for(var H=i;H<this.m;H++)this.U[H][i]=y[H][i];if(i<o){s[i]=0;for(var J=i+1;J<this.n;J++)s[i]=C.hypot(s[i],s[J]);if(s[i]!==0){if(s[i+1]<0)s[i]=-s[i];for(var V=i+1;V<this.n;V++)s[V]/=s[i];s[i+1]+=1}if(s[i]=-s[i],function(Qt,Wt){return Qt&&Wt}(i+1<this.m,s[i]!==0)){for(var _=i+1;_<this.m;_++)h[_]=0;for(var ot=i+1;ot<this.n;ot++)for(var it=i+1;it<this.m;it++)h[it]+=s[ot]*y[it][ot];for(var pt=i+1;pt<this.n;pt++){var q=-s[pt]/s[i+1];for(var st=i+1;st<this.m;st++)y[st][pt]+=q*h[st]}}if(a)for(var c=i+1;c<this.n;c++)this.V[c][i]=s[c]}}var G=Math.min(this.n,this.m+1);if(O<this.n)this.s[O]=y[O][O];if(this.m<G)this.s[G-1]=0;if(o+1<G)s[o]=y[o][G-1];if(s[G-1]=0,L){for(var S=O;S<l;S++){for(var Y=0;Y<this.m;Y++)this.U[Y][S]=0;this.U[S][S]=1}for(var I=O-1;I>=0;I--)if(this.s[I]!==0){for(var Q=I+1;Q<l;Q++){var k=0;for(var rt=I;rt<this.m;rt++)k+=this.U[rt][I]*this.U[rt][Q];k=-k/this.U[I][I];for(var tt=I;tt<this.m;tt++)this.U[tt][Q]+=k*this.U[tt][I]}for(var j=I;j<this.m;j++)this.U[j][I]=-this.U[j][I];this.U[I][I]=1+this.U[I][I];for(var dt=0;dt<I-1;dt++)this.U[dt][I]=0}else{for(var Nt=0;Nt<this.m;Nt++)this.U[Nt][I]=0;this.U[I][I]=1}}if(a)for(var et=this.n-1;et>=0;et--){if(function(Qt,Wt){return Qt&&Wt}(et<o,s[et]!==0))for(var Tt=et+1;Tt<l;Tt++){var ct=0;for(var B=et+1;B<this.n;B++)ct+=this.V[B][et]*this.V[B][Tt];ct=-ct/this.V[et+1][et];for(var at=et+1;at<this.n;at++)this.V[at][Tt]+=ct*this.V[at][et]}for(var ht=0;ht<this.n;ht++)this.V[ht][et]=0;this.V[et][et]=1}var mt=G-1,Ot=0,Vt=Math.pow(2,-52),_t=Math.pow(2,-966);while(G>0){var yt=void 0,ne=void 0;for(yt=G-2;yt>=-1;yt--){if(yt===-1)break;if(Math.abs(s[yt])<=_t+Vt*(Math.abs(this.s[yt])+Math.abs(this.s[yt+1]))){s[yt]=0;break}}if(yt===G-2)ne=4;else{var kt=void 0;for(kt=G-1;kt>=yt;kt--){if(kt===yt)break;var At=(kt!==G?Math.abs(s[kt]):0)+(kt!==yt+1?Math.abs(s[kt-1]):0);if(Math.abs(this.s[kt])<=_t+Vt*At){this.s[kt]=0;break}}if(kt===yt)ne=3;else if(kt===G-1)ne=1;else ne=2,yt=kt}switch(yt++,ne){case 1:{var Lt=s[G-2];s[G-2]=0;for(var Gt=G-2;Gt>=yt;Gt--){var Yt=C.hypot(this.s[Gt],Lt),zt=this.s[Gt]/Yt,Xt=Lt/Yt;if(this.s[Gt]=Yt,Gt!==yt)Lt=-Xt*s[Gt-1],s[Gt-1]=zt*s[Gt-1];if(a)for(var Ht=0;Ht<this.n;Ht++)Yt=zt*this.V[Ht][Gt]+Xt*this.V[Ht][G-1],this.V[Ht][G-1]=-Xt*this.V[Ht][Gt]+zt*this.V[Ht][G-1],this.V[Ht][Gt]=Yt}}break;case 2:{var qt=s[yt-1];s[yt-1]=0;for(var Kt=yt;Kt<G;Kt++){var le=C.hypot(this.s[Kt],qt),re=this.s[Kt]/le,ae=qt/le;if(this.s[Kt]=le,qt=-ae*s[Kt],s[Kt]=re*s[Kt],L)for(var ee=0;ee<this.m;ee++)le=re*this.U[ee][Kt]+ae*this.U[ee][yt-1],this.U[ee][yt-1]=-ae*this.U[ee][Kt]+re*this.U[ee][yt-1],this.U[ee][Kt]=le}}break;case 3:{var nt=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[G-1]),Math.abs(this.s[G-2])),Math.abs(s[G-2])),Math.abs(this.s[yt])),Math.abs(s[yt])),lt=this.s[G-1]/nt,ft=this.s[G-2]/nt,gt=s[G-2]/nt,ut=this.s[yt]/nt,Et=s[yt]/nt,Ft=((ft+lt)*(ft-lt)+gt*gt)/2,Rt=lt*gt*(lt*gt),vt=0;if(function(Qt,Wt){return Qt||Wt}(Ft!==0,Rt!==0)){if(vt=Math.sqrt(Ft*Ft+Rt),Ft<0)vt=-vt;vt=Rt/(Ft+vt)}var xt=(ut+lt)*(ut-lt)+vt,St=ut*Et;for(var wt=yt;wt<G-1;wt++){var Pt=C.hypot(xt,St),$t=xt/Pt,Dt=St/Pt;if(wt!==yt)s[wt-1]=Pt;if(xt=$t*this.s[wt]+Dt*s[wt],s[wt]=$t*s[wt]-Dt*this.s[wt],St=Dt*this.s[wt+1],this.s[wt+1]=$t*this.s[wt+1],a)for(var Mt=0;Mt<this.n;Mt++)Pt=$t*this.V[Mt][wt]+Dt*this.V[Mt][wt+1],this.V[Mt][wt+1]=-Dt*this.V[Mt][wt]+$t*this.V[Mt][wt+1],this.V[Mt][wt]=Pt;if(Pt=C.hypot(xt,St),$t=xt/Pt,Dt=St/Pt,this.s[wt]=Pt,xt=$t*s[wt]+Dt*this.s[wt+1],this.s[wt+1]=-Dt*s[wt]+$t*this.s[wt+1],St=Dt*s[wt+1],s[wt+1]=$t*s[wt+1],L&&wt<this.m-1)for(var bt=0;bt<this.m;bt++)Pt=$t*this.U[bt][wt]+Dt*this.U[bt][wt+1],this.U[bt][wt+1]=-Dt*this.U[bt][wt]+$t*this.U[bt][wt+1],this.U[bt][wt]=Pt}s[G-2]=xt,Ot=Ot+1}break;case 4:{if(this.s[yt]<=0){if(this.s[yt]=this.s[yt]<0?-this.s[yt]:0,a)for(var Ct=0;Ct<=mt;Ct++)this.V[Ct][yt]=-this.V[Ct][yt]}while(yt<mt){if(this.s[yt]>=this.s[yt+1])break;var It=this.s[yt];if(this.s[yt]=this.s[yt+1],this.s[yt+1]=It,a&&yt<this.n-1)for(var te=0;te<this.n;te++)It=this.V[te][yt+1],this.V[te][yt+1]=this.V[te][yt],this.V[te][yt]=It;if(L&&yt<this.m-1)for(var Jt=0;Jt<this.m;Jt++)It=this.U[Jt][yt+1],this.U[Jt][yt+1]=this.U[Jt][yt],this.U[Jt][yt]=It;yt++}Ot=0,G--}break}}var fe={U:this.U,V:this.V,S:this.s};return fe},C.hypot=function(y,l){var s=void 0;if(Math.abs(y)>Math.abs(l))s=l/y,s=Math.abs(y)*Math.sqrt(1+s*s);else if(l!=0)s=y/l,s=Math.abs(l)*Math.sqrt(1+s*s);else s=0;return s},U.exports=C},function(U,z,X){var C=function(){function s(h,L){for(var a=0;a<L.length;a++){var O=L[a];if(O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O)O.writable=!0;Object.defineProperty(h,O.key,O)}}return function(h,L,a){if(L)s(h.prototype,L);if(a)s(h,a);return h}}();function y(s,h){if(!(s instanceof h))throw TypeError("Cannot call a class as a function")}var l=function(){function s(h,L){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,O=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;y(this,s),this.sequence1=h,this.sequence2=L,this.match_score=a,this.mismatch_penalty=O,this.gap_penalty=o,this.iMax=h.length+1,this.jMax=L.length+1,this.grid=Array(this.iMax);for(var i=0;i<this.iMax;i++){this.grid[i]=Array(this.jMax);for(var N=0;N<this.jMax;N++)this.grid[i][N]=0}this.tracebackGrid=Array(this.iMax);for(var M=0;M<this.iMax;M++){this.tracebackGrid[M]=Array(this.jMax);for(var T=0;T<this.jMax;T++)this.tracebackGrid[M][T]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return C(s,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var L=1;L<this.jMax;L++)this.grid[0][L]=this.grid[0][L-1]+this.gap_penalty,this.tracebackGrid[0][L]=[!1,!1,!0];for(var a=1;a<this.iMax;a++)this.grid[a][0]=this.grid[a-1][0]+this.gap_penalty,this.tracebackGrid[a][0]=[!1,!0,!1];for(var O=1;O<this.iMax;O++)for(var o=1;o<this.jMax;o++){var i=void 0;if(this.sequence1[O-1]===this.sequence2[o-1])i=this.grid[O-1][o-1]+this.match_score;else i=this.grid[O-1][o-1]+this.mismatch_penalty;var N=this.grid[O-1][o]+this.gap_penalty,M=this.grid[O][o-1]+this.gap_penalty,T=[i,N,M],W=this.arrayAllMaxIndexes(T);this.grid[O][o]=T[W[0]],this.tracebackGrid[O][o]=[W.includes(0),W.includes(1),W.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var L=[];L.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(L[0]){var a=L[0],O=this.tracebackGrid[a.pos[0]][a.pos[1]];if(O[0])L.push({pos:[a.pos[0]-1,a.pos[1]-1],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2});if(O[1])L.push({pos:[a.pos[0]-1,a.pos[1]],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:"-"+a.seq2});if(O[2])L.push({pos:[a.pos[0],a.pos[1]-1],seq1:"-"+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2});if(a.pos[0]===0&&a.pos[1]===0)this.alignments.push({sequence1:a.seq1,sequence2:a.seq2});L.shift()}return this.alignments}},{key:"getAllIndexes",value:function(L,a){var O=[],o=-1;while((o=L.indexOf(a,o+1))!==-1)O.push(o);return O}},{key:"arrayAllMaxIndexes",value:function(L){return this.getAllIndexes(L,Math.max.apply(null,L))}}]),s}();U.exports=l},function(U,z,X){var C=function(){return};C.FDLayout=X(18),C.FDLayoutConstants=X(4),C.FDLayoutEdge=X(19),C.FDLayoutNode=X(20),C.DimensionD=X(21),C.HashMap=X(22),C.HashSet=X(23),C.IGeometry=X(8),C.IMath=X(9),C.Integer=X(10),C.Point=X(12),C.PointD=X(5),C.RandomSeed=X(16),C.RectangleD=X(13),C.Transform=X(17),C.UniqueIDGeneretor=X(14),C.Quicksort=X(25),C.LinkedList=X(11),C.LGraphObject=X(2),C.LGraph=X(6),C.LEdge=X(1),C.LGraphManager=X(7),C.LNode=X(3),C.Layout=X(15),C.LayoutConstants=X(0),C.NeedlemanWunsch=X(27),C.Matrix=X(24),C.SVD=X(26),U.exports=C},function(U,z,X){function C(){this.listeners=[]}var y=C.prototype;y.addListener=function(l,s){this.listeners.push({event:l,callback:s})},y.removeListener=function(l,s){for(var h=this.listeners.length;h>=0;h--){var L=this.listeners[h];if(L.event===l&&L.callback===s)this.listeners.splice(h,1)}},y.emit=function(l,s){for(var h=0;h<this.listeners.length;h++){var L=this.listeners[h];if(l===L.event)L.callback(s)}},U.exports=C}])})});var Ve=oe(function(De,We){(function(z,X){if(typeof De==="object"&&typeof We==="object")We.exports=X(He());else if(typeof define==="function"&&define.amd)define(["layout-base"],X);else if(typeof De==="object")De.coseBase=X(He());else z.coseBase=X(z.layoutBase)})(De,function(U){return(()=>{var z={45:(l,s,h)=>{var L={};L.layoutBase=h(551),L.CoSEConstants=h(806),L.CoSEEdge=h(767),L.CoSEGraph=h(880),L.CoSEGraphManager=h(578),L.CoSELayout=h(765),L.CoSENode=h(991),L.ConstraintHandler=h(902),l.exports=L},806:(l,s,h)=>{var L=h(551).FDLayoutConstants;function a(){}for(var O in L)a[O]=L[O];a.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,a.DEFAULT_RADIAL_SEPARATION=L.DEFAULT_EDGE_LENGTH,a.DEFAULT_COMPONENT_SEPERATION=60,a.TILE=!0,a.TILING_PADDING_VERTICAL=10,a.TILING_PADDING_HORIZONTAL=10,a.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,a.ENFORCE_CONSTRAINTS=!0,a.APPLY_LAYOUT=!0,a.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,a.TREE_REDUCTION_ON_INCREMENTAL=!0,a.PURE_INCREMENTAL=a.DEFAULT_INCREMENTAL,l.exports=a},767:(l,s,h)=>{var L=h(551).FDLayoutEdge;function a(o,i,N){L.call(this,o,i,N)}a.prototype=Object.create(L.prototype);for(var O in L)a[O]=L[O];l.exports=a},880:(l,s,h)=>{var L=h(551).LGraph;function a(o,i,N){L.call(this,o,i,N)}a.prototype=Object.create(L.prototype);for(var O in L)a[O]=L[O];l.exports=a},578:(l,s,h)=>{var L=h(551).LGraphManager;function a(o){L.call(this,o)}a.prototype=Object.create(L.prototype);for(var O in L)a[O]=L[O];l.exports=a},765:(l,s,h)=>{var L=h(551).FDLayout,a=h(578),O=h(880),o=h(991),i=h(767),N=h(806),M=h(902),T=h(551).FDLayoutConstants,W=h(551).LayoutConstants,F=h(551).Point,P=h(551).PointD,H=h(551).DimensionD,J=h(551).Layout,V=h(551).Integer,_=h(551).IGeometry,ot=h(551).LGraph,it=h(551).Transform,pt=h(551).LinkedList;function q(){L.call(this),this.toBeTiled={},this.constraints={}}q.prototype=Object.create(L.prototype);for(var st in L)q[st]=L[st];q.prototype.newGraphManager=function(){var c=new a(this);return this.graphManager=c,c},q.prototype.newGraph=function(c){return new O(null,this.graphManager,c)},q.prototype.newNode=function(c){return new o(this.graphManager,c)},q.prototype.newEdge=function(c){return new i(null,null,c)},q.prototype.initParameters=function(){if(L.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(N.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=N.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=N.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=T.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=T.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=T.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=T.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},q.prototype.initSpringEmbedder=function(){L.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/T.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},q.prototype.layout=function(){var c=W.DEFAULT_CREATE_BENDS_AS_NEEDED;if(c)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},q.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){var c=this.getFlatForest();if(c.length>0)this.positionNodesRadially(c);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var G=new Set(this.getAllNodes()),S=this.nodesWithGravity.filter(function(Y){return G.has(Y)});this.graphManager.setAllNodesToApplyGravitation(S),this.positionNodesRandomly()}}else if(N.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var G=new Set(this.getAllNodes()),S=this.nodesWithGravity.filter(function(Q){return G.has(Q)});this.graphManager.setAllNodesToApplyGravitation(S)}if(Object.keys(this.constraints).length>0)M.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),N.APPLY_LAYOUT)this.runSpringEmbedder();return!0},q.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%T.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(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 c=new Set(this.getAllNodes()),G=this.nodesWithGravity.filter(function(I){return c.has(I)});if(this.graphManager.setAllNodesToApplyGravitation(G),this.graphManager.updateBounds(),this.updateGrid(),N.PURE_INCREMENTAL)this.coolingFactor=T.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=T.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();if(N.PURE_INCREMENTAL)this.coolingFactor=T.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=T.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var S=!this.isTreeGrowing&&!this.isGrowthFinished,Y=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(S,Y),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},q.prototype.getPositionsData=function(){var c=this.graphManager.getAllNodes(),G={};for(var S=0;S<c.length;S++){var Y=c[S].rect,I=c[S].id;G[I]={id:I,x:Y.getCenterX(),y:Y.getCenterY(),w:Y.width,h:Y.height}}return G},q.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var c=!1;if(T.ANIMATE==="during")this.emit("layoutstarted");else{while(!c)c=this.tick();this.graphManager.updateBounds()}},q.prototype.moveNodes=function(){var c=this.getAllNodes(),G;for(var S=0;S<c.length;S++)G=c[S],G.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var S=0;S<c.length;S++)G=c[S],G.move()},q.prototype.initConstraintVariables=function(){var c=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var G=this.graphManager.getAllNodes();for(var S=0;S<G.length;S++){var Y=G[S];this.idToNodeMap.set(Y.id,Y)}var I=function B(at){var ht=at.getChild().getNodes(),mt,Ot=0;for(var Vt=0;Vt<ht.length;Vt++)if(mt=ht[Vt],mt.getChild()==null){if(c.fixedNodeSet.has(mt.id))Ot+=100}else Ot+=B(mt);return Ot};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(ht){c.fixedNodeSet.add(ht.nodeId)});var G=this.graphManager.getAllNodes(),Y;for(var S=0;S<G.length;S++)if(Y=G[S],Y.getChild()!=null){var Q=I(Y);if(Q>0)Y.fixedNodeWeight=Q}}if(this.constraints.relativePlacementConstraint){var k=new Map,rt=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(B){c.fixedNodesOnHorizontal.add(B),c.fixedNodesOnVertical.add(B)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var tt=this.constraints.alignmentConstraint.vertical;for(var S=0;S<tt.length;S++)this.dummyToNodeForVerticalAlignment.set("dummy"+S,[]),tt[S].forEach(function(at){if(k.set(at,"dummy"+S),c.dummyToNodeForVerticalAlignment.get("dummy"+S).push(at),c.fixedNodeSet.has(at))c.fixedNodesOnHorizontal.add("dummy"+S)})}if(this.constraints.alignmentConstraint.horizontal){var j=this.constraints.alignmentConstraint.horizontal;for(var S=0;S<j.length;S++)this.dummyToNodeForHorizontalAlignment.set("dummy"+S,[]),j[S].forEach(function(at){if(rt.set(at,"dummy"+S),c.dummyToNodeForHorizontalAlignment.get("dummy"+S).push(at),c.fixedNodeSet.has(at))c.fixedNodesOnVertical.add("dummy"+S)})}}if(N.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(B){var at,ht,mt;for(mt=B.length-1;mt>=2*B.length/3;mt--)at=Math.floor(Math.random()*(mt+1)),ht=B[mt],B[mt]=B[at],B[at]=ht;return B},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(B){if(B.left){var at=k.has(B.left)?k.get(B.left):B.left,ht=k.has(B.right)?k.get(B.right):B.right;if(!c.nodesInRelativeHorizontal.includes(at))if(c.nodesInRelativeHorizontal.push(at),c.nodeToRelativeConstraintMapHorizontal.set(at,[]),c.dummyToNodeForVerticalAlignment.has(at))c.nodeToTempPositionMapHorizontal.set(at,c.idToNodeMap.get(c.dummyToNodeForVerticalAlignment.get(at)[0]).getCenterX());else c.nodeToTempPositionMapHorizontal.set(at,c.idToNodeMap.get(at).getCenterX());if(!c.nodesInRelativeHorizontal.includes(ht))if(c.nodesInRelativeHorizontal.push(ht),c.nodeToRelativeConstraintMapHorizontal.set(ht,[]),c.dummyToNodeForVerticalAlignment.has(ht))c.nodeToTempPositionMapHorizontal.set(ht,c.idToNodeMap.get(c.dummyToNodeForVerticalAlignment.get(ht)[0]).getCenterX());else c.nodeToTempPositionMapHorizontal.set(ht,c.idToNodeMap.get(ht).getCenterX());c.nodeToRelativeConstraintMapHorizontal.get(at).push({right:ht,gap:B.gap}),c.nodeToRelativeConstraintMapHorizontal.get(ht).push({left:at,gap:B.gap})}else{var mt=rt.has(B.top)?rt.get(B.top):B.top,Ot=rt.has(B.bottom)?rt.get(B.bottom):B.bottom;if(!c.nodesInRelativeVertical.includes(mt))if(c.nodesInRelativeVertical.push(mt),c.nodeToRelativeConstraintMapVertical.set(mt,[]),c.dummyToNodeForHorizontalAlignment.has(mt))c.nodeToTempPositionMapVertical.set(mt,c.idToNodeMap.get(c.dummyToNodeForHorizontalAlignment.get(mt)[0]).getCenterY());else c.nodeToTempPositionMapVertical.set(mt,c.idToNodeMap.get(mt).getCenterY());if(!c.nodesInRelativeVertical.includes(Ot))if(c.nodesInRelativeVertical.push(Ot),c.nodeToRelativeConstraintMapVertical.set(Ot,[]),c.dummyToNodeForHorizontalAlignment.has(Ot))c.nodeToTempPositionMapVertical.set(Ot,c.idToNodeMap.get(c.dummyToNodeForHorizontalAlignment.get(Ot)[0]).getCenterY());else c.nodeToTempPositionMapVertical.set(Ot,c.idToNodeMap.get(Ot).getCenterY());c.nodeToRelativeConstraintMapVertical.get(mt).push({bottom:Ot,gap:B.gap}),c.nodeToRelativeConstraintMapVertical.get(Ot).push({top:mt,gap:B.gap})}});else{var dt=new Map,Nt=new Map;this.constraints.relativePlacementConstraint.forEach(function(B){if(B.left){var at=k.has(B.left)?k.get(B.left):B.left,ht=k.has(B.right)?k.get(B.right):B.right;if(dt.has(at))dt.get(at).push(ht);else dt.set(at,[ht]);if(dt.has(ht))dt.get(ht).push(at);else dt.set(ht,[at])}else{var mt=rt.has(B.top)?rt.get(B.top):B.top,Ot=rt.has(B.bottom)?rt.get(B.bottom):B.bottom;if(Nt.has(mt))Nt.get(mt).push(Ot);else Nt.set(mt,[Ot]);if(Nt.has(Ot))Nt.get(Ot).push(mt);else Nt.set(Ot,[mt])}});var et=function(at,ht){var mt=[],Ot=[],Vt=new pt,_t=new Set,yt=0;return at.forEach(function(ne,kt){if(!_t.has(kt)){mt[yt]=[],Ot[yt]=!1;var At=kt;Vt.push(At),_t.add(At),mt[yt].push(At);while(Vt.length!=0){if(At=Vt.shift(),ht.has(At))Ot[yt]=!0;var Lt=at.get(At);Lt.forEach(function(Gt){if(!_t.has(Gt))Vt.push(Gt),_t.add(Gt),mt[yt].push(Gt)})}yt++}}),{components:mt,isFixed:Ot}},Tt=et(dt,c.fixedNodesOnHorizontal);this.componentsOnHorizontal=Tt.components,this.fixedComponentsOnHorizontal=Tt.isFixed;var ct=et(Nt,c.fixedNodesOnVertical);this.componentsOnVertical=ct.components,this.fixedComponentsOnVertical=ct.isFixed}}},q.prototype.updateDisplacements=function(){var c=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(ct){var B=c.idToNodeMap.get(ct.nodeId);B.displacementX=0,B.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var G=this.constraints.alignmentConstraint.vertical;for(var S=0;S<G.length;S++){var Y=0;for(var I=0;I<G[S].length;I++){if(this.fixedNodeSet.has(G[S][I])){Y=0;break}Y+=this.idToNodeMap.get(G[S][I]).displacementX}var Q=Y/G[S].length;for(var I=0;I<G[S].length;I++)this.idToNodeMap.get(G[S][I]).displacementX=Q}}if(this.constraints.alignmentConstraint.horizontal){var k=this.constraints.alignmentConstraint.horizontal;for(var S=0;S<k.length;S++){var rt=0;for(var I=0;I<k[S].length;I++){if(this.fixedNodeSet.has(k[S][I])){rt=0;break}rt+=this.idToNodeMap.get(k[S][I]).displacementY}var tt=rt/k[S].length;for(var I=0;I<k[S].length;I++)this.idToNodeMap.get(k[S][I]).displacementY=tt}}}if(this.constraints.relativePlacementConstraint)if(N.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(ct){if(!c.fixedNodesOnHorizontal.has(ct)){var B=0;if(c.dummyToNodeForVerticalAlignment.has(ct))B=c.idToNodeMap.get(c.dummyToNodeForVerticalAlignment.get(ct)[0]).displacementX;else B=c.idToNodeMap.get(ct).displacementX;if(c.nodeToRelativeConstraintMapHorizontal.get(ct).forEach(function(at){if(at.right){var ht=c.nodeToTempPositionMapHorizontal.get(at.right)-c.nodeToTempPositionMapHorizontal.get(ct)-B;if(ht<at.gap)B-=at.gap-ht}else{var ht=c.nodeToTempPositionMapHorizontal.get(ct)-c.nodeToTempPositionMapHorizontal.get(at.left)+B;if(ht<at.gap)B+=at.gap-ht}}),c.nodeToTempPositionMapHorizontal.set(ct,c.nodeToTempPositionMapHorizontal.get(ct)+B),c.dummyToNodeForVerticalAlignment.has(ct))c.dummyToNodeForVerticalAlignment.get(ct).forEach(function(at){c.idToNodeMap.get(at).displacementX=B});else c.idToNodeMap.get(ct).displacementX=B}}),this.nodesInRelativeVertical.forEach(function(ct){if(!c.fixedNodesOnHorizontal.has(ct)){var B=0;if(c.dummyToNodeForHorizontalAlignment.has(ct))B=c.idToNodeMap.get(c.dummyToNodeForHorizontalAlignment.get(ct)[0]).displacementY;else B=c.idToNodeMap.get(ct).displacementY;if(c.nodeToRelativeConstraintMapVertical.get(ct).forEach(function(at){if(at.bottom){var ht=c.nodeToTempPositionMapVertical.get(at.bottom)-c.nodeToTempPositionMapVertical.get(ct)-B;if(ht<at.gap)B-=at.gap-ht}else{var ht=c.nodeToTempPositionMapVertical.get(ct)-c.nodeToTempPositionMapVertical.get(at.top)+B;if(ht<at.gap)B+=at.gap-ht}}),c.nodeToTempPositionMapVertical.set(ct,c.nodeToTempPositionMapVertical.get(ct)+B),c.dummyToNodeForHorizontalAlignment.has(ct))c.dummyToNodeForHorizontalAlignment.get(ct).forEach(function(at){c.idToNodeMap.get(at).displacementY=B});else c.idToNodeMap.get(ct).displacementY=B}})}else{for(var S=0;S<this.componentsOnHorizontal.length;S++){var j=this.componentsOnHorizontal[S];if(this.fixedComponentsOnHorizontal[S])for(var I=0;I<j.length;I++)if(this.dummyToNodeForVerticalAlignment.has(j[I]))this.dummyToNodeForVerticalAlignment.get(j[I]).forEach(function(at){c.idToNodeMap.get(at).displacementX=0});else this.idToNodeMap.get(j[I]).displacementX=0;else{var dt=0,Nt=0;for(var I=0;I<j.length;I++)if(this.dummyToNodeForVerticalAlignment.has(j[I])){var et=this.dummyToNodeForVerticalAlignment.get(j[I]);dt+=et.length*this.idToNodeMap.get(et[0]).displacementX,Nt+=et.length}else dt+=this.idToNodeMap.get(j[I]).displacementX,Nt++;var Tt=dt/Nt;for(var I=0;I<j.length;I++)if(this.dummyToNodeForVerticalAlignment.has(j[I]))this.dummyToNodeForVerticalAlignment.get(j[I]).forEach(function(at){c.idToNodeMap.get(at).displacementX=Tt});else this.idToNodeMap.get(j[I]).displacementX=Tt}}for(var S=0;S<this.componentsOnVertical.length;S++){var j=this.componentsOnVertical[S];if(this.fixedComponentsOnVertical[S])for(var I=0;I<j.length;I++)if(this.dummyToNodeForHorizontalAlignment.has(j[I]))this.dummyToNodeForHorizontalAlignment.get(j[I]).forEach(function(ht){c.idToNodeMap.get(ht).displacementY=0});else this.idToNodeMap.get(j[I]).displacementY=0;else{var dt=0,Nt=0;for(var I=0;I<j.length;I++)if(this.dummyToNodeForHorizontalAlignment.has(j[I])){var et=this.dummyToNodeForHorizontalAlignment.get(j[I]);dt+=et.length*this.idToNodeMap.get(et[0]).displacementY,Nt+=et.length}else dt+=this.idToNodeMap.get(j[I]).displacementY,Nt++;var Tt=dt/Nt;for(var I=0;I<j.length;I++)if(this.dummyToNodeForHorizontalAlignment.has(j[I]))this.dummyToNodeForHorizontalAlignment.get(j[I]).forEach(function(Vt){c.idToNodeMap.get(Vt).displacementY=Tt});else this.idToNodeMap.get(j[I]).displacementY=Tt}}}},q.prototype.calculateNodesToApplyGravitationTo=function(){var c=[],G,S=this.graphManager.getGraphs(),Y=S.length,I;for(I=0;I<Y;I++)if(G=S[I],G.updateConnected(),!G.isConnected)c=c.concat(G.getNodes());return c},q.prototype.createBendpoints=function(){var c=[];c=c.concat(this.graphManager.getAllEdges());var G=new Set,S;for(S=0;S<c.length;S++){var Y=c[S];if(!G.has(Y)){var I=Y.getSource(),Q=Y.getTarget();if(I==Q)Y.getBendpoints().push(new P),Y.getBendpoints().push(new P),this.createDummyNodesForBendpoints(Y),G.add(Y);else{var k=[];if(k=k.concat(I.getEdgeListToNode(Q)),k=k.concat(Q.getEdgeListToNode(I)),!G.has(k[0])){if(k.length>1){var rt;for(rt=0;rt<k.length;rt++){var tt=k[rt];tt.getBendpoints().push(new P),this.createDummyNodesForBendpoints(tt)}}k.forEach(function(j){G.add(j)})}}}if(G.size==c.length)break}},q.prototype.positionNodesRadially=function(c){var G=new F(0,0),S=Math.ceil(Math.sqrt(c.length)),Y=0,I=0,Q=0,k=new P(0,0);for(var rt=0;rt<c.length;rt++){if(rt%S==0){if(Q=0,I=Y,rt!=0)I+=N.DEFAULT_COMPONENT_SEPERATION;Y=0}var tt=c[rt],j=J.findCenterOfTree(tt);if(G.x=Q,G.y=I,k=q.radialLayout(tt,j,G),k.y>Y)Y=Math.floor(k.y);Q=Math.floor(k.x+N.DEFAULT_COMPONENT_SEPERATION)}this.transform(new P(W.WORLD_CENTER_X-k.x/2,W.WORLD_CENTER_Y-k.y/2))},q.radialLayout=function(c,G,S){var Y=Math.max(this.maxDiagonalInTree(c),N.DEFAULT_RADIAL_SEPARATION);q.branchRadialLayout(G,null,0,359,0,Y);var I=ot.calculateBounds(c),Q=new it;Q.setDeviceOrgX(I.getMinX()),Q.setDeviceOrgY(I.getMinY()),Q.setWorldOrgX(S.x),Q.setWorldOrgY(S.y);for(var k=0;k<c.length;k++){var rt=c[k];rt.transform(Q)}var tt=new P(I.getMaxX(),I.getMaxY());return Q.inverseTransformPoint(tt)},q.branchRadialLayout=function(c,G,S,Y,I,Q){var k=(Y-S+1)/2;if(k<0)k+=180;var rt=(k+S)%360,tt=rt*_.TWO_PI/360,j=Math.cos(tt),dt=I*Math.cos(tt),Nt=I*Math.sin(tt);c.setCenter(dt,Nt);var et=[];et=et.concat(c.getEdges());var Tt=et.length;if(G!=null)Tt--;var ct=0,B=et.length,at,ht=c.getEdgesBetween(G);while(ht.length>1){var mt=ht[0];ht.splice(0,1);var Ot=et.indexOf(mt);if(Ot>=0)et.splice(Ot,1);B--,Tt--}if(G!=null)at=(et.indexOf(ht[0])+1)%B;else at=0;var Vt=Math.abs(Y-S)/Tt;for(var _t=at;ct!=Tt;_t=++_t%B){var yt=et[_t].getOtherEnd(c);if(yt==G)continue;var ne=(S+ct*Vt)%360,kt=(ne+Vt)%360;q.branchRadialLayout(yt,c,ne,kt,I+Q,Q),ct++}},q.maxDiagonalInTree=function(c){var G=V.MIN_VALUE;for(var S=0;S<c.length;S++){var Y=c[S],I=Y.getDiagonal();if(I>G)G=I}return G},q.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},q.prototype.groupZeroDegreeMembers=function(){var c=this,G={};this.memberGroups={},this.idToDummyNode={};var S=[],Y=this.graphManager.getAllNodes();for(var I=0;I<Y.length;I++){var Q=Y[I],k=Q.getParent();if(this.getNodeDegreeWithChildren(Q)===0&&(k.id==null||!this.getToBeTiled(k)))S.push(Q)}for(var I=0;I<S.length;I++){var Q=S[I],rt=Q.getParent().id;if(typeof G[rt]>"u")G[rt]=[];G[rt]=G[rt].concat(Q)}Object.keys(G).forEach(function(tt){if(G[tt].length>1){var j="DummyCompound_"+tt;c.memberGroups[j]=G[tt];var dt=G[tt][0].getParent(),Nt=new o(c.graphManager);Nt.id=j,Nt.paddingLeft=dt.paddingLeft||0,Nt.paddingRight=dt.paddingRight||0,Nt.paddingBottom=dt.paddingBottom||0,Nt.paddingTop=dt.paddingTop||0,c.idToDummyNode[j]=Nt;var et=c.getGraphManager().add(c.newGraph(),Nt),Tt=dt.getChild();Tt.add(Nt);for(var ct=0;ct<G[tt].length;ct++){var B=G[tt][ct];Tt.remove(B),et.add(B)}}})},q.prototype.clearCompounds=function(){var c={},G={};this.performDFSOnCompounds();for(var S=0;S<this.compoundOrder.length;S++)G[this.compoundOrder[S].id]=this.compoundOrder[S],c[this.compoundOrder[S].id]=[].concat(this.compoundOrder[S].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[S].getChild()),this.compoundOrder[S].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(c,G)},q.prototype.clearZeroDegreeMembers=function(){var c=this,G=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(S){var Y=c.idToDummyNode[S];if(G[S]=c.tileNodes(c.memberGroups[S],Y.paddingLeft+Y.paddingRight),Y.rect.width=G[S].width,Y.rect.height=G[S].height,Y.setCenter(G[S].centerX,G[S].centerY),Y.labelMarginLeft=0,Y.labelMarginTop=0,N.NODE_DIMENSIONS_INCLUDE_LABELS){var I=Y.rect.width,Q=Y.rect.height;if(Y.labelWidth){if(Y.labelPosHorizontal=="left")Y.rect.x-=Y.labelWidth,Y.setWidth(I+Y.labelWidth),Y.labelMarginLeft=Y.labelWidth;else if(Y.labelPosHorizontal=="center"&&Y.labelWidth>I)Y.rect.x-=(Y.labelWidth-I)/2,Y.setWidth(Y.labelWidth),Y.labelMarginLeft=(Y.labelWidth-I)/2;else if(Y.labelPosHorizontal=="right")Y.setWidth(I+Y.labelWidth)}if(Y.labelHeight){if(Y.labelPosVertical=="top")Y.rect.y-=Y.labelHeight,Y.setHeight(Q+Y.labelHeight),Y.labelMarginTop=Y.labelHeight;else if(Y.labelPosVertical=="center"&&Y.labelHeight>Q)Y.rect.y-=(Y.labelHeight-Q)/2,Y.setHeight(Y.labelHeight),Y.labelMarginTop=(Y.labelHeight-Q)/2;else if(Y.labelPosVertical=="bottom")Y.setHeight(Q+Y.labelHeight)}}})},q.prototype.repopulateCompounds=function(){for(var c=this.compoundOrder.length-1;c>=0;c--){var G=this.compoundOrder[c],{id:S,paddingLeft:Y,paddingTop:I,labelMarginLeft:Q,labelMarginTop:k}=G;this.adjustLocations(this.tiledMemberPack[S],G.rect.x,G.rect.y,Y,I,Q,k)}},q.prototype.repopulateZeroDegreeMembers=function(){var c=this,G=this.tiledZeroDegreePack;Object.keys(G).forEach(function(S){var Y=c.idToDummyNode[S],{paddingLeft:I,paddingTop:Q,labelMarginLeft:k,labelMarginTop:rt}=Y;c.adjustLocations(G[S],Y.rect.x,Y.rect.y,I,Q,k,rt)})},q.prototype.getToBeTiled=function(c){var G=c.id;if(this.toBeTiled[G]!=null)return this.toBeTiled[G];var S=c.getChild();if(S==null)return this.toBeTiled[G]=!1,!1;var Y=S.getNodes();for(var I=0;I<Y.length;I++){var Q=Y[I];if(this.getNodeDegree(Q)>0)return this.toBeTiled[G]=!1,!1;if(Q.getChild()==null){this.toBeTiled[Q.id]=!1;continue}if(!this.getToBeTiled(Q))return this.toBeTiled[G]=!1,!1}return this.toBeTiled[G]=!0,!0},q.prototype.getNodeDegree=function(c){var G=c.id,S=c.getEdges(),Y=0;for(var I=0;I<S.length;I++){var Q=S[I];if(Q.getSource().id!==Q.getTarget().id)Y=Y+1}return Y},q.prototype.getNodeDegreeWithChildren=function(c){var G=this.getNodeDegree(c);if(c.getChild()==null)return G;var S=c.getChild().getNodes();for(var Y=0;Y<S.length;Y++){var I=S[Y];G+=this.getNodeDegreeWithChildren(I)}return G},q.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},q.prototype.fillCompexOrderByDFS=function(c){for(var G=0;G<c.length;G++){var S=c[G];if(S.getChild()!=null)this.fillCompexOrderByDFS(S.getChild().getNodes());if(this.getToBeTiled(S))this.compoundOrder.push(S)}},q.prototype.adjustLocations=function(c,G,S,Y,I,Q,k){G+=Y+Q,S+=I+k;var rt=G;for(var tt=0;tt<c.rows.length;tt++){var j=c.rows[tt];G=rt;var dt=0;for(var Nt=0;Nt<j.length;Nt++){var et=j[Nt];if(et.rect.x=G,et.rect.y=S,G+=et.rect.width+c.horizontalPadding,et.rect.height>dt)dt=et.rect.height}S+=dt+c.verticalPadding}},q.prototype.tileCompoundMembers=function(c,G){var S=this;this.tiledMemberPack=[],Object.keys(c).forEach(function(Y){var I=G[Y];if(S.tiledMemberPack[Y]=S.tileNodes(c[Y],I.paddingLeft+I.paddingRight),I.rect.width=S.tiledMemberPack[Y].width,I.rect.height=S.tiledMemberPack[Y].height,I.setCenter(S.tiledMemberPack[Y].centerX,S.tiledMemberPack[Y].centerY),I.labelMarginLeft=0,I.labelMarginTop=0,N.NODE_DIMENSIONS_INCLUDE_LABELS){var Q=I.rect.width,k=I.rect.height;if(I.labelWidth){if(I.labelPosHorizontal=="left")I.rect.x-=I.labelWidth,I.setWidth(Q+I.labelWidth),I.labelMarginLeft=I.labelWidth;else if(I.labelPosHorizontal=="center"&&I.labelWidth>Q)I.rect.x-=(I.labelWidth-Q)/2,I.setWidth(I.labelWidth),I.labelMarginLeft=(I.labelWidth-Q)/2;else if(I.labelPosHorizontal=="right")I.setWidth(Q+I.labelWidth)}if(I.labelHeight){if(I.labelPosVertical=="top")I.rect.y-=I.labelHeight,I.setHeight(k+I.labelHeight),I.labelMarginTop=I.labelHeight;else if(I.labelPosVertical=="center"&&I.labelHeight>k)I.rect.y-=(I.labelHeight-k)/2,I.setHeight(I.labelHeight),I.labelMarginTop=(I.labelHeight-k)/2;else if(I.labelPosVertical=="bottom")I.setHeight(k+I.labelHeight)}}})},q.prototype.tileNodes=function(c,G){var S=this.tileNodesByFavoringDim(c,G,!0),Y=this.tileNodesByFavoringDim(c,G,!1),I=this.getOrgRatio(S),Q=this.getOrgRatio(Y),k;if(Q<I)k=Y;else k=S;return k},q.prototype.getOrgRatio=function(c){var{width:G,height:S}=c,Y=G/S;if(Y<1)Y=1/Y;return Y},q.prototype.calcIdealRowWidth=function(c,G){var{TILING_PADDING_VERTICAL:S,TILING_PADDING_HORIZONTAL:Y}=N,I=c.length,Q=0,k=0,rt=0;c.forEach(function(ct){if(Q+=ct.getWidth(),k+=ct.getHeight(),ct.getWidth()>rt)rt=ct.getWidth()});var tt=Q/I,j=k/I,dt=Math.pow(S-Y,2)+4*(tt+Y)*(j+S)*I,Nt=(Y-S+Math.sqrt(dt))/(2*(tt+Y)),et;if(G){if(et=Math.ceil(Nt),et==Nt)et++}else et=Math.floor(Nt);var Tt=et*(tt+Y)-Y;if(rt>Tt)Tt=rt;return Tt+=Y*2,Tt},q.prototype.tileNodesByFavoringDim=function(c,G,S){var{TILING_PADDING_VERTICAL:Y,TILING_PADDING_HORIZONTAL:I,TILING_COMPARE_BY:Q}=N,k={rows:[],rowWidth:[],rowHeight:[],width:0,height:G,verticalPadding:Y,horizontalPadding:I,centerX:0,centerY:0};if(Q)k.idealRowWidth=this.calcIdealRowWidth(c,S);var rt=function(B){return B.rect.width*B.rect.height},tt=function(B,at){return rt(at)-rt(B)};c.sort(function(ct,B){var at=tt;if(k.idealRowWidth)return at=Q,at(ct.id,B.id);return at(ct,B)});var j=0,dt=0;for(var Nt=0;Nt<c.length;Nt++){var et=c[Nt];j+=et.getCenterX(),dt+=et.getCenterY()}k.centerX=j/c.length,k.centerY=dt/c.length;for(var Nt=0;Nt<c.length;Nt++){var et=c[Nt];if(k.rows.length==0)this.insertNodeToRow(k,et,0,G);else if(this.canAddHorizontal(k,et.rect.width,et.rect.height)){var Tt=k.rows.length-1;if(!k.idealRowWidth)Tt=this.getShortestRowIndex(k);this.insertNodeToRow(k,et,Tt,G)}else this.insertNodeToRow(k,et,k.rows.length,G);this.shiftToLastRow(k)}return k},q.prototype.insertNodeToRow=function(c,G,S,Y){var I=Y;if(S==c.rows.length){var Q=[];c.rows.push(Q),c.rowWidth.push(I),c.rowHeight.push(0)}var k=c.rowWidth[S]+G.rect.width;if(c.rows[S].length>0)k+=c.horizontalPadding;if(c.rowWidth[S]=k,c.width<k)c.width=k;var rt=G.rect.height;if(S>0)rt+=c.verticalPadding;var tt=0;if(rt>c.rowHeight[S])tt=c.rowHeight[S],c.rowHeight[S]=rt,tt=c.rowHeight[S]-tt;c.height+=tt,c.rows[S].push(G)},q.prototype.getShortestRowIndex=function(c){var G=-1,S=Number.MAX_VALUE;for(var Y=0;Y<c.rows.length;Y++)if(c.rowWidth[Y]<S)G=Y,S=c.rowWidth[Y];return G},q.prototype.getLongestRowIndex=function(c){var G=-1,S=Number.MIN_VALUE;for(var Y=0;Y<c.rows.length;Y++)if(c.rowWidth[Y]>S)G=Y,S=c.rowWidth[Y];return G},q.prototype.canAddHorizontal=function(c,G,S){if(c.idealRowWidth){var Y=c.rows.length-1,I=c.rowWidth[Y];return I+G+c.horizontalPadding<=c.idealRowWidth}var Q=this.getShortestRowIndex(c);if(Q<0)return!0;var k=c.rowWidth[Q];if(k+c.horizontalPadding+G<=c.width)return!0;var rt=0;if(c.rowHeight[Q]<S){if(Q>0)rt=S+c.verticalPadding-c.rowHeight[Q]}var tt;if(c.width-k>=G+c.horizontalPadding)tt=(c.height+rt)/(k+G+c.horizontalPadding);else tt=(c.height+rt)/c.width;rt=S+c.verticalPadding;var j;if(c.width<G)j=(c.height+rt)/G;else j=(c.height+rt)/c.width;if(j<1)j=1/j;if(tt<1)tt=1/tt;return tt<j},q.prototype.shiftToLastRow=function(c){var G=this.getLongestRowIndex(c),S=c.rowWidth.length-1,Y=c.rows[G],I=Y[Y.length-1],Q=I.width+c.horizontalPadding;if(c.width-c.rowWidth[S]>Q&&G!=S){Y.splice(-1,1),c.rows[S].push(I),c.rowWidth[G]=c.rowWidth[G]-Q,c.rowWidth[S]=c.rowWidth[S]+Q,c.width=c.rowWidth[instance.getLongestRowIndex(c)];var k=Number.MIN_VALUE;for(var rt=0;rt<Y.length;rt++)if(Y[rt].height>k)k=Y[rt].height;if(G>0)k+=c.verticalPadding;var tt=c.rowHeight[G]+c.rowHeight[S];if(c.rowHeight[G]=k,c.rowHeight[S]<I.height+c.verticalPadding)c.rowHeight[S]=I.height+c.verticalPadding;var j=c.rowHeight[G]+c.rowHeight[S];c.height+=j-tt,this.shiftToLastRow(c)}},q.prototype.tilingPreLayout=function(){if(N.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},q.prototype.tilingPostLayout=function(){if(N.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},q.prototype.reduceTrees=function(){var c=[],G=!0,S;while(G){var Y=this.graphManager.getAllNodes(),I=[];G=!1;for(var Q=0;Q<Y.length;Q++)if(S=Y[Q],S.getEdges().length==1&&!S.getEdges()[0].isInterGraph&&S.getChild()==null){if(N.PURE_INCREMENTAL){var k=S.getEdges()[0].getOtherEnd(S),rt=new H(S.getCenterX()-k.getCenterX(),S.getCenterY()-k.getCenterY());I.push([S,S.getEdges()[0],S.getOwner(),rt])}else I.push([S,S.getEdges()[0],S.getOwner()]);G=!0}if(G==!0){var tt=[];for(var j=0;j<I.length;j++)if(I[j][0].getEdges().length==1)tt.push(I[j]),I[j][0].getOwner().remove(I[j][0]);c.push(tt),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=c},q.prototype.growTree=function(c){var G=c.length,S=c[G-1],Y;for(var I=0;I<S.length;I++)Y=S[I],this.findPlaceforPrunedNode(Y),Y[2].add(Y[0]),Y[2].add(Y[1],Y[1].source,Y[1].target);c.splice(c.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},q.prototype.findPlaceforPrunedNode=function(c){var G,S,Y=c[0];if(Y==c[1].source)S=c[1].target;else S=c[1].source;if(N.PURE_INCREMENTAL)Y.setCenter(S.getCenterX()+c[3].getWidth(),S.getCenterY()+c[3].getHeight());else{var I=S.startX,Q=S.finishX,k=S.startY,rt=S.finishY,tt=0,j=0,dt=0,Nt=0,et=[tt,dt,j,Nt];if(k>0)for(var Tt=I;Tt<=Q;Tt++)et[0]+=this.grid[Tt][k-1].length+this.grid[Tt][k].length-1;if(Q<this.grid.length-1)for(var Tt=k;Tt<=rt;Tt++)et[1]+=this.grid[Q+1][Tt].length+this.grid[Q][Tt].length-1;if(rt<this.grid[0].length-1)for(var Tt=I;Tt<=Q;Tt++)et[2]+=this.grid[Tt][rt+1].length+this.grid[Tt][rt].length-1;if(I>0)for(var Tt=k;Tt<=rt;Tt++)et[3]+=this.grid[I-1][Tt].length+this.grid[I][Tt].length-1;var ct=V.MAX_VALUE,B,at;for(var ht=0;ht<et.length;ht++)if(et[ht]<ct)ct=et[ht],B=1,at=ht;else if(et[ht]==ct)B++;if(B==3&&ct==0){if(et[0]==0&&et[1]==0&&et[2]==0)G=1;else if(et[0]==0&&et[1]==0&&et[3]==0)G=0;else if(et[0]==0&&et[2]==0&&et[3]==0)G=3;else if(et[1]==0&&et[2]==0&&et[3]==0)G=2}else if(B==2&&ct==0){var mt=Math.floor(Math.random()*2);if(et[0]==0&&et[1]==0)if(mt==0)G=0;else G=1;else if(et[0]==0&&et[2]==0)if(mt==0)G=0;else G=2;else if(et[0]==0&&et[3]==0)if(mt==0)G=0;else G=3;else if(et[1]==0&&et[2]==0)if(mt==0)G=1;else G=2;else if(et[1]==0&&et[3]==0)if(mt==0)G=1;else G=3;else if(mt==0)G=2;else G=3}else if(B==4&&ct==0){var mt=Math.floor(Math.random()*4);G=mt}else G=at;if(G==0)Y.setCenter(S.getCenterX(),S.getCenterY()-S.getHeight()/2-T.DEFAULT_EDGE_LENGTH-Y.getHeight()/2);else if(G==1)Y.setCenter(S.getCenterX()+S.getWidth()/2+T.DEFAULT_EDGE_LENGTH+Y.getWidth()/2,S.getCenterY());else if(G==2)Y.setCenter(S.getCenterX(),S.getCenterY()+S.getHeight()/2+T.DEFAULT_EDGE_LENGTH+Y.getHeight()/2);else Y.setCenter(S.getCenterX()-S.getWidth()/2-T.DEFAULT_EDGE_LENGTH-Y.getWidth()/2,S.getCenterY())}},l.exports=q},991:(l,s,h)=>{var L=h(551).FDLayoutNode,a=h(551).IMath;function O(i,N,M,T){L.call(this,i,N,M,T)}O.prototype=Object.create(L.prototype);for(var o in L)O[o]=L[o];O.prototype.calculateDisplacement=function(){var i=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=i.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=i.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=i.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=i.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>i.coolingFactor*i.maxNodeDisplacement)this.displacementX=i.coolingFactor*i.maxNodeDisplacement*a.sign(this.displacementX);if(Math.abs(this.displacementY)>i.coolingFactor*i.maxNodeDisplacement)this.displacementY=i.coolingFactor*i.maxNodeDisplacement*a.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},O.prototype.propogateDisplacementToChildren=function(i,N){var M=this.getChild().getNodes(),T;for(var W=0;W<M.length;W++)if(T=M[W],T.getChild()==null)T.displacementX+=i,T.displacementY+=N;else T.propogateDisplacementToChildren(i,N)},O.prototype.move=function(){var i=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),i.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},O.prototype.setPred1=function(i){this.pred1=i},O.prototype.getPred1=function(){return pred1},O.prototype.getPred2=function(){return pred2},O.prototype.setNext=function(i){this.next=i},O.prototype.getNext=function(){return next},O.prototype.setProcessed=function(i){this.processed=i},O.prototype.isProcessed=function(){return processed},l.exports=O},902:(l,s,h)=>{function L(M){if(Array.isArray(M)){for(var T=0,W=Array(M.length);T<M.length;T++)W[T]=M[T];return W}else return Array.from(M)}var a=h(806),O=h(551).LinkedList,o=h(551).Matrix,i=h(551).SVD;function N(){}N.handleConstraints=function(M){var T={};T.fixedNodeConstraint=M.constraints.fixedNodeConstraint,T.alignmentConstraint=M.constraints.alignmentConstraint,T.relativePlacementConstraint=M.constraints.relativePlacementConstraint;var W=new Map,F=new Map,P=[],H=[],J=M.getAllNodes(),V=0;for(var _=0;_<J.length;_++){var ot=J[_];if(ot.getChild()==null)F.set(ot.id,V++),P.push(ot.getCenterX()),H.push(ot.getCenterY()),W.set(ot.id,ot)}if(T.relativePlacementConstraint)T.relativePlacementConstraint.forEach(function(nt){if(!nt.gap&&nt.gap!=0)if(nt.left)nt.gap=a.DEFAULT_EDGE_LENGTH+W.get(nt.left).getWidth()/2+W.get(nt.right).getWidth()/2;else nt.gap=a.DEFAULT_EDGE_LENGTH+W.get(nt.top).getHeight()/2+W.get(nt.bottom).getHeight()/2});var it=function(lt,ft){return{x:lt.x-ft.x,y:lt.y-ft.y}},pt=function(lt){var ft=0,gt=0;return lt.forEach(function(ut){ft+=P[F.get(ut)],gt+=H[F.get(ut)]}),{x:ft/lt.size,y:gt/lt.size}},q=function(lt,ft,gt,ut,Et){function Ft(Dt,Mt){var bt=new Set(Dt),Ct=!0,It=!1,te=void 0;try{for(var Jt=Mt[Symbol.iterator](),fe;!(Ct=(fe=Jt.next()).done);Ct=!0){var Qt=fe.value;bt.add(Qt)}}catch(Wt){It=!0,te=Wt}finally{try{if(!Ct&&Jt.return)Jt.return()}finally{if(It)throw te}}return bt}var Rt=new Map;lt.forEach(function(Dt,Mt){Rt.set(Mt,0)}),lt.forEach(function(Dt,Mt){Dt.forEach(function(bt){Rt.set(bt.id,Rt.get(bt.id)+1)})});var vt=new Map,xt=new Map,St=new O;if(Rt.forEach(function(Dt,Mt){if(Dt==0){if(St.push(Mt),!gt)if(ft=="horizontal")vt.set(Mt,F.has(Mt)?P[F.get(Mt)]:ut.get(Mt));else vt.set(Mt,F.has(Mt)?H[F.get(Mt)]:ut.get(Mt))}else vt.set(Mt,Number.NEGATIVE_INFINITY);if(gt)xt.set(Mt,new Set([Mt]))}),gt)Et.forEach(function(Dt){var Mt=[];if(Dt.forEach(function(It){if(gt.has(It))Mt.push(It)}),Mt.length>0){var bt=0;Mt.forEach(function(It){if(ft=="horizontal")vt.set(It,F.has(It)?P[F.get(It)]:ut.get(It)),bt+=vt.get(It);else vt.set(It,F.has(It)?H[F.get(It)]:ut.get(It)),bt+=vt.get(It)}),bt=bt/Mt.length,Dt.forEach(function(It){if(!gt.has(It))vt.set(It,bt)})}else{var Ct=0;Dt.forEach(function(It){if(ft=="horizontal")Ct+=F.has(It)?P[F.get(It)]:ut.get(It);else Ct+=F.has(It)?H[F.get(It)]:ut.get(It)}),Ct=Ct/Dt.length,Dt.forEach(function(It){vt.set(It,Ct)})}});var wt=function(){var Mt=St.shift(),bt=lt.get(Mt);bt.forEach(function(Ct){if(vt.get(Ct.id)<vt.get(Mt)+Ct.gap)if(gt&&gt.has(Ct.id)){var It=void 0;if(ft=="horizontal")It=F.has(Ct.id)?P[F.get(Ct.id)]:ut.get(Ct.id);else It=F.has(Ct.id)?H[F.get(Ct.id)]:ut.get(Ct.id);if(vt.set(Ct.id,It),It<vt.get(Mt)+Ct.gap){var te=vt.get(Mt)+Ct.gap-It;xt.get(Mt).forEach(function(Jt){vt.set(Jt,vt.get(Jt)-te)})}}else vt.set(Ct.id,vt.get(Mt)+Ct.gap);if(Rt.set(Ct.id,Rt.get(Ct.id)-1),Rt.get(Ct.id)==0)St.push(Ct.id);if(gt)xt.set(Ct.id,Ft(xt.get(Mt),xt.get(Ct.id)))})};while(St.length!=0)wt();if(gt){var Pt=new Set;lt.forEach(function(Dt,Mt){if(Dt.length==0)Pt.add(Mt)});var $t=[];xt.forEach(function(Dt,Mt){if(Pt.has(Mt)){var bt=!1,Ct=!0,It=!1,te=void 0;try{for(var Jt=Dt[Symbol.iterator](),fe;!(Ct=(fe=Jt.next()).done);Ct=!0){var Qt=fe.value;if(gt.has(Qt))bt=!0}}catch(jt){It=!0,te=jt}finally{try{if(!Ct&&Jt.return)Jt.return()}finally{if(It)throw te}}if(!bt){var Wt=!1,ue=void 0;if($t.forEach(function(jt,se){if(jt.has([].concat(L(Dt))[0]))Wt=!0,ue=se}),!Wt)$t.push(new Set(Dt));else Dt.forEach(function(jt){$t[ue].add(jt)})}}}),$t.forEach(function(Dt,Mt){var{POSITIVE_INFINITY:bt,POSITIVE_INFINITY:Ct,NEGATIVE_INFINITY:It,NEGATIVE_INFINITY:te}=Number,Jt=!0,fe=!1,Qt=void 0;try{for(var Wt=Dt[Symbol.iterator](),ue;!(Jt=(ue=Wt.next()).done);Jt=!0){var jt=ue.value,se=void 0;if(ft=="horizontal")se=F.has(jt)?P[F.get(jt)]:ut.get(jt);else se=F.has(jt)?H[F.get(jt)]:ut.get(jt);var ce=vt.get(jt);if(se<bt)bt=se;if(se>It)It=se;if(ce<Ct)Ct=ce;if(ce>te)te=ce}}catch(Le){fe=!0,Qt=Le}finally{try{if(!Jt&&Wt.return)Wt.return()}finally{if(fe)throw Qt}}var be=(bt+It)/2-(Ct+te)/2,pe=!0,me=!1,Ee=void 0;try{for(var ye=Dt[Symbol.iterator](),Se;!(pe=(Se=ye.next()).done);pe=!0){var Ne=Se.value;vt.set(Ne,vt.get(Ne)+be)}}catch(Le){me=!0,Ee=Le}finally{try{if(!pe&&ye.return)ye.return()}finally{if(me)throw Ee}}})}return vt},st=function(lt){var ft=0,gt=0,ut=0,Et=0;if(lt.forEach(function(xt){if(xt.left)P[F.get(xt.left)]-P[F.get(xt.right)]>=0?ft++:gt++;else H[F.get(xt.top)]-H[F.get(xt.bottom)]>=0?ut++:Et++}),ft>gt&&ut>Et)for(var Ft=0;Ft<F.size;Ft++)P[Ft]=-1*P[Ft],H[Ft]=-1*H[Ft];else if(ft>gt)for(var Rt=0;Rt<F.size;Rt++)P[Rt]=-1*P[Rt];else if(ut>Et)for(var vt=0;vt<F.size;vt++)H[vt]=-1*H[vt]},c=function(lt){var ft=[],gt=new O,ut=new Set,Et=0;return lt.forEach(function(Ft,Rt){if(!ut.has(Rt)){ft[Et]=[];var vt=Rt;gt.push(vt),ut.add(vt),ft[Et].push(vt);while(gt.length!=0){vt=gt.shift();var xt=lt.get(vt);xt.forEach(function(St){if(!ut.has(St.id))gt.push(St.id),ut.add(St.id),ft[Et].push(St.id)})}Et++}}),ft},G=function(lt){var ft=new Map;return lt.forEach(function(gt,ut){ft.set(ut,[])}),lt.forEach(function(gt,ut){gt.forEach(function(Et){ft.get(ut).push(Et),ft.get(Et.id).push({id:ut,gap:Et.gap,direction:Et.direction})})}),ft},S=function(lt){var ft=new Map;return lt.forEach(function(gt,ut){ft.set(ut,[])}),lt.forEach(function(gt,ut){gt.forEach(function(Et){ft.get(Et.id).push({id:ut,gap:Et.gap,direction:Et.direction})})}),ft},Y=[],I=[],Q=!1,k=!1,rt=new Set,tt=new Map,j=new Map,dt=[];if(T.fixedNodeConstraint)T.fixedNodeConstraint.forEach(function(nt){rt.add(nt.nodeId)});if(T.relativePlacementConstraint)T.relativePlacementConstraint.forEach(function(nt){if(nt.left){if(tt.has(nt.left))tt.get(nt.left).push({id:nt.right,gap:nt.gap,direction:"horizontal"});else tt.set(nt.left,[{id:nt.right,gap:nt.gap,direction:"horizontal"}]);if(!tt.has(nt.right))tt.set(nt.right,[])}else{if(tt.has(nt.top))tt.get(nt.top).push({id:nt.bottom,gap:nt.gap,direction:"vertical"});else tt.set(nt.top,[{id:nt.bottom,gap:nt.gap,direction:"vertical"}]);if(!tt.has(nt.bottom))tt.set(nt.bottom,[])}}),j=G(tt),dt=c(j);if(a.TRANSFORM_ON_CONSTRAINT_HANDLING){if(T.fixedNodeConstraint&&T.fixedNodeConstraint.length>1)T.fixedNodeConstraint.forEach(function(nt,lt){Y[lt]=[nt.position.x,nt.position.y],I[lt]=[P[F.get(nt.nodeId)],H[F.get(nt.nodeId)]]}),Q=!0;else if(T.alignmentConstraint)(function(){var nt=0;if(T.alignmentConstraint.vertical){var lt=T.alignmentConstraint.vertical,ft=function(vt){var xt=new Set;lt[vt].forEach(function(Pt){xt.add(Pt)});var St=new Set([].concat(L(xt)).filter(function(Pt){return rt.has(Pt)})),wt=void 0;if(St.size>0)wt=P[F.get(St.values().next().value)];else wt=pt(xt).x;lt[vt].forEach(function(Pt){Y[nt]=[wt,H[F.get(Pt)]],I[nt]=[P[F.get(Pt)],H[F.get(Pt)]],nt++})};for(var gt=0;gt<lt.length;gt++)ft(gt);Q=!0}if(T.alignmentConstraint.horizontal){var ut=T.alignmentConstraint.horizontal,Et=function(vt){var xt=new Set;ut[vt].forEach(function(Pt){xt.add(Pt)});var St=new Set([].concat(L(xt)).filter(function(Pt){return rt.has(Pt)})),wt=void 0;if(St.size>0)wt=P[F.get(St.values().next().value)];else wt=pt(xt).y;ut[vt].forEach(function(Pt){Y[nt]=[P[F.get(Pt)],wt],I[nt]=[P[F.get(Pt)],H[F.get(Pt)]],nt++})};for(var Ft=0;Ft<ut.length;Ft++)Et(Ft);Q=!0}if(T.relativePlacementConstraint)k=!0})();else if(T.relativePlacementConstraint){var Nt=0,et=0;for(var Tt=0;Tt<dt.length;Tt++)if(dt[Tt].length>Nt)Nt=dt[Tt].length,et=Tt;if(Nt<j.size/2)st(T.relativePlacementConstraint),Q=!1,k=!1;else{var ct=new Map,B=new Map,at=[];dt[et].forEach(function(nt){tt.get(nt).forEach(function(lt){if(lt.direction=="horizontal"){if(ct.has(nt))ct.get(nt).push(lt);else ct.set(nt,[lt]);if(!ct.has(lt.id))ct.set(lt.id,[]);at.push({left:nt,right:lt.id})}else{if(B.has(nt))B.get(nt).push(lt);else B.set(nt,[lt]);if(!B.has(lt.id))B.set(lt.id,[]);at.push({top:nt,bottom:lt.id})}})}),st(at),k=!1;var ht=q(ct,"horizontal"),mt=q(B,"vertical");dt[et].forEach(function(nt,lt){if(I[lt]=[P[F.get(nt)],H[F.get(nt)]],Y[lt]=[],ht.has(nt))Y[lt][0]=ht.get(nt);else Y[lt][0]=P[F.get(nt)];if(mt.has(nt))Y[lt][1]=mt.get(nt);else Y[lt][1]=H[F.get(nt)]}),Q=!0}}if(Q){var Ot=void 0,Vt=o.transpose(Y),_t=o.transpose(I);for(var yt=0;yt<Vt.length;yt++)Vt[yt]=o.multGamma(Vt[yt]),_t[yt]=o.multGamma(_t[yt]);var ne=o.multMat(Vt,o.transpose(_t)),kt=i.svd(ne);Ot=o.multMat(kt.V,o.transpose(kt.U));for(var At=0;At<F.size;At++){var Lt=[P[At],H[At]],Gt=[Ot[0][0],Ot[1][0]],Yt=[Ot[0][1],Ot[1][1]];P[At]=o.dotProduct(Lt,Gt),H[At]=o.dotProduct(Lt,Yt)}if(k)st(T.relativePlacementConstraint)}}if(a.ENFORCE_CONSTRAINTS){if(T.fixedNodeConstraint&&T.fixedNodeConstraint.length>0){var zt={x:0,y:0};T.fixedNodeConstraint.forEach(function(nt,lt){var ft={x:P[F.get(nt.nodeId)],y:H[F.get(nt.nodeId)]},gt=nt.position,ut=it(gt,ft);zt.x+=ut.x,zt.y+=ut.y}),zt.x/=T.fixedNodeConstraint.length,zt.y/=T.fixedNodeConstraint.length,P.forEach(function(nt,lt){P[lt]+=zt.x}),H.forEach(function(nt,lt){H[lt]+=zt.y}),T.fixedNodeConstraint.forEach(function(nt){P[F.get(nt.nodeId)]=nt.position.x,H[F.get(nt.nodeId)]=nt.position.y})}if(T.alignmentConstraint){if(T.alignmentConstraint.vertical){var Xt=T.alignmentConstraint.vertical,Ht=function(lt){var ft=new Set;Xt[lt].forEach(function(Et){ft.add(Et)});var gt=new Set([].concat(L(ft)).filter(function(Et){return rt.has(Et)})),ut=void 0;if(gt.size>0)ut=P[F.get(gt.values().next().value)];else ut=pt(ft).x;ft.forEach(function(Et){if(!rt.has(Et))P[F.get(Et)]=ut})};for(var qt=0;qt<Xt.length;qt++)Ht(qt)}if(T.alignmentConstraint.horizontal){var Kt=T.alignmentConstraint.horizontal,le=function(lt){var ft=new Set;Kt[lt].forEach(function(Et){ft.add(Et)});var gt=new Set([].concat(L(ft)).filter(function(Et){return rt.has(Et)})),ut=void 0;if(gt.size>0)ut=H[F.get(gt.values().next().value)];else ut=pt(ft).y;ft.forEach(function(Et){if(!rt.has(Et))H[F.get(Et)]=ut})};for(var re=0;re<Kt.length;re++)le(re)}}if(T.relativePlacementConstraint)(function(){var nt=new Map,lt=new Map,ft=new Map,gt=new Map,ut=new Map,Et=new Map,Ft=new Set,Rt=new Set;if(rt.forEach(function(ie){Ft.add(ie),Rt.add(ie)}),T.alignmentConstraint){if(T.alignmentConstraint.vertical){var vt=T.alignmentConstraint.vertical,xt=function(Ut){ft.set("dummy"+Ut,[]),vt[Ut].forEach(function(Zt){if(nt.set(Zt,"dummy"+Ut),ft.get("dummy"+Ut).push(Zt),rt.has(Zt))Ft.add("dummy"+Ut)}),ut.set("dummy"+Ut,P[F.get(vt[Ut][0])])};for(var St=0;St<vt.length;St++)xt(St)}if(T.alignmentConstraint.horizontal){var wt=T.alignmentConstraint.horizontal,Pt=function(Ut){gt.set("dummy"+Ut,[]),wt[Ut].forEach(function(Zt){if(lt.set(Zt,"dummy"+Ut),gt.get("dummy"+Ut).push(Zt),rt.has(Zt))Rt.add("dummy"+Ut)}),Et.set("dummy"+Ut,H[F.get(wt[Ut][0])])};for(var $t=0;$t<wt.length;$t++)Pt($t)}}var Dt=new Map,Mt=new Map,bt=function(Ut){tt.get(Ut).forEach(function(Zt){var de=void 0,ge=void 0;if(Zt.direction=="horizontal"){if(de=nt.get(Ut)?nt.get(Ut):Ut,nt.get(Zt.id))ge={id:nt.get(Zt.id),gap:Zt.gap,direction:Zt.direction};else ge=Zt;if(Dt.has(de))Dt.get(de).push(ge);else Dt.set(de,[ge]);if(!Dt.has(ge.id))Dt.set(ge.id,[])}else{if(de=lt.get(Ut)?lt.get(Ut):Ut,lt.get(Zt.id))ge={id:lt.get(Zt.id),gap:Zt.gap,direction:Zt.direction};else ge=Zt;if(Mt.has(de))Mt.get(de).push(ge);else Mt.set(de,[ge]);if(!Mt.has(ge.id))Mt.set(ge.id,[])}})},Ct=!0,It=!1,te=void 0;try{for(var Jt=tt.keys()[Symbol.iterator](),fe;!(Ct=(fe=Jt.next()).done);Ct=!0){var Qt=fe.value;bt(Qt)}}catch(ie){It=!0,te=ie}finally{try{if(!Ct&&Jt.return)Jt.return()}finally{if(It)throw te}}var Wt=G(Dt),ue=G(Mt),jt=c(Wt),se=c(ue),ce=S(Dt),be=S(Mt),pe=[],me=[];jt.forEach(function(ie,Ut){pe[Ut]=[],ie.forEach(function(Zt){if(ce.get(Zt).length==0)pe[Ut].push(Zt)})}),se.forEach(function(ie,Ut){me[Ut]=[],ie.forEach(function(Zt){if(be.get(Zt).length==0)me[Ut].push(Zt)})});var Ee=q(Dt,"horizontal",Ft,ut,pe),ye=q(Mt,"vertical",Rt,Et,me),Se=function(Ut){if(ft.get(Ut))ft.get(Ut).forEach(function(Zt){P[F.get(Zt)]=Ee.get(Ut)});else P[F.get(Ut)]=Ee.get(Ut)},Ne=!0,Le=!1,ke=void 0;try{for(var Pe=Ee.keys()[Symbol.iterator](),qe;!(Ne=(qe=Pe.next()).done);Ne=!0){var Ge=qe.value;Se(Ge)}}catch(ie){Le=!0,ke=ie}finally{try{if(!Ne&&Pe.return)Pe.return()}finally{if(Le)throw ke}}var vr=function(Ut){if(gt.get(Ut))gt.get(Ut).forEach(function(Zt){H[F.get(Zt)]=ye.get(Ut)});else H[F.get(Ut)]=ye.get(Ut)},Ue=!0,Qe=!1,Je=void 0;try{for(var Ye=ye.keys()[Symbol.iterator](),Ke;!(Ue=(Ke=Ye.next()).done);Ue=!0){var Ge=Ke.value;vr(Ge)}}catch(ie){Qe=!0,Je=ie}finally{try{if(!Ue&&Ye.return)Ye.return()}finally{if(Qe)throw Je}}})()}for(var ae=0;ae<J.length;ae++){var ee=J[ae];if(ee.getChild()==null)ee.setCenter(P[F.get(ee.id)],H[F.get(ee.id)])}},l.exports=N},551:(l)=>{l.exports=U}},X={};function C(l){var s=X[l];if(s!==void 0)return s.exports;var h=X[l]={exports:{}};return z[l](h,h.exports,C),h.exports}var y=C(45);return y})()})});var je=oe(function(Oe,ze){(function(z,X){if(typeof Oe==="object"&&typeof ze==="object")ze.exports=X(Ve());else if(typeof define==="function"&&define.amd)define(["cose-base"],X);else if(typeof Oe==="object")Oe.cytoscapeFcose=X(Ve());else z.cytoscapeFcose=X(z.coseBase)})(Oe,function(U){return(()=>{var z={658:(l)=>{l.exports=Object.assign!=null?Object.assign.bind(Object):function(s){for(var h=arguments.length,L=Array(h>1?h-1:0),a=1;a<h;a++)L[a-1]=arguments[a];return L.forEach(function(O){Object.keys(O).forEach(function(o){return s[o]=O[o]})}),s}},548:(l,s,h)=>{var L=function(){function o(i,N){var M=[],T=!0,W=!1,F=void 0;try{for(var P=i[Symbol.iterator](),H;!(T=(H=P.next()).done);T=!0)if(M.push(H.value),N&&M.length===N)break}catch(J){W=!0,F=J}finally{try{if(!T&&P.return)P.return()}finally{if(W)throw F}}return M}return function(i,N){if(Array.isArray(i))return i;else if(Symbol.iterator in Object(i))return o(i,N);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=h(140).layoutBase.LinkedList,O={};O.getTopMostNodes=function(o){var i={};for(var N=0;N<o.length;N++)i[o[N].id()]=!0;var M=o.filter(function(T,W){if(typeof T==="number")T=W;var F=T.parent()[0];while(F!=null){if(i[F.id()])return!1;F=F.parent()[0]}return!0});return M},O.connectComponents=function(o,i,N,M){var T=new a,W=new Set,F=[],P=void 0,H=void 0,J=void 0,V=!1,_=1,ot=[],it=[],pt=function(){var st=o.collection();it.push(st);var c=N[0],G=o.collection();G.merge(c).merge(c.descendants().intersection(i)),F.push(c),G.forEach(function(I){T.push(I),W.add(I),st.merge(I)});var S=function(){c=T.shift();var Q=o.collection();c.neighborhood().nodes().forEach(function(j){if(i.intersection(c.edgesWith(j)).length>0)Q.merge(j)});for(var k=0;k<Q.length;k++){var rt=Q[k];if(P=N.intersection(rt.union(rt.ancestors())),P!=null&&!W.has(P[0])){var tt=P.union(P.descendants());tt.forEach(function(j){if(T.push(j),W.add(j),st.merge(j),N.has(j))F.push(j)})}}};while(T.length!=0)S();if(st.forEach(function(I){i.intersection(I.connectedEdges()).forEach(function(Q){if(st.has(Q.source())&&st.has(Q.target()))st.merge(Q)})}),F.length==N.length)V=!0;if(!V||V&&_>1){H=F[0],J=H.connectedEdges().length,F.forEach(function(I){if(I.connectedEdges().length<J)J=I.connectedEdges().length,H=I}),ot.push(H.id());var Y=o.collection();Y.merge(F[0]),F.forEach(function(I){Y.merge(I)}),F=[],N=N.difference(Y),_++}};do pt();while(!V);if(M){if(ot.length>0)M.set("dummy"+(M.size+1),ot)}return it},O.relocateComponent=function(o,i,N){if(!N.fixedNodeConstraint){var{POSITIVE_INFINITY:M,NEGATIVE_INFINITY:T,POSITIVE_INFINITY:W,NEGATIVE_INFINITY:F}=Number;if(N.quality=="draft"){var P=!0,H=!1,J=void 0;try{for(var V=i.nodeIndexes[Symbol.iterator](),_;!(P=(_=V.next()).done);P=!0){var ot=_.value,it=L(ot,2),pt=it[0],q=it[1],st=N.cy.getElementById(pt);if(st){var c=st.boundingBox(),G=i.xCoords[q]-c.w/2,S=i.xCoords[q]+c.w/2,Y=i.yCoords[q]-c.h/2,I=i.yCoords[q]+c.h/2;if(G<M)M=G;if(S>T)T=S;if(Y<W)W=Y;if(I>F)F=I}}}catch(j){H=!0,J=j}finally{try{if(!P&&V.return)V.return()}finally{if(H)throw J}}var Q=o.x-(T+M)/2,k=o.y-(F+W)/2;i.xCoords=i.xCoords.map(function(j){return j+Q}),i.yCoords=i.yCoords.map(function(j){return j+k})}else{Object.keys(i).forEach(function(j){var dt=i[j],Nt=dt.getRect().x,et=dt.getRect().x+dt.getRect().width,Tt=dt.getRect().y,ct=dt.getRect().y+dt.getRect().height;if(Nt<M)M=Nt;if(et>T)T=et;if(Tt<W)W=Tt;if(ct>F)F=ct});var rt=o.x-(T+M)/2,tt=o.y-(F+W)/2;Object.keys(i).forEach(function(j){var dt=i[j];dt.setCenter(dt.getCenterX()+rt,dt.getCenterY()+tt)})}}},O.calcBoundingBox=function(o,i,N,M){var{MAX_SAFE_INTEGER:T,MIN_SAFE_INTEGER:W,MAX_SAFE_INTEGER:F,MIN_SAFE_INTEGER:P}=Number,H=void 0,J=void 0,V=void 0,_=void 0,ot=o.descendants().not(":parent"),it=ot.length;for(var pt=0;pt<it;pt++){var q=ot[pt];if(H=i[M.get(q.id())]-q.width()/2,J=i[M.get(q.id())]+q.width()/2,V=N[M.get(q.id())]-q.height()/2,_=N[M.get(q.id())]+q.height()/2,T>H)T=H;if(W<J)W=J;if(F>V)F=V;if(P<_)P=_}var st={};return st.topLeftX=T,st.topLeftY=F,st.width=W-T,st.height=P-F,st},O.calcParentsWithoutChildren=function(o,i){var N=o.collection();return i.nodes(":parent").forEach(function(M){var T=!1;if(M.children().forEach(function(W){if(W.css("display")!="none")T=!0}),!T)N.merge(M)}),N},l.exports=O},816:(l,s,h)=>{var L=h(548),a=h(140).CoSELayout,O=h(140).CoSENode,o=h(140).layoutBase.PointD,i=h(140).layoutBase.DimensionD,N=h(140).layoutBase.LayoutConstants,M=h(140).layoutBase.FDLayoutConstants,T=h(140).CoSEConstants,W=function(P,H){var{cy:J,eles:V}=P,_=V.nodes(),ot=V.edges(),it=void 0,pt=void 0,q=void 0,st={};if(P.randomize)it=H.nodeIndexes,pt=H.xCoords,q=H.yCoords;var c=function(j){return typeof j==="function"},G=function(j,dt){if(c(j))return j(dt);else return j},S=L.calcParentsWithoutChildren(J,V),Y=function tt(j,dt,Nt,et){var Tt=dt.length;for(var ct=0;ct<Tt;ct++){var B=dt[ct],at=null;if(B.intersection(S).length==0)at=B.children();var ht=void 0,mt=B.layoutDimensions({nodeDimensionsIncludeLabels:et.nodeDimensionsIncludeLabels});if(B.outerWidth()!=null&&B.outerHeight()!=null)if(et.randomize)if(!B.isParent())ht=j.add(new O(Nt.graphManager,new o(pt[it.get(B.id())]-mt.w/2,q[it.get(B.id())]-mt.h/2),new i(parseFloat(mt.w),parseFloat(mt.h))));else{var Ot=L.calcBoundingBox(B,pt,q,it);if(B.intersection(S).length==0)ht=j.add(new O(Nt.graphManager,new o(Ot.topLeftX,Ot.topLeftY),new i(Ot.width,Ot.height)));else ht=j.add(new O(Nt.graphManager,new o(Ot.topLeftX,Ot.topLeftY),new i(parseFloat(mt.w),parseFloat(mt.h))))}else ht=j.add(new O(Nt.graphManager,new o(B.position("x")-mt.w/2,B.position("y")-mt.h/2),new i(parseFloat(mt.w),parseFloat(mt.h))));else ht=j.add(new O(this.graphManager));if(ht.id=B.data("id"),ht.nodeRepulsion=G(et.nodeRepulsion,B),ht.paddingLeft=parseInt(B.css("padding")),ht.paddingTop=parseInt(B.css("padding")),ht.paddingRight=parseInt(B.css("padding")),ht.paddingBottom=parseInt(B.css("padding")),et.nodeDimensionsIncludeLabels)ht.labelWidth=B.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,ht.labelHeight=B.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,ht.labelPosVertical=B.css("text-valign"),ht.labelPosHorizontal=B.css("text-halign");if(st[B.data("id")]=ht,isNaN(ht.rect.x))ht.rect.x=0;if(isNaN(ht.rect.y))ht.rect.y=0;if(at!=null&&at.length>0){var Vt=void 0;Vt=Nt.getGraphManager().add(Nt.newGraph(),ht),tt(Vt,at,Nt,et)}}},I=function(j,dt,Nt){var et=0,Tt=0;for(var ct=0;ct<Nt.length;ct++){var B=Nt[ct],at=st[B.data("source")],ht=st[B.data("target")];if(at&&ht&&at!==ht&&at.getEdgesBetween(ht).length==0){var mt=dt.add(j.newEdge(),at,ht);mt.id=B.id(),mt.idealLength=G(P.idealEdgeLength,B),mt.edgeElasticity=G(P.edgeElasticity,B),et+=mt.idealLength,Tt++}}if(P.idealEdgeLength!=null){if(Tt>0)T.DEFAULT_EDGE_LENGTH=M.DEFAULT_EDGE_LENGTH=et/Tt;else if(!c(P.idealEdgeLength))T.DEFAULT_EDGE_LENGTH=M.DEFAULT_EDGE_LENGTH=P.idealEdgeLength;else T.DEFAULT_EDGE_LENGTH=M.DEFAULT_EDGE_LENGTH=50;T.MIN_REPULSION_DIST=M.MIN_REPULSION_DIST=M.DEFAULT_EDGE_LENGTH/10,T.DEFAULT_RADIAL_SEPARATION=M.DEFAULT_EDGE_LENGTH}},Q=function(j,dt){if(dt.fixedNodeConstraint)j.constraints.fixedNodeConstraint=dt.fixedNodeConstraint;if(dt.alignmentConstraint)j.constraints.alignmentConstraint=dt.alignmentConstraint;if(dt.relativePlacementConstraint)j.constraints.relativePlacementConstraint=dt.relativePlacementConstraint};if(P.nestingFactor!=null)T.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=M.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=P.nestingFactor;if(P.gravity!=null)T.DEFAULT_GRAVITY_STRENGTH=M.DEFAULT_GRAVITY_STRENGTH=P.gravity;if(P.numIter!=null)T.MAX_ITERATIONS=M.MAX_ITERATIONS=P.numIter;if(P.gravityRange!=null)T.DEFAULT_GRAVITY_RANGE_FACTOR=M.DEFAULT_GRAVITY_RANGE_FACTOR=P.gravityRange;if(P.gravityCompound!=null)T.DEFAULT_COMPOUND_GRAVITY_STRENGTH=M.DEFAULT_COMPOUND_GRAVITY_STRENGTH=P.gravityCompound;if(P.gravityRangeCompound!=null)T.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=M.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=P.gravityRangeCompound;if(P.initialEnergyOnIncremental!=null)T.DEFAULT_COOLING_FACTOR_INCREMENTAL=M.DEFAULT_COOLING_FACTOR_INCREMENTAL=P.initialEnergyOnIncremental;if(P.tilingCompareBy!=null)T.TILING_COMPARE_BY=P.tilingCompareBy;if(P.quality=="proof")N.QUALITY=2;else N.QUALITY=0;if(T.NODE_DIMENSIONS_INCLUDE_LABELS=M.NODE_DIMENSIONS_INCLUDE_LABELS=N.NODE_DIMENSIONS_INCLUDE_LABELS=P.nodeDimensionsIncludeLabels,T.DEFAULT_INCREMENTAL=M.DEFAULT_INCREMENTAL=N.DEFAULT_INCREMENTAL=!P.randomize,T.ANIMATE=M.ANIMATE=N.ANIMATE=P.animate,T.TILE=P.tile,T.TILING_PADDING_VERTICAL=typeof P.tilingPaddingVertical==="function"?P.tilingPaddingVertical.call():P.tilingPaddingVertical,T.TILING_PADDING_HORIZONTAL=typeof P.tilingPaddingHorizontal==="function"?P.tilingPaddingHorizontal.call():P.tilingPaddingHorizontal,T.DEFAULT_INCREMENTAL=M.DEFAULT_INCREMENTAL=N.DEFAULT_INCREMENTAL=!0,T.PURE_INCREMENTAL=!P.randomize,N.DEFAULT_UNIFORM_LEAF_NODE_SIZES=P.uniformNodeDimensions,P.step=="transformed")T.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,T.ENFORCE_CONSTRAINTS=!1,T.APPLY_LAYOUT=!1;if(P.step=="enforced")T.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,T.ENFORCE_CONSTRAINTS=!0,T.APPLY_LAYOUT=!1;if(P.step=="cose")T.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,T.ENFORCE_CONSTRAINTS=!1,T.APPLY_LAYOUT=!0;if(P.step=="all"){if(P.randomize)T.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else T.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;T.ENFORCE_CONSTRAINTS=!0,T.APPLY_LAYOUT=!0}if(P.fixedNodeConstraint||P.alignmentConstraint||P.relativePlacementConstraint)T.TREE_REDUCTION_ON_INCREMENTAL=!1;else T.TREE_REDUCTION_ON_INCREMENTAL=!0;var k=new a,rt=k.newGraphManager();return Y(rt.addRoot(),L.getTopMostNodes(_),k,P),I(k,rt,ot),Q(k,P),k.runLayout(),st};l.exports={coseLayout:W}},212:(l,s,h)=>{var L=function(){function P(H,J){for(var V=0;V<J.length;V++){var _=J[V];if(_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _)_.writable=!0;Object.defineProperty(H,_.key,_)}}return function(H,J,V){if(J)P(H.prototype,J);if(V)P(H,V);return H}}();function a(P,H){if(!(P instanceof H))throw TypeError("Cannot call a class as a function")}var O=h(658),o=h(548),i=h(657),N=i.spectralLayout,M=h(816),T=M.coseLayout,W=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function(H){return 4500},idealEdgeLength:function(H){return 50},edgeElasticity:function(H){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),F=function(){function P(H){a(this,P),this.options=O({},W,H)}return L(P,[{key:"run",value:function(){var J=this,V=this.options,{cy:_,eles:ot}=V,it=[],pt=void 0,q=void 0,st=[],c=void 0,G=[];if(V.fixedNodeConstraint&&(!Array.isArray(V.fixedNodeConstraint)||V.fixedNodeConstraint.length==0))V.fixedNodeConstraint=void 0;if(V.alignmentConstraint){if(V.alignmentConstraint.vertical&&(!Array.isArray(V.alignmentConstraint.vertical)||V.alignmentConstraint.vertical.length==0))V.alignmentConstraint.vertical=void 0;if(V.alignmentConstraint.horizontal&&(!Array.isArray(V.alignmentConstraint.horizontal)||V.alignmentConstraint.horizontal.length==0))V.alignmentConstraint.horizontal=void 0}if(V.relativePlacementConstraint&&(!Array.isArray(V.relativePlacementConstraint)||V.relativePlacementConstraint.length==0))V.relativePlacementConstraint=void 0;var S=V.fixedNodeConstraint||V.alignmentConstraint||V.relativePlacementConstraint;if(S)V.tile=!1,V.packComponents=!1;var Y=void 0,I=!1;if(_.layoutUtilities&&V.packComponents){if(Y=_.layoutUtilities("get"),!Y)Y=_.layoutUtilities();I=!0}if(ot.nodes().length>0)if(!I){var Q=V.eles.boundingBox();if(G.push({x:Q.x1+Q.w/2,y:Q.y1+Q.h/2}),V.randomize){var k=N(V);it.push(k)}if(V.quality=="default"||V.quality=="proof")st.push(T(V,it[0])),o.relocateComponent(G[0],st[0],V);else o.relocateComponent(G[0],it[0],V)}else{var rt=o.getTopMostNodes(V.eles.nodes());if(c=o.connectComponents(_,V.eles,rt),c.forEach(function(At){var Lt=At.boundingBox();G.push({x:Lt.x1+Lt.w/2,y:Lt.y1+Lt.h/2})}),V.randomize)c.forEach(function(At){V.eles=At,it.push(N(V))});if(V.quality=="default"||V.quality=="proof"){var tt=_.collection();if(V.tile){var j=new Map,dt=[],Nt=[],et=0,Tt={nodeIndexes:j,xCoords:dt,yCoords:Nt},ct=[];if(c.forEach(function(At,Lt){if(At.edges().length==0)At.nodes().forEach(function(Gt,Yt){if(tt.merge(At.nodes()[Yt]),!Gt.isParent())Tt.nodeIndexes.set(At.nodes()[Yt].id(),et++),Tt.xCoords.push(At.nodes()[0].position().x),Tt.yCoords.push(At.nodes()[0].position().y)}),ct.push(Lt)}),tt.length>1){var B=tt.boundingBox();G.push({x:B.x1+B.w/2,y:B.y1+B.h/2}),c.push(tt),it.push(Tt);for(var at=ct.length-1;at>=0;at--)c.splice(ct[at],1),it.splice(ct[at],1),G.splice(ct[at],1)}}c.forEach(function(At,Lt){V.eles=At,st.push(T(V,it[Lt])),o.relocateComponent(G[Lt],st[Lt],V)})}else c.forEach(function(At,Lt){o.relocateComponent(G[Lt],it[Lt],V)});var ht=new Set;if(c.length>1){var mt=[],Ot=ot.filter(function(At){return At.css("display")=="none"});c.forEach(function(At,Lt){var Gt=void 0;if(V.quality=="draft")Gt=it[Lt].nodeIndexes;if(At.nodes().not(Ot).length>0){var Yt={};Yt.edges=[],Yt.nodes=[];var zt=void 0;if(At.nodes().not(Ot).forEach(function(Xt){if(V.quality=="draft")if(!Xt.isParent())zt=Gt.get(Xt.id()),Yt.nodes.push({x:it[Lt].xCoords[zt]-Xt.boundingbox().w/2,y:it[Lt].yCoords[zt]-Xt.boundingbox().h/2,width:Xt.boundingbox().w,height:Xt.boundingbox().h});else{var Ht=o.calcBoundingBox(Xt,it[Lt].xCoords,it[Lt].yCoords,Gt);Yt.nodes.push({x:Ht.topLeftX,y:Ht.topLeftY,width:Ht.width,height:Ht.height})}else if(st[Lt][Xt.id()])Yt.nodes.push({x:st[Lt][Xt.id()].getLeft(),y:st[Lt][Xt.id()].getTop(),width:st[Lt][Xt.id()].getWidth(),height:st[Lt][Xt.id()].getHeight()})}),At.edges().forEach(function(Xt){var Ht=Xt.source(),qt=Xt.target();if(Ht.css("display")!="none"&&qt.css("display")!="none"){if(V.quality=="draft"){var Kt=Gt.get(Ht.id()),le=Gt.get(qt.id()),re=[],ae=[];if(Ht.isParent()){var ee=o.calcBoundingBox(Ht,it[Lt].xCoords,it[Lt].yCoords,Gt);re.push(ee.topLeftX+ee.width/2),re.push(ee.topLeftY+ee.height/2)}else re.push(it[Lt].xCoords[Kt]),re.push(it[Lt].yCoords[Kt]);if(qt.isParent()){var nt=o.calcBoundingBox(qt,it[Lt].xCoords,it[Lt].yCoords,Gt);ae.push(nt.topLeftX+nt.width/2),ae.push(nt.topLeftY+nt.height/2)}else ae.push(it[Lt].xCoords[le]),ae.push(it[Lt].yCoords[le]);Yt.edges.push({startX:re[0],startY:re[1],endX:ae[0],endY:ae[1]})}else if(st[Lt][Ht.id()]&&st[Lt][qt.id()])Yt.edges.push({startX:st[Lt][Ht.id()].getCenterX(),startY:st[Lt][Ht.id()].getCenterY(),endX:st[Lt][qt.id()].getCenterX(),endY:st[Lt][qt.id()].getCenterY()})}}),Yt.nodes.length>0)mt.push(Yt),ht.add(Lt)}});var Vt=Y.packComponents(mt,V.randomize).shifts;if(V.quality=="draft")it.forEach(function(At,Lt){var Gt=At.xCoords.map(function(zt){return zt+Vt[Lt].dx}),Yt=At.yCoords.map(function(zt){return zt+Vt[Lt].dy});At.xCoords=Gt,At.yCoords=Yt});else{var _t=0;ht.forEach(function(At){Object.keys(st[At]).forEach(function(Lt){var Gt=st[At][Lt];Gt.setCenter(Gt.getCenterX()+Vt[_t].dx,Gt.getCenterY()+Vt[_t].dy)}),_t++})}}}var yt=function(Lt,Gt){if(V.quality=="default"||V.quality=="proof"){if(typeof Lt==="number")Lt=Gt;var Yt=void 0,zt=void 0,Xt=Lt.data("id");if(st.forEach(function(qt){if(Xt in qt)Yt={x:qt[Xt].getRect().getCenterX(),y:qt[Xt].getRect().getCenterY()},zt=qt[Xt]}),V.nodeDimensionsIncludeLabels){if(zt.labelWidth){if(zt.labelPosHorizontal=="left")Yt.x+=zt.labelWidth/2;else if(zt.labelPosHorizontal=="right")Yt.x-=zt.labelWidth/2}if(zt.labelHeight){if(zt.labelPosVertical=="top")Yt.y+=zt.labelHeight/2;else if(zt.labelPosVertical=="bottom")Yt.y-=zt.labelHeight/2}}if(Yt==null)Yt={x:Lt.position("x"),y:Lt.position("y")};return{x:Yt.x,y:Yt.y}}else{var Ht=void 0;if(it.forEach(function(qt){var Kt=qt.nodeIndexes.get(Lt.id());if(Kt!=null)Ht={x:qt.xCoords[Kt],y:qt.yCoords[Kt]}}),Ht==null)Ht={x:Lt.position("x"),y:Lt.position("y")};return{x:Ht.x,y:Ht.y}}};if(V.quality=="default"||V.quality=="proof"||V.randomize){var ne=o.calcParentsWithoutChildren(_,ot),kt=ot.filter(function(At){return At.css("display")=="none"});if(V.eles=ot.not(kt),ot.nodes().not(":parent").not(kt).layoutPositions(J,V,yt),ne.length>0)ne.forEach(function(At){At.position(yt(At))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),P}();l.exports=F},657:(l,s,h)=>{var L=h(548),a=h(140).layoutBase.Matrix,O=h(140).layoutBase.SVD,o=function(N){var{cy:M,eles:T}=N,W=T.nodes(),F=T.nodes(":parent"),P=new Map,H=new Map,J=new Map,V=[],_=[],ot=[],it=[],pt=[],q=[],st=[],c=[],G=void 0,S=void 0,Y=1e8,I=0.000000001,{piTol:Q,samplingType:k,nodeSeparation:rt}=N,tt=void 0,j=function(){var ft=0,gt=0,ut=!1;while(gt<tt){ft=Math.floor(Math.random()*S),ut=!1;for(var Et=0;Et<gt;Et++)if(it[Et]==ft){ut=!0;break}if(!ut)it[gt]=ft,gt++;else continue}},dt=function(ft,gt,ut){var Et=[],Ft=0,Rt=0,vt=0,xt=void 0,St=[],wt=0,Pt=1;for(var $t=0;$t<S;$t++)St[$t]=Y;Et[Rt]=ft,St[ft]=0;while(Rt>=Ft){vt=Et[Ft++];var Dt=V[vt];for(var Mt=0;Mt<Dt.length;Mt++)if(xt=H.get(Dt[Mt]),St[xt]==Y)St[xt]=St[vt]+1,Et[++Rt]=xt;q[vt][gt]=St[vt]*rt}if(ut){for(var bt=0;bt<S;bt++)if(q[bt][gt]<pt[bt])pt[bt]=q[bt][gt];for(var Ct=0;Ct<S;Ct++)if(pt[Ct]>wt)wt=pt[Ct],Pt=Ct}return Pt},Nt=function(ft){var gt=void 0;if(!ft){j();for(var ut=0;ut<tt;ut++)dt(it[ut],ut,ft,!1)}else{gt=Math.floor(Math.random()*S),G=gt;for(var Et=0;Et<S;Et++)pt[Et]=Y;for(var Ft=0;Ft<tt;Ft++)it[Ft]=gt,gt=dt(gt,Ft,ft)}for(var Rt=0;Rt<S;Rt++)for(var vt=0;vt<tt;vt++)q[Rt][vt]*=q[Rt][vt];for(var xt=0;xt<tt;xt++)st[xt]=[];for(var St=0;St<tt;St++)for(var wt=0;wt<tt;wt++)st[St][wt]=q[it[wt]][St]},et=function(){var ft=O.svd(st),{S:gt,U:ut,V:Et}=ft,Ft=gt[0]*gt[0]*gt[0],Rt=[];for(var vt=0;vt<tt;vt++){Rt[vt]=[];for(var xt=0;xt<tt;xt++)if(Rt[vt][xt]=0,vt==xt)Rt[vt][xt]=gt[vt]/(gt[vt]*gt[vt]+Ft/(gt[vt]*gt[vt]))}c=a.multMat(a.multMat(Et,Rt),a.transpose(ut))},Tt=function(){var ft=void 0,gt=void 0,ut=[],Et=[],Ft=[],Rt=[];for(var vt=0;vt<S;vt++)ut[vt]=Math.random(),Et[vt]=Math.random();ut=a.normalize(ut),Et=a.normalize(Et);var xt=0,St=I,wt=I,Pt=void 0;while(!0){xt++;for(var $t=0;$t<S;$t++)Ft[$t]=ut[$t];if(ut=a.multGamma(a.multL(a.multGamma(Ft),q,c)),ft=a.dotProduct(Ft,ut),ut=a.normalize(ut),St=a.dotProduct(Ft,ut),Pt=Math.abs(St/wt),Pt<=1+Q&&Pt>=1)break;wt=St}for(var Dt=0;Dt<S;Dt++)Ft[Dt]=ut[Dt];xt=0,wt=I;while(!0){xt++;for(var Mt=0;Mt<S;Mt++)Rt[Mt]=Et[Mt];if(Rt=a.minusOp(Rt,a.multCons(Ft,a.dotProduct(Ft,Rt))),Et=a.multGamma(a.multL(a.multGamma(Rt),q,c)),gt=a.dotProduct(Rt,Et),Et=a.normalize(Et),St=a.dotProduct(Rt,Et),Pt=Math.abs(St/wt),Pt<=1+Q&&Pt>=1)break;wt=St}for(var bt=0;bt<S;bt++)Rt[bt]=Et[bt];_=a.multCons(Ft,Math.sqrt(Math.abs(ft))),ot=a.multCons(Rt,Math.sqrt(Math.abs(gt)))};L.connectComponents(M,T,L.getTopMostNodes(W),P),F.forEach(function(lt){L.connectComponents(M,T,L.getTopMostNodes(lt.descendants().intersection(T)),P)});var ct=0;for(var B=0;B<W.length;B++)if(!W[B].isParent())H.set(W[B].id(),ct++);var at=!0,ht=!1,mt=void 0;try{for(var Ot=P.keys()[Symbol.iterator](),Vt;!(at=(Vt=Ot.next()).done);at=!0){var _t=Vt.value;H.set(_t,ct++)}}catch(lt){ht=!0,mt=lt}finally{try{if(!at&&Ot.return)Ot.return()}finally{if(ht)throw mt}}for(var yt=0;yt<H.size;yt++)V[yt]=[];F.forEach(function(lt){var ft=lt.children().intersection(T);while(ft.nodes(":childless").length==0)ft=ft.nodes()[0].children().intersection(T);var gt=0,ut=ft.nodes(":childless")[0].connectedEdges().length;ft.nodes(":childless").forEach(function(Et,Ft){if(Et.connectedEdges().length<ut)ut=Et.connectedEdges().length,gt=Ft}),J.set(lt.id(),ft.nodes(":childless")[gt].id())}),W.forEach(function(lt){var ft=void 0;if(lt.isParent())ft=H.get(J.get(lt.id()));else ft=H.get(lt.id());lt.neighborhood().nodes().forEach(function(gt){if(T.intersection(lt.edgesWith(gt)).length>0)if(gt.isParent())V[ft].push(J.get(gt.id()));else V[ft].push(gt.id())})});var ne=function(ft){var gt=H.get(ft),ut=void 0;P.get(ft).forEach(function(Et){if(M.getElementById(Et).isParent())ut=J.get(Et);else ut=Et;V[gt].push(ut),V[H.get(ut)].push(ft)})},kt=!0,At=!1,Lt=void 0;try{for(var Gt=P.keys()[Symbol.iterator](),Yt;!(kt=(Yt=Gt.next()).done);kt=!0){var zt=Yt.value;ne(zt)}}catch(lt){At=!0,Lt=lt}finally{try{if(!kt&&Gt.return)Gt.return()}finally{if(At)throw Lt}}S=H.size;var Xt=void 0;if(S>2){tt=S<N.sampleSize?S:N.sampleSize;for(var Ht=0;Ht<S;Ht++)q[Ht]=[];for(var qt=0;qt<tt;qt++)c[qt]=[];if(N.quality=="draft"||N.step=="all")Nt(k),et(),Tt(),Xt={nodeIndexes:H,xCoords:_,yCoords:ot};else H.forEach(function(lt,ft){_.push(M.getElementById(ft).position("x")),ot.push(M.getElementById(ft).position("y"))}),Xt={nodeIndexes:H,xCoords:_,yCoords:ot};return Xt}else{var Kt=H.keys(),le=M.getElementById(Kt.next().value),re=le.position(),ae=le.outerWidth();if(_.push(re.x),ot.push(re.y),S==2){var ee=M.getElementById(Kt.next().value),nt=ee.outerWidth();_.push(re.x+ae/2+nt/2+N.idealEdgeLength),ot.push(re.y)}return Xt={nodeIndexes:H,xCoords:_,yCoords:ot},Xt}};l.exports={spectralLayout:o}},579:(l,s,h)=>{var L=h(212),a=function(o){if(!o)return;o("layout","fcose",L)};if(typeof cytoscape<"u")a(cytoscape);l.exports=a},140:(l)=>{l.exports=U}},X={};function C(l){var s=X[l];if(s!==void 0)return s.exports;var h=X[l]={exports:{}};return z[l](h,h.exports,C),h.exports}var y=C(579);return y})()})});var or=K(je(),1);var _e={L:"left",R:"right",T:"top",B:"bottom"},tr={L:e((U)=>`${U},${U/2} 0,${U} 0,0`,"L"),R:e((U)=>`0,${U/2} ${U},0 ${U},${U}`,"R"),T:e((U)=>`0,0 ${U},0 ${U/2},${U}`,"T"),B:e((U)=>`${U/2},0 ${U},${U} 0,${U}`,"B")},Fe={L:e((U,z)=>U-z+2,"L"),R:e((U,z)=>U-2,"R"),T:e((U,z)=>U-z+2,"T"),B:e((U,z)=>U-2,"B")},pr=e(function(U){if(he(U))return U==="L"?"R":"L";else return U==="T"?"B":"T"},"getOppositeArchitectureDirection"),er=e(function(U){let z=U;return z==="L"||z==="R"||z==="T"||z==="B"},"isArchitectureDirection"),he=e(function(U){let z=U;return z==="L"||z==="R"},"isArchitectureDirectionX"),ve=e(function(U){let z=U;return z==="T"||z==="B"},"isArchitectureDirectionY"),Ze=e(function(U,z){let X=he(U)&&ve(z),C=ve(U)&&he(z);return X||C},"isArchitectureDirectionXY"),yr=e(function(U){let z=U[0],X=U[1],C=he(z)&&ve(X),y=ve(z)&&he(X);return C||y},"isArchitecturePairXY"),mr=e(function(U){return U!=="LL"&&U!=="RR"&&U!=="TT"&&U!=="BB"},"isValidArchitectureDirectionPair"),$e=e(function(U,z){let X=`${U}${z}`;return mr(X)?X:void 0},"getArchitectureDirectionPair"),Er=e(function([U,z],X){let C=X[0],y=X[1];if(he(C))if(ve(y))return[U+(C==="L"?-1:1),z+(y==="T"?1:-1)];else return[U+(C==="L"?-1:1),z];else if(he(y))return[U+(y==="L"?1:-1),z+(C==="T"?1:-1)];else return[U,z+(C==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Tr=e(function(U){if(U==="LT"||U==="TL")return[1,1];else if(U==="BL"||U==="LB")return[1,-1];else if(U==="BR"||U==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),Nr=e(function(U,z){if(Ze(U,z))return"bend";else if(he(U))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),Lr=e(function(U){return U.type==="service"},"isArchitectureService"),wr=e(function(U){return U.type==="junction"},"isArchitectureJunction"),rr=e((U,z)=>{let[X,C]=[U,z].sort();return`${JSON.stringify(X)}-${JSON.stringify(C)}`},"architectureGroupAlignmentKey"),ir=e((U)=>U.data(),"edgeData"),Ce=e((U)=>U.data(),"nodeData"),Mr=x.architecture,nr=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=f,this.getAccTitle=p,this.setDiagramTitle=b,this.getDiagramTitle=v,this.getAccDescription=g,this.setAccDescription=m,this.clear()}static{e(this,"ArchitectureDB")}setDiagramId(U){this.diagramId=U}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",d()}addService({id:U,icon:z,in:X,title:C,iconText:y}){if(this.registeredIds.has(U))throw Error(`The service id [${U}] is already in use by another ${this.registeredIds.get(U)}`);if(X!==void 0){if(U===X)throw Error(`The service [${U}] cannot be placed within itself`);if(!this.registeredIds.has(X))throw Error(`The service [${U}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(X)==="node")throw Error(`The service [${U}]'s parent is not a group`)}this.registeredIds.set(U,"node"),this.nodes.set(U,{id:U,type:"service",icon:z,iconText:y,title:C,edges:[],in:X})}getServices(){return[...this.nodes.values()].filter(Lr)}addJunction({id:U,in:z}){if(this.registeredIds.has(U))throw Error(`The junction id [${U}] is already in use by another ${this.registeredIds.get(U)}`);if(z!==void 0){if(U===z)throw Error(`The junction [${U}] cannot be placed within itself`);if(!this.registeredIds.has(z))throw Error(`The junction [${U}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(z)==="node")throw Error(`The junction [${U}]'s parent is not a group`)}this.registeredIds.set(U,"node"),this.nodes.set(U,{id:U,type:"junction",edges:[],in:z})}getJunctions(){return[...this.nodes.values()].filter(wr)}getNodes(){return[...this.nodes.values()]}getNode(U){return this.nodes.get(U)??null}addGroup({id:U,icon:z,in:X,title:C}){if(this.registeredIds.has(U))throw Error(`The group id [${U}] is already in use by another ${this.registeredIds.get(U)}`);if(X!==void 0){if(U===X)throw Error(`The group [${U}] cannot be placed within itself`);if(!this.registeredIds.has(X))throw Error(`The group [${U}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(X)==="node")throw Error(`The group [${U}]'s parent is not a group`)}this.registeredIds.set(U,"group"),this.groups.set(U,{id:U,icon:z,title:C,in:X})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:U,rhsId:z,lhsDir:X,rhsDir:C,lhsInto:y,rhsInto:l,lhsGroup:s,rhsGroup:h,title:L}){if(!er(X))throw Error(`Invalid direction given for left hand side of edge ${U}--${z}. Expected (L,R,T,B) got ${String(X)}`);if(!er(C))throw Error(`Invalid direction given for right hand side of edge ${U}--${z}. Expected (L,R,T,B) got ${String(C)}`);if(!this.nodes.has(U)&&!this.groups.has(U))throw Error(`The left-hand id [${U}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(z)&&!this.groups.has(z))throw Error(`The right-hand id [${z}] does not yet exist. Please create the service/group before declaring an edge to it.`);let a=this.nodes.get(U).in,O=this.nodes.get(z).in;if(s&&a&&O&&a==O)throw Error(`The left-hand id [${U}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(h&&a&&O&&a==O)throw Error(`The right-hand id [${z}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let o={lhsId:U,lhsDir:X,lhsInto:y,lhsGroup:s,rhsId:z,rhsDir:C,rhsInto:l,rhsGroup:h,title:L};this.edges.push(o);let i=this.nodes.get(U),N=this.nodes.get(z);if(i&&N)i.edges.push(this.edges[this.edges.length-1]),N.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(U){if(U.members.length<2)throw Error(`An align directive requires at least two members; got ${U.members.length}`);let z=new Set;U.members.forEach((X)=>{if(this.registeredIds.get(X)!=="node")throw Error(`align ${U.direction} references [${X}], which is not a service or junction`);if(z.has(X))throw Error(`align ${U.direction} lists [${X}] more than once`);z.add(X)}),this.layoutHints.push(U)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let U=new Map,z=new Map;for(let[s,h]of this.nodes.entries()){let L=new Map;for(let a of h.edges){let O=this.getNode(a.lhsId)?.in,o=this.getNode(a.rhsId)?.in;if(O&&o&&O!==o){let i=Nr(a.lhsDir,a.rhsDir);if(i!=="bend")U.set(rr(O,o),i)}if(a.lhsId===s){let i=$e(a.lhsDir,a.rhsDir);if(i)L.set(i,a.rhsId)}else{let i=$e(a.rhsDir,a.lhsDir);if(i)L.set(i,a.lhsId)}}z.set(s,L)}let X=new Set,C=new Set(z.keys()),y=e((s)=>{let h=new Map([[s,[0,0]]]),L=[s];while(L.length>0){let a=L.shift();if(a){X.add(a),C.delete(a);let O=z.get(a);if(!O)throw Error(`BFS error: adjacency list for id ${a} not found. Please report this as a bug.`);let o=h.get(a);if(!o)throw Error(`BFS error: position for id ${a} not found in spatial map. Please report this as a bug.`);let[i,N]=o;O.forEach((M,T)=>{if(!X.has(M))h.set(M,Er([i,N],T)),L.push(M)})}}return h},"BFS"),l=[];while(C.size>0){let s=C.values().next().value;l.push(y(s))}this.dataStructures={adjList:z,spatialMaps:l,groupAlignments:U}}return this.dataStructures}setElementForId(U,z){this.elements.set(U,z)}getElementById(U){return this.elements.get(U)}getConfig(){return E({...Mr,...u().architecture})}getConfigField(U){return this.getConfig()[U]}},Cr=e((U,z)=>{R(U,z),U.groups.map((X)=>z.addGroup(X)),U.services.map((X)=>z.addService({...X,type:"service"})),U.junctions.map((X)=>z.addJunction({...X,type:"junction"})),U.edges.map((X)=>z.addEdge(X)),U.alignments?.map((X)=>z.addLayoutHint({direction:X.direction,members:[...X.members]}))},"populateDb"),ar={parser:{yy:void 0},parse:e(async(U)=>{let z=await D("architecture",U);t.debug(z);let X=ar.parser?.yy;if(!(X instanceof nr))throw 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.");Cr(z,X)},"parse")},Ar=e((U)=>`
2
2
  .edge {
3
3
  stroke-width: ${U.archEdgeWidth};
4
4
  stroke: ${U.archEdgeColor};
@@ -29,8 +29,8 @@ import{R}from"./index-353m7b0p.js";import{e,t,x,u,w,Ie,d,f,p,m,g,b,v,r,n,A,E,Me,
29
29
  display: -webkit-box;
30
30
  -webkit-box-orient: vertical;
31
31
  }
32
- `,"getStyles"),Dr=Ar;function $e(U,z){if(U===0)return z();let X=Math.random,C=U>>>0;Math.random=function(){C=C+1831565813>>>0;let y=C;return y=Math.imul(y^y>>>15,y|1),y^=y+Math.imul(y^y>>>7,y|61),((y^y>>>14)>>>0)/4294967296};try{return z()}finally{Math.random=X}}e($e,"withSeededRandom");var Le=e((U)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${U}</g>`,"wrapIcon"),Oe={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Le('<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:Le('<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:Le('<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:Le('<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:Le('<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:Si,blank:{body:Le("")}}},Or=e(async function(U,z,X,C){let y=X.getConfigField("padding"),l=X.getConfigField("iconSize"),s=l/2,h=l/6,L=h/2;await Promise.all(z.edges().map(async(a)=>{let{source:O,sourceDir:o,sourceArrow:i,sourceGroup:N,target:M,targetDir:T,targetArrow:W,targetGroup:F,label:P}=ir(a),{x:H,y:J}=a[0].sourceEndpoint(),{x:V,y:_}=a[0].midpoint(),{x:ot,y:it}=a[0].targetEndpoint(),pt=y+4;if(N)if(he(o))H+=o==="L"?-pt:pt;else J+=o==="T"?-pt:pt+18;if(F)if(he(T))ot+=T==="L"?-pt:pt;else it+=T==="T"?-pt:pt+18;if(!N&&X.getNode(O)?.type==="junction")if(he(o))H+=o==="L"?s:-s;else J+=o==="T"?s:-s;if(!F&&X.getNode(M)?.type==="junction")if(he(T))ot+=T==="L"?s:-s;else it+=T==="T"?s:-s;if(a[0]._private.rscratch){let q=U.insert("g");if(q.insert("path").attr("d",`M ${H},${J} L ${V},${_} L${ot},${it} `).attr("class","edge").attr("id",`${C}-${Me(O,M,{prefix:"L"})}`),i){let st=he(o)?Se[o](H,h):H-L,c=ve(o)?Se[o](J,h):J-L;q.insert("polygon").attr("points",tr[o](h)).attr("transform",`translate(${st},${c})`).attr("class","arrow")}if(W){let st=he(T)?Se[T](ot,h):ot-L,c=ve(T)?Se[T](it,h):it-L;q.insert("polygon").attr("points",tr[T](h)).attr("transform",`translate(${st},${c})`).attr("class","arrow")}if(P){let st=!Be(o,T)?he(o)?"X":"Y":"XY",c=0;if(st==="X")c=Math.abs(H-ot);else if(st==="Y")c=Math.abs(J-it)/1.5;else c=Math.abs(H-ot)/2;let G=q.append("g");if(await Z(G,P,{useHtmlLabels:!1,width:c,classes:"architecture-service-label"},r()),G.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),st==="X")G.attr("transform","translate("+V+", "+_+")");else if(st==="Y")G.attr("transform","translate("+V+", "+_+") rotate(-90)");else if(st==="XY"){let S=ze(o,T);if(S&&yr(S)){let Y=G.node().getBoundingClientRect(),[I,Q]=Tr(S);G.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*I*Q*45})`);let k=G.node().getBoundingClientRect();G.attr("transform",`
32
+ `,"getStyles"),Dr=Ar;function Be(U,z){if(U===0)return z();let X=Math.random,C=U>>>0;Math.random=function(){C=C+1831565813>>>0;let y=C;return y=Math.imul(y^y>>>15,y|1),y^=y+Math.imul(y^y>>>7,y|61),((y^y>>>14)>>>0)/4294967296};try{return z()}finally{Math.random=X}}e(Be,"withSeededRandom");var we=e((U)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${U}</g>`,"wrapIcon"),xe={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:we('<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:we('<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:we('<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:we('<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:we('<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:Si,blank:{body:we("")}}},Or=e(async function(U,z,X,C){let y=X.getConfigField("padding"),l=X.getConfigField("iconSize"),s=l/2,h=l/6,L=h/2;await Promise.all(z.edges().map(async(a)=>{let{source:O,sourceDir:o,sourceArrow:i,sourceGroup:N,target:M,targetDir:T,targetArrow:W,targetGroup:F,label:P}=ir(a),{x:H,y:J}=a[0].sourceEndpoint(),{x:V,y:_}=a[0].midpoint(),{x:ot,y:it}=a[0].targetEndpoint(),pt=y+4;if(N)if(he(o))H+=o==="L"?-pt:pt;else J+=o==="T"?-pt:pt+18;if(F)if(he(T))ot+=T==="L"?-pt:pt;else it+=T==="T"?-pt:pt+18;if(!N&&X.getNode(O)?.type==="junction")if(he(o))H+=o==="L"?s:-s;else J+=o==="T"?s:-s;if(!F&&X.getNode(M)?.type==="junction")if(he(T))ot+=T==="L"?s:-s;else it+=T==="T"?s:-s;if(a[0]._private.rscratch){let q=U.insert("g");if(q.insert("path").attr("d",`M ${H},${J} L ${V},${_} L${ot},${it} `).attr("class","edge").attr("id",`${C}-${Me(O,M,{prefix:"L"})}`),i){let st=he(o)?Fe[o](H,h):H-L,c=ve(o)?Fe[o](J,h):J-L;q.insert("polygon").attr("points",tr[o](h)).attr("transform",`translate(${st},${c})`).attr("class","arrow")}if(W){let st=he(T)?Fe[T](ot,h):ot-L,c=ve(T)?Fe[T](it,h):it-L;q.insert("polygon").attr("points",tr[T](h)).attr("transform",`translate(${st},${c})`).attr("class","arrow")}if(P){let st=!Ze(o,T)?he(o)?"X":"Y":"XY",c=0;if(st==="X")c=Math.abs(H-ot);else if(st==="Y")c=Math.abs(J-it)/1.5;else c=Math.abs(H-ot)/2;let G=q.append("g");if(await Z(G,P,{useHtmlLabels:!1,width:c,classes:"architecture-service-label"},r()),G.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),st==="X")G.attr("transform","translate("+V+", "+_+")");else if(st==="Y")G.attr("transform","translate("+V+", "+_+") rotate(-90)");else if(st==="XY"){let S=$e(o,T);if(S&&yr(S)){let Y=G.node().getBoundingClientRect(),[I,Q]=Tr(S);G.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*I*Q*45})`);let k=G.node().getBoundingClientRect();G.attr("transform",`
33
33
  translate(${V}, ${_-Y.height/2})
34
34
  translate(${I*k.width/2}, ${Q*k.height/2})
35
35
  rotate(${-1*I*Q*45}, 0, ${Y.height/2})
36
- `)}}}}}))},"drawEdges"),xr=e(async function(U,z,X,C){let l=X.getConfigField("padding")*0.75,s=X.getConfigField("fontSize"),L=X.getConfigField("iconSize")/2;await Promise.all(z.nodes().map(async(a)=>{let O=we(a);if(O.type==="group"){let{h:o,w:i,x1:N,y1:M}=a.boundingBox(),T=U.append("rect");T.attr("id",`${C}-group-${O.id}`).attr("x",N+L).attr("y",M+L).attr("width",i).attr("height",o).attr("class","node-bkg");let W=U.append("g"),F=N,P=M;if(O.icon){let H=W.append("g");H.html(`<g>${await ke(O.icon,{height:l,width:l,fallbackPrefix:Oe.prefix})}</g>`),H.attr("transform","translate("+(F+L+1)+", "+(P+L+1)+")"),F+=l,P+=s/2-1-2}if(O.label){let H=W.append("g");await Z(H,O.label,{useHtmlLabels:!1,width:i,classes:"architecture-service-label"},r()),H.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),H.attr("transform","translate("+(F+L+4)+", "+(P+L+2)+")")}X.setElementForId(O.id,T)}}))},"drawGroups"),Ir=e(async function(U,z,X,C){let y=r();for(let l of X){let s=z.append("g"),h=U.getConfigField("iconSize");if(l.title){let o=s.append("g");await Z(o,l.title,{useHtmlLabels:!1,width:h*1.5,classes:"architecture-service-label"},y),o.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),o.attr("transform","translate("+h/2+", "+h+")")}let L=s.append("g");if(l.icon)L.html(`<g>${await ke(l.icon,{height:h,width:h,fallbackPrefix:Oe.prefix})}</g>`);else if(l.iconText){L.html(`<g>${await ke("blank",{height:h,width:h,fallbackPrefix:Oe.prefix})}</g>`);let N=L.append("g").append("foreignObject").attr("width",h).attr("height",h).append("div").attr("class","node-icon-text").attr("style",`height: ${h}px;`).append("div").html(w(l.iconText,y)),M=parseInt(window.getComputedStyle(N.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;N.attr("style",`-webkit-line-clamp: ${Math.floor((h-2)/M)};`)}else L.append("path").attr("class","node-bkg").attr("id",`${C}-node-${l.id}`).attr("d",`M0,${h} V5 Q0,0 5,0 H${h-5} Q${h},0 ${h},5 V${h} Z`);s.attr("id",`${C}-service-${l.id}`).attr("class","architecture-service");let{width:a,height:O}=s.node().getBBox();l.width=a,l.height=O,U.setElementForId(l.id,s)}return 0},"drawServices"),Rr=e(function(U,z,X,C){X.forEach((y)=>{let l=z.append("g"),s=U.getConfigField("iconSize");l.append("g").append("rect").attr("id",`${C}-node-${y.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),l.attr("class","architecture-junction");let{width:L,height:a}=l._groups[0][0].getBBox();l.width=L,l.height=a,U.setElementForId(y.id,l)})},"drawJunctions");Bt([{name:Oe.prefix,icons:Oe}]);Re.use(or.default);function sr(U,z,X){U.forEach((C)=>{z.add({group:"nodes",data:{type:"service",id:C.id,icon:C.icon,label:C.title,parent:C.in,width:X.getConfigField("iconSize"),height:X.getConfigField("iconSize")},classes:"node-service"})})}e(sr,"addServices");function hr(U,z,X){U.forEach((C)=>{z.add({group:"nodes",data:{type:"junction",id:C.id,parent:C.in,width:X.getConfigField("iconSize"),height:X.getConfigField("iconSize")},classes:"node-junction"})})}e(hr,"addJunctions");function lr(U,z){z.nodes().map((X)=>{let C=we(X);if(C.type==="group")return;C.x=X.position().x,C.y=X.position().y,U.getElementById(C.id).attr("transform","translate("+(C.x||0)+","+(C.y||0)+")")})}e(lr,"positionNodes");function fr(U,z){U.forEach((X)=>{z.add({group:"nodes",data:{type:"group",id:X.id,icon:X.icon,label:X.title,parent:X.in},classes:"node-group"})})}e(fr,"addGroups");function cr(U,z){U.forEach((X)=>{let{lhsId:C,rhsId:y,lhsInto:l,lhsGroup:s,rhsInto:h,lhsDir:L,rhsDir:a,rhsGroup:O,title:o}=X,i=Be(X.lhsDir,X.rhsDir)?"segments":"straight",N={id:`${C}-${y}`,label:o,source:C,sourceDir:L,sourceArrow:l,sourceGroup:s,sourceEndpoint:L==="L"?"0 50%":L==="R"?"100% 50%":L==="T"?"50% 0":"50% 100%",target:y,targetDir:a,targetArrow:h,targetGroup:O,targetEndpoint:a==="L"?"0 50%":a==="R"?"100% 50%":a==="T"?"50% 0":"50% 100%"};z.add({group:"edges",data:N,classes:i})})}e(cr,"addEdges");function gr(U,z,X,C=[]){let y=e((i,N)=>{let M=new Map;for(let[T,W]of i.entries()){let F=`${T}`,P=0,H=[...W.entries()];if(H.length===1){M.set(F,H[0][1]);continue}for(let J=0;J<H.length-1;J++)for(let V=J+1;V<H.length;V++){let[_,ot]=H[J],[it,pt]=H[V];if(X.get(rr(_,it))===N)M.set(F,[...M.get(F)??[],...ot,...pt]);else if(_==="default"||it==="default")M.set(F,[...M.get(F)??[],...ot,...pt]);else{let st=`${F}-${P++}`;M.set(st,ot);let c=`${F}-${P++}`;M.set(c,pt)}}}return M},"flattenAlignments"),l=z.map((i)=>{let N=new Map,M=new Map;return i.forEach(([T,W],F)=>{let P=U.getNode(F)?.in??"default",H=N.get(W)??new Map;if(!N.has(W))N.set(W,H);let J=M.get(T)??new Map;if(!M.has(T))M.set(T,J);for(let V of[H,J]){let _=V.get(P)??[];if(!V.has(P))V.set(P,_);_.push(F)}}),{horiz:[...y(N,"horizontal").values()].filter((T)=>T.length>1),vert:[...y(M,"vertical").values()].filter((T)=>T.length>1)}}),[s,h]=l.reduce(([i,N],{horiz:M,vert:T})=>[[...i,...M],[...N,...T]],[[],[]]),L=new Set;C.forEach((i)=>i.members.forEach((N)=>L.add(N)));let a=e((i)=>i.filter((N)=>!N.some((M)=>L.has(M))),"dropOverlapping"),O=a(s),o=a(h);return C.forEach((i)=>{if(i.members.length<2)return;if(i.direction==="row")O.push([...i.members]);else o.push([...i.members])}),{horizontal:O,vertical:o}}e(gr,"getAlignments");function ur(U,z,X=[]){let C=[],y=z.getConfigField("iconSize"),l=z.getConfigField("idealEdgeLengthMultiplier"),s=l*y,h=new Set;X.forEach((O)=>{for(let o=0;o<O.members.length-1;o++){let i=O.members[o],N=O.members[o+1];if(h.add(`${i}|${N}`),h.add(`${N}|${i}`),O.direction==="row")C.push({left:i,right:N,gap:s});else C.push({top:i,bottom:N,gap:s})}});let L=e((O)=>`${O[0]},${O[1]}`,"posToStr"),a=e((O)=>O.split(",").map((o)=>parseInt(o)),"strToPos");return U.forEach((O)=>{let o=new Map([...O.entries()].map(([T,W])=>[L(W),T])),i=[L([0,0])],N={},M={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(i.length>0){let T=i.shift();if(T){N[T]=1;let W=o.get(T);if(W){let F=a(T);Object.entries(M).forEach(([P,H])=>{let J=L([F[0]+H[0],F[1]+H[1]]),V=o.get(J);if(V&&!N[J]){if(i.push(J),h.has(`${W}|${V}`))return;C.push({[_e[P]]:V,[_e[pr(P)]]:W,gap:l*y})}})}}}}),C}e(ur,"getRelativeConstraints");function dr(U,z,X,C,y,{spatialMaps:l,groupAlignments:s}){return new Promise((h)=>{let L=n("body").append("div").attr("id","cy").attr("style","display:none"),a=Re({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":[0.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":`${y.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:`${y.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});L.remove(),fr(X,a),sr(U,a,y),hr(z,a,y),cr(C,a);let O=y.getLayoutHints(),o=gr(y,l,s,O),i=ur(l,y,O),N=y.getConfigField("iconSize"),M=y.getConfigField("idealEdgeLengthMultiplier")*N,T=0.5*N,W=y.getConfigField("edgeElasticity"),F=y.getConfigField("seed"),P=a.layout({name:"fcose",quality:"proof",randomize:y.getConfigField("randomize"),nodeSeparation:y.getConfigField("nodeSeparation"),numIter:y.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(H){let[J,V]=H.connectedNodes(),{parent:_}=we(J),{parent:ot}=we(V);return _===ot?M:T},edgeElasticity(H){let[J,V]=H.connectedNodes(),{parent:_}=we(J),{parent:ot}=we(V);return _===ot?W:0.001},alignmentConstraint:o,relativePlacementConstraint:i});P.one("layoutstop",()=>{function H(J,V,_,ot){let it,pt,{x:q,y:st}=J,{x:c,y:G}=V;pt=(ot-st+(q-_)*(st-G)/(q-c))/Math.sqrt(1+Math.pow((st-G)/(q-c),2)),it=Math.sqrt(Math.pow(ot-st,2)+Math.pow(_-q,2)-Math.pow(pt,2));let S=Math.sqrt(Math.pow(c-q,2)+Math.pow(G-st,2));it=it/S;let Y=(c-q)*(ot-st)-(G-st)*(_-q);switch(!0){case Y>=0:Y=1;break;case Y<0:Y=-1;break}let I=(c-q)*(_-q)+(G-st)*(ot-st);switch(!0){case I>=0:I=1;break;case I<0:I=-1;break}return pt=Math.abs(pt)*Y,it=it*I,{distances:pt,weights:it}}e(H,"getSegmentWeights"),a.startBatch();for(let J of Object.values(a.edges()))if(J.data?.()){let{x:V,y:_}=J.source().position(),{x:ot,y:it}=J.target().position();if(V!==ot&&_!==it){let pt=J.sourceEndpoint(),q=J.targetEndpoint(),{sourceDir:st}=ir(J),[c,G]=ve(st)?[pt.x,q.y]:[q.x,pt.y],{weights:S,distances:Y}=H(pt,q,c,G);J.style("segment-distances",Y),J.style("segment-weights",S)}}a.endBatch(),$e(F,()=>P.run())});try{$e(F,()=>P.run())}catch(H){if(H instanceof RangeError&&H.message.includes("Invalid array length"))throw 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.");throw H}a.ready((H)=>{t.info("Ready",H),h(a)})})}e(dr,"layoutArchitecture");var Sr=e(async(U,z,X,C)=>{let y=C.db;y.setDiagramId(z);let l=y.getServices(),s=y.getJunctions(),h=y.getGroups(),L=y.getEdges(),a=y.getDataStructures(),O=A(z),o=O.append("g");o.attr("class","architecture-edges");let i=O.append("g");i.attr("class","architecture-services");let N=O.append("g");N.attr("class","architecture-groups"),await Ir(y,i,l,z),Rr(y,i,s,z);let M=await dr(l,s,h,L,y,a);await Or(o,M,y,z),await xr(N,M,y,z),lr(y,M),Ie(void 0,O,y.getConfigField("padding"),y.getConfigField("useMaxWidth"))},"draw"),Fr={draw:Sr},Br={parser:ar,get db(){return new nr},renderer:Fr,styles:Dr};export{Br as diagram};
36
+ `)}}}}}))},"drawEdges"),xr=e(async function(U,z,X,C){let l=X.getConfigField("padding")*0.75,s=X.getConfigField("fontSize"),L=X.getConfigField("iconSize")/2;await Promise.all(z.nodes().map(async(a)=>{let O=Ce(a);if(O.type==="group"){let{h:o,w:i,x1:N,y1:M}=a.boundingBox(),T=U.append("rect");T.attr("id",`${C}-group-${O.id}`).attr("x",N+L).attr("y",M+L).attr("width",i).attr("height",o).attr("class","node-bkg");let W=U.append("g"),F=N,P=M;if(O.icon){let H=W.append("g");H.html(`<g>${await Te(O.icon,{height:l,width:l,fallbackPrefix:xe.prefix})}</g>`),H.attr("transform","translate("+(F+L+1)+", "+(P+L+1)+")"),F+=l,P+=s/2-1-2}if(O.label){let H=W.append("g");await Z(H,O.label,{useHtmlLabels:!1,width:i,classes:"architecture-service-label"},r()),H.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),H.attr("transform","translate("+(F+L+4)+", "+(P+L+2)+")")}X.setElementForId(O.id,T)}}))},"drawGroups"),Ir=e(async function(U,z,X,C){let y=r();for(let l of X){let s=z.append("g"),h=U.getConfigField("iconSize");if(l.title){let o=s.append("g");await Z(o,l.title,{useHtmlLabels:!1,width:h*1.5,classes:"architecture-service-label"},y),o.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),o.attr("transform","translate("+h/2+", "+h+")")}let L=s.append("g");if(l.icon)L.html(`<g>${await Te(l.icon,{height:h,width:h,fallbackPrefix:xe.prefix})}</g>`);else if(l.iconText){L.html(`<g>${await Te("blank",{height:h,width:h,fallbackPrefix:xe.prefix})}</g>`);let N=L.append("g").append("foreignObject").attr("width",h).attr("height",h).append("div").attr("class","node-icon-text").attr("style",`height: ${h}px;`).append("div").html(w(l.iconText,y)),M=parseInt(window.getComputedStyle(N.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;N.attr("style",`-webkit-line-clamp: ${Math.floor((h-2)/M)};`)}else L.append("path").attr("class","node-bkg").attr("id",`${C}-node-${l.id}`).attr("d",`M0,${h} V5 Q0,0 5,0 H${h-5} Q${h},0 ${h},5 V${h} Z`);s.attr("id",`${C}-service-${l.id}`).attr("class","architecture-service");let{width:a,height:O}=s.node().getBBox();l.width=a,l.height=O,U.setElementForId(l.id,s)}return 0},"drawServices"),Rr=e(function(U,z,X,C){X.forEach((y)=>{let l=z.append("g"),s=U.getConfigField("iconSize");l.append("g").append("rect").attr("id",`${C}-node-${y.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),l.attr("class","architecture-junction");let{width:L,height:a}=l._groups[0][0].getBBox();l.width=L,l.height=a,U.setElementForId(y.id,l)})},"drawJunctions");Bt([{name:xe.prefix,icons:xe}]);Re.use(or.default);function sr(U,z,X){U.forEach((C)=>{z.add({group:"nodes",data:{type:"service",id:C.id,icon:C.icon,label:C.title,parent:C.in,width:X.getConfigField("iconSize"),height:X.getConfigField("iconSize")},classes:"node-service"})})}e(sr,"addServices");function hr(U,z,X){U.forEach((C)=>{z.add({group:"nodes",data:{type:"junction",id:C.id,parent:C.in,width:X.getConfigField("iconSize"),height:X.getConfigField("iconSize")},classes:"node-junction"})})}e(hr,"addJunctions");function lr(U,z){z.nodes().map((X)=>{let C=Ce(X);if(C.type==="group")return;C.x=X.position().x,C.y=X.position().y,U.getElementById(C.id).attr("transform","translate("+(C.x||0)+","+(C.y||0)+")")})}e(lr,"positionNodes");function fr(U,z){U.forEach((X)=>{z.add({group:"nodes",data:{type:"group",id:X.id,icon:X.icon,label:X.title,parent:X.in},classes:"node-group"})})}e(fr,"addGroups");function cr(U,z){U.forEach((X)=>{let{lhsId:C,rhsId:y,lhsInto:l,lhsGroup:s,rhsInto:h,lhsDir:L,rhsDir:a,rhsGroup:O,title:o}=X,i=Ze(X.lhsDir,X.rhsDir)?"segments":"straight",N={id:`${C}-${y}`,label:o,source:C,sourceDir:L,sourceArrow:l,sourceGroup:s,sourceEndpoint:L==="L"?"0 50%":L==="R"?"100% 50%":L==="T"?"50% 0":"50% 100%",target:y,targetDir:a,targetArrow:h,targetGroup:O,targetEndpoint:a==="L"?"0 50%":a==="R"?"100% 50%":a==="T"?"50% 0":"50% 100%"};z.add({group:"edges",data:N,classes:i})})}e(cr,"addEdges");function gr(U,z,X,C=[]){let y=e((i,N)=>{let M=new Map;for(let[T,W]of i.entries()){let F=`${T}`,P=0,H=[...W.entries()];if(H.length===1){M.set(F,H[0][1]);continue}for(let J=0;J<H.length-1;J++)for(let V=J+1;V<H.length;V++){let[_,ot]=H[J],[it,pt]=H[V];if(X.get(rr(_,it))===N)M.set(F,[...M.get(F)??[],...ot,...pt]);else if(_==="default"||it==="default")M.set(F,[...M.get(F)??[],...ot,...pt]);else{let st=`${F}-${P++}`;M.set(st,ot);let c=`${F}-${P++}`;M.set(c,pt)}}}return M},"flattenAlignments"),l=z.map((i)=>{let N=new Map,M=new Map;return i.forEach(([T,W],F)=>{let P=U.getNode(F)?.in??"default",H=N.get(W)??new Map;if(!N.has(W))N.set(W,H);let J=M.get(T)??new Map;if(!M.has(T))M.set(T,J);for(let V of[H,J]){let _=V.get(P)??[];if(!V.has(P))V.set(P,_);_.push(F)}}),{horiz:[...y(N,"horizontal").values()].filter((T)=>T.length>1),vert:[...y(M,"vertical").values()].filter((T)=>T.length>1)}}),[s,h]=l.reduce(([i,N],{horiz:M,vert:T})=>[[...i,...M],[...N,...T]],[[],[]]),L=new Set;C.forEach((i)=>i.members.forEach((N)=>L.add(N)));let a=e((i)=>i.filter((N)=>!N.some((M)=>L.has(M))),"dropOverlapping"),O=a(s),o=a(h);return C.forEach((i)=>{if(i.members.length<2)return;if(i.direction==="row")O.push([...i.members]);else o.push([...i.members])}),{horizontal:O,vertical:o}}e(gr,"getAlignments");function ur(U,z,X=[]){let C=[],y=z.getConfigField("iconSize"),l=z.getConfigField("idealEdgeLengthMultiplier"),s=l*y,h=new Set;X.forEach((O)=>{for(let o=0;o<O.members.length-1;o++){let i=O.members[o],N=O.members[o+1];if(h.add(`${i}|${N}`),h.add(`${N}|${i}`),O.direction==="row")C.push({left:i,right:N,gap:s});else C.push({top:i,bottom:N,gap:s})}});let L=e((O)=>`${O[0]},${O[1]}`,"posToStr"),a=e((O)=>O.split(",").map((o)=>parseInt(o)),"strToPos");return U.forEach((O)=>{let o=new Map([...O.entries()].map(([T,W])=>[L(W),T])),i=[L([0,0])],N={},M={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(i.length>0){let T=i.shift();if(T){N[T]=1;let W=o.get(T);if(W){let F=a(T);Object.entries(M).forEach(([P,H])=>{let J=L([F[0]+H[0],F[1]+H[1]]),V=o.get(J);if(V&&!N[J]){if(i.push(J),h.has(`${W}|${V}`))return;C.push({[_e[P]]:V,[_e[pr(P)]]:W,gap:l*y})}})}}}}),C}e(ur,"getRelativeConstraints");function dr(U,z,X,C,y,{spatialMaps:l,groupAlignments:s}){return new Promise((h)=>{let L=n("body").append("div").attr("id","cy").attr("style","display:none"),a=Re({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":[0.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":`${y.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:`${y.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});L.remove(),fr(X,a),sr(U,a,y),hr(z,a,y),cr(C,a);let O=y.getLayoutHints(),o=gr(y,l,s,O),i=ur(l,y,O),N=y.getConfigField("iconSize"),M=y.getConfigField("idealEdgeLengthMultiplier")*N,T=0.5*N,W=y.getConfigField("edgeElasticity"),F=y.getConfigField("seed"),P=a.layout({name:"fcose",quality:"proof",randomize:y.getConfigField("randomize"),nodeSeparation:y.getConfigField("nodeSeparation"),numIter:y.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(H){let[J,V]=H.connectedNodes(),{parent:_}=Ce(J),{parent:ot}=Ce(V);return _===ot?M:T},edgeElasticity(H){let[J,V]=H.connectedNodes(),{parent:_}=Ce(J),{parent:ot}=Ce(V);return _===ot?W:0.001},alignmentConstraint:o,relativePlacementConstraint:i});P.one("layoutstop",()=>{function H(J,V,_,ot){let it,pt,{x:q,y:st}=J,{x:c,y:G}=V;pt=(ot-st+(q-_)*(st-G)/(q-c))/Math.sqrt(1+Math.pow((st-G)/(q-c),2)),it=Math.sqrt(Math.pow(ot-st,2)+Math.pow(_-q,2)-Math.pow(pt,2));let S=Math.sqrt(Math.pow(c-q,2)+Math.pow(G-st,2));it=it/S;let Y=(c-q)*(ot-st)-(G-st)*(_-q);switch(!0){case Y>=0:Y=1;break;case Y<0:Y=-1;break}let I=(c-q)*(_-q)+(G-st)*(ot-st);switch(!0){case I>=0:I=1;break;case I<0:I=-1;break}return pt=Math.abs(pt)*Y,it=it*I,{distances:pt,weights:it}}e(H,"getSegmentWeights"),a.startBatch();for(let J of Object.values(a.edges()))if(J.data?.()){let{x:V,y:_}=J.source().position(),{x:ot,y:it}=J.target().position();if(V!==ot&&_!==it){let pt=J.sourceEndpoint(),q=J.targetEndpoint(),{sourceDir:st}=ir(J),[c,G]=ve(st)?[pt.x,q.y]:[q.x,pt.y],{weights:S,distances:Y}=H(pt,q,c,G);J.style("segment-distances",Y),J.style("segment-weights",S)}}a.endBatch(),Be(F,()=>P.run())});try{Be(F,()=>P.run())}catch(H){if(H instanceof RangeError&&H.message.includes("Invalid array length"))throw 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.");throw H}a.ready((H)=>{t.info("Ready",H),h(a)})})}e(dr,"layoutArchitecture");var Sr=e(async(U,z,X,C)=>{let y=C.db;y.setDiagramId(z);let l=y.getServices(),s=y.getJunctions(),h=y.getGroups(),L=y.getEdges(),a=y.getDataStructures(),O=A(z),o=O.append("g");o.attr("class","architecture-edges");let i=O.append("g");i.attr("class","architecture-services");let N=O.append("g");N.attr("class","architecture-groups"),await Ir(y,i,l,z),Rr(y,i,s,z);let M=await dr(l,s,h,L,y,a);await Or(o,M,y,z),await xr(N,M,y,z),lr(y,M),Ie(void 0,O,y.getConfigField("padding"),y.getConfigField("useMaxWidth"))},"draw"),Fr={draw:Sr},Br={parser:ar,get db(){return new nr},renderer:Fr,styles:Dr};export{Br as diagram};