@sourcegraph/amp 0.0.1749571294-gef5aa3 → 0.0.1749600114-g5c00b8

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