smart-chat-asp 2.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +364 -0
  2. package/README.zh.md +367 -0
  3. package/lib/Tableau10-2ff7471d.mjs +9 -0
  4. package/lib/arc-33fcfaff.mjs +86 -0
  5. package/lib/array-2ff2c7a6.mjs +6 -0
  6. package/lib/blockDiagram-38ab4fdb-3c912e88.mjs +1230 -0
  7. package/lib/c4Diagram-3d4e48cf-49908d37.mjs +1580 -0
  8. package/lib/channel-890a888a.mjs +5 -0
  9. package/lib/classDiagram-70f12bd4-ace7b178.mjs +221 -0
  10. package/lib/classDiagram-v2-f2320105-5848085d.mjs +207 -0
  11. package/lib/clone-59a3b16a.mjs +8 -0
  12. package/lib/createText-2e5e7dd3-898a4de3.mjs +2966 -0
  13. package/lib/edges-e0da2a9e-91b210e9.mjs +1083 -0
  14. package/lib/erDiagram-9861fffd-c13b7611.mjs +933 -0
  15. package/lib/favicon.ico +0 -0
  16. package/lib/favicon.svg +1 -0
  17. package/lib/flowDb-956e92f1-56fdcb20.mjs +1126 -0
  18. package/lib/flowDiagram-66a62f08-4023035a.mjs +798 -0
  19. package/lib/flowDiagram-v2-96b9c2cf-d28d8b17.mjs +26 -0
  20. package/lib/flowchart-elk-definition-4a651766-ab5b1391.mjs +48407 -0
  21. package/lib/ganttDiagram-c361ad54-ae59a5e3.mjs +2504 -0
  22. package/lib/gitGraphDiagram-72cf32ee-5bdf46bb.mjs +1265 -0
  23. package/lib/graph-9ea4e80a.mjs +512 -0
  24. package/lib/index-3862675e-b7177fa1.mjs +373 -0
  25. package/lib/index-958a220b.mjs +1470 -0
  26. package/lib/index-c42b0ff4.mjs +40 -0
  27. package/lib/index-f76d9453.mjs +28 -0
  28. package/lib/infoDiagram-f8f76790-5f3835f9.mjs +320 -0
  29. package/lib/init-f9637058.mjs +16 -0
  30. package/lib/journeyDiagram-49397b02-df06b21d.mjs +805 -0
  31. package/lib/layout-d3bc02b9.mjs +1495 -0
  32. package/lib/line-b044df13.mjs +34 -0
  33. package/lib/linear-e60140ad.mjs +447 -0
  34. package/lib/main-740da2e1.mjs +117801 -0
  35. package/lib/mindmap-definition-fc14e90a-3bfaf2a6.mjs +19384 -0
  36. package/lib/ordinal-980380c7.mjs +65 -0
  37. package/lib/path-428ebac9.mjs +91 -0
  38. package/lib/pieDiagram-8a3498a8-a8359c54.mjs +503 -0
  39. package/lib/pwa-192x192.png +0 -0
  40. package/lib/pwa-512x512.png +0 -0
  41. package/lib/quadrantDiagram-120e2f19-367eeae7.mjs +905 -0
  42. package/lib/requirementDiagram-deff3bca-27d1e96b.mjs +770 -0
  43. package/lib/sankeyDiagram-04a897e0-a9e993ee.mjs +818 -0
  44. package/lib/sequenceDiagram-704730f1-05f9d7b1.mjs +2235 -0
  45. package/lib/smart-chat.es.js +5 -0
  46. package/lib/smart-chat.umd.js +5444 -0
  47. package/lib/stateDiagram-587899a1-f3e4a81e.mjs +269 -0
  48. package/lib/stateDiagram-v2-d93cdb3a-763ad0ff.mjs +191 -0
  49. package/lib/style.css +1 -0
  50. package/lib/styles-6aaf32cf-e32ec570.mjs +960 -0
  51. package/lib/styles-9a916d00-18b5fd0d.mjs +1089 -0
  52. package/lib/styles-c10674c1-134300a0.mjs +433 -0
  53. package/lib/svgDrawCommon-08f97a94-f04d54dc.mjs +64 -0
  54. package/lib/timeline-definition-85554ec2-1989252c.mjs +796 -0
  55. package/lib/xychartDiagram-e933f94c-f7d5a550.mjs +1285 -0
  56. package/license +21 -0
  57. package/package.json +79 -0
@@ -0,0 +1,65 @@
1
+ import { i as a } from "./init-f9637058.mjs";
2
+ class o extends Map {
3
+ constructor(n, t = g) {
4
+ if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: t } }), n != null)
5
+ for (const [r, s] of n)
6
+ this.set(r, s);
7
+ }
8
+ get(n) {
9
+ return super.get(c(this, n));
10
+ }
11
+ has(n) {
12
+ return super.has(c(this, n));
13
+ }
14
+ set(n, t) {
15
+ return super.set(l(this, n), t);
16
+ }
17
+ delete(n) {
18
+ return super.delete(p(this, n));
19
+ }
20
+ }
21
+ function c({ _intern: e, _key: n }, t) {
22
+ const r = n(t);
23
+ return e.has(r) ? e.get(r) : t;
24
+ }
25
+ function l({ _intern: e, _key: n }, t) {
26
+ const r = n(t);
27
+ return e.has(r) ? e.get(r) : (e.set(r, t), t);
28
+ }
29
+ function p({ _intern: e, _key: n }, t) {
30
+ const r = n(t);
31
+ return e.has(r) && (t = e.get(r), e.delete(r)), t;
32
+ }
33
+ function g(e) {
34
+ return e !== null && typeof e == "object" ? e.valueOf() : e;
35
+ }
36
+ const f = Symbol("implicit");
37
+ function h() {
38
+ var e = new o(), n = [], t = [], r = f;
39
+ function s(u) {
40
+ let i = e.get(u);
41
+ if (i === void 0) {
42
+ if (r !== f)
43
+ return r;
44
+ e.set(u, i = n.push(u) - 1);
45
+ }
46
+ return t[i % t.length];
47
+ }
48
+ return s.domain = function(u) {
49
+ if (!arguments.length)
50
+ return n.slice();
51
+ n = [], e = new o();
52
+ for (const i of u)
53
+ e.has(i) || e.set(i, n.push(i) - 1);
54
+ return s;
55
+ }, s.range = function(u) {
56
+ return arguments.length ? (t = Array.from(u), s) : t.slice();
57
+ }, s.unknown = function(u) {
58
+ return arguments.length ? (r = u, s) : r;
59
+ }, s.copy = function() {
60
+ return h(n, t).unknown(r);
61
+ }, a.apply(s, arguments), s;
62
+ }
63
+ export {
64
+ h as o
65
+ };
@@ -0,0 +1,91 @@
1
+ const c = Math.PI, x = 2 * c, u = 1e-6, m = x - u;
2
+ function E(e) {
3
+ this._ += e[0];
4
+ for (let t = 1, h = e.length; t < h; ++t)
5
+ this._ += arguments[t] + e[t];
6
+ }
7
+ function A(e) {
8
+ let t = Math.floor(e);
9
+ if (!(t >= 0))
10
+ throw new Error(`invalid digits: ${e}`);
11
+ if (t > 15)
12
+ return E;
13
+ const h = 10 ** t;
14
+ return function(i) {
15
+ this._ += i[0];
16
+ for (let s = 1, n = i.length; s < n; ++s)
17
+ this._ += Math.round(arguments[s] * h) / h + i[s];
18
+ };
19
+ }
20
+ class L {
21
+ constructor(t) {
22
+ this._x0 = this._y0 = // start of current subpath
23
+ this._x1 = this._y1 = null, this._ = "", this._append = t == null ? E : A(t);
24
+ }
25
+ moveTo(t, h) {
26
+ this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +h}`;
27
+ }
28
+ closePath() {
29
+ this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`);
30
+ }
31
+ lineTo(t, h) {
32
+ this._append`L${this._x1 = +t},${this._y1 = +h}`;
33
+ }
34
+ quadraticCurveTo(t, h, i, s) {
35
+ this._append`Q${+t},${+h},${this._x1 = +i},${this._y1 = +s}`;
36
+ }
37
+ bezierCurveTo(t, h, i, s, n, $) {
38
+ this._append`C${+t},${+h},${+i},${+s},${this._x1 = +n},${this._y1 = +$}`;
39
+ }
40
+ arcTo(t, h, i, s, n) {
41
+ if (t = +t, h = +h, i = +i, s = +s, n = +n, n < 0)
42
+ throw new Error(`negative radius: ${n}`);
43
+ let $ = this._x1, r = this._y1, p = i - t, l = s - h, _ = $ - t, o = r - h, a = _ * _ + o * o;
44
+ if (this._x1 === null)
45
+ this._append`M${this._x1 = t},${this._y1 = h}`;
46
+ else if (a > u)
47
+ if (!(Math.abs(o * p - l * _) > u) || !n)
48
+ this._append`L${this._x1 = t},${this._y1 = h}`;
49
+ else {
50
+ let d = i - $, f = s - r, y = p * p + l * l, T = d * d + f * f, g = Math.sqrt(y), v = Math.sqrt(a), w = n * Math.tan((c - Math.acos((y + a - T) / (2 * g * v))) / 2), M = w / v, b = w / g;
51
+ Math.abs(M - 1) > u && this._append`L${t + M * _},${h + M * o}`, this._append`A${n},${n},0,0,${+(o * d > _ * f)},${this._x1 = t + b * p},${this._y1 = h + b * l}`;
52
+ }
53
+ }
54
+ arc(t, h, i, s, n, $) {
55
+ if (t = +t, h = +h, i = +i, $ = !!$, i < 0)
56
+ throw new Error(`negative radius: ${i}`);
57
+ let r = i * Math.cos(s), p = i * Math.sin(s), l = t + r, _ = h + p, o = 1 ^ $, a = $ ? s - n : n - s;
58
+ this._x1 === null ? this._append`M${l},${_}` : (Math.abs(this._x1 - l) > u || Math.abs(this._y1 - _) > u) && this._append`L${l},${_}`, i && (a < 0 && (a = a % x + x), a > m ? this._append`A${i},${i},0,1,${o},${t - r},${h - p}A${i},${i},0,1,${o},${this._x1 = l},${this._y1 = _}` : a > u && this._append`A${i},${i},0,${+(a >= c)},${o},${this._x1 = t + i * Math.cos(n)},${this._y1 = h + i * Math.sin(n)}`);
59
+ }
60
+ rect(t, h, i, s) {
61
+ this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +h}h${i = +i}v${+s}h${-i}Z`;
62
+ }
63
+ toString() {
64
+ return this._;
65
+ }
66
+ }
67
+ function P(e) {
68
+ return function() {
69
+ return e;
70
+ };
71
+ }
72
+ function q(e) {
73
+ let t = 3;
74
+ return e.digits = function(h) {
75
+ if (!arguments.length)
76
+ return t;
77
+ if (h == null)
78
+ t = null;
79
+ else {
80
+ const i = Math.floor(h);
81
+ if (!(i >= 0))
82
+ throw new RangeError(`invalid digits: ${h}`);
83
+ t = i;
84
+ }
85
+ return e;
86
+ }, () => new L(t);
87
+ }
88
+ export {
89
+ P as c,
90
+ q as w
91
+ };
@@ -0,0 +1,503 @@
1
+ import { aE as q, aF as at, am as lt, an as ot, T as ct, U as ht, X as ut, W as yt, ao as ft, Z as pt, Y as et, a2 as it, aG as gt, aD as dt, aH as mt, a3 as _t } from "./main-740da2e1.mjs";
2
+ import { a as tt } from "./arc-33fcfaff.mjs";
3
+ import { o as xt } from "./ordinal-980380c7.mjs";
4
+ import { a as kt } from "./array-2ff2c7a6.mjs";
5
+ import { c as L } from "./path-428ebac9.mjs";
6
+ import "vue";
7
+ import "./init-f9637058.mjs";
8
+ function vt(e, u) {
9
+ return u < e ? -1 : u > e ? 1 : u >= e ? 0 : NaN;
10
+ }
11
+ function bt(e) {
12
+ return e;
13
+ }
14
+ function St() {
15
+ var e = bt, u = vt, $ = null, p = L(0), g = L(q), E = L(0);
16
+ function y(a) {
17
+ var l, d = (a = kt(a)).length, m, I, T = 0, _ = new Array(d), v = new Array(d), c = +p.apply(this, arguments), A = Math.min(q, Math.max(-q, g.apply(this, arguments) - c)), O, w = Math.min(Math.abs(A) / d, E.apply(this, arguments)), b = w * (A < 0 ? -1 : 1), t;
18
+ for (l = 0; l < d; ++l)
19
+ (t = v[_[l] = l] = +e(a[l], l, a)) > 0 && (T += t);
20
+ for (u != null ? _.sort(function(i, n) {
21
+ return u(v[i], v[n]);
22
+ }) : $ != null && _.sort(function(i, n) {
23
+ return $(a[i], a[n]);
24
+ }), l = 0, I = T ? (A - d * b) / T : 0; l < d; ++l, c = O)
25
+ m = _[l], t = v[m], O = c + (t > 0 ? t * I : 0) + b, v[m] = {
26
+ data: a[m],
27
+ index: l,
28
+ value: t,
29
+ startAngle: c,
30
+ endAngle: O,
31
+ padAngle: w
32
+ };
33
+ return v;
34
+ }
35
+ return y.value = function(a) {
36
+ return arguments.length ? (e = typeof a == "function" ? a : L(+a), y) : e;
37
+ }, y.sortValues = function(a) {
38
+ return arguments.length ? (u = a, $ = null, y) : u;
39
+ }, y.sort = function(a) {
40
+ return arguments.length ? ($ = a, u = null, y) : $;
41
+ }, y.startAngle = function(a) {
42
+ return arguments.length ? (p = typeof a == "function" ? a : L(+a), y) : p;
43
+ }, y.endAngle = function(a) {
44
+ return arguments.length ? (g = typeof a == "function" ? a : L(+a), y) : g;
45
+ }, y.padAngle = function(a) {
46
+ return arguments.length ? (E = typeof a == "function" ? a : L(+a), y) : E;
47
+ }, y;
48
+ }
49
+ var J = function() {
50
+ var e = function(b, t, i, n) {
51
+ for (i = i || {}, n = b.length; n--; i[b[n]] = t)
52
+ ;
53
+ return i;
54
+ }, u = [1, 3], $ = [1, 4], p = [1, 5], g = [1, 6], E = [1, 10, 12, 14, 16, 18, 19, 20, 21, 22], y = [2, 4], a = [1, 5, 10, 12, 14, 16, 18, 19, 20, 21, 22], l = [20, 21, 22], d = [2, 7], m = [1, 12], I = [1, 13], T = [1, 14], _ = [1, 15], v = [1, 16], c = [1, 17], A = {
55
+ trace: function() {
56
+ },
57
+ yy: {},
58
+ 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 },
59
+ 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" },
60
+ 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]],
61
+ performAction: function(t, i, n, r, o, s, P) {
62
+ var x = s.length - 1;
63
+ switch (o) {
64
+ case 3:
65
+ r.setShowData(!0);
66
+ break;
67
+ case 6:
68
+ this.$ = s[x - 1];
69
+ break;
70
+ case 8:
71
+ r.addSection(s[x - 1], r.cleanupValue(s[x]));
72
+ break;
73
+ case 9:
74
+ this.$ = s[x].trim(), r.setDiagramTitle(this.$);
75
+ break;
76
+ case 10:
77
+ this.$ = s[x].trim(), r.setAccTitle(this.$);
78
+ break;
79
+ case 11:
80
+ case 12:
81
+ this.$ = s[x].trim(), r.setAccDescription(this.$);
82
+ break;
83
+ case 13:
84
+ r.addSection(s[x].substr(8)), this.$ = s[x].substr(8);
85
+ break;
86
+ }
87
+ },
88
+ table: [{ 3: 1, 4: 2, 5: u, 20: $, 21: p, 22: g }, { 1: [3] }, { 3: 7, 4: 2, 5: u, 20: $, 21: p, 22: g }, e(E, y, { 6: 8, 7: [1, 9] }), e(a, [2, 14]), e(a, [2, 15]), e(a, [2, 16]), { 1: [2, 1] }, e(l, d, { 8: 10, 9: 11, 1: [2, 2], 10: m, 12: I, 14: T, 16: _, 18: v, 19: c }), e(E, y, { 6: 18 }), e(E, [2, 5]), { 4: 19, 20: $, 21: p, 22: g }, { 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: m, 12: I, 14: T, 16: _, 18: v, 19: c }), e(E, [2, 6]), e(l, [2, 8]), e(l, [2, 9]), e(l, [2, 10]), e(l, [2, 11])],
89
+ defaultActions: { 7: [2, 1] },
90
+ parseError: function(t, i) {
91
+ if (i.recoverable)
92
+ this.trace(t);
93
+ else {
94
+ var n = new Error(t);
95
+ throw n.hash = i, n;
96
+ }
97
+ },
98
+ parse: function(t) {
99
+ var i = this, n = [0], r = [], o = [null], s = [], P = this.table, x = "", f = 0, V = 0, R = 2, M = 1, Y = s.slice.call(arguments, 1), h = Object.create(this.lexer), N = { yy: {} };
100
+ for (var B in this.yy)
101
+ Object.prototype.hasOwnProperty.call(this.yy, B) && (N.yy[B] = this.yy[B]);
102
+ h.setInput(t, N.yy), N.yy.lexer = h, N.yy.parser = this, typeof h.yylloc > "u" && (h.yylloc = {});
103
+ var Z = h.yylloc;
104
+ s.push(Z);
105
+ var st = h.options && h.options.ranges;
106
+ typeof N.yy.parseError == "function" ? this.parseError = N.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
107
+ function rt() {
108
+ var C;
109
+ return C = r.pop() || h.lex() || M, typeof C != "number" && (C instanceof Array && (r = C, C = r.pop()), C = i.symbols_[C] || C), C;
110
+ }
111
+ for (var k, F, S, H, z = {}, W, D, Q, j; ; ) {
112
+ if (F = n[n.length - 1], this.defaultActions[F] ? S = this.defaultActions[F] : ((k === null || typeof k > "u") && (k = rt()), S = P[F] && P[F][k]), typeof S > "u" || !S.length || !S[0]) {
113
+ var X = "";
114
+ j = [];
115
+ for (W in P[F])
116
+ this.terminals_[W] && W > R && j.push("'" + this.terminals_[W] + "'");
117
+ h.showPosition ? X = "Parse error on line " + (f + 1) + `:
118
+ ` + h.showPosition() + `
119
+ Expecting ` + j.join(", ") + ", got '" + (this.terminals_[k] || k) + "'" : X = "Parse error on line " + (f + 1) + ": Unexpected " + (k == M ? "end of input" : "'" + (this.terminals_[k] || k) + "'"), this.parseError(X, {
120
+ text: h.match,
121
+ token: this.terminals_[k] || k,
122
+ line: h.yylineno,
123
+ loc: Z,
124
+ expected: j
125
+ });
126
+ }
127
+ if (S[0] instanceof Array && S.length > 1)
128
+ throw new Error("Parse Error: multiple actions possible at state: " + F + ", token: " + k);
129
+ switch (S[0]) {
130
+ case 1:
131
+ n.push(k), o.push(h.yytext), s.push(h.yylloc), n.push(S[1]), k = null, V = h.yyleng, x = h.yytext, f = h.yylineno, Z = h.yylloc;
132
+ break;
133
+ case 2:
134
+ if (D = this.productions_[S[1]][1], z.$ = o[o.length - D], z._$ = {
135
+ first_line: s[s.length - (D || 1)].first_line,
136
+ last_line: s[s.length - 1].last_line,
137
+ first_column: s[s.length - (D || 1)].first_column,
138
+ last_column: s[s.length - 1].last_column
139
+ }, st && (z._$.range = [
140
+ s[s.length - (D || 1)].range[0],
141
+ s[s.length - 1].range[1]
142
+ ]), H = this.performAction.apply(z, [
143
+ x,
144
+ V,
145
+ f,
146
+ N.yy,
147
+ S[1],
148
+ o,
149
+ s
150
+ ].concat(Y)), typeof H < "u")
151
+ return H;
152
+ D && (n = n.slice(0, -1 * D * 2), o = o.slice(0, -1 * D), s = s.slice(0, -1 * D)), n.push(this.productions_[S[1]][0]), o.push(z.$), s.push(z._$), Q = P[n[n.length - 2]][n[n.length - 1]], n.push(Q);
153
+ break;
154
+ case 3:
155
+ return !0;
156
+ }
157
+ }
158
+ return !0;
159
+ }
160
+ }, O = function() {
161
+ var b = {
162
+ EOF: 1,
163
+ parseError: function(i, n) {
164
+ if (this.yy.parser)
165
+ this.yy.parser.parseError(i, n);
166
+ else
167
+ throw new Error(i);
168
+ },
169
+ // resets the lexer, sets new input
170
+ setInput: function(t, i) {
171
+ 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 = {
172
+ first_line: 1,
173
+ first_column: 0,
174
+ last_line: 1,
175
+ last_column: 0
176
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
177
+ },
178
+ // consumes and returns one char from the input
179
+ input: function() {
180
+ var t = this._input[0];
181
+ this.yytext += t, this.yyleng++, this.offset++, this.match += t, this.matched += t;
182
+ var i = t.match(/(?:\r\n?|\n).*/g);
183
+ 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;
184
+ },
185
+ // unshifts one char (or a string) into the input
186
+ unput: function(t) {
187
+ var i = t.length, n = t.split(/(?:\r\n?|\n)/g);
188
+ this._input = t + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - i), this.offset -= i;
189
+ var r = this.match.split(/(?:\r\n?|\n)/g);
190
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
191
+ var o = this.yylloc.range;
192
+ return this.yylloc = {
193
+ first_line: this.yylloc.first_line,
194
+ last_line: this.yylineno + 1,
195
+ first_column: this.yylloc.first_column,
196
+ last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - i
197
+ }, this.options.ranges && (this.yylloc.range = [o[0], o[0] + this.yyleng - i]), this.yyleng = this.yytext.length, this;
198
+ },
199
+ // When called from action, caches matched text and appends it on next action
200
+ more: function() {
201
+ return this._more = !0, this;
202
+ },
203
+ // 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.
204
+ reject: function() {
205
+ if (this.options.backtrack_lexer)
206
+ this._backtrack = !0;
207
+ else
208
+ 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).
209
+ ` + this.showPosition(), {
210
+ text: "",
211
+ token: null,
212
+ line: this.yylineno
213
+ });
214
+ return this;
215
+ },
216
+ // retain first n characters of the match
217
+ less: function(t) {
218
+ this.unput(this.match.slice(t));
219
+ },
220
+ // displays already matched input, i.e. for error messages
221
+ pastInput: function() {
222
+ var t = this.matched.substr(0, this.matched.length - this.match.length);
223
+ return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, "");
224
+ },
225
+ // displays upcoming input, i.e. for error messages
226
+ upcomingInput: function() {
227
+ var t = this.match;
228
+ return t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "");
229
+ },
230
+ // displays the character position where the lexing error occurred, i.e. for error messages
231
+ showPosition: function() {
232
+ var t = this.pastInput(), i = new Array(t.length + 1).join("-");
233
+ return t + this.upcomingInput() + `
234
+ ` + i + "^";
235
+ },
236
+ // test the lexed token: return FALSE when not a match, otherwise return token
237
+ test_match: function(t, i) {
238
+ var n, r, o;
239
+ if (this.options.backtrack_lexer && (o = {
240
+ yylineno: this.yylineno,
241
+ yylloc: {
242
+ first_line: this.yylloc.first_line,
243
+ last_line: this.last_line,
244
+ first_column: this.yylloc.first_column,
245
+ last_column: this.yylloc.last_column
246
+ },
247
+ yytext: this.yytext,
248
+ match: this.match,
249
+ matches: this.matches,
250
+ matched: this.matched,
251
+ yyleng: this.yyleng,
252
+ offset: this.offset,
253
+ _more: this._more,
254
+ _input: this._input,
255
+ yy: this.yy,
256
+ conditionStack: this.conditionStack.slice(0),
257
+ done: this.done
258
+ }, this.options.ranges && (o.yylloc.range = this.yylloc.range.slice(0))), r = t[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
259
+ first_line: this.yylloc.last_line,
260
+ last_line: this.yylineno + 1,
261
+ first_column: this.yylloc.last_column,
262
+ last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length
263
+ }, 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], n = this.performAction.call(this, this.yy, this, i, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n)
264
+ return n;
265
+ if (this._backtrack) {
266
+ for (var s in o)
267
+ this[s] = o[s];
268
+ return !1;
269
+ }
270
+ return !1;
271
+ },
272
+ // return next match in input
273
+ next: function() {
274
+ if (this.done)
275
+ return this.EOF;
276
+ this._input || (this.done = !0);
277
+ var t, i, n, r;
278
+ this._more || (this.yytext = "", this.match = "");
279
+ for (var o = this._currentRules(), s = 0; s < o.length; s++)
280
+ if (n = this._input.match(this.rules[o[s]]), n && (!i || n[0].length > i[0].length)) {
281
+ if (i = n, r = s, this.options.backtrack_lexer) {
282
+ if (t = this.test_match(n, o[s]), t !== !1)
283
+ return t;
284
+ if (this._backtrack) {
285
+ i = !1;
286
+ continue;
287
+ } else
288
+ return !1;
289
+ } else if (!this.options.flex)
290
+ break;
291
+ }
292
+ return i ? (t = this.test_match(i, o[r]), t !== !1 ? t : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
293
+ ` + this.showPosition(), {
294
+ text: "",
295
+ token: null,
296
+ line: this.yylineno
297
+ });
298
+ },
299
+ // return next match that has a token
300
+ lex: function() {
301
+ var i = this.next();
302
+ return i || this.lex();
303
+ },
304
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
305
+ begin: function(i) {
306
+ this.conditionStack.push(i);
307
+ },
308
+ // pop the previously active lexer condition state off the condition stack
309
+ popState: function() {
310
+ var i = this.conditionStack.length - 1;
311
+ return i > 0 ? this.conditionStack.pop() : this.conditionStack[0];
312
+ },
313
+ // produce the lexer rule set which is active for the currently active lexer condition state
314
+ _currentRules: function() {
315
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
316
+ },
317
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
318
+ topState: function(i) {
319
+ return i = this.conditionStack.length - 1 - Math.abs(i || 0), i >= 0 ? this.conditionStack[i] : "INITIAL";
320
+ },
321
+ // alias for begin(condition)
322
+ pushState: function(i) {
323
+ this.begin(i);
324
+ },
325
+ // return the number of states currently on the stack
326
+ stateStackSize: function() {
327
+ return this.conditionStack.length;
328
+ },
329
+ options: { "case-insensitive": !0 },
330
+ performAction: function(i, n, r, o) {
331
+ switch (r) {
332
+ case 0:
333
+ break;
334
+ case 1:
335
+ break;
336
+ case 2:
337
+ return 20;
338
+ case 3:
339
+ break;
340
+ case 4:
341
+ break;
342
+ case 5:
343
+ return this.begin("title"), 12;
344
+ case 6:
345
+ return this.popState(), "title_value";
346
+ case 7:
347
+ return this.begin("acc_title"), 14;
348
+ case 8:
349
+ return this.popState(), "acc_title_value";
350
+ case 9:
351
+ return this.begin("acc_descr"), 16;
352
+ case 10:
353
+ return this.popState(), "acc_descr_value";
354
+ case 11:
355
+ this.begin("acc_descr_multiline");
356
+ break;
357
+ case 12:
358
+ this.popState();
359
+ break;
360
+ case 13:
361
+ return "acc_descr_multiline_value";
362
+ case 14:
363
+ this.begin("string");
364
+ break;
365
+ case 15:
366
+ this.popState();
367
+ break;
368
+ case 16:
369
+ return "txt";
370
+ case 17:
371
+ return 5;
372
+ case 18:
373
+ return 7;
374
+ case 19:
375
+ return "value";
376
+ case 20:
377
+ return 22;
378
+ }
379
+ },
380
+ 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],
381
+ 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 } }
382
+ };
383
+ return b;
384
+ }();
385
+ A.lexer = O;
386
+ function w() {
387
+ this.yy = {};
388
+ }
389
+ return w.prototype = A, A.Parser = w, new w();
390
+ }();
391
+ J.parser = J;
392
+ const $t = J, nt = at.pie, G = {
393
+ sections: {},
394
+ showData: !1,
395
+ config: nt
396
+ };
397
+ let U = G.sections, K = G.showData;
398
+ const Et = structuredClone(nt), At = () => structuredClone(Et), wt = () => {
399
+ U = structuredClone(G.sections), K = G.showData, ft();
400
+ }, Tt = (e, u) => {
401
+ e = pt(e, et()), U[e] === void 0 && (U[e] = u, it.debug(`added new section: ${e}, with value: ${u}`));
402
+ }, It = () => U, Dt = (e) => (e.substring(0, 1) === ":" && (e = e.substring(1).trim()), Number(e.trim())), Ct = (e) => {
403
+ K = e;
404
+ }, Ot = () => K, Pt = {
405
+ getConfig: At,
406
+ clear: wt,
407
+ setDiagramTitle: lt,
408
+ getDiagramTitle: ot,
409
+ setAccTitle: ct,
410
+ getAccTitle: ht,
411
+ setAccDescription: ut,
412
+ getAccDescription: yt,
413
+ addSection: Tt,
414
+ getSections: It,
415
+ cleanupValue: Dt,
416
+ setShowData: Ct,
417
+ getShowData: Ot
418
+ }, Vt = (e) => `
419
+ .pieCircle{
420
+ stroke: ${e.pieStrokeColor};
421
+ stroke-width : ${e.pieStrokeWidth};
422
+ opacity : ${e.pieOpacity};
423
+ }
424
+ .pieOuterCircle{
425
+ stroke: ${e.pieOuterStrokeColor};
426
+ stroke-width: ${e.pieOuterStrokeWidth};
427
+ fill: none;
428
+ }
429
+ .pieTitleText {
430
+ text-anchor: middle;
431
+ font-size: ${e.pieTitleTextSize};
432
+ fill: ${e.pieTitleTextColor};
433
+ font-family: ${e.fontFamily};
434
+ }
435
+ .slice {
436
+ font-family: ${e.fontFamily};
437
+ fill: ${e.pieSectionTextColor};
438
+ font-size:${e.pieSectionTextSize};
439
+ // fill: white;
440
+ }
441
+ .legend text {
442
+ fill: ${e.pieLegendTextColor};
443
+ font-family: ${e.fontFamily};
444
+ font-size: ${e.pieLegendTextSize};
445
+ }
446
+ `, Nt = Vt, Ft = (e) => {
447
+ const u = Object.entries(e).map((p) => ({
448
+ label: p[0],
449
+ value: p[1]
450
+ })).sort((p, g) => g.value - p.value);
451
+ return St().value(
452
+ (p) => p.value
453
+ )(u);
454
+ }, Lt = (e, u, $, p) => {
455
+ it.debug(`rendering pie chart
456
+ ` + e);
457
+ const g = p.db, E = et(), y = gt(g.getConfig(), E.pie), a = 40, l = 18, d = 4, m = 450, I = m, T = dt(u), _ = T.append("g"), v = g.getSections();
458
+ _.attr("transform", "translate(" + I / 2 + "," + m / 2 + ")");
459
+ const { themeVariables: c } = E;
460
+ let [A] = mt(c.pieOuterStrokeWidth);
461
+ A ?? (A = 2);
462
+ const O = y.textPosition, w = Math.min(I, m) / 2 - a, b = tt().innerRadius(0).outerRadius(w), t = tt().innerRadius(w * O).outerRadius(w * O);
463
+ _.append("circle").attr("cx", 0).attr("cy", 0).attr("r", w + A / 2).attr("class", "pieOuterCircle");
464
+ const i = Ft(v), n = [
465
+ c.pie1,
466
+ c.pie2,
467
+ c.pie3,
468
+ c.pie4,
469
+ c.pie5,
470
+ c.pie6,
471
+ c.pie7,
472
+ c.pie8,
473
+ c.pie9,
474
+ c.pie10,
475
+ c.pie11,
476
+ c.pie12
477
+ ], r = xt(n);
478
+ _.selectAll("mySlices").data(i).enter().append("path").attr("d", b).attr("fill", (f) => r(f.data.label)).attr("class", "pieCircle");
479
+ let o = 0;
480
+ Object.keys(v).forEach((f) => {
481
+ o += v[f];
482
+ }), _.selectAll("mySlices").data(i).enter().append("text").text((f) => (f.data.value / o * 100).toFixed(0) + "%").attr("transform", (f) => "translate(" + t.centroid(f) + ")").style("text-anchor", "middle").attr("class", "slice"), _.append("text").text(g.getDiagramTitle()).attr("x", 0).attr("y", -(m - 50) / 2).attr("class", "pieTitleText");
483
+ const s = _.selectAll(".legend").data(r.domain()).enter().append("g").attr("class", "legend").attr("transform", (f, V) => {
484
+ const R = l + d, M = R * r.domain().length / 2, Y = 12 * l, h = V * R - M;
485
+ return "translate(" + Y + "," + h + ")";
486
+ });
487
+ s.append("rect").attr("width", l).attr("height", l).style("fill", r).style("stroke", r), s.data(i).append("text").attr("x", l + d).attr("y", l - d).text((f) => {
488
+ const { label: V, value: R } = f.data;
489
+ return g.getShowData() ? `${V} [${R}]` : V;
490
+ });
491
+ const P = Math.max(
492
+ ...s.selectAll("text").nodes().map((f) => (f == null ? void 0 : f.getBoundingClientRect().width) ?? 0)
493
+ ), x = I + a + l + d + P;
494
+ T.attr("viewBox", `0 0 ${x} ${m}`), _t(T, m, x, y.useMaxWidth);
495
+ }, Rt = { draw: Lt }, Bt = {
496
+ parser: $t,
497
+ db: Pt,
498
+ renderer: Rt,
499
+ styles: Nt
500
+ };
501
+ export {
502
+ Bt as diagram
503
+ };
Binary file
Binary file