@versini/sassysaint 8.109.0 → 8.109.2

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 (88) hide show
  1. package/dist/chunks/{AboutChangelog.BRT56BDz.js → AboutChangelog.BSdcqHox.js} +2 -2
  2. package/dist/chunks/{AboutEntry.CMdPepoL.js → AboutEntry.CAewlRU7.js} +7 -7
  3. package/dist/chunks/{App.Wt9DAZC-.js → App.Ck18sHiX.js} +1926 -1910
  4. package/dist/chunks/{Bubble.DHQ4RPG6.js → Bubble.B6v5eAOZ.js} +1 -1
  5. package/dist/chunks/{ButtonIconDelete.BiZeGt0X.js → ButtonIconDelete.jqbd7Q9b.js} +2 -2
  6. package/dist/chunks/{Chart.D8o5vo-h.js → Chart.BIy5YDm2.js} +2 -2
  7. package/dist/chunks/{ChatBubbleAssistant.BtddW9mU.js → ChatBubbleAssistant.CN-iqEkP.js} +4 -4
  8. package/dist/chunks/{ChatBubbleUser.CbmwaMlm.js → ChatBubbleUser.D4OLR3vD.js} +3 -3
  9. package/dist/chunks/{ChatHistoryTable.DKqwrBKD.js → ChatHistoryTable.ZOLprzfc.js} +4 -4
  10. package/dist/chunks/HistoryEntry.DY5WIpTu.js +373 -0
  11. package/dist/chunks/{LoginEntry.DBwmp8As.js → LoginEntry.CC1V4TOR.js} +4 -4
  12. package/dist/chunks/{LogoEntry.SOgHBcue.js → LogoEntry.B1e2c-s0.js} +1 -1
  13. package/dist/chunks/{MemoriesEntry.CITyGK6c.js → MemoriesEntry.CVrI1Ter.js} +5 -5
  14. package/dist/chunks/ProfileEntry.VlRvWAq4.js +213 -0
  15. package/dist/chunks/{SettingsEntry.D3L4l7IC.js → SettingsEntry.BxF_ZqA5.js} +5 -5
  16. package/dist/chunks/{UsageEntry.CmdeJLIV.js → UsageEntry.DHYx6GmN.js} +5 -5
  17. package/dist/chunks/_baseUniq.B6Gcl5nF.js +477 -0
  18. package/dist/chunks/{arc.B-ORIToq.js → arc.w_BReByh.js} +1 -1
  19. package/dist/chunks/{architecture-U656AL7Q.CB6_RZNp.js → architecture-U656AL7Q.BPCpLHAc.js} +1 -1
  20. package/dist/chunks/{architectureDiagram-VXUJARFQ.C7qK6HYe.js → architectureDiagram-VXUJARFQ.D96Sa2WG.js} +4 -4
  21. package/dist/chunks/{blockDiagram-VD42YOAC.DwHlAQP2.js → blockDiagram-VD42YOAC.fDjFSO1h.js} +5 -5
  22. package/dist/chunks/{browser.6DQmJHgS.js → browser.Cb_vr1PR.js} +1 -1
  23. package/dist/chunks/{c4Diagram-YG6GDRKO.CVlKk_bX.js → c4Diagram-YG6GDRKO.U8IWA3ML.js} +2 -2
  24. package/dist/chunks/{channel.Cp5WxJIQ.js → channel.Dw9Rrvd2.js} +1 -1
  25. package/dist/chunks/{chunk-4BX2VUAB.WBa0Ue2n.js → chunk-4BX2VUAB.Cio3OsS-.js} +1 -1
  26. package/dist/chunks/{chunk-55IACEB6.RtaLYhpZ.js → chunk-55IACEB6.CFaFqBKt.js} +1 -1
  27. package/dist/chunks/{chunk-B4BG7PRW.EjCIJ_Sg.js → chunk-B4BG7PRW.DGkVxxTo.js} +4 -4
  28. package/dist/chunks/{chunk-DI55MBZ5.-iqCDsf4.js → chunk-DI55MBZ5.DsnidbDu.js} +3 -3
  29. package/dist/chunks/{chunk-FMBD7UC4.Bd4tH_tI.js → chunk-FMBD7UC4.DTxRjjKJ.js} +1 -1
  30. package/dist/chunks/{chunk-QN33PNHL.BFvp5Q5Y.js → chunk-QN33PNHL.CuRPKMac.js} +1 -1
  31. package/dist/chunks/{chunk-QZHKN3VN.BfDkJcT4.js → chunk-QZHKN3VN.CntLD_-Z.js} +1 -1
  32. package/dist/chunks/{chunk-TZMSLE5B.CNZv5C8k.js → chunk-TZMSLE5B.B7_0n6Dd.js} +1 -1
  33. package/dist/chunks/{classDiagram-2ON5EDUG.D528Q0vD.js → classDiagram-2ON5EDUG.BJsNaiPY.js} +2 -2
  34. package/dist/chunks/{classDiagram-v2-WZHVMYZB.D528Q0vD.js → classDiagram-v2-WZHVMYZB.BJsNaiPY.js} +2 -2
  35. package/dist/chunks/{clone.oQvm9kWF.js → clone.BFX0o9-g.js} +1 -1
  36. package/dist/chunks/{cose-bilkent-S5V4N54A.C8MGhXyb.js → cose-bilkent-S5V4N54A.CJtHnhhQ.js} +2 -2
  37. package/dist/chunks/{dagre-6UL2VRFP.C70R4kjG.js → dagre-6UL2VRFP.CuwjO6gV.js} +21 -22
  38. package/dist/chunks/{diagram-PSM6KHXK.a0yfWeeT.js → diagram-PSM6KHXK.CnNu5_LM.js} +4 -4
  39. package/dist/chunks/{diagram-QEK2KX5R.CHu0oabd.js → diagram-QEK2KX5R.D74ae4xj.js} +3 -3
  40. package/dist/chunks/{diagram-S2PKOQOG.DtAmuun8.js → diagram-S2PKOQOG.C_JbSw1v.js} +3 -3
  41. package/dist/chunks/{erDiagram-Q2GNP2WA.CAVJYpQJ.js → erDiagram-Q2GNP2WA.Bu-foyWC.js} +4 -4
  42. package/dist/chunks/{flowDiagram-NV44I4VS.DpHS6qne.js → flowDiagram-NV44I4VS.YDgJ2OQY.js} +5 -5
  43. package/dist/chunks/{ganttDiagram-JELNMOA3.DFb9KpTj.js → ganttDiagram-JELNMOA3.ymNQ3Hoy.js} +2 -2
  44. package/dist/chunks/{gitGraph-F6HP7TQM.BBgVCGPo.js → gitGraph-F6HP7TQM.D-mPOTEU.js} +1 -1
  45. package/dist/chunks/{gitGraphDiagram-NY62KEGX.CmGPx1Oe.js → gitGraphDiagram-NY62KEGX.jrbht_5k.js} +4 -4
  46. package/dist/chunks/graph.Dw24ucCU.js +381 -0
  47. package/dist/chunks/{index.DMdseE_T.js → index.BGnEq9eh.js} +1 -1
  48. package/dist/chunks/{index.Dfo3o3CL.js → index.BzMdQGY-.js} +1 -1
  49. package/dist/chunks/{index.Df8WXgco.js → index.CQg0p3pG.js} +1 -1
  50. package/dist/chunks/{index.Cqc0UUEV.js → index.Ci301JK4.js} +1 -1
  51. package/dist/chunks/{index.0CebFe3S.js → index.CmK3RbmJ.js} +1 -1
  52. package/dist/chunks/{index.oY04wf0d.js → index.CmWau6U1.js} +4 -4
  53. package/dist/chunks/{index.Bn0jEzpb.js → index.Cn19xWGt.js} +3 -3
  54. package/dist/chunks/{index.0AN8Lw62.js → index.D5R76Qhp.js} +2 -2
  55. package/dist/chunks/{index.CIxznrNX.js → index.KPs76GKZ.js} +1 -1
  56. package/dist/chunks/{info-NVLQJR56.BRzS8nLx.js → info-NVLQJR56.CzwKOAh7.js} +1 -1
  57. package/dist/chunks/{infoDiagram-WHAUD3N6.CPQxCCp4.js → infoDiagram-WHAUD3N6.au7bTIRT.js} +2 -2
  58. package/dist/chunks/{journeyDiagram-XKPGCS4Q.BUTeu-UH.js → journeyDiagram-XKPGCS4Q.C9l-1F8k.js} +4 -4
  59. package/dist/chunks/{kanban-definition-3W4ZIXB7.YU1qGGzj.js → kanban-definition-3W4ZIXB7.D6Vfi9gE.js} +2 -2
  60. package/dist/chunks/{katex.D0sQThIv.js → katex.6qoCFezb.js} +898 -896
  61. package/dist/chunks/layout.DPHpmMar.js +1438 -0
  62. package/dist/chunks/{mermaid-parser.core.wRlJoAho.js → mermaid-parser.core.DInxEyfY.js} +6567 -5346
  63. package/dist/chunks/min.MWawyr81.js +38 -0
  64. package/dist/chunks/{mindmap-definition-VGOIOE7T.Ci0IapnU.js → mindmap-definition-VGOIOE7T.AmwLTujL.js} +3 -3
  65. package/dist/chunks/{packet-BFZMPI3H.A110pnSV.js → packet-BFZMPI3H.CSmnVpE_.js} +1 -1
  66. package/dist/chunks/{pie-7BOR55EZ.Ww9V4YV2.js → pie-7BOR55EZ.DJwvoEep.js} +1 -1
  67. package/dist/chunks/{pieDiagram-ADFJNKIX.CTPFheKw.js → pieDiagram-ADFJNKIX.Ci_Ogfw5.js} +4 -4
  68. package/dist/chunks/{quadrantDiagram-AYHSOK5B.DcdJijIq.js → quadrantDiagram-AYHSOK5B.DenSBLBq.js} +1 -1
  69. package/dist/chunks/{radar-NHE76QYJ.BU4W5dF0.js → radar-NHE76QYJ.Bs1Xji9w.js} +1 -1
  70. package/dist/chunks/{rehype-mermaid.BZ1zaur1.js → rehype-mermaid.DlMgdumz.js} +34 -36
  71. package/dist/chunks/{requirementDiagram-UZGBJVZJ.CGnhgdQn.js → requirementDiagram-UZGBJVZJ.CjMQhoO7.js} +3 -3
  72. package/dist/chunks/{sankeyDiagram-TZEHDZUN.CF8uSFjn.js → sankeyDiagram-TZEHDZUN.B9hWlv5i.js} +1 -1
  73. package/dist/chunks/{sequenceDiagram-WL72ISMW.BrgYjKXK.js → sequenceDiagram-WL72ISMW.MHpp_BjQ.js} +3 -3
  74. package/dist/chunks/{stateDiagram-FKZM4ZOC.BDnoXzuW.js → stateDiagram-FKZM4ZOC.C4fbHKw_.js} +4 -4
  75. package/dist/chunks/{stateDiagram-v2-4FDKWEC3.DDDvYdXA.js → stateDiagram-v2-4FDKWEC3.ByhBnYKV.js} +2 -2
  76. package/dist/chunks/{timeline-definition-IT6M3QCI.B24o5itR.js → timeline-definition-IT6M3QCI.BVQ3wHwi.js} +2 -2
  77. package/dist/chunks/{treemap-KMMF4GRG.Bl1EPmIr.js → treemap-KMMF4GRG.DCYbqvVC.js} +1 -1
  78. package/dist/chunks/{useMarkdown.GA1S4l3A.js → useMarkdown.4iaTIP2g.js} +1495 -1483
  79. package/dist/chunks/{xychartDiagram-PRI3JC2R.UsbLUEhu.js → xychartDiagram-PRI3JC2R.Dp6iurqL.js} +1 -1
  80. package/dist/components/SassySaint/SassySaint.js +1 -1
  81. package/dist/index.js +3 -3
  82. package/package.json +3 -3
  83. package/dist/chunks/HistoryEntry.DFec1Nmm.js +0 -362
  84. package/dist/chunks/ProfileEntry.BGpx5xaf.js +0 -197
  85. package/dist/chunks/_basePickBy.DH8qu2bB.js +0 -151
  86. package/dist/chunks/_baseUniq.CrQICPim.js +0 -614
  87. package/dist/chunks/graph.CYf6HeGF.js +0 -247
  88. package/dist/chunks/layout.DHq6HJUe.js +0 -1332
@@ -1,1332 +0,0 @@
1
- import { Graph as g } from "./graph.CYf6HeGF.js";
2
- import { baseClone as Te, castFunction as ce, baseForOwn as le, baseIteratee as z, isSymbol as ee, arrayMap as F, baseGet as Ie, hasIn as Me, baseFlatten as Se, toString as je, forEach as s, isUndefined as m, filter as _, values as x, reduce as M } from "./_baseUniq.CrQICPim.js";
3
- import { flatten as O, baseExtremum as he, baseLt as Fe, baseMap as Ve, basePickBy as Ae, toFinite as V, map as w, min as P, has as ve, find as X, last as T, defaults as Be } from "./_basePickBy.DH8qu2bB.js";
4
- import { setToString as Ge, overRest as Ye, baseFor as De, keysIn as $e, baseAssignValue as qe, identity as pe, isArray as we, baseUnary as We, isIterateeCall as $, baseRest as ze, assignValue as Xe, constant$1 as Ue, merge as q } from "./rehype-mermaid.BZ1zaur1.js";
5
- function He(e) {
6
- return Ge(Ye(e, void 0, O), e + "");
7
- }
8
- var Je = 1, Ze = 4;
9
- function Ke(e) {
10
- return Te(e, Je | Ze);
11
- }
12
- function Qe(e, n) {
13
- return e == null ? e : De(e, ce(n), $e);
14
- }
15
- function en(e, n) {
16
- return e && le(e, ce(n));
17
- }
18
- function nn(e, n) {
19
- return e > n;
20
- }
21
- function S(e, n) {
22
- var r = {};
23
- return n = z(n), le(e, function(t, i, a) {
24
- qe(r, i, n(t, i, a));
25
- }), r;
26
- }
27
- function y(e) {
28
- return e && e.length ? he(e, pe, nn) : void 0;
29
- }
30
- function U(e, n) {
31
- return e && e.length ? he(e, z(n), Fe) : void 0;
32
- }
33
- function rn(e, n) {
34
- var r = e.length;
35
- for (e.sort(n); r--; )
36
- e[r] = e[r].value;
37
- return e;
38
- }
39
- function tn(e, n) {
40
- if (e !== n) {
41
- var r = e !== void 0, t = e === null, i = e === e, a = ee(e), o = n !== void 0, u = n === null, d = n === n, f = ee(n);
42
- if (!u && !f && !a && e > n || a && o && d && !u && !f || t && o && d || !r && d || !i)
43
- return 1;
44
- if (!t && !a && !f && e < n || f && r && i && !t && !a || u && r && i || !o && i || !d)
45
- return -1;
46
- }
47
- return 0;
48
- }
49
- function an(e, n, r) {
50
- for (var t = -1, i = e.criteria, a = n.criteria, o = i.length, u = r.length; ++t < o; ) {
51
- var d = tn(i[t], a[t]);
52
- if (d) {
53
- if (t >= u)
54
- return d;
55
- var f = r[t];
56
- return d * (f == "desc" ? -1 : 1);
57
- }
58
- }
59
- return e.index - n.index;
60
- }
61
- function on(e, n, r) {
62
- n.length ? n = F(n, function(a) {
63
- return we(a) ? function(o) {
64
- return Ie(o, a.length === 1 ? a[0] : a);
65
- } : a;
66
- }) : n = [pe];
67
- var t = -1;
68
- n = F(n, We(z));
69
- var i = Ve(e, function(a, o, u) {
70
- var d = F(n, function(f) {
71
- return f(a);
72
- });
73
- return { criteria: d, index: ++t, value: a };
74
- });
75
- return rn(i, function(a, o) {
76
- return an(a, o, r);
77
- });
78
- }
79
- function un(e, n) {
80
- return Ae(e, n, function(r, t) {
81
- return Me(e, t);
82
- });
83
- }
84
- var I = He(function(e, n) {
85
- return e == null ? {} : un(e, n);
86
- }), dn = Math.ceil, fn = Math.max;
87
- function sn(e, n, r, t) {
88
- for (var i = -1, a = fn(dn((n - e) / (r || 1)), 0), o = Array(a); a--; )
89
- o[++i] = e, e += r;
90
- return o;
91
- }
92
- function cn(e) {
93
- return function(n, r, t) {
94
- return t && typeof t != "number" && $(n, r, t) && (r = t = void 0), n = V(n), r === void 0 ? (r = n, n = 0) : r = V(r), t = t === void 0 ? n < r ? 1 : -1 : V(t), sn(n, r, t);
95
- };
96
- }
97
- var E = cn(), R = ze(function(e, n) {
98
- if (e == null)
99
- return [];
100
- var r = n.length;
101
- return r > 1 && $(e, n[0], n[1]) ? n = [] : r > 2 && $(n[0], n[1], n[2]) && (n = [n[0]]), on(e, Se(n), []);
102
- }), ln = 0;
103
- function H(e) {
104
- var n = ++ln;
105
- return je(e) + n;
106
- }
107
- function hn(e, n, r) {
108
- for (var t = -1, i = e.length, a = n.length, o = {}; ++t < i; ) {
109
- var u = t < a ? n[t] : void 0;
110
- r(o, e[t], u);
111
- }
112
- return o;
113
- }
114
- function vn(e, n) {
115
- return hn(e || [], n || [], Xe);
116
- }
117
- class pn {
118
- constructor() {
119
- var n = {};
120
- n._next = n._prev = n, this._sentinel = n;
121
- }
122
- dequeue() {
123
- var n = this._sentinel, r = n._prev;
124
- if (r !== n)
125
- return ne(r), r;
126
- }
127
- enqueue(n) {
128
- var r = this._sentinel;
129
- n._prev && n._next && ne(n), n._next = r._next, r._next._prev = n, r._next = n, n._prev = r;
130
- }
131
- toString() {
132
- for (var n = [], r = this._sentinel, t = r._prev; t !== r; )
133
- n.push(JSON.stringify(t, wn)), t = t._prev;
134
- return "[" + n.join(", ") + "]";
135
- }
136
- }
137
- function ne(e) {
138
- e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
139
- }
140
- function wn(e, n) {
141
- if (e !== "_next" && e !== "_prev")
142
- return n;
143
- }
144
- var bn = Ue(1);
145
- function mn(e, n) {
146
- if (e.nodeCount() <= 1)
147
- return [];
148
- var r = yn(e, n || bn), t = gn(r.graph, r.buckets, r.zeroIdx);
149
- return O(
150
- w(t, function(i) {
151
- return e.outEdges(i.v, i.w);
152
- })
153
- );
154
- }
155
- function gn(e, n, r) {
156
- for (var t = [], i = n[n.length - 1], a = n[0], o; e.nodeCount(); ) {
157
- for (; o = a.dequeue(); )
158
- A(e, n, r, o);
159
- for (; o = i.dequeue(); )
160
- A(e, n, r, o);
161
- if (e.nodeCount()) {
162
- for (var u = n.length - 2; u > 0; --u)
163
- if (o = n[u].dequeue(), o) {
164
- t = t.concat(A(e, n, r, o, !0));
165
- break;
166
- }
167
- }
168
- }
169
- return t;
170
- }
171
- function A(e, n, r, t, i) {
172
- var a = i ? [] : void 0;
173
- return s(e.inEdges(t.v), function(o) {
174
- var u = e.edge(o), d = e.node(o.v);
175
- i && a.push({ v: o.v, w: o.w }), d.out -= u, W(n, r, d);
176
- }), s(e.outEdges(t.v), function(o) {
177
- var u = e.edge(o), d = o.w, f = e.node(d);
178
- f.in -= u, W(n, r, f);
179
- }), e.removeNode(t.v), a;
180
- }
181
- function yn(e, n) {
182
- var r = new g(), t = 0, i = 0;
183
- s(e.nodes(), function(u) {
184
- r.setNode(u, { v: u, in: 0, out: 0 });
185
- }), s(e.edges(), function(u) {
186
- var d = r.edge(u.v, u.w) || 0, f = n(u), c = d + f;
187
- r.setEdge(u.v, u.w, c), i = Math.max(i, r.node(u.v).out += f), t = Math.max(t, r.node(u.w).in += f);
188
- });
189
- var a = E(i + t + 3).map(function() {
190
- return new pn();
191
- }), o = t + 1;
192
- return s(r.nodes(), function(u) {
193
- W(a, o, r.node(u));
194
- }), { graph: r, buckets: a, zeroIdx: o };
195
- }
196
- function W(e, n, r) {
197
- r.out ? r.in ? e[r.out - r.in + n].enqueue(r) : e[e.length - 1].enqueue(r) : e[0].enqueue(r);
198
- }
199
- function kn(e) {
200
- var n = e.graph().acyclicer === "greedy" ? mn(e, r(e)) : xn(e);
201
- s(n, function(t) {
202
- var i = e.edge(t);
203
- e.removeEdge(t), i.forwardName = t.name, i.reversed = !0, e.setEdge(t.w, t.v, i, H("rev"));
204
- });
205
- function r(t) {
206
- return function(i) {
207
- return t.edge(i).weight;
208
- };
209
- }
210
- }
211
- function xn(e) {
212
- var n = [], r = {}, t = {};
213
- function i(a) {
214
- Object.prototype.hasOwnProperty.call(t, a) || (t[a] = !0, r[a] = !0, s(e.outEdges(a), function(o) {
215
- Object.prototype.hasOwnProperty.call(r, o.w) ? n.push(o) : i(o.w);
216
- }), delete r[a]);
217
- }
218
- return s(e.nodes(), i), n;
219
- }
220
- function En(e) {
221
- s(e.edges(), function(n) {
222
- var r = e.edge(n);
223
- if (r.reversed) {
224
- e.removeEdge(n);
225
- var t = r.forwardName;
226
- delete r.reversed, delete r.forwardName, e.setEdge(n.w, n.v, r, t);
227
- }
228
- });
229
- }
230
- function L(e, n, r, t) {
231
- var i;
232
- do
233
- i = H(t);
234
- while (e.hasNode(i));
235
- return r.dummy = n, e.setNode(i, r), i;
236
- }
237
- function On(e) {
238
- var n = new g().setGraph(e.graph());
239
- return s(e.nodes(), function(r) {
240
- n.setNode(r, e.node(r));
241
- }), s(e.edges(), function(r) {
242
- var t = n.edge(r.v, r.w) || { weight: 0, minlen: 1 }, i = e.edge(r);
243
- n.setEdge(r.v, r.w, {
244
- weight: t.weight + i.weight,
245
- minlen: Math.max(t.minlen, i.minlen)
246
- });
247
- }), n;
248
- }
249
- function be(e) {
250
- var n = new g({ multigraph: e.isMultigraph() }).setGraph(e.graph());
251
- return s(e.nodes(), function(r) {
252
- e.children(r).length || n.setNode(r, e.node(r));
253
- }), s(e.edges(), function(r) {
254
- n.setEdge(r, e.edge(r));
255
- }), n;
256
- }
257
- function re(e, n) {
258
- var r = e.x, t = e.y, i = n.x - r, a = n.y - t, o = e.width / 2, u = e.height / 2;
259
- if (!i && !a)
260
- throw new Error("Not possible to find intersection inside of the rectangle");
261
- var d, f;
262
- return Math.abs(a) * o > Math.abs(i) * u ? (a < 0 && (u = -u), d = u * i / a, f = u) : (i < 0 && (o = -o), d = o, f = o * a / i), { x: r + d, y: t + f };
263
- }
264
- function j(e) {
265
- var n = w(E(me(e) + 1), function() {
266
- return [];
267
- });
268
- return s(e.nodes(), function(r) {
269
- var t = e.node(r), i = t.rank;
270
- m(i) || (n[i][t.order] = r);
271
- }), n;
272
- }
273
- function Ln(e) {
274
- var n = P(
275
- w(e.nodes(), function(r) {
276
- return e.node(r).rank;
277
- })
278
- );
279
- s(e.nodes(), function(r) {
280
- var t = e.node(r);
281
- ve(t, "rank") && (t.rank -= n);
282
- });
283
- }
284
- function Nn(e) {
285
- var n = P(
286
- w(e.nodes(), function(a) {
287
- return e.node(a).rank;
288
- })
289
- ), r = [];
290
- s(e.nodes(), function(a) {
291
- var o = e.node(a).rank - n;
292
- r[o] || (r[o] = []), r[o].push(a);
293
- });
294
- var t = 0, i = e.graph().nodeRankFactor;
295
- s(r, function(a, o) {
296
- m(a) && o % i !== 0 ? --t : t && s(a, function(u) {
297
- e.node(u).rank += t;
298
- });
299
- });
300
- }
301
- function te(e, n, r, t) {
302
- var i = {
303
- width: 0,
304
- height: 0
305
- };
306
- return arguments.length >= 4 && (i.rank = r, i.order = t), L(e, "border", i, n);
307
- }
308
- function me(e) {
309
- return y(
310
- w(e.nodes(), function(n) {
311
- var r = e.node(n).rank;
312
- if (!m(r))
313
- return r;
314
- })
315
- );
316
- }
317
- function Pn(e, n) {
318
- var r = { lhs: [], rhs: [] };
319
- return s(e, function(t) {
320
- n(t) ? r.lhs.push(t) : r.rhs.push(t);
321
- }), r;
322
- }
323
- function Cn(e, n) {
324
- return n();
325
- }
326
- function _n(e) {
327
- function n(r) {
328
- var t = e.children(r), i = e.node(r);
329
- if (t.length && s(t, n), Object.prototype.hasOwnProperty.call(i, "minRank")) {
330
- i.borderLeft = [], i.borderRight = [];
331
- for (var a = i.minRank, o = i.maxRank + 1; a < o; ++a)
332
- ie(e, "borderLeft", "_bl", r, i, a), ie(e, "borderRight", "_br", r, i, a);
333
- }
334
- }
335
- s(e.children(), n);
336
- }
337
- function ie(e, n, r, t, i, a) {
338
- var o = { width: 0, height: 0, rank: a, borderType: n }, u = i[n][a - 1], d = L(e, "border", o, r);
339
- i[n][a] = d, e.setParent(d, t), u && e.setEdge(u, d, { weight: 1 });
340
- }
341
- function Rn(e) {
342
- var n = e.graph().rankdir.toLowerCase();
343
- (n === "lr" || n === "rl") && ge(e);
344
- }
345
- function Tn(e) {
346
- var n = e.graph().rankdir.toLowerCase();
347
- (n === "bt" || n === "rl") && In(e), (n === "lr" || n === "rl") && (Mn(e), ge(e));
348
- }
349
- function ge(e) {
350
- s(e.nodes(), function(n) {
351
- ae(e.node(n));
352
- }), s(e.edges(), function(n) {
353
- ae(e.edge(n));
354
- });
355
- }
356
- function ae(e) {
357
- var n = e.width;
358
- e.width = e.height, e.height = n;
359
- }
360
- function In(e) {
361
- s(e.nodes(), function(n) {
362
- B(e.node(n));
363
- }), s(e.edges(), function(n) {
364
- var r = e.edge(n);
365
- s(r.points, B), Object.prototype.hasOwnProperty.call(r, "y") && B(r);
366
- });
367
- }
368
- function B(e) {
369
- e.y = -e.y;
370
- }
371
- function Mn(e) {
372
- s(e.nodes(), function(n) {
373
- G(e.node(n));
374
- }), s(e.edges(), function(n) {
375
- var r = e.edge(n);
376
- s(r.points, G), Object.prototype.hasOwnProperty.call(r, "x") && G(r);
377
- });
378
- }
379
- function G(e) {
380
- var n = e.x;
381
- e.x = e.y, e.y = n;
382
- }
383
- function Sn(e) {
384
- e.graph().dummyChains = [], s(e.edges(), function(n) {
385
- jn(e, n);
386
- });
387
- }
388
- function jn(e, n) {
389
- var r = n.v, t = e.node(r).rank, i = n.w, a = e.node(i).rank, o = n.name, u = e.edge(n), d = u.labelRank;
390
- if (a !== t + 1) {
391
- e.removeEdge(n);
392
- var f = void 0, c, l;
393
- for (l = 0, ++t; t < a; ++l, ++t)
394
- u.points = [], f = {
395
- width: 0,
396
- height: 0,
397
- edgeLabel: u,
398
- edgeObj: n,
399
- rank: t
400
- }, c = L(e, "edge", f, "_d"), t === d && (f.width = u.width, f.height = u.height, f.dummy = "edge-label", f.labelpos = u.labelpos), e.setEdge(r, c, { weight: u.weight }, o), l === 0 && e.graph().dummyChains.push(c), r = c;
401
- e.setEdge(r, i, { weight: u.weight }, o);
402
- }
403
- }
404
- function Fn(e) {
405
- s(e.graph().dummyChains, function(n) {
406
- var r = e.node(n), t = r.edgeLabel, i;
407
- for (e.setEdge(r.edgeObj, t); r.dummy; )
408
- i = e.successors(n)[0], e.removeNode(n), t.points.push({ x: r.x, y: r.y }), r.dummy === "edge-label" && (t.x = r.x, t.y = r.y, t.width = r.width, t.height = r.height), n = i, r = e.node(n);
409
- });
410
- }
411
- function J(e) {
412
- var n = {};
413
- function r(t) {
414
- var i = e.node(t);
415
- if (Object.prototype.hasOwnProperty.call(n, t))
416
- return i.rank;
417
- n[t] = !0;
418
- var a = P(
419
- w(e.outEdges(t), function(o) {
420
- return r(o.w) - e.edge(o).minlen;
421
- })
422
- );
423
- return (a === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3
424
- a === void 0 || // return value of _.map([]) for Lodash 4
425
- a === null) && (a = 0), i.rank = a;
426
- }
427
- s(e.sources(), r);
428
- }
429
- function C(e, n) {
430
- return e.node(n.w).rank - e.node(n.v).rank - e.edge(n).minlen;
431
- }
432
- function ye(e) {
433
- var n = new g({ directed: !1 }), r = e.nodes()[0], t = e.nodeCount();
434
- n.setNode(r, {});
435
- for (var i, a; Vn(n, e) < t; )
436
- i = An(n, e), a = n.hasNode(i.v) ? C(e, i) : -C(e, i), Bn(n, e, a);
437
- return n;
438
- }
439
- function Vn(e, n) {
440
- function r(t) {
441
- s(n.nodeEdges(t), function(i) {
442
- var a = i.v, o = t === a ? i.w : a;
443
- !e.hasNode(o) && !C(n, i) && (e.setNode(o, {}), e.setEdge(t, o, {}), r(o));
444
- });
445
- }
446
- return s(e.nodes(), r), e.nodeCount();
447
- }
448
- function An(e, n) {
449
- return U(n.edges(), function(r) {
450
- if (e.hasNode(r.v) !== e.hasNode(r.w))
451
- return C(n, r);
452
- });
453
- }
454
- function Bn(e, n, r) {
455
- s(e.nodes(), function(t) {
456
- n.node(t).rank += r;
457
- });
458
- }
459
- function ke(e, n, r) {
460
- we(n) || (n = [n]);
461
- var t = (e.isDirected() ? e.successors : e.neighbors).bind(e), i = [], a = {};
462
- return s(n, function(o) {
463
- if (!e.hasNode(o))
464
- throw new Error("Graph does not have node: " + o);
465
- xe(e, o, r === "post", a, t, i);
466
- }), i;
467
- }
468
- function xe(e, n, r, t, i, a) {
469
- Object.prototype.hasOwnProperty.call(t, n) || (t[n] = !0, r || a.push(n), s(i(n), function(o) {
470
- xe(e, o, r, t, i, a);
471
- }), r && a.push(n));
472
- }
473
- function Gn(e, n) {
474
- return ke(e, n, "post");
475
- }
476
- function Yn(e, n) {
477
- return ke(e, n, "pre");
478
- }
479
- k.initLowLimValues = K;
480
- k.initCutValues = Z;
481
- k.calcCutValue = Ee;
482
- k.leaveEdge = Le;
483
- k.enterEdge = Ne;
484
- k.exchangeEdges = Pe;
485
- function k(e) {
486
- e = On(e), J(e);
487
- var n = ye(e);
488
- K(n), Z(n, e);
489
- for (var r, t; r = Le(n); )
490
- t = Ne(n, e, r), Pe(n, e, r, t);
491
- }
492
- function Z(e, n) {
493
- var r = Gn(e, e.nodes());
494
- r = r.slice(0, r.length - 1), s(r, function(t) {
495
- Dn(e, n, t);
496
- });
497
- }
498
- function Dn(e, n, r) {
499
- var t = e.node(r), i = t.parent;
500
- e.edge(r, i).cutvalue = Ee(e, n, r);
501
- }
502
- function Ee(e, n, r) {
503
- var t = e.node(r), i = t.parent, a = !0, o = n.edge(r, i), u = 0;
504
- return o || (a = !1, o = n.edge(i, r)), u = o.weight, s(n.nodeEdges(r), function(d) {
505
- var f = d.v === r, c = f ? d.w : d.v;
506
- if (c !== i) {
507
- var l = f === a, h = n.edge(d).weight;
508
- if (u += l ? h : -h, qn(e, r, c)) {
509
- var v = e.edge(r, c).cutvalue;
510
- u += l ? -v : v;
511
- }
512
- }
513
- }), u;
514
- }
515
- function K(e, n) {
516
- arguments.length < 2 && (n = e.nodes()[0]), Oe(e, {}, 1, n);
517
- }
518
- function Oe(e, n, r, t, i) {
519
- var a = r, o = e.node(t);
520
- return n[t] = !0, s(e.neighbors(t), function(u) {
521
- Object.prototype.hasOwnProperty.call(n, u) || (r = Oe(e, n, r, u, t));
522
- }), o.low = a, o.lim = r++, i ? o.parent = i : delete o.parent, r;
523
- }
524
- function Le(e) {
525
- return X(e.edges(), function(n) {
526
- return e.edge(n).cutvalue < 0;
527
- });
528
- }
529
- function Ne(e, n, r) {
530
- var t = r.v, i = r.w;
531
- n.hasEdge(t, i) || (t = r.w, i = r.v);
532
- var a = e.node(t), o = e.node(i), u = a, d = !1;
533
- a.lim > o.lim && (u = o, d = !0);
534
- var f = _(n.edges(), function(c) {
535
- return d === oe(e, e.node(c.v), u) && d !== oe(e, e.node(c.w), u);
536
- });
537
- return U(f, function(c) {
538
- return C(n, c);
539
- });
540
- }
541
- function Pe(e, n, r, t) {
542
- var i = r.v, a = r.w;
543
- e.removeEdge(i, a), e.setEdge(t.v, t.w, {}), K(e), Z(e, n), $n(e, n);
544
- }
545
- function $n(e, n) {
546
- var r = X(e.nodes(), function(i) {
547
- return !n.node(i).parent;
548
- }), t = Yn(e, r);
549
- t = t.slice(1), s(t, function(i) {
550
- var a = e.node(i).parent, o = n.edge(i, a), u = !1;
551
- o || (o = n.edge(a, i), u = !0), n.node(i).rank = n.node(a).rank + (u ? o.minlen : -o.minlen);
552
- });
553
- }
554
- function qn(e, n, r) {
555
- return e.hasEdge(n, r);
556
- }
557
- function oe(e, n, r) {
558
- return r.low <= n.lim && n.lim <= r.lim;
559
- }
560
- function Wn(e) {
561
- switch (e.graph().ranker) {
562
- case "network-simplex":
563
- ue(e);
564
- break;
565
- case "tight-tree":
566
- Xn(e);
567
- break;
568
- case "longest-path":
569
- zn(e);
570
- break;
571
- default:
572
- ue(e);
573
- }
574
- }
575
- var zn = J;
576
- function Xn(e) {
577
- J(e), ye(e);
578
- }
579
- function ue(e) {
580
- k(e);
581
- }
582
- function Un(e) {
583
- var n = L(e, "root", {}, "_root"), r = Hn(e), t = y(x(r)) - 1, i = 2 * t + 1;
584
- e.graph().nestingRoot = n, s(e.edges(), function(o) {
585
- e.edge(o).minlen *= i;
586
- });
587
- var a = Jn(e) + 1;
588
- s(e.children(), function(o) {
589
- Ce(e, n, i, a, t, r, o);
590
- }), e.graph().nodeRankFactor = i;
591
- }
592
- function Ce(e, n, r, t, i, a, o) {
593
- var u = e.children(o);
594
- if (!u.length) {
595
- o !== n && e.setEdge(n, o, { weight: 0, minlen: r });
596
- return;
597
- }
598
- var d = te(e, "_bt"), f = te(e, "_bb"), c = e.node(o);
599
- e.setParent(d, o), c.borderTop = d, e.setParent(f, o), c.borderBottom = f, s(u, function(l) {
600
- Ce(e, n, r, t, i, a, l);
601
- var h = e.node(l), v = h.borderTop ? h.borderTop : l, p = h.borderBottom ? h.borderBottom : l, b = h.borderTop ? t : 2 * t, N = v !== p ? 1 : i - a[o] + 1;
602
- e.setEdge(d, v, {
603
- weight: b,
604
- minlen: N,
605
- nestingEdge: !0
606
- }), e.setEdge(p, f, {
607
- weight: b,
608
- minlen: N,
609
- nestingEdge: !0
610
- });
611
- }), e.parent(o) || e.setEdge(n, d, { weight: 0, minlen: i + a[o] });
612
- }
613
- function Hn(e) {
614
- var n = {};
615
- function r(t, i) {
616
- var a = e.children(t);
617
- a && a.length && s(a, function(o) {
618
- r(o, i + 1);
619
- }), n[t] = i;
620
- }
621
- return s(e.children(), function(t) {
622
- r(t, 1);
623
- }), n;
624
- }
625
- function Jn(e) {
626
- return M(
627
- e.edges(),
628
- function(n, r) {
629
- return n + e.edge(r).weight;
630
- },
631
- 0
632
- );
633
- }
634
- function Zn(e) {
635
- var n = e.graph();
636
- e.removeNode(n.nestingRoot), delete n.nestingRoot, s(e.edges(), function(r) {
637
- var t = e.edge(r);
638
- t.nestingEdge && e.removeEdge(r);
639
- });
640
- }
641
- function Kn(e, n, r) {
642
- var t = {}, i;
643
- s(r, function(a) {
644
- for (var o = e.parent(a), u, d; o; ) {
645
- if (u = e.parent(o), u ? (d = t[u], t[u] = o) : (d = i, i = o), d && d !== o) {
646
- n.setEdge(d, o);
647
- return;
648
- }
649
- o = u;
650
- }
651
- });
652
- }
653
- function Qn(e, n, r) {
654
- var t = er(e), i = new g({ compound: !0 }).setGraph({ root: t }).setDefaultNodeLabel(function(a) {
655
- return e.node(a);
656
- });
657
- return s(e.nodes(), function(a) {
658
- var o = e.node(a), u = e.parent(a);
659
- (o.rank === n || o.minRank <= n && n <= o.maxRank) && (i.setNode(a), i.setParent(a, u || t), s(e[r](a), function(d) {
660
- var f = d.v === a ? d.w : d.v, c = i.edge(f, a), l = m(c) ? 0 : c.weight;
661
- i.setEdge(f, a, { weight: e.edge(d).weight + l });
662
- }), Object.prototype.hasOwnProperty.call(o, "minRank") && i.setNode(a, {
663
- borderLeft: o.borderLeft[n],
664
- borderRight: o.borderRight[n]
665
- }));
666
- }), i;
667
- }
668
- function er(e) {
669
- for (var n; e.hasNode(n = H("_root")); ) ;
670
- return n;
671
- }
672
- function nr(e, n) {
673
- for (var r = 0, t = 1; t < n.length; ++t)
674
- r += rr(e, n[t - 1], n[t]);
675
- return r;
676
- }
677
- function rr(e, n, r) {
678
- for (var t = vn(
679
- r,
680
- w(r, function(f, c) {
681
- return c;
682
- })
683
- ), i = O(
684
- w(n, function(f) {
685
- return R(
686
- w(e.outEdges(f), function(c) {
687
- return { pos: t[c.w], weight: e.edge(c).weight };
688
- }),
689
- "pos"
690
- );
691
- })
692
- ), a = 1; a < r.length; ) a <<= 1;
693
- var o = 2 * a - 1;
694
- a -= 1;
695
- var u = w(new Array(o), function() {
696
- return 0;
697
- }), d = 0;
698
- return s(
699
- // @ts-expect-error
700
- i.forEach(function(f) {
701
- var c = f.pos + a;
702
- u[c] += f.weight;
703
- for (var l = 0; c > 0; )
704
- c % 2 && (l += u[c + 1]), c = c - 1 >> 1, u[c] += f.weight;
705
- d += f.weight * l;
706
- })
707
- ), d;
708
- }
709
- function tr(e) {
710
- var n = {}, r = _(e.nodes(), function(u) {
711
- return !e.children(u).length;
712
- }), t = y(
713
- w(r, function(u) {
714
- return e.node(u).rank;
715
- })
716
- ), i = w(E(t + 1), function() {
717
- return [];
718
- });
719
- function a(u) {
720
- if (!ve(n, u)) {
721
- n[u] = !0;
722
- var d = e.node(u);
723
- i[d.rank].push(u), s(e.successors(u), a);
724
- }
725
- }
726
- var o = R(r, function(u) {
727
- return e.node(u).rank;
728
- });
729
- return s(o, a), i;
730
- }
731
- function ir(e, n) {
732
- return w(n, function(r) {
733
- var t = e.inEdges(r);
734
- if (t.length) {
735
- var i = M(
736
- t,
737
- function(a, o) {
738
- var u = e.edge(o), d = e.node(o.v);
739
- return {
740
- sum: a.sum + u.weight * d.order,
741
- weight: a.weight + u.weight
742
- };
743
- },
744
- { sum: 0, weight: 0 }
745
- );
746
- return {
747
- v: r,
748
- barycenter: i.sum / i.weight,
749
- weight: i.weight
750
- };
751
- } else
752
- return { v: r };
753
- });
754
- }
755
- function ar(e, n) {
756
- var r = {};
757
- s(e, function(i, a) {
758
- var o = r[i.v] = {
759
- indegree: 0,
760
- in: [],
761
- out: [],
762
- vs: [i.v],
763
- i: a
764
- };
765
- m(i.barycenter) || (o.barycenter = i.barycenter, o.weight = i.weight);
766
- }), s(n.edges(), function(i) {
767
- var a = r[i.v], o = r[i.w];
768
- !m(a) && !m(o) && (o.indegree++, a.out.push(r[i.w]));
769
- });
770
- var t = _(r, function(i) {
771
- return !i.indegree;
772
- });
773
- return or(t);
774
- }
775
- function or(e) {
776
- var n = [];
777
- function r(a) {
778
- return function(o) {
779
- o.merged || (m(o.barycenter) || m(a.barycenter) || o.barycenter >= a.barycenter) && ur(a, o);
780
- };
781
- }
782
- function t(a) {
783
- return function(o) {
784
- o.in.push(a), --o.indegree === 0 && e.push(o);
785
- };
786
- }
787
- for (; e.length; ) {
788
- var i = e.pop();
789
- n.push(i), s(i.in.reverse(), r(i)), s(i.out, t(i));
790
- }
791
- return w(
792
- _(n, function(a) {
793
- return !a.merged;
794
- }),
795
- function(a) {
796
- return I(a, ["vs", "i", "barycenter", "weight"]);
797
- }
798
- );
799
- }
800
- function ur(e, n) {
801
- var r = 0, t = 0;
802
- e.weight && (r += e.barycenter * e.weight, t += e.weight), n.weight && (r += n.barycenter * n.weight, t += n.weight), e.vs = n.vs.concat(e.vs), e.barycenter = r / t, e.weight = t, e.i = Math.min(n.i, e.i), n.merged = !0;
803
- }
804
- function dr(e, n) {
805
- var r = Pn(e, function(c) {
806
- return Object.prototype.hasOwnProperty.call(c, "barycenter");
807
- }), t = r.lhs, i = R(r.rhs, function(c) {
808
- return -c.i;
809
- }), a = [], o = 0, u = 0, d = 0;
810
- t.sort(fr(!!n)), d = de(a, i, d), s(t, function(c) {
811
- d += c.vs.length, a.push(c.vs), o += c.barycenter * c.weight, u += c.weight, d = de(a, i, d);
812
- });
813
- var f = { vs: O(a) };
814
- return u && (f.barycenter = o / u, f.weight = u), f;
815
- }
816
- function de(e, n, r) {
817
- for (var t; n.length && (t = T(n)).i <= r; )
818
- n.pop(), e.push(t.vs), r++;
819
- return r;
820
- }
821
- function fr(e) {
822
- return function(n, r) {
823
- return n.barycenter < r.barycenter ? -1 : n.barycenter > r.barycenter ? 1 : e ? r.i - n.i : n.i - r.i;
824
- };
825
- }
826
- function _e(e, n, r, t) {
827
- var i = e.children(n), a = e.node(n), o = a ? a.borderLeft : void 0, u = a ? a.borderRight : void 0, d = {};
828
- o && (i = _(i, function(p) {
829
- return p !== o && p !== u;
830
- }));
831
- var f = ir(e, i);
832
- s(f, function(p) {
833
- if (e.children(p.v).length) {
834
- var b = _e(e, p.v, r, t);
835
- d[p.v] = b, Object.prototype.hasOwnProperty.call(b, "barycenter") && cr(p, b);
836
- }
837
- });
838
- var c = ar(f, r);
839
- sr(c, d);
840
- var l = dr(c, t);
841
- if (o && (l.vs = O([o, l.vs, u]), e.predecessors(o).length)) {
842
- var h = e.node(e.predecessors(o)[0]), v = e.node(e.predecessors(u)[0]);
843
- Object.prototype.hasOwnProperty.call(l, "barycenter") || (l.barycenter = 0, l.weight = 0), l.barycenter = (l.barycenter * l.weight + h.order + v.order) / (l.weight + 2), l.weight += 2;
844
- }
845
- return l;
846
- }
847
- function sr(e, n) {
848
- s(e, function(r) {
849
- r.vs = O(
850
- r.vs.map(function(t) {
851
- return n[t] ? n[t].vs : t;
852
- })
853
- );
854
- });
855
- }
856
- function cr(e, n) {
857
- m(e.barycenter) ? (e.barycenter = n.barycenter, e.weight = n.weight) : (e.barycenter = (e.barycenter * e.weight + n.barycenter * n.weight) / (e.weight + n.weight), e.weight += n.weight);
858
- }
859
- function lr(e) {
860
- var n = me(e), r = fe(e, E(1, n + 1), "inEdges"), t = fe(e, E(n - 1, -1, -1), "outEdges"), i = tr(e);
861
- se(e, i);
862
- for (var a = Number.POSITIVE_INFINITY, o, u = 0, d = 0; d < 4; ++u, ++d) {
863
- hr(u % 2 ? r : t, u % 4 >= 2), i = j(e);
864
- var f = nr(e, i);
865
- f < a && (d = 0, o = Ke(i), a = f);
866
- }
867
- se(e, o);
868
- }
869
- function fe(e, n, r) {
870
- return w(n, function(t) {
871
- return Qn(e, t, r);
872
- });
873
- }
874
- function hr(e, n) {
875
- var r = new g();
876
- s(e, function(t) {
877
- var i = t.graph().root, a = _e(t, i, r, n);
878
- s(a.vs, function(o, u) {
879
- t.node(o).order = u;
880
- }), Kn(t, r, a.vs);
881
- });
882
- }
883
- function se(e, n) {
884
- s(n, function(r) {
885
- s(r, function(t, i) {
886
- e.node(t).order = i;
887
- });
888
- });
889
- }
890
- function vr(e) {
891
- var n = wr(e);
892
- s(e.graph().dummyChains, function(r) {
893
- for (var t = e.node(r), i = t.edgeObj, a = pr(e, n, i.v, i.w), o = a.path, u = a.lca, d = 0, f = o[d], c = !0; r !== i.w; ) {
894
- if (t = e.node(r), c) {
895
- for (; (f = o[d]) !== u && e.node(f).maxRank < t.rank; )
896
- d++;
897
- f === u && (c = !1);
898
- }
899
- if (!c) {
900
- for (; d < o.length - 1 && e.node(f = o[d + 1]).minRank <= t.rank; )
901
- d++;
902
- f = o[d];
903
- }
904
- e.setParent(r, f), r = e.successors(r)[0];
905
- }
906
- });
907
- }
908
- function pr(e, n, r, t) {
909
- var i = [], a = [], o = Math.min(n[r].low, n[t].low), u = Math.max(n[r].lim, n[t].lim), d, f;
910
- d = r;
911
- do
912
- d = e.parent(d), i.push(d);
913
- while (d && (n[d].low > o || u > n[d].lim));
914
- for (f = d, d = t; (d = e.parent(d)) !== f; )
915
- a.push(d);
916
- return { path: i.concat(a.reverse()), lca: f };
917
- }
918
- function wr(e) {
919
- var n = {}, r = 0;
920
- function t(i) {
921
- var a = r;
922
- s(e.children(i), t), n[i] = { low: a, lim: r++ };
923
- }
924
- return s(e.children(), t), n;
925
- }
926
- function br(e, n) {
927
- var r = {};
928
- function t(i, a) {
929
- var o = 0, u = 0, d = i.length, f = T(a);
930
- return s(a, function(c, l) {
931
- var h = gr(e, c), v = h ? e.node(h).order : d;
932
- (h || c === f) && (s(a.slice(u, l + 1), function(p) {
933
- s(e.predecessors(p), function(b) {
934
- var N = e.node(b), Q = N.order;
935
- (Q < o || v < Q) && !(N.dummy && e.node(p).dummy) && Re(r, b, p);
936
- });
937
- }), u = l + 1, o = v);
938
- }), a;
939
- }
940
- return M(n, t), r;
941
- }
942
- function mr(e, n) {
943
- var r = {};
944
- function t(a, o, u, d, f) {
945
- var c;
946
- s(E(o, u), function(l) {
947
- c = a[l], e.node(c).dummy && s(e.predecessors(c), function(h) {
948
- var v = e.node(h);
949
- v.dummy && (v.order < d || v.order > f) && Re(r, h, c);
950
- });
951
- });
952
- }
953
- function i(a, o) {
954
- var u = -1, d, f = 0;
955
- return s(o, function(c, l) {
956
- if (e.node(c).dummy === "border") {
957
- var h = e.predecessors(c);
958
- h.length && (d = e.node(h[0]).order, t(o, f, l, u, d), f = l, u = d);
959
- }
960
- t(o, f, o.length, d, a.length);
961
- }), o;
962
- }
963
- return M(n, i), r;
964
- }
965
- function gr(e, n) {
966
- if (e.node(n).dummy)
967
- return X(e.predecessors(n), function(r) {
968
- return e.node(r).dummy;
969
- });
970
- }
971
- function Re(e, n, r) {
972
- if (n > r) {
973
- var t = n;
974
- n = r, r = t;
975
- }
976
- Object.prototype.hasOwnProperty.call(e, n) || Object.defineProperty(e, n, {
977
- enumerable: !0,
978
- configurable: !0,
979
- value: {},
980
- writable: !0
981
- });
982
- var i = e[n];
983
- Object.defineProperty(i, r, {
984
- enumerable: !0,
985
- configurable: !0,
986
- value: !0,
987
- writable: !0
988
- });
989
- }
990
- function yr(e, n, r) {
991
- if (n > r) {
992
- var t = n;
993
- n = r, r = t;
994
- }
995
- return !!e[n] && Object.prototype.hasOwnProperty.call(e[n], r);
996
- }
997
- function kr(e, n, r, t) {
998
- var i = {}, a = {}, o = {};
999
- return s(n, function(u) {
1000
- s(u, function(d, f) {
1001
- i[d] = d, a[d] = d, o[d] = f;
1002
- });
1003
- }), s(n, function(u) {
1004
- var d = -1;
1005
- s(u, function(f) {
1006
- var c = t(f);
1007
- if (c.length) {
1008
- c = R(c, function(b) {
1009
- return o[b];
1010
- });
1011
- for (var l = (c.length - 1) / 2, h = Math.floor(l), v = Math.ceil(l); h <= v; ++h) {
1012
- var p = c[h];
1013
- a[f] === f && d < o[p] && !yr(r, f, p) && (a[p] = f, a[f] = i[f] = i[p], d = o[p]);
1014
- }
1015
- }
1016
- });
1017
- }), { root: i, align: a };
1018
- }
1019
- function xr(e, n, r, t, i) {
1020
- var a = {}, o = Er(e, n, r, i), u = i ? "borderLeft" : "borderRight";
1021
- function d(l, h) {
1022
- for (var v = o.nodes(), p = v.pop(), b = {}; p; )
1023
- b[p] ? l(p) : (b[p] = !0, v.push(p), v = v.concat(h(p))), p = v.pop();
1024
- }
1025
- function f(l) {
1026
- a[l] = o.inEdges(l).reduce(function(h, v) {
1027
- return Math.max(h, a[v.v] + o.edge(v));
1028
- }, 0);
1029
- }
1030
- function c(l) {
1031
- var h = o.outEdges(l).reduce(function(p, b) {
1032
- return Math.min(p, a[b.w] - o.edge(b));
1033
- }, Number.POSITIVE_INFINITY), v = e.node(l);
1034
- h !== Number.POSITIVE_INFINITY && v.borderType !== u && (a[l] = Math.max(a[l], h));
1035
- }
1036
- return d(f, o.predecessors.bind(o)), d(c, o.successors.bind(o)), s(t, function(l) {
1037
- a[l] = a[r[l]];
1038
- }), a;
1039
- }
1040
- function Er(e, n, r, t) {
1041
- var i = new g(), a = e.graph(), o = Cr(a.nodesep, a.edgesep, t);
1042
- return s(n, function(u) {
1043
- var d;
1044
- s(u, function(f) {
1045
- var c = r[f];
1046
- if (i.setNode(c), d) {
1047
- var l = r[d], h = i.edge(l, c);
1048
- i.setEdge(l, c, Math.max(o(e, f, d), h || 0));
1049
- }
1050
- d = f;
1051
- });
1052
- }), i;
1053
- }
1054
- function Or(e, n) {
1055
- return U(x(n), function(r) {
1056
- var t = Number.NEGATIVE_INFINITY, i = Number.POSITIVE_INFINITY;
1057
- return Qe(r, function(a, o) {
1058
- var u = _r(e, o) / 2;
1059
- t = Math.max(a + u, t), i = Math.min(a - u, i);
1060
- }), t - i;
1061
- });
1062
- }
1063
- function Lr(e, n) {
1064
- var r = x(n), t = P(r), i = y(r);
1065
- s(["u", "d"], function(a) {
1066
- s(["l", "r"], function(o) {
1067
- var u = a + o, d = e[u], f;
1068
- if (d !== n) {
1069
- var c = x(d);
1070
- f = o === "l" ? t - P(c) : i - y(c), f && (e[u] = S(d, function(l) {
1071
- return l + f;
1072
- }));
1073
- }
1074
- });
1075
- });
1076
- }
1077
- function Nr(e, n) {
1078
- return S(e.ul, function(r, t) {
1079
- if (n)
1080
- return e[n.toLowerCase()][t];
1081
- var i = R(w(e, t));
1082
- return (i[1] + i[2]) / 2;
1083
- });
1084
- }
1085
- function Pr(e) {
1086
- var n = j(e), r = q(br(e, n), mr(e, n)), t = {}, i;
1087
- s(["u", "d"], function(o) {
1088
- i = o === "u" ? n : x(n).reverse(), s(["l", "r"], function(u) {
1089
- u === "r" && (i = w(i, function(l) {
1090
- return x(l).reverse();
1091
- }));
1092
- var d = (o === "u" ? e.predecessors : e.successors).bind(e), f = kr(e, i, r, d), c = xr(e, i, f.root, f.align, u === "r");
1093
- u === "r" && (c = S(c, function(l) {
1094
- return -l;
1095
- })), t[o + u] = c;
1096
- });
1097
- });
1098
- var a = Or(e, t);
1099
- return Lr(t, a), Nr(t, e.graph().align);
1100
- }
1101
- function Cr(e, n, r) {
1102
- return function(t, i, a) {
1103
- var o = t.node(i), u = t.node(a), d = 0, f;
1104
- if (d += o.width / 2, Object.prototype.hasOwnProperty.call(o, "labelpos"))
1105
- switch (o.labelpos.toLowerCase()) {
1106
- case "l":
1107
- f = -o.width / 2;
1108
- break;
1109
- case "r":
1110
- f = o.width / 2;
1111
- break;
1112
- }
1113
- if (f && (d += r ? f : -f), f = 0, d += (o.dummy ? n : e) / 2, d += (u.dummy ? n : e) / 2, d += u.width / 2, Object.prototype.hasOwnProperty.call(u, "labelpos"))
1114
- switch (u.labelpos.toLowerCase()) {
1115
- case "l":
1116
- f = u.width / 2;
1117
- break;
1118
- case "r":
1119
- f = -u.width / 2;
1120
- break;
1121
- }
1122
- return f && (d += r ? f : -f), f = 0, d;
1123
- };
1124
- }
1125
- function _r(e, n) {
1126
- return e.node(n).width;
1127
- }
1128
- function Rr(e) {
1129
- e = be(e), Tr(e), en(Pr(e), function(n, r) {
1130
- e.node(r).x = n;
1131
- });
1132
- }
1133
- function Tr(e) {
1134
- var n = j(e), r = e.graph().ranksep, t = 0;
1135
- s(n, function(i) {
1136
- var a = y(
1137
- w(i, function(o) {
1138
- return e.node(o).height;
1139
- })
1140
- );
1141
- s(i, function(o) {
1142
- e.node(o).y = t + a / 2;
1143
- }), t += a + r;
1144
- });
1145
- }
1146
- function at(e, n) {
1147
- var r = Cn;
1148
- r("layout", () => {
1149
- var t = r(" buildLayoutGraph", () => Dr(e));
1150
- r(" runLayout", () => Ir(t, r)), r(" updateInputGraph", () => Mr(e, t));
1151
- });
1152
- }
1153
- function Ir(e, n) {
1154
- n(" makeSpaceForEdgeLabels", () => $r(e)), n(" removeSelfEdges", () => Kr(e)), n(" acyclic", () => kn(e)), n(" nestingGraph.run", () => Un(e)), n(" rank", () => Wn(be(e))), n(" injectEdgeLabelProxies", () => qr(e)), n(" removeEmptyRanks", () => Nn(e)), n(" nestingGraph.cleanup", () => Zn(e)), n(" normalizeRanks", () => Ln(e)), n(" assignRankMinMax", () => Wr(e)), n(" removeEdgeLabelProxies", () => zr(e)), n(" normalize.run", () => Sn(e)), n(" parentDummyChains", () => vr(e)), n(" addBorderSegments", () => _n(e)), n(" order", () => lr(e)), n(" insertSelfEdges", () => Qr(e)), n(" adjustCoordinateSystem", () => Rn(e)), n(" position", () => Rr(e)), n(" positionSelfEdges", () => et(e)), n(" removeBorderNodes", () => Zr(e)), n(" normalize.undo", () => Fn(e)), n(" fixupEdgeLabelCoords", () => Hr(e)), n(" undoCoordinateSystem", () => Tn(e)), n(" translateGraph", () => Xr(e)), n(" assignNodeIntersects", () => Ur(e)), n(" reversePoints", () => Jr(e)), n(" acyclic.undo", () => En(e));
1155
- }
1156
- function Mr(e, n) {
1157
- s(e.nodes(), function(r) {
1158
- var t = e.node(r), i = n.node(r);
1159
- t && (t.x = i.x, t.y = i.y, n.children(r).length && (t.width = i.width, t.height = i.height));
1160
- }), s(e.edges(), function(r) {
1161
- var t = e.edge(r), i = n.edge(r);
1162
- t.points = i.points, Object.prototype.hasOwnProperty.call(i, "x") && (t.x = i.x, t.y = i.y);
1163
- }), e.graph().width = n.graph().width, e.graph().height = n.graph().height;
1164
- }
1165
- var Sr = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], jr = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, Fr = ["acyclicer", "ranker", "rankdir", "align"], Vr = ["width", "height"], Ar = { width: 0, height: 0 }, Br = ["minlen", "weight", "width", "height", "labeloffset"], Gr = {
1166
- minlen: 1,
1167
- weight: 1,
1168
- width: 0,
1169
- height: 0,
1170
- labeloffset: 10,
1171
- labelpos: "r"
1172
- }, Yr = ["labelpos"];
1173
- function Dr(e) {
1174
- var n = new g({ multigraph: !0, compound: !0 }), r = D(e.graph());
1175
- return n.setGraph(
1176
- q({}, jr, Y(r, Sr), I(r, Fr))
1177
- ), s(e.nodes(), function(t) {
1178
- var i = D(e.node(t));
1179
- n.setNode(t, Be(Y(i, Vr), Ar)), n.setParent(t, e.parent(t));
1180
- }), s(e.edges(), function(t) {
1181
- var i = D(e.edge(t));
1182
- n.setEdge(
1183
- t,
1184
- q({}, Gr, Y(i, Br), I(i, Yr))
1185
- );
1186
- }), n;
1187
- }
1188
- function $r(e) {
1189
- var n = e.graph();
1190
- n.ranksep /= 2, s(e.edges(), function(r) {
1191
- var t = e.edge(r);
1192
- t.minlen *= 2, t.labelpos.toLowerCase() !== "c" && (n.rankdir === "TB" || n.rankdir === "BT" ? t.width += t.labeloffset : t.height += t.labeloffset);
1193
- });
1194
- }
1195
- function qr(e) {
1196
- s(e.edges(), function(n) {
1197
- var r = e.edge(n);
1198
- if (r.width && r.height) {
1199
- var t = e.node(n.v), i = e.node(n.w), a = { rank: (i.rank - t.rank) / 2 + t.rank, e: n };
1200
- L(e, "edge-proxy", a, "_ep");
1201
- }
1202
- });
1203
- }
1204
- function Wr(e) {
1205
- var n = 0;
1206
- s(e.nodes(), function(r) {
1207
- var t = e.node(r);
1208
- t.borderTop && (t.minRank = e.node(t.borderTop).rank, t.maxRank = e.node(t.borderBottom).rank, n = y(n));
1209
- }), e.graph().maxRank = n;
1210
- }
1211
- function zr(e) {
1212
- s(e.nodes(), function(n) {
1213
- var r = e.node(n);
1214
- r.dummy === "edge-proxy" && (e.edge(r.e).labelRank = r.rank, e.removeNode(n));
1215
- });
1216
- }
1217
- function Xr(e) {
1218
- var n = Number.POSITIVE_INFINITY, r = 0, t = Number.POSITIVE_INFINITY, i = 0, a = e.graph(), o = a.marginx || 0, u = a.marginy || 0;
1219
- function d(f) {
1220
- var c = f.x, l = f.y, h = f.width, v = f.height;
1221
- n = Math.min(n, c - h / 2), r = Math.max(r, c + h / 2), t = Math.min(t, l - v / 2), i = Math.max(i, l + v / 2);
1222
- }
1223
- s(e.nodes(), function(f) {
1224
- d(e.node(f));
1225
- }), s(e.edges(), function(f) {
1226
- var c = e.edge(f);
1227
- Object.prototype.hasOwnProperty.call(c, "x") && d(c);
1228
- }), n -= o, t -= u, s(e.nodes(), function(f) {
1229
- var c = e.node(f);
1230
- c.x -= n, c.y -= t;
1231
- }), s(e.edges(), function(f) {
1232
- var c = e.edge(f);
1233
- s(c.points, function(l) {
1234
- l.x -= n, l.y -= t;
1235
- }), Object.prototype.hasOwnProperty.call(c, "x") && (c.x -= n), Object.prototype.hasOwnProperty.call(c, "y") && (c.y -= t);
1236
- }), a.width = r - n + o, a.height = i - t + u;
1237
- }
1238
- function Ur(e) {
1239
- s(e.edges(), function(n) {
1240
- var r = e.edge(n), t = e.node(n.v), i = e.node(n.w), a, o;
1241
- r.points ? (a = r.points[0], o = r.points[r.points.length - 1]) : (r.points = [], a = i, o = t), r.points.unshift(re(t, a)), r.points.push(re(i, o));
1242
- });
1243
- }
1244
- function Hr(e) {
1245
- s(e.edges(), function(n) {
1246
- var r = e.edge(n);
1247
- if (Object.prototype.hasOwnProperty.call(r, "x"))
1248
- switch ((r.labelpos === "l" || r.labelpos === "r") && (r.width -= r.labeloffset), r.labelpos) {
1249
- case "l":
1250
- r.x -= r.width / 2 + r.labeloffset;
1251
- break;
1252
- case "r":
1253
- r.x += r.width / 2 + r.labeloffset;
1254
- break;
1255
- }
1256
- });
1257
- }
1258
- function Jr(e) {
1259
- s(e.edges(), function(n) {
1260
- var r = e.edge(n);
1261
- r.reversed && r.points.reverse();
1262
- });
1263
- }
1264
- function Zr(e) {
1265
- s(e.nodes(), function(n) {
1266
- if (e.children(n).length) {
1267
- var r = e.node(n), t = e.node(r.borderTop), i = e.node(r.borderBottom), a = e.node(T(r.borderLeft)), o = e.node(T(r.borderRight));
1268
- r.width = Math.abs(o.x - a.x), r.height = Math.abs(i.y - t.y), r.x = a.x + r.width / 2, r.y = t.y + r.height / 2;
1269
- }
1270
- }), s(e.nodes(), function(n) {
1271
- e.node(n).dummy === "border" && e.removeNode(n);
1272
- });
1273
- }
1274
- function Kr(e) {
1275
- s(e.edges(), function(n) {
1276
- if (n.v === n.w) {
1277
- var r = e.node(n.v);
1278
- r.selfEdges || (r.selfEdges = []), r.selfEdges.push({ e: n, label: e.edge(n) }), e.removeEdge(n);
1279
- }
1280
- });
1281
- }
1282
- function Qr(e) {
1283
- var n = j(e);
1284
- s(n, function(r) {
1285
- var t = 0;
1286
- s(r, function(i, a) {
1287
- var o = e.node(i);
1288
- o.order = a + t, s(o.selfEdges, function(u) {
1289
- L(
1290
- e,
1291
- "selfedge",
1292
- {
1293
- width: u.label.width,
1294
- height: u.label.height,
1295
- rank: o.rank,
1296
- order: a + ++t,
1297
- e: u.e,
1298
- label: u.label
1299
- },
1300
- "_se"
1301
- );
1302
- }), delete o.selfEdges;
1303
- });
1304
- });
1305
- }
1306
- function et(e) {
1307
- s(e.nodes(), function(n) {
1308
- var r = e.node(n);
1309
- if (r.dummy === "selfedge") {
1310
- var t = e.node(r.e.v), i = t.x + t.width / 2, a = t.y, o = r.x - i, u = t.height / 2;
1311
- e.setEdge(r.e, r.label), e.removeNode(n), r.label.points = [
1312
- { x: i + 2 * o / 3, y: a - u },
1313
- { x: i + 5 * o / 6, y: a - u },
1314
- { x: i + o, y: a },
1315
- { x: i + 5 * o / 6, y: a + u },
1316
- { x: i + 2 * o / 3, y: a + u }
1317
- ], r.label.x = r.x, r.label.y = r.y;
1318
- }
1319
- });
1320
- }
1321
- function Y(e, n) {
1322
- return S(I(e, n), Number);
1323
- }
1324
- function D(e) {
1325
- var n = {};
1326
- return s(e, function(r, t) {
1327
- n[t.toLowerCase()] = r;
1328
- }), n;
1329
- }
1330
- export {
1331
- at as layout
1332
- };