hub-ui-x 0.0.1

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