@layers-app/editor 0.5.4-optimization → 0.5.5-optimization

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 (137) hide show
  1. package/dist/index.cjs +2 -0
  2. package/dist/index.js +12 -10
  3. package/dist/layers.B10sB-Vy.js +1 -0
  4. package/dist/layers.BDsvvINb.js +6774 -0
  5. package/dist/layers.BFJ7oQiY.js +7723 -0
  6. package/dist/layers.BwyONivc.js +864 -0
  7. package/dist/layers.C2lacXcg.js +2511 -0
  8. package/dist/layers.C69TrYD7.js +7 -0
  9. package/dist/layers.CEMW9z_P.js +4 -0
  10. package/dist/layers.Cwao1pOZ.js +6 -0
  11. package/dist/layers.CzNz0Zya.js +1 -0
  12. package/dist/layers.D0Z-zLAV.js +530 -0
  13. package/dist/layers.DNCgFYS7.js +27 -0
  14. package/dist/layers.EKDSoJm1.js +2227 -0
  15. package/dist/layers.QjAkD17S.js +3677 -0
  16. package/dist/layers.ahDFHQXD.js +341 -0
  17. package/dist/layers.eLiGm-eZ.js +3 -0
  18. package/dist/layers.hgliNTDV.js +2 -0
  19. package/package.json +74 -17
  20. package/dist/layers.0EAb8Ajx.js +0 -65
  21. package/dist/layers.1Mvzm38Y.js +0 -501
  22. package/dist/layers.2wIERhxO.js +0 -41
  23. package/dist/layers.694DrE1_.js +0 -931
  24. package/dist/layers.7JqFgE4-.js +0 -15
  25. package/dist/layers.B-5aeeDH.js +0 -1359
  26. package/dist/layers.B0winug5.js +0 -59
  27. package/dist/layers.B1S8ufDn.js +0 -40
  28. package/dist/layers.B3JNY9Km.js +0 -42
  29. package/dist/layers.B6W2tqC0.js +0 -40
  30. package/dist/layers.B7Olyhe8.js +0 -1089
  31. package/dist/layers.BCuuRSaf.js +0 -37
  32. package/dist/layers.BESPlBGC.js +0 -32
  33. package/dist/layers.BJDrjORS.js +0 -244
  34. package/dist/layers.BJTh7mUo.js +0 -1265
  35. package/dist/layers.BLL-019k.js +0 -39
  36. package/dist/layers.BNJiP8Pw.js +0 -2966
  37. package/dist/layers.BNvAl5dS.js +0 -14
  38. package/dist/layers.BThP74aw.js +0 -32
  39. package/dist/layers.BZ4laUeR.js +0 -40
  40. package/dist/layers.BZByPNdY.js +0 -37
  41. package/dist/layers.B_5zMrI3.js +0 -38
  42. package/dist/layers.B_7N5yjX.js +0 -32
  43. package/dist/layers.BbCfEXyj.js +0 -55
  44. package/dist/layers.BdvfoI4U.js +0 -44
  45. package/dist/layers.BiJ8hfRt.js +0 -1510
  46. package/dist/layers.BiJBOHr0.js +0 -84
  47. package/dist/layers.Bk3_8qR9.js +0 -48146
  48. package/dist/layers.BkPPOKBy.js +0 -32
  49. package/dist/layers.BnZcjRLr.js +0 -32
  50. package/dist/layers.BpilXLfW.js +0 -6
  51. package/dist/layers.BqpcWKH6.js +0 -2479
  52. package/dist/layers.Br7D0wMN.js +0 -39
  53. package/dist/layers.BsAu1GXs.js +0 -42
  54. package/dist/layers.Bv5sK47C.js +0 -769
  55. package/dist/layers.BxEdkUpI.js +0 -1088
  56. package/dist/layers.BxUBbVsO.js +0 -41
  57. package/dist/layers.Bzalhqz_.js +0 -39
  58. package/dist/layers.C-dS7ntQ.js +0 -41
  59. package/dist/layers.C0Lgw_Sx.js +0 -11688
  60. package/dist/layers.C5BFsvzI.js +0 -803
  61. package/dist/layers.C5WLg9ed.js +0 -21763
  62. package/dist/layers.C6lAFlKZ.js +0 -186
  63. package/dist/layers.C8_lu5UH.js +0 -23
  64. package/dist/layers.CGwNL7dH.js +0 -791
  65. package/dist/layers.CI739wqN.js +0 -39
  66. package/dist/layers.CKaj4dG4.js +0 -41
  67. package/dist/layers.CLRiSwgi.js +0 -904
  68. package/dist/layers.CN1QkD6D.js +0 -38
  69. package/dist/layers.CPY6U3g-.js +0 -1034
  70. package/dist/layers.CRSjdIG6.js +0 -1619
  71. package/dist/layers.CUHkTCid.js +0 -6
  72. package/dist/layers.CUPMw0sy.js +0 -40
  73. package/dist/layers.CWb6LiAY.js +0 -40
  74. package/dist/layers.C_XsSNQo.js +0 -42
  75. package/dist/layers.CbmlFoXt.js +0 -33
  76. package/dist/layers.CfGeHh-g.js +0 -36
  77. package/dist/layers.CiJxVu9b.js +0 -36
  78. package/dist/layers.Cj4ezyVr.js +0 -33
  79. package/dist/layers.Cpb-MRZn.js +0 -960
  80. package/dist/layers.CqVTtuYm.js +0 -6
  81. package/dist/layers.CskURloi.js +0 -39
  82. package/dist/layers.CtTD47i4.js +0 -41
  83. package/dist/layers.CxcvEfKe.js +0 -36
  84. package/dist/layers.D-U9uIsP.js +0 -40
  85. package/dist/layers.D10WeKck.js +0 -2235
  86. package/dist/layers.D4T8fTcj.js +0 -1223
  87. package/dist/layers.D4jK2Tet.js +0 -39
  88. package/dist/layers.D7jGxypv.js +0 -8
  89. package/dist/layers.DBosqi2D.js +0 -19
  90. package/dist/layers.DGtETOVJ.js +0 -304
  91. package/dist/layers.DKENAsMv.js +0 -220
  92. package/dist/layers.DLwuMfdd.js +0 -84
  93. package/dist/layers.DN9HoVxI.js +0 -18
  94. package/dist/layers.DOBSfaUM.js +0 -35
  95. package/dist/layers.DOKLQ6A3.js +0 -373
  96. package/dist/layers.DPuVWH3L.js +0 -40
  97. package/dist/layers.DQVXh43C.js +0 -42
  98. package/dist/layers.DSTh89J8.js +0 -42
  99. package/dist/layers.DUsIfvNt.js +0 -46859
  100. package/dist/layers.DVfpGIrv.js +0 -41
  101. package/dist/layers.DWSkLlGf.js +0 -41
  102. package/dist/layers.DX1RI3m3.js +0 -32
  103. package/dist/layers.DdMwmP4m.js +0 -37
  104. package/dist/layers.DhkyREpW.js +0 -793
  105. package/dist/layers.Dj-f1_6N.js +0 -34
  106. package/dist/layers.DjUOC4st.js +0 -16
  107. package/dist/layers.DjhJT1nZ.js +0 -21938
  108. package/dist/layers.Djl9Gz6s.js +0 -282
  109. package/dist/layers.Dn2AP7iE.js +0 -1283
  110. package/dist/layers.Dqbek_0L.js +0 -40
  111. package/dist/layers.DsDjOLHs.js +0 -437
  112. package/dist/layers.DsOaqGXW.js +0 -8
  113. package/dist/layers.DuE1l7lR.js +0 -41
  114. package/dist/layers.DxA6ocdw.js +0 -70
  115. package/dist/layers.DxHlP7Pb.js +0 -39
  116. package/dist/layers.Dy1naDTQ.js +0 -14
  117. package/dist/layers.DyZ5R-vS.js +0 -37
  118. package/dist/layers.H2Kl_PC2.js +0 -40
  119. package/dist/layers.IW4NBP9k.js +0 -39
  120. package/dist/layers.LGx1jmqd.js +0 -40
  121. package/dist/layers.NABwYdw5.js +0 -35
  122. package/dist/layers.NtwvbkGN.js +0 -1580
  123. package/dist/layers.O-bFTk-n.js +0 -268
  124. package/dist/layers.R_udKe_N.js +0 -38
  125. package/dist/layers.TdTDbIzb.js +0 -1126
  126. package/dist/layers.WLeJl9el.js +0 -202
  127. package/dist/layers.b0h5ZBmD.js +0 -61
  128. package/dist/layers.dEHKcy8J.js +0 -320
  129. package/dist/layers.eTredPK_.js +0 -36
  130. package/dist/layers.gIdzfQAa.js +0 -5
  131. package/dist/layers.huV95Ipe.js +0 -295
  132. package/dist/layers.jU4W5PG5.js +0 -9166
  133. package/dist/layers.lCpg7dOn.js +0 -21
  134. package/dist/layers.mQcENPPW.js +0 -802
  135. package/dist/layers.nPQCmYXI.js +0 -423
  136. package/dist/layers.ntC1foLT.js +0 -39
  137. package/dist/layers.uHy1yMbq.js +0 -6
@@ -1,803 +0,0 @@
1
- import { o as mt, n as kt, s as _t, a as xt, c as vt, b as bt, g as rt, p as wt, d as Y, Y as St, q as Lt, j as Et } from "./layers.jU4W5PG5.js";
2
- import "./layers.C5WLg9ed.js";
3
- import { o as At } from "./layers.b0h5ZBmD.js";
4
- import { s as Tt } from "./layers.D7jGxypv.js";
5
- function ot(t, n) {
6
- let s;
7
- if (n === void 0)
8
- for (const a of t)
9
- a != null && (s < a || s === void 0 && a >= a) && (s = a);
10
- else {
11
- let a = -1;
12
- for (let u of t)
13
- (u = n(u, ++a, t)) != null && (s < u || s === void 0 && u >= u) && (s = u);
14
- }
15
- return s;
16
- }
17
- function yt(t, n) {
18
- let s;
19
- if (n === void 0)
20
- for (const a of t)
21
- a != null && (s > a || s === void 0 && a >= a) && (s = a);
22
- else {
23
- let a = -1;
24
- for (let u of t)
25
- (u = n(u, ++a, t)) != null && (s > u || s === void 0 && u >= u) && (s = u);
26
- }
27
- return s;
28
- }
29
- function Z(t, n) {
30
- let s = 0;
31
- if (n === void 0)
32
- for (let a of t)
33
- (a = +a) && (s += a);
34
- else {
35
- let a = -1;
36
- for (let u of t)
37
- (u = +n(u, ++a, t)) && (s += u);
38
- }
39
- return s;
40
- }
41
- function Mt(t) {
42
- return t.target.depth;
43
- }
44
- function Nt(t) {
45
- return t.depth;
46
- }
47
- function Pt(t, n) {
48
- return n - 1 - t.height;
49
- }
50
- function dt(t, n) {
51
- return t.sourceLinks.length ? t.depth : n - 1;
52
- }
53
- function Ct(t) {
54
- return t.targetLinks.length ? t.depth : t.sourceLinks.length ? yt(t.sourceLinks, Mt) - 1 : 0;
55
- }
56
- function G(t) {
57
- return function() {
58
- return t;
59
- };
60
- }
61
- function lt(t, n) {
62
- return q(t.source, n.source) || t.index - n.index;
63
- }
64
- function at(t, n) {
65
- return q(t.target, n.target) || t.index - n.index;
66
- }
67
- function q(t, n) {
68
- return t.y0 - n.y0;
69
- }
70
- function J(t) {
71
- return t.value;
72
- }
73
- function It(t) {
74
- return t.index;
75
- }
76
- function $t(t) {
77
- return t.nodes;
78
- }
79
- function Ot(t) {
80
- return t.links;
81
- }
82
- function ct(t, n) {
83
- const s = t.get(n);
84
- if (!s) throw new Error("missing: " + n);
85
- return s;
86
- }
87
- function ut({ nodes: t }) {
88
- for (const n of t) {
89
- let s = n.y0, a = s;
90
- for (const u of n.sourceLinks)
91
- u.y0 = s + u.width / 2, s += u.width;
92
- for (const u of n.targetLinks)
93
- u.y1 = a + u.width / 2, a += u.width;
94
- }
95
- }
96
- function jt() {
97
- let t = 0, n = 0, s = 1, a = 1, u = 24, _ = 8, g, p = It, i = dt, o, c, m = $t, b = Ot, y = 6;
98
- function x() {
99
- const e = { nodes: m.apply(null, arguments), links: b.apply(null, arguments) };
100
- return E(e), L(e), A(e), N(e), S(e), ut(e), e;
101
- }
102
- x.update = function(e) {
103
- return ut(e), e;
104
- }, x.nodeId = function(e) {
105
- return arguments.length ? (p = typeof e == "function" ? e : G(e), x) : p;
106
- }, x.nodeAlign = function(e) {
107
- return arguments.length ? (i = typeof e == "function" ? e : G(e), x) : i;
108
- }, x.nodeSort = function(e) {
109
- return arguments.length ? (o = e, x) : o;
110
- }, x.nodeWidth = function(e) {
111
- return arguments.length ? (u = +e, x) : u;
112
- }, x.nodePadding = function(e) {
113
- return arguments.length ? (_ = g = +e, x) : _;
114
- }, x.nodes = function(e) {
115
- return arguments.length ? (m = typeof e == "function" ? e : G(e), x) : m;
116
- }, x.links = function(e) {
117
- return arguments.length ? (b = typeof e == "function" ? e : G(e), x) : b;
118
- }, x.linkSort = function(e) {
119
- return arguments.length ? (c = e, x) : c;
120
- }, x.size = function(e) {
121
- return arguments.length ? (t = n = 0, s = +e[0], a = +e[1], x) : [s - t, a - n];
122
- }, x.extent = function(e) {
123
- return arguments.length ? (t = +e[0][0], s = +e[1][0], n = +e[0][1], a = +e[1][1], x) : [[t, n], [s, a]];
124
- }, x.iterations = function(e) {
125
- return arguments.length ? (y = +e, x) : y;
126
- };
127
- function E({ nodes: e, links: f }) {
128
- for (const [h, r] of e.entries())
129
- r.index = h, r.sourceLinks = [], r.targetLinks = [];
130
- const l = new Map(e.map((h, r) => [p(h, r, e), h]));
131
- for (const [h, r] of f.entries()) {
132
- r.index = h;
133
- let { source: k, target: v } = r;
134
- typeof k != "object" && (k = r.source = ct(l, k)), typeof v != "object" && (v = r.target = ct(l, v)), k.sourceLinks.push(r), v.targetLinks.push(r);
135
- }
136
- if (c != null)
137
- for (const { sourceLinks: h, targetLinks: r } of e)
138
- h.sort(c), r.sort(c);
139
- }
140
- function L({ nodes: e }) {
141
- for (const f of e)
142
- f.value = f.fixedValue === void 0 ? Math.max(Z(f.sourceLinks, J), Z(f.targetLinks, J)) : f.fixedValue;
143
- }
144
- function A({ nodes: e }) {
145
- const f = e.length;
146
- let l = new Set(e), h = /* @__PURE__ */ new Set(), r = 0;
147
- for (; l.size; ) {
148
- for (const k of l) {
149
- k.depth = r;
150
- for (const { target: v } of k.sourceLinks)
151
- h.add(v);
152
- }
153
- if (++r > f) throw new Error("circular link");
154
- l = h, h = /* @__PURE__ */ new Set();
155
- }
156
- }
157
- function N({ nodes: e }) {
158
- const f = e.length;
159
- let l = new Set(e), h = /* @__PURE__ */ new Set(), r = 0;
160
- for (; l.size; ) {
161
- for (const k of l) {
162
- k.height = r;
163
- for (const { source: v } of k.targetLinks)
164
- h.add(v);
165
- }
166
- if (++r > f) throw new Error("circular link");
167
- l = h, h = /* @__PURE__ */ new Set();
168
- }
169
- }
170
- function I({ nodes: e }) {
171
- const f = ot(e, (r) => r.depth) + 1, l = (s - t - u) / (f - 1), h = new Array(f);
172
- for (const r of e) {
173
- const k = Math.max(0, Math.min(f - 1, Math.floor(i.call(null, r, f))));
174
- r.layer = k, r.x0 = t + k * l, r.x1 = r.x0 + u, h[k] ? h[k].push(r) : h[k] = [r];
175
- }
176
- if (o) for (const r of h)
177
- r.sort(o);
178
- return h;
179
- }
180
- function j(e) {
181
- const f = yt(e, (l) => (a - n - (l.length - 1) * g) / Z(l, J));
182
- for (const l of e) {
183
- let h = n;
184
- for (const r of l) {
185
- r.y0 = h, r.y1 = h + r.value * f, h = r.y1 + g;
186
- for (const k of r.sourceLinks)
187
- k.width = k.value * f;
188
- }
189
- h = (a - h + g) / (l.length + 1);
190
- for (let r = 0; r < l.length; ++r) {
191
- const k = l[r];
192
- k.y0 += h * (r + 1), k.y1 += h * (r + 1);
193
- }
194
- $(l);
195
- }
196
- }
197
- function S(e) {
198
- const f = I(e);
199
- g = Math.min(_, (a - n) / (ot(f, (l) => l.length) - 1)), j(f);
200
- for (let l = 0; l < y; ++l) {
201
- const h = Math.pow(0.99, l), r = Math.max(1 - h, (l + 1) / y);
202
- O(f, h, r), M(f, h, r);
203
- }
204
- }
205
- function M(e, f, l) {
206
- for (let h = 1, r = e.length; h < r; ++h) {
207
- const k = e[h];
208
- for (const v of k) {
209
- let R = 0, z = 0;
210
- for (const { source: W, value: K } of v.targetLinks) {
211
- let F = K * (v.layer - W.layer);
212
- R += T(W, v) * F, z += F;
213
- }
214
- if (!(z > 0)) continue;
215
- let U = (R / z - v.y0) * f;
216
- v.y0 += U, v.y1 += U, w(v);
217
- }
218
- o === void 0 && k.sort(q), P(k, l);
219
- }
220
- }
221
- function O(e, f, l) {
222
- for (let h = e.length, r = h - 2; r >= 0; --r) {
223
- const k = e[r];
224
- for (const v of k) {
225
- let R = 0, z = 0;
226
- for (const { target: W, value: K } of v.sourceLinks) {
227
- let F = K * (W.layer - v.layer);
228
- R += V(v, W) * F, z += F;
229
- }
230
- if (!(z > 0)) continue;
231
- let U = (R / z - v.y0) * f;
232
- v.y0 += U, v.y1 += U, w(v);
233
- }
234
- o === void 0 && k.sort(q), P(k, l);
235
- }
236
- }
237
- function P(e, f) {
238
- const l = e.length >> 1, h = e[l];
239
- d(e, h.y0 - g, l - 1, f), C(e, h.y1 + g, l + 1, f), d(e, a, e.length - 1, f), C(e, n, 0, f);
240
- }
241
- function C(e, f, l, h) {
242
- for (; l < e.length; ++l) {
243
- const r = e[l], k = (f - r.y0) * h;
244
- k > 1e-6 && (r.y0 += k, r.y1 += k), f = r.y1 + g;
245
- }
246
- }
247
- function d(e, f, l, h) {
248
- for (; l >= 0; --l) {
249
- const r = e[l], k = (r.y1 - f) * h;
250
- k > 1e-6 && (r.y0 -= k, r.y1 -= k), f = r.y0 - g;
251
- }
252
- }
253
- function w({ sourceLinks: e, targetLinks: f }) {
254
- if (c === void 0) {
255
- for (const { source: { sourceLinks: l } } of f)
256
- l.sort(at);
257
- for (const { target: { targetLinks: l } } of e)
258
- l.sort(lt);
259
- }
260
- }
261
- function $(e) {
262
- if (c === void 0)
263
- for (const { sourceLinks: f, targetLinks: l } of e)
264
- f.sort(at), l.sort(lt);
265
- }
266
- function T(e, f) {
267
- let l = e.y0 - (e.sourceLinks.length - 1) * g / 2;
268
- for (const { target: h, width: r } of e.sourceLinks) {
269
- if (h === f) break;
270
- l += r + g;
271
- }
272
- for (const { source: h, width: r } of f.targetLinks) {
273
- if (h === e) break;
274
- l -= r;
275
- }
276
- return l;
277
- }
278
- function V(e, f) {
279
- let l = f.y0 - (f.targetLinks.length - 1) * g / 2;
280
- for (const { source: h, width: r } of f.targetLinks) {
281
- if (h === e) break;
282
- l += r + g;
283
- }
284
- for (const { target: h, width: r } of e.sourceLinks) {
285
- if (h === f) break;
286
- l -= r;
287
- }
288
- return l;
289
- }
290
- return x;
291
- }
292
- var tt = Math.PI, et = 2 * tt, D = 1e-6, zt = et - D;
293
- function nt() {
294
- this._x0 = this._y0 = // start of current subpath
295
- this._x1 = this._y1 = null, this._ = "";
296
- }
297
- function gt() {
298
- return new nt();
299
- }
300
- nt.prototype = gt.prototype = {
301
- constructor: nt,
302
- moveTo: function(t, n) {
303
- this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n);
304
- },
305
- closePath: function() {
306
- this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
307
- },
308
- lineTo: function(t, n) {
309
- this._ += "L" + (this._x1 = +t) + "," + (this._y1 = +n);
310
- },
311
- quadraticCurveTo: function(t, n, s, a) {
312
- this._ += "Q" + +t + "," + +n + "," + (this._x1 = +s) + "," + (this._y1 = +a);
313
- },
314
- bezierCurveTo: function(t, n, s, a, u, _) {
315
- this._ += "C" + +t + "," + +n + "," + +s + "," + +a + "," + (this._x1 = +u) + "," + (this._y1 = +_);
316
- },
317
- arcTo: function(t, n, s, a, u) {
318
- t = +t, n = +n, s = +s, a = +a, u = +u;
319
- var _ = this._x1, g = this._y1, p = s - t, i = a - n, o = _ - t, c = g - n, m = o * o + c * c;
320
- if (u < 0) throw new Error("negative radius: " + u);
321
- if (this._x1 === null)
322
- this._ += "M" + (this._x1 = t) + "," + (this._y1 = n);
323
- else if (m > D) if (!(Math.abs(c * p - i * o) > D) || !u)
324
- this._ += "L" + (this._x1 = t) + "," + (this._y1 = n);
325
- else {
326
- var b = s - _, y = a - g, x = p * p + i * i, E = b * b + y * y, L = Math.sqrt(x), A = Math.sqrt(m), N = u * Math.tan((tt - Math.acos((x + m - E) / (2 * L * A))) / 2), I = N / A, j = N / L;
327
- Math.abs(I - 1) > D && (this._ += "L" + (t + I * o) + "," + (n + I * c)), this._ += "A" + u + "," + u + ",0,0," + +(c * b > o * y) + "," + (this._x1 = t + j * p) + "," + (this._y1 = n + j * i);
328
- }
329
- },
330
- arc: function(t, n, s, a, u, _) {
331
- t = +t, n = +n, s = +s, _ = !!_;
332
- var g = s * Math.cos(a), p = s * Math.sin(a), i = t + g, o = n + p, c = 1 ^ _, m = _ ? a - u : u - a;
333
- if (s < 0) throw new Error("negative radius: " + s);
334
- this._x1 === null ? this._ += "M" + i + "," + o : (Math.abs(this._x1 - i) > D || Math.abs(this._y1 - o) > D) && (this._ += "L" + i + "," + o), s && (m < 0 && (m = m % et + et), m > zt ? this._ += "A" + s + "," + s + ",0,1," + c + "," + (t - g) + "," + (n - p) + "A" + s + "," + s + ",0,1," + c + "," + (this._x1 = i) + "," + (this._y1 = o) : m > D && (this._ += "A" + s + "," + s + ",0," + +(m >= tt) + "," + c + "," + (this._x1 = t + s * Math.cos(u)) + "," + (this._y1 = n + s * Math.sin(u))));
335
- },
336
- rect: function(t, n, s, a) {
337
- this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n) + "h" + +s + "v" + +a + "h" + -s + "Z";
338
- },
339
- toString: function() {
340
- return this._;
341
- }
342
- };
343
- function ht(t) {
344
- return function() {
345
- return t;
346
- };
347
- }
348
- function Dt(t) {
349
- return t[0];
350
- }
351
- function Bt(t) {
352
- return t[1];
353
- }
354
- var Vt = Array.prototype.slice;
355
- function Rt(t) {
356
- return t.source;
357
- }
358
- function Ut(t) {
359
- return t.target;
360
- }
361
- function Wt(t) {
362
- var n = Rt, s = Ut, a = Dt, u = Bt, _ = null;
363
- function g() {
364
- var p, i = Vt.call(arguments), o = n.apply(this, i), c = s.apply(this, i);
365
- if (_ || (_ = p = gt()), t(_, +a.apply(this, (i[0] = o, i)), +u.apply(this, i), +a.apply(this, (i[0] = c, i)), +u.apply(this, i)), p) return _ = null, p + "" || null;
366
- }
367
- return g.source = function(p) {
368
- return arguments.length ? (n = p, g) : n;
369
- }, g.target = function(p) {
370
- return arguments.length ? (s = p, g) : s;
371
- }, g.x = function(p) {
372
- return arguments.length ? (a = typeof p == "function" ? p : ht(+p), g) : a;
373
- }, g.y = function(p) {
374
- return arguments.length ? (u = typeof p == "function" ? p : ht(+p), g) : u;
375
- }, g.context = function(p) {
376
- return arguments.length ? (_ = p ?? null, g) : _;
377
- }, g;
378
- }
379
- function Ft(t, n, s, a, u) {
380
- t.moveTo(n, s), t.bezierCurveTo(n = (n + a) / 2, s, n, u, a, u);
381
- }
382
- function Yt() {
383
- return Wt(Ft);
384
- }
385
- function Gt(t) {
386
- return [t.source.x1, t.y0];
387
- }
388
- function qt(t) {
389
- return [t.target.x0, t.y1];
390
- }
391
- function Ht() {
392
- return Yt().source(Gt).target(qt);
393
- }
394
- var it = (function() {
395
- var t = function(p, i, o, c) {
396
- for (o = o || {}, c = p.length; c--; o[p[c]] = i)
397
- ;
398
- return o;
399
- }, n = [1, 9], s = [1, 10], a = [1, 5, 10, 12], u = {
400
- trace: function() {
401
- },
402
- yy: {},
403
- symbols_: { error: 2, start: 3, SANKEY: 4, NEWLINE: 5, csv: 6, opt_eof: 7, record: 8, csv_tail: 9, EOF: 10, "field[source]": 11, COMMA: 12, "field[target]": 13, "field[value]": 14, field: 15, escaped: 16, non_escaped: 17, DQUOTE: 18, ESCAPED_TEXT: 19, NON_ESCAPED_TEXT: 20, $accept: 0, $end: 1 },
404
- terminals_: { 2: "error", 4: "SANKEY", 5: "NEWLINE", 10: "EOF", 11: "field[source]", 12: "COMMA", 13: "field[target]", 14: "field[value]", 18: "DQUOTE", 19: "ESCAPED_TEXT", 20: "NON_ESCAPED_TEXT" },
405
- productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]],
406
- performAction: function(i, o, c, m, b, y, x) {
407
- var E = y.length - 1;
408
- switch (b) {
409
- case 7:
410
- const L = m.findOrCreateNode(y[E - 4].trim().replaceAll('""', '"')), A = m.findOrCreateNode(y[E - 2].trim().replaceAll('""', '"')), N = parseFloat(y[E].trim());
411
- m.addLink(L, A, N);
412
- break;
413
- case 8:
414
- case 9:
415
- case 11:
416
- this.$ = y[E];
417
- break;
418
- case 10:
419
- this.$ = y[E - 1];
420
- break;
421
- }
422
- },
423
- table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, { 5: [1, 3] }, { 6: 4, 8: 5, 15: 6, 16: 7, 17: 8, 18: n, 20: s }, { 1: [2, 6], 7: 11, 10: [1, 12] }, t(s, [2, 4], { 9: 13, 5: [1, 14] }), { 12: [1, 15] }, t(a, [2, 8]), t(a, [2, 9]), { 19: [1, 16] }, t(a, [2, 11]), { 1: [2, 1] }, { 1: [2, 5] }, t(s, [2, 2]), { 6: 17, 8: 5, 15: 6, 16: 7, 17: 8, 18: n, 20: s }, { 15: 18, 16: 7, 17: 8, 18: n, 20: s }, { 18: [1, 19] }, t(s, [2, 3]), { 12: [1, 20] }, t(a, [2, 10]), { 15: 21, 16: 7, 17: 8, 18: n, 20: s }, t([1, 5, 10], [2, 7])],
424
- defaultActions: { 11: [2, 1], 12: [2, 5] },
425
- parseError: function(i, o) {
426
- if (o.recoverable)
427
- this.trace(i);
428
- else {
429
- var c = new Error(i);
430
- throw c.hash = o, c;
431
- }
432
- },
433
- parse: function(i) {
434
- var o = this, c = [0], m = [], b = [null], y = [], x = this.table, E = "", L = 0, A = 0, N = 2, I = 1, j = y.slice.call(arguments, 1), S = Object.create(this.lexer), M = { yy: {} };
435
- for (var O in this.yy)
436
- Object.prototype.hasOwnProperty.call(this.yy, O) && (M.yy[O] = this.yy[O]);
437
- S.setInput(i, M.yy), M.yy.lexer = S, M.yy.parser = this, typeof S.yylloc > "u" && (S.yylloc = {});
438
- var P = S.yylloc;
439
- y.push(P);
440
- var C = S.options && S.options.ranges;
441
- typeof M.yy.parseError == "function" ? this.parseError = M.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
442
- function d() {
443
- var v;
444
- return v = m.pop() || S.lex() || I, typeof v != "number" && (v instanceof Array && (m = v, v = m.pop()), v = o.symbols_[v] || v), v;
445
- }
446
- for (var w, $, T, V, e = {}, f, l, h, r; ; ) {
447
- if ($ = c[c.length - 1], this.defaultActions[$] ? T = this.defaultActions[$] : ((w === null || typeof w > "u") && (w = d()), T = x[$] && x[$][w]), typeof T > "u" || !T.length || !T[0]) {
448
- var k = "";
449
- r = [];
450
- for (f in x[$])
451
- this.terminals_[f] && f > N && r.push("'" + this.terminals_[f] + "'");
452
- S.showPosition ? k = "Parse error on line " + (L + 1) + `:
453
- ` + S.showPosition() + `
454
- Expecting ` + r.join(", ") + ", got '" + (this.terminals_[w] || w) + "'" : k = "Parse error on line " + (L + 1) + ": Unexpected " + (w == I ? "end of input" : "'" + (this.terminals_[w] || w) + "'"), this.parseError(k, {
455
- text: S.match,
456
- token: this.terminals_[w] || w,
457
- line: S.yylineno,
458
- loc: P,
459
- expected: r
460
- });
461
- }
462
- if (T[0] instanceof Array && T.length > 1)
463
- throw new Error("Parse Error: multiple actions possible at state: " + $ + ", token: " + w);
464
- switch (T[0]) {
465
- case 1:
466
- c.push(w), b.push(S.yytext), y.push(S.yylloc), c.push(T[1]), w = null, A = S.yyleng, E = S.yytext, L = S.yylineno, P = S.yylloc;
467
- break;
468
- case 2:
469
- if (l = this.productions_[T[1]][1], e.$ = b[b.length - l], e._$ = {
470
- first_line: y[y.length - (l || 1)].first_line,
471
- last_line: y[y.length - 1].last_line,
472
- first_column: y[y.length - (l || 1)].first_column,
473
- last_column: y[y.length - 1].last_column
474
- }, C && (e._$.range = [
475
- y[y.length - (l || 1)].range[0],
476
- y[y.length - 1].range[1]
477
- ]), V = this.performAction.apply(e, [
478
- E,
479
- A,
480
- L,
481
- M.yy,
482
- T[1],
483
- b,
484
- y
485
- ].concat(j)), typeof V < "u")
486
- return V;
487
- l && (c = c.slice(0, -1 * l * 2), b = b.slice(0, -1 * l), y = y.slice(0, -1 * l)), c.push(this.productions_[T[1]][0]), b.push(e.$), y.push(e._$), h = x[c[c.length - 2]][c[c.length - 1]], c.push(h);
488
- break;
489
- case 3:
490
- return !0;
491
- }
492
- }
493
- return !0;
494
- }
495
- }, _ = /* @__PURE__ */ (function() {
496
- var p = {
497
- EOF: 1,
498
- parseError: function(o, c) {
499
- if (this.yy.parser)
500
- this.yy.parser.parseError(o, c);
501
- else
502
- throw new Error(o);
503
- },
504
- // resets the lexer, sets new input
505
- setInput: function(i, o) {
506
- return this.yy = o || this.yy || {}, this._input = i, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
507
- first_line: 1,
508
- first_column: 0,
509
- last_line: 1,
510
- last_column: 0
511
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
512
- },
513
- // consumes and returns one char from the input
514
- input: function() {
515
- var i = this._input[0];
516
- this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i;
517
- var o = i.match(/(?:\r\n?|\n).*/g);
518
- return o ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), i;
519
- },
520
- // unshifts one char (or a string) into the input
521
- unput: function(i) {
522
- var o = i.length, c = i.split(/(?:\r\n?|\n)/g);
523
- this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - o), this.offset -= o;
524
- var m = this.match.split(/(?:\r\n?|\n)/g);
525
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), c.length - 1 && (this.yylineno -= c.length - 1);
526
- var b = this.yylloc.range;
527
- return this.yylloc = {
528
- first_line: this.yylloc.first_line,
529
- last_line: this.yylineno + 1,
530
- first_column: this.yylloc.first_column,
531
- last_column: c ? (c.length === m.length ? this.yylloc.first_column : 0) + m[m.length - c.length].length - c[0].length : this.yylloc.first_column - o
532
- }, this.options.ranges && (this.yylloc.range = [b[0], b[0] + this.yyleng - o]), this.yyleng = this.yytext.length, this;
533
- },
534
- // When called from action, caches matched text and appends it on next action
535
- more: function() {
536
- return this._more = !0, this;
537
- },
538
- // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
539
- reject: function() {
540
- if (this.options.backtrack_lexer)
541
- this._backtrack = !0;
542
- else
543
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
544
- ` + this.showPosition(), {
545
- text: "",
546
- token: null,
547
- line: this.yylineno
548
- });
549
- return this;
550
- },
551
- // retain first n characters of the match
552
- less: function(i) {
553
- this.unput(this.match.slice(i));
554
- },
555
- // displays already matched input, i.e. for error messages
556
- pastInput: function() {
557
- var i = this.matched.substr(0, this.matched.length - this.match.length);
558
- return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
559
- },
560
- // displays upcoming input, i.e. for error messages
561
- upcomingInput: function() {
562
- var i = this.match;
563
- return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
564
- },
565
- // displays the character position where the lexing error occurred, i.e. for error messages
566
- showPosition: function() {
567
- var i = this.pastInput(), o = new Array(i.length + 1).join("-");
568
- return i + this.upcomingInput() + `
569
- ` + o + "^";
570
- },
571
- // test the lexed token: return FALSE when not a match, otherwise return token
572
- test_match: function(i, o) {
573
- var c, m, b;
574
- if (this.options.backtrack_lexer && (b = {
575
- yylineno: this.yylineno,
576
- yylloc: {
577
- first_line: this.yylloc.first_line,
578
- last_line: this.last_line,
579
- first_column: this.yylloc.first_column,
580
- last_column: this.yylloc.last_column
581
- },
582
- yytext: this.yytext,
583
- match: this.match,
584
- matches: this.matches,
585
- matched: this.matched,
586
- yyleng: this.yyleng,
587
- offset: this.offset,
588
- _more: this._more,
589
- _input: this._input,
590
- yy: this.yy,
591
- conditionStack: this.conditionStack.slice(0),
592
- done: this.done
593
- }, this.options.ranges && (b.yylloc.range = this.yylloc.range.slice(0))), m = i[0].match(/(?:\r\n?|\n).*/g), m && (this.yylineno += m.length), this.yylloc = {
594
- first_line: this.yylloc.last_line,
595
- last_line: this.yylineno + 1,
596
- first_column: this.yylloc.last_column,
597
- last_column: m ? m[m.length - 1].length - m[m.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
598
- }, this.yytext += i[0], this.match += i[0], this.matches = i, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(i[0].length), this.matched += i[0], c = this.performAction.call(this, this.yy, this, o, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), c)
599
- return c;
600
- if (this._backtrack) {
601
- for (var y in b)
602
- this[y] = b[y];
603
- return !1;
604
- }
605
- return !1;
606
- },
607
- // return next match in input
608
- next: function() {
609
- if (this.done)
610
- return this.EOF;
611
- this._input || (this.done = !0);
612
- var i, o, c, m;
613
- this._more || (this.yytext = "", this.match = "");
614
- for (var b = this._currentRules(), y = 0; y < b.length; y++)
615
- if (c = this._input.match(this.rules[b[y]]), c && (!o || c[0].length > o[0].length)) {
616
- if (o = c, m = y, this.options.backtrack_lexer) {
617
- if (i = this.test_match(c, b[y]), i !== !1)
618
- return i;
619
- if (this._backtrack) {
620
- o = !1;
621
- continue;
622
- } else
623
- return !1;
624
- } else if (!this.options.flex)
625
- break;
626
- }
627
- return o ? (i = this.test_match(o, b[m]), i !== !1 ? i : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
628
- ` + this.showPosition(), {
629
- text: "",
630
- token: null,
631
- line: this.yylineno
632
- });
633
- },
634
- // return next match that has a token
635
- lex: function() {
636
- var o = this.next();
637
- return o || this.lex();
638
- },
639
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
640
- begin: function(o) {
641
- this.conditionStack.push(o);
642
- },
643
- // pop the previously active lexer condition state off the condition stack
644
- popState: function() {
645
- var o = this.conditionStack.length - 1;
646
- return o > 0 ? this.conditionStack.pop() : this.conditionStack[0];
647
- },
648
- // produce the lexer rule set which is active for the currently active lexer condition state
649
- _currentRules: function() {
650
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
651
- },
652
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
653
- topState: function(o) {
654
- return o = this.conditionStack.length - 1 - Math.abs(o || 0), o >= 0 ? this.conditionStack[o] : "INITIAL";
655
- },
656
- // alias for begin(condition)
657
- pushState: function(o) {
658
- this.begin(o);
659
- },
660
- // return the number of states currently on the stack
661
- stateStackSize: function() {
662
- return this.conditionStack.length;
663
- },
664
- options: { "case-insensitive": !0 },
665
- performAction: function(o, c, m, b) {
666
- switch (m) {
667
- case 0:
668
- return this.pushState("csv"), 4;
669
- case 1:
670
- return 10;
671
- case 2:
672
- return 5;
673
- case 3:
674
- return 12;
675
- case 4:
676
- return this.pushState("escaped_text"), 18;
677
- case 5:
678
- return 20;
679
- case 6:
680
- return this.popState("escaped_text"), 18;
681
- case 7:
682
- return 19;
683
- }
684
- },
685
- rules: [/^(?:sankey-beta\b)/i, /^(?:$)/i, /^(?:((\u000D\u000A)|(\u000A)))/i, /^(?:(\u002C))/i, /^(?:(\u0022))/i, /^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i, /^(?:(\u0022)(?!(\u0022)))/i, /^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],
686
- conditions: { csv: { rules: [1, 2, 3, 4, 5, 6, 7], inclusive: !1 }, escaped_text: { rules: [6, 7], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7], inclusive: !0 } }
687
- };
688
- return p;
689
- })();
690
- u.lexer = _;
691
- function g() {
692
- this.yy = {};
693
- }
694
- return g.prototype = u, u.Parser = g, new g();
695
- })();
696
- it.parser = it;
697
- const H = it;
698
- let X = [], Q = [], B = {};
699
- const Xt = () => {
700
- X = [], Q = [], B = {}, Lt();
701
- };
702
- class Qt {
703
- constructor(n, s, a = 0) {
704
- this.source = n, this.target = s, this.value = a;
705
- }
706
- }
707
- const Kt = (t, n, s) => {
708
- X.push(new Qt(t, n, s));
709
- };
710
- class Zt {
711
- constructor(n) {
712
- this.ID = n;
713
- }
714
- }
715
- const Jt = (t) => (t = Et.sanitizeText(t, rt()), B[t] || (B[t] = new Zt(t), Q.push(B[t])), B[t]), te = () => Q, ee = () => X, ne = () => ({
716
- nodes: Q.map((t) => ({ id: t.ID })),
717
- links: X.map((t) => ({
718
- source: t.source.ID,
719
- target: t.target.ID,
720
- value: t.value
721
- }))
722
- }), ie = {
723
- nodesMap: B,
724
- getConfig: () => rt().sankey,
725
- getNodes: te,
726
- getLinks: ee,
727
- getGraph: ne,
728
- addLink: Kt,
729
- findOrCreateNode: Jt,
730
- getAccTitle: bt,
731
- setAccTitle: vt,
732
- getAccDescription: xt,
733
- setAccDescription: _t,
734
- getDiagramTitle: kt,
735
- setDiagramTitle: mt,
736
- clear: Xt
737
- }, pt = class st {
738
- static next(n) {
739
- return new st(n + ++st.count);
740
- }
741
- constructor(n) {
742
- this.id = n, this.href = `#${n}`;
743
- }
744
- toString() {
745
- return "url(" + this.href + ")";
746
- }
747
- };
748
- pt.count = 0;
749
- let ft = pt;
750
- const se = {
751
- left: Nt,
752
- right: Pt,
753
- center: Ct,
754
- justify: dt
755
- }, re = function(t, n, s, a) {
756
- const { securityLevel: u, sankey: _ } = rt(), g = wt.sankey;
757
- let p;
758
- u === "sandbox" && (p = Y("#i" + n));
759
- const i = u === "sandbox" ? Y(p.nodes()[0].contentDocument.body) : Y("body"), o = u === "sandbox" ? i.select(`[id="${n}"]`) : Y(`[id="${n}"]`), c = (_ == null ? void 0 : _.width) ?? g.width, m = (_ == null ? void 0 : _.height) ?? g.width, b = (_ == null ? void 0 : _.useMaxWidth) ?? g.useMaxWidth, y = (_ == null ? void 0 : _.nodeAlignment) ?? g.nodeAlignment, x = (_ == null ? void 0 : _.prefix) ?? g.prefix, E = (_ == null ? void 0 : _.suffix) ?? g.suffix, L = (_ == null ? void 0 : _.showValues) ?? g.showValues, A = a.db.getGraph(), N = se[y];
760
- jt().nodeId((d) => d.id).nodeWidth(10).nodePadding(10 + (L ? 15 : 0)).nodeAlign(N).extent([
761
- [0, 0],
762
- [c, m]
763
- ])(A);
764
- const S = At(Tt);
765
- o.append("g").attr("class", "nodes").selectAll(".node").data(A.nodes).join("g").attr("class", "node").attr("id", (d) => (d.uid = ft.next("node-")).id).attr("transform", function(d) {
766
- return "translate(" + d.x0 + "," + d.y0 + ")";
767
- }).attr("x", (d) => d.x0).attr("y", (d) => d.y0).append("rect").attr("height", (d) => d.y1 - d.y0).attr("width", (d) => d.x1 - d.x0).attr("fill", (d) => S(d.id));
768
- const M = ({ id: d, value: w }) => L ? `${d}
769
- ${x}${Math.round(w * 100) / 100}${E}` : d;
770
- o.append("g").attr("class", "node-labels").attr("font-family", "sans-serif").attr("font-size", 14).selectAll("text").data(A.nodes).join("text").attr("x", (d) => d.x0 < c / 2 ? d.x1 + 6 : d.x0 - 6).attr("y", (d) => (d.y1 + d.y0) / 2).attr("dy", `${L ? "0" : "0.35"}em`).attr("text-anchor", (d) => d.x0 < c / 2 ? "start" : "end").text(M);
771
- const O = o.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", 0.5).selectAll(".link").data(A.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply"), P = (_ == null ? void 0 : _.linkColor) || "gradient";
772
- if (P === "gradient") {
773
- const d = O.append("linearGradient").attr("id", (w) => (w.uid = ft.next("linearGradient-")).id).attr("gradientUnits", "userSpaceOnUse").attr("x1", (w) => w.source.x1).attr("x2", (w) => w.target.x0);
774
- d.append("stop").attr("offset", "0%").attr("stop-color", (w) => S(w.source.id)), d.append("stop").attr("offset", "100%").attr("stop-color", (w) => S(w.target.id));
775
- }
776
- let C;
777
- switch (P) {
778
- case "gradient":
779
- C = (d) => d.uid;
780
- break;
781
- case "source":
782
- C = (d) => S(d.source.id);
783
- break;
784
- case "target":
785
- C = (d) => S(d.target.id);
786
- break;
787
- default:
788
- C = P;
789
- }
790
- O.append("path").attr("d", Ht()).attr("stroke", C).attr("stroke-width", (d) => Math.max(1, d.width)), St(void 0, o, 0, b);
791
- }, oe = {
792
- draw: re
793
- }, le = (t) => t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, `
794
- `).trim(), ae = H.parse.bind(H);
795
- H.parse = (t) => ae(le(t));
796
- const ye = {
797
- parser: H,
798
- db: ie,
799
- renderer: oe
800
- };
801
- export {
802
- ye as diagram
803
- };