@schmitech/chatbot-widget 0.5.2 → 0.5.4

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 (47) hide show
  1. package/dist/Tableau10-D7jGxypv-BNlEL2G_.js +9 -0
  2. package/dist/arc-D-ZI5fuh-CvDHBzlN.js +84 -0
  3. package/dist/blockDiagram-c4efeb88-DUnNxfIR-Bhh-x1q6.js +1221 -0
  4. package/dist/c4Diagram-c83219d4-cC4OxfBG-DRTO_jy5.js +1580 -0
  5. package/dist/channel-hcYozyrT-BSOc2Hp-.js +6 -0
  6. package/dist/chatbot-widget.bundle.js +3881 -1586
  7. package/dist/chatbot-widget.css +1 -1
  8. package/dist/chatbot-widget.es.js +12 -63652
  9. package/dist/chatbot-widget.umd.js +3880 -1585
  10. package/dist/classDiagram-beda092f-BLYhf5Mr-vk4Ko58U.js +218 -0
  11. package/dist/classDiagram-v2-2358418a-VBkbF8mr-Ca0l1fEs.js +201 -0
  12. package/dist/clone-BZIkCMuw-B9owNq6E.js +9 -0
  13. package/dist/config/index.d.ts +2 -2
  14. package/dist/createText-1719965b-UejsQ47k-B1DYw0WW.js +2955 -0
  15. package/dist/edges-96097737-1M5QvjOd-BpQVVoQN.js +1088 -0
  16. package/dist/erDiagram-0228fc6a-CjBNxHoC-DXDVlH55.js +929 -0
  17. package/dist/flowDb-c6c81e3f-Q2aoOxdz-DfrfI3H1.js +1127 -0
  18. package/dist/flowDiagram-50d868cf-zizL6ppE-BAH-_juu.js +788 -0
  19. package/dist/flowDiagram-v2-4f6560a1-DVx_vlO5-bkcRE0UW.js +18 -0
  20. package/dist/flowchart-elk-definition-6af322e1-Eyez36go-B_lk3oHt.js +48132 -0
  21. package/dist/ganttDiagram-a2739b55-C82Jv-TO-DoS-s1Yu.js +1743 -0
  22. package/dist/gitGraphDiagram-82fe8481-D9o_9-U8-DJF-ZeR8.js +1265 -0
  23. package/dist/graph-BjmGDpTe-DgbYS1Ie.js +848 -0
  24. package/dist/index-5325376f-CJL5w-Sw-BXp44Ej5.js +374 -0
  25. package/dist/index-s6Yb6o1D.js +116386 -0
  26. package/dist/infoDiagram-8eee0895-FpS-TLK_-BnvO_wUe.js +320 -0
  27. package/dist/journeyDiagram-c64418c1-CMj1efQ9-CshcRDhm.js +802 -0
  28. package/dist/layout-D_6hdlf3-B7guhEBN.js +1470 -0
  29. package/dist/mindmap-definition-8da855dc-D4SxHjUd-jFZFomnk.js +21924 -0
  30. package/dist/pieDiagram-a8764435-BF5ZqOjB-Mqzg2J4Q.js +498 -0
  31. package/dist/quadrantDiagram-1e28029f-GtQb80VU-DCy1QjzW.js +903 -0
  32. package/dist/requirementDiagram-08caed73-CHtPj3FO-AHEP0cIt.js +767 -0
  33. package/dist/sankeyDiagram-a04cb91d-CBlXzOgd-CWJTc5AX.js +802 -0
  34. package/dist/sequenceDiagram-c5b8d532-Cs1iyw97-oayOJE8v.js +2235 -0
  35. package/dist/shared/styles.d.ts +1 -1
  36. package/dist/stateDiagram-1ecb1508-CpRKICMQ-C5OFJeRZ.js +266 -0
  37. package/dist/stateDiagram-v2-c2b004d7-BtkhFyQ5-DxzE8Je5.js +185 -0
  38. package/dist/styles-b4e223ce-D0oeHeKH-BmNvk4NR.js +1090 -0
  39. package/dist/styles-ca3715f6-BouNgl-L-_qXsPDP3.js +961 -0
  40. package/dist/styles-d45a18b0-Cvhb8Ltu-43I3Cd_I.js +437 -0
  41. package/dist/svgDrawCommon-b86b1483-mg-1NjZY-DrmnILcc.js +65 -0
  42. package/dist/timeline-definition-faaaa080-3olbep_P-BqKpgsPZ.js +793 -0
  43. package/dist/ui/Message.d.ts +1 -5
  44. package/dist/ui/MessagesList.d.ts +1 -5
  45. package/dist/xychartDiagram-f5964ef8-BN6HXpmW-C-g_F1w2.js +1238 -0
  46. package/package.json +3 -3
  47. package/dist/ui/TypingEffect.d.ts +0 -18
@@ -0,0 +1,498 @@
1
+ import { v as st, y as rt, b as at, a as lt, w as ot, x as ct, O as tt, g as et, ab as ht, aa as ut, ac as yt, ad as pt, W as ft, q as gt, m as dt, ae as mt, af as M, ag as _t, ah as q } from "./index-s6Yb6o1D.js";
2
+ import { h as H } from "./arc-D-ZI5fuh-CvDHBzlN.js";
3
+ typeof window < "u" && (window.global = window);
4
+ function bt(e, h) {
5
+ return h < e ? -1 : h > e ? 1 : h >= e ? 0 : NaN;
6
+ }
7
+ function vt(e) {
8
+ return e;
9
+ }
10
+ function kt() {
11
+ var e = vt, h = bt, p = null, $ = M(0), x = M(q), S = M(0);
12
+ function u(r) {
13
+ var l, d = (r = _t(r)).length, b, I, T = 0, m = new Array(d), v = new Array(d), o = +$.apply(this, arguments), A = Math.min(q, Math.max(-q, x.apply(this, arguments) - o)), D, E = Math.min(Math.abs(A) / d, S.apply(this, arguments)), g = E * (A < 0 ? -1 : 1), t;
14
+ for (l = 0; l < d; ++l)
15
+ (t = v[m[l] = l] = +e(r[l], l, r)) > 0 && (T += t);
16
+ for (h != null ? m.sort(function(i, s) {
17
+ return h(v[i], v[s]);
18
+ }) : p != null && m.sort(function(i, s) {
19
+ return p(r[i], r[s]);
20
+ }), l = 0, I = T ? (A - d * g) / T : 0; l < d; ++l, o = D)
21
+ b = m[l], t = v[b], D = o + (t > 0 ? t * I : 0) + g, v[b] = {
22
+ data: r[b],
23
+ index: l,
24
+ value: t,
25
+ startAngle: o,
26
+ endAngle: D,
27
+ padAngle: E
28
+ };
29
+ return v;
30
+ }
31
+ return u.value = function(r) {
32
+ return arguments.length ? (e = typeof r == "function" ? r : M(+r), u) : e;
33
+ }, u.sortValues = function(r) {
34
+ return arguments.length ? (h = r, p = null, u) : h;
35
+ }, u.sort = function(r) {
36
+ return arguments.length ? (p = r, h = null, u) : p;
37
+ }, u.startAngle = function(r) {
38
+ return arguments.length ? ($ = typeof r == "function" ? r : M(+r), u) : $;
39
+ }, u.endAngle = function(r) {
40
+ return arguments.length ? (x = typeof r == "function" ? r : M(+r), u) : x;
41
+ }, u.padAngle = function(r) {
42
+ return arguments.length ? (S = typeof r == "function" ? r : M(+r), u) : S;
43
+ }, u;
44
+ }
45
+ var J = function() {
46
+ var e = function(g, t, i, s) {
47
+ for (i = i || {}, s = g.length; s--; i[g[s]] = t)
48
+ ;
49
+ return i;
50
+ }, h = [1, 3], p = [1, 4], $ = [1, 5], x = [1, 6], S = [1, 10, 12, 14, 16, 18, 19, 20, 21, 22], u = [2, 4], r = [1, 5, 10, 12, 14, 16, 18, 19, 20, 21, 22], l = [20, 21, 22], d = [2, 7], b = [1, 12], I = [1, 13], T = [1, 14], m = [1, 15], v = [1, 16], o = [1, 17], A = {
51
+ trace: function() {
52
+ },
53
+ yy: {},
54
+ symbols_: { error: 2, start: 3, eol: 4, PIE: 5, document: 6, showData: 7, line: 8, statement: 9, txt: 10, value: 11, title: 12, title_value: 13, acc_title: 14, acc_title_value: 15, acc_descr: 16, acc_descr_value: 17, acc_descr_multiline_value: 18, section: 19, NEWLINE: 20, ";": 21, EOF: 22, $accept: 0, $end: 1 },
55
+ terminals_: { 2: "error", 5: "PIE", 7: "showData", 10: "txt", 11: "value", 12: "title", 13: "title_value", 14: "acc_title", 15: "acc_title_value", 16: "acc_descr", 17: "acc_descr_value", 18: "acc_descr_multiline_value", 19: "section", 20: "NEWLINE", 21: ";", 22: "EOF" },
56
+ productions_: [0, [3, 2], [3, 2], [3, 3], [6, 0], [6, 2], [8, 2], [9, 0], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [4, 1], [4, 1], [4, 1]],
57
+ performAction: function(g, t, i, s, a, n, y) {
58
+ var k = n.length - 1;
59
+ switch (a) {
60
+ case 3:
61
+ s.setShowData(!0);
62
+ break;
63
+ case 6:
64
+ this.$ = n[k - 1];
65
+ break;
66
+ case 8:
67
+ s.addSection(n[k - 1], s.cleanupValue(n[k]));
68
+ break;
69
+ case 9:
70
+ this.$ = n[k].trim(), s.setDiagramTitle(this.$);
71
+ break;
72
+ case 10:
73
+ this.$ = n[k].trim(), s.setAccTitle(this.$);
74
+ break;
75
+ case 11:
76
+ case 12:
77
+ this.$ = n[k].trim(), s.setAccDescription(this.$);
78
+ break;
79
+ case 13:
80
+ s.addSection(n[k].substr(8)), this.$ = n[k].substr(8);
81
+ break;
82
+ }
83
+ },
84
+ table: [{ 3: 1, 4: 2, 5: h, 20: p, 21: $, 22: x }, { 1: [3] }, { 3: 7, 4: 2, 5: h, 20: p, 21: $, 22: x }, e(S, u, { 6: 8, 7: [1, 9] }), e(r, [2, 14]), e(r, [2, 15]), e(r, [2, 16]), { 1: [2, 1] }, e(l, d, { 8: 10, 9: 11, 1: [2, 2], 10: b, 12: I, 14: T, 16: m, 18: v, 19: o }), e(S, u, { 6: 18 }), e(S, [2, 5]), { 4: 19, 20: p, 21: $, 22: x }, { 11: [1, 20] }, { 13: [1, 21] }, { 15: [1, 22] }, { 17: [1, 23] }, e(l, [2, 12]), e(l, [2, 13]), e(l, d, { 8: 10, 9: 11, 1: [2, 3], 10: b, 12: I, 14: T, 16: m, 18: v, 19: o }), e(S, [2, 6]), e(l, [2, 8]), e(l, [2, 9]), e(l, [2, 10]), e(l, [2, 11])],
85
+ defaultActions: { 7: [2, 1] },
86
+ parseError: function(g, t) {
87
+ if (t.recoverable)
88
+ this.trace(g);
89
+ else {
90
+ var i = new Error(g);
91
+ throw i.hash = t, i;
92
+ }
93
+ },
94
+ parse: function(g) {
95
+ var t = this, i = [0], s = [], a = [null], n = [], y = this.table, k = "", N = 0, f = 0, j = 2, R = 1, U = n.slice.call(arguments, 1), c = Object.create(this.lexer), O = { yy: {} };
96
+ for (var K in this.yy)
97
+ Object.prototype.hasOwnProperty.call(this.yy, K) && (O.yy[K] = this.yy[K]);
98
+ c.setInput(g, O.yy), O.yy.lexer = c, O.yy.parser = this, typeof c.yylloc > "u" && (c.yylloc = {});
99
+ var G = c.yylloc;
100
+ n.push(G);
101
+ var it = c.options && c.options.ranges;
102
+ typeof O.yy.parseError == "function" ? this.parseError = O.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
103
+ function nt() {
104
+ var C;
105
+ return C = s.pop() || c.lex() || R, typeof C != "number" && (C instanceof Array && (s = C, C = s.pop()), C = t.symbols_[C] || C), C;
106
+ }
107
+ for (var _, L, w, Q, V = {}, z, P, Y, W; ; ) {
108
+ if (L = i[i.length - 1], this.defaultActions[L] ? w = this.defaultActions[L] : ((_ === null || typeof _ > "u") && (_ = nt()), w = y[L] && y[L][_]), typeof w > "u" || !w.length || !w[0]) {
109
+ var Z = "";
110
+ W = [];
111
+ for (z in y[L])
112
+ this.terminals_[z] && z > j && W.push("'" + this.terminals_[z] + "'");
113
+ c.showPosition ? Z = "Parse error on line " + (N + 1) + `:
114
+ ` + c.showPosition() + `
115
+ Expecting ` + W.join(", ") + ", got '" + (this.terminals_[_] || _) + "'" : Z = "Parse error on line " + (N + 1) + ": Unexpected " + (_ == R ? "end of input" : "'" + (this.terminals_[_] || _) + "'"), this.parseError(Z, {
116
+ text: c.match,
117
+ token: this.terminals_[_] || _,
118
+ line: c.yylineno,
119
+ loc: G,
120
+ expected: W
121
+ });
122
+ }
123
+ if (w[0] instanceof Array && w.length > 1)
124
+ throw new Error("Parse Error: multiple actions possible at state: " + L + ", token: " + _);
125
+ switch (w[0]) {
126
+ case 1:
127
+ i.push(_), a.push(c.yytext), n.push(c.yylloc), i.push(w[1]), _ = null, f = c.yyleng, k = c.yytext, N = c.yylineno, G = c.yylloc;
128
+ break;
129
+ case 2:
130
+ if (P = this.productions_[w[1]][1], V.$ = a[a.length - P], V._$ = {
131
+ first_line: n[n.length - (P || 1)].first_line,
132
+ last_line: n[n.length - 1].last_line,
133
+ first_column: n[n.length - (P || 1)].first_column,
134
+ last_column: n[n.length - 1].last_column
135
+ }, it && (V._$.range = [
136
+ n[n.length - (P || 1)].range[0],
137
+ n[n.length - 1].range[1]
138
+ ]), Q = this.performAction.apply(V, [
139
+ k,
140
+ f,
141
+ N,
142
+ O.yy,
143
+ w[1],
144
+ a,
145
+ n
146
+ ].concat(U)), typeof Q < "u")
147
+ return Q;
148
+ P && (i = i.slice(0, -1 * P * 2), a = a.slice(0, -1 * P), n = n.slice(0, -1 * P)), i.push(this.productions_[w[1]][0]), a.push(V.$), n.push(V._$), Y = y[i[i.length - 2]][i[i.length - 1]], i.push(Y);
149
+ break;
150
+ case 3:
151
+ return !0;
152
+ }
153
+ }
154
+ return !0;
155
+ }
156
+ }, D = /* @__PURE__ */ function() {
157
+ var g = {
158
+ EOF: 1,
159
+ parseError: function(t, i) {
160
+ if (this.yy.parser)
161
+ this.yy.parser.parseError(t, i);
162
+ else
163
+ throw new Error(t);
164
+ },
165
+ // resets the lexer, sets new input
166
+ setInput: function(t, i) {
167
+ return this.yy = i || this.yy || {}, this._input = t, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
168
+ first_line: 1,
169
+ first_column: 0,
170
+ last_line: 1,
171
+ last_column: 0
172
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
173
+ },
174
+ // consumes and returns one char from the input
175
+ input: function() {
176
+ var t = this._input[0];
177
+ this.yytext += t, this.yyleng++, this.offset++, this.match += t, this.matched += t;
178
+ var i = t.match(/(?:\r\n?|\n).*/g);
179
+ return i ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), t;
180
+ },
181
+ // unshifts one char (or a string) into the input
182
+ unput: function(t) {
183
+ var i = t.length, s = t.split(/(?:\r\n?|\n)/g);
184
+ this._input = t + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - i), this.offset -= i;
185
+ var a = this.match.split(/(?:\r\n?|\n)/g);
186
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), s.length - 1 && (this.yylineno -= s.length - 1);
187
+ var n = this.yylloc.range;
188
+ return this.yylloc = {
189
+ first_line: this.yylloc.first_line,
190
+ last_line: this.yylineno + 1,
191
+ first_column: this.yylloc.first_column,
192
+ last_column: s ? (s.length === a.length ? this.yylloc.first_column : 0) + a[a.length - s.length].length - s[0].length : this.yylloc.first_column - i
193
+ }, this.options.ranges && (this.yylloc.range = [n[0], n[0] + this.yyleng - i]), this.yyleng = this.yytext.length, this;
194
+ },
195
+ // When called from action, caches matched text and appends it on next action
196
+ more: function() {
197
+ return this._more = !0, this;
198
+ },
199
+ // 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.
200
+ reject: function() {
201
+ if (this.options.backtrack_lexer)
202
+ this._backtrack = !0;
203
+ else
204
+ 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).
205
+ ` + this.showPosition(), {
206
+ text: "",
207
+ token: null,
208
+ line: this.yylineno
209
+ });
210
+ return this;
211
+ },
212
+ // retain first n characters of the match
213
+ less: function(t) {
214
+ this.unput(this.match.slice(t));
215
+ },
216
+ // displays already matched input, i.e. for error messages
217
+ pastInput: function() {
218
+ var t = this.matched.substr(0, this.matched.length - this.match.length);
219
+ return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, "");
220
+ },
221
+ // displays upcoming input, i.e. for error messages
222
+ upcomingInput: function() {
223
+ var t = this.match;
224
+ return t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "");
225
+ },
226
+ // displays the character position where the lexing error occurred, i.e. for error messages
227
+ showPosition: function() {
228
+ var t = this.pastInput(), i = new Array(t.length + 1).join("-");
229
+ return t + this.upcomingInput() + `
230
+ ` + i + "^";
231
+ },
232
+ // test the lexed token: return FALSE when not a match, otherwise return token
233
+ test_match: function(t, i) {
234
+ var s, a, n;
235
+ if (this.options.backtrack_lexer && (n = {
236
+ yylineno: this.yylineno,
237
+ yylloc: {
238
+ first_line: this.yylloc.first_line,
239
+ last_line: this.last_line,
240
+ first_column: this.yylloc.first_column,
241
+ last_column: this.yylloc.last_column
242
+ },
243
+ yytext: this.yytext,
244
+ match: this.match,
245
+ matches: this.matches,
246
+ matched: this.matched,
247
+ yyleng: this.yyleng,
248
+ offset: this.offset,
249
+ _more: this._more,
250
+ _input: this._input,
251
+ yy: this.yy,
252
+ conditionStack: this.conditionStack.slice(0),
253
+ done: this.done
254
+ }, this.options.ranges && (n.yylloc.range = this.yylloc.range.slice(0))), a = t[0].match(/(?:\r\n?|\n).*/g), a && (this.yylineno += a.length), this.yylloc = {
255
+ first_line: this.yylloc.last_line,
256
+ last_line: this.yylineno + 1,
257
+ first_column: this.yylloc.last_column,
258
+ last_column: a ? a[a.length - 1].length - a[a.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length
259
+ }, this.yytext += t[0], this.match += t[0], this.matches = t, 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(t[0].length), this.matched += t[0], s = this.performAction.call(this, this.yy, this, i, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), s)
260
+ return s;
261
+ if (this._backtrack) {
262
+ for (var y in n)
263
+ this[y] = n[y];
264
+ return !1;
265
+ }
266
+ return !1;
267
+ },
268
+ // return next match in input
269
+ next: function() {
270
+ if (this.done)
271
+ return this.EOF;
272
+ this._input || (this.done = !0);
273
+ var t, i, s, a;
274
+ this._more || (this.yytext = "", this.match = "");
275
+ for (var n = this._currentRules(), y = 0; y < n.length; y++)
276
+ if (s = this._input.match(this.rules[n[y]]), s && (!i || s[0].length > i[0].length)) {
277
+ if (i = s, a = y, this.options.backtrack_lexer) {
278
+ if (t = this.test_match(s, n[y]), t !== !1)
279
+ return t;
280
+ if (this._backtrack) {
281
+ i = !1;
282
+ continue;
283
+ } else
284
+ return !1;
285
+ } else if (!this.options.flex)
286
+ break;
287
+ }
288
+ return i ? (t = this.test_match(i, n[a]), t !== !1 ? t : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
289
+ ` + this.showPosition(), {
290
+ text: "",
291
+ token: null,
292
+ line: this.yylineno
293
+ });
294
+ },
295
+ // return next match that has a token
296
+ lex: function() {
297
+ var t = this.next();
298
+ return t || this.lex();
299
+ },
300
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
301
+ begin: function(t) {
302
+ this.conditionStack.push(t);
303
+ },
304
+ // pop the previously active lexer condition state off the condition stack
305
+ popState: function() {
306
+ var t = this.conditionStack.length - 1;
307
+ return t > 0 ? this.conditionStack.pop() : this.conditionStack[0];
308
+ },
309
+ // produce the lexer rule set which is active for the currently active lexer condition state
310
+ _currentRules: function() {
311
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
312
+ },
313
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
314
+ topState: function(t) {
315
+ return t = this.conditionStack.length - 1 - Math.abs(t || 0), t >= 0 ? this.conditionStack[t] : "INITIAL";
316
+ },
317
+ // alias for begin(condition)
318
+ pushState: function(t) {
319
+ this.begin(t);
320
+ },
321
+ // return the number of states currently on the stack
322
+ stateStackSize: function() {
323
+ return this.conditionStack.length;
324
+ },
325
+ options: { "case-insensitive": !0 },
326
+ performAction: function(t, i, s, a) {
327
+ switch (s) {
328
+ case 0:
329
+ break;
330
+ case 1:
331
+ break;
332
+ case 2:
333
+ return 20;
334
+ case 3:
335
+ break;
336
+ case 4:
337
+ break;
338
+ case 5:
339
+ return this.begin("title"), 12;
340
+ case 6:
341
+ return this.popState(), "title_value";
342
+ case 7:
343
+ return this.begin("acc_title"), 14;
344
+ case 8:
345
+ return this.popState(), "acc_title_value";
346
+ case 9:
347
+ return this.begin("acc_descr"), 16;
348
+ case 10:
349
+ return this.popState(), "acc_descr_value";
350
+ case 11:
351
+ this.begin("acc_descr_multiline");
352
+ break;
353
+ case 12:
354
+ this.popState();
355
+ break;
356
+ case 13:
357
+ return "acc_descr_multiline_value";
358
+ case 14:
359
+ this.begin("string");
360
+ break;
361
+ case 15:
362
+ this.popState();
363
+ break;
364
+ case 16:
365
+ return "txt";
366
+ case 17:
367
+ return 5;
368
+ case 18:
369
+ return 7;
370
+ case 19:
371
+ return "value";
372
+ case 20:
373
+ return 22;
374
+ }
375
+ },
376
+ rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:[\s]+)/i, /^(?:title\b)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:pie\b)/i, /^(?:showData\b)/i, /^(?::[\s]*[\d]+(?:\.[\d]+)?)/i, /^(?:$)/i],
377
+ conditions: { acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, title: { rules: [6], inclusive: !1 }, string: { rules: [15, 16], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 7, 9, 11, 14, 17, 18, 19, 20], inclusive: !0 } }
378
+ };
379
+ return g;
380
+ }();
381
+ A.lexer = D;
382
+ function E() {
383
+ this.yy = {};
384
+ }
385
+ return E.prototype = A, A.Parser = E, new E();
386
+ }();
387
+ J.parser = J;
388
+ const xt = J, wt = mt.pie, B = {
389
+ sections: {},
390
+ showData: !1
391
+ };
392
+ let F = B.sections, X = B.showData;
393
+ const $t = structuredClone(wt), St = () => structuredClone($t), At = () => {
394
+ F = structuredClone(B.sections), X = B.showData, dt();
395
+ }, Et = (e, h) => {
396
+ e = gt(e, et()), F[e] === void 0 && (F[e] = h, tt.debug(`added new section: ${e}, with value: ${h}`));
397
+ }, Tt = () => F, It = (e) => (e.substring(0, 1) === ":" && (e = e.substring(1).trim()), Number(e.trim())), Ot = (e) => {
398
+ X = e;
399
+ }, Pt = () => X, Ct = {
400
+ getConfig: St,
401
+ clear: At,
402
+ setDiagramTitle: ct,
403
+ getDiagramTitle: ot,
404
+ setAccTitle: lt,
405
+ getAccTitle: at,
406
+ setAccDescription: rt,
407
+ getAccDescription: st,
408
+ addSection: Et,
409
+ getSections: Tt,
410
+ cleanupValue: It,
411
+ setShowData: Ot,
412
+ getShowData: Pt
413
+ }, Dt = (e) => `
414
+ .pieCircle{
415
+ stroke: ${e.pieStrokeColor};
416
+ stroke-width : ${e.pieStrokeWidth};
417
+ opacity : ${e.pieOpacity};
418
+ }
419
+ .pieOuterCircle{
420
+ stroke: ${e.pieOuterStrokeColor};
421
+ stroke-width: ${e.pieOuterStrokeWidth};
422
+ fill: none;
423
+ }
424
+ .pieTitleText {
425
+ text-anchor: middle;
426
+ font-size: ${e.pieTitleTextSize};
427
+ fill: ${e.pieTitleTextColor};
428
+ font-family: ${e.fontFamily};
429
+ }
430
+ .slice {
431
+ font-family: ${e.fontFamily};
432
+ fill: ${e.pieSectionTextColor};
433
+ font-size:${e.pieSectionTextSize};
434
+ // fill: white;
435
+ }
436
+ .legend text {
437
+ fill: ${e.pieLegendTextColor};
438
+ font-family: ${e.fontFamily};
439
+ font-size: ${e.pieLegendTextSize};
440
+ }
441
+ `, Nt = Dt, Rt = (e) => {
442
+ const h = Object.entries(e).map((p) => ({
443
+ label: p[0],
444
+ value: p[1]
445
+ })).sort((p, $) => $.value - p.value);
446
+ return kt().value(
447
+ (p) => p.value
448
+ )(h);
449
+ }, Lt = (e, h, p, $) => {
450
+ tt.debug(`rendering pie chart
451
+ ` + e);
452
+ const x = $.db, S = et(), u = ht(x.getConfig(), S.pie), r = 40, l = 18, d = 4, b = 450, I = b, T = ut(h), m = T.append("g"), v = x.getSections();
453
+ m.attr("transform", "translate(" + I / 2 + "," + b / 2 + ")");
454
+ const { themeVariables: o } = S;
455
+ let [A] = yt(o.pieOuterStrokeWidth);
456
+ A ?? (A = 2);
457
+ const D = u.textPosition, E = Math.min(I, b) / 2 - r, g = H().innerRadius(0).outerRadius(E), t = H().innerRadius(E * D).outerRadius(E * D);
458
+ m.append("circle").attr("cx", 0).attr("cy", 0).attr("r", E + A / 2).attr("class", "pieOuterCircle");
459
+ const i = Rt(v), s = [
460
+ o.pie1,
461
+ o.pie2,
462
+ o.pie3,
463
+ o.pie4,
464
+ o.pie5,
465
+ o.pie6,
466
+ o.pie7,
467
+ o.pie8,
468
+ o.pie9,
469
+ o.pie10,
470
+ o.pie11,
471
+ o.pie12
472
+ ], a = pt(s);
473
+ m.selectAll("mySlices").data(i).enter().append("path").attr("d", g).attr("fill", (f) => a(f.data.label)).attr("class", "pieCircle");
474
+ let n = 0;
475
+ Object.keys(v).forEach((f) => {
476
+ n += v[f];
477
+ }), m.selectAll("mySlices").data(i).enter().append("text").text((f) => (f.data.value / n * 100).toFixed(0) + "%").attr("transform", (f) => "translate(" + t.centroid(f) + ")").style("text-anchor", "middle").attr("class", "slice"), m.append("text").text(x.getDiagramTitle()).attr("x", 0).attr("y", -400 / 2).attr("class", "pieTitleText");
478
+ const y = m.selectAll(".legend").data(a.domain()).enter().append("g").attr("class", "legend").attr("transform", (f, j) => {
479
+ const R = l + d, U = R * a.domain().length / 2, c = 12 * l, O = j * R - U;
480
+ return "translate(" + c + "," + O + ")";
481
+ });
482
+ y.append("rect").attr("width", l).attr("height", l).style("fill", a).style("stroke", a), y.data(i).append("text").attr("x", l + d).attr("y", l - d).text((f) => {
483
+ const { label: j, value: R } = f.data;
484
+ return x.getShowData() ? `${j} [${R}]` : j;
485
+ });
486
+ const k = Math.max(
487
+ ...y.selectAll("text").nodes().map((f) => (f == null ? void 0 : f.getBoundingClientRect().width) ?? 0)
488
+ ), N = I + r + l + d + k;
489
+ T.attr("viewBox", `0 0 ${N} ${b}`), ft(T, b, N, u.useMaxWidth);
490
+ }, Mt = { draw: Lt }, zt = {
491
+ parser: xt,
492
+ db: Ct,
493
+ renderer: Mt,
494
+ styles: Nt
495
+ };
496
+ export {
497
+ zt as diagram
498
+ };