@sourcegraph/amp 0.0.1749585689-g82b91d → 0.0.1749600114-g5c00b8

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 (61) hide show
  1. package/dist/amp.js +3 -3
  2. package/dist/architectureDiagram-RWNHDUBN-1v8WgxdD.js +4635 -0
  3. package/dist/blockDiagram-XZSR5OGQ-XFBYN-jB.js +2243 -0
  4. package/dist/c4Diagram-6R2MQUNL-B0L0pltn.js +1587 -0
  5. package/dist/chunk-COUQ6RZ3-qd4eG6tc.js +17852 -0
  6. package/dist/chunk-CRQPXCKQ-yjI467Bq.js +65 -0
  7. package/dist/chunk-EFPBJHX4-DdHmqd0M.js +1378 -0
  8. package/dist/chunk-EOAU2GW5-CpRNAcjo.js +253 -0
  9. package/dist/chunk-IHYUGLNO-DJcRQIf7.js +1365 -0
  10. package/dist/chunk-K2ZEYYM2-CbqHhUqy.js +9 -0
  11. package/dist/chunk-Q7VUVKE6-gBSSbdjU.js +24 -0
  12. package/dist/chunk-T2M37SMK-Br8mK30k.js +1411 -0
  13. package/dist/chunk-TGZYFRKZ-BYBLXoJz.js +1331 -0
  14. package/dist/chunk-YJGJQOYZ-BGiSkWF0.js +19 -0
  15. package/dist/classDiagram-LB37KKQG-DhFsEyDS.js +17 -0
  16. package/dist/classDiagram-v2-KFQJBC22-DhFsEyDS.js +17 -0
  17. package/dist/{client-C1WG2nEf.js → client-D-YAg8x6.js} +6 -6
  18. package/dist/{console-DK0gDzNQ.js → console-CoE5Qzyz.js} +41106 -22971
  19. package/dist/create_file.node-Co0Uh1F3.js +21 -0
  20. package/dist/dagre-CMTPJJKG-UDPzd9Iy.js +446 -0
  21. package/dist/diagram-BIPOGRU5-B7TV59-n.js +128 -0
  22. package/dist/diagram-YF4VECWA-LsAZsciQ.js +219 -0
  23. package/dist/{edit_file.node-BH524GkF.js → edit_file.node-CmTZeBc2.js} +11 -11
  24. package/dist/erDiagram-AK44R45H-BWpeEu7D.js +843 -0
  25. package/dist/{executable-5cBRGrsC.js → executable-BE7tfoX5.js} +1 -1
  26. package/dist/{files-CybxYgbE.js → files-DqpRf5q4.js} +10 -10
  27. package/dist/flowDiagram-XARHJDSH-DzpV02UB.js +1618 -0
  28. package/dist/ganttDiagram-H5QQZTZ5-C0BhJTzn.js +1605 -0
  29. package/dist/gitGraphDiagram-XHLTLO3W-0EiOmv44.js +701 -0
  30. package/dist/{glob.node-C6HbLuPt.js → glob.node-DNei8bFS.js} +11 -11
  31. package/dist/{index-C2wo7rRZ.js → index-BcjxaWOc.js} +31 -31
  32. package/dist/infoDiagram-TP2HPDHO-CQX5a0Fc.js +24 -0
  33. package/dist/journeyDiagram-VHRN44N3-C82dEe4G.js +809 -0
  34. package/dist/kanban-definition-K5J3OUUV-xilJcrom.js +718 -0
  35. package/dist/katex-5N2NCDMP-CAsrnb6_.js +11703 -0
  36. package/dist/{list_directory.node-ZQscizpi.js → list_directory.node-CMiNNbXP.js} +1 -1
  37. package/dist/{load-profile-BbmyxO_7.js → load-profile-Cg8XaTx6.js} +1 -1
  38. package/dist/{main-CiUaVPC2.js → main-Dy2VZM_S.js} +15 -15
  39. package/dist/mindmap-definition-TI5ONXTW-BNaRba4R.js +3221 -0
  40. package/dist/{node-DvmQAW7h.js → node-BtG1o_DD.js} +2 -2
  41. package/dist/{node-VrazB_nQ.js → node-BulbxvrV.js} +58 -58
  42. package/dist/{node-Cpbjmhrj.js → node-Cp3D7_hw.js} +71 -71
  43. package/dist/{node-GgocwWwI.js → node-CtoBdTQT.js} +3 -3
  44. package/dist/{node-CiFAW-F3.js → node-Ctw1i0nl.js} +12 -12
  45. package/dist/{node-CgVq0JJ9.js → node-D1zxOCuN.js} +1 -1
  46. package/dist/pieDiagram-FPR3CNQC-_30_tQz0.js +120 -0
  47. package/dist/quadrantDiagram-RLP5YTJ2-CTD43GTk.js +1028 -0
  48. package/dist/radar-MK3ICKWK-55CS4JTO-afihMdR4.js +14398 -0
  49. package/dist/{read_file.node-CIdAFiJ6.js → read_file.node-QZ0VCmB2.js} +1 -1
  50. package/dist/requirementDiagram-P5NVWGNK-Sd2_6g8e.js +853 -0
  51. package/dist/sankeyDiagram-C6NZRJHT-D1EcCYaw.js +864 -0
  52. package/dist/sequenceDiagram-6SLVIXKN-CghQTpGf.js +2283 -0
  53. package/dist/stateDiagram-WI5ZVJ5I-Bv21MlSK.js +272 -0
  54. package/dist/stateDiagram-v2-KVDSFUFK-BgP0D8xL.js +17 -0
  55. package/dist/{stdio-D9HyubOc.js → stdio-CCCGI3C7.js} +8 -8
  56. package/dist/storybook.js +7 -7
  57. package/dist/timeline-definition-65575674-BUqRZdJ-.js +800 -0
  58. package/dist/{undo_edit.node-VYuTxRwd.js → undo_edit.node-BkletvTZ.js} +5 -5
  59. package/dist/xychartDiagram-674MFTBU-DjBabATx.js +1291 -0
  60. package/package.json +1 -1
  61. package/dist/create_file.node-DtVTaHj5.js +0 -21
@@ -0,0 +1,864 @@
1
+ #!/usr/bin/env node
2
+ import { _ as e, T as Ot, U as Bt, u as Dt, v as jt, x as $t, w as Rt, y as ft, $ as Vt, z as Y, az as Ft, bv as Ut, Z as Wt, L as Ht, bE as Gt } from "./console-CoE5Qzyz.js";
3
+ var nt = function() {
4
+ var t = /* @__PURE__ */ e(function(k, s, a, l) {
5
+ for (a = a || {}, l = k.length; l--; a[k[l]] = s) ;
6
+ return a;
7
+ }, "o"), i = [1, 9], r = [1, 10], u = [1, 5, 10, 12], f = {
8
+ trace: /* @__PURE__ */ e(function() {
9
+ }, "trace"),
10
+ yy: {},
11
+ 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 },
12
+ 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" },
13
+ productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]],
14
+ performAction: /* @__PURE__ */ e(function(s, a, l, _, v, d, x) {
15
+ var M = d.length - 1;
16
+ switch (v) {
17
+ case 7:
18
+ const A = _.findOrCreateNode(d[M - 4].trim().replaceAll('""', '"')), N = _.findOrCreateNode(d[M - 2].trim().replaceAll('""', '"')), I = parseFloat(d[M].trim());
19
+ _.addLink(A, N, I);
20
+ break;
21
+ case 8:
22
+ case 9:
23
+ case 11:
24
+ this.$ = d[M];
25
+ break;
26
+ case 10:
27
+ this.$ = d[M - 1];
28
+ break;
29
+ }
30
+ }, "anonymous"),
31
+ table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, { 5: [1, 3] }, { 6: 4, 8: 5, 15: 6, 16: 7, 17: 8, 18: i, 20: r }, { 1: [2, 6], 7: 11, 10: [1, 12] }, t(r, [2, 4], { 9: 13, 5: [1, 14] }), { 12: [1, 15] }, t(u, [2, 8]), t(u, [2, 9]), { 19: [1, 16] }, t(u, [2, 11]), { 1: [2, 1] }, { 1: [2, 5] }, t(r, [2, 2]), { 6: 17, 8: 5, 15: 6, 16: 7, 17: 8, 18: i, 20: r }, { 15: 18, 16: 7, 17: 8, 18: i, 20: r }, { 18: [1, 19] }, t(r, [2, 3]), { 12: [1, 20] }, t(u, [2, 10]), { 15: 21, 16: 7, 17: 8, 18: i, 20: r }, t([1, 5, 10], [2, 7])],
32
+ defaultActions: { 11: [2, 1], 12: [2, 5] },
33
+ parseError: /* @__PURE__ */ e(function(s, a) {
34
+ if (a.recoverable)
35
+ this.trace(s);
36
+ else {
37
+ var l = new Error(s);
38
+ throw l.hash = a, l;
39
+ }
40
+ }, "parseError"),
41
+ parse: /* @__PURE__ */ e(function(s) {
42
+ var a = this, l = [0], _ = [], v = [null], d = [], x = this.table, M = "", A = 0, N = 0, I = 2, B = 1, $ = d.slice.call(arguments, 1), w = Object.create(this.lexer), P = { yy: {} };
43
+ for (var j in this.yy)
44
+ Object.prototype.hasOwnProperty.call(this.yy, j) && (P.yy[j] = this.yy[j]);
45
+ w.setInput(s, P.yy), P.yy.lexer = w, P.yy.parser = this, typeof w.yylloc > "u" && (w.yylloc = {});
46
+ var z = w.yylloc;
47
+ d.push(z);
48
+ var O = w.options && w.options.ranges;
49
+ typeof P.yy.parseError == "function" ? this.parseError = P.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
50
+ function g(L) {
51
+ l.length = l.length - 2 * L, v.length = v.length - L, d.length = d.length - L;
52
+ }
53
+ e(g, "popStack");
54
+ function T() {
55
+ var L;
56
+ return L = _.pop() || w.lex() || B, typeof L != "number" && (L instanceof Array && (_ = L, L = _.pop()), L = a.symbols_[L] || L), L;
57
+ }
58
+ e(T, "lex");
59
+ for (var E, D, C, n, y = {}, h, c, o, m; ; ) {
60
+ if (D = l[l.length - 1], this.defaultActions[D] ? C = this.defaultActions[D] : ((E === null || typeof E > "u") && (E = T()), C = x[D] && x[D][E]), typeof C > "u" || !C.length || !C[0]) {
61
+ var S = "";
62
+ m = [];
63
+ for (h in x[D])
64
+ this.terminals_[h] && h > I && m.push("'" + this.terminals_[h] + "'");
65
+ w.showPosition ? S = "Parse error on line " + (A + 1) + `:
66
+ ` + w.showPosition() + `
67
+ Expecting ` + m.join(", ") + ", got '" + (this.terminals_[E] || E) + "'" : S = "Parse error on line " + (A + 1) + ": Unexpected " + (E == B ? "end of input" : "'" + (this.terminals_[E] || E) + "'"), this.parseError(S, {
68
+ text: w.match,
69
+ token: this.terminals_[E] || E,
70
+ line: w.yylineno,
71
+ loc: z,
72
+ expected: m
73
+ });
74
+ }
75
+ if (C[0] instanceof Array && C.length > 1)
76
+ throw new Error("Parse Error: multiple actions possible at state: " + D + ", token: " + E);
77
+ switch (C[0]) {
78
+ case 1:
79
+ l.push(E), v.push(w.yytext), d.push(w.yylloc), l.push(C[1]), E = null, N = w.yyleng, M = w.yytext, A = w.yylineno, z = w.yylloc;
80
+ break;
81
+ case 2:
82
+ if (c = this.productions_[C[1]][1], y.$ = v[v.length - c], y._$ = {
83
+ first_line: d[d.length - (c || 1)].first_line,
84
+ last_line: d[d.length - 1].last_line,
85
+ first_column: d[d.length - (c || 1)].first_column,
86
+ last_column: d[d.length - 1].last_column
87
+ }, O && (y._$.range = [
88
+ d[d.length - (c || 1)].range[0],
89
+ d[d.length - 1].range[1]
90
+ ]), n = this.performAction.apply(y, [
91
+ M,
92
+ N,
93
+ A,
94
+ P.yy,
95
+ C[1],
96
+ v,
97
+ d
98
+ ].concat($)), typeof n < "u")
99
+ return n;
100
+ c && (l = l.slice(0, -1 * c * 2), v = v.slice(0, -1 * c), d = d.slice(0, -1 * c)), l.push(this.productions_[C[1]][0]), v.push(y.$), d.push(y._$), o = x[l[l.length - 2]][l[l.length - 1]], l.push(o);
101
+ break;
102
+ case 3:
103
+ return !0;
104
+ }
105
+ }
106
+ return !0;
107
+ }, "parse")
108
+ }, b = /* @__PURE__ */ function() {
109
+ var k = {
110
+ EOF: 1,
111
+ parseError: /* @__PURE__ */ e(function(a, l) {
112
+ if (this.yy.parser)
113
+ this.yy.parser.parseError(a, l);
114
+ else
115
+ throw new Error(a);
116
+ }, "parseError"),
117
+ // resets the lexer, sets new input
118
+ setInput: /* @__PURE__ */ e(function(s, a) {
119
+ return this.yy = a || this.yy || {}, this._input = s, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
120
+ first_line: 1,
121
+ first_column: 0,
122
+ last_line: 1,
123
+ last_column: 0
124
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
125
+ }, "setInput"),
126
+ // consumes and returns one char from the input
127
+ input: /* @__PURE__ */ e(function() {
128
+ var s = this._input[0];
129
+ this.yytext += s, this.yyleng++, this.offset++, this.match += s, this.matched += s;
130
+ var a = s.match(/(?:\r\n?|\n).*/g);
131
+ return a ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), s;
132
+ }, "input"),
133
+ // unshifts one char (or a string) into the input
134
+ unput: /* @__PURE__ */ e(function(s) {
135
+ var a = s.length, l = s.split(/(?:\r\n?|\n)/g);
136
+ this._input = s + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a;
137
+ var _ = this.match.split(/(?:\r\n?|\n)/g);
138
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), l.length - 1 && (this.yylineno -= l.length - 1);
139
+ var v = this.yylloc.range;
140
+ return this.yylloc = {
141
+ first_line: this.yylloc.first_line,
142
+ last_line: this.yylineno + 1,
143
+ first_column: this.yylloc.first_column,
144
+ last_column: l ? (l.length === _.length ? this.yylloc.first_column : 0) + _[_.length - l.length].length - l[0].length : this.yylloc.first_column - a
145
+ }, this.options.ranges && (this.yylloc.range = [v[0], v[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this;
146
+ }, "unput"),
147
+ // When called from action, caches matched text and appends it on next action
148
+ more: /* @__PURE__ */ e(function() {
149
+ return this._more = !0, this;
150
+ }, "more"),
151
+ // 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.
152
+ reject: /* @__PURE__ */ e(function() {
153
+ if (this.options.backtrack_lexer)
154
+ this._backtrack = !0;
155
+ else
156
+ 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).
157
+ ` + this.showPosition(), {
158
+ text: "",
159
+ token: null,
160
+ line: this.yylineno
161
+ });
162
+ return this;
163
+ }, "reject"),
164
+ // retain first n characters of the match
165
+ less: /* @__PURE__ */ e(function(s) {
166
+ this.unput(this.match.slice(s));
167
+ }, "less"),
168
+ // displays already matched input, i.e. for error messages
169
+ pastInput: /* @__PURE__ */ e(function() {
170
+ var s = this.matched.substr(0, this.matched.length - this.match.length);
171
+ return (s.length > 20 ? "..." : "") + s.substr(-20).replace(/\n/g, "");
172
+ }, "pastInput"),
173
+ // displays upcoming input, i.e. for error messages
174
+ upcomingInput: /* @__PURE__ */ e(function() {
175
+ var s = this.match;
176
+ return s.length < 20 && (s += this._input.substr(0, 20 - s.length)), (s.substr(0, 20) + (s.length > 20 ? "..." : "")).replace(/\n/g, "");
177
+ }, "upcomingInput"),
178
+ // displays the character position where the lexing error occurred, i.e. for error messages
179
+ showPosition: /* @__PURE__ */ e(function() {
180
+ var s = this.pastInput(), a = new Array(s.length + 1).join("-");
181
+ return s + this.upcomingInput() + `
182
+ ` + a + "^";
183
+ }, "showPosition"),
184
+ // test the lexed token: return FALSE when not a match, otherwise return token
185
+ test_match: /* @__PURE__ */ e(function(s, a) {
186
+ var l, _, v;
187
+ if (this.options.backtrack_lexer && (v = {
188
+ yylineno: this.yylineno,
189
+ yylloc: {
190
+ first_line: this.yylloc.first_line,
191
+ last_line: this.last_line,
192
+ first_column: this.yylloc.first_column,
193
+ last_column: this.yylloc.last_column
194
+ },
195
+ yytext: this.yytext,
196
+ match: this.match,
197
+ matches: this.matches,
198
+ matched: this.matched,
199
+ yyleng: this.yyleng,
200
+ offset: this.offset,
201
+ _more: this._more,
202
+ _input: this._input,
203
+ yy: this.yy,
204
+ conditionStack: this.conditionStack.slice(0),
205
+ done: this.done
206
+ }, this.options.ranges && (v.yylloc.range = this.yylloc.range.slice(0))), _ = s[0].match(/(?:\r\n?|\n).*/g), _ && (this.yylineno += _.length), this.yylloc = {
207
+ first_line: this.yylloc.last_line,
208
+ last_line: this.yylineno + 1,
209
+ first_column: this.yylloc.last_column,
210
+ last_column: _ ? _[_.length - 1].length - _[_.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + s[0].length
211
+ }, this.yytext += s[0], this.match += s[0], this.matches = s, 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(s[0].length), this.matched += s[0], l = this.performAction.call(this, this.yy, this, a, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), l)
212
+ return l;
213
+ if (this._backtrack) {
214
+ for (var d in v)
215
+ this[d] = v[d];
216
+ return !1;
217
+ }
218
+ return !1;
219
+ }, "test_match"),
220
+ // return next match in input
221
+ next: /* @__PURE__ */ e(function() {
222
+ if (this.done)
223
+ return this.EOF;
224
+ this._input || (this.done = !0);
225
+ var s, a, l, _;
226
+ this._more || (this.yytext = "", this.match = "");
227
+ for (var v = this._currentRules(), d = 0; d < v.length; d++)
228
+ if (l = this._input.match(this.rules[v[d]]), l && (!a || l[0].length > a[0].length)) {
229
+ if (a = l, _ = d, this.options.backtrack_lexer) {
230
+ if (s = this.test_match(l, v[d]), s !== !1)
231
+ return s;
232
+ if (this._backtrack) {
233
+ a = !1;
234
+ continue;
235
+ } else
236
+ return !1;
237
+ } else if (!this.options.flex)
238
+ break;
239
+ }
240
+ return a ? (s = this.test_match(a, v[_]), s !== !1 ? s : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
241
+ ` + this.showPosition(), {
242
+ text: "",
243
+ token: null,
244
+ line: this.yylineno
245
+ });
246
+ }, "next"),
247
+ // return next match that has a token
248
+ lex: /* @__PURE__ */ e(function() {
249
+ var a = this.next();
250
+ return a || this.lex();
251
+ }, "lex"),
252
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
253
+ begin: /* @__PURE__ */ e(function(a) {
254
+ this.conditionStack.push(a);
255
+ }, "begin"),
256
+ // pop the previously active lexer condition state off the condition stack
257
+ popState: /* @__PURE__ */ e(function() {
258
+ var a = this.conditionStack.length - 1;
259
+ return a > 0 ? this.conditionStack.pop() : this.conditionStack[0];
260
+ }, "popState"),
261
+ // produce the lexer rule set which is active for the currently active lexer condition state
262
+ _currentRules: /* @__PURE__ */ e(function() {
263
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
264
+ }, "_currentRules"),
265
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
266
+ topState: /* @__PURE__ */ e(function(a) {
267
+ return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL";
268
+ }, "topState"),
269
+ // alias for begin(condition)
270
+ pushState: /* @__PURE__ */ e(function(a) {
271
+ this.begin(a);
272
+ }, "pushState"),
273
+ // return the number of states currently on the stack
274
+ stateStackSize: /* @__PURE__ */ e(function() {
275
+ return this.conditionStack.length;
276
+ }, "stateStackSize"),
277
+ options: { "case-insensitive": !0 },
278
+ performAction: /* @__PURE__ */ e(function(a, l, _, v) {
279
+ switch (_) {
280
+ case 0:
281
+ return this.pushState("csv"), 4;
282
+ case 1:
283
+ return 10;
284
+ case 2:
285
+ return 5;
286
+ case 3:
287
+ return 12;
288
+ case 4:
289
+ return this.pushState("escaped_text"), 18;
290
+ case 5:
291
+ return 20;
292
+ case 6:
293
+ return this.popState("escaped_text"), 18;
294
+ case 7:
295
+ return 19;
296
+ }
297
+ }, "anonymous"),
298
+ 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],
299
+ 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 } }
300
+ };
301
+ return k;
302
+ }();
303
+ f.lexer = b;
304
+ function p() {
305
+ this.yy = {};
306
+ }
307
+ return e(p, "Parser"), p.prototype = f, f.Parser = p, new p();
308
+ }();
309
+ nt.parser = nt;
310
+ var Q = nt, J = [], tt = [], Z = /* @__PURE__ */ new Map(), Yt = /* @__PURE__ */ e(() => {
311
+ J = [], tt = [], Z = /* @__PURE__ */ new Map(), Wt();
312
+ }, "clear"), qt = class {
313
+ constructor(t, i, r = 0) {
314
+ this.source = t, this.target = i, this.value = r;
315
+ }
316
+ static {
317
+ e(this, "SankeyLink");
318
+ }
319
+ }, Xt = /* @__PURE__ */ e((t, i, r) => {
320
+ J.push(new qt(t, i, r));
321
+ }, "addLink"), Qt = class {
322
+ constructor(t) {
323
+ this.ID = t;
324
+ }
325
+ static {
326
+ e(this, "SankeyNode");
327
+ }
328
+ }, Zt = /* @__PURE__ */ e((t) => {
329
+ t = Ht.sanitizeText(t, ft());
330
+ let i = Z.get(t);
331
+ return i === void 0 && (i = new Qt(t), Z.set(t, i), tt.push(i)), i;
332
+ }, "findOrCreateNode"), Kt = /* @__PURE__ */ e(() => tt, "getNodes"), Jt = /* @__PURE__ */ e(() => J, "getLinks"), te = /* @__PURE__ */ e(() => ({
333
+ nodes: tt.map((t) => ({ id: t.ID })),
334
+ links: J.map((t) => ({
335
+ source: t.source.ID,
336
+ target: t.target.ID,
337
+ value: t.value
338
+ }))
339
+ }), "getGraph"), ee = {
340
+ nodesMap: Z,
341
+ getConfig: /* @__PURE__ */ e(() => ft().sankey, "getConfig"),
342
+ getNodes: Kt,
343
+ getLinks: Jt,
344
+ getGraph: te,
345
+ addLink: Xt,
346
+ findOrCreateNode: Zt,
347
+ getAccTitle: Rt,
348
+ setAccTitle: $t,
349
+ getAccDescription: jt,
350
+ setAccDescription: Dt,
351
+ getDiagramTitle: Bt,
352
+ setDiagramTitle: Ot,
353
+ clear: Yt
354
+ };
355
+ function it(t, i) {
356
+ let r;
357
+ if (i === void 0)
358
+ for (const u of t)
359
+ u != null && (r < u || r === void 0 && u >= u) && (r = u);
360
+ else {
361
+ let u = -1;
362
+ for (let f of t)
363
+ (f = i(f, ++u, t)) != null && (r < f || r === void 0 && f >= f) && (r = f);
364
+ }
365
+ return r;
366
+ }
367
+ e(it, "max");
368
+ function yt(t, i) {
369
+ let r;
370
+ if (i === void 0)
371
+ for (const u of t)
372
+ u != null && (r > u || r === void 0 && u >= u) && (r = u);
373
+ else {
374
+ let u = -1;
375
+ for (let f of t)
376
+ (f = i(f, ++u, t)) != null && (r > f || r === void 0 && f >= f) && (r = f);
377
+ }
378
+ return r;
379
+ }
380
+ e(yt, "min");
381
+ function q(t, i) {
382
+ let r = 0;
383
+ if (i === void 0)
384
+ for (let u of t)
385
+ (u = +u) && (r += u);
386
+ else {
387
+ let u = -1;
388
+ for (let f of t)
389
+ (f = +i(f, ++u, t)) && (r += f);
390
+ }
391
+ return r;
392
+ }
393
+ e(q, "sum");
394
+ function mt(t) {
395
+ return t.target.depth;
396
+ }
397
+ e(mt, "targetDepth");
398
+ function kt(t) {
399
+ return t.depth;
400
+ }
401
+ e(kt, "left");
402
+ function _t(t, i) {
403
+ return i - 1 - t.height;
404
+ }
405
+ e(_t, "right");
406
+ function dt(t, i) {
407
+ return t.sourceLinks.length ? t.depth : i - 1;
408
+ }
409
+ e(dt, "justify");
410
+ function xt(t) {
411
+ return t.targetLinks.length ? t.depth : t.sourceLinks.length ? yt(t.sourceLinks, mt) - 1 : 0;
412
+ }
413
+ e(xt, "center");
414
+ function H(t) {
415
+ return function() {
416
+ return t;
417
+ };
418
+ }
419
+ e(H, "constant");
420
+ function st(t, i) {
421
+ return G(t.source, i.source) || t.index - i.index;
422
+ }
423
+ e(st, "ascendingSourceBreadth");
424
+ function rt(t, i) {
425
+ return G(t.target, i.target) || t.index - i.index;
426
+ }
427
+ e(rt, "ascendingTargetBreadth");
428
+ function G(t, i) {
429
+ return t.y0 - i.y0;
430
+ }
431
+ e(G, "ascendingBreadth");
432
+ function X(t) {
433
+ return t.value;
434
+ }
435
+ e(X, "value");
436
+ function vt(t) {
437
+ return t.index;
438
+ }
439
+ e(vt, "defaultId");
440
+ function bt(t) {
441
+ return t.nodes;
442
+ }
443
+ e(bt, "defaultNodes");
444
+ function St(t) {
445
+ return t.links;
446
+ }
447
+ e(St, "defaultLinks");
448
+ function ot(t, i) {
449
+ const r = t.get(i);
450
+ if (!r) throw new Error("missing: " + i);
451
+ return r;
452
+ }
453
+ e(ot, "find");
454
+ function at({ nodes: t }) {
455
+ for (const i of t) {
456
+ let r = i.y0, u = r;
457
+ for (const f of i.sourceLinks)
458
+ f.y0 = r + f.width / 2, r += f.width;
459
+ for (const f of i.targetLinks)
460
+ f.y1 = u + f.width / 2, u += f.width;
461
+ }
462
+ }
463
+ e(at, "computeLinkBreadths");
464
+ function wt() {
465
+ let t = 0, i = 0, r = 1, u = 1, f = 24, b = 8, p, k = vt, s = dt, a, l, _ = bt, v = St, d = 6;
466
+ function x() {
467
+ const n = { nodes: _.apply(null, arguments), links: v.apply(null, arguments) };
468
+ return M(n), A(n), N(n), I(n), w(n), at(n), n;
469
+ }
470
+ e(x, "sankey"), x.update = function(n) {
471
+ return at(n), n;
472
+ }, x.nodeId = function(n) {
473
+ return arguments.length ? (k = typeof n == "function" ? n : H(n), x) : k;
474
+ }, x.nodeAlign = function(n) {
475
+ return arguments.length ? (s = typeof n == "function" ? n : H(n), x) : s;
476
+ }, x.nodeSort = function(n) {
477
+ return arguments.length ? (a = n, x) : a;
478
+ }, x.nodeWidth = function(n) {
479
+ return arguments.length ? (f = +n, x) : f;
480
+ }, x.nodePadding = function(n) {
481
+ return arguments.length ? (b = p = +n, x) : b;
482
+ }, x.nodes = function(n) {
483
+ return arguments.length ? (_ = typeof n == "function" ? n : H(n), x) : _;
484
+ }, x.links = function(n) {
485
+ return arguments.length ? (v = typeof n == "function" ? n : H(n), x) : v;
486
+ }, x.linkSort = function(n) {
487
+ return arguments.length ? (l = n, x) : l;
488
+ }, x.size = function(n) {
489
+ return arguments.length ? (t = i = 0, r = +n[0], u = +n[1], x) : [r - t, u - i];
490
+ }, x.extent = function(n) {
491
+ return arguments.length ? (t = +n[0][0], r = +n[1][0], i = +n[0][1], u = +n[1][1], x) : [[t, i], [r, u]];
492
+ }, x.iterations = function(n) {
493
+ return arguments.length ? (d = +n, x) : d;
494
+ };
495
+ function M({ nodes: n, links: y }) {
496
+ for (const [c, o] of n.entries())
497
+ o.index = c, o.sourceLinks = [], o.targetLinks = [];
498
+ const h = new Map(n.map((c, o) => [k(c, o, n), c]));
499
+ for (const [c, o] of y.entries()) {
500
+ o.index = c;
501
+ let { source: m, target: S } = o;
502
+ typeof m != "object" && (m = o.source = ot(h, m)), typeof S != "object" && (S = o.target = ot(h, S)), m.sourceLinks.push(o), S.targetLinks.push(o);
503
+ }
504
+ if (l != null)
505
+ for (const { sourceLinks: c, targetLinks: o } of n)
506
+ c.sort(l), o.sort(l);
507
+ }
508
+ e(M, "computeNodeLinks");
509
+ function A({ nodes: n }) {
510
+ for (const y of n)
511
+ y.value = y.fixedValue === void 0 ? Math.max(q(y.sourceLinks, X), q(y.targetLinks, X)) : y.fixedValue;
512
+ }
513
+ e(A, "computeNodeValues");
514
+ function N({ nodes: n }) {
515
+ const y = n.length;
516
+ let h = new Set(n), c = /* @__PURE__ */ new Set(), o = 0;
517
+ for (; h.size; ) {
518
+ for (const m of h) {
519
+ m.depth = o;
520
+ for (const { target: S } of m.sourceLinks)
521
+ c.add(S);
522
+ }
523
+ if (++o > y) throw new Error("circular link");
524
+ h = c, c = /* @__PURE__ */ new Set();
525
+ }
526
+ }
527
+ e(N, "computeNodeDepths");
528
+ function I({ nodes: n }) {
529
+ const y = n.length;
530
+ let h = new Set(n), c = /* @__PURE__ */ new Set(), o = 0;
531
+ for (; h.size; ) {
532
+ for (const m of h) {
533
+ m.height = o;
534
+ for (const { source: S } of m.targetLinks)
535
+ c.add(S);
536
+ }
537
+ if (++o > y) throw new Error("circular link");
538
+ h = c, c = /* @__PURE__ */ new Set();
539
+ }
540
+ }
541
+ e(I, "computeNodeHeights");
542
+ function B({ nodes: n }) {
543
+ const y = it(n, (o) => o.depth) + 1, h = (r - t - f) / (y - 1), c = new Array(y);
544
+ for (const o of n) {
545
+ const m = Math.max(0, Math.min(y - 1, Math.floor(s.call(null, o, y))));
546
+ o.layer = m, o.x0 = t + m * h, o.x1 = o.x0 + f, c[m] ? c[m].push(o) : c[m] = [o];
547
+ }
548
+ if (a) for (const o of c)
549
+ o.sort(a);
550
+ return c;
551
+ }
552
+ e(B, "computeNodeLayers");
553
+ function $(n) {
554
+ const y = yt(n, (h) => (u - i - (h.length - 1) * p) / q(h, X));
555
+ for (const h of n) {
556
+ let c = i;
557
+ for (const o of h) {
558
+ o.y0 = c, o.y1 = c + o.value * y, c = o.y1 + p;
559
+ for (const m of o.sourceLinks)
560
+ m.width = m.value * y;
561
+ }
562
+ c = (u - c + p) / (h.length + 1);
563
+ for (let o = 0; o < h.length; ++o) {
564
+ const m = h[o];
565
+ m.y0 += c * (o + 1), m.y1 += c * (o + 1);
566
+ }
567
+ E(h);
568
+ }
569
+ }
570
+ e($, "initializeNodeBreadths");
571
+ function w(n) {
572
+ const y = B(n);
573
+ p = Math.min(b, (u - i) / (it(y, (h) => h.length) - 1)), $(y);
574
+ for (let h = 0; h < d; ++h) {
575
+ const c = Math.pow(0.99, h), o = Math.max(1 - c, (h + 1) / d);
576
+ j(y, c, o), P(y, c, o);
577
+ }
578
+ }
579
+ e(w, "computeNodeBreadths");
580
+ function P(n, y, h) {
581
+ for (let c = 1, o = n.length; c < o; ++c) {
582
+ const m = n[c];
583
+ for (const S of m) {
584
+ let L = 0, R = 0;
585
+ for (const { source: U, value: et } of S.targetLinks) {
586
+ let W = et * (S.layer - U.layer);
587
+ L += D(U, S) * W, R += W;
588
+ }
589
+ if (!(R > 0)) continue;
590
+ let F = (L / R - S.y0) * y;
591
+ S.y0 += F, S.y1 += F, T(S);
592
+ }
593
+ a === void 0 && m.sort(G), z(m, h);
594
+ }
595
+ }
596
+ e(P, "relaxLeftToRight");
597
+ function j(n, y, h) {
598
+ for (let c = n.length, o = c - 2; o >= 0; --o) {
599
+ const m = n[o];
600
+ for (const S of m) {
601
+ let L = 0, R = 0;
602
+ for (const { target: U, value: et } of S.sourceLinks) {
603
+ let W = et * (U.layer - S.layer);
604
+ L += C(S, U) * W, R += W;
605
+ }
606
+ if (!(R > 0)) continue;
607
+ let F = (L / R - S.y0) * y;
608
+ S.y0 += F, S.y1 += F, T(S);
609
+ }
610
+ a === void 0 && m.sort(G), z(m, h);
611
+ }
612
+ }
613
+ e(j, "relaxRightToLeft");
614
+ function z(n, y) {
615
+ const h = n.length >> 1, c = n[h];
616
+ g(n, c.y0 - p, h - 1, y), O(n, c.y1 + p, h + 1, y), g(n, u, n.length - 1, y), O(n, i, 0, y);
617
+ }
618
+ e(z, "resolveCollisions");
619
+ function O(n, y, h, c) {
620
+ for (; h < n.length; ++h) {
621
+ const o = n[h], m = (y - o.y0) * c;
622
+ m > 1e-6 && (o.y0 += m, o.y1 += m), y = o.y1 + p;
623
+ }
624
+ }
625
+ e(O, "resolveCollisionsTopToBottom");
626
+ function g(n, y, h, c) {
627
+ for (; h >= 0; --h) {
628
+ const o = n[h], m = (o.y1 - y) * c;
629
+ m > 1e-6 && (o.y0 -= m, o.y1 -= m), y = o.y0 - p;
630
+ }
631
+ }
632
+ e(g, "resolveCollisionsBottomToTop");
633
+ function T({ sourceLinks: n, targetLinks: y }) {
634
+ if (l === void 0) {
635
+ for (const { source: { sourceLinks: h } } of y)
636
+ h.sort(rt);
637
+ for (const { target: { targetLinks: h } } of n)
638
+ h.sort(st);
639
+ }
640
+ }
641
+ e(T, "reorderNodeLinks");
642
+ function E(n) {
643
+ if (l === void 0)
644
+ for (const { sourceLinks: y, targetLinks: h } of n)
645
+ y.sort(rt), h.sort(st);
646
+ }
647
+ e(E, "reorderLinks");
648
+ function D(n, y) {
649
+ let h = n.y0 - (n.sourceLinks.length - 1) * p / 2;
650
+ for (const { target: c, width: o } of n.sourceLinks) {
651
+ if (c === y) break;
652
+ h += o + p;
653
+ }
654
+ for (const { source: c, width: o } of y.targetLinks) {
655
+ if (c === n) break;
656
+ h -= o;
657
+ }
658
+ return h;
659
+ }
660
+ e(D, "targetTop");
661
+ function C(n, y) {
662
+ let h = y.y0 - (y.targetLinks.length - 1) * p / 2;
663
+ for (const { source: c, width: o } of y.targetLinks) {
664
+ if (c === n) break;
665
+ h += o + p;
666
+ }
667
+ for (const { target: c, width: o } of n.sourceLinks) {
668
+ if (c === y) break;
669
+ h -= o;
670
+ }
671
+ return h;
672
+ }
673
+ return e(C, "sourceTop"), x;
674
+ }
675
+ e(wt, "Sankey");
676
+ var lt = Math.PI, ct = 2 * lt, V = 1e-6, ne = ct - V;
677
+ function K() {
678
+ this._x0 = this._y0 = // start of current subpath
679
+ this._x1 = this._y1 = null, this._ = "";
680
+ }
681
+ e(K, "Path");
682
+ function gt() {
683
+ return new K();
684
+ }
685
+ e(gt, "path");
686
+ K.prototype = gt.prototype = {
687
+ constructor: K,
688
+ moveTo: /* @__PURE__ */ e(function(t, i) {
689
+ this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +i);
690
+ }, "moveTo"),
691
+ closePath: /* @__PURE__ */ e(function() {
692
+ this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
693
+ }, "closePath"),
694
+ lineTo: /* @__PURE__ */ e(function(t, i) {
695
+ this._ += "L" + (this._x1 = +t) + "," + (this._y1 = +i);
696
+ }, "lineTo"),
697
+ quadraticCurveTo: /* @__PURE__ */ e(function(t, i, r, u) {
698
+ this._ += "Q" + +t + "," + +i + "," + (this._x1 = +r) + "," + (this._y1 = +u);
699
+ }, "quadraticCurveTo"),
700
+ bezierCurveTo: /* @__PURE__ */ e(function(t, i, r, u, f, b) {
701
+ this._ += "C" + +t + "," + +i + "," + +r + "," + +u + "," + (this._x1 = +f) + "," + (this._y1 = +b);
702
+ }, "bezierCurveTo"),
703
+ arcTo: /* @__PURE__ */ e(function(t, i, r, u, f) {
704
+ t = +t, i = +i, r = +r, u = +u, f = +f;
705
+ var b = this._x1, p = this._y1, k = r - t, s = u - i, a = b - t, l = p - i, _ = a * a + l * l;
706
+ if (f < 0) throw new Error("negative radius: " + f);
707
+ if (this._x1 === null)
708
+ this._ += "M" + (this._x1 = t) + "," + (this._y1 = i);
709
+ else if (_ > V) if (!(Math.abs(l * k - s * a) > V) || !f)
710
+ this._ += "L" + (this._x1 = t) + "," + (this._y1 = i);
711
+ else {
712
+ var v = r - b, d = u - p, x = k * k + s * s, M = v * v + d * d, A = Math.sqrt(x), N = Math.sqrt(_), I = f * Math.tan((lt - Math.acos((x + _ - M) / (2 * A * N))) / 2), B = I / N, $ = I / A;
713
+ Math.abs(B - 1) > V && (this._ += "L" + (t + B * a) + "," + (i + B * l)), this._ += "A" + f + "," + f + ",0,0," + +(l * v > a * d) + "," + (this._x1 = t + $ * k) + "," + (this._y1 = i + $ * s);
714
+ }
715
+ }, "arcTo"),
716
+ arc: /* @__PURE__ */ e(function(t, i, r, u, f, b) {
717
+ t = +t, i = +i, r = +r, b = !!b;
718
+ var p = r * Math.cos(u), k = r * Math.sin(u), s = t + p, a = i + k, l = 1 ^ b, _ = b ? u - f : f - u;
719
+ if (r < 0) throw new Error("negative radius: " + r);
720
+ this._x1 === null ? this._ += "M" + s + "," + a : (Math.abs(this._x1 - s) > V || Math.abs(this._y1 - a) > V) && (this._ += "L" + s + "," + a), r && (_ < 0 && (_ = _ % ct + ct), _ > ne ? this._ += "A" + r + "," + r + ",0,1," + l + "," + (t - p) + "," + (i - k) + "A" + r + "," + r + ",0,1," + l + "," + (this._x1 = s) + "," + (this._y1 = a) : _ > V && (this._ += "A" + r + "," + r + ",0," + +(_ >= lt) + "," + l + "," + (this._x1 = t + r * Math.cos(f)) + "," + (this._y1 = i + r * Math.sin(f))));
721
+ }, "arc"),
722
+ rect: /* @__PURE__ */ e(function(t, i, r, u) {
723
+ this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +i) + "h" + +r + "v" + +u + "h" + -r + "Z";
724
+ }, "rect"),
725
+ toString: /* @__PURE__ */ e(function() {
726
+ return this._;
727
+ }, "toString")
728
+ };
729
+ var ie = gt;
730
+ function ut(t) {
731
+ return /* @__PURE__ */ e(function() {
732
+ return t;
733
+ }, "constant");
734
+ }
735
+ e(ut, "default");
736
+ function Lt(t) {
737
+ return t[0];
738
+ }
739
+ e(Lt, "x");
740
+ function Tt(t) {
741
+ return t[1];
742
+ }
743
+ e(Tt, "y");
744
+ var se = Array.prototype.slice;
745
+ function Et(t) {
746
+ return t.source;
747
+ }
748
+ e(Et, "linkSource");
749
+ function At(t) {
750
+ return t.target;
751
+ }
752
+ e(At, "linkTarget");
753
+ function Mt(t) {
754
+ var i = Et, r = At, u = Lt, f = Tt, b = null;
755
+ function p() {
756
+ var k, s = se.call(arguments), a = i.apply(this, s), l = r.apply(this, s);
757
+ if (b || (b = k = ie()), t(b, +u.apply(this, (s[0] = a, s)), +f.apply(this, s), +u.apply(this, (s[0] = l, s)), +f.apply(this, s)), k) return b = null, k + "" || null;
758
+ }
759
+ return e(p, "link"), p.source = function(k) {
760
+ return arguments.length ? (i = k, p) : i;
761
+ }, p.target = function(k) {
762
+ return arguments.length ? (r = k, p) : r;
763
+ }, p.x = function(k) {
764
+ return arguments.length ? (u = typeof k == "function" ? k : ut(+k), p) : u;
765
+ }, p.y = function(k) {
766
+ return arguments.length ? (f = typeof k == "function" ? k : ut(+k), p) : f;
767
+ }, p.context = function(k) {
768
+ return arguments.length ? (b = k ?? null, p) : b;
769
+ }, p;
770
+ }
771
+ e(Mt, "link");
772
+ function Nt(t, i, r, u, f) {
773
+ t.moveTo(i, r), t.bezierCurveTo(i = (i + u) / 2, r, i, f, u, f);
774
+ }
775
+ e(Nt, "curveHorizontal");
776
+ function Ct() {
777
+ return Mt(Nt);
778
+ }
779
+ e(Ct, "linkHorizontal");
780
+ function Pt(t) {
781
+ return [t.source.x1, t.y0];
782
+ }
783
+ e(Pt, "horizontalSource");
784
+ function It(t) {
785
+ return [t.target.x0, t.y1];
786
+ }
787
+ e(It, "horizontalTarget");
788
+ function zt() {
789
+ return Ct().source(Pt).target(It);
790
+ }
791
+ e(zt, "default");
792
+ var pt = class ht {
793
+ static {
794
+ e(this, "Uid");
795
+ }
796
+ static {
797
+ this.count = 0;
798
+ }
799
+ static next(i) {
800
+ return new ht(i + ++ht.count);
801
+ }
802
+ constructor(i) {
803
+ this.id = i, this.href = `#${i}`;
804
+ }
805
+ toString() {
806
+ return "url(" + this.href + ")";
807
+ }
808
+ }, re = {
809
+ left: kt,
810
+ right: _t,
811
+ center: xt,
812
+ justify: dt
813
+ }, oe = /* @__PURE__ */ e(function(t, i, r, u) {
814
+ const { securityLevel: f, sankey: b } = ft(), p = Vt.sankey;
815
+ let k;
816
+ f === "sandbox" && (k = Y("#i" + i));
817
+ const s = f === "sandbox" ? Y(k.nodes()[0].contentDocument.body) : Y("body"), a = f === "sandbox" ? s.select(`[id="${i}"]`) : Y(`[id="${i}"]`), l = b?.width ?? p.width, _ = b?.height ?? p.width, v = b?.useMaxWidth ?? p.useMaxWidth, d = b?.nodeAlignment ?? p.nodeAlignment, x = b?.prefix ?? p.prefix, M = b?.suffix ?? p.suffix, A = b?.showValues ?? p.showValues, N = u.db.getGraph(), I = re[d];
818
+ wt().nodeId((g) => g.id).nodeWidth(10).nodePadding(10 + (A ? 15 : 0)).nodeAlign(I).extent([
819
+ [0, 0],
820
+ [l, _]
821
+ ])(N);
822
+ const w = Ft(Gt);
823
+ a.append("g").attr("class", "nodes").selectAll(".node").data(N.nodes).join("g").attr("class", "node").attr("id", (g) => (g.uid = pt.next("node-")).id).attr("transform", function(g) {
824
+ return "translate(" + g.x0 + "," + g.y0 + ")";
825
+ }).attr("x", (g) => g.x0).attr("y", (g) => g.y0).append("rect").attr("height", (g) => g.y1 - g.y0).attr("width", (g) => g.x1 - g.x0).attr("fill", (g) => w(g.id));
826
+ const P = /* @__PURE__ */ e(({ id: g, value: T }) => A ? `${g}
827
+ ${x}${Math.round(T * 100) / 100}${M}` : g, "getText");
828
+ a.append("g").attr("class", "node-labels").attr("font-size", 14).selectAll("text").data(N.nodes).join("text").attr("x", (g) => g.x0 < l / 2 ? g.x1 + 6 : g.x0 - 6).attr("y", (g) => (g.y1 + g.y0) / 2).attr("dy", `${A ? "0" : "0.35"}em`).attr("text-anchor", (g) => g.x0 < l / 2 ? "start" : "end").text(P);
829
+ const j = a.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", 0.5).selectAll(".link").data(N.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply"), z = b?.linkColor ?? "gradient";
830
+ if (z === "gradient") {
831
+ const g = j.append("linearGradient").attr("id", (T) => (T.uid = pt.next("linearGradient-")).id).attr("gradientUnits", "userSpaceOnUse").attr("x1", (T) => T.source.x1).attr("x2", (T) => T.target.x0);
832
+ g.append("stop").attr("offset", "0%").attr("stop-color", (T) => w(T.source.id)), g.append("stop").attr("offset", "100%").attr("stop-color", (T) => w(T.target.id));
833
+ }
834
+ let O;
835
+ switch (z) {
836
+ case "gradient":
837
+ O = /* @__PURE__ */ e((g) => g.uid, "coloring");
838
+ break;
839
+ case "source":
840
+ O = /* @__PURE__ */ e((g) => w(g.source.id), "coloring");
841
+ break;
842
+ case "target":
843
+ O = /* @__PURE__ */ e((g) => w(g.target.id), "coloring");
844
+ break;
845
+ default:
846
+ O = z;
847
+ }
848
+ j.append("path").attr("d", zt()).attr("stroke", O).attr("stroke-width", (g) => Math.max(1, g.width)), Ut(void 0, a, 0, v);
849
+ }, "draw"), ae = {
850
+ draw: oe
851
+ }, le = /* @__PURE__ */ e((t) => t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, `
852
+ `).trim(), "prepareTextForParsing"), ce = /* @__PURE__ */ e((t) => `.label {
853
+ font-family: ${t.fontFamily};
854
+ }`, "getStyles"), ue = ce, he = Q.parse.bind(Q);
855
+ Q.parse = (t) => he(le(t));
856
+ var ye = {
857
+ styles: ue,
858
+ parser: Q,
859
+ db: ee,
860
+ renderer: ae
861
+ };
862
+ export {
863
+ ye as diagram
864
+ };