@kabmo-labs/kabmo 0.32.0 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +537 -530
  3. package/dist/client/static/js/{CsvGrid-amafmq3z.js → CsvGrid-fncjbg6j.js} +2 -2
  4. package/dist/client/static/js/{DocxView-851ps9t0.js → DocxView-c9v2vr3r.js} +5 -5
  5. package/dist/client/static/js/{DrawioView-kw1vy3r2.js → DrawioView-vxjksm12.js} +2 -2
  6. package/dist/client/static/js/ImageView-a3g5k226.js +1 -0
  7. package/dist/client/static/js/LayoutWrapper-hnjfwsjh.js +2 -0
  8. package/dist/client/static/js/Modal-qtftcp2t.js +38 -0
  9. package/dist/client/static/js/{PdfView-f5jkm0rs.js → PdfView-ksaes53y.js} +1 -1
  10. package/dist/client/static/js/SessionsView-30vcr95v.js +1 -0
  11. package/dist/client/static/js/{SheetView-23zxy30b.js → SheetView-vc484scg.js} +23 -23
  12. package/dist/client/static/js/{SvgPreview-c341y50e.js → SvgPreview-tph89jet.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-2dc3mpk6.js → abnfDiagram-O67JEVCF-xbar278c.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-tavtgb8a.js +1 -0
  15. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-7jmrr5ja.js → architectureDiagram-NJMV4G6O-s171n2z6.js} +3 -3
  16. package/dist/client/static/js/{astro-sjtf954j.js → astro-80bs6hvg.js} +1 -1
  17. package/dist/client/static/js/bash-b3rwyg5p.js +1 -0
  18. package/dist/client/static/js/{blockDiagram-BEXU5L5S-jrk2m0ea.js → blockDiagram-BEXU5L5S-gzx6rv9n.js} +3 -3
  19. package/dist/client/static/js/c-wkgxb1t1.js +1 -0
  20. package/dist/client/static/js/{c4Diagram-YGBWAQC7-48cyncjd.js → c4Diagram-YGBWAQC7-7f00skch.js} +2 -2
  21. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-gm7jt1cd.js → classDiagram-v2-NBCMYWYE-j79v95nc.js} +4 -4
  22. package/dist/client/static/js/{cose-bilkent-JH36ORCC-g0g3z0xp.js → cose-bilkent-JH36ORCC-5fkn7ee5.js} +1 -1
  23. package/dist/client/static/js/cpp-y0t6mynx.js +1 -0
  24. package/dist/client/static/js/css-6vj0d308.js +1 -0
  25. package/dist/client/static/js/cynefin-OW5HDTMX-cdh3n2z2.js +1 -0
  26. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-6vjde6am.js → cynefinDiagram-VND7K2PF-cfs1yvrd.js} +1 -1
  27. package/dist/client/static/js/{dagre-6A5THRUB-q6k8bx1j.js → dagre-6A5THRUB-44bgc48p.js} +2 -2
  28. package/dist/client/static/js/{diagram-22UHCM2B-87cmze2n.js → diagram-22UHCM2B-a4g4x83k.js} +19 -19
  29. package/dist/client/static/js/{diagram-3UASUU5V-1ejbr2p4.js → diagram-3UASUU5V-gm4rg5na.js} +1 -1
  30. package/dist/client/static/js/{diagram-ATOU4E4O-vaw1r6k2.js → diagram-ATOU4E4O-a95y41vk.js} +3 -3
  31. package/dist/client/static/js/{diagram-CDSNMT55-gxm9zv7d.js → diagram-CDSNMT55-t3j93mmc.js} +5 -5
  32. package/dist/client/static/js/{diagram-MLGK6HIB-x010xswm.js → diagram-MLGK6HIB-c2wdez02.js} +1 -1
  33. package/dist/client/static/js/{diagram-MPIPVDR6-qtcq7e6c.js → diagram-MPIPVDR6-gya9jhs5.js} +2 -2
  34. package/dist/client/static/js/{dockerfile-k5xbramm.js → dockerfile-a7q6174s.js} +1 -1
  35. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-nwwbasfh.js → ebnfDiagram-ZINNZB2B-jjhkza6t.js} +1 -1
  36. package/dist/client/static/js/{elk-276RUBZZ-xcp7thax.js → elk-276RUBZZ-f7re45mw.js} +1 -1
  37. package/dist/client/static/js/{erDiagram-OPXOYQCR-xj1tp716.js → erDiagram-OPXOYQCR-tpm9g5te.js} +6 -6
  38. package/dist/client/static/js/{erlang-rz1g9mxy.js → erlang-qt876zrq.js} +1 -1
  39. package/dist/client/static/js/eventmodeling-NTZA5JFV-as97tpyp.js +1 -0
  40. package/dist/client/static/js/flowDiagram-KWPJA3E3-ggm06d12.js +1 -0
  41. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-f7q96bea.js → ganttDiagram-FUAMR5RP-fz43n12d.js} +4 -4
  42. package/dist/client/static/js/gitGraph-4MIJSDKK-eqz7p9ng.js +1 -0
  43. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-1rydkyq9.js → gitGraphDiagram-X574FWY7-f61hgbn6.js} +9 -9
  44. package/dist/client/static/js/graphql-n43pd5fs.js +1 -0
  45. package/dist/client/static/js/{index-0g25yrc0.js → index-03h3bkcf.js} +1 -1
  46. package/dist/client/static/js/{index-8m3q2zpb.js → index-0e40xskg.js} +1 -1
  47. package/dist/client/static/js/{index-w5131mtt.js → index-0n5wwe60.js} +2 -2
  48. package/dist/client/static/js/{index-ynqnbvn2.js → index-0tf0arsp.js} +3 -3
  49. package/dist/client/static/js/{index-0a1ekhqf.js → index-14vndmcr.js} +2 -2
  50. package/dist/client/static/js/index-1a0zkj8h.js +2 -0
  51. package/dist/client/static/js/{index-zca66d5d.js → index-1xqs14fr.js} +3 -3
  52. package/dist/client/static/js/{index-73xfkyea.js → index-1y9r4frb.js} +2 -2
  53. package/dist/client/static/js/{index-0n9c85ke.js → index-2svnq5gg.js} +2 -2
  54. package/dist/client/static/js/{index-pe9j88d4.js → index-2x5f66t6.js} +2 -2
  55. package/dist/client/static/js/{index-ggaqh9rt.js → index-354mqqra.js} +2 -2
  56. package/dist/client/static/js/{index-2t2tnc3x.js → index-3rcjx70v.js} +1 -1
  57. package/dist/client/static/js/{index-9nbxb421.js → index-3zc1b0dv.js} +2 -2
  58. package/dist/client/static/js/{index-14wppnkx.js → index-5tgq7aqx.js} +2 -2
  59. package/dist/client/static/js/{index-vrbcj11n.js → index-76zb4m0n.js} +2 -2
  60. package/dist/client/static/js/{index-x64kqgen.js → index-7y6rpsrp.js} +2 -2
  61. package/dist/client/static/js/{index-2n5wy1sh.js → index-8239j2v1.js} +1 -1
  62. package/dist/client/static/js/{index-pkyrkkbt.js → index-9fjt5anh.js} +2 -2
  63. package/dist/client/static/js/{index-m6wwc5h6.js → index-9t82sx0w.js} +2 -2
  64. package/dist/client/static/js/{index-hkq0y3pn.js → index-9y3gjdj7.js} +2 -2
  65. package/dist/client/static/js/{index-hyry1n8x.js → index-ahv9y42z.js} +2 -2
  66. package/dist/client/static/js/{index-f519m6s3.js → index-ajs3jj6j.js} +1 -1
  67. package/dist/client/static/js/index-apvkd37e.js +4 -0
  68. package/dist/client/static/js/index-at6bhjyf.js +1 -0
  69. package/dist/client/static/js/index-bkye8mz4.js +2 -0
  70. package/dist/client/static/js/{index-e7a3fkvv.js → index-d495kfm0.js} +1 -1
  71. package/dist/client/static/js/{index-hhm62nfj.js → index-dbe6afkf.js} +2 -2
  72. package/dist/client/static/js/{index-c20a46ww.js → index-djmg1d7h.js} +2 -2
  73. package/dist/client/static/js/{index-fc2j6bq2.js → index-e4p4cd3r.js} +2 -2
  74. package/dist/client/static/js/{index-f63y3mjj.js → index-eyzeya95.js} +5 -5
  75. package/dist/client/static/js/{index-123e8tqq.js → index-gcs49f3p.js} +1 -1
  76. package/dist/client/static/js/{index-c8jzx6b0.js → index-gs6f0qwa.js} +2 -2
  77. package/dist/client/static/js/{index-6sdctwv2.js → index-hf52f59k.js} +2 -2
  78. package/dist/client/static/js/{index-3anc30zh.js → index-j0r5hj0j.js} +2 -2
  79. package/dist/client/static/js/{index-31jrebvn.js → index-js7t1vb1.js} +18 -18
  80. package/dist/client/static/js/{index-xa7nrnda.js → index-km2zb6wk.js} +2 -2
  81. package/dist/client/static/js/{index-yvcpdk5f.js → index-m73za75e.js} +1 -1
  82. package/dist/client/static/js/{index-e6rar25v.js → index-pbe4yed4.js} +2 -2
  83. package/dist/client/static/js/{index-xpf2ra60.js → index-pxv2nw9w.js} +1 -1
  84. package/dist/client/static/js/{index-deex10rz.js → index-q2w6s8n7.js} +5 -5
  85. package/dist/client/static/js/{index-22jaxtz1.js → index-qckv9nte.js} +2 -2
  86. package/dist/client/static/js/{index-e26rd868.js → index-qsm2z36d.js} +2 -2
  87. package/dist/client/static/js/{index-5zd1jx9r.js → index-rg8jpbsw.js} +2 -2
  88. package/dist/client/static/js/{index-gvwqjpcr.js → index-rytaa8ca.js} +2 -2
  89. package/dist/client/static/js/{index-fmxn1rzs.js → index-sdtye3jy.js} +2 -2
  90. package/dist/client/static/js/index-sffjtm5w.js +12 -0
  91. package/dist/client/static/js/{index-tr8754r0.js → index-trm9x02n.js} +45 -45
  92. package/dist/client/static/js/{index-cwaz6geq.js → index-vtbbfwx0.js} +2 -2
  93. package/dist/client/static/js/{index-vmvcse63.js → index-vw4brsdx.js} +1 -1
  94. package/dist/client/static/js/{index-qmh0h87h.js → index-vw5k8csz.js} +55 -55
  95. package/dist/client/static/js/{index-52bgxh6f.js → index-w0fwb80e.js} +1 -1
  96. package/dist/client/static/js/{index-s9vp6p70.js → index-x07kp3jz.js} +2 -2
  97. package/dist/client/static/js/{index-8a3tmm1h.js → index-xj9649ac.js} +7 -7
  98. package/dist/client/static/js/{index-w4re5r8w.js → index-ypx3qmhq.js} +2 -2
  99. package/dist/client/static/js/{index-y139vc12.js → index-zt75xpq0.js} +193 -193
  100. package/dist/client/static/js/{index-nsrnyqcm.js → index-zvfvqvn9.js} +2 -2
  101. package/dist/client/static/js/info-A6RAGUB7-4pkzh1qx.js +1 -0
  102. package/dist/client/static/js/{infoDiagram-VRGFBTTK-ptg07tp2.js → infoDiagram-VRGFBTTK-1qj804sn.js} +1 -1
  103. package/dist/client/static/js/ini-j5dyq6gm.js +1 -0
  104. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-bdk2dkf5.js → ishikawaDiagram-OU5B5YK6-4j4qsnzw.js} +3 -3
  105. package/dist/client/static/js/java-g4dgwbfd.js +1 -0
  106. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-kez0ha4c.js → journeyDiagram-ZHPQQLJL-j0brnfft.js} +4 -4
  107. package/dist/client/static/js/json-j5q8nt57.js +1 -0
  108. package/dist/client/static/js/jsx-7t5ecz9s.js +1 -0
  109. package/dist/client/static/js/{julia-nmr85k8z.js → julia-4ghmfy3e.js} +1 -1
  110. package/dist/client/static/js/{kanban-definition-PNTS6WVX-dhzp3qg5.js → kanban-definition-PNTS6WVX-qqc22br0.js} +3 -3
  111. package/dist/client/static/js/lua-1g6w30de.js +1 -0
  112. package/dist/client/static/js/markdown-afx21x8c.js +1 -0
  113. package/dist/client/static/js/{mermaid.core-h7wttbss.js → mermaid.core-vv3wbe65.js} +7 -7
  114. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-tq5dd1em.js → mindmap-definition-NLK3R4M7-y5b2z8zp.js} +4 -4
  115. package/dist/client/static/js/one-dark-pro-hm3f56n1.js +1 -0
  116. package/dist/client/static/js/one-light-xrz49rct.js +1 -0
  117. package/dist/client/static/js/packet-AYTQ26CC-yg71sp88.js +1 -0
  118. package/dist/client/static/js/{pegDiagram-GJSIUBJH-e5hrdfzv.js → pegDiagram-GJSIUBJH-0be07mqs.js} +1 -1
  119. package/dist/client/static/js/{perl-prxcva8r.js → perl-sd00t4b4.js} +1 -1
  120. package/dist/client/static/js/{php-m9kcctzs.js → php-2zfyqa61.js} +1 -1
  121. package/dist/client/static/js/pie-WAS4IAKB-89wd6np0.js +1 -0
  122. package/dist/client/static/js/{pieDiagram-5QR66LMP-axvbvnz8.js → pieDiagram-5QR66LMP-544w86jk.js} +2 -2
  123. package/dist/client/static/js/properties-thd83wey.js +1 -0
  124. package/dist/client/static/js/python-264ns4xw.js +1 -0
  125. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-wtn28cfm.js → quadrantDiagram-O4NWA36T-p09e7z5s.js} +4 -4
  126. package/dist/client/static/js/r-qw82kkv9.js +1 -0
  127. package/dist/client/static/js/radar-RG4KPBEZ-avn0b8r9.js +1 -0
  128. package/dist/client/static/js/railroad-74A4TZTK-de27xv5w.js +1 -0
  129. package/dist/client/static/js/railroad-abnf-HS5TGJTU-rg4zzj7x.js +1 -0
  130. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-d84fhj8v.js +1 -0
  131. package/dist/client/static/js/railroad-peg-WCYAUIDC-dvf8xrmc.js +1 -0
  132. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-avjkq945.js → railroadDiagram-XR7U4H2S-de830ed2.js} +1 -1
  133. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-bntx7r6q.js → requirementDiagram-PLB6GJNP-b47d74p1.js} +4 -4
  134. package/dist/client/static/js/{ruby-t06c0e7g.js → ruby-v9qaqhby.js} +1 -1
  135. package/dist/client/static/js/{rust-6gqjxyf0.js → rust-fkt0qyrs.js} +1 -1
  136. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-ps8nkdm2.js → sankeyDiagram-IPEJSGJF-6ezc2fpj.js} +5 -5
  137. package/dist/client/static/js/{sass-gsbyn3wh.js → sass-9bxped7y.js} +1 -1
  138. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-3ckf1q6z.js → sequenceDiagram-PO4LG4MO-by5zqj6w.js} +18 -18
  139. package/dist/client/static/js/{sizeCapture-INFHLROL-akvcr1x7.js → sizeCapture-INFHLROL-q85r06j6.js} +1 -1
  140. package/dist/client/static/js/sql-g8wcshpc.js +1 -0
  141. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-c82914fz.js → stateDiagram-v2-GCMORJYK-ep5pyexs.js} +3 -3
  142. package/dist/client/static/js/{svelte-j54gfrvq.js → svelte-mwtx07d9.js} +1 -1
  143. package/dist/client/static/js/{swimlanes-2SLR337P-scgdefh4.js → swimlanes-2SLR337P-95fcqkh8.js} +1 -1
  144. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xs2en5dv.js +8 -0
  145. package/dist/client/static/js/{timeline-definition-EJHVYXUP-z2ha1rhq.js → timeline-definition-EJHVYXUP-461e615g.js} +2 -2
  146. package/dist/client/static/js/treeView-Q6P3EWNA-mham0bh6.js +1 -0
  147. package/dist/client/static/js/treemap-WGGIJYW6-mxrxax86.js +1 -0
  148. package/dist/client/static/js/tsx-nm94hed6.js +1 -0
  149. package/dist/client/static/js/typescript-0s2t05jj.js +1 -0
  150. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-3wdmrfmk.js → usecaseDiagram-POWQR4AR-ftqfnvhg.js} +38 -38
  151. package/dist/client/static/js/{vennDiagram-UO4OBE2U-7m5tatzv.js → vennDiagram-UO4OBE2U-7t96h6ez.js} +7 -7
  152. package/dist/client/static/js/{vue-y8bb5f3h.js → vue-j8vb9d7r.js} +1 -1
  153. package/dist/client/static/js/wardley-WFR3VGLG-8vrvh9p3.js +1 -0
  154. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-55ps9s4z.js → wardleyDiagram-VNRHLVJA-0de8w8c6.js} +4 -4
  155. package/dist/client/static/js/xml-dz51p1m3.js +1 -0
  156. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-8bsjtm4t.js → xychartDiagram-PMCCYNJV-dez9phkf.js} +5 -5
  157. package/dist/client/static/js/yaml-2cfkd30t.js +1 -0
  158. package/package.json +1 -1
  159. package/src/client/components/common/context-usage-button/McpSection.test.tsx +98 -0
  160. package/src/client/components/common/context-usage-button/McpSection.tsx +12 -5
  161. package/src/client/components/common/context-usage-button/SessionStats.tsx +80 -0
  162. package/src/client/components/common/context-usage-button/index.test.tsx +26 -0
  163. package/src/client/components/common/context-usage-button/index.tsx +36 -28
  164. package/src/client/components/common/harness-glyph/brands.ts +8 -0
  165. package/src/client/components/common/session-actions-menu/index.tsx +6 -1
  166. package/src/client/components/layout/session-sidebar/SessionsView.tsx +20 -33
  167. package/src/client/components/mobile/LayoutWrapper.tsx +28 -29
  168. package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +9 -2
  169. package/src/client/components/mobile/worktree-session.ts +4 -1
  170. package/src/client/components/settings/apply-side-effects.test.ts +11 -0
  171. package/src/client/components/settings/apply-side-effects.ts +7 -0
  172. package/src/client/components/settings/categories/ChatSettings.test.tsx +1 -1
  173. package/src/client/components/settings/categories/ChatSettings.tsx +2 -0
  174. package/src/client/components/settings/categories/NotificationSettings.tsx +1 -1
  175. package/src/client/components/settings/categories/chat-settings/ChangedFilesSection.tsx +79 -0
  176. package/src/client/components/settings/categories/chat-settings/groups.ts +4 -3
  177. package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.tsx +101 -0
  178. package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +16 -15
  179. package/src/client/components/workspace/chat-timeline/MessageList.tsx +33 -1
  180. package/src/client/components/workspace/chat-timeline/RunFooter.tsx +21 -1
  181. package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +13 -0
  182. package/src/client/components/workspace/chat-timeline/fork-preview.test.tsx +11 -0
  183. package/src/client/components/workspace/chat-timeline/index.tsx +1 -1
  184. package/src/client/components/workspace/diff-panel/Toolbar.tsx +17 -51
  185. package/src/client/components/workspace/diff-panel/index.tsx +23 -4
  186. package/src/client/components/workspace/diff-panel/toolbar-git-actions.tsx +94 -0
  187. package/src/client/components/workspace/editor/Body.tsx +2 -0
  188. package/src/client/data/settings/omp-schema.json +73 -3
  189. package/src/client/hooks/chat/btw/mode.ts +5 -1
  190. package/src/client/hooks/chat/omp/session-sidebar-controller.ts +9 -3
  191. package/src/client/hooks/chat/timeline/changed-files-setting.test.ts +31 -0
  192. package/src/client/hooks/chat/timeline/changed-files-setting.ts +60 -0
  193. package/src/client/hooks/chat/timeline/new-chat.ts +4 -1
  194. package/src/client/hooks/chat/timeline/pending-dispatch.ts +6 -10
  195. package/src/client/hooks/chat/timeline/session-changes.ts +51 -0
  196. package/src/client/hooks/chat/waiting/dispatch.ts +4 -1
  197. package/src/client/hooks/ui/notification-events.test.ts +3 -0
  198. package/src/client/hooks/ui/notification-events.ts +3 -1
  199. package/src/client/hooks/ui/notification-sound.ts +13 -6
  200. package/src/client/hooks/ui/ui-sounds.test.ts +15 -0
  201. package/src/client/hooks/workspace/batch-delete-run.ts +5 -1
  202. package/src/client/hooks/workspace/diff-file.ts +11 -4
  203. package/src/client/hooks/workspace/file-tabs.ts +13 -4
  204. package/src/client/hooks/workspace/journal-diff.ts +97 -0
  205. package/src/client/hooks/workspace/session-delete.ts +5 -1
  206. package/src/client/lib/notifications/native-banner-sound.test.ts +93 -0
  207. package/src/client/lib/notifications/native-banner-sound.ts +46 -0
  208. package/src/client/lib/notifications/os.test.ts +14 -5
  209. package/src/client/lib/notifications/os.ts +8 -0
  210. package/src/client/lib/router/branch-params.test.ts +62 -0
  211. package/src/client/lib/router/branch-params.ts +48 -0
  212. package/src/server/lib/assets/shell-settings.server.test.ts +35 -0
  213. package/src/server/lib/assets/shell-settings.server.ts +33 -0
  214. package/src/server/lib/harness/launch-table.ts +10 -0
  215. package/src/server/lib/omp/session/changes.test.ts +138 -0
  216. package/src/server/lib/omp/session/changes.ts +220 -0
  217. package/src/server/lib/omp/session/session-discovery.test.ts +4 -4
  218. package/src/server/lib/omp/session/sidebar-activity.server.test.ts +6 -2
  219. package/src/server/lib/omp/session/subagent-presence-scan.ts +54 -0
  220. package/src/server/lib/omp/session/subagent-presence-store.test.ts +1 -1
  221. package/src/server/lib/omp/session/subagent-presence.test.ts +115 -0
  222. package/src/server/lib/omp/session/subagent-presence.ts +12 -3
  223. package/src/server/lib/omp/session/telemetry/compute.ts +68 -0
  224. package/src/server/lib/omp/session/telemetry.test.ts +81 -0
  225. package/src/server/lib/realtime/topics/peer-relay.server.test.ts +1 -11
  226. package/src/server/plugins/ssr.ts +20 -8
  227. package/src/server/routes/sessions/changes.test.ts +90 -0
  228. package/src/server/routes/sessions/changes.ts +55 -0
  229. package/src/server/routes/sessions/index.ts +6 -0
  230. package/src/shared/lib/chat/duration.ts +34 -0
  231. package/src/shared/lib/chat/timeline/changed-files.test.ts +121 -0
  232. package/src/shared/lib/chat/timeline/changed-files.ts +71 -0
  233. package/src/shared/lib/chat/timeline/fork-anchor.test.ts +3 -0
  234. package/src/shared/lib/format/duration.test.ts +31 -0
  235. package/src/shared/lib/format/duration.ts +27 -0
  236. package/src/shared/lib/fs/unified-diff.test.ts +53 -0
  237. package/src/shared/lib/fs/unified-diff.ts +127 -0
  238. package/src/shared/lib/harness/brand-color.ts +3 -0
  239. package/src/shared/lib/harness/catalog.test.ts +13 -0
  240. package/src/shared/lib/harness/catalog.ts +8 -1
  241. package/src/shared/lib/harness/fork.ts +4 -2
  242. package/src/shared/lib/harness/mcp-facts.ts +3 -0
  243. package/src/shared/lib/harness/provider-facts.ts +14 -0
  244. package/src/shared/lib/harness/updates.ts +5 -0
  245. package/src/shared/lib/icons/tint-hues.generated.ts +27 -27
  246. package/src/shared/lib/omp/config/schema.test.ts +4 -2
  247. package/src/shared/lib/settings/defaults.ts +1 -0
  248. package/src/shared/lib/workspace/file-tab-id.ts +9 -0
  249. package/src/shared/types/context.ts +18 -0
  250. package/src/shared/types/fs.ts +21 -0
  251. package/src/shared/types/index.ts +1 -0
  252. package/src/shared/types/omp/session.ts +6 -0
  253. package/src/shared/types/session-changes.ts +58 -0
  254. package/src/shared/types/settings/state.ts +8 -0
  255. package/src/test-support/peer-harness.ts +13 -5
  256. package/dist/client/static/js/ImageView-ksx9bbct.js +0 -1
  257. package/dist/client/static/js/LayoutWrapper-9ftz050x.js +0 -2
  258. package/dist/client/static/js/Modal-f8x3j3be.js +0 -38
  259. package/dist/client/static/js/SessionsView-wzdf1cp6.js +0 -1
  260. package/dist/client/static/js/architecture-7GRP2DOG-4wsd6vk0.js +0 -1
  261. package/dist/client/static/js/bash-h6pkqvth.js +0 -1
  262. package/dist/client/static/js/c-thbdzmwv.js +0 -1
  263. package/dist/client/static/js/cpp-r1za1kke.js +0 -1
  264. package/dist/client/static/js/css-qsv4vvke.js +0 -1
  265. package/dist/client/static/js/cynefin-OW5HDTMX-eycwde8c.js +0 -1
  266. package/dist/client/static/js/eventmodeling-NTZA5JFV-srqbnmey.js +0 -1
  267. package/dist/client/static/js/flowDiagram-KWPJA3E3-yj98317w.js +0 -1
  268. package/dist/client/static/js/gitGraph-4MIJSDKK-5jcrvn94.js +0 -1
  269. package/dist/client/static/js/graphql-275pg7ya.js +0 -1
  270. package/dist/client/static/js/index-b08zd4eq.js +0 -1
  271. package/dist/client/static/js/index-g0pkzanm.js +0 -2
  272. package/dist/client/static/js/index-ga2xdef3.js +0 -2
  273. package/dist/client/static/js/index-r416e9dt.js +0 -12
  274. package/dist/client/static/js/index-xzfsaqyz.js +0 -4
  275. package/dist/client/static/js/info-A6RAGUB7-mbt0ryx5.js +0 -1
  276. package/dist/client/static/js/ini-jqdrx98c.js +0 -1
  277. package/dist/client/static/js/java-70zqqrkr.js +0 -1
  278. package/dist/client/static/js/json-kxk8gfet.js +0 -1
  279. package/dist/client/static/js/jsx-h1035eqk.js +0 -1
  280. package/dist/client/static/js/lua-j2356waf.js +0 -1
  281. package/dist/client/static/js/markdown-ffw6rgk6.js +0 -1
  282. package/dist/client/static/js/one-dark-pro-8acf6cn2.js +0 -1
  283. package/dist/client/static/js/one-light-ysc1knem.js +0 -1
  284. package/dist/client/static/js/packet-AYTQ26CC-a5yw789s.js +0 -1
  285. package/dist/client/static/js/pie-WAS4IAKB-x0y4v4r2.js +0 -1
  286. package/dist/client/static/js/properties-55mrarxr.js +0 -1
  287. package/dist/client/static/js/python-dhypc3j4.js +0 -1
  288. package/dist/client/static/js/r-6b8dt1wp.js +0 -1
  289. package/dist/client/static/js/radar-RG4KPBEZ-trrc3ta1.js +0 -1
  290. package/dist/client/static/js/railroad-74A4TZTK-dxgvx21w.js +0 -1
  291. package/dist/client/static/js/railroad-abnf-HS5TGJTU-rbgkd8sk.js +0 -1
  292. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-exgw7j47.js +0 -1
  293. package/dist/client/static/js/railroad-peg-WCYAUIDC-28tpamzk.js +0 -1
  294. package/dist/client/static/js/sql-9dq913c8.js +0 -1
  295. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-0x2ashav.js +0 -8
  296. package/dist/client/static/js/treeView-Q6P3EWNA-1a00b6kc.js +0 -1
  297. package/dist/client/static/js/treemap-WGGIJYW6-2q4f2f7m.js +0 -1
  298. package/dist/client/static/js/tsx-wh5xgm7f.js +0 -1
  299. package/dist/client/static/js/typescript-ge85req5.js +0 -1
  300. package/dist/client/static/js/wardley-WFR3VGLG-x9v91the.js +0 -1
  301. package/dist/client/static/js/xml-7bgz40qa.js +0 -1
  302. package/dist/client/static/js/yaml-4ht9416k.js +0 -1
  303. package/src/client/components/layout/session-sidebar/new-session-context.test.ts +0 -55
@@ -1,4 +1,4 @@
1
- import{be}from"./index-123e8tqq.js";import{t,l,K,E,X,Nr,R,M,O,P,z,j,G,p,h,ue,hf,_o,rr,ae,fn,Jt}from"./index-qmh0h87h.js";import{Te}from"./index-tr8754r0.js";import{Dr}from"./index-8a3tmm1h.js";import{rn,yn}from"./index-fmxn1rzs.js";var Se=yn(function(Ee,Re){(function(F,D){if(typeof Ee==="object"&&typeof Re==="object")Re.exports=D();else if(typeof define==="function"&&define.amd)define([],D);else if(typeof Ee==="object")Ee.layoutBase=D();else F.layoutBase=D()})(Ee,function(){return function(C){var F={};function D(v){if(F[v])return F[v].exports;var f=F[v]={i:v,l:!1,exports:{}};return C[v].call(f.exports,f,f.exports,D),f.l=!0,f.exports}return D.m=C,D.c=F,D.i=function(v){return v},D.d=function(v,f,o){if(!D.o(v,f))Object.defineProperty(v,f,{configurable:!1,enumerable:!0,get:o})},D.n=function(v){var f=v&&v.__esModule?function(){return v.default}:function(){return v};return D.d(f,"a",f),f},D.o=function(v,f){return Object.prototype.hasOwnProperty.call(v,f)},D.p="",D(D.s=28)}([function(C,F,D){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1000,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,C.exports=v},function(C,F,D){var v=D(2),f=D(8),o=D(9);function n(u,r,y){v.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=u,this.target=r}n.prototype=Object.create(v.prototype);for(var a in v)n[a]=v[a];n.prototype.getSource=function(){return this.source},n.prototype.getTarget=function(){return this.target},n.prototype.isInterGraph=function(){return this.isInterGraph},n.prototype.getLength=function(){return this.length},n.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},n.prototype.getBendpoints=function(){return this.bendpoints},n.prototype.getLca=function(){return this.lca},n.prototype.getSourceInLca=function(){return this.sourceInLca},n.prototype.getTargetInLca=function(){return this.targetInLca},n.prototype.getOtherEnd=function(u){if(this.source===u)return this.target;else if(this.target===u)return this.source;else throw"Node is not incident with this edge"},n.prototype.getOtherEndInGraph=function(u,r){var y=this.getOtherEnd(u),i=r.getGraphManager().getRoot();while(!0){if(y.getOwner()==r)return y;if(y.getOwner()==i)break;y=y.getOwner().getParent()}return null},n.prototype.updateLength=function(){var u=[,,,,];if(this.isOverlapingSourceAndTarget=f.getIntersection(this.target.getRect(),this.source.getRect(),u),!this.isOverlapingSourceAndTarget){if(this.lengthX=u[0]-u[2],this.lengthY=u[1]-u[3],Math.abs(this.lengthX)<1)this.lengthX=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},n.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=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},C.exports=n},function(C,F,D){function v(f){this.vGraphObject=f}C.exports=v},function(C,F,D){var v=D(2),f=D(10),o=D(13),n=D(0),a=D(16),u=D(5);function r(i,e,g,d){if(g==null&&d==null)d=e;if(v.call(this,d),i.graphManager!=null)i=i.graphManager;if(this.estimatedSize=f.MIN_VALUE,this.inclusionTreeDepth=f.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=i,g!=null&&e!=null)this.rect=new o(e.x,e.y,g.width,g.height);else this.rect=new o}r.prototype=Object.create(v.prototype);for(var y in v)r[y]=v[y];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(i){this.rect.width=i},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(i){this.rect.height=i},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new u(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new u(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(i,e){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=e.width,this.rect.height=e.height},r.prototype.setCenter=function(i,e){this.rect.x=i-this.rect.width/2,this.rect.y=e-this.rect.height/2},r.prototype.setLocation=function(i,e){this.rect.x=i,this.rect.y=e},r.prototype.moveBy=function(i,e){this.rect.x+=i,this.rect.y+=e},r.prototype.getEdgeListToNode=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(c.target==i){if(c.source!=d)throw"Incorrect edge source!";e.push(c)}}),e},r.prototype.getEdgesBetween=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(!(c.source==d||c.target==d))throw"Incorrect edge source and/or target";if(c.target==i||c.source==i)e.push(c)}),e},r.prototype.getNeighborsList=function(){var i=new Set,e=this;return e.edges.forEach(function(g){if(g.source==e)i.add(g.target);else{if(g.target!=e)throw"Incorrect incidency!";i.add(g.source)}}),i},r.prototype.withChildren=function(){var i=new Set,e,g;if(i.add(this),this.child!=null){var d=this.child.getNodes();for(var c=0;c<d.length;c++)e=d[c],g=e.withChildren(),g.forEach(function(I){i.add(I)})}return i},r.prototype.getNoOfChildren=function(){var i=0,e;if(this.child==null)i=1;else{var g=this.child.getNodes();for(var d=0;d<g.length;d++)e=g[d],i+=e.getNoOfChildren()}if(i==0)i=1;return i},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.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},r.prototype.scatter=function(){var i,e,g=-n.INITIAL_WORLD_BOUNDARY,d=n.INITIAL_WORLD_BOUNDARY;i=n.WORLD_CENTER_X+a.nextDouble()*(d-g)+g;var c=-n.INITIAL_WORLD_BOUNDARY,I=n.INITIAL_WORLD_BOUNDARY;e=n.WORLD_CENTER_Y+a.nextDouble()*(I-c)+c,this.rect.x=i,this.rect.y=e},r.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),n.NODE_DIMENSIONS_INCLUDE_LABELS){var e=i.getRight()-i.getLeft(),g=i.getBottom()-i.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(e+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>e)this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(e+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(g+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>g)this.rect.y-=(this.labelHeight-g)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(g+this.labelHeight)}}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==f.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(i){var e=this.rect.x;if(e>n.WORLD_BOUNDARY)e=n.WORLD_BOUNDARY;else if(e<-n.WORLD_BOUNDARY)e=-n.WORLD_BOUNDARY;var g=this.rect.y;if(g>n.WORLD_BOUNDARY)g=n.WORLD_BOUNDARY;else if(g<-n.WORLD_BOUNDARY)g=-n.WORLD_BOUNDARY;var d=new u(e,g),c=i.inverseTransformPoint(d);this.setLocation(c.x,c.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},C.exports=r},function(C,F,D){var v=D(0);function f(){}for(var o in v)f[o]=v[o];f.MAX_ITERATIONS=2500,f.DEFAULT_EDGE_LENGTH=50,f.DEFAULT_SPRING_STRENGTH=0.45,f.DEFAULT_REPULSION_STRENGTH=4500,f.DEFAULT_GRAVITY_STRENGTH=0.4,f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,f.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,f.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,f.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,f.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,f.COOLING_ADAPTATION_FACTOR=0.33,f.ADAPTATION_LOWER_NODE_LIMIT=1000,f.ADAPTATION_UPPER_NODE_LIMIT=5000,f.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,f.MAX_NODE_DISPLACEMENT=f.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,f.CONVERGENCE_CHECK_PERIOD=100,f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,f.MIN_EDGE_LENGTH=1,f.GRID_CALCULATION_CHECK_PERIOD=10,C.exports=f},function(C,F,D){function v(f,o){if(f==null&&o==null)this.x=0,this.y=0;else this.x=f,this.y=o}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(f){this.x=f},v.prototype.setY=function(f){this.y=f},v.prototype.getDifference=function(f){return new DimensionD(this.x-f.x,this.y-f.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(f){return this.x+=f.width,this.y+=f.height,this},C.exports=v},function(C,F,D){var v=D(2),f=D(10),o=D(0),n=D(7),a=D(3),u=D(1),r=D(13),y=D(12),i=D(11);function e(d,c,I){if(v.call(this,I),this.estimatedSize=f.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,c!=null&&c instanceof n)this.graphManager=c;else if(c!=null&&c instanceof Layout)this.graphManager=c.graphManager}e.prototype=Object.create(v.prototype);for(var g in v)e[g]=v[g];e.prototype.getNodes=function(){return this.nodes},e.prototype.getEdges=function(){return this.edges},e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getParent=function(){return this.parent},e.prototype.getLeft=function(){return this.left},e.prototype.getRight=function(){return this.right},e.prototype.getTop=function(){return this.top},e.prototype.getBottom=function(){return this.bottom},e.prototype.isConnected=function(){return this.isConnected},e.prototype.add=function(d,c,I){if(c==null&&I==null){var N=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(N)>-1)throw"Node already in graph!";return N.owner=this,this.getNodes().push(N),N}else{var L=d;if(!(this.getNodes().indexOf(c)>-1&&this.getNodes().indexOf(I)>-1))throw"Source or target not in graph!";if(!(c.owner==I.owner&&c.owner==this))throw"Both owners must be this graph!";if(c.owner!=I.owner)return null;if(L.source=c,L.target=I,L.isInterGraph=!1,this.getEdges().push(L),c.edges.push(L),I!=c)I.edges.push(L);return L}},e.prototype.remove=function(d){var c=d;if(d instanceof a){if(c==null)throw"Node is null!";if(!(c.owner!=null&&c.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var I=c.edges.slice(),N,L=I.length;for(var x=0;x<L;x++)if(N=I[x],N.isInterGraph)this.graphManager.remove(N);else N.source.owner.remove(N);var W=this.nodes.indexOf(c);if(W==-1)throw"Node not in owner node list!";this.nodes.splice(W,1)}else if(d instanceof u){var N=d;if(N==null)throw"Edge is null!";if(!(N.source!=null&&N.target!=null))throw"Source and/or target is null!";if(!(N.source.owner!=null&&N.target.owner!=null&&N.source.owner==this&&N.target.owner==this))throw"Source and/or target owner is invalid!";var S=N.source.edges.indexOf(N),B=N.target.edges.indexOf(N);if(!(S>-1&&B>-1))throw"Source and/or target doesn't know this edge!";if(N.source.edges.splice(S,1),N.target!=N.source)N.target.edges.splice(B,1);var W=N.source.owner.getEdges().indexOf(N);if(W==-1)throw"Not in owner's edge list!";N.source.owner.getEdges().splice(W,1)}},e.prototype.updateLeftTop=function(){var{MAX_VALUE:d,MAX_VALUE:c}=f,I,N,L,x=this.getNodes(),W=x.length;for(var S=0;S<W;S++){var B=x[S];if(I=B.getTop(),N=B.getLeft(),d>I)d=I;if(c>N)c=N}if(d==f.MAX_VALUE)return null;if(x[0].getParent().paddingLeft!=null)L=x[0].getParent().paddingLeft;else L=this.margin;return this.left=c-L,this.top=d-L,new y(this.left,this.top)},e.prototype.updateBounds=function(d){var c=f.MAX_VALUE,I=-f.MAX_VALUE,N=f.MAX_VALUE,L=-f.MAX_VALUE,x,W,S,B,tt,Q=this.nodes,ft=Q.length;for(var Y=0;Y<ft;Y++){var et=Q[Y];if(d&&et.child!=null)et.updateBounds();if(x=et.getLeft(),W=et.getRight(),S=et.getTop(),B=et.getBottom(),c>x)c=x;if(I<W)I=W;if(N>S)N=S;if(L<B)L=B}var s=new r(c,N,I-c,L-N);if(c==f.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(Q[0].getParent().paddingLeft!=null)tt=Q[0].getParent().paddingLeft;else tt=this.margin;this.left=s.x-tt,this.right=s.x+s.width+tt,this.top=s.y-tt,this.bottom=s.y+s.height+tt},e.calculateBounds=function(d){var c=f.MAX_VALUE,I=-f.MAX_VALUE,N=f.MAX_VALUE,L=-f.MAX_VALUE,x,W,S,B,tt=d.length;for(var Q=0;Q<tt;Q++){var ft=d[Q];if(x=ft.getLeft(),W=ft.getRight(),S=ft.getTop(),B=ft.getBottom(),c>x)c=x;if(I<W)I=W;if(N>S)N=S;if(L<B)L=B}var Y=new r(c,N,I-c,L-N);return Y},e.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){var d=0,c=this.nodes,I=c.length;for(var N=0;N<I;N++){var L=c[N];d+=L.calcEstimatedSize()}if(d==0)this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=d/Math.sqrt(this.nodes.length);return this.estimatedSize},e.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var c=new i,I=new Set,N=this.nodes[0],L,x,W=N.withChildren();W.forEach(function(Y){c.push(Y),I.add(Y)});while(c.length!==0){N=c.shift(),L=N.getEdges();var S=L.length;for(var B=0;B<S;B++){var tt=L[B];if(x=tt.getOtherEndInGraph(N,this),x!=null&&!I.has(x)){var Q=x.withChildren();Q.forEach(function(Y){c.push(Y),I.add(Y)})}}}if(this.isConnected=!1,I.size>=this.nodes.length){var ft=0;if(I.forEach(function(Y){if(Y.owner==d)ft++}),ft==this.nodes.length)this.isConnected=!0}},C.exports=e},function(C,F,D){var v,f=D(1);function o(n){v=D(6),this.layout=n,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var n=this.layout.newGraph(),a=this.layout.newNode(null),u=this.add(n,a);return this.setRootGraph(u),this.rootGraph},o.prototype.add=function(n,a,u,r,y){if(u==null&&r==null&&y==null){if(n==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(n)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(n),n.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return n.parent=a,a.child=n,n}else{y=u,r=a,u=n;var i=r.getOwner(),e=y.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(e!=null&&e.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==e)return u.isInterGraph=!1,i.add(u,r,y);else{if(u.isInterGraph=!0,u.source=r,u.target=y,this.edges.indexOf(u)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(u),!(u.source!=null&&u.target!=null))throw"Edge source and/or target is null!";if(!(u.source.edges.indexOf(u)==-1&&u.target.edges.indexOf(u)==-1))throw"Edge already in source and/or target incidency list!";return u.source.edges.push(u),u.target.edges.push(u),u}}},o.prototype.remove=function(n){if(n instanceof v){var a=n;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var u=[];u=u.concat(a.getEdges());var r,y=u.length;for(var i=0;i<y;i++)r=u[i],a.remove(r);var e=[];e=e.concat(a.getNodes());var g;y=e.length;for(var i=0;i<y;i++)g=e[i],a.remove(g);if(a==this.rootGraph)this.setRootGraph(null);var d=this.graphs.indexOf(a);this.graphs.splice(d,1),a.parent=null}else if(n instanceof f){if(r=n,r==null)throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(!(r.source!=null&&r.target!=null))throw"Source and/or target is null!";if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw"Source and/or target doesn't know this edge!";var d=r.source.edges.indexOf(r);if(r.source.edges.splice(d,1),d=r.target.edges.indexOf(r),r.target.edges.splice(d,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw"Not in owner graph manager's edge list!";var d=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(d,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<u;r++)n=n.concat(a[r].getNodes());this.allNodes=n}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<a.length;r++)n=n.concat(a[r].getEdges());n=n.concat(this.edges),this.allEdges=n}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(n){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=n},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(n){if(n.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=n,n.parent==null)n.parent=this.layout.newNode("Root node")},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(n,a){if(!(n!=null&&a!=null))throw"assert failed";if(n==a)return!0;var u=n.getOwner(),r;do{if(r=u.getParent(),r==null)break;if(r==a)return!0;if(u=r.getOwner(),u==null)break}while(!0);u=a.getOwner();do{if(r=u.getParent(),r==null)break;if(r==n)return!0;if(u=r.getOwner(),u==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){var n,a,u,r,y,i=this.getAllEdges(),e=i.length;for(var g=0;g<e;g++){if(n=i[g],a=n.source,u=n.target,n.lca=null,n.sourceInLca=a,n.targetInLca=u,a==u){n.lca=a.getOwner();continue}r=a.getOwner();while(n.lca==null){n.targetInLca=u,y=u.getOwner();while(n.lca==null){if(y==r){n.lca=y;break}if(y==this.rootGraph)break;if(n.lca!=null)throw"assert failed";n.targetInLca=y.getParent(),y=n.targetInLca.getOwner()}if(r==this.rootGraph)break;if(n.lca==null)n.sourceInLca=r.getParent(),r=n.sourceInLca.getOwner()}if(n.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(n,a){if(n==a)return n.getOwner();var u=n.getOwner();do{if(u==null)break;var r=a.getOwner();do{if(r==null)break;if(r==u)return r;r=r.getParent().getOwner()}while(!0);u=u.getParent().getOwner()}while(!0);return u},o.prototype.calcInclusionTreeDepths=function(n,a){if(n==null&&a==null)n=this.rootGraph,a=1;var u,r=n.getNodes(),y=r.length;for(var i=0;i<y;i++)if(u=r[i],u.inclusionTreeDepth=a,u.child!=null)this.calcInclusionTreeDepths(u.child,a+1)},o.prototype.includesInvalidEdge=function(){var n,a=[],u=this.edges.length;for(var r=0;r<u;r++)if(n=this.edges[r],this.isOneAncestorOfOther(n.source,n.target))a.push(n);for(var r=0;r<a.length;r++)this.remove(a[r]);return!1},C.exports=o},function(C,F,D){var v=D(12);function f(){}f.calcSeparationAmount=function(o,n,a,u){if(!o.intersects(n))throw"assert failed";var r=[,,];if(this.decideDirectionsForOverlappingNodes(o,n,r),a[0]=Math.min(o.getRight(),n.getRight())-Math.max(o.x,n.x),a[1]=Math.min(o.getBottom(),n.getBottom())-Math.max(o.y,n.y),o.getX()<=n.getX()&&o.getRight()>=n.getRight())a[0]+=Math.min(n.getX()-o.getX(),o.getRight()-n.getRight());else if(n.getX()<=o.getX()&&n.getRight()>=o.getRight())a[0]+=Math.min(o.getX()-n.getX(),n.getRight()-o.getRight());if(o.getY()<=n.getY()&&o.getBottom()>=n.getBottom())a[1]+=Math.min(n.getY()-o.getY(),o.getBottom()-n.getBottom());else if(n.getY()<=o.getY()&&n.getBottom()>=o.getBottom())a[1]+=Math.min(o.getY()-n.getY(),n.getBottom()-o.getBottom());var y=Math.abs((n.getCenterY()-o.getCenterY())/(n.getCenterX()-o.getCenterX()));if(n.getCenterY()===o.getCenterY()&&n.getCenterX()===o.getCenterX())y=1;var i=y*a[0],e=a[1]/y;if(a[0]<e)e=a[0];else i=a[1];a[0]=-1*r[0]*(e/2+u),a[1]=-1*r[1]*(i/2+u)},f.decideDirectionsForOverlappingNodes=function(o,n,a){if(o.getCenterX()<n.getCenterX())a[0]=-1;else a[0]=1;if(o.getCenterY()<n.getCenterY())a[1]=-1;else a[1]=1},f.getIntersection2=function(o,n,a){var u=o.getCenterX(),r=o.getCenterY(),y=n.getCenterX(),i=n.getCenterY();if(o.intersects(n))return a[0]=u,a[1]=r,a[2]=y,a[3]=i,!0;var e=o.getX(),g=o.getY(),d=o.getRight(),c=o.getX(),I=o.getBottom(),N=o.getRight(),L=o.getWidthHalf(),x=o.getHeightHalf(),W=n.getX(),S=n.getY(),B=n.getRight(),tt=n.getX(),Q=n.getBottom(),ft=n.getRight(),Y=n.getWidthHalf(),et=n.getHeightHalf(),s=!1,w=!1;if(u===y){if(r>i)return a[0]=u,a[1]=g,a[2]=y,a[3]=Q,!1;else if(r<i)return a[0]=u,a[1]=I,a[2]=y,a[3]=S,!1}else if(r===i){if(u>y)return a[0]=e,a[1]=r,a[2]=B,a[3]=i,!1;else if(u<y)return a[0]=d,a[1]=r,a[2]=W,a[3]=i,!1}else{var T=o.height/o.width,A=n.height/n.width,m=(i-r)/(y-u),H=void 0,U=void 0,q=void 0,Z=void 0,V=void 0,ht=void 0;if(-T===m)if(u>y)a[0]=c,a[1]=I,s=!0;else a[0]=d,a[1]=g,s=!0;else if(T===m)if(u>y)a[0]=e,a[1]=g,s=!0;else a[0]=N,a[1]=I,s=!0;if(-A===m)if(y>u)a[2]=tt,a[3]=Q,w=!0;else a[2]=B,a[3]=S,w=!0;else if(A===m)if(y>u)a[2]=W,a[3]=S,w=!0;else a[2]=ft,a[3]=Q,w=!0;if(s&&w)return!1;if(u>y)if(r>i)H=this.getCardinalDirection(T,m,4),U=this.getCardinalDirection(A,m,2);else H=this.getCardinalDirection(-T,m,3),U=this.getCardinalDirection(-A,m,1);else if(r>i)H=this.getCardinalDirection(-T,m,1),U=this.getCardinalDirection(-A,m,3);else H=this.getCardinalDirection(T,m,2),U=this.getCardinalDirection(A,m,4);if(!s)switch(H){case 1:Z=g,q=u+-x/m,a[0]=q,a[1]=Z;break;case 2:q=N,Z=r+L*m,a[0]=q,a[1]=Z;break;case 3:Z=I,q=u+x/m,a[0]=q,a[1]=Z;break;case 4:q=c,Z=r+-L*m,a[0]=q,a[1]=Z;break}if(!w)switch(U){case 1:ht=S,V=y+-et/m,a[2]=V,a[3]=ht;break;case 2:V=ft,ht=i+Y*m,a[2]=V,a[3]=ht;break;case 3:ht=Q,V=y+et/m,a[2]=V,a[3]=ht;break;case 4:V=tt,ht=i+-Y*m,a[2]=V,a[3]=ht;break}}return!1},f.getCardinalDirection=function(o,n,a){if(o>n)return a;else return 1+a%4},f.getIntersection=function(o,n,a,u){if(u==null)return this.getIntersection2(o,n,a);var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:I}=u,N=void 0,L=void 0,x=void 0,W=void 0,S=void 0,B=void 0,tt=void 0,Q=void 0,ft=void 0;if(x=e-y,S=r-i,tt=i*y-r*e,W=I-d,B=g-c,Q=c*d-g*I,ft=x*B-W*S,ft===0)return null;return N=(S*Q-B*tt)/ft,L=(W*tt-x*Q)/ft,new v(N,L)},f.angleOfVector=function(o,n,a,u){var r=void 0;if(o!==a){if(r=Math.atan((u-n)/(a-o)),a<o)r+=Math.PI;else if(u<n)r+=this.TWO_PI}else if(u<n)r=this.ONE_AND_HALF_PI;else r=this.HALF_PI;return r},f.doIntersect=function(o,n,a,u){var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:I}=u,N=(i-r)*(I-d)-(c-g)*(e-y);if(N===0)return!1;else{var L=((I-d)*(c-r)+(g-c)*(I-y))/N,x=((y-e)*(c-r)+(i-r)*(I-y))/N;return 0<L&&L<1&&0<x&&x<1}},f.findCircleLineIntersections=function(o,n,a,u,r,y,i){var e=(a-o)*(a-o)+(u-n)*(u-n),g=2*((o-r)*(a-o)+(n-y)*(u-n)),d=(o-r)*(o-r)+(n-y)*(n-y)-i*i,c=g*g-4*e*d;if(c>=0){var I=(-g+Math.sqrt(g*g-4*e*d))/(2*e),N=(-g-Math.sqrt(g*g-4*e*d))/(2*e),L=null;if(I>=0&&I<=1)return[I];if(N>=0&&N<=1)return[N];return L}else return null},f.HALF_PI=0.5*Math.PI,f.ONE_AND_HALF_PI=1.5*Math.PI,f.TWO_PI=2*Math.PI,f.THREE_PI=3*Math.PI,C.exports=f},function(C,F,D){function v(){}v.sign=function(f){if(f>0)return 1;else if(f<0)return-1;else return 0},v.floor=function(f){return f<0?Math.ceil(f):Math.floor(f)},v.ceil=function(f){return f<0?Math.floor(f):Math.ceil(f)},C.exports=v},function(C,F,D){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,C.exports=v},function(C,F,D){var v=function(){function r(y,i){for(var e=0;e<i.length;e++){var g=i[e];if(g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g)g.writable=!0;Object.defineProperty(y,g.key,g)}}return function(y,i,e){if(i)r(y.prototype,i);if(e)r(y,e);return y}}();function f(r,y){if(!(r instanceof y))throw TypeError("Cannot call a class as a function")}var o=function(y){return{value:y,next:null,prev:null}},n=function(y,i,e,g){if(y!==null)y.next=i;else g.head=i;if(e!==null)e.prev=i;else g.tail=i;return i.prev=y,i.next=e,g.length++,i},a=function(y,i){var{prev:e,next:g}=y;if(e!==null)e.next=g;else i.head=g;if(g!==null)g.prev=e;else i.tail=e;return y.prev=y.next=null,i.length--,y},u=function(){function r(y){var i=this;if(f(this,r),this.length=0,this.head=null,this.tail=null,y!=null)y.forEach(function(e){return i.push(e)})}return v(r,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(i,e){return n(e.prev,o(i),e,this)}},{key:"insertAfter",value:function(i,e){return n(e,o(i),e.next,this)}},{key:"insertNodeBefore",value:function(i,e){return n(e.prev,i,e,this)}},{key:"insertNodeAfter",value:function(i,e){return n(e,i,e.next,this)}},{key:"push",value:function(i){return n(this.tail,o(i),null,this)}},{key:"unshift",value:function(i){return n(null,o(i),this.head,this)}},{key:"remove",value:function(i){return a(i,this)}},{key:"pop",value:function(){return a(this.tail,this).value}},{key:"popNode",value:function(){return a(this.tail,this)}},{key:"shift",value:function(){return a(this.head,this).value}},{key:"shiftNode",value:function(){return a(this.head,this)}},{key:"get_object_at",value:function(i){if(i<=this.length()){var e=1,g=this.head;while(e<i)g=g.next,e++;return g.value}}},{key:"set_object_at",value:function(i,e){if(i<=this.length()){var g=1,d=this.head;while(g<i)d=d.next,g++;d.value=e}}}]),r}();C.exports=u},function(C,F,D){function v(f,o,n){if(this.x=null,this.y=null,f==null&&o==null&&n==null)this.x=0,this.y=0;else if(typeof f=="number"&&typeof o=="number"&&n==null)this.x=f,this.y=o;else if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.x=n.x,this.y=n.y}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.getLocation=function(){return new v(this.x,this.y)},v.prototype.setLocation=function(f,o,n){if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.setLocation(n.x,n.y);else if(typeof f=="number"&&typeof o=="number"&&n==null)if(parseInt(f)==f&&parseInt(o)==o)this.move(f,o);else this.x=Math.floor(f+0.5),this.y=Math.floor(o+0.5)},v.prototype.move=function(f,o){this.x=f,this.y=o},v.prototype.translate=function(f,o){this.x+=f,this.y+=o},v.prototype.equals=function(f){if(f.constructor.name=="Point"){var o=f;return this.x==o.x&&this.y==o.y}return this==f},v.prototype.toString=function(){return new v().constructor.name+"[x="+this.x+",y="+this.y+"]"},C.exports=v},function(C,F,D){function v(f,o,n,a){if(this.x=0,this.y=0,this.width=0,this.height=0,f!=null&&o!=null&&n!=null&&a!=null)this.x=f,this.y=o,this.width=n,this.height=a}v.prototype.getX=function(){return this.x},v.prototype.setX=function(f){this.x=f},v.prototype.getY=function(){return this.y},v.prototype.setY=function(f){this.y=f},v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},v.prototype.getRight=function(){return this.x+this.width},v.prototype.getBottom=function(){return this.y+this.height},v.prototype.intersects=function(f){if(this.getRight()<f.x)return!1;if(this.getBottom()<f.y)return!1;if(f.getRight()<this.x)return!1;if(f.getBottom()<this.y)return!1;return!0},v.prototype.getCenterX=function(){return this.x+this.width/2},v.prototype.getMinX=function(){return this.getX()},v.prototype.getMaxX=function(){return this.getX()+this.width},v.prototype.getCenterY=function(){return this.y+this.height/2},v.prototype.getMinY=function(){return this.getY()},v.prototype.getMaxY=function(){return this.getY()+this.height},v.prototype.getWidthHalf=function(){return this.width/2},v.prototype.getHeightHalf=function(){return this.height/2},C.exports=v},function(C,F,D){var v=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol==="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function f(){}f.lastID=0,f.createID=function(o){if(f.isPrimitive(o))return o;if(o.uniqueID!=null)return o.uniqueID;return o.uniqueID=f.getString(),f.lastID++,o.uniqueID},f.getString=function(o){if(o==null)o=f.lastID;return"Object#"+o},f.isPrimitive=function(o){var n=typeof o>"u"?"undefined":v(o);return o==null||n!="object"&&n!="function"},C.exports=f},function(C,F,D){function v(g){if(Array.isArray(g)){for(var d=0,c=Array(g.length);d<g.length;d++)c[d]=g[d];return c}else return Array.from(g)}var f=D(0),o=D(7),n=D(3),a=D(1),u=D(6),r=D(5),y=D(17),i=D(29);function e(g){if(i.call(this),this.layoutQuality=f.QUALITY,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=f.DEFAULT_INCREMENTAL,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,g!=null)this.isRemoteUse=g}e.RANDOM_SEED=1,e.prototype=Object.create(i.prototype),e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},e.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},e.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},e.prototype.newGraphManager=function(){var g=new o(this);return this.graphManager=g,g},e.prototype.newGraph=function(g){return new u(null,this.graphManager,g)},e.prototype.newNode=function(g){return new n(this.graphManager,g)},e.prototype.newEdge=function(g){return new a(null,null,g)},e.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},e.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var g;if(this.checkLayoutSuccess())g=!1;else g=this.layout();if(f.ANIMATE==="during")return!1;if(g){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,g},e.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},e.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var g,d=this.graphManager.getAllEdges();for(var c=0;c<d.length;c++)g=d[c];var I,N=this.graphManager.getRoot().getNodes();for(var c=0;c<N.length;c++)I=N[c];this.update(this.graphManager.getRoot())}},e.prototype.update=function(g){if(g==null)this.update2();else if(g instanceof n){var d=g;if(d.getChild()!=null){var c=d.getChild().getNodes();for(var I=0;I<c.length;I++)update(c[I])}if(d.vGraphObject!=null){var N=d.vGraphObject;N.update(d)}}else if(g instanceof a){var L=g;if(L.vGraphObject!=null){var x=L.vGraphObject;x.update(L)}}else if(g instanceof u){var W=g;if(W.vGraphObject!=null){var S=W.vGraphObject;S.update(W)}}},e.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=f.QUALITY,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=f.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},e.prototype.transform=function(g){if(g==null)this.transform(new r(0,0));else{var d=new y,c=this.graphManager.getRoot().updateLeftTop();if(c!=null){d.setWorldOrgX(g.x),d.setWorldOrgY(g.y),d.setDeviceOrgX(c.x),d.setDeviceOrgY(c.y);var I=this.getAllNodes(),N;for(var L=0;L<I.length;L++)N=I[L],N.transform(d)}}},e.prototype.positionNodesRandomly=function(g){if(g==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var d,c,I=g.getNodes();for(var N=0;N<I.length;N++)if(d=I[N],c=d.getChild(),c==null)d.scatter();else if(c.getNodes().length==0)d.scatter();else this.positionNodesRandomly(c),d.updateBounds()}},e.prototype.getFlatForest=function(){var g=[],d=!0,c=this.graphManager.getRoot().getNodes(),I=!0;for(var N=0;N<c.length;N++)if(c[N].getChild()!=null)I=!1;if(!I)return g;var L=new Set,x=[],W=new Map,S=[];S=S.concat(c);while(S.length>0&&d){x.push(S[0]);while(x.length>0&&d){var B=x[0];x.splice(0,1),L.add(B);var tt=B.getEdges();for(var N=0;N<tt.length;N++){var Q=tt[N].getOtherEnd(B);if(W.get(B)!=Q)if(!L.has(Q))x.push(Q),W.set(Q,B);else{d=!1;break}}}if(!d)g=[];else{var ft=[].concat(v(L));g.push(ft);for(var N=0;N<ft.length;N++){var Y=ft[N],et=S.indexOf(Y);if(et>-1)S.splice(et,1)}L=new Set,W=new Map}}return g},e.prototype.createDummyNodesForBendpoints=function(g){var d=[],c=g.source,I=this.graphManager.calcLowestCommonAncestor(g.source,g.target);for(var N=0;N<g.bendpoints.length;N++){var L=this.newNode(null);L.setRect(new Point(0,0),new Dimension(1,1)),I.add(L);var x=this.newEdge(null);this.graphManager.add(x,c,L),d.add(L),c=L}var x=this.newEdge(null);if(this.graphManager.add(x,c,g.target),this.edgeToDummyNodes.set(g,d),g.isInterGraph())this.graphManager.remove(g);else I.remove(g);return d},e.prototype.createBendpointsFromDummyNodes=function(){var g=[];g=g.concat(this.graphManager.getAllEdges()),g=[].concat(v(this.edgeToDummyNodes.keys())).concat(g);for(var d=0;d<g.length;d++){var c=g[d];if(c.bendpoints.length>0){var I=this.edgeToDummyNodes.get(c);for(var N=0;N<I.length;N++){var L=I[N],x=new r(L.getCenterX(),L.getCenterY()),W=c.bendpoints.get(N);W.x=x.x,W.y=x.y,L.getOwner().remove(L)}this.graphManager.add(c,c.source,c.target)}}},e.transform=function(g,d,c,I){if(c!=null&&I!=null){var N=d;if(g<=50){var L=d/c;N-=(d-L)/50*(50-g)}else{var x=d*I;N+=(x-d)/50*(g-50)}return N}else{var W,S;if(g<=50)W=9*d/500,S=d/10;else W=9*d/50,S=-8*d;return W*g+S}},e.findCenterOfTree=function(g){var d=[];d=d.concat(g);var c=[],I=new Map,N=!1,L=null;if(d.length==1||d.length==2)N=!0,L=d[0];for(var x=0;x<d.length;x++){var W=d[x],S=W.getNeighborsList().size;if(I.set(W,W.getNeighborsList().size),S==1)c.push(W)}var B=[];B=B.concat(c);while(!N){var tt=[];tt=tt.concat(B),B=[];for(var x=0;x<d.length;x++){var W=d[x],Q=d.indexOf(W);if(Q>=0)d.splice(Q,1);var ft=W.getNeighborsList();ft.forEach(function(s){if(c.indexOf(s)<0){var w=I.get(s),T=w-1;if(T==1)B.push(s);I.set(s,T)}})}if(c=c.concat(B),d.length==1||d.length==2)N=!0,L=d[0]}return L},e.prototype.setGraphManager=function(g){this.graphManager=g},C.exports=e},function(C,F,D){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},C.exports=v},function(C,F,D){var v=D(5);function f(o,n){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}f.prototype.getWorldOrgX=function(){return this.lworldOrgX},f.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},f.prototype.getWorldOrgY=function(){return this.lworldOrgY},f.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},f.prototype.getWorldExtX=function(){return this.lworldExtX},f.prototype.setWorldExtX=function(o){this.lworldExtX=o},f.prototype.getWorldExtY=function(){return this.lworldExtY},f.prototype.setWorldExtY=function(o){this.lworldExtY=o},f.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},f.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},f.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},f.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},f.prototype.getDeviceExtX=function(){return this.ldeviceExtX},f.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},f.prototype.getDeviceExtY=function(){return this.ldeviceExtY},f.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},f.prototype.transformX=function(o){var n=0,a=this.lworldExtX;if(a!=0)n=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/a;return n},f.prototype.transformY=function(o){var n=0,a=this.lworldExtY;if(a!=0)n=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/a;return n},f.prototype.inverseTransformX=function(o){var n=0,a=this.ldeviceExtX;if(a!=0)n=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/a;return n},f.prototype.inverseTransformY=function(o){var n=0,a=this.ldeviceExtY;if(a!=0)n=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/a;return n},f.prototype.inverseTransformPoint=function(o){var n=new v(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return n},C.exports=f},function(C,F,D){function v(i){if(Array.isArray(i)){for(var e=0,g=Array(i.length);e<i.length;e++)g[e]=i[e];return g}else return Array.from(i)}var f=D(15),o=D(4),n=D(0),a=D(8),u=D(9);function r(){f.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}r.prototype=Object.create(f.prototype);for(var y in f)r[y]=f[y];r.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},r.prototype.calcIdealEdgeLengths=function(){var i,e,g,d,c,I,N,L=this.getGraphManager().getAllEdges();for(var x=0;x<L.length;x++)if(i=L[x],e=i.idealLength,i.isInterGraph){if(d=i.getSource(),c=i.getTarget(),I=i.getSourceInLca().getEstimatedSize(),N=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)i.idealLength+=I+N-2*n.SIMPLE_NODE_SIZE;g=i.getLca().getInclusionTreeDepth(),i.idealLength+=e*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+c.getInclusionTreeDepth()-2*g)}},r.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;if(this.incremental){if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){var i=this.getAllEdges(),e;for(var g=0;g<i.length;g++)e=i[g],this.calcSpringForce(e,e.idealLength)},r.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g,d,c,I,N=this.getAllNodes(),L;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&i)this.updateGrid();L=new Set;for(g=0;g<N.length;g++)c=N[g],this.calculateRepulsionForceOfANode(c,L,i,e),L.add(c)}else for(g=0;g<N.length;g++){c=N[g];for(d=g+1;d<N.length;d++){if(I=N[d],c.getOwner()!=I.getOwner())continue;this.calcRepulsionForce(c,I)}}},r.prototype.calcGravitationalForces=function(){var i,e=this.getAllNodesToApplyGravitation();for(var g=0;g<e.length;g++)i=e[g],this.calcGravitationalForce(i)},r.prototype.moveNodes=function(){var i=this.getAllNodes(),e;for(var g=0;g<i.length;g++)e=i[g],e.move()},r.prototype.calcSpringForce=function(i,e){var g=i.getSource(),d=i.getTarget(),c,I,N,L;if(this.uniformLeafNodeSizes&&g.getChild()==null&&d.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;if(c=i.getLength(),c==0)return;I=i.edgeElasticity*(c-e),N=I*(i.lengthX/c),L=I*(i.lengthY/c),g.springForceX+=N,g.springForceY+=L,d.springForceX-=N,d.springForceY-=L},r.prototype.calcRepulsionForce=function(i,e){var g=i.getRect(),d=e.getRect(),c=[,,],I=[,,,,],N,L,x,W,S,B,tt;if(g.intersects(d)){a.calcSeparationAmount(g,d,c,o.DEFAULT_EDGE_LENGTH/2),B=2*c[0],tt=2*c[1];var Q=i.noOfChildren*e.noOfChildren/(i.noOfChildren+e.noOfChildren);i.repulsionForceX-=Q*B,i.repulsionForceY-=Q*tt,e.repulsionForceX+=Q*B,e.repulsionForceY+=Q*tt}else{if(this.uniformLeafNodeSizes&&i.getChild()==null&&e.getChild()==null)N=d.getCenterX()-g.getCenterX(),L=d.getCenterY()-g.getCenterY();else a.getIntersection(g,d,I),N=I[2]-I[0],L=I[3]-I[1];if(Math.abs(N)<o.MIN_REPULSION_DIST)N=u.sign(N)*o.MIN_REPULSION_DIST;if(Math.abs(L)<o.MIN_REPULSION_DIST)L=u.sign(L)*o.MIN_REPULSION_DIST;x=N*N+L*L,W=Math.sqrt(x),S=(i.nodeRepulsion/2+e.nodeRepulsion/2)*i.noOfChildren*e.noOfChildren/x,B=S*N/W,tt=S*L/W,i.repulsionForceX-=B,i.repulsionForceY-=tt,e.repulsionForceX+=B,e.repulsionForceY+=tt}},r.prototype.calcGravitationalForce=function(i){var e,g,d,c,I,N,L,x;if(e=i.getOwner(),g=(e.getRight()+e.getLeft())/2,d=(e.getTop()+e.getBottom())/2,c=i.getCenterX()-g,I=i.getCenterY()-d,N=Math.abs(c)+i.getWidth()/2,L=Math.abs(I)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()){if(x=e.getEstimatedSize()*this.gravityRangeFactor,N>x||L>x)i.gravitationForceX=-this.gravityConstant*c,i.gravitationForceY=-this.gravityConstant*I}else if(x=e.getEstimatedSize()*this.compoundGravityRangeFactor,N>x||L>x)i.gravitationForceX=-this.gravityConstant*c*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*I*this.compoundGravityConstant},r.prototype.isConverged=function(){var i,e=!1;if(this.totalIterations>this.maxIterations/3)e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||e},r.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},r.prototype.calcNoOfChildrenForAllNodes=function(){var i,e=this.graphManager.getAllNodes();for(var g=0;g<e.length;g++)i=e[g],i.noOfChildren=i.getNoOfChildren()},r.prototype.calcGrid=function(i){var e=0,g=0;e=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),g=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));var d=Array(e);for(var c=0;c<e;c++)d[c]=Array(g);for(var c=0;c<e;c++)for(var I=0;I<g;I++)d[c][I]=[];return d},r.prototype.addNodeToGrid=function(i,e,g){var d=0,c=0,I=0,N=0;d=parseInt(Math.floor((i.getRect().x-e)/this.repulsionRange)),c=parseInt(Math.floor((i.getRect().width+i.getRect().x-e)/this.repulsionRange)),I=parseInt(Math.floor((i.getRect().y-g)/this.repulsionRange)),N=parseInt(Math.floor((i.getRect().height+i.getRect().y-g)/this.repulsionRange));for(var L=d;L<=c;L++)for(var x=I;x<=N;x++)this.grid[L][x].push(i),i.setGridCoordinates(d,c,I,N)},r.prototype.updateGrid=function(){var i,e,g=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(i=0;i<g.length;i++)e=g[i],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(i,e,g,d){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&g||d){var c=new Set;i.surrounding=[];var I,N=this.grid;for(var L=i.startX-1;L<i.finishX+2;L++)for(var x=i.startY-1;x<i.finishY+2;x++)if(!(L<0||x<0||L>=N.length||x>=N[0].length))for(var W=0;W<N[L][x].length;W++){if(I=N[L][x][W],i.getOwner()!=I.getOwner()||i==I)continue;if(!e.has(I)&&!c.has(I)){var S=Math.abs(i.getCenterX()-I.getCenterX())-(i.getWidth()/2+I.getWidth()/2),B=Math.abs(i.getCenterY()-I.getCenterY())-(i.getHeight()/2+I.getHeight()/2);if(S<=this.repulsionRange&&B<=this.repulsionRange)c.add(I)}}i.surrounding=[].concat(v(c))}for(L=0;L<i.surrounding.length;L++)this.calcRepulsionForce(i,i.surrounding[L])},r.prototype.calcRepulsionRange=function(){return 0},C.exports=r},function(C,F,D){var v=D(1),f=D(4);function o(a,u,r){v.call(this,a,u,r),this.idealLength=f.DEFAULT_EDGE_LENGTH,this.edgeElasticity=f.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];C.exports=o},function(C,F,D){var v=D(3),f=D(4);function o(a,u,r,y){v.call(this,a,u,r,y),this.nodeRepulsion=f.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=[]}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];o.prototype.setGridCoordinates=function(a,u,r,y){this.startX=a,this.finishX=u,this.startY=r,this.finishY=y},C.exports=o},function(C,F,D){function v(f,o){if(this.width=0,this.height=0,f!==null&&o!==null)this.height=o,this.width=f}v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},C.exports=v},function(C,F,D){var v=D(14);function f(){this.map={},this.keys=[]}f.prototype.put=function(o,n){var a=v.createID(o);if(!this.contains(a))this.map[a]=n,this.keys.push(o)},f.prototype.contains=function(o){var n=v.createID(o);return this.map[o]!=null},f.prototype.get=function(o){var n=v.createID(o);return this.map[n]},f.prototype.keySet=function(){return this.keys},C.exports=f},function(C,F,D){var v=D(14);function f(){this.set={}}f.prototype.add=function(o){var n=v.createID(o);if(!this.contains(n))this.set[n]=o},f.prototype.remove=function(o){delete this.set[v.createID(o)]},f.prototype.clear=function(){this.set={}},f.prototype.contains=function(o){return this.set[v.createID(o)]==o},f.prototype.isEmpty=function(){return this.size()===0},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAllTo=function(o){var n=Object.keys(this.set),a=n.length;for(var u=0;u<a;u++)o.push(this.set[n[u]])},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAll=function(o){var n=o.length;for(var a=0;a<n;a++){var u=o[a];this.add(u)}},C.exports=f},function(C,F,D){function v(){}v.multMat=function(f,o){var n=[];for(var a=0;a<f.length;a++){n[a]=[];for(var u=0;u<o[0].length;u++){n[a][u]=0;for(var r=0;r<f[0].length;r++)n[a][u]+=f[a][r]*o[r][u]}}return n},v.transpose=function(f){var o=[];for(var n=0;n<f[0].length;n++){o[n]=[];for(var a=0;a<f.length;a++)o[n][a]=f[a][n]}return o},v.multCons=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]*o;return n},v.minusOp=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]-o[a];return n},v.dotProduct=function(f,o){var n=0;for(var a=0;a<f.length;a++)n+=f[a]*o[a];return n},v.mag=function(f){return Math.sqrt(this.dotProduct(f,f))},v.normalize=function(f){var o=[],n=this.mag(f);for(var a=0;a<f.length;a++)o[a]=f[a]/n;return o},v.multGamma=function(f){var o=[],n=0;for(var a=0;a<f.length;a++)n+=f[a];n*=-1/f.length;for(var u=0;u<f.length;u++)o[u]=n+f[u];return o},v.multL=function(f,o,n){var a=[],u=[],r=[];for(var y=0;y<o[0].length;y++){var i=0;for(var e=0;e<o.length;e++)i+=-0.5*o[e][y]*f[e];u[y]=i}for(var g=0;g<n.length;g++){var d=0;for(var c=0;c<n.length;c++)d+=n[g][c]*u[c];r[g]=d}for(var I=0;I<o.length;I++){var N=0;for(var L=0;L<o[0].length;L++)N+=o[I][L]*r[L];a[I]=N}return a},C.exports=v},function(C,F,D){var v=function(){function a(u,r){for(var y=0;y<r.length;y++){var i=r[y];if(i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i)i.writable=!0;Object.defineProperty(u,i.key,i)}}return function(u,r,y){if(r)a(u.prototype,r);if(y)a(u,y);return u}}();function f(a,u){if(!(a instanceof u))throw TypeError("Cannot call a class as a function")}var o=D(11),n=function(){function a(u,r){if(f(this,a),r!==null||r!==void 0)this.compareFunction=this._defaultCompareFunction;var y=void 0;if(u instanceof o)y=u.size();else y=u.length;this._quicksort(u,0,y-1)}return v(a,[{key:"_quicksort",value:function(r,y,i){if(y<i){var e=this._partition(r,y,i);this._quicksort(r,y,e),this._quicksort(r,e+1,i)}}},{key:"_partition",value:function(r,y,i){var e=this._get(r,y),g=y,d=i;while(!0){while(this.compareFunction(e,this._get(r,d)))d--;while(this.compareFunction(this._get(r,g),e))g++;if(g<d)this._swap(r,g,d),g++,d--;else return d}}},{key:"_get",value:function(r,y){if(r instanceof o)return r.get_object_at(y);else return r[y]}},{key:"_set",value:function(r,y,i){if(r instanceof o)r.set_object_at(y,i);else r[y]=i}},{key:"_swap",value:function(r,y,i){var e=this._get(r,y);this._set(r,y,this._get(r,i)),this._set(r,i,e)}},{key:"_defaultCompareFunction",value:function(r,y){return y>r}}]),a}();C.exports=n},function(C,F,D){function v(){}v.svd=function(f){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=f.length,this.n=f[0].length;var o=Math.min(this.m,this.n);this.s=function(Vt){var Pt=[];while(Vt-- >0)Pt.push(0);return Pt}(Math.min(this.m+1,this.n)),this.U=function(Vt){var Pt=function se(Bt){if(Bt.length==0)return 0;else{var te=[];for(var ne=0;ne<Bt[0];ne++)te.push(se(Bt.slice(1)));return te}};return Pt(Vt)}([this.m,o]),this.V=function(Vt){var Pt=function se(Bt){if(Bt.length==0)return 0;else{var te=[];for(var ne=0;ne<Bt[0];ne++)te.push(se(Bt.slice(1)));return te}};return Pt(Vt)}([this.n,this.n]);var n=function(Vt){var Pt=[];while(Vt-- >0)Pt.push(0);return Pt}(this.n),a=function(Vt){var Pt=[];while(Vt-- >0)Pt.push(0);return Pt}(this.m),u=!0,r=!0,y=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m));for(var e=0;e<Math.max(y,i);e++){if(e<y){this.s[e]=0;for(var g=e;g<this.m;g++)this.s[e]=v.hypot(this.s[e],f[g][e]);if(this.s[e]!==0){if(f[e][e]<0)this.s[e]=-this.s[e];for(var d=e;d<this.m;d++)f[d][e]/=this.s[e];f[e][e]+=1}this.s[e]=-this.s[e]}for(var c=e+1;c<this.n;c++){if(function(Vt,Pt){return Vt&&Pt}(e<y,this.s[e]!==0)){var I=0;for(var N=e;N<this.m;N++)I+=f[N][e]*f[N][c];I=-I/f[e][e];for(var L=e;L<this.m;L++)f[L][c]+=I*f[L][e]}n[c]=f[e][c]}if(function(Vt,Pt){return Vt&&Pt}(u,e<y))for(var x=e;x<this.m;x++)this.U[x][e]=f[x][e];if(e<i){n[e]=0;for(var W=e+1;W<this.n;W++)n[e]=v.hypot(n[e],n[W]);if(n[e]!==0){if(n[e+1]<0)n[e]=-n[e];for(var S=e+1;S<this.n;S++)n[S]/=n[e];n[e+1]+=1}if(n[e]=-n[e],function(Vt,Pt){return Vt&&Pt}(e+1<this.m,n[e]!==0)){for(var B=e+1;B<this.m;B++)a[B]=0;for(var tt=e+1;tt<this.n;tt++)for(var Q=e+1;Q<this.m;Q++)a[Q]+=n[tt]*f[Q][tt];for(var ft=e+1;ft<this.n;ft++){var Y=-n[ft]/n[e+1];for(var et=e+1;et<this.m;et++)f[et][ft]+=Y*a[et]}}if(r)for(var s=e+1;s<this.n;s++)this.V[s][e]=n[s]}}var w=Math.min(this.n,this.m+1);if(y<this.n)this.s[y]=f[y][y];if(this.m<w)this.s[w-1]=0;if(i+1<w)n[i]=f[i][w-1];if(n[w-1]=0,u){for(var T=y;T<o;T++){for(var A=0;A<this.m;A++)this.U[A][T]=0;this.U[T][T]=1}for(var m=y-1;m>=0;m--)if(this.s[m]!==0){for(var H=m+1;H<o;H++){var U=0;for(var q=m;q<this.m;q++)U+=this.U[q][m]*this.U[q][H];U=-U/this.U[m][m];for(var Z=m;Z<this.m;Z++)this.U[Z][H]+=U*this.U[Z][m]}for(var V=m;V<this.m;V++)this.U[V][m]=-this.U[V][m];this.U[m][m]=1+this.U[m][m];for(var ht=0;ht<m-1;ht++)this.U[ht][m]=0}else{for(var vt=0;vt<this.m;vt++)this.U[vt][m]=0;this.U[m][m]=1}}if(r)for(var k=this.n-1;k>=0;k--){if(function(Vt,Pt){return Vt&&Pt}(k<i,n[k]!==0))for(var dt=k+1;dt<o;dt++){var at=0;for(var b=k+1;b<this.n;b++)at+=this.V[b][k]*this.V[b][dt];at=-at/this.V[k+1][k];for(var _=k+1;_<this.n;_++)this.V[_][dt]+=at*this.V[_][k]}for(var rt=0;rt<this.n;rt++)this.V[rt][k]=0;this.V[k][k]=1}var gt=w-1,Lt=0,Gt=Math.pow(2,-52),Zt=Math.pow(2,-966);while(w>0){var ct=void 0,jt=void 0;for(ct=w-2;ct>=-1;ct--){if(ct===-1)break;if(Math.abs(n[ct])<=Zt+Gt*(Math.abs(this.s[ct])+Math.abs(this.s[ct+1]))){n[ct]=0;break}}if(ct===w-2)jt=4;else{var Ht=void 0;for(Ht=w-1;Ht>=ct;Ht--){if(Ht===ct)break;var Tt=(Ht!==w?Math.abs(n[Ht]):0)+(Ht!==ct+1?Math.abs(n[Ht-1]):0);if(Math.abs(this.s[Ht])<=Zt+Gt*Tt){this.s[Ht]=0;break}}if(Ht===ct)jt=3;else if(Ht===w-1)jt=1;else jt=2,ct=Ht}switch(ct++,jt){case 1:{var pt=n[w-2];n[w-2]=0;for(var It=w-2;It>=ct;It--){var St=v.hypot(this.s[It],pt),Ut=this.s[It]/St,Ft=pt/St;if(this.s[It]=St,It!==ct)pt=-Ft*n[It-1],n[It-1]=Ut*n[It-1];if(r)for(var bt=0;bt<this.n;bt++)St=Ut*this.V[bt][It]+Ft*this.V[bt][w-1],this.V[bt][w-1]=-Ft*this.V[bt][It]+Ut*this.V[bt][w-1],this.V[bt][It]=St}}break;case 2:{var Wt=n[ct-1];n[ct-1]=0;for(var $t=ct;$t<w;$t++){var re=v.hypot(this.s[$t],Wt),Qt=this.s[$t]/re,_t=Wt/re;if(this.s[$t]=re,Wt=-_t*n[$t],n[$t]=Qt*n[$t],u)for(var qt=0;qt<this.m;qt++)re=Qt*this.U[qt][$t]+_t*this.U[qt][ct-1],this.U[qt][ct-1]=-_t*this.U[qt][$t]+Qt*this.U[qt][ct-1],this.U[qt][$t]=re}}break;case 3:{var J=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[w-1]),Math.abs(this.s[w-2])),Math.abs(n[w-2])),Math.abs(this.s[ct])),Math.abs(n[ct])),it=this.s[w-1]/J,nt=this.s[w-2]/J,ot=n[w-2]/J,st=this.s[ct]/J,ut=n[ct]/J,Dt=((nt+it)*(nt-it)+ot*ot)/2,Ct=it*ot*(it*ot),lt=0;if(function(Vt,Pt){return Vt||Pt}(Dt!==0,Ct!==0)){if(lt=Math.sqrt(Dt*Dt+Ct),Dt<0)lt=-lt;lt=Ct/(Dt+lt)}var wt=(st+it)*(st-it)+lt,At=st*ut;for(var yt=ct;yt<w-1;yt++){var xt=v.hypot(wt,At),Yt=wt/xt,Nt=At/xt;if(yt!==ct)n[yt-1]=xt;if(wt=Yt*this.s[yt]+Nt*n[yt],n[yt]=Yt*n[yt]-Nt*this.s[yt],At=Nt*this.s[yt+1],this.s[yt+1]=Yt*this.s[yt+1],r)for(var mt=0;mt<this.n;mt++)xt=Yt*this.V[mt][yt]+Nt*this.V[mt][yt+1],this.V[mt][yt+1]=-Nt*this.V[mt][yt]+Yt*this.V[mt][yt+1],this.V[mt][yt]=xt;if(xt=v.hypot(wt,At),Yt=wt/xt,Nt=At/xt,this.s[yt]=xt,wt=Yt*n[yt]+Nt*this.s[yt+1],this.s[yt+1]=-Nt*n[yt]+Yt*this.s[yt+1],At=Nt*n[yt+1],n[yt+1]=Yt*n[yt+1],u&&yt<this.m-1)for(var Ot=0;Ot<this.m;Ot++)xt=Yt*this.U[Ot][yt]+Nt*this.U[Ot][yt+1],this.U[Ot][yt+1]=-Nt*this.U[Ot][yt]+Yt*this.U[Ot][yt+1],this.U[Ot][yt]=xt}n[w-2]=wt,Lt=Lt+1}break;case 4:{if(this.s[ct]<=0){if(this.s[ct]=this.s[ct]<0?-this.s[ct]:0,r)for(var Et=0;Et<=gt;Et++)this.V[Et][ct]=-this.V[Et][ct]}while(ct<gt){if(this.s[ct]>=this.s[ct+1])break;var Mt=this.s[ct];if(this.s[ct]=this.s[ct+1],this.s[ct+1]=Mt,r&&ct<this.n-1)for(var kt=0;kt<this.n;kt++)Mt=this.V[kt][ct+1],this.V[kt][ct+1]=this.V[kt][ct],this.V[kt][ct]=Mt;if(u&&ct<this.m-1)for(var zt=0;zt<this.m;zt++)Mt=this.U[zt][ct+1],this.U[zt][ct+1]=this.U[zt][ct],this.U[zt][ct]=Mt;ct++}Lt=0,w--}break}}var ie={U:this.U,V:this.V,S:this.s};return ie},v.hypot=function(f,o){var n=void 0;if(Math.abs(f)>Math.abs(o))n=o/f,n=Math.abs(f)*Math.sqrt(1+n*n);else if(o!=0)n=f/o,n=Math.abs(o)*Math.sqrt(1+n*n);else n=0;return n},C.exports=v},function(C,F,D){var v=function(){function n(a,u){for(var r=0;r<u.length;r++){var y=u[r];if(y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y)y.writable=!0;Object.defineProperty(a,y.key,y)}}return function(a,u,r){if(u)n(a.prototype,u);if(r)n(a,r);return a}}();function f(n,a){if(!(n instanceof a))throw TypeError("Cannot call a class as a function")}var o=function(){function n(a,u){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;f(this,n),this.sequence1=a,this.sequence2=u,this.match_score=r,this.mismatch_penalty=y,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=u.length+1,this.grid=Array(this.iMax);for(var e=0;e<this.iMax;e++){this.grid[e]=Array(this.jMax);for(var g=0;g<this.jMax;g++)this.grid[e][g]=0}this.tracebackGrid=Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.tracebackGrid[d][c]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return v(n,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var u=1;u<this.jMax;u++)this.grid[0][u]=this.grid[0][u-1]+this.gap_penalty,this.tracebackGrid[0][u]=[!1,!1,!0];for(var r=1;r<this.iMax;r++)this.grid[r][0]=this.grid[r-1][0]+this.gap_penalty,this.tracebackGrid[r][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var i=1;i<this.jMax;i++){var e=void 0;if(this.sequence1[y-1]===this.sequence2[i-1])e=this.grid[y-1][i-1]+this.match_score;else e=this.grid[y-1][i-1]+this.mismatch_penalty;var g=this.grid[y-1][i]+this.gap_penalty,d=this.grid[y][i-1]+this.gap_penalty,c=[e,g,d],I=this.arrayAllMaxIndexes(c);this.grid[y][i]=c[I[0]],this.tracebackGrid[y][i]=[I.includes(0),I.includes(1),I.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var u=[];u.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(u[0]){var r=u[0],y=this.tracebackGrid[r.pos[0]][r.pos[1]];if(y[0])u.push({pos:[r.pos[0]-1,r.pos[1]-1],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(y[1])u.push({pos:[r.pos[0]-1,r.pos[1]],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:"-"+r.seq2});if(y[2])u.push({pos:[r.pos[0],r.pos[1]-1],seq1:"-"+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(r.pos[0]===0&&r.pos[1]===0)this.alignments.push({sequence1:r.seq1,sequence2:r.seq2});u.shift()}return this.alignments}},{key:"getAllIndexes",value:function(u,r){var y=[],i=-1;while((i=u.indexOf(r,i+1))!==-1)y.push(i);return y}},{key:"arrayAllMaxIndexes",value:function(u){return this.getAllIndexes(u,Math.max.apply(null,u))}}]),n}();C.exports=o},function(C,F,D){var v=function(){return};v.FDLayout=D(18),v.FDLayoutConstants=D(4),v.FDLayoutEdge=D(19),v.FDLayoutNode=D(20),v.DimensionD=D(21),v.HashMap=D(22),v.HashSet=D(23),v.IGeometry=D(8),v.IMath=D(9),v.Integer=D(10),v.Point=D(12),v.PointD=D(5),v.RandomSeed=D(16),v.RectangleD=D(13),v.Transform=D(17),v.UniqueIDGeneretor=D(14),v.Quicksort=D(25),v.LinkedList=D(11),v.LGraphObject=D(2),v.LGraph=D(6),v.LEdge=D(1),v.LGraphManager=D(7),v.LNode=D(3),v.Layout=D(15),v.LayoutConstants=D(0),v.NeedlemanWunsch=D(27),v.Matrix=D(24),v.SVD=D(26),C.exports=v},function(C,F,D){function v(){this.listeners=[]}var f=v.prototype;f.addListener=function(o,n){this.listeners.push({event:o,callback:n})},f.removeListener=function(o,n){for(var a=this.listeners.length;a>=0;a--){var u=this.listeners[a];if(u.event===o&&u.callback===n)this.listeners.splice(a,1)}},f.emit=function(o,n){for(var a=0;a<this.listeners.length;a++){var u=this.listeners[a];if(o===u.event)u.callback(n)}},C.exports=v}])})});var Pe=yn(function(Ne,Fe){(function(F,D){if(typeof Ne==="object"&&typeof Fe==="object")Fe.exports=D(Se());else if(typeof define==="function"&&define.amd)define(["layout-base"],D);else if(typeof Ne==="object")Ne.coseBase=D(Se());else F.coseBase=D(F.layoutBase)})(Ne,function(C){return(()=>{var F={45:(o,n,a)=>{var u={};u.layoutBase=a(551),u.CoSEConstants=a(806),u.CoSEEdge=a(767),u.CoSEGraph=a(880),u.CoSEGraphManager=a(578),u.CoSELayout=a(765),u.CoSENode=a(991),u.ConstraintHandler=a(902),o.exports=u},806:(o,n,a)=>{var u=a(551).FDLayoutConstants;function r(){}for(var y in u)r[y]=u[y];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,o.exports=r},767:(o,n,a)=>{var u=a(551).FDLayoutEdge;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},880:(o,n,a)=>{var u=a(551).LGraph;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},578:(o,n,a)=>{var u=a(551).LGraphManager;function r(i){u.call(this,i)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},765:(o,n,a)=>{var u=a(551).FDLayout,r=a(578),y=a(880),i=a(991),e=a(767),g=a(806),d=a(902),c=a(551).FDLayoutConstants,I=a(551).LayoutConstants,N=a(551).Point,L=a(551).PointD,x=a(551).DimensionD,W=a(551).Layout,S=a(551).Integer,B=a(551).IGeometry,tt=a(551).LGraph,Q=a(551).Transform,ft=a(551).LinkedList;function Y(){u.call(this),this.toBeTiled={},this.constraints={}}Y.prototype=Object.create(u.prototype);for(var et in u)Y[et]=u[et];Y.prototype.newGraphManager=function(){var s=new r(this);return this.graphManager=s,s},Y.prototype.newGraph=function(s){return new y(null,this.graphManager,s)},Y.prototype.newNode=function(s){return new i(this.graphManager,s)},Y.prototype.newEdge=function(s){return new e(null,null,s)},Y.prototype.initParameters=function(){if(u.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(g.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=g.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=g.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},Y.prototype.initSpringEmbedder=function(){u.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},Y.prototype.layout=function(){var s=I.DEFAULT_CREATE_BENDS_AS_NEEDED;if(s)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},Y.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 s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var w=new Set(this.getAllNodes()),T=this.nodesWithGravity.filter(function(A){return w.has(A)});this.graphManager.setAllNodesToApplyGravitation(T),this.positionNodesRandomly()}}else if(g.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var w=new Set(this.getAllNodes()),T=this.nodesWithGravity.filter(function(H){return w.has(H)});this.graphManager.setAllNodesToApplyGravitation(T)}if(Object.keys(this.constraints).length>0)d.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),g.APPLY_LAYOUT)this.runSpringEmbedder();return!0},Y.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%c.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 s=new Set(this.getAllNodes()),w=this.nodesWithGravity.filter(function(m){return s.has(m)});if(this.graphManager.setAllNodesToApplyGravitation(w),this.graphManager.updateBounds(),this.updateGrid(),g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=c.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(g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var T=!this.isTreeGrowing&&!this.isGrowthFinished,A=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(T,A),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},Y.prototype.getPositionsData=function(){var s=this.graphManager.getAllNodes(),w={};for(var T=0;T<s.length;T++){var A=s[T].rect,m=s[T].id;w[m]={id:m,x:A.getCenterX(),y:A.getCenterY(),w:A.width,h:A.height}}return w},Y.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(c.ANIMATE==="during")this.emit("layoutstarted");else{while(!s)s=this.tick();this.graphManager.updateBounds()}},Y.prototype.moveNodes=function(){var s=this.getAllNodes(),w;for(var T=0;T<s.length;T++)w=s[T],w.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var T=0;T<s.length;T++)w=s[T],w.move()},Y.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var w=this.graphManager.getAllNodes();for(var T=0;T<w.length;T++){var A=w[T];this.idToNodeMap.set(A.id,A)}var m=function b(_){var rt=_.getChild().getNodes(),gt,Lt=0;for(var Gt=0;Gt<rt.length;Gt++)if(gt=rt[Gt],gt.getChild()==null){if(s.fixedNodeSet.has(gt.id))Lt+=100}else Lt+=b(gt);return Lt};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(rt){s.fixedNodeSet.add(rt.nodeId)});var w=this.graphManager.getAllNodes(),A;for(var T=0;T<w.length;T++)if(A=w[T],A.getChild()!=null){var H=m(A);if(H>0)A.fixedNodeWeight=H}}if(this.constraints.relativePlacementConstraint){var U=new Map,q=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(b){s.fixedNodesOnHorizontal.add(b),s.fixedNodesOnVertical.add(b)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var Z=this.constraints.alignmentConstraint.vertical;for(var T=0;T<Z.length;T++)this.dummyToNodeForVerticalAlignment.set("dummy"+T,[]),Z[T].forEach(function(_){if(U.set(_,"dummy"+T),s.dummyToNodeForVerticalAlignment.get("dummy"+T).push(_),s.fixedNodeSet.has(_))s.fixedNodesOnHorizontal.add("dummy"+T)})}if(this.constraints.alignmentConstraint.horizontal){var V=this.constraints.alignmentConstraint.horizontal;for(var T=0;T<V.length;T++)this.dummyToNodeForHorizontalAlignment.set("dummy"+T,[]),V[T].forEach(function(_){if(q.set(_,"dummy"+T),s.dummyToNodeForHorizontalAlignment.get("dummy"+T).push(_),s.fixedNodeSet.has(_))s.fixedNodesOnVertical.add("dummy"+T)})}}if(g.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(b){var _,rt,gt;for(gt=b.length-1;gt>=2*b.length/3;gt--)_=Math.floor(Math.random()*(gt+1)),rt=b[gt],b[gt]=b[_],b[_]=rt;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 _=U.has(b.left)?U.get(b.left):b.left,rt=U.has(b.right)?U.get(b.right):b.right;if(!s.nodesInRelativeHorizontal.includes(_))if(s.nodesInRelativeHorizontal.push(_),s.nodeToRelativeConstraintMapHorizontal.set(_,[]),s.dummyToNodeForVerticalAlignment.has(_))s.nodeToTempPositionMapHorizontal.set(_,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(_)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(_,s.idToNodeMap.get(_).getCenterX());if(!s.nodesInRelativeHorizontal.includes(rt))if(s.nodesInRelativeHorizontal.push(rt),s.nodeToRelativeConstraintMapHorizontal.set(rt,[]),s.dummyToNodeForVerticalAlignment.has(rt))s.nodeToTempPositionMapHorizontal.set(rt,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(rt)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(rt,s.idToNodeMap.get(rt).getCenterX());s.nodeToRelativeConstraintMapHorizontal.get(_).push({right:rt,gap:b.gap}),s.nodeToRelativeConstraintMapHorizontal.get(rt).push({left:_,gap:b.gap})}else{var gt=q.has(b.top)?q.get(b.top):b.top,Lt=q.has(b.bottom)?q.get(b.bottom):b.bottom;if(!s.nodesInRelativeVertical.includes(gt))if(s.nodesInRelativeVertical.push(gt),s.nodeToRelativeConstraintMapVertical.set(gt,[]),s.dummyToNodeForHorizontalAlignment.has(gt))s.nodeToTempPositionMapVertical.set(gt,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(gt)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(gt,s.idToNodeMap.get(gt).getCenterY());if(!s.nodesInRelativeVertical.includes(Lt))if(s.nodesInRelativeVertical.push(Lt),s.nodeToRelativeConstraintMapVertical.set(Lt,[]),s.dummyToNodeForHorizontalAlignment.has(Lt))s.nodeToTempPositionMapVertical.set(Lt,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(Lt)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(Lt,s.idToNodeMap.get(Lt).getCenterY());s.nodeToRelativeConstraintMapVertical.get(gt).push({bottom:Lt,gap:b.gap}),s.nodeToRelativeConstraintMapVertical.get(Lt).push({top:gt,gap:b.gap})}});else{var ht=new Map,vt=new Map;this.constraints.relativePlacementConstraint.forEach(function(b){if(b.left){var _=U.has(b.left)?U.get(b.left):b.left,rt=U.has(b.right)?U.get(b.right):b.right;if(ht.has(_))ht.get(_).push(rt);else ht.set(_,[rt]);if(ht.has(rt))ht.get(rt).push(_);else ht.set(rt,[_])}else{var gt=q.has(b.top)?q.get(b.top):b.top,Lt=q.has(b.bottom)?q.get(b.bottom):b.bottom;if(vt.has(gt))vt.get(gt).push(Lt);else vt.set(gt,[Lt]);if(vt.has(Lt))vt.get(Lt).push(gt);else vt.set(Lt,[gt])}});var k=function(_,rt){var gt=[],Lt=[],Gt=new ft,Zt=new Set,ct=0;return _.forEach(function(jt,Ht){if(!Zt.has(Ht)){gt[ct]=[],Lt[ct]=!1;var Tt=Ht;Gt.push(Tt),Zt.add(Tt),gt[ct].push(Tt);while(Gt.length!=0){if(Tt=Gt.shift(),rt.has(Tt))Lt[ct]=!0;var pt=_.get(Tt);pt.forEach(function(It){if(!Zt.has(It))Gt.push(It),Zt.add(It),gt[ct].push(It)})}ct++}}),{components:gt,isFixed:Lt}},dt=k(ht,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=dt.components,this.fixedComponentsOnHorizontal=dt.isFixed;var at=k(vt,s.fixedNodesOnVertical);this.componentsOnVertical=at.components,this.fixedComponentsOnVertical=at.isFixed}}},Y.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(at){var b=s.idToNodeMap.get(at.nodeId);b.displacementX=0,b.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var w=this.constraints.alignmentConstraint.vertical;for(var T=0;T<w.length;T++){var A=0;for(var m=0;m<w[T].length;m++){if(this.fixedNodeSet.has(w[T][m])){A=0;break}A+=this.idToNodeMap.get(w[T][m]).displacementX}var H=A/w[T].length;for(var m=0;m<w[T].length;m++)this.idToNodeMap.get(w[T][m]).displacementX=H}}if(this.constraints.alignmentConstraint.horizontal){var U=this.constraints.alignmentConstraint.horizontal;for(var T=0;T<U.length;T++){var q=0;for(var m=0;m<U[T].length;m++){if(this.fixedNodeSet.has(U[T][m])){q=0;break}q+=this.idToNodeMap.get(U[T][m]).displacementY}var Z=q/U[T].length;for(var m=0;m<U[T].length;m++)this.idToNodeMap.get(U[T][m]).displacementY=Z}}}if(this.constraints.relativePlacementConstraint)if(g.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(at){if(!s.fixedNodesOnHorizontal.has(at)){var b=0;if(s.dummyToNodeForVerticalAlignment.has(at))b=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(at)[0]).displacementX;else b=s.idToNodeMap.get(at).displacementX;if(s.nodeToRelativeConstraintMapHorizontal.get(at).forEach(function(_){if(_.right){var rt=s.nodeToTempPositionMapHorizontal.get(_.right)-s.nodeToTempPositionMapHorizontal.get(at)-b;if(rt<_.gap)b-=_.gap-rt}else{var rt=s.nodeToTempPositionMapHorizontal.get(at)-s.nodeToTempPositionMapHorizontal.get(_.left)+b;if(rt<_.gap)b+=_.gap-rt}}),s.nodeToTempPositionMapHorizontal.set(at,s.nodeToTempPositionMapHorizontal.get(at)+b),s.dummyToNodeForVerticalAlignment.has(at))s.dummyToNodeForVerticalAlignment.get(at).forEach(function(_){s.idToNodeMap.get(_).displacementX=b});else s.idToNodeMap.get(at).displacementX=b}}),this.nodesInRelativeVertical.forEach(function(at){if(!s.fixedNodesOnHorizontal.has(at)){var b=0;if(s.dummyToNodeForHorizontalAlignment.has(at))b=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(at)[0]).displacementY;else b=s.idToNodeMap.get(at).displacementY;if(s.nodeToRelativeConstraintMapVertical.get(at).forEach(function(_){if(_.bottom){var rt=s.nodeToTempPositionMapVertical.get(_.bottom)-s.nodeToTempPositionMapVertical.get(at)-b;if(rt<_.gap)b-=_.gap-rt}else{var rt=s.nodeToTempPositionMapVertical.get(at)-s.nodeToTempPositionMapVertical.get(_.top)+b;if(rt<_.gap)b+=_.gap-rt}}),s.nodeToTempPositionMapVertical.set(at,s.nodeToTempPositionMapVertical.get(at)+b),s.dummyToNodeForHorizontalAlignment.has(at))s.dummyToNodeForHorizontalAlignment.get(at).forEach(function(_){s.idToNodeMap.get(_).displacementY=b});else s.idToNodeMap.get(at).displacementY=b}})}else{for(var T=0;T<this.componentsOnHorizontal.length;T++){var V=this.componentsOnHorizontal[T];if(this.fixedComponentsOnHorizontal[T])for(var m=0;m<V.length;m++)if(this.dummyToNodeForVerticalAlignment.has(V[m]))this.dummyToNodeForVerticalAlignment.get(V[m]).forEach(function(_){s.idToNodeMap.get(_).displacementX=0});else this.idToNodeMap.get(V[m]).displacementX=0;else{var ht=0,vt=0;for(var m=0;m<V.length;m++)if(this.dummyToNodeForVerticalAlignment.has(V[m])){var k=this.dummyToNodeForVerticalAlignment.get(V[m]);ht+=k.length*this.idToNodeMap.get(k[0]).displacementX,vt+=k.length}else ht+=this.idToNodeMap.get(V[m]).displacementX,vt++;var dt=ht/vt;for(var m=0;m<V.length;m++)if(this.dummyToNodeForVerticalAlignment.has(V[m]))this.dummyToNodeForVerticalAlignment.get(V[m]).forEach(function(_){s.idToNodeMap.get(_).displacementX=dt});else this.idToNodeMap.get(V[m]).displacementX=dt}}for(var T=0;T<this.componentsOnVertical.length;T++){var V=this.componentsOnVertical[T];if(this.fixedComponentsOnVertical[T])for(var m=0;m<V.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(V[m]))this.dummyToNodeForHorizontalAlignment.get(V[m]).forEach(function(rt){s.idToNodeMap.get(rt).displacementY=0});else this.idToNodeMap.get(V[m]).displacementY=0;else{var ht=0,vt=0;for(var m=0;m<V.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(V[m])){var k=this.dummyToNodeForHorizontalAlignment.get(V[m]);ht+=k.length*this.idToNodeMap.get(k[0]).displacementY,vt+=k.length}else ht+=this.idToNodeMap.get(V[m]).displacementY,vt++;var dt=ht/vt;for(var m=0;m<V.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(V[m]))this.dummyToNodeForHorizontalAlignment.get(V[m]).forEach(function(Gt){s.idToNodeMap.get(Gt).displacementY=dt});else this.idToNodeMap.get(V[m]).displacementY=dt}}}},Y.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],w,T=this.graphManager.getGraphs(),A=T.length,m;for(m=0;m<A;m++)if(w=T[m],w.updateConnected(),!w.isConnected)s=s.concat(w.getNodes());return s},Y.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var w=new Set,T;for(T=0;T<s.length;T++){var A=s[T];if(!w.has(A)){var m=A.getSource(),H=A.getTarget();if(m==H)A.getBendpoints().push(new L),A.getBendpoints().push(new L),this.createDummyNodesForBendpoints(A),w.add(A);else{var U=[];if(U=U.concat(m.getEdgeListToNode(H)),U=U.concat(H.getEdgeListToNode(m)),!w.has(U[0])){if(U.length>1){var q;for(q=0;q<U.length;q++){var Z=U[q];Z.getBendpoints().push(new L),this.createDummyNodesForBendpoints(Z)}}U.forEach(function(V){w.add(V)})}}}if(w.size==s.length)break}},Y.prototype.positionNodesRadially=function(s){var w=new N(0,0),T=Math.ceil(Math.sqrt(s.length)),A=0,m=0,H=0,U=new L(0,0);for(var q=0;q<s.length;q++){if(q%T==0){if(H=0,m=A,q!=0)m+=g.DEFAULT_COMPONENT_SEPERATION;A=0}var Z=s[q],V=W.findCenterOfTree(Z);if(w.x=H,w.y=m,U=Y.radialLayout(Z,V,w),U.y>A)A=Math.floor(U.y);H=Math.floor(U.x+g.DEFAULT_COMPONENT_SEPERATION)}this.transform(new L(I.WORLD_CENTER_X-U.x/2,I.WORLD_CENTER_Y-U.y/2))},Y.radialLayout=function(s,w,T){var A=Math.max(this.maxDiagonalInTree(s),g.DEFAULT_RADIAL_SEPARATION);Y.branchRadialLayout(w,null,0,359,0,A);var m=tt.calculateBounds(s),H=new Q;H.setDeviceOrgX(m.getMinX()),H.setDeviceOrgY(m.getMinY()),H.setWorldOrgX(T.x),H.setWorldOrgY(T.y);for(var U=0;U<s.length;U++){var q=s[U];q.transform(H)}var Z=new L(m.getMaxX(),m.getMaxY());return H.inverseTransformPoint(Z)},Y.branchRadialLayout=function(s,w,T,A,m,H){var U=(A-T+1)/2;if(U<0)U+=180;var q=(U+T)%360,Z=q*B.TWO_PI/360,V=Math.cos(Z),ht=m*Math.cos(Z),vt=m*Math.sin(Z);s.setCenter(ht,vt);var k=[];k=k.concat(s.getEdges());var dt=k.length;if(w!=null)dt--;var at=0,b=k.length,_,rt=s.getEdgesBetween(w);while(rt.length>1){var gt=rt[0];rt.splice(0,1);var Lt=k.indexOf(gt);if(Lt>=0)k.splice(Lt,1);b--,dt--}if(w!=null)_=(k.indexOf(rt[0])+1)%b;else _=0;var Gt=Math.abs(A-T)/dt;for(var Zt=_;at!=dt;Zt=++Zt%b){var ct=k[Zt].getOtherEnd(s);if(ct==w)continue;var jt=(T+at*Gt)%360,Ht=(jt+Gt)%360;Y.branchRadialLayout(ct,s,jt,Ht,m+H,H),at++}},Y.maxDiagonalInTree=function(s){var w=S.MIN_VALUE;for(var T=0;T<s.length;T++){var A=s[T],m=A.getDiagonal();if(m>w)w=m}return w},Y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},Y.prototype.groupZeroDegreeMembers=function(){var s=this,w={};this.memberGroups={},this.idToDummyNode={};var T=[],A=this.graphManager.getAllNodes();for(var m=0;m<A.length;m++){var H=A[m],U=H.getParent();if(this.getNodeDegreeWithChildren(H)===0&&(U.id==null||!this.getToBeTiled(U)))T.push(H)}for(var m=0;m<T.length;m++){var H=T[m],q=H.getParent().id;if(typeof w[q]>"u")w[q]=[];w[q]=w[q].concat(H)}Object.keys(w).forEach(function(Z){if(w[Z].length>1){var V="DummyCompound_"+Z;s.memberGroups[V]=w[Z];var ht=w[Z][0].getParent(),vt=new i(s.graphManager);vt.id=V,vt.paddingLeft=ht.paddingLeft||0,vt.paddingRight=ht.paddingRight||0,vt.paddingBottom=ht.paddingBottom||0,vt.paddingTop=ht.paddingTop||0,s.idToDummyNode[V]=vt;var k=s.getGraphManager().add(s.newGraph(),vt),dt=ht.getChild();dt.add(vt);for(var at=0;at<w[Z].length;at++){var b=w[Z][at];dt.remove(b),k.add(b)}}})},Y.prototype.clearCompounds=function(){var s={},w={};this.performDFSOnCompounds();for(var T=0;T<this.compoundOrder.length;T++)w[this.compoundOrder[T].id]=this.compoundOrder[T],s[this.compoundOrder[T].id]=[].concat(this.compoundOrder[T].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[T].getChild()),this.compoundOrder[T].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,w)},Y.prototype.clearZeroDegreeMembers=function(){var s=this,w=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(T){var A=s.idToDummyNode[T];if(w[T]=s.tileNodes(s.memberGroups[T],A.paddingLeft+A.paddingRight),A.rect.width=w[T].width,A.rect.height=w[T].height,A.setCenter(w[T].centerX,w[T].centerY),A.labelMarginLeft=0,A.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var m=A.rect.width,H=A.rect.height;if(A.labelWidth){if(A.labelPosHorizontal=="left")A.rect.x-=A.labelWidth,A.setWidth(m+A.labelWidth),A.labelMarginLeft=A.labelWidth;else if(A.labelPosHorizontal=="center"&&A.labelWidth>m)A.rect.x-=(A.labelWidth-m)/2,A.setWidth(A.labelWidth),A.labelMarginLeft=(A.labelWidth-m)/2;else if(A.labelPosHorizontal=="right")A.setWidth(m+A.labelWidth)}if(A.labelHeight){if(A.labelPosVertical=="top")A.rect.y-=A.labelHeight,A.setHeight(H+A.labelHeight),A.labelMarginTop=A.labelHeight;else if(A.labelPosVertical=="center"&&A.labelHeight>H)A.rect.y-=(A.labelHeight-H)/2,A.setHeight(A.labelHeight),A.labelMarginTop=(A.labelHeight-H)/2;else if(A.labelPosVertical=="bottom")A.setHeight(H+A.labelHeight)}}})},Y.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var w=this.compoundOrder[s],{id:T,paddingLeft:A,paddingTop:m,labelMarginLeft:H,labelMarginTop:U}=w;this.adjustLocations(this.tiledMemberPack[T],w.rect.x,w.rect.y,A,m,H,U)}},Y.prototype.repopulateZeroDegreeMembers=function(){var s=this,w=this.tiledZeroDegreePack;Object.keys(w).forEach(function(T){var A=s.idToDummyNode[T],{paddingLeft:m,paddingTop:H,labelMarginLeft:U,labelMarginTop:q}=A;s.adjustLocations(w[T],A.rect.x,A.rect.y,m,H,U,q)})},Y.prototype.getToBeTiled=function(s){var w=s.id;if(this.toBeTiled[w]!=null)return this.toBeTiled[w];var T=s.getChild();if(T==null)return this.toBeTiled[w]=!1,!1;var A=T.getNodes();for(var m=0;m<A.length;m++){var H=A[m];if(this.getNodeDegree(H)>0)return this.toBeTiled[w]=!1,!1;if(H.getChild()==null){this.toBeTiled[H.id]=!1;continue}if(!this.getToBeTiled(H))return this.toBeTiled[w]=!1,!1}return this.toBeTiled[w]=!0,!0},Y.prototype.getNodeDegree=function(s){var w=s.id,T=s.getEdges(),A=0;for(var m=0;m<T.length;m++){var H=T[m];if(H.getSource().id!==H.getTarget().id)A=A+1}return A},Y.prototype.getNodeDegreeWithChildren=function(s){var w=this.getNodeDegree(s);if(s.getChild()==null)return w;var T=s.getChild().getNodes();for(var A=0;A<T.length;A++){var m=T[A];w+=this.getNodeDegreeWithChildren(m)}return w},Y.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},Y.prototype.fillCompexOrderByDFS=function(s){for(var w=0;w<s.length;w++){var T=s[w];if(T.getChild()!=null)this.fillCompexOrderByDFS(T.getChild().getNodes());if(this.getToBeTiled(T))this.compoundOrder.push(T)}},Y.prototype.adjustLocations=function(s,w,T,A,m,H,U){w+=A+H,T+=m+U;var q=w;for(var Z=0;Z<s.rows.length;Z++){var V=s.rows[Z];w=q;var ht=0;for(var vt=0;vt<V.length;vt++){var k=V[vt];if(k.rect.x=w,k.rect.y=T,w+=k.rect.width+s.horizontalPadding,k.rect.height>ht)ht=k.rect.height}T+=ht+s.verticalPadding}},Y.prototype.tileCompoundMembers=function(s,w){var T=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(A){var m=w[A];if(T.tiledMemberPack[A]=T.tileNodes(s[A],m.paddingLeft+m.paddingRight),m.rect.width=T.tiledMemberPack[A].width,m.rect.height=T.tiledMemberPack[A].height,m.setCenter(T.tiledMemberPack[A].centerX,T.tiledMemberPack[A].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var H=m.rect.width,U=m.rect.height;if(m.labelWidth){if(m.labelPosHorizontal=="left")m.rect.x-=m.labelWidth,m.setWidth(H+m.labelWidth),m.labelMarginLeft=m.labelWidth;else if(m.labelPosHorizontal=="center"&&m.labelWidth>H)m.rect.x-=(m.labelWidth-H)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-H)/2;else if(m.labelPosHorizontal=="right")m.setWidth(H+m.labelWidth)}if(m.labelHeight){if(m.labelPosVertical=="top")m.rect.y-=m.labelHeight,m.setHeight(U+m.labelHeight),m.labelMarginTop=m.labelHeight;else if(m.labelPosVertical=="center"&&m.labelHeight>U)m.rect.y-=(m.labelHeight-U)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-U)/2;else if(m.labelPosVertical=="bottom")m.setHeight(U+m.labelHeight)}}})},Y.prototype.tileNodes=function(s,w){var T=this.tileNodesByFavoringDim(s,w,!0),A=this.tileNodesByFavoringDim(s,w,!1),m=this.getOrgRatio(T),H=this.getOrgRatio(A),U;if(H<m)U=A;else U=T;return U},Y.prototype.getOrgRatio=function(s){var{width:w,height:T}=s,A=w/T;if(A<1)A=1/A;return A},Y.prototype.calcIdealRowWidth=function(s,w){var{TILING_PADDING_VERTICAL:T,TILING_PADDING_HORIZONTAL:A}=g,m=s.length,H=0,U=0,q=0;s.forEach(function(at){if(H+=at.getWidth(),U+=at.getHeight(),at.getWidth()>q)q=at.getWidth()});var Z=H/m,V=U/m,ht=Math.pow(T-A,2)+4*(Z+A)*(V+T)*m,vt=(A-T+Math.sqrt(ht))/(2*(Z+A)),k;if(w){if(k=Math.ceil(vt),k==vt)k++}else k=Math.floor(vt);var dt=k*(Z+A)-A;if(q>dt)dt=q;return dt+=A*2,dt},Y.prototype.tileNodesByFavoringDim=function(s,w,T){var{TILING_PADDING_VERTICAL:A,TILING_PADDING_HORIZONTAL:m,TILING_COMPARE_BY:H}=g,U={rows:[],rowWidth:[],rowHeight:[],width:0,height:w,verticalPadding:A,horizontalPadding:m,centerX:0,centerY:0};if(H)U.idealRowWidth=this.calcIdealRowWidth(s,T);var q=function(b){return b.rect.width*b.rect.height},Z=function(b,_){return q(_)-q(b)};s.sort(function(at,b){var _=Z;if(U.idealRowWidth)return _=H,_(at.id,b.id);return _(at,b)});var V=0,ht=0;for(var vt=0;vt<s.length;vt++){var k=s[vt];V+=k.getCenterX(),ht+=k.getCenterY()}U.centerX=V/s.length,U.centerY=ht/s.length;for(var vt=0;vt<s.length;vt++){var k=s[vt];if(U.rows.length==0)this.insertNodeToRow(U,k,0,w);else if(this.canAddHorizontal(U,k.rect.width,k.rect.height)){var dt=U.rows.length-1;if(!U.idealRowWidth)dt=this.getShortestRowIndex(U);this.insertNodeToRow(U,k,dt,w)}else this.insertNodeToRow(U,k,U.rows.length,w);this.shiftToLastRow(U)}return U},Y.prototype.insertNodeToRow=function(s,w,T,A){var m=A;if(T==s.rows.length){var H=[];s.rows.push(H),s.rowWidth.push(m),s.rowHeight.push(0)}var U=s.rowWidth[T]+w.rect.width;if(s.rows[T].length>0)U+=s.horizontalPadding;if(s.rowWidth[T]=U,s.width<U)s.width=U;var q=w.rect.height;if(T>0)q+=s.verticalPadding;var Z=0;if(q>s.rowHeight[T])Z=s.rowHeight[T],s.rowHeight[T]=q,Z=s.rowHeight[T]-Z;s.height+=Z,s.rows[T].push(w)},Y.prototype.getShortestRowIndex=function(s){var w=-1,T=Number.MAX_VALUE;for(var A=0;A<s.rows.length;A++)if(s.rowWidth[A]<T)w=A,T=s.rowWidth[A];return w},Y.prototype.getLongestRowIndex=function(s){var w=-1,T=Number.MIN_VALUE;for(var A=0;A<s.rows.length;A++)if(s.rowWidth[A]>T)w=A,T=s.rowWidth[A];return w},Y.prototype.canAddHorizontal=function(s,w,T){if(s.idealRowWidth){var A=s.rows.length-1,m=s.rowWidth[A];return m+w+s.horizontalPadding<=s.idealRowWidth}var H=this.getShortestRowIndex(s);if(H<0)return!0;var U=s.rowWidth[H];if(U+s.horizontalPadding+w<=s.width)return!0;var q=0;if(s.rowHeight[H]<T){if(H>0)q=T+s.verticalPadding-s.rowHeight[H]}var Z;if(s.width-U>=w+s.horizontalPadding)Z=(s.height+q)/(U+w+s.horizontalPadding);else Z=(s.height+q)/s.width;q=T+s.verticalPadding;var V;if(s.width<w)V=(s.height+q)/w;else V=(s.height+q)/s.width;if(V<1)V=1/V;if(Z<1)Z=1/Z;return Z<V},Y.prototype.shiftToLastRow=function(s){var w=this.getLongestRowIndex(s),T=s.rowWidth.length-1,A=s.rows[w],m=A[A.length-1],H=m.width+s.horizontalPadding;if(s.width-s.rowWidth[T]>H&&w!=T){A.splice(-1,1),s.rows[T].push(m),s.rowWidth[w]=s.rowWidth[w]-H,s.rowWidth[T]=s.rowWidth[T]+H,s.width=s.rowWidth[instance.getLongestRowIndex(s)];var U=Number.MIN_VALUE;for(var q=0;q<A.length;q++)if(A[q].height>U)U=A[q].height;if(w>0)U+=s.verticalPadding;var Z=s.rowHeight[w]+s.rowHeight[T];if(s.rowHeight[w]=U,s.rowHeight[T]<m.height+s.verticalPadding)s.rowHeight[T]=m.height+s.verticalPadding;var V=s.rowHeight[w]+s.rowHeight[T];s.height+=V-Z,this.shiftToLastRow(s)}},Y.prototype.tilingPreLayout=function(){if(g.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},Y.prototype.tilingPostLayout=function(){if(g.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},Y.prototype.reduceTrees=function(){var s=[],w=!0,T;while(w){var A=this.graphManager.getAllNodes(),m=[];w=!1;for(var H=0;H<A.length;H++)if(T=A[H],T.getEdges().length==1&&!T.getEdges()[0].isInterGraph&&T.getChild()==null){if(g.PURE_INCREMENTAL){var U=T.getEdges()[0].getOtherEnd(T),q=new x(T.getCenterX()-U.getCenterX(),T.getCenterY()-U.getCenterY());m.push([T,T.getEdges()[0],T.getOwner(),q])}else m.push([T,T.getEdges()[0],T.getOwner()]);w=!0}if(w==!0){var Z=[];for(var V=0;V<m.length;V++)if(m[V][0].getEdges().length==1)Z.push(m[V]),m[V][0].getOwner().remove(m[V][0]);s.push(Z),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},Y.prototype.growTree=function(s){var w=s.length,T=s[w-1],A;for(var m=0;m<T.length;m++)A=T[m],this.findPlaceforPrunedNode(A),A[2].add(A[0]),A[2].add(A[1],A[1].source,A[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},Y.prototype.findPlaceforPrunedNode=function(s){var w,T,A=s[0];if(A==s[1].source)T=s[1].target;else T=s[1].source;if(g.PURE_INCREMENTAL)A.setCenter(T.getCenterX()+s[3].getWidth(),T.getCenterY()+s[3].getHeight());else{var m=T.startX,H=T.finishX,U=T.startY,q=T.finishY,Z=0,V=0,ht=0,vt=0,k=[Z,ht,V,vt];if(U>0)for(var dt=m;dt<=H;dt++)k[0]+=this.grid[dt][U-1].length+this.grid[dt][U].length-1;if(H<this.grid.length-1)for(var dt=U;dt<=q;dt++)k[1]+=this.grid[H+1][dt].length+this.grid[H][dt].length-1;if(q<this.grid[0].length-1)for(var dt=m;dt<=H;dt++)k[2]+=this.grid[dt][q+1].length+this.grid[dt][q].length-1;if(m>0)for(var dt=U;dt<=q;dt++)k[3]+=this.grid[m-1][dt].length+this.grid[m][dt].length-1;var at=S.MAX_VALUE,b,_;for(var rt=0;rt<k.length;rt++)if(k[rt]<at)at=k[rt],b=1,_=rt;else if(k[rt]==at)b++;if(b==3&&at==0){if(k[0]==0&&k[1]==0&&k[2]==0)w=1;else if(k[0]==0&&k[1]==0&&k[3]==0)w=0;else if(k[0]==0&&k[2]==0&&k[3]==0)w=3;else if(k[1]==0&&k[2]==0&&k[3]==0)w=2}else if(b==2&&at==0){var gt=Math.floor(Math.random()*2);if(k[0]==0&&k[1]==0)if(gt==0)w=0;else w=1;else if(k[0]==0&&k[2]==0)if(gt==0)w=0;else w=2;else if(k[0]==0&&k[3]==0)if(gt==0)w=0;else w=3;else if(k[1]==0&&k[2]==0)if(gt==0)w=1;else w=2;else if(k[1]==0&&k[3]==0)if(gt==0)w=1;else w=3;else if(gt==0)w=2;else w=3}else if(b==4&&at==0){var gt=Math.floor(Math.random()*4);w=gt}else w=_;if(w==0)A.setCenter(T.getCenterX(),T.getCenterY()-T.getHeight()/2-c.DEFAULT_EDGE_LENGTH-A.getHeight()/2);else if(w==1)A.setCenter(T.getCenterX()+T.getWidth()/2+c.DEFAULT_EDGE_LENGTH+A.getWidth()/2,T.getCenterY());else if(w==2)A.setCenter(T.getCenterX(),T.getCenterY()+T.getHeight()/2+c.DEFAULT_EDGE_LENGTH+A.getHeight()/2);else A.setCenter(T.getCenterX()-T.getWidth()/2-c.DEFAULT_EDGE_LENGTH-A.getWidth()/2,T.getCenterY())}},o.exports=Y},991:(o,n,a)=>{var u=a(551).FDLayoutNode,r=a(551).IMath;function y(e,g,d,c){u.call(this,e,g,d,c)}y.prototype=Object.create(u.prototype);for(var i in u)y[i]=u[i];y.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement)this.displacementX=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementX);if(Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement)this.displacementY=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},y.prototype.propogateDisplacementToChildren=function(e,g){var d=this.getChild().getNodes(),c;for(var I=0;I<d.length;I++)if(c=d[I],c.getChild()==null)c.displacementX+=e,c.displacementY+=g;else c.propogateDisplacementToChildren(e,g)},y.prototype.move=function(){var e=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),e.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},y.prototype.setPred1=function(e){this.pred1=e},y.prototype.getPred1=function(){return pred1},y.prototype.getPred2=function(){return pred2},y.prototype.setNext=function(e){this.next=e},y.prototype.getNext=function(){return next},y.prototype.setProcessed=function(e){this.processed=e},y.prototype.isProcessed=function(){return processed},o.exports=y},902:(o,n,a)=>{function u(d){if(Array.isArray(d)){for(var c=0,I=Array(d.length);c<d.length;c++)I[c]=d[c];return I}else return Array.from(d)}var r=a(806),y=a(551).LinkedList,i=a(551).Matrix,e=a(551).SVD;function g(){}g.handleConstraints=function(d){var c={};c.fixedNodeConstraint=d.constraints.fixedNodeConstraint,c.alignmentConstraint=d.constraints.alignmentConstraint,c.relativePlacementConstraint=d.constraints.relativePlacementConstraint;var I=new Map,N=new Map,L=[],x=[],W=d.getAllNodes(),S=0;for(var B=0;B<W.length;B++){var tt=W[B];if(tt.getChild()==null)N.set(tt.id,S++),L.push(tt.getCenterX()),x.push(tt.getCenterY()),I.set(tt.id,tt)}if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(J){if(!J.gap&&J.gap!=0)if(J.left)J.gap=r.DEFAULT_EDGE_LENGTH+I.get(J.left).getWidth()/2+I.get(J.right).getWidth()/2;else J.gap=r.DEFAULT_EDGE_LENGTH+I.get(J.top).getHeight()/2+I.get(J.bottom).getHeight()/2});var Q=function(it,nt){return{x:it.x-nt.x,y:it.y-nt.y}},ft=function(it){var nt=0,ot=0;return it.forEach(function(st){nt+=L[N.get(st)],ot+=x[N.get(st)]}),{x:nt/it.size,y:ot/it.size}},Y=function(it,nt,ot,st,ut){function Dt(Nt,mt){var Ot=new Set(Nt),Et=!0,Mt=!1,kt=void 0;try{for(var zt=mt[Symbol.iterator](),ie;!(Et=(ie=zt.next()).done);Et=!0){var Vt=ie.value;Ot.add(Vt)}}catch(Pt){Mt=!0,kt=Pt}finally{try{if(!Et&&zt.return)zt.return()}finally{if(Mt)throw kt}}return Ot}var Ct=new Map;it.forEach(function(Nt,mt){Ct.set(mt,0)}),it.forEach(function(Nt,mt){Nt.forEach(function(Ot){Ct.set(Ot.id,Ct.get(Ot.id)+1)})});var lt=new Map,wt=new Map,At=new y;if(Ct.forEach(function(Nt,mt){if(Nt==0){if(At.push(mt),!ot)if(nt=="horizontal")lt.set(mt,N.has(mt)?L[N.get(mt)]:st.get(mt));else lt.set(mt,N.has(mt)?x[N.get(mt)]:st.get(mt))}else lt.set(mt,Number.NEGATIVE_INFINITY);if(ot)wt.set(mt,new Set([mt]))}),ot)ut.forEach(function(Nt){var mt=[];if(Nt.forEach(function(Mt){if(ot.has(Mt))mt.push(Mt)}),mt.length>0){var Ot=0;mt.forEach(function(Mt){if(nt=="horizontal")lt.set(Mt,N.has(Mt)?L[N.get(Mt)]:st.get(Mt)),Ot+=lt.get(Mt);else lt.set(Mt,N.has(Mt)?x[N.get(Mt)]:st.get(Mt)),Ot+=lt.get(Mt)}),Ot=Ot/mt.length,Nt.forEach(function(Mt){if(!ot.has(Mt))lt.set(Mt,Ot)})}else{var Et=0;Nt.forEach(function(Mt){if(nt=="horizontal")Et+=N.has(Mt)?L[N.get(Mt)]:st.get(Mt);else Et+=N.has(Mt)?x[N.get(Mt)]:st.get(Mt)}),Et=Et/Nt.length,Nt.forEach(function(Mt){lt.set(Mt,Et)})}});var yt=function(){var mt=At.shift(),Ot=it.get(mt);Ot.forEach(function(Et){if(lt.get(Et.id)<lt.get(mt)+Et.gap)if(ot&&ot.has(Et.id)){var Mt=void 0;if(nt=="horizontal")Mt=N.has(Et.id)?L[N.get(Et.id)]:st.get(Et.id);else Mt=N.has(Et.id)?x[N.get(Et.id)]:st.get(Et.id);if(lt.set(Et.id,Mt),Mt<lt.get(mt)+Et.gap){var kt=lt.get(mt)+Et.gap-Mt;wt.get(mt).forEach(function(zt){lt.set(zt,lt.get(zt)-kt)})}}else lt.set(Et.id,lt.get(mt)+Et.gap);if(Ct.set(Et.id,Ct.get(Et.id)-1),Ct.get(Et.id)==0)At.push(Et.id);if(ot)wt.set(Et.id,Dt(wt.get(mt),wt.get(Et.id)))})};while(At.length!=0)yt();if(ot){var xt=new Set;it.forEach(function(Nt,mt){if(Nt.length==0)xt.add(mt)});var Yt=[];wt.forEach(function(Nt,mt){if(xt.has(mt)){var Ot=!1,Et=!0,Mt=!1,kt=void 0;try{for(var zt=Nt[Symbol.iterator](),ie;!(Et=(ie=zt.next()).done);Et=!0){var Vt=ie.value;if(ot.has(Vt))Ot=!0}}catch(Bt){Mt=!0,kt=Bt}finally{try{if(!Et&&zt.return)zt.return()}finally{if(Mt)throw kt}}if(!Ot){var Pt=!1,se=void 0;if(Yt.forEach(function(Bt,te){if(Bt.has([].concat(u(Nt))[0]))Pt=!0,se=te}),!Pt)Yt.push(new Set(Nt));else Nt.forEach(function(Bt){Yt[se].add(Bt)})}}}),Yt.forEach(function(Nt,mt){var{POSITIVE_INFINITY:Ot,POSITIVE_INFINITY:Et,NEGATIVE_INFINITY:Mt,NEGATIVE_INFINITY:kt}=Number,zt=!0,ie=!1,Vt=void 0;try{for(var Pt=Nt[Symbol.iterator](),se;!(zt=(se=Pt.next()).done);zt=!0){var Bt=se.value,te=void 0;if(nt=="horizontal")te=N.has(Bt)?L[N.get(Bt)]:st.get(Bt);else te=N.has(Bt)?x[N.get(Bt)]:st.get(Bt);var ne=lt.get(Bt);if(te<Ot)Ot=te;if(te>Mt)Mt=te;if(ne<Et)Et=ne;if(ne>kt)kt=ne}}catch(pe){ie=!0,Vt=pe}finally{try{if(!zt&&Pt.return)Pt.return()}finally{if(ie)throw Vt}}var Ae=(Ot+Mt)/2-(Et+kt)/2,fe=!0,ge=!1,de=void 0;try{for(var ce=Nt[Symbol.iterator](),Me;!(fe=(Me=ce.next()).done);fe=!0){var ve=Me.value;lt.set(ve,lt.get(ve)+Ae)}}catch(pe){ge=!0,de=pe}finally{try{if(!fe&&ce.return)ce.return()}finally{if(ge)throw de}}})}return lt},et=function(it){var nt=0,ot=0,st=0,ut=0;if(it.forEach(function(wt){if(wt.left)L[N.get(wt.left)]-L[N.get(wt.right)]>=0?nt++:ot++;else x[N.get(wt.top)]-x[N.get(wt.bottom)]>=0?st++:ut++}),nt>ot&&st>ut)for(var Dt=0;Dt<N.size;Dt++)L[Dt]=-1*L[Dt],x[Dt]=-1*x[Dt];else if(nt>ot)for(var Ct=0;Ct<N.size;Ct++)L[Ct]=-1*L[Ct];else if(st>ut)for(var lt=0;lt<N.size;lt++)x[lt]=-1*x[lt]},s=function(it){var nt=[],ot=new y,st=new Set,ut=0;return it.forEach(function(Dt,Ct){if(!st.has(Ct)){nt[ut]=[];var lt=Ct;ot.push(lt),st.add(lt),nt[ut].push(lt);while(ot.length!=0){lt=ot.shift();var wt=it.get(lt);wt.forEach(function(At){if(!st.has(At.id))ot.push(At.id),st.add(At.id),nt[ut].push(At.id)})}ut++}}),nt},w=function(it){var nt=new Map;return it.forEach(function(ot,st){nt.set(st,[])}),it.forEach(function(ot,st){ot.forEach(function(ut){nt.get(st).push(ut),nt.get(ut.id).push({id:st,gap:ut.gap,direction:ut.direction})})}),nt},T=function(it){var nt=new Map;return it.forEach(function(ot,st){nt.set(st,[])}),it.forEach(function(ot,st){ot.forEach(function(ut){nt.get(ut.id).push({id:st,gap:ut.gap,direction:ut.direction})})}),nt},A=[],m=[],H=!1,U=!1,q=new Set,Z=new Map,V=new Map,ht=[];if(c.fixedNodeConstraint)c.fixedNodeConstraint.forEach(function(J){q.add(J.nodeId)});if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(J){if(J.left){if(Z.has(J.left))Z.get(J.left).push({id:J.right,gap:J.gap,direction:"horizontal"});else Z.set(J.left,[{id:J.right,gap:J.gap,direction:"horizontal"}]);if(!Z.has(J.right))Z.set(J.right,[])}else{if(Z.has(J.top))Z.get(J.top).push({id:J.bottom,gap:J.gap,direction:"vertical"});else Z.set(J.top,[{id:J.bottom,gap:J.gap,direction:"vertical"}]);if(!Z.has(J.bottom))Z.set(J.bottom,[])}}),V=w(Z),ht=s(V);if(r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>1)c.fixedNodeConstraint.forEach(function(J,it){A[it]=[J.position.x,J.position.y],m[it]=[L[N.get(J.nodeId)],x[N.get(J.nodeId)]]}),H=!0;else if(c.alignmentConstraint)(function(){var J=0;if(c.alignmentConstraint.vertical){var it=c.alignmentConstraint.vertical,nt=function(lt){var wt=new Set;it[lt].forEach(function(xt){wt.add(xt)});var At=new Set([].concat(u(wt)).filter(function(xt){return q.has(xt)})),yt=void 0;if(At.size>0)yt=L[N.get(At.values().next().value)];else yt=ft(wt).x;it[lt].forEach(function(xt){A[J]=[yt,x[N.get(xt)]],m[J]=[L[N.get(xt)],x[N.get(xt)]],J++})};for(var ot=0;ot<it.length;ot++)nt(ot);H=!0}if(c.alignmentConstraint.horizontal){var st=c.alignmentConstraint.horizontal,ut=function(lt){var wt=new Set;st[lt].forEach(function(xt){wt.add(xt)});var At=new Set([].concat(u(wt)).filter(function(xt){return q.has(xt)})),yt=void 0;if(At.size>0)yt=L[N.get(At.values().next().value)];else yt=ft(wt).y;st[lt].forEach(function(xt){A[J]=[L[N.get(xt)],yt],m[J]=[L[N.get(xt)],x[N.get(xt)]],J++})};for(var Dt=0;Dt<st.length;Dt++)ut(Dt);H=!0}if(c.relativePlacementConstraint)U=!0})();else if(c.relativePlacementConstraint){var vt=0,k=0;for(var dt=0;dt<ht.length;dt++)if(ht[dt].length>vt)vt=ht[dt].length,k=dt;if(vt<V.size/2)et(c.relativePlacementConstraint),H=!1,U=!1;else{var at=new Map,b=new Map,_=[];ht[k].forEach(function(J){Z.get(J).forEach(function(it){if(it.direction=="horizontal"){if(at.has(J))at.get(J).push(it);else at.set(J,[it]);if(!at.has(it.id))at.set(it.id,[]);_.push({left:J,right:it.id})}else{if(b.has(J))b.get(J).push(it);else b.set(J,[it]);if(!b.has(it.id))b.set(it.id,[]);_.push({top:J,bottom:it.id})}})}),et(_),U=!1;var rt=Y(at,"horizontal"),gt=Y(b,"vertical");ht[k].forEach(function(J,it){if(m[it]=[L[N.get(J)],x[N.get(J)]],A[it]=[],rt.has(J))A[it][0]=rt.get(J);else A[it][0]=L[N.get(J)];if(gt.has(J))A[it][1]=gt.get(J);else A[it][1]=x[N.get(J)]}),H=!0}}if(H){var Lt=void 0,Gt=i.transpose(A),Zt=i.transpose(m);for(var ct=0;ct<Gt.length;ct++)Gt[ct]=i.multGamma(Gt[ct]),Zt[ct]=i.multGamma(Zt[ct]);var jt=i.multMat(Gt,i.transpose(Zt)),Ht=e.svd(jt);Lt=i.multMat(Ht.V,i.transpose(Ht.U));for(var Tt=0;Tt<N.size;Tt++){var pt=[L[Tt],x[Tt]],It=[Lt[0][0],Lt[1][0]],St=[Lt[0][1],Lt[1][1]];L[Tt]=i.dotProduct(pt,It),x[Tt]=i.dotProduct(pt,St)}if(U)et(c.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>0){var Ut={x:0,y:0};c.fixedNodeConstraint.forEach(function(J,it){var nt={x:L[N.get(J.nodeId)],y:x[N.get(J.nodeId)]},ot=J.position,st=Q(ot,nt);Ut.x+=st.x,Ut.y+=st.y}),Ut.x/=c.fixedNodeConstraint.length,Ut.y/=c.fixedNodeConstraint.length,L.forEach(function(J,it){L[it]+=Ut.x}),x.forEach(function(J,it){x[it]+=Ut.y}),c.fixedNodeConstraint.forEach(function(J){L[N.get(J.nodeId)]=J.position.x,x[N.get(J.nodeId)]=J.position.y})}if(c.alignmentConstraint){if(c.alignmentConstraint.vertical){var Ft=c.alignmentConstraint.vertical,bt=function(it){var nt=new Set;Ft[it].forEach(function(ut){nt.add(ut)});var ot=new Set([].concat(u(nt)).filter(function(ut){return q.has(ut)})),st=void 0;if(ot.size>0)st=L[N.get(ot.values().next().value)];else st=ft(nt).x;nt.forEach(function(ut){if(!q.has(ut))L[N.get(ut)]=st})};for(var Wt=0;Wt<Ft.length;Wt++)bt(Wt)}if(c.alignmentConstraint.horizontal){var $t=c.alignmentConstraint.horizontal,re=function(it){var nt=new Set;$t[it].forEach(function(ut){nt.add(ut)});var ot=new Set([].concat(u(nt)).filter(function(ut){return q.has(ut)})),st=void 0;if(ot.size>0)st=x[N.get(ot.values().next().value)];else st=ft(nt).y;nt.forEach(function(ut){if(!q.has(ut))x[N.get(ut)]=st})};for(var Qt=0;Qt<$t.length;Qt++)re(Qt)}}if(c.relativePlacementConstraint)(function(){var J=new Map,it=new Map,nt=new Map,ot=new Map,st=new Map,ut=new Map,Dt=new Set,Ct=new Set;if(q.forEach(function(Kt){Dt.add(Kt),Ct.add(Kt)}),c.alignmentConstraint){if(c.alignmentConstraint.vertical){var lt=c.alignmentConstraint.vertical,wt=function(Rt){nt.set("dummy"+Rt,[]),lt[Rt].forEach(function(Xt){if(J.set(Xt,"dummy"+Rt),nt.get("dummy"+Rt).push(Xt),q.has(Xt))Dt.add("dummy"+Rt)}),st.set("dummy"+Rt,L[N.get(lt[Rt][0])])};for(var At=0;At<lt.length;At++)wt(At)}if(c.alignmentConstraint.horizontal){var yt=c.alignmentConstraint.horizontal,xt=function(Rt){ot.set("dummy"+Rt,[]),yt[Rt].forEach(function(Xt){if(it.set(Xt,"dummy"+Rt),ot.get("dummy"+Rt).push(Xt),q.has(Xt))Ct.add("dummy"+Rt)}),ut.set("dummy"+Rt,x[N.get(yt[Rt][0])])};for(var Yt=0;Yt<yt.length;Yt++)xt(Yt)}}var Nt=new Map,mt=new Map,Ot=function(Rt){Z.get(Rt).forEach(function(Xt){var he=void 0,oe=void 0;if(Xt.direction=="horizontal"){if(he=J.get(Rt)?J.get(Rt):Rt,J.get(Xt.id))oe={id:J.get(Xt.id),gap:Xt.gap,direction:Xt.direction};else oe=Xt;if(Nt.has(he))Nt.get(he).push(oe);else Nt.set(he,[oe]);if(!Nt.has(oe.id))Nt.set(oe.id,[])}else{if(he=it.get(Rt)?it.get(Rt):Rt,it.get(Xt.id))oe={id:it.get(Xt.id),gap:Xt.gap,direction:Xt.direction};else oe=Xt;if(mt.has(he))mt.get(he).push(oe);else mt.set(he,[oe]);if(!mt.has(oe.id))mt.set(oe.id,[])}})},Et=!0,Mt=!1,kt=void 0;try{for(var zt=Z.keys()[Symbol.iterator](),ie;!(Et=(ie=zt.next()).done);Et=!0){var Vt=ie.value;Ot(Vt)}}catch(Kt){Mt=!0,kt=Kt}finally{try{if(!Et&&zt.return)zt.return()}finally{if(Mt)throw kt}}var Pt=w(Nt),se=w(mt),Bt=s(Pt),te=s(se),ne=T(Nt),Ae=T(mt),fe=[],ge=[];Bt.forEach(function(Kt,Rt){fe[Rt]=[],Kt.forEach(function(Xt){if(ne.get(Xt).length==0)fe[Rt].push(Xt)})}),te.forEach(function(Kt,Rt){ge[Rt]=[],Kt.forEach(function(Xt){if(Ae.get(Xt).length==0)ge[Rt].push(Xt)})});var de=Y(Nt,"horizontal",Dt,st,fe),ce=Y(mt,"vertical",Ct,ut,ge),Me=function(Rt){if(nt.get(Rt))nt.get(Rt).forEach(function(Xt){L[N.get(Xt)]=de.get(Rt)});else L[N.get(Rt)]=de.get(Rt)},ve=!0,pe=!1,He=void 0;try{for(var De=de.keys()[Symbol.iterator](),We;!(ve=(We=De.next()).done);ve=!0){var Oe=We.value;Me(Oe)}}catch(Kt){pe=!0,He=Kt}finally{try{if(!ve&&De.return)De.return()}finally{if(pe)throw He}}var lr=function(Rt){if(ot.get(Rt))ot.get(Rt).forEach(function(Xt){x[N.get(Xt)]=ce.get(Rt)});else x[N.get(Rt)]=ce.get(Rt)},xe=!0,Ve=!1,ze=void 0;try{for(var Ie=ce.keys()[Symbol.iterator](),$e;!(xe=($e=Ie.next()).done);xe=!0){var Oe=$e.value;lr(Oe)}}catch(Kt){Ve=!0,ze=Kt}finally{try{if(!xe&&Ie.return)Ie.return()}finally{if(Ve)throw ze}}})()}for(var _t=0;_t<W.length;_t++){var qt=W[_t];if(qt.getChild()==null)qt.setCenter(L[N.get(qt.id)],x[N.get(qt.id)])}},o.exports=g},551:(o)=>{o.exports=C}},D={};function v(o){var n=D[o];if(n!==void 0)return n.exports;var a=D[o]={exports:{}};return F[o](a,a.exports,v),a.exports}var f=v(45);return f})()})});var Be=yn(function(Le,Ge){(function(F,D){if(typeof Le==="object"&&typeof Ge==="object")Ge.exports=D(Pe());else if(typeof define==="function"&&define.amd)define(["cose-base"],D);else if(typeof Le==="object")Le.cytoscapeFcose=D(Pe());else F.cytoscapeFcose=D(F.coseBase)})(Le,function(C){return(()=>{var F={658:(o)=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(n){for(var a=arguments.length,u=Array(a>1?a-1:0),r=1;r<a;r++)u[r-1]=arguments[r];return u.forEach(function(y){Object.keys(y).forEach(function(i){return n[i]=y[i]})}),n}},548:(o,n,a)=>{var u=function(){function i(e,g){var d=[],c=!0,I=!1,N=void 0;try{for(var L=e[Symbol.iterator](),x;!(c=(x=L.next()).done);c=!0)if(d.push(x.value),g&&d.length===g)break}catch(W){I=!0,N=W}finally{try{if(!c&&L.return)L.return()}finally{if(I)throw N}}return d}return function(e,g){if(Array.isArray(e))return e;else if(Symbol.iterator in Object(e))return i(e,g);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=a(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(i){var e={};for(var g=0;g<i.length;g++)e[i[g].id()]=!0;var d=i.filter(function(c,I){if(typeof c==="number")c=I;var N=c.parent()[0];while(N!=null){if(e[N.id()])return!1;N=N.parent()[0]}return!0});return d},y.connectComponents=function(i,e,g,d){var c=new r,I=new Set,N=[],L=void 0,x=void 0,W=void 0,S=!1,B=1,tt=[],Q=[],ft=function(){var et=i.collection();Q.push(et);var s=g[0],w=i.collection();w.merge(s).merge(s.descendants().intersection(e)),N.push(s),w.forEach(function(m){c.push(m),I.add(m),et.merge(m)});var T=function(){s=c.shift();var H=i.collection();s.neighborhood().nodes().forEach(function(V){if(e.intersection(s.edgesWith(V)).length>0)H.merge(V)});for(var U=0;U<H.length;U++){var q=H[U];if(L=g.intersection(q.union(q.ancestors())),L!=null&&!I.has(L[0])){var Z=L.union(L.descendants());Z.forEach(function(V){if(c.push(V),I.add(V),et.merge(V),g.has(V))N.push(V)})}}};while(c.length!=0)T();if(et.forEach(function(m){e.intersection(m.connectedEdges()).forEach(function(H){if(et.has(H.source())&&et.has(H.target()))et.merge(H)})}),N.length==g.length)S=!0;if(!S||S&&B>1){x=N[0],W=x.connectedEdges().length,N.forEach(function(m){if(m.connectedEdges().length<W)W=m.connectedEdges().length,x=m}),tt.push(x.id());var A=i.collection();A.merge(N[0]),N.forEach(function(m){A.merge(m)}),N=[],g=g.difference(A),B++}};do ft();while(!S);if(d){if(tt.length>0)d.set("dummy"+(d.size+1),tt)}return Q},y.relocateComponent=function(i,e,g){if(!g.fixedNodeConstraint){var{POSITIVE_INFINITY:d,NEGATIVE_INFINITY:c,POSITIVE_INFINITY:I,NEGATIVE_INFINITY:N}=Number;if(g.quality=="draft"){var L=!0,x=!1,W=void 0;try{for(var S=e.nodeIndexes[Symbol.iterator](),B;!(L=(B=S.next()).done);L=!0){var tt=B.value,Q=u(tt,2),ft=Q[0],Y=Q[1],et=g.cy.getElementById(ft);if(et){var s=et.boundingBox(),w=e.xCoords[Y]-s.w/2,T=e.xCoords[Y]+s.w/2,A=e.yCoords[Y]-s.h/2,m=e.yCoords[Y]+s.h/2;if(w<d)d=w;if(T>c)c=T;if(A<I)I=A;if(m>N)N=m}}}catch(V){x=!0,W=V}finally{try{if(!L&&S.return)S.return()}finally{if(x)throw W}}var H=i.x-(c+d)/2,U=i.y-(N+I)/2;e.xCoords=e.xCoords.map(function(V){return V+H}),e.yCoords=e.yCoords.map(function(V){return V+U})}else{Object.keys(e).forEach(function(V){var ht=e[V],vt=ht.getRect().x,k=ht.getRect().x+ht.getRect().width,dt=ht.getRect().y,at=ht.getRect().y+ht.getRect().height;if(vt<d)d=vt;if(k>c)c=k;if(dt<I)I=dt;if(at>N)N=at});var q=i.x-(c+d)/2,Z=i.y-(N+I)/2;Object.keys(e).forEach(function(V){var ht=e[V];ht.setCenter(ht.getCenterX()+q,ht.getCenterY()+Z)})}}},y.calcBoundingBox=function(i,e,g,d){var{MAX_SAFE_INTEGER:c,MIN_SAFE_INTEGER:I,MAX_SAFE_INTEGER:N,MIN_SAFE_INTEGER:L}=Number,x=void 0,W=void 0,S=void 0,B=void 0,tt=i.descendants().not(":parent"),Q=tt.length;for(var ft=0;ft<Q;ft++){var Y=tt[ft];if(x=e[d.get(Y.id())]-Y.width()/2,W=e[d.get(Y.id())]+Y.width()/2,S=g[d.get(Y.id())]-Y.height()/2,B=g[d.get(Y.id())]+Y.height()/2,c>x)c=x;if(I<W)I=W;if(N>S)N=S;if(L<B)L=B}var et={};return et.topLeftX=c,et.topLeftY=N,et.width=I-c,et.height=L-N,et},y.calcParentsWithoutChildren=function(i,e){var g=i.collection();return e.nodes(":parent").forEach(function(d){var c=!1;if(d.children().forEach(function(I){if(I.css("display")!="none")c=!0}),!c)g.merge(d)}),g},o.exports=y},816:(o,n,a)=>{var u=a(548),r=a(140).CoSELayout,y=a(140).CoSENode,i=a(140).layoutBase.PointD,e=a(140).layoutBase.DimensionD,g=a(140).layoutBase.LayoutConstants,d=a(140).layoutBase.FDLayoutConstants,c=a(140).CoSEConstants,I=function(L,x){var{cy:W,eles:S}=L,B=S.nodes(),tt=S.edges(),Q=void 0,ft=void 0,Y=void 0,et={};if(L.randomize)Q=x.nodeIndexes,ft=x.xCoords,Y=x.yCoords;var s=function(V){return typeof V==="function"},w=function(V,ht){if(s(V))return V(ht);else return V},T=u.calcParentsWithoutChildren(W,S),A=function Z(V,ht,vt,k){var dt=ht.length;for(var at=0;at<dt;at++){var b=ht[at],_=null;if(b.intersection(T).length==0)_=b.children();var rt=void 0,gt=b.layoutDimensions({nodeDimensionsIncludeLabels:k.nodeDimensionsIncludeLabels});if(b.outerWidth()!=null&&b.outerHeight()!=null)if(k.randomize)if(!b.isParent())rt=V.add(new y(vt.graphManager,new i(ft[Q.get(b.id())]-gt.w/2,Y[Q.get(b.id())]-gt.h/2),new e(parseFloat(gt.w),parseFloat(gt.h))));else{var Lt=u.calcBoundingBox(b,ft,Y,Q);if(b.intersection(T).length==0)rt=V.add(new y(vt.graphManager,new i(Lt.topLeftX,Lt.topLeftY),new e(Lt.width,Lt.height)));else rt=V.add(new y(vt.graphManager,new i(Lt.topLeftX,Lt.topLeftY),new e(parseFloat(gt.w),parseFloat(gt.h))))}else rt=V.add(new y(vt.graphManager,new i(b.position("x")-gt.w/2,b.position("y")-gt.h/2),new e(parseFloat(gt.w),parseFloat(gt.h))));else rt=V.add(new y(this.graphManager));if(rt.id=b.data("id"),rt.nodeRepulsion=w(k.nodeRepulsion,b),rt.paddingLeft=parseInt(b.css("padding")),rt.paddingTop=parseInt(b.css("padding")),rt.paddingRight=parseInt(b.css("padding")),rt.paddingBottom=parseInt(b.css("padding")),k.nodeDimensionsIncludeLabels)rt.labelWidth=b.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,rt.labelHeight=b.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,rt.labelPosVertical=b.css("text-valign"),rt.labelPosHorizontal=b.css("text-halign");if(et[b.data("id")]=rt,isNaN(rt.rect.x))rt.rect.x=0;if(isNaN(rt.rect.y))rt.rect.y=0;if(_!=null&&_.length>0){var Gt=void 0;Gt=vt.getGraphManager().add(vt.newGraph(),rt),Z(Gt,_,vt,k)}}},m=function(V,ht,vt){var k=0,dt=0;for(var at=0;at<vt.length;at++){var b=vt[at],_=et[b.data("source")],rt=et[b.data("target")];if(_&&rt&&_!==rt&&_.getEdgesBetween(rt).length==0){var gt=ht.add(V.newEdge(),_,rt);gt.id=b.id(),gt.idealLength=w(L.idealEdgeLength,b),gt.edgeElasticity=w(L.edgeElasticity,b),k+=gt.idealLength,dt++}}if(L.idealEdgeLength!=null){if(dt>0)c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=k/dt;else if(!s(L.idealEdgeLength))c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=L.idealEdgeLength;else c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=50;c.MIN_REPULSION_DIST=d.MIN_REPULSION_DIST=d.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH}},H=function(V,ht){if(ht.fixedNodeConstraint)V.constraints.fixedNodeConstraint=ht.fixedNodeConstraint;if(ht.alignmentConstraint)V.constraints.alignmentConstraint=ht.alignmentConstraint;if(ht.relativePlacementConstraint)V.constraints.relativePlacementConstraint=ht.relativePlacementConstraint};if(L.nestingFactor!=null)c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=L.nestingFactor;if(L.gravity!=null)c.DEFAULT_GRAVITY_STRENGTH=d.DEFAULT_GRAVITY_STRENGTH=L.gravity;if(L.numIter!=null)c.MAX_ITERATIONS=d.MAX_ITERATIONS=L.numIter;if(L.gravityRange!=null)c.DEFAULT_GRAVITY_RANGE_FACTOR=d.DEFAULT_GRAVITY_RANGE_FACTOR=L.gravityRange;if(L.gravityCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=L.gravityCompound;if(L.gravityRangeCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=L.gravityRangeCompound;if(L.initialEnergyOnIncremental!=null)c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.DEFAULT_COOLING_FACTOR_INCREMENTAL=L.initialEnergyOnIncremental;if(L.tilingCompareBy!=null)c.TILING_COMPARE_BY=L.tilingCompareBy;if(L.quality=="proof")g.QUALITY=2;else g.QUALITY=0;if(c.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=L.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!L.randomize,c.ANIMATE=d.ANIMATE=g.ANIMATE=L.animate,c.TILE=L.tile,c.TILING_PADDING_VERTICAL=typeof L.tilingPaddingVertical==="function"?L.tilingPaddingVertical.call():L.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL=typeof L.tilingPaddingHorizontal==="function"?L.tilingPaddingHorizontal.call():L.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!L.randomize,g.DEFAULT_UNIFORM_LEAF_NODE_SIZES=L.uniformNodeDimensions,L.step=="transformed")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1;if(L.step=="enforced")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1;if(L.step=="cose")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0;if(L.step=="all"){if(L.randomize)c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0}if(L.fixedNodeConstraint||L.alignmentConstraint||L.relativePlacementConstraint)c.TREE_REDUCTION_ON_INCREMENTAL=!1;else c.TREE_REDUCTION_ON_INCREMENTAL=!0;var U=new r,q=U.newGraphManager();return A(q.addRoot(),u.getTopMostNodes(B),U,L),m(U,q,tt),H(U,L),U.runLayout(),et};o.exports={coseLayout:I}},212:(o,n,a)=>{var u=function(){function L(x,W){for(var S=0;S<W.length;S++){var B=W[S];if(B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B)B.writable=!0;Object.defineProperty(x,B.key,B)}}return function(x,W,S){if(W)L(x.prototype,W);if(S)L(x,S);return x}}();function r(L,x){if(!(L instanceof x))throw TypeError("Cannot call a class as a function")}var y=a(658),i=a(548),e=a(657),g=e.spectralLayout,d=a(816),c=d.coseLayout,I=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(x){return 4500},idealEdgeLength:function(x){return 50},edgeElasticity:function(x){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(){}}),N=function(){function L(x){r(this,L),this.options=y({},I,x)}return u(L,[{key:"run",value:function(){var W=this,S=this.options,{cy:B,eles:tt}=S,Q=[],ft=void 0,Y=void 0,et=[],s=void 0,w=[];if(S.fixedNodeConstraint&&(!Array.isArray(S.fixedNodeConstraint)||S.fixedNodeConstraint.length==0))S.fixedNodeConstraint=void 0;if(S.alignmentConstraint){if(S.alignmentConstraint.vertical&&(!Array.isArray(S.alignmentConstraint.vertical)||S.alignmentConstraint.vertical.length==0))S.alignmentConstraint.vertical=void 0;if(S.alignmentConstraint.horizontal&&(!Array.isArray(S.alignmentConstraint.horizontal)||S.alignmentConstraint.horizontal.length==0))S.alignmentConstraint.horizontal=void 0}if(S.relativePlacementConstraint&&(!Array.isArray(S.relativePlacementConstraint)||S.relativePlacementConstraint.length==0))S.relativePlacementConstraint=void 0;var T=S.fixedNodeConstraint||S.alignmentConstraint||S.relativePlacementConstraint;if(T)S.tile=!1,S.packComponents=!1;var A=void 0,m=!1;if(B.layoutUtilities&&S.packComponents){if(A=B.layoutUtilities("get"),!A)A=B.layoutUtilities();m=!0}if(tt.nodes().length>0)if(!m){var H=S.eles.boundingBox();if(w.push({x:H.x1+H.w/2,y:H.y1+H.h/2}),S.randomize){var U=g(S);Q.push(U)}if(S.quality=="default"||S.quality=="proof")et.push(c(S,Q[0])),i.relocateComponent(w[0],et[0],S);else i.relocateComponent(w[0],Q[0],S)}else{var q=i.getTopMostNodes(S.eles.nodes());if(s=i.connectComponents(B,S.eles,q),s.forEach(function(Tt){var pt=Tt.boundingBox();w.push({x:pt.x1+pt.w/2,y:pt.y1+pt.h/2})}),S.randomize)s.forEach(function(Tt){S.eles=Tt,Q.push(g(S))});if(S.quality=="default"||S.quality=="proof"){var Z=B.collection();if(S.tile){var V=new Map,ht=[],vt=[],k=0,dt={nodeIndexes:V,xCoords:ht,yCoords:vt},at=[];if(s.forEach(function(Tt,pt){if(Tt.edges().length==0)Tt.nodes().forEach(function(It,St){if(Z.merge(Tt.nodes()[St]),!It.isParent())dt.nodeIndexes.set(Tt.nodes()[St].id(),k++),dt.xCoords.push(Tt.nodes()[0].position().x),dt.yCoords.push(Tt.nodes()[0].position().y)}),at.push(pt)}),Z.length>1){var b=Z.boundingBox();w.push({x:b.x1+b.w/2,y:b.y1+b.h/2}),s.push(Z),Q.push(dt);for(var _=at.length-1;_>=0;_--)s.splice(at[_],1),Q.splice(at[_],1),w.splice(at[_],1)}}s.forEach(function(Tt,pt){S.eles=Tt,et.push(c(S,Q[pt])),i.relocateComponent(w[pt],et[pt],S)})}else s.forEach(function(Tt,pt){i.relocateComponent(w[pt],Q[pt],S)});var rt=new Set;if(s.length>1){var gt=[],Lt=tt.filter(function(Tt){return Tt.css("display")=="none"});s.forEach(function(Tt,pt){var It=void 0;if(S.quality=="draft")It=Q[pt].nodeIndexes;if(Tt.nodes().not(Lt).length>0){var St={};St.edges=[],St.nodes=[];var Ut=void 0;if(Tt.nodes().not(Lt).forEach(function(Ft){if(S.quality=="draft")if(!Ft.isParent())Ut=It.get(Ft.id()),St.nodes.push({x:Q[pt].xCoords[Ut]-Ft.boundingbox().w/2,y:Q[pt].yCoords[Ut]-Ft.boundingbox().h/2,width:Ft.boundingbox().w,height:Ft.boundingbox().h});else{var bt=i.calcBoundingBox(Ft,Q[pt].xCoords,Q[pt].yCoords,It);St.nodes.push({x:bt.topLeftX,y:bt.topLeftY,width:bt.width,height:bt.height})}else if(et[pt][Ft.id()])St.nodes.push({x:et[pt][Ft.id()].getLeft(),y:et[pt][Ft.id()].getTop(),width:et[pt][Ft.id()].getWidth(),height:et[pt][Ft.id()].getHeight()})}),Tt.edges().forEach(function(Ft){var bt=Ft.source(),Wt=Ft.target();if(bt.css("display")!="none"&&Wt.css("display")!="none"){if(S.quality=="draft"){var $t=It.get(bt.id()),re=It.get(Wt.id()),Qt=[],_t=[];if(bt.isParent()){var qt=i.calcBoundingBox(bt,Q[pt].xCoords,Q[pt].yCoords,It);Qt.push(qt.topLeftX+qt.width/2),Qt.push(qt.topLeftY+qt.height/2)}else Qt.push(Q[pt].xCoords[$t]),Qt.push(Q[pt].yCoords[$t]);if(Wt.isParent()){var J=i.calcBoundingBox(Wt,Q[pt].xCoords,Q[pt].yCoords,It);_t.push(J.topLeftX+J.width/2),_t.push(J.topLeftY+J.height/2)}else _t.push(Q[pt].xCoords[re]),_t.push(Q[pt].yCoords[re]);St.edges.push({startX:Qt[0],startY:Qt[1],endX:_t[0],endY:_t[1]})}else if(et[pt][bt.id()]&&et[pt][Wt.id()])St.edges.push({startX:et[pt][bt.id()].getCenterX(),startY:et[pt][bt.id()].getCenterY(),endX:et[pt][Wt.id()].getCenterX(),endY:et[pt][Wt.id()].getCenterY()})}}),St.nodes.length>0)gt.push(St),rt.add(pt)}});var Gt=A.packComponents(gt,S.randomize).shifts;if(S.quality=="draft")Q.forEach(function(Tt,pt){var It=Tt.xCoords.map(function(Ut){return Ut+Gt[pt].dx}),St=Tt.yCoords.map(function(Ut){return Ut+Gt[pt].dy});Tt.xCoords=It,Tt.yCoords=St});else{var Zt=0;rt.forEach(function(Tt){Object.keys(et[Tt]).forEach(function(pt){var It=et[Tt][pt];It.setCenter(It.getCenterX()+Gt[Zt].dx,It.getCenterY()+Gt[Zt].dy)}),Zt++})}}}var ct=function(pt,It){if(S.quality=="default"||S.quality=="proof"){if(typeof pt==="number")pt=It;var St=void 0,Ut=void 0,Ft=pt.data("id");if(et.forEach(function(Wt){if(Ft in Wt)St={x:Wt[Ft].getRect().getCenterX(),y:Wt[Ft].getRect().getCenterY()},Ut=Wt[Ft]}),S.nodeDimensionsIncludeLabels){if(Ut.labelWidth){if(Ut.labelPosHorizontal=="left")St.x+=Ut.labelWidth/2;else if(Ut.labelPosHorizontal=="right")St.x-=Ut.labelWidth/2}if(Ut.labelHeight){if(Ut.labelPosVertical=="top")St.y+=Ut.labelHeight/2;else if(Ut.labelPosVertical=="bottom")St.y-=Ut.labelHeight/2}}if(St==null)St={x:pt.position("x"),y:pt.position("y")};return{x:St.x,y:St.y}}else{var bt=void 0;if(Q.forEach(function(Wt){var $t=Wt.nodeIndexes.get(pt.id());if($t!=null)bt={x:Wt.xCoords[$t],y:Wt.yCoords[$t]}}),bt==null)bt={x:pt.position("x"),y:pt.position("y")};return{x:bt.x,y:bt.y}}};if(S.quality=="default"||S.quality=="proof"||S.randomize){var jt=i.calcParentsWithoutChildren(B,tt),Ht=tt.filter(function(Tt){return Tt.css("display")=="none"});if(S.eles=tt.not(Ht),tt.nodes().not(":parent").not(Ht).layoutPositions(W,S,ct),jt.length>0)jt.forEach(function(Tt){Tt.position(ct(Tt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),L}();o.exports=N},657:(o,n,a)=>{var u=a(548),r=a(140).layoutBase.Matrix,y=a(140).layoutBase.SVD,i=function(g){var{cy:d,eles:c}=g,I=c.nodes(),N=c.nodes(":parent"),L=new Map,x=new Map,W=new Map,S=[],B=[],tt=[],Q=[],ft=[],Y=[],et=[],s=[],w=void 0,T=void 0,A=1e8,m=0.000000001,{piTol:H,samplingType:U,nodeSeparation:q}=g,Z=void 0,V=function(){var nt=0,ot=0,st=!1;while(ot<Z){nt=Math.floor(Math.random()*T),st=!1;for(var ut=0;ut<ot;ut++)if(Q[ut]==nt){st=!0;break}if(!st)Q[ot]=nt,ot++;else continue}},ht=function(nt,ot,st){var ut=[],Dt=0,Ct=0,lt=0,wt=void 0,At=[],yt=0,xt=1;for(var Yt=0;Yt<T;Yt++)At[Yt]=A;ut[Ct]=nt,At[nt]=0;while(Ct>=Dt){lt=ut[Dt++];var Nt=S[lt];for(var mt=0;mt<Nt.length;mt++)if(wt=x.get(Nt[mt]),At[wt]==A)At[wt]=At[lt]+1,ut[++Ct]=wt;Y[lt][ot]=At[lt]*q}if(st){for(var Ot=0;Ot<T;Ot++)if(Y[Ot][ot]<ft[Ot])ft[Ot]=Y[Ot][ot];for(var Et=0;Et<T;Et++)if(ft[Et]>yt)yt=ft[Et],xt=Et}return xt},vt=function(nt){var ot=void 0;if(!nt){V();for(var st=0;st<Z;st++)ht(Q[st],st,nt,!1)}else{ot=Math.floor(Math.random()*T),w=ot;for(var ut=0;ut<T;ut++)ft[ut]=A;for(var Dt=0;Dt<Z;Dt++)Q[Dt]=ot,ot=ht(ot,Dt,nt)}for(var Ct=0;Ct<T;Ct++)for(var lt=0;lt<Z;lt++)Y[Ct][lt]*=Y[Ct][lt];for(var wt=0;wt<Z;wt++)et[wt]=[];for(var At=0;At<Z;At++)for(var yt=0;yt<Z;yt++)et[At][yt]=Y[Q[yt]][At]},k=function(){var nt=y.svd(et),{S:ot,U:st,V:ut}=nt,Dt=ot[0]*ot[0]*ot[0],Ct=[];for(var lt=0;lt<Z;lt++){Ct[lt]=[];for(var wt=0;wt<Z;wt++)if(Ct[lt][wt]=0,lt==wt)Ct[lt][wt]=ot[lt]/(ot[lt]*ot[lt]+Dt/(ot[lt]*ot[lt]))}s=r.multMat(r.multMat(ut,Ct),r.transpose(st))},dt=function(){var nt=void 0,ot=void 0,st=[],ut=[],Dt=[],Ct=[];for(var lt=0;lt<T;lt++)st[lt]=Math.random(),ut[lt]=Math.random();st=r.normalize(st),ut=r.normalize(ut);var wt=0,At=m,yt=m,xt=void 0;while(!0){wt++;for(var Yt=0;Yt<T;Yt++)Dt[Yt]=st[Yt];if(st=r.multGamma(r.multL(r.multGamma(Dt),Y,s)),nt=r.dotProduct(Dt,st),st=r.normalize(st),At=r.dotProduct(Dt,st),xt=Math.abs(At/yt),xt<=1+H&&xt>=1)break;yt=At}for(var Nt=0;Nt<T;Nt++)Dt[Nt]=st[Nt];wt=0,yt=m;while(!0){wt++;for(var mt=0;mt<T;mt++)Ct[mt]=ut[mt];if(Ct=r.minusOp(Ct,r.multCons(Dt,r.dotProduct(Dt,Ct))),ut=r.multGamma(r.multL(r.multGamma(Ct),Y,s)),ot=r.dotProduct(Ct,ut),ut=r.normalize(ut),At=r.dotProduct(Ct,ut),xt=Math.abs(At/yt),xt<=1+H&&xt>=1)break;yt=At}for(var Ot=0;Ot<T;Ot++)Ct[Ot]=ut[Ot];B=r.multCons(Dt,Math.sqrt(Math.abs(nt))),tt=r.multCons(Ct,Math.sqrt(Math.abs(ot)))};u.connectComponents(d,c,u.getTopMostNodes(I),L),N.forEach(function(it){u.connectComponents(d,c,u.getTopMostNodes(it.descendants().intersection(c)),L)});var at=0;for(var b=0;b<I.length;b++)if(!I[b].isParent())x.set(I[b].id(),at++);var _=!0,rt=!1,gt=void 0;try{for(var Lt=L.keys()[Symbol.iterator](),Gt;!(_=(Gt=Lt.next()).done);_=!0){var Zt=Gt.value;x.set(Zt,at++)}}catch(it){rt=!0,gt=it}finally{try{if(!_&&Lt.return)Lt.return()}finally{if(rt)throw gt}}for(var ct=0;ct<x.size;ct++)S[ct]=[];N.forEach(function(it){var nt=it.children().intersection(c);while(nt.nodes(":childless").length==0)nt=nt.nodes()[0].children().intersection(c);var ot=0,st=nt.nodes(":childless")[0].connectedEdges().length;nt.nodes(":childless").forEach(function(ut,Dt){if(ut.connectedEdges().length<st)st=ut.connectedEdges().length,ot=Dt}),W.set(it.id(),nt.nodes(":childless")[ot].id())}),I.forEach(function(it){var nt=void 0;if(it.isParent())nt=x.get(W.get(it.id()));else nt=x.get(it.id());it.neighborhood().nodes().forEach(function(ot){if(c.intersection(it.edgesWith(ot)).length>0)if(ot.isParent())S[nt].push(W.get(ot.id()));else S[nt].push(ot.id())})});var jt=function(nt){var ot=x.get(nt),st=void 0;L.get(nt).forEach(function(ut){if(d.getElementById(ut).isParent())st=W.get(ut);else st=ut;S[ot].push(st),S[x.get(st)].push(nt)})},Ht=!0,Tt=!1,pt=void 0;try{for(var It=L.keys()[Symbol.iterator](),St;!(Ht=(St=It.next()).done);Ht=!0){var Ut=St.value;jt(Ut)}}catch(it){Tt=!0,pt=it}finally{try{if(!Ht&&It.return)It.return()}finally{if(Tt)throw pt}}T=x.size;var Ft=void 0;if(T>2){Z=T<g.sampleSize?T:g.sampleSize;for(var bt=0;bt<T;bt++)Y[bt]=[];for(var Wt=0;Wt<Z;Wt++)s[Wt]=[];if(g.quality=="draft"||g.step=="all")vt(U),k(),dt(),Ft={nodeIndexes:x,xCoords:B,yCoords:tt};else x.forEach(function(it,nt){B.push(d.getElementById(nt).position("x")),tt.push(d.getElementById(nt).position("y"))}),Ft={nodeIndexes:x,xCoords:B,yCoords:tt};return Ft}else{var $t=x.keys(),re=d.getElementById($t.next().value),Qt=re.position(),_t=re.outerWidth();if(B.push(Qt.x),tt.push(Qt.y),T==2){var qt=d.getElementById($t.next().value),J=qt.outerWidth();B.push(Qt.x+_t/2+J/2+g.idealEdgeLength),tt.push(Qt.y)}return Ft={nodeIndexes:x,xCoords:B,yCoords:tt},Ft}};o.exports={spectralLayout:i}},579:(o,n,a)=>{var u=a(212),r=function(i){if(!i)return;i("layout","fcose",u)};if(typeof cytoscape<"u")r(cytoscape);o.exports=r},140:(o)=>{o.exports=C}},D={};function v(o){var n=D[o];if(n!==void 0)return n.exports;var a=D[o]={exports:{}};return F[o](a,a.exports,v),a.exports}var f=v(579);return f})()})});var _e=rn(Be(),1);var Ze={L:"left",R:"right",T:"top",B:"bottom"},ke={L:t((C)=>`${C},${C/2} 0,${C} 0,0`,"L"),R:t((C)=>`0,${C/2} ${C},0 ${C},${C}`,"R"),T:t((C)=>`0,0 ${C},0 ${C/2},${C}`,"T"),B:t((C)=>`${C/2},0 ${C},${C} 0,${C}`,"B")},Ce={L:t((C,F)=>C-F+2,"L"),R:t((C,F)=>C-2,"R"),T:t((C,F)=>C-F+2,"T"),B:t((C,F)=>C-2,"B")},fr=t(function(C){if(ee(C))return C==="L"?"R":"L";else return C==="T"?"B":"T"},"getOppositeArchitectureDirection"),qe=t(function(C){let F=C;return F==="L"||F==="R"||F==="T"||F==="B"},"isArchitectureDirection"),ee=t(function(C){let F=C;return F==="L"||F==="R"},"isArchitectureDirectionX"),le=t(function(C){let F=C;return F==="T"||F==="B"},"isArchitectureDirectionY"),Xe=t(function(C,F){let D=ee(C)&&le(F),v=le(C)&&ee(F);return D||v},"isArchitectureDirectionXY"),cr=t(function(C){let F=C[0],D=C[1],v=ee(F)&&le(D),f=le(F)&&ee(D);return v||f},"isArchitecturePairXY"),gr=t(function(C){return C!=="LL"&&C!=="RR"&&C!=="TT"&&C!=="BB"},"isValidArchitectureDirectionPair"),Ue=t(function(C,F){let D=`${C}${F}`;return gr(D)?D:void 0},"getArchitectureDirectionPair"),ur=t(function([C,F],D){let v=D[0],f=D[1];if(ee(v))if(le(f))return[C+(v==="L"?-1:1),F+(f==="T"?1:-1)];else return[C+(v==="L"?-1:1),F];else if(ee(f))return[C+(f==="L"?1:-1),F+(v==="T"?1:-1)];else return[C,F+(v==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),dr=t(function(C){if(C==="LT"||C==="TL")return[1,1];else if(C==="BL"||C==="LB")return[1,-1];else if(C==="BR"||C==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),vr=t(function(C,F){if(Xe(C,F))return"bend";else if(ee(C))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),pr=t(function(C){return C.type==="service"},"isArchitectureService"),yr=t(function(C){return C.type==="junction"},"isArchitectureJunction"),Qe=t((C,F)=>{let[D,v]=[C,F].sort();return`${JSON.stringify(D)}-${JSON.stringify(v)}`},"architectureGroupAlignmentKey"),Je=t((C)=>C.data(),"edgeData"),me=t((C)=>C.data(),"nodeData"),mr=K.architecture,Ke=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=M,this.getAccTitle=O,this.setDiagramTitle=j,this.getDiagramTitle=G,this.getAccDescription=z,this.setAccDescription=P,this.clear()}static{t(this,"ArchitectureDB")}setDiagramId(C){this.diagramId=C}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="",R()}addService({id:C,icon:F,in:D,title:v,iconText:f}){if(this.registeredIds.has(C))throw Error(`The service id [${C}] is already in use by another ${this.registeredIds.get(C)}`);if(D!==void 0){if(C===D)throw Error(`The service [${C}] cannot be placed within itself`);if(!this.registeredIds.has(D))throw Error(`The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(D)==="node")throw Error(`The service [${C}]'s parent is not a group`)}this.registeredIds.set(C,"node"),this.nodes.set(C,{id:C,type:"service",icon:F,iconText:f,title:v,edges:[],in:D})}getServices(){return[...this.nodes.values()].filter(pr)}addJunction({id:C,in:F}){if(this.registeredIds.has(C))throw Error(`The junction id [${C}] is already in use by another ${this.registeredIds.get(C)}`);if(F!==void 0){if(C===F)throw Error(`The junction [${C}] cannot be placed within itself`);if(!this.registeredIds.has(F))throw Error(`The junction [${C}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(F)==="node")throw Error(`The junction [${C}]'s parent is not a group`)}this.registeredIds.set(C,"node"),this.nodes.set(C,{id:C,type:"junction",edges:[],in:F})}getJunctions(){return[...this.nodes.values()].filter(yr)}getNodes(){return[...this.nodes.values()]}getNode(C){return this.nodes.get(C)??null}addGroup({id:C,icon:F,in:D,title:v}){if(this.registeredIds.has(C))throw Error(`The group id [${C}] is already in use by another ${this.registeredIds.get(C)}`);if(D!==void 0){if(C===D)throw Error(`The group [${C}] cannot be placed within itself`);if(!this.registeredIds.has(D))throw Error(`The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(D)==="node")throw Error(`The group [${C}]'s parent is not a group`)}this.registeredIds.set(C,"group"),this.groups.set(C,{id:C,icon:F,title:v,in:D})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:C,rhsId:F,lhsDir:D,rhsDir:v,lhsInto:f,rhsInto:o,lhsGroup:n,rhsGroup:a,title:u}){if(!qe(D))throw Error(`Invalid direction given for left hand side of edge ${C}--${F}. Expected (L,R,T,B) got ${String(D)}`);if(!qe(v))throw Error(`Invalid direction given for right hand side of edge ${C}--${F}. Expected (L,R,T,B) got ${String(v)}`);if(!this.nodes.has(C)&&!this.groups.has(C))throw Error(`The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(F)&&!this.groups.has(F))throw Error(`The right-hand id [${F}] does not yet exist. Please create the service/group before declaring an edge to it.`);let r=this.nodes.get(C).in,y=this.nodes.get(F).in;if(n&&r&&y&&r==y)throw Error(`The left-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&r&&y&&r==y)throw Error(`The right-hand id [${F}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:C,lhsDir:D,lhsInto:f,lhsGroup:n,rhsId:F,rhsDir:v,rhsInto:o,rhsGroup:a,title:u};this.edges.push(i);let e=this.nodes.get(C),g=this.nodes.get(F);if(e&&g)e.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(C){if(C.members.length<2)throw Error(`An align directive requires at least two members; got ${C.members.length}`);let F=new Set;C.members.forEach((D)=>{if(this.registeredIds.get(D)!=="node")throw Error(`align ${C.direction} references [${D}], which is not a service or junction`);if(F.has(D))throw Error(`align ${C.direction} lists [${D}] more than once`);F.add(D)}),this.layoutHints.push(C)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let C=new Map,F=new Map;for(let[n,a]of this.nodes.entries()){let u=new Map;for(let r of a.edges){let y=this.getNode(r.lhsId)?.in,i=this.getNode(r.rhsId)?.in;if(y&&i&&y!==i){let e=vr(r.lhsDir,r.rhsDir);if(e!=="bend")C.set(Qe(y,i),e)}if(r.lhsId===n){let e=Ue(r.lhsDir,r.rhsDir);if(e)u.set(e,r.rhsId)}else{let e=Ue(r.rhsDir,r.lhsDir);if(e)u.set(e,r.lhsId)}}F.set(n,u)}let D=new Set,v=new Set(F.keys()),f=t((n)=>{let a=new Map([[n,[0,0]]]),u=[n];while(u.length>0){let r=u.shift();if(r){D.add(r),v.delete(r);let y=F.get(r);if(!y)throw Error(`BFS error: adjacency list for id ${r} not found. Please report this as a bug.`);let i=a.get(r);if(!i)throw Error(`BFS error: position for id ${r} not found in spatial map. Please report this as a bug.`);let[e,g]=i;y.forEach((d,c)=>{if(!D.has(d))a.set(d,ur([e,g],c)),u.push(d)})}}return a},"BFS"),o=[];while(v.size>0){let n=v.values().next().value;o.push(f(n))}this.dataStructures={adjList:F,spatialMaps:o,groupAlignments:C}}return this.dataStructures}setElementForId(C,F){this.elements.set(C,F)}getElementById(C){return this.elements.get(C)}getConfig(){return ae({...mr,...E().architecture})}getConfigField(C){return this.getConfig()[C]}},Er=t((C,F)=>{be(C,F),C.groups.map((D)=>F.addGroup(D)),C.services.map((D)=>F.addService({...D,type:"service"})),C.junctions.map((D)=>F.addJunction({...D,type:"junction"})),C.edges.map((D)=>F.addEdge(D)),C.alignments?.map((D)=>F.addLayoutHint({direction:D.direction,members:[...D.members]}))},"populateDb"),je={parser:{yy:void 0},parse:t(async(C)=>{let F=await Te("architecture",C);l.debug(F);let D=je.parser?.yy;if(!(D instanceof Ke))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.");Er(F,D)},"parse")},Tr=t((C)=>`
1
+ import{be}from"./index-gcs49f3p.js";import{t,l,K,E,X,Rr,R,L,O,P,z,j,G,p,h,ue,vf,So,ar,ie,An,Zt}from"./index-vw5k8csz.js";import{Te}from"./index-trm9x02n.js";import{Qr}from"./index-xj9649ac.js";import{an,yn}from"./index-sdtye3jy.js";var Se=yn(function(Ee,Re){(function(F,D){if(typeof Ee==="object"&&typeof Re==="object")Re.exports=D();else if(typeof define==="function"&&define.amd)define([],D);else if(typeof Ee==="object")Ee.layoutBase=D();else F.layoutBase=D()})(Ee,function(){return function(C){var F={};function D(v){if(F[v])return F[v].exports;var f=F[v]={i:v,l:!1,exports:{}};return C[v].call(f.exports,f,f.exports,D),f.l=!0,f.exports}return D.m=C,D.c=F,D.i=function(v){return v},D.d=function(v,f,o){if(!D.o(v,f))Object.defineProperty(v,f,{configurable:!1,enumerable:!0,get:o})},D.n=function(v){var f=v&&v.__esModule?function(){return v.default}:function(){return v};return D.d(f,"a",f),f},D.o=function(v,f){return Object.prototype.hasOwnProperty.call(v,f)},D.p="",D(D.s=28)}([function(C,F,D){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1000,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,C.exports=v},function(C,F,D){var v=D(2),f=D(8),o=D(9);function n(u,r,y){v.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=u,this.target=r}n.prototype=Object.create(v.prototype);for(var a in v)n[a]=v[a];n.prototype.getSource=function(){return this.source},n.prototype.getTarget=function(){return this.target},n.prototype.isInterGraph=function(){return this.isInterGraph},n.prototype.getLength=function(){return this.length},n.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},n.prototype.getBendpoints=function(){return this.bendpoints},n.prototype.getLca=function(){return this.lca},n.prototype.getSourceInLca=function(){return this.sourceInLca},n.prototype.getTargetInLca=function(){return this.targetInLca},n.prototype.getOtherEnd=function(u){if(this.source===u)return this.target;else if(this.target===u)return this.source;else throw"Node is not incident with this edge"},n.prototype.getOtherEndInGraph=function(u,r){var y=this.getOtherEnd(u),i=r.getGraphManager().getRoot();while(!0){if(y.getOwner()==r)return y;if(y.getOwner()==i)break;y=y.getOwner().getParent()}return null},n.prototype.updateLength=function(){var u=[,,,,];if(this.isOverlapingSourceAndTarget=f.getIntersection(this.target.getRect(),this.source.getRect(),u),!this.isOverlapingSourceAndTarget){if(this.lengthX=u[0]-u[2],this.lengthY=u[1]-u[3],Math.abs(this.lengthX)<1)this.lengthX=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},n.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=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},C.exports=n},function(C,F,D){function v(f){this.vGraphObject=f}C.exports=v},function(C,F,D){var v=D(2),f=D(10),o=D(13),n=D(0),a=D(16),u=D(5);function r(i,e,g,d){if(g==null&&d==null)d=e;if(v.call(this,d),i.graphManager!=null)i=i.graphManager;if(this.estimatedSize=f.MIN_VALUE,this.inclusionTreeDepth=f.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=i,g!=null&&e!=null)this.rect=new o(e.x,e.y,g.width,g.height);else this.rect=new o}r.prototype=Object.create(v.prototype);for(var y in v)r[y]=v[y];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(i){this.rect.width=i},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(i){this.rect.height=i},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new u(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new u(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(i,e){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=e.width,this.rect.height=e.height},r.prototype.setCenter=function(i,e){this.rect.x=i-this.rect.width/2,this.rect.y=e-this.rect.height/2},r.prototype.setLocation=function(i,e){this.rect.x=i,this.rect.y=e},r.prototype.moveBy=function(i,e){this.rect.x+=i,this.rect.y+=e},r.prototype.getEdgeListToNode=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(c.target==i){if(c.source!=d)throw"Incorrect edge source!";e.push(c)}}),e},r.prototype.getEdgesBetween=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(!(c.source==d||c.target==d))throw"Incorrect edge source and/or target";if(c.target==i||c.source==i)e.push(c)}),e},r.prototype.getNeighborsList=function(){var i=new Set,e=this;return e.edges.forEach(function(g){if(g.source==e)i.add(g.target);else{if(g.target!=e)throw"Incorrect incidency!";i.add(g.source)}}),i},r.prototype.withChildren=function(){var i=new Set,e,g;if(i.add(this),this.child!=null){var d=this.child.getNodes();for(var c=0;c<d.length;c++)e=d[c],g=e.withChildren(),g.forEach(function(I){i.add(I)})}return i},r.prototype.getNoOfChildren=function(){var i=0,e;if(this.child==null)i=1;else{var g=this.child.getNodes();for(var d=0;d<g.length;d++)e=g[d],i+=e.getNoOfChildren()}if(i==0)i=1;return i},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.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},r.prototype.scatter=function(){var i,e,g=-n.INITIAL_WORLD_BOUNDARY,d=n.INITIAL_WORLD_BOUNDARY;i=n.WORLD_CENTER_X+a.nextDouble()*(d-g)+g;var c=-n.INITIAL_WORLD_BOUNDARY,I=n.INITIAL_WORLD_BOUNDARY;e=n.WORLD_CENTER_Y+a.nextDouble()*(I-c)+c,this.rect.x=i,this.rect.y=e},r.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),n.NODE_DIMENSIONS_INCLUDE_LABELS){var e=i.getRight()-i.getLeft(),g=i.getBottom()-i.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(e+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>e)this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(e+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(g+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>g)this.rect.y-=(this.labelHeight-g)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(g+this.labelHeight)}}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==f.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(i){var e=this.rect.x;if(e>n.WORLD_BOUNDARY)e=n.WORLD_BOUNDARY;else if(e<-n.WORLD_BOUNDARY)e=-n.WORLD_BOUNDARY;var g=this.rect.y;if(g>n.WORLD_BOUNDARY)g=n.WORLD_BOUNDARY;else if(g<-n.WORLD_BOUNDARY)g=-n.WORLD_BOUNDARY;var d=new u(e,g),c=i.inverseTransformPoint(d);this.setLocation(c.x,c.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},C.exports=r},function(C,F,D){var v=D(0);function f(){}for(var o in v)f[o]=v[o];f.MAX_ITERATIONS=2500,f.DEFAULT_EDGE_LENGTH=50,f.DEFAULT_SPRING_STRENGTH=0.45,f.DEFAULT_REPULSION_STRENGTH=4500,f.DEFAULT_GRAVITY_STRENGTH=0.4,f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,f.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,f.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,f.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,f.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,f.COOLING_ADAPTATION_FACTOR=0.33,f.ADAPTATION_LOWER_NODE_LIMIT=1000,f.ADAPTATION_UPPER_NODE_LIMIT=5000,f.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,f.MAX_NODE_DISPLACEMENT=f.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,f.CONVERGENCE_CHECK_PERIOD=100,f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,f.MIN_EDGE_LENGTH=1,f.GRID_CALCULATION_CHECK_PERIOD=10,C.exports=f},function(C,F,D){function v(f,o){if(f==null&&o==null)this.x=0,this.y=0;else this.x=f,this.y=o}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(f){this.x=f},v.prototype.setY=function(f){this.y=f},v.prototype.getDifference=function(f){return new DimensionD(this.x-f.x,this.y-f.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(f){return this.x+=f.width,this.y+=f.height,this},C.exports=v},function(C,F,D){var v=D(2),f=D(10),o=D(0),n=D(7),a=D(3),u=D(1),r=D(13),y=D(12),i=D(11);function e(d,c,I){if(v.call(this,I),this.estimatedSize=f.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,c!=null&&c instanceof n)this.graphManager=c;else if(c!=null&&c instanceof Layout)this.graphManager=c.graphManager}e.prototype=Object.create(v.prototype);for(var g in v)e[g]=v[g];e.prototype.getNodes=function(){return this.nodes},e.prototype.getEdges=function(){return this.edges},e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getParent=function(){return this.parent},e.prototype.getLeft=function(){return this.left},e.prototype.getRight=function(){return this.right},e.prototype.getTop=function(){return this.top},e.prototype.getBottom=function(){return this.bottom},e.prototype.isConnected=function(){return this.isConnected},e.prototype.add=function(d,c,I){if(c==null&&I==null){var N=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(N)>-1)throw"Node already in graph!";return N.owner=this,this.getNodes().push(N),N}else{var w=d;if(!(this.getNodes().indexOf(c)>-1&&this.getNodes().indexOf(I)>-1))throw"Source or target not in graph!";if(!(c.owner==I.owner&&c.owner==this))throw"Both owners must be this graph!";if(c.owner!=I.owner)return null;if(w.source=c,w.target=I,w.isInterGraph=!1,this.getEdges().push(w),c.edges.push(w),I!=c)I.edges.push(w);return w}},e.prototype.remove=function(d){var c=d;if(d instanceof a){if(c==null)throw"Node is null!";if(!(c.owner!=null&&c.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var I=c.edges.slice(),N,w=I.length;for(var x=0;x<w;x++)if(N=I[x],N.isInterGraph)this.graphManager.remove(N);else N.source.owner.remove(N);var W=this.nodes.indexOf(c);if(W==-1)throw"Node not in owner node list!";this.nodes.splice(W,1)}else if(d instanceof u){var N=d;if(N==null)throw"Edge is null!";if(!(N.source!=null&&N.target!=null))throw"Source and/or target is null!";if(!(N.source.owner!=null&&N.target.owner!=null&&N.source.owner==this&&N.target.owner==this))throw"Source and/or target owner is invalid!";var S=N.source.edges.indexOf(N),B=N.target.edges.indexOf(N);if(!(S>-1&&B>-1))throw"Source and/or target doesn't know this edge!";if(N.source.edges.splice(S,1),N.target!=N.source)N.target.edges.splice(B,1);var W=N.source.owner.getEdges().indexOf(N);if(W==-1)throw"Not in owner's edge list!";N.source.owner.getEdges().splice(W,1)}},e.prototype.updateLeftTop=function(){var{MAX_VALUE:d,MAX_VALUE:c}=f,I,N,w,x=this.getNodes(),W=x.length;for(var S=0;S<W;S++){var B=x[S];if(I=B.getTop(),N=B.getLeft(),d>I)d=I;if(c>N)c=N}if(d==f.MAX_VALUE)return null;if(x[0].getParent().paddingLeft!=null)w=x[0].getParent().paddingLeft;else w=this.margin;return this.left=c-w,this.top=d-w,new y(this.left,this.top)},e.prototype.updateBounds=function(d){var c=f.MAX_VALUE,I=-f.MAX_VALUE,N=f.MAX_VALUE,w=-f.MAX_VALUE,x,W,S,B,tt,Q=this.nodes,ft=Q.length;for(var Y=0;Y<ft;Y++){var et=Q[Y];if(d&&et.child!=null)et.updateBounds();if(x=et.getLeft(),W=et.getRight(),S=et.getTop(),B=et.getBottom(),c>x)c=x;if(I<W)I=W;if(N>S)N=S;if(w<B)w=B}var s=new r(c,N,I-c,w-N);if(c==f.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(Q[0].getParent().paddingLeft!=null)tt=Q[0].getParent().paddingLeft;else tt=this.margin;this.left=s.x-tt,this.right=s.x+s.width+tt,this.top=s.y-tt,this.bottom=s.y+s.height+tt},e.calculateBounds=function(d){var c=f.MAX_VALUE,I=-f.MAX_VALUE,N=f.MAX_VALUE,w=-f.MAX_VALUE,x,W,S,B,tt=d.length;for(var Q=0;Q<tt;Q++){var ft=d[Q];if(x=ft.getLeft(),W=ft.getRight(),S=ft.getTop(),B=ft.getBottom(),c>x)c=x;if(I<W)I=W;if(N>S)N=S;if(w<B)w=B}var Y=new r(c,N,I-c,w-N);return Y},e.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){var d=0,c=this.nodes,I=c.length;for(var N=0;N<I;N++){var w=c[N];d+=w.calcEstimatedSize()}if(d==0)this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=d/Math.sqrt(this.nodes.length);return this.estimatedSize},e.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var c=new i,I=new Set,N=this.nodes[0],w,x,W=N.withChildren();W.forEach(function(Y){c.push(Y),I.add(Y)});while(c.length!==0){N=c.shift(),w=N.getEdges();var S=w.length;for(var B=0;B<S;B++){var tt=w[B];if(x=tt.getOtherEndInGraph(N,this),x!=null&&!I.has(x)){var Q=x.withChildren();Q.forEach(function(Y){c.push(Y),I.add(Y)})}}}if(this.isConnected=!1,I.size>=this.nodes.length){var ft=0;if(I.forEach(function(Y){if(Y.owner==d)ft++}),ft==this.nodes.length)this.isConnected=!0}},C.exports=e},function(C,F,D){var v,f=D(1);function o(n){v=D(6),this.layout=n,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var n=this.layout.newGraph(),a=this.layout.newNode(null),u=this.add(n,a);return this.setRootGraph(u),this.rootGraph},o.prototype.add=function(n,a,u,r,y){if(u==null&&r==null&&y==null){if(n==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(n)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(n),n.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return n.parent=a,a.child=n,n}else{y=u,r=a,u=n;var i=r.getOwner(),e=y.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(e!=null&&e.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==e)return u.isInterGraph=!1,i.add(u,r,y);else{if(u.isInterGraph=!0,u.source=r,u.target=y,this.edges.indexOf(u)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(u),!(u.source!=null&&u.target!=null))throw"Edge source and/or target is null!";if(!(u.source.edges.indexOf(u)==-1&&u.target.edges.indexOf(u)==-1))throw"Edge already in source and/or target incidency list!";return u.source.edges.push(u),u.target.edges.push(u),u}}},o.prototype.remove=function(n){if(n instanceof v){var a=n;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var u=[];u=u.concat(a.getEdges());var r,y=u.length;for(var i=0;i<y;i++)r=u[i],a.remove(r);var e=[];e=e.concat(a.getNodes());var g;y=e.length;for(var i=0;i<y;i++)g=e[i],a.remove(g);if(a==this.rootGraph)this.setRootGraph(null);var d=this.graphs.indexOf(a);this.graphs.splice(d,1),a.parent=null}else if(n instanceof f){if(r=n,r==null)throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(!(r.source!=null&&r.target!=null))throw"Source and/or target is null!";if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw"Source and/or target doesn't know this edge!";var d=r.source.edges.indexOf(r);if(r.source.edges.splice(d,1),d=r.target.edges.indexOf(r),r.target.edges.splice(d,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw"Not in owner graph manager's edge list!";var d=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(d,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<u;r++)n=n.concat(a[r].getNodes());this.allNodes=n}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<a.length;r++)n=n.concat(a[r].getEdges());n=n.concat(this.edges),this.allEdges=n}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(n){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=n},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(n){if(n.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=n,n.parent==null)n.parent=this.layout.newNode("Root node")},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(n,a){if(!(n!=null&&a!=null))throw"assert failed";if(n==a)return!0;var u=n.getOwner(),r;do{if(r=u.getParent(),r==null)break;if(r==a)return!0;if(u=r.getOwner(),u==null)break}while(!0);u=a.getOwner();do{if(r=u.getParent(),r==null)break;if(r==n)return!0;if(u=r.getOwner(),u==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){var n,a,u,r,y,i=this.getAllEdges(),e=i.length;for(var g=0;g<e;g++){if(n=i[g],a=n.source,u=n.target,n.lca=null,n.sourceInLca=a,n.targetInLca=u,a==u){n.lca=a.getOwner();continue}r=a.getOwner();while(n.lca==null){n.targetInLca=u,y=u.getOwner();while(n.lca==null){if(y==r){n.lca=y;break}if(y==this.rootGraph)break;if(n.lca!=null)throw"assert failed";n.targetInLca=y.getParent(),y=n.targetInLca.getOwner()}if(r==this.rootGraph)break;if(n.lca==null)n.sourceInLca=r.getParent(),r=n.sourceInLca.getOwner()}if(n.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(n,a){if(n==a)return n.getOwner();var u=n.getOwner();do{if(u==null)break;var r=a.getOwner();do{if(r==null)break;if(r==u)return r;r=r.getParent().getOwner()}while(!0);u=u.getParent().getOwner()}while(!0);return u},o.prototype.calcInclusionTreeDepths=function(n,a){if(n==null&&a==null)n=this.rootGraph,a=1;var u,r=n.getNodes(),y=r.length;for(var i=0;i<y;i++)if(u=r[i],u.inclusionTreeDepth=a,u.child!=null)this.calcInclusionTreeDepths(u.child,a+1)},o.prototype.includesInvalidEdge=function(){var n,a=[],u=this.edges.length;for(var r=0;r<u;r++)if(n=this.edges[r],this.isOneAncestorOfOther(n.source,n.target))a.push(n);for(var r=0;r<a.length;r++)this.remove(a[r]);return!1},C.exports=o},function(C,F,D){var v=D(12);function f(){}f.calcSeparationAmount=function(o,n,a,u){if(!o.intersects(n))throw"assert failed";var r=[,,];if(this.decideDirectionsForOverlappingNodes(o,n,r),a[0]=Math.min(o.getRight(),n.getRight())-Math.max(o.x,n.x),a[1]=Math.min(o.getBottom(),n.getBottom())-Math.max(o.y,n.y),o.getX()<=n.getX()&&o.getRight()>=n.getRight())a[0]+=Math.min(n.getX()-o.getX(),o.getRight()-n.getRight());else if(n.getX()<=o.getX()&&n.getRight()>=o.getRight())a[0]+=Math.min(o.getX()-n.getX(),n.getRight()-o.getRight());if(o.getY()<=n.getY()&&o.getBottom()>=n.getBottom())a[1]+=Math.min(n.getY()-o.getY(),o.getBottom()-n.getBottom());else if(n.getY()<=o.getY()&&n.getBottom()>=o.getBottom())a[1]+=Math.min(o.getY()-n.getY(),n.getBottom()-o.getBottom());var y=Math.abs((n.getCenterY()-o.getCenterY())/(n.getCenterX()-o.getCenterX()));if(n.getCenterY()===o.getCenterY()&&n.getCenterX()===o.getCenterX())y=1;var i=y*a[0],e=a[1]/y;if(a[0]<e)e=a[0];else i=a[1];a[0]=-1*r[0]*(e/2+u),a[1]=-1*r[1]*(i/2+u)},f.decideDirectionsForOverlappingNodes=function(o,n,a){if(o.getCenterX()<n.getCenterX())a[0]=-1;else a[0]=1;if(o.getCenterY()<n.getCenterY())a[1]=-1;else a[1]=1},f.getIntersection2=function(o,n,a){var u=o.getCenterX(),r=o.getCenterY(),y=n.getCenterX(),i=n.getCenterY();if(o.intersects(n))return a[0]=u,a[1]=r,a[2]=y,a[3]=i,!0;var e=o.getX(),g=o.getY(),d=o.getRight(),c=o.getX(),I=o.getBottom(),N=o.getRight(),w=o.getWidthHalf(),x=o.getHeightHalf(),W=n.getX(),S=n.getY(),B=n.getRight(),tt=n.getX(),Q=n.getBottom(),ft=n.getRight(),Y=n.getWidthHalf(),et=n.getHeightHalf(),s=!1,M=!1;if(u===y){if(r>i)return a[0]=u,a[1]=g,a[2]=y,a[3]=Q,!1;else if(r<i)return a[0]=u,a[1]=I,a[2]=y,a[3]=S,!1}else if(r===i){if(u>y)return a[0]=e,a[1]=r,a[2]=B,a[3]=i,!1;else if(u<y)return a[0]=d,a[1]=r,a[2]=W,a[3]=i,!1}else{var T=o.height/o.width,A=n.height/n.width,m=(i-r)/(y-u),H=void 0,U=void 0,q=void 0,Z=void 0,V=void 0,ht=void 0;if(-T===m)if(u>y)a[0]=c,a[1]=I,s=!0;else a[0]=d,a[1]=g,s=!0;else if(T===m)if(u>y)a[0]=e,a[1]=g,s=!0;else a[0]=N,a[1]=I,s=!0;if(-A===m)if(y>u)a[2]=tt,a[3]=Q,M=!0;else a[2]=B,a[3]=S,M=!0;else if(A===m)if(y>u)a[2]=W,a[3]=S,M=!0;else a[2]=ft,a[3]=Q,M=!0;if(s&&M)return!1;if(u>y)if(r>i)H=this.getCardinalDirection(T,m,4),U=this.getCardinalDirection(A,m,2);else H=this.getCardinalDirection(-T,m,3),U=this.getCardinalDirection(-A,m,1);else if(r>i)H=this.getCardinalDirection(-T,m,1),U=this.getCardinalDirection(-A,m,3);else H=this.getCardinalDirection(T,m,2),U=this.getCardinalDirection(A,m,4);if(!s)switch(H){case 1:Z=g,q=u+-x/m,a[0]=q,a[1]=Z;break;case 2:q=N,Z=r+w*m,a[0]=q,a[1]=Z;break;case 3:Z=I,q=u+x/m,a[0]=q,a[1]=Z;break;case 4:q=c,Z=r+-w*m,a[0]=q,a[1]=Z;break}if(!M)switch(U){case 1:ht=S,V=y+-et/m,a[2]=V,a[3]=ht;break;case 2:V=ft,ht=i+Y*m,a[2]=V,a[3]=ht;break;case 3:ht=Q,V=y+et/m,a[2]=V,a[3]=ht;break;case 4:V=tt,ht=i+-Y*m,a[2]=V,a[3]=ht;break}}return!1},f.getCardinalDirection=function(o,n,a){if(o>n)return a;else return 1+a%4},f.getIntersection=function(o,n,a,u){if(u==null)return this.getIntersection2(o,n,a);var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:I}=u,N=void 0,w=void 0,x=void 0,W=void 0,S=void 0,B=void 0,tt=void 0,Q=void 0,ft=void 0;if(x=e-y,S=r-i,tt=i*y-r*e,W=I-d,B=g-c,Q=c*d-g*I,ft=x*B-W*S,ft===0)return null;return N=(S*Q-B*tt)/ft,w=(W*tt-x*Q)/ft,new v(N,w)},f.angleOfVector=function(o,n,a,u){var r=void 0;if(o!==a){if(r=Math.atan((u-n)/(a-o)),a<o)r+=Math.PI;else if(u<n)r+=this.TWO_PI}else if(u<n)r=this.ONE_AND_HALF_PI;else r=this.HALF_PI;return r},f.doIntersect=function(o,n,a,u){var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:I}=u,N=(i-r)*(I-d)-(c-g)*(e-y);if(N===0)return!1;else{var w=((I-d)*(c-r)+(g-c)*(I-y))/N,x=((y-e)*(c-r)+(i-r)*(I-y))/N;return 0<w&&w<1&&0<x&&x<1}},f.findCircleLineIntersections=function(o,n,a,u,r,y,i){var e=(a-o)*(a-o)+(u-n)*(u-n),g=2*((o-r)*(a-o)+(n-y)*(u-n)),d=(o-r)*(o-r)+(n-y)*(n-y)-i*i,c=g*g-4*e*d;if(c>=0){var I=(-g+Math.sqrt(g*g-4*e*d))/(2*e),N=(-g-Math.sqrt(g*g-4*e*d))/(2*e),w=null;if(I>=0&&I<=1)return[I];if(N>=0&&N<=1)return[N];return w}else return null},f.HALF_PI=0.5*Math.PI,f.ONE_AND_HALF_PI=1.5*Math.PI,f.TWO_PI=2*Math.PI,f.THREE_PI=3*Math.PI,C.exports=f},function(C,F,D){function v(){}v.sign=function(f){if(f>0)return 1;else if(f<0)return-1;else return 0},v.floor=function(f){return f<0?Math.ceil(f):Math.floor(f)},v.ceil=function(f){return f<0?Math.floor(f):Math.ceil(f)},C.exports=v},function(C,F,D){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,C.exports=v},function(C,F,D){var v=function(){function r(y,i){for(var e=0;e<i.length;e++){var g=i[e];if(g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g)g.writable=!0;Object.defineProperty(y,g.key,g)}}return function(y,i,e){if(i)r(y.prototype,i);if(e)r(y,e);return y}}();function f(r,y){if(!(r instanceof y))throw TypeError("Cannot call a class as a function")}var o=function(y){return{value:y,next:null,prev:null}},n=function(y,i,e,g){if(y!==null)y.next=i;else g.head=i;if(e!==null)e.prev=i;else g.tail=i;return i.prev=y,i.next=e,g.length++,i},a=function(y,i){var{prev:e,next:g}=y;if(e!==null)e.next=g;else i.head=g;if(g!==null)g.prev=e;else i.tail=e;return y.prev=y.next=null,i.length--,y},u=function(){function r(y){var i=this;if(f(this,r),this.length=0,this.head=null,this.tail=null,y!=null)y.forEach(function(e){return i.push(e)})}return v(r,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(i,e){return n(e.prev,o(i),e,this)}},{key:"insertAfter",value:function(i,e){return n(e,o(i),e.next,this)}},{key:"insertNodeBefore",value:function(i,e){return n(e.prev,i,e,this)}},{key:"insertNodeAfter",value:function(i,e){return n(e,i,e.next,this)}},{key:"push",value:function(i){return n(this.tail,o(i),null,this)}},{key:"unshift",value:function(i){return n(null,o(i),this.head,this)}},{key:"remove",value:function(i){return a(i,this)}},{key:"pop",value:function(){return a(this.tail,this).value}},{key:"popNode",value:function(){return a(this.tail,this)}},{key:"shift",value:function(){return a(this.head,this).value}},{key:"shiftNode",value:function(){return a(this.head,this)}},{key:"get_object_at",value:function(i){if(i<=this.length()){var e=1,g=this.head;while(e<i)g=g.next,e++;return g.value}}},{key:"set_object_at",value:function(i,e){if(i<=this.length()){var g=1,d=this.head;while(g<i)d=d.next,g++;d.value=e}}}]),r}();C.exports=u},function(C,F,D){function v(f,o,n){if(this.x=null,this.y=null,f==null&&o==null&&n==null)this.x=0,this.y=0;else if(typeof f=="number"&&typeof o=="number"&&n==null)this.x=f,this.y=o;else if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.x=n.x,this.y=n.y}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.getLocation=function(){return new v(this.x,this.y)},v.prototype.setLocation=function(f,o,n){if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.setLocation(n.x,n.y);else if(typeof f=="number"&&typeof o=="number"&&n==null)if(parseInt(f)==f&&parseInt(o)==o)this.move(f,o);else this.x=Math.floor(f+0.5),this.y=Math.floor(o+0.5)},v.prototype.move=function(f,o){this.x=f,this.y=o},v.prototype.translate=function(f,o){this.x+=f,this.y+=o},v.prototype.equals=function(f){if(f.constructor.name=="Point"){var o=f;return this.x==o.x&&this.y==o.y}return this==f},v.prototype.toString=function(){return new v().constructor.name+"[x="+this.x+",y="+this.y+"]"},C.exports=v},function(C,F,D){function v(f,o,n,a){if(this.x=0,this.y=0,this.width=0,this.height=0,f!=null&&o!=null&&n!=null&&a!=null)this.x=f,this.y=o,this.width=n,this.height=a}v.prototype.getX=function(){return this.x},v.prototype.setX=function(f){this.x=f},v.prototype.getY=function(){return this.y},v.prototype.setY=function(f){this.y=f},v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},v.prototype.getRight=function(){return this.x+this.width},v.prototype.getBottom=function(){return this.y+this.height},v.prototype.intersects=function(f){if(this.getRight()<f.x)return!1;if(this.getBottom()<f.y)return!1;if(f.getRight()<this.x)return!1;if(f.getBottom()<this.y)return!1;return!0},v.prototype.getCenterX=function(){return this.x+this.width/2},v.prototype.getMinX=function(){return this.getX()},v.prototype.getMaxX=function(){return this.getX()+this.width},v.prototype.getCenterY=function(){return this.y+this.height/2},v.prototype.getMinY=function(){return this.getY()},v.prototype.getMaxY=function(){return this.getY()+this.height},v.prototype.getWidthHalf=function(){return this.width/2},v.prototype.getHeightHalf=function(){return this.height/2},C.exports=v},function(C,F,D){var v=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol==="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function f(){}f.lastID=0,f.createID=function(o){if(f.isPrimitive(o))return o;if(o.uniqueID!=null)return o.uniqueID;return o.uniqueID=f.getString(),f.lastID++,o.uniqueID},f.getString=function(o){if(o==null)o=f.lastID;return"Object#"+o},f.isPrimitive=function(o){var n=typeof o>"u"?"undefined":v(o);return o==null||n!="object"&&n!="function"},C.exports=f},function(C,F,D){function v(g){if(Array.isArray(g)){for(var d=0,c=Array(g.length);d<g.length;d++)c[d]=g[d];return c}else return Array.from(g)}var f=D(0),o=D(7),n=D(3),a=D(1),u=D(6),r=D(5),y=D(17),i=D(29);function e(g){if(i.call(this),this.layoutQuality=f.QUALITY,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=f.DEFAULT_INCREMENTAL,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,g!=null)this.isRemoteUse=g}e.RANDOM_SEED=1,e.prototype=Object.create(i.prototype),e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},e.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},e.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},e.prototype.newGraphManager=function(){var g=new o(this);return this.graphManager=g,g},e.prototype.newGraph=function(g){return new u(null,this.graphManager,g)},e.prototype.newNode=function(g){return new n(this.graphManager,g)},e.prototype.newEdge=function(g){return new a(null,null,g)},e.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},e.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var g;if(this.checkLayoutSuccess())g=!1;else g=this.layout();if(f.ANIMATE==="during")return!1;if(g){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,g},e.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},e.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var g,d=this.graphManager.getAllEdges();for(var c=0;c<d.length;c++)g=d[c];var I,N=this.graphManager.getRoot().getNodes();for(var c=0;c<N.length;c++)I=N[c];this.update(this.graphManager.getRoot())}},e.prototype.update=function(g){if(g==null)this.update2();else if(g instanceof n){var d=g;if(d.getChild()!=null){var c=d.getChild().getNodes();for(var I=0;I<c.length;I++)update(c[I])}if(d.vGraphObject!=null){var N=d.vGraphObject;N.update(d)}}else if(g instanceof a){var w=g;if(w.vGraphObject!=null){var x=w.vGraphObject;x.update(w)}}else if(g instanceof u){var W=g;if(W.vGraphObject!=null){var S=W.vGraphObject;S.update(W)}}},e.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=f.QUALITY,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=f.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},e.prototype.transform=function(g){if(g==null)this.transform(new r(0,0));else{var d=new y,c=this.graphManager.getRoot().updateLeftTop();if(c!=null){d.setWorldOrgX(g.x),d.setWorldOrgY(g.y),d.setDeviceOrgX(c.x),d.setDeviceOrgY(c.y);var I=this.getAllNodes(),N;for(var w=0;w<I.length;w++)N=I[w],N.transform(d)}}},e.prototype.positionNodesRandomly=function(g){if(g==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var d,c,I=g.getNodes();for(var N=0;N<I.length;N++)if(d=I[N],c=d.getChild(),c==null)d.scatter();else if(c.getNodes().length==0)d.scatter();else this.positionNodesRandomly(c),d.updateBounds()}},e.prototype.getFlatForest=function(){var g=[],d=!0,c=this.graphManager.getRoot().getNodes(),I=!0;for(var N=0;N<c.length;N++)if(c[N].getChild()!=null)I=!1;if(!I)return g;var w=new Set,x=[],W=new Map,S=[];S=S.concat(c);while(S.length>0&&d){x.push(S[0]);while(x.length>0&&d){var B=x[0];x.splice(0,1),w.add(B);var tt=B.getEdges();for(var N=0;N<tt.length;N++){var Q=tt[N].getOtherEnd(B);if(W.get(B)!=Q)if(!w.has(Q))x.push(Q),W.set(Q,B);else{d=!1;break}}}if(!d)g=[];else{var ft=[].concat(v(w));g.push(ft);for(var N=0;N<ft.length;N++){var Y=ft[N],et=S.indexOf(Y);if(et>-1)S.splice(et,1)}w=new Set,W=new Map}}return g},e.prototype.createDummyNodesForBendpoints=function(g){var d=[],c=g.source,I=this.graphManager.calcLowestCommonAncestor(g.source,g.target);for(var N=0;N<g.bendpoints.length;N++){var w=this.newNode(null);w.setRect(new Point(0,0),new Dimension(1,1)),I.add(w);var x=this.newEdge(null);this.graphManager.add(x,c,w),d.add(w),c=w}var x=this.newEdge(null);if(this.graphManager.add(x,c,g.target),this.edgeToDummyNodes.set(g,d),g.isInterGraph())this.graphManager.remove(g);else I.remove(g);return d},e.prototype.createBendpointsFromDummyNodes=function(){var g=[];g=g.concat(this.graphManager.getAllEdges()),g=[].concat(v(this.edgeToDummyNodes.keys())).concat(g);for(var d=0;d<g.length;d++){var c=g[d];if(c.bendpoints.length>0){var I=this.edgeToDummyNodes.get(c);for(var N=0;N<I.length;N++){var w=I[N],x=new r(w.getCenterX(),w.getCenterY()),W=c.bendpoints.get(N);W.x=x.x,W.y=x.y,w.getOwner().remove(w)}this.graphManager.add(c,c.source,c.target)}}},e.transform=function(g,d,c,I){if(c!=null&&I!=null){var N=d;if(g<=50){var w=d/c;N-=(d-w)/50*(50-g)}else{var x=d*I;N+=(x-d)/50*(g-50)}return N}else{var W,S;if(g<=50)W=9*d/500,S=d/10;else W=9*d/50,S=-8*d;return W*g+S}},e.findCenterOfTree=function(g){var d=[];d=d.concat(g);var c=[],I=new Map,N=!1,w=null;if(d.length==1||d.length==2)N=!0,w=d[0];for(var x=0;x<d.length;x++){var W=d[x],S=W.getNeighborsList().size;if(I.set(W,W.getNeighborsList().size),S==1)c.push(W)}var B=[];B=B.concat(c);while(!N){var tt=[];tt=tt.concat(B),B=[];for(var x=0;x<d.length;x++){var W=d[x],Q=d.indexOf(W);if(Q>=0)d.splice(Q,1);var ft=W.getNeighborsList();ft.forEach(function(s){if(c.indexOf(s)<0){var M=I.get(s),T=M-1;if(T==1)B.push(s);I.set(s,T)}})}if(c=c.concat(B),d.length==1||d.length==2)N=!0,w=d[0]}return w},e.prototype.setGraphManager=function(g){this.graphManager=g},C.exports=e},function(C,F,D){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},C.exports=v},function(C,F,D){var v=D(5);function f(o,n){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}f.prototype.getWorldOrgX=function(){return this.lworldOrgX},f.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},f.prototype.getWorldOrgY=function(){return this.lworldOrgY},f.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},f.prototype.getWorldExtX=function(){return this.lworldExtX},f.prototype.setWorldExtX=function(o){this.lworldExtX=o},f.prototype.getWorldExtY=function(){return this.lworldExtY},f.prototype.setWorldExtY=function(o){this.lworldExtY=o},f.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},f.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},f.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},f.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},f.prototype.getDeviceExtX=function(){return this.ldeviceExtX},f.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},f.prototype.getDeviceExtY=function(){return this.ldeviceExtY},f.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},f.prototype.transformX=function(o){var n=0,a=this.lworldExtX;if(a!=0)n=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/a;return n},f.prototype.transformY=function(o){var n=0,a=this.lworldExtY;if(a!=0)n=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/a;return n},f.prototype.inverseTransformX=function(o){var n=0,a=this.ldeviceExtX;if(a!=0)n=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/a;return n},f.prototype.inverseTransformY=function(o){var n=0,a=this.ldeviceExtY;if(a!=0)n=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/a;return n},f.prototype.inverseTransformPoint=function(o){var n=new v(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return n},C.exports=f},function(C,F,D){function v(i){if(Array.isArray(i)){for(var e=0,g=Array(i.length);e<i.length;e++)g[e]=i[e];return g}else return Array.from(i)}var f=D(15),o=D(4),n=D(0),a=D(8),u=D(9);function r(){f.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}r.prototype=Object.create(f.prototype);for(var y in f)r[y]=f[y];r.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},r.prototype.calcIdealEdgeLengths=function(){var i,e,g,d,c,I,N,w=this.getGraphManager().getAllEdges();for(var x=0;x<w.length;x++)if(i=w[x],e=i.idealLength,i.isInterGraph){if(d=i.getSource(),c=i.getTarget(),I=i.getSourceInLca().getEstimatedSize(),N=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)i.idealLength+=I+N-2*n.SIMPLE_NODE_SIZE;g=i.getLca().getInclusionTreeDepth(),i.idealLength+=e*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+c.getInclusionTreeDepth()-2*g)}},r.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;if(this.incremental){if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){var i=this.getAllEdges(),e;for(var g=0;g<i.length;g++)e=i[g],this.calcSpringForce(e,e.idealLength)},r.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g,d,c,I,N=this.getAllNodes(),w;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&i)this.updateGrid();w=new Set;for(g=0;g<N.length;g++)c=N[g],this.calculateRepulsionForceOfANode(c,w,i,e),w.add(c)}else for(g=0;g<N.length;g++){c=N[g];for(d=g+1;d<N.length;d++){if(I=N[d],c.getOwner()!=I.getOwner())continue;this.calcRepulsionForce(c,I)}}},r.prototype.calcGravitationalForces=function(){var i,e=this.getAllNodesToApplyGravitation();for(var g=0;g<e.length;g++)i=e[g],this.calcGravitationalForce(i)},r.prototype.moveNodes=function(){var i=this.getAllNodes(),e;for(var g=0;g<i.length;g++)e=i[g],e.move()},r.prototype.calcSpringForce=function(i,e){var g=i.getSource(),d=i.getTarget(),c,I,N,w;if(this.uniformLeafNodeSizes&&g.getChild()==null&&d.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;if(c=i.getLength(),c==0)return;I=i.edgeElasticity*(c-e),N=I*(i.lengthX/c),w=I*(i.lengthY/c),g.springForceX+=N,g.springForceY+=w,d.springForceX-=N,d.springForceY-=w},r.prototype.calcRepulsionForce=function(i,e){var g=i.getRect(),d=e.getRect(),c=[,,],I=[,,,,],N,w,x,W,S,B,tt;if(g.intersects(d)){a.calcSeparationAmount(g,d,c,o.DEFAULT_EDGE_LENGTH/2),B=2*c[0],tt=2*c[1];var Q=i.noOfChildren*e.noOfChildren/(i.noOfChildren+e.noOfChildren);i.repulsionForceX-=Q*B,i.repulsionForceY-=Q*tt,e.repulsionForceX+=Q*B,e.repulsionForceY+=Q*tt}else{if(this.uniformLeafNodeSizes&&i.getChild()==null&&e.getChild()==null)N=d.getCenterX()-g.getCenterX(),w=d.getCenterY()-g.getCenterY();else a.getIntersection(g,d,I),N=I[2]-I[0],w=I[3]-I[1];if(Math.abs(N)<o.MIN_REPULSION_DIST)N=u.sign(N)*o.MIN_REPULSION_DIST;if(Math.abs(w)<o.MIN_REPULSION_DIST)w=u.sign(w)*o.MIN_REPULSION_DIST;x=N*N+w*w,W=Math.sqrt(x),S=(i.nodeRepulsion/2+e.nodeRepulsion/2)*i.noOfChildren*e.noOfChildren/x,B=S*N/W,tt=S*w/W,i.repulsionForceX-=B,i.repulsionForceY-=tt,e.repulsionForceX+=B,e.repulsionForceY+=tt}},r.prototype.calcGravitationalForce=function(i){var e,g,d,c,I,N,w,x;if(e=i.getOwner(),g=(e.getRight()+e.getLeft())/2,d=(e.getTop()+e.getBottom())/2,c=i.getCenterX()-g,I=i.getCenterY()-d,N=Math.abs(c)+i.getWidth()/2,w=Math.abs(I)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()){if(x=e.getEstimatedSize()*this.gravityRangeFactor,N>x||w>x)i.gravitationForceX=-this.gravityConstant*c,i.gravitationForceY=-this.gravityConstant*I}else if(x=e.getEstimatedSize()*this.compoundGravityRangeFactor,N>x||w>x)i.gravitationForceX=-this.gravityConstant*c*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*I*this.compoundGravityConstant},r.prototype.isConverged=function(){var i,e=!1;if(this.totalIterations>this.maxIterations/3)e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||e},r.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},r.prototype.calcNoOfChildrenForAllNodes=function(){var i,e=this.graphManager.getAllNodes();for(var g=0;g<e.length;g++)i=e[g],i.noOfChildren=i.getNoOfChildren()},r.prototype.calcGrid=function(i){var e=0,g=0;e=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),g=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));var d=Array(e);for(var c=0;c<e;c++)d[c]=Array(g);for(var c=0;c<e;c++)for(var I=0;I<g;I++)d[c][I]=[];return d},r.prototype.addNodeToGrid=function(i,e,g){var d=0,c=0,I=0,N=0;d=parseInt(Math.floor((i.getRect().x-e)/this.repulsionRange)),c=parseInt(Math.floor((i.getRect().width+i.getRect().x-e)/this.repulsionRange)),I=parseInt(Math.floor((i.getRect().y-g)/this.repulsionRange)),N=parseInt(Math.floor((i.getRect().height+i.getRect().y-g)/this.repulsionRange));for(var w=d;w<=c;w++)for(var x=I;x<=N;x++)this.grid[w][x].push(i),i.setGridCoordinates(d,c,I,N)},r.prototype.updateGrid=function(){var i,e,g=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(i=0;i<g.length;i++)e=g[i],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(i,e,g,d){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&g||d){var c=new Set;i.surrounding=[];var I,N=this.grid;for(var w=i.startX-1;w<i.finishX+2;w++)for(var x=i.startY-1;x<i.finishY+2;x++)if(!(w<0||x<0||w>=N.length||x>=N[0].length))for(var W=0;W<N[w][x].length;W++){if(I=N[w][x][W],i.getOwner()!=I.getOwner()||i==I)continue;if(!e.has(I)&&!c.has(I)){var S=Math.abs(i.getCenterX()-I.getCenterX())-(i.getWidth()/2+I.getWidth()/2),B=Math.abs(i.getCenterY()-I.getCenterY())-(i.getHeight()/2+I.getHeight()/2);if(S<=this.repulsionRange&&B<=this.repulsionRange)c.add(I)}}i.surrounding=[].concat(v(c))}for(w=0;w<i.surrounding.length;w++)this.calcRepulsionForce(i,i.surrounding[w])},r.prototype.calcRepulsionRange=function(){return 0},C.exports=r},function(C,F,D){var v=D(1),f=D(4);function o(a,u,r){v.call(this,a,u,r),this.idealLength=f.DEFAULT_EDGE_LENGTH,this.edgeElasticity=f.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];C.exports=o},function(C,F,D){var v=D(3),f=D(4);function o(a,u,r,y){v.call(this,a,u,r,y),this.nodeRepulsion=f.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=[]}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];o.prototype.setGridCoordinates=function(a,u,r,y){this.startX=a,this.finishX=u,this.startY=r,this.finishY=y},C.exports=o},function(C,F,D){function v(f,o){if(this.width=0,this.height=0,f!==null&&o!==null)this.height=o,this.width=f}v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},C.exports=v},function(C,F,D){var v=D(14);function f(){this.map={},this.keys=[]}f.prototype.put=function(o,n){var a=v.createID(o);if(!this.contains(a))this.map[a]=n,this.keys.push(o)},f.prototype.contains=function(o){var n=v.createID(o);return this.map[o]!=null},f.prototype.get=function(o){var n=v.createID(o);return this.map[n]},f.prototype.keySet=function(){return this.keys},C.exports=f},function(C,F,D){var v=D(14);function f(){this.set={}}f.prototype.add=function(o){var n=v.createID(o);if(!this.contains(n))this.set[n]=o},f.prototype.remove=function(o){delete this.set[v.createID(o)]},f.prototype.clear=function(){this.set={}},f.prototype.contains=function(o){return this.set[v.createID(o)]==o},f.prototype.isEmpty=function(){return this.size()===0},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAllTo=function(o){var n=Object.keys(this.set),a=n.length;for(var u=0;u<a;u++)o.push(this.set[n[u]])},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAll=function(o){var n=o.length;for(var a=0;a<n;a++){var u=o[a];this.add(u)}},C.exports=f},function(C,F,D){function v(){}v.multMat=function(f,o){var n=[];for(var a=0;a<f.length;a++){n[a]=[];for(var u=0;u<o[0].length;u++){n[a][u]=0;for(var r=0;r<f[0].length;r++)n[a][u]+=f[a][r]*o[r][u]}}return n},v.transpose=function(f){var o=[];for(var n=0;n<f[0].length;n++){o[n]=[];for(var a=0;a<f.length;a++)o[n][a]=f[a][n]}return o},v.multCons=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]*o;return n},v.minusOp=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]-o[a];return n},v.dotProduct=function(f,o){var n=0;for(var a=0;a<f.length;a++)n+=f[a]*o[a];return n},v.mag=function(f){return Math.sqrt(this.dotProduct(f,f))},v.normalize=function(f){var o=[],n=this.mag(f);for(var a=0;a<f.length;a++)o[a]=f[a]/n;return o},v.multGamma=function(f){var o=[],n=0;for(var a=0;a<f.length;a++)n+=f[a];n*=-1/f.length;for(var u=0;u<f.length;u++)o[u]=n+f[u];return o},v.multL=function(f,o,n){var a=[],u=[],r=[];for(var y=0;y<o[0].length;y++){var i=0;for(var e=0;e<o.length;e++)i+=-0.5*o[e][y]*f[e];u[y]=i}for(var g=0;g<n.length;g++){var d=0;for(var c=0;c<n.length;c++)d+=n[g][c]*u[c];r[g]=d}for(var I=0;I<o.length;I++){var N=0;for(var w=0;w<o[0].length;w++)N+=o[I][w]*r[w];a[I]=N}return a},C.exports=v},function(C,F,D){var v=function(){function a(u,r){for(var y=0;y<r.length;y++){var i=r[y];if(i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i)i.writable=!0;Object.defineProperty(u,i.key,i)}}return function(u,r,y){if(r)a(u.prototype,r);if(y)a(u,y);return u}}();function f(a,u){if(!(a instanceof u))throw TypeError("Cannot call a class as a function")}var o=D(11),n=function(){function a(u,r){if(f(this,a),r!==null||r!==void 0)this.compareFunction=this._defaultCompareFunction;var y=void 0;if(u instanceof o)y=u.size();else y=u.length;this._quicksort(u,0,y-1)}return v(a,[{key:"_quicksort",value:function(r,y,i){if(y<i){var e=this._partition(r,y,i);this._quicksort(r,y,e),this._quicksort(r,e+1,i)}}},{key:"_partition",value:function(r,y,i){var e=this._get(r,y),g=y,d=i;while(!0){while(this.compareFunction(e,this._get(r,d)))d--;while(this.compareFunction(this._get(r,g),e))g++;if(g<d)this._swap(r,g,d),g++,d--;else return d}}},{key:"_get",value:function(r,y){if(r instanceof o)return r.get_object_at(y);else return r[y]}},{key:"_set",value:function(r,y,i){if(r instanceof o)r.set_object_at(y,i);else r[y]=i}},{key:"_swap",value:function(r,y,i){var e=this._get(r,y);this._set(r,y,this._get(r,i)),this._set(r,i,e)}},{key:"_defaultCompareFunction",value:function(r,y){return y>r}}]),a}();C.exports=n},function(C,F,D){function v(){}v.svd=function(f){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=f.length,this.n=f[0].length;var o=Math.min(this.m,this.n);this.s=function(Vt){var Pt=[];while(Vt-- >0)Pt.push(0);return Pt}(Math.min(this.m+1,this.n)),this.U=function(Vt){var Pt=function se(Bt){if(Bt.length==0)return 0;else{var te=[];for(var ae=0;ae<Bt[0];ae++)te.push(se(Bt.slice(1)));return te}};return Pt(Vt)}([this.m,o]),this.V=function(Vt){var Pt=function se(Bt){if(Bt.length==0)return 0;else{var te=[];for(var ae=0;ae<Bt[0];ae++)te.push(se(Bt.slice(1)));return te}};return Pt(Vt)}([this.n,this.n]);var n=function(Vt){var Pt=[];while(Vt-- >0)Pt.push(0);return Pt}(this.n),a=function(Vt){var Pt=[];while(Vt-- >0)Pt.push(0);return Pt}(this.m),u=!0,r=!0,y=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m));for(var e=0;e<Math.max(y,i);e++){if(e<y){this.s[e]=0;for(var g=e;g<this.m;g++)this.s[e]=v.hypot(this.s[e],f[g][e]);if(this.s[e]!==0){if(f[e][e]<0)this.s[e]=-this.s[e];for(var d=e;d<this.m;d++)f[d][e]/=this.s[e];f[e][e]+=1}this.s[e]=-this.s[e]}for(var c=e+1;c<this.n;c++){if(function(Vt,Pt){return Vt&&Pt}(e<y,this.s[e]!==0)){var I=0;for(var N=e;N<this.m;N++)I+=f[N][e]*f[N][c];I=-I/f[e][e];for(var w=e;w<this.m;w++)f[w][c]+=I*f[w][e]}n[c]=f[e][c]}if(function(Vt,Pt){return Vt&&Pt}(u,e<y))for(var x=e;x<this.m;x++)this.U[x][e]=f[x][e];if(e<i){n[e]=0;for(var W=e+1;W<this.n;W++)n[e]=v.hypot(n[e],n[W]);if(n[e]!==0){if(n[e+1]<0)n[e]=-n[e];for(var S=e+1;S<this.n;S++)n[S]/=n[e];n[e+1]+=1}if(n[e]=-n[e],function(Vt,Pt){return Vt&&Pt}(e+1<this.m,n[e]!==0)){for(var B=e+1;B<this.m;B++)a[B]=0;for(var tt=e+1;tt<this.n;tt++)for(var Q=e+1;Q<this.m;Q++)a[Q]+=n[tt]*f[Q][tt];for(var ft=e+1;ft<this.n;ft++){var Y=-n[ft]/n[e+1];for(var et=e+1;et<this.m;et++)f[et][ft]+=Y*a[et]}}if(r)for(var s=e+1;s<this.n;s++)this.V[s][e]=n[s]}}var M=Math.min(this.n,this.m+1);if(y<this.n)this.s[y]=f[y][y];if(this.m<M)this.s[M-1]=0;if(i+1<M)n[i]=f[i][M-1];if(n[M-1]=0,u){for(var T=y;T<o;T++){for(var A=0;A<this.m;A++)this.U[A][T]=0;this.U[T][T]=1}for(var m=y-1;m>=0;m--)if(this.s[m]!==0){for(var H=m+1;H<o;H++){var U=0;for(var q=m;q<this.m;q++)U+=this.U[q][m]*this.U[q][H];U=-U/this.U[m][m];for(var Z=m;Z<this.m;Z++)this.U[Z][H]+=U*this.U[Z][m]}for(var V=m;V<this.m;V++)this.U[V][m]=-this.U[V][m];this.U[m][m]=1+this.U[m][m];for(var ht=0;ht<m-1;ht++)this.U[ht][m]=0}else{for(var vt=0;vt<this.m;vt++)this.U[vt][m]=0;this.U[m][m]=1}}if(r)for(var k=this.n-1;k>=0;k--){if(function(Vt,Pt){return Vt&&Pt}(k<i,n[k]!==0))for(var dt=k+1;dt<o;dt++){var at=0;for(var b=k+1;b<this.n;b++)at+=this.V[b][k]*this.V[b][dt];at=-at/this.V[k+1][k];for(var _=k+1;_<this.n;_++)this.V[_][dt]+=at*this.V[_][k]}for(var rt=0;rt<this.n;rt++)this.V[rt][k]=0;this.V[k][k]=1}var gt=M-1,Lt=0,Gt=Math.pow(2,-52),kt=Math.pow(2,-966);while(M>0){var ct=void 0,jt=void 0;for(ct=M-2;ct>=-1;ct--){if(ct===-1)break;if(Math.abs(n[ct])<=kt+Gt*(Math.abs(this.s[ct])+Math.abs(this.s[ct+1]))){n[ct]=0;break}}if(ct===M-2)jt=4;else{var Ht=void 0;for(Ht=M-1;Ht>=ct;Ht--){if(Ht===ct)break;var Tt=(Ht!==M?Math.abs(n[Ht]):0)+(Ht!==ct+1?Math.abs(n[Ht-1]):0);if(Math.abs(this.s[Ht])<=kt+Gt*Tt){this.s[Ht]=0;break}}if(Ht===ct)jt=3;else if(Ht===M-1)jt=1;else jt=2,ct=Ht}switch(ct++,jt){case 1:{var pt=n[M-2];n[M-2]=0;for(var It=M-2;It>=ct;It--){var St=v.hypot(this.s[It],pt),Ut=this.s[It]/St,Ft=pt/St;if(this.s[It]=St,It!==ct)pt=-Ft*n[It-1],n[It-1]=Ut*n[It-1];if(r)for(var bt=0;bt<this.n;bt++)St=Ut*this.V[bt][It]+Ft*this.V[bt][M-1],this.V[bt][M-1]=-Ft*this.V[bt][It]+Ut*this.V[bt][M-1],this.V[bt][It]=St}}break;case 2:{var Wt=n[ct-1];n[ct-1]=0;for(var $t=ct;$t<M;$t++){var re=v.hypot(this.s[$t],Wt),Jt=this.s[$t]/re,_t=Wt/re;if(this.s[$t]=re,Wt=-_t*n[$t],n[$t]=Jt*n[$t],u)for(var Qt=0;Qt<this.m;Qt++)re=Jt*this.U[Qt][$t]+_t*this.U[Qt][ct-1],this.U[Qt][ct-1]=-_t*this.U[Qt][$t]+Jt*this.U[Qt][ct-1],this.U[Qt][$t]=re}}break;case 3:{var J=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[M-1]),Math.abs(this.s[M-2])),Math.abs(n[M-2])),Math.abs(this.s[ct])),Math.abs(n[ct])),it=this.s[M-1]/J,nt=this.s[M-2]/J,ot=n[M-2]/J,st=this.s[ct]/J,ut=n[ct]/J,Dt=((nt+it)*(nt-it)+ot*ot)/2,Ct=it*ot*(it*ot),lt=0;if(function(Vt,Pt){return Vt||Pt}(Dt!==0,Ct!==0)){if(lt=Math.sqrt(Dt*Dt+Ct),Dt<0)lt=-lt;lt=Ct/(Dt+lt)}var wt=(st+it)*(st-it)+lt,At=st*ut;for(var yt=ct;yt<M-1;yt++){var xt=v.hypot(wt,At),Yt=wt/xt,Nt=At/xt;if(yt!==ct)n[yt-1]=xt;if(wt=Yt*this.s[yt]+Nt*n[yt],n[yt]=Yt*n[yt]-Nt*this.s[yt],At=Nt*this.s[yt+1],this.s[yt+1]=Yt*this.s[yt+1],r)for(var mt=0;mt<this.n;mt++)xt=Yt*this.V[mt][yt]+Nt*this.V[mt][yt+1],this.V[mt][yt+1]=-Nt*this.V[mt][yt]+Yt*this.V[mt][yt+1],this.V[mt][yt]=xt;if(xt=v.hypot(wt,At),Yt=wt/xt,Nt=At/xt,this.s[yt]=xt,wt=Yt*n[yt]+Nt*this.s[yt+1],this.s[yt+1]=-Nt*n[yt]+Yt*this.s[yt+1],At=Nt*n[yt+1],n[yt+1]=Yt*n[yt+1],u&&yt<this.m-1)for(var Ot=0;Ot<this.m;Ot++)xt=Yt*this.U[Ot][yt]+Nt*this.U[Ot][yt+1],this.U[Ot][yt+1]=-Nt*this.U[Ot][yt]+Yt*this.U[Ot][yt+1],this.U[Ot][yt]=xt}n[M-2]=wt,Lt=Lt+1}break;case 4:{if(this.s[ct]<=0){if(this.s[ct]=this.s[ct]<0?-this.s[ct]:0,r)for(var Et=0;Et<=gt;Et++)this.V[Et][ct]=-this.V[Et][ct]}while(ct<gt){if(this.s[ct]>=this.s[ct+1])break;var Mt=this.s[ct];if(this.s[ct]=this.s[ct+1],this.s[ct+1]=Mt,r&&ct<this.n-1)for(var qt=0;qt<this.n;qt++)Mt=this.V[qt][ct+1],this.V[qt][ct+1]=this.V[qt][ct],this.V[qt][ct]=Mt;if(u&&ct<this.m-1)for(var zt=0;zt<this.m;zt++)Mt=this.U[zt][ct+1],this.U[zt][ct+1]=this.U[zt][ct],this.U[zt][ct]=Mt;ct++}Lt=0,M--}break}}var ne={U:this.U,V:this.V,S:this.s};return ne},v.hypot=function(f,o){var n=void 0;if(Math.abs(f)>Math.abs(o))n=o/f,n=Math.abs(f)*Math.sqrt(1+n*n);else if(o!=0)n=f/o,n=Math.abs(o)*Math.sqrt(1+n*n);else n=0;return n},C.exports=v},function(C,F,D){var v=function(){function n(a,u){for(var r=0;r<u.length;r++){var y=u[r];if(y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y)y.writable=!0;Object.defineProperty(a,y.key,y)}}return function(a,u,r){if(u)n(a.prototype,u);if(r)n(a,r);return a}}();function f(n,a){if(!(n instanceof a))throw TypeError("Cannot call a class as a function")}var o=function(){function n(a,u){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;f(this,n),this.sequence1=a,this.sequence2=u,this.match_score=r,this.mismatch_penalty=y,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=u.length+1,this.grid=Array(this.iMax);for(var e=0;e<this.iMax;e++){this.grid[e]=Array(this.jMax);for(var g=0;g<this.jMax;g++)this.grid[e][g]=0}this.tracebackGrid=Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.tracebackGrid[d][c]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return v(n,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var u=1;u<this.jMax;u++)this.grid[0][u]=this.grid[0][u-1]+this.gap_penalty,this.tracebackGrid[0][u]=[!1,!1,!0];for(var r=1;r<this.iMax;r++)this.grid[r][0]=this.grid[r-1][0]+this.gap_penalty,this.tracebackGrid[r][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var i=1;i<this.jMax;i++){var e=void 0;if(this.sequence1[y-1]===this.sequence2[i-1])e=this.grid[y-1][i-1]+this.match_score;else e=this.grid[y-1][i-1]+this.mismatch_penalty;var g=this.grid[y-1][i]+this.gap_penalty,d=this.grid[y][i-1]+this.gap_penalty,c=[e,g,d],I=this.arrayAllMaxIndexes(c);this.grid[y][i]=c[I[0]],this.tracebackGrid[y][i]=[I.includes(0),I.includes(1),I.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var u=[];u.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(u[0]){var r=u[0],y=this.tracebackGrid[r.pos[0]][r.pos[1]];if(y[0])u.push({pos:[r.pos[0]-1,r.pos[1]-1],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(y[1])u.push({pos:[r.pos[0]-1,r.pos[1]],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:"-"+r.seq2});if(y[2])u.push({pos:[r.pos[0],r.pos[1]-1],seq1:"-"+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(r.pos[0]===0&&r.pos[1]===0)this.alignments.push({sequence1:r.seq1,sequence2:r.seq2});u.shift()}return this.alignments}},{key:"getAllIndexes",value:function(u,r){var y=[],i=-1;while((i=u.indexOf(r,i+1))!==-1)y.push(i);return y}},{key:"arrayAllMaxIndexes",value:function(u){return this.getAllIndexes(u,Math.max.apply(null,u))}}]),n}();C.exports=o},function(C,F,D){var v=function(){return};v.FDLayout=D(18),v.FDLayoutConstants=D(4),v.FDLayoutEdge=D(19),v.FDLayoutNode=D(20),v.DimensionD=D(21),v.HashMap=D(22),v.HashSet=D(23),v.IGeometry=D(8),v.IMath=D(9),v.Integer=D(10),v.Point=D(12),v.PointD=D(5),v.RandomSeed=D(16),v.RectangleD=D(13),v.Transform=D(17),v.UniqueIDGeneretor=D(14),v.Quicksort=D(25),v.LinkedList=D(11),v.LGraphObject=D(2),v.LGraph=D(6),v.LEdge=D(1),v.LGraphManager=D(7),v.LNode=D(3),v.Layout=D(15),v.LayoutConstants=D(0),v.NeedlemanWunsch=D(27),v.Matrix=D(24),v.SVD=D(26),C.exports=v},function(C,F,D){function v(){this.listeners=[]}var f=v.prototype;f.addListener=function(o,n){this.listeners.push({event:o,callback:n})},f.removeListener=function(o,n){for(var a=this.listeners.length;a>=0;a--){var u=this.listeners[a];if(u.event===o&&u.callback===n)this.listeners.splice(a,1)}},f.emit=function(o,n){for(var a=0;a<this.listeners.length;a++){var u=this.listeners[a];if(o===u.event)u.callback(n)}},C.exports=v}])})});var Pe=yn(function(Ne,Fe){(function(F,D){if(typeof Ne==="object"&&typeof Fe==="object")Fe.exports=D(Se());else if(typeof define==="function"&&define.amd)define(["layout-base"],D);else if(typeof Ne==="object")Ne.coseBase=D(Se());else F.coseBase=D(F.layoutBase)})(Ne,function(C){return(()=>{var F={45:(o,n,a)=>{var u={};u.layoutBase=a(551),u.CoSEConstants=a(806),u.CoSEEdge=a(767),u.CoSEGraph=a(880),u.CoSEGraphManager=a(578),u.CoSELayout=a(765),u.CoSENode=a(991),u.ConstraintHandler=a(902),o.exports=u},806:(o,n,a)=>{var u=a(551).FDLayoutConstants;function r(){}for(var y in u)r[y]=u[y];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,o.exports=r},767:(o,n,a)=>{var u=a(551).FDLayoutEdge;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},880:(o,n,a)=>{var u=a(551).LGraph;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},578:(o,n,a)=>{var u=a(551).LGraphManager;function r(i){u.call(this,i)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},765:(o,n,a)=>{var u=a(551).FDLayout,r=a(578),y=a(880),i=a(991),e=a(767),g=a(806),d=a(902),c=a(551).FDLayoutConstants,I=a(551).LayoutConstants,N=a(551).Point,w=a(551).PointD,x=a(551).DimensionD,W=a(551).Layout,S=a(551).Integer,B=a(551).IGeometry,tt=a(551).LGraph,Q=a(551).Transform,ft=a(551).LinkedList;function Y(){u.call(this),this.toBeTiled={},this.constraints={}}Y.prototype=Object.create(u.prototype);for(var et in u)Y[et]=u[et];Y.prototype.newGraphManager=function(){var s=new r(this);return this.graphManager=s,s},Y.prototype.newGraph=function(s){return new y(null,this.graphManager,s)},Y.prototype.newNode=function(s){return new i(this.graphManager,s)},Y.prototype.newEdge=function(s){return new e(null,null,s)},Y.prototype.initParameters=function(){if(u.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(g.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=g.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=g.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},Y.prototype.initSpringEmbedder=function(){u.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},Y.prototype.layout=function(){var s=I.DEFAULT_CREATE_BENDS_AS_NEEDED;if(s)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},Y.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 s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var M=new Set(this.getAllNodes()),T=this.nodesWithGravity.filter(function(A){return M.has(A)});this.graphManager.setAllNodesToApplyGravitation(T),this.positionNodesRandomly()}}else if(g.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var M=new Set(this.getAllNodes()),T=this.nodesWithGravity.filter(function(H){return M.has(H)});this.graphManager.setAllNodesToApplyGravitation(T)}if(Object.keys(this.constraints).length>0)d.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),g.APPLY_LAYOUT)this.runSpringEmbedder();return!0},Y.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%c.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 s=new Set(this.getAllNodes()),M=this.nodesWithGravity.filter(function(m){return s.has(m)});if(this.graphManager.setAllNodesToApplyGravitation(M),this.graphManager.updateBounds(),this.updateGrid(),g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=c.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(g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var T=!this.isTreeGrowing&&!this.isGrowthFinished,A=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(T,A),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},Y.prototype.getPositionsData=function(){var s=this.graphManager.getAllNodes(),M={};for(var T=0;T<s.length;T++){var A=s[T].rect,m=s[T].id;M[m]={id:m,x:A.getCenterX(),y:A.getCenterY(),w:A.width,h:A.height}}return M},Y.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(c.ANIMATE==="during")this.emit("layoutstarted");else{while(!s)s=this.tick();this.graphManager.updateBounds()}},Y.prototype.moveNodes=function(){var s=this.getAllNodes(),M;for(var T=0;T<s.length;T++)M=s[T],M.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var T=0;T<s.length;T++)M=s[T],M.move()},Y.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var M=this.graphManager.getAllNodes();for(var T=0;T<M.length;T++){var A=M[T];this.idToNodeMap.set(A.id,A)}var m=function b(_){var rt=_.getChild().getNodes(),gt,Lt=0;for(var Gt=0;Gt<rt.length;Gt++)if(gt=rt[Gt],gt.getChild()==null){if(s.fixedNodeSet.has(gt.id))Lt+=100}else Lt+=b(gt);return Lt};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(rt){s.fixedNodeSet.add(rt.nodeId)});var M=this.graphManager.getAllNodes(),A;for(var T=0;T<M.length;T++)if(A=M[T],A.getChild()!=null){var H=m(A);if(H>0)A.fixedNodeWeight=H}}if(this.constraints.relativePlacementConstraint){var U=new Map,q=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(b){s.fixedNodesOnHorizontal.add(b),s.fixedNodesOnVertical.add(b)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var Z=this.constraints.alignmentConstraint.vertical;for(var T=0;T<Z.length;T++)this.dummyToNodeForVerticalAlignment.set("dummy"+T,[]),Z[T].forEach(function(_){if(U.set(_,"dummy"+T),s.dummyToNodeForVerticalAlignment.get("dummy"+T).push(_),s.fixedNodeSet.has(_))s.fixedNodesOnHorizontal.add("dummy"+T)})}if(this.constraints.alignmentConstraint.horizontal){var V=this.constraints.alignmentConstraint.horizontal;for(var T=0;T<V.length;T++)this.dummyToNodeForHorizontalAlignment.set("dummy"+T,[]),V[T].forEach(function(_){if(q.set(_,"dummy"+T),s.dummyToNodeForHorizontalAlignment.get("dummy"+T).push(_),s.fixedNodeSet.has(_))s.fixedNodesOnVertical.add("dummy"+T)})}}if(g.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(b){var _,rt,gt;for(gt=b.length-1;gt>=2*b.length/3;gt--)_=Math.floor(Math.random()*(gt+1)),rt=b[gt],b[gt]=b[_],b[_]=rt;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 _=U.has(b.left)?U.get(b.left):b.left,rt=U.has(b.right)?U.get(b.right):b.right;if(!s.nodesInRelativeHorizontal.includes(_))if(s.nodesInRelativeHorizontal.push(_),s.nodeToRelativeConstraintMapHorizontal.set(_,[]),s.dummyToNodeForVerticalAlignment.has(_))s.nodeToTempPositionMapHorizontal.set(_,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(_)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(_,s.idToNodeMap.get(_).getCenterX());if(!s.nodesInRelativeHorizontal.includes(rt))if(s.nodesInRelativeHorizontal.push(rt),s.nodeToRelativeConstraintMapHorizontal.set(rt,[]),s.dummyToNodeForVerticalAlignment.has(rt))s.nodeToTempPositionMapHorizontal.set(rt,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(rt)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(rt,s.idToNodeMap.get(rt).getCenterX());s.nodeToRelativeConstraintMapHorizontal.get(_).push({right:rt,gap:b.gap}),s.nodeToRelativeConstraintMapHorizontal.get(rt).push({left:_,gap:b.gap})}else{var gt=q.has(b.top)?q.get(b.top):b.top,Lt=q.has(b.bottom)?q.get(b.bottom):b.bottom;if(!s.nodesInRelativeVertical.includes(gt))if(s.nodesInRelativeVertical.push(gt),s.nodeToRelativeConstraintMapVertical.set(gt,[]),s.dummyToNodeForHorizontalAlignment.has(gt))s.nodeToTempPositionMapVertical.set(gt,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(gt)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(gt,s.idToNodeMap.get(gt).getCenterY());if(!s.nodesInRelativeVertical.includes(Lt))if(s.nodesInRelativeVertical.push(Lt),s.nodeToRelativeConstraintMapVertical.set(Lt,[]),s.dummyToNodeForHorizontalAlignment.has(Lt))s.nodeToTempPositionMapVertical.set(Lt,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(Lt)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(Lt,s.idToNodeMap.get(Lt).getCenterY());s.nodeToRelativeConstraintMapVertical.get(gt).push({bottom:Lt,gap:b.gap}),s.nodeToRelativeConstraintMapVertical.get(Lt).push({top:gt,gap:b.gap})}});else{var ht=new Map,vt=new Map;this.constraints.relativePlacementConstraint.forEach(function(b){if(b.left){var _=U.has(b.left)?U.get(b.left):b.left,rt=U.has(b.right)?U.get(b.right):b.right;if(ht.has(_))ht.get(_).push(rt);else ht.set(_,[rt]);if(ht.has(rt))ht.get(rt).push(_);else ht.set(rt,[_])}else{var gt=q.has(b.top)?q.get(b.top):b.top,Lt=q.has(b.bottom)?q.get(b.bottom):b.bottom;if(vt.has(gt))vt.get(gt).push(Lt);else vt.set(gt,[Lt]);if(vt.has(Lt))vt.get(Lt).push(gt);else vt.set(Lt,[gt])}});var k=function(_,rt){var gt=[],Lt=[],Gt=new ft,kt=new Set,ct=0;return _.forEach(function(jt,Ht){if(!kt.has(Ht)){gt[ct]=[],Lt[ct]=!1;var Tt=Ht;Gt.push(Tt),kt.add(Tt),gt[ct].push(Tt);while(Gt.length!=0){if(Tt=Gt.shift(),rt.has(Tt))Lt[ct]=!0;var pt=_.get(Tt);pt.forEach(function(It){if(!kt.has(It))Gt.push(It),kt.add(It),gt[ct].push(It)})}ct++}}),{components:gt,isFixed:Lt}},dt=k(ht,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=dt.components,this.fixedComponentsOnHorizontal=dt.isFixed;var at=k(vt,s.fixedNodesOnVertical);this.componentsOnVertical=at.components,this.fixedComponentsOnVertical=at.isFixed}}},Y.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(at){var b=s.idToNodeMap.get(at.nodeId);b.displacementX=0,b.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var M=this.constraints.alignmentConstraint.vertical;for(var T=0;T<M.length;T++){var A=0;for(var m=0;m<M[T].length;m++){if(this.fixedNodeSet.has(M[T][m])){A=0;break}A+=this.idToNodeMap.get(M[T][m]).displacementX}var H=A/M[T].length;for(var m=0;m<M[T].length;m++)this.idToNodeMap.get(M[T][m]).displacementX=H}}if(this.constraints.alignmentConstraint.horizontal){var U=this.constraints.alignmentConstraint.horizontal;for(var T=0;T<U.length;T++){var q=0;for(var m=0;m<U[T].length;m++){if(this.fixedNodeSet.has(U[T][m])){q=0;break}q+=this.idToNodeMap.get(U[T][m]).displacementY}var Z=q/U[T].length;for(var m=0;m<U[T].length;m++)this.idToNodeMap.get(U[T][m]).displacementY=Z}}}if(this.constraints.relativePlacementConstraint)if(g.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(at){if(!s.fixedNodesOnHorizontal.has(at)){var b=0;if(s.dummyToNodeForVerticalAlignment.has(at))b=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(at)[0]).displacementX;else b=s.idToNodeMap.get(at).displacementX;if(s.nodeToRelativeConstraintMapHorizontal.get(at).forEach(function(_){if(_.right){var rt=s.nodeToTempPositionMapHorizontal.get(_.right)-s.nodeToTempPositionMapHorizontal.get(at)-b;if(rt<_.gap)b-=_.gap-rt}else{var rt=s.nodeToTempPositionMapHorizontal.get(at)-s.nodeToTempPositionMapHorizontal.get(_.left)+b;if(rt<_.gap)b+=_.gap-rt}}),s.nodeToTempPositionMapHorizontal.set(at,s.nodeToTempPositionMapHorizontal.get(at)+b),s.dummyToNodeForVerticalAlignment.has(at))s.dummyToNodeForVerticalAlignment.get(at).forEach(function(_){s.idToNodeMap.get(_).displacementX=b});else s.idToNodeMap.get(at).displacementX=b}}),this.nodesInRelativeVertical.forEach(function(at){if(!s.fixedNodesOnHorizontal.has(at)){var b=0;if(s.dummyToNodeForHorizontalAlignment.has(at))b=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(at)[0]).displacementY;else b=s.idToNodeMap.get(at).displacementY;if(s.nodeToRelativeConstraintMapVertical.get(at).forEach(function(_){if(_.bottom){var rt=s.nodeToTempPositionMapVertical.get(_.bottom)-s.nodeToTempPositionMapVertical.get(at)-b;if(rt<_.gap)b-=_.gap-rt}else{var rt=s.nodeToTempPositionMapVertical.get(at)-s.nodeToTempPositionMapVertical.get(_.top)+b;if(rt<_.gap)b+=_.gap-rt}}),s.nodeToTempPositionMapVertical.set(at,s.nodeToTempPositionMapVertical.get(at)+b),s.dummyToNodeForHorizontalAlignment.has(at))s.dummyToNodeForHorizontalAlignment.get(at).forEach(function(_){s.idToNodeMap.get(_).displacementY=b});else s.idToNodeMap.get(at).displacementY=b}})}else{for(var T=0;T<this.componentsOnHorizontal.length;T++){var V=this.componentsOnHorizontal[T];if(this.fixedComponentsOnHorizontal[T])for(var m=0;m<V.length;m++)if(this.dummyToNodeForVerticalAlignment.has(V[m]))this.dummyToNodeForVerticalAlignment.get(V[m]).forEach(function(_){s.idToNodeMap.get(_).displacementX=0});else this.idToNodeMap.get(V[m]).displacementX=0;else{var ht=0,vt=0;for(var m=0;m<V.length;m++)if(this.dummyToNodeForVerticalAlignment.has(V[m])){var k=this.dummyToNodeForVerticalAlignment.get(V[m]);ht+=k.length*this.idToNodeMap.get(k[0]).displacementX,vt+=k.length}else ht+=this.idToNodeMap.get(V[m]).displacementX,vt++;var dt=ht/vt;for(var m=0;m<V.length;m++)if(this.dummyToNodeForVerticalAlignment.has(V[m]))this.dummyToNodeForVerticalAlignment.get(V[m]).forEach(function(_){s.idToNodeMap.get(_).displacementX=dt});else this.idToNodeMap.get(V[m]).displacementX=dt}}for(var T=0;T<this.componentsOnVertical.length;T++){var V=this.componentsOnVertical[T];if(this.fixedComponentsOnVertical[T])for(var m=0;m<V.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(V[m]))this.dummyToNodeForHorizontalAlignment.get(V[m]).forEach(function(rt){s.idToNodeMap.get(rt).displacementY=0});else this.idToNodeMap.get(V[m]).displacementY=0;else{var ht=0,vt=0;for(var m=0;m<V.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(V[m])){var k=this.dummyToNodeForHorizontalAlignment.get(V[m]);ht+=k.length*this.idToNodeMap.get(k[0]).displacementY,vt+=k.length}else ht+=this.idToNodeMap.get(V[m]).displacementY,vt++;var dt=ht/vt;for(var m=0;m<V.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(V[m]))this.dummyToNodeForHorizontalAlignment.get(V[m]).forEach(function(Gt){s.idToNodeMap.get(Gt).displacementY=dt});else this.idToNodeMap.get(V[m]).displacementY=dt}}}},Y.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],M,T=this.graphManager.getGraphs(),A=T.length,m;for(m=0;m<A;m++)if(M=T[m],M.updateConnected(),!M.isConnected)s=s.concat(M.getNodes());return s},Y.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var M=new Set,T;for(T=0;T<s.length;T++){var A=s[T];if(!M.has(A)){var m=A.getSource(),H=A.getTarget();if(m==H)A.getBendpoints().push(new w),A.getBendpoints().push(new w),this.createDummyNodesForBendpoints(A),M.add(A);else{var U=[];if(U=U.concat(m.getEdgeListToNode(H)),U=U.concat(H.getEdgeListToNode(m)),!M.has(U[0])){if(U.length>1){var q;for(q=0;q<U.length;q++){var Z=U[q];Z.getBendpoints().push(new w),this.createDummyNodesForBendpoints(Z)}}U.forEach(function(V){M.add(V)})}}}if(M.size==s.length)break}},Y.prototype.positionNodesRadially=function(s){var M=new N(0,0),T=Math.ceil(Math.sqrt(s.length)),A=0,m=0,H=0,U=new w(0,0);for(var q=0;q<s.length;q++){if(q%T==0){if(H=0,m=A,q!=0)m+=g.DEFAULT_COMPONENT_SEPERATION;A=0}var Z=s[q],V=W.findCenterOfTree(Z);if(M.x=H,M.y=m,U=Y.radialLayout(Z,V,M),U.y>A)A=Math.floor(U.y);H=Math.floor(U.x+g.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(I.WORLD_CENTER_X-U.x/2,I.WORLD_CENTER_Y-U.y/2))},Y.radialLayout=function(s,M,T){var A=Math.max(this.maxDiagonalInTree(s),g.DEFAULT_RADIAL_SEPARATION);Y.branchRadialLayout(M,null,0,359,0,A);var m=tt.calculateBounds(s),H=new Q;H.setDeviceOrgX(m.getMinX()),H.setDeviceOrgY(m.getMinY()),H.setWorldOrgX(T.x),H.setWorldOrgY(T.y);for(var U=0;U<s.length;U++){var q=s[U];q.transform(H)}var Z=new w(m.getMaxX(),m.getMaxY());return H.inverseTransformPoint(Z)},Y.branchRadialLayout=function(s,M,T,A,m,H){var U=(A-T+1)/2;if(U<0)U+=180;var q=(U+T)%360,Z=q*B.TWO_PI/360,V=Math.cos(Z),ht=m*Math.cos(Z),vt=m*Math.sin(Z);s.setCenter(ht,vt);var k=[];k=k.concat(s.getEdges());var dt=k.length;if(M!=null)dt--;var at=0,b=k.length,_,rt=s.getEdgesBetween(M);while(rt.length>1){var gt=rt[0];rt.splice(0,1);var Lt=k.indexOf(gt);if(Lt>=0)k.splice(Lt,1);b--,dt--}if(M!=null)_=(k.indexOf(rt[0])+1)%b;else _=0;var Gt=Math.abs(A-T)/dt;for(var kt=_;at!=dt;kt=++kt%b){var ct=k[kt].getOtherEnd(s);if(ct==M)continue;var jt=(T+at*Gt)%360,Ht=(jt+Gt)%360;Y.branchRadialLayout(ct,s,jt,Ht,m+H,H),at++}},Y.maxDiagonalInTree=function(s){var M=S.MIN_VALUE;for(var T=0;T<s.length;T++){var A=s[T],m=A.getDiagonal();if(m>M)M=m}return M},Y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},Y.prototype.groupZeroDegreeMembers=function(){var s=this,M={};this.memberGroups={},this.idToDummyNode={};var T=[],A=this.graphManager.getAllNodes();for(var m=0;m<A.length;m++){var H=A[m],U=H.getParent();if(this.getNodeDegreeWithChildren(H)===0&&(U.id==null||!this.getToBeTiled(U)))T.push(H)}for(var m=0;m<T.length;m++){var H=T[m],q=H.getParent().id;if(typeof M[q]>"u")M[q]=[];M[q]=M[q].concat(H)}Object.keys(M).forEach(function(Z){if(M[Z].length>1){var V="DummyCompound_"+Z;s.memberGroups[V]=M[Z];var ht=M[Z][0].getParent(),vt=new i(s.graphManager);vt.id=V,vt.paddingLeft=ht.paddingLeft||0,vt.paddingRight=ht.paddingRight||0,vt.paddingBottom=ht.paddingBottom||0,vt.paddingTop=ht.paddingTop||0,s.idToDummyNode[V]=vt;var k=s.getGraphManager().add(s.newGraph(),vt),dt=ht.getChild();dt.add(vt);for(var at=0;at<M[Z].length;at++){var b=M[Z][at];dt.remove(b),k.add(b)}}})},Y.prototype.clearCompounds=function(){var s={},M={};this.performDFSOnCompounds();for(var T=0;T<this.compoundOrder.length;T++)M[this.compoundOrder[T].id]=this.compoundOrder[T],s[this.compoundOrder[T].id]=[].concat(this.compoundOrder[T].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[T].getChild()),this.compoundOrder[T].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,M)},Y.prototype.clearZeroDegreeMembers=function(){var s=this,M=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(T){var A=s.idToDummyNode[T];if(M[T]=s.tileNodes(s.memberGroups[T],A.paddingLeft+A.paddingRight),A.rect.width=M[T].width,A.rect.height=M[T].height,A.setCenter(M[T].centerX,M[T].centerY),A.labelMarginLeft=0,A.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var m=A.rect.width,H=A.rect.height;if(A.labelWidth){if(A.labelPosHorizontal=="left")A.rect.x-=A.labelWidth,A.setWidth(m+A.labelWidth),A.labelMarginLeft=A.labelWidth;else if(A.labelPosHorizontal=="center"&&A.labelWidth>m)A.rect.x-=(A.labelWidth-m)/2,A.setWidth(A.labelWidth),A.labelMarginLeft=(A.labelWidth-m)/2;else if(A.labelPosHorizontal=="right")A.setWidth(m+A.labelWidth)}if(A.labelHeight){if(A.labelPosVertical=="top")A.rect.y-=A.labelHeight,A.setHeight(H+A.labelHeight),A.labelMarginTop=A.labelHeight;else if(A.labelPosVertical=="center"&&A.labelHeight>H)A.rect.y-=(A.labelHeight-H)/2,A.setHeight(A.labelHeight),A.labelMarginTop=(A.labelHeight-H)/2;else if(A.labelPosVertical=="bottom")A.setHeight(H+A.labelHeight)}}})},Y.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var M=this.compoundOrder[s],{id:T,paddingLeft:A,paddingTop:m,labelMarginLeft:H,labelMarginTop:U}=M;this.adjustLocations(this.tiledMemberPack[T],M.rect.x,M.rect.y,A,m,H,U)}},Y.prototype.repopulateZeroDegreeMembers=function(){var s=this,M=this.tiledZeroDegreePack;Object.keys(M).forEach(function(T){var A=s.idToDummyNode[T],{paddingLeft:m,paddingTop:H,labelMarginLeft:U,labelMarginTop:q}=A;s.adjustLocations(M[T],A.rect.x,A.rect.y,m,H,U,q)})},Y.prototype.getToBeTiled=function(s){var M=s.id;if(this.toBeTiled[M]!=null)return this.toBeTiled[M];var T=s.getChild();if(T==null)return this.toBeTiled[M]=!1,!1;var A=T.getNodes();for(var m=0;m<A.length;m++){var H=A[m];if(this.getNodeDegree(H)>0)return this.toBeTiled[M]=!1,!1;if(H.getChild()==null){this.toBeTiled[H.id]=!1;continue}if(!this.getToBeTiled(H))return this.toBeTiled[M]=!1,!1}return this.toBeTiled[M]=!0,!0},Y.prototype.getNodeDegree=function(s){var M=s.id,T=s.getEdges(),A=0;for(var m=0;m<T.length;m++){var H=T[m];if(H.getSource().id!==H.getTarget().id)A=A+1}return A},Y.prototype.getNodeDegreeWithChildren=function(s){var M=this.getNodeDegree(s);if(s.getChild()==null)return M;var T=s.getChild().getNodes();for(var A=0;A<T.length;A++){var m=T[A];M+=this.getNodeDegreeWithChildren(m)}return M},Y.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},Y.prototype.fillCompexOrderByDFS=function(s){for(var M=0;M<s.length;M++){var T=s[M];if(T.getChild()!=null)this.fillCompexOrderByDFS(T.getChild().getNodes());if(this.getToBeTiled(T))this.compoundOrder.push(T)}},Y.prototype.adjustLocations=function(s,M,T,A,m,H,U){M+=A+H,T+=m+U;var q=M;for(var Z=0;Z<s.rows.length;Z++){var V=s.rows[Z];M=q;var ht=0;for(var vt=0;vt<V.length;vt++){var k=V[vt];if(k.rect.x=M,k.rect.y=T,M+=k.rect.width+s.horizontalPadding,k.rect.height>ht)ht=k.rect.height}T+=ht+s.verticalPadding}},Y.prototype.tileCompoundMembers=function(s,M){var T=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(A){var m=M[A];if(T.tiledMemberPack[A]=T.tileNodes(s[A],m.paddingLeft+m.paddingRight),m.rect.width=T.tiledMemberPack[A].width,m.rect.height=T.tiledMemberPack[A].height,m.setCenter(T.tiledMemberPack[A].centerX,T.tiledMemberPack[A].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var H=m.rect.width,U=m.rect.height;if(m.labelWidth){if(m.labelPosHorizontal=="left")m.rect.x-=m.labelWidth,m.setWidth(H+m.labelWidth),m.labelMarginLeft=m.labelWidth;else if(m.labelPosHorizontal=="center"&&m.labelWidth>H)m.rect.x-=(m.labelWidth-H)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-H)/2;else if(m.labelPosHorizontal=="right")m.setWidth(H+m.labelWidth)}if(m.labelHeight){if(m.labelPosVertical=="top")m.rect.y-=m.labelHeight,m.setHeight(U+m.labelHeight),m.labelMarginTop=m.labelHeight;else if(m.labelPosVertical=="center"&&m.labelHeight>U)m.rect.y-=(m.labelHeight-U)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-U)/2;else if(m.labelPosVertical=="bottom")m.setHeight(U+m.labelHeight)}}})},Y.prototype.tileNodes=function(s,M){var T=this.tileNodesByFavoringDim(s,M,!0),A=this.tileNodesByFavoringDim(s,M,!1),m=this.getOrgRatio(T),H=this.getOrgRatio(A),U;if(H<m)U=A;else U=T;return U},Y.prototype.getOrgRatio=function(s){var{width:M,height:T}=s,A=M/T;if(A<1)A=1/A;return A},Y.prototype.calcIdealRowWidth=function(s,M){var{TILING_PADDING_VERTICAL:T,TILING_PADDING_HORIZONTAL:A}=g,m=s.length,H=0,U=0,q=0;s.forEach(function(at){if(H+=at.getWidth(),U+=at.getHeight(),at.getWidth()>q)q=at.getWidth()});var Z=H/m,V=U/m,ht=Math.pow(T-A,2)+4*(Z+A)*(V+T)*m,vt=(A-T+Math.sqrt(ht))/(2*(Z+A)),k;if(M){if(k=Math.ceil(vt),k==vt)k++}else k=Math.floor(vt);var dt=k*(Z+A)-A;if(q>dt)dt=q;return dt+=A*2,dt},Y.prototype.tileNodesByFavoringDim=function(s,M,T){var{TILING_PADDING_VERTICAL:A,TILING_PADDING_HORIZONTAL:m,TILING_COMPARE_BY:H}=g,U={rows:[],rowWidth:[],rowHeight:[],width:0,height:M,verticalPadding:A,horizontalPadding:m,centerX:0,centerY:0};if(H)U.idealRowWidth=this.calcIdealRowWidth(s,T);var q=function(b){return b.rect.width*b.rect.height},Z=function(b,_){return q(_)-q(b)};s.sort(function(at,b){var _=Z;if(U.idealRowWidth)return _=H,_(at.id,b.id);return _(at,b)});var V=0,ht=0;for(var vt=0;vt<s.length;vt++){var k=s[vt];V+=k.getCenterX(),ht+=k.getCenterY()}U.centerX=V/s.length,U.centerY=ht/s.length;for(var vt=0;vt<s.length;vt++){var k=s[vt];if(U.rows.length==0)this.insertNodeToRow(U,k,0,M);else if(this.canAddHorizontal(U,k.rect.width,k.rect.height)){var dt=U.rows.length-1;if(!U.idealRowWidth)dt=this.getShortestRowIndex(U);this.insertNodeToRow(U,k,dt,M)}else this.insertNodeToRow(U,k,U.rows.length,M);this.shiftToLastRow(U)}return U},Y.prototype.insertNodeToRow=function(s,M,T,A){var m=A;if(T==s.rows.length){var H=[];s.rows.push(H),s.rowWidth.push(m),s.rowHeight.push(0)}var U=s.rowWidth[T]+M.rect.width;if(s.rows[T].length>0)U+=s.horizontalPadding;if(s.rowWidth[T]=U,s.width<U)s.width=U;var q=M.rect.height;if(T>0)q+=s.verticalPadding;var Z=0;if(q>s.rowHeight[T])Z=s.rowHeight[T],s.rowHeight[T]=q,Z=s.rowHeight[T]-Z;s.height+=Z,s.rows[T].push(M)},Y.prototype.getShortestRowIndex=function(s){var M=-1,T=Number.MAX_VALUE;for(var A=0;A<s.rows.length;A++)if(s.rowWidth[A]<T)M=A,T=s.rowWidth[A];return M},Y.prototype.getLongestRowIndex=function(s){var M=-1,T=Number.MIN_VALUE;for(var A=0;A<s.rows.length;A++)if(s.rowWidth[A]>T)M=A,T=s.rowWidth[A];return M},Y.prototype.canAddHorizontal=function(s,M,T){if(s.idealRowWidth){var A=s.rows.length-1,m=s.rowWidth[A];return m+M+s.horizontalPadding<=s.idealRowWidth}var H=this.getShortestRowIndex(s);if(H<0)return!0;var U=s.rowWidth[H];if(U+s.horizontalPadding+M<=s.width)return!0;var q=0;if(s.rowHeight[H]<T){if(H>0)q=T+s.verticalPadding-s.rowHeight[H]}var Z;if(s.width-U>=M+s.horizontalPadding)Z=(s.height+q)/(U+M+s.horizontalPadding);else Z=(s.height+q)/s.width;q=T+s.verticalPadding;var V;if(s.width<M)V=(s.height+q)/M;else V=(s.height+q)/s.width;if(V<1)V=1/V;if(Z<1)Z=1/Z;return Z<V},Y.prototype.shiftToLastRow=function(s){var M=this.getLongestRowIndex(s),T=s.rowWidth.length-1,A=s.rows[M],m=A[A.length-1],H=m.width+s.horizontalPadding;if(s.width-s.rowWidth[T]>H&&M!=T){A.splice(-1,1),s.rows[T].push(m),s.rowWidth[M]=s.rowWidth[M]-H,s.rowWidth[T]=s.rowWidth[T]+H,s.width=s.rowWidth[instance.getLongestRowIndex(s)];var U=Number.MIN_VALUE;for(var q=0;q<A.length;q++)if(A[q].height>U)U=A[q].height;if(M>0)U+=s.verticalPadding;var Z=s.rowHeight[M]+s.rowHeight[T];if(s.rowHeight[M]=U,s.rowHeight[T]<m.height+s.verticalPadding)s.rowHeight[T]=m.height+s.verticalPadding;var V=s.rowHeight[M]+s.rowHeight[T];s.height+=V-Z,this.shiftToLastRow(s)}},Y.prototype.tilingPreLayout=function(){if(g.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},Y.prototype.tilingPostLayout=function(){if(g.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},Y.prototype.reduceTrees=function(){var s=[],M=!0,T;while(M){var A=this.graphManager.getAllNodes(),m=[];M=!1;for(var H=0;H<A.length;H++)if(T=A[H],T.getEdges().length==1&&!T.getEdges()[0].isInterGraph&&T.getChild()==null){if(g.PURE_INCREMENTAL){var U=T.getEdges()[0].getOtherEnd(T),q=new x(T.getCenterX()-U.getCenterX(),T.getCenterY()-U.getCenterY());m.push([T,T.getEdges()[0],T.getOwner(),q])}else m.push([T,T.getEdges()[0],T.getOwner()]);M=!0}if(M==!0){var Z=[];for(var V=0;V<m.length;V++)if(m[V][0].getEdges().length==1)Z.push(m[V]),m[V][0].getOwner().remove(m[V][0]);s.push(Z),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},Y.prototype.growTree=function(s){var M=s.length,T=s[M-1],A;for(var m=0;m<T.length;m++)A=T[m],this.findPlaceforPrunedNode(A),A[2].add(A[0]),A[2].add(A[1],A[1].source,A[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},Y.prototype.findPlaceforPrunedNode=function(s){var M,T,A=s[0];if(A==s[1].source)T=s[1].target;else T=s[1].source;if(g.PURE_INCREMENTAL)A.setCenter(T.getCenterX()+s[3].getWidth(),T.getCenterY()+s[3].getHeight());else{var m=T.startX,H=T.finishX,U=T.startY,q=T.finishY,Z=0,V=0,ht=0,vt=0,k=[Z,ht,V,vt];if(U>0)for(var dt=m;dt<=H;dt++)k[0]+=this.grid[dt][U-1].length+this.grid[dt][U].length-1;if(H<this.grid.length-1)for(var dt=U;dt<=q;dt++)k[1]+=this.grid[H+1][dt].length+this.grid[H][dt].length-1;if(q<this.grid[0].length-1)for(var dt=m;dt<=H;dt++)k[2]+=this.grid[dt][q+1].length+this.grid[dt][q].length-1;if(m>0)for(var dt=U;dt<=q;dt++)k[3]+=this.grid[m-1][dt].length+this.grid[m][dt].length-1;var at=S.MAX_VALUE,b,_;for(var rt=0;rt<k.length;rt++)if(k[rt]<at)at=k[rt],b=1,_=rt;else if(k[rt]==at)b++;if(b==3&&at==0){if(k[0]==0&&k[1]==0&&k[2]==0)M=1;else if(k[0]==0&&k[1]==0&&k[3]==0)M=0;else if(k[0]==0&&k[2]==0&&k[3]==0)M=3;else if(k[1]==0&&k[2]==0&&k[3]==0)M=2}else if(b==2&&at==0){var gt=Math.floor(Math.random()*2);if(k[0]==0&&k[1]==0)if(gt==0)M=0;else M=1;else if(k[0]==0&&k[2]==0)if(gt==0)M=0;else M=2;else if(k[0]==0&&k[3]==0)if(gt==0)M=0;else M=3;else if(k[1]==0&&k[2]==0)if(gt==0)M=1;else M=2;else if(k[1]==0&&k[3]==0)if(gt==0)M=1;else M=3;else if(gt==0)M=2;else M=3}else if(b==4&&at==0){var gt=Math.floor(Math.random()*4);M=gt}else M=_;if(M==0)A.setCenter(T.getCenterX(),T.getCenterY()-T.getHeight()/2-c.DEFAULT_EDGE_LENGTH-A.getHeight()/2);else if(M==1)A.setCenter(T.getCenterX()+T.getWidth()/2+c.DEFAULT_EDGE_LENGTH+A.getWidth()/2,T.getCenterY());else if(M==2)A.setCenter(T.getCenterX(),T.getCenterY()+T.getHeight()/2+c.DEFAULT_EDGE_LENGTH+A.getHeight()/2);else A.setCenter(T.getCenterX()-T.getWidth()/2-c.DEFAULT_EDGE_LENGTH-A.getWidth()/2,T.getCenterY())}},o.exports=Y},991:(o,n,a)=>{var u=a(551).FDLayoutNode,r=a(551).IMath;function y(e,g,d,c){u.call(this,e,g,d,c)}y.prototype=Object.create(u.prototype);for(var i in u)y[i]=u[i];y.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement)this.displacementX=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementX);if(Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement)this.displacementY=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},y.prototype.propogateDisplacementToChildren=function(e,g){var d=this.getChild().getNodes(),c;for(var I=0;I<d.length;I++)if(c=d[I],c.getChild()==null)c.displacementX+=e,c.displacementY+=g;else c.propogateDisplacementToChildren(e,g)},y.prototype.move=function(){var e=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),e.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},y.prototype.setPred1=function(e){this.pred1=e},y.prototype.getPred1=function(){return pred1},y.prototype.getPred2=function(){return pred2},y.prototype.setNext=function(e){this.next=e},y.prototype.getNext=function(){return next},y.prototype.setProcessed=function(e){this.processed=e},y.prototype.isProcessed=function(){return processed},o.exports=y},902:(o,n,a)=>{function u(d){if(Array.isArray(d)){for(var c=0,I=Array(d.length);c<d.length;c++)I[c]=d[c];return I}else return Array.from(d)}var r=a(806),y=a(551).LinkedList,i=a(551).Matrix,e=a(551).SVD;function g(){}g.handleConstraints=function(d){var c={};c.fixedNodeConstraint=d.constraints.fixedNodeConstraint,c.alignmentConstraint=d.constraints.alignmentConstraint,c.relativePlacementConstraint=d.constraints.relativePlacementConstraint;var I=new Map,N=new Map,w=[],x=[],W=d.getAllNodes(),S=0;for(var B=0;B<W.length;B++){var tt=W[B];if(tt.getChild()==null)N.set(tt.id,S++),w.push(tt.getCenterX()),x.push(tt.getCenterY()),I.set(tt.id,tt)}if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(J){if(!J.gap&&J.gap!=0)if(J.left)J.gap=r.DEFAULT_EDGE_LENGTH+I.get(J.left).getWidth()/2+I.get(J.right).getWidth()/2;else J.gap=r.DEFAULT_EDGE_LENGTH+I.get(J.top).getHeight()/2+I.get(J.bottom).getHeight()/2});var Q=function(it,nt){return{x:it.x-nt.x,y:it.y-nt.y}},ft=function(it){var nt=0,ot=0;return it.forEach(function(st){nt+=w[N.get(st)],ot+=x[N.get(st)]}),{x:nt/it.size,y:ot/it.size}},Y=function(it,nt,ot,st,ut){function Dt(Nt,mt){var Ot=new Set(Nt),Et=!0,Mt=!1,qt=void 0;try{for(var zt=mt[Symbol.iterator](),ne;!(Et=(ne=zt.next()).done);Et=!0){var Vt=ne.value;Ot.add(Vt)}}catch(Pt){Mt=!0,qt=Pt}finally{try{if(!Et&&zt.return)zt.return()}finally{if(Mt)throw qt}}return Ot}var Ct=new Map;it.forEach(function(Nt,mt){Ct.set(mt,0)}),it.forEach(function(Nt,mt){Nt.forEach(function(Ot){Ct.set(Ot.id,Ct.get(Ot.id)+1)})});var lt=new Map,wt=new Map,At=new y;if(Ct.forEach(function(Nt,mt){if(Nt==0){if(At.push(mt),!ot)if(nt=="horizontal")lt.set(mt,N.has(mt)?w[N.get(mt)]:st.get(mt));else lt.set(mt,N.has(mt)?x[N.get(mt)]:st.get(mt))}else lt.set(mt,Number.NEGATIVE_INFINITY);if(ot)wt.set(mt,new Set([mt]))}),ot)ut.forEach(function(Nt){var mt=[];if(Nt.forEach(function(Mt){if(ot.has(Mt))mt.push(Mt)}),mt.length>0){var Ot=0;mt.forEach(function(Mt){if(nt=="horizontal")lt.set(Mt,N.has(Mt)?w[N.get(Mt)]:st.get(Mt)),Ot+=lt.get(Mt);else lt.set(Mt,N.has(Mt)?x[N.get(Mt)]:st.get(Mt)),Ot+=lt.get(Mt)}),Ot=Ot/mt.length,Nt.forEach(function(Mt){if(!ot.has(Mt))lt.set(Mt,Ot)})}else{var Et=0;Nt.forEach(function(Mt){if(nt=="horizontal")Et+=N.has(Mt)?w[N.get(Mt)]:st.get(Mt);else Et+=N.has(Mt)?x[N.get(Mt)]:st.get(Mt)}),Et=Et/Nt.length,Nt.forEach(function(Mt){lt.set(Mt,Et)})}});var yt=function(){var mt=At.shift(),Ot=it.get(mt);Ot.forEach(function(Et){if(lt.get(Et.id)<lt.get(mt)+Et.gap)if(ot&&ot.has(Et.id)){var Mt=void 0;if(nt=="horizontal")Mt=N.has(Et.id)?w[N.get(Et.id)]:st.get(Et.id);else Mt=N.has(Et.id)?x[N.get(Et.id)]:st.get(Et.id);if(lt.set(Et.id,Mt),Mt<lt.get(mt)+Et.gap){var qt=lt.get(mt)+Et.gap-Mt;wt.get(mt).forEach(function(zt){lt.set(zt,lt.get(zt)-qt)})}}else lt.set(Et.id,lt.get(mt)+Et.gap);if(Ct.set(Et.id,Ct.get(Et.id)-1),Ct.get(Et.id)==0)At.push(Et.id);if(ot)wt.set(Et.id,Dt(wt.get(mt),wt.get(Et.id)))})};while(At.length!=0)yt();if(ot){var xt=new Set;it.forEach(function(Nt,mt){if(Nt.length==0)xt.add(mt)});var Yt=[];wt.forEach(function(Nt,mt){if(xt.has(mt)){var Ot=!1,Et=!0,Mt=!1,qt=void 0;try{for(var zt=Nt[Symbol.iterator](),ne;!(Et=(ne=zt.next()).done);Et=!0){var Vt=ne.value;if(ot.has(Vt))Ot=!0}}catch(Bt){Mt=!0,qt=Bt}finally{try{if(!Et&&zt.return)zt.return()}finally{if(Mt)throw qt}}if(!Ot){var Pt=!1,se=void 0;if(Yt.forEach(function(Bt,te){if(Bt.has([].concat(u(Nt))[0]))Pt=!0,se=te}),!Pt)Yt.push(new Set(Nt));else Nt.forEach(function(Bt){Yt[se].add(Bt)})}}}),Yt.forEach(function(Nt,mt){var{POSITIVE_INFINITY:Ot,POSITIVE_INFINITY:Et,NEGATIVE_INFINITY:Mt,NEGATIVE_INFINITY:qt}=Number,zt=!0,ne=!1,Vt=void 0;try{for(var Pt=Nt[Symbol.iterator](),se;!(zt=(se=Pt.next()).done);zt=!0){var Bt=se.value,te=void 0;if(nt=="horizontal")te=N.has(Bt)?w[N.get(Bt)]:st.get(Bt);else te=N.has(Bt)?x[N.get(Bt)]:st.get(Bt);var ae=lt.get(Bt);if(te<Ot)Ot=te;if(te>Mt)Mt=te;if(ae<Et)Et=ae;if(ae>qt)qt=ae}}catch(pe){ne=!0,Vt=pe}finally{try{if(!zt&&Pt.return)Pt.return()}finally{if(ne)throw Vt}}var Ae=(Ot+Mt)/2-(Et+qt)/2,fe=!0,ge=!1,de=void 0;try{for(var ce=Nt[Symbol.iterator](),Me;!(fe=(Me=ce.next()).done);fe=!0){var ve=Me.value;lt.set(ve,lt.get(ve)+Ae)}}catch(pe){ge=!0,de=pe}finally{try{if(!fe&&ce.return)ce.return()}finally{if(ge)throw de}}})}return lt},et=function(it){var nt=0,ot=0,st=0,ut=0;if(it.forEach(function(wt){if(wt.left)w[N.get(wt.left)]-w[N.get(wt.right)]>=0?nt++:ot++;else x[N.get(wt.top)]-x[N.get(wt.bottom)]>=0?st++:ut++}),nt>ot&&st>ut)for(var Dt=0;Dt<N.size;Dt++)w[Dt]=-1*w[Dt],x[Dt]=-1*x[Dt];else if(nt>ot)for(var Ct=0;Ct<N.size;Ct++)w[Ct]=-1*w[Ct];else if(st>ut)for(var lt=0;lt<N.size;lt++)x[lt]=-1*x[lt]},s=function(it){var nt=[],ot=new y,st=new Set,ut=0;return it.forEach(function(Dt,Ct){if(!st.has(Ct)){nt[ut]=[];var lt=Ct;ot.push(lt),st.add(lt),nt[ut].push(lt);while(ot.length!=0){lt=ot.shift();var wt=it.get(lt);wt.forEach(function(At){if(!st.has(At.id))ot.push(At.id),st.add(At.id),nt[ut].push(At.id)})}ut++}}),nt},M=function(it){var nt=new Map;return it.forEach(function(ot,st){nt.set(st,[])}),it.forEach(function(ot,st){ot.forEach(function(ut){nt.get(st).push(ut),nt.get(ut.id).push({id:st,gap:ut.gap,direction:ut.direction})})}),nt},T=function(it){var nt=new Map;return it.forEach(function(ot,st){nt.set(st,[])}),it.forEach(function(ot,st){ot.forEach(function(ut){nt.get(ut.id).push({id:st,gap:ut.gap,direction:ut.direction})})}),nt},A=[],m=[],H=!1,U=!1,q=new Set,Z=new Map,V=new Map,ht=[];if(c.fixedNodeConstraint)c.fixedNodeConstraint.forEach(function(J){q.add(J.nodeId)});if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(J){if(J.left){if(Z.has(J.left))Z.get(J.left).push({id:J.right,gap:J.gap,direction:"horizontal"});else Z.set(J.left,[{id:J.right,gap:J.gap,direction:"horizontal"}]);if(!Z.has(J.right))Z.set(J.right,[])}else{if(Z.has(J.top))Z.get(J.top).push({id:J.bottom,gap:J.gap,direction:"vertical"});else Z.set(J.top,[{id:J.bottom,gap:J.gap,direction:"vertical"}]);if(!Z.has(J.bottom))Z.set(J.bottom,[])}}),V=M(Z),ht=s(V);if(r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>1)c.fixedNodeConstraint.forEach(function(J,it){A[it]=[J.position.x,J.position.y],m[it]=[w[N.get(J.nodeId)],x[N.get(J.nodeId)]]}),H=!0;else if(c.alignmentConstraint)(function(){var J=0;if(c.alignmentConstraint.vertical){var it=c.alignmentConstraint.vertical,nt=function(lt){var wt=new Set;it[lt].forEach(function(xt){wt.add(xt)});var At=new Set([].concat(u(wt)).filter(function(xt){return q.has(xt)})),yt=void 0;if(At.size>0)yt=w[N.get(At.values().next().value)];else yt=ft(wt).x;it[lt].forEach(function(xt){A[J]=[yt,x[N.get(xt)]],m[J]=[w[N.get(xt)],x[N.get(xt)]],J++})};for(var ot=0;ot<it.length;ot++)nt(ot);H=!0}if(c.alignmentConstraint.horizontal){var st=c.alignmentConstraint.horizontal,ut=function(lt){var wt=new Set;st[lt].forEach(function(xt){wt.add(xt)});var At=new Set([].concat(u(wt)).filter(function(xt){return q.has(xt)})),yt=void 0;if(At.size>0)yt=w[N.get(At.values().next().value)];else yt=ft(wt).y;st[lt].forEach(function(xt){A[J]=[w[N.get(xt)],yt],m[J]=[w[N.get(xt)],x[N.get(xt)]],J++})};for(var Dt=0;Dt<st.length;Dt++)ut(Dt);H=!0}if(c.relativePlacementConstraint)U=!0})();else if(c.relativePlacementConstraint){var vt=0,k=0;for(var dt=0;dt<ht.length;dt++)if(ht[dt].length>vt)vt=ht[dt].length,k=dt;if(vt<V.size/2)et(c.relativePlacementConstraint),H=!1,U=!1;else{var at=new Map,b=new Map,_=[];ht[k].forEach(function(J){Z.get(J).forEach(function(it){if(it.direction=="horizontal"){if(at.has(J))at.get(J).push(it);else at.set(J,[it]);if(!at.has(it.id))at.set(it.id,[]);_.push({left:J,right:it.id})}else{if(b.has(J))b.get(J).push(it);else b.set(J,[it]);if(!b.has(it.id))b.set(it.id,[]);_.push({top:J,bottom:it.id})}})}),et(_),U=!1;var rt=Y(at,"horizontal"),gt=Y(b,"vertical");ht[k].forEach(function(J,it){if(m[it]=[w[N.get(J)],x[N.get(J)]],A[it]=[],rt.has(J))A[it][0]=rt.get(J);else A[it][0]=w[N.get(J)];if(gt.has(J))A[it][1]=gt.get(J);else A[it][1]=x[N.get(J)]}),H=!0}}if(H){var Lt=void 0,Gt=i.transpose(A),kt=i.transpose(m);for(var ct=0;ct<Gt.length;ct++)Gt[ct]=i.multGamma(Gt[ct]),kt[ct]=i.multGamma(kt[ct]);var jt=i.multMat(Gt,i.transpose(kt)),Ht=e.svd(jt);Lt=i.multMat(Ht.V,i.transpose(Ht.U));for(var Tt=0;Tt<N.size;Tt++){var pt=[w[Tt],x[Tt]],It=[Lt[0][0],Lt[1][0]],St=[Lt[0][1],Lt[1][1]];w[Tt]=i.dotProduct(pt,It),x[Tt]=i.dotProduct(pt,St)}if(U)et(c.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>0){var Ut={x:0,y:0};c.fixedNodeConstraint.forEach(function(J,it){var nt={x:w[N.get(J.nodeId)],y:x[N.get(J.nodeId)]},ot=J.position,st=Q(ot,nt);Ut.x+=st.x,Ut.y+=st.y}),Ut.x/=c.fixedNodeConstraint.length,Ut.y/=c.fixedNodeConstraint.length,w.forEach(function(J,it){w[it]+=Ut.x}),x.forEach(function(J,it){x[it]+=Ut.y}),c.fixedNodeConstraint.forEach(function(J){w[N.get(J.nodeId)]=J.position.x,x[N.get(J.nodeId)]=J.position.y})}if(c.alignmentConstraint){if(c.alignmentConstraint.vertical){var Ft=c.alignmentConstraint.vertical,bt=function(it){var nt=new Set;Ft[it].forEach(function(ut){nt.add(ut)});var ot=new Set([].concat(u(nt)).filter(function(ut){return q.has(ut)})),st=void 0;if(ot.size>0)st=w[N.get(ot.values().next().value)];else st=ft(nt).x;nt.forEach(function(ut){if(!q.has(ut))w[N.get(ut)]=st})};for(var Wt=0;Wt<Ft.length;Wt++)bt(Wt)}if(c.alignmentConstraint.horizontal){var $t=c.alignmentConstraint.horizontal,re=function(it){var nt=new Set;$t[it].forEach(function(ut){nt.add(ut)});var ot=new Set([].concat(u(nt)).filter(function(ut){return q.has(ut)})),st=void 0;if(ot.size>0)st=x[N.get(ot.values().next().value)];else st=ft(nt).y;nt.forEach(function(ut){if(!q.has(ut))x[N.get(ut)]=st})};for(var Jt=0;Jt<$t.length;Jt++)re(Jt)}}if(c.relativePlacementConstraint)(function(){var J=new Map,it=new Map,nt=new Map,ot=new Map,st=new Map,ut=new Map,Dt=new Set,Ct=new Set;if(q.forEach(function(Kt){Dt.add(Kt),Ct.add(Kt)}),c.alignmentConstraint){if(c.alignmentConstraint.vertical){var lt=c.alignmentConstraint.vertical,wt=function(Rt){nt.set("dummy"+Rt,[]),lt[Rt].forEach(function(Xt){if(J.set(Xt,"dummy"+Rt),nt.get("dummy"+Rt).push(Xt),q.has(Xt))Dt.add("dummy"+Rt)}),st.set("dummy"+Rt,w[N.get(lt[Rt][0])])};for(var At=0;At<lt.length;At++)wt(At)}if(c.alignmentConstraint.horizontal){var yt=c.alignmentConstraint.horizontal,xt=function(Rt){ot.set("dummy"+Rt,[]),yt[Rt].forEach(function(Xt){if(it.set(Xt,"dummy"+Rt),ot.get("dummy"+Rt).push(Xt),q.has(Xt))Ct.add("dummy"+Rt)}),ut.set("dummy"+Rt,x[N.get(yt[Rt][0])])};for(var Yt=0;Yt<yt.length;Yt++)xt(Yt)}}var Nt=new Map,mt=new Map,Ot=function(Rt){Z.get(Rt).forEach(function(Xt){var he=void 0,oe=void 0;if(Xt.direction=="horizontal"){if(he=J.get(Rt)?J.get(Rt):Rt,J.get(Xt.id))oe={id:J.get(Xt.id),gap:Xt.gap,direction:Xt.direction};else oe=Xt;if(Nt.has(he))Nt.get(he).push(oe);else Nt.set(he,[oe]);if(!Nt.has(oe.id))Nt.set(oe.id,[])}else{if(he=it.get(Rt)?it.get(Rt):Rt,it.get(Xt.id))oe={id:it.get(Xt.id),gap:Xt.gap,direction:Xt.direction};else oe=Xt;if(mt.has(he))mt.get(he).push(oe);else mt.set(he,[oe]);if(!mt.has(oe.id))mt.set(oe.id,[])}})},Et=!0,Mt=!1,qt=void 0;try{for(var zt=Z.keys()[Symbol.iterator](),ne;!(Et=(ne=zt.next()).done);Et=!0){var Vt=ne.value;Ot(Vt)}}catch(Kt){Mt=!0,qt=Kt}finally{try{if(!Et&&zt.return)zt.return()}finally{if(Mt)throw qt}}var Pt=M(Nt),se=M(mt),Bt=s(Pt),te=s(se),ae=T(Nt),Ae=T(mt),fe=[],ge=[];Bt.forEach(function(Kt,Rt){fe[Rt]=[],Kt.forEach(function(Xt){if(ae.get(Xt).length==0)fe[Rt].push(Xt)})}),te.forEach(function(Kt,Rt){ge[Rt]=[],Kt.forEach(function(Xt){if(Ae.get(Xt).length==0)ge[Rt].push(Xt)})});var de=Y(Nt,"horizontal",Dt,st,fe),ce=Y(mt,"vertical",Ct,ut,ge),Me=function(Rt){if(nt.get(Rt))nt.get(Rt).forEach(function(Xt){w[N.get(Xt)]=de.get(Rt)});else w[N.get(Rt)]=de.get(Rt)},ve=!0,pe=!1,He=void 0;try{for(var De=de.keys()[Symbol.iterator](),We;!(ve=(We=De.next()).done);ve=!0){var Oe=We.value;Me(Oe)}}catch(Kt){pe=!0,He=Kt}finally{try{if(!ve&&De.return)De.return()}finally{if(pe)throw He}}var lr=function(Rt){if(ot.get(Rt))ot.get(Rt).forEach(function(Xt){x[N.get(Xt)]=ce.get(Rt)});else x[N.get(Rt)]=ce.get(Rt)},xe=!0,Ve=!1,ze=void 0;try{for(var Ie=ce.keys()[Symbol.iterator](),$e;!(xe=($e=Ie.next()).done);xe=!0){var Oe=$e.value;lr(Oe)}}catch(Kt){Ve=!0,ze=Kt}finally{try{if(!xe&&Ie.return)Ie.return()}finally{if(Ve)throw ze}}})()}for(var _t=0;_t<W.length;_t++){var Qt=W[_t];if(Qt.getChild()==null)Qt.setCenter(w[N.get(Qt.id)],x[N.get(Qt.id)])}},o.exports=g},551:(o)=>{o.exports=C}},D={};function v(o){var n=D[o];if(n!==void 0)return n.exports;var a=D[o]={exports:{}};return F[o](a,a.exports,v),a.exports}var f=v(45);return f})()})});var Be=yn(function(Le,Ge){(function(F,D){if(typeof Le==="object"&&typeof Ge==="object")Ge.exports=D(Pe());else if(typeof define==="function"&&define.amd)define(["cose-base"],D);else if(typeof Le==="object")Le.cytoscapeFcose=D(Pe());else F.cytoscapeFcose=D(F.coseBase)})(Le,function(C){return(()=>{var F={658:(o)=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(n){for(var a=arguments.length,u=Array(a>1?a-1:0),r=1;r<a;r++)u[r-1]=arguments[r];return u.forEach(function(y){Object.keys(y).forEach(function(i){return n[i]=y[i]})}),n}},548:(o,n,a)=>{var u=function(){function i(e,g){var d=[],c=!0,I=!1,N=void 0;try{for(var w=e[Symbol.iterator](),x;!(c=(x=w.next()).done);c=!0)if(d.push(x.value),g&&d.length===g)break}catch(W){I=!0,N=W}finally{try{if(!c&&w.return)w.return()}finally{if(I)throw N}}return d}return function(e,g){if(Array.isArray(e))return e;else if(Symbol.iterator in Object(e))return i(e,g);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=a(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(i){var e={};for(var g=0;g<i.length;g++)e[i[g].id()]=!0;var d=i.filter(function(c,I){if(typeof c==="number")c=I;var N=c.parent()[0];while(N!=null){if(e[N.id()])return!1;N=N.parent()[0]}return!0});return d},y.connectComponents=function(i,e,g,d){var c=new r,I=new Set,N=[],w=void 0,x=void 0,W=void 0,S=!1,B=1,tt=[],Q=[],ft=function(){var et=i.collection();Q.push(et);var s=g[0],M=i.collection();M.merge(s).merge(s.descendants().intersection(e)),N.push(s),M.forEach(function(m){c.push(m),I.add(m),et.merge(m)});var T=function(){s=c.shift();var H=i.collection();s.neighborhood().nodes().forEach(function(V){if(e.intersection(s.edgesWith(V)).length>0)H.merge(V)});for(var U=0;U<H.length;U++){var q=H[U];if(w=g.intersection(q.union(q.ancestors())),w!=null&&!I.has(w[0])){var Z=w.union(w.descendants());Z.forEach(function(V){if(c.push(V),I.add(V),et.merge(V),g.has(V))N.push(V)})}}};while(c.length!=0)T();if(et.forEach(function(m){e.intersection(m.connectedEdges()).forEach(function(H){if(et.has(H.source())&&et.has(H.target()))et.merge(H)})}),N.length==g.length)S=!0;if(!S||S&&B>1){x=N[0],W=x.connectedEdges().length,N.forEach(function(m){if(m.connectedEdges().length<W)W=m.connectedEdges().length,x=m}),tt.push(x.id());var A=i.collection();A.merge(N[0]),N.forEach(function(m){A.merge(m)}),N=[],g=g.difference(A),B++}};do ft();while(!S);if(d){if(tt.length>0)d.set("dummy"+(d.size+1),tt)}return Q},y.relocateComponent=function(i,e,g){if(!g.fixedNodeConstraint){var{POSITIVE_INFINITY:d,NEGATIVE_INFINITY:c,POSITIVE_INFINITY:I,NEGATIVE_INFINITY:N}=Number;if(g.quality=="draft"){var w=!0,x=!1,W=void 0;try{for(var S=e.nodeIndexes[Symbol.iterator](),B;!(w=(B=S.next()).done);w=!0){var tt=B.value,Q=u(tt,2),ft=Q[0],Y=Q[1],et=g.cy.getElementById(ft);if(et){var s=et.boundingBox(),M=e.xCoords[Y]-s.w/2,T=e.xCoords[Y]+s.w/2,A=e.yCoords[Y]-s.h/2,m=e.yCoords[Y]+s.h/2;if(M<d)d=M;if(T>c)c=T;if(A<I)I=A;if(m>N)N=m}}}catch(V){x=!0,W=V}finally{try{if(!w&&S.return)S.return()}finally{if(x)throw W}}var H=i.x-(c+d)/2,U=i.y-(N+I)/2;e.xCoords=e.xCoords.map(function(V){return V+H}),e.yCoords=e.yCoords.map(function(V){return V+U})}else{Object.keys(e).forEach(function(V){var ht=e[V],vt=ht.getRect().x,k=ht.getRect().x+ht.getRect().width,dt=ht.getRect().y,at=ht.getRect().y+ht.getRect().height;if(vt<d)d=vt;if(k>c)c=k;if(dt<I)I=dt;if(at>N)N=at});var q=i.x-(c+d)/2,Z=i.y-(N+I)/2;Object.keys(e).forEach(function(V){var ht=e[V];ht.setCenter(ht.getCenterX()+q,ht.getCenterY()+Z)})}}},y.calcBoundingBox=function(i,e,g,d){var{MAX_SAFE_INTEGER:c,MIN_SAFE_INTEGER:I,MAX_SAFE_INTEGER:N,MIN_SAFE_INTEGER:w}=Number,x=void 0,W=void 0,S=void 0,B=void 0,tt=i.descendants().not(":parent"),Q=tt.length;for(var ft=0;ft<Q;ft++){var Y=tt[ft];if(x=e[d.get(Y.id())]-Y.width()/2,W=e[d.get(Y.id())]+Y.width()/2,S=g[d.get(Y.id())]-Y.height()/2,B=g[d.get(Y.id())]+Y.height()/2,c>x)c=x;if(I<W)I=W;if(N>S)N=S;if(w<B)w=B}var et={};return et.topLeftX=c,et.topLeftY=N,et.width=I-c,et.height=w-N,et},y.calcParentsWithoutChildren=function(i,e){var g=i.collection();return e.nodes(":parent").forEach(function(d){var c=!1;if(d.children().forEach(function(I){if(I.css("display")!="none")c=!0}),!c)g.merge(d)}),g},o.exports=y},816:(o,n,a)=>{var u=a(548),r=a(140).CoSELayout,y=a(140).CoSENode,i=a(140).layoutBase.PointD,e=a(140).layoutBase.DimensionD,g=a(140).layoutBase.LayoutConstants,d=a(140).layoutBase.FDLayoutConstants,c=a(140).CoSEConstants,I=function(w,x){var{cy:W,eles:S}=w,B=S.nodes(),tt=S.edges(),Q=void 0,ft=void 0,Y=void 0,et={};if(w.randomize)Q=x.nodeIndexes,ft=x.xCoords,Y=x.yCoords;var s=function(V){return typeof V==="function"},M=function(V,ht){if(s(V))return V(ht);else return V},T=u.calcParentsWithoutChildren(W,S),A=function Z(V,ht,vt,k){var dt=ht.length;for(var at=0;at<dt;at++){var b=ht[at],_=null;if(b.intersection(T).length==0)_=b.children();var rt=void 0,gt=b.layoutDimensions({nodeDimensionsIncludeLabels:k.nodeDimensionsIncludeLabels});if(b.outerWidth()!=null&&b.outerHeight()!=null)if(k.randomize)if(!b.isParent())rt=V.add(new y(vt.graphManager,new i(ft[Q.get(b.id())]-gt.w/2,Y[Q.get(b.id())]-gt.h/2),new e(parseFloat(gt.w),parseFloat(gt.h))));else{var Lt=u.calcBoundingBox(b,ft,Y,Q);if(b.intersection(T).length==0)rt=V.add(new y(vt.graphManager,new i(Lt.topLeftX,Lt.topLeftY),new e(Lt.width,Lt.height)));else rt=V.add(new y(vt.graphManager,new i(Lt.topLeftX,Lt.topLeftY),new e(parseFloat(gt.w),parseFloat(gt.h))))}else rt=V.add(new y(vt.graphManager,new i(b.position("x")-gt.w/2,b.position("y")-gt.h/2),new e(parseFloat(gt.w),parseFloat(gt.h))));else rt=V.add(new y(this.graphManager));if(rt.id=b.data("id"),rt.nodeRepulsion=M(k.nodeRepulsion,b),rt.paddingLeft=parseInt(b.css("padding")),rt.paddingTop=parseInt(b.css("padding")),rt.paddingRight=parseInt(b.css("padding")),rt.paddingBottom=parseInt(b.css("padding")),k.nodeDimensionsIncludeLabels)rt.labelWidth=b.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,rt.labelHeight=b.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,rt.labelPosVertical=b.css("text-valign"),rt.labelPosHorizontal=b.css("text-halign");if(et[b.data("id")]=rt,isNaN(rt.rect.x))rt.rect.x=0;if(isNaN(rt.rect.y))rt.rect.y=0;if(_!=null&&_.length>0){var Gt=void 0;Gt=vt.getGraphManager().add(vt.newGraph(),rt),Z(Gt,_,vt,k)}}},m=function(V,ht,vt){var k=0,dt=0;for(var at=0;at<vt.length;at++){var b=vt[at],_=et[b.data("source")],rt=et[b.data("target")];if(_&&rt&&_!==rt&&_.getEdgesBetween(rt).length==0){var gt=ht.add(V.newEdge(),_,rt);gt.id=b.id(),gt.idealLength=M(w.idealEdgeLength,b),gt.edgeElasticity=M(w.edgeElasticity,b),k+=gt.idealLength,dt++}}if(w.idealEdgeLength!=null){if(dt>0)c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=k/dt;else if(!s(w.idealEdgeLength))c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=w.idealEdgeLength;else c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=50;c.MIN_REPULSION_DIST=d.MIN_REPULSION_DIST=d.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH}},H=function(V,ht){if(ht.fixedNodeConstraint)V.constraints.fixedNodeConstraint=ht.fixedNodeConstraint;if(ht.alignmentConstraint)V.constraints.alignmentConstraint=ht.alignmentConstraint;if(ht.relativePlacementConstraint)V.constraints.relativePlacementConstraint=ht.relativePlacementConstraint};if(w.nestingFactor!=null)c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor;if(w.gravity!=null)c.DEFAULT_GRAVITY_STRENGTH=d.DEFAULT_GRAVITY_STRENGTH=w.gravity;if(w.numIter!=null)c.MAX_ITERATIONS=d.MAX_ITERATIONS=w.numIter;if(w.gravityRange!=null)c.DEFAULT_GRAVITY_RANGE_FACTOR=d.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange;if(w.gravityCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound;if(w.gravityRangeCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound;if(w.initialEnergyOnIncremental!=null)c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental;if(w.tilingCompareBy!=null)c.TILING_COMPARE_BY=w.tilingCompareBy;if(w.quality=="proof")g.QUALITY=2;else g.QUALITY=0;if(c.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!w.randomize,c.ANIMATE=d.ANIMATE=g.ANIMATE=w.animate,c.TILE=w.tile,c.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical==="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal==="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!w.randomize,g.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1;if(w.step=="enforced")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1;if(w.step=="cose")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0;if(w.step=="all"){if(w.randomize)c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0}if(w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint)c.TREE_REDUCTION_ON_INCREMENTAL=!1;else c.TREE_REDUCTION_ON_INCREMENTAL=!0;var U=new r,q=U.newGraphManager();return A(q.addRoot(),u.getTopMostNodes(B),U,w),m(U,q,tt),H(U,w),U.runLayout(),et};o.exports={coseLayout:I}},212:(o,n,a)=>{var u=function(){function w(x,W){for(var S=0;S<W.length;S++){var B=W[S];if(B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B)B.writable=!0;Object.defineProperty(x,B.key,B)}}return function(x,W,S){if(W)w(x.prototype,W);if(S)w(x,S);return x}}();function r(w,x){if(!(w instanceof x))throw TypeError("Cannot call a class as a function")}var y=a(658),i=a(548),e=a(657),g=e.spectralLayout,d=a(816),c=d.coseLayout,I=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(x){return 4500},idealEdgeLength:function(x){return 50},edgeElasticity:function(x){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(){}}),N=function(){function w(x){r(this,w),this.options=y({},I,x)}return u(w,[{key:"run",value:function(){var W=this,S=this.options,{cy:B,eles:tt}=S,Q=[],ft=void 0,Y=void 0,et=[],s=void 0,M=[];if(S.fixedNodeConstraint&&(!Array.isArray(S.fixedNodeConstraint)||S.fixedNodeConstraint.length==0))S.fixedNodeConstraint=void 0;if(S.alignmentConstraint){if(S.alignmentConstraint.vertical&&(!Array.isArray(S.alignmentConstraint.vertical)||S.alignmentConstraint.vertical.length==0))S.alignmentConstraint.vertical=void 0;if(S.alignmentConstraint.horizontal&&(!Array.isArray(S.alignmentConstraint.horizontal)||S.alignmentConstraint.horizontal.length==0))S.alignmentConstraint.horizontal=void 0}if(S.relativePlacementConstraint&&(!Array.isArray(S.relativePlacementConstraint)||S.relativePlacementConstraint.length==0))S.relativePlacementConstraint=void 0;var T=S.fixedNodeConstraint||S.alignmentConstraint||S.relativePlacementConstraint;if(T)S.tile=!1,S.packComponents=!1;var A=void 0,m=!1;if(B.layoutUtilities&&S.packComponents){if(A=B.layoutUtilities("get"),!A)A=B.layoutUtilities();m=!0}if(tt.nodes().length>0)if(!m){var H=S.eles.boundingBox();if(M.push({x:H.x1+H.w/2,y:H.y1+H.h/2}),S.randomize){var U=g(S);Q.push(U)}if(S.quality=="default"||S.quality=="proof")et.push(c(S,Q[0])),i.relocateComponent(M[0],et[0],S);else i.relocateComponent(M[0],Q[0],S)}else{var q=i.getTopMostNodes(S.eles.nodes());if(s=i.connectComponents(B,S.eles,q),s.forEach(function(Tt){var pt=Tt.boundingBox();M.push({x:pt.x1+pt.w/2,y:pt.y1+pt.h/2})}),S.randomize)s.forEach(function(Tt){S.eles=Tt,Q.push(g(S))});if(S.quality=="default"||S.quality=="proof"){var Z=B.collection();if(S.tile){var V=new Map,ht=[],vt=[],k=0,dt={nodeIndexes:V,xCoords:ht,yCoords:vt},at=[];if(s.forEach(function(Tt,pt){if(Tt.edges().length==0)Tt.nodes().forEach(function(It,St){if(Z.merge(Tt.nodes()[St]),!It.isParent())dt.nodeIndexes.set(Tt.nodes()[St].id(),k++),dt.xCoords.push(Tt.nodes()[0].position().x),dt.yCoords.push(Tt.nodes()[0].position().y)}),at.push(pt)}),Z.length>1){var b=Z.boundingBox();M.push({x:b.x1+b.w/2,y:b.y1+b.h/2}),s.push(Z),Q.push(dt);for(var _=at.length-1;_>=0;_--)s.splice(at[_],1),Q.splice(at[_],1),M.splice(at[_],1)}}s.forEach(function(Tt,pt){S.eles=Tt,et.push(c(S,Q[pt])),i.relocateComponent(M[pt],et[pt],S)})}else s.forEach(function(Tt,pt){i.relocateComponent(M[pt],Q[pt],S)});var rt=new Set;if(s.length>1){var gt=[],Lt=tt.filter(function(Tt){return Tt.css("display")=="none"});s.forEach(function(Tt,pt){var It=void 0;if(S.quality=="draft")It=Q[pt].nodeIndexes;if(Tt.nodes().not(Lt).length>0){var St={};St.edges=[],St.nodes=[];var Ut=void 0;if(Tt.nodes().not(Lt).forEach(function(Ft){if(S.quality=="draft")if(!Ft.isParent())Ut=It.get(Ft.id()),St.nodes.push({x:Q[pt].xCoords[Ut]-Ft.boundingbox().w/2,y:Q[pt].yCoords[Ut]-Ft.boundingbox().h/2,width:Ft.boundingbox().w,height:Ft.boundingbox().h});else{var bt=i.calcBoundingBox(Ft,Q[pt].xCoords,Q[pt].yCoords,It);St.nodes.push({x:bt.topLeftX,y:bt.topLeftY,width:bt.width,height:bt.height})}else if(et[pt][Ft.id()])St.nodes.push({x:et[pt][Ft.id()].getLeft(),y:et[pt][Ft.id()].getTop(),width:et[pt][Ft.id()].getWidth(),height:et[pt][Ft.id()].getHeight()})}),Tt.edges().forEach(function(Ft){var bt=Ft.source(),Wt=Ft.target();if(bt.css("display")!="none"&&Wt.css("display")!="none"){if(S.quality=="draft"){var $t=It.get(bt.id()),re=It.get(Wt.id()),Jt=[],_t=[];if(bt.isParent()){var Qt=i.calcBoundingBox(bt,Q[pt].xCoords,Q[pt].yCoords,It);Jt.push(Qt.topLeftX+Qt.width/2),Jt.push(Qt.topLeftY+Qt.height/2)}else Jt.push(Q[pt].xCoords[$t]),Jt.push(Q[pt].yCoords[$t]);if(Wt.isParent()){var J=i.calcBoundingBox(Wt,Q[pt].xCoords,Q[pt].yCoords,It);_t.push(J.topLeftX+J.width/2),_t.push(J.topLeftY+J.height/2)}else _t.push(Q[pt].xCoords[re]),_t.push(Q[pt].yCoords[re]);St.edges.push({startX:Jt[0],startY:Jt[1],endX:_t[0],endY:_t[1]})}else if(et[pt][bt.id()]&&et[pt][Wt.id()])St.edges.push({startX:et[pt][bt.id()].getCenterX(),startY:et[pt][bt.id()].getCenterY(),endX:et[pt][Wt.id()].getCenterX(),endY:et[pt][Wt.id()].getCenterY()})}}),St.nodes.length>0)gt.push(St),rt.add(pt)}});var Gt=A.packComponents(gt,S.randomize).shifts;if(S.quality=="draft")Q.forEach(function(Tt,pt){var It=Tt.xCoords.map(function(Ut){return Ut+Gt[pt].dx}),St=Tt.yCoords.map(function(Ut){return Ut+Gt[pt].dy});Tt.xCoords=It,Tt.yCoords=St});else{var kt=0;rt.forEach(function(Tt){Object.keys(et[Tt]).forEach(function(pt){var It=et[Tt][pt];It.setCenter(It.getCenterX()+Gt[kt].dx,It.getCenterY()+Gt[kt].dy)}),kt++})}}}var ct=function(pt,It){if(S.quality=="default"||S.quality=="proof"){if(typeof pt==="number")pt=It;var St=void 0,Ut=void 0,Ft=pt.data("id");if(et.forEach(function(Wt){if(Ft in Wt)St={x:Wt[Ft].getRect().getCenterX(),y:Wt[Ft].getRect().getCenterY()},Ut=Wt[Ft]}),S.nodeDimensionsIncludeLabels){if(Ut.labelWidth){if(Ut.labelPosHorizontal=="left")St.x+=Ut.labelWidth/2;else if(Ut.labelPosHorizontal=="right")St.x-=Ut.labelWidth/2}if(Ut.labelHeight){if(Ut.labelPosVertical=="top")St.y+=Ut.labelHeight/2;else if(Ut.labelPosVertical=="bottom")St.y-=Ut.labelHeight/2}}if(St==null)St={x:pt.position("x"),y:pt.position("y")};return{x:St.x,y:St.y}}else{var bt=void 0;if(Q.forEach(function(Wt){var $t=Wt.nodeIndexes.get(pt.id());if($t!=null)bt={x:Wt.xCoords[$t],y:Wt.yCoords[$t]}}),bt==null)bt={x:pt.position("x"),y:pt.position("y")};return{x:bt.x,y:bt.y}}};if(S.quality=="default"||S.quality=="proof"||S.randomize){var jt=i.calcParentsWithoutChildren(B,tt),Ht=tt.filter(function(Tt){return Tt.css("display")=="none"});if(S.eles=tt.not(Ht),tt.nodes().not(":parent").not(Ht).layoutPositions(W,S,ct),jt.length>0)jt.forEach(function(Tt){Tt.position(ct(Tt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w}();o.exports=N},657:(o,n,a)=>{var u=a(548),r=a(140).layoutBase.Matrix,y=a(140).layoutBase.SVD,i=function(g){var{cy:d,eles:c}=g,I=c.nodes(),N=c.nodes(":parent"),w=new Map,x=new Map,W=new Map,S=[],B=[],tt=[],Q=[],ft=[],Y=[],et=[],s=[],M=void 0,T=void 0,A=1e8,m=0.000000001,{piTol:H,samplingType:U,nodeSeparation:q}=g,Z=void 0,V=function(){var nt=0,ot=0,st=!1;while(ot<Z){nt=Math.floor(Math.random()*T),st=!1;for(var ut=0;ut<ot;ut++)if(Q[ut]==nt){st=!0;break}if(!st)Q[ot]=nt,ot++;else continue}},ht=function(nt,ot,st){var ut=[],Dt=0,Ct=0,lt=0,wt=void 0,At=[],yt=0,xt=1;for(var Yt=0;Yt<T;Yt++)At[Yt]=A;ut[Ct]=nt,At[nt]=0;while(Ct>=Dt){lt=ut[Dt++];var Nt=S[lt];for(var mt=0;mt<Nt.length;mt++)if(wt=x.get(Nt[mt]),At[wt]==A)At[wt]=At[lt]+1,ut[++Ct]=wt;Y[lt][ot]=At[lt]*q}if(st){for(var Ot=0;Ot<T;Ot++)if(Y[Ot][ot]<ft[Ot])ft[Ot]=Y[Ot][ot];for(var Et=0;Et<T;Et++)if(ft[Et]>yt)yt=ft[Et],xt=Et}return xt},vt=function(nt){var ot=void 0;if(!nt){V();for(var st=0;st<Z;st++)ht(Q[st],st,nt,!1)}else{ot=Math.floor(Math.random()*T),M=ot;for(var ut=0;ut<T;ut++)ft[ut]=A;for(var Dt=0;Dt<Z;Dt++)Q[Dt]=ot,ot=ht(ot,Dt,nt)}for(var Ct=0;Ct<T;Ct++)for(var lt=0;lt<Z;lt++)Y[Ct][lt]*=Y[Ct][lt];for(var wt=0;wt<Z;wt++)et[wt]=[];for(var At=0;At<Z;At++)for(var yt=0;yt<Z;yt++)et[At][yt]=Y[Q[yt]][At]},k=function(){var nt=y.svd(et),{S:ot,U:st,V:ut}=nt,Dt=ot[0]*ot[0]*ot[0],Ct=[];for(var lt=0;lt<Z;lt++){Ct[lt]=[];for(var wt=0;wt<Z;wt++)if(Ct[lt][wt]=0,lt==wt)Ct[lt][wt]=ot[lt]/(ot[lt]*ot[lt]+Dt/(ot[lt]*ot[lt]))}s=r.multMat(r.multMat(ut,Ct),r.transpose(st))},dt=function(){var nt=void 0,ot=void 0,st=[],ut=[],Dt=[],Ct=[];for(var lt=0;lt<T;lt++)st[lt]=Math.random(),ut[lt]=Math.random();st=r.normalize(st),ut=r.normalize(ut);var wt=0,At=m,yt=m,xt=void 0;while(!0){wt++;for(var Yt=0;Yt<T;Yt++)Dt[Yt]=st[Yt];if(st=r.multGamma(r.multL(r.multGamma(Dt),Y,s)),nt=r.dotProduct(Dt,st),st=r.normalize(st),At=r.dotProduct(Dt,st),xt=Math.abs(At/yt),xt<=1+H&&xt>=1)break;yt=At}for(var Nt=0;Nt<T;Nt++)Dt[Nt]=st[Nt];wt=0,yt=m;while(!0){wt++;for(var mt=0;mt<T;mt++)Ct[mt]=ut[mt];if(Ct=r.minusOp(Ct,r.multCons(Dt,r.dotProduct(Dt,Ct))),ut=r.multGamma(r.multL(r.multGamma(Ct),Y,s)),ot=r.dotProduct(Ct,ut),ut=r.normalize(ut),At=r.dotProduct(Ct,ut),xt=Math.abs(At/yt),xt<=1+H&&xt>=1)break;yt=At}for(var Ot=0;Ot<T;Ot++)Ct[Ot]=ut[Ot];B=r.multCons(Dt,Math.sqrt(Math.abs(nt))),tt=r.multCons(Ct,Math.sqrt(Math.abs(ot)))};u.connectComponents(d,c,u.getTopMostNodes(I),w),N.forEach(function(it){u.connectComponents(d,c,u.getTopMostNodes(it.descendants().intersection(c)),w)});var at=0;for(var b=0;b<I.length;b++)if(!I[b].isParent())x.set(I[b].id(),at++);var _=!0,rt=!1,gt=void 0;try{for(var Lt=w.keys()[Symbol.iterator](),Gt;!(_=(Gt=Lt.next()).done);_=!0){var kt=Gt.value;x.set(kt,at++)}}catch(it){rt=!0,gt=it}finally{try{if(!_&&Lt.return)Lt.return()}finally{if(rt)throw gt}}for(var ct=0;ct<x.size;ct++)S[ct]=[];N.forEach(function(it){var nt=it.children().intersection(c);while(nt.nodes(":childless").length==0)nt=nt.nodes()[0].children().intersection(c);var ot=0,st=nt.nodes(":childless")[0].connectedEdges().length;nt.nodes(":childless").forEach(function(ut,Dt){if(ut.connectedEdges().length<st)st=ut.connectedEdges().length,ot=Dt}),W.set(it.id(),nt.nodes(":childless")[ot].id())}),I.forEach(function(it){var nt=void 0;if(it.isParent())nt=x.get(W.get(it.id()));else nt=x.get(it.id());it.neighborhood().nodes().forEach(function(ot){if(c.intersection(it.edgesWith(ot)).length>0)if(ot.isParent())S[nt].push(W.get(ot.id()));else S[nt].push(ot.id())})});var jt=function(nt){var ot=x.get(nt),st=void 0;w.get(nt).forEach(function(ut){if(d.getElementById(ut).isParent())st=W.get(ut);else st=ut;S[ot].push(st),S[x.get(st)].push(nt)})},Ht=!0,Tt=!1,pt=void 0;try{for(var It=w.keys()[Symbol.iterator](),St;!(Ht=(St=It.next()).done);Ht=!0){var Ut=St.value;jt(Ut)}}catch(it){Tt=!0,pt=it}finally{try{if(!Ht&&It.return)It.return()}finally{if(Tt)throw pt}}T=x.size;var Ft=void 0;if(T>2){Z=T<g.sampleSize?T:g.sampleSize;for(var bt=0;bt<T;bt++)Y[bt]=[];for(var Wt=0;Wt<Z;Wt++)s[Wt]=[];if(g.quality=="draft"||g.step=="all")vt(U),k(),dt(),Ft={nodeIndexes:x,xCoords:B,yCoords:tt};else x.forEach(function(it,nt){B.push(d.getElementById(nt).position("x")),tt.push(d.getElementById(nt).position("y"))}),Ft={nodeIndexes:x,xCoords:B,yCoords:tt};return Ft}else{var $t=x.keys(),re=d.getElementById($t.next().value),Jt=re.position(),_t=re.outerWidth();if(B.push(Jt.x),tt.push(Jt.y),T==2){var Qt=d.getElementById($t.next().value),J=Qt.outerWidth();B.push(Jt.x+_t/2+J/2+g.idealEdgeLength),tt.push(Jt.y)}return Ft={nodeIndexes:x,xCoords:B,yCoords:tt},Ft}};o.exports={spectralLayout:i}},579:(o,n,a)=>{var u=a(212),r=function(i){if(!i)return;i("layout","fcose",u)};if(typeof cytoscape<"u")r(cytoscape);o.exports=r},140:(o)=>{o.exports=C}},D={};function v(o){var n=D[o];if(n!==void 0)return n.exports;var a=D[o]={exports:{}};return F[o](a,a.exports,v),a.exports}var f=v(579);return f})()})});var _e=an(Be(),1);var Ze={L:"left",R:"right",T:"top",B:"bottom"},ke={L:t((C)=>`${C},${C/2} 0,${C} 0,0`,"L"),R:t((C)=>`0,${C/2} ${C},0 ${C},${C}`,"R"),T:t((C)=>`0,0 ${C},0 ${C/2},${C}`,"T"),B:t((C)=>`${C/2},0 ${C},${C} 0,${C}`,"B")},Ce={L:t((C,F)=>C-F+2,"L"),R:t((C,F)=>C-2,"R"),T:t((C,F)=>C-F+2,"T"),B:t((C,F)=>C-2,"B")},fr=t(function(C){if(ee(C))return C==="L"?"R":"L";else return C==="T"?"B":"T"},"getOppositeArchitectureDirection"),qe=t(function(C){let F=C;return F==="L"||F==="R"||F==="T"||F==="B"},"isArchitectureDirection"),ee=t(function(C){let F=C;return F==="L"||F==="R"},"isArchitectureDirectionX"),le=t(function(C){let F=C;return F==="T"||F==="B"},"isArchitectureDirectionY"),Xe=t(function(C,F){let D=ee(C)&&le(F),v=le(C)&&ee(F);return D||v},"isArchitectureDirectionXY"),cr=t(function(C){let F=C[0],D=C[1],v=ee(F)&&le(D),f=le(F)&&ee(D);return v||f},"isArchitecturePairXY"),gr=t(function(C){return C!=="LL"&&C!=="RR"&&C!=="TT"&&C!=="BB"},"isValidArchitectureDirectionPair"),Ue=t(function(C,F){let D=`${C}${F}`;return gr(D)?D:void 0},"getArchitectureDirectionPair"),ur=t(function([C,F],D){let v=D[0],f=D[1];if(ee(v))if(le(f))return[C+(v==="L"?-1:1),F+(f==="T"?1:-1)];else return[C+(v==="L"?-1:1),F];else if(ee(f))return[C+(f==="L"?1:-1),F+(v==="T"?1:-1)];else return[C,F+(v==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),dr=t(function(C){if(C==="LT"||C==="TL")return[1,1];else if(C==="BL"||C==="LB")return[1,-1];else if(C==="BR"||C==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),vr=t(function(C,F){if(Xe(C,F))return"bend";else if(ee(C))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),pr=t(function(C){return C.type==="service"},"isArchitectureService"),yr=t(function(C){return C.type==="junction"},"isArchitectureJunction"),Qe=t((C,F)=>{let[D,v]=[C,F].sort();return`${JSON.stringify(D)}-${JSON.stringify(v)}`},"architectureGroupAlignmentKey"),Je=t((C)=>C.data(),"edgeData"),me=t((C)=>C.data(),"nodeData"),mr=K.architecture,Ke=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=L,this.getAccTitle=O,this.setDiagramTitle=j,this.getDiagramTitle=G,this.getAccDescription=z,this.setAccDescription=P,this.clear()}static{t(this,"ArchitectureDB")}setDiagramId(C){this.diagramId=C}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="",R()}addService({id:C,icon:F,in:D,title:v,iconText:f}){if(this.registeredIds.has(C))throw Error(`The service id [${C}] is already in use by another ${this.registeredIds.get(C)}`);if(D!==void 0){if(C===D)throw Error(`The service [${C}] cannot be placed within itself`);if(!this.registeredIds.has(D))throw Error(`The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(D)==="node")throw Error(`The service [${C}]'s parent is not a group`)}this.registeredIds.set(C,"node"),this.nodes.set(C,{id:C,type:"service",icon:F,iconText:f,title:v,edges:[],in:D})}getServices(){return[...this.nodes.values()].filter(pr)}addJunction({id:C,in:F}){if(this.registeredIds.has(C))throw Error(`The junction id [${C}] is already in use by another ${this.registeredIds.get(C)}`);if(F!==void 0){if(C===F)throw Error(`The junction [${C}] cannot be placed within itself`);if(!this.registeredIds.has(F))throw Error(`The junction [${C}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(F)==="node")throw Error(`The junction [${C}]'s parent is not a group`)}this.registeredIds.set(C,"node"),this.nodes.set(C,{id:C,type:"junction",edges:[],in:F})}getJunctions(){return[...this.nodes.values()].filter(yr)}getNodes(){return[...this.nodes.values()]}getNode(C){return this.nodes.get(C)??null}addGroup({id:C,icon:F,in:D,title:v}){if(this.registeredIds.has(C))throw Error(`The group id [${C}] is already in use by another ${this.registeredIds.get(C)}`);if(D!==void 0){if(C===D)throw Error(`The group [${C}] cannot be placed within itself`);if(!this.registeredIds.has(D))throw Error(`The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(D)==="node")throw Error(`The group [${C}]'s parent is not a group`)}this.registeredIds.set(C,"group"),this.groups.set(C,{id:C,icon:F,title:v,in:D})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:C,rhsId:F,lhsDir:D,rhsDir:v,lhsInto:f,rhsInto:o,lhsGroup:n,rhsGroup:a,title:u}){if(!qe(D))throw Error(`Invalid direction given for left hand side of edge ${C}--${F}. Expected (L,R,T,B) got ${String(D)}`);if(!qe(v))throw Error(`Invalid direction given for right hand side of edge ${C}--${F}. Expected (L,R,T,B) got ${String(v)}`);if(!this.nodes.has(C)&&!this.groups.has(C))throw Error(`The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(F)&&!this.groups.has(F))throw Error(`The right-hand id [${F}] does not yet exist. Please create the service/group before declaring an edge to it.`);let r=this.nodes.get(C).in,y=this.nodes.get(F).in;if(n&&r&&y&&r==y)throw Error(`The left-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&r&&y&&r==y)throw Error(`The right-hand id [${F}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:C,lhsDir:D,lhsInto:f,lhsGroup:n,rhsId:F,rhsDir:v,rhsInto:o,rhsGroup:a,title:u};this.edges.push(i);let e=this.nodes.get(C),g=this.nodes.get(F);if(e&&g)e.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(C){if(C.members.length<2)throw Error(`An align directive requires at least two members; got ${C.members.length}`);let F=new Set;C.members.forEach((D)=>{if(this.registeredIds.get(D)!=="node")throw Error(`align ${C.direction} references [${D}], which is not a service or junction`);if(F.has(D))throw Error(`align ${C.direction} lists [${D}] more than once`);F.add(D)}),this.layoutHints.push(C)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let C=new Map,F=new Map;for(let[n,a]of this.nodes.entries()){let u=new Map;for(let r of a.edges){let y=this.getNode(r.lhsId)?.in,i=this.getNode(r.rhsId)?.in;if(y&&i&&y!==i){let e=vr(r.lhsDir,r.rhsDir);if(e!=="bend")C.set(Qe(y,i),e)}if(r.lhsId===n){let e=Ue(r.lhsDir,r.rhsDir);if(e)u.set(e,r.rhsId)}else{let e=Ue(r.rhsDir,r.lhsDir);if(e)u.set(e,r.lhsId)}}F.set(n,u)}let D=new Set,v=new Set(F.keys()),f=t((n)=>{let a=new Map([[n,[0,0]]]),u=[n];while(u.length>0){let r=u.shift();if(r){D.add(r),v.delete(r);let y=F.get(r);if(!y)throw Error(`BFS error: adjacency list for id ${r} not found. Please report this as a bug.`);let i=a.get(r);if(!i)throw Error(`BFS error: position for id ${r} not found in spatial map. Please report this as a bug.`);let[e,g]=i;y.forEach((d,c)=>{if(!D.has(d))a.set(d,ur([e,g],c)),u.push(d)})}}return a},"BFS"),o=[];while(v.size>0){let n=v.values().next().value;o.push(f(n))}this.dataStructures={adjList:F,spatialMaps:o,groupAlignments:C}}return this.dataStructures}setElementForId(C,F){this.elements.set(C,F)}getElementById(C){return this.elements.get(C)}getConfig(){return ie({...mr,...E().architecture})}getConfigField(C){return this.getConfig()[C]}},Er=t((C,F)=>{be(C,F),C.groups.map((D)=>F.addGroup(D)),C.services.map((D)=>F.addService({...D,type:"service"})),C.junctions.map((D)=>F.addJunction({...D,type:"junction"})),C.edges.map((D)=>F.addEdge(D)),C.alignments?.map((D)=>F.addLayoutHint({direction:D.direction,members:[...D.members]}))},"populateDb"),je={parser:{yy:void 0},parse:t(async(C)=>{let F=await Te("architecture",C);l.debug(F);let D=je.parser?.yy;if(!(D instanceof Ke))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.");Er(F,D)},"parse")},Tr=t((C)=>`
2
2
  .edge {
3
3
  stroke-width: ${C.archEdgeWidth};
4
4
  stroke: ${C.archEdgeColor};
@@ -29,8 +29,8 @@ import{be}from"./index-123e8tqq.js";import{t,l,K,E,X,Nr,R,M,O,P,z,j,G,p,h,ue,hf,
29
29
  display: -webkit-box;
30
30
  -webkit-box-orient: vertical;
31
31
  }
32
- `,"getStyles"),Lr=Tr;function Ye(C,F){if(C===0)return F();let D=Math.random,v=C>>>0;Math.random=function(){v=v+1831565813>>>0;let f=v;return f=Math.imul(f^f>>>15,f|1),f^=f+Math.imul(f^f>>>7,f|61),((f^f>>>14)>>>0)/4294967296};try{return F()}finally{Math.random=D}}t(Ye,"withSeededRandom");var ye=t((C)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${C}</g>`,"wrapIcon"),we={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:ye('<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:ye('<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:ye('<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:ye('<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:ye('<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:hf,blank:{body:ye("")}}},wr=t(async function(C,F,D,v){let f=D.getConfigField("padding"),o=D.getConfigField("iconSize"),n=o/2,a=o/6,u=a/2;await Promise.all(F.edges().map(async(r)=>{let{source:y,sourceDir:i,sourceArrow:e,sourceGroup:g,target:d,targetDir:c,targetArrow:I,targetGroup:N,label:L}=Je(r),{x,y:W}=r[0].sourceEndpoint(),{x:S,y:B}=r[0].midpoint(),{x:tt,y:Q}=r[0].targetEndpoint(),ft=f+4;if(g)if(ee(i))x+=i==="L"?-ft:ft;else W+=i==="T"?-ft:ft+18;if(N)if(ee(c))tt+=c==="L"?-ft:ft;else Q+=c==="T"?-ft:ft+18;if(!g&&D.getNode(y)?.type==="junction")if(ee(i))x+=i==="L"?n:-n;else W+=i==="T"?n:-n;if(!N&&D.getNode(d)?.type==="junction")if(ee(c))tt+=c==="L"?n:-n;else Q+=c==="T"?n:-n;if(r[0]._private.rscratch){let Y=C.insert("g");if(Y.insert("path").attr("d",`M ${x},${W} L ${S},${B} L${tt},${Q} `).attr("class","edge").attr("id",`${v}-${fn(y,d,{prefix:"L"})}`),e){let et=ee(i)?Ce[i](x,a):x-u,s=le(i)?Ce[i](W,a):W-u;Y.insert("polygon").attr("points",ke[i](a)).attr("transform",`translate(${et},${s})`).attr("class","arrow")}if(I){let et=ee(c)?Ce[c](tt,a):tt-u,s=le(c)?Ce[c](Q,a):Q-u;Y.insert("polygon").attr("points",ke[c](a)).attr("transform",`translate(${et},${s})`).attr("class","arrow")}if(L){let et=!Xe(i,c)?ee(i)?"X":"Y":"XY",s=0;if(et==="X")s=Math.abs(x-tt);else if(et==="Y")s=Math.abs(W-Q)/1.5;else s=Math.abs(x-tt)/2;let w=Y.append("g");if(await Jt(w,L,{useHtmlLabels:!1,width:s,classes:"architecture-service-label"},p()),w.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),et==="X")w.attr("transform","translate("+S+", "+B+")");else if(et==="Y")w.attr("transform","translate("+S+", "+B+") rotate(-90)");else if(et==="XY"){let T=Ue(i,c);if(T&&cr(T)){let A=w.node().getBoundingClientRect(),[m,H]=dr(T);w.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*m*H*45})`);let U=w.node().getBoundingClientRect();w.attr("transform",`
32
+ `,"getStyles"),Nr=Tr;function Ye(C,F){if(C===0)return F();let D=Math.random,v=C>>>0;Math.random=function(){v=v+1831565813>>>0;let f=v;return f=Math.imul(f^f>>>15,f|1),f^=f+Math.imul(f^f>>>7,f|61),((f^f>>>14)>>>0)/4294967296};try{return F()}finally{Math.random=D}}t(Ye,"withSeededRandom");var ye=t((C)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${C}</g>`,"wrapIcon"),we={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:ye('<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:ye('<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:ye('<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:ye('<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:ye('<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:vf,blank:{body:ye("")}}},Lr=t(async function(C,F,D,v){let f=D.getConfigField("padding"),o=D.getConfigField("iconSize"),n=o/2,a=o/6,u=a/2;await Promise.all(F.edges().map(async(r)=>{let{source:y,sourceDir:i,sourceArrow:e,sourceGroup:g,target:d,targetDir:c,targetArrow:I,targetGroup:N,label:w}=Je(r),{x,y:W}=r[0].sourceEndpoint(),{x:S,y:B}=r[0].midpoint(),{x:tt,y:Q}=r[0].targetEndpoint(),ft=f+4;if(g)if(ee(i))x+=i==="L"?-ft:ft;else W+=i==="T"?-ft:ft+18;if(N)if(ee(c))tt+=c==="L"?-ft:ft;else Q+=c==="T"?-ft:ft+18;if(!g&&D.getNode(y)?.type==="junction")if(ee(i))x+=i==="L"?n:-n;else W+=i==="T"?n:-n;if(!N&&D.getNode(d)?.type==="junction")if(ee(c))tt+=c==="L"?n:-n;else Q+=c==="T"?n:-n;if(r[0]._private.rscratch){let Y=C.insert("g");if(Y.insert("path").attr("d",`M ${x},${W} L ${S},${B} L${tt},${Q} `).attr("class","edge").attr("id",`${v}-${An(y,d,{prefix:"L"})}`),e){let et=ee(i)?Ce[i](x,a):x-u,s=le(i)?Ce[i](W,a):W-u;Y.insert("polygon").attr("points",ke[i](a)).attr("transform",`translate(${et},${s})`).attr("class","arrow")}if(I){let et=ee(c)?Ce[c](tt,a):tt-u,s=le(c)?Ce[c](Q,a):Q-u;Y.insert("polygon").attr("points",ke[c](a)).attr("transform",`translate(${et},${s})`).attr("class","arrow")}if(w){let et=!Xe(i,c)?ee(i)?"X":"Y":"XY",s=0;if(et==="X")s=Math.abs(x-tt);else if(et==="Y")s=Math.abs(W-Q)/1.5;else s=Math.abs(x-tt)/2;let M=Y.append("g");if(await Zt(M,w,{useHtmlLabels:!1,width:s,classes:"architecture-service-label"},p()),M.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),et==="X")M.attr("transform","translate("+S+", "+B+")");else if(et==="Y")M.attr("transform","translate("+S+", "+B+") rotate(-90)");else if(et==="XY"){let T=Ue(i,c);if(T&&cr(T)){let A=M.node().getBoundingClientRect(),[m,H]=dr(T);M.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*m*H*45})`);let U=M.node().getBoundingClientRect();M.attr("transform",`
33
33
  translate(${S}, ${B-A.height/2})
34
34
  translate(${m*U.width/2}, ${H*U.height/2})
35
35
  rotate(${-1*m*H*45}, 0, ${A.height/2})
36
- `)}}}}}))},"drawEdges"),Mr=t(async function(C,F,D,v){let o=D.getConfigField("padding")*0.75,n=D.getConfigField("fontSize"),u=D.getConfigField("iconSize")/2;await Promise.all(F.nodes().map(async(r)=>{let y=me(r);if(y.type==="group"){let{h:i,w:e,x1:g,y1:d}=r.boundingBox(),c=C.append("rect");c.attr("id",`${v}-group-${y.id}`).attr("x",g+u).attr("y",d+u).attr("width",e).attr("height",i).attr("class","node-bkg");let I=C.append("g"),N=g,L=d;if(y.icon){let x=I.append("g");x.html(`<g>${await rr(y.icon,{height:o,width:o,fallbackPrefix:we.prefix})}</g>`),x.attr("transform","translate("+(N+u+1)+", "+(L+u+1)+")"),N+=o,L+=n/2-1-2}if(y.label){let x=I.append("g");await Jt(x,y.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},p()),x.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),x.attr("transform","translate("+(N+u+4)+", "+(L+u+2)+")")}D.setElementForId(y.id,c)}}))},"drawGroups"),Cr=t(async function(C,F,D,v){let f=p();for(let o of D){let n=F.append("g"),a=C.getConfigField("iconSize");if(o.title){let i=n.append("g");await Jt(i,o.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},f),i.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),i.attr("transform","translate("+a/2+", "+a+")")}let u=n.append("g");if(o.icon)u.html(`<g>${await rr(o.icon,{height:a,width:a,fallbackPrefix:we.prefix})}</g>`);else if(o.iconText){u.html(`<g>${await rr("blank",{height:a,width:a,fallbackPrefix:we.prefix})}</g>`);let g=u.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(X(o.iconText,f)),d=parseInt(window.getComputedStyle(g.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;g.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/d)};`)}else u.append("path").attr("class","node-bkg").attr("id",`${v}-node-${o.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);n.attr("id",`${v}-service-${o.id}`).attr("class","architecture-service");let{width:r,height:y}=n.node().getBBox();o.width=r,o.height=y,C.setElementForId(o.id,n)}return 0},"drawServices"),Ar=t(function(C,F,D,v){D.forEach((f)=>{let o=F.append("g"),n=C.getConfigField("iconSize");o.append("g").append("rect").attr("id",`${v}-node-${f.id}`).attr("fill-opacity","0").attr("width",n).attr("height",n),o.attr("class","architecture-junction");let{width:u,height:r}=o._groups[0][0].getBBox();o.width=u,o.height=r,C.setElementForId(f.id,o)})},"drawJunctions");_o([{name:we.prefix,icons:we}]);Dr.use(_e.default);function tr(C,F,D){C.forEach((v)=>{F.add({group:"nodes",data:{type:"service",id:v.id,icon:v.icon,label:v.title,parent:v.in,width:D.getConfigField("iconSize"),height:D.getConfigField("iconSize")},classes:"node-service"})})}t(tr,"addServices");function er(C,F,D){C.forEach((v)=>{F.add({group:"nodes",data:{type:"junction",id:v.id,parent:v.in,width:D.getConfigField("iconSize"),height:D.getConfigField("iconSize")},classes:"node-junction"})})}t(er,"addJunctions");function ir(C,F){F.nodes().map((D)=>{let v=me(D);if(v.type==="group")return;v.x=D.position().x,v.y=D.position().y,C.getElementById(v.id).attr("transform","translate("+(v.x||0)+","+(v.y||0)+")")})}t(ir,"positionNodes");function nr(C,F){C.forEach((D)=>{F.add({group:"nodes",data:{type:"group",id:D.id,icon:D.icon,label:D.title,parent:D.in},classes:"node-group"})})}t(nr,"addGroups");function ar(C,F){C.forEach((D)=>{let{lhsId:v,rhsId:f,lhsInto:o,lhsGroup:n,rhsInto:a,lhsDir:u,rhsDir:r,rhsGroup:y,title:i}=D,e=Xe(D.lhsDir,D.rhsDir)?"segments":"straight",g={id:`${v}-${f}`,label:i,source:v,sourceDir:u,sourceArrow:o,sourceGroup:n,sourceEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%",target:f,targetDir:r,targetArrow:a,targetGroup:y,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};F.add({group:"edges",data:g,classes:e})})}t(ar,"addEdges");function or(C,F,D,v=[]){let f=t((e,g)=>{let d=new Map;for(let[c,I]of e.entries()){let N=`${c}`,L=0,x=[...I.entries()];if(x.length===1){d.set(N,x[0][1]);continue}for(let W=0;W<x.length-1;W++)for(let S=W+1;S<x.length;S++){let[B,tt]=x[W],[Q,ft]=x[S];if(D.get(Qe(B,Q))===g)d.set(N,[...d.get(N)??[],...tt,...ft]);else if(B==="default"||Q==="default")d.set(N,[...d.get(N)??[],...tt,...ft]);else{let et=`${N}-${L++}`;d.set(et,tt);let s=`${N}-${L++}`;d.set(s,ft)}}}return d},"flattenAlignments"),o=F.map((e)=>{let g=new Map,d=new Map;return e.forEach(([c,I],N)=>{let L=C.getNode(N)?.in??"default",x=g.get(I)??new Map;if(!g.has(I))g.set(I,x);let W=d.get(c)??new Map;if(!d.has(c))d.set(c,W);for(let S of[x,W]){let B=S.get(L)??[];if(!S.has(L))S.set(L,B);B.push(N)}}),{horiz:[...f(g,"horizontal").values()].filter((c)=>c.length>1),vert:[...f(d,"vertical").values()].filter((c)=>c.length>1)}}),[n,a]=o.reduce(([e,g],{horiz:d,vert:c})=>[[...e,...d],[...g,...c]],[[],[]]),u=new Set;v.forEach((e)=>e.members.forEach((g)=>u.add(g)));let r=t((e)=>e.filter((g)=>!g.some((d)=>u.has(d))),"dropOverlapping"),y=r(n),i=r(a);return v.forEach((e)=>{if(e.members.length<2)return;if(e.direction==="row")y.push([...e.members]);else i.push([...e.members])}),{horizontal:y,vertical:i}}t(or,"getAlignments");function sr(C,F,D=[]){let v=[],f=F.getConfigField("iconSize"),o=F.getConfigField("idealEdgeLengthMultiplier"),n=o*f,a=new Set;D.forEach((y)=>{for(let i=0;i<y.members.length-1;i++){let e=y.members[i],g=y.members[i+1];if(a.add(`${e}|${g}`),a.add(`${g}|${e}`),y.direction==="row")v.push({left:e,right:g,gap:n});else v.push({top:e,bottom:g,gap:n})}});let u=t((y)=>`${y[0]},${y[1]}`,"posToStr"),r=t((y)=>y.split(",").map((i)=>parseInt(i)),"strToPos");return C.forEach((y)=>{let i=new Map([...y.entries()].map(([c,I])=>[u(I),c])),e=[u([0,0])],g={},d={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(e.length>0){let c=e.shift();if(c){g[c]=1;let I=i.get(c);if(I){let N=r(c);Object.entries(d).forEach(([L,x])=>{let W=u([N[0]+x[0],N[1]+x[1]]),S=i.get(W);if(S&&!g[W]){if(e.push(W),a.has(`${I}|${S}`))return;v.push({[Ze[L]]:S,[Ze[fr(L)]]:I,gap:o*f})}})}}}}),v}t(sr,"getRelativeConstraints");function hr(C,F,D,v,f,{spatialMaps:o,groupAlignments:n}){return new Promise((a)=>{let u=h("body").append("div").attr("id","cy").attr("style","display:none"),r=Dr({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":`${f.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:`${f.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});u.remove(),nr(D,r),tr(C,r,f),er(F,r,f),ar(v,r);let y=f.getLayoutHints(),i=or(f,o,n,y),e=sr(o,f,y),g=f.getConfigField("iconSize"),d=f.getConfigField("idealEdgeLengthMultiplier")*g,c=0.5*g,I=f.getConfigField("edgeElasticity"),N=f.getConfigField("seed"),L=r.layout({name:"fcose",quality:"proof",randomize:f.getConfigField("randomize"),nodeSeparation:f.getConfigField("nodeSeparation"),numIter:f.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(x){let[W,S]=x.connectedNodes(),{parent:B}=me(W),{parent:tt}=me(S);return B===tt?d:c},edgeElasticity(x){let[W,S]=x.connectedNodes(),{parent:B}=me(W),{parent:tt}=me(S);return B===tt?I:0.001},alignmentConstraint:i,relativePlacementConstraint:e});L.one("layoutstop",()=>{function x(W,S,B,tt){let Q,ft,{x:Y,y:et}=W,{x:s,y:w}=S;ft=(tt-et+(Y-B)*(et-w)/(Y-s))/Math.sqrt(1+Math.pow((et-w)/(Y-s),2)),Q=Math.sqrt(Math.pow(tt-et,2)+Math.pow(B-Y,2)-Math.pow(ft,2));let T=Math.sqrt(Math.pow(s-Y,2)+Math.pow(w-et,2));Q=Q/T;let A=(s-Y)*(tt-et)-(w-et)*(B-Y);switch(!0){case A>=0:A=1;break;case A<0:A=-1;break}let m=(s-Y)*(B-Y)+(w-et)*(tt-et);switch(!0){case m>=0:m=1;break;case m<0:m=-1;break}return ft=Math.abs(ft)*A,Q=Q*m,{distances:ft,weights:Q}}t(x,"getSegmentWeights"),r.startBatch();for(let W of Object.values(r.edges()))if(W.data?.()){let{x:S,y:B}=W.source().position(),{x:tt,y:Q}=W.target().position();if(S!==tt&&B!==Q){let ft=W.sourceEndpoint(),Y=W.targetEndpoint(),{sourceDir:et}=Je(W),[s,w]=le(et)?[ft.x,Y.y]:[Y.x,ft.y],{weights:T,distances:A}=x(ft,Y,s,w);W.style("segment-distances",A),W.style("segment-weights",T)}}r.endBatch(),Ye(N,()=>L.run())});try{Ye(N,()=>L.run())}catch(x){if(x instanceof RangeError&&x.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 x}r.ready((x)=>{l.info("Ready",x),a(r)})})}t(hr,"layoutArchitecture");var Or=t(async(C,F,D,v)=>{let f=v.db;f.setDiagramId(F);let o=f.getServices(),n=f.getJunctions(),a=f.getGroups(),u=f.getEdges(),r=f.getDataStructures(),y=ue(F),i=y.append("g");i.attr("class","architecture-edges");let e=y.append("g");e.attr("class","architecture-services");let g=y.append("g");g.attr("class","architecture-groups"),await Cr(f,e,o,F),Ar(f,e,n,F);let d=await hr(o,n,a,u,f,r);await wr(i,d,f,F),await Mr(g,d,f,F),ir(f,d),Nr(void 0,y,f.getConfigField("padding"),f.getConfigField("useMaxWidth"))},"draw"),xr={draw:Or},Wr={parser:je,get db(){return new Ke},renderer:xr,styles:Lr};export{Wr as diagram};
36
+ `)}}}}}))},"drawEdges"),wr=t(async function(C,F,D,v){let o=D.getConfigField("padding")*0.75,n=D.getConfigField("fontSize"),u=D.getConfigField("iconSize")/2;await Promise.all(F.nodes().map(async(r)=>{let y=me(r);if(y.type==="group"){let{h:i,w:e,x1:g,y1:d}=r.boundingBox(),c=C.append("rect");c.attr("id",`${v}-group-${y.id}`).attr("x",g+u).attr("y",d+u).attr("width",e).attr("height",i).attr("class","node-bkg");let I=C.append("g"),N=g,w=d;if(y.icon){let x=I.append("g");x.html(`<g>${await ar(y.icon,{height:o,width:o,fallbackPrefix:we.prefix})}</g>`),x.attr("transform","translate("+(N+u+1)+", "+(w+u+1)+")"),N+=o,w+=n/2-1-2}if(y.label){let x=I.append("g");await Zt(x,y.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},p()),x.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),x.attr("transform","translate("+(N+u+4)+", "+(w+u+2)+")")}D.setElementForId(y.id,c)}}))},"drawGroups"),Mr=t(async function(C,F,D,v){let f=p();for(let o of D){let n=F.append("g"),a=C.getConfigField("iconSize");if(o.title){let i=n.append("g");await Zt(i,o.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},f),i.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),i.attr("transform","translate("+a/2+", "+a+")")}let u=n.append("g");if(o.icon)u.html(`<g>${await ar(o.icon,{height:a,width:a,fallbackPrefix:we.prefix})}</g>`);else if(o.iconText){u.html(`<g>${await ar("blank",{height:a,width:a,fallbackPrefix:we.prefix})}</g>`);let g=u.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(X(o.iconText,f)),d=parseInt(window.getComputedStyle(g.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;g.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/d)};`)}else u.append("path").attr("class","node-bkg").attr("id",`${v}-node-${o.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);n.attr("id",`${v}-service-${o.id}`).attr("class","architecture-service");let{width:r,height:y}=n.node().getBBox();o.width=r,o.height=y,C.setElementForId(o.id,n)}return 0},"drawServices"),Cr=t(function(C,F,D,v){D.forEach((f)=>{let o=F.append("g"),n=C.getConfigField("iconSize");o.append("g").append("rect").attr("id",`${v}-node-${f.id}`).attr("fill-opacity","0").attr("width",n).attr("height",n),o.attr("class","architecture-junction");let{width:u,height:r}=o._groups[0][0].getBBox();o.width=u,o.height=r,C.setElementForId(f.id,o)})},"drawJunctions");So([{name:we.prefix,icons:we}]);Qr.use(_e.default);function tr(C,F,D){C.forEach((v)=>{F.add({group:"nodes",data:{type:"service",id:v.id,icon:v.icon,label:v.title,parent:v.in,width:D.getConfigField("iconSize"),height:D.getConfigField("iconSize")},classes:"node-service"})})}t(tr,"addServices");function er(C,F,D){C.forEach((v)=>{F.add({group:"nodes",data:{type:"junction",id:v.id,parent:v.in,width:D.getConfigField("iconSize"),height:D.getConfigField("iconSize")},classes:"node-junction"})})}t(er,"addJunctions");function rr(C,F){F.nodes().map((D)=>{let v=me(D);if(v.type==="group")return;v.x=D.position().x,v.y=D.position().y,C.getElementById(v.id).attr("transform","translate("+(v.x||0)+","+(v.y||0)+")")})}t(rr,"positionNodes");function ir(C,F){C.forEach((D)=>{F.add({group:"nodes",data:{type:"group",id:D.id,icon:D.icon,label:D.title,parent:D.in},classes:"node-group"})})}t(ir,"addGroups");function nr(C,F){C.forEach((D)=>{let{lhsId:v,rhsId:f,lhsInto:o,lhsGroup:n,rhsInto:a,lhsDir:u,rhsDir:r,rhsGroup:y,title:i}=D,e=Xe(D.lhsDir,D.rhsDir)?"segments":"straight",g={id:`${v}-${f}`,label:i,source:v,sourceDir:u,sourceArrow:o,sourceGroup:n,sourceEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%",target:f,targetDir:r,targetArrow:a,targetGroup:y,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};F.add({group:"edges",data:g,classes:e})})}t(nr,"addEdges");function or(C,F,D,v=[]){let f=t((e,g)=>{let d=new Map;for(let[c,I]of e.entries()){let N=`${c}`,w=0,x=[...I.entries()];if(x.length===1){d.set(N,x[0][1]);continue}for(let W=0;W<x.length-1;W++)for(let S=W+1;S<x.length;S++){let[B,tt]=x[W],[Q,ft]=x[S];if(D.get(Qe(B,Q))===g)d.set(N,[...d.get(N)??[],...tt,...ft]);else if(B==="default"||Q==="default")d.set(N,[...d.get(N)??[],...tt,...ft]);else{let et=`${N}-${w++}`;d.set(et,tt);let s=`${N}-${w++}`;d.set(s,ft)}}}return d},"flattenAlignments"),o=F.map((e)=>{let g=new Map,d=new Map;return e.forEach(([c,I],N)=>{let w=C.getNode(N)?.in??"default",x=g.get(I)??new Map;if(!g.has(I))g.set(I,x);let W=d.get(c)??new Map;if(!d.has(c))d.set(c,W);for(let S of[x,W]){let B=S.get(w)??[];if(!S.has(w))S.set(w,B);B.push(N)}}),{horiz:[...f(g,"horizontal").values()].filter((c)=>c.length>1),vert:[...f(d,"vertical").values()].filter((c)=>c.length>1)}}),[n,a]=o.reduce(([e,g],{horiz:d,vert:c})=>[[...e,...d],[...g,...c]],[[],[]]),u=new Set;v.forEach((e)=>e.members.forEach((g)=>u.add(g)));let r=t((e)=>e.filter((g)=>!g.some((d)=>u.has(d))),"dropOverlapping"),y=r(n),i=r(a);return v.forEach((e)=>{if(e.members.length<2)return;if(e.direction==="row")y.push([...e.members]);else i.push([...e.members])}),{horizontal:y,vertical:i}}t(or,"getAlignments");function sr(C,F,D=[]){let v=[],f=F.getConfigField("iconSize"),o=F.getConfigField("idealEdgeLengthMultiplier"),n=o*f,a=new Set;D.forEach((y)=>{for(let i=0;i<y.members.length-1;i++){let e=y.members[i],g=y.members[i+1];if(a.add(`${e}|${g}`),a.add(`${g}|${e}`),y.direction==="row")v.push({left:e,right:g,gap:n});else v.push({top:e,bottom:g,gap:n})}});let u=t((y)=>`${y[0]},${y[1]}`,"posToStr"),r=t((y)=>y.split(",").map((i)=>parseInt(i)),"strToPos");return C.forEach((y)=>{let i=new Map([...y.entries()].map(([c,I])=>[u(I),c])),e=[u([0,0])],g={},d={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(e.length>0){let c=e.shift();if(c){g[c]=1;let I=i.get(c);if(I){let N=r(c);Object.entries(d).forEach(([w,x])=>{let W=u([N[0]+x[0],N[1]+x[1]]),S=i.get(W);if(S&&!g[W]){if(e.push(W),a.has(`${I}|${S}`))return;v.push({[Ze[w]]:S,[Ze[fr(w)]]:I,gap:o*f})}})}}}}),v}t(sr,"getRelativeConstraints");function hr(C,F,D,v,f,{spatialMaps:o,groupAlignments:n}){return new Promise((a)=>{let u=h("body").append("div").attr("id","cy").attr("style","display:none"),r=Qr({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":`${f.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:`${f.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});u.remove(),ir(D,r),tr(C,r,f),er(F,r,f),nr(v,r);let y=f.getLayoutHints(),i=or(f,o,n,y),e=sr(o,f,y),g=f.getConfigField("iconSize"),d=f.getConfigField("idealEdgeLengthMultiplier")*g,c=0.5*g,I=f.getConfigField("edgeElasticity"),N=f.getConfigField("seed"),w=r.layout({name:"fcose",quality:"proof",randomize:f.getConfigField("randomize"),nodeSeparation:f.getConfigField("nodeSeparation"),numIter:f.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(x){let[W,S]=x.connectedNodes(),{parent:B}=me(W),{parent:tt}=me(S);return B===tt?d:c},edgeElasticity(x){let[W,S]=x.connectedNodes(),{parent:B}=me(W),{parent:tt}=me(S);return B===tt?I:0.001},alignmentConstraint:i,relativePlacementConstraint:e});w.one("layoutstop",()=>{function x(W,S,B,tt){let Q,ft,{x:Y,y:et}=W,{x:s,y:M}=S;ft=(tt-et+(Y-B)*(et-M)/(Y-s))/Math.sqrt(1+Math.pow((et-M)/(Y-s),2)),Q=Math.sqrt(Math.pow(tt-et,2)+Math.pow(B-Y,2)-Math.pow(ft,2));let T=Math.sqrt(Math.pow(s-Y,2)+Math.pow(M-et,2));Q=Q/T;let A=(s-Y)*(tt-et)-(M-et)*(B-Y);switch(!0){case A>=0:A=1;break;case A<0:A=-1;break}let m=(s-Y)*(B-Y)+(M-et)*(tt-et);switch(!0){case m>=0:m=1;break;case m<0:m=-1;break}return ft=Math.abs(ft)*A,Q=Q*m,{distances:ft,weights:Q}}t(x,"getSegmentWeights"),r.startBatch();for(let W of Object.values(r.edges()))if(W.data?.()){let{x:S,y:B}=W.source().position(),{x:tt,y:Q}=W.target().position();if(S!==tt&&B!==Q){let ft=W.sourceEndpoint(),Y=W.targetEndpoint(),{sourceDir:et}=Je(W),[s,M]=le(et)?[ft.x,Y.y]:[Y.x,ft.y],{weights:T,distances:A}=x(ft,Y,s,M);W.style("segment-distances",A),W.style("segment-weights",T)}}r.endBatch(),Ye(N,()=>w.run())});try{Ye(N,()=>w.run())}catch(x){if(x instanceof RangeError&&x.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 x}r.ready((x)=>{l.info("Ready",x),a(r)})})}t(hr,"layoutArchitecture");var Ar=t(async(C,F,D,v)=>{let f=v.db;f.setDiagramId(F);let o=f.getServices(),n=f.getJunctions(),a=f.getGroups(),u=f.getEdges(),r=f.getDataStructures(),y=ue(F),i=y.append("g");i.attr("class","architecture-edges");let e=y.append("g");e.attr("class","architecture-services");let g=y.append("g");g.attr("class","architecture-groups"),await Mr(f,e,o,F),Cr(f,e,n,F);let d=await hr(o,n,a,u,f,r);await Lr(i,d,f,F),await wr(g,d,f,F),rr(f,d),Rr(void 0,y,f.getConfigField("padding"),f.getConfigField("useMaxWidth"))},"draw"),Dr={draw:Ar},Hr={parser:je,get db(){return new Ke},renderer:Dr,styles:Nr};export{Hr as diagram};