smart-chat-asp 2.11.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 (57) hide show
  1. package/README.md +364 -0
  2. package/README.zh.md +367 -0
  3. package/lib/Tableau10-2ff7471d.mjs +9 -0
  4. package/lib/arc-33fcfaff.mjs +86 -0
  5. package/lib/array-2ff2c7a6.mjs +6 -0
  6. package/lib/blockDiagram-38ab4fdb-3c912e88.mjs +1230 -0
  7. package/lib/c4Diagram-3d4e48cf-49908d37.mjs +1580 -0
  8. package/lib/channel-890a888a.mjs +5 -0
  9. package/lib/classDiagram-70f12bd4-ace7b178.mjs +221 -0
  10. package/lib/classDiagram-v2-f2320105-5848085d.mjs +207 -0
  11. package/lib/clone-59a3b16a.mjs +8 -0
  12. package/lib/createText-2e5e7dd3-898a4de3.mjs +2966 -0
  13. package/lib/edges-e0da2a9e-91b210e9.mjs +1083 -0
  14. package/lib/erDiagram-9861fffd-c13b7611.mjs +933 -0
  15. package/lib/favicon.ico +0 -0
  16. package/lib/favicon.svg +1 -0
  17. package/lib/flowDb-956e92f1-56fdcb20.mjs +1126 -0
  18. package/lib/flowDiagram-66a62f08-4023035a.mjs +798 -0
  19. package/lib/flowDiagram-v2-96b9c2cf-d28d8b17.mjs +26 -0
  20. package/lib/flowchart-elk-definition-4a651766-ab5b1391.mjs +48407 -0
  21. package/lib/ganttDiagram-c361ad54-ae59a5e3.mjs +2504 -0
  22. package/lib/gitGraphDiagram-72cf32ee-5bdf46bb.mjs +1265 -0
  23. package/lib/graph-9ea4e80a.mjs +512 -0
  24. package/lib/index-3862675e-b7177fa1.mjs +373 -0
  25. package/lib/index-958a220b.mjs +1470 -0
  26. package/lib/index-c42b0ff4.mjs +40 -0
  27. package/lib/index-f76d9453.mjs +28 -0
  28. package/lib/infoDiagram-f8f76790-5f3835f9.mjs +320 -0
  29. package/lib/init-f9637058.mjs +16 -0
  30. package/lib/journeyDiagram-49397b02-df06b21d.mjs +805 -0
  31. package/lib/layout-d3bc02b9.mjs +1495 -0
  32. package/lib/line-b044df13.mjs +34 -0
  33. package/lib/linear-e60140ad.mjs +447 -0
  34. package/lib/main-740da2e1.mjs +117801 -0
  35. package/lib/mindmap-definition-fc14e90a-3bfaf2a6.mjs +19384 -0
  36. package/lib/ordinal-980380c7.mjs +65 -0
  37. package/lib/path-428ebac9.mjs +91 -0
  38. package/lib/pieDiagram-8a3498a8-a8359c54.mjs +503 -0
  39. package/lib/pwa-192x192.png +0 -0
  40. package/lib/pwa-512x512.png +0 -0
  41. package/lib/quadrantDiagram-120e2f19-367eeae7.mjs +905 -0
  42. package/lib/requirementDiagram-deff3bca-27d1e96b.mjs +770 -0
  43. package/lib/sankeyDiagram-04a897e0-a9e993ee.mjs +818 -0
  44. package/lib/sequenceDiagram-704730f1-05f9d7b1.mjs +2235 -0
  45. package/lib/smart-chat.es.js +5 -0
  46. package/lib/smart-chat.umd.js +5444 -0
  47. package/lib/stateDiagram-587899a1-f3e4a81e.mjs +269 -0
  48. package/lib/stateDiagram-v2-d93cdb3a-763ad0ff.mjs +191 -0
  49. package/lib/style.css +1 -0
  50. package/lib/styles-6aaf32cf-e32ec570.mjs +960 -0
  51. package/lib/styles-9a916d00-18b5fd0d.mjs +1089 -0
  52. package/lib/styles-c10674c1-134300a0.mjs +433 -0
  53. package/lib/svgDrawCommon-08f97a94-f04d54dc.mjs +64 -0
  54. package/lib/timeline-definition-85554ec2-1989252c.mjs +796 -0
  55. package/lib/xychartDiagram-e933f94c-f7d5a550.mjs +1285 -0
  56. package/license +21 -0
  57. package/package.json +79 -0
@@ -0,0 +1,818 @@
1
+ import { Y as rt, U as mt, T as kt, W as _t, X as xt, an as vt, am as bt, ao as wt, a5 as St, bn as Lt, a1 as Y, ad as Et } from "./main-740da2e1.mjs";
2
+ import { o as At } from "./ordinal-980380c7.mjs";
3
+ import { s as Tt } from "./Tableau10-2ff7471d.mjs";
4
+ import "vue";
5
+ import "./init-f9637058.mjs";
6
+ function ot(t, n) {
7
+ let s;
8
+ if (n === void 0)
9
+ for (const a of t)
10
+ a != null && (s < a || s === void 0 && a >= a) && (s = a);
11
+ else {
12
+ let a = -1;
13
+ for (let u of t)
14
+ (u = n(u, ++a, t)) != null && (s < u || s === void 0 && u >= u) && (s = u);
15
+ }
16
+ return s;
17
+ }
18
+ function yt(t, n) {
19
+ let s;
20
+ if (n === void 0)
21
+ for (const a of t)
22
+ a != null && (s > a || s === void 0 && a >= a) && (s = a);
23
+ else {
24
+ let a = -1;
25
+ for (let u of t)
26
+ (u = n(u, ++a, t)) != null && (s > u || s === void 0 && u >= u) && (s = u);
27
+ }
28
+ return s;
29
+ }
30
+ function Z(t, n) {
31
+ let s = 0;
32
+ if (n === void 0)
33
+ for (let a of t)
34
+ (a = +a) && (s += a);
35
+ else {
36
+ let a = -1;
37
+ for (let u of t)
38
+ (u = +n(u, ++a, t)) && (s += u);
39
+ }
40
+ return s;
41
+ }
42
+ function Mt(t) {
43
+ return t.target.depth;
44
+ }
45
+ function Nt(t) {
46
+ return t.depth;
47
+ }
48
+ function Pt(t, n) {
49
+ return n - 1 - t.height;
50
+ }
51
+ function dt(t, n) {
52
+ return t.sourceLinks.length ? t.depth : n - 1;
53
+ }
54
+ function Ct(t) {
55
+ return t.targetLinks.length ? t.depth : t.sourceLinks.length ? yt(t.sourceLinks, Mt) - 1 : 0;
56
+ }
57
+ function G(t) {
58
+ return function() {
59
+ return t;
60
+ };
61
+ }
62
+ function lt(t, n) {
63
+ return X(t.source, n.source) || t.index - n.index;
64
+ }
65
+ function at(t, n) {
66
+ return X(t.target, n.target) || t.index - n.index;
67
+ }
68
+ function X(t, n) {
69
+ return t.y0 - n.y0;
70
+ }
71
+ function J(t) {
72
+ return t.value;
73
+ }
74
+ function It(t) {
75
+ return t.index;
76
+ }
77
+ function $t(t) {
78
+ return t.nodes;
79
+ }
80
+ function Ot(t) {
81
+ return t.links;
82
+ }
83
+ function ct(t, n) {
84
+ const s = t.get(n);
85
+ if (!s)
86
+ throw new Error("missing: " + n);
87
+ return s;
88
+ }
89
+ function ut({ nodes: t }) {
90
+ for (const n of t) {
91
+ let s = n.y0, a = s;
92
+ for (const u of n.sourceLinks)
93
+ u.y0 = s + u.width / 2, s += u.width;
94
+ for (const u of n.targetLinks)
95
+ u.y1 = a + u.width / 2, a += u.width;
96
+ }
97
+ }
98
+ function zt() {
99
+ 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;
100
+ function x() {
101
+ const e = { nodes: m.apply(null, arguments), links: b.apply(null, arguments) };
102
+ return E(e), L(e), A(e), N(e), S(e), ut(e), e;
103
+ }
104
+ x.update = function(e) {
105
+ return ut(e), e;
106
+ }, x.nodeId = function(e) {
107
+ return arguments.length ? (p = typeof e == "function" ? e : G(e), x) : p;
108
+ }, x.nodeAlign = function(e) {
109
+ return arguments.length ? (i = typeof e == "function" ? e : G(e), x) : i;
110
+ }, x.nodeSort = function(e) {
111
+ return arguments.length ? (o = e, x) : o;
112
+ }, x.nodeWidth = function(e) {
113
+ return arguments.length ? (u = +e, x) : u;
114
+ }, x.nodePadding = function(e) {
115
+ return arguments.length ? (_ = g = +e, x) : _;
116
+ }, x.nodes = function(e) {
117
+ return arguments.length ? (m = typeof e == "function" ? e : G(e), x) : m;
118
+ }, x.links = function(e) {
119
+ return arguments.length ? (b = typeof e == "function" ? e : G(e), x) : b;
120
+ }, x.linkSort = function(e) {
121
+ return arguments.length ? (c = e, x) : c;
122
+ }, x.size = function(e) {
123
+ return arguments.length ? (t = n = 0, s = +e[0], a = +e[1], x) : [s - t, a - n];
124
+ }, x.extent = function(e) {
125
+ return arguments.length ? (t = +e[0][0], s = +e[1][0], n = +e[0][1], a = +e[1][1], x) : [[t, n], [s, a]];
126
+ }, x.iterations = function(e) {
127
+ return arguments.length ? (y = +e, x) : y;
128
+ };
129
+ function E({ nodes: e, links: f }) {
130
+ for (const [h, r] of e.entries())
131
+ r.index = h, r.sourceLinks = [], r.targetLinks = [];
132
+ const l = new Map(e.map((h, r) => [p(h, r, e), h]));
133
+ for (const [h, r] of f.entries()) {
134
+ r.index = h;
135
+ let { source: k, target: v } = r;
136
+ 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);
137
+ }
138
+ if (c != null)
139
+ for (const { sourceLinks: h, targetLinks: r } of e)
140
+ h.sort(c), r.sort(c);
141
+ }
142
+ function L({ nodes: e }) {
143
+ for (const f of e)
144
+ f.value = f.fixedValue === void 0 ? Math.max(Z(f.sourceLinks, J), Z(f.targetLinks, J)) : f.fixedValue;
145
+ }
146
+ function A({ nodes: e }) {
147
+ const f = e.length;
148
+ let l = new Set(e), h = /* @__PURE__ */ new Set(), r = 0;
149
+ for (; l.size; ) {
150
+ for (const k of l) {
151
+ k.depth = r;
152
+ for (const { target: v } of k.sourceLinks)
153
+ h.add(v);
154
+ }
155
+ if (++r > f)
156
+ throw new Error("circular link");
157
+ l = h, h = /* @__PURE__ */ new Set();
158
+ }
159
+ }
160
+ function N({ nodes: e }) {
161
+ const f = e.length;
162
+ let l = new Set(e), h = /* @__PURE__ */ new Set(), r = 0;
163
+ for (; l.size; ) {
164
+ for (const k of l) {
165
+ k.height = r;
166
+ for (const { source: v } of k.targetLinks)
167
+ h.add(v);
168
+ }
169
+ if (++r > f)
170
+ throw new Error("circular link");
171
+ l = h, h = /* @__PURE__ */ new Set();
172
+ }
173
+ }
174
+ function P({ nodes: e }) {
175
+ const f = ot(e, (r) => r.depth) + 1, l = (s - t - u) / (f - 1), h = new Array(f);
176
+ for (const r of e) {
177
+ const k = Math.max(0, Math.min(f - 1, Math.floor(i.call(null, r, f))));
178
+ r.layer = k, r.x0 = t + k * l, r.x1 = r.x0 + u, h[k] ? h[k].push(r) : h[k] = [r];
179
+ }
180
+ if (o)
181
+ for (const r of h)
182
+ r.sort(o);
183
+ return h;
184
+ }
185
+ function z(e) {
186
+ const f = yt(e, (l) => (a - n - (l.length - 1) * g) / Z(l, J));
187
+ for (const l of e) {
188
+ let h = n;
189
+ for (const r of l) {
190
+ r.y0 = h, r.y1 = h + r.value * f, h = r.y1 + g;
191
+ for (const k of r.sourceLinks)
192
+ k.width = k.value * f;
193
+ }
194
+ h = (a - h + g) / (l.length + 1);
195
+ for (let r = 0; r < l.length; ++r) {
196
+ const k = l[r];
197
+ k.y0 += h * (r + 1), k.y1 += h * (r + 1);
198
+ }
199
+ $(l);
200
+ }
201
+ }
202
+ function S(e) {
203
+ const f = P(e);
204
+ g = Math.min(_, (a - n) / (ot(f, (l) => l.length) - 1)), z(f);
205
+ for (let l = 0; l < y; ++l) {
206
+ const h = Math.pow(0.99, l), r = Math.max(1 - h, (l + 1) / y);
207
+ O(f, h, r), M(f, h, r);
208
+ }
209
+ }
210
+ function M(e, f, l) {
211
+ for (let h = 1, r = e.length; h < r; ++h) {
212
+ const k = e[h];
213
+ for (const v of k) {
214
+ let V = 0, j = 0;
215
+ for (const { source: W, value: K } of v.targetLinks) {
216
+ let F = K * (v.layer - W.layer);
217
+ V += T(W, v) * F, j += F;
218
+ }
219
+ if (!(j > 0))
220
+ continue;
221
+ let R = (V / j - v.y0) * f;
222
+ v.y0 += R, v.y1 += R, w(v);
223
+ }
224
+ o === void 0 && k.sort(X), C(k, l);
225
+ }
226
+ }
227
+ function O(e, f, l) {
228
+ for (let h = e.length, r = h - 2; r >= 0; --r) {
229
+ const k = e[r];
230
+ for (const v of k) {
231
+ let V = 0, j = 0;
232
+ for (const { target: W, value: K } of v.sourceLinks) {
233
+ let F = K * (W.layer - v.layer);
234
+ V += U(v, W) * F, j += F;
235
+ }
236
+ if (!(j > 0))
237
+ continue;
238
+ let R = (V / j - v.y0) * f;
239
+ v.y0 += R, v.y1 += R, w(v);
240
+ }
241
+ o === void 0 && k.sort(X), C(k, l);
242
+ }
243
+ }
244
+ function C(e, f) {
245
+ const l = e.length >> 1, h = e[l];
246
+ d(e, h.y0 - g, l - 1, f), I(e, h.y1 + g, l + 1, f), d(e, a, e.length - 1, f), I(e, n, 0, f);
247
+ }
248
+ function I(e, f, l, h) {
249
+ for (; l < e.length; ++l) {
250
+ const r = e[l], k = (f - r.y0) * h;
251
+ k > 1e-6 && (r.y0 += k, r.y1 += k), f = r.y1 + g;
252
+ }
253
+ }
254
+ function d(e, f, l, h) {
255
+ for (; l >= 0; --l) {
256
+ const r = e[l], k = (r.y1 - f) * h;
257
+ k > 1e-6 && (r.y0 -= k, r.y1 -= k), f = r.y0 - g;
258
+ }
259
+ }
260
+ function w({ sourceLinks: e, targetLinks: f }) {
261
+ if (c === void 0) {
262
+ for (const { source: { sourceLinks: l } } of f)
263
+ l.sort(at);
264
+ for (const { target: { targetLinks: l } } of e)
265
+ l.sort(lt);
266
+ }
267
+ }
268
+ function $(e) {
269
+ if (c === void 0)
270
+ for (const { sourceLinks: f, targetLinks: l } of e)
271
+ f.sort(at), l.sort(lt);
272
+ }
273
+ function T(e, f) {
274
+ let l = e.y0 - (e.sourceLinks.length - 1) * g / 2;
275
+ for (const { target: h, width: r } of e.sourceLinks) {
276
+ if (h === f)
277
+ break;
278
+ l += r + g;
279
+ }
280
+ for (const { source: h, width: r } of f.targetLinks) {
281
+ if (h === e)
282
+ break;
283
+ l -= r;
284
+ }
285
+ return l;
286
+ }
287
+ function U(e, f) {
288
+ let l = f.y0 - (f.targetLinks.length - 1) * g / 2;
289
+ for (const { source: h, width: r } of f.targetLinks) {
290
+ if (h === e)
291
+ break;
292
+ l += r + g;
293
+ }
294
+ for (const { target: h, width: r } of e.sourceLinks) {
295
+ if (h === f)
296
+ break;
297
+ l -= r;
298
+ }
299
+ return l;
300
+ }
301
+ return x;
302
+ }
303
+ var tt = Math.PI, et = 2 * tt, D = 1e-6, jt = et - D;
304
+ function nt() {
305
+ this._x0 = this._y0 = // start of current subpath
306
+ this._x1 = this._y1 = null, this._ = "";
307
+ }
308
+ function gt() {
309
+ return new nt();
310
+ }
311
+ nt.prototype = gt.prototype = {
312
+ constructor: nt,
313
+ moveTo: function(t, n) {
314
+ this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n);
315
+ },
316
+ closePath: function() {
317
+ this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
318
+ },
319
+ lineTo: function(t, n) {
320
+ this._ += "L" + (this._x1 = +t) + "," + (this._y1 = +n);
321
+ },
322
+ quadraticCurveTo: function(t, n, s, a) {
323
+ this._ += "Q" + +t + "," + +n + "," + (this._x1 = +s) + "," + (this._y1 = +a);
324
+ },
325
+ bezierCurveTo: function(t, n, s, a, u, _) {
326
+ this._ += "C" + +t + "," + +n + "," + +s + "," + +a + "," + (this._x1 = +u) + "," + (this._y1 = +_);
327
+ },
328
+ arcTo: function(t, n, s, a, u) {
329
+ t = +t, n = +n, s = +s, a = +a, u = +u;
330
+ var _ = this._x1, g = this._y1, p = s - t, i = a - n, o = _ - t, c = g - n, m = o * o + c * c;
331
+ if (u < 0)
332
+ throw new Error("negative radius: " + u);
333
+ if (this._x1 === null)
334
+ this._ += "M" + (this._x1 = t) + "," + (this._y1 = n);
335
+ else if (m > D)
336
+ if (!(Math.abs(c * p - i * o) > D) || !u)
337
+ this._ += "L" + (this._x1 = t) + "," + (this._y1 = n);
338
+ else {
339
+ 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), P = N / A, z = N / L;
340
+ Math.abs(P - 1) > D && (this._ += "L" + (t + P * o) + "," + (n + P * c)), this._ += "A" + u + "," + u + ",0,0," + +(c * b > o * y) + "," + (this._x1 = t + z * p) + "," + (this._y1 = n + z * i);
341
+ }
342
+ },
343
+ arc: function(t, n, s, a, u, _) {
344
+ t = +t, n = +n, s = +s, _ = !!_;
345
+ var g = s * Math.cos(a), p = s * Math.sin(a), i = t + g, o = n + p, c = 1 ^ _, m = _ ? a - u : u - a;
346
+ if (s < 0)
347
+ throw new Error("negative radius: " + s);
348
+ 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 > jt ? 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))));
349
+ },
350
+ rect: function(t, n, s, a) {
351
+ this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n) + "h" + +s + "v" + +a + "h" + -s + "Z";
352
+ },
353
+ toString: function() {
354
+ return this._;
355
+ }
356
+ };
357
+ function ht(t) {
358
+ return function() {
359
+ return t;
360
+ };
361
+ }
362
+ function Dt(t) {
363
+ return t[0];
364
+ }
365
+ function Bt(t) {
366
+ return t[1];
367
+ }
368
+ var Ut = Array.prototype.slice;
369
+ function Vt(t) {
370
+ return t.source;
371
+ }
372
+ function Rt(t) {
373
+ return t.target;
374
+ }
375
+ function Wt(t) {
376
+ var n = Vt, s = Rt, a = Dt, u = Bt, _ = null;
377
+ function g() {
378
+ var p, i = Ut.call(arguments), o = n.apply(this, i), c = s.apply(this, i);
379
+ 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)
380
+ return _ = null, p + "" || null;
381
+ }
382
+ return g.source = function(p) {
383
+ return arguments.length ? (n = p, g) : n;
384
+ }, g.target = function(p) {
385
+ return arguments.length ? (s = p, g) : s;
386
+ }, g.x = function(p) {
387
+ return arguments.length ? (a = typeof p == "function" ? p : ht(+p), g) : a;
388
+ }, g.y = function(p) {
389
+ return arguments.length ? (u = typeof p == "function" ? p : ht(+p), g) : u;
390
+ }, g.context = function(p) {
391
+ return arguments.length ? (_ = p ?? null, g) : _;
392
+ }, g;
393
+ }
394
+ function Ft(t, n, s, a, u) {
395
+ t.moveTo(n, s), t.bezierCurveTo(n = (n + a) / 2, s, n, u, a, u);
396
+ }
397
+ function Yt() {
398
+ return Wt(Ft);
399
+ }
400
+ function Gt(t) {
401
+ return [t.source.x1, t.y0];
402
+ }
403
+ function Xt(t) {
404
+ return [t.target.x0, t.y1];
405
+ }
406
+ function Ht() {
407
+ return Yt().source(Gt).target(Xt);
408
+ }
409
+ var it = function() {
410
+ var t = function(p, i, o, c) {
411
+ for (o = o || {}, c = p.length; c--; o[p[c]] = i)
412
+ ;
413
+ return o;
414
+ }, n = [1, 9], s = [1, 10], a = [1, 5, 10, 12], u = {
415
+ trace: function() {
416
+ },
417
+ yy: {},
418
+ 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 },
419
+ 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" },
420
+ productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]],
421
+ performAction: function(i, o, c, m, b, y, x) {
422
+ var E = y.length - 1;
423
+ switch (b) {
424
+ case 7:
425
+ const L = m.findOrCreateNode(y[E - 4].trim().replaceAll('""', '"')), A = m.findOrCreateNode(y[E - 2].trim().replaceAll('""', '"')), N = parseFloat(y[E].trim());
426
+ m.addLink(L, A, N);
427
+ break;
428
+ case 8:
429
+ case 9:
430
+ case 11:
431
+ this.$ = y[E];
432
+ break;
433
+ case 10:
434
+ this.$ = y[E - 1];
435
+ break;
436
+ }
437
+ },
438
+ 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])],
439
+ defaultActions: { 11: [2, 1], 12: [2, 5] },
440
+ parseError: function(i, o) {
441
+ if (o.recoverable)
442
+ this.trace(i);
443
+ else {
444
+ var c = new Error(i);
445
+ throw c.hash = o, c;
446
+ }
447
+ },
448
+ parse: function(i) {
449
+ var o = this, c = [0], m = [], b = [null], y = [], x = this.table, E = "", L = 0, A = 0, N = 2, P = 1, z = y.slice.call(arguments, 1), S = Object.create(this.lexer), M = { yy: {} };
450
+ for (var O in this.yy)
451
+ Object.prototype.hasOwnProperty.call(this.yy, O) && (M.yy[O] = this.yy[O]);
452
+ S.setInput(i, M.yy), M.yy.lexer = S, M.yy.parser = this, typeof S.yylloc > "u" && (S.yylloc = {});
453
+ var C = S.yylloc;
454
+ y.push(C);
455
+ var I = S.options && S.options.ranges;
456
+ typeof M.yy.parseError == "function" ? this.parseError = M.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
457
+ function d() {
458
+ var v;
459
+ return v = m.pop() || S.lex() || P, typeof v != "number" && (v instanceof Array && (m = v, v = m.pop()), v = o.symbols_[v] || v), v;
460
+ }
461
+ for (var w, $, T, U, e = {}, f, l, h, r; ; ) {
462
+ 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]) {
463
+ var k = "";
464
+ r = [];
465
+ for (f in x[$])
466
+ this.terminals_[f] && f > N && r.push("'" + this.terminals_[f] + "'");
467
+ S.showPosition ? k = "Parse error on line " + (L + 1) + `:
468
+ ` + S.showPosition() + `
469
+ Expecting ` + r.join(", ") + ", got '" + (this.terminals_[w] || w) + "'" : k = "Parse error on line " + (L + 1) + ": Unexpected " + (w == P ? "end of input" : "'" + (this.terminals_[w] || w) + "'"), this.parseError(k, {
470
+ text: S.match,
471
+ token: this.terminals_[w] || w,
472
+ line: S.yylineno,
473
+ loc: C,
474
+ expected: r
475
+ });
476
+ }
477
+ if (T[0] instanceof Array && T.length > 1)
478
+ throw new Error("Parse Error: multiple actions possible at state: " + $ + ", token: " + w);
479
+ switch (T[0]) {
480
+ case 1:
481
+ 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, C = S.yylloc;
482
+ break;
483
+ case 2:
484
+ if (l = this.productions_[T[1]][1], e.$ = b[b.length - l], e._$ = {
485
+ first_line: y[y.length - (l || 1)].first_line,
486
+ last_line: y[y.length - 1].last_line,
487
+ first_column: y[y.length - (l || 1)].first_column,
488
+ last_column: y[y.length - 1].last_column
489
+ }, I && (e._$.range = [
490
+ y[y.length - (l || 1)].range[0],
491
+ y[y.length - 1].range[1]
492
+ ]), U = this.performAction.apply(e, [
493
+ E,
494
+ A,
495
+ L,
496
+ M.yy,
497
+ T[1],
498
+ b,
499
+ y
500
+ ].concat(z)), typeof U < "u")
501
+ return U;
502
+ 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);
503
+ break;
504
+ case 3:
505
+ return !0;
506
+ }
507
+ }
508
+ return !0;
509
+ }
510
+ }, _ = function() {
511
+ var p = {
512
+ EOF: 1,
513
+ parseError: function(o, c) {
514
+ if (this.yy.parser)
515
+ this.yy.parser.parseError(o, c);
516
+ else
517
+ throw new Error(o);
518
+ },
519
+ // resets the lexer, sets new input
520
+ setInput: function(i, o) {
521
+ 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 = {
522
+ first_line: 1,
523
+ first_column: 0,
524
+ last_line: 1,
525
+ last_column: 0
526
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
527
+ },
528
+ // consumes and returns one char from the input
529
+ input: function() {
530
+ var i = this._input[0];
531
+ this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i;
532
+ var o = i.match(/(?:\r\n?|\n).*/g);
533
+ 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;
534
+ },
535
+ // unshifts one char (or a string) into the input
536
+ unput: function(i) {
537
+ var o = i.length, c = i.split(/(?:\r\n?|\n)/g);
538
+ this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - o), this.offset -= o;
539
+ var m = this.match.split(/(?:\r\n?|\n)/g);
540
+ 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);
541
+ var b = this.yylloc.range;
542
+ return this.yylloc = {
543
+ first_line: this.yylloc.first_line,
544
+ last_line: this.yylineno + 1,
545
+ first_column: this.yylloc.first_column,
546
+ 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
547
+ }, this.options.ranges && (this.yylloc.range = [b[0], b[0] + this.yyleng - o]), this.yyleng = this.yytext.length, this;
548
+ },
549
+ // When called from action, caches matched text and appends it on next action
550
+ more: function() {
551
+ return this._more = !0, this;
552
+ },
553
+ // 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.
554
+ reject: function() {
555
+ if (this.options.backtrack_lexer)
556
+ this._backtrack = !0;
557
+ else
558
+ 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).
559
+ ` + this.showPosition(), {
560
+ text: "",
561
+ token: null,
562
+ line: this.yylineno
563
+ });
564
+ return this;
565
+ },
566
+ // retain first n characters of the match
567
+ less: function(i) {
568
+ this.unput(this.match.slice(i));
569
+ },
570
+ // displays already matched input, i.e. for error messages
571
+ pastInput: function() {
572
+ var i = this.matched.substr(0, this.matched.length - this.match.length);
573
+ return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
574
+ },
575
+ // displays upcoming input, i.e. for error messages
576
+ upcomingInput: function() {
577
+ var i = this.match;
578
+ return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
579
+ },
580
+ // displays the character position where the lexing error occurred, i.e. for error messages
581
+ showPosition: function() {
582
+ var i = this.pastInput(), o = new Array(i.length + 1).join("-");
583
+ return i + this.upcomingInput() + `
584
+ ` + o + "^";
585
+ },
586
+ // test the lexed token: return FALSE when not a match, otherwise return token
587
+ test_match: function(i, o) {
588
+ var c, m, b;
589
+ if (this.options.backtrack_lexer && (b = {
590
+ yylineno: this.yylineno,
591
+ yylloc: {
592
+ first_line: this.yylloc.first_line,
593
+ last_line: this.last_line,
594
+ first_column: this.yylloc.first_column,
595
+ last_column: this.yylloc.last_column
596
+ },
597
+ yytext: this.yytext,
598
+ match: this.match,
599
+ matches: this.matches,
600
+ matched: this.matched,
601
+ yyleng: this.yyleng,
602
+ offset: this.offset,
603
+ _more: this._more,
604
+ _input: this._input,
605
+ yy: this.yy,
606
+ conditionStack: this.conditionStack.slice(0),
607
+ done: this.done
608
+ }, 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 = {
609
+ first_line: this.yylloc.last_line,
610
+ last_line: this.yylineno + 1,
611
+ first_column: this.yylloc.last_column,
612
+ last_column: m ? m[m.length - 1].length - m[m.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
613
+ }, 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)
614
+ return c;
615
+ if (this._backtrack) {
616
+ for (var y in b)
617
+ this[y] = b[y];
618
+ return !1;
619
+ }
620
+ return !1;
621
+ },
622
+ // return next match in input
623
+ next: function() {
624
+ if (this.done)
625
+ return this.EOF;
626
+ this._input || (this.done = !0);
627
+ var i, o, c, m;
628
+ this._more || (this.yytext = "", this.match = "");
629
+ for (var b = this._currentRules(), y = 0; y < b.length; y++)
630
+ if (c = this._input.match(this.rules[b[y]]), c && (!o || c[0].length > o[0].length)) {
631
+ if (o = c, m = y, this.options.backtrack_lexer) {
632
+ if (i = this.test_match(c, b[y]), i !== !1)
633
+ return i;
634
+ if (this._backtrack) {
635
+ o = !1;
636
+ continue;
637
+ } else
638
+ return !1;
639
+ } else if (!this.options.flex)
640
+ break;
641
+ }
642
+ 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.
643
+ ` + this.showPosition(), {
644
+ text: "",
645
+ token: null,
646
+ line: this.yylineno
647
+ });
648
+ },
649
+ // return next match that has a token
650
+ lex: function() {
651
+ var o = this.next();
652
+ return o || this.lex();
653
+ },
654
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
655
+ begin: function(o) {
656
+ this.conditionStack.push(o);
657
+ },
658
+ // pop the previously active lexer condition state off the condition stack
659
+ popState: function() {
660
+ var o = this.conditionStack.length - 1;
661
+ return o > 0 ? this.conditionStack.pop() : this.conditionStack[0];
662
+ },
663
+ // produce the lexer rule set which is active for the currently active lexer condition state
664
+ _currentRules: function() {
665
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
666
+ },
667
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
668
+ topState: function(o) {
669
+ return o = this.conditionStack.length - 1 - Math.abs(o || 0), o >= 0 ? this.conditionStack[o] : "INITIAL";
670
+ },
671
+ // alias for begin(condition)
672
+ pushState: function(o) {
673
+ this.begin(o);
674
+ },
675
+ // return the number of states currently on the stack
676
+ stateStackSize: function() {
677
+ return this.conditionStack.length;
678
+ },
679
+ options: { "case-insensitive": !0 },
680
+ performAction: function(o, c, m, b) {
681
+ switch (m) {
682
+ case 0:
683
+ return this.pushState("csv"), 4;
684
+ case 1:
685
+ return 10;
686
+ case 2:
687
+ return 5;
688
+ case 3:
689
+ return 12;
690
+ case 4:
691
+ return this.pushState("escaped_text"), 18;
692
+ case 5:
693
+ return 20;
694
+ case 6:
695
+ return this.popState("escaped_text"), 18;
696
+ case 7:
697
+ return 19;
698
+ }
699
+ },
700
+ 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],
701
+ 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 } }
702
+ };
703
+ return p;
704
+ }();
705
+ u.lexer = _;
706
+ function g() {
707
+ this.yy = {};
708
+ }
709
+ return g.prototype = u, u.Parser = g, new g();
710
+ }();
711
+ it.parser = it;
712
+ const H = it;
713
+ let q = [], Q = [], B = {};
714
+ const qt = () => {
715
+ q = [], Q = [], B = {}, wt();
716
+ };
717
+ class Qt {
718
+ constructor(n, s, a = 0) {
719
+ this.source = n, this.target = s, this.value = a;
720
+ }
721
+ }
722
+ const Kt = (t, n, s) => {
723
+ q.push(new Qt(t, n, s));
724
+ };
725
+ class Zt {
726
+ constructor(n) {
727
+ this.ID = n;
728
+ }
729
+ }
730
+ const Jt = (t) => (t = St.sanitizeText(t, rt()), B[t] || (B[t] = new Zt(t), Q.push(B[t])), B[t]), te = () => Q, ee = () => q, ne = () => ({
731
+ nodes: Q.map((t) => ({ id: t.ID })),
732
+ links: q.map((t) => ({
733
+ source: t.source.ID,
734
+ target: t.target.ID,
735
+ value: t.value
736
+ }))
737
+ }), ie = {
738
+ nodesMap: B,
739
+ getConfig: () => rt().sankey,
740
+ getNodes: te,
741
+ getLinks: ee,
742
+ getGraph: ne,
743
+ addLink: Kt,
744
+ findOrCreateNode: Jt,
745
+ getAccTitle: mt,
746
+ setAccTitle: kt,
747
+ getAccDescription: _t,
748
+ setAccDescription: xt,
749
+ getDiagramTitle: vt,
750
+ setDiagramTitle: bt,
751
+ clear: qt
752
+ }, pt = class st {
753
+ static next(n) {
754
+ return new st(n + ++st.count);
755
+ }
756
+ constructor(n) {
757
+ this.id = n, this.href = `#${n}`;
758
+ }
759
+ toString() {
760
+ return "url(" + this.href + ")";
761
+ }
762
+ };
763
+ pt.count = 0;
764
+ let ft = pt;
765
+ const se = {
766
+ left: Nt,
767
+ right: Pt,
768
+ center: Ct,
769
+ justify: dt
770
+ }, re = function(t, n, s, a) {
771
+ const { securityLevel: u, sankey: _ } = rt(), g = Lt.sankey;
772
+ let p;
773
+ u === "sandbox" && (p = Y("#i" + n));
774
+ 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], P = 10;
775
+ zt().nodeId((d) => d.id).nodeWidth(P).nodePadding(10 + (L ? 15 : 0)).nodeAlign(N).extent([
776
+ [0, 0],
777
+ [c, m]
778
+ ])(A);
779
+ const S = At(Tt);
780
+ 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) {
781
+ return "translate(" + d.x0 + "," + d.y0 + ")";
782
+ }).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));
783
+ const M = ({ id: d, value: w }) => L ? `${d}
784
+ ${x}${Math.round(w * 100) / 100}${E}` : d;
785
+ 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);
786
+ 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"), C = (_ == null ? void 0 : _.linkColor) || "gradient";
787
+ if (C === "gradient") {
788
+ 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);
789
+ 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));
790
+ }
791
+ let I;
792
+ switch (C) {
793
+ case "gradient":
794
+ I = (d) => d.uid;
795
+ break;
796
+ case "source":
797
+ I = (d) => S(d.source.id);
798
+ break;
799
+ case "target":
800
+ I = (d) => S(d.target.id);
801
+ break;
802
+ default:
803
+ I = C;
804
+ }
805
+ O.append("path").attr("d", Ht()).attr("stroke", I).attr("stroke-width", (d) => Math.max(1, d.width)), Et(void 0, o, 0, b);
806
+ }, oe = {
807
+ draw: re
808
+ }, le = (t) => t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, `
809
+ `).trim(), ae = H.parse.bind(H);
810
+ H.parse = (t) => ae(le(t));
811
+ const de = {
812
+ parser: H,
813
+ db: ie,
814
+ renderer: oe
815
+ };
816
+ export {
817
+ de as diagram
818
+ };