@zjlab-frontier/markdown 1.0.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 (53) hide show
  1. package/README.md +148 -0
  2. package/dist/Tableau10-D7jGxypv.mjs +8 -0
  3. package/dist/arc-BkFOiLi7.mjs +84 -0
  4. package/dist/array-CqVTtuYm.mjs +6 -0
  5. package/dist/blockDiagram-c4efeb88-CngVNufX.mjs +1221 -0
  6. package/dist/c4Diagram-c83219d4-CvSWXhSV.mjs +1579 -0
  7. package/dist/channel-BCTzeqLo.mjs +5 -0
  8. package/dist/classDiagram-beda092f-8UkpWDgI.mjs +218 -0
  9. package/dist/classDiagram-v2-2358418a-D3LsBhTm.mjs +200 -0
  10. package/dist/clone-DZgGXtyK.mjs +8 -0
  11. package/dist/createText-1719965b-DMv-Bu7A.mjs +155 -0
  12. package/dist/edges-96097737-BeVwLt3S.mjs +1088 -0
  13. package/dist/erDiagram-0228fc6a-GXXkRZ8r.mjs +929 -0
  14. package/dist/flowDb-c6c81e3f-CrOg5i55.mjs +1126 -0
  15. package/dist/flowDiagram-50d868cf-sXe_oFAW.mjs +788 -0
  16. package/dist/flowDiagram-v2-4f6560a1-CoKYvZkH.mjs +17 -0
  17. package/dist/flowchart-elk-definition-6af322e1-SuvGsuBl.mjs +48146 -0
  18. package/dist/ganttDiagram-a2739b55-BbWq9bqY.mjs +2477 -0
  19. package/dist/gitGraphDiagram-82fe8481-C6-e4UmK.mjs +1264 -0
  20. package/dist/graph-CoIGCRFf.mjs +847 -0
  21. package/dist/index-5325376f-BENBY8aO.mjs +373 -0
  22. package/dist/index-5_ujiRGo.mjs +46276 -0
  23. package/dist/index.css +1 -0
  24. package/dist/index.d.ts +2 -0
  25. package/dist/index.mjs +8 -0
  26. package/dist/index.umd.js +2421 -0
  27. package/dist/infoDiagram-8eee0895-BEAb2pCD.mjs +319 -0
  28. package/dist/init-DjUOC4st.mjs +16 -0
  29. package/dist/journeyDiagram-c64418c1-CERjyYnA.mjs +801 -0
  30. package/dist/layout-aCAVHR2T.mjs +1472 -0
  31. package/dist/line-BGunMwE-.mjs +33 -0
  32. package/dist/linear-DciWi0hE.mjs +423 -0
  33. package/dist/markdown.d.ts +25 -0
  34. package/dist/mindmap-definition-8da855dc-Cc8_U7zD.mjs +21936 -0
  35. package/dist/ordinal-C0oynhte.mjs +61 -0
  36. package/dist/path-DLwuMfdd.mjs +84 -0
  37. package/dist/pieDiagram-a8764435-B00hy7Ez.mjs +500 -0
  38. package/dist/quadrantDiagram-1e28029f-DR7IGAoM.mjs +903 -0
  39. package/dist/requirementDiagram-08caed73-o6N3X3-m.mjs +767 -0
  40. package/dist/sankeyDiagram-a04cb91d-CYF9Ro1W.mjs +802 -0
  41. package/dist/sequenceDiagram-c5b8d532-vz_R7xBU.mjs +2234 -0
  42. package/dist/stateDiagram-1ecb1508-B0YUHnuE.mjs +266 -0
  43. package/dist/stateDiagram-v2-c2b004d7-CDTm1Jfb.mjs +184 -0
  44. package/dist/styles/highlight.scss +115 -0
  45. package/dist/styles/markdown.scss +1163 -0
  46. package/dist/styles-b4e223ce-C_-huVuQ.mjs +1089 -0
  47. package/dist/styles-ca3715f6-soe07Bnw.mjs +960 -0
  48. package/dist/styles-d45a18b0-0ZXwJp5P.mjs +436 -0
  49. package/dist/svgDrawCommon-b86b1483-UCLksviB.mjs +64 -0
  50. package/dist/timeline-definition-faaaa080-Dt5unv7p.mjs +792 -0
  51. package/dist/vite.config.d.ts +2 -0
  52. package/dist/xychartDiagram-f5964ef8-BZWS0E_9.mjs +1282 -0
  53. package/package.json +66 -0
@@ -0,0 +1,61 @@
1
+ import { i as a } from "./init-DjUOC4st.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) for (const [r, s] of n) this.set(r, s);
5
+ }
6
+ get(n) {
7
+ return super.get(c(this, n));
8
+ }
9
+ has(n) {
10
+ return super.has(c(this, n));
11
+ }
12
+ set(n, t) {
13
+ return super.set(l(this, n), t);
14
+ }
15
+ delete(n) {
16
+ return super.delete(p(this, n));
17
+ }
18
+ }
19
+ function c({ _intern: e, _key: n }, t) {
20
+ const r = n(t);
21
+ return e.has(r) ? e.get(r) : t;
22
+ }
23
+ function l({ _intern: e, _key: n }, t) {
24
+ const r = n(t);
25
+ return e.has(r) ? e.get(r) : (e.set(r, t), t);
26
+ }
27
+ function p({ _intern: e, _key: n }, t) {
28
+ const r = n(t);
29
+ return e.has(r) && (t = e.get(r), e.delete(r)), t;
30
+ }
31
+ function g(e) {
32
+ return e !== null && typeof e == "object" ? e.valueOf() : e;
33
+ }
34
+ const f = Symbol("implicit");
35
+ function h() {
36
+ var e = new o(), n = [], t = [], r = f;
37
+ function s(u) {
38
+ let i = e.get(u);
39
+ if (i === void 0) {
40
+ if (r !== f) return r;
41
+ e.set(u, i = n.push(u) - 1);
42
+ }
43
+ return t[i % t.length];
44
+ }
45
+ return s.domain = function(u) {
46
+ if (!arguments.length) return n.slice();
47
+ n = [], e = new o();
48
+ for (const i of u)
49
+ e.has(i) || e.set(i, n.push(i) - 1);
50
+ return s;
51
+ }, s.range = function(u) {
52
+ return arguments.length ? (t = Array.from(u), s) : t.slice();
53
+ }, s.unknown = function(u) {
54
+ return arguments.length ? (r = u, s) : r;
55
+ }, s.copy = function() {
56
+ return h(n, t).unknown(r);
57
+ }, a.apply(s, arguments), s;
58
+ }
59
+ export {
60
+ h as o
61
+ };
@@ -0,0 +1,84 @@
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)) throw new Error(`invalid digits: ${e}`);
10
+ if (t > 15) return E;
11
+ const h = 10 ** t;
12
+ return function(i) {
13
+ this._ += i[0];
14
+ for (let s = 1, n = i.length; s < n; ++s)
15
+ this._ += Math.round(arguments[s] * h) / h + i[s];
16
+ };
17
+ }
18
+ class L {
19
+ constructor(t) {
20
+ this._x0 = this._y0 = // start of current subpath
21
+ this._x1 = this._y1 = null, this._ = "", this._append = t == null ? E : A(t);
22
+ }
23
+ moveTo(t, h) {
24
+ this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +h}`;
25
+ }
26
+ closePath() {
27
+ this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`);
28
+ }
29
+ lineTo(t, h) {
30
+ this._append`L${this._x1 = +t},${this._y1 = +h}`;
31
+ }
32
+ quadraticCurveTo(t, h, i, s) {
33
+ this._append`Q${+t},${+h},${this._x1 = +i},${this._y1 = +s}`;
34
+ }
35
+ bezierCurveTo(t, h, i, s, n, $) {
36
+ this._append`C${+t},${+h},${+i},${+s},${this._x1 = +n},${this._y1 = +$}`;
37
+ }
38
+ arcTo(t, h, i, s, n) {
39
+ if (t = +t, h = +h, i = +i, s = +s, n = +n, n < 0) throw new Error(`negative radius: ${n}`);
40
+ let $ = this._x1, r = this._y1, p = i - t, l = s - h, _ = $ - t, o = r - h, a = _ * _ + o * o;
41
+ if (this._x1 === null)
42
+ this._append`M${this._x1 = t},${this._y1 = h}`;
43
+ else if (a > u) if (!(Math.abs(o * p - l * _) > u) || !n)
44
+ this._append`L${this._x1 = t},${this._y1 = h}`;
45
+ else {
46
+ 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;
47
+ 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}`;
48
+ }
49
+ }
50
+ arc(t, h, i, s, n, $) {
51
+ if (t = +t, h = +h, i = +i, $ = !!$, i < 0) throw new Error(`negative radius: ${i}`);
52
+ let r = i * Math.cos(s), p = i * Math.sin(s), l = t + r, _ = h + p, o = 1 ^ $, a = $ ? s - n : n - s;
53
+ 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)}`);
54
+ }
55
+ rect(t, h, i, s) {
56
+ this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +h}h${i = +i}v${+s}h${-i}Z`;
57
+ }
58
+ toString() {
59
+ return this._;
60
+ }
61
+ }
62
+ function P(e) {
63
+ return function() {
64
+ return e;
65
+ };
66
+ }
67
+ function q(e) {
68
+ let t = 3;
69
+ return e.digits = function(h) {
70
+ if (!arguments.length) return t;
71
+ if (h == null)
72
+ t = null;
73
+ else {
74
+ const i = Math.floor(h);
75
+ if (!(i >= 0)) throw new RangeError(`invalid digits: ${h}`);
76
+ t = i;
77
+ }
78
+ return e;
79
+ }, () => new L(t);
80
+ }
81
+ export {
82
+ P as c,
83
+ q as w
84
+ };
@@ -0,0 +1,500 @@
1
+ import { U as H, a as rt, s as at, b as lt, c as ot, C as ct, D as ht, l as et, g as it, V as ut, T as yt, W as ft, e as pt, i as gt, E as dt, X as mt } from "./index-5_ujiRGo.mjs";
2
+ import { a as tt } from "./arc-BkFOiLi7.mjs";
3
+ import { o as _t } from "./ordinal-C0oynhte.mjs";
4
+ import { a as xt } from "./array-CqVTtuYm.mjs";
5
+ import { c as F } from "./path-DLwuMfdd.mjs";
6
+ function kt(e, u) {
7
+ return u < e ? -1 : u > e ? 1 : u >= e ? 0 : NaN;
8
+ }
9
+ function vt(e) {
10
+ return e;
11
+ }
12
+ function bt() {
13
+ var e = vt, u = kt, $ = null, p = F(0), g = F(H), E = F(0);
14
+ function y(a) {
15
+ var l, d = (a = xt(a)).length, k, I, T = 0, m = new Array(d), v = new Array(d), c = +p.apply(this, arguments), A = Math.min(H, Math.max(-H, g.apply(this, arguments) - c)), O, w = Math.min(Math.abs(A) / d, E.apply(this, arguments)), b = w * (A < 0 ? -1 : 1), t;
16
+ for (l = 0; l < d; ++l)
17
+ (t = v[m[l] = l] = +e(a[l], l, a)) > 0 && (T += t);
18
+ for (u != null ? m.sort(function(i, n) {
19
+ return u(v[i], v[n]);
20
+ }) : $ != null && m.sort(function(i, n) {
21
+ return $(a[i], a[n]);
22
+ }), l = 0, I = T ? (A - d * b) / T : 0; l < d; ++l, c = O)
23
+ k = m[l], t = v[k], O = c + (t > 0 ? t * I : 0) + b, v[k] = {
24
+ data: a[k],
25
+ index: l,
26
+ value: t,
27
+ startAngle: c,
28
+ endAngle: O,
29
+ padAngle: w
30
+ };
31
+ return v;
32
+ }
33
+ return y.value = function(a) {
34
+ return arguments.length ? (e = typeof a == "function" ? a : F(+a), y) : e;
35
+ }, y.sortValues = function(a) {
36
+ return arguments.length ? (u = a, $ = null, y) : u;
37
+ }, y.sort = function(a) {
38
+ return arguments.length ? ($ = a, u = null, y) : $;
39
+ }, y.startAngle = function(a) {
40
+ return arguments.length ? (p = typeof a == "function" ? a : F(+a), y) : p;
41
+ }, y.endAngle = function(a) {
42
+ return arguments.length ? (g = typeof a == "function" ? a : F(+a), y) : g;
43
+ }, y.padAngle = function(a) {
44
+ return arguments.length ? (E = typeof a == "function" ? a : F(+a), y) : E;
45
+ }, y;
46
+ }
47
+ var J = (function() {
48
+ var e = function(b, t, i, n) {
49
+ for (i = i || {}, n = b.length; n--; i[b[n]] = t)
50
+ ;
51
+ return i;
52
+ }, 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], k = [1, 12], I = [1, 13], T = [1, 14], m = [1, 15], v = [1, 16], c = [1, 17], A = {
53
+ trace: function() {
54
+ },
55
+ yy: {},
56
+ 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 },
57
+ 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" },
58
+ 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]],
59
+ performAction: function(t, i, n, r, o, s, V) {
60
+ var _ = s.length - 1;
61
+ switch (o) {
62
+ case 3:
63
+ r.setShowData(!0);
64
+ break;
65
+ case 6:
66
+ this.$ = s[_ - 1];
67
+ break;
68
+ case 8:
69
+ r.addSection(s[_ - 1], r.cleanupValue(s[_]));
70
+ break;
71
+ case 9:
72
+ this.$ = s[_].trim(), r.setDiagramTitle(this.$);
73
+ break;
74
+ case 10:
75
+ this.$ = s[_].trim(), r.setAccTitle(this.$);
76
+ break;
77
+ case 11:
78
+ case 12:
79
+ this.$ = s[_].trim(), r.setAccDescription(this.$);
80
+ break;
81
+ case 13:
82
+ r.addSection(s[_].substr(8)), this.$ = s[_].substr(8);
83
+ break;
84
+ }
85
+ },
86
+ 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: k, 12: I, 14: T, 16: m, 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: k, 12: I, 14: T, 16: m, 18: v, 19: c }), e(E, [2, 6]), e(l, [2, 8]), e(l, [2, 9]), e(l, [2, 10]), e(l, [2, 11])],
87
+ defaultActions: { 7: [2, 1] },
88
+ parseError: function(t, i) {
89
+ if (i.recoverable)
90
+ this.trace(t);
91
+ else {
92
+ var n = new Error(t);
93
+ throw n.hash = i, n;
94
+ }
95
+ },
96
+ parse: function(t) {
97
+ var i = this, n = [0], r = [], o = [null], s = [], V = this.table, _ = "", f = 0, P = 0, R = 2, M = 1, B = s.slice.call(arguments, 1), h = Object.create(this.lexer), N = { yy: {} };
98
+ for (var Y in this.yy)
99
+ Object.prototype.hasOwnProperty.call(this.yy, Y) && (N.yy[Y] = this.yy[Y]);
100
+ h.setInput(t, N.yy), N.yy.lexer = h, N.yy.parser = this, typeof h.yylloc > "u" && (h.yylloc = {});
101
+ var X = h.yylloc;
102
+ s.push(X);
103
+ var nt = h.options && h.options.ranges;
104
+ typeof N.yy.parseError == "function" ? this.parseError = N.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
105
+ function st() {
106
+ var C;
107
+ return C = r.pop() || h.lex() || M, typeof C != "number" && (C instanceof Array && (r = C, C = r.pop()), C = i.symbols_[C] || C), C;
108
+ }
109
+ for (var x, L, S, Z, z = {}, W, D, Q, j; ; ) {
110
+ if (L = n[n.length - 1], this.defaultActions[L] ? S = this.defaultActions[L] : ((x === null || typeof x > "u") && (x = st()), S = V[L] && V[L][x]), typeof S > "u" || !S.length || !S[0]) {
111
+ var q = "";
112
+ j = [];
113
+ for (W in V[L])
114
+ this.terminals_[W] && W > R && j.push("'" + this.terminals_[W] + "'");
115
+ h.showPosition ? q = "Parse error on line " + (f + 1) + `:
116
+ ` + h.showPosition() + `
117
+ Expecting ` + j.join(", ") + ", got '" + (this.terminals_[x] || x) + "'" : q = "Parse error on line " + (f + 1) + ": Unexpected " + (x == M ? "end of input" : "'" + (this.terminals_[x] || x) + "'"), this.parseError(q, {
118
+ text: h.match,
119
+ token: this.terminals_[x] || x,
120
+ line: h.yylineno,
121
+ loc: X,
122
+ expected: j
123
+ });
124
+ }
125
+ if (S[0] instanceof Array && S.length > 1)
126
+ throw new Error("Parse Error: multiple actions possible at state: " + L + ", token: " + x);
127
+ switch (S[0]) {
128
+ case 1:
129
+ n.push(x), o.push(h.yytext), s.push(h.yylloc), n.push(S[1]), x = null, P = h.yyleng, _ = h.yytext, f = h.yylineno, X = h.yylloc;
130
+ break;
131
+ case 2:
132
+ if (D = this.productions_[S[1]][1], z.$ = o[o.length - D], z._$ = {
133
+ first_line: s[s.length - (D || 1)].first_line,
134
+ last_line: s[s.length - 1].last_line,
135
+ first_column: s[s.length - (D || 1)].first_column,
136
+ last_column: s[s.length - 1].last_column
137
+ }, nt && (z._$.range = [
138
+ s[s.length - (D || 1)].range[0],
139
+ s[s.length - 1].range[1]
140
+ ]), Z = this.performAction.apply(z, [
141
+ _,
142
+ P,
143
+ f,
144
+ N.yy,
145
+ S[1],
146
+ o,
147
+ s
148
+ ].concat(B)), typeof Z < "u")
149
+ return Z;
150
+ 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 = V[n[n.length - 2]][n[n.length - 1]], n.push(Q);
151
+ break;
152
+ case 3:
153
+ return !0;
154
+ }
155
+ }
156
+ return !0;
157
+ }
158
+ }, O = /* @__PURE__ */ (function() {
159
+ var b = {
160
+ EOF: 1,
161
+ parseError: function(i, n) {
162
+ if (this.yy.parser)
163
+ this.yy.parser.parseError(i, n);
164
+ else
165
+ throw new Error(i);
166
+ },
167
+ // resets the lexer, sets new input
168
+ setInput: function(t, i) {
169
+ 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 = {
170
+ first_line: 1,
171
+ first_column: 0,
172
+ last_line: 1,
173
+ last_column: 0
174
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
175
+ },
176
+ // consumes and returns one char from the input
177
+ input: function() {
178
+ var t = this._input[0];
179
+ this.yytext += t, this.yyleng++, this.offset++, this.match += t, this.matched += t;
180
+ var i = t.match(/(?:\r\n?|\n).*/g);
181
+ 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;
182
+ },
183
+ // unshifts one char (or a string) into the input
184
+ unput: function(t) {
185
+ var i = t.length, n = t.split(/(?:\r\n?|\n)/g);
186
+ this._input = t + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - i), this.offset -= i;
187
+ var r = this.match.split(/(?:\r\n?|\n)/g);
188
+ 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);
189
+ var o = this.yylloc.range;
190
+ return this.yylloc = {
191
+ first_line: this.yylloc.first_line,
192
+ last_line: this.yylineno + 1,
193
+ first_column: this.yylloc.first_column,
194
+ 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
195
+ }, this.options.ranges && (this.yylloc.range = [o[0], o[0] + this.yyleng - i]), this.yyleng = this.yytext.length, this;
196
+ },
197
+ // When called from action, caches matched text and appends it on next action
198
+ more: function() {
199
+ return this._more = !0, this;
200
+ },
201
+ // 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.
202
+ reject: function() {
203
+ if (this.options.backtrack_lexer)
204
+ this._backtrack = !0;
205
+ else
206
+ 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).
207
+ ` + this.showPosition(), {
208
+ text: "",
209
+ token: null,
210
+ line: this.yylineno
211
+ });
212
+ return this;
213
+ },
214
+ // retain first n characters of the match
215
+ less: function(t) {
216
+ this.unput(this.match.slice(t));
217
+ },
218
+ // displays already matched input, i.e. for error messages
219
+ pastInput: function() {
220
+ var t = this.matched.substr(0, this.matched.length - this.match.length);
221
+ return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, "");
222
+ },
223
+ // displays upcoming input, i.e. for error messages
224
+ upcomingInput: function() {
225
+ var t = this.match;
226
+ return t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "");
227
+ },
228
+ // displays the character position where the lexing error occurred, i.e. for error messages
229
+ showPosition: function() {
230
+ var t = this.pastInput(), i = new Array(t.length + 1).join("-");
231
+ return t + this.upcomingInput() + `
232
+ ` + i + "^";
233
+ },
234
+ // test the lexed token: return FALSE when not a match, otherwise return token
235
+ test_match: function(t, i) {
236
+ var n, r, o;
237
+ if (this.options.backtrack_lexer && (o = {
238
+ yylineno: this.yylineno,
239
+ yylloc: {
240
+ first_line: this.yylloc.first_line,
241
+ last_line: this.last_line,
242
+ first_column: this.yylloc.first_column,
243
+ last_column: this.yylloc.last_column
244
+ },
245
+ yytext: this.yytext,
246
+ match: this.match,
247
+ matches: this.matches,
248
+ matched: this.matched,
249
+ yyleng: this.yyleng,
250
+ offset: this.offset,
251
+ _more: this._more,
252
+ _input: this._input,
253
+ yy: this.yy,
254
+ conditionStack: this.conditionStack.slice(0),
255
+ done: this.done
256
+ }, 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 = {
257
+ first_line: this.yylloc.last_line,
258
+ last_line: this.yylineno + 1,
259
+ first_column: this.yylloc.last_column,
260
+ last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length
261
+ }, 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)
262
+ return n;
263
+ if (this._backtrack) {
264
+ for (var s in o)
265
+ this[s] = o[s];
266
+ return !1;
267
+ }
268
+ return !1;
269
+ },
270
+ // return next match in input
271
+ next: function() {
272
+ if (this.done)
273
+ return this.EOF;
274
+ this._input || (this.done = !0);
275
+ var t, i, n, r;
276
+ this._more || (this.yytext = "", this.match = "");
277
+ for (var o = this._currentRules(), s = 0; s < o.length; s++)
278
+ if (n = this._input.match(this.rules[o[s]]), n && (!i || n[0].length > i[0].length)) {
279
+ if (i = n, r = s, this.options.backtrack_lexer) {
280
+ if (t = this.test_match(n, o[s]), t !== !1)
281
+ return t;
282
+ if (this._backtrack) {
283
+ i = !1;
284
+ continue;
285
+ } else
286
+ return !1;
287
+ } else if (!this.options.flex)
288
+ break;
289
+ }
290
+ 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.
291
+ ` + this.showPosition(), {
292
+ text: "",
293
+ token: null,
294
+ line: this.yylineno
295
+ });
296
+ },
297
+ // return next match that has a token
298
+ lex: function() {
299
+ var i = this.next();
300
+ return i || this.lex();
301
+ },
302
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
303
+ begin: function(i) {
304
+ this.conditionStack.push(i);
305
+ },
306
+ // pop the previously active lexer condition state off the condition stack
307
+ popState: function() {
308
+ var i = this.conditionStack.length - 1;
309
+ return i > 0 ? this.conditionStack.pop() : this.conditionStack[0];
310
+ },
311
+ // produce the lexer rule set which is active for the currently active lexer condition state
312
+ _currentRules: function() {
313
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
314
+ },
315
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
316
+ topState: function(i) {
317
+ return i = this.conditionStack.length - 1 - Math.abs(i || 0), i >= 0 ? this.conditionStack[i] : "INITIAL";
318
+ },
319
+ // alias for begin(condition)
320
+ pushState: function(i) {
321
+ this.begin(i);
322
+ },
323
+ // return the number of states currently on the stack
324
+ stateStackSize: function() {
325
+ return this.conditionStack.length;
326
+ },
327
+ options: { "case-insensitive": !0 },
328
+ performAction: function(i, n, r, o) {
329
+ switch (r) {
330
+ case 0:
331
+ break;
332
+ case 1:
333
+ break;
334
+ case 2:
335
+ return 20;
336
+ case 3:
337
+ break;
338
+ case 4:
339
+ break;
340
+ case 5:
341
+ return this.begin("title"), 12;
342
+ case 6:
343
+ return this.popState(), "title_value";
344
+ case 7:
345
+ return this.begin("acc_title"), 14;
346
+ case 8:
347
+ return this.popState(), "acc_title_value";
348
+ case 9:
349
+ return this.begin("acc_descr"), 16;
350
+ case 10:
351
+ return this.popState(), "acc_descr_value";
352
+ case 11:
353
+ this.begin("acc_descr_multiline");
354
+ break;
355
+ case 12:
356
+ this.popState();
357
+ break;
358
+ case 13:
359
+ return "acc_descr_multiline_value";
360
+ case 14:
361
+ this.begin("string");
362
+ break;
363
+ case 15:
364
+ this.popState();
365
+ break;
366
+ case 16:
367
+ return "txt";
368
+ case 17:
369
+ return 5;
370
+ case 18:
371
+ return 7;
372
+ case 19:
373
+ return "value";
374
+ case 20:
375
+ return 22;
376
+ }
377
+ },
378
+ 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],
379
+ 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 } }
380
+ };
381
+ return b;
382
+ })();
383
+ A.lexer = O;
384
+ function w() {
385
+ this.yy = {};
386
+ }
387
+ return w.prototype = A, A.Parser = w, new w();
388
+ })();
389
+ J.parser = J;
390
+ const St = J, $t = mt.pie, G = {
391
+ sections: {},
392
+ showData: !1
393
+ };
394
+ let U = G.sections, K = G.showData;
395
+ const Et = structuredClone($t), At = () => structuredClone(Et), wt = () => {
396
+ U = structuredClone(G.sections), K = G.showData, dt();
397
+ }, Tt = (e, u) => {
398
+ e = gt(e, it()), U[e] === void 0 && (U[e] = u, et.debug(`added new section: ${e}, with value: ${u}`));
399
+ }, It = () => U, Dt = (e) => (e.substring(0, 1) === ":" && (e = e.substring(1).trim()), Number(e.trim())), Ct = (e) => {
400
+ K = e;
401
+ }, Ot = () => K, Vt = {
402
+ getConfig: At,
403
+ clear: wt,
404
+ setDiagramTitle: ht,
405
+ getDiagramTitle: ct,
406
+ setAccTitle: ot,
407
+ getAccTitle: lt,
408
+ setAccDescription: at,
409
+ getAccDescription: rt,
410
+ addSection: Tt,
411
+ getSections: It,
412
+ cleanupValue: Dt,
413
+ setShowData: Ct,
414
+ getShowData: Ot
415
+ }, Pt = (e) => `
416
+ .pieCircle{
417
+ stroke: ${e.pieStrokeColor};
418
+ stroke-width : ${e.pieStrokeWidth};
419
+ opacity : ${e.pieOpacity};
420
+ }
421
+ .pieOuterCircle{
422
+ stroke: ${e.pieOuterStrokeColor};
423
+ stroke-width: ${e.pieOuterStrokeWidth};
424
+ fill: none;
425
+ }
426
+ .pieTitleText {
427
+ text-anchor: middle;
428
+ font-size: ${e.pieTitleTextSize};
429
+ fill: ${e.pieTitleTextColor};
430
+ font-family: ${e.fontFamily};
431
+ }
432
+ .slice {
433
+ font-family: ${e.fontFamily};
434
+ fill: ${e.pieSectionTextColor};
435
+ font-size:${e.pieSectionTextSize};
436
+ // fill: white;
437
+ }
438
+ .legend text {
439
+ fill: ${e.pieLegendTextColor};
440
+ font-family: ${e.fontFamily};
441
+ font-size: ${e.pieLegendTextSize};
442
+ }
443
+ `, Nt = Pt, Lt = (e) => {
444
+ const u = Object.entries(e).map((p) => ({
445
+ label: p[0],
446
+ value: p[1]
447
+ })).sort((p, g) => g.value - p.value);
448
+ return bt().value(
449
+ (p) => p.value
450
+ )(u);
451
+ }, Ft = (e, u, $, p) => {
452
+ et.debug(`rendering pie chart
453
+ ` + e);
454
+ const g = p.db, E = it(), y = ut(g.getConfig(), E.pie), a = 40, l = 18, d = 4, k = 450, I = k, T = yt(u), m = T.append("g"), v = g.getSections();
455
+ m.attr("transform", "translate(" + I / 2 + "," + k / 2 + ")");
456
+ const { themeVariables: c } = E;
457
+ let [A] = ft(c.pieOuterStrokeWidth);
458
+ A ?? (A = 2);
459
+ const O = y.textPosition, w = Math.min(I, k) / 2 - a, b = tt().innerRadius(0).outerRadius(w), t = tt().innerRadius(w * O).outerRadius(w * O);
460
+ m.append("circle").attr("cx", 0).attr("cy", 0).attr("r", w + A / 2).attr("class", "pieOuterCircle");
461
+ const i = Lt(v), n = [
462
+ c.pie1,
463
+ c.pie2,
464
+ c.pie3,
465
+ c.pie4,
466
+ c.pie5,
467
+ c.pie6,
468
+ c.pie7,
469
+ c.pie8,
470
+ c.pie9,
471
+ c.pie10,
472
+ c.pie11,
473
+ c.pie12
474
+ ], r = _t(n);
475
+ m.selectAll("mySlices").data(i).enter().append("path").attr("d", b).attr("fill", (f) => r(f.data.label)).attr("class", "pieCircle");
476
+ let o = 0;
477
+ Object.keys(v).forEach((f) => {
478
+ o += v[f];
479
+ }), m.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"), m.append("text").text(g.getDiagramTitle()).attr("x", 0).attr("y", -400 / 2).attr("class", "pieTitleText");
480
+ const s = m.selectAll(".legend").data(r.domain()).enter().append("g").attr("class", "legend").attr("transform", (f, P) => {
481
+ const R = l + d, M = R * r.domain().length / 2, B = 12 * l, h = P * R - M;
482
+ return "translate(" + B + "," + h + ")";
483
+ });
484
+ 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) => {
485
+ const { label: P, value: R } = f.data;
486
+ return g.getShowData() ? `${P} [${R}]` : P;
487
+ });
488
+ const V = Math.max(
489
+ ...s.selectAll("text").nodes().map((f) => f?.getBoundingClientRect().width ?? 0)
490
+ ), _ = I + a + l + d + V;
491
+ T.attr("viewBox", `0 0 ${_} ${k}`), pt(T, k, _, y.useMaxWidth);
492
+ }, Rt = { draw: Ft }, Ut = {
493
+ parser: St,
494
+ db: Vt,
495
+ renderer: Rt,
496
+ styles: Nt
497
+ };
498
+ export {
499
+ Ut as diagram
500
+ };