bg-editor 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +51 -0
  3. package/README.zh-CN.md +51 -0
  4. package/dist/_basePickBy-4kmg42pS.js +158 -0
  5. package/dist/_baseUniq-WOvvCHTI.js +621 -0
  6. package/dist/arc-wItjmL5I.js +90 -0
  7. package/dist/architecture-U656AL7Q-FYDwFSxk.js +12 -0
  8. package/dist/architectureDiagram-VXUJARFQ-iG5MkBjx.js +4666 -0
  9. package/dist/blockDiagram-VD42YOAC-i2GlXmWy.js +2268 -0
  10. package/dist/c4Diagram-YG6GDRKO-IufO7T1R.js +1587 -0
  11. package/dist/channel-Dah4F59k.js +12 -0
  12. package/dist/chunk-4BX2VUAB-5_v9rnje.js +15 -0
  13. package/dist/chunk-55IACEB6-BDNtSypP.js +15 -0
  14. package/dist/chunk-B4BG7PRW-DzaYPsfW.js +1382 -0
  15. package/dist/chunk-DI55MBZ5-Buwrprkw.js +1377 -0
  16. package/dist/chunk-FMBD7UC4-BaEPEIWb.js +26 -0
  17. package/dist/chunk-QN33PNHL-DhbA7i5G.js +26 -0
  18. package/dist/chunk-QZHKN3VN-BAb_D1oz.js +22 -0
  19. package/dist/chunk-TZMSLE5B-OU1MJ2do.js +71 -0
  20. package/dist/classDiagram-2ON5EDUG-KStC8v09.js +23 -0
  21. package/dist/classDiagram-v2-WZHVMYZB-KStC8v09.js +23 -0
  22. package/dist/clone-C74UiRbr.js +15 -0
  23. package/dist/cose-bilkent-S5V4N54A-eRXCoix2.js +2612 -0
  24. package/dist/cytoscape.esm-BG3R4uVs.js +18738 -0
  25. package/dist/dagre-6UL2VRFP-Bi83jPQf.js +451 -0
  26. package/dist/defaultLocale-DgmhL6Re.js +178 -0
  27. package/dist/diagram-PSM6KHXK-aW98k2-4.js +539 -0
  28. package/dist/diagram-QEK2KX5R-BR--iNM5.js +224 -0
  29. package/dist/diagram-S2PKOQOG-NTnEy5_O.js +149 -0
  30. package/dist/erDiagram-Q2GNP2WA-C8oZ5c-S.js +848 -0
  31. package/dist/flowDiagram-NV44I4VS-DiKad3Bb.js +1627 -0
  32. package/dist/ganttDiagram-LVOFAZNH-CthzjjJq.js +2506 -0
  33. package/dist/gitGraph-F6HP7TQM-CuXAC0XT.js +12 -0
  34. package/dist/gitGraphDiagram-NY62KEGX-d4KszKqi.js +706 -0
  35. package/dist/graph-CnOTx4E0.js +254 -0
  36. package/dist/index-D6-Wf75-.js +122127 -0
  37. package/dist/info-NVLQJR56-Dhmtdc7O.js +12 -0
  38. package/dist/infoDiagram-ER5ION4S-DedidjTu.js +31 -0
  39. package/dist/init-d639unba.js +23 -0
  40. package/dist/journeyDiagram-XKPGCS4Q-BylvmUWL.js +843 -0
  41. package/dist/kanban-definition-3W4ZIXB7-DGV_aVgU.js +725 -0
  42. package/dist/layout-OXk4OSoz.js +1342 -0
  43. package/dist/linear-CO_vz87n.js +266 -0
  44. package/dist/mermaid-parser.core-CYtF6phW.js +12928 -0
  45. package/dist/mindmap-definition-VGOIOE7T-BU05Y6Vz.js +790 -0
  46. package/dist/ordinal-CofNqUw2.js +68 -0
  47. package/dist/packet-BFZMPI3H-D7H_8Q-U.js +12 -0
  48. package/dist/pie-7BOR55EZ-BNWNcO5Z.js +12 -0
  49. package/dist/pieDiagram-ADFJNKIX-reGTUsiW.js +168 -0
  50. package/dist/quadrantDiagram-AYHSOK5B-NeHOJ0lX.js +1029 -0
  51. package/dist/radar-NHE76QYJ-DrVEcvh1.js +12 -0
  52. package/dist/requirementDiagram-UZGBJVZJ-BE76XNaT.js +857 -0
  53. package/dist/sankeyDiagram-TZEHDZUN-UHfMLEKl.js +817 -0
  54. package/dist/sequenceDiagram-WL72ISMW-62KWnVbh.js +2518 -0
  55. package/dist/stateDiagram-FKZM4ZOC--_CkWvu6.js +270 -0
  56. package/dist/stateDiagram-v2-4FDKWEC3-Dj7ZjAmI.js +23 -0
  57. package/dist/style.css +1 -0
  58. package/dist/timeline-definition-IT6M3QCI-C3Wb0xMN.js +804 -0
  59. package/dist/treemap-KMMF4GRG-Bc8F2dFd.js +12 -0
  60. package/dist/umo-editor.js +16 -0
  61. package/dist/xychartDiagram-PRI3JC2R-D2J307cO.js +1347 -0
  62. package/package.json +200 -0
  63. package/types/index.d.ts +277 -0
  64. package/types/src/components/index.d.ts +9 -0
  65. package/types/src/components/menus/button.vue.d.ts +583 -0
  66. package/types/src/components/modal.vue.d.ts +2 -0
  67. package/types/src/components/tooltip.vue.d.ts +27 -0
@@ -0,0 +1,2612 @@
1
+ import "./style.css";
2
+ import { aI as $, aJ as lt, _ as V, l as k, d as gt } from "./index-D6-Wf75-.js";
3
+ import { c as z } from "./cytoscape.esm-BG3R4uVs.js";
4
+ /**
5
+ * @umoteam/editor 9.0.1
6
+ * @license MIT
7
+ * @author umodoc https://www.umodoc.com
8
+ * @see https://www.umodoc.com
9
+ **/
10
+ var tt = { exports: {} }, Z = { exports: {} }, Q = { exports: {} }, J;
11
+ function ut() {
12
+ return J || (J = 1, function(G, b) {
13
+ (function(I, L) {
14
+ G.exports = L();
15
+ })($, function() {
16
+ return (
17
+ /******/
18
+ function(N) {
19
+ var I = {};
20
+ function L(o) {
21
+ if (I[o])
22
+ return I[o].exports;
23
+ var e = I[o] = {
24
+ /******/
25
+ i: o,
26
+ /******/
27
+ l: !1,
28
+ /******/
29
+ exports: {}
30
+ /******/
31
+ };
32
+ return N[o].call(e.exports, e, e.exports, L), e.l = !0, e.exports;
33
+ }
34
+ return L.m = N, L.c = I, L.i = function(o) {
35
+ return o;
36
+ }, L.d = function(o, e, t) {
37
+ L.o(o, e) || Object.defineProperty(o, e, {
38
+ /******/
39
+ configurable: !1,
40
+ /******/
41
+ enumerable: !0,
42
+ /******/
43
+ get: t
44
+ /******/
45
+ });
46
+ }, L.n = function(o) {
47
+ var e = o && o.__esModule ? (
48
+ /******/
49
+ function() {
50
+ return o.default;
51
+ }
52
+ ) : (
53
+ /******/
54
+ function() {
55
+ return o;
56
+ }
57
+ );
58
+ return L.d(e, "a", e), e;
59
+ }, L.o = function(o, e) {
60
+ return Object.prototype.hasOwnProperty.call(o, e);
61
+ }, L.p = "", L(L.s = 26);
62
+ }([
63
+ /* 0 */
64
+ /***/
65
+ function(N, I, L) {
66
+ function o() {
67
+ }
68
+ o.QUALITY = 1, o.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, o.DEFAULT_INCREMENTAL = !1, o.DEFAULT_ANIMATION_ON_LAYOUT = !0, o.DEFAULT_ANIMATION_DURING_LAYOUT = !1, o.DEFAULT_ANIMATION_PERIOD = 50, o.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, o.DEFAULT_GRAPH_MARGIN = 15, o.NODE_DIMENSIONS_INCLUDE_LABELS = !1, o.SIMPLE_NODE_SIZE = 40, o.SIMPLE_NODE_HALF_SIZE = o.SIMPLE_NODE_SIZE / 2, o.EMPTY_COMPOUND_NODE_SIZE = 40, o.MIN_EDGE_LENGTH = 1, o.WORLD_BOUNDARY = 1e6, o.INITIAL_WORLD_BOUNDARY = o.WORLD_BOUNDARY / 1e3, o.WORLD_CENTER_X = 1200, o.WORLD_CENTER_Y = 900, N.exports = o;
69
+ },
70
+ /* 1 */
71
+ /***/
72
+ function(N, I, L) {
73
+ var o = L(2), e = L(8), t = L(9);
74
+ function i(g, n, d) {
75
+ o.call(this, d), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = d, this.bendpoints = [], this.source = g, this.target = n;
76
+ }
77
+ i.prototype = Object.create(o.prototype);
78
+ for (var l in o)
79
+ i[l] = o[l];
80
+ i.prototype.getSource = function() {
81
+ return this.source;
82
+ }, i.prototype.getTarget = function() {
83
+ return this.target;
84
+ }, i.prototype.isInterGraph = function() {
85
+ return this.isInterGraph;
86
+ }, i.prototype.getLength = function() {
87
+ return this.length;
88
+ }, i.prototype.isOverlapingSourceAndTarget = function() {
89
+ return this.isOverlapingSourceAndTarget;
90
+ }, i.prototype.getBendpoints = function() {
91
+ return this.bendpoints;
92
+ }, i.prototype.getLca = function() {
93
+ return this.lca;
94
+ }, i.prototype.getSourceInLca = function() {
95
+ return this.sourceInLca;
96
+ }, i.prototype.getTargetInLca = function() {
97
+ return this.targetInLca;
98
+ }, i.prototype.getOtherEnd = function(g) {
99
+ if (this.source === g)
100
+ return this.target;
101
+ if (this.target === g)
102
+ return this.source;
103
+ throw "Node is not incident with this edge";
104
+ }, i.prototype.getOtherEndInGraph = function(g, n) {
105
+ for (var d = this.getOtherEnd(g), r = n.getGraphManager().getRoot(); ; ) {
106
+ if (d.getOwner() == n)
107
+ return d;
108
+ if (d.getOwner() == r)
109
+ break;
110
+ d = d.getOwner().getParent();
111
+ }
112
+ return null;
113
+ }, i.prototype.updateLength = function() {
114
+ var g = new Array(4);
115
+ this.isOverlapingSourceAndTarget = e.getIntersection(this.target.getRect(), this.source.getRect(), g), this.isOverlapingSourceAndTarget || (this.lengthX = g[0] - g[2], this.lengthY = g[1] - g[3], Math.abs(this.lengthX) < 1 && (this.lengthX = t.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = t.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
116
+ }, i.prototype.updateLengthSimple = function() {
117
+ this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = t.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = t.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
118
+ }, N.exports = i;
119
+ },
120
+ /* 2 */
121
+ /***/
122
+ function(N, I, L) {
123
+ function o(e) {
124
+ this.vGraphObject = e;
125
+ }
126
+ N.exports = o;
127
+ },
128
+ /* 3 */
129
+ /***/
130
+ function(N, I, L) {
131
+ var o = L(2), e = L(10), t = L(13), i = L(0), l = L(16), g = L(4);
132
+ function n(r, h, a, p) {
133
+ a == null && p == null && (p = h), o.call(this, p), r.graphManager != null && (r = r.graphManager), this.estimatedSize = e.MIN_VALUE, this.inclusionTreeDepth = e.MAX_VALUE, this.vGraphObject = p, this.edges = [], this.graphManager = r, a != null && h != null ? this.rect = new t(h.x, h.y, a.width, a.height) : this.rect = new t();
134
+ }
135
+ n.prototype = Object.create(o.prototype);
136
+ for (var d in o)
137
+ n[d] = o[d];
138
+ n.prototype.getEdges = function() {
139
+ return this.edges;
140
+ }, n.prototype.getChild = function() {
141
+ return this.child;
142
+ }, n.prototype.getOwner = function() {
143
+ return this.owner;
144
+ }, n.prototype.getWidth = function() {
145
+ return this.rect.width;
146
+ }, n.prototype.setWidth = function(r) {
147
+ this.rect.width = r;
148
+ }, n.prototype.getHeight = function() {
149
+ return this.rect.height;
150
+ }, n.prototype.setHeight = function(r) {
151
+ this.rect.height = r;
152
+ }, n.prototype.getCenterX = function() {
153
+ return this.rect.x + this.rect.width / 2;
154
+ }, n.prototype.getCenterY = function() {
155
+ return this.rect.y + this.rect.height / 2;
156
+ }, n.prototype.getCenter = function() {
157
+ return new g(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
158
+ }, n.prototype.getLocation = function() {
159
+ return new g(this.rect.x, this.rect.y);
160
+ }, n.prototype.getRect = function() {
161
+ return this.rect;
162
+ }, n.prototype.getDiagonal = function() {
163
+ return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
164
+ }, n.prototype.getHalfTheDiagonal = function() {
165
+ return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
166
+ }, n.prototype.setRect = function(r, h) {
167
+ this.rect.x = r.x, this.rect.y = r.y, this.rect.width = h.width, this.rect.height = h.height;
168
+ }, n.prototype.setCenter = function(r, h) {
169
+ this.rect.x = r - this.rect.width / 2, this.rect.y = h - this.rect.height / 2;
170
+ }, n.prototype.setLocation = function(r, h) {
171
+ this.rect.x = r, this.rect.y = h;
172
+ }, n.prototype.moveBy = function(r, h) {
173
+ this.rect.x += r, this.rect.y += h;
174
+ }, n.prototype.getEdgeListToNode = function(r) {
175
+ var h = [], a = this;
176
+ return a.edges.forEach(function(p) {
177
+ if (p.target == r) {
178
+ if (p.source != a) throw "Incorrect edge source!";
179
+ h.push(p);
180
+ }
181
+ }), h;
182
+ }, n.prototype.getEdgesBetween = function(r) {
183
+ var h = [], a = this;
184
+ return a.edges.forEach(function(p) {
185
+ if (!(p.source == a || p.target == a)) throw "Incorrect edge source and/or target";
186
+ (p.target == r || p.source == r) && h.push(p);
187
+ }), h;
188
+ }, n.prototype.getNeighborsList = function() {
189
+ var r = /* @__PURE__ */ new Set(), h = this;
190
+ return h.edges.forEach(function(a) {
191
+ if (a.source == h)
192
+ r.add(a.target);
193
+ else {
194
+ if (a.target != h)
195
+ throw "Incorrect incidency!";
196
+ r.add(a.source);
197
+ }
198
+ }), r;
199
+ }, n.prototype.withChildren = function() {
200
+ var r = /* @__PURE__ */ new Set(), h, a;
201
+ if (r.add(this), this.child != null)
202
+ for (var p = this.child.getNodes(), v = 0; v < p.length; v++)
203
+ h = p[v], a = h.withChildren(), a.forEach(function(D) {
204
+ r.add(D);
205
+ });
206
+ return r;
207
+ }, n.prototype.getNoOfChildren = function() {
208
+ var r = 0, h;
209
+ if (this.child == null)
210
+ r = 1;
211
+ else
212
+ for (var a = this.child.getNodes(), p = 0; p < a.length; p++)
213
+ h = a[p], r += h.getNoOfChildren();
214
+ return r == 0 && (r = 1), r;
215
+ }, n.prototype.getEstimatedSize = function() {
216
+ if (this.estimatedSize == e.MIN_VALUE)
217
+ throw "assert failed";
218
+ return this.estimatedSize;
219
+ }, n.prototype.calcEstimatedSize = function() {
220
+ 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);
221
+ }, n.prototype.scatter = function() {
222
+ var r, h, a = -i.INITIAL_WORLD_BOUNDARY, p = i.INITIAL_WORLD_BOUNDARY;
223
+ r = i.WORLD_CENTER_X + l.nextDouble() * (p - a) + a;
224
+ var v = -i.INITIAL_WORLD_BOUNDARY, D = i.INITIAL_WORLD_BOUNDARY;
225
+ h = i.WORLD_CENTER_Y + l.nextDouble() * (D - v) + v, this.rect.x = r, this.rect.y = h;
226
+ }, n.prototype.updateBounds = function() {
227
+ if (this.getChild() == null)
228
+ throw "assert failed";
229
+ if (this.getChild().getNodes().length != 0) {
230
+ var r = this.getChild();
231
+ if (r.updateBounds(!0), this.rect.x = r.getLeft(), this.rect.y = r.getTop(), this.setWidth(r.getRight() - r.getLeft()), this.setHeight(r.getBottom() - r.getTop()), i.NODE_DIMENSIONS_INCLUDE_LABELS) {
232
+ var h = r.getRight() - r.getLeft(), a = r.getBottom() - r.getTop();
233
+ this.labelWidth > h && (this.rect.x -= (this.labelWidth - h) / 2, this.setWidth(this.labelWidth)), this.labelHeight > a && (this.labelPos == "center" ? this.rect.y -= (this.labelHeight - a) / 2 : this.labelPos == "top" && (this.rect.y -= this.labelHeight - a), this.setHeight(this.labelHeight));
234
+ }
235
+ }
236
+ }, n.prototype.getInclusionTreeDepth = function() {
237
+ if (this.inclusionTreeDepth == e.MAX_VALUE)
238
+ throw "assert failed";
239
+ return this.inclusionTreeDepth;
240
+ }, n.prototype.transform = function(r) {
241
+ var h = this.rect.x;
242
+ h > i.WORLD_BOUNDARY ? h = i.WORLD_BOUNDARY : h < -i.WORLD_BOUNDARY && (h = -i.WORLD_BOUNDARY);
243
+ var a = this.rect.y;
244
+ a > i.WORLD_BOUNDARY ? a = i.WORLD_BOUNDARY : a < -i.WORLD_BOUNDARY && (a = -i.WORLD_BOUNDARY);
245
+ var p = new g(h, a), v = r.inverseTransformPoint(p);
246
+ this.setLocation(v.x, v.y);
247
+ }, n.prototype.getLeft = function() {
248
+ return this.rect.x;
249
+ }, n.prototype.getRight = function() {
250
+ return this.rect.x + this.rect.width;
251
+ }, n.prototype.getTop = function() {
252
+ return this.rect.y;
253
+ }, n.prototype.getBottom = function() {
254
+ return this.rect.y + this.rect.height;
255
+ }, n.prototype.getParent = function() {
256
+ return this.owner == null ? null : this.owner.getParent();
257
+ }, N.exports = n;
258
+ },
259
+ /* 4 */
260
+ /***/
261
+ function(N, I, L) {
262
+ function o(e, t) {
263
+ e == null && t == null ? (this.x = 0, this.y = 0) : (this.x = e, this.y = t);
264
+ }
265
+ o.prototype.getX = function() {
266
+ return this.x;
267
+ }, o.prototype.getY = function() {
268
+ return this.y;
269
+ }, o.prototype.setX = function(e) {
270
+ this.x = e;
271
+ }, o.prototype.setY = function(e) {
272
+ this.y = e;
273
+ }, o.prototype.getDifference = function(e) {
274
+ return new DimensionD(this.x - e.x, this.y - e.y);
275
+ }, o.prototype.getCopy = function() {
276
+ return new o(this.x, this.y);
277
+ }, o.prototype.translate = function(e) {
278
+ return this.x += e.width, this.y += e.height, this;
279
+ }, N.exports = o;
280
+ },
281
+ /* 5 */
282
+ /***/
283
+ function(N, I, L) {
284
+ var o = L(2), e = L(10), t = L(0), i = L(6), l = L(3), g = L(1), n = L(13), d = L(12), r = L(11);
285
+ function h(p, v, D) {
286
+ o.call(this, D), this.estimatedSize = e.MIN_VALUE, this.margin = t.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = p, v != null && v instanceof i ? this.graphManager = v : v != null && v instanceof Layout && (this.graphManager = v.graphManager);
287
+ }
288
+ h.prototype = Object.create(o.prototype);
289
+ for (var a in o)
290
+ h[a] = o[a];
291
+ h.prototype.getNodes = function() {
292
+ return this.nodes;
293
+ }, h.prototype.getEdges = function() {
294
+ return this.edges;
295
+ }, h.prototype.getGraphManager = function() {
296
+ return this.graphManager;
297
+ }, h.prototype.getParent = function() {
298
+ return this.parent;
299
+ }, h.prototype.getLeft = function() {
300
+ return this.left;
301
+ }, h.prototype.getRight = function() {
302
+ return this.right;
303
+ }, h.prototype.getTop = function() {
304
+ return this.top;
305
+ }, h.prototype.getBottom = function() {
306
+ return this.bottom;
307
+ }, h.prototype.isConnected = function() {
308
+ return this.isConnected;
309
+ }, h.prototype.add = function(p, v, D) {
310
+ if (v == null && D == null) {
311
+ var u = p;
312
+ if (this.graphManager == null)
313
+ throw "Graph has no graph mgr!";
314
+ if (this.getNodes().indexOf(u) > -1)
315
+ throw "Node already in graph!";
316
+ return u.owner = this, this.getNodes().push(u), u;
317
+ } else {
318
+ var T = p;
319
+ if (!(this.getNodes().indexOf(v) > -1 && this.getNodes().indexOf(D) > -1))
320
+ throw "Source or target not in graph!";
321
+ if (!(v.owner == D.owner && v.owner == this))
322
+ throw "Both owners must be this graph!";
323
+ return v.owner != D.owner ? null : (T.source = v, T.target = D, T.isInterGraph = !1, this.getEdges().push(T), v.edges.push(T), D != v && D.edges.push(T), T);
324
+ }
325
+ }, h.prototype.remove = function(p) {
326
+ var v = p;
327
+ if (p instanceof l) {
328
+ if (v == null)
329
+ throw "Node is null!";
330
+ if (!(v.owner != null && v.owner == this))
331
+ throw "Owner graph is invalid!";
332
+ if (this.graphManager == null)
333
+ throw "Owner graph manager is invalid!";
334
+ for (var D = v.edges.slice(), u, T = D.length, y = 0; y < T; y++)
335
+ u = D[y], u.isInterGraph ? this.graphManager.remove(u) : u.source.owner.remove(u);
336
+ var O = this.nodes.indexOf(v);
337
+ if (O == -1)
338
+ throw "Node not in owner node list!";
339
+ this.nodes.splice(O, 1);
340
+ } else if (p instanceof g) {
341
+ var u = p;
342
+ if (u == null)
343
+ throw "Edge is null!";
344
+ if (!(u.source != null && u.target != null))
345
+ throw "Source and/or target is null!";
346
+ if (!(u.source.owner != null && u.target.owner != null && u.source.owner == this && u.target.owner == this))
347
+ throw "Source and/or target owner is invalid!";
348
+ var s = u.source.edges.indexOf(u), f = u.target.edges.indexOf(u);
349
+ if (!(s > -1 && f > -1))
350
+ throw "Source and/or target doesn't know this edge!";
351
+ u.source.edges.splice(s, 1), u.target != u.source && u.target.edges.splice(f, 1);
352
+ var O = u.source.owner.getEdges().indexOf(u);
353
+ if (O == -1)
354
+ throw "Not in owner's edge list!";
355
+ u.source.owner.getEdges().splice(O, 1);
356
+ }
357
+ }, h.prototype.updateLeftTop = function() {
358
+ for (var p = e.MAX_VALUE, v = e.MAX_VALUE, D, u, T, y = this.getNodes(), O = y.length, s = 0; s < O; s++) {
359
+ var f = y[s];
360
+ D = f.getTop(), u = f.getLeft(), p > D && (p = D), v > u && (v = u);
361
+ }
362
+ return p == e.MAX_VALUE ? null : (y[0].getParent().paddingLeft != null ? T = y[0].getParent().paddingLeft : T = this.margin, this.left = v - T, this.top = p - T, new d(this.left, this.top));
363
+ }, h.prototype.updateBounds = function(p) {
364
+ for (var v = e.MAX_VALUE, D = -e.MAX_VALUE, u = e.MAX_VALUE, T = -e.MAX_VALUE, y, O, s, f, c, E = this.nodes, A = E.length, m = 0; m < A; m++) {
365
+ var R = E[m];
366
+ p && R.child != null && R.updateBounds(), y = R.getLeft(), O = R.getRight(), s = R.getTop(), f = R.getBottom(), v > y && (v = y), D < O && (D = O), u > s && (u = s), T < f && (T = f);
367
+ }
368
+ var C = new n(v, u, D - v, T - u);
369
+ v == e.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), E[0].getParent().paddingLeft != null ? c = E[0].getParent().paddingLeft : c = this.margin, this.left = C.x - c, this.right = C.x + C.width + c, this.top = C.y - c, this.bottom = C.y + C.height + c;
370
+ }, h.calculateBounds = function(p) {
371
+ for (var v = e.MAX_VALUE, D = -e.MAX_VALUE, u = e.MAX_VALUE, T = -e.MAX_VALUE, y, O, s, f, c = p.length, E = 0; E < c; E++) {
372
+ var A = p[E];
373
+ y = A.getLeft(), O = A.getRight(), s = A.getTop(), f = A.getBottom(), v > y && (v = y), D < O && (D = O), u > s && (u = s), T < f && (T = f);
374
+ }
375
+ var m = new n(v, u, D - v, T - u);
376
+ return m;
377
+ }, h.prototype.getInclusionTreeDepth = function() {
378
+ return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
379
+ }, h.prototype.getEstimatedSize = function() {
380
+ if (this.estimatedSize == e.MIN_VALUE)
381
+ throw "assert failed";
382
+ return this.estimatedSize;
383
+ }, h.prototype.calcEstimatedSize = function() {
384
+ for (var p = 0, v = this.nodes, D = v.length, u = 0; u < D; u++) {
385
+ var T = v[u];
386
+ p += T.calcEstimatedSize();
387
+ }
388
+ return p == 0 ? this.estimatedSize = t.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = p / Math.sqrt(this.nodes.length), this.estimatedSize;
389
+ }, h.prototype.updateConnected = function() {
390
+ var p = this;
391
+ if (this.nodes.length == 0) {
392
+ this.isConnected = !0;
393
+ return;
394
+ }
395
+ var v = new r(), D = /* @__PURE__ */ new Set(), u = this.nodes[0], T, y, O = u.withChildren();
396
+ for (O.forEach(function(m) {
397
+ v.push(m), D.add(m);
398
+ }); v.length !== 0; ) {
399
+ u = v.shift(), T = u.getEdges();
400
+ for (var s = T.length, f = 0; f < s; f++) {
401
+ var c = T[f];
402
+ if (y = c.getOtherEndInGraph(u, this), y != null && !D.has(y)) {
403
+ var E = y.withChildren();
404
+ E.forEach(function(m) {
405
+ v.push(m), D.add(m);
406
+ });
407
+ }
408
+ }
409
+ }
410
+ if (this.isConnected = !1, D.size >= this.nodes.length) {
411
+ var A = 0;
412
+ D.forEach(function(m) {
413
+ m.owner == p && A++;
414
+ }), A == this.nodes.length && (this.isConnected = !0);
415
+ }
416
+ }, N.exports = h;
417
+ },
418
+ /* 6 */
419
+ /***/
420
+ function(N, I, L) {
421
+ var o, e = L(1);
422
+ function t(i) {
423
+ o = L(5), this.layout = i, this.graphs = [], this.edges = [];
424
+ }
425
+ t.prototype.addRoot = function() {
426
+ var i = this.layout.newGraph(), l = this.layout.newNode(null), g = this.add(i, l);
427
+ return this.setRootGraph(g), this.rootGraph;
428
+ }, t.prototype.add = function(i, l, g, n, d) {
429
+ if (g == null && n == null && d == null) {
430
+ if (i == null)
431
+ throw "Graph is null!";
432
+ if (l == null)
433
+ throw "Parent node is null!";
434
+ if (this.graphs.indexOf(i) > -1)
435
+ throw "Graph already in this graph mgr!";
436
+ if (this.graphs.push(i), i.parent != null)
437
+ throw "Already has a parent!";
438
+ if (l.child != null)
439
+ throw "Already has a child!";
440
+ return i.parent = l, l.child = i, i;
441
+ } else {
442
+ d = g, n = l, g = i;
443
+ var r = n.getOwner(), h = d.getOwner();
444
+ if (!(r != null && r.getGraphManager() == this))
445
+ throw "Source not in this graph mgr!";
446
+ if (!(h != null && h.getGraphManager() == this))
447
+ throw "Target not in this graph mgr!";
448
+ if (r == h)
449
+ return g.isInterGraph = !1, r.add(g, n, d);
450
+ if (g.isInterGraph = !0, g.source = n, g.target = d, this.edges.indexOf(g) > -1)
451
+ throw "Edge already in inter-graph edge list!";
452
+ if (this.edges.push(g), !(g.source != null && g.target != null))
453
+ throw "Edge source and/or target is null!";
454
+ if (!(g.source.edges.indexOf(g) == -1 && g.target.edges.indexOf(g) == -1))
455
+ throw "Edge already in source and/or target incidency list!";
456
+ return g.source.edges.push(g), g.target.edges.push(g), g;
457
+ }
458
+ }, t.prototype.remove = function(i) {
459
+ if (i instanceof o) {
460
+ var l = i;
461
+ if (l.getGraphManager() != this)
462
+ throw "Graph not in this graph mgr";
463
+ if (!(l == this.rootGraph || l.parent != null && l.parent.graphManager == this))
464
+ throw "Invalid parent node!";
465
+ var g = [];
466
+ g = g.concat(l.getEdges());
467
+ for (var n, d = g.length, r = 0; r < d; r++)
468
+ n = g[r], l.remove(n);
469
+ var h = [];
470
+ h = h.concat(l.getNodes());
471
+ var a;
472
+ d = h.length;
473
+ for (var r = 0; r < d; r++)
474
+ a = h[r], l.remove(a);
475
+ l == this.rootGraph && this.setRootGraph(null);
476
+ var p = this.graphs.indexOf(l);
477
+ this.graphs.splice(p, 1), l.parent = null;
478
+ } else if (i instanceof e) {
479
+ if (n = i, n == null)
480
+ throw "Edge is null!";
481
+ if (!n.isInterGraph)
482
+ throw "Not an inter-graph edge!";
483
+ if (!(n.source != null && n.target != null))
484
+ throw "Source and/or target is null!";
485
+ if (!(n.source.edges.indexOf(n) != -1 && n.target.edges.indexOf(n) != -1))
486
+ throw "Source and/or target doesn't know this edge!";
487
+ var p = n.source.edges.indexOf(n);
488
+ if (n.source.edges.splice(p, 1), p = n.target.edges.indexOf(n), n.target.edges.splice(p, 1), !(n.source.owner != null && n.source.owner.getGraphManager() != null))
489
+ throw "Edge owner graph or owner graph manager is null!";
490
+ if (n.source.owner.getGraphManager().edges.indexOf(n) == -1)
491
+ throw "Not in owner graph manager's edge list!";
492
+ var p = n.source.owner.getGraphManager().edges.indexOf(n);
493
+ n.source.owner.getGraphManager().edges.splice(p, 1);
494
+ }
495
+ }, t.prototype.updateBounds = function() {
496
+ this.rootGraph.updateBounds(!0);
497
+ }, t.prototype.getGraphs = function() {
498
+ return this.graphs;
499
+ }, t.prototype.getAllNodes = function() {
500
+ if (this.allNodes == null) {
501
+ for (var i = [], l = this.getGraphs(), g = l.length, n = 0; n < g; n++)
502
+ i = i.concat(l[n].getNodes());
503
+ this.allNodes = i;
504
+ }
505
+ return this.allNodes;
506
+ }, t.prototype.resetAllNodes = function() {
507
+ this.allNodes = null;
508
+ }, t.prototype.resetAllEdges = function() {
509
+ this.allEdges = null;
510
+ }, t.prototype.resetAllNodesToApplyGravitation = function() {
511
+ this.allNodesToApplyGravitation = null;
512
+ }, t.prototype.getAllEdges = function() {
513
+ if (this.allEdges == null) {
514
+ var i = [], l = this.getGraphs();
515
+ l.length;
516
+ for (var g = 0; g < l.length; g++)
517
+ i = i.concat(l[g].getEdges());
518
+ i = i.concat(this.edges), this.allEdges = i;
519
+ }
520
+ return this.allEdges;
521
+ }, t.prototype.getAllNodesToApplyGravitation = function() {
522
+ return this.allNodesToApplyGravitation;
523
+ }, t.prototype.setAllNodesToApplyGravitation = function(i) {
524
+ if (this.allNodesToApplyGravitation != null)
525
+ throw "assert failed";
526
+ this.allNodesToApplyGravitation = i;
527
+ }, t.prototype.getRoot = function() {
528
+ return this.rootGraph;
529
+ }, t.prototype.setRootGraph = function(i) {
530
+ if (i.getGraphManager() != this)
531
+ throw "Root not in this graph mgr!";
532
+ this.rootGraph = i, i.parent == null && (i.parent = this.layout.newNode("Root node"));
533
+ }, t.prototype.getLayout = function() {
534
+ return this.layout;
535
+ }, t.prototype.isOneAncestorOfOther = function(i, l) {
536
+ if (!(i != null && l != null))
537
+ throw "assert failed";
538
+ if (i == l)
539
+ return !0;
540
+ var g = i.getOwner(), n;
541
+ do {
542
+ if (n = g.getParent(), n == null)
543
+ break;
544
+ if (n == l)
545
+ return !0;
546
+ if (g = n.getOwner(), g == null)
547
+ break;
548
+ } while (!0);
549
+ g = l.getOwner();
550
+ do {
551
+ if (n = g.getParent(), n == null)
552
+ break;
553
+ if (n == i)
554
+ return !0;
555
+ if (g = n.getOwner(), g == null)
556
+ break;
557
+ } while (!0);
558
+ return !1;
559
+ }, t.prototype.calcLowestCommonAncestors = function() {
560
+ for (var i, l, g, n, d, r = this.getAllEdges(), h = r.length, a = 0; a < h; a++) {
561
+ if (i = r[a], l = i.source, g = i.target, i.lca = null, i.sourceInLca = l, i.targetInLca = g, l == g) {
562
+ i.lca = l.getOwner();
563
+ continue;
564
+ }
565
+ for (n = l.getOwner(); i.lca == null; ) {
566
+ for (i.targetInLca = g, d = g.getOwner(); i.lca == null; ) {
567
+ if (d == n) {
568
+ i.lca = d;
569
+ break;
570
+ }
571
+ if (d == this.rootGraph)
572
+ break;
573
+ if (i.lca != null)
574
+ throw "assert failed";
575
+ i.targetInLca = d.getParent(), d = i.targetInLca.getOwner();
576
+ }
577
+ if (n == this.rootGraph)
578
+ break;
579
+ i.lca == null && (i.sourceInLca = n.getParent(), n = i.sourceInLca.getOwner());
580
+ }
581
+ if (i.lca == null)
582
+ throw "assert failed";
583
+ }
584
+ }, t.prototype.calcLowestCommonAncestor = function(i, l) {
585
+ if (i == l)
586
+ return i.getOwner();
587
+ var g = i.getOwner();
588
+ do {
589
+ if (g == null)
590
+ break;
591
+ var n = l.getOwner();
592
+ do {
593
+ if (n == null)
594
+ break;
595
+ if (n == g)
596
+ return n;
597
+ n = n.getParent().getOwner();
598
+ } while (!0);
599
+ g = g.getParent().getOwner();
600
+ } while (!0);
601
+ return g;
602
+ }, t.prototype.calcInclusionTreeDepths = function(i, l) {
603
+ i == null && l == null && (i = this.rootGraph, l = 1);
604
+ for (var g, n = i.getNodes(), d = n.length, r = 0; r < d; r++)
605
+ g = n[r], g.inclusionTreeDepth = l, g.child != null && this.calcInclusionTreeDepths(g.child, l + 1);
606
+ }, t.prototype.includesInvalidEdge = function() {
607
+ for (var i, l = this.edges.length, g = 0; g < l; g++)
608
+ if (i = this.edges[g], this.isOneAncestorOfOther(i.source, i.target))
609
+ return !0;
610
+ return !1;
611
+ }, N.exports = t;
612
+ },
613
+ /* 7 */
614
+ /***/
615
+ function(N, I, L) {
616
+ var o = L(0);
617
+ function e() {
618
+ }
619
+ for (var t in o)
620
+ e[t] = o[t];
621
+ e.MAX_ITERATIONS = 2500, e.DEFAULT_EDGE_LENGTH = 50, e.DEFAULT_SPRING_STRENGTH = 0.45, e.DEFAULT_REPULSION_STRENGTH = 4500, e.DEFAULT_GRAVITY_STRENGTH = 0.4, e.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, e.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, e.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, e.COOLING_ADAPTATION_FACTOR = 0.33, e.ADAPTATION_LOWER_NODE_LIMIT = 1e3, e.ADAPTATION_UPPER_NODE_LIMIT = 5e3, e.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, e.MAX_NODE_DISPLACEMENT = e.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, e.MIN_REPULSION_DIST = e.DEFAULT_EDGE_LENGTH / 10, e.CONVERGENCE_CHECK_PERIOD = 100, e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, e.MIN_EDGE_LENGTH = 1, e.GRID_CALCULATION_CHECK_PERIOD = 10, N.exports = e;
622
+ },
623
+ /* 8 */
624
+ /***/
625
+ function(N, I, L) {
626
+ var o = L(12);
627
+ function e() {
628
+ }
629
+ e.calcSeparationAmount = function(t, i, l, g) {
630
+ if (!t.intersects(i))
631
+ throw "assert failed";
632
+ var n = new Array(2);
633
+ this.decideDirectionsForOverlappingNodes(t, i, n), l[0] = Math.min(t.getRight(), i.getRight()) - Math.max(t.x, i.x), l[1] = Math.min(t.getBottom(), i.getBottom()) - Math.max(t.y, i.y), t.getX() <= i.getX() && t.getRight() >= i.getRight() ? l[0] += Math.min(i.getX() - t.getX(), t.getRight() - i.getRight()) : i.getX() <= t.getX() && i.getRight() >= t.getRight() && (l[0] += Math.min(t.getX() - i.getX(), i.getRight() - t.getRight())), t.getY() <= i.getY() && t.getBottom() >= i.getBottom() ? l[1] += Math.min(i.getY() - t.getY(), t.getBottom() - i.getBottom()) : i.getY() <= t.getY() && i.getBottom() >= t.getBottom() && (l[1] += Math.min(t.getY() - i.getY(), i.getBottom() - t.getBottom()));
634
+ var d = Math.abs((i.getCenterY() - t.getCenterY()) / (i.getCenterX() - t.getCenterX()));
635
+ i.getCenterY() === t.getCenterY() && i.getCenterX() === t.getCenterX() && (d = 1);
636
+ var r = d * l[0], h = l[1] / d;
637
+ l[0] < h ? h = l[0] : r = l[1], l[0] = -1 * n[0] * (h / 2 + g), l[1] = -1 * n[1] * (r / 2 + g);
638
+ }, e.decideDirectionsForOverlappingNodes = function(t, i, l) {
639
+ t.getCenterX() < i.getCenterX() ? l[0] = -1 : l[0] = 1, t.getCenterY() < i.getCenterY() ? l[1] = -1 : l[1] = 1;
640
+ }, e.getIntersection2 = function(t, i, l) {
641
+ var g = t.getCenterX(), n = t.getCenterY(), d = i.getCenterX(), r = i.getCenterY();
642
+ if (t.intersects(i))
643
+ return l[0] = g, l[1] = n, l[2] = d, l[3] = r, !0;
644
+ var h = t.getX(), a = t.getY(), p = t.getRight(), v = t.getX(), D = t.getBottom(), u = t.getRight(), T = t.getWidthHalf(), y = t.getHeightHalf(), O = i.getX(), s = i.getY(), f = i.getRight(), c = i.getX(), E = i.getBottom(), A = i.getRight(), m = i.getWidthHalf(), R = i.getHeightHalf(), C = !1, M = !1;
645
+ if (g === d) {
646
+ if (n > r)
647
+ return l[0] = g, l[1] = a, l[2] = d, l[3] = E, !1;
648
+ if (n < r)
649
+ return l[0] = g, l[1] = D, l[2] = d, l[3] = s, !1;
650
+ } else if (n === r) {
651
+ if (g > d)
652
+ return l[0] = h, l[1] = n, l[2] = f, l[3] = r, !1;
653
+ if (g < d)
654
+ return l[0] = p, l[1] = n, l[2] = O, l[3] = r, !1;
655
+ } else {
656
+ var S = t.height / t.width, Y = i.height / i.width, w = (r - n) / (d - g), x = void 0, F = void 0, U = void 0, P = void 0, _ = void 0, X = void 0;
657
+ if (-S === w ? g > d ? (l[0] = v, l[1] = D, C = !0) : (l[0] = p, l[1] = a, C = !0) : S === w && (g > d ? (l[0] = h, l[1] = a, C = !0) : (l[0] = u, l[1] = D, C = !0)), -Y === w ? d > g ? (l[2] = c, l[3] = E, M = !0) : (l[2] = f, l[3] = s, M = !0) : Y === w && (d > g ? (l[2] = O, l[3] = s, M = !0) : (l[2] = A, l[3] = E, M = !0)), C && M)
658
+ return !1;
659
+ if (g > d ? n > r ? (x = this.getCardinalDirection(S, w, 4), F = this.getCardinalDirection(Y, w, 2)) : (x = this.getCardinalDirection(-S, w, 3), F = this.getCardinalDirection(-Y, w, 1)) : n > r ? (x = this.getCardinalDirection(-S, w, 1), F = this.getCardinalDirection(-Y, w, 3)) : (x = this.getCardinalDirection(S, w, 2), F = this.getCardinalDirection(Y, w, 4)), !C)
660
+ switch (x) {
661
+ case 1:
662
+ P = a, U = g + -y / w, l[0] = U, l[1] = P;
663
+ break;
664
+ case 2:
665
+ U = u, P = n + T * w, l[0] = U, l[1] = P;
666
+ break;
667
+ case 3:
668
+ P = D, U = g + y / w, l[0] = U, l[1] = P;
669
+ break;
670
+ case 4:
671
+ U = v, P = n + -T * w, l[0] = U, l[1] = P;
672
+ break;
673
+ }
674
+ if (!M)
675
+ switch (F) {
676
+ case 1:
677
+ X = s, _ = d + -R / w, l[2] = _, l[3] = X;
678
+ break;
679
+ case 2:
680
+ _ = A, X = r + m * w, l[2] = _, l[3] = X;
681
+ break;
682
+ case 3:
683
+ X = E, _ = d + R / w, l[2] = _, l[3] = X;
684
+ break;
685
+ case 4:
686
+ _ = c, X = r + -m * w, l[2] = _, l[3] = X;
687
+ break;
688
+ }
689
+ }
690
+ return !1;
691
+ }, e.getCardinalDirection = function(t, i, l) {
692
+ return t > i ? l : 1 + l % 4;
693
+ }, e.getIntersection = function(t, i, l, g) {
694
+ if (g == null)
695
+ return this.getIntersection2(t, i, l);
696
+ var n = t.x, d = t.y, r = i.x, h = i.y, a = l.x, p = l.y, v = g.x, D = g.y, u = void 0, T = void 0, y = void 0, O = void 0, s = void 0, f = void 0, c = void 0, E = void 0, A = void 0;
697
+ return y = h - d, s = n - r, c = r * d - n * h, O = D - p, f = a - v, E = v * p - a * D, A = y * f - O * s, A === 0 ? null : (u = (s * E - f * c) / A, T = (O * c - y * E) / A, new o(u, T));
698
+ }, e.angleOfVector = function(t, i, l, g) {
699
+ var n = void 0;
700
+ return t !== l ? (n = Math.atan((g - i) / (l - t)), l < t ? n += Math.PI : g < i && (n += this.TWO_PI)) : g < i ? n = this.ONE_AND_HALF_PI : n = this.HALF_PI, n;
701
+ }, e.doIntersect = function(t, i, l, g) {
702
+ var n = t.x, d = t.y, r = i.x, h = i.y, a = l.x, p = l.y, v = g.x, D = g.y, u = (r - n) * (D - p) - (v - a) * (h - d);
703
+ if (u === 0)
704
+ return !1;
705
+ var T = ((D - p) * (v - n) + (a - v) * (D - d)) / u, y = ((d - h) * (v - n) + (r - n) * (D - d)) / u;
706
+ return 0 < T && T < 1 && 0 < y && y < 1;
707
+ }, e.HALF_PI = 0.5 * Math.PI, e.ONE_AND_HALF_PI = 1.5 * Math.PI, e.TWO_PI = 2 * Math.PI, e.THREE_PI = 3 * Math.PI, N.exports = e;
708
+ },
709
+ /* 9 */
710
+ /***/
711
+ function(N, I, L) {
712
+ function o() {
713
+ }
714
+ o.sign = function(e) {
715
+ return e > 0 ? 1 : e < 0 ? -1 : 0;
716
+ }, o.floor = function(e) {
717
+ return e < 0 ? Math.ceil(e) : Math.floor(e);
718
+ }, o.ceil = function(e) {
719
+ return e < 0 ? Math.floor(e) : Math.ceil(e);
720
+ }, N.exports = o;
721
+ },
722
+ /* 10 */
723
+ /***/
724
+ function(N, I, L) {
725
+ function o() {
726
+ }
727
+ o.MAX_VALUE = 2147483647, o.MIN_VALUE = -2147483648, N.exports = o;
728
+ },
729
+ /* 11 */
730
+ /***/
731
+ function(N, I, L) {
732
+ var o = /* @__PURE__ */ function() {
733
+ function n(d, r) {
734
+ for (var h = 0; h < r.length; h++) {
735
+ var a = r[h];
736
+ a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(d, a.key, a);
737
+ }
738
+ }
739
+ return function(d, r, h) {
740
+ return r && n(d.prototype, r), h && n(d, h), d;
741
+ };
742
+ }();
743
+ function e(n, d) {
744
+ if (!(n instanceof d))
745
+ throw new TypeError("Cannot call a class as a function");
746
+ }
747
+ var t = function(d) {
748
+ return { value: d, next: null, prev: null };
749
+ }, i = function(d, r, h, a) {
750
+ return d !== null ? d.next = r : a.head = r, h !== null ? h.prev = r : a.tail = r, r.prev = d, r.next = h, a.length++, r;
751
+ }, l = function(d, r) {
752
+ var h = d.prev, a = d.next;
753
+ return h !== null ? h.next = a : r.head = a, a !== null ? a.prev = h : r.tail = h, d.prev = d.next = null, r.length--, d;
754
+ }, g = function() {
755
+ function n(d) {
756
+ var r = this;
757
+ e(this, n), this.length = 0, this.head = null, this.tail = null, d?.forEach(function(h) {
758
+ return r.push(h);
759
+ });
760
+ }
761
+ return o(n, [{
762
+ key: "size",
763
+ value: function() {
764
+ return this.length;
765
+ }
766
+ }, {
767
+ key: "insertBefore",
768
+ value: function(r, h) {
769
+ return i(h.prev, t(r), h, this);
770
+ }
771
+ }, {
772
+ key: "insertAfter",
773
+ value: function(r, h) {
774
+ return i(h, t(r), h.next, this);
775
+ }
776
+ }, {
777
+ key: "insertNodeBefore",
778
+ value: function(r, h) {
779
+ return i(h.prev, r, h, this);
780
+ }
781
+ }, {
782
+ key: "insertNodeAfter",
783
+ value: function(r, h) {
784
+ return i(h, r, h.next, this);
785
+ }
786
+ }, {
787
+ key: "push",
788
+ value: function(r) {
789
+ return i(this.tail, t(r), null, this);
790
+ }
791
+ }, {
792
+ key: "unshift",
793
+ value: function(r) {
794
+ return i(null, t(r), this.head, this);
795
+ }
796
+ }, {
797
+ key: "remove",
798
+ value: function(r) {
799
+ return l(r, this);
800
+ }
801
+ }, {
802
+ key: "pop",
803
+ value: function() {
804
+ return l(this.tail, this).value;
805
+ }
806
+ }, {
807
+ key: "popNode",
808
+ value: function() {
809
+ return l(this.tail, this);
810
+ }
811
+ }, {
812
+ key: "shift",
813
+ value: function() {
814
+ return l(this.head, this).value;
815
+ }
816
+ }, {
817
+ key: "shiftNode",
818
+ value: function() {
819
+ return l(this.head, this);
820
+ }
821
+ }, {
822
+ key: "get_object_at",
823
+ value: function(r) {
824
+ if (r <= this.length()) {
825
+ for (var h = 1, a = this.head; h < r; )
826
+ a = a.next, h++;
827
+ return a.value;
828
+ }
829
+ }
830
+ }, {
831
+ key: "set_object_at",
832
+ value: function(r, h) {
833
+ if (r <= this.length()) {
834
+ for (var a = 1, p = this.head; a < r; )
835
+ p = p.next, a++;
836
+ p.value = h;
837
+ }
838
+ }
839
+ }]), n;
840
+ }();
841
+ N.exports = g;
842
+ },
843
+ /* 12 */
844
+ /***/
845
+ function(N, I, L) {
846
+ function o(e, t, i) {
847
+ this.x = null, this.y = null, e == null && t == null && i == null ? (this.x = 0, this.y = 0) : typeof e == "number" && typeof t == "number" && i == null ? (this.x = e, this.y = t) : e.constructor.name == "Point" && t == null && i == null && (i = e, this.x = i.x, this.y = i.y);
848
+ }
849
+ o.prototype.getX = function() {
850
+ return this.x;
851
+ }, o.prototype.getY = function() {
852
+ return this.y;
853
+ }, o.prototype.getLocation = function() {
854
+ return new o(this.x, this.y);
855
+ }, o.prototype.setLocation = function(e, t, i) {
856
+ e.constructor.name == "Point" && t == null && i == null ? (i = e, this.setLocation(i.x, i.y)) : typeof e == "number" && typeof t == "number" && i == null && (parseInt(e) == e && parseInt(t) == t ? this.move(e, t) : (this.x = Math.floor(e + 0.5), this.y = Math.floor(t + 0.5)));
857
+ }, o.prototype.move = function(e, t) {
858
+ this.x = e, this.y = t;
859
+ }, o.prototype.translate = function(e, t) {
860
+ this.x += e, this.y += t;
861
+ }, o.prototype.equals = function(e) {
862
+ if (e.constructor.name == "Point") {
863
+ var t = e;
864
+ return this.x == t.x && this.y == t.y;
865
+ }
866
+ return this == e;
867
+ }, o.prototype.toString = function() {
868
+ return new o().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
869
+ }, N.exports = o;
870
+ },
871
+ /* 13 */
872
+ /***/
873
+ function(N, I, L) {
874
+ function o(e, t, i, l) {
875
+ this.x = 0, this.y = 0, this.width = 0, this.height = 0, e != null && t != null && i != null && l != null && (this.x = e, this.y = t, this.width = i, this.height = l);
876
+ }
877
+ o.prototype.getX = function() {
878
+ return this.x;
879
+ }, o.prototype.setX = function(e) {
880
+ this.x = e;
881
+ }, o.prototype.getY = function() {
882
+ return this.y;
883
+ }, o.prototype.setY = function(e) {
884
+ this.y = e;
885
+ }, o.prototype.getWidth = function() {
886
+ return this.width;
887
+ }, o.prototype.setWidth = function(e) {
888
+ this.width = e;
889
+ }, o.prototype.getHeight = function() {
890
+ return this.height;
891
+ }, o.prototype.setHeight = function(e) {
892
+ this.height = e;
893
+ }, o.prototype.getRight = function() {
894
+ return this.x + this.width;
895
+ }, o.prototype.getBottom = function() {
896
+ return this.y + this.height;
897
+ }, o.prototype.intersects = function(e) {
898
+ return !(this.getRight() < e.x || this.getBottom() < e.y || e.getRight() < this.x || e.getBottom() < this.y);
899
+ }, o.prototype.getCenterX = function() {
900
+ return this.x + this.width / 2;
901
+ }, o.prototype.getMinX = function() {
902
+ return this.getX();
903
+ }, o.prototype.getMaxX = function() {
904
+ return this.getX() + this.width;
905
+ }, o.prototype.getCenterY = function() {
906
+ return this.y + this.height / 2;
907
+ }, o.prototype.getMinY = function() {
908
+ return this.getY();
909
+ }, o.prototype.getMaxY = function() {
910
+ return this.getY() + this.height;
911
+ }, o.prototype.getWidthHalf = function() {
912
+ return this.width / 2;
913
+ }, o.prototype.getHeightHalf = function() {
914
+ return this.height / 2;
915
+ }, N.exports = o;
916
+ },
917
+ /* 14 */
918
+ /***/
919
+ function(N, I, L) {
920
+ var o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
921
+ return typeof t;
922
+ } : function(t) {
923
+ return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
924
+ };
925
+ function e() {
926
+ }
927
+ e.lastID = 0, e.createID = function(t) {
928
+ return e.isPrimitive(t) ? t : (t.uniqueID != null || (t.uniqueID = e.getString(), e.lastID++), t.uniqueID);
929
+ }, e.getString = function(t) {
930
+ return t == null && (t = e.lastID), "Object#" + t;
931
+ }, e.isPrimitive = function(t) {
932
+ var i = typeof t > "u" ? "undefined" : o(t);
933
+ return t == null || i != "object" && i != "function";
934
+ }, N.exports = e;
935
+ },
936
+ /* 15 */
937
+ /***/
938
+ function(N, I, L) {
939
+ function o(a) {
940
+ if (Array.isArray(a)) {
941
+ for (var p = 0, v = Array(a.length); p < a.length; p++)
942
+ v[p] = a[p];
943
+ return v;
944
+ } else
945
+ return Array.from(a);
946
+ }
947
+ var e = L(0), t = L(6), i = L(3), l = L(1), g = L(5), n = L(4), d = L(17), r = L(27);
948
+ function h(a) {
949
+ r.call(this), this.layoutQuality = e.QUALITY, this.createBendsAsNeeded = e.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = e.DEFAULT_INCREMENTAL, this.animationOnLayout = e.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = e.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = e.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = e.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new t(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, a != null && (this.isRemoteUse = a);
950
+ }
951
+ h.RANDOM_SEED = 1, h.prototype = Object.create(r.prototype), h.prototype.getGraphManager = function() {
952
+ return this.graphManager;
953
+ }, h.prototype.getAllNodes = function() {
954
+ return this.graphManager.getAllNodes();
955
+ }, h.prototype.getAllEdges = function() {
956
+ return this.graphManager.getAllEdges();
957
+ }, h.prototype.getAllNodesToApplyGravitation = function() {
958
+ return this.graphManager.getAllNodesToApplyGravitation();
959
+ }, h.prototype.newGraphManager = function() {
960
+ var a = new t(this);
961
+ return this.graphManager = a, a;
962
+ }, h.prototype.newGraph = function(a) {
963
+ return new g(null, this.graphManager, a);
964
+ }, h.prototype.newNode = function(a) {
965
+ return new i(this.graphManager, a);
966
+ }, h.prototype.newEdge = function(a) {
967
+ return new l(null, null, a);
968
+ }, h.prototype.checkLayoutSuccess = function() {
969
+ return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
970
+ }, h.prototype.runLayout = function() {
971
+ this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
972
+ var a;
973
+ return this.checkLayoutSuccess() ? a = !1 : a = this.layout(), e.ANIMATE === "during" ? !1 : (a && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, a);
974
+ }, h.prototype.doPostLayout = function() {
975
+ this.incremental || this.transform(), this.update();
976
+ }, h.prototype.update2 = function() {
977
+ if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
978
+ for (var a = this.graphManager.getAllEdges(), p = 0; p < a.length; p++)
979
+ a[p];
980
+ for (var v = this.graphManager.getRoot().getNodes(), p = 0; p < v.length; p++)
981
+ v[p];
982
+ this.update(this.graphManager.getRoot());
983
+ }
984
+ }, h.prototype.update = function(a) {
985
+ if (a == null)
986
+ this.update2();
987
+ else if (a instanceof i) {
988
+ var p = a;
989
+ if (p.getChild() != null)
990
+ for (var v = p.getChild().getNodes(), D = 0; D < v.length; D++)
991
+ update(v[D]);
992
+ if (p.vGraphObject != null) {
993
+ var u = p.vGraphObject;
994
+ u.update(p);
995
+ }
996
+ } else if (a instanceof l) {
997
+ var T = a;
998
+ if (T.vGraphObject != null) {
999
+ var y = T.vGraphObject;
1000
+ y.update(T);
1001
+ }
1002
+ } else if (a instanceof g) {
1003
+ var O = a;
1004
+ if (O.vGraphObject != null) {
1005
+ var s = O.vGraphObject;
1006
+ s.update(O);
1007
+ }
1008
+ }
1009
+ }, h.prototype.initParameters = function() {
1010
+ this.isSubLayout || (this.layoutQuality = e.QUALITY, this.animationDuringLayout = e.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = e.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = e.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = e.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = e.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = e.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
1011
+ }, h.prototype.transform = function(a) {
1012
+ if (a == null)
1013
+ this.transform(new n(0, 0));
1014
+ else {
1015
+ var p = new d(), v = this.graphManager.getRoot().updateLeftTop();
1016
+ if (v != null) {
1017
+ p.setWorldOrgX(a.x), p.setWorldOrgY(a.y), p.setDeviceOrgX(v.x), p.setDeviceOrgY(v.y);
1018
+ for (var D = this.getAllNodes(), u, T = 0; T < D.length; T++)
1019
+ u = D[T], u.transform(p);
1020
+ }
1021
+ }
1022
+ }, h.prototype.positionNodesRandomly = function(a) {
1023
+ if (a == null)
1024
+ this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
1025
+ else
1026
+ for (var p, v, D = a.getNodes(), u = 0; u < D.length; u++)
1027
+ p = D[u], v = p.getChild(), v == null || v.getNodes().length == 0 ? p.scatter() : (this.positionNodesRandomly(v), p.updateBounds());
1028
+ }, h.prototype.getFlatForest = function() {
1029
+ for (var a = [], p = !0, v = this.graphManager.getRoot().getNodes(), D = !0, u = 0; u < v.length; u++)
1030
+ v[u].getChild() != null && (D = !1);
1031
+ if (!D)
1032
+ return a;
1033
+ var T = /* @__PURE__ */ new Set(), y = [], O = /* @__PURE__ */ new Map(), s = [];
1034
+ for (s = s.concat(v); s.length > 0 && p; ) {
1035
+ for (y.push(s[0]); y.length > 0 && p; ) {
1036
+ var f = y[0];
1037
+ y.splice(0, 1), T.add(f);
1038
+ for (var c = f.getEdges(), u = 0; u < c.length; u++) {
1039
+ var E = c[u].getOtherEnd(f);
1040
+ if (O.get(f) != E)
1041
+ if (!T.has(E))
1042
+ y.push(E), O.set(E, f);
1043
+ else {
1044
+ p = !1;
1045
+ break;
1046
+ }
1047
+ }
1048
+ }
1049
+ if (!p)
1050
+ a = [];
1051
+ else {
1052
+ var A = [].concat(o(T));
1053
+ a.push(A);
1054
+ for (var u = 0; u < A.length; u++) {
1055
+ var m = A[u], R = s.indexOf(m);
1056
+ R > -1 && s.splice(R, 1);
1057
+ }
1058
+ T = /* @__PURE__ */ new Set(), O = /* @__PURE__ */ new Map();
1059
+ }
1060
+ }
1061
+ return a;
1062
+ }, h.prototype.createDummyNodesForBendpoints = function(a) {
1063
+ for (var p = [], v = a.source, D = this.graphManager.calcLowestCommonAncestor(a.source, a.target), u = 0; u < a.bendpoints.length; u++) {
1064
+ var T = this.newNode(null);
1065
+ T.setRect(new Point(0, 0), new Dimension(1, 1)), D.add(T);
1066
+ var y = this.newEdge(null);
1067
+ this.graphManager.add(y, v, T), p.add(T), v = T;
1068
+ }
1069
+ var y = this.newEdge(null);
1070
+ return this.graphManager.add(y, v, a.target), this.edgeToDummyNodes.set(a, p), a.isInterGraph() ? this.graphManager.remove(a) : D.remove(a), p;
1071
+ }, h.prototype.createBendpointsFromDummyNodes = function() {
1072
+ var a = [];
1073
+ a = a.concat(this.graphManager.getAllEdges()), a = [].concat(o(this.edgeToDummyNodes.keys())).concat(a);
1074
+ for (var p = 0; p < a.length; p++) {
1075
+ var v = a[p];
1076
+ if (v.bendpoints.length > 0) {
1077
+ for (var D = this.edgeToDummyNodes.get(v), u = 0; u < D.length; u++) {
1078
+ var T = D[u], y = new n(T.getCenterX(), T.getCenterY()), O = v.bendpoints.get(u);
1079
+ O.x = y.x, O.y = y.y, T.getOwner().remove(T);
1080
+ }
1081
+ this.graphManager.add(v, v.source, v.target);
1082
+ }
1083
+ }
1084
+ }, h.transform = function(a, p, v, D) {
1085
+ if (v != null && D != null) {
1086
+ var u = p;
1087
+ if (a <= 50) {
1088
+ var T = p / v;
1089
+ u -= (p - T) / 50 * (50 - a);
1090
+ } else {
1091
+ var y = p * D;
1092
+ u += (y - p) / 50 * (a - 50);
1093
+ }
1094
+ return u;
1095
+ } else {
1096
+ var O, s;
1097
+ return a <= 50 ? (O = 9 * p / 500, s = p / 10) : (O = 9 * p / 50, s = -8 * p), O * a + s;
1098
+ }
1099
+ }, h.findCenterOfTree = function(a) {
1100
+ var p = [];
1101
+ p = p.concat(a);
1102
+ var v = [], D = /* @__PURE__ */ new Map(), u = !1, T = null;
1103
+ (p.length == 1 || p.length == 2) && (u = !0, T = p[0]);
1104
+ for (var y = 0; y < p.length; y++) {
1105
+ var O = p[y], s = O.getNeighborsList().size;
1106
+ D.set(O, O.getNeighborsList().size), s == 1 && v.push(O);
1107
+ }
1108
+ var f = [];
1109
+ for (f = f.concat(v); !u; ) {
1110
+ var c = [];
1111
+ c = c.concat(f), f = [];
1112
+ for (var y = 0; y < p.length; y++) {
1113
+ var O = p[y], E = p.indexOf(O);
1114
+ E >= 0 && p.splice(E, 1);
1115
+ var A = O.getNeighborsList();
1116
+ A.forEach(function(C) {
1117
+ if (v.indexOf(C) < 0) {
1118
+ var M = D.get(C), S = M - 1;
1119
+ S == 1 && f.push(C), D.set(C, S);
1120
+ }
1121
+ });
1122
+ }
1123
+ v = v.concat(f), (p.length == 1 || p.length == 2) && (u = !0, T = p[0]);
1124
+ }
1125
+ return T;
1126
+ }, h.prototype.setGraphManager = function(a) {
1127
+ this.graphManager = a;
1128
+ }, N.exports = h;
1129
+ },
1130
+ /* 16 */
1131
+ /***/
1132
+ function(N, I, L) {
1133
+ function o() {
1134
+ }
1135
+ o.seed = 1, o.x = 0, o.nextDouble = function() {
1136
+ return o.x = Math.sin(o.seed++) * 1e4, o.x - Math.floor(o.x);
1137
+ }, N.exports = o;
1138
+ },
1139
+ /* 17 */
1140
+ /***/
1141
+ function(N, I, L) {
1142
+ var o = L(4);
1143
+ function e(t, i) {
1144
+ this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
1145
+ }
1146
+ e.prototype.getWorldOrgX = function() {
1147
+ return this.lworldOrgX;
1148
+ }, e.prototype.setWorldOrgX = function(t) {
1149
+ this.lworldOrgX = t;
1150
+ }, e.prototype.getWorldOrgY = function() {
1151
+ return this.lworldOrgY;
1152
+ }, e.prototype.setWorldOrgY = function(t) {
1153
+ this.lworldOrgY = t;
1154
+ }, e.prototype.getWorldExtX = function() {
1155
+ return this.lworldExtX;
1156
+ }, e.prototype.setWorldExtX = function(t) {
1157
+ this.lworldExtX = t;
1158
+ }, e.prototype.getWorldExtY = function() {
1159
+ return this.lworldExtY;
1160
+ }, e.prototype.setWorldExtY = function(t) {
1161
+ this.lworldExtY = t;
1162
+ }, e.prototype.getDeviceOrgX = function() {
1163
+ return this.ldeviceOrgX;
1164
+ }, e.prototype.setDeviceOrgX = function(t) {
1165
+ this.ldeviceOrgX = t;
1166
+ }, e.prototype.getDeviceOrgY = function() {
1167
+ return this.ldeviceOrgY;
1168
+ }, e.prototype.setDeviceOrgY = function(t) {
1169
+ this.ldeviceOrgY = t;
1170
+ }, e.prototype.getDeviceExtX = function() {
1171
+ return this.ldeviceExtX;
1172
+ }, e.prototype.setDeviceExtX = function(t) {
1173
+ this.ldeviceExtX = t;
1174
+ }, e.prototype.getDeviceExtY = function() {
1175
+ return this.ldeviceExtY;
1176
+ }, e.prototype.setDeviceExtY = function(t) {
1177
+ this.ldeviceExtY = t;
1178
+ }, e.prototype.transformX = function(t) {
1179
+ var i = 0, l = this.lworldExtX;
1180
+ return l != 0 && (i = this.ldeviceOrgX + (t - this.lworldOrgX) * this.ldeviceExtX / l), i;
1181
+ }, e.prototype.transformY = function(t) {
1182
+ var i = 0, l = this.lworldExtY;
1183
+ return l != 0 && (i = this.ldeviceOrgY + (t - this.lworldOrgY) * this.ldeviceExtY / l), i;
1184
+ }, e.prototype.inverseTransformX = function(t) {
1185
+ var i = 0, l = this.ldeviceExtX;
1186
+ return l != 0 && (i = this.lworldOrgX + (t - this.ldeviceOrgX) * this.lworldExtX / l), i;
1187
+ }, e.prototype.inverseTransformY = function(t) {
1188
+ var i = 0, l = this.ldeviceExtY;
1189
+ return l != 0 && (i = this.lworldOrgY + (t - this.ldeviceOrgY) * this.lworldExtY / l), i;
1190
+ }, e.prototype.inverseTransformPoint = function(t) {
1191
+ var i = new o(this.inverseTransformX(t.x), this.inverseTransformY(t.y));
1192
+ return i;
1193
+ }, N.exports = e;
1194
+ },
1195
+ /* 18 */
1196
+ /***/
1197
+ function(N, I, L) {
1198
+ function o(r) {
1199
+ if (Array.isArray(r)) {
1200
+ for (var h = 0, a = Array(r.length); h < r.length; h++)
1201
+ a[h] = r[h];
1202
+ return a;
1203
+ } else
1204
+ return Array.from(r);
1205
+ }
1206
+ var e = L(15), t = L(7), i = L(0), l = L(8), g = L(9);
1207
+ function n() {
1208
+ e.call(this), this.useSmartIdealEdgeLengthCalculation = t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.idealEdgeLength = t.DEFAULT_EDGE_LENGTH, this.springConstant = t.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = t.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = t.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = t.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = t.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * t.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = t.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = t.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = t.MAX_ITERATIONS;
1209
+ }
1210
+ n.prototype = Object.create(e.prototype);
1211
+ for (var d in e)
1212
+ n[d] = e[d];
1213
+ n.prototype.initParameters = function() {
1214
+ e.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1215
+ }, n.prototype.calcIdealEdgeLengths = function() {
1216
+ for (var r, h, a, p, v, D, u = this.getGraphManager().getAllEdges(), T = 0; T < u.length; T++)
1217
+ r = u[T], r.idealLength = this.idealEdgeLength, r.isInterGraph && (a = r.getSource(), p = r.getTarget(), v = r.getSourceInLca().getEstimatedSize(), D = r.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (r.idealLength += v + D - 2 * i.SIMPLE_NODE_SIZE), h = r.getLca().getInclusionTreeDepth(), r.idealLength += t.DEFAULT_EDGE_LENGTH * t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (a.getInclusionTreeDepth() + p.getInclusionTreeDepth() - 2 * h));
1218
+ }, n.prototype.initSpringEmbedder = function() {
1219
+ var r = this.getAllNodes().length;
1220
+ this.incremental ? (r > t.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * t.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (r - t.ADAPTATION_LOWER_NODE_LIMIT) / (t.ADAPTATION_UPPER_NODE_LIMIT - t.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - t.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = t.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (r > t.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(t.COOLING_ADAPTATION_FACTOR, 1 - (r - t.ADAPTATION_LOWER_NODE_LIMIT) / (t.ADAPTATION_UPPER_NODE_LIMIT - t.ADAPTATION_LOWER_NODE_LIMIT) * (1 - t.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = t.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1221
+ }, n.prototype.calcSpringForces = function() {
1222
+ for (var r = this.getAllEdges(), h, a = 0; a < r.length; a++)
1223
+ h = r[a], this.calcSpringForce(h, h.idealLength);
1224
+ }, n.prototype.calcRepulsionForces = function() {
1225
+ var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, h = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, a, p, v, D, u = this.getAllNodes(), T;
1226
+ if (this.useFRGridVariant)
1227
+ for (this.totalIterations % t.GRID_CALCULATION_CHECK_PERIOD == 1 && r && this.updateGrid(), T = /* @__PURE__ */ new Set(), a = 0; a < u.length; a++)
1228
+ v = u[a], this.calculateRepulsionForceOfANode(v, T, r, h), T.add(v);
1229
+ else
1230
+ for (a = 0; a < u.length; a++)
1231
+ for (v = u[a], p = a + 1; p < u.length; p++)
1232
+ D = u[p], v.getOwner() == D.getOwner() && this.calcRepulsionForce(v, D);
1233
+ }, n.prototype.calcGravitationalForces = function() {
1234
+ for (var r, h = this.getAllNodesToApplyGravitation(), a = 0; a < h.length; a++)
1235
+ r = h[a], this.calcGravitationalForce(r);
1236
+ }, n.prototype.moveNodes = function() {
1237
+ for (var r = this.getAllNodes(), h, a = 0; a < r.length; a++)
1238
+ h = r[a], h.move();
1239
+ }, n.prototype.calcSpringForce = function(r, h) {
1240
+ var a = r.getSource(), p = r.getTarget(), v, D, u, T;
1241
+ if (this.uniformLeafNodeSizes && a.getChild() == null && p.getChild() == null)
1242
+ r.updateLengthSimple();
1243
+ else if (r.updateLength(), r.isOverlapingSourceAndTarget)
1244
+ return;
1245
+ v = r.getLength(), v != 0 && (D = this.springConstant * (v - h), u = D * (r.lengthX / v), T = D * (r.lengthY / v), a.springForceX += u, a.springForceY += T, p.springForceX -= u, p.springForceY -= T);
1246
+ }, n.prototype.calcRepulsionForce = function(r, h) {
1247
+ var a = r.getRect(), p = h.getRect(), v = new Array(2), D = new Array(4), u, T, y, O, s, f, c;
1248
+ if (a.intersects(p)) {
1249
+ l.calcSeparationAmount(a, p, v, t.DEFAULT_EDGE_LENGTH / 2), f = 2 * v[0], c = 2 * v[1];
1250
+ var E = r.noOfChildren * h.noOfChildren / (r.noOfChildren + h.noOfChildren);
1251
+ r.repulsionForceX -= E * f, r.repulsionForceY -= E * c, h.repulsionForceX += E * f, h.repulsionForceY += E * c;
1252
+ } else
1253
+ this.uniformLeafNodeSizes && r.getChild() == null && h.getChild() == null ? (u = p.getCenterX() - a.getCenterX(), T = p.getCenterY() - a.getCenterY()) : (l.getIntersection(a, p, D), u = D[2] - D[0], T = D[3] - D[1]), Math.abs(u) < t.MIN_REPULSION_DIST && (u = g.sign(u) * t.MIN_REPULSION_DIST), Math.abs(T) < t.MIN_REPULSION_DIST && (T = g.sign(T) * t.MIN_REPULSION_DIST), y = u * u + T * T, O = Math.sqrt(y), s = this.repulsionConstant * r.noOfChildren * h.noOfChildren / y, f = s * u / O, c = s * T / O, r.repulsionForceX -= f, r.repulsionForceY -= c, h.repulsionForceX += f, h.repulsionForceY += c;
1254
+ }, n.prototype.calcGravitationalForce = function(r) {
1255
+ var h, a, p, v, D, u, T, y;
1256
+ h = r.getOwner(), a = (h.getRight() + h.getLeft()) / 2, p = (h.getTop() + h.getBottom()) / 2, v = r.getCenterX() - a, D = r.getCenterY() - p, u = Math.abs(v) + r.getWidth() / 2, T = Math.abs(D) + r.getHeight() / 2, r.getOwner() == this.graphManager.getRoot() ? (y = h.getEstimatedSize() * this.gravityRangeFactor, (u > y || T > y) && (r.gravitationForceX = -this.gravityConstant * v, r.gravitationForceY = -this.gravityConstant * D)) : (y = h.getEstimatedSize() * this.compoundGravityRangeFactor, (u > y || T > y) && (r.gravitationForceX = -this.gravityConstant * v * this.compoundGravityConstant, r.gravitationForceY = -this.gravityConstant * D * this.compoundGravityConstant));
1257
+ }, n.prototype.isConverged = function() {
1258
+ var r, h = !1;
1259
+ return this.totalIterations > this.maxIterations / 3 && (h = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), r = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, r || h;
1260
+ }, n.prototype.animate = function() {
1261
+ this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1262
+ }, n.prototype.calcNoOfChildrenForAllNodes = function() {
1263
+ for (var r, h = this.graphManager.getAllNodes(), a = 0; a < h.length; a++)
1264
+ r = h[a], r.noOfChildren = r.getNoOfChildren();
1265
+ }, n.prototype.calcGrid = function(r) {
1266
+ var h = 0, a = 0;
1267
+ h = parseInt(Math.ceil((r.getRight() - r.getLeft()) / this.repulsionRange)), a = parseInt(Math.ceil((r.getBottom() - r.getTop()) / this.repulsionRange));
1268
+ for (var p = new Array(h), v = 0; v < h; v++)
1269
+ p[v] = new Array(a);
1270
+ for (var v = 0; v < h; v++)
1271
+ for (var D = 0; D < a; D++)
1272
+ p[v][D] = new Array();
1273
+ return p;
1274
+ }, n.prototype.addNodeToGrid = function(r, h, a) {
1275
+ var p = 0, v = 0, D = 0, u = 0;
1276
+ p = parseInt(Math.floor((r.getRect().x - h) / this.repulsionRange)), v = parseInt(Math.floor((r.getRect().width + r.getRect().x - h) / this.repulsionRange)), D = parseInt(Math.floor((r.getRect().y - a) / this.repulsionRange)), u = parseInt(Math.floor((r.getRect().height + r.getRect().y - a) / this.repulsionRange));
1277
+ for (var T = p; T <= v; T++)
1278
+ for (var y = D; y <= u; y++)
1279
+ this.grid[T][y].push(r), r.setGridCoordinates(p, v, D, u);
1280
+ }, n.prototype.updateGrid = function() {
1281
+ var r, h, a = this.getAllNodes();
1282
+ for (this.grid = this.calcGrid(this.graphManager.getRoot()), r = 0; r < a.length; r++)
1283
+ h = a[r], this.addNodeToGrid(h, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1284
+ }, n.prototype.calculateRepulsionForceOfANode = function(r, h, a, p) {
1285
+ if (this.totalIterations % t.GRID_CALCULATION_CHECK_PERIOD == 1 && a || p) {
1286
+ var v = /* @__PURE__ */ new Set();
1287
+ r.surrounding = new Array();
1288
+ for (var D, u = this.grid, T = r.startX - 1; T < r.finishX + 2; T++)
1289
+ for (var y = r.startY - 1; y < r.finishY + 2; y++)
1290
+ if (!(T < 0 || y < 0 || T >= u.length || y >= u[0].length)) {
1291
+ for (var O = 0; O < u[T][y].length; O++)
1292
+ if (D = u[T][y][O], !(r.getOwner() != D.getOwner() || r == D) && !h.has(D) && !v.has(D)) {
1293
+ var s = Math.abs(r.getCenterX() - D.getCenterX()) - (r.getWidth() / 2 + D.getWidth() / 2), f = Math.abs(r.getCenterY() - D.getCenterY()) - (r.getHeight() / 2 + D.getHeight() / 2);
1294
+ s <= this.repulsionRange && f <= this.repulsionRange && v.add(D);
1295
+ }
1296
+ }
1297
+ r.surrounding = [].concat(o(v));
1298
+ }
1299
+ for (T = 0; T < r.surrounding.length; T++)
1300
+ this.calcRepulsionForce(r, r.surrounding[T]);
1301
+ }, n.prototype.calcRepulsionRange = function() {
1302
+ return 0;
1303
+ }, N.exports = n;
1304
+ },
1305
+ /* 19 */
1306
+ /***/
1307
+ function(N, I, L) {
1308
+ var o = L(1), e = L(7);
1309
+ function t(l, g, n) {
1310
+ o.call(this, l, g, n), this.idealLength = e.DEFAULT_EDGE_LENGTH;
1311
+ }
1312
+ t.prototype = Object.create(o.prototype);
1313
+ for (var i in o)
1314
+ t[i] = o[i];
1315
+ N.exports = t;
1316
+ },
1317
+ /* 20 */
1318
+ /***/
1319
+ function(N, I, L) {
1320
+ var o = L(3);
1321
+ function e(i, l, g, n) {
1322
+ o.call(this, i, l, g, n), 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 = [];
1323
+ }
1324
+ e.prototype = Object.create(o.prototype);
1325
+ for (var t in o)
1326
+ e[t] = o[t];
1327
+ e.prototype.setGridCoordinates = function(i, l, g, n) {
1328
+ this.startX = i, this.finishX = l, this.startY = g, this.finishY = n;
1329
+ }, N.exports = e;
1330
+ },
1331
+ /* 21 */
1332
+ /***/
1333
+ function(N, I, L) {
1334
+ function o(e, t) {
1335
+ this.width = 0, this.height = 0, e !== null && t !== null && (this.height = t, this.width = e);
1336
+ }
1337
+ o.prototype.getWidth = function() {
1338
+ return this.width;
1339
+ }, o.prototype.setWidth = function(e) {
1340
+ this.width = e;
1341
+ }, o.prototype.getHeight = function() {
1342
+ return this.height;
1343
+ }, o.prototype.setHeight = function(e) {
1344
+ this.height = e;
1345
+ }, N.exports = o;
1346
+ },
1347
+ /* 22 */
1348
+ /***/
1349
+ function(N, I, L) {
1350
+ var o = L(14);
1351
+ function e() {
1352
+ this.map = {}, this.keys = [];
1353
+ }
1354
+ e.prototype.put = function(t, i) {
1355
+ var l = o.createID(t);
1356
+ this.contains(l) || (this.map[l] = i, this.keys.push(t));
1357
+ }, e.prototype.contains = function(t) {
1358
+ return o.createID(t), this.map[t] != null;
1359
+ }, e.prototype.get = function(t) {
1360
+ var i = o.createID(t);
1361
+ return this.map[i];
1362
+ }, e.prototype.keySet = function() {
1363
+ return this.keys;
1364
+ }, N.exports = e;
1365
+ },
1366
+ /* 23 */
1367
+ /***/
1368
+ function(N, I, L) {
1369
+ var o = L(14);
1370
+ function e() {
1371
+ this.set = {};
1372
+ }
1373
+ e.prototype.add = function(t) {
1374
+ var i = o.createID(t);
1375
+ this.contains(i) || (this.set[i] = t);
1376
+ }, e.prototype.remove = function(t) {
1377
+ delete this.set[o.createID(t)];
1378
+ }, e.prototype.clear = function() {
1379
+ this.set = {};
1380
+ }, e.prototype.contains = function(t) {
1381
+ return this.set[o.createID(t)] == t;
1382
+ }, e.prototype.isEmpty = function() {
1383
+ return this.size() === 0;
1384
+ }, e.prototype.size = function() {
1385
+ return Object.keys(this.set).length;
1386
+ }, e.prototype.addAllTo = function(t) {
1387
+ for (var i = Object.keys(this.set), l = i.length, g = 0; g < l; g++)
1388
+ t.push(this.set[i[g]]);
1389
+ }, e.prototype.size = function() {
1390
+ return Object.keys(this.set).length;
1391
+ }, e.prototype.addAll = function(t) {
1392
+ for (var i = t.length, l = 0; l < i; l++) {
1393
+ var g = t[l];
1394
+ this.add(g);
1395
+ }
1396
+ }, N.exports = e;
1397
+ },
1398
+ /* 24 */
1399
+ /***/
1400
+ function(N, I, L) {
1401
+ var o = /* @__PURE__ */ function() {
1402
+ function l(g, n) {
1403
+ for (var d = 0; d < n.length; d++) {
1404
+ var r = n[d];
1405
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(g, r.key, r);
1406
+ }
1407
+ }
1408
+ return function(g, n, d) {
1409
+ return n && l(g.prototype, n), d && l(g, d), g;
1410
+ };
1411
+ }();
1412
+ function e(l, g) {
1413
+ if (!(l instanceof g))
1414
+ throw new TypeError("Cannot call a class as a function");
1415
+ }
1416
+ var t = L(11), i = function() {
1417
+ function l(g, n) {
1418
+ e(this, l), (n !== null || n !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1419
+ var d = void 0;
1420
+ g instanceof t ? d = g.size() : d = g.length, this._quicksort(g, 0, d - 1);
1421
+ }
1422
+ return o(l, [{
1423
+ key: "_quicksort",
1424
+ value: function(n, d, r) {
1425
+ if (d < r) {
1426
+ var h = this._partition(n, d, r);
1427
+ this._quicksort(n, d, h), this._quicksort(n, h + 1, r);
1428
+ }
1429
+ }
1430
+ }, {
1431
+ key: "_partition",
1432
+ value: function(n, d, r) {
1433
+ for (var h = this._get(n, d), a = d, p = r; ; ) {
1434
+ for (; this.compareFunction(h, this._get(n, p)); )
1435
+ p--;
1436
+ for (; this.compareFunction(this._get(n, a), h); )
1437
+ a++;
1438
+ if (a < p)
1439
+ this._swap(n, a, p), a++, p--;
1440
+ else return p;
1441
+ }
1442
+ }
1443
+ }, {
1444
+ key: "_get",
1445
+ value: function(n, d) {
1446
+ return n instanceof t ? n.get_object_at(d) : n[d];
1447
+ }
1448
+ }, {
1449
+ key: "_set",
1450
+ value: function(n, d, r) {
1451
+ n instanceof t ? n.set_object_at(d, r) : n[d] = r;
1452
+ }
1453
+ }, {
1454
+ key: "_swap",
1455
+ value: function(n, d, r) {
1456
+ var h = this._get(n, d);
1457
+ this._set(n, d, this._get(n, r)), this._set(n, r, h);
1458
+ }
1459
+ }, {
1460
+ key: "_defaultCompareFunction",
1461
+ value: function(n, d) {
1462
+ return d > n;
1463
+ }
1464
+ }]), l;
1465
+ }();
1466
+ N.exports = i;
1467
+ },
1468
+ /* 25 */
1469
+ /***/
1470
+ function(N, I, L) {
1471
+ var o = /* @__PURE__ */ function() {
1472
+ function i(l, g) {
1473
+ for (var n = 0; n < g.length; n++) {
1474
+ var d = g[n];
1475
+ d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(l, d.key, d);
1476
+ }
1477
+ }
1478
+ return function(l, g, n) {
1479
+ return g && i(l.prototype, g), n && i(l, n), l;
1480
+ };
1481
+ }();
1482
+ function e(i, l) {
1483
+ if (!(i instanceof l))
1484
+ throw new TypeError("Cannot call a class as a function");
1485
+ }
1486
+ var t = function() {
1487
+ function i(l, g) {
1488
+ var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, d = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1489
+ e(this, i), this.sequence1 = l, this.sequence2 = g, this.match_score = n, this.mismatch_penalty = d, this.gap_penalty = r, this.iMax = l.length + 1, this.jMax = g.length + 1, this.grid = new Array(this.iMax);
1490
+ for (var h = 0; h < this.iMax; h++) {
1491
+ this.grid[h] = new Array(this.jMax);
1492
+ for (var a = 0; a < this.jMax; a++)
1493
+ this.grid[h][a] = 0;
1494
+ }
1495
+ this.tracebackGrid = new Array(this.iMax);
1496
+ for (var p = 0; p < this.iMax; p++) {
1497
+ this.tracebackGrid[p] = new Array(this.jMax);
1498
+ for (var v = 0; v < this.jMax; v++)
1499
+ this.tracebackGrid[p][v] = [null, null, null];
1500
+ }
1501
+ this.alignments = [], this.score = -1, this.computeGrids();
1502
+ }
1503
+ return o(i, [{
1504
+ key: "getScore",
1505
+ value: function() {
1506
+ return this.score;
1507
+ }
1508
+ }, {
1509
+ key: "getAlignments",
1510
+ value: function() {
1511
+ return this.alignments;
1512
+ }
1513
+ // Main dynamic programming procedure
1514
+ }, {
1515
+ key: "computeGrids",
1516
+ value: function() {
1517
+ for (var g = 1; g < this.jMax; g++)
1518
+ this.grid[0][g] = this.grid[0][g - 1] + this.gap_penalty, this.tracebackGrid[0][g] = [!1, !1, !0];
1519
+ for (var n = 1; n < this.iMax; n++)
1520
+ this.grid[n][0] = this.grid[n - 1][0] + this.gap_penalty, this.tracebackGrid[n][0] = [!1, !0, !1];
1521
+ for (var d = 1; d < this.iMax; d++)
1522
+ for (var r = 1; r < this.jMax; r++) {
1523
+ var h = void 0;
1524
+ this.sequence1[d - 1] === this.sequence2[r - 1] ? h = this.grid[d - 1][r - 1] + this.match_score : h = this.grid[d - 1][r - 1] + this.mismatch_penalty;
1525
+ var a = this.grid[d - 1][r] + this.gap_penalty, p = this.grid[d][r - 1] + this.gap_penalty, v = [h, a, p], D = this.arrayAllMaxIndexes(v);
1526
+ this.grid[d][r] = v[D[0]], this.tracebackGrid[d][r] = [D.includes(0), D.includes(1), D.includes(2)];
1527
+ }
1528
+ this.score = this.grid[this.iMax - 1][this.jMax - 1];
1529
+ }
1530
+ // Gets all possible valid sequence combinations
1531
+ }, {
1532
+ key: "alignmentTraceback",
1533
+ value: function() {
1534
+ var g = [];
1535
+ for (g.push({
1536
+ pos: [this.sequence1.length, this.sequence2.length],
1537
+ seq1: "",
1538
+ seq2: ""
1539
+ }); g[0]; ) {
1540
+ var n = g[0], d = this.tracebackGrid[n.pos[0]][n.pos[1]];
1541
+ d[0] && g.push({
1542
+ pos: [n.pos[0] - 1, n.pos[1] - 1],
1543
+ seq1: this.sequence1[n.pos[0] - 1] + n.seq1,
1544
+ seq2: this.sequence2[n.pos[1] - 1] + n.seq2
1545
+ }), d[1] && g.push({
1546
+ pos: [n.pos[0] - 1, n.pos[1]],
1547
+ seq1: this.sequence1[n.pos[0] - 1] + n.seq1,
1548
+ seq2: "-" + n.seq2
1549
+ }), d[2] && g.push({
1550
+ pos: [n.pos[0], n.pos[1] - 1],
1551
+ seq1: "-" + n.seq1,
1552
+ seq2: this.sequence2[n.pos[1] - 1] + n.seq2
1553
+ }), n.pos[0] === 0 && n.pos[1] === 0 && this.alignments.push({
1554
+ sequence1: n.seq1,
1555
+ sequence2: n.seq2
1556
+ }), g.shift();
1557
+ }
1558
+ return this.alignments;
1559
+ }
1560
+ // Helper Functions
1561
+ }, {
1562
+ key: "getAllIndexes",
1563
+ value: function(g, n) {
1564
+ for (var d = [], r = -1; (r = g.indexOf(n, r + 1)) !== -1; )
1565
+ d.push(r);
1566
+ return d;
1567
+ }
1568
+ }, {
1569
+ key: "arrayAllMaxIndexes",
1570
+ value: function(g) {
1571
+ return this.getAllIndexes(g, Math.max.apply(null, g));
1572
+ }
1573
+ }]), i;
1574
+ }();
1575
+ N.exports = t;
1576
+ },
1577
+ /* 26 */
1578
+ /***/
1579
+ function(N, I, L) {
1580
+ var o = function() {
1581
+ };
1582
+ o.FDLayout = L(18), o.FDLayoutConstants = L(7), o.FDLayoutEdge = L(19), o.FDLayoutNode = L(20), o.DimensionD = L(21), o.HashMap = L(22), o.HashSet = L(23), o.IGeometry = L(8), o.IMath = L(9), o.Integer = L(10), o.Point = L(12), o.PointD = L(4), o.RandomSeed = L(16), o.RectangleD = L(13), o.Transform = L(17), o.UniqueIDGeneretor = L(14), o.Quicksort = L(24), o.LinkedList = L(11), o.LGraphObject = L(2), o.LGraph = L(5), o.LEdge = L(1), o.LGraphManager = L(6), o.LNode = L(3), o.Layout = L(15), o.LayoutConstants = L(0), o.NeedlemanWunsch = L(25), N.exports = o;
1583
+ },
1584
+ /* 27 */
1585
+ /***/
1586
+ function(N, I, L) {
1587
+ function o() {
1588
+ this.listeners = [];
1589
+ }
1590
+ var e = o.prototype;
1591
+ e.addListener = function(t, i) {
1592
+ this.listeners.push({
1593
+ event: t,
1594
+ callback: i
1595
+ });
1596
+ }, e.removeListener = function(t, i) {
1597
+ for (var l = this.listeners.length; l >= 0; l--) {
1598
+ var g = this.listeners[l];
1599
+ g.event === t && g.callback === i && this.listeners.splice(l, 1);
1600
+ }
1601
+ }, e.emit = function(t, i) {
1602
+ for (var l = 0; l < this.listeners.length; l++) {
1603
+ var g = this.listeners[l];
1604
+ t === g.event && g.callback(i);
1605
+ }
1606
+ }, N.exports = o;
1607
+ }
1608
+ /******/
1609
+ ])
1610
+ );
1611
+ });
1612
+ }(Q)), Q.exports;
1613
+ }
1614
+ var q;
1615
+ function ft() {
1616
+ return q || (q = 1, function(G, b) {
1617
+ (function(I, L) {
1618
+ G.exports = L(ut());
1619
+ })($, function(N) {
1620
+ return (
1621
+ /******/
1622
+ function(I) {
1623
+ var L = {};
1624
+ function o(e) {
1625
+ if (L[e])
1626
+ return L[e].exports;
1627
+ var t = L[e] = {
1628
+ /******/
1629
+ i: e,
1630
+ /******/
1631
+ l: !1,
1632
+ /******/
1633
+ exports: {}
1634
+ /******/
1635
+ };
1636
+ return I[e].call(t.exports, t, t.exports, o), t.l = !0, t.exports;
1637
+ }
1638
+ return o.m = I, o.c = L, o.i = function(e) {
1639
+ return e;
1640
+ }, o.d = function(e, t, i) {
1641
+ o.o(e, t) || Object.defineProperty(e, t, {
1642
+ /******/
1643
+ configurable: !1,
1644
+ /******/
1645
+ enumerable: !0,
1646
+ /******/
1647
+ get: i
1648
+ /******/
1649
+ });
1650
+ }, o.n = function(e) {
1651
+ var t = e && e.__esModule ? (
1652
+ /******/
1653
+ function() {
1654
+ return e.default;
1655
+ }
1656
+ ) : (
1657
+ /******/
1658
+ function() {
1659
+ return e;
1660
+ }
1661
+ );
1662
+ return o.d(t, "a", t), t;
1663
+ }, o.o = function(e, t) {
1664
+ return Object.prototype.hasOwnProperty.call(e, t);
1665
+ }, o.p = "", o(o.s = 7);
1666
+ }([
1667
+ /* 0 */
1668
+ /***/
1669
+ function(I, L) {
1670
+ I.exports = N;
1671
+ },
1672
+ /* 1 */
1673
+ /***/
1674
+ function(I, L, o) {
1675
+ var e = o(0).FDLayoutConstants;
1676
+ function t() {
1677
+ }
1678
+ for (var i in e)
1679
+ t[i] = e[i];
1680
+ t.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, t.DEFAULT_RADIAL_SEPARATION = e.DEFAULT_EDGE_LENGTH, t.DEFAULT_COMPONENT_SEPERATION = 60, t.TILE = !0, t.TILING_PADDING_VERTICAL = 10, t.TILING_PADDING_HORIZONTAL = 10, t.TREE_REDUCTION_ON_INCREMENTAL = !1, I.exports = t;
1681
+ },
1682
+ /* 2 */
1683
+ /***/
1684
+ function(I, L, o) {
1685
+ var e = o(0).FDLayoutEdge;
1686
+ function t(l, g, n) {
1687
+ e.call(this, l, g, n);
1688
+ }
1689
+ t.prototype = Object.create(e.prototype);
1690
+ for (var i in e)
1691
+ t[i] = e[i];
1692
+ I.exports = t;
1693
+ },
1694
+ /* 3 */
1695
+ /***/
1696
+ function(I, L, o) {
1697
+ var e = o(0).LGraph;
1698
+ function t(l, g, n) {
1699
+ e.call(this, l, g, n);
1700
+ }
1701
+ t.prototype = Object.create(e.prototype);
1702
+ for (var i in e)
1703
+ t[i] = e[i];
1704
+ I.exports = t;
1705
+ },
1706
+ /* 4 */
1707
+ /***/
1708
+ function(I, L, o) {
1709
+ var e = o(0).LGraphManager;
1710
+ function t(l) {
1711
+ e.call(this, l);
1712
+ }
1713
+ t.prototype = Object.create(e.prototype);
1714
+ for (var i in e)
1715
+ t[i] = e[i];
1716
+ I.exports = t;
1717
+ },
1718
+ /* 5 */
1719
+ /***/
1720
+ function(I, L, o) {
1721
+ var e = o(0).FDLayoutNode, t = o(0).IMath;
1722
+ function i(g, n, d, r) {
1723
+ e.call(this, g, n, d, r);
1724
+ }
1725
+ i.prototype = Object.create(e.prototype);
1726
+ for (var l in e)
1727
+ i[l] = e[l];
1728
+ i.prototype.move = function() {
1729
+ var g = this.graphManager.getLayout();
1730
+ this.displacementX = g.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY = g.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren, Math.abs(this.displacementX) > g.coolingFactor * g.maxNodeDisplacement && (this.displacementX = g.coolingFactor * g.maxNodeDisplacement * t.sign(this.displacementX)), Math.abs(this.displacementY) > g.coolingFactor * g.maxNodeDisplacement && (this.displacementY = g.coolingFactor * g.maxNodeDisplacement * t.sign(this.displacementY)), this.child == null ? this.moveBy(this.displacementX, this.displacementY) : this.child.getNodes().length == 0 ? this.moveBy(this.displacementX, this.displacementY) : this.propogateDisplacementToChildren(this.displacementX, this.displacementY), g.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;
1731
+ }, i.prototype.propogateDisplacementToChildren = function(g, n) {
1732
+ for (var d = this.getChild().getNodes(), r, h = 0; h < d.length; h++)
1733
+ r = d[h], r.getChild() == null ? (r.moveBy(g, n), r.displacementX += g, r.displacementY += n) : r.propogateDisplacementToChildren(g, n);
1734
+ }, i.prototype.setPred1 = function(g) {
1735
+ this.pred1 = g;
1736
+ }, i.prototype.getPred1 = function() {
1737
+ return pred1;
1738
+ }, i.prototype.getPred2 = function() {
1739
+ return pred2;
1740
+ }, i.prototype.setNext = function(g) {
1741
+ this.next = g;
1742
+ }, i.prototype.getNext = function() {
1743
+ return next;
1744
+ }, i.prototype.setProcessed = function(g) {
1745
+ this.processed = g;
1746
+ }, i.prototype.isProcessed = function() {
1747
+ return processed;
1748
+ }, I.exports = i;
1749
+ },
1750
+ /* 6 */
1751
+ /***/
1752
+ function(I, L, o) {
1753
+ var e = o(0).FDLayout, t = o(4), i = o(3), l = o(5), g = o(2), n = o(1), d = o(0).FDLayoutConstants, r = o(0).LayoutConstants, h = o(0).Point, a = o(0).PointD, p = o(0).Layout, v = o(0).Integer, D = o(0).IGeometry, u = o(0).LGraph, T = o(0).Transform;
1754
+ function y() {
1755
+ e.call(this), this.toBeTiled = {};
1756
+ }
1757
+ y.prototype = Object.create(e.prototype);
1758
+ for (var O in e)
1759
+ y[O] = e[O];
1760
+ y.prototype.newGraphManager = function() {
1761
+ var s = new t(this);
1762
+ return this.graphManager = s, s;
1763
+ }, y.prototype.newGraph = function(s) {
1764
+ return new i(null, this.graphManager, s);
1765
+ }, y.prototype.newNode = function(s) {
1766
+ return new l(this.graphManager, s);
1767
+ }, y.prototype.newEdge = function(s) {
1768
+ return new g(null, null, s);
1769
+ }, y.prototype.initParameters = function() {
1770
+ e.prototype.initParameters.call(this, arguments), this.isSubLayout || (n.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = n.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.springConstant = d.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = d.DEFAULT_REPULSION_STRENGTH, 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, this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / d.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = d.CONVERGENCE_CHECK_PERIOD / this.maxIterations, this.coolingAdjuster = 1);
1771
+ }, y.prototype.layout = function() {
1772
+ var s = r.DEFAULT_CREATE_BENDS_AS_NEEDED;
1773
+ return s && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
1774
+ }, y.prototype.classicLayout = function() {
1775
+ 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) {
1776
+ if (n.TREE_REDUCTION_ON_INCREMENTAL) {
1777
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1778
+ var f = new Set(this.getAllNodes()), c = this.nodesWithGravity.filter(function(m) {
1779
+ return f.has(m);
1780
+ });
1781
+ this.graphManager.setAllNodesToApplyGravitation(c);
1782
+ }
1783
+ } else {
1784
+ var s = this.getFlatForest();
1785
+ if (s.length > 0)
1786
+ this.positionNodesRadially(s);
1787
+ else {
1788
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1789
+ var f = new Set(this.getAllNodes()), c = this.nodesWithGravity.filter(function(E) {
1790
+ return f.has(E);
1791
+ });
1792
+ this.graphManager.setAllNodesToApplyGravitation(c), this.positionNodesRandomly();
1793
+ }
1794
+ }
1795
+ return this.initSpringEmbedder(), this.runSpringEmbedder(), !0;
1796
+ }, y.prototype.tick = function() {
1797
+ if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished)
1798
+ if (this.prunedNodesAll.length > 0)
1799
+ this.isTreeGrowing = !0;
1800
+ else
1801
+ return !0;
1802
+ if (this.totalIterations % d.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
1803
+ if (this.isConverged())
1804
+ if (this.prunedNodesAll.length > 0)
1805
+ this.isTreeGrowing = !0;
1806
+ else
1807
+ return !0;
1808
+ 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));
1809
+ }
1810
+ if (this.isTreeGrowing) {
1811
+ if (this.growTreeIterations % 10 == 0)
1812
+ if (this.prunedNodesAll.length > 0) {
1813
+ this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
1814
+ var s = new Set(this.getAllNodes()), f = this.nodesWithGravity.filter(function(A) {
1815
+ return s.has(A);
1816
+ });
1817
+ this.graphManager.setAllNodesToApplyGravitation(f), this.graphManager.updateBounds(), this.updateGrid(), this.coolingFactor = d.DEFAULT_COOLING_FACTOR_INCREMENTAL;
1818
+ } else
1819
+ this.isTreeGrowing = !1, this.isGrowthFinished = !0;
1820
+ this.growTreeIterations++;
1821
+ }
1822
+ if (this.isGrowthFinished) {
1823
+ if (this.isConverged())
1824
+ return !0;
1825
+ this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), this.coolingFactor = d.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
1826
+ }
1827
+ var c = !this.isTreeGrowing && !this.isGrowthFinished, E = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
1828
+ return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(c, E), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
1829
+ }, y.prototype.getPositionsData = function() {
1830
+ for (var s = this.graphManager.getAllNodes(), f = {}, c = 0; c < s.length; c++) {
1831
+ var E = s[c].rect, A = s[c].id;
1832
+ f[A] = {
1833
+ id: A,
1834
+ x: E.getCenterX(),
1835
+ y: E.getCenterY(),
1836
+ w: E.width,
1837
+ h: E.height
1838
+ };
1839
+ }
1840
+ return f;
1841
+ }, y.prototype.runSpringEmbedder = function() {
1842
+ this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
1843
+ var s = !1;
1844
+ if (d.ANIMATE === "during")
1845
+ this.emit("layoutstarted");
1846
+ else {
1847
+ for (; !s; )
1848
+ s = this.tick();
1849
+ this.graphManager.updateBounds();
1850
+ }
1851
+ }, y.prototype.calculateNodesToApplyGravitationTo = function() {
1852
+ var s = [], f, c = this.graphManager.getGraphs(), E = c.length, A;
1853
+ for (A = 0; A < E; A++)
1854
+ f = c[A], f.updateConnected(), f.isConnected || (s = s.concat(f.getNodes()));
1855
+ return s;
1856
+ }, y.prototype.createBendpoints = function() {
1857
+ var s = [];
1858
+ s = s.concat(this.graphManager.getAllEdges());
1859
+ var f = /* @__PURE__ */ new Set(), c;
1860
+ for (c = 0; c < s.length; c++) {
1861
+ var E = s[c];
1862
+ if (!f.has(E)) {
1863
+ var A = E.getSource(), m = E.getTarget();
1864
+ if (A == m)
1865
+ E.getBendpoints().push(new a()), E.getBendpoints().push(new a()), this.createDummyNodesForBendpoints(E), f.add(E);
1866
+ else {
1867
+ var R = [];
1868
+ if (R = R.concat(A.getEdgeListToNode(m)), R = R.concat(m.getEdgeListToNode(A)), !f.has(R[0])) {
1869
+ if (R.length > 1) {
1870
+ var C;
1871
+ for (C = 0; C < R.length; C++) {
1872
+ var M = R[C];
1873
+ M.getBendpoints().push(new a()), this.createDummyNodesForBendpoints(M);
1874
+ }
1875
+ }
1876
+ R.forEach(function(S) {
1877
+ f.add(S);
1878
+ });
1879
+ }
1880
+ }
1881
+ }
1882
+ if (f.size == s.length)
1883
+ break;
1884
+ }
1885
+ }, y.prototype.positionNodesRadially = function(s) {
1886
+ for (var f = new h(0, 0), c = Math.ceil(Math.sqrt(s.length)), E = 0, A = 0, m = 0, R = new a(0, 0), C = 0; C < s.length; C++) {
1887
+ C % c == 0 && (m = 0, A = E, C != 0 && (A += n.DEFAULT_COMPONENT_SEPERATION), E = 0);
1888
+ var M = s[C], S = p.findCenterOfTree(M);
1889
+ f.x = m, f.y = A, R = y.radialLayout(M, S, f), R.y > E && (E = Math.floor(R.y)), m = Math.floor(R.x + n.DEFAULT_COMPONENT_SEPERATION);
1890
+ }
1891
+ this.transform(new a(r.WORLD_CENTER_X - R.x / 2, r.WORLD_CENTER_Y - R.y / 2));
1892
+ }, y.radialLayout = function(s, f, c) {
1893
+ var E = Math.max(this.maxDiagonalInTree(s), n.DEFAULT_RADIAL_SEPARATION);
1894
+ y.branchRadialLayout(f, null, 0, 359, 0, E);
1895
+ var A = u.calculateBounds(s), m = new T();
1896
+ m.setDeviceOrgX(A.getMinX()), m.setDeviceOrgY(A.getMinY()), m.setWorldOrgX(c.x), m.setWorldOrgY(c.y);
1897
+ for (var R = 0; R < s.length; R++) {
1898
+ var C = s[R];
1899
+ C.transform(m);
1900
+ }
1901
+ var M = new a(A.getMaxX(), A.getMaxY());
1902
+ return m.inverseTransformPoint(M);
1903
+ }, y.branchRadialLayout = function(s, f, c, E, A, m) {
1904
+ var R = (E - c + 1) / 2;
1905
+ R < 0 && (R += 180);
1906
+ var C = (R + c) % 360, M = C * D.TWO_PI / 360, S = A * Math.cos(M), Y = A * Math.sin(M);
1907
+ s.setCenter(S, Y);
1908
+ var w = [];
1909
+ w = w.concat(s.getEdges());
1910
+ var x = w.length;
1911
+ f != null && x--;
1912
+ for (var F = 0, U = w.length, P, _ = s.getEdgesBetween(f); _.length > 1; ) {
1913
+ var X = _[0];
1914
+ _.splice(0, 1);
1915
+ var H = w.indexOf(X);
1916
+ H >= 0 && w.splice(H, 1), U--, x--;
1917
+ }
1918
+ f != null ? P = (w.indexOf(_[0]) + 1) % U : P = 0;
1919
+ for (var W = Math.abs(E - c) / x, B = P; F != x; B = ++B % U) {
1920
+ var K = w[B].getOtherEnd(s);
1921
+ if (K != f) {
1922
+ var j = (c + F * W) % 360, ht = (j + W) % 360;
1923
+ y.branchRadialLayout(K, s, j, ht, A + m, m), F++;
1924
+ }
1925
+ }
1926
+ }, y.maxDiagonalInTree = function(s) {
1927
+ for (var f = v.MIN_VALUE, c = 0; c < s.length; c++) {
1928
+ var E = s[c], A = E.getDiagonal();
1929
+ A > f && (f = A);
1930
+ }
1931
+ return f;
1932
+ }, y.prototype.calcRepulsionRange = function() {
1933
+ return 2 * (this.level + 1) * this.idealEdgeLength;
1934
+ }, y.prototype.groupZeroDegreeMembers = function() {
1935
+ var s = this, f = {};
1936
+ this.memberGroups = {}, this.idToDummyNode = {};
1937
+ for (var c = [], E = this.graphManager.getAllNodes(), A = 0; A < E.length; A++) {
1938
+ var m = E[A], R = m.getParent();
1939
+ this.getNodeDegreeWithChildren(m) === 0 && (R.id == null || !this.getToBeTiled(R)) && c.push(m);
1940
+ }
1941
+ for (var A = 0; A < c.length; A++) {
1942
+ var m = c[A], C = m.getParent().id;
1943
+ typeof f[C] > "u" && (f[C] = []), f[C] = f[C].concat(m);
1944
+ }
1945
+ Object.keys(f).forEach(function(M) {
1946
+ if (f[M].length > 1) {
1947
+ var S = "DummyCompound_" + M;
1948
+ s.memberGroups[S] = f[M];
1949
+ var Y = f[M][0].getParent(), w = new l(s.graphManager);
1950
+ w.id = S, w.paddingLeft = Y.paddingLeft || 0, w.paddingRight = Y.paddingRight || 0, w.paddingBottom = Y.paddingBottom || 0, w.paddingTop = Y.paddingTop || 0, s.idToDummyNode[S] = w;
1951
+ var x = s.getGraphManager().add(s.newGraph(), w), F = Y.getChild();
1952
+ F.add(w);
1953
+ for (var U = 0; U < f[M].length; U++) {
1954
+ var P = f[M][U];
1955
+ F.remove(P), x.add(P);
1956
+ }
1957
+ }
1958
+ });
1959
+ }, y.prototype.clearCompounds = function() {
1960
+ var s = {}, f = {};
1961
+ this.performDFSOnCompounds();
1962
+ for (var c = 0; c < this.compoundOrder.length; c++)
1963
+ f[this.compoundOrder[c].id] = this.compoundOrder[c], s[this.compoundOrder[c].id] = [].concat(this.compoundOrder[c].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[c].getChild()), this.compoundOrder[c].child = null;
1964
+ this.graphManager.resetAllNodes(), this.tileCompoundMembers(s, f);
1965
+ }, y.prototype.clearZeroDegreeMembers = function() {
1966
+ var s = this, f = this.tiledZeroDegreePack = [];
1967
+ Object.keys(this.memberGroups).forEach(function(c) {
1968
+ var E = s.idToDummyNode[c];
1969
+ f[c] = s.tileNodes(s.memberGroups[c], E.paddingLeft + E.paddingRight), E.rect.width = f[c].width, E.rect.height = f[c].height;
1970
+ });
1971
+ }, y.prototype.repopulateCompounds = function() {
1972
+ for (var s = this.compoundOrder.length - 1; s >= 0; s--) {
1973
+ var f = this.compoundOrder[s], c = f.id, E = f.paddingLeft, A = f.paddingTop;
1974
+ this.adjustLocations(this.tiledMemberPack[c], f.rect.x, f.rect.y, E, A);
1975
+ }
1976
+ }, y.prototype.repopulateZeroDegreeMembers = function() {
1977
+ var s = this, f = this.tiledZeroDegreePack;
1978
+ Object.keys(f).forEach(function(c) {
1979
+ var E = s.idToDummyNode[c], A = E.paddingLeft, m = E.paddingTop;
1980
+ s.adjustLocations(f[c], E.rect.x, E.rect.y, A, m);
1981
+ });
1982
+ }, y.prototype.getToBeTiled = function(s) {
1983
+ var f = s.id;
1984
+ if (this.toBeTiled[f] != null)
1985
+ return this.toBeTiled[f];
1986
+ var c = s.getChild();
1987
+ if (c == null)
1988
+ return this.toBeTiled[f] = !1, !1;
1989
+ for (var E = c.getNodes(), A = 0; A < E.length; A++) {
1990
+ var m = E[A];
1991
+ if (this.getNodeDegree(m) > 0)
1992
+ return this.toBeTiled[f] = !1, !1;
1993
+ if (m.getChild() == null) {
1994
+ this.toBeTiled[m.id] = !1;
1995
+ continue;
1996
+ }
1997
+ if (!this.getToBeTiled(m))
1998
+ return this.toBeTiled[f] = !1, !1;
1999
+ }
2000
+ return this.toBeTiled[f] = !0, !0;
2001
+ }, y.prototype.getNodeDegree = function(s) {
2002
+ s.id;
2003
+ for (var f = s.getEdges(), c = 0, E = 0; E < f.length; E++) {
2004
+ var A = f[E];
2005
+ A.getSource().id !== A.getTarget().id && (c = c + 1);
2006
+ }
2007
+ return c;
2008
+ }, y.prototype.getNodeDegreeWithChildren = function(s) {
2009
+ var f = this.getNodeDegree(s);
2010
+ if (s.getChild() == null)
2011
+ return f;
2012
+ for (var c = s.getChild().getNodes(), E = 0; E < c.length; E++) {
2013
+ var A = c[E];
2014
+ f += this.getNodeDegreeWithChildren(A);
2015
+ }
2016
+ return f;
2017
+ }, y.prototype.performDFSOnCompounds = function() {
2018
+ this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
2019
+ }, y.prototype.fillCompexOrderByDFS = function(s) {
2020
+ for (var f = 0; f < s.length; f++) {
2021
+ var c = s[f];
2022
+ c.getChild() != null && this.fillCompexOrderByDFS(c.getChild().getNodes()), this.getToBeTiled(c) && this.compoundOrder.push(c);
2023
+ }
2024
+ }, y.prototype.adjustLocations = function(s, f, c, E, A) {
2025
+ f += E, c += A;
2026
+ for (var m = f, R = 0; R < s.rows.length; R++) {
2027
+ var C = s.rows[R];
2028
+ f = m;
2029
+ for (var M = 0, S = 0; S < C.length; S++) {
2030
+ var Y = C[S];
2031
+ Y.rect.x = f, Y.rect.y = c, f += Y.rect.width + s.horizontalPadding, Y.rect.height > M && (M = Y.rect.height);
2032
+ }
2033
+ c += M + s.verticalPadding;
2034
+ }
2035
+ }, y.prototype.tileCompoundMembers = function(s, f) {
2036
+ var c = this;
2037
+ this.tiledMemberPack = [], Object.keys(s).forEach(function(E) {
2038
+ var A = f[E];
2039
+ c.tiledMemberPack[E] = c.tileNodes(s[E], A.paddingLeft + A.paddingRight), A.rect.width = c.tiledMemberPack[E].width, A.rect.height = c.tiledMemberPack[E].height;
2040
+ });
2041
+ }, y.prototype.tileNodes = function(s, f) {
2042
+ var c = n.TILING_PADDING_VERTICAL, E = n.TILING_PADDING_HORIZONTAL, A = {
2043
+ rows: [],
2044
+ rowWidth: [],
2045
+ rowHeight: [],
2046
+ width: 0,
2047
+ height: f,
2048
+ // assume minHeight equals to minWidth
2049
+ verticalPadding: c,
2050
+ horizontalPadding: E
2051
+ };
2052
+ s.sort(function(C, M) {
2053
+ return C.rect.width * C.rect.height > M.rect.width * M.rect.height ? -1 : C.rect.width * C.rect.height < M.rect.width * M.rect.height ? 1 : 0;
2054
+ });
2055
+ for (var m = 0; m < s.length; m++) {
2056
+ var R = s[m];
2057
+ A.rows.length == 0 ? this.insertNodeToRow(A, R, 0, f) : this.canAddHorizontal(A, R.rect.width, R.rect.height) ? this.insertNodeToRow(A, R, this.getShortestRowIndex(A), f) : this.insertNodeToRow(A, R, A.rows.length, f), this.shiftToLastRow(A);
2058
+ }
2059
+ return A;
2060
+ }, y.prototype.insertNodeToRow = function(s, f, c, E) {
2061
+ var A = E;
2062
+ if (c == s.rows.length) {
2063
+ var m = [];
2064
+ s.rows.push(m), s.rowWidth.push(A), s.rowHeight.push(0);
2065
+ }
2066
+ var R = s.rowWidth[c] + f.rect.width;
2067
+ s.rows[c].length > 0 && (R += s.horizontalPadding), s.rowWidth[c] = R, s.width < R && (s.width = R);
2068
+ var C = f.rect.height;
2069
+ c > 0 && (C += s.verticalPadding);
2070
+ var M = 0;
2071
+ C > s.rowHeight[c] && (M = s.rowHeight[c], s.rowHeight[c] = C, M = s.rowHeight[c] - M), s.height += M, s.rows[c].push(f);
2072
+ }, y.prototype.getShortestRowIndex = function(s) {
2073
+ for (var f = -1, c = Number.MAX_VALUE, E = 0; E < s.rows.length; E++)
2074
+ s.rowWidth[E] < c && (f = E, c = s.rowWidth[E]);
2075
+ return f;
2076
+ }, y.prototype.getLongestRowIndex = function(s) {
2077
+ for (var f = -1, c = Number.MIN_VALUE, E = 0; E < s.rows.length; E++)
2078
+ s.rowWidth[E] > c && (f = E, c = s.rowWidth[E]);
2079
+ return f;
2080
+ }, y.prototype.canAddHorizontal = function(s, f, c) {
2081
+ var E = this.getShortestRowIndex(s);
2082
+ if (E < 0)
2083
+ return !0;
2084
+ var A = s.rowWidth[E];
2085
+ if (A + s.horizontalPadding + f <= s.width) return !0;
2086
+ var m = 0;
2087
+ s.rowHeight[E] < c && E > 0 && (m = c + s.verticalPadding - s.rowHeight[E]);
2088
+ var R;
2089
+ s.width - A >= f + s.horizontalPadding ? R = (s.height + m) / (A + f + s.horizontalPadding) : R = (s.height + m) / s.width, m = c + s.verticalPadding;
2090
+ var C;
2091
+ return s.width < f ? C = (s.height + m) / f : C = (s.height + m) / s.width, C < 1 && (C = 1 / C), R < 1 && (R = 1 / R), R < C;
2092
+ }, y.prototype.shiftToLastRow = function(s) {
2093
+ var f = this.getLongestRowIndex(s), c = s.rowWidth.length - 1, E = s.rows[f], A = E[E.length - 1], m = A.width + s.horizontalPadding;
2094
+ if (s.width - s.rowWidth[c] > m && f != c) {
2095
+ E.splice(-1, 1), s.rows[c].push(A), s.rowWidth[f] = s.rowWidth[f] - m, s.rowWidth[c] = s.rowWidth[c] + m, s.width = s.rowWidth[instance.getLongestRowIndex(s)];
2096
+ for (var R = Number.MIN_VALUE, C = 0; C < E.length; C++)
2097
+ E[C].height > R && (R = E[C].height);
2098
+ f > 0 && (R += s.verticalPadding);
2099
+ var M = s.rowHeight[f] + s.rowHeight[c];
2100
+ s.rowHeight[f] = R, s.rowHeight[c] < A.height + s.verticalPadding && (s.rowHeight[c] = A.height + s.verticalPadding);
2101
+ var S = s.rowHeight[f] + s.rowHeight[c];
2102
+ s.height += S - M, this.shiftToLastRow(s);
2103
+ }
2104
+ }, y.prototype.tilingPreLayout = function() {
2105
+ n.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
2106
+ }, y.prototype.tilingPostLayout = function() {
2107
+ n.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
2108
+ }, y.prototype.reduceTrees = function() {
2109
+ for (var s = [], f = !0, c; f; ) {
2110
+ var E = this.graphManager.getAllNodes(), A = [];
2111
+ f = !1;
2112
+ for (var m = 0; m < E.length; m++)
2113
+ c = E[m], c.getEdges().length == 1 && !c.getEdges()[0].isInterGraph && c.getChild() == null && (A.push([c, c.getEdges()[0], c.getOwner()]), f = !0);
2114
+ if (f == !0) {
2115
+ for (var R = [], C = 0; C < A.length; C++)
2116
+ A[C][0].getEdges().length == 1 && (R.push(A[C]), A[C][0].getOwner().remove(A[C][0]));
2117
+ s.push(R), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2118
+ }
2119
+ }
2120
+ this.prunedNodesAll = s;
2121
+ }, y.prototype.growTree = function(s) {
2122
+ for (var f = s.length, c = s[f - 1], E, A = 0; A < c.length; A++)
2123
+ E = c[A], this.findPlaceforPrunedNode(E), E[2].add(E[0]), E[2].add(E[1], E[1].source, E[1].target);
2124
+ s.splice(s.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2125
+ }, y.prototype.findPlaceforPrunedNode = function(s) {
2126
+ var f, c, E = s[0];
2127
+ E == s[1].source ? c = s[1].target : c = s[1].source;
2128
+ var A = c.startX, m = c.finishX, R = c.startY, C = c.finishY, M = 0, S = 0, Y = 0, w = 0, x = [M, Y, S, w];
2129
+ if (R > 0)
2130
+ for (var F = A; F <= m; F++)
2131
+ x[0] += this.grid[F][R - 1].length + this.grid[F][R].length - 1;
2132
+ if (m < this.grid.length - 1)
2133
+ for (var F = R; F <= C; F++)
2134
+ x[1] += this.grid[m + 1][F].length + this.grid[m][F].length - 1;
2135
+ if (C < this.grid[0].length - 1)
2136
+ for (var F = A; F <= m; F++)
2137
+ x[2] += this.grid[F][C + 1].length + this.grid[F][C].length - 1;
2138
+ if (A > 0)
2139
+ for (var F = R; F <= C; F++)
2140
+ x[3] += this.grid[A - 1][F].length + this.grid[A][F].length - 1;
2141
+ for (var U = v.MAX_VALUE, P, _, X = 0; X < x.length; X++)
2142
+ x[X] < U ? (U = x[X], P = 1, _ = X) : x[X] == U && P++;
2143
+ if (P == 3 && U == 0)
2144
+ x[0] == 0 && x[1] == 0 && x[2] == 0 ? f = 1 : x[0] == 0 && x[1] == 0 && x[3] == 0 ? f = 0 : x[0] == 0 && x[2] == 0 && x[3] == 0 ? f = 3 : x[1] == 0 && x[2] == 0 && x[3] == 0 && (f = 2);
2145
+ else if (P == 2 && U == 0) {
2146
+ var H = Math.floor(Math.random() * 2);
2147
+ x[0] == 0 && x[1] == 0 ? H == 0 ? f = 0 : f = 1 : x[0] == 0 && x[2] == 0 ? H == 0 ? f = 0 : f = 2 : x[0] == 0 && x[3] == 0 ? H == 0 ? f = 0 : f = 3 : x[1] == 0 && x[2] == 0 ? H == 0 ? f = 1 : f = 2 : x[1] == 0 && x[3] == 0 ? H == 0 ? f = 1 : f = 3 : H == 0 ? f = 2 : f = 3;
2148
+ } else if (P == 4 && U == 0) {
2149
+ var H = Math.floor(Math.random() * 4);
2150
+ f = H;
2151
+ } else
2152
+ f = _;
2153
+ f == 0 ? E.setCenter(c.getCenterX(), c.getCenterY() - c.getHeight() / 2 - d.DEFAULT_EDGE_LENGTH - E.getHeight() / 2) : f == 1 ? E.setCenter(c.getCenterX() + c.getWidth() / 2 + d.DEFAULT_EDGE_LENGTH + E.getWidth() / 2, c.getCenterY()) : f == 2 ? E.setCenter(c.getCenterX(), c.getCenterY() + c.getHeight() / 2 + d.DEFAULT_EDGE_LENGTH + E.getHeight() / 2) : E.setCenter(c.getCenterX() - c.getWidth() / 2 - d.DEFAULT_EDGE_LENGTH - E.getWidth() / 2, c.getCenterY());
2154
+ }, I.exports = y;
2155
+ },
2156
+ /* 7 */
2157
+ /***/
2158
+ function(I, L, o) {
2159
+ var e = {};
2160
+ e.layoutBase = o(0), e.CoSEConstants = o(1), e.CoSEEdge = o(2), e.CoSEGraph = o(3), e.CoSEGraphManager = o(4), e.CoSELayout = o(6), e.CoSENode = o(5), I.exports = e;
2161
+ }
2162
+ /******/
2163
+ ])
2164
+ );
2165
+ });
2166
+ }(Z)), Z.exports;
2167
+ }
2168
+ (function(G, b) {
2169
+ (function(I, L) {
2170
+ G.exports = L(ft());
2171
+ })($, function(N) {
2172
+ return (
2173
+ /******/
2174
+ function(I) {
2175
+ var L = {};
2176
+ function o(e) {
2177
+ if (L[e])
2178
+ return L[e].exports;
2179
+ var t = L[e] = {
2180
+ /******/
2181
+ i: e,
2182
+ /******/
2183
+ l: !1,
2184
+ /******/
2185
+ exports: {}
2186
+ /******/
2187
+ };
2188
+ return I[e].call(t.exports, t, t.exports, o), t.l = !0, t.exports;
2189
+ }
2190
+ return o.m = I, o.c = L, o.i = function(e) {
2191
+ return e;
2192
+ }, o.d = function(e, t, i) {
2193
+ o.o(e, t) || Object.defineProperty(e, t, {
2194
+ /******/
2195
+ configurable: !1,
2196
+ /******/
2197
+ enumerable: !0,
2198
+ /******/
2199
+ get: i
2200
+ /******/
2201
+ });
2202
+ }, o.n = function(e) {
2203
+ var t = e && e.__esModule ? (
2204
+ /******/
2205
+ function() {
2206
+ return e.default;
2207
+ }
2208
+ ) : (
2209
+ /******/
2210
+ function() {
2211
+ return e;
2212
+ }
2213
+ );
2214
+ return o.d(t, "a", t), t;
2215
+ }, o.o = function(e, t) {
2216
+ return Object.prototype.hasOwnProperty.call(e, t);
2217
+ }, o.p = "", o(o.s = 1);
2218
+ }([
2219
+ /* 0 */
2220
+ /***/
2221
+ function(I, L) {
2222
+ I.exports = N;
2223
+ },
2224
+ /* 1 */
2225
+ /***/
2226
+ function(I, L, o) {
2227
+ var e = o(0).layoutBase.LayoutConstants, t = o(0).layoutBase.FDLayoutConstants, i = o(0).CoSEConstants, l = o(0).CoSELayout, g = o(0).CoSENode, n = o(0).layoutBase.PointD, d = o(0).layoutBase.DimensionD, r = {
2228
+ // Called on `layoutready`
2229
+ ready: function() {
2230
+ },
2231
+ // Called on `layoutstop`
2232
+ stop: function() {
2233
+ },
2234
+ // 'draft', 'default' or 'proof"
2235
+ // - 'draft' fast cooling rate
2236
+ // - 'default' moderate cooling rate
2237
+ // - "proof" slow cooling rate
2238
+ quality: "default",
2239
+ // include labels in node dimensions
2240
+ nodeDimensionsIncludeLabels: !1,
2241
+ // number of ticks per frame; higher is faster but more jerky
2242
+ refresh: 30,
2243
+ // Whether to fit the network view after when done
2244
+ fit: !0,
2245
+ // Padding on fit
2246
+ padding: 10,
2247
+ // Whether to enable incremental mode
2248
+ randomize: !0,
2249
+ // Node repulsion (non overlapping) multiplier
2250
+ nodeRepulsion: 4500,
2251
+ // Ideal edge (non nested) length
2252
+ idealEdgeLength: 50,
2253
+ // Divisor to compute edge forces
2254
+ edgeElasticity: 0.45,
2255
+ // Nesting factor (multiplier) to compute ideal edge length for nested edges
2256
+ nestingFactor: 0.1,
2257
+ // Gravity force (constant)
2258
+ gravity: 0.25,
2259
+ // Maximum number of iterations to perform
2260
+ numIter: 2500,
2261
+ // For enabling tiling
2262
+ tile: !0,
2263
+ // Type of layout animation. The option set is {'during', 'end', false}
2264
+ animate: "end",
2265
+ // Duration for animate:end
2266
+ animationDuration: 500,
2267
+ // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
2268
+ tilingPaddingVertical: 10,
2269
+ // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
2270
+ tilingPaddingHorizontal: 10,
2271
+ // Gravity range (constant) for compounds
2272
+ gravityRangeCompound: 1.5,
2273
+ // Gravity force (constant) for compounds
2274
+ gravityCompound: 1,
2275
+ // Gravity range (constant)
2276
+ gravityRange: 3.8,
2277
+ // Initial cooling factor for incremental layout
2278
+ initialEnergyOnIncremental: 0.5
2279
+ };
2280
+ function h(D, u) {
2281
+ var T = {};
2282
+ for (var y in D)
2283
+ T[y] = D[y];
2284
+ for (var y in u)
2285
+ T[y] = u[y];
2286
+ return T;
2287
+ }
2288
+ function a(D) {
2289
+ this.options = h(r, D), p(this.options);
2290
+ }
2291
+ var p = function(u) {
2292
+ u.nodeRepulsion != null && (i.DEFAULT_REPULSION_STRENGTH = t.DEFAULT_REPULSION_STRENGTH = u.nodeRepulsion), u.idealEdgeLength != null && (i.DEFAULT_EDGE_LENGTH = t.DEFAULT_EDGE_LENGTH = u.idealEdgeLength), u.edgeElasticity != null && (i.DEFAULT_SPRING_STRENGTH = t.DEFAULT_SPRING_STRENGTH = u.edgeElasticity), u.nestingFactor != null && (i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = u.nestingFactor), u.gravity != null && (i.DEFAULT_GRAVITY_STRENGTH = t.DEFAULT_GRAVITY_STRENGTH = u.gravity), u.numIter != null && (i.MAX_ITERATIONS = t.MAX_ITERATIONS = u.numIter), u.gravityRange != null && (i.DEFAULT_GRAVITY_RANGE_FACTOR = t.DEFAULT_GRAVITY_RANGE_FACTOR = u.gravityRange), u.gravityCompound != null && (i.DEFAULT_COMPOUND_GRAVITY_STRENGTH = t.DEFAULT_COMPOUND_GRAVITY_STRENGTH = u.gravityCompound), u.gravityRangeCompound != null && (i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = u.gravityRangeCompound), u.initialEnergyOnIncremental != null && (i.DEFAULT_COOLING_FACTOR_INCREMENTAL = t.DEFAULT_COOLING_FACTOR_INCREMENTAL = u.initialEnergyOnIncremental), u.quality == "draft" ? e.QUALITY = 0 : u.quality == "proof" ? e.QUALITY = 2 : e.QUALITY = 1, i.NODE_DIMENSIONS_INCLUDE_LABELS = t.NODE_DIMENSIONS_INCLUDE_LABELS = e.NODE_DIMENSIONS_INCLUDE_LABELS = u.nodeDimensionsIncludeLabels, i.DEFAULT_INCREMENTAL = t.DEFAULT_INCREMENTAL = e.DEFAULT_INCREMENTAL = !u.randomize, i.ANIMATE = t.ANIMATE = e.ANIMATE = u.animate, i.TILE = u.tile, i.TILING_PADDING_VERTICAL = typeof u.tilingPaddingVertical == "function" ? u.tilingPaddingVertical.call() : u.tilingPaddingVertical, i.TILING_PADDING_HORIZONTAL = typeof u.tilingPaddingHorizontal == "function" ? u.tilingPaddingHorizontal.call() : u.tilingPaddingHorizontal;
2293
+ };
2294
+ a.prototype.run = function() {
2295
+ var D, u, T = this.options;
2296
+ this.idToLNode = {};
2297
+ var y = this.layout = new l(), O = this;
2298
+ O.stopped = !1, this.cy = this.options.cy, this.cy.trigger({ type: "layoutstart", layout: this });
2299
+ var s = y.newGraphManager();
2300
+ this.gm = s;
2301
+ var f = this.options.eles.nodes(), c = this.options.eles.edges();
2302
+ this.root = s.addRoot(), this.processChildrenList(this.root, this.getTopMostNodes(f), y);
2303
+ for (var E = 0; E < c.length; E++) {
2304
+ var A = c[E], m = this.idToLNode[A.data("source")], R = this.idToLNode[A.data("target")];
2305
+ if (m !== R && m.getEdgesBetween(R).length == 0) {
2306
+ var C = s.add(y.newEdge(), m, R);
2307
+ C.id = A.id();
2308
+ }
2309
+ }
2310
+ var M = function(w, x) {
2311
+ typeof w == "number" && (w = x);
2312
+ var F = w.data("id"), U = O.idToLNode[F];
2313
+ return {
2314
+ x: U.getRect().getCenterX(),
2315
+ y: U.getRect().getCenterY()
2316
+ };
2317
+ }, S = function Y() {
2318
+ for (var w = function() {
2319
+ T.fit && T.cy.fit(T.eles, T.padding), D || (D = !0, O.cy.one("layoutready", T.ready), O.cy.trigger({ type: "layoutready", layout: O }));
2320
+ }, x = O.options.refresh, F, U = 0; U < x && !F; U++)
2321
+ F = O.stopped || O.layout.tick();
2322
+ if (F) {
2323
+ y.checkLayoutSuccess() && !y.isSubLayout && y.doPostLayout(), y.tilingPostLayout && y.tilingPostLayout(), y.isLayoutFinished = !0, O.options.eles.nodes().positions(M), w(), O.cy.one("layoutstop", O.options.stop), O.cy.trigger({ type: "layoutstop", layout: O }), u && cancelAnimationFrame(u), D = !1;
2324
+ return;
2325
+ }
2326
+ var P = O.layout.getPositionsData();
2327
+ T.eles.nodes().positions(function(_, X) {
2328
+ if (typeof _ == "number" && (_ = X), !_.isParent()) {
2329
+ for (var H = _.id(), W = P[H], B = _; W == null && (W = P[B.data("parent")] || P["DummyCompound_" + B.data("parent")], P[H] = W, B = B.parent()[0], B != null); )
2330
+ ;
2331
+ return W != null ? {
2332
+ x: W.x,
2333
+ y: W.y
2334
+ } : {
2335
+ x: _.position("x"),
2336
+ y: _.position("y")
2337
+ };
2338
+ }
2339
+ }), w(), u = requestAnimationFrame(Y);
2340
+ };
2341
+ return y.addListener("layoutstarted", function() {
2342
+ O.options.animate === "during" && (u = requestAnimationFrame(S));
2343
+ }), y.runLayout(), this.options.animate !== "during" && (O.options.eles.nodes().not(":parent").layoutPositions(O, O.options, M), D = !1), this;
2344
+ }, a.prototype.getTopMostNodes = function(D) {
2345
+ for (var u = {}, T = 0; T < D.length; T++)
2346
+ u[D[T].id()] = !0;
2347
+ var y = D.filter(function(O, s) {
2348
+ typeof O == "number" && (O = s);
2349
+ for (var f = O.parent()[0]; f != null; ) {
2350
+ if (u[f.id()])
2351
+ return !1;
2352
+ f = f.parent()[0];
2353
+ }
2354
+ return !0;
2355
+ });
2356
+ return y;
2357
+ }, a.prototype.processChildrenList = function(D, u, T) {
2358
+ for (var y = u.length, O = 0; O < y; O++) {
2359
+ var s = u[O], f = s.children(), c, E = s.layoutDimensions({
2360
+ nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels
2361
+ });
2362
+ if (s.outerWidth() != null && s.outerHeight() != null ? c = D.add(new g(T.graphManager, new n(s.position("x") - E.w / 2, s.position("y") - E.h / 2), new d(parseFloat(E.w), parseFloat(E.h)))) : c = D.add(new g(this.graphManager)), c.id = s.data("id"), c.paddingLeft = parseInt(s.css("padding")), c.paddingTop = parseInt(s.css("padding")), c.paddingRight = parseInt(s.css("padding")), c.paddingBottom = parseInt(s.css("padding")), this.options.nodeDimensionsIncludeLabels && s.isParent()) {
2363
+ var A = s.boundingBox({ includeLabels: !0, includeNodes: !1 }).w, m = s.boundingBox({ includeLabels: !0, includeNodes: !1 }).h, R = s.css("text-halign");
2364
+ c.labelWidth = A, c.labelHeight = m, c.labelPos = R;
2365
+ }
2366
+ if (this.idToLNode[s.data("id")] = c, isNaN(c.rect.x) && (c.rect.x = 0), isNaN(c.rect.y) && (c.rect.y = 0), f != null && f.length > 0) {
2367
+ var C;
2368
+ C = T.getGraphManager().add(T.newGraph(), c), this.processChildrenList(C, f, T);
2369
+ }
2370
+ }
2371
+ }, a.prototype.stop = function() {
2372
+ return this.stopped = !0, this;
2373
+ };
2374
+ var v = function(u) {
2375
+ u("layout", "cose-bilkent", a);
2376
+ };
2377
+ typeof cytoscape < "u" && v(cytoscape), I.exports = v;
2378
+ }
2379
+ /******/
2380
+ ])
2381
+ );
2382
+ });
2383
+ })(tt);
2384
+ var ct = tt.exports;
2385
+ const pt = /* @__PURE__ */ lt(ct);
2386
+ z.use(pt);
2387
+ function et(G, b) {
2388
+ G.forEach((N) => {
2389
+ const I = {
2390
+ id: N.id,
2391
+ labelText: N.label,
2392
+ height: N.height,
2393
+ width: N.width,
2394
+ padding: N.padding ?? 0
2395
+ };
2396
+ Object.keys(N).forEach((L) => {
2397
+ ["id", "label", "height", "width", "padding", "x", "y"].includes(L) || (I[L] = N[L]);
2398
+ }), b.add({
2399
+ group: "nodes",
2400
+ data: I,
2401
+ position: {
2402
+ x: N.x ?? 0,
2403
+ y: N.y ?? 0
2404
+ }
2405
+ });
2406
+ });
2407
+ }
2408
+ V(et, "addNodes");
2409
+ function rt(G, b) {
2410
+ G.forEach((N) => {
2411
+ const I = {
2412
+ id: N.id,
2413
+ source: N.start,
2414
+ target: N.end
2415
+ };
2416
+ Object.keys(N).forEach((L) => {
2417
+ ["id", "start", "end"].includes(L) || (I[L] = N[L]);
2418
+ }), b.add({
2419
+ group: "edges",
2420
+ data: I
2421
+ });
2422
+ });
2423
+ }
2424
+ V(rt, "addEdges");
2425
+ function it(G) {
2426
+ return new Promise((b) => {
2427
+ const N = gt("body").append("div").attr("id", "cy").attr("style", "display:none"), I = z({
2428
+ container: document.getElementById("cy"),
2429
+ // container to render in
2430
+ style: [
2431
+ {
2432
+ selector: "edge",
2433
+ style: {
2434
+ "curve-style": "bezier"
2435
+ }
2436
+ }
2437
+ ]
2438
+ });
2439
+ N.remove(), et(G.nodes, I), rt(G.edges, I), I.nodes().forEach(function(o) {
2440
+ o.layoutDimensions = () => {
2441
+ const e = o.data();
2442
+ return { w: e.width, h: e.height };
2443
+ };
2444
+ });
2445
+ const L = {
2446
+ name: "cose-bilkent",
2447
+ // @ts-ignore Types for cose-bilkent are not correct?
2448
+ quality: "proof",
2449
+ styleEnabled: !1,
2450
+ animate: !1
2451
+ };
2452
+ I.layout(L).run(), I.ready((o) => {
2453
+ k.info("Cytoscape ready", o), b(I);
2454
+ });
2455
+ });
2456
+ }
2457
+ V(it, "createCytoscapeInstance");
2458
+ function nt(G) {
2459
+ return G.nodes().map((b) => {
2460
+ const N = b.data(), I = b.position(), L = {
2461
+ id: N.id,
2462
+ x: I.x,
2463
+ y: I.y
2464
+ };
2465
+ return Object.keys(N).forEach((o) => {
2466
+ o !== "id" && (L[o] = N[o]);
2467
+ }), L;
2468
+ });
2469
+ }
2470
+ V(nt, "extractPositionedNodes");
2471
+ function ot(G) {
2472
+ return G.edges().map((b) => {
2473
+ const N = b.data(), I = b._private.rscratch, L = {
2474
+ id: N.id,
2475
+ source: N.source,
2476
+ target: N.target,
2477
+ startX: I.startX,
2478
+ startY: I.startY,
2479
+ midX: I.midX,
2480
+ midY: I.midY,
2481
+ endX: I.endX,
2482
+ endY: I.endY
2483
+ };
2484
+ return Object.keys(N).forEach((o) => {
2485
+ ["id", "source", "target"].includes(o) || (L[o] = N[o]);
2486
+ }), L;
2487
+ });
2488
+ }
2489
+ V(ot, "extractPositionedEdges");
2490
+ async function st(G, b) {
2491
+ k.debug("Starting cose-bilkent layout algorithm");
2492
+ try {
2493
+ at(G);
2494
+ const N = await it(G), I = nt(N), L = ot(N);
2495
+ return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`), {
2496
+ nodes: I,
2497
+ edges: L
2498
+ };
2499
+ } catch (N) {
2500
+ throw k.error("Error in cose-bilkent layout algorithm:", N), N;
2501
+ }
2502
+ }
2503
+ V(st, "executeCoseBilkentLayout");
2504
+ function at(G) {
2505
+ if (!G)
2506
+ throw new Error("Layout data is required");
2507
+ if (!G.config)
2508
+ throw new Error("Configuration is required in layout data");
2509
+ if (!G.rootNode)
2510
+ throw new Error("Root node is required");
2511
+ if (!G.nodes || !Array.isArray(G.nodes))
2512
+ throw new Error("No nodes found in layout data");
2513
+ if (!Array.isArray(G.edges))
2514
+ throw new Error("Edges array is required in layout data");
2515
+ return !0;
2516
+ }
2517
+ V(at, "validateLayoutData");
2518
+ var dt = /* @__PURE__ */ V(async (G, b, {
2519
+ insertCluster: N,
2520
+ insertEdge: I,
2521
+ insertEdgeLabel: L,
2522
+ insertMarkers: o,
2523
+ insertNode: e,
2524
+ log: t,
2525
+ positionEdgeLabel: i
2526
+ }, { algorithm: l }) => {
2527
+ const g = {}, n = {}, d = b.select("g");
2528
+ o(d, G.markers, G.type, G.diagramId);
2529
+ const r = d.insert("g").attr("class", "subgraphs"), h = d.insert("g").attr("class", "edgePaths"), a = d.insert("g").attr("class", "edgeLabels"), p = d.insert("g").attr("class", "nodes");
2530
+ t.debug("Inserting nodes into DOM for dimension calculation"), await Promise.all(
2531
+ G.nodes.map(async (u) => {
2532
+ if (u.isGroup) {
2533
+ const T = { ...u };
2534
+ n[u.id] = T, g[u.id] = T, await N(r, u);
2535
+ } else {
2536
+ const T = { ...u };
2537
+ g[u.id] = T;
2538
+ const y = await e(p, u, {
2539
+ config: G.config,
2540
+ dir: G.direction || "TB"
2541
+ }), O = y.node().getBBox();
2542
+ T.width = O.width, T.height = O.height, T.domId = y, t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`);
2543
+ }
2544
+ })
2545
+ ), t.debug("Running cose-bilkent layout algorithm");
2546
+ const v = {
2547
+ ...G,
2548
+ nodes: G.nodes.map((u) => {
2549
+ const T = g[u.id];
2550
+ return {
2551
+ ...u,
2552
+ width: T.width,
2553
+ height: T.height
2554
+ };
2555
+ })
2556
+ }, D = await st(v, G.config);
2557
+ t.debug("Positioning nodes based on layout results"), D.nodes.forEach((u) => {
2558
+ const T = g[u.id];
2559
+ T?.domId && (T.domId.attr(
2560
+ "transform",
2561
+ `translate(${u.x}, ${u.y})`
2562
+ ), T.x = u.x, T.y = u.y, t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`));
2563
+ }), D.edges.forEach((u) => {
2564
+ const T = G.edges.find((y) => y.id === u.id);
2565
+ T && (T.points = [
2566
+ { x: u.startX, y: u.startY },
2567
+ { x: u.midX, y: u.midY },
2568
+ { x: u.endX, y: u.endY }
2569
+ ]);
2570
+ }), t.debug("Inserting and positioning edges"), await Promise.all(
2571
+ G.edges.map(async (u) => {
2572
+ await L(a, u);
2573
+ const T = g[u.start ?? ""], y = g[u.end ?? ""];
2574
+ if (T && y) {
2575
+ const O = D.edges.find((s) => s.id === u.id);
2576
+ if (O) {
2577
+ t.debug("APA01 positionedEdge", O);
2578
+ const s = { ...u }, f = I(
2579
+ h,
2580
+ s,
2581
+ n,
2582
+ G.type,
2583
+ T,
2584
+ y,
2585
+ G.diagramId
2586
+ );
2587
+ i(s, f);
2588
+ } else {
2589
+ const s = {
2590
+ ...u,
2591
+ points: [
2592
+ { x: T.x || 0, y: T.y || 0 },
2593
+ { x: y.x || 0, y: y.y || 0 }
2594
+ ]
2595
+ }, f = I(
2596
+ h,
2597
+ s,
2598
+ n,
2599
+ G.type,
2600
+ T,
2601
+ y,
2602
+ G.diagramId
2603
+ );
2604
+ i(s, f);
2605
+ }
2606
+ }
2607
+ })
2608
+ ), t.debug("Cose-bilkent rendering completed");
2609
+ }, "render"), Lt = dt;
2610
+ export {
2611
+ Lt as render
2612
+ };