docmedown 0.1.1 → 0.1.2

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 (214) hide show
  1. package/README.md +38 -20
  2. package/dist/abnfDiagram-VCTEODGH-CtQBp0Qv.mjs +89 -0
  3. package/dist/abnfDiagram-VCTEODGH-mccrzlD_.js +1 -0
  4. package/dist/arc-DgPKXEdT.mjs +82 -0
  5. package/dist/arc-n7TW7Bis.js +1 -0
  6. package/dist/architecture-7GRP2DOG-B7myQ46f.js +1 -0
  7. package/dist/architecture-7GRP2DOG-Cxj1ussQ.mjs +3 -0
  8. package/dist/architectureDiagram-5GKGNRK7-BdTCu5T3.js +36 -0
  9. package/dist/architectureDiagram-5GKGNRK7-CkgZa-G1.mjs +4154 -0
  10. package/dist/array-CApNbSU9.mjs +6 -0
  11. package/dist/array-DZSRzHA_.js +1 -0
  12. package/dist/blockDiagram-I7D4REHJ-CSYvpxQw.js +129 -0
  13. package/dist/blockDiagram-I7D4REHJ-CYngfPD9.mjs +1922 -0
  14. package/dist/c4Diagram-7LVT6UL2-B-sz5MUK.js +38 -0
  15. package/dist/c4Diagram-7LVT6UL2-DEzxFf2b.mjs +3010 -0
  16. package/dist/channel-LgHproiI.mjs +5 -0
  17. package/dist/channel-yqu0m4cl.js +1 -0
  18. package/dist/chunk-2E4U76K2-BOyeRQsI.js +1 -0
  19. package/dist/chunk-2E4U76K2-CoTrgtfg.mjs +348 -0
  20. package/dist/chunk-2Q5K7J3B-D4EgYPOq.mjs +15 -0
  21. package/dist/chunk-2Q5K7J3B-DhjCNjaM.js +1 -0
  22. package/dist/chunk-4HAMMTFA-GFyfmcSO.js +62 -0
  23. package/dist/chunk-4HAMMTFA-VgWPe1ng.mjs +4188 -0
  24. package/dist/chunk-5VM5RSS4-GINalzIv.js +15 -0
  25. package/dist/chunk-5VM5RSS4-TqxtqrwE.mjs +5 -0
  26. package/dist/chunk-75Z2AOVW-DYouz5MZ.js +2 -0
  27. package/dist/chunk-75Z2AOVW-Dz0Sko9Y.mjs +1330 -0
  28. package/dist/chunk-CLGD4ZFX-C5J-e2io.js +1 -0
  29. package/dist/chunk-CLGD4ZFX-DBkwyMMv.mjs +14 -0
  30. package/dist/chunk-DU6HZSFF-BEQZSmUu.mjs +3836 -0
  31. package/dist/chunk-DU6HZSFF-CWc5ewtb.js +127 -0
  32. package/dist/chunk-F27PBJKO-8jvY_jJK.js +1 -0
  33. package/dist/chunk-F27PBJKO-DFH3sRZG.mjs +61 -0
  34. package/dist/chunk-FOHPRMQF-LRqOLsSw.mjs +21456 -0
  35. package/dist/chunk-FOHPRMQF-tmTlwTeH.js +161 -0
  36. package/dist/chunk-GMAD6QVW-BZeZ4fdb.mjs +1863 -0
  37. package/dist/chunk-GMAD6QVW-DEQiTa0c.js +72 -0
  38. package/dist/chunk-GVQU2GXP-B1D3J05J.mjs +37 -0
  39. package/dist/chunk-GVQU2GXP-CdJIWN41.js +1 -0
  40. package/dist/chunk-IMKFNOWR-BmZb9U1f.mjs +2042 -0
  41. package/dist/chunk-IMKFNOWR-CPJsszGN.js +231 -0
  42. package/dist/chunk-JWPE2WC7-DIKiF5cm.mjs +8 -0
  43. package/dist/chunk-JWPE2WC7-p1fYVdYc.js +1 -0
  44. package/dist/chunk-L3NEJ4N5-TzDiVs78.js +1 -0
  45. package/dist/chunk-L3NEJ4N5-lal8wUID.mjs +245 -0
  46. package/dist/chunk-LNGE3PJU-BQX75wkM.js +34 -0
  47. package/dist/chunk-LNGE3PJU-DJ9JuXV6.mjs +1521 -0
  48. package/dist/chunk-OSK3NFVY-9AWK88m1.mjs +672 -0
  49. package/dist/chunk-OSK3NFVY-CHzvVe8m.js +10 -0
  50. package/dist/chunk-P2QGCYS3-6q3AXPt5.mjs +67 -0
  51. package/dist/chunk-P2QGCYS3-DKZzpRQW.js +1 -0
  52. package/dist/chunk-POPQ4Y6H-Dd7J9tx3.mjs +26 -0
  53. package/dist/chunk-POPQ4Y6H-T5C7wpjf.js +1 -0
  54. package/dist/chunk-PWAF6VOD-BYG76tEe.mjs +275 -0
  55. package/dist/chunk-PWAF6VOD-DxZLuCEw.js +1 -0
  56. package/dist/chunk-SHT3W25Y-B2Wes8jn.mjs +4183 -0
  57. package/dist/chunk-SHT3W25Y-BQjHSn5K.js +168 -0
  58. package/dist/chunk-SVP7TREG-BFMd615E.js +88 -0
  59. package/dist/chunk-SVP7TREG-CynckzeF.mjs +490 -0
  60. package/dist/chunk-TICWLB2K-BfCuoR1V.mjs +3357 -0
  61. package/dist/chunk-TICWLB2K-agcyBfUp.js +206 -0
  62. package/dist/chunk-TLUHSLCS-CUrWaKDG.mjs +59 -0
  63. package/dist/chunk-TLUHSLCS-Drx_a7am.js +1 -0
  64. package/dist/chunk-XXDRQBXY-AAk1-Cyg.js +1 -0
  65. package/dist/chunk-XXDRQBXY-DpR8eYzz.mjs +9 -0
  66. package/dist/chunk-Y2CYZVJY-CnmLqFtv.js +1 -0
  67. package/dist/chunk-Y2CYZVJY-i11wjrBe.mjs +12 -0
  68. package/dist/classDiagram-ZZMXUADV-B7IN9zcX.js +1 -0
  69. package/dist/classDiagram-ZZMXUADV-tcy6gxSB.mjs +30 -0
  70. package/dist/classDiagram-v2-VYDZK3BY-B7IN9zcX.js +1 -0
  71. package/dist/classDiagram-v2-VYDZK3BY-D5wM6Acp.mjs +30 -0
  72. package/dist/cli.js +87 -58
  73. package/dist/cose-bilkent-JH36ORCC-DBUPO3qJ.js +1 -0
  74. package/dist/cose-bilkent-JH36ORCC-Slpx4WIt.mjs +2253 -0
  75. package/dist/cynefin-OW5HDTMX--QVnfGi1.mjs +3 -0
  76. package/dist/cynefin-OW5HDTMX-lNKysi7S.js +1 -0
  77. package/dist/cynefinDiagram-5FMLGOSQ-CsFONYqx.js +62 -0
  78. package/dist/cynefinDiagram-5FMLGOSQ-DsrxYBcg.mjs +355 -0
  79. package/dist/cytoscape.esm-C5TvPYYm.mjs +18148 -0
  80. package/dist/cytoscape.esm-CBmWJr5M.js +321 -0
  81. package/dist/dagre-CZ6P9L_h.js +1 -0
  82. package/dist/dagre-GXQ25YYZ-CQszk-7P.js +4 -0
  83. package/dist/dagre-GXQ25YYZ-ecYByRSn.mjs +425 -0
  84. package/dist/dagre-J_1oH0eY.mjs +1934 -0
  85. package/dist/defaultLocale-N-0uLSyg.mjs +198 -0
  86. package/dist/defaultLocale-ybN1Vtvg.js +1 -0
  87. package/dist/diagram-S7CK7UJ4-CTMvxX__.js +30 -0
  88. package/dist/diagram-S7CK7UJ4-DxCghfa-.mjs +301 -0
  89. package/dist/diagram-UQ7AKVKN-1viEkqlG.js +41 -0
  90. package/dist/diagram-UQ7AKVKN-BA7Z_oB7.mjs +214 -0
  91. package/dist/diagram-VSXAHHWV-DgVT19mq.js +3 -0
  92. package/dist/diagram-VSXAHHWV-Dtqo03M5.mjs +432 -0
  93. package/dist/diagram-VX7I27RA-CNw0pOX_.js +24 -0
  94. package/dist/diagram-VX7I27RA-GMPRt8Zh.mjs +527 -0
  95. package/dist/diagram-Z3DM3KII-C6XdQK_Q.mjs +134 -0
  96. package/dist/diagram-Z3DM3KII-CPkBr3FT.js +24 -0
  97. package/dist/dist-CXWJafG_.js +1 -0
  98. package/dist/dist-DNdLIC8h.mjs +59 -0
  99. package/dist/docmedown.cjs +65 -48
  100. package/dist/docmedown.iife.js +3418 -77
  101. package/dist/docmedown.mjs +6550 -4630
  102. package/dist/ebnfDiagram-PWID7BFC-CseVsyL3.js +1 -0
  103. package/dist/ebnfDiagram-PWID7BFC-D_dBDXWC.mjs +100 -0
  104. package/dist/erDiagram-RLTQ6QDP-DFwfQTRS.js +99 -0
  105. package/dist/erDiagram-RLTQ6QDP-DP7ddGMH.mjs +1966 -0
  106. package/dist/eventmodeling-NTZA5JFV-CzxVg0l5.js +1 -0
  107. package/dist/eventmodeling-NTZA5JFV-Djsy__5n.mjs +3 -0
  108. package/dist/flowDiagram-HODETNUW-7hSJfI3W.js +1 -0
  109. package/dist/flowDiagram-HODETNUW-Dqu5Lr19.mjs +17 -0
  110. package/dist/ganttDiagram-EL5Y4UJY-KNL3tzTD.mjs +3072 -0
  111. package/dist/ganttDiagram-EL5Y4UJY-aiLqNWgi.js +292 -0
  112. package/dist/gitGraph-4MIJSDKK-DnElfqX7.js +1 -0
  113. package/dist/gitGraph-4MIJSDKK-xuKJBT2e.mjs +3 -0
  114. package/dist/gitGraphDiagram-WWUBYQGX-D4gSo_-e.js +106 -0
  115. package/dist/gitGraphDiagram-WWUBYQGX-Dooss5fG.mjs +733 -0
  116. package/dist/graphlib-BaETKKSa.js +1 -0
  117. package/dist/graphlib-XW-Jr8pF.mjs +1267 -0
  118. package/dist/info-A6RAGUB7-ClYskpn6.mjs +3 -0
  119. package/dist/info-A6RAGUB7-DDvvt-fW.js +1 -0
  120. package/dist/infoDiagram-27XIBGKW-B2-y2mdQ.mjs +20 -0
  121. package/dist/infoDiagram-27XIBGKW-DYQ9NzfL.js +2 -0
  122. package/dist/init-BJdqMO10.js +1 -0
  123. package/dist/init-CsQUQz36.mjs +13 -0
  124. package/dist/ishikawaDiagram-5VMMS53U-ULIhoYO5.js +70 -0
  125. package/dist/ishikawaDiagram-5VMMS53U-xAArNh-1.mjs +719 -0
  126. package/dist/journeyDiagram-3NMN7TZE-BBMYNZRL.js +139 -0
  127. package/dist/journeyDiagram-3NMN7TZE-BH-uKqP7.mjs +884 -0
  128. package/dist/kanban-definition-UXKFOSKX-Be49llXr.mjs +976 -0
  129. package/dist/kanban-definition-UXKFOSKX-CDL5yJkq.js +89 -0
  130. package/dist/line-BEwhHSLl.js +1 -0
  131. package/dist/line-CiXRog8O.mjs +34 -0
  132. package/dist/linear-75tfjrny.js +1 -0
  133. package/dist/linear-Ncx_RuON.mjs +288 -0
  134. package/dist/mermaid-parser.core-BBApyu_y.js +6 -0
  135. package/dist/mermaid-parser.core-BRHibdUE.mjs +638 -0
  136. package/dist/mindmap-definition-YA3MSWOX-Chy7XP_5.mjs +1006 -0
  137. package/dist/mindmap-definition-YA3MSWOX-DOda-fkL.js +96 -0
  138. package/dist/ordinal-B1BNQwUR.mjs +65 -0
  139. package/dist/ordinal-B9aFWmF9.js +1 -0
  140. package/dist/packet-AYTQ26CC-CorIy9Ul.js +1 -0
  141. package/dist/packet-AYTQ26CC-DWH8gXJK.mjs +3 -0
  142. package/dist/path-CnWkkRiY.mjs +84 -0
  143. package/dist/path-DIS6ck99.js +1 -0
  144. package/dist/pegDiagram-XKGWAZYB-Cdw6MeON.js +1 -0
  145. package/dist/pegDiagram-XKGWAZYB-uNfxRaq1.mjs +94 -0
  146. package/dist/pie-WAS4IAKB-Cn5eK-5P.mjs +3 -0
  147. package/dist/pie-WAS4IAKB-D84xrSoY.js +1 -0
  148. package/dist/pieDiagram-E7YTZNPT-Bd6mvpJw.js +39 -0
  149. package/dist/pieDiagram-E7YTZNPT-Cczo96a2.mjs +203 -0
  150. package/dist/quadrantDiagram-AXDQQJYC-BPfgvMsS.js +7 -0
  151. package/dist/quadrantDiagram-AXDQQJYC-eqRNtVRl.mjs +2001 -0
  152. package/dist/radar-RG4KPBEZ-DvkxGdO6.mjs +3 -0
  153. package/dist/radar-RG4KPBEZ-R2sQOLL9.js +1 -0
  154. package/dist/railroad-74A4TZTK-BOZIf6ts.js +1 -0
  155. package/dist/railroad-74A4TZTK-CrQzn8Nm.mjs +3 -0
  156. package/dist/railroad-abnf-HS5TGJTU-BZYetxLz.mjs +3 -0
  157. package/dist/railroad-abnf-HS5TGJTU-CXU1aC4B.js +1 -0
  158. package/dist/railroad-ebnf-LZEXJU2U-D29kI3YW.js +1 -0
  159. package/dist/railroad-ebnf-LZEXJU2U-qgzTOmN6.mjs +3 -0
  160. package/dist/railroad-peg-WCYAUIDC-Bjs9Ws3P.mjs +3 -0
  161. package/dist/railroad-peg-WCYAUIDC-CXviP0hz.js +1 -0
  162. package/dist/railroadDiagram-O6MQD6OU-58kvwt7H.mjs +76 -0
  163. package/dist/railroadDiagram-O6MQD6OU-CKY3uzTc.js +1 -0
  164. package/dist/requirementDiagram-BXWQKSXE-0hZ04Q6h.js +84 -0
  165. package/dist/requirementDiagram-BXWQKSXE-CS673B5n.mjs +2224 -0
  166. package/dist/rough.esm-ChRLLRha.js +1 -0
  167. package/dist/rough.esm-DXYGHN3m.mjs +1361 -0
  168. package/dist/sankeyDiagram-P5KCCOFB-D1D6HfAM.mjs +972 -0
  169. package/dist/sankeyDiagram-P5KCCOFB-ciJb9Zr8.js +40 -0
  170. package/dist/sequenceDiagram-WJ2MYXX4-BXEznuI6.js +162 -0
  171. package/dist/sequenceDiagram-WJ2MYXX4-CI1VT8AG.mjs +4156 -0
  172. package/dist/sizeCapture-INFHLROL-BihkCH-7.js +1 -0
  173. package/dist/sizeCapture-INFHLROL-BmxqyOLj.mjs +46 -0
  174. package/dist/src-B4mN2BMl.js +1 -0
  175. package/dist/src-D_hsMyeP.mjs +2154 -0
  176. package/dist/stateDiagram-D77RDMKH-BQrSs72W.mjs +220 -0
  177. package/dist/stateDiagram-D77RDMKH-D2PtkW2U.js +1 -0
  178. package/dist/stateDiagram-v2-MP3YSRHH-CCbvNfk-.mjs +30 -0
  179. package/dist/stateDiagram-v2-MP3YSRHH-Dq1QuPeN.js +1 -0
  180. package/dist/swimlanes-42K2YHIH-CA316NPm.mjs +4979 -0
  181. package/dist/swimlanes-42K2YHIH-DlggBCTy.js +1 -0
  182. package/dist/swimlanesDiagram-VR7AAH4N-BV9PEIoG.js +8 -0
  183. package/dist/swimlanesDiagram-VR7AAH4N-BfrOCfdf.mjs +31 -0
  184. package/dist/timeline-definition-24CTP7MA-Bkd8rWNJ.js +120 -0
  185. package/dist/timeline-definition-24CTP7MA-BvkqNYt1.mjs +1069 -0
  186. package/dist/treeView-Q6P3EWNA-Aof3Cp1M.mjs +3 -0
  187. package/dist/treeView-Q6P3EWNA-BTzvdwbb.js +1 -0
  188. package/dist/treemap-WGGIJYW6-BNXGg99p.mjs +3 -0
  189. package/dist/treemap-WGGIJYW6-DfR4P2Hh.js +1 -0
  190. package/dist/types/runtime/components/AppearanceMenu.d.ts +2 -0
  191. package/dist/types/runtime/components/DmdRegistry.d.ts +3 -1
  192. package/dist/types/runtime/components/MermaidDiagram.d.ts +16 -0
  193. package/dist/types/runtime/components/OfflineDownloadButton.d.ts +2 -0
  194. package/dist/types/runtime/config-schema.d.ts +42 -0
  195. package/dist/types/runtime/index.d.ts +1 -0
  196. package/dist/types/runtime/markdown/mermaid.d.ts +82 -1
  197. package/dist/types/runtime/offline-export.d.ts +26 -0
  198. package/dist/types/runtime/provider/ThemeProvider.d.ts +11 -4
  199. package/dist/types/runtime/types.d.ts +4 -1
  200. package/dist/vennDiagram-4TSXK5OY-BOUFXjso.js +34 -0
  201. package/dist/vennDiagram-4TSXK5OY-CeOg3-hU.mjs +1880 -0
  202. package/dist/wardley-WFR3VGLG-BOYcSLd1.mjs +3 -0
  203. package/dist/wardley-WFR3VGLG-DWDqJSgm.js +1 -0
  204. package/dist/wardleyDiagram-VM6X3IG4-BhWgMjFr.js +78 -0
  205. package/dist/wardleyDiagram-VM6X3IG4-C31KoRmF.mjs +645 -0
  206. package/dist/xychartDiagram-S5SC5T6Z-1yU8zz6I.js +7 -0
  207. package/dist/xychartDiagram-S5SC5T6Z-BK7upFom.mjs +2210 -0
  208. package/package.json +6 -3
  209. package/schemas/docs.schema.json +10 -1
  210. package/templates/README.md +4 -4
  211. package/templates/docs.json +4 -2
  212. package/templates/getting-started.md +1 -1
  213. package/templates/guides/custom-components.md +2 -0
  214. package/templates/index.html +2 -4
@@ -0,0 +1,2253 @@
1
+ import { _ as e, m as t, p as n, y as r } from "./src-D_hsMyeP.mjs";
2
+ import { n as i } from "./chunk-Y2CYZVJY-i11wjrBe.mjs";
3
+ import { t as a } from "./cytoscape.esm-C5TvPYYm.mjs";
4
+ //#region node_modules/layout-base/layout-base.js
5
+ var o = /* @__PURE__ */ e(((e, t) => {
6
+ (function(n, r) {
7
+ typeof e == "object" && typeof t == "object" ? t.exports = r() : typeof define == "function" && define.amd ? define([], r) : typeof e == "object" ? e.layoutBase = r() : n.layoutBase = r();
8
+ })(e, function() {
9
+ return (function(e) {
10
+ var t = {};
11
+ function n(r) {
12
+ if (t[r]) return t[r].exports;
13
+ var i = t[r] = {
14
+ i: r,
15
+ l: !1,
16
+ exports: {}
17
+ };
18
+ return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports;
19
+ }
20
+ return n.m = e, n.c = t, n.i = function(e) {
21
+ return e;
22
+ }, n.d = function(e, t, r) {
23
+ n.o(e, t) || Object.defineProperty(e, t, {
24
+ configurable: !1,
25
+ enumerable: !0,
26
+ get: r
27
+ });
28
+ }, n.n = function(e) {
29
+ var t = e && e.__esModule ? function() {
30
+ return e.default;
31
+ } : function() {
32
+ return e;
33
+ };
34
+ return n.d(t, "a", t), t;
35
+ }, n.o = function(e, t) {
36
+ return Object.prototype.hasOwnProperty.call(e, t);
37
+ }, n.p = "", n(n.s = 26);
38
+ })([
39
+ (function(e, t, n) {
40
+ function r() {}
41
+ r.QUALITY = 1, r.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, r.DEFAULT_INCREMENTAL = !1, r.DEFAULT_ANIMATION_ON_LAYOUT = !0, r.DEFAULT_ANIMATION_DURING_LAYOUT = !1, r.DEFAULT_ANIMATION_PERIOD = 50, r.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, r.DEFAULT_GRAPH_MARGIN = 15, r.NODE_DIMENSIONS_INCLUDE_LABELS = !1, r.SIMPLE_NODE_SIZE = 40, r.SIMPLE_NODE_HALF_SIZE = r.SIMPLE_NODE_SIZE / 2, r.EMPTY_COMPOUND_NODE_SIZE = 40, r.MIN_EDGE_LENGTH = 1, r.WORLD_BOUNDARY = 1e6, r.INITIAL_WORLD_BOUNDARY = r.WORLD_BOUNDARY / 1e3, r.WORLD_CENTER_X = 1200, r.WORLD_CENTER_Y = 900, e.exports = r;
42
+ }),
43
+ (function(e, t, n) {
44
+ var r = n(2), i = n(8), a = n(9);
45
+ function o(e, t, n) {
46
+ r.call(this, n), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = n, this.bendpoints = [], this.source = e, this.target = t;
47
+ }
48
+ for (var s in o.prototype = Object.create(r.prototype), r) o[s] = r[s];
49
+ o.prototype.getSource = function() {
50
+ return this.source;
51
+ }, o.prototype.getTarget = function() {
52
+ return this.target;
53
+ }, o.prototype.isInterGraph = function() {
54
+ return this.isInterGraph;
55
+ }, o.prototype.getLength = function() {
56
+ return this.length;
57
+ }, o.prototype.isOverlapingSourceAndTarget = function() {
58
+ return this.isOverlapingSourceAndTarget;
59
+ }, o.prototype.getBendpoints = function() {
60
+ return this.bendpoints;
61
+ }, o.prototype.getLca = function() {
62
+ return this.lca;
63
+ }, o.prototype.getSourceInLca = function() {
64
+ return this.sourceInLca;
65
+ }, o.prototype.getTargetInLca = function() {
66
+ return this.targetInLca;
67
+ }, o.prototype.getOtherEnd = function(e) {
68
+ if (this.source === e) return this.target;
69
+ if (this.target === e) return this.source;
70
+ throw "Node is not incident with this edge";
71
+ }, o.prototype.getOtherEndInGraph = function(e, t) {
72
+ for (var n = this.getOtherEnd(e), r = t.getGraphManager().getRoot();;) {
73
+ if (n.getOwner() == t) return n;
74
+ if (n.getOwner() == r) break;
75
+ n = n.getOwner().getParent();
76
+ }
77
+ return null;
78
+ }, o.prototype.updateLength = function() {
79
+ var e = [
80
+ ,
81
+ ,
82
+ ,
83
+ ,
84
+ ];
85
+ this.isOverlapingSourceAndTarget = i.getIntersection(this.target.getRect(), this.source.getRect(), e), this.isOverlapingSourceAndTarget || (this.lengthX = e[0] - e[2], this.lengthY = e[1] - e[3], Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
86
+ }, o.prototype.updateLengthSimple = function() {
87
+ this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
88
+ }, e.exports = o;
89
+ }),
90
+ (function(e, t, n) {
91
+ function r(e) {
92
+ this.vGraphObject = e;
93
+ }
94
+ e.exports = r;
95
+ }),
96
+ (function(e, t, n) {
97
+ var r = n(2), i = n(10), a = n(13), o = n(0), s = n(16), c = n(4);
98
+ function l(e, t, n, o) {
99
+ n == null && o == null && (o = t), r.call(this, o), e.graphManager != null && (e = e.graphManager), this.estimatedSize = i.MIN_VALUE, this.inclusionTreeDepth = i.MAX_VALUE, this.vGraphObject = o, this.edges = [], this.graphManager = e, this.rect = n != null && t != null ? new a(t.x, t.y, n.width, n.height) : new a();
100
+ }
101
+ for (var u in l.prototype = Object.create(r.prototype), r) l[u] = r[u];
102
+ l.prototype.getEdges = function() {
103
+ return this.edges;
104
+ }, l.prototype.getChild = function() {
105
+ return this.child;
106
+ }, l.prototype.getOwner = function() {
107
+ return this.owner;
108
+ }, l.prototype.getWidth = function() {
109
+ return this.rect.width;
110
+ }, l.prototype.setWidth = function(e) {
111
+ this.rect.width = e;
112
+ }, l.prototype.getHeight = function() {
113
+ return this.rect.height;
114
+ }, l.prototype.setHeight = function(e) {
115
+ this.rect.height = e;
116
+ }, l.prototype.getCenterX = function() {
117
+ return this.rect.x + this.rect.width / 2;
118
+ }, l.prototype.getCenterY = function() {
119
+ return this.rect.y + this.rect.height / 2;
120
+ }, l.prototype.getCenter = function() {
121
+ return new c(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
122
+ }, l.prototype.getLocation = function() {
123
+ return new c(this.rect.x, this.rect.y);
124
+ }, l.prototype.getRect = function() {
125
+ return this.rect;
126
+ }, l.prototype.getDiagonal = function() {
127
+ return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
128
+ }, l.prototype.getHalfTheDiagonal = function() {
129
+ return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
130
+ }, l.prototype.setRect = function(e, t) {
131
+ this.rect.x = e.x, this.rect.y = e.y, this.rect.width = t.width, this.rect.height = t.height;
132
+ }, l.prototype.setCenter = function(e, t) {
133
+ this.rect.x = e - this.rect.width / 2, this.rect.y = t - this.rect.height / 2;
134
+ }, l.prototype.setLocation = function(e, t) {
135
+ this.rect.x = e, this.rect.y = t;
136
+ }, l.prototype.moveBy = function(e, t) {
137
+ this.rect.x += e, this.rect.y += t;
138
+ }, l.prototype.getEdgeListToNode = function(e) {
139
+ var t = [], n = this;
140
+ return n.edges.forEach(function(r) {
141
+ if (r.target == e) {
142
+ if (r.source != n) throw "Incorrect edge source!";
143
+ t.push(r);
144
+ }
145
+ }), t;
146
+ }, l.prototype.getEdgesBetween = function(e) {
147
+ var t = [], n = this;
148
+ return n.edges.forEach(function(r) {
149
+ if (r.source != n && r.target != n) throw "Incorrect edge source and/or target";
150
+ (r.target == e || r.source == e) && t.push(r);
151
+ }), t;
152
+ }, l.prototype.getNeighborsList = function() {
153
+ var e = /* @__PURE__ */ new Set(), t = this;
154
+ return t.edges.forEach(function(n) {
155
+ if (n.source == t) e.add(n.target);
156
+ else {
157
+ if (n.target != t) throw "Incorrect incidency!";
158
+ e.add(n.source);
159
+ }
160
+ }), e;
161
+ }, l.prototype.withChildren = function() {
162
+ var e = /* @__PURE__ */ new Set(), t, n;
163
+ if (e.add(this), this.child != null) for (var r = this.child.getNodes(), i = 0; i < r.length; i++) t = r[i], n = t.withChildren(), n.forEach(function(t) {
164
+ e.add(t);
165
+ });
166
+ return e;
167
+ }, l.prototype.getNoOfChildren = function() {
168
+ var e = 0, t;
169
+ if (this.child == null) e = 1;
170
+ else for (var n = this.child.getNodes(), r = 0; r < n.length; r++) t = n[r], e += t.getNoOfChildren();
171
+ return e == 0 && (e = 1), e;
172
+ }, l.prototype.getEstimatedSize = function() {
173
+ if (this.estimatedSize == i.MIN_VALUE) throw "assert failed";
174
+ return this.estimatedSize;
175
+ }, l.prototype.calcEstimatedSize = function() {
176
+ return this.child == null ? this.estimatedSize = (this.rect.width + this.rect.height) / 2 : (this.estimatedSize = this.child.calcEstimatedSize(), this.rect.width = this.estimatedSize, this.rect.height = this.estimatedSize, this.estimatedSize);
177
+ }, l.prototype.scatter = function() {
178
+ var e, t, n = -o.INITIAL_WORLD_BOUNDARY, r = o.INITIAL_WORLD_BOUNDARY;
179
+ e = o.WORLD_CENTER_X + s.nextDouble() * (r - n) + n;
180
+ var i = -o.INITIAL_WORLD_BOUNDARY, a = o.INITIAL_WORLD_BOUNDARY;
181
+ t = o.WORLD_CENTER_Y + s.nextDouble() * (a - i) + i, this.rect.x = e, this.rect.y = t;
182
+ }, l.prototype.updateBounds = function() {
183
+ if (this.getChild() == null) throw "assert failed";
184
+ if (this.getChild().getNodes().length != 0) {
185
+ var e = this.getChild();
186
+ if (e.updateBounds(!0), this.rect.x = e.getLeft(), this.rect.y = e.getTop(), this.setWidth(e.getRight() - e.getLeft()), this.setHeight(e.getBottom() - e.getTop()), o.NODE_DIMENSIONS_INCLUDE_LABELS) {
187
+ var t = e.getRight() - e.getLeft(), n = e.getBottom() - e.getTop();
188
+ this.labelWidth > t && (this.rect.x -= (this.labelWidth - t) / 2, this.setWidth(this.labelWidth)), this.labelHeight > n && (this.labelPos == "center" ? this.rect.y -= (this.labelHeight - n) / 2 : this.labelPos == "top" && (this.rect.y -= this.labelHeight - n), this.setHeight(this.labelHeight));
189
+ }
190
+ }
191
+ }, l.prototype.getInclusionTreeDepth = function() {
192
+ if (this.inclusionTreeDepth == i.MAX_VALUE) throw "assert failed";
193
+ return this.inclusionTreeDepth;
194
+ }, l.prototype.transform = function(e) {
195
+ var t = this.rect.x;
196
+ t > o.WORLD_BOUNDARY ? t = o.WORLD_BOUNDARY : t < -o.WORLD_BOUNDARY && (t = -o.WORLD_BOUNDARY);
197
+ var n = this.rect.y;
198
+ n > o.WORLD_BOUNDARY ? n = o.WORLD_BOUNDARY : n < -o.WORLD_BOUNDARY && (n = -o.WORLD_BOUNDARY);
199
+ var r = new c(t, n), i = e.inverseTransformPoint(r);
200
+ this.setLocation(i.x, i.y);
201
+ }, l.prototype.getLeft = function() {
202
+ return this.rect.x;
203
+ }, l.prototype.getRight = function() {
204
+ return this.rect.x + this.rect.width;
205
+ }, l.prototype.getTop = function() {
206
+ return this.rect.y;
207
+ }, l.prototype.getBottom = function() {
208
+ return this.rect.y + this.rect.height;
209
+ }, l.prototype.getParent = function() {
210
+ return this.owner == null ? null : this.owner.getParent();
211
+ }, e.exports = l;
212
+ }),
213
+ (function(e, t, n) {
214
+ function r(e, t) {
215
+ e == null && t == null ? (this.x = 0, this.y = 0) : (this.x = e, this.y = t);
216
+ }
217
+ r.prototype.getX = function() {
218
+ return this.x;
219
+ }, r.prototype.getY = function() {
220
+ return this.y;
221
+ }, r.prototype.setX = function(e) {
222
+ this.x = e;
223
+ }, r.prototype.setY = function(e) {
224
+ this.y = e;
225
+ }, r.prototype.getDifference = function(e) {
226
+ return new DimensionD(this.x - e.x, this.y - e.y);
227
+ }, r.prototype.getCopy = function() {
228
+ return new r(this.x, this.y);
229
+ }, r.prototype.translate = function(e) {
230
+ return this.x += e.width, this.y += e.height, this;
231
+ }, e.exports = r;
232
+ }),
233
+ (function(e, t, n) {
234
+ var r = n(2), i = n(10), a = n(0), o = n(6), s = n(3), c = n(1), l = n(13), u = n(12), d = n(11);
235
+ function f(e, t, n) {
236
+ r.call(this, n), this.estimatedSize = i.MIN_VALUE, this.margin = a.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = e, t != null && t instanceof o ? this.graphManager = t : t != null && t instanceof Layout && (this.graphManager = t.graphManager);
237
+ }
238
+ for (var p in f.prototype = Object.create(r.prototype), r) f[p] = r[p];
239
+ f.prototype.getNodes = function() {
240
+ return this.nodes;
241
+ }, f.prototype.getEdges = function() {
242
+ return this.edges;
243
+ }, f.prototype.getGraphManager = function() {
244
+ return this.graphManager;
245
+ }, f.prototype.getParent = function() {
246
+ return this.parent;
247
+ }, f.prototype.getLeft = function() {
248
+ return this.left;
249
+ }, f.prototype.getRight = function() {
250
+ return this.right;
251
+ }, f.prototype.getTop = function() {
252
+ return this.top;
253
+ }, f.prototype.getBottom = function() {
254
+ return this.bottom;
255
+ }, f.prototype.isConnected = function() {
256
+ return this.isConnected;
257
+ }, f.prototype.add = function(e, t, n) {
258
+ if (t == null && n == null) {
259
+ var r = e;
260
+ if (this.graphManager == null) throw "Graph has no graph mgr!";
261
+ if (this.getNodes().indexOf(r) > -1) throw "Node already in graph!";
262
+ return r.owner = this, this.getNodes().push(r), r;
263
+ }
264
+ var i = e;
265
+ if (!(this.getNodes().indexOf(t) > -1 && this.getNodes().indexOf(n) > -1)) throw "Source or target not in graph!";
266
+ if (t.owner != n.owner || t.owner != this) throw "Both owners must be this graph!";
267
+ return t.owner == n.owner ? (i.source = t, i.target = n, i.isInterGraph = !1, this.getEdges().push(i), t.edges.push(i), n != t && n.edges.push(i), i) : null;
268
+ }, f.prototype.remove = function(e) {
269
+ var t = e;
270
+ if (e instanceof s) {
271
+ if (t == null) throw "Node is null!";
272
+ if (t.owner == null || t.owner != this) throw "Owner graph is invalid!";
273
+ if (this.graphManager == null) throw "Owner graph manager is invalid!";
274
+ for (var n = t.edges.slice(), r, i = n.length, a = 0; a < i; a++) r = n[a], r.isInterGraph ? this.graphManager.remove(r) : r.source.owner.remove(r);
275
+ var o = this.nodes.indexOf(t);
276
+ if (o == -1) throw "Node not in owner node list!";
277
+ this.nodes.splice(o, 1);
278
+ } else if (e instanceof c) {
279
+ var r = e;
280
+ if (r == null) throw "Edge is null!";
281
+ if (r.source == null || r.target == null) throw "Source and/or target is null!";
282
+ if (r.source.owner == null || r.target.owner == null || r.source.owner != this || r.target.owner != this) throw "Source and/or target owner is invalid!";
283
+ var l = r.source.edges.indexOf(r), u = r.target.edges.indexOf(r);
284
+ if (!(l > -1 && u > -1)) throw "Source and/or target doesn't know this edge!";
285
+ r.source.edges.splice(l, 1), r.target != r.source && r.target.edges.splice(u, 1);
286
+ var o = r.source.owner.getEdges().indexOf(r);
287
+ if (o == -1) throw "Not in owner's edge list!";
288
+ r.source.owner.getEdges().splice(o, 1);
289
+ }
290
+ }, f.prototype.updateLeftTop = function() {
291
+ for (var e = i.MAX_VALUE, t = i.MAX_VALUE, n, r, a, o = this.getNodes(), s = o.length, c = 0; c < s; c++) {
292
+ var l = o[c];
293
+ n = l.getTop(), r = l.getLeft(), e > n && (e = n), t > r && (t = r);
294
+ }
295
+ return e == i.MAX_VALUE ? null : (a = o[0].getParent().paddingLeft == null ? this.margin : o[0].getParent().paddingLeft, this.left = t - a, this.top = e - a, new u(this.left, this.top));
296
+ }, f.prototype.updateBounds = function(e) {
297
+ for (var t = i.MAX_VALUE, n = -i.MAX_VALUE, r = i.MAX_VALUE, a = -i.MAX_VALUE, o, s, c, u, d, f = this.nodes, p = f.length, m = 0; m < p; m++) {
298
+ var h = f[m];
299
+ e && h.child != null && h.updateBounds(), o = h.getLeft(), s = h.getRight(), c = h.getTop(), u = h.getBottom(), t > o && (t = o), n < s && (n = s), r > c && (r = c), a < u && (a = u);
300
+ }
301
+ var g = new l(t, r, n - t, a - r);
302
+ t == i.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), d = f[0].getParent().paddingLeft == null ? this.margin : f[0].getParent().paddingLeft, this.left = g.x - d, this.right = g.x + g.width + d, this.top = g.y - d, this.bottom = g.y + g.height + d;
303
+ }, f.calculateBounds = function(e) {
304
+ for (var t = i.MAX_VALUE, n = -i.MAX_VALUE, r = i.MAX_VALUE, a = -i.MAX_VALUE, o, s, c, u, d = e.length, f = 0; f < d; f++) {
305
+ var p = e[f];
306
+ o = p.getLeft(), s = p.getRight(), c = p.getTop(), u = p.getBottom(), t > o && (t = o), n < s && (n = s), r > c && (r = c), a < u && (a = u);
307
+ }
308
+ return new l(t, r, n - t, a - r);
309
+ }, f.prototype.getInclusionTreeDepth = function() {
310
+ return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
311
+ }, f.prototype.getEstimatedSize = function() {
312
+ if (this.estimatedSize == i.MIN_VALUE) throw "assert failed";
313
+ return this.estimatedSize;
314
+ }, f.prototype.calcEstimatedSize = function() {
315
+ for (var e = 0, t = this.nodes, n = t.length, r = 0; r < n; r++) {
316
+ var i = t[r];
317
+ e += i.calcEstimatedSize();
318
+ }
319
+ return this.estimatedSize = e == 0 ? a.EMPTY_COMPOUND_NODE_SIZE : e / Math.sqrt(this.nodes.length), this.estimatedSize;
320
+ }, f.prototype.updateConnected = function() {
321
+ var e = this;
322
+ if (this.nodes.length == 0) {
323
+ this.isConnected = !0;
324
+ return;
325
+ }
326
+ var t = new d(), n = /* @__PURE__ */ new Set(), r = this.nodes[0], i, a;
327
+ for (r.withChildren().forEach(function(e) {
328
+ t.push(e), n.add(e);
329
+ }); t.length !== 0;) {
330
+ r = t.shift(), i = r.getEdges();
331
+ for (var o = i.length, s = 0; s < o; s++) a = i[s].getOtherEndInGraph(r, this), a != null && !n.has(a) && a.withChildren().forEach(function(e) {
332
+ t.push(e), n.add(e);
333
+ });
334
+ }
335
+ if (this.isConnected = !1, n.size >= this.nodes.length) {
336
+ var c = 0;
337
+ n.forEach(function(t) {
338
+ t.owner == e && c++;
339
+ }), c == this.nodes.length && (this.isConnected = !0);
340
+ }
341
+ }, e.exports = f;
342
+ }),
343
+ (function(e, t, n) {
344
+ var r, i = n(1);
345
+ function a(e) {
346
+ r = n(5), this.layout = e, this.graphs = [], this.edges = [];
347
+ }
348
+ a.prototype.addRoot = function() {
349
+ var e = this.layout.newGraph(), t = this.layout.newNode(null), n = this.add(e, t);
350
+ return this.setRootGraph(n), this.rootGraph;
351
+ }, a.prototype.add = function(e, t, n, r, i) {
352
+ if (n == null && r == null && i == null) {
353
+ if (e == null) throw "Graph is null!";
354
+ if (t == null) throw "Parent node is null!";
355
+ if (this.graphs.indexOf(e) > -1) throw "Graph already in this graph mgr!";
356
+ if (this.graphs.push(e), e.parent != null) throw "Already has a parent!";
357
+ if (t.child != null) throw "Already has a child!";
358
+ return e.parent = t, t.child = e, e;
359
+ }
360
+ i = n, r = t, n = e;
361
+ var a = r.getOwner(), o = i.getOwner();
362
+ if (a == null || a.getGraphManager() != this) throw "Source not in this graph mgr!";
363
+ if (o == null || o.getGraphManager() != this) throw "Target not in this graph mgr!";
364
+ if (a == o) return n.isInterGraph = !1, a.add(n, r, i);
365
+ if (n.isInterGraph = !0, n.source = r, n.target = i, this.edges.indexOf(n) > -1) throw "Edge already in inter-graph edge list!";
366
+ if (this.edges.push(n), n.source == null || n.target == null) throw "Edge source and/or target is null!";
367
+ if (n.source.edges.indexOf(n) != -1 || n.target.edges.indexOf(n) != -1) throw "Edge already in source and/or target incidency list!";
368
+ return n.source.edges.push(n), n.target.edges.push(n), n;
369
+ }, a.prototype.remove = function(e) {
370
+ if (e instanceof r) {
371
+ var t = e;
372
+ if (t.getGraphManager() != this) throw "Graph not in this graph mgr";
373
+ if (!(t == this.rootGraph || t.parent != null && t.parent.graphManager == this)) throw "Invalid parent node!";
374
+ var n = [];
375
+ n = n.concat(t.getEdges());
376
+ for (var a, o = n.length, s = 0; s < o; s++) a = n[s], t.remove(a);
377
+ var c = [];
378
+ c = c.concat(t.getNodes());
379
+ var l;
380
+ o = c.length;
381
+ for (var s = 0; s < o; s++) l = c[s], t.remove(l);
382
+ t == this.rootGraph && this.setRootGraph(null);
383
+ var u = this.graphs.indexOf(t);
384
+ this.graphs.splice(u, 1), t.parent = null;
385
+ } else if (e instanceof i) {
386
+ if (a = e, a == null) throw "Edge is null!";
387
+ if (!a.isInterGraph) throw "Not an inter-graph edge!";
388
+ if (a.source == null || a.target == null) throw "Source and/or target is null!";
389
+ if (a.source.edges.indexOf(a) == -1 || a.target.edges.indexOf(a) == -1) throw "Source and/or target doesn't know this edge!";
390
+ var u = a.source.edges.indexOf(a);
391
+ if (a.source.edges.splice(u, 1), u = a.target.edges.indexOf(a), a.target.edges.splice(u, 1), a.source.owner == null || a.source.owner.getGraphManager() == null) throw "Edge owner graph or owner graph manager is null!";
392
+ if (a.source.owner.getGraphManager().edges.indexOf(a) == -1) throw "Not in owner graph manager's edge list!";
393
+ var u = a.source.owner.getGraphManager().edges.indexOf(a);
394
+ a.source.owner.getGraphManager().edges.splice(u, 1);
395
+ }
396
+ }, a.prototype.updateBounds = function() {
397
+ this.rootGraph.updateBounds(!0);
398
+ }, a.prototype.getGraphs = function() {
399
+ return this.graphs;
400
+ }, a.prototype.getAllNodes = function() {
401
+ if (this.allNodes == null) {
402
+ for (var e = [], t = this.getGraphs(), n = t.length, r = 0; r < n; r++) e = e.concat(t[r].getNodes());
403
+ this.allNodes = e;
404
+ }
405
+ return this.allNodes;
406
+ }, a.prototype.resetAllNodes = function() {
407
+ this.allNodes = null;
408
+ }, a.prototype.resetAllEdges = function() {
409
+ this.allEdges = null;
410
+ }, a.prototype.resetAllNodesToApplyGravitation = function() {
411
+ this.allNodesToApplyGravitation = null;
412
+ }, a.prototype.getAllEdges = function() {
413
+ if (this.allEdges == null) {
414
+ var e = [], t = this.getGraphs();
415
+ t.length;
416
+ for (var n = 0; n < t.length; n++) e = e.concat(t[n].getEdges());
417
+ e = e.concat(this.edges), this.allEdges = e;
418
+ }
419
+ return this.allEdges;
420
+ }, a.prototype.getAllNodesToApplyGravitation = function() {
421
+ return this.allNodesToApplyGravitation;
422
+ }, a.prototype.setAllNodesToApplyGravitation = function(e) {
423
+ if (this.allNodesToApplyGravitation != null) throw "assert failed";
424
+ this.allNodesToApplyGravitation = e;
425
+ }, a.prototype.getRoot = function() {
426
+ return this.rootGraph;
427
+ }, a.prototype.setRootGraph = function(e) {
428
+ if (e.getGraphManager() != this) throw "Root not in this graph mgr!";
429
+ this.rootGraph = e, e.parent ??= this.layout.newNode("Root node");
430
+ }, a.prototype.getLayout = function() {
431
+ return this.layout;
432
+ }, a.prototype.isOneAncestorOfOther = function(e, t) {
433
+ if (e == null || t == null) throw "assert failed";
434
+ if (e == t) return !0;
435
+ var n = e.getOwner(), r;
436
+ do {
437
+ if (r = n.getParent(), r == null) break;
438
+ if (r == t) return !0;
439
+ if (n = r.getOwner(), n == null) break;
440
+ } while (!0);
441
+ n = t.getOwner();
442
+ do {
443
+ if (r = n.getParent(), r == null) break;
444
+ if (r == e) return !0;
445
+ if (n = r.getOwner(), n == null) break;
446
+ } while (!0);
447
+ return !1;
448
+ }, a.prototype.calcLowestCommonAncestors = function() {
449
+ for (var e, t, n, r, i, a = this.getAllEdges(), o = a.length, s = 0; s < o; s++) {
450
+ if (e = a[s], t = e.source, n = e.target, e.lca = null, e.sourceInLca = t, e.targetInLca = n, t == n) {
451
+ e.lca = t.getOwner();
452
+ continue;
453
+ }
454
+ for (r = t.getOwner(); e.lca == null;) {
455
+ for (e.targetInLca = n, i = n.getOwner(); e.lca == null;) {
456
+ if (i == r) {
457
+ e.lca = i;
458
+ break;
459
+ }
460
+ if (i == this.rootGraph) break;
461
+ if (e.lca != null) throw "assert failed";
462
+ e.targetInLca = i.getParent(), i = e.targetInLca.getOwner();
463
+ }
464
+ if (r == this.rootGraph) break;
465
+ e.lca ?? (e.sourceInLca = r.getParent(), r = e.sourceInLca.getOwner());
466
+ }
467
+ if (e.lca == null) throw "assert failed";
468
+ }
469
+ }, a.prototype.calcLowestCommonAncestor = function(e, t) {
470
+ if (e == t) return e.getOwner();
471
+ var n = e.getOwner();
472
+ do {
473
+ if (n == null) break;
474
+ var r = t.getOwner();
475
+ do {
476
+ if (r == null) break;
477
+ if (r == n) return r;
478
+ r = r.getParent().getOwner();
479
+ } while (!0);
480
+ n = n.getParent().getOwner();
481
+ } while (!0);
482
+ return n;
483
+ }, a.prototype.calcInclusionTreeDepths = function(e, t) {
484
+ e == null && t == null && (e = this.rootGraph, t = 1);
485
+ for (var n, r = e.getNodes(), i = r.length, a = 0; a < i; a++) n = r[a], n.inclusionTreeDepth = t, n.child != null && this.calcInclusionTreeDepths(n.child, t + 1);
486
+ }, a.prototype.includesInvalidEdge = function() {
487
+ for (var e, t = this.edges.length, n = 0; n < t; n++) if (e = this.edges[n], this.isOneAncestorOfOther(e.source, e.target)) return !0;
488
+ return !1;
489
+ }, e.exports = a;
490
+ }),
491
+ (function(e, t, n) {
492
+ var r = n(0);
493
+ function i() {}
494
+ for (var a in r) i[a] = r[a];
495
+ i.MAX_ITERATIONS = 2500, i.DEFAULT_EDGE_LENGTH = 50, i.DEFAULT_SPRING_STRENGTH = .45, i.DEFAULT_REPULSION_STRENGTH = 4500, i.DEFAULT_GRAVITY_STRENGTH = .4, i.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, i.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, i.DEFAULT_COOLING_FACTOR_INCREMENTAL = .3, i.COOLING_ADAPTATION_FACTOR = .33, i.ADAPTATION_LOWER_NODE_LIMIT = 1e3, i.ADAPTATION_UPPER_NODE_LIMIT = 5e3, i.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, i.MAX_NODE_DISPLACEMENT = i.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, i.MIN_REPULSION_DIST = i.DEFAULT_EDGE_LENGTH / 10, i.CONVERGENCE_CHECK_PERIOD = 100, i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = .1, i.MIN_EDGE_LENGTH = 1, i.GRID_CALCULATION_CHECK_PERIOD = 10, e.exports = i;
496
+ }),
497
+ (function(e, t, n) {
498
+ var r = n(12);
499
+ function i() {}
500
+ i.calcSeparationAmount = function(e, t, n, r) {
501
+ if (!e.intersects(t)) throw "assert failed";
502
+ var i = [, ,];
503
+ this.decideDirectionsForOverlappingNodes(e, t, i), n[0] = Math.min(e.getRight(), t.getRight()) - Math.max(e.x, t.x), n[1] = Math.min(e.getBottom(), t.getBottom()) - Math.max(e.y, t.y), e.getX() <= t.getX() && e.getRight() >= t.getRight() ? n[0] += Math.min(t.getX() - e.getX(), e.getRight() - t.getRight()) : t.getX() <= e.getX() && t.getRight() >= e.getRight() && (n[0] += Math.min(e.getX() - t.getX(), t.getRight() - e.getRight())), e.getY() <= t.getY() && e.getBottom() >= t.getBottom() ? n[1] += Math.min(t.getY() - e.getY(), e.getBottom() - t.getBottom()) : t.getY() <= e.getY() && t.getBottom() >= e.getBottom() && (n[1] += Math.min(e.getY() - t.getY(), t.getBottom() - e.getBottom()));
504
+ var a = Math.abs((t.getCenterY() - e.getCenterY()) / (t.getCenterX() - e.getCenterX()));
505
+ t.getCenterY() === e.getCenterY() && t.getCenterX() === e.getCenterX() && (a = 1);
506
+ var o = a * n[0], s = n[1] / a;
507
+ n[0] < s ? s = n[0] : o = n[1], n[0] = -1 * i[0] * (s / 2 + r), n[1] = -1 * i[1] * (o / 2 + r);
508
+ }, i.decideDirectionsForOverlappingNodes = function(e, t, n) {
509
+ n[0] = e.getCenterX() < t.getCenterX() ? -1 : 1, n[1] = e.getCenterY() < t.getCenterY() ? -1 : 1;
510
+ }, i.getIntersection2 = function(e, t, n) {
511
+ var r = e.getCenterX(), i = e.getCenterY(), a = t.getCenterX(), o = t.getCenterY();
512
+ if (e.intersects(t)) return n[0] = r, n[1] = i, n[2] = a, n[3] = o, !0;
513
+ var s = e.getX(), c = e.getY(), l = e.getRight(), u = e.getX(), d = e.getBottom(), f = e.getRight(), p = e.getWidthHalf(), m = e.getHeightHalf(), h = t.getX(), g = t.getY(), _ = t.getRight(), v = t.getX(), y = t.getBottom(), b = t.getRight(), x = t.getWidthHalf(), S = t.getHeightHalf(), C = !1, w = !1;
514
+ if (r === a) {
515
+ if (i > o) return n[0] = r, n[1] = c, n[2] = a, n[3] = y, !1;
516
+ if (i < o) return n[0] = r, n[1] = d, n[2] = a, n[3] = g, !1;
517
+ } else if (i === o) {
518
+ if (r > a) return n[0] = s, n[1] = i, n[2] = _, n[3] = o, !1;
519
+ if (r < a) return n[0] = l, n[1] = i, n[2] = h, n[3] = o, !1;
520
+ } else {
521
+ var T = e.height / e.width, E = t.height / t.width, D = (o - i) / (a - r), O = void 0, k = void 0, A = void 0, j = void 0, M = void 0, N = void 0;
522
+ if (-T === D ? r > a ? (n[0] = u, n[1] = d, C = !0) : (n[0] = l, n[1] = c, C = !0) : T === D && (r > a ? (n[0] = s, n[1] = c, C = !0) : (n[0] = f, n[1] = d, C = !0)), -E === D ? a > r ? (n[2] = v, n[3] = y, w = !0) : (n[2] = _, n[3] = g, w = !0) : E === D && (a > r ? (n[2] = h, n[3] = g, w = !0) : (n[2] = b, n[3] = y, w = !0)), C && w) return !1;
523
+ if (r > a ? i > o ? (O = this.getCardinalDirection(T, D, 4), k = this.getCardinalDirection(E, D, 2)) : (O = this.getCardinalDirection(-T, D, 3), k = this.getCardinalDirection(-E, D, 1)) : i > o ? (O = this.getCardinalDirection(-T, D, 1), k = this.getCardinalDirection(-E, D, 3)) : (O = this.getCardinalDirection(T, D, 2), k = this.getCardinalDirection(E, D, 4)), !C) switch (O) {
524
+ case 1:
525
+ j = c, A = r + -m / D, n[0] = A, n[1] = j;
526
+ break;
527
+ case 2:
528
+ A = f, j = i + p * D, n[0] = A, n[1] = j;
529
+ break;
530
+ case 3:
531
+ j = d, A = r + m / D, n[0] = A, n[1] = j;
532
+ break;
533
+ case 4: A = u, j = i + -p * D, n[0] = A, n[1] = j;
534
+ }
535
+ if (!w) switch (k) {
536
+ case 1:
537
+ N = g, M = a + -S / D, n[2] = M, n[3] = N;
538
+ break;
539
+ case 2:
540
+ M = b, N = o + x * D, n[2] = M, n[3] = N;
541
+ break;
542
+ case 3:
543
+ N = y, M = a + S / D, n[2] = M, n[3] = N;
544
+ break;
545
+ case 4: M = v, N = o + -x * D, n[2] = M, n[3] = N;
546
+ }
547
+ }
548
+ return !1;
549
+ }, i.getCardinalDirection = function(e, t, n) {
550
+ return e > t ? n : 1 + n % 4;
551
+ }, i.getIntersection = function(e, t, n, i) {
552
+ if (i == null) return this.getIntersection2(e, t, n);
553
+ var a = e.x, o = e.y, s = t.x, c = t.y, l = n.x, u = n.y, d = i.x, f = i.y, p = void 0, m = void 0, h = void 0, g = void 0, _ = void 0, v = void 0, y = void 0, b = void 0, x = void 0;
554
+ return h = c - o, _ = a - s, y = s * o - a * c, g = f - u, v = l - d, b = d * u - l * f, x = h * v - g * _, x === 0 ? null : (p = (_ * b - v * y) / x, m = (g * y - h * b) / x, new r(p, m));
555
+ }, i.angleOfVector = function(e, t, n, r) {
556
+ var i = void 0;
557
+ return e === n ? i = r < t ? this.ONE_AND_HALF_PI : this.HALF_PI : (i = Math.atan((r - t) / (n - e)), n < e ? i += Math.PI : r < t && (i += this.TWO_PI)), i;
558
+ }, i.doIntersect = function(e, t, n, r) {
559
+ var i = e.x, a = e.y, o = t.x, s = t.y, c = n.x, l = n.y, u = r.x, d = r.y, f = (o - i) * (d - l) - (u - c) * (s - a);
560
+ if (f === 0) return !1;
561
+ var p = ((d - l) * (u - i) + (c - u) * (d - a)) / f, m = ((a - s) * (u - i) + (o - i) * (d - a)) / f;
562
+ return 0 < p && p < 1 && 0 < m && m < 1;
563
+ }, i.HALF_PI = .5 * Math.PI, i.ONE_AND_HALF_PI = 1.5 * Math.PI, i.TWO_PI = 2 * Math.PI, i.THREE_PI = 3 * Math.PI, e.exports = i;
564
+ }),
565
+ (function(e, t, n) {
566
+ function r() {}
567
+ r.sign = function(e) {
568
+ return e > 0 ? 1 : e < 0 ? -1 : 0;
569
+ }, r.floor = function(e) {
570
+ return e < 0 ? Math.ceil(e) : Math.floor(e);
571
+ }, r.ceil = function(e) {
572
+ return e < 0 ? Math.floor(e) : Math.ceil(e);
573
+ }, e.exports = r;
574
+ }),
575
+ (function(e, t, n) {
576
+ function r() {}
577
+ r.MAX_VALUE = 2147483647, r.MIN_VALUE = -2147483648, e.exports = r;
578
+ }),
579
+ (function(e, t, n) {
580
+ var r = function() {
581
+ function e(e, t) {
582
+ for (var n = 0; n < t.length; n++) {
583
+ var r = t[n];
584
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
585
+ }
586
+ }
587
+ return function(t, n, r) {
588
+ return n && e(t.prototype, n), r && e(t, r), t;
589
+ };
590
+ }();
591
+ function i(e, t) {
592
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
593
+ }
594
+ var a = function(e) {
595
+ return {
596
+ value: e,
597
+ next: null,
598
+ prev: null
599
+ };
600
+ }, o = function(e, t, n, r) {
601
+ return e === null ? r.head = t : e.next = t, n === null ? r.tail = t : n.prev = t, t.prev = e, t.next = n, r.length++, t;
602
+ }, s = function(e, t) {
603
+ var n = e.prev, r = e.next;
604
+ return n === null ? t.head = r : n.next = r, r === null ? t.tail = n : r.prev = n, e.prev = e.next = null, t.length--, e;
605
+ };
606
+ e.exports = function() {
607
+ function e(t) {
608
+ var n = this;
609
+ i(this, e), this.length = 0, this.head = null, this.tail = null, t?.forEach(function(e) {
610
+ return n.push(e);
611
+ });
612
+ }
613
+ return r(e, [
614
+ {
615
+ key: "size",
616
+ value: function() {
617
+ return this.length;
618
+ }
619
+ },
620
+ {
621
+ key: "insertBefore",
622
+ value: function(e, t) {
623
+ return o(t.prev, a(e), t, this);
624
+ }
625
+ },
626
+ {
627
+ key: "insertAfter",
628
+ value: function(e, t) {
629
+ return o(t, a(e), t.next, this);
630
+ }
631
+ },
632
+ {
633
+ key: "insertNodeBefore",
634
+ value: function(e, t) {
635
+ return o(t.prev, e, t, this);
636
+ }
637
+ },
638
+ {
639
+ key: "insertNodeAfter",
640
+ value: function(e, t) {
641
+ return o(t, e, t.next, this);
642
+ }
643
+ },
644
+ {
645
+ key: "push",
646
+ value: function(e) {
647
+ return o(this.tail, a(e), null, this);
648
+ }
649
+ },
650
+ {
651
+ key: "unshift",
652
+ value: function(e) {
653
+ return o(null, a(e), this.head, this);
654
+ }
655
+ },
656
+ {
657
+ key: "remove",
658
+ value: function(e) {
659
+ return s(e, this);
660
+ }
661
+ },
662
+ {
663
+ key: "pop",
664
+ value: function() {
665
+ return s(this.tail, this).value;
666
+ }
667
+ },
668
+ {
669
+ key: "popNode",
670
+ value: function() {
671
+ return s(this.tail, this);
672
+ }
673
+ },
674
+ {
675
+ key: "shift",
676
+ value: function() {
677
+ return s(this.head, this).value;
678
+ }
679
+ },
680
+ {
681
+ key: "shiftNode",
682
+ value: function() {
683
+ return s(this.head, this);
684
+ }
685
+ },
686
+ {
687
+ key: "get_object_at",
688
+ value: function(e) {
689
+ if (e <= this.length()) {
690
+ for (var t = 1, n = this.head; t < e;) n = n.next, t++;
691
+ return n.value;
692
+ }
693
+ }
694
+ },
695
+ {
696
+ key: "set_object_at",
697
+ value: function(e, t) {
698
+ if (e <= this.length()) {
699
+ for (var n = 1, r = this.head; n < e;) r = r.next, n++;
700
+ r.value = t;
701
+ }
702
+ }
703
+ }
704
+ ]), e;
705
+ }();
706
+ }),
707
+ (function(e, t, n) {
708
+ function r(e, t, n) {
709
+ this.x = null, this.y = null, e == null && t == null && n == null ? (this.x = 0, this.y = 0) : typeof e == "number" && typeof t == "number" && n == null ? (this.x = e, this.y = t) : e.constructor.name == "Point" && t == null && n == null && (n = e, this.x = n.x, this.y = n.y);
710
+ }
711
+ r.prototype.getX = function() {
712
+ return this.x;
713
+ }, r.prototype.getY = function() {
714
+ return this.y;
715
+ }, r.prototype.getLocation = function() {
716
+ return new r(this.x, this.y);
717
+ }, r.prototype.setLocation = function(e, t, n) {
718
+ e.constructor.name == "Point" && t == null && n == null ? (n = e, this.setLocation(n.x, n.y)) : typeof e == "number" && typeof t == "number" && n == null && (parseInt(e) == e && parseInt(t) == t ? this.move(e, t) : (this.x = Math.floor(e + .5), this.y = Math.floor(t + .5)));
719
+ }, r.prototype.move = function(e, t) {
720
+ this.x = e, this.y = t;
721
+ }, r.prototype.translate = function(e, t) {
722
+ this.x += e, this.y += t;
723
+ }, r.prototype.equals = function(e) {
724
+ if (e.constructor.name == "Point") {
725
+ var t = e;
726
+ return this.x == t.x && this.y == t.y;
727
+ }
728
+ return this == e;
729
+ }, r.prototype.toString = function() {
730
+ return new r().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
731
+ }, e.exports = r;
732
+ }),
733
+ (function(e, t, n) {
734
+ function r(e, t, n, r) {
735
+ this.x = 0, this.y = 0, this.width = 0, this.height = 0, e != null && t != null && n != null && r != null && (this.x = e, this.y = t, this.width = n, this.height = r);
736
+ }
737
+ r.prototype.getX = function() {
738
+ return this.x;
739
+ }, r.prototype.setX = function(e) {
740
+ this.x = e;
741
+ }, r.prototype.getY = function() {
742
+ return this.y;
743
+ }, r.prototype.setY = function(e) {
744
+ this.y = e;
745
+ }, r.prototype.getWidth = function() {
746
+ return this.width;
747
+ }, r.prototype.setWidth = function(e) {
748
+ this.width = e;
749
+ }, r.prototype.getHeight = function() {
750
+ return this.height;
751
+ }, r.prototype.setHeight = function(e) {
752
+ this.height = e;
753
+ }, r.prototype.getRight = function() {
754
+ return this.x + this.width;
755
+ }, r.prototype.getBottom = function() {
756
+ return this.y + this.height;
757
+ }, r.prototype.intersects = function(e) {
758
+ return !(this.getRight() < e.x || this.getBottom() < e.y || e.getRight() < this.x || e.getBottom() < this.y);
759
+ }, r.prototype.getCenterX = function() {
760
+ return this.x + this.width / 2;
761
+ }, r.prototype.getMinX = function() {
762
+ return this.getX();
763
+ }, r.prototype.getMaxX = function() {
764
+ return this.getX() + this.width;
765
+ }, r.prototype.getCenterY = function() {
766
+ return this.y + this.height / 2;
767
+ }, r.prototype.getMinY = function() {
768
+ return this.getY();
769
+ }, r.prototype.getMaxY = function() {
770
+ return this.getY() + this.height;
771
+ }, r.prototype.getWidthHalf = function() {
772
+ return this.width / 2;
773
+ }, r.prototype.getHeightHalf = function() {
774
+ return this.height / 2;
775
+ }, e.exports = r;
776
+ }),
777
+ (function(e, t, n) {
778
+ var r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
779
+ return typeof e;
780
+ } : function(e) {
781
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
782
+ };
783
+ function i() {}
784
+ i.lastID = 0, i.createID = function(e) {
785
+ return i.isPrimitive(e) ? e : e.uniqueID == null ? (e.uniqueID = i.getString(), i.lastID++, e.uniqueID) : e.uniqueID;
786
+ }, i.getString = function(e) {
787
+ return e ??= i.lastID, "Object#" + e;
788
+ }, i.isPrimitive = function(e) {
789
+ var t = e === void 0 ? "undefined" : r(e);
790
+ return e == null || t != "object" && t != "function";
791
+ }, e.exports = i;
792
+ }),
793
+ (function(e, t, n) {
794
+ function r(e) {
795
+ if (Array.isArray(e)) {
796
+ for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
797
+ return n;
798
+ }
799
+ return Array.from(e);
800
+ }
801
+ var i = n(0), a = n(6), o = n(3), s = n(1), c = n(5), l = n(4), u = n(17), d = n(27);
802
+ function f(e) {
803
+ d.call(this), this.layoutQuality = i.QUALITY, this.createBendsAsNeeded = i.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = i.DEFAULT_INCREMENTAL, this.animationOnLayout = i.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = i.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = i.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = i.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new a(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, e != null && (this.isRemoteUse = e);
804
+ }
805
+ f.RANDOM_SEED = 1, f.prototype = Object.create(d.prototype), f.prototype.getGraphManager = function() {
806
+ return this.graphManager;
807
+ }, f.prototype.getAllNodes = function() {
808
+ return this.graphManager.getAllNodes();
809
+ }, f.prototype.getAllEdges = function() {
810
+ return this.graphManager.getAllEdges();
811
+ }, f.prototype.getAllNodesToApplyGravitation = function() {
812
+ return this.graphManager.getAllNodesToApplyGravitation();
813
+ }, f.prototype.newGraphManager = function() {
814
+ var e = new a(this);
815
+ return this.graphManager = e, e;
816
+ }, f.prototype.newGraph = function(e) {
817
+ return new c(null, this.graphManager, e);
818
+ }, f.prototype.newNode = function(e) {
819
+ return new o(this.graphManager, e);
820
+ }, f.prototype.newEdge = function(e) {
821
+ return new s(null, null, e);
822
+ }, f.prototype.checkLayoutSuccess = function() {
823
+ return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
824
+ }, f.prototype.runLayout = function() {
825
+ this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
826
+ var e = !this.checkLayoutSuccess() && this.layout();
827
+ return i.ANIMATE !== "during" && (e && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, e);
828
+ }, f.prototype.doPostLayout = function() {
829
+ this.incremental || this.transform(), this.update();
830
+ }, f.prototype.update2 = function() {
831
+ if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
832
+ for (var e = this.graphManager.getAllEdges(), t = 0; t < e.length; t++) e[t];
833
+ for (var n = this.graphManager.getRoot().getNodes(), t = 0; t < n.length; t++) n[t];
834
+ this.update(this.graphManager.getRoot());
835
+ }
836
+ }, f.prototype.update = function(e) {
837
+ if (e == null) this.update2();
838
+ else if (e instanceof o) {
839
+ var t = e;
840
+ if (t.getChild() != null) for (var n = t.getChild().getNodes(), r = 0; r < n.length; r++) update(n[r]);
841
+ t.vGraphObject != null && t.vGraphObject.update(t);
842
+ } else if (e instanceof s) {
843
+ var i = e;
844
+ i.vGraphObject != null && i.vGraphObject.update(i);
845
+ } else if (e instanceof c) {
846
+ var a = e;
847
+ a.vGraphObject != null && a.vGraphObject.update(a);
848
+ }
849
+ }, f.prototype.initParameters = function() {
850
+ this.isSubLayout || (this.layoutQuality = i.QUALITY, this.animationDuringLayout = i.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = i.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = i.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = i.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = i.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = i.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
851
+ }, f.prototype.transform = function(e) {
852
+ if (e == null) this.transform(new l(0, 0));
853
+ else {
854
+ var t = new u(), n = this.graphManager.getRoot().updateLeftTop();
855
+ if (n != null) {
856
+ t.setWorldOrgX(e.x), t.setWorldOrgY(e.y), t.setDeviceOrgX(n.x), t.setDeviceOrgY(n.y);
857
+ for (var r = this.getAllNodes(), i, a = 0; a < r.length; a++) i = r[a], i.transform(t);
858
+ }
859
+ }
860
+ }, f.prototype.positionNodesRandomly = function(e) {
861
+ if (e == null) this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
862
+ else for (var t, n, r = e.getNodes(), i = 0; i < r.length; i++) t = r[i], n = t.getChild(), n == null || n.getNodes().length == 0 ? t.scatter() : (this.positionNodesRandomly(n), t.updateBounds());
863
+ }, f.prototype.getFlatForest = function() {
864
+ for (var e = [], t = !0, n = this.graphManager.getRoot().getNodes(), i = !0, a = 0; a < n.length; a++) n[a].getChild() != null && (i = !1);
865
+ if (!i) return e;
866
+ var o = /* @__PURE__ */ new Set(), s = [], c = /* @__PURE__ */ new Map(), l = [];
867
+ for (l = l.concat(n); l.length > 0 && t;) {
868
+ for (s.push(l[0]); s.length > 0 && t;) {
869
+ var u = s[0];
870
+ s.splice(0, 1), o.add(u);
871
+ for (var d = u.getEdges(), a = 0; a < d.length; a++) {
872
+ var f = d[a].getOtherEnd(u);
873
+ if (c.get(u) != f) {
874
+ if (!o.has(f)) s.push(f), c.set(f, u);
875
+ else {
876
+ t = !1;
877
+ break;
878
+ }
879
+ }
880
+ }
881
+ }
882
+ if (!t) e = [];
883
+ else {
884
+ var p = [].concat(r(o));
885
+ e.push(p);
886
+ for (var a = 0; a < p.length; a++) {
887
+ var m = p[a], h = l.indexOf(m);
888
+ h > -1 && l.splice(h, 1);
889
+ }
890
+ o = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
891
+ }
892
+ }
893
+ return e;
894
+ }, f.prototype.createDummyNodesForBendpoints = function(e) {
895
+ for (var t = [], n = e.source, r = this.graphManager.calcLowestCommonAncestor(e.source, e.target), i = 0; i < e.bendpoints.length; i++) {
896
+ var a = this.newNode(null);
897
+ a.setRect(new Point(0, 0), new Dimension(1, 1)), r.add(a);
898
+ var o = this.newEdge(null);
899
+ this.graphManager.add(o, n, a), t.add(a), n = a;
900
+ }
901
+ var o = this.newEdge(null);
902
+ return this.graphManager.add(o, n, e.target), this.edgeToDummyNodes.set(e, t), e.isInterGraph() ? this.graphManager.remove(e) : r.remove(e), t;
903
+ }, f.prototype.createBendpointsFromDummyNodes = function() {
904
+ var e = [];
905
+ e = e.concat(this.graphManager.getAllEdges()), e = [].concat(r(this.edgeToDummyNodes.keys()), e);
906
+ for (var t = 0; t < e.length; t++) {
907
+ var n = e[t];
908
+ if (n.bendpoints.length > 0) {
909
+ for (var i = this.edgeToDummyNodes.get(n), a = 0; a < i.length; a++) {
910
+ var o = i[a], s = new l(o.getCenterX(), o.getCenterY()), c = n.bendpoints.get(a);
911
+ c.x = s.x, c.y = s.y, o.getOwner().remove(o);
912
+ }
913
+ this.graphManager.add(n, n.source, n.target);
914
+ }
915
+ }
916
+ }, f.transform = function(e, t, n, r) {
917
+ if (n != null && r != null) {
918
+ var i = t;
919
+ if (e <= 50) {
920
+ var a = t / n;
921
+ i -= (t - a) / 50 * (50 - e);
922
+ } else {
923
+ var o = t * r;
924
+ i += (o - t) / 50 * (e - 50);
925
+ }
926
+ return i;
927
+ }
928
+ var s, c;
929
+ return e <= 50 ? (s = 9 * t / 500, c = t / 10) : (s = 9 * t / 50, c = -8 * t), s * e + c;
930
+ }, f.findCenterOfTree = function(e) {
931
+ var t = [];
932
+ t = t.concat(e);
933
+ var n = [], r = /* @__PURE__ */ new Map(), i = !1, a = null;
934
+ (t.length == 1 || t.length == 2) && (i = !0, a = t[0]);
935
+ for (var o = 0; o < t.length; o++) {
936
+ var s = t[o], c = s.getNeighborsList().size;
937
+ r.set(s, s.getNeighborsList().size), c == 1 && n.push(s);
938
+ }
939
+ var l = [];
940
+ for (l = l.concat(n); !i;) {
941
+ var u = [];
942
+ u = u.concat(l), l = [];
943
+ for (var o = 0; o < t.length; o++) {
944
+ var s = t[o], d = t.indexOf(s);
945
+ d >= 0 && t.splice(d, 1), s.getNeighborsList().forEach(function(e) {
946
+ if (n.indexOf(e) < 0) {
947
+ var t = r.get(e) - 1;
948
+ t == 1 && l.push(e), r.set(e, t);
949
+ }
950
+ });
951
+ }
952
+ n = n.concat(l), (t.length == 1 || t.length == 2) && (i = !0, a = t[0]);
953
+ }
954
+ return a;
955
+ }, f.prototype.setGraphManager = function(e) {
956
+ this.graphManager = e;
957
+ }, e.exports = f;
958
+ }),
959
+ (function(e, t, n) {
960
+ function r() {}
961
+ r.seed = 1, r.x = 0, r.nextDouble = function() {
962
+ return r.x = Math.sin(r.seed++) * 1e4, r.x - Math.floor(r.x);
963
+ }, e.exports = r;
964
+ }),
965
+ (function(e, t, n) {
966
+ var r = n(4);
967
+ function i(e, t) {
968
+ this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
969
+ }
970
+ i.prototype.getWorldOrgX = function() {
971
+ return this.lworldOrgX;
972
+ }, i.prototype.setWorldOrgX = function(e) {
973
+ this.lworldOrgX = e;
974
+ }, i.prototype.getWorldOrgY = function() {
975
+ return this.lworldOrgY;
976
+ }, i.prototype.setWorldOrgY = function(e) {
977
+ this.lworldOrgY = e;
978
+ }, i.prototype.getWorldExtX = function() {
979
+ return this.lworldExtX;
980
+ }, i.prototype.setWorldExtX = function(e) {
981
+ this.lworldExtX = e;
982
+ }, i.prototype.getWorldExtY = function() {
983
+ return this.lworldExtY;
984
+ }, i.prototype.setWorldExtY = function(e) {
985
+ this.lworldExtY = e;
986
+ }, i.prototype.getDeviceOrgX = function() {
987
+ return this.ldeviceOrgX;
988
+ }, i.prototype.setDeviceOrgX = function(e) {
989
+ this.ldeviceOrgX = e;
990
+ }, i.prototype.getDeviceOrgY = function() {
991
+ return this.ldeviceOrgY;
992
+ }, i.prototype.setDeviceOrgY = function(e) {
993
+ this.ldeviceOrgY = e;
994
+ }, i.prototype.getDeviceExtX = function() {
995
+ return this.ldeviceExtX;
996
+ }, i.prototype.setDeviceExtX = function(e) {
997
+ this.ldeviceExtX = e;
998
+ }, i.prototype.getDeviceExtY = function() {
999
+ return this.ldeviceExtY;
1000
+ }, i.prototype.setDeviceExtY = function(e) {
1001
+ this.ldeviceExtY = e;
1002
+ }, i.prototype.transformX = function(e) {
1003
+ var t = 0, n = this.lworldExtX;
1004
+ return n != 0 && (t = this.ldeviceOrgX + (e - this.lworldOrgX) * this.ldeviceExtX / n), t;
1005
+ }, i.prototype.transformY = function(e) {
1006
+ var t = 0, n = this.lworldExtY;
1007
+ return n != 0 && (t = this.ldeviceOrgY + (e - this.lworldOrgY) * this.ldeviceExtY / n), t;
1008
+ }, i.prototype.inverseTransformX = function(e) {
1009
+ var t = 0, n = this.ldeviceExtX;
1010
+ return n != 0 && (t = this.lworldOrgX + (e - this.ldeviceOrgX) * this.lworldExtX / n), t;
1011
+ }, i.prototype.inverseTransformY = function(e) {
1012
+ var t = 0, n = this.ldeviceExtY;
1013
+ return n != 0 && (t = this.lworldOrgY + (e - this.ldeviceOrgY) * this.lworldExtY / n), t;
1014
+ }, i.prototype.inverseTransformPoint = function(e) {
1015
+ return new r(this.inverseTransformX(e.x), this.inverseTransformY(e.y));
1016
+ }, e.exports = i;
1017
+ }),
1018
+ (function(e, t, n) {
1019
+ function r(e) {
1020
+ if (Array.isArray(e)) {
1021
+ for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
1022
+ return n;
1023
+ }
1024
+ return Array.from(e);
1025
+ }
1026
+ var i = n(15), a = n(7), o = n(0), s = n(8), c = n(9);
1027
+ function l() {
1028
+ i.call(this), this.useSmartIdealEdgeLengthCalculation = a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.idealEdgeLength = a.DEFAULT_EDGE_LENGTH, this.springConstant = a.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = a.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = a.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = a.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = a.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * a.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = a.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = a.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = a.MAX_ITERATIONS;
1029
+ }
1030
+ for (var u in l.prototype = Object.create(i.prototype), i) l[u] = i[u];
1031
+ l.prototype.initParameters = function() {
1032
+ i.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1033
+ }, l.prototype.calcIdealEdgeLengths = function() {
1034
+ for (var e, t, n, r, i, s, c = this.getGraphManager().getAllEdges(), l = 0; l < c.length; l++) e = c[l], e.idealLength = this.idealEdgeLength, e.isInterGraph && (n = e.getSource(), r = e.getTarget(), i = e.getSourceInLca().getEstimatedSize(), s = e.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (e.idealLength += i + s - 2 * o.SIMPLE_NODE_SIZE), t = e.getLca().getInclusionTreeDepth(), e.idealLength += a.DEFAULT_EDGE_LENGTH * a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (n.getInclusionTreeDepth() + r.getInclusionTreeDepth() - 2 * t));
1035
+ }, l.prototype.initSpringEmbedder = function() {
1036
+ var e = this.getAllNodes().length;
1037
+ this.incremental ? (e > a.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * a.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (e - a.ADAPTATION_LOWER_NODE_LIMIT) / (a.ADAPTATION_UPPER_NODE_LIMIT - a.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - a.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = a.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (this.coolingFactor = e > a.ADAPTATION_LOWER_NODE_LIMIT ? Math.max(a.COOLING_ADAPTATION_FACTOR, 1 - (e - a.ADAPTATION_LOWER_NODE_LIMIT) / (a.ADAPTATION_UPPER_NODE_LIMIT - a.ADAPTATION_LOWER_NODE_LIMIT) * (1 - a.COOLING_ADAPTATION_FACTOR)) : 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = a.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1038
+ }, l.prototype.calcSpringForces = function() {
1039
+ for (var e = this.getAllEdges(), t, n = 0; n < e.length; n++) t = e[n], this.calcSpringForce(t, t.idealLength);
1040
+ }, l.prototype.calcRepulsionForces = function() {
1041
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n, r, i, o, s = this.getAllNodes(), c;
1042
+ if (this.useFRGridVariant) for (this.totalIterations % a.GRID_CALCULATION_CHECK_PERIOD == 1 && e && this.updateGrid(), c = /* @__PURE__ */ new Set(), n = 0; n < s.length; n++) i = s[n], this.calculateRepulsionForceOfANode(i, c, e, t), c.add(i);
1043
+ else for (n = 0; n < s.length; n++) for (i = s[n], r = n + 1; r < s.length; r++) o = s[r], i.getOwner() == o.getOwner() && this.calcRepulsionForce(i, o);
1044
+ }, l.prototype.calcGravitationalForces = function() {
1045
+ for (var e, t = this.getAllNodesToApplyGravitation(), n = 0; n < t.length; n++) e = t[n], this.calcGravitationalForce(e);
1046
+ }, l.prototype.moveNodes = function() {
1047
+ for (var e = this.getAllNodes(), t, n = 0; n < e.length; n++) t = e[n], t.move();
1048
+ }, l.prototype.calcSpringForce = function(e, t) {
1049
+ var n = e.getSource(), r = e.getTarget(), i, a, o, s;
1050
+ if (this.uniformLeafNodeSizes && n.getChild() == null && r.getChild() == null) e.updateLengthSimple();
1051
+ else if (e.updateLength(), e.isOverlapingSourceAndTarget) return;
1052
+ i = e.getLength(), i != 0 && (a = this.springConstant * (i - t), o = a * (e.lengthX / i), s = a * (e.lengthY / i), n.springForceX += o, n.springForceY += s, r.springForceX -= o, r.springForceY -= s);
1053
+ }, l.prototype.calcRepulsionForce = function(e, t) {
1054
+ var n = e.getRect(), r = t.getRect(), i = [, ,], o = [
1055
+ ,
1056
+ ,
1057
+ ,
1058
+ ,
1059
+ ], l, u, d, f, p, m, h;
1060
+ if (n.intersects(r)) {
1061
+ s.calcSeparationAmount(n, r, i, a.DEFAULT_EDGE_LENGTH / 2), m = 2 * i[0], h = 2 * i[1];
1062
+ var g = e.noOfChildren * t.noOfChildren / (e.noOfChildren + t.noOfChildren);
1063
+ e.repulsionForceX -= g * m, e.repulsionForceY -= g * h, t.repulsionForceX += g * m, t.repulsionForceY += g * h;
1064
+ } else this.uniformLeafNodeSizes && e.getChild() == null && t.getChild() == null ? (l = r.getCenterX() - n.getCenterX(), u = r.getCenterY() - n.getCenterY()) : (s.getIntersection(n, r, o), l = o[2] - o[0], u = o[3] - o[1]), Math.abs(l) < a.MIN_REPULSION_DIST && (l = c.sign(l) * a.MIN_REPULSION_DIST), Math.abs(u) < a.MIN_REPULSION_DIST && (u = c.sign(u) * a.MIN_REPULSION_DIST), d = l * l + u * u, f = Math.sqrt(d), p = this.repulsionConstant * e.noOfChildren * t.noOfChildren / d, m = p * l / f, h = p * u / f, e.repulsionForceX -= m, e.repulsionForceY -= h, t.repulsionForceX += m, t.repulsionForceY += h;
1065
+ }, l.prototype.calcGravitationalForce = function(e) {
1066
+ var t = e.getOwner(), n = (t.getRight() + t.getLeft()) / 2, r = (t.getTop() + t.getBottom()) / 2, i = e.getCenterX() - n, a = e.getCenterY() - r, o = Math.abs(i) + e.getWidth() / 2, s = Math.abs(a) + e.getHeight() / 2, c;
1067
+ e.getOwner() == this.graphManager.getRoot() ? (c = t.getEstimatedSize() * this.gravityRangeFactor, (o > c || s > c) && (e.gravitationForceX = -this.gravityConstant * i, e.gravitationForceY = -this.gravityConstant * a)) : (c = t.getEstimatedSize() * this.compoundGravityRangeFactor, (o > c || s > c) && (e.gravitationForceX = -this.gravityConstant * i * this.compoundGravityConstant, e.gravitationForceY = -this.gravityConstant * a * this.compoundGravityConstant));
1068
+ }, l.prototype.isConverged = function() {
1069
+ var e, t = !1;
1070
+ return this.totalIterations > this.maxIterations / 3 && (t = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), e = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, e || t;
1071
+ }, l.prototype.animate = function() {
1072
+ this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1073
+ }, l.prototype.calcNoOfChildrenForAllNodes = function() {
1074
+ for (var e, t = this.graphManager.getAllNodes(), n = 0; n < t.length; n++) e = t[n], e.noOfChildren = e.getNoOfChildren();
1075
+ }, l.prototype.calcGrid = function(e) {
1076
+ var t = 0, n = 0;
1077
+ t = parseInt(Math.ceil((e.getRight() - e.getLeft()) / this.repulsionRange)), n = parseInt(Math.ceil((e.getBottom() - e.getTop()) / this.repulsionRange));
1078
+ for (var r = Array(t), i = 0; i < t; i++) r[i] = Array(n);
1079
+ for (var i = 0; i < t; i++) for (var a = 0; a < n; a++) r[i][a] = [];
1080
+ return r;
1081
+ }, l.prototype.addNodeToGrid = function(e, t, n) {
1082
+ var r = 0, i = 0, a = 0, o = 0;
1083
+ r = parseInt(Math.floor((e.getRect().x - t) / this.repulsionRange)), i = parseInt(Math.floor((e.getRect().width + e.getRect().x - t) / this.repulsionRange)), a = parseInt(Math.floor((e.getRect().y - n) / this.repulsionRange)), o = parseInt(Math.floor((e.getRect().height + e.getRect().y - n) / this.repulsionRange));
1084
+ for (var s = r; s <= i; s++) for (var c = a; c <= o; c++) this.grid[s][c].push(e), e.setGridCoordinates(r, i, a, o);
1085
+ }, l.prototype.updateGrid = function() {
1086
+ var e, t, n = this.getAllNodes();
1087
+ for (this.grid = this.calcGrid(this.graphManager.getRoot()), e = 0; e < n.length; e++) t = n[e], this.addNodeToGrid(t, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1088
+ }, l.prototype.calculateRepulsionForceOfANode = function(e, t, n, i) {
1089
+ if (this.totalIterations % a.GRID_CALCULATION_CHECK_PERIOD == 1 && n || i) {
1090
+ var o = /* @__PURE__ */ new Set();
1091
+ e.surrounding = [];
1092
+ for (var s, c = this.grid, l = e.startX - 1; l < e.finishX + 2; l++) for (var u = e.startY - 1; u < e.finishY + 2; u++) if (!(l < 0 || u < 0 || l >= c.length || u >= c[0].length)) {
1093
+ for (var d = 0; d < c[l][u].length; d++) if (s = c[l][u][d], e.getOwner() == s.getOwner() && e != s && !t.has(s) && !o.has(s)) {
1094
+ var f = Math.abs(e.getCenterX() - s.getCenterX()) - (e.getWidth() / 2 + s.getWidth() / 2), p = Math.abs(e.getCenterY() - s.getCenterY()) - (e.getHeight() / 2 + s.getHeight() / 2);
1095
+ f <= this.repulsionRange && p <= this.repulsionRange && o.add(s);
1096
+ }
1097
+ }
1098
+ e.surrounding = [].concat(r(o));
1099
+ }
1100
+ for (l = 0; l < e.surrounding.length; l++) this.calcRepulsionForce(e, e.surrounding[l]);
1101
+ }, l.prototype.calcRepulsionRange = function() {
1102
+ return 0;
1103
+ }, e.exports = l;
1104
+ }),
1105
+ (function(e, t, n) {
1106
+ var r = n(1), i = n(7);
1107
+ function a(e, t, n) {
1108
+ r.call(this, e, t, n), this.idealLength = i.DEFAULT_EDGE_LENGTH;
1109
+ }
1110
+ for (var o in a.prototype = Object.create(r.prototype), r) a[o] = r[o];
1111
+ e.exports = a;
1112
+ }),
1113
+ (function(e, t, n) {
1114
+ var r = n(3);
1115
+ function i(e, t, n, i) {
1116
+ r.call(this, e, t, n, i), 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 = [];
1117
+ }
1118
+ for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1119
+ i.prototype.setGridCoordinates = function(e, t, n, r) {
1120
+ this.startX = e, this.finishX = t, this.startY = n, this.finishY = r;
1121
+ }, e.exports = i;
1122
+ }),
1123
+ (function(e, t, n) {
1124
+ function r(e, t) {
1125
+ this.width = 0, this.height = 0, e !== null && t !== null && (this.height = t, this.width = e);
1126
+ }
1127
+ r.prototype.getWidth = function() {
1128
+ return this.width;
1129
+ }, r.prototype.setWidth = function(e) {
1130
+ this.width = e;
1131
+ }, r.prototype.getHeight = function() {
1132
+ return this.height;
1133
+ }, r.prototype.setHeight = function(e) {
1134
+ this.height = e;
1135
+ }, e.exports = r;
1136
+ }),
1137
+ (function(e, t, n) {
1138
+ var r = n(14);
1139
+ function i() {
1140
+ this.map = {}, this.keys = [];
1141
+ }
1142
+ i.prototype.put = function(e, t) {
1143
+ var n = r.createID(e);
1144
+ this.contains(n) || (this.map[n] = t, this.keys.push(e));
1145
+ }, i.prototype.contains = function(e) {
1146
+ return r.createID(e), this.map[e] != null;
1147
+ }, i.prototype.get = function(e) {
1148
+ var t = r.createID(e);
1149
+ return this.map[t];
1150
+ }, i.prototype.keySet = function() {
1151
+ return this.keys;
1152
+ }, e.exports = i;
1153
+ }),
1154
+ (function(e, t, n) {
1155
+ var r = n(14);
1156
+ function i() {
1157
+ this.set = {};
1158
+ }
1159
+ i.prototype.add = function(e) {
1160
+ var t = r.createID(e);
1161
+ this.contains(t) || (this.set[t] = e);
1162
+ }, i.prototype.remove = function(e) {
1163
+ delete this.set[r.createID(e)];
1164
+ }, i.prototype.clear = function() {
1165
+ this.set = {};
1166
+ }, i.prototype.contains = function(e) {
1167
+ return this.set[r.createID(e)] == e;
1168
+ }, i.prototype.isEmpty = function() {
1169
+ return this.size() === 0;
1170
+ }, i.prototype.size = function() {
1171
+ return Object.keys(this.set).length;
1172
+ }, i.prototype.addAllTo = function(e) {
1173
+ for (var t = Object.keys(this.set), n = t.length, r = 0; r < n; r++) e.push(this.set[t[r]]);
1174
+ }, i.prototype.size = function() {
1175
+ return Object.keys(this.set).length;
1176
+ }, i.prototype.addAll = function(e) {
1177
+ for (var t = e.length, n = 0; n < t; n++) {
1178
+ var r = e[n];
1179
+ this.add(r);
1180
+ }
1181
+ }, e.exports = i;
1182
+ }),
1183
+ (function(e, t, n) {
1184
+ var r = function() {
1185
+ function e(e, t) {
1186
+ for (var n = 0; n < t.length; n++) {
1187
+ var r = t[n];
1188
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
1189
+ }
1190
+ }
1191
+ return function(t, n, r) {
1192
+ return n && e(t.prototype, n), r && e(t, r), t;
1193
+ };
1194
+ }();
1195
+ function i(e, t) {
1196
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
1197
+ }
1198
+ var a = n(11);
1199
+ e.exports = function() {
1200
+ function e(t, n) {
1201
+ i(this, e), (n !== null || n !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1202
+ var r = void 0;
1203
+ r = t instanceof a ? t.size() : t.length, this._quicksort(t, 0, r - 1);
1204
+ }
1205
+ return r(e, [
1206
+ {
1207
+ key: "_quicksort",
1208
+ value: function(e, t, n) {
1209
+ if (t < n) {
1210
+ var r = this._partition(e, t, n);
1211
+ this._quicksort(e, t, r), this._quicksort(e, r + 1, n);
1212
+ }
1213
+ }
1214
+ },
1215
+ {
1216
+ key: "_partition",
1217
+ value: function(e, t, n) {
1218
+ for (var r = this._get(e, t), i = t, a = n;;) {
1219
+ for (; this.compareFunction(r, this._get(e, a));) a--;
1220
+ for (; this.compareFunction(this._get(e, i), r);) i++;
1221
+ if (i < a) this._swap(e, i, a), i++, a--;
1222
+ else return a;
1223
+ }
1224
+ }
1225
+ },
1226
+ {
1227
+ key: "_get",
1228
+ value: function(e, t) {
1229
+ return e instanceof a ? e.get_object_at(t) : e[t];
1230
+ }
1231
+ },
1232
+ {
1233
+ key: "_set",
1234
+ value: function(e, t, n) {
1235
+ e instanceof a ? e.set_object_at(t, n) : e[t] = n;
1236
+ }
1237
+ },
1238
+ {
1239
+ key: "_swap",
1240
+ value: function(e, t, n) {
1241
+ var r = this._get(e, t);
1242
+ this._set(e, t, this._get(e, n)), this._set(e, n, r);
1243
+ }
1244
+ },
1245
+ {
1246
+ key: "_defaultCompareFunction",
1247
+ value: function(e, t) {
1248
+ return t > e;
1249
+ }
1250
+ }
1251
+ ]), e;
1252
+ }();
1253
+ }),
1254
+ (function(e, t, n) {
1255
+ var r = function() {
1256
+ function e(e, t) {
1257
+ for (var n = 0; n < t.length; n++) {
1258
+ var r = t[n];
1259
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
1260
+ }
1261
+ }
1262
+ return function(t, n, r) {
1263
+ return n && e(t.prototype, n), r && e(t, r), t;
1264
+ };
1265
+ }();
1266
+ function i(e, t) {
1267
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
1268
+ }
1269
+ e.exports = function() {
1270
+ function e(t, n) {
1271
+ var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1272
+ i(this, e), this.sequence1 = t, this.sequence2 = n, this.match_score = r, this.mismatch_penalty = a, this.gap_penalty = o, this.iMax = t.length + 1, this.jMax = n.length + 1, this.grid = Array(this.iMax);
1273
+ for (var s = 0; s < this.iMax; s++) {
1274
+ this.grid[s] = Array(this.jMax);
1275
+ for (var c = 0; c < this.jMax; c++) this.grid[s][c] = 0;
1276
+ }
1277
+ this.tracebackGrid = Array(this.iMax);
1278
+ for (var l = 0; l < this.iMax; l++) {
1279
+ this.tracebackGrid[l] = Array(this.jMax);
1280
+ for (var u = 0; u < this.jMax; u++) this.tracebackGrid[l][u] = [
1281
+ null,
1282
+ null,
1283
+ null
1284
+ ];
1285
+ }
1286
+ this.alignments = [], this.score = -1, this.computeGrids();
1287
+ }
1288
+ return r(e, [
1289
+ {
1290
+ key: "getScore",
1291
+ value: function() {
1292
+ return this.score;
1293
+ }
1294
+ },
1295
+ {
1296
+ key: "getAlignments",
1297
+ value: function() {
1298
+ return this.alignments;
1299
+ }
1300
+ },
1301
+ {
1302
+ key: "computeGrids",
1303
+ value: function() {
1304
+ for (var e = 1; e < this.jMax; e++) this.grid[0][e] = this.grid[0][e - 1] + this.gap_penalty, this.tracebackGrid[0][e] = [
1305
+ !1,
1306
+ !1,
1307
+ !0
1308
+ ];
1309
+ for (var t = 1; t < this.iMax; t++) this.grid[t][0] = this.grid[t - 1][0] + this.gap_penalty, this.tracebackGrid[t][0] = [
1310
+ !1,
1311
+ !0,
1312
+ !1
1313
+ ];
1314
+ for (var n = 1; n < this.iMax; n++) for (var r = 1; r < this.jMax; r++) {
1315
+ var i = void 0;
1316
+ i = this.sequence1[n - 1] === this.sequence2[r - 1] ? this.grid[n - 1][r - 1] + this.match_score : this.grid[n - 1][r - 1] + this.mismatch_penalty;
1317
+ var a = this.grid[n - 1][r] + this.gap_penalty, o = this.grid[n][r - 1] + this.gap_penalty, s = [
1318
+ i,
1319
+ a,
1320
+ o
1321
+ ], c = this.arrayAllMaxIndexes(s);
1322
+ this.grid[n][r] = s[c[0]], this.tracebackGrid[n][r] = [
1323
+ c.includes(0),
1324
+ c.includes(1),
1325
+ c.includes(2)
1326
+ ];
1327
+ }
1328
+ this.score = this.grid[this.iMax - 1][this.jMax - 1];
1329
+ }
1330
+ },
1331
+ {
1332
+ key: "alignmentTraceback",
1333
+ value: function() {
1334
+ var e = [];
1335
+ for (e.push({
1336
+ pos: [this.sequence1.length, this.sequence2.length],
1337
+ seq1: "",
1338
+ seq2: ""
1339
+ }); e[0];) {
1340
+ var t = e[0], n = this.tracebackGrid[t.pos[0]][t.pos[1]];
1341
+ n[0] && e.push({
1342
+ pos: [t.pos[0] - 1, t.pos[1] - 1],
1343
+ seq1: this.sequence1[t.pos[0] - 1] + t.seq1,
1344
+ seq2: this.sequence2[t.pos[1] - 1] + t.seq2
1345
+ }), n[1] && e.push({
1346
+ pos: [t.pos[0] - 1, t.pos[1]],
1347
+ seq1: this.sequence1[t.pos[0] - 1] + t.seq1,
1348
+ seq2: "-" + t.seq2
1349
+ }), n[2] && e.push({
1350
+ pos: [t.pos[0], t.pos[1] - 1],
1351
+ seq1: "-" + t.seq1,
1352
+ seq2: this.sequence2[t.pos[1] - 1] + t.seq2
1353
+ }), t.pos[0] === 0 && t.pos[1] === 0 && this.alignments.push({
1354
+ sequence1: t.seq1,
1355
+ sequence2: t.seq2
1356
+ }), e.shift();
1357
+ }
1358
+ return this.alignments;
1359
+ }
1360
+ },
1361
+ {
1362
+ key: "getAllIndexes",
1363
+ value: function(e, t) {
1364
+ for (var n = [], r = -1; (r = e.indexOf(t, r + 1)) !== -1;) n.push(r);
1365
+ return n;
1366
+ }
1367
+ },
1368
+ {
1369
+ key: "arrayAllMaxIndexes",
1370
+ value: function(e) {
1371
+ return this.getAllIndexes(e, Math.max.apply(null, e));
1372
+ }
1373
+ }
1374
+ ]), e;
1375
+ }();
1376
+ }),
1377
+ (function(e, t, n) {
1378
+ var r = function() {};
1379
+ r.FDLayout = n(18), r.FDLayoutConstants = n(7), r.FDLayoutEdge = n(19), r.FDLayoutNode = n(20), r.DimensionD = n(21), r.HashMap = n(22), r.HashSet = n(23), r.IGeometry = n(8), r.IMath = n(9), r.Integer = n(10), r.Point = n(12), r.PointD = n(4), r.RandomSeed = n(16), r.RectangleD = n(13), r.Transform = n(17), r.UniqueIDGeneretor = n(14), r.Quicksort = n(24), r.LinkedList = n(11), r.LGraphObject = n(2), r.LGraph = n(5), r.LEdge = n(1), r.LGraphManager = n(6), r.LNode = n(3), r.Layout = n(15), r.LayoutConstants = n(0), r.NeedlemanWunsch = n(25), e.exports = r;
1380
+ }),
1381
+ (function(e, t, n) {
1382
+ function r() {
1383
+ this.listeners = [];
1384
+ }
1385
+ var i = r.prototype;
1386
+ i.addListener = function(e, t) {
1387
+ this.listeners.push({
1388
+ event: e,
1389
+ callback: t
1390
+ });
1391
+ }, i.removeListener = function(e, t) {
1392
+ for (var n = this.listeners.length; n >= 0; n--) {
1393
+ var r = this.listeners[n];
1394
+ r.event === e && r.callback === t && this.listeners.splice(n, 1);
1395
+ }
1396
+ }, i.emit = function(e, t) {
1397
+ for (var n = 0; n < this.listeners.length; n++) {
1398
+ var r = this.listeners[n];
1399
+ e === r.event && r.callback(t);
1400
+ }
1401
+ }, e.exports = r;
1402
+ })
1403
+ ]);
1404
+ });
1405
+ })), s = /* @__PURE__ */ e(((e, t) => {
1406
+ (function(n, r) {
1407
+ typeof e == "object" && typeof t == "object" ? t.exports = r(o()) : typeof define == "function" && define.amd ? define(["layout-base"], r) : typeof e == "object" ? e.coseBase = r(o()) : n.coseBase = r(n.layoutBase);
1408
+ })(e, function(e) {
1409
+ return (function(e) {
1410
+ var t = {};
1411
+ function n(r) {
1412
+ if (t[r]) return t[r].exports;
1413
+ var i = t[r] = {
1414
+ i: r,
1415
+ l: !1,
1416
+ exports: {}
1417
+ };
1418
+ return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports;
1419
+ }
1420
+ return n.m = e, n.c = t, n.i = function(e) {
1421
+ return e;
1422
+ }, n.d = function(e, t, r) {
1423
+ n.o(e, t) || Object.defineProperty(e, t, {
1424
+ configurable: !1,
1425
+ enumerable: !0,
1426
+ get: r
1427
+ });
1428
+ }, n.n = function(e) {
1429
+ var t = e && e.__esModule ? function() {
1430
+ return e.default;
1431
+ } : function() {
1432
+ return e;
1433
+ };
1434
+ return n.d(t, "a", t), t;
1435
+ }, n.o = function(e, t) {
1436
+ return Object.prototype.hasOwnProperty.call(e, t);
1437
+ }, n.p = "", n(n.s = 7);
1438
+ })([
1439
+ (function(t, n) {
1440
+ t.exports = e;
1441
+ }),
1442
+ (function(e, t, n) {
1443
+ var r = n(0).FDLayoutConstants;
1444
+ function i() {}
1445
+ for (var a in r) i[a] = r[a];
1446
+ i.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, i.DEFAULT_RADIAL_SEPARATION = r.DEFAULT_EDGE_LENGTH, i.DEFAULT_COMPONENT_SEPERATION = 60, i.TILE = !0, i.TILING_PADDING_VERTICAL = 10, i.TILING_PADDING_HORIZONTAL = 10, i.TREE_REDUCTION_ON_INCREMENTAL = !1, e.exports = i;
1447
+ }),
1448
+ (function(e, t, n) {
1449
+ var r = n(0).FDLayoutEdge;
1450
+ function i(e, t, n) {
1451
+ r.call(this, e, t, n);
1452
+ }
1453
+ for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1454
+ e.exports = i;
1455
+ }),
1456
+ (function(e, t, n) {
1457
+ var r = n(0).LGraph;
1458
+ function i(e, t, n) {
1459
+ r.call(this, e, t, n);
1460
+ }
1461
+ for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1462
+ e.exports = i;
1463
+ }),
1464
+ (function(e, t, n) {
1465
+ var r = n(0).LGraphManager;
1466
+ function i(e) {
1467
+ r.call(this, e);
1468
+ }
1469
+ for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1470
+ e.exports = i;
1471
+ }),
1472
+ (function(e, t, n) {
1473
+ var r = n(0).FDLayoutNode, i = n(0).IMath;
1474
+ function a(e, t, n, i) {
1475
+ r.call(this, e, t, n, i);
1476
+ }
1477
+ for (var o in a.prototype = Object.create(r.prototype), r) a[o] = r[o];
1478
+ a.prototype.move = function() {
1479
+ var e = this.graphManager.getLayout();
1480
+ this.displacementX = e.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY = e.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren, Math.abs(this.displacementX) > e.coolingFactor * e.maxNodeDisplacement && (this.displacementX = e.coolingFactor * e.maxNodeDisplacement * i.sign(this.displacementX)), Math.abs(this.displacementY) > e.coolingFactor * e.maxNodeDisplacement && (this.displacementY = e.coolingFactor * e.maxNodeDisplacement * i.sign(this.displacementY)), this.child == null || this.child.getNodes().length == 0 ? this.moveBy(this.displacementX, this.displacementY) : this.propogateDisplacementToChildren(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;
1481
+ }, a.prototype.propogateDisplacementToChildren = function(e, t) {
1482
+ for (var n = this.getChild().getNodes(), r, i = 0; i < n.length; i++) r = n[i], r.getChild() == null ? (r.moveBy(e, t), r.displacementX += e, r.displacementY += t) : r.propogateDisplacementToChildren(e, t);
1483
+ }, a.prototype.setPred1 = function(e) {
1484
+ this.pred1 = e;
1485
+ }, a.prototype.getPred1 = function() {
1486
+ return pred1;
1487
+ }, a.prototype.getPred2 = function() {
1488
+ return pred2;
1489
+ }, a.prototype.setNext = function(e) {
1490
+ this.next = e;
1491
+ }, a.prototype.getNext = function() {
1492
+ return next;
1493
+ }, a.prototype.setProcessed = function(e) {
1494
+ this.processed = e;
1495
+ }, a.prototype.isProcessed = function() {
1496
+ return processed;
1497
+ }, e.exports = a;
1498
+ }),
1499
+ (function(e, t, n) {
1500
+ var r = n(0).FDLayout, i = n(4), a = n(3), o = n(5), s = n(2), c = n(1), l = n(0).FDLayoutConstants, u = n(0).LayoutConstants, d = n(0).Point, f = n(0).PointD, p = n(0).Layout, m = n(0).Integer, h = n(0).IGeometry, g = n(0).LGraph, _ = n(0).Transform;
1501
+ function v() {
1502
+ r.call(this), this.toBeTiled = {};
1503
+ }
1504
+ for (var y in v.prototype = Object.create(r.prototype), r) v[y] = r[y];
1505
+ v.prototype.newGraphManager = function() {
1506
+ var e = new i(this);
1507
+ return this.graphManager = e, e;
1508
+ }, v.prototype.newGraph = function(e) {
1509
+ return new a(null, this.graphManager, e);
1510
+ }, v.prototype.newNode = function(e) {
1511
+ return new o(this.graphManager, e);
1512
+ }, v.prototype.newEdge = function(e) {
1513
+ return new s(null, null, e);
1514
+ }, v.prototype.initParameters = function() {
1515
+ r.prototype.initParameters.call(this, arguments), this.isSubLayout || (this.idealEdgeLength = c.DEFAULT_EDGE_LENGTH < 10 ? 10 : c.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.springConstant = l.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = l.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = l.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = l.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = l.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1, this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / l.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = l.CONVERGENCE_CHECK_PERIOD / this.maxIterations, this.coolingAdjuster = 1);
1516
+ }, v.prototype.layout = function() {
1517
+ return u.DEFAULT_CREATE_BENDS_AS_NEEDED && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
1518
+ }, v.prototype.classicLayout = function() {
1519
+ 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) {
1520
+ var e = this.getFlatForest();
1521
+ if (e.length > 0) this.positionNodesRadially(e);
1522
+ else {
1523
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1524
+ var t = new Set(this.getAllNodes()), n = this.nodesWithGravity.filter(function(e) {
1525
+ return t.has(e);
1526
+ });
1527
+ this.graphManager.setAllNodesToApplyGravitation(n), this.positionNodesRandomly();
1528
+ }
1529
+ } else if (c.TREE_REDUCTION_ON_INCREMENTAL) {
1530
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1531
+ var t = new Set(this.getAllNodes()), n = this.nodesWithGravity.filter(function(e) {
1532
+ return t.has(e);
1533
+ });
1534
+ this.graphManager.setAllNodesToApplyGravitation(n);
1535
+ }
1536
+ return this.initSpringEmbedder(), this.runSpringEmbedder(), !0;
1537
+ }, v.prototype.tick = function() {
1538
+ if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) {
1539
+ if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
1540
+ else return !0;
1541
+ }
1542
+ if (this.totalIterations % l.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
1543
+ if (this.isConverged()) {
1544
+ if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
1545
+ else return !0;
1546
+ }
1547
+ this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), this.coolingFactor = Math.max(this.initialCoolingFactor - 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));
1548
+ }
1549
+ if (this.isTreeGrowing) {
1550
+ if (this.growTreeIterations % 10 == 0) {
1551
+ if (this.prunedNodesAll.length > 0) {
1552
+ this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
1553
+ var e = new Set(this.getAllNodes()), t = this.nodesWithGravity.filter(function(t) {
1554
+ return e.has(t);
1555
+ });
1556
+ this.graphManager.setAllNodesToApplyGravitation(t), this.graphManager.updateBounds(), this.updateGrid(), this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL;
1557
+ } else this.isTreeGrowing = !1, this.isGrowthFinished = !0;
1558
+ }
1559
+ this.growTreeIterations++;
1560
+ }
1561
+ if (this.isGrowthFinished) {
1562
+ if (this.isConverged()) return !0;
1563
+ this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
1564
+ }
1565
+ var n = !this.isTreeGrowing && !this.isGrowthFinished, r = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
1566
+ return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(n, r), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
1567
+ }, v.prototype.getPositionsData = function() {
1568
+ for (var e = this.graphManager.getAllNodes(), t = {}, n = 0; n < e.length; n++) {
1569
+ var r = e[n].rect, i = e[n].id;
1570
+ t[i] = {
1571
+ id: i,
1572
+ x: r.getCenterX(),
1573
+ y: r.getCenterY(),
1574
+ w: r.width,
1575
+ h: r.height
1576
+ };
1577
+ }
1578
+ return t;
1579
+ }, v.prototype.runSpringEmbedder = function() {
1580
+ this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
1581
+ var e = !1;
1582
+ if (l.ANIMATE === "during") this.emit("layoutstarted");
1583
+ else {
1584
+ for (; !e;) e = this.tick();
1585
+ this.graphManager.updateBounds();
1586
+ }
1587
+ }, v.prototype.calculateNodesToApplyGravitationTo = function() {
1588
+ var e = [], t, n = this.graphManager.getGraphs(), r = n.length, i;
1589
+ for (i = 0; i < r; i++) t = n[i], t.updateConnected(), t.isConnected || (e = e.concat(t.getNodes()));
1590
+ return e;
1591
+ }, v.prototype.createBendpoints = function() {
1592
+ var e = [];
1593
+ e = e.concat(this.graphManager.getAllEdges());
1594
+ var t = /* @__PURE__ */ new Set(), n;
1595
+ for (n = 0; n < e.length; n++) {
1596
+ var r = e[n];
1597
+ if (!t.has(r)) {
1598
+ var i = r.getSource(), a = r.getTarget();
1599
+ if (i == a) r.getBendpoints().push(new f()), r.getBendpoints().push(new f()), this.createDummyNodesForBendpoints(r), t.add(r);
1600
+ else {
1601
+ var o = [];
1602
+ if (o = o.concat(i.getEdgeListToNode(a)), o = o.concat(a.getEdgeListToNode(i)), !t.has(o[0])) {
1603
+ if (o.length > 1) {
1604
+ var s;
1605
+ for (s = 0; s < o.length; s++) {
1606
+ var c = o[s];
1607
+ c.getBendpoints().push(new f()), this.createDummyNodesForBendpoints(c);
1608
+ }
1609
+ }
1610
+ o.forEach(function(e) {
1611
+ t.add(e);
1612
+ });
1613
+ }
1614
+ }
1615
+ }
1616
+ if (t.size == e.length) break;
1617
+ }
1618
+ }, v.prototype.positionNodesRadially = function(e) {
1619
+ for (var t = new d(0, 0), n = Math.ceil(Math.sqrt(e.length)), r = 0, i = 0, a = 0, o = new f(0, 0), s = 0; s < e.length; s++) {
1620
+ s % n == 0 && (a = 0, i = r, s != 0 && (i += c.DEFAULT_COMPONENT_SEPERATION), r = 0);
1621
+ var l = e[s], m = p.findCenterOfTree(l);
1622
+ t.x = a, t.y = i, o = v.radialLayout(l, m, t), o.y > r && (r = Math.floor(o.y)), a = Math.floor(o.x + c.DEFAULT_COMPONENT_SEPERATION);
1623
+ }
1624
+ this.transform(new f(u.WORLD_CENTER_X - o.x / 2, u.WORLD_CENTER_Y - o.y / 2));
1625
+ }, v.radialLayout = function(e, t, n) {
1626
+ var r = Math.max(this.maxDiagonalInTree(e), c.DEFAULT_RADIAL_SEPARATION);
1627
+ v.branchRadialLayout(t, null, 0, 359, 0, r);
1628
+ var i = g.calculateBounds(e), a = new _();
1629
+ a.setDeviceOrgX(i.getMinX()), a.setDeviceOrgY(i.getMinY()), a.setWorldOrgX(n.x), a.setWorldOrgY(n.y);
1630
+ for (var o = 0; o < e.length; o++) e[o].transform(a);
1631
+ var s = new f(i.getMaxX(), i.getMaxY());
1632
+ return a.inverseTransformPoint(s);
1633
+ }, v.branchRadialLayout = function(e, t, n, r, i, a) {
1634
+ var o = (r - n + 1) / 2;
1635
+ o < 0 && (o += 180);
1636
+ var s = (o + n) % 360 * h.TWO_PI / 360, c = i * Math.cos(s), l = i * Math.sin(s);
1637
+ e.setCenter(c, l);
1638
+ var u = [];
1639
+ u = u.concat(e.getEdges());
1640
+ var d = u.length;
1641
+ t != null && d--;
1642
+ for (var f = 0, p = u.length, m, g = e.getEdgesBetween(t); g.length > 1;) {
1643
+ var _ = g[0];
1644
+ g.splice(0, 1);
1645
+ var y = u.indexOf(_);
1646
+ y >= 0 && u.splice(y, 1), p--, d--;
1647
+ }
1648
+ m = t == null ? 0 : (u.indexOf(g[0]) + 1) % p;
1649
+ for (var b = Math.abs(r - n) / d, x = m; f != d; x = ++x % p) {
1650
+ var S = u[x].getOtherEnd(e);
1651
+ if (S != t) {
1652
+ var C = (n + f * b) % 360, w = (C + b) % 360;
1653
+ v.branchRadialLayout(S, e, C, w, i + a, a), f++;
1654
+ }
1655
+ }
1656
+ }, v.maxDiagonalInTree = function(e) {
1657
+ for (var t = m.MIN_VALUE, n = 0; n < e.length; n++) {
1658
+ var r = e[n].getDiagonal();
1659
+ r > t && (t = r);
1660
+ }
1661
+ return t;
1662
+ }, v.prototype.calcRepulsionRange = function() {
1663
+ return 2 * (this.level + 1) * this.idealEdgeLength;
1664
+ }, v.prototype.groupZeroDegreeMembers = function() {
1665
+ var e = this, t = {};
1666
+ this.memberGroups = {}, this.idToDummyNode = {};
1667
+ for (var n = [], r = this.graphManager.getAllNodes(), i = 0; i < r.length; i++) {
1668
+ var a = r[i], s = a.getParent();
1669
+ this.getNodeDegreeWithChildren(a) === 0 && (s.id == null || !this.getToBeTiled(s)) && n.push(a);
1670
+ }
1671
+ for (var i = 0; i < n.length; i++) {
1672
+ var a = n[i], c = a.getParent().id;
1673
+ t[c] === void 0 && (t[c] = []), t[c] = t[c].concat(a);
1674
+ }
1675
+ Object.keys(t).forEach(function(n) {
1676
+ if (t[n].length > 1) {
1677
+ var r = "DummyCompound_" + n;
1678
+ e.memberGroups[r] = t[n];
1679
+ var i = t[n][0].getParent(), a = new o(e.graphManager);
1680
+ a.id = r, a.paddingLeft = i.paddingLeft || 0, a.paddingRight = i.paddingRight || 0, a.paddingBottom = i.paddingBottom || 0, a.paddingTop = i.paddingTop || 0, e.idToDummyNode[r] = a;
1681
+ var s = e.getGraphManager().add(e.newGraph(), a), c = i.getChild();
1682
+ c.add(a);
1683
+ for (var l = 0; l < t[n].length; l++) {
1684
+ var u = t[n][l];
1685
+ c.remove(u), s.add(u);
1686
+ }
1687
+ }
1688
+ });
1689
+ }, v.prototype.clearCompounds = function() {
1690
+ var e = {}, t = {};
1691
+ this.performDFSOnCompounds();
1692
+ for (var n = 0; n < this.compoundOrder.length; n++) t[this.compoundOrder[n].id] = this.compoundOrder[n], e[this.compoundOrder[n].id] = [].concat(this.compoundOrder[n].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[n].getChild()), this.compoundOrder[n].child = null;
1693
+ this.graphManager.resetAllNodes(), this.tileCompoundMembers(e, t);
1694
+ }, v.prototype.clearZeroDegreeMembers = function() {
1695
+ var e = this, t = this.tiledZeroDegreePack = [];
1696
+ Object.keys(this.memberGroups).forEach(function(n) {
1697
+ var r = e.idToDummyNode[n];
1698
+ t[n] = e.tileNodes(e.memberGroups[n], r.paddingLeft + r.paddingRight), r.rect.width = t[n].width, r.rect.height = t[n].height;
1699
+ });
1700
+ }, v.prototype.repopulateCompounds = function() {
1701
+ for (var e = this.compoundOrder.length - 1; e >= 0; e--) {
1702
+ var t = this.compoundOrder[e], n = t.id, r = t.paddingLeft, i = t.paddingTop;
1703
+ this.adjustLocations(this.tiledMemberPack[n], t.rect.x, t.rect.y, r, i);
1704
+ }
1705
+ }, v.prototype.repopulateZeroDegreeMembers = function() {
1706
+ var e = this, t = this.tiledZeroDegreePack;
1707
+ Object.keys(t).forEach(function(n) {
1708
+ var r = e.idToDummyNode[n], i = r.paddingLeft, a = r.paddingTop;
1709
+ e.adjustLocations(t[n], r.rect.x, r.rect.y, i, a);
1710
+ });
1711
+ }, v.prototype.getToBeTiled = function(e) {
1712
+ var t = e.id;
1713
+ if (this.toBeTiled[t] != null) return this.toBeTiled[t];
1714
+ var n = e.getChild();
1715
+ if (n == null) return this.toBeTiled[t] = !1, !1;
1716
+ for (var r = n.getNodes(), i = 0; i < r.length; i++) {
1717
+ var a = r[i];
1718
+ if (this.getNodeDegree(a) > 0) return this.toBeTiled[t] = !1, !1;
1719
+ if (a.getChild() == null) {
1720
+ this.toBeTiled[a.id] = !1;
1721
+ continue;
1722
+ }
1723
+ if (!this.getToBeTiled(a)) return this.toBeTiled[t] = !1, !1;
1724
+ }
1725
+ return this.toBeTiled[t] = !0, !0;
1726
+ }, v.prototype.getNodeDegree = function(e) {
1727
+ e.id;
1728
+ for (var t = e.getEdges(), n = 0, r = 0; r < t.length; r++) {
1729
+ var i = t[r];
1730
+ i.getSource().id !== i.getTarget().id && (n += 1);
1731
+ }
1732
+ return n;
1733
+ }, v.prototype.getNodeDegreeWithChildren = function(e) {
1734
+ var t = this.getNodeDegree(e);
1735
+ if (e.getChild() == null) return t;
1736
+ for (var n = e.getChild().getNodes(), r = 0; r < n.length; r++) {
1737
+ var i = n[r];
1738
+ t += this.getNodeDegreeWithChildren(i);
1739
+ }
1740
+ return t;
1741
+ }, v.prototype.performDFSOnCompounds = function() {
1742
+ this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
1743
+ }, v.prototype.fillCompexOrderByDFS = function(e) {
1744
+ for (var t = 0; t < e.length; t++) {
1745
+ var n = e[t];
1746
+ n.getChild() != null && this.fillCompexOrderByDFS(n.getChild().getNodes()), this.getToBeTiled(n) && this.compoundOrder.push(n);
1747
+ }
1748
+ }, v.prototype.adjustLocations = function(e, t, n, r, i) {
1749
+ t += r, n += i;
1750
+ for (var a = t, o = 0; o < e.rows.length; o++) {
1751
+ var s = e.rows[o];
1752
+ t = a;
1753
+ for (var c = 0, l = 0; l < s.length; l++) {
1754
+ var u = s[l];
1755
+ u.rect.x = t, u.rect.y = n, t += u.rect.width + e.horizontalPadding, u.rect.height > c && (c = u.rect.height);
1756
+ }
1757
+ n += c + e.verticalPadding;
1758
+ }
1759
+ }, v.prototype.tileCompoundMembers = function(e, t) {
1760
+ var n = this;
1761
+ this.tiledMemberPack = [], Object.keys(e).forEach(function(r) {
1762
+ var i = t[r];
1763
+ n.tiledMemberPack[r] = n.tileNodes(e[r], i.paddingLeft + i.paddingRight), i.rect.width = n.tiledMemberPack[r].width, i.rect.height = n.tiledMemberPack[r].height;
1764
+ });
1765
+ }, v.prototype.tileNodes = function(e, t) {
1766
+ var n = {
1767
+ rows: [],
1768
+ rowWidth: [],
1769
+ rowHeight: [],
1770
+ width: 0,
1771
+ height: t,
1772
+ verticalPadding: c.TILING_PADDING_VERTICAL,
1773
+ horizontalPadding: c.TILING_PADDING_HORIZONTAL
1774
+ };
1775
+ e.sort(function(e, t) {
1776
+ return e.rect.width * e.rect.height > t.rect.width * t.rect.height ? -1 : +(e.rect.width * e.rect.height < t.rect.width * t.rect.height);
1777
+ });
1778
+ for (var r = 0; r < e.length; r++) {
1779
+ var i = e[r];
1780
+ n.rows.length == 0 ? this.insertNodeToRow(n, i, 0, t) : this.canAddHorizontal(n, i.rect.width, i.rect.height) ? this.insertNodeToRow(n, i, this.getShortestRowIndex(n), t) : this.insertNodeToRow(n, i, n.rows.length, t), this.shiftToLastRow(n);
1781
+ }
1782
+ return n;
1783
+ }, v.prototype.insertNodeToRow = function(e, t, n, r) {
1784
+ var i = r;
1785
+ n == e.rows.length && (e.rows.push([]), e.rowWidth.push(i), e.rowHeight.push(0));
1786
+ var a = e.rowWidth[n] + t.rect.width;
1787
+ e.rows[n].length > 0 && (a += e.horizontalPadding), e.rowWidth[n] = a, e.width < a && (e.width = a);
1788
+ var o = t.rect.height;
1789
+ n > 0 && (o += e.verticalPadding);
1790
+ var s = 0;
1791
+ o > e.rowHeight[n] && (s = e.rowHeight[n], e.rowHeight[n] = o, s = e.rowHeight[n] - s), e.height += s, e.rows[n].push(t);
1792
+ }, v.prototype.getShortestRowIndex = function(e) {
1793
+ for (var t = -1, n = Number.MAX_VALUE, r = 0; r < e.rows.length; r++) e.rowWidth[r] < n && (t = r, n = e.rowWidth[r]);
1794
+ return t;
1795
+ }, v.prototype.getLongestRowIndex = function(e) {
1796
+ for (var t = -1, n = Number.MIN_VALUE, r = 0; r < e.rows.length; r++) e.rowWidth[r] > n && (t = r, n = e.rowWidth[r]);
1797
+ return t;
1798
+ }, v.prototype.canAddHorizontal = function(e, t, n) {
1799
+ var r = this.getShortestRowIndex(e);
1800
+ if (r < 0) return !0;
1801
+ var i = e.rowWidth[r];
1802
+ if (i + e.horizontalPadding + t <= e.width) return !0;
1803
+ var a = 0;
1804
+ e.rowHeight[r] < n && r > 0 && (a = n + e.verticalPadding - e.rowHeight[r]);
1805
+ var o = e.width - i >= t + e.horizontalPadding ? (e.height + a) / (i + t + e.horizontalPadding) : (e.height + a) / e.width;
1806
+ a = n + e.verticalPadding;
1807
+ var s = e.width < t ? (e.height + a) / t : (e.height + a) / e.width;
1808
+ return s < 1 && (s = 1 / s), o < 1 && (o = 1 / o), o < s;
1809
+ }, v.prototype.shiftToLastRow = function(e) {
1810
+ var t = this.getLongestRowIndex(e), n = e.rowWidth.length - 1, r = e.rows[t], i = r[r.length - 1], a = i.width + e.horizontalPadding;
1811
+ if (e.width - e.rowWidth[n] > a && t != n) {
1812
+ r.splice(-1, 1), e.rows[n].push(i), e.rowWidth[t] = e.rowWidth[t] - a, e.rowWidth[n] = e.rowWidth[n] + a, e.width = e.rowWidth[instance.getLongestRowIndex(e)];
1813
+ for (var o = Number.MIN_VALUE, s = 0; s < r.length; s++) r[s].height > o && (o = r[s].height);
1814
+ t > 0 && (o += e.verticalPadding);
1815
+ var c = e.rowHeight[t] + e.rowHeight[n];
1816
+ e.rowHeight[t] = o, e.rowHeight[n] < i.height + e.verticalPadding && (e.rowHeight[n] = i.height + e.verticalPadding);
1817
+ var l = e.rowHeight[t] + e.rowHeight[n];
1818
+ e.height += l - c, this.shiftToLastRow(e);
1819
+ }
1820
+ }, v.prototype.tilingPreLayout = function() {
1821
+ c.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
1822
+ }, v.prototype.tilingPostLayout = function() {
1823
+ c.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
1824
+ }, v.prototype.reduceTrees = function() {
1825
+ for (var e = [], t = !0, n; t;) {
1826
+ var r = this.graphManager.getAllNodes(), i = [];
1827
+ t = !1;
1828
+ for (var a = 0; a < r.length; a++) n = r[a], n.getEdges().length == 1 && !n.getEdges()[0].isInterGraph && n.getChild() == null && (i.push([
1829
+ n,
1830
+ n.getEdges()[0],
1831
+ n.getOwner()
1832
+ ]), t = !0);
1833
+ if (t == 1) {
1834
+ for (var o = [], s = 0; s < i.length; s++) i[s][0].getEdges().length == 1 && (o.push(i[s]), i[s][0].getOwner().remove(i[s][0]));
1835
+ e.push(o), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
1836
+ }
1837
+ }
1838
+ this.prunedNodesAll = e;
1839
+ }, v.prototype.growTree = function(e) {
1840
+ for (var t = e[e.length - 1], n, r = 0; r < t.length; r++) n = t[r], this.findPlaceforPrunedNode(n), n[2].add(n[0]), n[2].add(n[1], n[1].source, n[1].target);
1841
+ e.splice(e.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
1842
+ }, v.prototype.findPlaceforPrunedNode = function(e) {
1843
+ var t, n, r = e[0];
1844
+ n = r == e[1].source ? e[1].target : e[1].source;
1845
+ var i = n.startX, a = n.finishX, o = n.startY, s = n.finishY, c = [
1846
+ 0,
1847
+ 0,
1848
+ 0,
1849
+ 0
1850
+ ];
1851
+ if (o > 0) for (var u = i; u <= a; u++) c[0] += this.grid[u][o - 1].length + this.grid[u][o].length - 1;
1852
+ if (a < this.grid.length - 1) for (var u = o; u <= s; u++) c[1] += this.grid[a + 1][u].length + this.grid[a][u].length - 1;
1853
+ if (s < this.grid[0].length - 1) for (var u = i; u <= a; u++) c[2] += this.grid[u][s + 1].length + this.grid[u][s].length - 1;
1854
+ if (i > 0) for (var u = o; u <= s; u++) c[3] += this.grid[i - 1][u].length + this.grid[i][u].length - 1;
1855
+ for (var d = m.MAX_VALUE, f, p, h = 0; h < c.length; h++) c[h] < d ? (d = c[h], f = 1, p = h) : c[h] == d && f++;
1856
+ if (f == 3 && d == 0) c[0] == 0 && c[1] == 0 && c[2] == 0 ? t = 1 : c[0] == 0 && c[1] == 0 && c[3] == 0 ? t = 0 : c[0] == 0 && c[2] == 0 && c[3] == 0 ? t = 3 : c[1] == 0 && c[2] == 0 && c[3] == 0 && (t = 2);
1857
+ else if (f == 2 && d == 0) {
1858
+ var g = Math.floor(Math.random() * 2);
1859
+ t = c[0] == 0 && c[1] == 0 ? g == 0 ? 0 : 1 : c[0] == 0 && c[2] == 0 ? g == 0 ? 0 : 2 : c[0] == 0 && c[3] == 0 ? g == 0 ? 0 : 3 : c[1] == 0 && c[2] == 0 ? g == 0 ? 1 : 2 : c[1] == 0 && c[3] == 0 ? g == 0 ? 1 : 3 : g == 0 ? 2 : 3;
1860
+ } else if (f == 4 && d == 0) {
1861
+ var g = Math.floor(Math.random() * 4);
1862
+ t = g;
1863
+ } else t = p;
1864
+ t == 0 ? r.setCenter(n.getCenterX(), n.getCenterY() - n.getHeight() / 2 - l.DEFAULT_EDGE_LENGTH - r.getHeight() / 2) : t == 1 ? r.setCenter(n.getCenterX() + n.getWidth() / 2 + l.DEFAULT_EDGE_LENGTH + r.getWidth() / 2, n.getCenterY()) : t == 2 ? r.setCenter(n.getCenterX(), n.getCenterY() + n.getHeight() / 2 + l.DEFAULT_EDGE_LENGTH + r.getHeight() / 2) : r.setCenter(n.getCenterX() - n.getWidth() / 2 - l.DEFAULT_EDGE_LENGTH - r.getWidth() / 2, n.getCenterY());
1865
+ }, e.exports = v;
1866
+ }),
1867
+ (function(e, t, n) {
1868
+ var r = {};
1869
+ r.layoutBase = n(0), r.CoSEConstants = n(1), r.CoSEEdge = n(2), r.CoSEGraph = n(3), r.CoSEGraphManager = n(4), r.CoSELayout = n(6), r.CoSENode = n(5), e.exports = r;
1870
+ })
1871
+ ]);
1872
+ });
1873
+ })), c = /* @__PURE__ */ r((/* @__PURE__ */ e(((e, t) => {
1874
+ (function(n, r) {
1875
+ typeof e == "object" && typeof t == "object" ? t.exports = r(s()) : typeof define == "function" && define.amd ? define(["cose-base"], r) : typeof e == "object" ? e.cytoscapeCoseBilkent = r(s()) : n.cytoscapeCoseBilkent = r(n.coseBase);
1876
+ })(e, function(e) {
1877
+ return (function(e) {
1878
+ var t = {};
1879
+ function n(r) {
1880
+ if (t[r]) return t[r].exports;
1881
+ var i = t[r] = {
1882
+ i: r,
1883
+ l: !1,
1884
+ exports: {}
1885
+ };
1886
+ return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports;
1887
+ }
1888
+ return n.m = e, n.c = t, n.i = function(e) {
1889
+ return e;
1890
+ }, n.d = function(e, t, r) {
1891
+ n.o(e, t) || Object.defineProperty(e, t, {
1892
+ configurable: !1,
1893
+ enumerable: !0,
1894
+ get: r
1895
+ });
1896
+ }, n.n = function(e) {
1897
+ var t = e && e.__esModule ? function() {
1898
+ return e.default;
1899
+ } : function() {
1900
+ return e;
1901
+ };
1902
+ return n.d(t, "a", t), t;
1903
+ }, n.o = function(e, t) {
1904
+ return Object.prototype.hasOwnProperty.call(e, t);
1905
+ }, n.p = "", n(n.s = 1);
1906
+ })([(function(t, n) {
1907
+ t.exports = e;
1908
+ }), (function(e, t, n) {
1909
+ var r = n(0).layoutBase.LayoutConstants, i = n(0).layoutBase.FDLayoutConstants, a = n(0).CoSEConstants, o = n(0).CoSELayout, s = n(0).CoSENode, c = n(0).layoutBase.PointD, l = n(0).layoutBase.DimensionD, u = {
1910
+ ready: function() {},
1911
+ stop: function() {},
1912
+ quality: "default",
1913
+ nodeDimensionsIncludeLabels: !1,
1914
+ refresh: 30,
1915
+ fit: !0,
1916
+ padding: 10,
1917
+ randomize: !0,
1918
+ nodeRepulsion: 4500,
1919
+ idealEdgeLength: 50,
1920
+ edgeElasticity: .45,
1921
+ nestingFactor: .1,
1922
+ gravity: .25,
1923
+ numIter: 2500,
1924
+ tile: !0,
1925
+ animate: "end",
1926
+ animationDuration: 500,
1927
+ tilingPaddingVertical: 10,
1928
+ tilingPaddingHorizontal: 10,
1929
+ gravityRangeCompound: 1.5,
1930
+ gravityCompound: 1,
1931
+ gravityRange: 3.8,
1932
+ initialEnergyOnIncremental: .5
1933
+ };
1934
+ function d(e, t) {
1935
+ var n = {};
1936
+ for (var r in e) n[r] = e[r];
1937
+ for (var r in t) n[r] = t[r];
1938
+ return n;
1939
+ }
1940
+ function f(e) {
1941
+ this.options = d(u, e), p(this.options);
1942
+ }
1943
+ var p = function(e) {
1944
+ e.nodeRepulsion != null && (a.DEFAULT_REPULSION_STRENGTH = i.DEFAULT_REPULSION_STRENGTH = e.nodeRepulsion), e.idealEdgeLength != null && (a.DEFAULT_EDGE_LENGTH = i.DEFAULT_EDGE_LENGTH = e.idealEdgeLength), e.edgeElasticity != null && (a.DEFAULT_SPRING_STRENGTH = i.DEFAULT_SPRING_STRENGTH = e.edgeElasticity), e.nestingFactor != null && (a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = e.nestingFactor), e.gravity != null && (a.DEFAULT_GRAVITY_STRENGTH = i.DEFAULT_GRAVITY_STRENGTH = e.gravity), e.numIter != null && (a.MAX_ITERATIONS = i.MAX_ITERATIONS = e.numIter), e.gravityRange != null && (a.DEFAULT_GRAVITY_RANGE_FACTOR = i.DEFAULT_GRAVITY_RANGE_FACTOR = e.gravityRange), e.gravityCompound != null && (a.DEFAULT_COMPOUND_GRAVITY_STRENGTH = i.DEFAULT_COMPOUND_GRAVITY_STRENGTH = e.gravityCompound), e.gravityRangeCompound != null && (a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = e.gravityRangeCompound), e.initialEnergyOnIncremental != null && (a.DEFAULT_COOLING_FACTOR_INCREMENTAL = i.DEFAULT_COOLING_FACTOR_INCREMENTAL = e.initialEnergyOnIncremental), r.QUALITY = e.quality == "draft" ? 0 : e.quality == "proof" ? 2 : 1, a.NODE_DIMENSIONS_INCLUDE_LABELS = i.NODE_DIMENSIONS_INCLUDE_LABELS = r.NODE_DIMENSIONS_INCLUDE_LABELS = e.nodeDimensionsIncludeLabels, a.DEFAULT_INCREMENTAL = i.DEFAULT_INCREMENTAL = r.DEFAULT_INCREMENTAL = !e.randomize, a.ANIMATE = i.ANIMATE = r.ANIMATE = e.animate, a.TILE = e.tile, a.TILING_PADDING_VERTICAL = typeof e.tilingPaddingVertical == "function" ? e.tilingPaddingVertical.call() : e.tilingPaddingVertical, a.TILING_PADDING_HORIZONTAL = typeof e.tilingPaddingHorizontal == "function" ? e.tilingPaddingHorizontal.call() : e.tilingPaddingHorizontal;
1945
+ };
1946
+ f.prototype.run = function() {
1947
+ var e, t, n = this.options;
1948
+ this.idToLNode = {};
1949
+ var r = this.layout = new o(), i = this;
1950
+ i.stopped = !1, this.cy = this.options.cy, this.cy.trigger({
1951
+ type: "layoutstart",
1952
+ layout: this
1953
+ });
1954
+ var a = r.newGraphManager();
1955
+ this.gm = a;
1956
+ var s = this.options.eles.nodes(), c = this.options.eles.edges();
1957
+ this.root = a.addRoot(), this.processChildrenList(this.root, this.getTopMostNodes(s), r);
1958
+ for (var l = 0; l < c.length; l++) {
1959
+ var u = c[l], d = this.idToLNode[u.data("source")], f = this.idToLNode[u.data("target")];
1960
+ if (d !== f && d.getEdgesBetween(f).length == 0) {
1961
+ var p = a.add(r.newEdge(), d, f);
1962
+ p.id = u.id();
1963
+ }
1964
+ }
1965
+ var m = function(e, t) {
1966
+ typeof e == "number" && (e = t);
1967
+ var n = e.data("id"), r = i.idToLNode[n];
1968
+ return {
1969
+ x: r.getRect().getCenterX(),
1970
+ y: r.getRect().getCenterY()
1971
+ };
1972
+ }, h = function a() {
1973
+ for (var o = function() {
1974
+ n.fit && n.cy.fit(n.eles, n.padding), e || (e = !0, i.cy.one("layoutready", n.ready), i.cy.trigger({
1975
+ type: "layoutready",
1976
+ layout: i
1977
+ }));
1978
+ }, s = i.options.refresh, c, l = 0; l < s && !c; l++) c = i.stopped || i.layout.tick();
1979
+ if (c) {
1980
+ r.checkLayoutSuccess() && !r.isSubLayout && r.doPostLayout(), r.tilingPostLayout && r.tilingPostLayout(), r.isLayoutFinished = !0, i.options.eles.nodes().positions(m), o(), i.cy.one("layoutstop", i.options.stop), i.cy.trigger({
1981
+ type: "layoutstop",
1982
+ layout: i
1983
+ }), t && cancelAnimationFrame(t), e = !1;
1984
+ return;
1985
+ }
1986
+ var u = i.layout.getPositionsData();
1987
+ n.eles.nodes().positions(function(e, t) {
1988
+ if (typeof e == "number" && (e = t), !e.isParent()) {
1989
+ for (var n = e.id(), r = u[n], i = e; r == null && (r = u[i.data("parent")] || u["DummyCompound_" + i.data("parent")], u[n] = r, i = i.parent()[0], i != null););
1990
+ return r == null ? {
1991
+ x: e.position("x"),
1992
+ y: e.position("y")
1993
+ } : {
1994
+ x: r.x,
1995
+ y: r.y
1996
+ };
1997
+ }
1998
+ }), o(), t = requestAnimationFrame(a);
1999
+ };
2000
+ return r.addListener("layoutstarted", function() {
2001
+ i.options.animate === "during" && (t = requestAnimationFrame(h));
2002
+ }), r.runLayout(), this.options.animate !== "during" && (i.options.eles.nodes().not(":parent").layoutPositions(i, i.options, m), e = !1), this;
2003
+ }, f.prototype.getTopMostNodes = function(e) {
2004
+ for (var t = {}, n = 0; n < e.length; n++) t[e[n].id()] = !0;
2005
+ return e.filter(function(e, n) {
2006
+ typeof e == "number" && (e = n);
2007
+ for (var r = e.parent()[0]; r != null;) {
2008
+ if (t[r.id()]) return !1;
2009
+ r = r.parent()[0];
2010
+ }
2011
+ return !0;
2012
+ });
2013
+ }, f.prototype.processChildrenList = function(e, t, n) {
2014
+ for (var r = t.length, i = 0; i < r; i++) {
2015
+ var a = t[i], o = a.children(), u, d = a.layoutDimensions({ nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels });
2016
+ if (u = a.outerWidth() != null && a.outerHeight() != null ? e.add(new s(n.graphManager, new c(a.position("x") - d.w / 2, a.position("y") - d.h / 2), new l(parseFloat(d.w), parseFloat(d.h)))) : e.add(new s(this.graphManager)), u.id = a.data("id"), u.paddingLeft = parseInt(a.css("padding")), u.paddingTop = parseInt(a.css("padding")), u.paddingRight = parseInt(a.css("padding")), u.paddingBottom = parseInt(a.css("padding")), this.options.nodeDimensionsIncludeLabels && a.isParent()) {
2017
+ var f = a.boundingBox({
2018
+ includeLabels: !0,
2019
+ includeNodes: !1
2020
+ }).w, p = a.boundingBox({
2021
+ includeLabels: !0,
2022
+ includeNodes: !1
2023
+ }).h, m = a.css("text-halign");
2024
+ u.labelWidth = f, u.labelHeight = p, u.labelPos = m;
2025
+ }
2026
+ if (this.idToLNode[a.data("id")] = u, isNaN(u.rect.x) && (u.rect.x = 0), isNaN(u.rect.y) && (u.rect.y = 0), o != null && o.length > 0) {
2027
+ var h = n.getGraphManager().add(n.newGraph(), u);
2028
+ this.processChildrenList(h, o, n);
2029
+ }
2030
+ }
2031
+ }, f.prototype.stop = function() {
2032
+ return this.stopped = !0, this;
2033
+ };
2034
+ var m = function(e) {
2035
+ e("layout", "cose-bilkent", f);
2036
+ };
2037
+ typeof cytoscape < "u" && m(cytoscape), e.exports = m;
2038
+ })]);
2039
+ });
2040
+ })))(), 1);
2041
+ a.use(c.default);
2042
+ function l(e, t) {
2043
+ e.forEach((e) => {
2044
+ let n = {
2045
+ id: e.id,
2046
+ labelText: e.label,
2047
+ height: e.height,
2048
+ width: e.width,
2049
+ padding: e.padding ?? 0
2050
+ };
2051
+ Object.keys(e).forEach((t) => {
2052
+ [
2053
+ "id",
2054
+ "label",
2055
+ "height",
2056
+ "width",
2057
+ "padding",
2058
+ "x",
2059
+ "y"
2060
+ ].includes(t) || (n[t] = e[t]);
2061
+ }), t.add({
2062
+ group: "nodes",
2063
+ data: n,
2064
+ position: {
2065
+ x: e.x ?? 0,
2066
+ y: e.y ?? 0
2067
+ }
2068
+ });
2069
+ });
2070
+ }
2071
+ i(l, "addNodes");
2072
+ function u(e, t) {
2073
+ e.forEach((e) => {
2074
+ let n = {
2075
+ id: e.id,
2076
+ source: e.start,
2077
+ target: e.end
2078
+ };
2079
+ Object.keys(e).forEach((t) => {
2080
+ [
2081
+ "id",
2082
+ "start",
2083
+ "end"
2084
+ ].includes(t) || (n[t] = e[t]);
2085
+ }), t.add({
2086
+ group: "edges",
2087
+ data: n
2088
+ });
2089
+ });
2090
+ }
2091
+ i(u, "addEdges");
2092
+ function d(e) {
2093
+ return new Promise((r) => {
2094
+ let i = n("body").append("div").attr("id", "cy").attr("style", "display:none"), o = a({
2095
+ container: document.getElementById("cy"),
2096
+ style: [{
2097
+ selector: "edge",
2098
+ style: { "curve-style": "bezier" }
2099
+ }]
2100
+ });
2101
+ i.remove(), l(e.nodes, o), u(e.edges, o), o.nodes().forEach(function(e) {
2102
+ e.layoutDimensions = () => {
2103
+ let t = e.data();
2104
+ return {
2105
+ w: t.width,
2106
+ h: t.height
2107
+ };
2108
+ };
2109
+ }), o.layout({
2110
+ name: "cose-bilkent",
2111
+ quality: "proof",
2112
+ styleEnabled: !1,
2113
+ animate: !1
2114
+ }).run(), o.ready((e) => {
2115
+ t.info("Cytoscape ready", e), r(o);
2116
+ });
2117
+ });
2118
+ }
2119
+ i(d, "createCytoscapeInstance");
2120
+ function f(e) {
2121
+ return e.nodes().map((e) => {
2122
+ let t = e.data(), n = e.position(), r = {
2123
+ id: t.id,
2124
+ x: n.x,
2125
+ y: n.y
2126
+ };
2127
+ return Object.keys(t).forEach((e) => {
2128
+ e !== "id" && (r[e] = t[e]);
2129
+ }), r;
2130
+ });
2131
+ }
2132
+ i(f, "extractPositionedNodes");
2133
+ function p(e) {
2134
+ return e.edges().map((e) => {
2135
+ let t = e.data(), n = e._private.rscratch, r = {
2136
+ id: t.id,
2137
+ source: t.source,
2138
+ target: t.target,
2139
+ startX: n.startX,
2140
+ startY: n.startY,
2141
+ midX: n.midX,
2142
+ midY: n.midY,
2143
+ endX: n.endX,
2144
+ endY: n.endY
2145
+ };
2146
+ return Object.keys(t).forEach((e) => {
2147
+ [
2148
+ "id",
2149
+ "source",
2150
+ "target"
2151
+ ].includes(e) || (r[e] = t[e]);
2152
+ }), r;
2153
+ });
2154
+ }
2155
+ i(p, "extractPositionedEdges");
2156
+ async function m(e, n) {
2157
+ t.debug("Starting cose-bilkent layout algorithm");
2158
+ try {
2159
+ h(e);
2160
+ let n = await d(e), r = f(n), i = p(n);
2161
+ return t.debug(`Layout completed: ${r.length} nodes, ${i.length} edges`), {
2162
+ nodes: r,
2163
+ edges: i
2164
+ };
2165
+ } catch (e) {
2166
+ throw t.error("Error in cose-bilkent layout algorithm:", e), e;
2167
+ }
2168
+ }
2169
+ i(m, "executeCoseBilkentLayout");
2170
+ function h(e) {
2171
+ if (!e) throw Error("Layout data is required");
2172
+ if (!e.config) throw Error("Configuration is required in layout data");
2173
+ if (!e.rootNode) throw Error("Root node is required");
2174
+ if (!e.nodes || !Array.isArray(e.nodes)) throw Error("No nodes found in layout data");
2175
+ if (!Array.isArray(e.edges)) throw Error("Edges array is required in layout data");
2176
+ return !0;
2177
+ }
2178
+ i(h, "validateLayoutData");
2179
+ var g = /* @__PURE__ */ i(async (e, t, { insertCluster: n, insertEdge: r, insertEdgeLabel: i, insertMarkers: a, insertNode: o, log: s, positionEdgeLabel: c }, { algorithm: l }) => {
2180
+ let u = {}, d = {}, f = t.select("g");
2181
+ a(f, e.markers, e.type, e.diagramId);
2182
+ let p = f.insert("g").attr("class", "subgraphs"), h = f.insert("g").attr("class", "edgePaths"), g = f.insert("g").attr("class", "edgeLabels"), _ = f.insert("g").attr("class", "nodes");
2183
+ s.debug("Inserting nodes into DOM for dimension calculation"), await Promise.all(e.nodes.map(async (t) => {
2184
+ if (t.isGroup) {
2185
+ let e = { ...t };
2186
+ d[t.id] = e, u[t.id] = e, await n(p, t);
2187
+ } else {
2188
+ let n = { ...t };
2189
+ u[t.id] = n;
2190
+ let r = await o(_, t, {
2191
+ config: e.config,
2192
+ dir: e.direction || "TB"
2193
+ }), i = r.node().getBBox();
2194
+ n.width = i.width, n.height = i.height, n.domId = r, s.debug(`Node ${t.id} dimensions: ${i.width}x${i.height}`);
2195
+ }
2196
+ })), s.debug("Running cose-bilkent layout algorithm");
2197
+ let v = await m({
2198
+ ...e,
2199
+ nodes: e.nodes.map((e) => {
2200
+ let t = u[e.id];
2201
+ return {
2202
+ ...e,
2203
+ width: t.width,
2204
+ height: t.height
2205
+ };
2206
+ })
2207
+ }, e.config);
2208
+ s.debug("Positioning nodes based on layout results"), v.nodes.forEach((e) => {
2209
+ let t = u[e.id];
2210
+ t?.domId && (t.domId.attr("transform", `translate(${e.x}, ${e.y})`), t.x = e.x, t.y = e.y, s.debug(`Positioned node ${t.id} at center (${e.x}, ${e.y})`));
2211
+ }), v.edges.forEach((t) => {
2212
+ let n = e.edges.find((e) => e.id === t.id);
2213
+ n && (n.points = [
2214
+ {
2215
+ x: t.startX,
2216
+ y: t.startY
2217
+ },
2218
+ {
2219
+ x: t.midX,
2220
+ y: t.midY
2221
+ },
2222
+ {
2223
+ x: t.endX,
2224
+ y: t.endY
2225
+ }
2226
+ ]);
2227
+ }), s.debug("Inserting and positioning edges"), await Promise.all(e.edges.map(async (t) => {
2228
+ await i(g, t);
2229
+ let n = u[t.start ?? ""], a = u[t.end ?? ""];
2230
+ if (n && a) {
2231
+ let i = v.edges.find((e) => e.id === t.id);
2232
+ if (i) {
2233
+ s.debug("APA01 positionedEdge", i);
2234
+ let o = { ...t };
2235
+ c(o, r(h, o, d, e.type, n, a, e.diagramId));
2236
+ } else {
2237
+ let i = {
2238
+ ...t,
2239
+ points: [{
2240
+ x: n.x || 0,
2241
+ y: n.y || 0
2242
+ }, {
2243
+ x: a.x || 0,
2244
+ y: a.y || 0
2245
+ }]
2246
+ };
2247
+ c(i, r(h, i, d, e.type, n, a, e.diagramId));
2248
+ }
2249
+ }
2250
+ })), s.debug("Cose-bilkent rendering completed");
2251
+ }, "render");
2252
+ //#endregion
2253
+ export { g as render };