@elmethis/core 1.0.0-alpha.135 → 1.0.0-alpha.136

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 (66) hide show
  1. package/dist/{Bash-5KqPZETT.js → Bash-BGUPOZp7.js} +1 -1
  2. package/dist/{Css-Br7IeFYI.js → Css-BCZOJ9TO.js} +1 -1
  3. package/dist/{Rust-TE1r2SD6.js → Rust-BwvKtYCc.js} +1 -1
  4. package/dist/_basePickBy-BjVOtBbf.js +152 -0
  5. package/dist/_baseUniq-DBXEmOed.js +583 -0
  6. package/dist/arc-CpOtc53l.js +83 -0
  7. package/dist/architecture-I3QFYML2-B3piHlUx.js +5 -0
  8. package/dist/architectureDiagram-UYN6MBPD-CIvqBNYd.js +4595 -0
  9. package/dist/blockDiagram-ZHA2E4KO-BJHIBwi6.js +2247 -0
  10. package/dist/c4Diagram-6F5ED5ID-DxXqw6e0.js +1581 -0
  11. package/dist/channel-BgZSmjvA.js +5 -0
  12. package/dist/chunk-5HRBRIJM-CvhBPtHu.js +24 -0
  13. package/dist/chunk-7U56Z5CX-CaWvnXle.js +1215 -0
  14. package/dist/chunk-ASOPGD6M-CQjrO8hd.js +64 -0
  15. package/dist/chunk-KFBOBJHC-DWru5GNu.js +15 -0
  16. package/dist/chunk-T2TOU4HS-DqpYO7rW.js +1303 -0
  17. package/dist/chunk-TMUBEWPD-LmMMNIqt.js +9 -0
  18. package/dist/classDiagram-LNE6IOMH-D5GoOZTJ.js +14 -0
  19. package/dist/classDiagram-v2-MQ7JQ4JX-D5GoOZTJ.js +14 -0
  20. package/dist/clone-DMQ2a__4.js +8 -0
  21. package/dist/{cobol-DZ3yq6J9.js → cobol-DMssKNmC.js} +1 -1
  22. package/dist/components/code/ElmMermaid.stories.d.ts +7 -0
  23. package/dist/components/code/ElmMermaid.vue.d.ts +8 -0
  24. package/dist/cytoscape.esm-CsRvAgYT.js +17639 -0
  25. package/dist/dagre-4EVJKHTY-C7YsHY3S.js +447 -0
  26. package/dist/diagram-QW4FP2JN-iDbrW_yI.js +126 -0
  27. package/dist/elmethis.js +36 -35
  28. package/dist/elmethis.umd.cjs +2272 -41
  29. package/dist/erDiagram-6RL3IURR-LYq0WEw3.js +937 -0
  30. package/dist/flowDiagram-7ASYPVHJ-DRPtjs2_.js +1484 -0
  31. package/dist/ganttDiagram-NTVNEXSI-C-hO_7Lp.js +2494 -0
  32. package/dist/gitGraph-YCYPL57B-BaVhg8eu.js +5 -0
  33. package/dist/gitGraphDiagram-NRZ2UAAF-u52k9qsq.js +712 -0
  34. package/dist/graph-CKV5wesZ.js +247 -0
  35. package/dist/{index-0D7NEPxZ.js → index-DQdUr-_f.js} +3548 -3436
  36. package/dist/index.d.ts +3 -2
  37. package/dist/info-46DW6VJ7-D5JUpHK_.js +5 -0
  38. package/dist/infoDiagram-A4XQUW5V-D5IcjWQu.js +22 -0
  39. package/dist/init-DjUOC4st.js +16 -0
  40. package/dist/journeyDiagram-G5WM74LC-XHcEaxXL.js +810 -0
  41. package/dist/kanban-definition-QRCXZQQD-BFgu8zXi.js +718 -0
  42. package/dist/layout-Cycesmdu.js +1324 -0
  43. package/dist/linear-CjRkwbhR.js +423 -0
  44. package/dist/mermaid-parser.core-CL_REaxY.js +12479 -0
  45. package/dist/mermaid.core-gtllNrzr.js +14852 -0
  46. package/dist/mindmap-definition-GWI6TPTV-yPOhYeCo.js +3220 -0
  47. package/dist/ordinal-DfAQgscy.js +61 -0
  48. package/dist/packet-W2GHVCYJ-D1drjM5q.js +5 -0
  49. package/dist/pie-BEWT4RHE-B2xFs62T.js +5 -0
  50. package/dist/pieDiagram-YF2LJOPJ-Cnvx0DvF.js +162 -0
  51. package/dist/quadrantDiagram-OS5C2QUG-DBWy6UVd.js +1024 -0
  52. package/dist/{razor-Dl6rcHmj.js → razor-CeqqNtyB.js} +1 -1
  53. package/dist/requirementDiagram-MIRIMTAZ-CfHcsBsO.js +768 -0
  54. package/dist/sankeyDiagram-Y46BX6SQ-C_60tCtv.js +805 -0
  55. package/dist/sass-eCUyDs9S.js +6 -0
  56. package/dist/scala-Cly-fENF.js +6 -0
  57. package/dist/sequenceDiagram-G6AWOVSC-XvgYpHvJ.js +2274 -0
  58. package/dist/stateDiagram-MAYHULR4-Bx48BKG3.js +268 -0
  59. package/dist/stateDiagram-v2-4JROLMXI-pDuBzVSZ.js +14 -0
  60. package/dist/swift-BAWqNR8A.js +6 -0
  61. package/dist/timeline-definition-U7ZMHBDA-EGhtku4S.js +804 -0
  62. package/dist/xychartDiagram-6QU3TZC5-B_OmutYz.js +1304 -0
  63. package/package.json +11 -10
  64. package/dist/sass-iCyS6eP9.js +0 -6
  65. package/dist/scala-BQHTnvwx.js +0 -6
  66. package/dist/swift-OL4r9IGP.js +0 -6
@@ -0,0 +1,1304 @@
1
+ import { _ as a, aE as ui, l as Ft, a1 as Bt, a0 as gi, F as At, E as Xt, D as xi, i as di, r as Nt, s as pi, g as fi, q as mi, b as yi, c as bi, x as Ai, I as wi, k as Ci } from "./mermaid.core-gtllNrzr.js";
2
+ import { i as Si } from "./init-DjUOC4st.js";
3
+ import { o as _i } from "./ordinal-DfAQgscy.js";
4
+ import { l as Wt } from "./linear-CjRkwbhR.js";
5
+ function ki(e, t, i) {
6
+ e = +e, t = +t, i = (n = arguments.length) < 2 ? (t = e, e = 0, 1) : n < 3 ? 1 : +i;
7
+ for (var s = -1, n = Math.max(0, Math.ceil((t - e) / i)) | 0, o = new Array(n); ++s < n; )
8
+ o[s] = e + s * i;
9
+ return o;
10
+ }
11
+ function pt() {
12
+ var e = _i().unknown(void 0), t = e.domain, i = e.range, s = 0, n = 1, o, u, f = !1, p = 0, k = 0, R = 0.5;
13
+ delete e.unknown;
14
+ function w() {
15
+ var y = t().length, D = n < s, S = D ? n : s, v = D ? s : n;
16
+ o = (v - S) / Math.max(1, y - p + k * 2), f && (o = Math.floor(o)), S += (v - S - o * (y - p)) * R, u = o * (1 - p), f && (S = Math.round(S), u = Math.round(u));
17
+ var m = ki(y).map(function(_) {
18
+ return S + o * _;
19
+ });
20
+ return i(D ? m.reverse() : m);
21
+ }
22
+ return e.domain = function(y) {
23
+ return arguments.length ? (t(y), w()) : t();
24
+ }, e.range = function(y) {
25
+ return arguments.length ? ([s, n] = y, s = +s, n = +n, w()) : [s, n];
26
+ }, e.rangeRound = function(y) {
27
+ return [s, n] = y, s = +s, n = +n, f = !0, w();
28
+ }, e.bandwidth = function() {
29
+ return u;
30
+ }, e.step = function() {
31
+ return o;
32
+ }, e.round = function(y) {
33
+ return arguments.length ? (f = !!y, w()) : f;
34
+ }, e.padding = function(y) {
35
+ return arguments.length ? (p = Math.min(1, k = +y), w()) : p;
36
+ }, e.paddingInner = function(y) {
37
+ return arguments.length ? (p = Math.min(1, y), w()) : p;
38
+ }, e.paddingOuter = function(y) {
39
+ return arguments.length ? (k = +y, w()) : k;
40
+ }, e.align = function(y) {
41
+ return arguments.length ? (R = Math.max(0, Math.min(1, y)), w()) : R;
42
+ }, e.copy = function() {
43
+ return pt(t(), [s, n]).round(f).paddingInner(p).paddingOuter(k).align(R);
44
+ }, Si.apply(w(), arguments);
45
+ }
46
+ var ft = function() {
47
+ var e = /* @__PURE__ */ a(function(B, h, c, g) {
48
+ for (c = c || {}, g = B.length; g--; c[B[g]] = h) ;
49
+ return c;
50
+ }, "o"), t = [1, 10, 12, 14, 16, 18, 19, 21, 23], i = [2, 6], s = [1, 3], n = [1, 5], o = [1, 6], u = [1, 7], f = [1, 5, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], p = [1, 25], k = [1, 26], R = [1, 28], w = [1, 29], y = [1, 30], D = [1, 31], S = [1, 32], v = [1, 33], m = [1, 34], _ = [1, 35], l = [1, 36], E = [1, 37], K = [1, 43], vt = [1, 42], Pt = [1, 47], et = [1, 50], C = [1, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], lt = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36], I = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], Lt = [1, 64], ct = {
51
+ trace: /* @__PURE__ */ a(function() {
52
+ }, "trace"),
53
+ yy: {},
54
+ symbols_: { error: 2, start: 3, eol: 4, XYCHART: 5, chartConfig: 6, document: 7, CHART_ORIENTATION: 8, statement: 9, title: 10, text: 11, X_AXIS: 12, parseXAxis: 13, Y_AXIS: 14, parseYAxis: 15, LINE: 16, plotData: 17, BAR: 18, acc_title: 19, acc_title_value: 20, acc_descr: 21, acc_descr_value: 22, acc_descr_multiline_value: 23, SQUARE_BRACES_START: 24, commaSeparatedNumbers: 25, SQUARE_BRACES_END: 26, NUMBER_WITH_DECIMAL: 27, COMMA: 28, xAxisData: 29, bandData: 30, ARROW_DELIMITER: 31, commaSeparatedTexts: 32, yAxisData: 33, NEWLINE: 34, SEMI: 35, EOF: 36, alphaNum: 37, STR: 38, MD_STR: 39, alphaNumToken: 40, AMP: 41, NUM: 42, ALPHA: 43, PLUS: 44, EQUALS: 45, MULT: 46, DOT: 47, BRKT: 48, MINUS: 49, UNDERSCORE: 50, $accept: 0, $end: 1 },
55
+ terminals_: { 2: "error", 5: "XYCHART", 8: "CHART_ORIENTATION", 10: "title", 12: "X_AXIS", 14: "Y_AXIS", 16: "LINE", 18: "BAR", 19: "acc_title", 20: "acc_title_value", 21: "acc_descr", 22: "acc_descr_value", 23: "acc_descr_multiline_value", 24: "SQUARE_BRACES_START", 26: "SQUARE_BRACES_END", 27: "NUMBER_WITH_DECIMAL", 28: "COMMA", 31: "ARROW_DELIMITER", 34: "NEWLINE", 35: "SEMI", 36: "EOF", 38: "STR", 39: "MD_STR", 41: "AMP", 42: "NUM", 43: "ALPHA", 44: "PLUS", 45: "EQUALS", 46: "MULT", 47: "DOT", 48: "BRKT", 49: "MINUS", 50: "UNDERSCORE" },
56
+ productions_: [0, [3, 2], [3, 3], [3, 2], [3, 1], [6, 1], [7, 0], [7, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 3], [9, 2], [9, 3], [9, 2], [9, 2], [9, 1], [17, 3], [25, 3], [25, 1], [13, 1], [13, 2], [13, 1], [29, 1], [29, 3], [30, 3], [32, 3], [32, 1], [15, 1], [15, 2], [15, 1], [33, 3], [4, 1], [4, 1], [4, 1], [11, 1], [11, 1], [11, 1], [37, 1], [37, 2], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1]],
57
+ performAction: /* @__PURE__ */ a(function(h, c, g, x, A, r, Z) {
58
+ var d = r.length - 1;
59
+ switch (A) {
60
+ case 5:
61
+ x.setOrientation(r[d]);
62
+ break;
63
+ case 9:
64
+ x.setDiagramTitle(r[d].text.trim());
65
+ break;
66
+ case 12:
67
+ x.setLineData({ text: "", type: "text" }, r[d]);
68
+ break;
69
+ case 13:
70
+ x.setLineData(r[d - 1], r[d]);
71
+ break;
72
+ case 14:
73
+ x.setBarData({ text: "", type: "text" }, r[d]);
74
+ break;
75
+ case 15:
76
+ x.setBarData(r[d - 1], r[d]);
77
+ break;
78
+ case 16:
79
+ this.$ = r[d].trim(), x.setAccTitle(this.$);
80
+ break;
81
+ case 17:
82
+ case 18:
83
+ this.$ = r[d].trim(), x.setAccDescription(this.$);
84
+ break;
85
+ case 19:
86
+ this.$ = r[d - 1];
87
+ break;
88
+ case 20:
89
+ this.$ = [Number(r[d - 2]), ...r[d]];
90
+ break;
91
+ case 21:
92
+ this.$ = [Number(r[d])];
93
+ break;
94
+ case 22:
95
+ x.setXAxisTitle(r[d]);
96
+ break;
97
+ case 23:
98
+ x.setXAxisTitle(r[d - 1]);
99
+ break;
100
+ case 24:
101
+ x.setXAxisTitle({ type: "text", text: "" });
102
+ break;
103
+ case 25:
104
+ x.setXAxisBand(r[d]);
105
+ break;
106
+ case 26:
107
+ x.setXAxisRangeData(Number(r[d - 2]), Number(r[d]));
108
+ break;
109
+ case 27:
110
+ this.$ = r[d - 1];
111
+ break;
112
+ case 28:
113
+ this.$ = [r[d - 2], ...r[d]];
114
+ break;
115
+ case 29:
116
+ this.$ = [r[d]];
117
+ break;
118
+ case 30:
119
+ x.setYAxisTitle(r[d]);
120
+ break;
121
+ case 31:
122
+ x.setYAxisTitle(r[d - 1]);
123
+ break;
124
+ case 32:
125
+ x.setYAxisTitle({ type: "text", text: "" });
126
+ break;
127
+ case 33:
128
+ x.setYAxisRangeData(Number(r[d - 2]), Number(r[d]));
129
+ break;
130
+ case 37:
131
+ this.$ = { text: r[d], type: "text" };
132
+ break;
133
+ case 38:
134
+ this.$ = { text: r[d], type: "text" };
135
+ break;
136
+ case 39:
137
+ this.$ = { text: r[d], type: "markdown" };
138
+ break;
139
+ case 40:
140
+ this.$ = r[d];
141
+ break;
142
+ case 41:
143
+ this.$ = r[d - 1] + "" + r[d];
144
+ break;
145
+ }
146
+ }, "anonymous"),
147
+ table: [e(t, i, { 3: 1, 4: 2, 7: 4, 5: s, 34: n, 35: o, 36: u }), { 1: [3] }, e(t, i, { 4: 2, 7: 4, 3: 8, 5: s, 34: n, 35: o, 36: u }), e(t, i, { 4: 2, 7: 4, 6: 9, 3: 10, 5: s, 8: [1, 11], 34: n, 35: o, 36: u }), { 1: [2, 4], 9: 12, 10: [1, 13], 12: [1, 14], 14: [1, 15], 16: [1, 16], 18: [1, 17], 19: [1, 18], 21: [1, 19], 23: [1, 20] }, e(f, [2, 34]), e(f, [2, 35]), e(f, [2, 36]), { 1: [2, 1] }, e(t, i, { 4: 2, 7: 4, 3: 21, 5: s, 34: n, 35: o, 36: u }), { 1: [2, 3] }, e(f, [2, 5]), e(t, [2, 7], { 4: 22, 34: n, 35: o, 36: u }), { 11: 23, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 11: 39, 13: 38, 24: K, 27: vt, 29: 40, 30: 41, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 11: 45, 15: 44, 27: Pt, 33: 46, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 11: 49, 17: 48, 24: et, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 11: 52, 17: 51, 24: et, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 20: [1, 53] }, { 22: [1, 54] }, e(C, [2, 18]), { 1: [2, 2] }, e(C, [2, 8]), e(C, [2, 9]), e(lt, [2, 37], { 40: 55, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }), e(lt, [2, 38]), e(lt, [2, 39]), e(I, [2, 40]), e(I, [2, 42]), e(I, [2, 43]), e(I, [2, 44]), e(I, [2, 45]), e(I, [2, 46]), e(I, [2, 47]), e(I, [2, 48]), e(I, [2, 49]), e(I, [2, 50]), e(I, [2, 51]), e(C, [2, 10]), e(C, [2, 22], { 30: 41, 29: 56, 24: K, 27: vt }), e(C, [2, 24]), e(C, [2, 25]), { 31: [1, 57] }, { 11: 59, 32: 58, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, e(C, [2, 11]), e(C, [2, 30], { 33: 60, 27: Pt }), e(C, [2, 32]), { 31: [1, 61] }, e(C, [2, 12]), { 17: 62, 24: et }, { 25: 63, 27: Lt }, e(C, [2, 14]), { 17: 65, 24: et }, e(C, [2, 16]), e(C, [2, 17]), e(I, [2, 41]), e(C, [2, 23]), { 27: [1, 66] }, { 26: [1, 67] }, { 26: [2, 29], 28: [1, 68] }, e(C, [2, 31]), { 27: [1, 69] }, e(C, [2, 13]), { 26: [1, 70] }, { 26: [2, 21], 28: [1, 71] }, e(C, [2, 15]), e(C, [2, 26]), e(C, [2, 27]), { 11: 59, 32: 72, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, e(C, [2, 33]), e(C, [2, 19]), { 25: 73, 27: Lt }, { 26: [2, 28] }, { 26: [2, 20] }],
148
+ defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 72: [2, 28], 73: [2, 20] },
149
+ parseError: /* @__PURE__ */ a(function(h, c) {
150
+ if (c.recoverable)
151
+ this.trace(h);
152
+ else {
153
+ var g = new Error(h);
154
+ throw g.hash = c, g;
155
+ }
156
+ }, "parseError"),
157
+ parse: /* @__PURE__ */ a(function(h) {
158
+ var c = this, g = [0], x = [], A = [null], r = [], Z = this.table, d = "", nt = 0, Et = 0, oi = 2, It = 1, hi = r.slice.call(arguments, 1), T = Object.create(this.lexer), W = { yy: {} };
159
+ for (var ut in this.yy)
160
+ Object.prototype.hasOwnProperty.call(this.yy, ut) && (W.yy[ut] = this.yy[ut]);
161
+ T.setInput(h, W.yy), W.yy.lexer = T, W.yy.parser = this, typeof T.yylloc > "u" && (T.yylloc = {});
162
+ var gt = T.yylloc;
163
+ r.push(gt);
164
+ var li = T.options && T.options.ranges;
165
+ typeof W.yy.parseError == "function" ? this.parseError = W.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
166
+ function ci(L) {
167
+ g.length = g.length - 2 * L, A.length = A.length - L, r.length = r.length - L;
168
+ }
169
+ a(ci, "popStack");
170
+ function Mt() {
171
+ var L;
172
+ return L = x.pop() || T.lex() || It, typeof L != "number" && (L instanceof Array && (x = L, L = x.pop()), L = c.symbols_[L] || L), L;
173
+ }
174
+ a(Mt, "lex");
175
+ for (var P, O, M, xt, z = {}, at, V, Vt, rt; ; ) {
176
+ if (O = g[g.length - 1], this.defaultActions[O] ? M = this.defaultActions[O] : ((P === null || typeof P > "u") && (P = Mt()), M = Z[O] && Z[O][P]), typeof M > "u" || !M.length || !M[0]) {
177
+ var dt = "";
178
+ rt = [];
179
+ for (at in Z[O])
180
+ this.terminals_[at] && at > oi && rt.push("'" + this.terminals_[at] + "'");
181
+ T.showPosition ? dt = "Parse error on line " + (nt + 1) + `:
182
+ ` + T.showPosition() + `
183
+ Expecting ` + rt.join(", ") + ", got '" + (this.terminals_[P] || P) + "'" : dt = "Parse error on line " + (nt + 1) + ": Unexpected " + (P == It ? "end of input" : "'" + (this.terminals_[P] || P) + "'"), this.parseError(dt, {
184
+ text: T.match,
185
+ token: this.terminals_[P] || P,
186
+ line: T.yylineno,
187
+ loc: gt,
188
+ expected: rt
189
+ });
190
+ }
191
+ if (M[0] instanceof Array && M.length > 1)
192
+ throw new Error("Parse Error: multiple actions possible at state: " + O + ", token: " + P);
193
+ switch (M[0]) {
194
+ case 1:
195
+ g.push(P), A.push(T.yytext), r.push(T.yylloc), g.push(M[1]), P = null, Et = T.yyleng, d = T.yytext, nt = T.yylineno, gt = T.yylloc;
196
+ break;
197
+ case 2:
198
+ if (V = this.productions_[M[1]][1], z.$ = A[A.length - V], z._$ = {
199
+ first_line: r[r.length - (V || 1)].first_line,
200
+ last_line: r[r.length - 1].last_line,
201
+ first_column: r[r.length - (V || 1)].first_column,
202
+ last_column: r[r.length - 1].last_column
203
+ }, li && (z._$.range = [
204
+ r[r.length - (V || 1)].range[0],
205
+ r[r.length - 1].range[1]
206
+ ]), xt = this.performAction.apply(z, [
207
+ d,
208
+ Et,
209
+ nt,
210
+ W.yy,
211
+ M[1],
212
+ A,
213
+ r
214
+ ].concat(hi)), typeof xt < "u")
215
+ return xt;
216
+ V && (g = g.slice(0, -1 * V * 2), A = A.slice(0, -1 * V), r = r.slice(0, -1 * V)), g.push(this.productions_[M[1]][0]), A.push(z.$), r.push(z._$), Vt = Z[g[g.length - 2]][g[g.length - 1]], g.push(Vt);
217
+ break;
218
+ case 3:
219
+ return !0;
220
+ }
221
+ }
222
+ return !0;
223
+ }, "parse")
224
+ }, ri = /* @__PURE__ */ function() {
225
+ var B = {
226
+ EOF: 1,
227
+ parseError: /* @__PURE__ */ a(function(c, g) {
228
+ if (this.yy.parser)
229
+ this.yy.parser.parseError(c, g);
230
+ else
231
+ throw new Error(c);
232
+ }, "parseError"),
233
+ // resets the lexer, sets new input
234
+ setInput: /* @__PURE__ */ a(function(h, c) {
235
+ return this.yy = c || this.yy || {}, this._input = h, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
236
+ first_line: 1,
237
+ first_column: 0,
238
+ last_line: 1,
239
+ last_column: 0
240
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
241
+ }, "setInput"),
242
+ // consumes and returns one char from the input
243
+ input: /* @__PURE__ */ a(function() {
244
+ var h = this._input[0];
245
+ this.yytext += h, this.yyleng++, this.offset++, this.match += h, this.matched += h;
246
+ var c = h.match(/(?:\r\n?|\n).*/g);
247
+ return c ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), h;
248
+ }, "input"),
249
+ // unshifts one char (or a string) into the input
250
+ unput: /* @__PURE__ */ a(function(h) {
251
+ var c = h.length, g = h.split(/(?:\r\n?|\n)/g);
252
+ this._input = h + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - c), this.offset -= c;
253
+ var x = this.match.split(/(?:\r\n?|\n)/g);
254
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), g.length - 1 && (this.yylineno -= g.length - 1);
255
+ var A = this.yylloc.range;
256
+ return this.yylloc = {
257
+ first_line: this.yylloc.first_line,
258
+ last_line: this.yylineno + 1,
259
+ first_column: this.yylloc.first_column,
260
+ last_column: g ? (g.length === x.length ? this.yylloc.first_column : 0) + x[x.length - g.length].length - g[0].length : this.yylloc.first_column - c
261
+ }, this.options.ranges && (this.yylloc.range = [A[0], A[0] + this.yyleng - c]), this.yyleng = this.yytext.length, this;
262
+ }, "unput"),
263
+ // When called from action, caches matched text and appends it on next action
264
+ more: /* @__PURE__ */ a(function() {
265
+ return this._more = !0, this;
266
+ }, "more"),
267
+ // 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.
268
+ reject: /* @__PURE__ */ a(function() {
269
+ if (this.options.backtrack_lexer)
270
+ this._backtrack = !0;
271
+ else
272
+ 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).
273
+ ` + this.showPosition(), {
274
+ text: "",
275
+ token: null,
276
+ line: this.yylineno
277
+ });
278
+ return this;
279
+ }, "reject"),
280
+ // retain first n characters of the match
281
+ less: /* @__PURE__ */ a(function(h) {
282
+ this.unput(this.match.slice(h));
283
+ }, "less"),
284
+ // displays already matched input, i.e. for error messages
285
+ pastInput: /* @__PURE__ */ a(function() {
286
+ var h = this.matched.substr(0, this.matched.length - this.match.length);
287
+ return (h.length > 20 ? "..." : "") + h.substr(-20).replace(/\n/g, "");
288
+ }, "pastInput"),
289
+ // displays upcoming input, i.e. for error messages
290
+ upcomingInput: /* @__PURE__ */ a(function() {
291
+ var h = this.match;
292
+ return h.length < 20 && (h += this._input.substr(0, 20 - h.length)), (h.substr(0, 20) + (h.length > 20 ? "..." : "")).replace(/\n/g, "");
293
+ }, "upcomingInput"),
294
+ // displays the character position where the lexing error occurred, i.e. for error messages
295
+ showPosition: /* @__PURE__ */ a(function() {
296
+ var h = this.pastInput(), c = new Array(h.length + 1).join("-");
297
+ return h + this.upcomingInput() + `
298
+ ` + c + "^";
299
+ }, "showPosition"),
300
+ // test the lexed token: return FALSE when not a match, otherwise return token
301
+ test_match: /* @__PURE__ */ a(function(h, c) {
302
+ var g, x, A;
303
+ if (this.options.backtrack_lexer && (A = {
304
+ yylineno: this.yylineno,
305
+ yylloc: {
306
+ first_line: this.yylloc.first_line,
307
+ last_line: this.last_line,
308
+ first_column: this.yylloc.first_column,
309
+ last_column: this.yylloc.last_column
310
+ },
311
+ yytext: this.yytext,
312
+ match: this.match,
313
+ matches: this.matches,
314
+ matched: this.matched,
315
+ yyleng: this.yyleng,
316
+ offset: this.offset,
317
+ _more: this._more,
318
+ _input: this._input,
319
+ yy: this.yy,
320
+ conditionStack: this.conditionStack.slice(0),
321
+ done: this.done
322
+ }, this.options.ranges && (A.yylloc.range = this.yylloc.range.slice(0))), x = h[0].match(/(?:\r\n?|\n).*/g), x && (this.yylineno += x.length), this.yylloc = {
323
+ first_line: this.yylloc.last_line,
324
+ last_line: this.yylineno + 1,
325
+ first_column: this.yylloc.last_column,
326
+ last_column: x ? x[x.length - 1].length - x[x.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + h[0].length
327
+ }, this.yytext += h[0], this.match += h[0], this.matches = h, 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(h[0].length), this.matched += h[0], g = this.performAction.call(this, this.yy, this, c, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), g)
328
+ return g;
329
+ if (this._backtrack) {
330
+ for (var r in A)
331
+ this[r] = A[r];
332
+ return !1;
333
+ }
334
+ return !1;
335
+ }, "test_match"),
336
+ // return next match in input
337
+ next: /* @__PURE__ */ a(function() {
338
+ if (this.done)
339
+ return this.EOF;
340
+ this._input || (this.done = !0);
341
+ var h, c, g, x;
342
+ this._more || (this.yytext = "", this.match = "");
343
+ for (var A = this._currentRules(), r = 0; r < A.length; r++)
344
+ if (g = this._input.match(this.rules[A[r]]), g && (!c || g[0].length > c[0].length)) {
345
+ if (c = g, x = r, this.options.backtrack_lexer) {
346
+ if (h = this.test_match(g, A[r]), h !== !1)
347
+ return h;
348
+ if (this._backtrack) {
349
+ c = !1;
350
+ continue;
351
+ } else
352
+ return !1;
353
+ } else if (!this.options.flex)
354
+ break;
355
+ }
356
+ return c ? (h = this.test_match(c, A[x]), h !== !1 ? h : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
357
+ ` + this.showPosition(), {
358
+ text: "",
359
+ token: null,
360
+ line: this.yylineno
361
+ });
362
+ }, "next"),
363
+ // return next match that has a token
364
+ lex: /* @__PURE__ */ a(function() {
365
+ var c = this.next();
366
+ return c || this.lex();
367
+ }, "lex"),
368
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
369
+ begin: /* @__PURE__ */ a(function(c) {
370
+ this.conditionStack.push(c);
371
+ }, "begin"),
372
+ // pop the previously active lexer condition state off the condition stack
373
+ popState: /* @__PURE__ */ a(function() {
374
+ var c = this.conditionStack.length - 1;
375
+ return c > 0 ? this.conditionStack.pop() : this.conditionStack[0];
376
+ }, "popState"),
377
+ // produce the lexer rule set which is active for the currently active lexer condition state
378
+ _currentRules: /* @__PURE__ */ a(function() {
379
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
380
+ }, "_currentRules"),
381
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
382
+ topState: /* @__PURE__ */ a(function(c) {
383
+ return c = this.conditionStack.length - 1 - Math.abs(c || 0), c >= 0 ? this.conditionStack[c] : "INITIAL";
384
+ }, "topState"),
385
+ // alias for begin(condition)
386
+ pushState: /* @__PURE__ */ a(function(c) {
387
+ this.begin(c);
388
+ }, "pushState"),
389
+ // return the number of states currently on the stack
390
+ stateStackSize: /* @__PURE__ */ a(function() {
391
+ return this.conditionStack.length;
392
+ }, "stateStackSize"),
393
+ options: { "case-insensitive": !0 },
394
+ performAction: /* @__PURE__ */ a(function(c, g, x, A) {
395
+ switch (x) {
396
+ case 0:
397
+ break;
398
+ case 1:
399
+ break;
400
+ case 2:
401
+ return this.popState(), 34;
402
+ case 3:
403
+ return this.popState(), 34;
404
+ case 4:
405
+ return 34;
406
+ case 5:
407
+ break;
408
+ case 6:
409
+ return 10;
410
+ case 7:
411
+ return this.pushState("acc_title"), 19;
412
+ case 8:
413
+ return this.popState(), "acc_title_value";
414
+ case 9:
415
+ return this.pushState("acc_descr"), 21;
416
+ case 10:
417
+ return this.popState(), "acc_descr_value";
418
+ case 11:
419
+ this.pushState("acc_descr_multiline");
420
+ break;
421
+ case 12:
422
+ this.popState();
423
+ break;
424
+ case 13:
425
+ return "acc_descr_multiline_value";
426
+ case 14:
427
+ return 5;
428
+ case 15:
429
+ return 8;
430
+ case 16:
431
+ return this.pushState("axis_data"), "X_AXIS";
432
+ case 17:
433
+ return this.pushState("axis_data"), "Y_AXIS";
434
+ case 18:
435
+ return this.pushState("axis_band_data"), 24;
436
+ case 19:
437
+ return 31;
438
+ case 20:
439
+ return this.pushState("data"), 16;
440
+ case 21:
441
+ return this.pushState("data"), 18;
442
+ case 22:
443
+ return this.pushState("data_inner"), 24;
444
+ case 23:
445
+ return 27;
446
+ case 24:
447
+ return this.popState(), 26;
448
+ case 25:
449
+ this.popState();
450
+ break;
451
+ case 26:
452
+ this.pushState("string");
453
+ break;
454
+ case 27:
455
+ this.popState();
456
+ break;
457
+ case 28:
458
+ return "STR";
459
+ case 29:
460
+ return 24;
461
+ case 30:
462
+ return 26;
463
+ case 31:
464
+ return 43;
465
+ case 32:
466
+ return "COLON";
467
+ case 33:
468
+ return 44;
469
+ case 34:
470
+ return 28;
471
+ case 35:
472
+ return 45;
473
+ case 36:
474
+ return 46;
475
+ case 37:
476
+ return 48;
477
+ case 38:
478
+ return 50;
479
+ case 39:
480
+ return 47;
481
+ case 40:
482
+ return 41;
483
+ case 41:
484
+ return 49;
485
+ case 42:
486
+ return 42;
487
+ case 43:
488
+ break;
489
+ case 44:
490
+ return 35;
491
+ case 45:
492
+ return 36;
493
+ }
494
+ }, "anonymous"),
495
+ rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:(\r?\n))/i, /^(?:(\r?\n))/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:\{)/i, /^(?:[^\}]*)/i, /^(?:xychart-beta\b)/i, /^(?:(?:vertical|horizontal))/i, /^(?:x-axis\b)/i, /^(?:y-axis\b)/i, /^(?:\[)/i, /^(?:-->)/i, /^(?:line\b)/i, /^(?:bar\b)/i, /^(?:\[)/i, /^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i, /^(?:\])/i, /^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s+)/i, /^(?:;)/i, /^(?:$)/i],
496
+ conditions: { data_inner: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, data: { rules: [0, 1, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 22, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, axis_band_data: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, axis_data: { rules: [0, 1, 2, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19, 20, 21, 23, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, title: { rules: [], inclusive: !1 }, md_string: { rules: [], inclusive: !1 }, string: { rules: [27, 28], inclusive: !1 }, INITIAL: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 } }
497
+ };
498
+ return B;
499
+ }();
500
+ ct.lexer = ri;
501
+ function st() {
502
+ this.yy = {};
503
+ }
504
+ return a(st, "Parser"), st.prototype = ct, ct.Parser = st, new st();
505
+ }();
506
+ ft.parser = ft;
507
+ var Ri = ft;
508
+ function mt(e) {
509
+ return e.type === "bar";
510
+ }
511
+ a(mt, "isBarPlot");
512
+ function wt(e) {
513
+ return e.type === "band";
514
+ }
515
+ a(wt, "isBandAxisData");
516
+ function F(e) {
517
+ return e.type === "linear";
518
+ }
519
+ a(F, "isLinearAxisData");
520
+ var X, Yt = (X = class {
521
+ constructor(t) {
522
+ this.parentGroup = t;
523
+ }
524
+ getMaxDimension(t, i) {
525
+ if (!this.parentGroup)
526
+ return {
527
+ width: t.reduce((o, u) => Math.max(u.length, o), 0) * i,
528
+ height: i
529
+ };
530
+ const s = {
531
+ width: 0,
532
+ height: 0
533
+ }, n = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", i);
534
+ for (const o of t) {
535
+ const u = ui(n, 1, o), f = u ? u.width : o.length * i, p = u ? u.height : i;
536
+ s.width = Math.max(s.width, f), s.height = Math.max(s.height, p);
537
+ }
538
+ return n.remove(), s;
539
+ }
540
+ }, a(X, "TextDimensionCalculatorWithFont"), X), Ot = 0.7, zt = 0.2, N, Ht = (N = class {
541
+ constructor(t, i, s, n) {
542
+ this.axisConfig = t, this.title = i, this.textDimensionCalculator = s, this.axisThemeConfig = n, this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left", this.showTitle = !1, this.showLabel = !1, this.showTick = !1, this.showAxisLine = !1, this.outerPadding = 0, this.titleTextHeight = 0, this.labelTextHeight = 0, this.range = [0, 10], this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left";
543
+ }
544
+ setRange(t) {
545
+ this.range = t, this.axisPosition === "left" || this.axisPosition === "right" ? this.boundingRect.height = t[1] - t[0] : this.boundingRect.width = t[1] - t[0], this.recalculateScale();
546
+ }
547
+ getRange() {
548
+ return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding];
549
+ }
550
+ setAxisPosition(t) {
551
+ this.axisPosition = t, this.setRange(this.range);
552
+ }
553
+ getTickDistance() {
554
+ const t = this.getRange();
555
+ return Math.abs(t[0] - t[1]) / this.getTickValues().length;
556
+ }
557
+ getAxisOuterPadding() {
558
+ return this.outerPadding;
559
+ }
560
+ getLabelDimension() {
561
+ return this.textDimensionCalculator.getMaxDimension(
562
+ this.getTickValues().map((t) => t.toString()),
563
+ this.axisConfig.labelFontSize
564
+ );
565
+ }
566
+ recalculateOuterPaddingToDrawBar() {
567
+ Ot * this.getTickDistance() > this.outerPadding * 2 && (this.outerPadding = Math.floor(Ot * this.getTickDistance() / 2)), this.recalculateScale();
568
+ }
569
+ calculateSpaceIfDrawnHorizontally(t) {
570
+ let i = t.height;
571
+ if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) {
572
+ const s = this.getLabelDimension(), n = zt * t.width;
573
+ this.outerPadding = Math.min(s.width / 2, n);
574
+ const o = s.height + this.axisConfig.labelPadding * 2;
575
+ this.labelTextHeight = s.height, o <= i && (i -= o, this.showLabel = !0);
576
+ }
577
+ if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) {
578
+ const s = this.textDimensionCalculator.getMaxDimension(
579
+ [this.title],
580
+ this.axisConfig.titleFontSize
581
+ ), n = s.height + this.axisConfig.titlePadding * 2;
582
+ this.titleTextHeight = s.height, n <= i && (i -= n, this.showTitle = !0);
583
+ }
584
+ this.boundingRect.width = t.width, this.boundingRect.height = t.height - i;
585
+ }
586
+ calculateSpaceIfDrawnVertical(t) {
587
+ let i = t.width;
588
+ if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) {
589
+ const s = this.getLabelDimension(), n = zt * t.height;
590
+ this.outerPadding = Math.min(s.height / 2, n);
591
+ const o = s.width + this.axisConfig.labelPadding * 2;
592
+ o <= i && (i -= o, this.showLabel = !0);
593
+ }
594
+ if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) {
595
+ const s = this.textDimensionCalculator.getMaxDimension(
596
+ [this.title],
597
+ this.axisConfig.titleFontSize
598
+ ), n = s.height + this.axisConfig.titlePadding * 2;
599
+ this.titleTextHeight = s.height, n <= i && (i -= n, this.showTitle = !0);
600
+ }
601
+ this.boundingRect.width = t.width - i, this.boundingRect.height = t.height;
602
+ }
603
+ calculateSpace(t) {
604
+ return this.axisPosition === "left" || this.axisPosition === "right" ? this.calculateSpaceIfDrawnVertical(t) : this.calculateSpaceIfDrawnHorizontally(t), this.recalculateScale(), {
605
+ width: this.boundingRect.width,
606
+ height: this.boundingRect.height
607
+ };
608
+ }
609
+ setBoundingBoxXY(t) {
610
+ this.boundingRect.x = t.x, this.boundingRect.y = t.y;
611
+ }
612
+ getDrawableElementsForLeftAxis() {
613
+ const t = [];
614
+ if (this.showAxisLine) {
615
+ const i = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2;
616
+ t.push({
617
+ type: "path",
618
+ groupTexts: ["left-axis", "axisl-line"],
619
+ data: [
620
+ {
621
+ path: `M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y + this.boundingRect.height} `,
622
+ strokeFill: this.axisThemeConfig.axisLineColor,
623
+ strokeWidth: this.axisConfig.axisLineWidth
624
+ }
625
+ ]
626
+ });
627
+ }
628
+ if (this.showLabel && t.push({
629
+ type: "text",
630
+ groupTexts: ["left-axis", "label"],
631
+ data: this.getTickValues().map((i) => ({
632
+ text: i.toString(),
633
+ x: this.boundingRect.x + this.boundingRect.width - (this.showLabel ? this.axisConfig.labelPadding : 0) - (this.showTick ? this.axisConfig.tickLength : 0) - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
634
+ y: this.getScaleValue(i),
635
+ fill: this.axisThemeConfig.labelColor,
636
+ fontSize: this.axisConfig.labelFontSize,
637
+ rotation: 0,
638
+ verticalPos: "middle",
639
+ horizontalPos: "right"
640
+ }))
641
+ }), this.showTick) {
642
+ const i = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
643
+ t.push({
644
+ type: "path",
645
+ groupTexts: ["left-axis", "ticks"],
646
+ data: this.getTickValues().map((s) => ({
647
+ path: `M ${i},${this.getScaleValue(s)} L ${i - this.axisConfig.tickLength},${this.getScaleValue(s)}`,
648
+ strokeFill: this.axisThemeConfig.tickColor,
649
+ strokeWidth: this.axisConfig.tickWidth
650
+ }))
651
+ });
652
+ }
653
+ return this.showTitle && t.push({
654
+ type: "text",
655
+ groupTexts: ["left-axis", "title"],
656
+ data: [
657
+ {
658
+ text: this.title,
659
+ x: this.boundingRect.x + this.axisConfig.titlePadding,
660
+ y: this.boundingRect.y + this.boundingRect.height / 2,
661
+ fill: this.axisThemeConfig.titleColor,
662
+ fontSize: this.axisConfig.titleFontSize,
663
+ rotation: 270,
664
+ verticalPos: "top",
665
+ horizontalPos: "center"
666
+ }
667
+ ]
668
+ }), t;
669
+ }
670
+ getDrawableElementsForBottomAxis() {
671
+ const t = [];
672
+ if (this.showAxisLine) {
673
+ const i = this.boundingRect.y + this.axisConfig.axisLineWidth / 2;
674
+ t.push({
675
+ type: "path",
676
+ groupTexts: ["bottom-axis", "axis-line"],
677
+ data: [
678
+ {
679
+ path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`,
680
+ strokeFill: this.axisThemeConfig.axisLineColor,
681
+ strokeWidth: this.axisConfig.axisLineWidth
682
+ }
683
+ ]
684
+ });
685
+ }
686
+ if (this.showLabel && t.push({
687
+ type: "text",
688
+ groupTexts: ["bottom-axis", "label"],
689
+ data: this.getTickValues().map((i) => ({
690
+ text: i.toString(),
691
+ x: this.getScaleValue(i),
692
+ y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
693
+ fill: this.axisThemeConfig.labelColor,
694
+ fontSize: this.axisConfig.labelFontSize,
695
+ rotation: 0,
696
+ verticalPos: "top",
697
+ horizontalPos: "center"
698
+ }))
699
+ }), this.showTick) {
700
+ const i = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
701
+ t.push({
702
+ type: "path",
703
+ groupTexts: ["bottom-axis", "ticks"],
704
+ data: this.getTickValues().map((s) => ({
705
+ path: `M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i + this.axisConfig.tickLength}`,
706
+ strokeFill: this.axisThemeConfig.tickColor,
707
+ strokeWidth: this.axisConfig.tickWidth
708
+ }))
709
+ });
710
+ }
711
+ return this.showTitle && t.push({
712
+ type: "text",
713
+ groupTexts: ["bottom-axis", "title"],
714
+ data: [
715
+ {
716
+ text: this.title,
717
+ x: this.range[0] + (this.range[1] - this.range[0]) / 2,
718
+ y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight,
719
+ fill: this.axisThemeConfig.titleColor,
720
+ fontSize: this.axisConfig.titleFontSize,
721
+ rotation: 0,
722
+ verticalPos: "top",
723
+ horizontalPos: "center"
724
+ }
725
+ ]
726
+ }), t;
727
+ }
728
+ getDrawableElementsForTopAxis() {
729
+ const t = [];
730
+ if (this.showAxisLine) {
731
+ const i = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2;
732
+ t.push({
733
+ type: "path",
734
+ groupTexts: ["top-axis", "axis-line"],
735
+ data: [
736
+ {
737
+ path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`,
738
+ strokeFill: this.axisThemeConfig.axisLineColor,
739
+ strokeWidth: this.axisConfig.axisLineWidth
740
+ }
741
+ ]
742
+ });
743
+ }
744
+ if (this.showLabel && t.push({
745
+ type: "text",
746
+ groupTexts: ["top-axis", "label"],
747
+ data: this.getTickValues().map((i) => ({
748
+ text: i.toString(),
749
+ x: this.getScaleValue(i),
750
+ y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding,
751
+ fill: this.axisThemeConfig.labelColor,
752
+ fontSize: this.axisConfig.labelFontSize,
753
+ rotation: 0,
754
+ verticalPos: "top",
755
+ horizontalPos: "center"
756
+ }))
757
+ }), this.showTick) {
758
+ const i = this.boundingRect.y;
759
+ t.push({
760
+ type: "path",
761
+ groupTexts: ["top-axis", "ticks"],
762
+ data: this.getTickValues().map((s) => ({
763
+ path: `M ${this.getScaleValue(s)},${i + this.boundingRect.height - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)} L ${this.getScaleValue(s)},${i + this.boundingRect.height - this.axisConfig.tickLength - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)}`,
764
+ strokeFill: this.axisThemeConfig.tickColor,
765
+ strokeWidth: this.axisConfig.tickWidth
766
+ }))
767
+ });
768
+ }
769
+ return this.showTitle && t.push({
770
+ type: "text",
771
+ groupTexts: ["top-axis", "title"],
772
+ data: [
773
+ {
774
+ text: this.title,
775
+ x: this.boundingRect.x + this.boundingRect.width / 2,
776
+ y: this.boundingRect.y + this.axisConfig.titlePadding,
777
+ fill: this.axisThemeConfig.titleColor,
778
+ fontSize: this.axisConfig.titleFontSize,
779
+ rotation: 0,
780
+ verticalPos: "top",
781
+ horizontalPos: "center"
782
+ }
783
+ ]
784
+ }), t;
785
+ }
786
+ getDrawableElements() {
787
+ if (this.axisPosition === "left")
788
+ return this.getDrawableElementsForLeftAxis();
789
+ if (this.axisPosition === "right")
790
+ throw Error("Drawing of right axis is not implemented");
791
+ return this.axisPosition === "bottom" ? this.getDrawableElementsForBottomAxis() : this.axisPosition === "top" ? this.getDrawableElementsForTopAxis() : [];
792
+ }
793
+ }, a(N, "BaseAxis"), N), Y, Ti = (Y = class extends Ht {
794
+ constructor(t, i, s, n, o) {
795
+ super(t, n, o, i), this.categories = s, this.scale = pt().domain(this.categories).range(this.getRange());
796
+ }
797
+ setRange(t) {
798
+ super.setRange(t);
799
+ }
800
+ recalculateScale() {
801
+ this.scale = pt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5), Ft.trace("BandAxis axis final categories, range: ", this.categories, this.getRange());
802
+ }
803
+ getTickValues() {
804
+ return this.categories;
805
+ }
806
+ getScaleValue(t) {
807
+ return this.scale(t) ?? this.getRange()[0];
808
+ }
809
+ }, a(Y, "BandAxis"), Y), H, Di = (H = class extends Ht {
810
+ constructor(t, i, s, n, o) {
811
+ super(t, n, o, i), this.domain = s, this.scale = Wt().domain(this.domain).range(this.getRange());
812
+ }
813
+ getTickValues() {
814
+ return this.scale.ticks();
815
+ }
816
+ recalculateScale() {
817
+ const t = [...this.domain];
818
+ this.axisPosition === "left" && t.reverse(), this.scale = Wt().domain(t).range(this.getRange());
819
+ }
820
+ getScaleValue(t) {
821
+ return this.scale(t);
822
+ }
823
+ }, a(H, "LinearAxis"), H);
824
+ function yt(e, t, i, s) {
825
+ const n = new Yt(s);
826
+ return wt(e) ? new Ti(
827
+ t,
828
+ i,
829
+ e.categories,
830
+ e.title,
831
+ n
832
+ ) : new Di(
833
+ t,
834
+ i,
835
+ [e.min, e.max],
836
+ e.title,
837
+ n
838
+ );
839
+ }
840
+ a(yt, "getAxis");
841
+ var U, vi = (U = class {
842
+ constructor(t, i, s, n) {
843
+ this.textDimensionCalculator = t, this.chartConfig = i, this.chartData = s, this.chartThemeConfig = n, this.boundingRect = {
844
+ x: 0,
845
+ y: 0,
846
+ width: 0,
847
+ height: 0
848
+ }, this.showChartTitle = !1;
849
+ }
850
+ setBoundingBoxXY(t) {
851
+ this.boundingRect.x = t.x, this.boundingRect.y = t.y;
852
+ }
853
+ calculateSpace(t) {
854
+ const i = this.textDimensionCalculator.getMaxDimension(
855
+ [this.chartData.title],
856
+ this.chartConfig.titleFontSize
857
+ ), s = Math.max(i.width, t.width), n = i.height + 2 * this.chartConfig.titlePadding;
858
+ return i.width <= s && i.height <= n && this.chartConfig.showTitle && this.chartData.title && (this.boundingRect.width = s, this.boundingRect.height = n, this.showChartTitle = !0), {
859
+ width: this.boundingRect.width,
860
+ height: this.boundingRect.height
861
+ };
862
+ }
863
+ getDrawableElements() {
864
+ const t = [];
865
+ return this.showChartTitle && t.push({
866
+ groupTexts: ["chart-title"],
867
+ type: "text",
868
+ data: [
869
+ {
870
+ fontSize: this.chartConfig.titleFontSize,
871
+ text: this.chartData.title,
872
+ verticalPos: "middle",
873
+ horizontalPos: "center",
874
+ x: this.boundingRect.x + this.boundingRect.width / 2,
875
+ y: this.boundingRect.y + this.boundingRect.height / 2,
876
+ fill: this.chartThemeConfig.titleColor,
877
+ rotation: 0
878
+ }
879
+ ]
880
+ }), t;
881
+ }
882
+ }, a(U, "ChartTitle"), U);
883
+ function Ut(e, t, i, s) {
884
+ const n = new Yt(s);
885
+ return new vi(n, e, t, i);
886
+ }
887
+ a(Ut, "getChartTitleComponent");
888
+ var $, Pi = ($ = class {
889
+ constructor(t, i, s, n, o) {
890
+ this.plotData = t, this.xAxis = i, this.yAxis = s, this.orientation = n, this.plotIndex = o;
891
+ }
892
+ getDrawableElement() {
893
+ const t = this.plotData.data.map((s) => [
894
+ this.xAxis.getScaleValue(s[0]),
895
+ this.yAxis.getScaleValue(s[1])
896
+ ]);
897
+ let i;
898
+ return this.orientation === "horizontal" ? i = Bt().y((s) => s[0]).x((s) => s[1])(t) : i = Bt().x((s) => s[0]).y((s) => s[1])(t), i ? [
899
+ {
900
+ groupTexts: ["plot", `line-plot-${this.plotIndex}`],
901
+ type: "path",
902
+ data: [
903
+ {
904
+ path: i,
905
+ strokeFill: this.plotData.strokeFill,
906
+ strokeWidth: this.plotData.strokeWidth
907
+ }
908
+ ]
909
+ }
910
+ ] : [];
911
+ }
912
+ }, a($, "LinePlot"), $), q, Li = (q = class {
913
+ constructor(t, i, s, n, o, u) {
914
+ this.barData = t, this.boundingRect = i, this.xAxis = s, this.yAxis = n, this.orientation = o, this.plotIndex = u;
915
+ }
916
+ getDrawableElement() {
917
+ const t = this.barData.data.map((o) => [
918
+ this.xAxis.getScaleValue(o[0]),
919
+ this.yAxis.getScaleValue(o[1])
920
+ ]), s = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * (1 - 0.05), n = s / 2;
921
+ return this.orientation === "horizontal" ? [
922
+ {
923
+ groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
924
+ type: "rect",
925
+ data: t.map((o) => ({
926
+ x: this.boundingRect.x,
927
+ y: o[0] - n,
928
+ height: s,
929
+ width: o[1] - this.boundingRect.x,
930
+ fill: this.barData.fill,
931
+ strokeWidth: 0,
932
+ strokeFill: this.barData.fill
933
+ }))
934
+ }
935
+ ] : [
936
+ {
937
+ groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
938
+ type: "rect",
939
+ data: t.map((o) => ({
940
+ x: o[0] - n,
941
+ y: o[1],
942
+ width: s,
943
+ height: this.boundingRect.y + this.boundingRect.height - o[1],
944
+ fill: this.barData.fill,
945
+ strokeWidth: 0,
946
+ strokeFill: this.barData.fill
947
+ }))
948
+ }
949
+ ];
950
+ }
951
+ }, a(q, "BarPlot"), q), G, Ei = (G = class {
952
+ constructor(t, i, s) {
953
+ this.chartConfig = t, this.chartData = i, this.chartThemeConfig = s, this.boundingRect = {
954
+ x: 0,
955
+ y: 0,
956
+ width: 0,
957
+ height: 0
958
+ };
959
+ }
960
+ setAxes(t, i) {
961
+ this.xAxis = t, this.yAxis = i;
962
+ }
963
+ setBoundingBoxXY(t) {
964
+ this.boundingRect.x = t.x, this.boundingRect.y = t.y;
965
+ }
966
+ calculateSpace(t) {
967
+ return this.boundingRect.width = t.width, this.boundingRect.height = t.height, {
968
+ width: this.boundingRect.width,
969
+ height: this.boundingRect.height
970
+ };
971
+ }
972
+ getDrawableElements() {
973
+ if (!(this.xAxis && this.yAxis))
974
+ throw Error("Axes must be passed to render Plots");
975
+ const t = [];
976
+ for (const [i, s] of this.chartData.plots.entries())
977
+ switch (s.type) {
978
+ case "line":
979
+ {
980
+ const n = new Pi(
981
+ s,
982
+ this.xAxis,
983
+ this.yAxis,
984
+ this.chartConfig.chartOrientation,
985
+ i
986
+ );
987
+ t.push(...n.getDrawableElement());
988
+ }
989
+ break;
990
+ case "bar":
991
+ {
992
+ const n = new Li(
993
+ s,
994
+ this.boundingRect,
995
+ this.xAxis,
996
+ this.yAxis,
997
+ this.chartConfig.chartOrientation,
998
+ i
999
+ );
1000
+ t.push(...n.getDrawableElement());
1001
+ }
1002
+ break;
1003
+ }
1004
+ return t;
1005
+ }
1006
+ }, a(G, "BasePlot"), G);
1007
+ function $t(e, t, i) {
1008
+ return new Ei(e, t, i);
1009
+ }
1010
+ a($t, "getPlotComponent");
1011
+ var j, Ii = (j = class {
1012
+ constructor(t, i, s, n) {
1013
+ this.chartConfig = t, this.chartData = i, this.componentStore = {
1014
+ title: Ut(t, i, s, n),
1015
+ plot: $t(t, i, s),
1016
+ xAxis: yt(
1017
+ i.xAxis,
1018
+ t.xAxis,
1019
+ {
1020
+ titleColor: s.xAxisTitleColor,
1021
+ labelColor: s.xAxisLabelColor,
1022
+ tickColor: s.xAxisTickColor,
1023
+ axisLineColor: s.xAxisLineColor
1024
+ },
1025
+ n
1026
+ ),
1027
+ yAxis: yt(
1028
+ i.yAxis,
1029
+ t.yAxis,
1030
+ {
1031
+ titleColor: s.yAxisTitleColor,
1032
+ labelColor: s.yAxisLabelColor,
1033
+ tickColor: s.yAxisTickColor,
1034
+ axisLineColor: s.yAxisLineColor
1035
+ },
1036
+ n
1037
+ )
1038
+ };
1039
+ }
1040
+ calculateVerticalSpace() {
1041
+ let t = this.chartConfig.width, i = this.chartConfig.height, s = 0, n = 0, o = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), u = Math.floor(
1042
+ i * this.chartConfig.plotReservedSpacePercent / 100
1043
+ ), f = this.componentStore.plot.calculateSpace({
1044
+ width: o,
1045
+ height: u
1046
+ });
1047
+ t -= f.width, i -= f.height, f = this.componentStore.title.calculateSpace({
1048
+ width: this.chartConfig.width,
1049
+ height: i
1050
+ }), n = f.height, i -= f.height, this.componentStore.xAxis.setAxisPosition("bottom"), f = this.componentStore.xAxis.calculateSpace({
1051
+ width: t,
1052
+ height: i
1053
+ }), i -= f.height, this.componentStore.yAxis.setAxisPosition("left"), f = this.componentStore.yAxis.calculateSpace({
1054
+ width: t,
1055
+ height: i
1056
+ }), s = f.width, t -= f.width, t > 0 && (o += t, t = 0), i > 0 && (u += i, i = 0), this.componentStore.plot.calculateSpace({
1057
+ width: o,
1058
+ height: u
1059
+ }), this.componentStore.plot.setBoundingBoxXY({ x: s, y: n }), this.componentStore.xAxis.setRange([s, s + o]), this.componentStore.xAxis.setBoundingBoxXY({ x: s, y: n + u }), this.componentStore.yAxis.setRange([n, n + u]), this.componentStore.yAxis.setBoundingBoxXY({ x: 0, y: n }), this.chartData.plots.some((p) => mt(p)) && this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1060
+ }
1061
+ calculateHorizontalSpace() {
1062
+ let t = this.chartConfig.width, i = this.chartConfig.height, s = 0, n = 0, o = 0, u = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), f = Math.floor(
1063
+ i * this.chartConfig.plotReservedSpacePercent / 100
1064
+ ), p = this.componentStore.plot.calculateSpace({
1065
+ width: u,
1066
+ height: f
1067
+ });
1068
+ t -= p.width, i -= p.height, p = this.componentStore.title.calculateSpace({
1069
+ width: this.chartConfig.width,
1070
+ height: i
1071
+ }), s = p.height, i -= p.height, this.componentStore.xAxis.setAxisPosition("left"), p = this.componentStore.xAxis.calculateSpace({
1072
+ width: t,
1073
+ height: i
1074
+ }), t -= p.width, n = p.width, this.componentStore.yAxis.setAxisPosition("top"), p = this.componentStore.yAxis.calculateSpace({
1075
+ width: t,
1076
+ height: i
1077
+ }), i -= p.height, o = s + p.height, t > 0 && (u += t, t = 0), i > 0 && (f += i, i = 0), this.componentStore.plot.calculateSpace({
1078
+ width: u,
1079
+ height: f
1080
+ }), this.componentStore.plot.setBoundingBoxXY({ x: n, y: o }), this.componentStore.yAxis.setRange([n, n + u]), this.componentStore.yAxis.setBoundingBoxXY({ x: n, y: s }), this.componentStore.xAxis.setRange([o, o + f]), this.componentStore.xAxis.setBoundingBoxXY({ x: 0, y: o }), this.chartData.plots.some((k) => mt(k)) && this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1081
+ }
1082
+ calculateSpace() {
1083
+ this.chartConfig.chartOrientation === "horizontal" ? this.calculateHorizontalSpace() : this.calculateVerticalSpace();
1084
+ }
1085
+ getDrawableElement() {
1086
+ this.calculateSpace();
1087
+ const t = [];
1088
+ this.componentStore.plot.setAxes(this.componentStore.xAxis, this.componentStore.yAxis);
1089
+ for (const i of Object.values(this.componentStore))
1090
+ t.push(...i.getDrawableElements());
1091
+ return t;
1092
+ }
1093
+ }, a(j, "Orchestrator"), j), Q, Mi = (Q = class {
1094
+ static build(t, i, s, n) {
1095
+ return new Ii(t, i, s, n).getDrawableElement();
1096
+ }
1097
+ }, a(Q, "XYChartBuilder"), Q), J = 0, qt, tt = _t(), it = St(), b = kt(), bt = it.plotColorPalette.split(",").map((e) => e.trim()), ot = !1, Ct = !1;
1098
+ function St() {
1099
+ const e = gi(), t = At();
1100
+ return Xt(e.xyChart, t.themeVariables.xyChart);
1101
+ }
1102
+ a(St, "getChartDefaultThemeConfig");
1103
+ function _t() {
1104
+ const e = At();
1105
+ return Xt(
1106
+ xi.xyChart,
1107
+ e.xyChart
1108
+ );
1109
+ }
1110
+ a(_t, "getChartDefaultConfig");
1111
+ function kt() {
1112
+ return {
1113
+ yAxis: {
1114
+ type: "linear",
1115
+ title: "",
1116
+ min: 1 / 0,
1117
+ max: -1 / 0
1118
+ },
1119
+ xAxis: {
1120
+ type: "band",
1121
+ title: "",
1122
+ categories: []
1123
+ },
1124
+ title: "",
1125
+ plots: []
1126
+ };
1127
+ }
1128
+ a(kt, "getChartDefaultData");
1129
+ function ht(e) {
1130
+ const t = At();
1131
+ return di(e.trim(), t);
1132
+ }
1133
+ a(ht, "textSanitizer");
1134
+ function Gt(e) {
1135
+ qt = e;
1136
+ }
1137
+ a(Gt, "setTmpSVGG");
1138
+ function jt(e) {
1139
+ e === "horizontal" ? tt.chartOrientation = "horizontal" : tt.chartOrientation = "vertical";
1140
+ }
1141
+ a(jt, "setOrientation");
1142
+ function Qt(e) {
1143
+ b.xAxis.title = ht(e.text);
1144
+ }
1145
+ a(Qt, "setXAxisTitle");
1146
+ function Rt(e, t) {
1147
+ b.xAxis = { type: "linear", title: b.xAxis.title, min: e, max: t }, ot = !0;
1148
+ }
1149
+ a(Rt, "setXAxisRangeData");
1150
+ function Kt(e) {
1151
+ b.xAxis = {
1152
+ type: "band",
1153
+ title: b.xAxis.title,
1154
+ categories: e.map((t) => ht(t.text))
1155
+ }, ot = !0;
1156
+ }
1157
+ a(Kt, "setXAxisBand");
1158
+ function Zt(e) {
1159
+ b.yAxis.title = ht(e.text);
1160
+ }
1161
+ a(Zt, "setYAxisTitle");
1162
+ function Jt(e, t) {
1163
+ b.yAxis = { type: "linear", title: b.yAxis.title, min: e, max: t }, Ct = !0;
1164
+ }
1165
+ a(Jt, "setYAxisRangeData");
1166
+ function ti(e) {
1167
+ const t = Math.min(...e), i = Math.max(...e), s = F(b.yAxis) ? b.yAxis.min : 1 / 0, n = F(b.yAxis) ? b.yAxis.max : -1 / 0;
1168
+ b.yAxis = {
1169
+ type: "linear",
1170
+ title: b.yAxis.title,
1171
+ min: Math.min(s, t),
1172
+ max: Math.max(n, i)
1173
+ };
1174
+ }
1175
+ a(ti, "setYAxisRangeFromPlotData");
1176
+ function Tt(e) {
1177
+ let t = [];
1178
+ if (e.length === 0)
1179
+ return t;
1180
+ if (!ot) {
1181
+ const i = F(b.xAxis) ? b.xAxis.min : 1 / 0, s = F(b.xAxis) ? b.xAxis.max : -1 / 0;
1182
+ Rt(Math.min(i, 1), Math.max(s, e.length));
1183
+ }
1184
+ if (Ct || ti(e), wt(b.xAxis) && (t = b.xAxis.categories.map((i, s) => [i, e[s]])), F(b.xAxis)) {
1185
+ const i = b.xAxis.min, s = b.xAxis.max, n = (s - i) / (e.length - 1), o = [];
1186
+ for (let u = i; u <= s; u += n)
1187
+ o.push(`${u}`);
1188
+ t = o.map((u, f) => [u, e[f]]);
1189
+ }
1190
+ return t;
1191
+ }
1192
+ a(Tt, "transformDataWithoutCategory");
1193
+ function Dt(e) {
1194
+ return bt[e === 0 ? 0 : e % bt.length];
1195
+ }
1196
+ a(Dt, "getPlotColorFromPalette");
1197
+ function ii(e, t) {
1198
+ const i = Tt(t);
1199
+ b.plots.push({
1200
+ type: "line",
1201
+ strokeFill: Dt(J),
1202
+ strokeWidth: 2,
1203
+ data: i
1204
+ }), J++;
1205
+ }
1206
+ a(ii, "setLineData");
1207
+ function ei(e, t) {
1208
+ const i = Tt(t);
1209
+ b.plots.push({
1210
+ type: "bar",
1211
+ fill: Dt(J),
1212
+ data: i
1213
+ }), J++;
1214
+ }
1215
+ a(ei, "setBarData");
1216
+ function si() {
1217
+ if (b.plots.length === 0)
1218
+ throw Error("No Plot to render, please provide a plot with some data");
1219
+ return b.title = Nt(), Mi.build(tt, b, it, qt);
1220
+ }
1221
+ a(si, "getDrawableElem");
1222
+ function ni() {
1223
+ return it;
1224
+ }
1225
+ a(ni, "getChartThemeConfig");
1226
+ function ai() {
1227
+ return tt;
1228
+ }
1229
+ a(ai, "getChartConfig");
1230
+ var Vi = /* @__PURE__ */ a(function() {
1231
+ Ai(), J = 0, tt = _t(), b = kt(), it = St(), bt = it.plotColorPalette.split(",").map((e) => e.trim()), ot = !1, Ct = !1;
1232
+ }, "clear"), Bi = {
1233
+ getDrawableElem: si,
1234
+ clear: Vi,
1235
+ setAccTitle: pi,
1236
+ getAccTitle: fi,
1237
+ setDiagramTitle: mi,
1238
+ getDiagramTitle: Nt,
1239
+ getAccDescription: yi,
1240
+ setAccDescription: bi,
1241
+ setOrientation: jt,
1242
+ setXAxisTitle: Qt,
1243
+ setXAxisRangeData: Rt,
1244
+ setXAxisBand: Kt,
1245
+ setYAxisTitle: Zt,
1246
+ setYAxisRangeData: Jt,
1247
+ setLineData: ii,
1248
+ setBarData: ei,
1249
+ setTmpSVGG: Gt,
1250
+ getChartThemeConfig: ni,
1251
+ getChartConfig: ai
1252
+ }, Wi = /* @__PURE__ */ a((e, t, i, s) => {
1253
+ const n = s.db, o = n.getChartThemeConfig(), u = n.getChartConfig();
1254
+ function f(m) {
1255
+ return m === "top" ? "text-before-edge" : "middle";
1256
+ }
1257
+ a(f, "getDominantBaseLine");
1258
+ function p(m) {
1259
+ return m === "left" ? "start" : m === "right" ? "end" : "middle";
1260
+ }
1261
+ a(p, "getTextAnchor");
1262
+ function k(m) {
1263
+ return `translate(${m.x}, ${m.y}) rotate(${m.rotation || 0})`;
1264
+ }
1265
+ a(k, "getTextTransformation"), Ft.debug(`Rendering xychart chart
1266
+ ` + e);
1267
+ const R = wi(t), w = R.append("g").attr("class", "main"), y = w.append("rect").attr("width", u.width).attr("height", u.height).attr("class", "background");
1268
+ Ci(R, u.height, u.width, !0), R.attr("viewBox", `0 0 ${u.width} ${u.height}`), y.attr("fill", o.backgroundColor), n.setTmpSVGG(R.append("g").attr("class", "mermaid-tmp-group"));
1269
+ const D = n.getDrawableElem(), S = {};
1270
+ function v(m) {
1271
+ let _ = w, l = "";
1272
+ for (const [E] of m.entries()) {
1273
+ let K = w;
1274
+ E > 0 && S[l] && (K = S[l]), l += m[E], _ = S[l], _ || (_ = S[l] = K.append("g").attr("class", m[E]));
1275
+ }
1276
+ return _;
1277
+ }
1278
+ a(v, "getGroup");
1279
+ for (const m of D) {
1280
+ if (m.data.length === 0)
1281
+ continue;
1282
+ const _ = v(m.groupTexts);
1283
+ switch (m.type) {
1284
+ case "rect":
1285
+ _.selectAll("rect").data(m.data).enter().append("rect").attr("x", (l) => l.x).attr("y", (l) => l.y).attr("width", (l) => l.width).attr("height", (l) => l.height).attr("fill", (l) => l.fill).attr("stroke", (l) => l.strokeFill).attr("stroke-width", (l) => l.strokeWidth);
1286
+ break;
1287
+ case "text":
1288
+ _.selectAll("text").data(m.data).enter().append("text").attr("x", 0).attr("y", 0).attr("fill", (l) => l.fill).attr("font-size", (l) => l.fontSize).attr("dominant-baseline", (l) => f(l.verticalPos)).attr("text-anchor", (l) => p(l.horizontalPos)).attr("transform", (l) => k(l)).text((l) => l.text);
1289
+ break;
1290
+ case "path":
1291
+ _.selectAll("path").data(m.data).enter().append("path").attr("d", (l) => l.path).attr("fill", (l) => l.fill ? l.fill : "none").attr("stroke", (l) => l.strokeFill).attr("stroke-width", (l) => l.strokeWidth);
1292
+ break;
1293
+ }
1294
+ }
1295
+ }, "draw"), Oi = {
1296
+ draw: Wi
1297
+ }, Yi = {
1298
+ parser: Ri,
1299
+ db: Bi,
1300
+ renderer: Oi
1301
+ };
1302
+ export {
1303
+ Yi as diagram
1304
+ };