@schmitech/chatbot-widget 0.5.3 → 0.6.0

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