@kong-ui-public/documentation 1.5.10 → 1.5.11

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 (90) hide show
  1. package/dist/_baseUniq-BM5nBlUE-Bqq-876b.js +477 -0
  2. package/dist/{arc-B-ukyQgl-BIkl0oly.js → arc-Da5qnJCa-D1fJq9Ga.js} +14 -14
  3. package/dist/architecture-YZFGNWBL-CvR_VbsD-i8qH434J.js +6 -0
  4. package/dist/architectureDiagram-Q4EWVU46-DqiP7Rm1-CBe5jt7q.js +4694 -0
  5. package/dist/blockDiagram-DXYQGD6D-Dqw9F2Am-BLtGZalg.js +2304 -0
  6. package/dist/{c4Diagram-AAMF2YG6-CKwlop6T-biDHxtgF.js → c4Diagram-AHTNJAMY-D1CqyEQ6-B0R-a6pf.js} +740 -743
  7. package/dist/{channel-Da4OyhNU-CjtA-gzv.js → channel-C0HsK-iS-D8tJdRzv.js} +1 -1
  8. package/dist/{chunk-ANTBXLJU-CgMY7K4E-BDFVHt4k.js → chunk-4BX2VUAB-CkAjNgA_-Bs9A5Kfv.js} +1 -1
  9. package/dist/{chunk-JBRWN2VN-DGZEDqQT-C_bgxQXb.js → chunk-4TB4RGXK-BahB65Eg-ChDwOMia.js} +483 -393
  10. package/dist/{chunk-WVR4S24B-CqqZpXpd-DYcapnmX.js → chunk-55IACEB6-FAGpaDxG-BTfPS-CU.js} +1 -1
  11. package/dist/{chunk-NRVI72HA-Bk2QoSU4-C8BLG4Nn.js → chunk-EDXVE4YY-JJVh1SXw-B-sKHFur.js} +1 -1
  12. package/dist/{chunk-GLLZNHP4-BfObQGbx-D2i6EGF4.js → chunk-FMBD7UC4-CAMVhC3j-oHcHavNU.js} +1 -1
  13. package/dist/{chunk-LXBSTHXV-DDrUAnPm-BhQORC-M.js → chunk-OYMX7WX6-CUYLPicN-BOih3xeZ.js} +219 -206
  14. package/dist/{chunk-FHKO5MBM--0hzbho5-CD7UphLJ.js → chunk-QZHKN3VN-DludCzyb-DYJGn0Nm.js} +1 -1
  15. package/dist/chunk-YZCP3GAM-D78rBxvk-E0y6EYmh.js +68 -0
  16. package/dist/{classDiagram-3BZAVTQC-BieGHK_n-DKk2Tasm.js → classDiagram-6PBFFD2Q-DImmr9bN-Ipdf4BlS.js} +2 -2
  17. package/dist/{classDiagram-v2-QTMF73CY-BieGHK_n-DKk2Tasm.js → classDiagram-v2-HSJHXN6E-DImmr9bN-Ipdf4BlS.js} +2 -2
  18. package/dist/{clone-BQ4BCIVX-BtVSQfya.js → clone-CxV-_MWN-BTBOrYIK.js} +1 -1
  19. package/dist/cose-bilkent-S5V4N54A-B5XQcR33-C16znhn9.js +2608 -0
  20. package/dist/{cytoscape.esm-CjI2IsL8-DYIumutE.js → cytoscape.esm-BjnMFxuP-CWlRmT1g.js} +16 -13
  21. package/dist/{dagre-2BBEFEWP-sc2upYy7-rNXSQFNY.js → dagre-KV5264BT-PBiSm4y3-BP7huLbw.js} +19 -20
  22. package/dist/diagram-5BDNPKRD-Um_ME5I2-DLUwrd96.js +123 -0
  23. package/dist/diagram-G4DWMVQ6-BsTsajjz-Uehh1WWi.js +530 -0
  24. package/dist/{diagram-RP2FKANI-DabtWDGU-FmJgjY_V.js → diagram-MMDJMWI5-C5oqUzF8-gcpf6PNh.js} +67 -67
  25. package/dist/{diagram-GUPCWM2R-RSzJRmP4-5_ml5U5U.js → diagram-TYMM5635-CQxFzu44-Dx5KCUXW.js} +23 -23
  26. package/dist/documentation.es.js +1 -1
  27. package/dist/documentation.umd.js +1748 -1228
  28. package/dist/erDiagram-SMLLAGMA-23hRKyIy-B-dChHLQ.js +898 -0
  29. package/dist/flowDiagram-DWJPFMVM-BeSa8cQn-B2__M71K.js +1635 -0
  30. package/dist/ganttDiagram-T4ZO3ILL-ZC4a8MdR-tE42RGcp.js +2700 -0
  31. package/dist/gitGraph-7Q5UKJZL-DlY-5kQ6-CLY7BmsA.js +6 -0
  32. package/dist/gitGraphDiagram-UUTBAWPF-DXVZeOtJ-CWWgOrKv.js +828 -0
  33. package/dist/graph-WBvyJJXo-BBnBDARn.js +738 -0
  34. package/dist/{index-DeBlJN4f.js → index-Bh-wTBlD.js} +16761 -15853
  35. package/dist/info-OMHHGYJF-RTXqsfQC-DrfqfklB.js +6 -0
  36. package/dist/infoDiagram-42DDH7IO-BZdpI3Rt-l8iFfMFP.js +24 -0
  37. package/dist/ishikawaDiagram-UXIWVN3A-DvYKV3c4-BPgCxTOl.js +622 -0
  38. package/dist/journeyDiagram-VCZTEJTY-C2ry_hWi-DI5GD7uG.js +834 -0
  39. package/dist/{kanban-definition-KOZQBZVT-BcgyR947-u-ThSWpr.js → kanban-definition-6JOO6SKY-CY_QsIlW-OqXNCY1p.js} +163 -158
  40. package/dist/{katex-C0Lgw_Sx-CbX2I1cQ.js → katex-CX_HYDAq-_-dpIk5k.js} +3261 -3333
  41. package/dist/layout-DzPx9mR5-CHbk03j2.js +1438 -0
  42. package/dist/{linear-Bkwca0xU-DC0DlB3Q.js → linear-h6L3lVRp-DOzK9CUG.js} +1 -1
  43. package/dist/mermaid-parser.core-DtLRLmJt-Bs8fzU82.js +18375 -0
  44. package/dist/min-hEQogXjh-DyJPZJjb.js +38 -0
  45. package/dist/mindmap-definition-QFDTVHPH-DtiyxxYL-DUl1WEb7.js +836 -0
  46. package/dist/packet-4T2RLAQJ-Di7zpGDk-UtQRvAVW.js +6 -0
  47. package/dist/pie-ZZUOXDRM-CXos-t2G-BFyC-RaB.js +6 -0
  48. package/dist/pieDiagram-DEJITSTG-D7gBkRMg-BBSz-kJB.js +164 -0
  49. package/dist/{quadrantDiagram-YPSRARAO-BQtyf3HP-D7rZGp1l.js → quadrantDiagram-34T5L4WZ-Cfwapd1Q-CS_lKY3k.js} +16 -16
  50. package/dist/radar-PYXPWWZC-D0dHj_5J-DO49D32P.js +6 -0
  51. package/dist/{requirementDiagram-EGVEC5DT-CnnVFZwh-D9sZFwwg.js → requirementDiagram-MS252O5E-Bimzbn3B-B-e5vK9F.js} +199 -167
  52. package/dist/{sankeyDiagram-HRAUVNP4-DnGkLEvt-DIAbJDNn.js → sankeyDiagram-XADWPNL6-B8rOSxDr-uYyl_iJz.js} +13 -13
  53. package/dist/sequenceDiagram-FGHM5R23-z1blPVFc-DxkfwOOg.js +2893 -0
  54. package/dist/stateDiagram-FHFEXIEX-Dvj2dUvd-CEjEPSzp.js +263 -0
  55. package/dist/{stateDiagram-v2-EYPG3UTE-CkraIkNs-DLA1w3a5.js → stateDiagram-v2-QKLJ7IA2-CEq8bJSN-BmK4dbQp.js} +2 -2
  56. package/dist/timeline-definition-GMOUNBTQ-CFbR3HDt-Dajv0gse.js +1066 -0
  57. package/dist/treeView-SZITEDCU-ZiyDRNdY-FcohlUhB.js +6 -0
  58. package/dist/treemap-W4RFUUIX-D-tfszYV-CkdYg79W.js +6 -0
  59. package/dist/vennDiagram-DHZGUBPP-DDPnvwIl-DLef8GZ-.js +1564 -0
  60. package/dist/wardley-RL74JXVD-CzW2PcVh-Bl64UM-9.js +6 -0
  61. package/dist/wardleyDiagram-NUSXRM2D-G2F05w5q-Dgb8afBt.js +603 -0
  62. package/dist/{xychartDiagram-FDP5SA34-C0od7xbm-JkA2XwsO.js → xychartDiagram-5P7HB3ND-DcvqnhIW-CQekuj1q.js} +286 -284
  63. package/package.json +2 -2
  64. package/dist/_basePickBy-By9oZA6R-C9Q3wZgc.js +0 -151
  65. package/dist/_baseUniq-aulxCrZg-DpgqVftQ.js +0 -614
  66. package/dist/architecture-U656AL7Q-D7FlR8mQ-CcoM0xmP.js +0 -6
  67. package/dist/architectureDiagram-KFL7JDKH-D2wQyXF3-DUIfKyBT.js +0 -4665
  68. package/dist/blockDiagram-ZYB65J3Q-BVrJ6Sru-CTSsbOHf.js +0 -2265
  69. package/dist/chunk-OMD6QJNC-Dw01cgI4-BX05x0MM.js +0 -64
  70. package/dist/diagram-4IRLE6MV-DhfS8dHC-BHYGYZis.js +0 -533
  71. package/dist/erDiagram-HZWUO2LU-DRB4Mbtv-CgU99FCL.js +0 -840
  72. package/dist/flowDiagram-THRYKUMA-Cca2217c-CyDxFUag.js +0 -1627
  73. package/dist/ganttDiagram-WV7ZQ7D5-T3W_JgZV-PlELdFB9.js +0 -2504
  74. package/dist/gitGraph-F6HP7TQM-CF97nS_M-Cds3-fO4.js +0 -6
  75. package/dist/gitGraphDiagram-OJR772UL-DxvQcvVZ-DsH5Tcqa.js +0 -712
  76. package/dist/graph-DM4yJZhA-Bbo6I0vd.js +0 -247
  77. package/dist/info-NVLQJR56-BIkzHNxa-PHtGLaWD.js +0 -6
  78. package/dist/infoDiagram-6WOFNB3A-rRqd7shu-DmCUCKD0.js +0 -24
  79. package/dist/journeyDiagram-FFXJYRFH-C9rjRycy-44BCKp7p.js +0 -834
  80. package/dist/layout-CDChcvw3-C4cdx174.js +0 -1321
  81. package/dist/mermaid-parser.core-DRkTy7co-D3k_lOFL.js +0 -12890
  82. package/dist/mindmap-definition-LNHGMQRG-Dzyqm5dG-BSHIrtY4.js +0 -3231
  83. package/dist/packet-BFZMPI3H-D2ECyuNX-BrLUxNwr.js +0 -6
  84. package/dist/pie-7BOR55EZ-DZrUX33b-DTRam8Zi.js +0 -6
  85. package/dist/pieDiagram-DBDJKBY4-Pbq0hYNc-BY63OUmy.js +0 -161
  86. package/dist/radar-NHE76QYJ-DRHdhW6w-DS2_BWvC.js +0 -6
  87. package/dist/sequenceDiagram-WFGC7UMF-ChsW9bN4-D52efQBS.js +0 -2283
  88. package/dist/stateDiagram-UUKSUZ4H-Cbf4sKeS-CW-kRLpc.js +0 -263
  89. package/dist/timeline-definition-3HZDQTIS-zCLLmQCc-B-r1pMne.js +0 -799
  90. package/dist/treemap-KMMF4GRG-BWdglwua-CKei-6bJ.js +0 -6
@@ -0,0 +1,4694 @@
1
+ import { _ as pt, aU as Be, bo as Ve, l as Oe, aa as $e, a9 as je, ao as qe, ap as Ze, a8 as Ke, a7 as Je, av as Qe, aD as ti, aE as ei, aB as ii, g as me, bt as ve, by as ge, ae as ri, a5 as ni, at as oi, bz as ai, bA as si, a6 as hi } from "./index-Bh-wTBlD.js";
2
+ import { m as li } from "./chunk-4BX2VUAB-CkAjNgA_-Bs9A5Kfv.js";
3
+ import { M as di } from "./mermaid-parser.core-DtLRLmJt-Bs8fzU82.js";
4
+ import { e as Re } from "./cytoscape.esm-BjnMFxuP-CWlRmT1g.js";
5
+ var ce = { exports: {} }, ue = { exports: {} }, fe = { exports: {} }, gi = fe.exports, Ie;
6
+ function ci() {
7
+ return Ie || (Ie = 1, function(N, U) {
8
+ (function(I, G) {
9
+ N.exports = G();
10
+ })(gi, function() {
11
+ return (
12
+ /******/
13
+ function(I) {
14
+ var G = {};
15
+ function A(u) {
16
+ if (G[u])
17
+ return G[u].exports;
18
+ var d = G[u] = {
19
+ /******/
20
+ i: u,
21
+ /******/
22
+ l: !1,
23
+ /******/
24
+ exports: {}
25
+ /******/
26
+ };
27
+ return I[u].call(d.exports, d, d.exports, A), d.l = !0, d.exports;
28
+ }
29
+ return A.m = I, A.c = G, A.i = function(u) {
30
+ return u;
31
+ }, A.d = function(u, d, r) {
32
+ A.o(u, d) || Object.defineProperty(u, d, {
33
+ /******/
34
+ configurable: !1,
35
+ /******/
36
+ enumerable: !0,
37
+ /******/
38
+ get: r
39
+ /******/
40
+ });
41
+ }, A.n = function(u) {
42
+ var d = u && u.__esModule ? (
43
+ /******/
44
+ function() {
45
+ return u.default;
46
+ }
47
+ ) : (
48
+ /******/
49
+ function() {
50
+ return u;
51
+ }
52
+ );
53
+ return A.d(d, "a", d), d;
54
+ }, A.o = function(u, d) {
55
+ return Object.prototype.hasOwnProperty.call(u, d);
56
+ }, A.p = "", A(A.s = 28);
57
+ }([
58
+ /* 0 */
59
+ /***/
60
+ function(I, G, A) {
61
+ function u() {
62
+ }
63
+ u.QUALITY = 1, u.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, u.DEFAULT_INCREMENTAL = !1, u.DEFAULT_ANIMATION_ON_LAYOUT = !0, u.DEFAULT_ANIMATION_DURING_LAYOUT = !1, u.DEFAULT_ANIMATION_PERIOD = 50, u.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, u.DEFAULT_GRAPH_MARGIN = 15, u.NODE_DIMENSIONS_INCLUDE_LABELS = !1, u.SIMPLE_NODE_SIZE = 40, u.SIMPLE_NODE_HALF_SIZE = u.SIMPLE_NODE_SIZE / 2, u.EMPTY_COMPOUND_NODE_SIZE = 40, u.MIN_EDGE_LENGTH = 1, u.WORLD_BOUNDARY = 1e6, u.INITIAL_WORLD_BOUNDARY = u.WORLD_BOUNDARY / 1e3, u.WORLD_CENTER_X = 1200, u.WORLD_CENTER_Y = 900, I.exports = u;
64
+ },
65
+ /* 1 */
66
+ /***/
67
+ function(I, G, A) {
68
+ var u = A(2), d = A(8), r = A(9);
69
+ function i(a, o, f) {
70
+ u.call(this, f), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = f, this.bendpoints = [], this.source = a, this.target = o;
71
+ }
72
+ i.prototype = Object.create(u.prototype);
73
+ for (var e in u)
74
+ i[e] = u[e];
75
+ i.prototype.getSource = function() {
76
+ return this.source;
77
+ }, i.prototype.getTarget = function() {
78
+ return this.target;
79
+ }, i.prototype.isInterGraph = function() {
80
+ return this.isInterGraph;
81
+ }, i.prototype.getLength = function() {
82
+ return this.length;
83
+ }, i.prototype.isOverlapingSourceAndTarget = function() {
84
+ return this.isOverlapingSourceAndTarget;
85
+ }, i.prototype.getBendpoints = function() {
86
+ return this.bendpoints;
87
+ }, i.prototype.getLca = function() {
88
+ return this.lca;
89
+ }, i.prototype.getSourceInLca = function() {
90
+ return this.sourceInLca;
91
+ }, i.prototype.getTargetInLca = function() {
92
+ return this.targetInLca;
93
+ }, i.prototype.getOtherEnd = function(a) {
94
+ if (this.source === a)
95
+ return this.target;
96
+ if (this.target === a)
97
+ return this.source;
98
+ throw "Node is not incident with this edge";
99
+ }, i.prototype.getOtherEndInGraph = function(a, o) {
100
+ for (var f = this.getOtherEnd(a), t = o.getGraphManager().getRoot(); ; ) {
101
+ if (f.getOwner() == o)
102
+ return f;
103
+ if (f.getOwner() == t)
104
+ break;
105
+ f = f.getOwner().getParent();
106
+ }
107
+ return null;
108
+ }, i.prototype.updateLength = function() {
109
+ var a = new Array(4);
110
+ this.isOverlapingSourceAndTarget = d.getIntersection(this.target.getRect(), this.source.getRect(), a), this.isOverlapingSourceAndTarget || (this.lengthX = a[0] - a[2], this.lengthY = a[1] - a[3], Math.abs(this.lengthX) < 1 && (this.lengthX = r.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = r.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
111
+ }, i.prototype.updateLengthSimple = function() {
112
+ this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = r.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = r.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
113
+ }, I.exports = i;
114
+ },
115
+ /* 2 */
116
+ /***/
117
+ function(I, G, A) {
118
+ function u(d) {
119
+ this.vGraphObject = d;
120
+ }
121
+ I.exports = u;
122
+ },
123
+ /* 3 */
124
+ /***/
125
+ function(I, G, A) {
126
+ var u = A(2), d = A(10), r = A(13), i = A(0), e = A(16), a = A(5);
127
+ function o(t, h, s, c) {
128
+ s == null && c == null && (c = h), u.call(this, c), t.graphManager != null && (t = t.graphManager), this.estimatedSize = d.MIN_VALUE, this.inclusionTreeDepth = d.MAX_VALUE, this.vGraphObject = c, this.edges = [], this.graphManager = t, s != null && h != null ? this.rect = new r(h.x, h.y, s.width, s.height) : this.rect = new r();
129
+ }
130
+ o.prototype = Object.create(u.prototype);
131
+ for (var f in u)
132
+ o[f] = u[f];
133
+ o.prototype.getEdges = function() {
134
+ return this.edges;
135
+ }, o.prototype.getChild = function() {
136
+ return this.child;
137
+ }, o.prototype.getOwner = function() {
138
+ return this.owner;
139
+ }, o.prototype.getWidth = function() {
140
+ return this.rect.width;
141
+ }, o.prototype.setWidth = function(t) {
142
+ this.rect.width = t;
143
+ }, o.prototype.getHeight = function() {
144
+ return this.rect.height;
145
+ }, o.prototype.setHeight = function(t) {
146
+ this.rect.height = t;
147
+ }, o.prototype.getCenterX = function() {
148
+ return this.rect.x + this.rect.width / 2;
149
+ }, o.prototype.getCenterY = function() {
150
+ return this.rect.y + this.rect.height / 2;
151
+ }, o.prototype.getCenter = function() {
152
+ return new a(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
153
+ }, o.prototype.getLocation = function() {
154
+ return new a(this.rect.x, this.rect.y);
155
+ }, o.prototype.getRect = function() {
156
+ return this.rect;
157
+ }, o.prototype.getDiagonal = function() {
158
+ return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
159
+ }, o.prototype.getHalfTheDiagonal = function() {
160
+ return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
161
+ }, o.prototype.setRect = function(t, h) {
162
+ this.rect.x = t.x, this.rect.y = t.y, this.rect.width = h.width, this.rect.height = h.height;
163
+ }, o.prototype.setCenter = function(t, h) {
164
+ this.rect.x = t - this.rect.width / 2, this.rect.y = h - this.rect.height / 2;
165
+ }, o.prototype.setLocation = function(t, h) {
166
+ this.rect.x = t, this.rect.y = h;
167
+ }, o.prototype.moveBy = function(t, h) {
168
+ this.rect.x += t, this.rect.y += h;
169
+ }, o.prototype.getEdgeListToNode = function(t) {
170
+ var h = [], s = this;
171
+ return s.edges.forEach(function(c) {
172
+ if (c.target == t) {
173
+ if (c.source != s) throw "Incorrect edge source!";
174
+ h.push(c);
175
+ }
176
+ }), h;
177
+ }, o.prototype.getEdgesBetween = function(t) {
178
+ var h = [], s = this;
179
+ return s.edges.forEach(function(c) {
180
+ if (!(c.source == s || c.target == s)) throw "Incorrect edge source and/or target";
181
+ (c.target == t || c.source == t) && h.push(c);
182
+ }), h;
183
+ }, o.prototype.getNeighborsList = function() {
184
+ var t = /* @__PURE__ */ new Set(), h = this;
185
+ return h.edges.forEach(function(s) {
186
+ if (s.source == h)
187
+ t.add(s.target);
188
+ else {
189
+ if (s.target != h)
190
+ throw "Incorrect incidency!";
191
+ t.add(s.source);
192
+ }
193
+ }), t;
194
+ }, o.prototype.withChildren = function() {
195
+ var t = /* @__PURE__ */ new Set(), h, s;
196
+ if (t.add(this), this.child != null)
197
+ for (var c = this.child.getNodes(), l = 0; l < c.length; l++)
198
+ h = c[l], s = h.withChildren(), s.forEach(function(T) {
199
+ t.add(T);
200
+ });
201
+ return t;
202
+ }, o.prototype.getNoOfChildren = function() {
203
+ var t = 0, h;
204
+ if (this.child == null)
205
+ t = 1;
206
+ else
207
+ for (var s = this.child.getNodes(), c = 0; c < s.length; c++)
208
+ h = s[c], t += h.getNoOfChildren();
209
+ return t == 0 && (t = 1), t;
210
+ }, o.prototype.getEstimatedSize = function() {
211
+ if (this.estimatedSize == d.MIN_VALUE)
212
+ throw "assert failed";
213
+ return this.estimatedSize;
214
+ }, o.prototype.calcEstimatedSize = function() {
215
+ 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);
216
+ }, o.prototype.scatter = function() {
217
+ var t, h, s = -i.INITIAL_WORLD_BOUNDARY, c = i.INITIAL_WORLD_BOUNDARY;
218
+ t = i.WORLD_CENTER_X + e.nextDouble() * (c - s) + s;
219
+ var l = -i.INITIAL_WORLD_BOUNDARY, T = i.INITIAL_WORLD_BOUNDARY;
220
+ h = i.WORLD_CENTER_Y + e.nextDouble() * (T - l) + l, this.rect.x = t, this.rect.y = h;
221
+ }, o.prototype.updateBounds = function() {
222
+ if (this.getChild() == null)
223
+ throw "assert failed";
224
+ if (this.getChild().getNodes().length != 0) {
225
+ var t = this.getChild();
226
+ if (t.updateBounds(!0), this.rect.x = t.getLeft(), this.rect.y = t.getTop(), this.setWidth(t.getRight() - t.getLeft()), this.setHeight(t.getBottom() - t.getTop()), i.NODE_DIMENSIONS_INCLUDE_LABELS) {
227
+ var h = t.getRight() - t.getLeft(), s = t.getBottom() - t.getTop();
228
+ this.labelWidth && (this.labelPosHorizontal == "left" ? (this.rect.x -= this.labelWidth, this.setWidth(h + this.labelWidth)) : this.labelPosHorizontal == "center" && this.labelWidth > h ? (this.rect.x -= (this.labelWidth - h) / 2, this.setWidth(this.labelWidth)) : this.labelPosHorizontal == "right" && this.setWidth(h + this.labelWidth)), this.labelHeight && (this.labelPosVertical == "top" ? (this.rect.y -= this.labelHeight, this.setHeight(s + this.labelHeight)) : this.labelPosVertical == "center" && this.labelHeight > s ? (this.rect.y -= (this.labelHeight - s) / 2, this.setHeight(this.labelHeight)) : this.labelPosVertical == "bottom" && this.setHeight(s + this.labelHeight));
229
+ }
230
+ }
231
+ }, o.prototype.getInclusionTreeDepth = function() {
232
+ if (this.inclusionTreeDepth == d.MAX_VALUE)
233
+ throw "assert failed";
234
+ return this.inclusionTreeDepth;
235
+ }, o.prototype.transform = function(t) {
236
+ var h = this.rect.x;
237
+ h > i.WORLD_BOUNDARY ? h = i.WORLD_BOUNDARY : h < -i.WORLD_BOUNDARY && (h = -i.WORLD_BOUNDARY);
238
+ var s = this.rect.y;
239
+ s > i.WORLD_BOUNDARY ? s = i.WORLD_BOUNDARY : s < -i.WORLD_BOUNDARY && (s = -i.WORLD_BOUNDARY);
240
+ var c = new a(h, s), l = t.inverseTransformPoint(c);
241
+ this.setLocation(l.x, l.y);
242
+ }, o.prototype.getLeft = function() {
243
+ return this.rect.x;
244
+ }, o.prototype.getRight = function() {
245
+ return this.rect.x + this.rect.width;
246
+ }, o.prototype.getTop = function() {
247
+ return this.rect.y;
248
+ }, o.prototype.getBottom = function() {
249
+ return this.rect.y + this.rect.height;
250
+ }, o.prototype.getParent = function() {
251
+ return this.owner == null ? null : this.owner.getParent();
252
+ }, I.exports = o;
253
+ },
254
+ /* 4 */
255
+ /***/
256
+ function(I, G, A) {
257
+ var u = A(0);
258
+ function d() {
259
+ }
260
+ for (var r in u)
261
+ d[r] = u[r];
262
+ d.MAX_ITERATIONS = 2500, d.DEFAULT_EDGE_LENGTH = 50, d.DEFAULT_SPRING_STRENGTH = 0.45, d.DEFAULT_REPULSION_STRENGTH = 4500, d.DEFAULT_GRAVITY_STRENGTH = 0.4, d.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, d.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, d.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, d.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, d.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, d.COOLING_ADAPTATION_FACTOR = 0.33, d.ADAPTATION_LOWER_NODE_LIMIT = 1e3, d.ADAPTATION_UPPER_NODE_LIMIT = 5e3, d.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, d.MAX_NODE_DISPLACEMENT = d.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, d.MIN_REPULSION_DIST = d.DEFAULT_EDGE_LENGTH / 10, d.CONVERGENCE_CHECK_PERIOD = 100, d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, d.MIN_EDGE_LENGTH = 1, d.GRID_CALCULATION_CHECK_PERIOD = 10, I.exports = d;
263
+ },
264
+ /* 5 */
265
+ /***/
266
+ function(I, G, A) {
267
+ function u(d, r) {
268
+ d == null && r == null ? (this.x = 0, this.y = 0) : (this.x = d, this.y = r);
269
+ }
270
+ u.prototype.getX = function() {
271
+ return this.x;
272
+ }, u.prototype.getY = function() {
273
+ return this.y;
274
+ }, u.prototype.setX = function(d) {
275
+ this.x = d;
276
+ }, u.prototype.setY = function(d) {
277
+ this.y = d;
278
+ }, u.prototype.getDifference = function(d) {
279
+ return new DimensionD(this.x - d.x, this.y - d.y);
280
+ }, u.prototype.getCopy = function() {
281
+ return new u(this.x, this.y);
282
+ }, u.prototype.translate = function(d) {
283
+ return this.x += d.width, this.y += d.height, this;
284
+ }, I.exports = u;
285
+ },
286
+ /* 6 */
287
+ /***/
288
+ function(I, G, A) {
289
+ var u = A(2), d = A(10), r = A(0), i = A(7), e = A(3), a = A(1), o = A(13), f = A(12), t = A(11);
290
+ function h(c, l, T) {
291
+ u.call(this, T), this.estimatedSize = d.MIN_VALUE, this.margin = r.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = c, l != null && l instanceof i ? this.graphManager = l : l != null && l instanceof Layout && (this.graphManager = l.graphManager);
292
+ }
293
+ h.prototype = Object.create(u.prototype);
294
+ for (var s in u)
295
+ h[s] = u[s];
296
+ h.prototype.getNodes = function() {
297
+ return this.nodes;
298
+ }, h.prototype.getEdges = function() {
299
+ return this.edges;
300
+ }, h.prototype.getGraphManager = function() {
301
+ return this.graphManager;
302
+ }, h.prototype.getParent = function() {
303
+ return this.parent;
304
+ }, h.prototype.getLeft = function() {
305
+ return this.left;
306
+ }, h.prototype.getRight = function() {
307
+ return this.right;
308
+ }, h.prototype.getTop = function() {
309
+ return this.top;
310
+ }, h.prototype.getBottom = function() {
311
+ return this.bottom;
312
+ }, h.prototype.isConnected = function() {
313
+ return this.isConnected;
314
+ }, h.prototype.add = function(c, l, T) {
315
+ if (l == null && T == null) {
316
+ var g = c;
317
+ if (this.graphManager == null)
318
+ throw "Graph has no graph mgr!";
319
+ if (this.getNodes().indexOf(g) > -1)
320
+ throw "Node already in graph!";
321
+ return g.owner = this, this.getNodes().push(g), g;
322
+ } else {
323
+ var y = c;
324
+ if (!(this.getNodes().indexOf(l) > -1 && this.getNodes().indexOf(T) > -1))
325
+ throw "Source or target not in graph!";
326
+ if (!(l.owner == T.owner && l.owner == this))
327
+ throw "Both owners must be this graph!";
328
+ return l.owner != T.owner ? null : (y.source = l, y.target = T, y.isInterGraph = !1, this.getEdges().push(y), l.edges.push(y), T != l && T.edges.push(y), y);
329
+ }
330
+ }, h.prototype.remove = function(c) {
331
+ var l = c;
332
+ if (c instanceof e) {
333
+ if (l == null)
334
+ throw "Node is null!";
335
+ if (!(l.owner != null && l.owner == this))
336
+ throw "Owner graph is invalid!";
337
+ if (this.graphManager == null)
338
+ throw "Owner graph manager is invalid!";
339
+ for (var T = l.edges.slice(), g, y = T.length, C = 0; C < y; C++)
340
+ g = T[C], g.isInterGraph ? this.graphManager.remove(g) : g.source.owner.remove(g);
341
+ var w = this.nodes.indexOf(l);
342
+ if (w == -1)
343
+ throw "Node not in owner node list!";
344
+ this.nodes.splice(w, 1);
345
+ } else if (c instanceof a) {
346
+ var g = c;
347
+ if (g == null)
348
+ throw "Edge is null!";
349
+ if (!(g.source != null && g.target != null))
350
+ throw "Source and/or target is null!";
351
+ if (!(g.source.owner != null && g.target.owner != null && g.source.owner == this && g.target.owner == this))
352
+ throw "Source and/or target owner is invalid!";
353
+ var S = g.source.edges.indexOf(g), k = g.target.edges.indexOf(g);
354
+ if (!(S > -1 && k > -1))
355
+ throw "Source and/or target doesn't know this edge!";
356
+ g.source.edges.splice(S, 1), g.target != g.source && g.target.edges.splice(k, 1);
357
+ var w = g.source.owner.getEdges().indexOf(g);
358
+ if (w == -1)
359
+ throw "Not in owner's edge list!";
360
+ g.source.owner.getEdges().splice(w, 1);
361
+ }
362
+ }, h.prototype.updateLeftTop = function() {
363
+ for (var c = d.MAX_VALUE, l = d.MAX_VALUE, T, g, y, C = this.getNodes(), w = C.length, S = 0; S < w; S++) {
364
+ var k = C[S];
365
+ T = k.getTop(), g = k.getLeft(), c > T && (c = T), l > g && (l = g);
366
+ }
367
+ return c == d.MAX_VALUE ? null : (C[0].getParent().paddingLeft != null ? y = C[0].getParent().paddingLeft : y = this.margin, this.left = l - y, this.top = c - y, new f(this.left, this.top));
368
+ }, h.prototype.updateBounds = function(c) {
369
+ for (var l = d.MAX_VALUE, T = -d.MAX_VALUE, g = d.MAX_VALUE, y = -d.MAX_VALUE, C, w, S, k, Y, H = this.nodes, V = H.length, M = 0; M < V; M++) {
370
+ var it = H[M];
371
+ c && it.child != null && it.updateBounds(), C = it.getLeft(), w = it.getRight(), S = it.getTop(), k = it.getBottom(), l > C && (l = C), T < w && (T = w), g > S && (g = S), y < k && (y = k);
372
+ }
373
+ var n = new o(l, g, T - l, y - g);
374
+ l == d.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), H[0].getParent().paddingLeft != null ? Y = H[0].getParent().paddingLeft : Y = this.margin, this.left = n.x - Y, this.right = n.x + n.width + Y, this.top = n.y - Y, this.bottom = n.y + n.height + Y;
375
+ }, h.calculateBounds = function(c) {
376
+ for (var l = d.MAX_VALUE, T = -d.MAX_VALUE, g = d.MAX_VALUE, y = -d.MAX_VALUE, C, w, S, k, Y = c.length, H = 0; H < Y; H++) {
377
+ var V = c[H];
378
+ C = V.getLeft(), w = V.getRight(), S = V.getTop(), k = V.getBottom(), l > C && (l = C), T < w && (T = w), g > S && (g = S), y < k && (y = k);
379
+ }
380
+ var M = new o(l, g, T - l, y - g);
381
+ return M;
382
+ }, h.prototype.getInclusionTreeDepth = function() {
383
+ return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
384
+ }, h.prototype.getEstimatedSize = function() {
385
+ if (this.estimatedSize == d.MIN_VALUE)
386
+ throw "assert failed";
387
+ return this.estimatedSize;
388
+ }, h.prototype.calcEstimatedSize = function() {
389
+ for (var c = 0, l = this.nodes, T = l.length, g = 0; g < T; g++) {
390
+ var y = l[g];
391
+ c += y.calcEstimatedSize();
392
+ }
393
+ return c == 0 ? this.estimatedSize = r.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = c / Math.sqrt(this.nodes.length), this.estimatedSize;
394
+ }, h.prototype.updateConnected = function() {
395
+ var c = this;
396
+ if (this.nodes.length == 0) {
397
+ this.isConnected = !0;
398
+ return;
399
+ }
400
+ var l = new t(), T = /* @__PURE__ */ new Set(), g = this.nodes[0], y, C, w = g.withChildren();
401
+ for (w.forEach(function(M) {
402
+ l.push(M), T.add(M);
403
+ }); l.length !== 0; ) {
404
+ g = l.shift(), y = g.getEdges();
405
+ for (var S = y.length, k = 0; k < S; k++) {
406
+ var Y = y[k];
407
+ if (C = Y.getOtherEndInGraph(g, this), C != null && !T.has(C)) {
408
+ var H = C.withChildren();
409
+ H.forEach(function(M) {
410
+ l.push(M), T.add(M);
411
+ });
412
+ }
413
+ }
414
+ }
415
+ if (this.isConnected = !1, T.size >= this.nodes.length) {
416
+ var V = 0;
417
+ T.forEach(function(M) {
418
+ M.owner == c && V++;
419
+ }), V == this.nodes.length && (this.isConnected = !0);
420
+ }
421
+ }, I.exports = h;
422
+ },
423
+ /* 7 */
424
+ /***/
425
+ function(I, G, A) {
426
+ var u, d = A(1);
427
+ function r(i) {
428
+ u = A(6), this.layout = i, this.graphs = [], this.edges = [];
429
+ }
430
+ r.prototype.addRoot = function() {
431
+ var i = this.layout.newGraph(), e = this.layout.newNode(null), a = this.add(i, e);
432
+ return this.setRootGraph(a), this.rootGraph;
433
+ }, r.prototype.add = function(i, e, a, o, f) {
434
+ if (a == null && o == null && f == null) {
435
+ if (i == null)
436
+ throw "Graph is null!";
437
+ if (e == null)
438
+ throw "Parent node is null!";
439
+ if (this.graphs.indexOf(i) > -1)
440
+ throw "Graph already in this graph mgr!";
441
+ if (this.graphs.push(i), i.parent != null)
442
+ throw "Already has a parent!";
443
+ if (e.child != null)
444
+ throw "Already has a child!";
445
+ return i.parent = e, e.child = i, i;
446
+ } else {
447
+ f = a, o = e, a = i;
448
+ var t = o.getOwner(), h = f.getOwner();
449
+ if (!(t != null && t.getGraphManager() == this))
450
+ throw "Source not in this graph mgr!";
451
+ if (!(h != null && h.getGraphManager() == this))
452
+ throw "Target not in this graph mgr!";
453
+ if (t == h)
454
+ return a.isInterGraph = !1, t.add(a, o, f);
455
+ if (a.isInterGraph = !0, a.source = o, a.target = f, this.edges.indexOf(a) > -1)
456
+ throw "Edge already in inter-graph edge list!";
457
+ if (this.edges.push(a), !(a.source != null && a.target != null))
458
+ throw "Edge source and/or target is null!";
459
+ if (!(a.source.edges.indexOf(a) == -1 && a.target.edges.indexOf(a) == -1))
460
+ throw "Edge already in source and/or target incidency list!";
461
+ return a.source.edges.push(a), a.target.edges.push(a), a;
462
+ }
463
+ }, r.prototype.remove = function(i) {
464
+ if (i instanceof u) {
465
+ var e = i;
466
+ if (e.getGraphManager() != this)
467
+ throw "Graph not in this graph mgr";
468
+ if (!(e == this.rootGraph || e.parent != null && e.parent.graphManager == this))
469
+ throw "Invalid parent node!";
470
+ var a = [];
471
+ a = a.concat(e.getEdges());
472
+ for (var o, f = a.length, t = 0; t < f; t++)
473
+ o = a[t], e.remove(o);
474
+ var h = [];
475
+ h = h.concat(e.getNodes());
476
+ var s;
477
+ f = h.length;
478
+ for (var t = 0; t < f; t++)
479
+ s = h[t], e.remove(s);
480
+ e == this.rootGraph && this.setRootGraph(null);
481
+ var c = this.graphs.indexOf(e);
482
+ this.graphs.splice(c, 1), e.parent = null;
483
+ } else if (i instanceof d) {
484
+ if (o = i, o == null)
485
+ throw "Edge is null!";
486
+ if (!o.isInterGraph)
487
+ throw "Not an inter-graph edge!";
488
+ if (!(o.source != null && o.target != null))
489
+ throw "Source and/or target is null!";
490
+ if (!(o.source.edges.indexOf(o) != -1 && o.target.edges.indexOf(o) != -1))
491
+ throw "Source and/or target doesn't know this edge!";
492
+ var c = o.source.edges.indexOf(o);
493
+ if (o.source.edges.splice(c, 1), c = o.target.edges.indexOf(o), o.target.edges.splice(c, 1), !(o.source.owner != null && o.source.owner.getGraphManager() != null))
494
+ throw "Edge owner graph or owner graph manager is null!";
495
+ if (o.source.owner.getGraphManager().edges.indexOf(o) == -1)
496
+ throw "Not in owner graph manager's edge list!";
497
+ var c = o.source.owner.getGraphManager().edges.indexOf(o);
498
+ o.source.owner.getGraphManager().edges.splice(c, 1);
499
+ }
500
+ }, r.prototype.updateBounds = function() {
501
+ this.rootGraph.updateBounds(!0);
502
+ }, r.prototype.getGraphs = function() {
503
+ return this.graphs;
504
+ }, r.prototype.getAllNodes = function() {
505
+ if (this.allNodes == null) {
506
+ for (var i = [], e = this.getGraphs(), a = e.length, o = 0; o < a; o++)
507
+ i = i.concat(e[o].getNodes());
508
+ this.allNodes = i;
509
+ }
510
+ return this.allNodes;
511
+ }, r.prototype.resetAllNodes = function() {
512
+ this.allNodes = null;
513
+ }, r.prototype.resetAllEdges = function() {
514
+ this.allEdges = null;
515
+ }, r.prototype.resetAllNodesToApplyGravitation = function() {
516
+ this.allNodesToApplyGravitation = null;
517
+ }, r.prototype.getAllEdges = function() {
518
+ if (this.allEdges == null) {
519
+ var i = [], e = this.getGraphs();
520
+ e.length;
521
+ for (var a = 0; a < e.length; a++)
522
+ i = i.concat(e[a].getEdges());
523
+ i = i.concat(this.edges), this.allEdges = i;
524
+ }
525
+ return this.allEdges;
526
+ }, r.prototype.getAllNodesToApplyGravitation = function() {
527
+ return this.allNodesToApplyGravitation;
528
+ }, r.prototype.setAllNodesToApplyGravitation = function(i) {
529
+ if (this.allNodesToApplyGravitation != null)
530
+ throw "assert failed";
531
+ this.allNodesToApplyGravitation = i;
532
+ }, r.prototype.getRoot = function() {
533
+ return this.rootGraph;
534
+ }, r.prototype.setRootGraph = function(i) {
535
+ if (i.getGraphManager() != this)
536
+ throw "Root not in this graph mgr!";
537
+ this.rootGraph = i, i.parent == null && (i.parent = this.layout.newNode("Root node"));
538
+ }, r.prototype.getLayout = function() {
539
+ return this.layout;
540
+ }, r.prototype.isOneAncestorOfOther = function(i, e) {
541
+ if (!(i != null && e != null))
542
+ throw "assert failed";
543
+ if (i == e)
544
+ return !0;
545
+ var a = i.getOwner(), o;
546
+ do {
547
+ if (o = a.getParent(), o == null)
548
+ break;
549
+ if (o == e)
550
+ return !0;
551
+ if (a = o.getOwner(), a == null)
552
+ break;
553
+ } while (!0);
554
+ a = e.getOwner();
555
+ do {
556
+ if (o = a.getParent(), o == null)
557
+ break;
558
+ if (o == i)
559
+ return !0;
560
+ if (a = o.getOwner(), a == null)
561
+ break;
562
+ } while (!0);
563
+ return !1;
564
+ }, r.prototype.calcLowestCommonAncestors = function() {
565
+ for (var i, e, a, o, f, t = this.getAllEdges(), h = t.length, s = 0; s < h; s++) {
566
+ if (i = t[s], e = i.source, a = i.target, i.lca = null, i.sourceInLca = e, i.targetInLca = a, e == a) {
567
+ i.lca = e.getOwner();
568
+ continue;
569
+ }
570
+ for (o = e.getOwner(); i.lca == null; ) {
571
+ for (i.targetInLca = a, f = a.getOwner(); i.lca == null; ) {
572
+ if (f == o) {
573
+ i.lca = f;
574
+ break;
575
+ }
576
+ if (f == this.rootGraph)
577
+ break;
578
+ if (i.lca != null)
579
+ throw "assert failed";
580
+ i.targetInLca = f.getParent(), f = i.targetInLca.getOwner();
581
+ }
582
+ if (o == this.rootGraph)
583
+ break;
584
+ i.lca == null && (i.sourceInLca = o.getParent(), o = i.sourceInLca.getOwner());
585
+ }
586
+ if (i.lca == null)
587
+ throw "assert failed";
588
+ }
589
+ }, r.prototype.calcLowestCommonAncestor = function(i, e) {
590
+ if (i == e)
591
+ return i.getOwner();
592
+ var a = i.getOwner();
593
+ do {
594
+ if (a == null)
595
+ break;
596
+ var o = e.getOwner();
597
+ do {
598
+ if (o == null)
599
+ break;
600
+ if (o == a)
601
+ return o;
602
+ o = o.getParent().getOwner();
603
+ } while (!0);
604
+ a = a.getParent().getOwner();
605
+ } while (!0);
606
+ return a;
607
+ }, r.prototype.calcInclusionTreeDepths = function(i, e) {
608
+ i == null && e == null && (i = this.rootGraph, e = 1);
609
+ for (var a, o = i.getNodes(), f = o.length, t = 0; t < f; t++)
610
+ a = o[t], a.inclusionTreeDepth = e, a.child != null && this.calcInclusionTreeDepths(a.child, e + 1);
611
+ }, r.prototype.includesInvalidEdge = function() {
612
+ for (var i, e = [], a = this.edges.length, o = 0; o < a; o++)
613
+ i = this.edges[o], this.isOneAncestorOfOther(i.source, i.target) && e.push(i);
614
+ for (var o = 0; o < e.length; o++)
615
+ this.remove(e[o]);
616
+ return !1;
617
+ }, I.exports = r;
618
+ },
619
+ /* 8 */
620
+ /***/
621
+ function(I, G, A) {
622
+ var u = A(12);
623
+ function d() {
624
+ }
625
+ d.calcSeparationAmount = function(r, i, e, a) {
626
+ if (!r.intersects(i))
627
+ throw "assert failed";
628
+ var o = new Array(2);
629
+ this.decideDirectionsForOverlappingNodes(r, i, o), e[0] = Math.min(r.getRight(), i.getRight()) - Math.max(r.x, i.x), e[1] = Math.min(r.getBottom(), i.getBottom()) - Math.max(r.y, i.y), r.getX() <= i.getX() && r.getRight() >= i.getRight() ? e[0] += Math.min(i.getX() - r.getX(), r.getRight() - i.getRight()) : i.getX() <= r.getX() && i.getRight() >= r.getRight() && (e[0] += Math.min(r.getX() - i.getX(), i.getRight() - r.getRight())), r.getY() <= i.getY() && r.getBottom() >= i.getBottom() ? e[1] += Math.min(i.getY() - r.getY(), r.getBottom() - i.getBottom()) : i.getY() <= r.getY() && i.getBottom() >= r.getBottom() && (e[1] += Math.min(r.getY() - i.getY(), i.getBottom() - r.getBottom()));
630
+ var f = Math.abs((i.getCenterY() - r.getCenterY()) / (i.getCenterX() - r.getCenterX()));
631
+ i.getCenterY() === r.getCenterY() && i.getCenterX() === r.getCenterX() && (f = 1);
632
+ var t = f * e[0], h = e[1] / f;
633
+ e[0] < h ? h = e[0] : t = e[1], e[0] = -1 * o[0] * (h / 2 + a), e[1] = -1 * o[1] * (t / 2 + a);
634
+ }, d.decideDirectionsForOverlappingNodes = function(r, i, e) {
635
+ r.getCenterX() < i.getCenterX() ? e[0] = -1 : e[0] = 1, r.getCenterY() < i.getCenterY() ? e[1] = -1 : e[1] = 1;
636
+ }, d.getIntersection2 = function(r, i, e) {
637
+ var a = r.getCenterX(), o = r.getCenterY(), f = i.getCenterX(), t = i.getCenterY();
638
+ if (r.intersects(i))
639
+ return e[0] = a, e[1] = o, e[2] = f, e[3] = t, !0;
640
+ var h = r.getX(), s = r.getY(), c = r.getRight(), l = r.getX(), T = r.getBottom(), g = r.getRight(), y = r.getWidthHalf(), C = r.getHeightHalf(), w = i.getX(), S = i.getY(), k = i.getRight(), Y = i.getX(), H = i.getBottom(), V = i.getRight(), M = i.getWidthHalf(), it = i.getHeightHalf(), n = !1, E = !1;
641
+ if (a === f) {
642
+ if (o > t)
643
+ return e[0] = a, e[1] = s, e[2] = f, e[3] = H, !1;
644
+ if (o < t)
645
+ return e[0] = a, e[1] = T, e[2] = f, e[3] = S, !1;
646
+ } else if (o === t) {
647
+ if (a > f)
648
+ return e[0] = h, e[1] = o, e[2] = k, e[3] = t, !1;
649
+ if (a < f)
650
+ return e[0] = c, e[1] = o, e[2] = w, e[3] = t, !1;
651
+ } else {
652
+ var p = r.height / r.width, m = i.height / i.width, v = (t - o) / (f - a), D = void 0, _ = void 0, x = void 0, F = void 0, X = void 0, B = void 0;
653
+ if (-p === v ? a > f ? (e[0] = l, e[1] = T, n = !0) : (e[0] = c, e[1] = s, n = !0) : p === v && (a > f ? (e[0] = h, e[1] = s, n = !0) : (e[0] = g, e[1] = T, n = !0)), -m === v ? f > a ? (e[2] = Y, e[3] = H, E = !0) : (e[2] = k, e[3] = S, E = !0) : m === v && (f > a ? (e[2] = w, e[3] = S, E = !0) : (e[2] = V, e[3] = H, E = !0)), n && E)
654
+ return !1;
655
+ if (a > f ? o > t ? (D = this.getCardinalDirection(p, v, 4), _ = this.getCardinalDirection(m, v, 2)) : (D = this.getCardinalDirection(-p, v, 3), _ = this.getCardinalDirection(-m, v, 1)) : o > t ? (D = this.getCardinalDirection(-p, v, 1), _ = this.getCardinalDirection(-m, v, 3)) : (D = this.getCardinalDirection(p, v, 2), _ = this.getCardinalDirection(m, v, 4)), !n)
656
+ switch (D) {
657
+ case 1:
658
+ F = s, x = a + -C / v, e[0] = x, e[1] = F;
659
+ break;
660
+ case 2:
661
+ x = g, F = o + y * v, e[0] = x, e[1] = F;
662
+ break;
663
+ case 3:
664
+ F = T, x = a + C / v, e[0] = x, e[1] = F;
665
+ break;
666
+ case 4:
667
+ x = l, F = o + -y * v, e[0] = x, e[1] = F;
668
+ break;
669
+ }
670
+ if (!E)
671
+ switch (_) {
672
+ case 1:
673
+ B = S, X = f + -it / v, e[2] = X, e[3] = B;
674
+ break;
675
+ case 2:
676
+ X = V, B = t + M * v, e[2] = X, e[3] = B;
677
+ break;
678
+ case 3:
679
+ B = H, X = f + it / v, e[2] = X, e[3] = B;
680
+ break;
681
+ case 4:
682
+ X = Y, B = t + -M * v, e[2] = X, e[3] = B;
683
+ break;
684
+ }
685
+ }
686
+ return !1;
687
+ }, d.getCardinalDirection = function(r, i, e) {
688
+ return r > i ? e : 1 + e % 4;
689
+ }, d.getIntersection = function(r, i, e, a) {
690
+ if (a == null)
691
+ return this.getIntersection2(r, i, e);
692
+ var o = r.x, f = r.y, t = i.x, h = i.y, s = e.x, c = e.y, l = a.x, T = a.y, g = void 0, y = void 0, C = void 0, w = void 0, S = void 0, k = void 0, Y = void 0, H = void 0, V = void 0;
693
+ return C = h - f, S = o - t, Y = t * f - o * h, w = T - c, k = s - l, H = l * c - s * T, V = C * k - w * S, V === 0 ? null : (g = (S * H - k * Y) / V, y = (w * Y - C * H) / V, new u(g, y));
694
+ }, d.angleOfVector = function(r, i, e, a) {
695
+ var o = void 0;
696
+ return r !== e ? (o = Math.atan((a - i) / (e - r)), e < r ? o += Math.PI : a < i && (o += this.TWO_PI)) : a < i ? o = this.ONE_AND_HALF_PI : o = this.HALF_PI, o;
697
+ }, d.doIntersect = function(r, i, e, a) {
698
+ var o = r.x, f = r.y, t = i.x, h = i.y, s = e.x, c = e.y, l = a.x, T = a.y, g = (t - o) * (T - c) - (l - s) * (h - f);
699
+ if (g === 0)
700
+ return !1;
701
+ var y = ((T - c) * (l - o) + (s - l) * (T - f)) / g, C = ((f - h) * (l - o) + (t - o) * (T - f)) / g;
702
+ return 0 < y && y < 1 && 0 < C && C < 1;
703
+ }, d.findCircleLineIntersections = function(r, i, e, a, o, f, t) {
704
+ var h = (e - r) * (e - r) + (a - i) * (a - i), s = 2 * ((r - o) * (e - r) + (i - f) * (a - i)), c = (r - o) * (r - o) + (i - f) * (i - f) - t * t, l = s * s - 4 * h * c;
705
+ if (l >= 0) {
706
+ var T = (-s + Math.sqrt(s * s - 4 * h * c)) / (2 * h), g = (-s - Math.sqrt(s * s - 4 * h * c)) / (2 * h), y = null;
707
+ return T >= 0 && T <= 1 ? [T] : g >= 0 && g <= 1 ? [g] : y;
708
+ } else return null;
709
+ }, d.HALF_PI = 0.5 * Math.PI, d.ONE_AND_HALF_PI = 1.5 * Math.PI, d.TWO_PI = 2 * Math.PI, d.THREE_PI = 3 * Math.PI, I.exports = d;
710
+ },
711
+ /* 9 */
712
+ /***/
713
+ function(I, G, A) {
714
+ function u() {
715
+ }
716
+ u.sign = function(d) {
717
+ return d > 0 ? 1 : d < 0 ? -1 : 0;
718
+ }, u.floor = function(d) {
719
+ return d < 0 ? Math.ceil(d) : Math.floor(d);
720
+ }, u.ceil = function(d) {
721
+ return d < 0 ? Math.floor(d) : Math.ceil(d);
722
+ }, I.exports = u;
723
+ },
724
+ /* 10 */
725
+ /***/
726
+ function(I, G, A) {
727
+ function u() {
728
+ }
729
+ u.MAX_VALUE = 2147483647, u.MIN_VALUE = -2147483648, I.exports = u;
730
+ },
731
+ /* 11 */
732
+ /***/
733
+ function(I, G, A) {
734
+ var u = /* @__PURE__ */ function() {
735
+ function o(f, t) {
736
+ for (var h = 0; h < t.length; h++) {
737
+ var s = t[h];
738
+ s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(f, s.key, s);
739
+ }
740
+ }
741
+ return function(f, t, h) {
742
+ return t && o(f.prototype, t), h && o(f, h), f;
743
+ };
744
+ }();
745
+ function d(o, f) {
746
+ if (!(o instanceof f))
747
+ throw new TypeError("Cannot call a class as a function");
748
+ }
749
+ var r = function(o) {
750
+ return { value: o, next: null, prev: null };
751
+ }, i = function(o, f, t, h) {
752
+ return o !== null ? o.next = f : h.head = f, t !== null ? t.prev = f : h.tail = f, f.prev = o, f.next = t, h.length++, f;
753
+ }, e = function(o, f) {
754
+ var t = o.prev, h = o.next;
755
+ return t !== null ? t.next = h : f.head = h, h !== null ? h.prev = t : f.tail = t, o.prev = o.next = null, f.length--, o;
756
+ }, a = function() {
757
+ function o(f) {
758
+ var t = this;
759
+ d(this, o), this.length = 0, this.head = null, this.tail = null, f != null && f.forEach(function(h) {
760
+ return t.push(h);
761
+ });
762
+ }
763
+ return u(o, [{
764
+ key: "size",
765
+ value: function() {
766
+ return this.length;
767
+ }
768
+ }, {
769
+ key: "insertBefore",
770
+ value: function(f, t) {
771
+ return i(t.prev, r(f), t, this);
772
+ }
773
+ }, {
774
+ key: "insertAfter",
775
+ value: function(f, t) {
776
+ return i(t, r(f), t.next, this);
777
+ }
778
+ }, {
779
+ key: "insertNodeBefore",
780
+ value: function(f, t) {
781
+ return i(t.prev, f, t, this);
782
+ }
783
+ }, {
784
+ key: "insertNodeAfter",
785
+ value: function(f, t) {
786
+ return i(t, f, t.next, this);
787
+ }
788
+ }, {
789
+ key: "push",
790
+ value: function(f) {
791
+ return i(this.tail, r(f), null, this);
792
+ }
793
+ }, {
794
+ key: "unshift",
795
+ value: function(f) {
796
+ return i(null, r(f), this.head, this);
797
+ }
798
+ }, {
799
+ key: "remove",
800
+ value: function(f) {
801
+ return e(f, this);
802
+ }
803
+ }, {
804
+ key: "pop",
805
+ value: function() {
806
+ return e(this.tail, this).value;
807
+ }
808
+ }, {
809
+ key: "popNode",
810
+ value: function() {
811
+ return e(this.tail, this);
812
+ }
813
+ }, {
814
+ key: "shift",
815
+ value: function() {
816
+ return e(this.head, this).value;
817
+ }
818
+ }, {
819
+ key: "shiftNode",
820
+ value: function() {
821
+ return e(this.head, this);
822
+ }
823
+ }, {
824
+ key: "get_object_at",
825
+ value: function(f) {
826
+ if (f <= this.length()) {
827
+ for (var t = 1, h = this.head; t < f; )
828
+ h = h.next, t++;
829
+ return h.value;
830
+ }
831
+ }
832
+ }, {
833
+ key: "set_object_at",
834
+ value: function(f, t) {
835
+ if (f <= this.length()) {
836
+ for (var h = 1, s = this.head; h < f; )
837
+ s = s.next, h++;
838
+ s.value = t;
839
+ }
840
+ }
841
+ }]), o;
842
+ }();
843
+ I.exports = a;
844
+ },
845
+ /* 12 */
846
+ /***/
847
+ function(I, G, A) {
848
+ function u(d, r, i) {
849
+ this.x = null, this.y = null, d == null && r == null && i == null ? (this.x = 0, this.y = 0) : typeof d == "number" && typeof r == "number" && i == null ? (this.x = d, this.y = r) : d.constructor.name == "Point" && r == null && i == null && (i = d, this.x = i.x, this.y = i.y);
850
+ }
851
+ u.prototype.getX = function() {
852
+ return this.x;
853
+ }, u.prototype.getY = function() {
854
+ return this.y;
855
+ }, u.prototype.getLocation = function() {
856
+ return new u(this.x, this.y);
857
+ }, u.prototype.setLocation = function(d, r, i) {
858
+ d.constructor.name == "Point" && r == null && i == null ? (i = d, this.setLocation(i.x, i.y)) : typeof d == "number" && typeof r == "number" && i == null && (parseInt(d) == d && parseInt(r) == r ? this.move(d, r) : (this.x = Math.floor(d + 0.5), this.y = Math.floor(r + 0.5)));
859
+ }, u.prototype.move = function(d, r) {
860
+ this.x = d, this.y = r;
861
+ }, u.prototype.translate = function(d, r) {
862
+ this.x += d, this.y += r;
863
+ }, u.prototype.equals = function(d) {
864
+ if (d.constructor.name == "Point") {
865
+ var r = d;
866
+ return this.x == r.x && this.y == r.y;
867
+ }
868
+ return this == d;
869
+ }, u.prototype.toString = function() {
870
+ return new u().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
871
+ }, I.exports = u;
872
+ },
873
+ /* 13 */
874
+ /***/
875
+ function(I, G, A) {
876
+ function u(d, r, i, e) {
877
+ this.x = 0, this.y = 0, this.width = 0, this.height = 0, d != null && r != null && i != null && e != null && (this.x = d, this.y = r, this.width = i, this.height = e);
878
+ }
879
+ u.prototype.getX = function() {
880
+ return this.x;
881
+ }, u.prototype.setX = function(d) {
882
+ this.x = d;
883
+ }, u.prototype.getY = function() {
884
+ return this.y;
885
+ }, u.prototype.setY = function(d) {
886
+ this.y = d;
887
+ }, u.prototype.getWidth = function() {
888
+ return this.width;
889
+ }, u.prototype.setWidth = function(d) {
890
+ this.width = d;
891
+ }, u.prototype.getHeight = function() {
892
+ return this.height;
893
+ }, u.prototype.setHeight = function(d) {
894
+ this.height = d;
895
+ }, u.prototype.getRight = function() {
896
+ return this.x + this.width;
897
+ }, u.prototype.getBottom = function() {
898
+ return this.y + this.height;
899
+ }, u.prototype.intersects = function(d) {
900
+ return !(this.getRight() < d.x || this.getBottom() < d.y || d.getRight() < this.x || d.getBottom() < this.y);
901
+ }, u.prototype.getCenterX = function() {
902
+ return this.x + this.width / 2;
903
+ }, u.prototype.getMinX = function() {
904
+ return this.getX();
905
+ }, u.prototype.getMaxX = function() {
906
+ return this.getX() + this.width;
907
+ }, u.prototype.getCenterY = function() {
908
+ return this.y + this.height / 2;
909
+ }, u.prototype.getMinY = function() {
910
+ return this.getY();
911
+ }, u.prototype.getMaxY = function() {
912
+ return this.getY() + this.height;
913
+ }, u.prototype.getWidthHalf = function() {
914
+ return this.width / 2;
915
+ }, u.prototype.getHeightHalf = function() {
916
+ return this.height / 2;
917
+ }, I.exports = u;
918
+ },
919
+ /* 14 */
920
+ /***/
921
+ function(I, G, A) {
922
+ var u = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
923
+ return typeof r;
924
+ } : function(r) {
925
+ return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
926
+ };
927
+ function d() {
928
+ }
929
+ d.lastID = 0, d.createID = function(r) {
930
+ return d.isPrimitive(r) ? r : (r.uniqueID != null || (r.uniqueID = d.getString(), d.lastID++), r.uniqueID);
931
+ }, d.getString = function(r) {
932
+ return r == null && (r = d.lastID), "Object#" + r;
933
+ }, d.isPrimitive = function(r) {
934
+ var i = typeof r > "u" ? "undefined" : u(r);
935
+ return r == null || i != "object" && i != "function";
936
+ }, I.exports = d;
937
+ },
938
+ /* 15 */
939
+ /***/
940
+ function(I, G, A) {
941
+ function u(s) {
942
+ if (Array.isArray(s)) {
943
+ for (var c = 0, l = Array(s.length); c < s.length; c++)
944
+ l[c] = s[c];
945
+ return l;
946
+ } else
947
+ return Array.from(s);
948
+ }
949
+ var d = A(0), r = A(7), i = A(3), e = A(1), a = A(6), o = A(5), f = A(17), t = A(29);
950
+ function h(s) {
951
+ t.call(this), this.layoutQuality = d.QUALITY, this.createBendsAsNeeded = d.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = d.DEFAULT_INCREMENTAL, this.animationOnLayout = d.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = d.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = d.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = d.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new r(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, s != null && (this.isRemoteUse = s);
952
+ }
953
+ h.RANDOM_SEED = 1, h.prototype = Object.create(t.prototype), h.prototype.getGraphManager = function() {
954
+ return this.graphManager;
955
+ }, h.prototype.getAllNodes = function() {
956
+ return this.graphManager.getAllNodes();
957
+ }, h.prototype.getAllEdges = function() {
958
+ return this.graphManager.getAllEdges();
959
+ }, h.prototype.getAllNodesToApplyGravitation = function() {
960
+ return this.graphManager.getAllNodesToApplyGravitation();
961
+ }, h.prototype.newGraphManager = function() {
962
+ var s = new r(this);
963
+ return this.graphManager = s, s;
964
+ }, h.prototype.newGraph = function(s) {
965
+ return new a(null, this.graphManager, s);
966
+ }, h.prototype.newNode = function(s) {
967
+ return new i(this.graphManager, s);
968
+ }, h.prototype.newEdge = function(s) {
969
+ return new e(null, null, s);
970
+ }, h.prototype.checkLayoutSuccess = function() {
971
+ return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
972
+ }, h.prototype.runLayout = function() {
973
+ this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
974
+ var s;
975
+ return this.checkLayoutSuccess() ? s = !1 : s = this.layout(), d.ANIMATE === "during" ? !1 : (s && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, s);
976
+ }, h.prototype.doPostLayout = function() {
977
+ this.incremental || this.transform(), this.update();
978
+ }, h.prototype.update2 = function() {
979
+ if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
980
+ for (var s = this.graphManager.getAllEdges(), c = 0; c < s.length; c++)
981
+ s[c];
982
+ for (var l = this.graphManager.getRoot().getNodes(), c = 0; c < l.length; c++)
983
+ l[c];
984
+ this.update(this.graphManager.getRoot());
985
+ }
986
+ }, h.prototype.update = function(s) {
987
+ if (s == null)
988
+ this.update2();
989
+ else if (s instanceof i) {
990
+ var c = s;
991
+ if (c.getChild() != null)
992
+ for (var l = c.getChild().getNodes(), T = 0; T < l.length; T++)
993
+ update(l[T]);
994
+ if (c.vGraphObject != null) {
995
+ var g = c.vGraphObject;
996
+ g.update(c);
997
+ }
998
+ } else if (s instanceof e) {
999
+ var y = s;
1000
+ if (y.vGraphObject != null) {
1001
+ var C = y.vGraphObject;
1002
+ C.update(y);
1003
+ }
1004
+ } else if (s instanceof a) {
1005
+ var w = s;
1006
+ if (w.vGraphObject != null) {
1007
+ var S = w.vGraphObject;
1008
+ S.update(w);
1009
+ }
1010
+ }
1011
+ }, h.prototype.initParameters = function() {
1012
+ this.isSubLayout || (this.layoutQuality = d.QUALITY, this.animationDuringLayout = d.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = d.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = d.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = d.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = d.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = d.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
1013
+ }, h.prototype.transform = function(s) {
1014
+ if (s == null)
1015
+ this.transform(new o(0, 0));
1016
+ else {
1017
+ var c = new f(), l = this.graphManager.getRoot().updateLeftTop();
1018
+ if (l != null) {
1019
+ c.setWorldOrgX(s.x), c.setWorldOrgY(s.y), c.setDeviceOrgX(l.x), c.setDeviceOrgY(l.y);
1020
+ for (var T = this.getAllNodes(), g, y = 0; y < T.length; y++)
1021
+ g = T[y], g.transform(c);
1022
+ }
1023
+ }
1024
+ }, h.prototype.positionNodesRandomly = function(s) {
1025
+ if (s == null)
1026
+ this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
1027
+ else
1028
+ for (var c, l, T = s.getNodes(), g = 0; g < T.length; g++)
1029
+ c = T[g], l = c.getChild(), l == null || l.getNodes().length == 0 ? c.scatter() : (this.positionNodesRandomly(l), c.updateBounds());
1030
+ }, h.prototype.getFlatForest = function() {
1031
+ for (var s = [], c = !0, l = this.graphManager.getRoot().getNodes(), T = !0, g = 0; g < l.length; g++)
1032
+ l[g].getChild() != null && (T = !1);
1033
+ if (!T)
1034
+ return s;
1035
+ var y = /* @__PURE__ */ new Set(), C = [], w = /* @__PURE__ */ new Map(), S = [];
1036
+ for (S = S.concat(l); S.length > 0 && c; ) {
1037
+ for (C.push(S[0]); C.length > 0 && c; ) {
1038
+ var k = C[0];
1039
+ C.splice(0, 1), y.add(k);
1040
+ for (var Y = k.getEdges(), g = 0; g < Y.length; g++) {
1041
+ var H = Y[g].getOtherEnd(k);
1042
+ if (w.get(k) != H)
1043
+ if (!y.has(H))
1044
+ C.push(H), w.set(H, k);
1045
+ else {
1046
+ c = !1;
1047
+ break;
1048
+ }
1049
+ }
1050
+ }
1051
+ if (!c)
1052
+ s = [];
1053
+ else {
1054
+ var V = [].concat(u(y));
1055
+ s.push(V);
1056
+ for (var g = 0; g < V.length; g++) {
1057
+ var M = V[g], it = S.indexOf(M);
1058
+ it > -1 && S.splice(it, 1);
1059
+ }
1060
+ y = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Map();
1061
+ }
1062
+ }
1063
+ return s;
1064
+ }, h.prototype.createDummyNodesForBendpoints = function(s) {
1065
+ for (var c = [], l = s.source, T = this.graphManager.calcLowestCommonAncestor(s.source, s.target), g = 0; g < s.bendpoints.length; g++) {
1066
+ var y = this.newNode(null);
1067
+ y.setRect(new Point(0, 0), new Dimension(1, 1)), T.add(y);
1068
+ var C = this.newEdge(null);
1069
+ this.graphManager.add(C, l, y), c.add(y), l = y;
1070
+ }
1071
+ var C = this.newEdge(null);
1072
+ return this.graphManager.add(C, l, s.target), this.edgeToDummyNodes.set(s, c), s.isInterGraph() ? this.graphManager.remove(s) : T.remove(s), c;
1073
+ }, h.prototype.createBendpointsFromDummyNodes = function() {
1074
+ var s = [];
1075
+ s = s.concat(this.graphManager.getAllEdges()), s = [].concat(u(this.edgeToDummyNodes.keys())).concat(s);
1076
+ for (var c = 0; c < s.length; c++) {
1077
+ var l = s[c];
1078
+ if (l.bendpoints.length > 0) {
1079
+ for (var T = this.edgeToDummyNodes.get(l), g = 0; g < T.length; g++) {
1080
+ var y = T[g], C = new o(y.getCenterX(), y.getCenterY()), w = l.bendpoints.get(g);
1081
+ w.x = C.x, w.y = C.y, y.getOwner().remove(y);
1082
+ }
1083
+ this.graphManager.add(l, l.source, l.target);
1084
+ }
1085
+ }
1086
+ }, h.transform = function(s, c, l, T) {
1087
+ if (l != null && T != null) {
1088
+ var g = c;
1089
+ if (s <= 50) {
1090
+ var y = c / l;
1091
+ g -= (c - y) / 50 * (50 - s);
1092
+ } else {
1093
+ var C = c * T;
1094
+ g += (C - c) / 50 * (s - 50);
1095
+ }
1096
+ return g;
1097
+ } else {
1098
+ var w, S;
1099
+ return s <= 50 ? (w = 9 * c / 500, S = c / 10) : (w = 9 * c / 50, S = -8 * c), w * s + S;
1100
+ }
1101
+ }, h.findCenterOfTree = function(s) {
1102
+ var c = [];
1103
+ c = c.concat(s);
1104
+ var l = [], T = /* @__PURE__ */ new Map(), g = !1, y = null;
1105
+ (c.length == 1 || c.length == 2) && (g = !0, y = c[0]);
1106
+ for (var C = 0; C < c.length; C++) {
1107
+ var w = c[C], S = w.getNeighborsList().size;
1108
+ T.set(w, w.getNeighborsList().size), S == 1 && l.push(w);
1109
+ }
1110
+ var k = [];
1111
+ for (k = k.concat(l); !g; ) {
1112
+ var Y = [];
1113
+ Y = Y.concat(k), k = [];
1114
+ for (var C = 0; C < c.length; C++) {
1115
+ var w = c[C], H = c.indexOf(w);
1116
+ H >= 0 && c.splice(H, 1);
1117
+ var V = w.getNeighborsList();
1118
+ V.forEach(function(n) {
1119
+ if (l.indexOf(n) < 0) {
1120
+ var E = T.get(n), p = E - 1;
1121
+ p == 1 && k.push(n), T.set(n, p);
1122
+ }
1123
+ });
1124
+ }
1125
+ l = l.concat(k), (c.length == 1 || c.length == 2) && (g = !0, y = c[0]);
1126
+ }
1127
+ return y;
1128
+ }, h.prototype.setGraphManager = function(s) {
1129
+ this.graphManager = s;
1130
+ }, I.exports = h;
1131
+ },
1132
+ /* 16 */
1133
+ /***/
1134
+ function(I, G, A) {
1135
+ function u() {
1136
+ }
1137
+ u.seed = 1, u.x = 0, u.nextDouble = function() {
1138
+ return u.x = Math.sin(u.seed++) * 1e4, u.x - Math.floor(u.x);
1139
+ }, I.exports = u;
1140
+ },
1141
+ /* 17 */
1142
+ /***/
1143
+ function(I, G, A) {
1144
+ var u = A(5);
1145
+ function d(r, i) {
1146
+ this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
1147
+ }
1148
+ d.prototype.getWorldOrgX = function() {
1149
+ return this.lworldOrgX;
1150
+ }, d.prototype.setWorldOrgX = function(r) {
1151
+ this.lworldOrgX = r;
1152
+ }, d.prototype.getWorldOrgY = function() {
1153
+ return this.lworldOrgY;
1154
+ }, d.prototype.setWorldOrgY = function(r) {
1155
+ this.lworldOrgY = r;
1156
+ }, d.prototype.getWorldExtX = function() {
1157
+ return this.lworldExtX;
1158
+ }, d.prototype.setWorldExtX = function(r) {
1159
+ this.lworldExtX = r;
1160
+ }, d.prototype.getWorldExtY = function() {
1161
+ return this.lworldExtY;
1162
+ }, d.prototype.setWorldExtY = function(r) {
1163
+ this.lworldExtY = r;
1164
+ }, d.prototype.getDeviceOrgX = function() {
1165
+ return this.ldeviceOrgX;
1166
+ }, d.prototype.setDeviceOrgX = function(r) {
1167
+ this.ldeviceOrgX = r;
1168
+ }, d.prototype.getDeviceOrgY = function() {
1169
+ return this.ldeviceOrgY;
1170
+ }, d.prototype.setDeviceOrgY = function(r) {
1171
+ this.ldeviceOrgY = r;
1172
+ }, d.prototype.getDeviceExtX = function() {
1173
+ return this.ldeviceExtX;
1174
+ }, d.prototype.setDeviceExtX = function(r) {
1175
+ this.ldeviceExtX = r;
1176
+ }, d.prototype.getDeviceExtY = function() {
1177
+ return this.ldeviceExtY;
1178
+ }, d.prototype.setDeviceExtY = function(r) {
1179
+ this.ldeviceExtY = r;
1180
+ }, d.prototype.transformX = function(r) {
1181
+ var i = 0, e = this.lworldExtX;
1182
+ return e != 0 && (i = this.ldeviceOrgX + (r - this.lworldOrgX) * this.ldeviceExtX / e), i;
1183
+ }, d.prototype.transformY = function(r) {
1184
+ var i = 0, e = this.lworldExtY;
1185
+ return e != 0 && (i = this.ldeviceOrgY + (r - this.lworldOrgY) * this.ldeviceExtY / e), i;
1186
+ }, d.prototype.inverseTransformX = function(r) {
1187
+ var i = 0, e = this.ldeviceExtX;
1188
+ return e != 0 && (i = this.lworldOrgX + (r - this.ldeviceOrgX) * this.lworldExtX / e), i;
1189
+ }, d.prototype.inverseTransformY = function(r) {
1190
+ var i = 0, e = this.ldeviceExtY;
1191
+ return e != 0 && (i = this.lworldOrgY + (r - this.ldeviceOrgY) * this.lworldExtY / e), i;
1192
+ }, d.prototype.inverseTransformPoint = function(r) {
1193
+ var i = new u(this.inverseTransformX(r.x), this.inverseTransformY(r.y));
1194
+ return i;
1195
+ }, I.exports = d;
1196
+ },
1197
+ /* 18 */
1198
+ /***/
1199
+ function(I, G, A) {
1200
+ function u(t) {
1201
+ if (Array.isArray(t)) {
1202
+ for (var h = 0, s = Array(t.length); h < t.length; h++)
1203
+ s[h] = t[h];
1204
+ return s;
1205
+ } else
1206
+ return Array.from(t);
1207
+ }
1208
+ var d = A(15), r = A(4), i = A(0), e = A(8), a = A(9);
1209
+ function o() {
1210
+ d.call(this), this.useSmartIdealEdgeLengthCalculation = r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = r.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = r.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = r.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * r.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = r.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = r.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = r.MAX_ITERATIONS;
1211
+ }
1212
+ o.prototype = Object.create(d.prototype);
1213
+ for (var f in d)
1214
+ o[f] = d[f];
1215
+ o.prototype.initParameters = function() {
1216
+ d.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = r.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1217
+ }, o.prototype.calcIdealEdgeLengths = function() {
1218
+ for (var t, h, s, c, l, T, g, y = this.getGraphManager().getAllEdges(), C = 0; C < y.length; C++)
1219
+ t = y[C], h = t.idealLength, t.isInterGraph && (c = t.getSource(), l = t.getTarget(), T = t.getSourceInLca().getEstimatedSize(), g = t.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (t.idealLength += T + g - 2 * i.SIMPLE_NODE_SIZE), s = t.getLca().getInclusionTreeDepth(), t.idealLength += h * r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (c.getInclusionTreeDepth() + l.getInclusionTreeDepth() - 2 * s));
1220
+ }, o.prototype.initSpringEmbedder = function() {
1221
+ var t = this.getAllNodes().length;
1222
+ this.incremental ? (t > r.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * r.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (t - r.ADAPTATION_LOWER_NODE_LIMIT) / (r.ADAPTATION_UPPER_NODE_LIMIT - r.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - r.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = r.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (t > r.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(r.COOLING_ADAPTATION_FACTOR, 1 - (t - r.ADAPTATION_LOWER_NODE_LIMIT) / (r.ADAPTATION_UPPER_NODE_LIMIT - r.ADAPTATION_LOWER_NODE_LIMIT) * (1 - r.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = r.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.displacementThresholdPerNode = 3 * r.DEFAULT_EDGE_LENGTH / 100, this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1223
+ }, o.prototype.calcSpringForces = function() {
1224
+ for (var t = this.getAllEdges(), h, s = 0; s < t.length; s++)
1225
+ h = t[s], this.calcSpringForce(h, h.idealLength);
1226
+ }, o.prototype.calcRepulsionForces = function() {
1227
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, h = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, s, c, l, T, g = this.getAllNodes(), y;
1228
+ if (this.useFRGridVariant)
1229
+ for (this.totalIterations % r.GRID_CALCULATION_CHECK_PERIOD == 1 && t && this.updateGrid(), y = /* @__PURE__ */ new Set(), s = 0; s < g.length; s++)
1230
+ l = g[s], this.calculateRepulsionForceOfANode(l, y, t, h), y.add(l);
1231
+ else
1232
+ for (s = 0; s < g.length; s++)
1233
+ for (l = g[s], c = s + 1; c < g.length; c++)
1234
+ T = g[c], l.getOwner() == T.getOwner() && this.calcRepulsionForce(l, T);
1235
+ }, o.prototype.calcGravitationalForces = function() {
1236
+ for (var t, h = this.getAllNodesToApplyGravitation(), s = 0; s < h.length; s++)
1237
+ t = h[s], this.calcGravitationalForce(t);
1238
+ }, o.prototype.moveNodes = function() {
1239
+ for (var t = this.getAllNodes(), h, s = 0; s < t.length; s++)
1240
+ h = t[s], h.move();
1241
+ }, o.prototype.calcSpringForce = function(t, h) {
1242
+ var s = t.getSource(), c = t.getTarget(), l, T, g, y;
1243
+ if (this.uniformLeafNodeSizes && s.getChild() == null && c.getChild() == null)
1244
+ t.updateLengthSimple();
1245
+ else if (t.updateLength(), t.isOverlapingSourceAndTarget)
1246
+ return;
1247
+ l = t.getLength(), l != 0 && (T = t.edgeElasticity * (l - h), g = T * (t.lengthX / l), y = T * (t.lengthY / l), s.springForceX += g, s.springForceY += y, c.springForceX -= g, c.springForceY -= y);
1248
+ }, o.prototype.calcRepulsionForce = function(t, h) {
1249
+ var s = t.getRect(), c = h.getRect(), l = new Array(2), T = new Array(4), g, y, C, w, S, k, Y;
1250
+ if (s.intersects(c)) {
1251
+ e.calcSeparationAmount(s, c, l, r.DEFAULT_EDGE_LENGTH / 2), k = 2 * l[0], Y = 2 * l[1];
1252
+ var H = t.noOfChildren * h.noOfChildren / (t.noOfChildren + h.noOfChildren);
1253
+ t.repulsionForceX -= H * k, t.repulsionForceY -= H * Y, h.repulsionForceX += H * k, h.repulsionForceY += H * Y;
1254
+ } else
1255
+ this.uniformLeafNodeSizes && t.getChild() == null && h.getChild() == null ? (g = c.getCenterX() - s.getCenterX(), y = c.getCenterY() - s.getCenterY()) : (e.getIntersection(s, c, T), g = T[2] - T[0], y = T[3] - T[1]), Math.abs(g) < r.MIN_REPULSION_DIST && (g = a.sign(g) * r.MIN_REPULSION_DIST), Math.abs(y) < r.MIN_REPULSION_DIST && (y = a.sign(y) * r.MIN_REPULSION_DIST), C = g * g + y * y, w = Math.sqrt(C), S = (t.nodeRepulsion / 2 + h.nodeRepulsion / 2) * t.noOfChildren * h.noOfChildren / C, k = S * g / w, Y = S * y / w, t.repulsionForceX -= k, t.repulsionForceY -= Y, h.repulsionForceX += k, h.repulsionForceY += Y;
1256
+ }, o.prototype.calcGravitationalForce = function(t) {
1257
+ var h, s, c, l, T, g, y, C;
1258
+ h = t.getOwner(), s = (h.getRight() + h.getLeft()) / 2, c = (h.getTop() + h.getBottom()) / 2, l = t.getCenterX() - s, T = t.getCenterY() - c, g = Math.abs(l) + t.getWidth() / 2, y = Math.abs(T) + t.getHeight() / 2, t.getOwner() == this.graphManager.getRoot() ? (C = h.getEstimatedSize() * this.gravityRangeFactor, (g > C || y > C) && (t.gravitationForceX = -this.gravityConstant * l, t.gravitationForceY = -this.gravityConstant * T)) : (C = h.getEstimatedSize() * this.compoundGravityRangeFactor, (g > C || y > C) && (t.gravitationForceX = -this.gravityConstant * l * this.compoundGravityConstant, t.gravitationForceY = -this.gravityConstant * T * this.compoundGravityConstant));
1259
+ }, o.prototype.isConverged = function() {
1260
+ var t, h = !1;
1261
+ return this.totalIterations > this.maxIterations / 3 && (h = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), t = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, t || h;
1262
+ }, o.prototype.animate = function() {
1263
+ this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1264
+ }, o.prototype.calcNoOfChildrenForAllNodes = function() {
1265
+ for (var t, h = this.graphManager.getAllNodes(), s = 0; s < h.length; s++)
1266
+ t = h[s], t.noOfChildren = t.getNoOfChildren();
1267
+ }, o.prototype.calcGrid = function(t) {
1268
+ var h = 0, s = 0;
1269
+ h = parseInt(Math.ceil((t.getRight() - t.getLeft()) / this.repulsionRange)), s = parseInt(Math.ceil((t.getBottom() - t.getTop()) / this.repulsionRange));
1270
+ for (var c = new Array(h), l = 0; l < h; l++)
1271
+ c[l] = new Array(s);
1272
+ for (var l = 0; l < h; l++)
1273
+ for (var T = 0; T < s; T++)
1274
+ c[l][T] = new Array();
1275
+ return c;
1276
+ }, o.prototype.addNodeToGrid = function(t, h, s) {
1277
+ var c = 0, l = 0, T = 0, g = 0;
1278
+ c = parseInt(Math.floor((t.getRect().x - h) / this.repulsionRange)), l = parseInt(Math.floor((t.getRect().width + t.getRect().x - h) / this.repulsionRange)), T = parseInt(Math.floor((t.getRect().y - s) / this.repulsionRange)), g = parseInt(Math.floor((t.getRect().height + t.getRect().y - s) / this.repulsionRange));
1279
+ for (var y = c; y <= l; y++)
1280
+ for (var C = T; C <= g; C++)
1281
+ this.grid[y][C].push(t), t.setGridCoordinates(c, l, T, g);
1282
+ }, o.prototype.updateGrid = function() {
1283
+ var t, h, s = this.getAllNodes();
1284
+ for (this.grid = this.calcGrid(this.graphManager.getRoot()), t = 0; t < s.length; t++)
1285
+ h = s[t], this.addNodeToGrid(h, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1286
+ }, o.prototype.calculateRepulsionForceOfANode = function(t, h, s, c) {
1287
+ if (this.totalIterations % r.GRID_CALCULATION_CHECK_PERIOD == 1 && s || c) {
1288
+ var l = /* @__PURE__ */ new Set();
1289
+ t.surrounding = new Array();
1290
+ for (var T, g = this.grid, y = t.startX - 1; y < t.finishX + 2; y++)
1291
+ for (var C = t.startY - 1; C < t.finishY + 2; C++)
1292
+ if (!(y < 0 || C < 0 || y >= g.length || C >= g[0].length)) {
1293
+ for (var w = 0; w < g[y][C].length; w++)
1294
+ if (T = g[y][C][w], !(t.getOwner() != T.getOwner() || t == T) && !h.has(T) && !l.has(T)) {
1295
+ var S = Math.abs(t.getCenterX() - T.getCenterX()) - (t.getWidth() / 2 + T.getWidth() / 2), k = Math.abs(t.getCenterY() - T.getCenterY()) - (t.getHeight() / 2 + T.getHeight() / 2);
1296
+ S <= this.repulsionRange && k <= this.repulsionRange && l.add(T);
1297
+ }
1298
+ }
1299
+ t.surrounding = [].concat(u(l));
1300
+ }
1301
+ for (y = 0; y < t.surrounding.length; y++)
1302
+ this.calcRepulsionForce(t, t.surrounding[y]);
1303
+ }, o.prototype.calcRepulsionRange = function() {
1304
+ return 0;
1305
+ }, I.exports = o;
1306
+ },
1307
+ /* 19 */
1308
+ /***/
1309
+ function(I, G, A) {
1310
+ var u = A(1), d = A(4);
1311
+ function r(e, a, o) {
1312
+ u.call(this, e, a, o), this.idealLength = d.DEFAULT_EDGE_LENGTH, this.edgeElasticity = d.DEFAULT_SPRING_STRENGTH;
1313
+ }
1314
+ r.prototype = Object.create(u.prototype);
1315
+ for (var i in u)
1316
+ r[i] = u[i];
1317
+ I.exports = r;
1318
+ },
1319
+ /* 20 */
1320
+ /***/
1321
+ function(I, G, A) {
1322
+ var u = A(3), d = A(4);
1323
+ function r(e, a, o, f) {
1324
+ u.call(this, e, a, o, f), this.nodeRepulsion = d.DEFAULT_REPULSION_STRENGTH, this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0, this.startX = 0, this.finishX = 0, this.startY = 0, this.finishY = 0, this.surrounding = [];
1325
+ }
1326
+ r.prototype = Object.create(u.prototype);
1327
+ for (var i in u)
1328
+ r[i] = u[i];
1329
+ r.prototype.setGridCoordinates = function(e, a, o, f) {
1330
+ this.startX = e, this.finishX = a, this.startY = o, this.finishY = f;
1331
+ }, I.exports = r;
1332
+ },
1333
+ /* 21 */
1334
+ /***/
1335
+ function(I, G, A) {
1336
+ function u(d, r) {
1337
+ this.width = 0, this.height = 0, d !== null && r !== null && (this.height = r, this.width = d);
1338
+ }
1339
+ u.prototype.getWidth = function() {
1340
+ return this.width;
1341
+ }, u.prototype.setWidth = function(d) {
1342
+ this.width = d;
1343
+ }, u.prototype.getHeight = function() {
1344
+ return this.height;
1345
+ }, u.prototype.setHeight = function(d) {
1346
+ this.height = d;
1347
+ }, I.exports = u;
1348
+ },
1349
+ /* 22 */
1350
+ /***/
1351
+ function(I, G, A) {
1352
+ var u = A(14);
1353
+ function d() {
1354
+ this.map = {}, this.keys = [];
1355
+ }
1356
+ d.prototype.put = function(r, i) {
1357
+ var e = u.createID(r);
1358
+ this.contains(e) || (this.map[e] = i, this.keys.push(r));
1359
+ }, d.prototype.contains = function(r) {
1360
+ return u.createID(r), this.map[r] != null;
1361
+ }, d.prototype.get = function(r) {
1362
+ var i = u.createID(r);
1363
+ return this.map[i];
1364
+ }, d.prototype.keySet = function() {
1365
+ return this.keys;
1366
+ }, I.exports = d;
1367
+ },
1368
+ /* 23 */
1369
+ /***/
1370
+ function(I, G, A) {
1371
+ var u = A(14);
1372
+ function d() {
1373
+ this.set = {};
1374
+ }
1375
+ d.prototype.add = function(r) {
1376
+ var i = u.createID(r);
1377
+ this.contains(i) || (this.set[i] = r);
1378
+ }, d.prototype.remove = function(r) {
1379
+ delete this.set[u.createID(r)];
1380
+ }, d.prototype.clear = function() {
1381
+ this.set = {};
1382
+ }, d.prototype.contains = function(r) {
1383
+ return this.set[u.createID(r)] == r;
1384
+ }, d.prototype.isEmpty = function() {
1385
+ return this.size() === 0;
1386
+ }, d.prototype.size = function() {
1387
+ return Object.keys(this.set).length;
1388
+ }, d.prototype.addAllTo = function(r) {
1389
+ for (var i = Object.keys(this.set), e = i.length, a = 0; a < e; a++)
1390
+ r.push(this.set[i[a]]);
1391
+ }, d.prototype.size = function() {
1392
+ return Object.keys(this.set).length;
1393
+ }, d.prototype.addAll = function(r) {
1394
+ for (var i = r.length, e = 0; e < i; e++) {
1395
+ var a = r[e];
1396
+ this.add(a);
1397
+ }
1398
+ }, I.exports = d;
1399
+ },
1400
+ /* 24 */
1401
+ /***/
1402
+ function(I, G, A) {
1403
+ function u() {
1404
+ }
1405
+ u.multMat = function(d, r) {
1406
+ for (var i = [], e = 0; e < d.length; e++) {
1407
+ i[e] = [];
1408
+ for (var a = 0; a < r[0].length; a++) {
1409
+ i[e][a] = 0;
1410
+ for (var o = 0; o < d[0].length; o++)
1411
+ i[e][a] += d[e][o] * r[o][a];
1412
+ }
1413
+ }
1414
+ return i;
1415
+ }, u.transpose = function(d) {
1416
+ for (var r = [], i = 0; i < d[0].length; i++) {
1417
+ r[i] = [];
1418
+ for (var e = 0; e < d.length; e++)
1419
+ r[i][e] = d[e][i];
1420
+ }
1421
+ return r;
1422
+ }, u.multCons = function(d, r) {
1423
+ for (var i = [], e = 0; e < d.length; e++)
1424
+ i[e] = d[e] * r;
1425
+ return i;
1426
+ }, u.minusOp = function(d, r) {
1427
+ for (var i = [], e = 0; e < d.length; e++)
1428
+ i[e] = d[e] - r[e];
1429
+ return i;
1430
+ }, u.dotProduct = function(d, r) {
1431
+ for (var i = 0, e = 0; e < d.length; e++)
1432
+ i += d[e] * r[e];
1433
+ return i;
1434
+ }, u.mag = function(d) {
1435
+ return Math.sqrt(this.dotProduct(d, d));
1436
+ }, u.normalize = function(d) {
1437
+ for (var r = [], i = this.mag(d), e = 0; e < d.length; e++)
1438
+ r[e] = d[e] / i;
1439
+ return r;
1440
+ }, u.multGamma = function(d) {
1441
+ for (var r = [], i = 0, e = 0; e < d.length; e++)
1442
+ i += d[e];
1443
+ i *= -1 / d.length;
1444
+ for (var a = 0; a < d.length; a++)
1445
+ r[a] = i + d[a];
1446
+ return r;
1447
+ }, u.multL = function(d, r, i) {
1448
+ for (var e = [], a = [], o = [], f = 0; f < r[0].length; f++) {
1449
+ for (var t = 0, h = 0; h < r.length; h++)
1450
+ t += -0.5 * r[h][f] * d[h];
1451
+ a[f] = t;
1452
+ }
1453
+ for (var s = 0; s < i.length; s++) {
1454
+ for (var c = 0, l = 0; l < i.length; l++)
1455
+ c += i[s][l] * a[l];
1456
+ o[s] = c;
1457
+ }
1458
+ for (var T = 0; T < r.length; T++) {
1459
+ for (var g = 0, y = 0; y < r[0].length; y++)
1460
+ g += r[T][y] * o[y];
1461
+ e[T] = g;
1462
+ }
1463
+ return e;
1464
+ }, I.exports = u;
1465
+ },
1466
+ /* 25 */
1467
+ /***/
1468
+ function(I, G, A) {
1469
+ var u = /* @__PURE__ */ function() {
1470
+ function e(a, o) {
1471
+ for (var f = 0; f < o.length; f++) {
1472
+ var t = o[f];
1473
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(a, t.key, t);
1474
+ }
1475
+ }
1476
+ return function(a, o, f) {
1477
+ return o && e(a.prototype, o), f && e(a, f), a;
1478
+ };
1479
+ }();
1480
+ function d(e, a) {
1481
+ if (!(e instanceof a))
1482
+ throw new TypeError("Cannot call a class as a function");
1483
+ }
1484
+ var r = A(11), i = function() {
1485
+ function e(a, o) {
1486
+ d(this, e), (o !== null || o !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1487
+ var f = void 0;
1488
+ a instanceof r ? f = a.size() : f = a.length, this._quicksort(a, 0, f - 1);
1489
+ }
1490
+ return u(e, [{
1491
+ key: "_quicksort",
1492
+ value: function(a, o, f) {
1493
+ if (o < f) {
1494
+ var t = this._partition(a, o, f);
1495
+ this._quicksort(a, o, t), this._quicksort(a, t + 1, f);
1496
+ }
1497
+ }
1498
+ }, {
1499
+ key: "_partition",
1500
+ value: function(a, o, f) {
1501
+ for (var t = this._get(a, o), h = o, s = f; ; ) {
1502
+ for (; this.compareFunction(t, this._get(a, s)); )
1503
+ s--;
1504
+ for (; this.compareFunction(this._get(a, h), t); )
1505
+ h++;
1506
+ if (h < s)
1507
+ this._swap(a, h, s), h++, s--;
1508
+ else return s;
1509
+ }
1510
+ }
1511
+ }, {
1512
+ key: "_get",
1513
+ value: function(a, o) {
1514
+ return a instanceof r ? a.get_object_at(o) : a[o];
1515
+ }
1516
+ }, {
1517
+ key: "_set",
1518
+ value: function(a, o, f) {
1519
+ a instanceof r ? a.set_object_at(o, f) : a[o] = f;
1520
+ }
1521
+ }, {
1522
+ key: "_swap",
1523
+ value: function(a, o, f) {
1524
+ var t = this._get(a, o);
1525
+ this._set(a, o, this._get(a, f)), this._set(a, f, t);
1526
+ }
1527
+ }, {
1528
+ key: "_defaultCompareFunction",
1529
+ value: function(a, o) {
1530
+ return o > a;
1531
+ }
1532
+ }]), e;
1533
+ }();
1534
+ I.exports = i;
1535
+ },
1536
+ /* 26 */
1537
+ /***/
1538
+ function(I, G, A) {
1539
+ function u() {
1540
+ }
1541
+ u.svd = function(d) {
1542
+ this.U = null, this.V = null, this.s = null, this.m = 0, this.n = 0, this.m = d.length, this.n = d[0].length;
1543
+ var r = Math.min(this.m, this.n);
1544
+ this.s = function(wt) {
1545
+ for (var Nt = []; wt-- > 0; )
1546
+ Nt.push(0);
1547
+ return Nt;
1548
+ }(Math.min(this.m + 1, this.n)), this.U = function(wt) {
1549
+ var Nt = function Ut(kt) {
1550
+ if (kt.length == 0)
1551
+ return 0;
1552
+ for (var Ot = [], St = 0; St < kt[0]; St++)
1553
+ Ot.push(Ut(kt.slice(1)));
1554
+ return Ot;
1555
+ };
1556
+ return Nt(wt);
1557
+ }([this.m, r]), this.V = function(wt) {
1558
+ var Nt = function Ut(kt) {
1559
+ if (kt.length == 0)
1560
+ return 0;
1561
+ for (var Ot = [], St = 0; St < kt[0]; St++)
1562
+ Ot.push(Ut(kt.slice(1)));
1563
+ return Ot;
1564
+ };
1565
+ return Nt(wt);
1566
+ }([this.n, this.n]);
1567
+ for (var i = function(wt) {
1568
+ for (var Nt = []; wt-- > 0; )
1569
+ Nt.push(0);
1570
+ return Nt;
1571
+ }(this.n), e = function(wt) {
1572
+ for (var Nt = []; wt-- > 0; )
1573
+ Nt.push(0);
1574
+ return Nt;
1575
+ }(this.m), a = !0, o = Math.min(this.m - 1, this.n), f = Math.max(0, Math.min(this.n - 2, this.m)), t = 0; t < Math.max(o, f); t++) {
1576
+ if (t < o) {
1577
+ this.s[t] = 0;
1578
+ for (var h = t; h < this.m; h++)
1579
+ this.s[t] = u.hypot(this.s[t], d[h][t]);
1580
+ if (this.s[t] !== 0) {
1581
+ d[t][t] < 0 && (this.s[t] = -this.s[t]);
1582
+ for (var s = t; s < this.m; s++)
1583
+ d[s][t] /= this.s[t];
1584
+ d[t][t] += 1;
1585
+ }
1586
+ this.s[t] = -this.s[t];
1587
+ }
1588
+ for (var c = t + 1; c < this.n; c++) {
1589
+ if (/* @__PURE__ */ function(wt, Nt) {
1590
+ return wt && Nt;
1591
+ }(t < o, this.s[t] !== 0)) {
1592
+ for (var l = 0, T = t; T < this.m; T++)
1593
+ l += d[T][t] * d[T][c];
1594
+ l = -l / d[t][t];
1595
+ for (var g = t; g < this.m; g++)
1596
+ d[g][c] += l * d[g][t];
1597
+ }
1598
+ i[c] = d[t][c];
1599
+ }
1600
+ if (/* @__PURE__ */ function(wt, Nt) {
1601
+ return Nt;
1602
+ }(a, t < o))
1603
+ for (var y = t; y < this.m; y++)
1604
+ this.U[y][t] = d[y][t];
1605
+ if (t < f) {
1606
+ i[t] = 0;
1607
+ for (var C = t + 1; C < this.n; C++)
1608
+ i[t] = u.hypot(i[t], i[C]);
1609
+ if (i[t] !== 0) {
1610
+ i[t + 1] < 0 && (i[t] = -i[t]);
1611
+ for (var w = t + 1; w < this.n; w++)
1612
+ i[w] /= i[t];
1613
+ i[t + 1] += 1;
1614
+ }
1615
+ if (i[t] = -i[t], /* @__PURE__ */ function(wt, Nt) {
1616
+ return wt && Nt;
1617
+ }(t + 1 < this.m, i[t] !== 0)) {
1618
+ for (var S = t + 1; S < this.m; S++)
1619
+ e[S] = 0;
1620
+ for (var k = t + 1; k < this.n; k++)
1621
+ for (var Y = t + 1; Y < this.m; Y++)
1622
+ e[Y] += i[k] * d[Y][k];
1623
+ for (var H = t + 1; H < this.n; H++)
1624
+ for (var V = -i[H] / i[t + 1], M = t + 1; M < this.m; M++)
1625
+ d[M][H] += V * e[M];
1626
+ }
1627
+ for (var it = t + 1; it < this.n; it++)
1628
+ this.V[it][t] = i[it];
1629
+ }
1630
+ }
1631
+ var n = Math.min(this.n, this.m + 1);
1632
+ o < this.n && (this.s[o] = d[o][o]), this.m < n && (this.s[n - 1] = 0), f + 1 < n && (i[f] = d[f][n - 1]), i[n - 1] = 0;
1633
+ {
1634
+ for (var E = o; E < r; E++) {
1635
+ for (var p = 0; p < this.m; p++)
1636
+ this.U[p][E] = 0;
1637
+ this.U[E][E] = 1;
1638
+ }
1639
+ for (var m = o - 1; m >= 0; m--)
1640
+ if (this.s[m] !== 0) {
1641
+ for (var v = m + 1; v < r; v++) {
1642
+ for (var D = 0, _ = m; _ < this.m; _++)
1643
+ D += this.U[_][m] * this.U[_][v];
1644
+ D = -D / this.U[m][m];
1645
+ for (var x = m; x < this.m; x++)
1646
+ this.U[x][v] += D * this.U[x][m];
1647
+ }
1648
+ for (var F = m; F < this.m; F++)
1649
+ this.U[F][m] = -this.U[F][m];
1650
+ this.U[m][m] = 1 + this.U[m][m];
1651
+ for (var X = 0; X < m - 1; X++)
1652
+ this.U[X][m] = 0;
1653
+ } else {
1654
+ for (var B = 0; B < this.m; B++)
1655
+ this.U[B][m] = 0;
1656
+ this.U[m][m] = 1;
1657
+ }
1658
+ }
1659
+ for (var W = this.n - 1; W >= 0; W--) {
1660
+ if (/* @__PURE__ */ function(wt, Nt) {
1661
+ return wt && Nt;
1662
+ }(W < f, i[W] !== 0))
1663
+ for (var z = W + 1; z < r; z++) {
1664
+ for (var Z = 0, P = W + 1; P < this.n; P++)
1665
+ Z += this.V[P][W] * this.V[P][z];
1666
+ Z = -Z / this.V[W + 1][W];
1667
+ for (var O = W + 1; O < this.n; O++)
1668
+ this.V[O][z] += Z * this.V[O][W];
1669
+ }
1670
+ for (var b = 0; b < this.n; b++)
1671
+ this.V[b][W] = 0;
1672
+ this.V[W][W] = 1;
1673
+ }
1674
+ for (var q = n - 1, et = Math.pow(2, -52), mt = Math.pow(2, -966); n > 0; ) {
1675
+ var j = void 0, xt = void 0;
1676
+ for (j = n - 2; j >= -1 && j !== -1; j--)
1677
+ if (Math.abs(i[j]) <= mt + et * (Math.abs(this.s[j]) + Math.abs(this.s[j + 1]))) {
1678
+ i[j] = 0;
1679
+ break;
1680
+ }
1681
+ if (j === n - 2)
1682
+ xt = 4;
1683
+ else {
1684
+ var Q = void 0;
1685
+ for (Q = n - 1; Q >= j && Q !== j; Q--) {
1686
+ var nt = (Q !== n ? Math.abs(i[Q]) : 0) + (Q !== j + 1 ? Math.abs(i[Q - 1]) : 0);
1687
+ if (Math.abs(this.s[Q]) <= mt + et * nt) {
1688
+ this.s[Q] = 0;
1689
+ break;
1690
+ }
1691
+ }
1692
+ Q === j ? xt = 3 : Q === n - 1 ? xt = 1 : (xt = 2, j = Q);
1693
+ }
1694
+ switch (j++, xt) {
1695
+ case 1:
1696
+ {
1697
+ var vt = i[n - 2];
1698
+ i[n - 2] = 0;
1699
+ for (var st = n - 2; st >= j; st--) {
1700
+ var It = u.hypot(this.s[st], vt), Lt = this.s[st] / It, Tt = vt / It;
1701
+ this.s[st] = It, st !== j && (vt = -Tt * i[st - 1], i[st - 1] = Lt * i[st - 1]);
1702
+ for (var At = 0; At < this.n; At++)
1703
+ It = Lt * this.V[At][st] + Tt * this.V[At][n - 1], this.V[At][n - 1] = -Tt * this.V[At][st] + Lt * this.V[At][n - 1], this.V[At][st] = It;
1704
+ }
1705
+ }
1706
+ break;
1707
+ case 2:
1708
+ {
1709
+ var Ht = i[j - 1];
1710
+ i[j - 1] = 0;
1711
+ for (var Rt = j; Rt < n; Rt++) {
1712
+ var bt = u.hypot(this.s[Rt], Ht), Ft = this.s[Rt] / bt, zt = Ht / bt;
1713
+ this.s[Rt] = bt, Ht = -zt * i[Rt], i[Rt] = Ft * i[Rt];
1714
+ for (var Pt = 0; Pt < this.m; Pt++)
1715
+ bt = Ft * this.U[Pt][Rt] + zt * this.U[Pt][j - 1], this.U[Pt][j - 1] = -zt * this.U[Pt][Rt] + Ft * this.U[Pt][j - 1], this.U[Pt][Rt] = bt;
1716
+ }
1717
+ }
1718
+ break;
1719
+ case 3:
1720
+ {
1721
+ var Bt = Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[n - 1]), Math.abs(this.s[n - 2])), Math.abs(i[n - 2])), Math.abs(this.s[j])), Math.abs(i[j])), dt = this.s[n - 1] / Bt, L = this.s[n - 2] / Bt, R = i[n - 2] / Bt, $ = this.s[j] / Bt, J = i[j] / Bt, K = ((L + dt) * (L - dt) + R * R) / 2, ft = dt * R * (dt * R), ht = 0;
1722
+ /* @__PURE__ */ (function(wt, Nt) {
1723
+ return wt || Nt;
1724
+ })(K !== 0, ft !== 0) && (ht = Math.sqrt(K * K + ft), K < 0 && (ht = -ht), ht = ft / (K + ht));
1725
+ for (var tt = ($ + dt) * ($ - dt) + ht, gt = $ * J, rt = j; rt < n - 1; rt++) {
1726
+ var Et = u.hypot(tt, gt), yt = tt / Et, Mt = gt / Et;
1727
+ rt !== j && (i[rt - 1] = Et), tt = yt * this.s[rt] + Mt * i[rt], i[rt] = yt * i[rt] - Mt * this.s[rt], gt = Mt * this.s[rt + 1], this.s[rt + 1] = yt * this.s[rt + 1];
1728
+ for (var lt = 0; lt < this.n; lt++)
1729
+ Et = yt * this.V[lt][rt] + Mt * this.V[lt][rt + 1], this.V[lt][rt + 1] = -Mt * this.V[lt][rt] + yt * this.V[lt][rt + 1], this.V[lt][rt] = Et;
1730
+ if (Et = u.hypot(tt, gt), yt = tt / Et, Mt = gt / Et, this.s[rt] = Et, tt = yt * i[rt] + Mt * this.s[rt + 1], this.s[rt + 1] = -Mt * i[rt] + yt * this.s[rt + 1], gt = Mt * i[rt + 1], i[rt + 1] = yt * i[rt + 1], rt < this.m - 1)
1731
+ for (var ot = 0; ot < this.m; ot++)
1732
+ Et = yt * this.U[ot][rt] + Mt * this.U[ot][rt + 1], this.U[ot][rt + 1] = -Mt * this.U[ot][rt] + yt * this.U[ot][rt + 1], this.U[ot][rt] = Et;
1733
+ }
1734
+ i[n - 2] = tt;
1735
+ }
1736
+ break;
1737
+ case 4:
1738
+ {
1739
+ if (this.s[j] <= 0) {
1740
+ this.s[j] = this.s[j] < 0 ? -this.s[j] : 0;
1741
+ for (var at = 0; at <= q; at++)
1742
+ this.V[at][j] = -this.V[at][j];
1743
+ }
1744
+ for (; j < q && !(this.s[j] >= this.s[j + 1]); ) {
1745
+ var Ct = this.s[j];
1746
+ if (this.s[j] = this.s[j + 1], this.s[j + 1] = Ct, j < this.n - 1)
1747
+ for (var ct = 0; ct < this.n; ct++)
1748
+ Ct = this.V[ct][j + 1], this.V[ct][j + 1] = this.V[ct][j], this.V[ct][j] = Ct;
1749
+ if (j < this.m - 1)
1750
+ for (var Dt = 0; Dt < this.m; Dt++)
1751
+ Ct = this.U[Dt][j + 1], this.U[Dt][j + 1] = this.U[Dt][j], this.U[Dt][j] = Ct;
1752
+ j++;
1753
+ }
1754
+ n--;
1755
+ }
1756
+ break;
1757
+ }
1758
+ }
1759
+ var Gt = { U: this.U, V: this.V, S: this.s };
1760
+ return Gt;
1761
+ }, u.hypot = function(d, r) {
1762
+ var i = void 0;
1763
+ return Math.abs(d) > Math.abs(r) ? (i = r / d, i = Math.abs(d) * Math.sqrt(1 + i * i)) : r != 0 ? (i = d / r, i = Math.abs(r) * Math.sqrt(1 + i * i)) : i = 0, i;
1764
+ }, I.exports = u;
1765
+ },
1766
+ /* 27 */
1767
+ /***/
1768
+ function(I, G, A) {
1769
+ var u = /* @__PURE__ */ function() {
1770
+ function i(e, a) {
1771
+ for (var o = 0; o < a.length; o++) {
1772
+ var f = a[o];
1773
+ f.enumerable = f.enumerable || !1, f.configurable = !0, "value" in f && (f.writable = !0), Object.defineProperty(e, f.key, f);
1774
+ }
1775
+ }
1776
+ return function(e, a, o) {
1777
+ return a && i(e.prototype, a), o && i(e, o), e;
1778
+ };
1779
+ }();
1780
+ function d(i, e) {
1781
+ if (!(i instanceof e))
1782
+ throw new TypeError("Cannot call a class as a function");
1783
+ }
1784
+ var r = function() {
1785
+ function i(e, a) {
1786
+ var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, f = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, t = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1787
+ d(this, i), this.sequence1 = e, this.sequence2 = a, this.match_score = o, this.mismatch_penalty = f, this.gap_penalty = t, this.iMax = e.length + 1, this.jMax = a.length + 1, this.grid = new Array(this.iMax);
1788
+ for (var h = 0; h < this.iMax; h++) {
1789
+ this.grid[h] = new Array(this.jMax);
1790
+ for (var s = 0; s < this.jMax; s++)
1791
+ this.grid[h][s] = 0;
1792
+ }
1793
+ this.tracebackGrid = new Array(this.iMax);
1794
+ for (var c = 0; c < this.iMax; c++) {
1795
+ this.tracebackGrid[c] = new Array(this.jMax);
1796
+ for (var l = 0; l < this.jMax; l++)
1797
+ this.tracebackGrid[c][l] = [null, null, null];
1798
+ }
1799
+ this.alignments = [], this.score = -1, this.computeGrids();
1800
+ }
1801
+ return u(i, [{
1802
+ key: "getScore",
1803
+ value: function() {
1804
+ return this.score;
1805
+ }
1806
+ }, {
1807
+ key: "getAlignments",
1808
+ value: function() {
1809
+ return this.alignments;
1810
+ }
1811
+ // Main dynamic programming procedure
1812
+ }, {
1813
+ key: "computeGrids",
1814
+ value: function() {
1815
+ for (var e = 1; e < this.jMax; e++)
1816
+ this.grid[0][e] = this.grid[0][e - 1] + this.gap_penalty, this.tracebackGrid[0][e] = [!1, !1, !0];
1817
+ for (var a = 1; a < this.iMax; a++)
1818
+ this.grid[a][0] = this.grid[a - 1][0] + this.gap_penalty, this.tracebackGrid[a][0] = [!1, !0, !1];
1819
+ for (var o = 1; o < this.iMax; o++)
1820
+ for (var f = 1; f < this.jMax; f++) {
1821
+ var t = void 0;
1822
+ this.sequence1[o - 1] === this.sequence2[f - 1] ? t = this.grid[o - 1][f - 1] + this.match_score : t = this.grid[o - 1][f - 1] + this.mismatch_penalty;
1823
+ var h = this.grid[o - 1][f] + this.gap_penalty, s = this.grid[o][f - 1] + this.gap_penalty, c = [t, h, s], l = this.arrayAllMaxIndexes(c);
1824
+ this.grid[o][f] = c[l[0]], this.tracebackGrid[o][f] = [l.includes(0), l.includes(1), l.includes(2)];
1825
+ }
1826
+ this.score = this.grid[this.iMax - 1][this.jMax - 1];
1827
+ }
1828
+ // Gets all possible valid sequence combinations
1829
+ }, {
1830
+ key: "alignmentTraceback",
1831
+ value: function() {
1832
+ var e = [];
1833
+ for (e.push({
1834
+ pos: [this.sequence1.length, this.sequence2.length],
1835
+ seq1: "",
1836
+ seq2: ""
1837
+ }); e[0]; ) {
1838
+ var a = e[0], o = this.tracebackGrid[a.pos[0]][a.pos[1]];
1839
+ o[0] && e.push({
1840
+ pos: [a.pos[0] - 1, a.pos[1] - 1],
1841
+ seq1: this.sequence1[a.pos[0] - 1] + a.seq1,
1842
+ seq2: this.sequence2[a.pos[1] - 1] + a.seq2
1843
+ }), o[1] && e.push({
1844
+ pos: [a.pos[0] - 1, a.pos[1]],
1845
+ seq1: this.sequence1[a.pos[0] - 1] + a.seq1,
1846
+ seq2: "-" + a.seq2
1847
+ }), o[2] && e.push({
1848
+ pos: [a.pos[0], a.pos[1] - 1],
1849
+ seq1: "-" + a.seq1,
1850
+ seq2: this.sequence2[a.pos[1] - 1] + a.seq2
1851
+ }), a.pos[0] === 0 && a.pos[1] === 0 && this.alignments.push({
1852
+ sequence1: a.seq1,
1853
+ sequence2: a.seq2
1854
+ }), e.shift();
1855
+ }
1856
+ return this.alignments;
1857
+ }
1858
+ // Helper Functions
1859
+ }, {
1860
+ key: "getAllIndexes",
1861
+ value: function(e, a) {
1862
+ for (var o = [], f = -1; (f = e.indexOf(a, f + 1)) !== -1; )
1863
+ o.push(f);
1864
+ return o;
1865
+ }
1866
+ }, {
1867
+ key: "arrayAllMaxIndexes",
1868
+ value: function(e) {
1869
+ return this.getAllIndexes(e, Math.max.apply(null, e));
1870
+ }
1871
+ }]), i;
1872
+ }();
1873
+ I.exports = r;
1874
+ },
1875
+ /* 28 */
1876
+ /***/
1877
+ function(I, G, A) {
1878
+ var u = function() {
1879
+ };
1880
+ u.FDLayout = A(18), u.FDLayoutConstants = A(4), u.FDLayoutEdge = A(19), u.FDLayoutNode = A(20), u.DimensionD = A(21), u.HashMap = A(22), u.HashSet = A(23), u.IGeometry = A(8), u.IMath = A(9), u.Integer = A(10), u.Point = A(12), u.PointD = A(5), u.RandomSeed = A(16), u.RectangleD = A(13), u.Transform = A(17), u.UniqueIDGeneretor = A(14), u.Quicksort = A(25), u.LinkedList = A(11), u.LGraphObject = A(2), u.LGraph = A(6), u.LEdge = A(1), u.LGraphManager = A(7), u.LNode = A(3), u.Layout = A(15), u.LayoutConstants = A(0), u.NeedlemanWunsch = A(27), u.Matrix = A(24), u.SVD = A(26), I.exports = u;
1881
+ },
1882
+ /* 29 */
1883
+ /***/
1884
+ function(I, G, A) {
1885
+ function u() {
1886
+ this.listeners = [];
1887
+ }
1888
+ var d = u.prototype;
1889
+ d.addListener = function(r, i) {
1890
+ this.listeners.push({
1891
+ event: r,
1892
+ callback: i
1893
+ });
1894
+ }, d.removeListener = function(r, i) {
1895
+ for (var e = this.listeners.length; e >= 0; e--) {
1896
+ var a = this.listeners[e];
1897
+ a.event === r && a.callback === i && this.listeners.splice(e, 1);
1898
+ }
1899
+ }, d.emit = function(r, i) {
1900
+ for (var e = 0; e < this.listeners.length; e++) {
1901
+ var a = this.listeners[e];
1902
+ r === a.event && a.callback(i);
1903
+ }
1904
+ }, I.exports = u;
1905
+ }
1906
+ /******/
1907
+ ])
1908
+ );
1909
+ });
1910
+ }(fe)), fe.exports;
1911
+ }
1912
+ var ui = ue.exports, Le;
1913
+ function fi() {
1914
+ return Le || (Le = 1, function(N, U) {
1915
+ (function(I, G) {
1916
+ N.exports = G(ci());
1917
+ })(ui, function(I) {
1918
+ return (
1919
+ /******/
1920
+ (() => {
1921
+ var G = {
1922
+ /***/
1923
+ 45: (
1924
+ /***/
1925
+ (r, i, e) => {
1926
+ var a = {};
1927
+ a.layoutBase = e(551), a.CoSEConstants = e(806), a.CoSEEdge = e(767), a.CoSEGraph = e(880), a.CoSEGraphManager = e(578), a.CoSELayout = e(765), a.CoSENode = e(991), a.ConstraintHandler = e(902), r.exports = a;
1928
+ }
1929
+ ),
1930
+ /***/
1931
+ 806: (
1932
+ /***/
1933
+ (r, i, e) => {
1934
+ var a = e(551).FDLayoutConstants;
1935
+ function o() {
1936
+ }
1937
+ for (var f in a)
1938
+ o[f] = a[f];
1939
+ o.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, o.DEFAULT_RADIAL_SEPARATION = a.DEFAULT_EDGE_LENGTH, o.DEFAULT_COMPONENT_SEPERATION = 60, o.TILE = !0, o.TILING_PADDING_VERTICAL = 10, o.TILING_PADDING_HORIZONTAL = 10, o.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, o.ENFORCE_CONSTRAINTS = !0, o.APPLY_LAYOUT = !0, o.RELAX_MOVEMENT_ON_CONSTRAINTS = !0, o.TREE_REDUCTION_ON_INCREMENTAL = !0, o.PURE_INCREMENTAL = o.DEFAULT_INCREMENTAL, r.exports = o;
1940
+ }
1941
+ ),
1942
+ /***/
1943
+ 767: (
1944
+ /***/
1945
+ (r, i, e) => {
1946
+ var a = e(551).FDLayoutEdge;
1947
+ function o(t, h, s) {
1948
+ a.call(this, t, h, s);
1949
+ }
1950
+ o.prototype = Object.create(a.prototype);
1951
+ for (var f in a)
1952
+ o[f] = a[f];
1953
+ r.exports = o;
1954
+ }
1955
+ ),
1956
+ /***/
1957
+ 880: (
1958
+ /***/
1959
+ (r, i, e) => {
1960
+ var a = e(551).LGraph;
1961
+ function o(t, h, s) {
1962
+ a.call(this, t, h, s);
1963
+ }
1964
+ o.prototype = Object.create(a.prototype);
1965
+ for (var f in a)
1966
+ o[f] = a[f];
1967
+ r.exports = o;
1968
+ }
1969
+ ),
1970
+ /***/
1971
+ 578: (
1972
+ /***/
1973
+ (r, i, e) => {
1974
+ var a = e(551).LGraphManager;
1975
+ function o(t) {
1976
+ a.call(this, t);
1977
+ }
1978
+ o.prototype = Object.create(a.prototype);
1979
+ for (var f in a)
1980
+ o[f] = a[f];
1981
+ r.exports = o;
1982
+ }
1983
+ ),
1984
+ /***/
1985
+ 765: (
1986
+ /***/
1987
+ (r, i, e) => {
1988
+ var a = e(551).FDLayout, o = e(578), f = e(880), t = e(991), h = e(767), s = e(806), c = e(902), l = e(551).FDLayoutConstants, T = e(551).LayoutConstants, g = e(551).Point, y = e(551).PointD, C = e(551).DimensionD, w = e(551).Layout, S = e(551).Integer, k = e(551).IGeometry, Y = e(551).LGraph, H = e(551).Transform, V = e(551).LinkedList;
1989
+ function M() {
1990
+ a.call(this), this.toBeTiled = {}, this.constraints = {};
1991
+ }
1992
+ M.prototype = Object.create(a.prototype);
1993
+ for (var it in a)
1994
+ M[it] = a[it];
1995
+ M.prototype.newGraphManager = function() {
1996
+ var n = new o(this);
1997
+ return this.graphManager = n, n;
1998
+ }, M.prototype.newGraph = function(n) {
1999
+ return new f(null, this.graphManager, n);
2000
+ }, M.prototype.newNode = function(n) {
2001
+ return new t(this.graphManager, n);
2002
+ }, M.prototype.newEdge = function(n) {
2003
+ return new h(null, null, n);
2004
+ }, M.prototype.initParameters = function() {
2005
+ a.prototype.initParameters.call(this, arguments), this.isSubLayout || (s.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = s.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = l.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = l.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = l.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1);
2006
+ }, M.prototype.initSpringEmbedder = function() {
2007
+ a.prototype.initSpringEmbedder.call(this), this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / l.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = 0.04, this.coolingAdjuster = 1;
2008
+ }, M.prototype.layout = function() {
2009
+ var n = T.DEFAULT_CREATE_BENDS_AS_NEEDED;
2010
+ return n && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
2011
+ }, M.prototype.classicLayout = function() {
2012
+ 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) {
2013
+ if (s.TREE_REDUCTION_ON_INCREMENTAL) {
2014
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
2015
+ var n = new Set(this.getAllNodes()), E = this.nodesWithGravity.filter(function(m) {
2016
+ return n.has(m);
2017
+ });
2018
+ this.graphManager.setAllNodesToApplyGravitation(E);
2019
+ }
2020
+ } else {
2021
+ var p = this.getFlatForest();
2022
+ if (p.length > 0)
2023
+ this.positionNodesRadially(p);
2024
+ else {
2025
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
2026
+ var n = new Set(this.getAllNodes()), E = this.nodesWithGravity.filter(function(D) {
2027
+ return n.has(D);
2028
+ });
2029
+ this.graphManager.setAllNodesToApplyGravitation(E), this.positionNodesRandomly();
2030
+ }
2031
+ }
2032
+ return Object.keys(this.constraints).length > 0 && (c.handleConstraints(this), this.initConstraintVariables()), this.initSpringEmbedder(), s.APPLY_LAYOUT && this.runSpringEmbedder(), !0;
2033
+ }, M.prototype.tick = function() {
2034
+ if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished)
2035
+ if (this.prunedNodesAll.length > 0)
2036
+ this.isTreeGrowing = !0;
2037
+ else
2038
+ return !0;
2039
+ if (this.totalIterations % l.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
2040
+ if (this.isConverged())
2041
+ if (this.prunedNodesAll.length > 0)
2042
+ this.isTreeGrowing = !0;
2043
+ else
2044
+ return !0;
2045
+ this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(this.coolingCycle, Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature), this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));
2046
+ }
2047
+ if (this.isTreeGrowing) {
2048
+ if (this.growTreeIterations % 10 == 0)
2049
+ if (this.prunedNodesAll.length > 0) {
2050
+ this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
2051
+ var n = new Set(this.getAllNodes()), E = this.nodesWithGravity.filter(function(v) {
2052
+ return n.has(v);
2053
+ });
2054
+ this.graphManager.setAllNodesToApplyGravitation(E), this.graphManager.updateBounds(), this.updateGrid(), s.PURE_INCREMENTAL ? this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 : this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL;
2055
+ } else
2056
+ this.isTreeGrowing = !1, this.isGrowthFinished = !0;
2057
+ this.growTreeIterations++;
2058
+ }
2059
+ if (this.isGrowthFinished) {
2060
+ if (this.isConverged())
2061
+ return !0;
2062
+ this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), s.PURE_INCREMENTAL ? this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 * ((100 - this.afterGrowthIterations) / 100) : this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
2063
+ }
2064
+ var p = !this.isTreeGrowing && !this.isGrowthFinished, m = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
2065
+ return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(p, m), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
2066
+ }, M.prototype.getPositionsData = function() {
2067
+ for (var n = this.graphManager.getAllNodes(), E = {}, p = 0; p < n.length; p++) {
2068
+ var m = n[p].rect, v = n[p].id;
2069
+ E[v] = {
2070
+ id: v,
2071
+ x: m.getCenterX(),
2072
+ y: m.getCenterY(),
2073
+ w: m.width,
2074
+ h: m.height
2075
+ };
2076
+ }
2077
+ return E;
2078
+ }, M.prototype.runSpringEmbedder = function() {
2079
+ this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
2080
+ var n = !1;
2081
+ if (l.ANIMATE === "during")
2082
+ this.emit("layoutstarted");
2083
+ else {
2084
+ for (; !n; )
2085
+ n = this.tick();
2086
+ this.graphManager.updateBounds();
2087
+ }
2088
+ }, M.prototype.moveNodes = function() {
2089
+ for (var n = this.getAllNodes(), E, p = 0; p < n.length; p++)
2090
+ E = n[p], E.calculateDisplacement();
2091
+ Object.keys(this.constraints).length > 0 && this.updateDisplacements();
2092
+ for (var p = 0; p < n.length; p++)
2093
+ E = n[p], E.move();
2094
+ }, M.prototype.initConstraintVariables = function() {
2095
+ var n = this;
2096
+ this.idToNodeMap = /* @__PURE__ */ new Map(), this.fixedNodeSet = /* @__PURE__ */ new Set();
2097
+ for (var E = this.graphManager.getAllNodes(), p = 0; p < E.length; p++) {
2098
+ var m = E[p];
2099
+ this.idToNodeMap.set(m.id, m);
2100
+ }
2101
+ var v = function O(b) {
2102
+ for (var q = b.getChild().getNodes(), et, mt = 0, j = 0; j < q.length; j++)
2103
+ et = q[j], et.getChild() == null ? n.fixedNodeSet.has(et.id) && (mt += 100) : mt += O(et);
2104
+ return mt;
2105
+ };
2106
+ if (this.constraints.fixedNodeConstraint) {
2107
+ this.constraints.fixedNodeConstraint.forEach(function(O) {
2108
+ n.fixedNodeSet.add(O.nodeId);
2109
+ });
2110
+ for (var E = this.graphManager.getAllNodes(), m, p = 0; p < E.length; p++)
2111
+ if (m = E[p], m.getChild() != null) {
2112
+ var D = v(m);
2113
+ D > 0 && (m.fixedNodeWeight = D);
2114
+ }
2115
+ }
2116
+ if (this.constraints.relativePlacementConstraint) {
2117
+ var _ = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
2118
+ if (this.dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map(), this.dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map(), this.fixedNodesOnHorizontal = /* @__PURE__ */ new Set(), this.fixedNodesOnVertical = /* @__PURE__ */ new Set(), this.fixedNodeSet.forEach(function(O) {
2119
+ n.fixedNodesOnHorizontal.add(O), n.fixedNodesOnVertical.add(O);
2120
+ }), this.constraints.alignmentConstraint) {
2121
+ if (this.constraints.alignmentConstraint.vertical)
2122
+ for (var F = this.constraints.alignmentConstraint.vertical, p = 0; p < F.length; p++)
2123
+ this.dummyToNodeForVerticalAlignment.set("dummy" + p, []), F[p].forEach(function(b) {
2124
+ _.set(b, "dummy" + p), n.dummyToNodeForVerticalAlignment.get("dummy" + p).push(b), n.fixedNodeSet.has(b) && n.fixedNodesOnHorizontal.add("dummy" + p);
2125
+ });
2126
+ if (this.constraints.alignmentConstraint.horizontal)
2127
+ for (var X = this.constraints.alignmentConstraint.horizontal, p = 0; p < X.length; p++)
2128
+ this.dummyToNodeForHorizontalAlignment.set("dummy" + p, []), X[p].forEach(function(b) {
2129
+ x.set(b, "dummy" + p), n.dummyToNodeForHorizontalAlignment.get("dummy" + p).push(b), n.fixedNodeSet.has(b) && n.fixedNodesOnVertical.add("dummy" + p);
2130
+ });
2131
+ }
2132
+ if (s.RELAX_MOVEMENT_ON_CONSTRAINTS)
2133
+ this.shuffle = function(O) {
2134
+ var b, q, et;
2135
+ for (et = O.length - 1; et >= 2 * O.length / 3; et--)
2136
+ b = Math.floor(Math.random() * (et + 1)), q = O[et], O[et] = O[b], O[b] = q;
2137
+ return O;
2138
+ }, this.nodesInRelativeHorizontal = [], this.nodesInRelativeVertical = [], this.nodeToRelativeConstraintMapHorizontal = /* @__PURE__ */ new Map(), this.nodeToRelativeConstraintMapVertical = /* @__PURE__ */ new Map(), this.nodeToTempPositionMapHorizontal = /* @__PURE__ */ new Map(), this.nodeToTempPositionMapVertical = /* @__PURE__ */ new Map(), this.constraints.relativePlacementConstraint.forEach(function(O) {
2139
+ if (O.left) {
2140
+ var b = _.has(O.left) ? _.get(O.left) : O.left, q = _.has(O.right) ? _.get(O.right) : O.right;
2141
+ n.nodesInRelativeHorizontal.includes(b) || (n.nodesInRelativeHorizontal.push(b), n.nodeToRelativeConstraintMapHorizontal.set(b, []), n.dummyToNodeForVerticalAlignment.has(b) ? n.nodeToTempPositionMapHorizontal.set(b, n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(b)[0]).getCenterX()) : n.nodeToTempPositionMapHorizontal.set(b, n.idToNodeMap.get(b).getCenterX())), n.nodesInRelativeHorizontal.includes(q) || (n.nodesInRelativeHorizontal.push(q), n.nodeToRelativeConstraintMapHorizontal.set(q, []), n.dummyToNodeForVerticalAlignment.has(q) ? n.nodeToTempPositionMapHorizontal.set(q, n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(q)[0]).getCenterX()) : n.nodeToTempPositionMapHorizontal.set(q, n.idToNodeMap.get(q).getCenterX())), n.nodeToRelativeConstraintMapHorizontal.get(b).push({ right: q, gap: O.gap }), n.nodeToRelativeConstraintMapHorizontal.get(q).push({ left: b, gap: O.gap });
2142
+ } else {
2143
+ var et = x.has(O.top) ? x.get(O.top) : O.top, mt = x.has(O.bottom) ? x.get(O.bottom) : O.bottom;
2144
+ n.nodesInRelativeVertical.includes(et) || (n.nodesInRelativeVertical.push(et), n.nodeToRelativeConstraintMapVertical.set(et, []), n.dummyToNodeForHorizontalAlignment.has(et) ? n.nodeToTempPositionMapVertical.set(et, n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(et)[0]).getCenterY()) : n.nodeToTempPositionMapVertical.set(et, n.idToNodeMap.get(et).getCenterY())), n.nodesInRelativeVertical.includes(mt) || (n.nodesInRelativeVertical.push(mt), n.nodeToRelativeConstraintMapVertical.set(mt, []), n.dummyToNodeForHorizontalAlignment.has(mt) ? n.nodeToTempPositionMapVertical.set(mt, n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(mt)[0]).getCenterY()) : n.nodeToTempPositionMapVertical.set(mt, n.idToNodeMap.get(mt).getCenterY())), n.nodeToRelativeConstraintMapVertical.get(et).push({ bottom: mt, gap: O.gap }), n.nodeToRelativeConstraintMapVertical.get(mt).push({ top: et, gap: O.gap });
2145
+ }
2146
+ });
2147
+ else {
2148
+ var B = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new Map();
2149
+ this.constraints.relativePlacementConstraint.forEach(function(O) {
2150
+ if (O.left) {
2151
+ var b = _.has(O.left) ? _.get(O.left) : O.left, q = _.has(O.right) ? _.get(O.right) : O.right;
2152
+ B.has(b) ? B.get(b).push(q) : B.set(b, [q]), B.has(q) ? B.get(q).push(b) : B.set(q, [b]);
2153
+ } else {
2154
+ var et = x.has(O.top) ? x.get(O.top) : O.top, mt = x.has(O.bottom) ? x.get(O.bottom) : O.bottom;
2155
+ W.has(et) ? W.get(et).push(mt) : W.set(et, [mt]), W.has(mt) ? W.get(mt).push(et) : W.set(mt, [et]);
2156
+ }
2157
+ });
2158
+ var z = function(O, b) {
2159
+ var q = [], et = [], mt = new V(), j = /* @__PURE__ */ new Set(), xt = 0;
2160
+ return O.forEach(function(Q, nt) {
2161
+ if (!j.has(nt)) {
2162
+ q[xt] = [], et[xt] = !1;
2163
+ var vt = nt;
2164
+ for (mt.push(vt), j.add(vt), q[xt].push(vt); mt.length != 0; ) {
2165
+ vt = mt.shift(), b.has(vt) && (et[xt] = !0);
2166
+ var st = O.get(vt);
2167
+ st.forEach(function(It) {
2168
+ j.has(It) || (mt.push(It), j.add(It), q[xt].push(It));
2169
+ });
2170
+ }
2171
+ xt++;
2172
+ }
2173
+ }), { components: q, isFixed: et };
2174
+ }, Z = z(B, n.fixedNodesOnHorizontal);
2175
+ this.componentsOnHorizontal = Z.components, this.fixedComponentsOnHorizontal = Z.isFixed;
2176
+ var P = z(W, n.fixedNodesOnVertical);
2177
+ this.componentsOnVertical = P.components, this.fixedComponentsOnVertical = P.isFixed;
2178
+ }
2179
+ }
2180
+ }, M.prototype.updateDisplacements = function() {
2181
+ var n = this;
2182
+ if (this.constraints.fixedNodeConstraint && this.constraints.fixedNodeConstraint.forEach(function(P) {
2183
+ var O = n.idToNodeMap.get(P.nodeId);
2184
+ O.displacementX = 0, O.displacementY = 0;
2185
+ }), this.constraints.alignmentConstraint) {
2186
+ if (this.constraints.alignmentConstraint.vertical)
2187
+ for (var E = this.constraints.alignmentConstraint.vertical, p = 0; p < E.length; p++) {
2188
+ for (var m = 0, v = 0; v < E[p].length; v++) {
2189
+ if (this.fixedNodeSet.has(E[p][v])) {
2190
+ m = 0;
2191
+ break;
2192
+ }
2193
+ m += this.idToNodeMap.get(E[p][v]).displacementX;
2194
+ }
2195
+ for (var D = m / E[p].length, v = 0; v < E[p].length; v++)
2196
+ this.idToNodeMap.get(E[p][v]).displacementX = D;
2197
+ }
2198
+ if (this.constraints.alignmentConstraint.horizontal)
2199
+ for (var _ = this.constraints.alignmentConstraint.horizontal, p = 0; p < _.length; p++) {
2200
+ for (var x = 0, v = 0; v < _[p].length; v++) {
2201
+ if (this.fixedNodeSet.has(_[p][v])) {
2202
+ x = 0;
2203
+ break;
2204
+ }
2205
+ x += this.idToNodeMap.get(_[p][v]).displacementY;
2206
+ }
2207
+ for (var F = x / _[p].length, v = 0; v < _[p].length; v++)
2208
+ this.idToNodeMap.get(_[p][v]).displacementY = F;
2209
+ }
2210
+ }
2211
+ if (this.constraints.relativePlacementConstraint)
2212
+ if (s.RELAX_MOVEMENT_ON_CONSTRAINTS)
2213
+ this.totalIterations % 10 == 0 && (this.shuffle(this.nodesInRelativeHorizontal), this.shuffle(this.nodesInRelativeVertical)), this.nodesInRelativeHorizontal.forEach(function(P) {
2214
+ if (!n.fixedNodesOnHorizontal.has(P)) {
2215
+ var O = 0;
2216
+ n.dummyToNodeForVerticalAlignment.has(P) ? O = n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(P)[0]).displacementX : O = n.idToNodeMap.get(P).displacementX, n.nodeToRelativeConstraintMapHorizontal.get(P).forEach(function(b) {
2217
+ if (b.right) {
2218
+ var q = n.nodeToTempPositionMapHorizontal.get(b.right) - n.nodeToTempPositionMapHorizontal.get(P) - O;
2219
+ q < b.gap && (O -= b.gap - q);
2220
+ } else {
2221
+ var q = n.nodeToTempPositionMapHorizontal.get(P) - n.nodeToTempPositionMapHorizontal.get(b.left) + O;
2222
+ q < b.gap && (O += b.gap - q);
2223
+ }
2224
+ }), n.nodeToTempPositionMapHorizontal.set(P, n.nodeToTempPositionMapHorizontal.get(P) + O), n.dummyToNodeForVerticalAlignment.has(P) ? n.dummyToNodeForVerticalAlignment.get(P).forEach(function(b) {
2225
+ n.idToNodeMap.get(b).displacementX = O;
2226
+ }) : n.idToNodeMap.get(P).displacementX = O;
2227
+ }
2228
+ }), this.nodesInRelativeVertical.forEach(function(P) {
2229
+ if (!n.fixedNodesOnHorizontal.has(P)) {
2230
+ var O = 0;
2231
+ n.dummyToNodeForHorizontalAlignment.has(P) ? O = n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(P)[0]).displacementY : O = n.idToNodeMap.get(P).displacementY, n.nodeToRelativeConstraintMapVertical.get(P).forEach(function(b) {
2232
+ if (b.bottom) {
2233
+ var q = n.nodeToTempPositionMapVertical.get(b.bottom) - n.nodeToTempPositionMapVertical.get(P) - O;
2234
+ q < b.gap && (O -= b.gap - q);
2235
+ } else {
2236
+ var q = n.nodeToTempPositionMapVertical.get(P) - n.nodeToTempPositionMapVertical.get(b.top) + O;
2237
+ q < b.gap && (O += b.gap - q);
2238
+ }
2239
+ }), n.nodeToTempPositionMapVertical.set(P, n.nodeToTempPositionMapVertical.get(P) + O), n.dummyToNodeForHorizontalAlignment.has(P) ? n.dummyToNodeForHorizontalAlignment.get(P).forEach(function(b) {
2240
+ n.idToNodeMap.get(b).displacementY = O;
2241
+ }) : n.idToNodeMap.get(P).displacementY = O;
2242
+ }
2243
+ });
2244
+ else {
2245
+ for (var p = 0; p < this.componentsOnHorizontal.length; p++) {
2246
+ var X = this.componentsOnHorizontal[p];
2247
+ if (this.fixedComponentsOnHorizontal[p])
2248
+ for (var v = 0; v < X.length; v++)
2249
+ this.dummyToNodeForVerticalAlignment.has(X[v]) ? this.dummyToNodeForVerticalAlignment.get(X[v]).forEach(function(b) {
2250
+ n.idToNodeMap.get(b).displacementX = 0;
2251
+ }) : this.idToNodeMap.get(X[v]).displacementX = 0;
2252
+ else {
2253
+ for (var B = 0, W = 0, v = 0; v < X.length; v++)
2254
+ if (this.dummyToNodeForVerticalAlignment.has(X[v])) {
2255
+ var z = this.dummyToNodeForVerticalAlignment.get(X[v]);
2256
+ B += z.length * this.idToNodeMap.get(z[0]).displacementX, W += z.length;
2257
+ } else
2258
+ B += this.idToNodeMap.get(X[v]).displacementX, W++;
2259
+ for (var Z = B / W, v = 0; v < X.length; v++)
2260
+ this.dummyToNodeForVerticalAlignment.has(X[v]) ? this.dummyToNodeForVerticalAlignment.get(X[v]).forEach(function(b) {
2261
+ n.idToNodeMap.get(b).displacementX = Z;
2262
+ }) : this.idToNodeMap.get(X[v]).displacementX = Z;
2263
+ }
2264
+ }
2265
+ for (var p = 0; p < this.componentsOnVertical.length; p++) {
2266
+ var X = this.componentsOnVertical[p];
2267
+ if (this.fixedComponentsOnVertical[p])
2268
+ for (var v = 0; v < X.length; v++)
2269
+ this.dummyToNodeForHorizontalAlignment.has(X[v]) ? this.dummyToNodeForHorizontalAlignment.get(X[v]).forEach(function(q) {
2270
+ n.idToNodeMap.get(q).displacementY = 0;
2271
+ }) : this.idToNodeMap.get(X[v]).displacementY = 0;
2272
+ else {
2273
+ for (var B = 0, W = 0, v = 0; v < X.length; v++)
2274
+ if (this.dummyToNodeForHorizontalAlignment.has(X[v])) {
2275
+ var z = this.dummyToNodeForHorizontalAlignment.get(X[v]);
2276
+ B += z.length * this.idToNodeMap.get(z[0]).displacementY, W += z.length;
2277
+ } else
2278
+ B += this.idToNodeMap.get(X[v]).displacementY, W++;
2279
+ for (var Z = B / W, v = 0; v < X.length; v++)
2280
+ this.dummyToNodeForHorizontalAlignment.has(X[v]) ? this.dummyToNodeForHorizontalAlignment.get(X[v]).forEach(function(et) {
2281
+ n.idToNodeMap.get(et).displacementY = Z;
2282
+ }) : this.idToNodeMap.get(X[v]).displacementY = Z;
2283
+ }
2284
+ }
2285
+ }
2286
+ }, M.prototype.calculateNodesToApplyGravitationTo = function() {
2287
+ var n = [], E, p = this.graphManager.getGraphs(), m = p.length, v;
2288
+ for (v = 0; v < m; v++)
2289
+ E = p[v], E.updateConnected(), E.isConnected || (n = n.concat(E.getNodes()));
2290
+ return n;
2291
+ }, M.prototype.createBendpoints = function() {
2292
+ var n = [];
2293
+ n = n.concat(this.graphManager.getAllEdges());
2294
+ var E = /* @__PURE__ */ new Set(), p;
2295
+ for (p = 0; p < n.length; p++) {
2296
+ var m = n[p];
2297
+ if (!E.has(m)) {
2298
+ var v = m.getSource(), D = m.getTarget();
2299
+ if (v == D)
2300
+ m.getBendpoints().push(new y()), m.getBendpoints().push(new y()), this.createDummyNodesForBendpoints(m), E.add(m);
2301
+ else {
2302
+ var _ = [];
2303
+ if (_ = _.concat(v.getEdgeListToNode(D)), _ = _.concat(D.getEdgeListToNode(v)), !E.has(_[0])) {
2304
+ if (_.length > 1) {
2305
+ var x;
2306
+ for (x = 0; x < _.length; x++) {
2307
+ var F = _[x];
2308
+ F.getBendpoints().push(new y()), this.createDummyNodesForBendpoints(F);
2309
+ }
2310
+ }
2311
+ _.forEach(function(X) {
2312
+ E.add(X);
2313
+ });
2314
+ }
2315
+ }
2316
+ }
2317
+ if (E.size == n.length)
2318
+ break;
2319
+ }
2320
+ }, M.prototype.positionNodesRadially = function(n) {
2321
+ for (var E = new g(0, 0), p = Math.ceil(Math.sqrt(n.length)), m = 0, v = 0, D = 0, _ = new y(0, 0), x = 0; x < n.length; x++) {
2322
+ x % p == 0 && (D = 0, v = m, x != 0 && (v += s.DEFAULT_COMPONENT_SEPERATION), m = 0);
2323
+ var F = n[x], X = w.findCenterOfTree(F);
2324
+ E.x = D, E.y = v, _ = M.radialLayout(F, X, E), _.y > m && (m = Math.floor(_.y)), D = Math.floor(_.x + s.DEFAULT_COMPONENT_SEPERATION);
2325
+ }
2326
+ this.transform(new y(T.WORLD_CENTER_X - _.x / 2, T.WORLD_CENTER_Y - _.y / 2));
2327
+ }, M.radialLayout = function(n, E, p) {
2328
+ var m = Math.max(this.maxDiagonalInTree(n), s.DEFAULT_RADIAL_SEPARATION);
2329
+ M.branchRadialLayout(E, null, 0, 359, 0, m);
2330
+ var v = Y.calculateBounds(n), D = new H();
2331
+ D.setDeviceOrgX(v.getMinX()), D.setDeviceOrgY(v.getMinY()), D.setWorldOrgX(p.x), D.setWorldOrgY(p.y);
2332
+ for (var _ = 0; _ < n.length; _++) {
2333
+ var x = n[_];
2334
+ x.transform(D);
2335
+ }
2336
+ var F = new y(v.getMaxX(), v.getMaxY());
2337
+ return D.inverseTransformPoint(F);
2338
+ }, M.branchRadialLayout = function(n, E, p, m, v, D) {
2339
+ var _ = (m - p + 1) / 2;
2340
+ _ < 0 && (_ += 180);
2341
+ var x = (_ + p) % 360, F = x * k.TWO_PI / 360, X = v * Math.cos(F), B = v * Math.sin(F);
2342
+ n.setCenter(X, B);
2343
+ var W = [];
2344
+ W = W.concat(n.getEdges());
2345
+ var z = W.length;
2346
+ E != null && z--;
2347
+ for (var Z = 0, P = W.length, O, b = n.getEdgesBetween(E); b.length > 1; ) {
2348
+ var q = b[0];
2349
+ b.splice(0, 1);
2350
+ var et = W.indexOf(q);
2351
+ et >= 0 && W.splice(et, 1), P--, z--;
2352
+ }
2353
+ E != null ? O = (W.indexOf(b[0]) + 1) % P : O = 0;
2354
+ for (var mt = Math.abs(m - p) / z, j = O; Z != z; j = ++j % P) {
2355
+ var xt = W[j].getOtherEnd(n);
2356
+ if (xt != E) {
2357
+ var Q = (p + Z * mt) % 360, nt = (Q + mt) % 360;
2358
+ M.branchRadialLayout(xt, n, Q, nt, v + D, D), Z++;
2359
+ }
2360
+ }
2361
+ }, M.maxDiagonalInTree = function(n) {
2362
+ for (var E = S.MIN_VALUE, p = 0; p < n.length; p++) {
2363
+ var m = n[p], v = m.getDiagonal();
2364
+ v > E && (E = v);
2365
+ }
2366
+ return E;
2367
+ }, M.prototype.calcRepulsionRange = function() {
2368
+ return 2 * (this.level + 1) * this.idealEdgeLength;
2369
+ }, M.prototype.groupZeroDegreeMembers = function() {
2370
+ var n = this, E = {};
2371
+ this.memberGroups = {}, this.idToDummyNode = {};
2372
+ for (var p = [], m = this.graphManager.getAllNodes(), v = 0; v < m.length; v++) {
2373
+ var D = m[v], _ = D.getParent();
2374
+ this.getNodeDegreeWithChildren(D) === 0 && (_.id == null || !this.getToBeTiled(_)) && p.push(D);
2375
+ }
2376
+ for (var v = 0; v < p.length; v++) {
2377
+ var D = p[v], x = D.getParent().id;
2378
+ typeof E[x] > "u" && (E[x] = []), E[x] = E[x].concat(D);
2379
+ }
2380
+ Object.keys(E).forEach(function(F) {
2381
+ if (E[F].length > 1) {
2382
+ var X = "DummyCompound_" + F;
2383
+ n.memberGroups[X] = E[F];
2384
+ var B = E[F][0].getParent(), W = new t(n.graphManager);
2385
+ W.id = X, W.paddingLeft = B.paddingLeft || 0, W.paddingRight = B.paddingRight || 0, W.paddingBottom = B.paddingBottom || 0, W.paddingTop = B.paddingTop || 0, n.idToDummyNode[X] = W;
2386
+ var z = n.getGraphManager().add(n.newGraph(), W), Z = B.getChild();
2387
+ Z.add(W);
2388
+ for (var P = 0; P < E[F].length; P++) {
2389
+ var O = E[F][P];
2390
+ Z.remove(O), z.add(O);
2391
+ }
2392
+ }
2393
+ });
2394
+ }, M.prototype.clearCompounds = function() {
2395
+ var n = {}, E = {};
2396
+ this.performDFSOnCompounds();
2397
+ for (var p = 0; p < this.compoundOrder.length; p++)
2398
+ E[this.compoundOrder[p].id] = this.compoundOrder[p], n[this.compoundOrder[p].id] = [].concat(this.compoundOrder[p].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[p].getChild()), this.compoundOrder[p].child = null;
2399
+ this.graphManager.resetAllNodes(), this.tileCompoundMembers(n, E);
2400
+ }, M.prototype.clearZeroDegreeMembers = function() {
2401
+ var n = this, E = this.tiledZeroDegreePack = [];
2402
+ Object.keys(this.memberGroups).forEach(function(p) {
2403
+ var m = n.idToDummyNode[p];
2404
+ if (E[p] = n.tileNodes(n.memberGroups[p], m.paddingLeft + m.paddingRight), m.rect.width = E[p].width, m.rect.height = E[p].height, m.setCenter(E[p].centerX, E[p].centerY), m.labelMarginLeft = 0, m.labelMarginTop = 0, s.NODE_DIMENSIONS_INCLUDE_LABELS) {
2405
+ var v = m.rect.width, D = m.rect.height;
2406
+ m.labelWidth && (m.labelPosHorizontal == "left" ? (m.rect.x -= m.labelWidth, m.setWidth(v + m.labelWidth), m.labelMarginLeft = m.labelWidth) : m.labelPosHorizontal == "center" && m.labelWidth > v ? (m.rect.x -= (m.labelWidth - v) / 2, m.setWidth(m.labelWidth), m.labelMarginLeft = (m.labelWidth - v) / 2) : m.labelPosHorizontal == "right" && m.setWidth(v + m.labelWidth)), m.labelHeight && (m.labelPosVertical == "top" ? (m.rect.y -= m.labelHeight, m.setHeight(D + m.labelHeight), m.labelMarginTop = m.labelHeight) : m.labelPosVertical == "center" && m.labelHeight > D ? (m.rect.y -= (m.labelHeight - D) / 2, m.setHeight(m.labelHeight), m.labelMarginTop = (m.labelHeight - D) / 2) : m.labelPosVertical == "bottom" && m.setHeight(D + m.labelHeight));
2407
+ }
2408
+ });
2409
+ }, M.prototype.repopulateCompounds = function() {
2410
+ for (var n = this.compoundOrder.length - 1; n >= 0; n--) {
2411
+ var E = this.compoundOrder[n], p = E.id, m = E.paddingLeft, v = E.paddingTop, D = E.labelMarginLeft, _ = E.labelMarginTop;
2412
+ this.adjustLocations(this.tiledMemberPack[p], E.rect.x, E.rect.y, m, v, D, _);
2413
+ }
2414
+ }, M.prototype.repopulateZeroDegreeMembers = function() {
2415
+ var n = this, E = this.tiledZeroDegreePack;
2416
+ Object.keys(E).forEach(function(p) {
2417
+ var m = n.idToDummyNode[p], v = m.paddingLeft, D = m.paddingTop, _ = m.labelMarginLeft, x = m.labelMarginTop;
2418
+ n.adjustLocations(E[p], m.rect.x, m.rect.y, v, D, _, x);
2419
+ });
2420
+ }, M.prototype.getToBeTiled = function(n) {
2421
+ var E = n.id;
2422
+ if (this.toBeTiled[E] != null)
2423
+ return this.toBeTiled[E];
2424
+ var p = n.getChild();
2425
+ if (p == null)
2426
+ return this.toBeTiled[E] = !1, !1;
2427
+ for (var m = p.getNodes(), v = 0; v < m.length; v++) {
2428
+ var D = m[v];
2429
+ if (this.getNodeDegree(D) > 0)
2430
+ return this.toBeTiled[E] = !1, !1;
2431
+ if (D.getChild() == null) {
2432
+ this.toBeTiled[D.id] = !1;
2433
+ continue;
2434
+ }
2435
+ if (!this.getToBeTiled(D))
2436
+ return this.toBeTiled[E] = !1, !1;
2437
+ }
2438
+ return this.toBeTiled[E] = !0, !0;
2439
+ }, M.prototype.getNodeDegree = function(n) {
2440
+ n.id;
2441
+ for (var E = n.getEdges(), p = 0, m = 0; m < E.length; m++) {
2442
+ var v = E[m];
2443
+ v.getSource().id !== v.getTarget().id && (p = p + 1);
2444
+ }
2445
+ return p;
2446
+ }, M.prototype.getNodeDegreeWithChildren = function(n) {
2447
+ var E = this.getNodeDegree(n);
2448
+ if (n.getChild() == null)
2449
+ return E;
2450
+ for (var p = n.getChild().getNodes(), m = 0; m < p.length; m++) {
2451
+ var v = p[m];
2452
+ E += this.getNodeDegreeWithChildren(v);
2453
+ }
2454
+ return E;
2455
+ }, M.prototype.performDFSOnCompounds = function() {
2456
+ this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
2457
+ }, M.prototype.fillCompexOrderByDFS = function(n) {
2458
+ for (var E = 0; E < n.length; E++) {
2459
+ var p = n[E];
2460
+ p.getChild() != null && this.fillCompexOrderByDFS(p.getChild().getNodes()), this.getToBeTiled(p) && this.compoundOrder.push(p);
2461
+ }
2462
+ }, M.prototype.adjustLocations = function(n, E, p, m, v, D, _) {
2463
+ E += m + D, p += v + _;
2464
+ for (var x = E, F = 0; F < n.rows.length; F++) {
2465
+ var X = n.rows[F];
2466
+ E = x;
2467
+ for (var B = 0, W = 0; W < X.length; W++) {
2468
+ var z = X[W];
2469
+ z.rect.x = E, z.rect.y = p, E += z.rect.width + n.horizontalPadding, z.rect.height > B && (B = z.rect.height);
2470
+ }
2471
+ p += B + n.verticalPadding;
2472
+ }
2473
+ }, M.prototype.tileCompoundMembers = function(n, E) {
2474
+ var p = this;
2475
+ this.tiledMemberPack = [], Object.keys(n).forEach(function(m) {
2476
+ var v = E[m];
2477
+ if (p.tiledMemberPack[m] = p.tileNodes(n[m], v.paddingLeft + v.paddingRight), v.rect.width = p.tiledMemberPack[m].width, v.rect.height = p.tiledMemberPack[m].height, v.setCenter(p.tiledMemberPack[m].centerX, p.tiledMemberPack[m].centerY), v.labelMarginLeft = 0, v.labelMarginTop = 0, s.NODE_DIMENSIONS_INCLUDE_LABELS) {
2478
+ var D = v.rect.width, _ = v.rect.height;
2479
+ v.labelWidth && (v.labelPosHorizontal == "left" ? (v.rect.x -= v.labelWidth, v.setWidth(D + v.labelWidth), v.labelMarginLeft = v.labelWidth) : v.labelPosHorizontal == "center" && v.labelWidth > D ? (v.rect.x -= (v.labelWidth - D) / 2, v.setWidth(v.labelWidth), v.labelMarginLeft = (v.labelWidth - D) / 2) : v.labelPosHorizontal == "right" && v.setWidth(D + v.labelWidth)), v.labelHeight && (v.labelPosVertical == "top" ? (v.rect.y -= v.labelHeight, v.setHeight(_ + v.labelHeight), v.labelMarginTop = v.labelHeight) : v.labelPosVertical == "center" && v.labelHeight > _ ? (v.rect.y -= (v.labelHeight - _) / 2, v.setHeight(v.labelHeight), v.labelMarginTop = (v.labelHeight - _) / 2) : v.labelPosVertical == "bottom" && v.setHeight(_ + v.labelHeight));
2480
+ }
2481
+ });
2482
+ }, M.prototype.tileNodes = function(n, E) {
2483
+ var p = this.tileNodesByFavoringDim(n, E, !0), m = this.tileNodesByFavoringDim(n, E, !1), v = this.getOrgRatio(p), D = this.getOrgRatio(m), _;
2484
+ return D < v ? _ = m : _ = p, _;
2485
+ }, M.prototype.getOrgRatio = function(n) {
2486
+ var E = n.width, p = n.height, m = E / p;
2487
+ return m < 1 && (m = 1 / m), m;
2488
+ }, M.prototype.calcIdealRowWidth = function(n, E) {
2489
+ var p = s.TILING_PADDING_VERTICAL, m = s.TILING_PADDING_HORIZONTAL, v = n.length, D = 0, _ = 0, x = 0;
2490
+ n.forEach(function(P) {
2491
+ D += P.getWidth(), _ += P.getHeight(), P.getWidth() > x && (x = P.getWidth());
2492
+ });
2493
+ var F = D / v, X = _ / v, B = Math.pow(p - m, 2) + 4 * (F + m) * (X + p) * v, W = (m - p + Math.sqrt(B)) / (2 * (F + m)), z;
2494
+ E ? (z = Math.ceil(W), z == W && z++) : z = Math.floor(W);
2495
+ var Z = z * (F + m) - m;
2496
+ return x > Z && (Z = x), Z += m * 2, Z;
2497
+ }, M.prototype.tileNodesByFavoringDim = function(n, E, p) {
2498
+ var m = s.TILING_PADDING_VERTICAL, v = s.TILING_PADDING_HORIZONTAL, D = s.TILING_COMPARE_BY, _ = {
2499
+ rows: [],
2500
+ rowWidth: [],
2501
+ rowHeight: [],
2502
+ width: 0,
2503
+ height: E,
2504
+ // assume minHeight equals to minWidth
2505
+ verticalPadding: m,
2506
+ horizontalPadding: v,
2507
+ centerX: 0,
2508
+ centerY: 0
2509
+ };
2510
+ D && (_.idealRowWidth = this.calcIdealRowWidth(n, p));
2511
+ var x = function(P) {
2512
+ return P.rect.width * P.rect.height;
2513
+ }, F = function(P, O) {
2514
+ return x(O) - x(P);
2515
+ };
2516
+ n.sort(function(P, O) {
2517
+ var b = F;
2518
+ return _.idealRowWidth ? (b = D, b(P.id, O.id)) : b(P, O);
2519
+ });
2520
+ for (var X = 0, B = 0, W = 0; W < n.length; W++) {
2521
+ var z = n[W];
2522
+ X += z.getCenterX(), B += z.getCenterY();
2523
+ }
2524
+ _.centerX = X / n.length, _.centerY = B / n.length;
2525
+ for (var W = 0; W < n.length; W++) {
2526
+ var z = n[W];
2527
+ if (_.rows.length == 0)
2528
+ this.insertNodeToRow(_, z, 0, E);
2529
+ else if (this.canAddHorizontal(_, z.rect.width, z.rect.height)) {
2530
+ var Z = _.rows.length - 1;
2531
+ _.idealRowWidth || (Z = this.getShortestRowIndex(_)), this.insertNodeToRow(_, z, Z, E);
2532
+ } else
2533
+ this.insertNodeToRow(_, z, _.rows.length, E);
2534
+ this.shiftToLastRow(_);
2535
+ }
2536
+ return _;
2537
+ }, M.prototype.insertNodeToRow = function(n, E, p, m) {
2538
+ var v = m;
2539
+ if (p == n.rows.length) {
2540
+ var D = [];
2541
+ n.rows.push(D), n.rowWidth.push(v), n.rowHeight.push(0);
2542
+ }
2543
+ var _ = n.rowWidth[p] + E.rect.width;
2544
+ n.rows[p].length > 0 && (_ += n.horizontalPadding), n.rowWidth[p] = _, n.width < _ && (n.width = _);
2545
+ var x = E.rect.height;
2546
+ p > 0 && (x += n.verticalPadding);
2547
+ var F = 0;
2548
+ x > n.rowHeight[p] && (F = n.rowHeight[p], n.rowHeight[p] = x, F = n.rowHeight[p] - F), n.height += F, n.rows[p].push(E);
2549
+ }, M.prototype.getShortestRowIndex = function(n) {
2550
+ for (var E = -1, p = Number.MAX_VALUE, m = 0; m < n.rows.length; m++)
2551
+ n.rowWidth[m] < p && (E = m, p = n.rowWidth[m]);
2552
+ return E;
2553
+ }, M.prototype.getLongestRowIndex = function(n) {
2554
+ for (var E = -1, p = Number.MIN_VALUE, m = 0; m < n.rows.length; m++)
2555
+ n.rowWidth[m] > p && (E = m, p = n.rowWidth[m]);
2556
+ return E;
2557
+ }, M.prototype.canAddHorizontal = function(n, E, p) {
2558
+ if (n.idealRowWidth) {
2559
+ var m = n.rows.length - 1, v = n.rowWidth[m];
2560
+ return v + E + n.horizontalPadding <= n.idealRowWidth;
2561
+ }
2562
+ var D = this.getShortestRowIndex(n);
2563
+ if (D < 0)
2564
+ return !0;
2565
+ var _ = n.rowWidth[D];
2566
+ if (_ + n.horizontalPadding + E <= n.width) return !0;
2567
+ var x = 0;
2568
+ n.rowHeight[D] < p && D > 0 && (x = p + n.verticalPadding - n.rowHeight[D]);
2569
+ var F;
2570
+ n.width - _ >= E + n.horizontalPadding ? F = (n.height + x) / (_ + E + n.horizontalPadding) : F = (n.height + x) / n.width, x = p + n.verticalPadding;
2571
+ var X;
2572
+ return n.width < E ? X = (n.height + x) / E : X = (n.height + x) / n.width, X < 1 && (X = 1 / X), F < 1 && (F = 1 / F), F < X;
2573
+ }, M.prototype.shiftToLastRow = function(n) {
2574
+ var E = this.getLongestRowIndex(n), p = n.rowWidth.length - 1, m = n.rows[E], v = m[m.length - 1], D = v.width + n.horizontalPadding;
2575
+ if (n.width - n.rowWidth[p] > D && E != p) {
2576
+ m.splice(-1, 1), n.rows[p].push(v), n.rowWidth[E] = n.rowWidth[E] - D, n.rowWidth[p] = n.rowWidth[p] + D, n.width = n.rowWidth[instance.getLongestRowIndex(n)];
2577
+ for (var _ = Number.MIN_VALUE, x = 0; x < m.length; x++)
2578
+ m[x].height > _ && (_ = m[x].height);
2579
+ E > 0 && (_ += n.verticalPadding);
2580
+ var F = n.rowHeight[E] + n.rowHeight[p];
2581
+ n.rowHeight[E] = _, n.rowHeight[p] < v.height + n.verticalPadding && (n.rowHeight[p] = v.height + n.verticalPadding);
2582
+ var X = n.rowHeight[E] + n.rowHeight[p];
2583
+ n.height += X - F, this.shiftToLastRow(n);
2584
+ }
2585
+ }, M.prototype.tilingPreLayout = function() {
2586
+ s.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
2587
+ }, M.prototype.tilingPostLayout = function() {
2588
+ s.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
2589
+ }, M.prototype.reduceTrees = function() {
2590
+ for (var n = [], E = !0, p; E; ) {
2591
+ var m = this.graphManager.getAllNodes(), v = [];
2592
+ E = !1;
2593
+ for (var D = 0; D < m.length; D++)
2594
+ if (p = m[D], p.getEdges().length == 1 && !p.getEdges()[0].isInterGraph && p.getChild() == null) {
2595
+ if (s.PURE_INCREMENTAL) {
2596
+ var _ = p.getEdges()[0].getOtherEnd(p), x = new C(p.getCenterX() - _.getCenterX(), p.getCenterY() - _.getCenterY());
2597
+ v.push([p, p.getEdges()[0], p.getOwner(), x]);
2598
+ } else
2599
+ v.push([p, p.getEdges()[0], p.getOwner()]);
2600
+ E = !0;
2601
+ }
2602
+ if (E == !0) {
2603
+ for (var F = [], X = 0; X < v.length; X++)
2604
+ v[X][0].getEdges().length == 1 && (F.push(v[X]), v[X][0].getOwner().remove(v[X][0]));
2605
+ n.push(F), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2606
+ }
2607
+ }
2608
+ this.prunedNodesAll = n;
2609
+ }, M.prototype.growTree = function(n) {
2610
+ for (var E = n.length, p = n[E - 1], m, v = 0; v < p.length; v++)
2611
+ m = p[v], this.findPlaceforPrunedNode(m), m[2].add(m[0]), m[2].add(m[1], m[1].source, m[1].target);
2612
+ n.splice(n.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2613
+ }, M.prototype.findPlaceforPrunedNode = function(n) {
2614
+ var E, p, m = n[0];
2615
+ if (m == n[1].source ? p = n[1].target : p = n[1].source, s.PURE_INCREMENTAL)
2616
+ m.setCenter(p.getCenterX() + n[3].getWidth(), p.getCenterY() + n[3].getHeight());
2617
+ else {
2618
+ var v = p.startX, D = p.finishX, _ = p.startY, x = p.finishY, F = 0, X = 0, B = 0, W = 0, z = [F, B, X, W];
2619
+ if (_ > 0)
2620
+ for (var Z = v; Z <= D; Z++)
2621
+ z[0] += this.grid[Z][_ - 1].length + this.grid[Z][_].length - 1;
2622
+ if (D < this.grid.length - 1)
2623
+ for (var Z = _; Z <= x; Z++)
2624
+ z[1] += this.grid[D + 1][Z].length + this.grid[D][Z].length - 1;
2625
+ if (x < this.grid[0].length - 1)
2626
+ for (var Z = v; Z <= D; Z++)
2627
+ z[2] += this.grid[Z][x + 1].length + this.grid[Z][x].length - 1;
2628
+ if (v > 0)
2629
+ for (var Z = _; Z <= x; Z++)
2630
+ z[3] += this.grid[v - 1][Z].length + this.grid[v][Z].length - 1;
2631
+ for (var P = S.MAX_VALUE, O, b, q = 0; q < z.length; q++)
2632
+ z[q] < P ? (P = z[q], O = 1, b = q) : z[q] == P && O++;
2633
+ if (O == 3 && P == 0)
2634
+ z[0] == 0 && z[1] == 0 && z[2] == 0 ? E = 1 : z[0] == 0 && z[1] == 0 && z[3] == 0 ? E = 0 : z[0] == 0 && z[2] == 0 && z[3] == 0 ? E = 3 : z[1] == 0 && z[2] == 0 && z[3] == 0 && (E = 2);
2635
+ else if (O == 2 && P == 0) {
2636
+ var et = Math.floor(Math.random() * 2);
2637
+ z[0] == 0 && z[1] == 0 ? et == 0 ? E = 0 : E = 1 : z[0] == 0 && z[2] == 0 ? et == 0 ? E = 0 : E = 2 : z[0] == 0 && z[3] == 0 ? et == 0 ? E = 0 : E = 3 : z[1] == 0 && z[2] == 0 ? et == 0 ? E = 1 : E = 2 : z[1] == 0 && z[3] == 0 ? et == 0 ? E = 1 : E = 3 : et == 0 ? E = 2 : E = 3;
2638
+ } else if (O == 4 && P == 0) {
2639
+ var et = Math.floor(Math.random() * 4);
2640
+ E = et;
2641
+ } else
2642
+ E = b;
2643
+ E == 0 ? m.setCenter(p.getCenterX(), p.getCenterY() - p.getHeight() / 2 - l.DEFAULT_EDGE_LENGTH - m.getHeight() / 2) : E == 1 ? m.setCenter(p.getCenterX() + p.getWidth() / 2 + l.DEFAULT_EDGE_LENGTH + m.getWidth() / 2, p.getCenterY()) : E == 2 ? m.setCenter(p.getCenterX(), p.getCenterY() + p.getHeight() / 2 + l.DEFAULT_EDGE_LENGTH + m.getHeight() / 2) : m.setCenter(p.getCenterX() - p.getWidth() / 2 - l.DEFAULT_EDGE_LENGTH - m.getWidth() / 2, p.getCenterY());
2644
+ }
2645
+ }, r.exports = M;
2646
+ }
2647
+ ),
2648
+ /***/
2649
+ 991: (
2650
+ /***/
2651
+ (r, i, e) => {
2652
+ var a = e(551).FDLayoutNode, o = e(551).IMath;
2653
+ function f(h, s, c, l) {
2654
+ a.call(this, h, s, c, l);
2655
+ }
2656
+ f.prototype = Object.create(a.prototype);
2657
+ for (var t in a)
2658
+ f[t] = a[t];
2659
+ f.prototype.calculateDisplacement = function() {
2660
+ var h = this.graphManager.getLayout();
2661
+ this.getChild() != null && this.fixedNodeWeight ? (this.displacementX += h.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.fixedNodeWeight, this.displacementY += h.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.fixedNodeWeight) : (this.displacementX += h.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY += h.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren), Math.abs(this.displacementX) > h.coolingFactor * h.maxNodeDisplacement && (this.displacementX = h.coolingFactor * h.maxNodeDisplacement * o.sign(this.displacementX)), Math.abs(this.displacementY) > h.coolingFactor * h.maxNodeDisplacement && (this.displacementY = h.coolingFactor * h.maxNodeDisplacement * o.sign(this.displacementY)), this.child && this.child.getNodes().length > 0 && this.propogateDisplacementToChildren(this.displacementX, this.displacementY);
2662
+ }, f.prototype.propogateDisplacementToChildren = function(h, s) {
2663
+ for (var c = this.getChild().getNodes(), l, T = 0; T < c.length; T++)
2664
+ l = c[T], l.getChild() == null ? (l.displacementX += h, l.displacementY += s) : l.propogateDisplacementToChildren(h, s);
2665
+ }, f.prototype.move = function() {
2666
+ var h = this.graphManager.getLayout();
2667
+ (this.child == null || this.child.getNodes().length == 0) && (this.moveBy(this.displacementX, this.displacementY), h.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;
2668
+ }, f.prototype.setPred1 = function(h) {
2669
+ this.pred1 = h;
2670
+ }, f.prototype.getPred1 = function() {
2671
+ return pred1;
2672
+ }, f.prototype.getPred2 = function() {
2673
+ return pred2;
2674
+ }, f.prototype.setNext = function(h) {
2675
+ this.next = h;
2676
+ }, f.prototype.getNext = function() {
2677
+ return next;
2678
+ }, f.prototype.setProcessed = function(h) {
2679
+ this.processed = h;
2680
+ }, f.prototype.isProcessed = function() {
2681
+ return processed;
2682
+ }, r.exports = f;
2683
+ }
2684
+ ),
2685
+ /***/
2686
+ 902: (
2687
+ /***/
2688
+ (r, i, e) => {
2689
+ function a(c) {
2690
+ if (Array.isArray(c)) {
2691
+ for (var l = 0, T = Array(c.length); l < c.length; l++)
2692
+ T[l] = c[l];
2693
+ return T;
2694
+ } else
2695
+ return Array.from(c);
2696
+ }
2697
+ var o = e(806), f = e(551).LinkedList, t = e(551).Matrix, h = e(551).SVD;
2698
+ function s() {
2699
+ }
2700
+ s.handleConstraints = function(c) {
2701
+ var l = {};
2702
+ l.fixedNodeConstraint = c.constraints.fixedNodeConstraint, l.alignmentConstraint = c.constraints.alignmentConstraint, l.relativePlacementConstraint = c.constraints.relativePlacementConstraint;
2703
+ for (var T = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), y = [], C = [], w = c.getAllNodes(), S = 0, k = 0; k < w.length; k++) {
2704
+ var Y = w[k];
2705
+ Y.getChild() == null && (g.set(Y.id, S++), y.push(Y.getCenterX()), C.push(Y.getCenterY()), T.set(Y.id, Y));
2706
+ }
2707
+ l.relativePlacementConstraint && l.relativePlacementConstraint.forEach(function(L) {
2708
+ !L.gap && L.gap != 0 && (L.left ? L.gap = o.DEFAULT_EDGE_LENGTH + T.get(L.left).getWidth() / 2 + T.get(L.right).getWidth() / 2 : L.gap = o.DEFAULT_EDGE_LENGTH + T.get(L.top).getHeight() / 2 + T.get(L.bottom).getHeight() / 2);
2709
+ });
2710
+ var H = function(L, R) {
2711
+ return { x: L.x - R.x, y: L.y - R.y };
2712
+ }, V = function(L) {
2713
+ var R = 0, $ = 0;
2714
+ return L.forEach(function(J) {
2715
+ R += y[g.get(J)], $ += C[g.get(J)];
2716
+ }), { x: R / L.size, y: $ / L.size };
2717
+ }, M = function(L, R, $, J, K) {
2718
+ function ft(lt, ot) {
2719
+ var at = new Set(lt), Ct = !0, ct = !1, Dt = void 0;
2720
+ try {
2721
+ for (var Gt = ot[Symbol.iterator](), wt; !(Ct = (wt = Gt.next()).done); Ct = !0) {
2722
+ var Nt = wt.value;
2723
+ at.add(Nt);
2724
+ }
2725
+ } catch (Ut) {
2726
+ ct = !0, Dt = Ut;
2727
+ } finally {
2728
+ try {
2729
+ !Ct && Gt.return && Gt.return();
2730
+ } finally {
2731
+ if (ct)
2732
+ throw Dt;
2733
+ }
2734
+ }
2735
+ return at;
2736
+ }
2737
+ var ht = /* @__PURE__ */ new Map();
2738
+ L.forEach(function(lt, ot) {
2739
+ ht.set(ot, 0);
2740
+ }), L.forEach(function(lt, ot) {
2741
+ lt.forEach(function(at) {
2742
+ ht.set(at.id, ht.get(at.id) + 1);
2743
+ });
2744
+ });
2745
+ var tt = /* @__PURE__ */ new Map(), gt = /* @__PURE__ */ new Map(), rt = new f();
2746
+ ht.forEach(function(lt, ot) {
2747
+ lt == 0 ? (rt.push(ot), $ || (R == "horizontal" ? tt.set(ot, g.has(ot) ? y[g.get(ot)] : J.get(ot)) : tt.set(ot, g.has(ot) ? C[g.get(ot)] : J.get(ot)))) : tt.set(ot, Number.NEGATIVE_INFINITY), $ && gt.set(ot, /* @__PURE__ */ new Set([ot]));
2748
+ }), $ && K.forEach(function(lt) {
2749
+ var ot = [];
2750
+ if (lt.forEach(function(ct) {
2751
+ $.has(ct) && ot.push(ct);
2752
+ }), ot.length > 0) {
2753
+ var at = 0;
2754
+ ot.forEach(function(ct) {
2755
+ R == "horizontal" ? (tt.set(ct, g.has(ct) ? y[g.get(ct)] : J.get(ct)), at += tt.get(ct)) : (tt.set(ct, g.has(ct) ? C[g.get(ct)] : J.get(ct)), at += tt.get(ct));
2756
+ }), at = at / ot.length, lt.forEach(function(ct) {
2757
+ $.has(ct) || tt.set(ct, at);
2758
+ });
2759
+ } else {
2760
+ var Ct = 0;
2761
+ lt.forEach(function(ct) {
2762
+ R == "horizontal" ? Ct += g.has(ct) ? y[g.get(ct)] : J.get(ct) : Ct += g.has(ct) ? C[g.get(ct)] : J.get(ct);
2763
+ }), Ct = Ct / lt.length, lt.forEach(function(ct) {
2764
+ tt.set(ct, Ct);
2765
+ });
2766
+ }
2767
+ });
2768
+ for (var Et = function() {
2769
+ var lt = rt.shift(), ot = L.get(lt);
2770
+ ot.forEach(function(at) {
2771
+ if (tt.get(at.id) < tt.get(lt) + at.gap)
2772
+ if ($ && $.has(at.id)) {
2773
+ var Ct = void 0;
2774
+ if (R == "horizontal" ? Ct = g.has(at.id) ? y[g.get(at.id)] : J.get(at.id) : Ct = g.has(at.id) ? C[g.get(at.id)] : J.get(at.id), tt.set(at.id, Ct), Ct < tt.get(lt) + at.gap) {
2775
+ var ct = tt.get(lt) + at.gap - Ct;
2776
+ gt.get(lt).forEach(function(Dt) {
2777
+ tt.set(Dt, tt.get(Dt) - ct);
2778
+ });
2779
+ }
2780
+ } else
2781
+ tt.set(at.id, tt.get(lt) + at.gap);
2782
+ ht.set(at.id, ht.get(at.id) - 1), ht.get(at.id) == 0 && rt.push(at.id), $ && gt.set(at.id, ft(gt.get(lt), gt.get(at.id)));
2783
+ });
2784
+ }; rt.length != 0; )
2785
+ Et();
2786
+ if ($) {
2787
+ var yt = /* @__PURE__ */ new Set();
2788
+ L.forEach(function(lt, ot) {
2789
+ lt.length == 0 && yt.add(ot);
2790
+ });
2791
+ var Mt = [];
2792
+ gt.forEach(function(lt, ot) {
2793
+ if (yt.has(ot)) {
2794
+ var at = !1, Ct = !0, ct = !1, Dt = void 0;
2795
+ try {
2796
+ for (var Gt = lt[Symbol.iterator](), wt; !(Ct = (wt = Gt.next()).done); Ct = !0) {
2797
+ var Nt = wt.value;
2798
+ $.has(Nt) && (at = !0);
2799
+ }
2800
+ } catch (Ot) {
2801
+ ct = !0, Dt = Ot;
2802
+ } finally {
2803
+ try {
2804
+ !Ct && Gt.return && Gt.return();
2805
+ } finally {
2806
+ if (ct)
2807
+ throw Dt;
2808
+ }
2809
+ }
2810
+ if (!at) {
2811
+ var Ut = !1, kt = void 0;
2812
+ Mt.forEach(function(Ot, St) {
2813
+ Ot.has([].concat(a(lt))[0]) && (Ut = !0, kt = St);
2814
+ }), Ut ? lt.forEach(function(Ot) {
2815
+ Mt[kt].add(Ot);
2816
+ }) : Mt.push(new Set(lt));
2817
+ }
2818
+ }
2819
+ }), Mt.forEach(function(lt, ot) {
2820
+ var at = Number.POSITIVE_INFINITY, Ct = Number.POSITIVE_INFINITY, ct = Number.NEGATIVE_INFINITY, Dt = Number.NEGATIVE_INFINITY, Gt = !0, wt = !1, Nt = void 0;
2821
+ try {
2822
+ for (var Ut = lt[Symbol.iterator](), kt; !(Gt = (kt = Ut.next()).done); Gt = !0) {
2823
+ var Ot = kt.value, St = void 0;
2824
+ R == "horizontal" ? St = g.has(Ot) ? y[g.get(Ot)] : J.get(Ot) : St = g.has(Ot) ? C[g.get(Ot)] : J.get(Ot);
2825
+ var qt = tt.get(Ot);
2826
+ St < at && (at = St), St > ct && (ct = St), qt < Ct && (Ct = qt), qt > Dt && (Dt = qt);
2827
+ }
2828
+ } catch (jt) {
2829
+ wt = !0, Nt = jt;
2830
+ } finally {
2831
+ try {
2832
+ !Gt && Ut.return && Ut.return();
2833
+ } finally {
2834
+ if (wt)
2835
+ throw Nt;
2836
+ }
2837
+ }
2838
+ var oe = (at + ct) / 2 - (Ct + Dt) / 2, ee = !0, Zt = !1, Kt = void 0;
2839
+ try {
2840
+ for (var $t = lt[Symbol.iterator](), Jt; !(ee = (Jt = $t.next()).done); ee = !0) {
2841
+ var re = Jt.value;
2842
+ tt.set(re, tt.get(re) + oe);
2843
+ }
2844
+ } catch (jt) {
2845
+ Zt = !0, Kt = jt;
2846
+ } finally {
2847
+ try {
2848
+ !ee && $t.return && $t.return();
2849
+ } finally {
2850
+ if (Zt)
2851
+ throw Kt;
2852
+ }
2853
+ }
2854
+ });
2855
+ }
2856
+ return tt;
2857
+ }, it = function(L) {
2858
+ var R = 0, $ = 0, J = 0, K = 0;
2859
+ if (L.forEach(function(gt) {
2860
+ gt.left ? y[g.get(gt.left)] - y[g.get(gt.right)] >= 0 ? R++ : $++ : C[g.get(gt.top)] - C[g.get(gt.bottom)] >= 0 ? J++ : K++;
2861
+ }), R > $ && J > K)
2862
+ for (var ft = 0; ft < g.size; ft++)
2863
+ y[ft] = -1 * y[ft], C[ft] = -1 * C[ft];
2864
+ else if (R > $)
2865
+ for (var ht = 0; ht < g.size; ht++)
2866
+ y[ht] = -1 * y[ht];
2867
+ else if (J > K)
2868
+ for (var tt = 0; tt < g.size; tt++)
2869
+ C[tt] = -1 * C[tt];
2870
+ }, n = function(L) {
2871
+ var R = [], $ = new f(), J = /* @__PURE__ */ new Set(), K = 0;
2872
+ return L.forEach(function(ft, ht) {
2873
+ if (!J.has(ht)) {
2874
+ R[K] = [];
2875
+ var tt = ht;
2876
+ for ($.push(tt), J.add(tt), R[K].push(tt); $.length != 0; ) {
2877
+ tt = $.shift();
2878
+ var gt = L.get(tt);
2879
+ gt.forEach(function(rt) {
2880
+ J.has(rt.id) || ($.push(rt.id), J.add(rt.id), R[K].push(rt.id));
2881
+ });
2882
+ }
2883
+ K++;
2884
+ }
2885
+ }), R;
2886
+ }, E = function(L) {
2887
+ var R = /* @__PURE__ */ new Map();
2888
+ return L.forEach(function($, J) {
2889
+ R.set(J, []);
2890
+ }), L.forEach(function($, J) {
2891
+ $.forEach(function(K) {
2892
+ R.get(J).push(K), R.get(K.id).push({ id: J, gap: K.gap, direction: K.direction });
2893
+ });
2894
+ }), R;
2895
+ }, p = function(L) {
2896
+ var R = /* @__PURE__ */ new Map();
2897
+ return L.forEach(function($, J) {
2898
+ R.set(J, []);
2899
+ }), L.forEach(function($, J) {
2900
+ $.forEach(function(K) {
2901
+ R.get(K.id).push({ id: J, gap: K.gap, direction: K.direction });
2902
+ });
2903
+ }), R;
2904
+ }, m = [], v = [], D = !1, _ = !1, x = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map(), B = [];
2905
+ if (l.fixedNodeConstraint && l.fixedNodeConstraint.forEach(function(L) {
2906
+ x.add(L.nodeId);
2907
+ }), l.relativePlacementConstraint && (l.relativePlacementConstraint.forEach(function(L) {
2908
+ L.left ? (F.has(L.left) ? F.get(L.left).push({ id: L.right, gap: L.gap, direction: "horizontal" }) : F.set(L.left, [{ id: L.right, gap: L.gap, direction: "horizontal" }]), F.has(L.right) || F.set(L.right, [])) : (F.has(L.top) ? F.get(L.top).push({ id: L.bottom, gap: L.gap, direction: "vertical" }) : F.set(L.top, [{ id: L.bottom, gap: L.gap, direction: "vertical" }]), F.has(L.bottom) || F.set(L.bottom, []));
2909
+ }), X = E(F), B = n(X)), o.TRANSFORM_ON_CONSTRAINT_HANDLING) {
2910
+ if (l.fixedNodeConstraint && l.fixedNodeConstraint.length > 1)
2911
+ l.fixedNodeConstraint.forEach(function(L, R) {
2912
+ m[R] = [L.position.x, L.position.y], v[R] = [y[g.get(L.nodeId)], C[g.get(L.nodeId)]];
2913
+ }), D = !0;
2914
+ else if (l.alignmentConstraint)
2915
+ (function() {
2916
+ var L = 0;
2917
+ if (l.alignmentConstraint.vertical) {
2918
+ for (var R = l.alignmentConstraint.vertical, $ = function(tt) {
2919
+ var gt = /* @__PURE__ */ new Set();
2920
+ R[tt].forEach(function(yt) {
2921
+ gt.add(yt);
2922
+ });
2923
+ var rt = new Set([].concat(a(gt)).filter(function(yt) {
2924
+ return x.has(yt);
2925
+ })), Et = void 0;
2926
+ rt.size > 0 ? Et = y[g.get(rt.values().next().value)] : Et = V(gt).x, R[tt].forEach(function(yt) {
2927
+ m[L] = [Et, C[g.get(yt)]], v[L] = [y[g.get(yt)], C[g.get(yt)]], L++;
2928
+ });
2929
+ }, J = 0; J < R.length; J++)
2930
+ $(J);
2931
+ D = !0;
2932
+ }
2933
+ if (l.alignmentConstraint.horizontal) {
2934
+ for (var K = l.alignmentConstraint.horizontal, ft = function(tt) {
2935
+ var gt = /* @__PURE__ */ new Set();
2936
+ K[tt].forEach(function(yt) {
2937
+ gt.add(yt);
2938
+ });
2939
+ var rt = new Set([].concat(a(gt)).filter(function(yt) {
2940
+ return x.has(yt);
2941
+ })), Et = void 0;
2942
+ rt.size > 0 ? Et = y[g.get(rt.values().next().value)] : Et = V(gt).y, K[tt].forEach(function(yt) {
2943
+ m[L] = [y[g.get(yt)], Et], v[L] = [y[g.get(yt)], C[g.get(yt)]], L++;
2944
+ });
2945
+ }, ht = 0; ht < K.length; ht++)
2946
+ ft(ht);
2947
+ D = !0;
2948
+ }
2949
+ l.relativePlacementConstraint && (_ = !0);
2950
+ })();
2951
+ else if (l.relativePlacementConstraint) {
2952
+ for (var W = 0, z = 0, Z = 0; Z < B.length; Z++)
2953
+ B[Z].length > W && (W = B[Z].length, z = Z);
2954
+ if (W < X.size / 2)
2955
+ it(l.relativePlacementConstraint), D = !1, _ = !1;
2956
+ else {
2957
+ var P = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), b = [];
2958
+ B[z].forEach(function(L) {
2959
+ F.get(L).forEach(function(R) {
2960
+ R.direction == "horizontal" ? (P.has(L) ? P.get(L).push(R) : P.set(L, [R]), P.has(R.id) || P.set(R.id, []), b.push({ left: L, right: R.id })) : (O.has(L) ? O.get(L).push(R) : O.set(L, [R]), O.has(R.id) || O.set(R.id, []), b.push({ top: L, bottom: R.id }));
2961
+ });
2962
+ }), it(b), _ = !1;
2963
+ var q = M(P, "horizontal"), et = M(O, "vertical");
2964
+ B[z].forEach(function(L, R) {
2965
+ v[R] = [y[g.get(L)], C[g.get(L)]], m[R] = [], q.has(L) ? m[R][0] = q.get(L) : m[R][0] = y[g.get(L)], et.has(L) ? m[R][1] = et.get(L) : m[R][1] = C[g.get(L)];
2966
+ }), D = !0;
2967
+ }
2968
+ }
2969
+ if (D) {
2970
+ for (var mt = void 0, j = t.transpose(m), xt = t.transpose(v), Q = 0; Q < j.length; Q++)
2971
+ j[Q] = t.multGamma(j[Q]), xt[Q] = t.multGamma(xt[Q]);
2972
+ var nt = t.multMat(j, t.transpose(xt)), vt = h.svd(nt);
2973
+ mt = t.multMat(vt.V, t.transpose(vt.U));
2974
+ for (var st = 0; st < g.size; st++) {
2975
+ var It = [y[st], C[st]], Lt = [mt[0][0], mt[1][0]], Tt = [mt[0][1], mt[1][1]];
2976
+ y[st] = t.dotProduct(It, Lt), C[st] = t.dotProduct(It, Tt);
2977
+ }
2978
+ _ && it(l.relativePlacementConstraint);
2979
+ }
2980
+ }
2981
+ if (o.ENFORCE_CONSTRAINTS) {
2982
+ if (l.fixedNodeConstraint && l.fixedNodeConstraint.length > 0) {
2983
+ var At = { x: 0, y: 0 };
2984
+ l.fixedNodeConstraint.forEach(function(L, R) {
2985
+ var $ = { x: y[g.get(L.nodeId)], y: C[g.get(L.nodeId)] }, J = L.position, K = H(J, $);
2986
+ At.x += K.x, At.y += K.y;
2987
+ }), At.x /= l.fixedNodeConstraint.length, At.y /= l.fixedNodeConstraint.length, y.forEach(function(L, R) {
2988
+ y[R] += At.x;
2989
+ }), C.forEach(function(L, R) {
2990
+ C[R] += At.y;
2991
+ }), l.fixedNodeConstraint.forEach(function(L) {
2992
+ y[g.get(L.nodeId)] = L.position.x, C[g.get(L.nodeId)] = L.position.y;
2993
+ });
2994
+ }
2995
+ if (l.alignmentConstraint) {
2996
+ if (l.alignmentConstraint.vertical)
2997
+ for (var Ht = l.alignmentConstraint.vertical, Rt = function(L) {
2998
+ var R = /* @__PURE__ */ new Set();
2999
+ Ht[L].forEach(function(K) {
3000
+ R.add(K);
3001
+ });
3002
+ var $ = new Set([].concat(a(R)).filter(function(K) {
3003
+ return x.has(K);
3004
+ })), J = void 0;
3005
+ $.size > 0 ? J = y[g.get($.values().next().value)] : J = V(R).x, R.forEach(function(K) {
3006
+ x.has(K) || (y[g.get(K)] = J);
3007
+ });
3008
+ }, bt = 0; bt < Ht.length; bt++)
3009
+ Rt(bt);
3010
+ if (l.alignmentConstraint.horizontal)
3011
+ for (var Ft = l.alignmentConstraint.horizontal, zt = function(L) {
3012
+ var R = /* @__PURE__ */ new Set();
3013
+ Ft[L].forEach(function(K) {
3014
+ R.add(K);
3015
+ });
3016
+ var $ = new Set([].concat(a(R)).filter(function(K) {
3017
+ return x.has(K);
3018
+ })), J = void 0;
3019
+ $.size > 0 ? J = C[g.get($.values().next().value)] : J = V(R).y, R.forEach(function(K) {
3020
+ x.has(K) || (C[g.get(K)] = J);
3021
+ });
3022
+ }, Pt = 0; Pt < Ft.length; Pt++)
3023
+ zt(Pt);
3024
+ }
3025
+ l.relativePlacementConstraint && function() {
3026
+ var L = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), K = /* @__PURE__ */ new Map(), ft = /* @__PURE__ */ new Map(), ht = /* @__PURE__ */ new Set(), tt = /* @__PURE__ */ new Set();
3027
+ if (x.forEach(function(ut) {
3028
+ ht.add(ut), tt.add(ut);
3029
+ }), l.alignmentConstraint) {
3030
+ if (l.alignmentConstraint.vertical)
3031
+ for (var gt = l.alignmentConstraint.vertical, rt = function(ut) {
3032
+ $.set("dummy" + ut, []), gt[ut].forEach(function(_t) {
3033
+ L.set(_t, "dummy" + ut), $.get("dummy" + ut).push(_t), x.has(_t) && ht.add("dummy" + ut);
3034
+ }), K.set("dummy" + ut, y[g.get(gt[ut][0])]);
3035
+ }, Et = 0; Et < gt.length; Et++)
3036
+ rt(Et);
3037
+ if (l.alignmentConstraint.horizontal)
3038
+ for (var yt = l.alignmentConstraint.horizontal, Mt = function(ut) {
3039
+ J.set("dummy" + ut, []), yt[ut].forEach(function(_t) {
3040
+ R.set(_t, "dummy" + ut), J.get("dummy" + ut).push(_t), x.has(_t) && tt.add("dummy" + ut);
3041
+ }), ft.set("dummy" + ut, C[g.get(yt[ut][0])]);
3042
+ }, lt = 0; lt < yt.length; lt++)
3043
+ Mt(lt);
3044
+ }
3045
+ var ot = /* @__PURE__ */ new Map(), at = /* @__PURE__ */ new Map(), Ct = function(ut) {
3046
+ F.get(ut).forEach(function(_t) {
3047
+ var Yt = void 0, Wt = void 0;
3048
+ _t.direction == "horizontal" ? (Yt = L.get(ut) ? L.get(ut) : ut, L.get(_t.id) ? Wt = { id: L.get(_t.id), gap: _t.gap, direction: _t.direction } : Wt = _t, ot.has(Yt) ? ot.get(Yt).push(Wt) : ot.set(Yt, [Wt]), ot.has(Wt.id) || ot.set(Wt.id, [])) : (Yt = R.get(ut) ? R.get(ut) : ut, R.get(_t.id) ? Wt = { id: R.get(_t.id), gap: _t.gap, direction: _t.direction } : Wt = _t, at.has(Yt) ? at.get(Yt).push(Wt) : at.set(Yt, [Wt]), at.has(Wt.id) || at.set(Wt.id, []));
3049
+ });
3050
+ }, ct = !0, Dt = !1, Gt = void 0;
3051
+ try {
3052
+ for (var wt = F.keys()[Symbol.iterator](), Nt; !(ct = (Nt = wt.next()).done); ct = !0) {
3053
+ var Ut = Nt.value;
3054
+ Ct(Ut);
3055
+ }
3056
+ } catch (ut) {
3057
+ Dt = !0, Gt = ut;
3058
+ } finally {
3059
+ try {
3060
+ !ct && wt.return && wt.return();
3061
+ } finally {
3062
+ if (Dt)
3063
+ throw Gt;
3064
+ }
3065
+ }
3066
+ var kt = E(ot), Ot = E(at), St = n(kt), qt = n(Ot), oe = p(ot), ee = p(at), Zt = [], Kt = [];
3067
+ St.forEach(function(ut, _t) {
3068
+ Zt[_t] = [], ut.forEach(function(Yt) {
3069
+ oe.get(Yt).length == 0 && Zt[_t].push(Yt);
3070
+ });
3071
+ }), qt.forEach(function(ut, _t) {
3072
+ Kt[_t] = [], ut.forEach(function(Yt) {
3073
+ ee.get(Yt).length == 0 && Kt[_t].push(Yt);
3074
+ });
3075
+ });
3076
+ var $t = M(ot, "horizontal", ht, K, Zt), Jt = M(at, "vertical", tt, ft, Kt), re = function(ut) {
3077
+ $.get(ut) ? $.get(ut).forEach(function(_t) {
3078
+ y[g.get(_t)] = $t.get(ut);
3079
+ }) : y[g.get(ut)] = $t.get(ut);
3080
+ }, jt = !0, Ee = !1, Te = void 0;
3081
+ try {
3082
+ for (var ae = $t.keys()[Symbol.iterator](), Ne; !(jt = (Ne = ae.next()).done); jt = !0) {
3083
+ var se = Ne.value;
3084
+ re(se);
3085
+ }
3086
+ } catch (ut) {
3087
+ Ee = !0, Te = ut;
3088
+ } finally {
3089
+ try {
3090
+ !jt && ae.return && ae.return();
3091
+ } finally {
3092
+ if (Ee)
3093
+ throw Te;
3094
+ }
3095
+ }
3096
+ var We = function(ut) {
3097
+ J.get(ut) ? J.get(ut).forEach(function(_t) {
3098
+ C[g.get(_t)] = Jt.get(ut);
3099
+ }) : C[g.get(ut)] = Jt.get(ut);
3100
+ }, he = !0, Ae = !1, Ce = void 0;
3101
+ try {
3102
+ for (var le = Jt.keys()[Symbol.iterator](), we; !(he = (we = le.next()).done); he = !0) {
3103
+ var se = we.value;
3104
+ We(se);
3105
+ }
3106
+ } catch (ut) {
3107
+ Ae = !0, Ce = ut;
3108
+ } finally {
3109
+ try {
3110
+ !he && le.return && le.return();
3111
+ } finally {
3112
+ if (Ae)
3113
+ throw Ce;
3114
+ }
3115
+ }
3116
+ }();
3117
+ }
3118
+ for (var Bt = 0; Bt < w.length; Bt++) {
3119
+ var dt = w[Bt];
3120
+ dt.getChild() == null && dt.setCenter(y[g.get(dt.id)], C[g.get(dt.id)]);
3121
+ }
3122
+ }, r.exports = s;
3123
+ }
3124
+ ),
3125
+ /***/
3126
+ 551: (
3127
+ /***/
3128
+ (r) => {
3129
+ r.exports = I;
3130
+ }
3131
+ )
3132
+ /******/
3133
+ }, A = {};
3134
+ function u(r) {
3135
+ var i = A[r];
3136
+ if (i !== void 0)
3137
+ return i.exports;
3138
+ var e = A[r] = {
3139
+ /******/
3140
+ // no module.id needed
3141
+ /******/
3142
+ // no module.loaded needed
3143
+ /******/
3144
+ exports: {}
3145
+ /******/
3146
+ };
3147
+ return G[r](e, e.exports, u), e.exports;
3148
+ }
3149
+ var d = u(45);
3150
+ return d;
3151
+ })()
3152
+ );
3153
+ });
3154
+ }(ue)), ue.exports;
3155
+ }
3156
+ var pi = ce.exports, _e;
3157
+ function mi() {
3158
+ return _e || (_e = 1, function(N, U) {
3159
+ (function(I, G) {
3160
+ N.exports = G(fi());
3161
+ })(pi, function(I) {
3162
+ return (
3163
+ /******/
3164
+ (() => {
3165
+ var G = {
3166
+ /***/
3167
+ 658: (
3168
+ /***/
3169
+ (r) => {
3170
+ r.exports = Object.assign != null ? Object.assign.bind(Object) : function(i) {
3171
+ for (var e = arguments.length, a = Array(e > 1 ? e - 1 : 0), o = 1; o < e; o++)
3172
+ a[o - 1] = arguments[o];
3173
+ return a.forEach(function(f) {
3174
+ Object.keys(f).forEach(function(t) {
3175
+ return i[t] = f[t];
3176
+ });
3177
+ }), i;
3178
+ };
3179
+ }
3180
+ ),
3181
+ /***/
3182
+ 548: (
3183
+ /***/
3184
+ (r, i, e) => {
3185
+ var a = /* @__PURE__ */ function() {
3186
+ function t(h, s) {
3187
+ var c = [], l = !0, T = !1, g = void 0;
3188
+ try {
3189
+ for (var y = h[Symbol.iterator](), C; !(l = (C = y.next()).done) && (c.push(C.value), !(s && c.length === s)); l = !0)
3190
+ ;
3191
+ } catch (w) {
3192
+ T = !0, g = w;
3193
+ } finally {
3194
+ try {
3195
+ !l && y.return && y.return();
3196
+ } finally {
3197
+ if (T) throw g;
3198
+ }
3199
+ }
3200
+ return c;
3201
+ }
3202
+ return function(h, s) {
3203
+ if (Array.isArray(h))
3204
+ return h;
3205
+ if (Symbol.iterator in Object(h))
3206
+ return t(h, s);
3207
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
3208
+ };
3209
+ }(), o = e(140).layoutBase.LinkedList, f = {};
3210
+ f.getTopMostNodes = function(t) {
3211
+ for (var h = {}, s = 0; s < t.length; s++)
3212
+ h[t[s].id()] = !0;
3213
+ var c = t.filter(function(l, T) {
3214
+ typeof l == "number" && (l = T);
3215
+ for (var g = l.parent()[0]; g != null; ) {
3216
+ if (h[g.id()])
3217
+ return !1;
3218
+ g = g.parent()[0];
3219
+ }
3220
+ return !0;
3221
+ });
3222
+ return c;
3223
+ }, f.connectComponents = function(t, h, s, c) {
3224
+ var l = new o(), T = /* @__PURE__ */ new Set(), g = [], y = void 0, C = void 0, w = void 0, S = !1, k = 1, Y = [], H = [], V = function() {
3225
+ var M = t.collection();
3226
+ H.push(M);
3227
+ var it = s[0], n = t.collection();
3228
+ n.merge(it).merge(it.descendants().intersection(h)), g.push(it), n.forEach(function(m) {
3229
+ l.push(m), T.add(m), M.merge(m);
3230
+ });
3231
+ for (var E = function() {
3232
+ it = l.shift();
3233
+ var m = t.collection();
3234
+ it.neighborhood().nodes().forEach(function(x) {
3235
+ h.intersection(it.edgesWith(x)).length > 0 && m.merge(x);
3236
+ });
3237
+ for (var v = 0; v < m.length; v++) {
3238
+ var D = m[v];
3239
+ if (y = s.intersection(D.union(D.ancestors())), y != null && !T.has(y[0])) {
3240
+ var _ = y.union(y.descendants());
3241
+ _.forEach(function(x) {
3242
+ l.push(x), T.add(x), M.merge(x), s.has(x) && g.push(x);
3243
+ });
3244
+ }
3245
+ }
3246
+ }; l.length != 0; )
3247
+ E();
3248
+ if (M.forEach(function(m) {
3249
+ h.intersection(m.connectedEdges()).forEach(function(v) {
3250
+ M.has(v.source()) && M.has(v.target()) && M.merge(v);
3251
+ });
3252
+ }), g.length == s.length && (S = !0), !S || S && k > 1) {
3253
+ C = g[0], w = C.connectedEdges().length, g.forEach(function(m) {
3254
+ m.connectedEdges().length < w && (w = m.connectedEdges().length, C = m);
3255
+ }), Y.push(C.id());
3256
+ var p = t.collection();
3257
+ p.merge(g[0]), g.forEach(function(m) {
3258
+ p.merge(m);
3259
+ }), g = [], s = s.difference(p), k++;
3260
+ }
3261
+ };
3262
+ do
3263
+ V();
3264
+ while (!S);
3265
+ return c && Y.length > 0 && c.set("dummy" + (c.size + 1), Y), H;
3266
+ }, f.relocateComponent = function(t, h, s) {
3267
+ if (!s.fixedNodeConstraint) {
3268
+ var c = Number.POSITIVE_INFINITY, l = Number.NEGATIVE_INFINITY, T = Number.POSITIVE_INFINITY, g = Number.NEGATIVE_INFINITY;
3269
+ if (s.quality == "draft") {
3270
+ var y = !0, C = !1, w = void 0;
3271
+ try {
3272
+ for (var S = h.nodeIndexes[Symbol.iterator](), k; !(y = (k = S.next()).done); y = !0) {
3273
+ var Y = k.value, H = a(Y, 2), V = H[0], M = H[1], it = s.cy.getElementById(V);
3274
+ if (it) {
3275
+ var n = it.boundingBox(), E = h.xCoords[M] - n.w / 2, p = h.xCoords[M] + n.w / 2, m = h.yCoords[M] - n.h / 2, v = h.yCoords[M] + n.h / 2;
3276
+ E < c && (c = E), p > l && (l = p), m < T && (T = m), v > g && (g = v);
3277
+ }
3278
+ }
3279
+ } catch (X) {
3280
+ C = !0, w = X;
3281
+ } finally {
3282
+ try {
3283
+ !y && S.return && S.return();
3284
+ } finally {
3285
+ if (C)
3286
+ throw w;
3287
+ }
3288
+ }
3289
+ var D = t.x - (l + c) / 2, _ = t.y - (g + T) / 2;
3290
+ h.xCoords = h.xCoords.map(function(X) {
3291
+ return X + D;
3292
+ }), h.yCoords = h.yCoords.map(function(X) {
3293
+ return X + _;
3294
+ });
3295
+ } else {
3296
+ Object.keys(h).forEach(function(X) {
3297
+ var B = h[X], W = B.getRect().x, z = B.getRect().x + B.getRect().width, Z = B.getRect().y, P = B.getRect().y + B.getRect().height;
3298
+ W < c && (c = W), z > l && (l = z), Z < T && (T = Z), P > g && (g = P);
3299
+ });
3300
+ var x = t.x - (l + c) / 2, F = t.y - (g + T) / 2;
3301
+ Object.keys(h).forEach(function(X) {
3302
+ var B = h[X];
3303
+ B.setCenter(B.getCenterX() + x, B.getCenterY() + F);
3304
+ });
3305
+ }
3306
+ }
3307
+ }, f.calcBoundingBox = function(t, h, s, c) {
3308
+ for (var l = Number.MAX_SAFE_INTEGER, T = Number.MIN_SAFE_INTEGER, g = Number.MAX_SAFE_INTEGER, y = Number.MIN_SAFE_INTEGER, C = void 0, w = void 0, S = void 0, k = void 0, Y = t.descendants().not(":parent"), H = Y.length, V = 0; V < H; V++) {
3309
+ var M = Y[V];
3310
+ C = h[c.get(M.id())] - M.width() / 2, w = h[c.get(M.id())] + M.width() / 2, S = s[c.get(M.id())] - M.height() / 2, k = s[c.get(M.id())] + M.height() / 2, l > C && (l = C), T < w && (T = w), g > S && (g = S), y < k && (y = k);
3311
+ }
3312
+ var it = {};
3313
+ return it.topLeftX = l, it.topLeftY = g, it.width = T - l, it.height = y - g, it;
3314
+ }, f.calcParentsWithoutChildren = function(t, h) {
3315
+ var s = t.collection();
3316
+ return h.nodes(":parent").forEach(function(c) {
3317
+ var l = !1;
3318
+ c.children().forEach(function(T) {
3319
+ T.css("display") != "none" && (l = !0);
3320
+ }), l || s.merge(c);
3321
+ }), s;
3322
+ }, r.exports = f;
3323
+ }
3324
+ ),
3325
+ /***/
3326
+ 816: (
3327
+ /***/
3328
+ (r, i, e) => {
3329
+ var a = e(548), o = e(140).CoSELayout, f = e(140).CoSENode, t = e(140).layoutBase.PointD, h = e(140).layoutBase.DimensionD, s = e(140).layoutBase.LayoutConstants, c = e(140).layoutBase.FDLayoutConstants, l = e(140).CoSEConstants, T = function(g, y) {
3330
+ var C = g.cy, w = g.eles, S = w.nodes(), k = w.edges(), Y = void 0, H = void 0, V = void 0, M = {};
3331
+ g.randomize && (Y = y.nodeIndexes, H = y.xCoords, V = y.yCoords);
3332
+ var it = function(x) {
3333
+ return typeof x == "function";
3334
+ }, n = function(x, F) {
3335
+ return it(x) ? x(F) : x;
3336
+ }, E = a.calcParentsWithoutChildren(C, w), p = function x(F, X, B, W) {
3337
+ for (var z = X.length, Z = 0; Z < z; Z++) {
3338
+ var P = X[Z], O = null;
3339
+ P.intersection(E).length == 0 && (O = P.children());
3340
+ var b = void 0, q = P.layoutDimensions({
3341
+ nodeDimensionsIncludeLabels: W.nodeDimensionsIncludeLabels
3342
+ });
3343
+ if (P.outerWidth() != null && P.outerHeight() != null)
3344
+ if (W.randomize)
3345
+ if (!P.isParent())
3346
+ b = F.add(new f(B.graphManager, new t(H[Y.get(P.id())] - q.w / 2, V[Y.get(P.id())] - q.h / 2), new h(parseFloat(q.w), parseFloat(q.h))));
3347
+ else {
3348
+ var et = a.calcBoundingBox(P, H, V, Y);
3349
+ P.intersection(E).length == 0 ? b = F.add(new f(B.graphManager, new t(et.topLeftX, et.topLeftY), new h(et.width, et.height))) : b = F.add(new f(B.graphManager, new t(et.topLeftX, et.topLeftY), new h(parseFloat(q.w), parseFloat(q.h))));
3350
+ }
3351
+ else
3352
+ b = F.add(new f(B.graphManager, new t(P.position("x") - q.w / 2, P.position("y") - q.h / 2), new h(parseFloat(q.w), parseFloat(q.h))));
3353
+ else
3354
+ b = F.add(new f(this.graphManager));
3355
+ if (b.id = P.data("id"), b.nodeRepulsion = n(W.nodeRepulsion, P), b.paddingLeft = parseInt(P.css("padding")), b.paddingTop = parseInt(P.css("padding")), b.paddingRight = parseInt(P.css("padding")), b.paddingBottom = parseInt(P.css("padding")), W.nodeDimensionsIncludeLabels && (b.labelWidth = P.boundingBox({ includeLabels: !0, includeNodes: !1, includeOverlays: !1 }).w, b.labelHeight = P.boundingBox({ includeLabels: !0, includeNodes: !1, includeOverlays: !1 }).h, b.labelPosVertical = P.css("text-valign"), b.labelPosHorizontal = P.css("text-halign")), M[P.data("id")] = b, isNaN(b.rect.x) && (b.rect.x = 0), isNaN(b.rect.y) && (b.rect.y = 0), O != null && O.length > 0) {
3356
+ var mt = void 0;
3357
+ mt = B.getGraphManager().add(B.newGraph(), b), x(mt, O, B, W);
3358
+ }
3359
+ }
3360
+ }, m = function(x, F, X) {
3361
+ for (var B = 0, W = 0, z = 0; z < X.length; z++) {
3362
+ var Z = X[z], P = M[Z.data("source")], O = M[Z.data("target")];
3363
+ if (P && O && P !== O && P.getEdgesBetween(O).length == 0) {
3364
+ var b = F.add(x.newEdge(), P, O);
3365
+ b.id = Z.id(), b.idealLength = n(g.idealEdgeLength, Z), b.edgeElasticity = n(g.edgeElasticity, Z), B += b.idealLength, W++;
3366
+ }
3367
+ }
3368
+ g.idealEdgeLength != null && (W > 0 ? l.DEFAULT_EDGE_LENGTH = c.DEFAULT_EDGE_LENGTH = B / W : it(g.idealEdgeLength) ? l.DEFAULT_EDGE_LENGTH = c.DEFAULT_EDGE_LENGTH = 50 : l.DEFAULT_EDGE_LENGTH = c.DEFAULT_EDGE_LENGTH = g.idealEdgeLength, l.MIN_REPULSION_DIST = c.MIN_REPULSION_DIST = c.DEFAULT_EDGE_LENGTH / 10, l.DEFAULT_RADIAL_SEPARATION = c.DEFAULT_EDGE_LENGTH);
3369
+ }, v = function(x, F) {
3370
+ F.fixedNodeConstraint && (x.constraints.fixedNodeConstraint = F.fixedNodeConstraint), F.alignmentConstraint && (x.constraints.alignmentConstraint = F.alignmentConstraint), F.relativePlacementConstraint && (x.constraints.relativePlacementConstraint = F.relativePlacementConstraint);
3371
+ };
3372
+ g.nestingFactor != null && (l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = g.nestingFactor), g.gravity != null && (l.DEFAULT_GRAVITY_STRENGTH = c.DEFAULT_GRAVITY_STRENGTH = g.gravity), g.numIter != null && (l.MAX_ITERATIONS = c.MAX_ITERATIONS = g.numIter), g.gravityRange != null && (l.DEFAULT_GRAVITY_RANGE_FACTOR = c.DEFAULT_GRAVITY_RANGE_FACTOR = g.gravityRange), g.gravityCompound != null && (l.DEFAULT_COMPOUND_GRAVITY_STRENGTH = c.DEFAULT_COMPOUND_GRAVITY_STRENGTH = g.gravityCompound), g.gravityRangeCompound != null && (l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = g.gravityRangeCompound), g.initialEnergyOnIncremental != null && (l.DEFAULT_COOLING_FACTOR_INCREMENTAL = c.DEFAULT_COOLING_FACTOR_INCREMENTAL = g.initialEnergyOnIncremental), g.tilingCompareBy != null && (l.TILING_COMPARE_BY = g.tilingCompareBy), g.quality == "proof" ? s.QUALITY = 2 : s.QUALITY = 0, l.NODE_DIMENSIONS_INCLUDE_LABELS = c.NODE_DIMENSIONS_INCLUDE_LABELS = s.NODE_DIMENSIONS_INCLUDE_LABELS = g.nodeDimensionsIncludeLabels, l.DEFAULT_INCREMENTAL = c.DEFAULT_INCREMENTAL = s.DEFAULT_INCREMENTAL = !g.randomize, l.ANIMATE = c.ANIMATE = s.ANIMATE = g.animate, l.TILE = g.tile, l.TILING_PADDING_VERTICAL = typeof g.tilingPaddingVertical == "function" ? g.tilingPaddingVertical.call() : g.tilingPaddingVertical, l.TILING_PADDING_HORIZONTAL = typeof g.tilingPaddingHorizontal == "function" ? g.tilingPaddingHorizontal.call() : g.tilingPaddingHorizontal, l.DEFAULT_INCREMENTAL = c.DEFAULT_INCREMENTAL = s.DEFAULT_INCREMENTAL = !0, l.PURE_INCREMENTAL = !g.randomize, s.DEFAULT_UNIFORM_LEAF_NODE_SIZES = g.uniformNodeDimensions, g.step == "transformed" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, l.ENFORCE_CONSTRAINTS = !1, l.APPLY_LAYOUT = !1), g.step == "enforced" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, l.ENFORCE_CONSTRAINTS = !0, l.APPLY_LAYOUT = !1), g.step == "cose" && (l.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, l.ENFORCE_CONSTRAINTS = !1, l.APPLY_LAYOUT = !0), g.step == "all" && (g.randomize ? l.TRANSFORM_ON_CONSTRAINT_HANDLING = !0 : l.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, l.ENFORCE_CONSTRAINTS = !0, l.APPLY_LAYOUT = !0), g.fixedNodeConstraint || g.alignmentConstraint || g.relativePlacementConstraint ? l.TREE_REDUCTION_ON_INCREMENTAL = !1 : l.TREE_REDUCTION_ON_INCREMENTAL = !0;
3373
+ var D = new o(), _ = D.newGraphManager();
3374
+ return p(_.addRoot(), a.getTopMostNodes(S), D, g), m(D, _, k), v(D, g), D.runLayout(), M;
3375
+ };
3376
+ r.exports = { coseLayout: T };
3377
+ }
3378
+ ),
3379
+ /***/
3380
+ 212: (
3381
+ /***/
3382
+ (r, i, e) => {
3383
+ var a = /* @__PURE__ */ function() {
3384
+ function y(C, w) {
3385
+ for (var S = 0; S < w.length; S++) {
3386
+ var k = w[S];
3387
+ k.enumerable = k.enumerable || !1, k.configurable = !0, "value" in k && (k.writable = !0), Object.defineProperty(C, k.key, k);
3388
+ }
3389
+ }
3390
+ return function(C, w, S) {
3391
+ return w && y(C.prototype, w), S && y(C, S), C;
3392
+ };
3393
+ }();
3394
+ function o(y, C) {
3395
+ if (!(y instanceof C))
3396
+ throw new TypeError("Cannot call a class as a function");
3397
+ }
3398
+ var f = e(658), t = e(548), h = e(657), s = h.spectralLayout, c = e(816), l = c.coseLayout, T = Object.freeze({
3399
+ // 'draft', 'default' or 'proof'
3400
+ // - 'draft' only applies spectral layout
3401
+ // - 'default' improves the quality with subsequent CoSE layout (fast cooling rate)
3402
+ // - 'proof' improves the quality with subsequent CoSE layout (slow cooling rate)
3403
+ quality: "default",
3404
+ // Use random node positions at beginning of layout
3405
+ // if this is set to false, then quality option must be "proof"
3406
+ randomize: !0,
3407
+ // Whether or not to animate the layout
3408
+ animate: !0,
3409
+ // Duration of animation in ms, if enabled
3410
+ animationDuration: 1e3,
3411
+ // Easing of animation, if enabled
3412
+ animationEasing: void 0,
3413
+ // Fit the viewport to the repositioned nodes
3414
+ fit: !0,
3415
+ // Padding around layout
3416
+ padding: 30,
3417
+ // Whether to include labels in node dimensions. Valid in "proof" quality
3418
+ nodeDimensionsIncludeLabels: !1,
3419
+ // Whether or not simple nodes (non-compound nodes) are of uniform dimensions
3420
+ uniformNodeDimensions: !1,
3421
+ // Whether to pack disconnected components - valid only if randomize: true
3422
+ packComponents: !0,
3423
+ // Layout step - all, transformed, enforced, cose - for debug purpose only
3424
+ step: "all",
3425
+ /* spectral layout options */
3426
+ // False for random, true for greedy
3427
+ samplingType: !0,
3428
+ // Sample size to construct distance matrix
3429
+ sampleSize: 25,
3430
+ // Separation amount between nodes
3431
+ nodeSeparation: 75,
3432
+ // Power iteration tolerance
3433
+ piTol: 1e-7,
3434
+ /* CoSE layout options */
3435
+ // Node repulsion (non overlapping) multiplier
3436
+ nodeRepulsion: function(y) {
3437
+ return 4500;
3438
+ },
3439
+ // Ideal edge (non nested) length
3440
+ idealEdgeLength: function(y) {
3441
+ return 50;
3442
+ },
3443
+ // Divisor to compute edge forces
3444
+ edgeElasticity: function(y) {
3445
+ return 0.45;
3446
+ },
3447
+ // Nesting factor (multiplier) to compute ideal edge length for nested edges
3448
+ nestingFactor: 0.1,
3449
+ // Gravity force (constant)
3450
+ gravity: 0.25,
3451
+ // Maximum number of iterations to perform
3452
+ numIter: 2500,
3453
+ // For enabling tiling
3454
+ tile: !0,
3455
+ // The function that specifies the criteria for comparing nodes while sorting them during tiling operation.
3456
+ // Takes the node id as a parameter and the default tiling operation is perfomed when this option is not set.
3457
+ tilingCompareBy: void 0,
3458
+ // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
3459
+ tilingPaddingVertical: 10,
3460
+ // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
3461
+ tilingPaddingHorizontal: 10,
3462
+ // Gravity range (constant) for compounds
3463
+ gravityRangeCompound: 1.5,
3464
+ // Gravity force (constant) for compounds
3465
+ gravityCompound: 1,
3466
+ // Gravity range (constant)
3467
+ gravityRange: 3.8,
3468
+ // Initial cooling factor for incremental layout
3469
+ initialEnergyOnIncremental: 0.3,
3470
+ /* constraint options */
3471
+ // Fix required nodes to predefined positions
3472
+ // [{nodeId: 'n1', position: {x: 100, y: 200}, {...}]
3473
+ fixedNodeConstraint: void 0,
3474
+ // Align required nodes in vertical/horizontal direction
3475
+ // {vertical: [['n1', 'n2')], ['n3', 'n4']], horizontal: ['n2', 'n4']}
3476
+ alignmentConstraint: void 0,
3477
+ // Place two nodes relatively in vertical/horizontal direction
3478
+ // [{top: 'n1', bottom: 'n2', gap: 100}, {left: 'n3', right: 'n4', gap: 75}]
3479
+ relativePlacementConstraint: void 0,
3480
+ /* layout event callbacks */
3481
+ ready: function() {
3482
+ },
3483
+ // on layoutready
3484
+ stop: function() {
3485
+ }
3486
+ // on layoutstop
3487
+ }), g = function() {
3488
+ function y(C) {
3489
+ o(this, y), this.options = f({}, T, C);
3490
+ }
3491
+ return a(y, [{
3492
+ key: "run",
3493
+ value: function() {
3494
+ var C = this, w = this.options, S = w.cy, k = w.eles, Y = [], H = [], V = void 0, M = [];
3495
+ w.fixedNodeConstraint && (!Array.isArray(w.fixedNodeConstraint) || w.fixedNodeConstraint.length == 0) && (w.fixedNodeConstraint = void 0), w.alignmentConstraint && (w.alignmentConstraint.vertical && (!Array.isArray(w.alignmentConstraint.vertical) || w.alignmentConstraint.vertical.length == 0) && (w.alignmentConstraint.vertical = void 0), w.alignmentConstraint.horizontal && (!Array.isArray(w.alignmentConstraint.horizontal) || w.alignmentConstraint.horizontal.length == 0) && (w.alignmentConstraint.horizontal = void 0)), w.relativePlacementConstraint && (!Array.isArray(w.relativePlacementConstraint) || w.relativePlacementConstraint.length == 0) && (w.relativePlacementConstraint = void 0);
3496
+ var it = w.fixedNodeConstraint || w.alignmentConstraint || w.relativePlacementConstraint;
3497
+ it && (w.tile = !1, w.packComponents = !1);
3498
+ var n = void 0, E = !1;
3499
+ if (S.layoutUtilities && w.packComponents && (n = S.layoutUtilities("get"), n || (n = S.layoutUtilities()), E = !0), k.nodes().length > 0)
3500
+ if (E) {
3501
+ var p = t.getTopMostNodes(w.eles.nodes());
3502
+ if (V = t.connectComponents(S, w.eles, p), V.forEach(function(Q) {
3503
+ var nt = Q.boundingBox();
3504
+ M.push({ x: nt.x1 + nt.w / 2, y: nt.y1 + nt.h / 2 });
3505
+ }), w.randomize && V.forEach(function(Q) {
3506
+ w.eles = Q, Y.push(s(w));
3507
+ }), w.quality == "default" || w.quality == "proof") {
3508
+ var m = S.collection();
3509
+ if (w.tile) {
3510
+ var v = /* @__PURE__ */ new Map(), D = [], _ = [], x = 0, F = { nodeIndexes: v, xCoords: D, yCoords: _ }, X = [];
3511
+ if (V.forEach(function(Q, nt) {
3512
+ Q.edges().length == 0 && (Q.nodes().forEach(function(vt, st) {
3513
+ m.merge(Q.nodes()[st]), vt.isParent() || (F.nodeIndexes.set(Q.nodes()[st].id(), x++), F.xCoords.push(Q.nodes()[0].position().x), F.yCoords.push(Q.nodes()[0].position().y));
3514
+ }), X.push(nt));
3515
+ }), m.length > 1) {
3516
+ var B = m.boundingBox();
3517
+ M.push({ x: B.x1 + B.w / 2, y: B.y1 + B.h / 2 }), V.push(m), Y.push(F);
3518
+ for (var W = X.length - 1; W >= 0; W--)
3519
+ V.splice(X[W], 1), Y.splice(X[W], 1), M.splice(X[W], 1);
3520
+ }
3521
+ }
3522
+ V.forEach(function(Q, nt) {
3523
+ w.eles = Q, H.push(l(w, Y[nt])), t.relocateComponent(M[nt], H[nt], w);
3524
+ });
3525
+ } else
3526
+ V.forEach(function(Q, nt) {
3527
+ t.relocateComponent(M[nt], Y[nt], w);
3528
+ });
3529
+ var z = /* @__PURE__ */ new Set();
3530
+ if (V.length > 1) {
3531
+ var Z = [], P = k.filter(function(Q) {
3532
+ return Q.css("display") == "none";
3533
+ });
3534
+ V.forEach(function(Q, nt) {
3535
+ var vt = void 0;
3536
+ if (w.quality == "draft" && (vt = Y[nt].nodeIndexes), Q.nodes().not(P).length > 0) {
3537
+ var st = {};
3538
+ st.edges = [], st.nodes = [];
3539
+ var It = void 0;
3540
+ Q.nodes().not(P).forEach(function(Lt) {
3541
+ if (w.quality == "draft")
3542
+ if (!Lt.isParent())
3543
+ It = vt.get(Lt.id()), st.nodes.push({ x: Y[nt].xCoords[It] - Lt.boundingbox().w / 2, y: Y[nt].yCoords[It] - Lt.boundingbox().h / 2, width: Lt.boundingbox().w, height: Lt.boundingbox().h });
3544
+ else {
3545
+ var Tt = t.calcBoundingBox(Lt, Y[nt].xCoords, Y[nt].yCoords, vt);
3546
+ st.nodes.push({ x: Tt.topLeftX, y: Tt.topLeftY, width: Tt.width, height: Tt.height });
3547
+ }
3548
+ else
3549
+ H[nt][Lt.id()] && st.nodes.push({ x: H[nt][Lt.id()].getLeft(), y: H[nt][Lt.id()].getTop(), width: H[nt][Lt.id()].getWidth(), height: H[nt][Lt.id()].getHeight() });
3550
+ }), Q.edges().forEach(function(Lt) {
3551
+ var Tt = Lt.source(), At = Lt.target();
3552
+ if (Tt.css("display") != "none" && At.css("display") != "none")
3553
+ if (w.quality == "draft") {
3554
+ var Ht = vt.get(Tt.id()), Rt = vt.get(At.id()), bt = [], Ft = [];
3555
+ if (Tt.isParent()) {
3556
+ var zt = t.calcBoundingBox(Tt, Y[nt].xCoords, Y[nt].yCoords, vt);
3557
+ bt.push(zt.topLeftX + zt.width / 2), bt.push(zt.topLeftY + zt.height / 2);
3558
+ } else
3559
+ bt.push(Y[nt].xCoords[Ht]), bt.push(Y[nt].yCoords[Ht]);
3560
+ if (At.isParent()) {
3561
+ var Pt = t.calcBoundingBox(At, Y[nt].xCoords, Y[nt].yCoords, vt);
3562
+ Ft.push(Pt.topLeftX + Pt.width / 2), Ft.push(Pt.topLeftY + Pt.height / 2);
3563
+ } else
3564
+ Ft.push(Y[nt].xCoords[Rt]), Ft.push(Y[nt].yCoords[Rt]);
3565
+ st.edges.push({ startX: bt[0], startY: bt[1], endX: Ft[0], endY: Ft[1] });
3566
+ } else
3567
+ H[nt][Tt.id()] && H[nt][At.id()] && st.edges.push({ startX: H[nt][Tt.id()].getCenterX(), startY: H[nt][Tt.id()].getCenterY(), endX: H[nt][At.id()].getCenterX(), endY: H[nt][At.id()].getCenterY() });
3568
+ }), st.nodes.length > 0 && (Z.push(st), z.add(nt));
3569
+ }
3570
+ });
3571
+ var O = n.packComponents(Z, w.randomize).shifts;
3572
+ if (w.quality == "draft")
3573
+ Y.forEach(function(Q, nt) {
3574
+ var vt = Q.xCoords.map(function(It) {
3575
+ return It + O[nt].dx;
3576
+ }), st = Q.yCoords.map(function(It) {
3577
+ return It + O[nt].dy;
3578
+ });
3579
+ Q.xCoords = vt, Q.yCoords = st;
3580
+ });
3581
+ else {
3582
+ var b = 0;
3583
+ z.forEach(function(Q) {
3584
+ Object.keys(H[Q]).forEach(function(nt) {
3585
+ var vt = H[Q][nt];
3586
+ vt.setCenter(vt.getCenterX() + O[b].dx, vt.getCenterY() + O[b].dy);
3587
+ }), b++;
3588
+ });
3589
+ }
3590
+ }
3591
+ } else {
3592
+ var q = w.eles.boundingBox();
3593
+ if (M.push({ x: q.x1 + q.w / 2, y: q.y1 + q.h / 2 }), w.randomize) {
3594
+ var et = s(w);
3595
+ Y.push(et);
3596
+ }
3597
+ w.quality == "default" || w.quality == "proof" ? (H.push(l(w, Y[0])), t.relocateComponent(M[0], H[0], w)) : t.relocateComponent(M[0], Y[0], w);
3598
+ }
3599
+ var mt = function(Q, nt) {
3600
+ if (w.quality == "default" || w.quality == "proof") {
3601
+ typeof Q == "number" && (Q = nt);
3602
+ var vt = void 0, st = void 0, It = Q.data("id");
3603
+ return H.forEach(function(Tt) {
3604
+ It in Tt && (vt = { x: Tt[It].getRect().getCenterX(), y: Tt[It].getRect().getCenterY() }, st = Tt[It]);
3605
+ }), w.nodeDimensionsIncludeLabels && (st.labelWidth && (st.labelPosHorizontal == "left" ? vt.x += st.labelWidth / 2 : st.labelPosHorizontal == "right" && (vt.x -= st.labelWidth / 2)), st.labelHeight && (st.labelPosVertical == "top" ? vt.y += st.labelHeight / 2 : st.labelPosVertical == "bottom" && (vt.y -= st.labelHeight / 2))), vt == null && (vt = { x: Q.position("x"), y: Q.position("y") }), {
3606
+ x: vt.x,
3607
+ y: vt.y
3608
+ };
3609
+ } else {
3610
+ var Lt = void 0;
3611
+ return Y.forEach(function(Tt) {
3612
+ var At = Tt.nodeIndexes.get(Q.id());
3613
+ At != null && (Lt = { x: Tt.xCoords[At], y: Tt.yCoords[At] });
3614
+ }), Lt == null && (Lt = { x: Q.position("x"), y: Q.position("y") }), {
3615
+ x: Lt.x,
3616
+ y: Lt.y
3617
+ };
3618
+ }
3619
+ };
3620
+ if (w.quality == "default" || w.quality == "proof" || w.randomize) {
3621
+ var j = t.calcParentsWithoutChildren(S, k), xt = k.filter(function(Q) {
3622
+ return Q.css("display") == "none";
3623
+ });
3624
+ w.eles = k.not(xt), k.nodes().not(":parent").not(xt).layoutPositions(C, w, mt), j.length > 0 && j.forEach(function(Q) {
3625
+ Q.position(mt(Q));
3626
+ });
3627
+ } else
3628
+ console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.");
3629
+ }
3630
+ }]), y;
3631
+ }();
3632
+ r.exports = g;
3633
+ }
3634
+ ),
3635
+ /***/
3636
+ 657: (
3637
+ /***/
3638
+ (r, i, e) => {
3639
+ var a = e(548), o = e(140).layoutBase.Matrix, f = e(140).layoutBase.SVD, t = function(h) {
3640
+ var s = h.cy, c = h.eles, l = c.nodes(), T = c.nodes(":parent"), g = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), w = [], S = [], k = [], Y = [], H = [], V = [], M = [], it = [], n = void 0, E = 1e8, p = 1e-9, m = h.piTol, v = h.samplingType, D = h.nodeSeparation, _ = void 0, x = function() {
3641
+ for (var dt = 0, L = 0, R = !1; L < _; ) {
3642
+ dt = Math.floor(Math.random() * n), R = !1;
3643
+ for (var $ = 0; $ < L; $++)
3644
+ if (Y[$] == dt) {
3645
+ R = !0;
3646
+ break;
3647
+ }
3648
+ if (!R)
3649
+ Y[L] = dt, L++;
3650
+ else
3651
+ continue;
3652
+ }
3653
+ }, F = function(dt, L, R) {
3654
+ for (var $ = [], J = 0, K = 0, ft = 0, ht = void 0, tt = [], gt = 0, rt = 1, Et = 0; Et < n; Et++)
3655
+ tt[Et] = E;
3656
+ for ($[K] = dt, tt[dt] = 0; K >= J; ) {
3657
+ ft = $[J++];
3658
+ for (var yt = w[ft], Mt = 0; Mt < yt.length; Mt++)
3659
+ ht = y.get(yt[Mt]), tt[ht] == E && (tt[ht] = tt[ft] + 1, $[++K] = ht);
3660
+ V[ft][L] = tt[ft] * D;
3661
+ }
3662
+ if (R) {
3663
+ for (var lt = 0; lt < n; lt++)
3664
+ V[lt][L] < H[lt] && (H[lt] = V[lt][L]);
3665
+ for (var ot = 0; ot < n; ot++)
3666
+ H[ot] > gt && (gt = H[ot], rt = ot);
3667
+ }
3668
+ return rt;
3669
+ }, X = function(dt) {
3670
+ var L = void 0;
3671
+ if (dt) {
3672
+ L = Math.floor(Math.random() * n);
3673
+ for (var R = 0; R < n; R++)
3674
+ H[R] = E;
3675
+ for (var $ = 0; $ < _; $++)
3676
+ Y[$] = L, L = F(L, $, dt);
3677
+ } else {
3678
+ x();
3679
+ for (var J = 0; J < _; J++)
3680
+ F(Y[J], J, dt);
3681
+ }
3682
+ for (var K = 0; K < n; K++)
3683
+ for (var ft = 0; ft < _; ft++)
3684
+ V[K][ft] *= V[K][ft];
3685
+ for (var ht = 0; ht < _; ht++)
3686
+ M[ht] = [];
3687
+ for (var tt = 0; tt < _; tt++)
3688
+ for (var gt = 0; gt < _; gt++)
3689
+ M[tt][gt] = V[Y[gt]][tt];
3690
+ }, B = function() {
3691
+ for (var dt = f.svd(M), L = dt.S, R = dt.U, $ = dt.V, J = L[0] * L[0] * L[0], K = [], ft = 0; ft < _; ft++) {
3692
+ K[ft] = [];
3693
+ for (var ht = 0; ht < _; ht++)
3694
+ K[ft][ht] = 0, ft == ht && (K[ft][ht] = L[ft] / (L[ft] * L[ft] + J / (L[ft] * L[ft])));
3695
+ }
3696
+ it = o.multMat(o.multMat($, K), o.transpose(R));
3697
+ }, W = function() {
3698
+ for (var dt = void 0, L = void 0, R = [], $ = [], J = [], K = [], ft = 0; ft < n; ft++)
3699
+ R[ft] = Math.random(), $[ft] = Math.random();
3700
+ R = o.normalize(R), $ = o.normalize($);
3701
+ for (var ht = p, tt = p, gt = void 0; ; ) {
3702
+ for (var rt = 0; rt < n; rt++)
3703
+ J[rt] = R[rt];
3704
+ if (R = o.multGamma(o.multL(o.multGamma(J), V, it)), dt = o.dotProduct(J, R), R = o.normalize(R), ht = o.dotProduct(J, R), gt = Math.abs(ht / tt), gt <= 1 + m && gt >= 1)
3705
+ break;
3706
+ tt = ht;
3707
+ }
3708
+ for (var Et = 0; Et < n; Et++)
3709
+ J[Et] = R[Et];
3710
+ for (tt = p; ; ) {
3711
+ for (var yt = 0; yt < n; yt++)
3712
+ K[yt] = $[yt];
3713
+ if (K = o.minusOp(K, o.multCons(J, o.dotProduct(J, K))), $ = o.multGamma(o.multL(o.multGamma(K), V, it)), L = o.dotProduct(K, $), $ = o.normalize($), ht = o.dotProduct(K, $), gt = Math.abs(ht / tt), gt <= 1 + m && gt >= 1)
3714
+ break;
3715
+ tt = ht;
3716
+ }
3717
+ for (var Mt = 0; Mt < n; Mt++)
3718
+ K[Mt] = $[Mt];
3719
+ S = o.multCons(J, Math.sqrt(Math.abs(dt))), k = o.multCons(K, Math.sqrt(Math.abs(L)));
3720
+ };
3721
+ a.connectComponents(s, c, a.getTopMostNodes(l), g), T.forEach(function(dt) {
3722
+ a.connectComponents(s, c, a.getTopMostNodes(dt.descendants().intersection(c)), g);
3723
+ });
3724
+ for (var z = 0, Z = 0; Z < l.length; Z++)
3725
+ l[Z].isParent() || y.set(l[Z].id(), z++);
3726
+ var P = !0, O = !1, b = void 0;
3727
+ try {
3728
+ for (var q = g.keys()[Symbol.iterator](), et; !(P = (et = q.next()).done); P = !0) {
3729
+ var mt = et.value;
3730
+ y.set(mt, z++);
3731
+ }
3732
+ } catch (dt) {
3733
+ O = !0, b = dt;
3734
+ } finally {
3735
+ try {
3736
+ !P && q.return && q.return();
3737
+ } finally {
3738
+ if (O)
3739
+ throw b;
3740
+ }
3741
+ }
3742
+ for (var j = 0; j < y.size; j++)
3743
+ w[j] = [];
3744
+ T.forEach(function(dt) {
3745
+ for (var L = dt.children().intersection(c); L.nodes(":childless").length == 0; )
3746
+ L = L.nodes()[0].children().intersection(c);
3747
+ var R = 0, $ = L.nodes(":childless")[0].connectedEdges().length;
3748
+ L.nodes(":childless").forEach(function(J, K) {
3749
+ J.connectedEdges().length < $ && ($ = J.connectedEdges().length, R = K);
3750
+ }), C.set(dt.id(), L.nodes(":childless")[R].id());
3751
+ }), l.forEach(function(dt) {
3752
+ var L = void 0;
3753
+ dt.isParent() ? L = y.get(C.get(dt.id())) : L = y.get(dt.id()), dt.neighborhood().nodes().forEach(function(R) {
3754
+ c.intersection(dt.edgesWith(R)).length > 0 && (R.isParent() ? w[L].push(C.get(R.id())) : w[L].push(R.id()));
3755
+ });
3756
+ });
3757
+ var xt = function(dt) {
3758
+ var L = y.get(dt), R = void 0;
3759
+ g.get(dt).forEach(function($) {
3760
+ s.getElementById($).isParent() ? R = C.get($) : R = $, w[L].push(R), w[y.get(R)].push(dt);
3761
+ });
3762
+ }, Q = !0, nt = !1, vt = void 0;
3763
+ try {
3764
+ for (var st = g.keys()[Symbol.iterator](), It; !(Q = (It = st.next()).done); Q = !0) {
3765
+ var Lt = It.value;
3766
+ xt(Lt);
3767
+ }
3768
+ } catch (dt) {
3769
+ nt = !0, vt = dt;
3770
+ } finally {
3771
+ try {
3772
+ !Q && st.return && st.return();
3773
+ } finally {
3774
+ if (nt)
3775
+ throw vt;
3776
+ }
3777
+ }
3778
+ n = y.size;
3779
+ var Tt = void 0;
3780
+ if (n > 2) {
3781
+ _ = n < h.sampleSize ? n : h.sampleSize;
3782
+ for (var At = 0; At < n; At++)
3783
+ V[At] = [];
3784
+ for (var Ht = 0; Ht < _; Ht++)
3785
+ it[Ht] = [];
3786
+ return h.quality == "draft" || h.step == "all" ? (X(v), B(), W(), Tt = { nodeIndexes: y, xCoords: S, yCoords: k }) : (y.forEach(function(dt, L) {
3787
+ S.push(s.getElementById(L).position("x")), k.push(s.getElementById(L).position("y"));
3788
+ }), Tt = { nodeIndexes: y, xCoords: S, yCoords: k }), Tt;
3789
+ } else {
3790
+ var Rt = y.keys(), bt = s.getElementById(Rt.next().value), Ft = bt.position(), zt = bt.outerWidth();
3791
+ if (S.push(Ft.x), k.push(Ft.y), n == 2) {
3792
+ var Pt = s.getElementById(Rt.next().value), Bt = Pt.outerWidth();
3793
+ S.push(Ft.x + zt / 2 + Bt / 2 + h.idealEdgeLength), k.push(Ft.y);
3794
+ }
3795
+ return Tt = { nodeIndexes: y, xCoords: S, yCoords: k }, Tt;
3796
+ }
3797
+ };
3798
+ r.exports = { spectralLayout: t };
3799
+ }
3800
+ ),
3801
+ /***/
3802
+ 579: (
3803
+ /***/
3804
+ (r, i, e) => {
3805
+ var a = e(212), o = function(f) {
3806
+ f && f("layout", "fcose", a);
3807
+ };
3808
+ typeof cytoscape < "u" && o(cytoscape), r.exports = o;
3809
+ }
3810
+ ),
3811
+ /***/
3812
+ 140: (
3813
+ /***/
3814
+ (r) => {
3815
+ r.exports = I;
3816
+ }
3817
+ )
3818
+ /******/
3819
+ }, A = {};
3820
+ function u(r) {
3821
+ var i = A[r];
3822
+ if (i !== void 0)
3823
+ return i.exports;
3824
+ var e = A[r] = {
3825
+ /******/
3826
+ // no module.id needed
3827
+ /******/
3828
+ // no module.loaded needed
3829
+ /******/
3830
+ exports: {}
3831
+ /******/
3832
+ };
3833
+ return G[r](e, e.exports, u), e.exports;
3834
+ }
3835
+ var d = u(579);
3836
+ return d;
3837
+ })()
3838
+ );
3839
+ });
3840
+ }(ce)), ce.exports;
3841
+ }
3842
+ var vi = mi();
3843
+ const yi = /* @__PURE__ */ hi(vi);
3844
+ var Me = {
3845
+ L: "left",
3846
+ R: "right",
3847
+ T: "top",
3848
+ B: "bottom"
3849
+ }, xe = {
3850
+ L: /* @__PURE__ */ pt((N) => `${N},${N / 2} 0,${N} 0,0`, "L"),
3851
+ R: /* @__PURE__ */ pt((N) => `0,${N / 2} ${N},0 ${N},${N}`, "R"),
3852
+ T: /* @__PURE__ */ pt((N) => `0,0 ${N},0 ${N / 2},${N}`, "T"),
3853
+ B: /* @__PURE__ */ pt((N) => `${N / 2},0 ${N},${N} 0,${N}`, "B")
3854
+ }, ne = {
3855
+ L: /* @__PURE__ */ pt((N, U) => N - U + 2, "L"),
3856
+ R: /* @__PURE__ */ pt((N, U) => N - 2, "R"),
3857
+ T: /* @__PURE__ */ pt((N, U) => N - U + 2, "T"),
3858
+ B: /* @__PURE__ */ pt((N, U) => N - 2, "B")
3859
+ }, Ei = /* @__PURE__ */ pt(function(N) {
3860
+ return Xt(N) ? N === "L" ? "R" : "L" : N === "T" ? "B" : "T";
3861
+ }, "getOppositeArchitectureDirection"), De = /* @__PURE__ */ pt(function(N) {
3862
+ const U = N;
3863
+ return U === "L" || U === "R" || U === "T" || U === "B";
3864
+ }, "isArchitectureDirection"), Xt = /* @__PURE__ */ pt(function(N) {
3865
+ const U = N;
3866
+ return U === "L" || U === "R";
3867
+ }, "isArchitectureDirectionX"), Vt = /* @__PURE__ */ pt(function(N) {
3868
+ const U = N;
3869
+ return U === "T" || U === "B";
3870
+ }, "isArchitectureDirectionY"), ye = /* @__PURE__ */ pt(function(N, U) {
3871
+ const I = Xt(N) && Vt(U), G = Vt(N) && Xt(U);
3872
+ return I || G;
3873
+ }, "isArchitectureDirectionXY"), Ti = /* @__PURE__ */ pt(function(N) {
3874
+ const U = N[0], I = N[1], G = Xt(U) && Vt(I), A = Vt(U) && Xt(I);
3875
+ return G || A;
3876
+ }, "isArchitecturePairXY"), Ni = /* @__PURE__ */ pt(function(N) {
3877
+ return N !== "LL" && N !== "RR" && N !== "TT" && N !== "BB";
3878
+ }, "isValidArchitectureDirectionPair"), pe = /* @__PURE__ */ pt(function(N, U) {
3879
+ const I = `${N}${U}`;
3880
+ return Ni(I) ? I : void 0;
3881
+ }, "getArchitectureDirectionPair"), Ai = /* @__PURE__ */ pt(function([N, U], I) {
3882
+ const G = I[0], A = I[1];
3883
+ return Xt(G) ? Vt(A) ? [N + (G === "L" ? -1 : 1), U + (A === "T" ? 1 : -1)] : [N + (G === "L" ? -1 : 1), U] : Xt(A) ? [N + (A === "L" ? 1 : -1), U + (G === "T" ? 1 : -1)] : [N, U + (G === "T" ? 1 : -1)];
3884
+ }, "shiftPositionByArchitectureDirectionPair"), Ci = /* @__PURE__ */ pt(function(N) {
3885
+ return N === "LT" || N === "TL" ? [1, 1] : N === "BL" || N === "LB" ? [1, -1] : N === "BR" || N === "RB" ? [-1, -1] : [-1, 1];
3886
+ }, "getArchitectureDirectionXYFactors"), wi = /* @__PURE__ */ pt(function(N, U) {
3887
+ return ye(N, U) ? "bend" : Xt(N) ? "horizontal" : "vertical";
3888
+ }, "getArchitectureDirectionAlignment"), Ii = /* @__PURE__ */ pt(function(N) {
3889
+ return N.type === "service";
3890
+ }, "isArchitectureService"), Li = /* @__PURE__ */ pt(function(N) {
3891
+ return N.type === "junction";
3892
+ }, "isArchitectureJunction"), be = /* @__PURE__ */ pt((N) => N.data(), "edgeData"), te = /* @__PURE__ */ pt((N) => N.data(), "nodeData"), _i = ei.architecture, de, Pe = (de = class {
3893
+ constructor() {
3894
+ this.nodes = {}, this.groups = {}, this.edges = [], this.registeredIds = {}, this.elements = {}, this.diagramId = "", this.setAccTitle = $e, this.getAccTitle = je, this.setDiagramTitle = qe, this.getDiagramTitle = Ze, this.getAccDescription = Ke, this.setAccDescription = Je, this.clear();
3895
+ }
3896
+ setDiagramId(N) {
3897
+ this.diagramId = N;
3898
+ }
3899
+ getDiagramId() {
3900
+ return this.diagramId;
3901
+ }
3902
+ clear() {
3903
+ this.nodes = {}, this.groups = {}, this.edges = [], this.registeredIds = {}, this.dataStructures = void 0, this.elements = {}, this.diagramId = "", Qe();
3904
+ }
3905
+ addService({
3906
+ id: N,
3907
+ icon: U,
3908
+ in: I,
3909
+ title: G,
3910
+ iconText: A
3911
+ }) {
3912
+ if (this.registeredIds[N] !== void 0)
3913
+ throw new Error(
3914
+ `The service id [${N}] is already in use by another ${this.registeredIds[N]}`
3915
+ );
3916
+ if (I !== void 0) {
3917
+ if (N === I)
3918
+ throw new Error(`The service [${N}] cannot be placed within itself`);
3919
+ if (this.registeredIds[I] === void 0)
3920
+ throw new Error(
3921
+ `The service [${N}]'s parent does not exist. Please make sure the parent is created before this service`
3922
+ );
3923
+ if (this.registeredIds[I] === "node")
3924
+ throw new Error(`The service [${N}]'s parent is not a group`);
3925
+ }
3926
+ this.registeredIds[N] = "node", this.nodes[N] = {
3927
+ id: N,
3928
+ type: "service",
3929
+ icon: U,
3930
+ iconText: A,
3931
+ title: G,
3932
+ edges: [],
3933
+ in: I
3934
+ };
3935
+ }
3936
+ getServices() {
3937
+ return Object.values(this.nodes).filter(Ii);
3938
+ }
3939
+ addJunction({ id: N, in: U }) {
3940
+ if (this.registeredIds[N] !== void 0)
3941
+ throw new Error(
3942
+ `The junction id [${N}] is already in use by another ${this.registeredIds[N]}`
3943
+ );
3944
+ if (U !== void 0) {
3945
+ if (N === U)
3946
+ throw new Error(`The junction [${N}] cannot be placed within itself`);
3947
+ if (this.registeredIds[U] === void 0)
3948
+ throw new Error(
3949
+ `The junction [${N}]'s parent does not exist. Please make sure the parent is created before this junction`
3950
+ );
3951
+ if (this.registeredIds[U] === "node")
3952
+ throw new Error(`The junction [${N}]'s parent is not a group`);
3953
+ }
3954
+ this.registeredIds[N] = "node", this.nodes[N] = {
3955
+ id: N,
3956
+ type: "junction",
3957
+ edges: [],
3958
+ in: U
3959
+ };
3960
+ }
3961
+ getJunctions() {
3962
+ return Object.values(this.nodes).filter(Li);
3963
+ }
3964
+ getNodes() {
3965
+ return Object.values(this.nodes);
3966
+ }
3967
+ getNode(N) {
3968
+ return this.nodes[N] ?? null;
3969
+ }
3970
+ addGroup({ id: N, icon: U, in: I, title: G }) {
3971
+ var A, u, d;
3972
+ if (((A = this.registeredIds) == null ? void 0 : A[N]) !== void 0)
3973
+ throw new Error(
3974
+ `The group id [${N}] is already in use by another ${this.registeredIds[N]}`
3975
+ );
3976
+ if (I !== void 0) {
3977
+ if (N === I)
3978
+ throw new Error(`The group [${N}] cannot be placed within itself`);
3979
+ if (((u = this.registeredIds) == null ? void 0 : u[I]) === void 0)
3980
+ throw new Error(
3981
+ `The group [${N}]'s parent does not exist. Please make sure the parent is created before this group`
3982
+ );
3983
+ if (((d = this.registeredIds) == null ? void 0 : d[I]) === "node")
3984
+ throw new Error(`The group [${N}]'s parent is not a group`);
3985
+ }
3986
+ this.registeredIds[N] = "group", this.groups[N] = {
3987
+ id: N,
3988
+ icon: U,
3989
+ title: G,
3990
+ in: I
3991
+ };
3992
+ }
3993
+ getGroups() {
3994
+ return Object.values(this.groups);
3995
+ }
3996
+ addEdge({
3997
+ lhsId: N,
3998
+ rhsId: U,
3999
+ lhsDir: I,
4000
+ rhsDir: G,
4001
+ lhsInto: A,
4002
+ rhsInto: u,
4003
+ lhsGroup: d,
4004
+ rhsGroup: r,
4005
+ title: i
4006
+ }) {
4007
+ if (!De(I))
4008
+ throw new Error(
4009
+ `Invalid direction given for left hand side of edge ${N}--${U}. Expected (L,R,T,B) got ${String(I)}`
4010
+ );
4011
+ if (!De(G))
4012
+ throw new Error(
4013
+ `Invalid direction given for right hand side of edge ${N}--${U}. Expected (L,R,T,B) got ${String(G)}`
4014
+ );
4015
+ if (this.nodes[N] === void 0 && this.groups[N] === void 0)
4016
+ throw new Error(
4017
+ `The left-hand id [${N}] does not yet exist. Please create the service/group before declaring an edge to it.`
4018
+ );
4019
+ if (this.nodes[U] === void 0 && this.groups[U] === void 0)
4020
+ throw new Error(
4021
+ `The right-hand id [${U}] does not yet exist. Please create the service/group before declaring an edge to it.`
4022
+ );
4023
+ const e = this.nodes[N].in, a = this.nodes[U].in;
4024
+ if (d && e && a && e == a)
4025
+ throw new Error(
4026
+ `The left-hand id [${N}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
4027
+ );
4028
+ if (r && e && a && e == a)
4029
+ throw new Error(
4030
+ `The right-hand id [${U}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
4031
+ );
4032
+ const o = {
4033
+ lhsId: N,
4034
+ lhsDir: I,
4035
+ lhsInto: A,
4036
+ lhsGroup: d,
4037
+ rhsId: U,
4038
+ rhsDir: G,
4039
+ rhsInto: u,
4040
+ rhsGroup: r,
4041
+ title: i
4042
+ };
4043
+ this.edges.push(o), this.nodes[N] && this.nodes[U] && (this.nodes[N].edges.push(this.edges[this.edges.length - 1]), this.nodes[U].edges.push(this.edges[this.edges.length - 1]));
4044
+ }
4045
+ getEdges() {
4046
+ return this.edges;
4047
+ }
4048
+ /**
4049
+ * Returns the current diagram's adjacency list, spatial map, & group alignments.
4050
+ * If they have not been created, run the algorithms to generate them.
4051
+ * @returns
4052
+ */
4053
+ getDataStructures() {
4054
+ if (this.dataStructures === void 0) {
4055
+ const N = {}, U = Object.entries(this.nodes).reduce((r, [i, e]) => (r[i] = e.edges.reduce((a, o) => {
4056
+ var f, t;
4057
+ const h = (f = this.getNode(o.lhsId)) == null ? void 0 : f.in, s = (t = this.getNode(o.rhsId)) == null ? void 0 : t.in;
4058
+ if (h && s && h !== s) {
4059
+ const c = wi(o.lhsDir, o.rhsDir);
4060
+ c !== "bend" && (N[h] ?? (N[h] = {}), N[h][s] = c, N[s] ?? (N[s] = {}), N[s][h] = c);
4061
+ }
4062
+ if (o.lhsId === i) {
4063
+ const c = pe(o.lhsDir, o.rhsDir);
4064
+ c && (a[c] = o.rhsId);
4065
+ } else {
4066
+ const c = pe(o.rhsDir, o.lhsDir);
4067
+ c && (a[c] = o.lhsId);
4068
+ }
4069
+ return a;
4070
+ }, {}), r), {}), I = Object.keys(U)[0], G = { [I]: 1 }, A = Object.keys(U).reduce(
4071
+ (r, i) => i === I ? r : { ...r, [i]: 1 },
4072
+ {}
4073
+ ), u = /* @__PURE__ */ pt((r) => {
4074
+ const i = { [r]: [0, 0] }, e = [r];
4075
+ for (; e.length > 0; ) {
4076
+ const a = e.shift();
4077
+ if (a) {
4078
+ G[a] = 1, delete A[a];
4079
+ const o = U[a], [f, t] = i[a];
4080
+ Object.entries(o).forEach(([h, s]) => {
4081
+ G[s] || (i[s] = Ai(
4082
+ [f, t],
4083
+ h
4084
+ ), e.push(s));
4085
+ });
4086
+ }
4087
+ }
4088
+ return i;
4089
+ }, "BFS"), d = [u(I)];
4090
+ for (; Object.keys(A).length > 0; )
4091
+ d.push(u(Object.keys(A)[0]));
4092
+ this.dataStructures = {
4093
+ adjList: U,
4094
+ spatialMaps: d,
4095
+ groupAlignments: N
4096
+ };
4097
+ }
4098
+ return this.dataStructures;
4099
+ }
4100
+ setElementForId(N, U) {
4101
+ this.elements[N] = U;
4102
+ }
4103
+ getElementById(N) {
4104
+ return this.elements[N];
4105
+ }
4106
+ getConfig() {
4107
+ return ti({
4108
+ ..._i,
4109
+ ...ii().architecture
4110
+ });
4111
+ }
4112
+ getConfigField(N) {
4113
+ return this.getConfig()[N];
4114
+ }
4115
+ }, pt(de, "ArchitectureDB"), de), Mi = /* @__PURE__ */ pt((N, U) => {
4116
+ li(N, U), N.groups.map((I) => U.addGroup(I)), N.services.map((I) => U.addService({ ...I, type: "service" })), N.junctions.map((I) => U.addJunction({ ...I, type: "junction" })), N.edges.map((I) => U.addEdge(I));
4117
+ }, "populateDb"), Fe = {
4118
+ parser: {
4119
+ // @ts-expect-error - ArchitectureDB is not assignable to DiagramDB
4120
+ yy: void 0
4121
+ },
4122
+ parse: /* @__PURE__ */ pt(async (N) => {
4123
+ var U;
4124
+ const I = await di("architecture", N);
4125
+ Oe.debug(I);
4126
+ const G = (U = Fe.parser) == null ? void 0 : U.yy;
4127
+ if (!(G instanceof Pe))
4128
+ throw new Error(
4129
+ "parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
4130
+ );
4131
+ Mi(I, G);
4132
+ }, "parse")
4133
+ }, xi = /* @__PURE__ */ pt((N) => `
4134
+ .edge {
4135
+ stroke-width: ${N.archEdgeWidth};
4136
+ stroke: ${N.archEdgeColor};
4137
+ fill: none;
4138
+ }
4139
+
4140
+ .arrow {
4141
+ fill: ${N.archEdgeArrowColor};
4142
+ }
4143
+
4144
+ .node-bkg {
4145
+ fill: none;
4146
+ stroke: ${N.archGroupBorderColor};
4147
+ stroke-width: ${N.archGroupBorderWidth};
4148
+ stroke-dasharray: 8;
4149
+ }
4150
+ .node-icon-text {
4151
+ display: flex;
4152
+ align-items: center;
4153
+ }
4154
+
4155
+ .node-icon-text > div {
4156
+ color: #fff;
4157
+ margin: 1px;
4158
+ height: fit-content;
4159
+ text-align: center;
4160
+ overflow: hidden;
4161
+ display: -webkit-box;
4162
+ -webkit-box-orient: vertical;
4163
+ }
4164
+ `, "getStyles"), Di = xi, Qt = /* @__PURE__ */ pt((N) => `<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${N}</g>`, "wrapIcon"), ie = {
4165
+ prefix: "mermaid-architecture",
4166
+ height: 80,
4167
+ width: 80,
4168
+ icons: {
4169
+ database: {
4170
+ body: Qt(
4171
+ '<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
4172
+ )
4173
+ },
4174
+ server: {
4175
+ body: Qt(
4176
+ '<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>'
4177
+ )
4178
+ },
4179
+ disk: {
4180
+ body: Qt(
4181
+ '<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>'
4182
+ )
4183
+ },
4184
+ internet: {
4185
+ body: Qt(
4186
+ '<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
4187
+ )
4188
+ },
4189
+ cloud: {
4190
+ body: Qt(
4191
+ '<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
4192
+ )
4193
+ },
4194
+ unknown: si,
4195
+ blank: {
4196
+ body: Qt("")
4197
+ }
4198
+ }
4199
+ }, Oi = /* @__PURE__ */ pt(async function(N, U, I, G) {
4200
+ const A = I.getConfigField("padding"), u = I.getConfigField("iconSize"), d = u / 2, r = u / 6, i = r / 2;
4201
+ await Promise.all(
4202
+ U.edges().map(async (e) => {
4203
+ var a, o;
4204
+ const {
4205
+ source: f,
4206
+ sourceDir: t,
4207
+ sourceArrow: h,
4208
+ sourceGroup: s,
4209
+ target: c,
4210
+ targetDir: l,
4211
+ targetArrow: T,
4212
+ targetGroup: g,
4213
+ label: y
4214
+ } = be(e);
4215
+ let { x: C, y: w } = e[0].sourceEndpoint();
4216
+ const { x: S, y: k } = e[0].midpoint();
4217
+ let { x: Y, y: H } = e[0].targetEndpoint();
4218
+ const V = A + 4;
4219
+ if (s && (Xt(t) ? C += t === "L" ? -V : V : w += t === "T" ? -V : V + 18), g && (Xt(l) ? Y += l === "L" ? -V : V : H += l === "T" ? -V : V + 18), !s && ((a = I.getNode(f)) == null ? void 0 : a.type) === "junction" && (Xt(t) ? C += t === "L" ? d : -d : w += t === "T" ? d : -d), !g && ((o = I.getNode(c)) == null ? void 0 : o.type) === "junction" && (Xt(l) ? Y += l === "L" ? d : -d : H += l === "T" ? d : -d), e[0]._private.rscratch) {
4220
+ const M = N.insert("g");
4221
+ if (M.insert("path").attr("d", `M ${C},${w} L ${S},${k} L${Y},${H} `).attr("class", "edge").attr("id", `${G}-${oi(f, c, { prefix: "L" })}`), h) {
4222
+ const it = Xt(t) ? ne[t](C, r) : C - i, n = Vt(t) ? ne[t](w, r) : w - i;
4223
+ M.insert("polygon").attr("points", xe[t](r)).attr("transform", `translate(${it},${n})`).attr("class", "arrow");
4224
+ }
4225
+ if (T) {
4226
+ const it = Xt(l) ? ne[l](Y, r) : Y - i, n = Vt(l) ? ne[l](H, r) : H - i;
4227
+ M.insert("polygon").attr("points", xe[l](r)).attr("transform", `translate(${it},${n})`).attr("class", "arrow");
4228
+ }
4229
+ if (y) {
4230
+ const it = ye(t, l) ? "XY" : Xt(t) ? "X" : "Y";
4231
+ let n = 0;
4232
+ it === "X" ? n = Math.abs(C - Y) : it === "Y" ? n = Math.abs(w - H) / 1.5 : n = Math.abs(C - Y) / 2;
4233
+ const E = M.append("g");
4234
+ if (await ve(
4235
+ E,
4236
+ y,
4237
+ {
4238
+ useHtmlLabels: !1,
4239
+ width: n,
4240
+ classes: "architecture-service-label"
4241
+ },
4242
+ me()
4243
+ ), E.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), it === "X")
4244
+ E.attr("transform", "translate(" + S + ", " + k + ")");
4245
+ else if (it === "Y")
4246
+ E.attr("transform", "translate(" + S + ", " + k + ") rotate(-90)");
4247
+ else if (it === "XY") {
4248
+ const p = pe(t, l);
4249
+ if (p && Ti(p)) {
4250
+ const m = E.node().getBoundingClientRect(), [v, D] = Ci(p);
4251
+ E.attr("dominant-baseline", "auto").attr("transform", `rotate(${-1 * v * D * 45})`);
4252
+ const _ = E.node().getBoundingClientRect();
4253
+ E.attr(
4254
+ "transform",
4255
+ `
4256
+ translate(${S}, ${k - m.height / 2})
4257
+ translate(${v * _.width / 2}, ${D * _.height / 2})
4258
+ rotate(${-1 * v * D * 45}, 0, ${m.height / 2})
4259
+ `
4260
+ );
4261
+ }
4262
+ }
4263
+ }
4264
+ }
4265
+ })
4266
+ );
4267
+ }, "drawEdges"), Ri = /* @__PURE__ */ pt(async function(N, U, I, G) {
4268
+ const A = I.getConfigField("padding") * 0.75, u = I.getConfigField("fontSize"), d = I.getConfigField("iconSize") / 2;
4269
+ await Promise.all(
4270
+ U.nodes().map(async (r) => {
4271
+ const i = te(r);
4272
+ if (i.type === "group") {
4273
+ const { h: e, w: a, x1: o, y1: f } = r.boundingBox(), t = N.append("rect");
4274
+ t.attr("id", `${G}-group-${i.id}`).attr("x", o + d).attr("y", f + d).attr("width", a).attr("height", e).attr("class", "node-bkg");
4275
+ const h = N.append("g");
4276
+ let s = o, c = f;
4277
+ if (i.icon) {
4278
+ const l = h.append("g");
4279
+ l.html(
4280
+ `<g>${await ge(i.icon, { height: A, width: A, fallbackPrefix: ie.prefix })}</g>`
4281
+ ), l.attr(
4282
+ "transform",
4283
+ "translate(" + (s + d + 1) + ", " + (c + d + 1) + ")"
4284
+ ), s += A, c += u / 2 - 1 - 2;
4285
+ }
4286
+ if (i.label) {
4287
+ const l = h.append("g");
4288
+ await ve(
4289
+ l,
4290
+ i.label,
4291
+ {
4292
+ useHtmlLabels: !1,
4293
+ width: a,
4294
+ classes: "architecture-service-label"
4295
+ },
4296
+ me()
4297
+ ), l.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "start").attr("text-anchor", "start"), l.attr(
4298
+ "transform",
4299
+ "translate(" + (s + d + 4) + ", " + (c + d + 2) + ")"
4300
+ );
4301
+ }
4302
+ I.setElementForId(i.id, t);
4303
+ }
4304
+ })
4305
+ );
4306
+ }, "drawGroups"), bi = /* @__PURE__ */ pt(async function(N, U, I, G) {
4307
+ const A = me();
4308
+ for (const u of I) {
4309
+ const d = U.append("g"), r = N.getConfigField("iconSize");
4310
+ if (u.title) {
4311
+ const o = d.append("g");
4312
+ await ve(
4313
+ o,
4314
+ u.title,
4315
+ {
4316
+ useHtmlLabels: !1,
4317
+ width: r * 1.5,
4318
+ classes: "architecture-service-label"
4319
+ },
4320
+ A
4321
+ ), o.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), o.attr("transform", "translate(" + r / 2 + ", " + r + ")");
4322
+ }
4323
+ const i = d.append("g");
4324
+ if (u.icon)
4325
+ i.html(
4326
+ `<g>${await ge(u.icon, { height: r, width: r, fallbackPrefix: ie.prefix })}</g>`
4327
+ );
4328
+ else if (u.iconText) {
4329
+ i.html(
4330
+ `<g>${await ge("blank", { height: r, width: r, fallbackPrefix: ie.prefix })}</g>`
4331
+ );
4332
+ const o = i.append("g").append("foreignObject").attr("width", r).attr("height", r).append("div").attr("class", "node-icon-text").attr("style", `height: ${r}px;`).append("div").html(ri(u.iconText, A)), f = parseInt(
4333
+ window.getComputedStyle(o.node(), null).getPropertyValue("font-size").replace(/\D/g, "")
4334
+ ) ?? 16;
4335
+ o.attr("style", `-webkit-line-clamp: ${Math.floor((r - 2) / f)};`);
4336
+ } else
4337
+ i.append("path").attr("class", "node-bkg").attr("id", `${G}-node-${u.id}`).attr(
4338
+ "d",
4339
+ `M0,${r} V5 Q0,0 5,0 H${r - 5} Q${r},0 ${r},5 V${r} Z`
4340
+ );
4341
+ d.attr("id", `${G}-service-${u.id}`).attr("class", "architecture-service");
4342
+ const { width: e, height: a } = d.node().getBBox();
4343
+ u.width = e, u.height = a, N.setElementForId(u.id, d);
4344
+ }
4345
+ return 0;
4346
+ }, "drawServices"), Pi = /* @__PURE__ */ pt(function(N, U, I, G) {
4347
+ I.forEach((A) => {
4348
+ const u = U.append("g"), d = N.getConfigField("iconSize");
4349
+ u.append("g").append("rect").attr("id", `${G}-node-${A.id}`).attr("fill-opacity", "0").attr("width", d).attr("height", d), u.attr("class", "architecture-junction");
4350
+ const { width: r, height: i } = u._groups[0][0].getBBox();
4351
+ u.width = r, u.height = i, N.setElementForId(A.id, u);
4352
+ });
4353
+ }, "drawJunctions");
4354
+ ai([
4355
+ {
4356
+ name: ie.prefix,
4357
+ icons: ie
4358
+ }
4359
+ ]);
4360
+ Re.use(yi);
4361
+ function Ge(N, U, I) {
4362
+ N.forEach((G) => {
4363
+ U.add({
4364
+ group: "nodes",
4365
+ data: {
4366
+ type: "service",
4367
+ id: G.id,
4368
+ icon: G.icon,
4369
+ label: G.title,
4370
+ parent: G.in,
4371
+ width: I.getConfigField("iconSize"),
4372
+ height: I.getConfigField("iconSize")
4373
+ },
4374
+ classes: "node-service"
4375
+ });
4376
+ });
4377
+ }
4378
+ pt(Ge, "addServices");
4379
+ function Se(N, U, I) {
4380
+ N.forEach((G) => {
4381
+ U.add({
4382
+ group: "nodes",
4383
+ data: {
4384
+ type: "junction",
4385
+ id: G.id,
4386
+ parent: G.in,
4387
+ width: I.getConfigField("iconSize"),
4388
+ height: I.getConfigField("iconSize")
4389
+ },
4390
+ classes: "node-junction"
4391
+ });
4392
+ });
4393
+ }
4394
+ pt(Se, "addJunctions");
4395
+ function ke(N, U) {
4396
+ U.nodes().map((I) => {
4397
+ const G = te(I);
4398
+ G.type !== "group" && (G.x = I.position().x, G.y = I.position().y, N.getElementById(G.id).attr("transform", "translate(" + (G.x || 0) + "," + (G.y || 0) + ")"));
4399
+ });
4400
+ }
4401
+ pt(ke, "positionNodes");
4402
+ function Xe(N, U) {
4403
+ N.forEach((I) => {
4404
+ U.add({
4405
+ group: "nodes",
4406
+ data: {
4407
+ type: "group",
4408
+ id: I.id,
4409
+ icon: I.icon,
4410
+ label: I.title,
4411
+ parent: I.in
4412
+ },
4413
+ classes: "node-group"
4414
+ });
4415
+ });
4416
+ }
4417
+ pt(Xe, "addGroups");
4418
+ function Ue(N, U) {
4419
+ N.forEach((I) => {
4420
+ const { lhsId: G, rhsId: A, lhsInto: u, lhsGroup: d, rhsInto: r, lhsDir: i, rhsDir: e, rhsGroup: a, title: o } = I, f = ye(I.lhsDir, I.rhsDir) ? "segments" : "straight", t = {
4421
+ id: `${G}-${A}`,
4422
+ label: o,
4423
+ source: G,
4424
+ sourceDir: i,
4425
+ sourceArrow: u,
4426
+ sourceGroup: d,
4427
+ sourceEndpoint: i === "L" ? "0 50%" : i === "R" ? "100% 50%" : i === "T" ? "50% 0" : "50% 100%",
4428
+ target: A,
4429
+ targetDir: e,
4430
+ targetArrow: r,
4431
+ targetGroup: a,
4432
+ targetEndpoint: e === "L" ? "0 50%" : e === "R" ? "100% 50%" : e === "T" ? "50% 0" : "50% 100%"
4433
+ };
4434
+ U.add({
4435
+ group: "edges",
4436
+ data: t,
4437
+ classes: f
4438
+ });
4439
+ });
4440
+ }
4441
+ pt(Ue, "addEdges");
4442
+ function Ye(N, U, I) {
4443
+ const G = /* @__PURE__ */ pt((r, i) => Object.entries(r).reduce(
4444
+ (e, [a, o]) => {
4445
+ var f;
4446
+ let t = 0;
4447
+ const h = Object.entries(o);
4448
+ if (h.length === 1)
4449
+ return e[a] = h[0][1], e;
4450
+ for (let s = 0; s < h.length - 1; s++)
4451
+ for (let c = s + 1; c < h.length; c++) {
4452
+ const [l, T] = h[s], [g, y] = h[c];
4453
+ if (((f = I[l]) == null ? void 0 : f[g]) === i)
4454
+ e[a] ?? (e[a] = []), e[a] = [...e[a], ...T, ...y];
4455
+ else if (l === "default" || g === "default")
4456
+ e[a] ?? (e[a] = []), e[a] = [...e[a], ...T, ...y];
4457
+ else {
4458
+ const C = `${a}-${t++}`;
4459
+ e[C] = T;
4460
+ const w = `${a}-${t++}`;
4461
+ e[w] = y;
4462
+ }
4463
+ }
4464
+ return e;
4465
+ },
4466
+ {}
4467
+ ), "flattenAlignments"), A = U.map((r) => {
4468
+ const i = {}, e = {};
4469
+ return Object.entries(r).forEach(([a, [o, f]]) => {
4470
+ var t, h, s;
4471
+ const c = ((t = N.getNode(a)) == null ? void 0 : t.in) ?? "default";
4472
+ i[f] ?? (i[f] = {}), (h = i[f])[c] ?? (h[c] = []), i[f][c].push(a), e[o] ?? (e[o] = {}), (s = e[o])[c] ?? (s[c] = []), e[o][c].push(a);
4473
+ }), {
4474
+ horiz: Object.values(G(i, "horizontal")).filter(
4475
+ (a) => a.length > 1
4476
+ ),
4477
+ vert: Object.values(G(e, "vertical")).filter(
4478
+ (a) => a.length > 1
4479
+ )
4480
+ };
4481
+ }), [u, d] = A.reduce(
4482
+ ([r, i], { horiz: e, vert: a }) => [
4483
+ [...r, ...e],
4484
+ [...i, ...a]
4485
+ ],
4486
+ [[], []]
4487
+ );
4488
+ return {
4489
+ horizontal: u,
4490
+ vertical: d
4491
+ };
4492
+ }
4493
+ pt(Ye, "getAlignments");
4494
+ function He(N, U) {
4495
+ const I = [], G = /* @__PURE__ */ pt((u) => `${u[0]},${u[1]}`, "posToStr"), A = /* @__PURE__ */ pt((u) => u.split(",").map((d) => parseInt(d)), "strToPos");
4496
+ return N.forEach((u) => {
4497
+ const d = Object.fromEntries(
4498
+ Object.entries(u).map(([a, o]) => [G(o), a])
4499
+ ), r = [G([0, 0])], i = {}, e = {
4500
+ L: [-1, 0],
4501
+ R: [1, 0],
4502
+ T: [0, 1],
4503
+ B: [0, -1]
4504
+ };
4505
+ for (; r.length > 0; ) {
4506
+ const a = r.shift();
4507
+ if (a) {
4508
+ i[a] = 1;
4509
+ const o = d[a];
4510
+ if (o) {
4511
+ const f = A(a);
4512
+ Object.entries(e).forEach(([t, h]) => {
4513
+ const s = G([f[0] + h[0], f[1] + h[1]]), c = d[s];
4514
+ c && !i[s] && (r.push(s), I.push({
4515
+ [Me[t]]: c,
4516
+ [Me[Ei(t)]]: o,
4517
+ gap: 1.5 * U.getConfigField("iconSize")
4518
+ }));
4519
+ });
4520
+ }
4521
+ }
4522
+ }
4523
+ }), I;
4524
+ }
4525
+ pt(He, "getRelativeConstraints");
4526
+ function ze(N, U, I, G, A, { spatialMaps: u, groupAlignments: d }) {
4527
+ return new Promise((r) => {
4528
+ const i = ni("body").append("div").attr("id", "cy").attr("style", "display:none"), e = Re({
4529
+ container: document.getElementById("cy"),
4530
+ style: [
4531
+ {
4532
+ selector: "edge",
4533
+ style: {
4534
+ "curve-style": "straight",
4535
+ "source-endpoint": "data(sourceEndpoint)",
4536
+ "target-endpoint": "data(targetEndpoint)"
4537
+ }
4538
+ },
4539
+ {
4540
+ selector: "edge[label]",
4541
+ style: {
4542
+ label: "data(label)"
4543
+ }
4544
+ },
4545
+ {
4546
+ selector: "edge.segments",
4547
+ style: {
4548
+ "curve-style": "segments",
4549
+ "segment-weights": "0",
4550
+ "segment-distances": [0.5],
4551
+ // @ts-ignore Incorrect library types
4552
+ "edge-distances": "endpoints",
4553
+ "source-endpoint": "data(sourceEndpoint)",
4554
+ "target-endpoint": "data(targetEndpoint)"
4555
+ }
4556
+ },
4557
+ {
4558
+ selector: "node",
4559
+ style: {
4560
+ // @ts-ignore Incorrect library types
4561
+ "compound-sizing-wrt-labels": "include"
4562
+ }
4563
+ },
4564
+ {
4565
+ selector: "node[label]",
4566
+ style: {
4567
+ "text-valign": "bottom",
4568
+ "text-halign": "center",
4569
+ "font-size": `${A.getConfigField("fontSize")}px`
4570
+ }
4571
+ },
4572
+ {
4573
+ selector: ".node-service",
4574
+ style: {
4575
+ label: "data(label)",
4576
+ width: "data(width)",
4577
+ height: "data(height)"
4578
+ }
4579
+ },
4580
+ {
4581
+ selector: ".node-junction",
4582
+ style: {
4583
+ width: "data(width)",
4584
+ height: "data(height)"
4585
+ }
4586
+ },
4587
+ {
4588
+ selector: ".node-group",
4589
+ style: {
4590
+ // @ts-ignore Incorrect library types
4591
+ padding: `${A.getConfigField("padding")}px`
4592
+ }
4593
+ }
4594
+ ],
4595
+ layout: {
4596
+ name: "grid",
4597
+ boundingBox: {
4598
+ x1: 0,
4599
+ x2: 100,
4600
+ y1: 0,
4601
+ y2: 100
4602
+ }
4603
+ }
4604
+ });
4605
+ i.remove(), Xe(I, e), Ge(N, e, A), Se(U, e, A), Ue(G, e);
4606
+ const a = Ye(A, u, d), o = He(u, A), f = e.layout({
4607
+ name: "fcose",
4608
+ quality: "proof",
4609
+ randomize: A.getConfigField("randomize"),
4610
+ styleEnabled: !1,
4611
+ animate: !1,
4612
+ nodeDimensionsIncludeLabels: !1,
4613
+ // Adjust the edge parameters if it passes through the border of a group
4614
+ // Hacky fix for: https://github.com/iVis-at-Bilkent/cytoscape.js-fcose/issues/67
4615
+ idealEdgeLength(t) {
4616
+ const [h, s] = t.connectedNodes(), { parent: c } = te(h), { parent: l } = te(s);
4617
+ return c === l ? 1.5 * A.getConfigField("iconSize") : 0.5 * A.getConfigField("iconSize");
4618
+ },
4619
+ edgeElasticity(t) {
4620
+ const [h, s] = t.connectedNodes(), { parent: c } = te(h), { parent: l } = te(s);
4621
+ return c === l ? 0.45 : 1e-3;
4622
+ },
4623
+ alignmentConstraint: a,
4624
+ relativePlacementConstraint: o
4625
+ });
4626
+ f.one("layoutstop", () => {
4627
+ var t;
4628
+ function h(s, c, l, T) {
4629
+ let g, y;
4630
+ const { x: C, y: w } = s, { x: S, y: k } = c;
4631
+ y = (T - w + (C - l) * (w - k) / (C - S)) / Math.sqrt(1 + Math.pow((w - k) / (C - S), 2)), g = Math.sqrt(Math.pow(T - w, 2) + Math.pow(l - C, 2) - Math.pow(y, 2));
4632
+ const Y = Math.sqrt(Math.pow(S - C, 2) + Math.pow(k - w, 2));
4633
+ g = g / Y;
4634
+ let H = (S - C) * (T - w) - (k - w) * (l - C);
4635
+ switch (!0) {
4636
+ case H >= 0:
4637
+ H = 1;
4638
+ break;
4639
+ case H < 0:
4640
+ H = -1;
4641
+ break;
4642
+ }
4643
+ let V = (S - C) * (l - C) + (k - w) * (T - w);
4644
+ switch (!0) {
4645
+ case V >= 0:
4646
+ V = 1;
4647
+ break;
4648
+ case V < 0:
4649
+ V = -1;
4650
+ break;
4651
+ }
4652
+ return y = Math.abs(y) * H, g = g * V, {
4653
+ distances: y,
4654
+ weights: g
4655
+ };
4656
+ }
4657
+ pt(h, "getSegmentWeights"), e.startBatch();
4658
+ for (const s of Object.values(e.edges()))
4659
+ if ((t = s.data) != null && t.call(s)) {
4660
+ const { x: c, y: l } = s.source().position(), { x: T, y: g } = s.target().position();
4661
+ if (c !== T && l !== g) {
4662
+ const y = s.sourceEndpoint(), C = s.targetEndpoint(), { sourceDir: w } = be(s), [S, k] = Vt(w) ? [y.x, C.y] : [C.x, y.y], { weights: Y, distances: H } = h(y, C, S, k);
4663
+ s.style("segment-distances", H), s.style("segment-weights", Y);
4664
+ }
4665
+ }
4666
+ e.endBatch(), f.run();
4667
+ }), f.run(), e.ready((t) => {
4668
+ Oe.info("Ready", t), r(e);
4669
+ });
4670
+ });
4671
+ }
4672
+ pt(ze, "layoutArchitecture");
4673
+ var Fi = /* @__PURE__ */ pt(async (N, U, I, G) => {
4674
+ const A = G.db;
4675
+ A.setDiagramId(U);
4676
+ const u = A.getServices(), d = A.getJunctions(), r = A.getGroups(), i = A.getEdges(), e = A.getDataStructures(), a = Be(U), o = a.append("g");
4677
+ o.attr("class", "architecture-edges");
4678
+ const f = a.append("g");
4679
+ f.attr("class", "architecture-services");
4680
+ const t = a.append("g");
4681
+ t.attr("class", "architecture-groups"), await bi(A, f, u, U), Pi(A, f, d, U);
4682
+ const h = await ze(u, d, r, i, A, e);
4683
+ await Oi(o, h, A, U), await Ri(t, h, A, U), ke(A, h), Ve(void 0, a, A.getConfigField("padding"), A.getConfigField("useMaxWidth"));
4684
+ }, "draw"), Gi = { draw: Fi }, Yi = {
4685
+ parser: Fe,
4686
+ get db() {
4687
+ return new Pe();
4688
+ },
4689
+ renderer: Gi,
4690
+ styles: Di
4691
+ };
4692
+ export {
4693
+ Yi as diagram
4694
+ };