@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,903 @@
1
+ import { s as vt, a as Lt, C as bt, D as Ct, b as zt, c as Et, g as yt, l as ot, d as gt, e as Dt, E as It, X as D, Y as Bt, i as wt } from "./index-5_ujiRGo.mjs";
2
+ import { l as mt } from "./linear-DciWi0hE.mjs";
3
+ var pt = (function() {
4
+ var e = function(K, n, r, l) {
5
+ for (r = r || {}, l = K.length; l--; r[K[l]] = n)
6
+ ;
7
+ return r;
8
+ }, s = [1, 3], h = [1, 4], x = [1, 5], f = [1, 6], d = [1, 7], c = [1, 5, 13, 15, 17, 19, 20, 25, 27, 28, 29, 30, 31, 32, 33, 34, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], g = [1, 5, 6, 13, 15, 17, 19, 20, 25, 27, 28, 29, 30, 31, 32, 33, 34, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], i = [32, 33, 34], y = [2, 7], p = [1, 13], B = [1, 17], N = [1, 18], V = [1, 19], I = [1, 20], b = [1, 21], X = [1, 22], M = [1, 23], C = [1, 24], it = [1, 25], at = [1, 26], nt = [1, 27], U = [1, 30], Q = [1, 31], T = [1, 32], m = [1, 33], _ = [1, 34], t = [1, 35], A = [1, 36], S = [1, 37], k = [1, 38], F = [1, 39], P = [1, 40], v = [1, 41], L = [1, 42], O = [1, 57], Y = [1, 58], z = [5, 22, 26, 32, 33, 34, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51], ht = {
9
+ trace: function() {
10
+ },
11
+ yy: {},
12
+ symbols_: { error: 2, start: 3, eol: 4, SPACE: 5, QUADRANT: 6, document: 7, line: 8, statement: 9, axisDetails: 10, quadrantDetails: 11, points: 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, text: 21, point_start: 22, point_x: 23, point_y: 24, "X-AXIS": 25, "AXIS-TEXT-DELIMITER": 26, "Y-AXIS": 27, QUADRANT_1: 28, QUADRANT_2: 29, QUADRANT_3: 30, QUADRANT_4: 31, NEWLINE: 32, SEMI: 33, EOF: 34, alphaNumToken: 35, textNoTagsToken: 36, STR: 37, MD_STR: 38, alphaNum: 39, PUNCTUATION: 40, AMP: 41, NUM: 42, ALPHA: 43, COMMA: 44, PLUS: 45, EQUALS: 46, MULT: 47, DOT: 48, BRKT: 49, UNDERSCORE: 50, MINUS: 51, $accept: 0, $end: 1 },
13
+ terminals_: { 2: "error", 5: "SPACE", 6: "QUADRANT", 13: "title", 14: "title_value", 15: "acc_title", 16: "acc_title_value", 17: "acc_descr", 18: "acc_descr_value", 19: "acc_descr_multiline_value", 20: "section", 22: "point_start", 23: "point_x", 24: "point_y", 25: "X-AXIS", 26: "AXIS-TEXT-DELIMITER", 27: "Y-AXIS", 28: "QUADRANT_1", 29: "QUADRANT_2", 30: "QUADRANT_3", 31: "QUADRANT_4", 32: "NEWLINE", 33: "SEMI", 34: "EOF", 37: "STR", 38: "MD_STR", 40: "PUNCTUATION", 41: "AMP", 42: "NUM", 43: "ALPHA", 44: "COMMA", 45: "PLUS", 46: "EQUALS", 47: "MULT", 48: "DOT", 49: "BRKT", 50: "UNDERSCORE", 51: "MINUS" },
14
+ productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [9, 0], [9, 2], [9, 1], [9, 1], [9, 1], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [12, 4], [10, 4], [10, 3], [10, 2], [10, 4], [10, 3], [10, 2], [11, 2], [11, 2], [11, 2], [11, 2], [4, 1], [4, 1], [4, 1], [21, 1], [21, 2], [21, 1], [21, 1], [39, 1], [39, 2], [35, 1], [35, 1], [35, 1], [35, 1], [35, 1], [35, 1], [35, 1], [35, 1], [35, 1], [35, 1], [35, 1], [36, 1], [36, 1], [36, 1]],
15
+ performAction: function(n, r, l, o, q, a, et) {
16
+ var u = a.length - 1;
17
+ switch (q) {
18
+ case 12:
19
+ this.$ = a[u].trim(), o.setDiagramTitle(this.$);
20
+ break;
21
+ case 13:
22
+ this.$ = a[u].trim(), o.setAccTitle(this.$);
23
+ break;
24
+ case 14:
25
+ case 15:
26
+ this.$ = a[u].trim(), o.setAccDescription(this.$);
27
+ break;
28
+ case 16:
29
+ o.addSection(a[u].substr(8)), this.$ = a[u].substr(8);
30
+ break;
31
+ case 17:
32
+ o.addPoint(a[u - 3], a[u - 1], a[u]);
33
+ break;
34
+ case 18:
35
+ o.setXAxisLeftText(a[u - 2]), o.setXAxisRightText(a[u]);
36
+ break;
37
+ case 19:
38
+ a[u - 1].text += " ⟶ ", o.setXAxisLeftText(a[u - 1]);
39
+ break;
40
+ case 20:
41
+ o.setXAxisLeftText(a[u]);
42
+ break;
43
+ case 21:
44
+ o.setYAxisBottomText(a[u - 2]), o.setYAxisTopText(a[u]);
45
+ break;
46
+ case 22:
47
+ a[u - 1].text += " ⟶ ", o.setYAxisBottomText(a[u - 1]);
48
+ break;
49
+ case 23:
50
+ o.setYAxisBottomText(a[u]);
51
+ break;
52
+ case 24:
53
+ o.setQuadrant1Text(a[u]);
54
+ break;
55
+ case 25:
56
+ o.setQuadrant2Text(a[u]);
57
+ break;
58
+ case 26:
59
+ o.setQuadrant3Text(a[u]);
60
+ break;
61
+ case 27:
62
+ o.setQuadrant4Text(a[u]);
63
+ break;
64
+ case 31:
65
+ this.$ = { text: a[u], type: "text" };
66
+ break;
67
+ case 32:
68
+ this.$ = { text: a[u - 1].text + "" + a[u], type: a[u - 1].type };
69
+ break;
70
+ case 33:
71
+ this.$ = { text: a[u], type: "text" };
72
+ break;
73
+ case 34:
74
+ this.$ = { text: a[u], type: "markdown" };
75
+ break;
76
+ case 35:
77
+ this.$ = a[u];
78
+ break;
79
+ case 36:
80
+ this.$ = a[u - 1] + "" + a[u];
81
+ break;
82
+ }
83
+ },
84
+ table: [{ 3: 1, 4: 2, 5: s, 6: h, 32: x, 33: f, 34: d }, { 1: [3] }, { 3: 8, 4: 2, 5: s, 6: h, 32: x, 33: f, 34: d }, { 3: 9, 4: 2, 5: s, 6: h, 32: x, 33: f, 34: d }, e(c, [2, 4], { 7: 10 }), e(g, [2, 28]), e(g, [2, 29]), e(g, [2, 30]), { 1: [2, 1] }, { 1: [2, 2] }, e(i, y, { 8: 11, 9: 12, 10: 14, 11: 15, 12: 16, 21: 28, 35: 29, 1: [2, 3], 5: p, 13: B, 15: N, 17: V, 19: I, 20: b, 25: X, 27: M, 28: C, 29: it, 30: at, 31: nt, 37: U, 38: Q, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L }), e(c, [2, 5]), { 4: 43, 32: x, 33: f, 34: d }, e(i, y, { 10: 14, 11: 15, 12: 16, 21: 28, 35: 29, 9: 44, 5: p, 13: B, 15: N, 17: V, 19: I, 20: b, 25: X, 27: M, 28: C, 29: it, 30: at, 31: nt, 37: U, 38: Q, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L }), e(i, [2, 9]), e(i, [2, 10]), e(i, [2, 11]), { 14: [1, 45] }, { 16: [1, 46] }, { 18: [1, 47] }, e(i, [2, 15]), e(i, [2, 16]), { 21: 48, 35: 29, 37: U, 38: Q, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L }, { 21: 49, 35: 29, 37: U, 38: Q, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L }, { 21: 50, 35: 29, 37: U, 38: Q, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L }, { 21: 51, 35: 29, 37: U, 38: Q, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L }, { 21: 52, 35: 29, 37: U, 38: Q, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L }, { 21: 53, 35: 29, 37: U, 38: Q, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L }, { 5: O, 22: [1, 54], 35: 56, 36: 55, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L, 51: Y }, e(z, [2, 31]), e(z, [2, 33]), e(z, [2, 34]), e(z, [2, 37]), e(z, [2, 38]), e(z, [2, 39]), e(z, [2, 40]), e(z, [2, 41]), e(z, [2, 42]), e(z, [2, 43]), e(z, [2, 44]), e(z, [2, 45]), e(z, [2, 46]), e(z, [2, 47]), e(c, [2, 6]), e(i, [2, 8]), e(i, [2, 12]), e(i, [2, 13]), e(i, [2, 14]), e(i, [2, 20], { 36: 55, 35: 56, 5: O, 26: [1, 59], 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L, 51: Y }), e(i, [2, 23], { 36: 55, 35: 56, 5: O, 26: [1, 60], 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L, 51: Y }), e(i, [2, 24], { 36: 55, 35: 56, 5: O, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L, 51: Y }), e(i, [2, 25], { 36: 55, 35: 56, 5: O, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L, 51: Y }), e(i, [2, 26], { 36: 55, 35: 56, 5: O, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L, 51: Y }), e(i, [2, 27], { 36: 55, 35: 56, 5: O, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L, 51: Y }), { 23: [1, 61] }, e(z, [2, 32]), e(z, [2, 48]), e(z, [2, 49]), e(z, [2, 50]), e(i, [2, 19], { 35: 29, 21: 62, 37: U, 38: Q, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L }), e(i, [2, 22], { 35: 29, 21: 63, 37: U, 38: Q, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L }), { 24: [1, 64] }, e(i, [2, 18], { 36: 55, 35: 56, 5: O, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L, 51: Y }), e(i, [2, 21], { 36: 55, 35: 56, 5: O, 40: T, 41: m, 42: _, 43: t, 44: A, 45: S, 46: k, 47: F, 48: P, 49: v, 50: L, 51: Y }), e(i, [2, 17])],
85
+ defaultActions: { 8: [2, 1], 9: [2, 2] },
86
+ parseError: function(n, r) {
87
+ if (r.recoverable)
88
+ this.trace(n);
89
+ else {
90
+ var l = new Error(n);
91
+ throw l.hash = r, l;
92
+ }
93
+ },
94
+ parse: function(n) {
95
+ var r = this, l = [0], o = [], q = [null], a = [], et = this.table, u = "", st = 0, qt = 0, St = 2, Tt = 1, kt = a.slice.call(arguments, 1), E = Object.create(this.lexer), Z = { yy: {} };
96
+ for (var dt in this.yy)
97
+ Object.prototype.hasOwnProperty.call(this.yy, dt) && (Z.yy[dt] = this.yy[dt]);
98
+ E.setInput(n, Z.yy), Z.yy.lexer = E, Z.yy.parser = this, typeof E.yylloc > "u" && (E.yylloc = {});
99
+ var ut = E.yylloc;
100
+ a.push(ut);
101
+ var Ft = E.options && E.options.ranges;
102
+ typeof Z.yy.parseError == "function" ? this.parseError = Z.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
103
+ function Pt() {
104
+ var j;
105
+ return j = o.pop() || E.lex() || Tt, typeof j != "number" && (j instanceof Array && (o = j, j = o.pop()), j = r.symbols_[j] || j), j;
106
+ }
107
+ for (var W, J, H, xt, tt = {}, rt, $, _t, lt; ; ) {
108
+ if (J = l[l.length - 1], this.defaultActions[J] ? H = this.defaultActions[J] : ((W === null || typeof W > "u") && (W = Pt()), H = et[J] && et[J][W]), typeof H > "u" || !H.length || !H[0]) {
109
+ var ft = "";
110
+ lt = [];
111
+ for (rt in et[J])
112
+ this.terminals_[rt] && rt > St && lt.push("'" + this.terminals_[rt] + "'");
113
+ E.showPosition ? ft = "Parse error on line " + (st + 1) + `:
114
+ ` + E.showPosition() + `
115
+ Expecting ` + lt.join(", ") + ", got '" + (this.terminals_[W] || W) + "'" : ft = "Parse error on line " + (st + 1) + ": Unexpected " + (W == Tt ? "end of input" : "'" + (this.terminals_[W] || W) + "'"), this.parseError(ft, {
116
+ text: E.match,
117
+ token: this.terminals_[W] || W,
118
+ line: E.yylineno,
119
+ loc: ut,
120
+ expected: lt
121
+ });
122
+ }
123
+ if (H[0] instanceof Array && H.length > 1)
124
+ throw new Error("Parse Error: multiple actions possible at state: " + J + ", token: " + W);
125
+ switch (H[0]) {
126
+ case 1:
127
+ l.push(W), q.push(E.yytext), a.push(E.yylloc), l.push(H[1]), W = null, qt = E.yyleng, u = E.yytext, st = E.yylineno, ut = E.yylloc;
128
+ break;
129
+ case 2:
130
+ if ($ = this.productions_[H[1]][1], tt.$ = q[q.length - $], tt._$ = {
131
+ first_line: a[a.length - ($ || 1)].first_line,
132
+ last_line: a[a.length - 1].last_line,
133
+ first_column: a[a.length - ($ || 1)].first_column,
134
+ last_column: a[a.length - 1].last_column
135
+ }, Ft && (tt._$.range = [
136
+ a[a.length - ($ || 1)].range[0],
137
+ a[a.length - 1].range[1]
138
+ ]), xt = this.performAction.apply(tt, [
139
+ u,
140
+ qt,
141
+ st,
142
+ Z.yy,
143
+ H[1],
144
+ q,
145
+ a
146
+ ].concat(kt)), typeof xt < "u")
147
+ return xt;
148
+ $ && (l = l.slice(0, -1 * $ * 2), q = q.slice(0, -1 * $), a = a.slice(0, -1 * $)), l.push(this.productions_[H[1]][0]), q.push(tt.$), a.push(tt._$), _t = et[l[l.length - 2]][l[l.length - 1]], l.push(_t);
149
+ break;
150
+ case 3:
151
+ return !0;
152
+ }
153
+ }
154
+ return !0;
155
+ }
156
+ }, At = /* @__PURE__ */ (function() {
157
+ var K = {
158
+ EOF: 1,
159
+ parseError: function(r, l) {
160
+ if (this.yy.parser)
161
+ this.yy.parser.parseError(r, l);
162
+ else
163
+ throw new Error(r);
164
+ },
165
+ // resets the lexer, sets new input
166
+ setInput: function(n, r) {
167
+ return this.yy = r || this.yy || {}, this._input = n, 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 n = this._input[0];
177
+ this.yytext += n, this.yyleng++, this.offset++, this.match += n, this.matched += n;
178
+ var r = n.match(/(?:\r\n?|\n).*/g);
179
+ return r ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), n;
180
+ },
181
+ // unshifts one char (or a string) into the input
182
+ unput: function(n) {
183
+ var r = n.length, l = n.split(/(?:\r\n?|\n)/g);
184
+ this._input = n + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - r), this.offset -= r;
185
+ var o = 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), l.length - 1 && (this.yylineno -= l.length - 1);
187
+ var q = 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: l ? (l.length === o.length ? this.yylloc.first_column : 0) + o[o.length - l.length].length - l[0].length : this.yylloc.first_column - r
193
+ }, this.options.ranges && (this.yylloc.range = [q[0], q[0] + this.yyleng - r]), 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(n) {
214
+ this.unput(this.match.slice(n));
215
+ },
216
+ // displays already matched input, i.e. for error messages
217
+ pastInput: function() {
218
+ var n = this.matched.substr(0, this.matched.length - this.match.length);
219
+ return (n.length > 20 ? "..." : "") + n.substr(-20).replace(/\n/g, "");
220
+ },
221
+ // displays upcoming input, i.e. for error messages
222
+ upcomingInput: function() {
223
+ var n = this.match;
224
+ return n.length < 20 && (n += this._input.substr(0, 20 - n.length)), (n.substr(0, 20) + (n.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 n = this.pastInput(), r = new Array(n.length + 1).join("-");
229
+ return n + this.upcomingInput() + `
230
+ ` + r + "^";
231
+ },
232
+ // test the lexed token: return FALSE when not a match, otherwise return token
233
+ test_match: function(n, r) {
234
+ var l, o, q;
235
+ if (this.options.backtrack_lexer && (q = {
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 && (q.yylloc.range = this.yylloc.range.slice(0))), o = n[0].match(/(?:\r\n?|\n).*/g), o && (this.yylineno += o.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: o ? o[o.length - 1].length - o[o.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + n[0].length
259
+ }, this.yytext += n[0], this.match += n[0], this.matches = n, 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(n[0].length), this.matched += n[0], l = this.performAction.call(this, this.yy, this, r, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), l)
260
+ return l;
261
+ if (this._backtrack) {
262
+ for (var a in q)
263
+ this[a] = q[a];
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 n, r, l, o;
274
+ this._more || (this.yytext = "", this.match = "");
275
+ for (var q = this._currentRules(), a = 0; a < q.length; a++)
276
+ if (l = this._input.match(this.rules[q[a]]), l && (!r || l[0].length > r[0].length)) {
277
+ if (r = l, o = a, this.options.backtrack_lexer) {
278
+ if (n = this.test_match(l, q[a]), n !== !1)
279
+ return n;
280
+ if (this._backtrack) {
281
+ r = !1;
282
+ continue;
283
+ } else
284
+ return !1;
285
+ } else if (!this.options.flex)
286
+ break;
287
+ }
288
+ return r ? (n = this.test_match(r, q[o]), n !== !1 ? n : !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 r = this.next();
298
+ return r || this.lex();
299
+ },
300
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
301
+ begin: function(r) {
302
+ this.conditionStack.push(r);
303
+ },
304
+ // pop the previously active lexer condition state off the condition stack
305
+ popState: function() {
306
+ var r = this.conditionStack.length - 1;
307
+ return r > 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(r) {
315
+ return r = this.conditionStack.length - 1 - Math.abs(r || 0), r >= 0 ? this.conditionStack[r] : "INITIAL";
316
+ },
317
+ // alias for begin(condition)
318
+ pushState: function(r) {
319
+ this.begin(r);
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(r, l, o, q) {
327
+ switch (o) {
328
+ case 0:
329
+ break;
330
+ case 1:
331
+ break;
332
+ case 2:
333
+ return 32;
334
+ case 3:
335
+ break;
336
+ case 4:
337
+ return this.begin("title"), 13;
338
+ case 5:
339
+ return this.popState(), "title_value";
340
+ case 6:
341
+ return this.begin("acc_title"), 15;
342
+ case 7:
343
+ return this.popState(), "acc_title_value";
344
+ case 8:
345
+ return this.begin("acc_descr"), 17;
346
+ case 9:
347
+ return this.popState(), "acc_descr_value";
348
+ case 10:
349
+ this.begin("acc_descr_multiline");
350
+ break;
351
+ case 11:
352
+ this.popState();
353
+ break;
354
+ case 12:
355
+ return "acc_descr_multiline_value";
356
+ case 13:
357
+ return 25;
358
+ case 14:
359
+ return 27;
360
+ case 15:
361
+ return 26;
362
+ case 16:
363
+ return 28;
364
+ case 17:
365
+ return 29;
366
+ case 18:
367
+ return 30;
368
+ case 19:
369
+ return 31;
370
+ case 20:
371
+ this.begin("md_string");
372
+ break;
373
+ case 21:
374
+ return "MD_STR";
375
+ case 22:
376
+ this.popState();
377
+ break;
378
+ case 23:
379
+ this.begin("string");
380
+ break;
381
+ case 24:
382
+ this.popState();
383
+ break;
384
+ case 25:
385
+ return "STR";
386
+ case 26:
387
+ return this.begin("point_start"), 22;
388
+ case 27:
389
+ return this.begin("point_x"), 23;
390
+ case 28:
391
+ this.popState();
392
+ break;
393
+ case 29:
394
+ this.popState(), this.begin("point_y");
395
+ break;
396
+ case 30:
397
+ return this.popState(), 24;
398
+ case 31:
399
+ return 6;
400
+ case 32:
401
+ return 43;
402
+ case 33:
403
+ return "COLON";
404
+ case 34:
405
+ return 45;
406
+ case 35:
407
+ return 44;
408
+ case 36:
409
+ return 46;
410
+ case 37:
411
+ return 46;
412
+ case 38:
413
+ return 47;
414
+ case 39:
415
+ return 49;
416
+ case 40:
417
+ return 50;
418
+ case 41:
419
+ return 48;
420
+ case 42:
421
+ return 41;
422
+ case 43:
423
+ return 51;
424
+ case 44:
425
+ return 42;
426
+ case 45:
427
+ return 5;
428
+ case 46:
429
+ return 33;
430
+ case 47:
431
+ return 40;
432
+ case 48:
433
+ return 34;
434
+ }
435
+ },
436
+ rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/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, /^(?: *x-axis *)/i, /^(?: *y-axis *)/i, /^(?: *--+> *)/i, /^(?: *quadrant-1 *)/i, /^(?: *quadrant-2 *)/i, /^(?: *quadrant-3 *)/i, /^(?: *quadrant-4 *)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\s*:\s*\[\s*)/i, /^(?:(1)|(0(.\d+)?))/i, /^(?:\s*\] *)/i, /^(?:\s*,\s*)/i, /^(?:(1)|(0(.\d+)?))/i, /^(?: *quadrantChart *)/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s)/i, /^(?:;)/i, /^(?:[!"#$%&'*+,-.`?\\_/])/i, /^(?:$)/i],
437
+ conditions: { point_y: { rules: [30], inclusive: !1 }, point_x: { rules: [29], inclusive: !1 }, point_start: { rules: [27, 28], inclusive: !1 }, acc_descr_multiline: { rules: [11, 12], inclusive: !1 }, acc_descr: { rules: [9], inclusive: !1 }, acc_title: { rules: [7], inclusive: !1 }, title: { rules: [5], inclusive: !1 }, md_string: { rules: [21, 22], inclusive: !1 }, string: { rules: [24, 25], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 23, 26, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48], inclusive: !0 } }
438
+ };
439
+ return K;
440
+ })();
441
+ ht.lexer = At;
442
+ function ct() {
443
+ this.yy = {};
444
+ }
445
+ return ct.prototype = ht, ht.Parser = ct, new ct();
446
+ })();
447
+ pt.parser = pt;
448
+ const Rt = pt, R = Bt();
449
+ class Vt {
450
+ constructor() {
451
+ this.config = this.getDefaultConfig(), this.themeConfig = this.getDefaultThemeConfig(), this.data = this.getDefaultData();
452
+ }
453
+ getDefaultData() {
454
+ return {
455
+ titleText: "",
456
+ quadrant1Text: "",
457
+ quadrant2Text: "",
458
+ quadrant3Text: "",
459
+ quadrant4Text: "",
460
+ xAxisLeftText: "",
461
+ xAxisRightText: "",
462
+ yAxisBottomText: "",
463
+ yAxisTopText: "",
464
+ points: []
465
+ };
466
+ }
467
+ getDefaultConfig() {
468
+ var s, h, x, f, d, c, g, i, y, p, B, N, V, I, b, X, M, C;
469
+ return {
470
+ showXAxis: !0,
471
+ showYAxis: !0,
472
+ showTitle: !0,
473
+ chartHeight: ((s = D.quadrantChart) == null ? void 0 : s.chartWidth) || 500,
474
+ chartWidth: ((h = D.quadrantChart) == null ? void 0 : h.chartHeight) || 500,
475
+ titlePadding: ((x = D.quadrantChart) == null ? void 0 : x.titlePadding) || 10,
476
+ titleFontSize: ((f = D.quadrantChart) == null ? void 0 : f.titleFontSize) || 20,
477
+ quadrantPadding: ((d = D.quadrantChart) == null ? void 0 : d.quadrantPadding) || 5,
478
+ xAxisLabelPadding: ((c = D.quadrantChart) == null ? void 0 : c.xAxisLabelPadding) || 5,
479
+ yAxisLabelPadding: ((g = D.quadrantChart) == null ? void 0 : g.yAxisLabelPadding) || 5,
480
+ xAxisLabelFontSize: ((i = D.quadrantChart) == null ? void 0 : i.xAxisLabelFontSize) || 16,
481
+ yAxisLabelFontSize: ((y = D.quadrantChart) == null ? void 0 : y.yAxisLabelFontSize) || 16,
482
+ quadrantLabelFontSize: ((p = D.quadrantChart) == null ? void 0 : p.quadrantLabelFontSize) || 16,
483
+ quadrantTextTopPadding: ((B = D.quadrantChart) == null ? void 0 : B.quadrantTextTopPadding) || 5,
484
+ pointTextPadding: ((N = D.quadrantChart) == null ? void 0 : N.pointTextPadding) || 5,
485
+ pointLabelFontSize: ((V = D.quadrantChart) == null ? void 0 : V.pointLabelFontSize) || 12,
486
+ pointRadius: ((I = D.quadrantChart) == null ? void 0 : I.pointRadius) || 5,
487
+ xAxisPosition: ((b = D.quadrantChart) == null ? void 0 : b.xAxisPosition) || "top",
488
+ yAxisPosition: ((X = D.quadrantChart) == null ? void 0 : X.yAxisPosition) || "left",
489
+ quadrantInternalBorderStrokeWidth: ((M = D.quadrantChart) == null ? void 0 : M.quadrantInternalBorderStrokeWidth) || 1,
490
+ quadrantExternalBorderStrokeWidth: ((C = D.quadrantChart) == null ? void 0 : C.quadrantExternalBorderStrokeWidth) || 2
491
+ };
492
+ }
493
+ getDefaultThemeConfig() {
494
+ return {
495
+ quadrant1Fill: R.quadrant1Fill,
496
+ quadrant2Fill: R.quadrant2Fill,
497
+ quadrant3Fill: R.quadrant3Fill,
498
+ quadrant4Fill: R.quadrant4Fill,
499
+ quadrant1TextFill: R.quadrant1TextFill,
500
+ quadrant2TextFill: R.quadrant2TextFill,
501
+ quadrant3TextFill: R.quadrant3TextFill,
502
+ quadrant4TextFill: R.quadrant4TextFill,
503
+ quadrantPointFill: R.quadrantPointFill,
504
+ quadrantPointTextFill: R.quadrantPointTextFill,
505
+ quadrantXAxisTextFill: R.quadrantXAxisTextFill,
506
+ quadrantYAxisTextFill: R.quadrantYAxisTextFill,
507
+ quadrantTitleFill: R.quadrantTitleFill,
508
+ quadrantInternalBorderStrokeFill: R.quadrantInternalBorderStrokeFill,
509
+ quadrantExternalBorderStrokeFill: R.quadrantExternalBorderStrokeFill
510
+ };
511
+ }
512
+ clear() {
513
+ this.config = this.getDefaultConfig(), this.themeConfig = this.getDefaultThemeConfig(), this.data = this.getDefaultData(), ot.info("clear called");
514
+ }
515
+ setData(s) {
516
+ this.data = { ...this.data, ...s };
517
+ }
518
+ addPoints(s) {
519
+ this.data.points = [...s, ...this.data.points];
520
+ }
521
+ setConfig(s) {
522
+ ot.trace("setConfig called with: ", s), this.config = { ...this.config, ...s };
523
+ }
524
+ setThemeConfig(s) {
525
+ ot.trace("setThemeConfig called with: ", s), this.themeConfig = { ...this.themeConfig, ...s };
526
+ }
527
+ calculateSpace(s, h, x, f) {
528
+ const d = this.config.xAxisLabelPadding * 2 + this.config.xAxisLabelFontSize, c = {
529
+ top: s === "top" && h ? d : 0,
530
+ bottom: s === "bottom" && h ? d : 0
531
+ }, g = this.config.yAxisLabelPadding * 2 + this.config.yAxisLabelFontSize, i = {
532
+ left: this.config.yAxisPosition === "left" && x ? g : 0,
533
+ right: this.config.yAxisPosition === "right" && x ? g : 0
534
+ }, y = this.config.titleFontSize + this.config.titlePadding * 2, p = {
535
+ top: f ? y : 0
536
+ }, B = this.config.quadrantPadding + i.left, N = this.config.quadrantPadding + c.top + p.top, V = this.config.chartWidth - this.config.quadrantPadding * 2 - i.left - i.right, I = this.config.chartHeight - this.config.quadrantPadding * 2 - c.top - c.bottom - p.top, b = V / 2, X = I / 2;
537
+ return {
538
+ xAxisSpace: c,
539
+ yAxisSpace: i,
540
+ titleSpace: p,
541
+ quadrantSpace: {
542
+ quadrantLeft: B,
543
+ quadrantTop: N,
544
+ quadrantWidth: V,
545
+ quadrantHalfWidth: b,
546
+ quadrantHeight: I,
547
+ quadrantHalfHeight: X
548
+ }
549
+ };
550
+ }
551
+ getAxisLabels(s, h, x, f) {
552
+ const { quadrantSpace: d, titleSpace: c } = f, {
553
+ quadrantHalfHeight: g,
554
+ quadrantHeight: i,
555
+ quadrantLeft: y,
556
+ quadrantHalfWidth: p,
557
+ quadrantTop: B,
558
+ quadrantWidth: N
559
+ } = d, V = !!this.data.xAxisRightText, I = !!this.data.yAxisTopText, b = [];
560
+ return this.data.xAxisLeftText && h && b.push({
561
+ text: this.data.xAxisLeftText,
562
+ fill: this.themeConfig.quadrantXAxisTextFill,
563
+ x: y + (V ? p / 2 : 0),
564
+ y: s === "top" ? this.config.xAxisLabelPadding + c.top : this.config.xAxisLabelPadding + B + i + this.config.quadrantPadding,
565
+ fontSize: this.config.xAxisLabelFontSize,
566
+ verticalPos: V ? "center" : "left",
567
+ horizontalPos: "top",
568
+ rotation: 0
569
+ }), this.data.xAxisRightText && h && b.push({
570
+ text: this.data.xAxisRightText,
571
+ fill: this.themeConfig.quadrantXAxisTextFill,
572
+ x: y + p + (V ? p / 2 : 0),
573
+ y: s === "top" ? this.config.xAxisLabelPadding + c.top : this.config.xAxisLabelPadding + B + i + this.config.quadrantPadding,
574
+ fontSize: this.config.xAxisLabelFontSize,
575
+ verticalPos: V ? "center" : "left",
576
+ horizontalPos: "top",
577
+ rotation: 0
578
+ }), this.data.yAxisBottomText && x && b.push({
579
+ text: this.data.yAxisBottomText,
580
+ fill: this.themeConfig.quadrantYAxisTextFill,
581
+ x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + y + N + this.config.quadrantPadding,
582
+ y: B + i - (I ? g / 2 : 0),
583
+ fontSize: this.config.yAxisLabelFontSize,
584
+ verticalPos: I ? "center" : "left",
585
+ horizontalPos: "top",
586
+ rotation: -90
587
+ }), this.data.yAxisTopText && x && b.push({
588
+ text: this.data.yAxisTopText,
589
+ fill: this.themeConfig.quadrantYAxisTextFill,
590
+ x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + y + N + this.config.quadrantPadding,
591
+ y: B + g - (I ? g / 2 : 0),
592
+ fontSize: this.config.yAxisLabelFontSize,
593
+ verticalPos: I ? "center" : "left",
594
+ horizontalPos: "top",
595
+ rotation: -90
596
+ }), b;
597
+ }
598
+ getQuadrants(s) {
599
+ const { quadrantSpace: h } = s, { quadrantHalfHeight: x, quadrantLeft: f, quadrantHalfWidth: d, quadrantTop: c } = h, g = [
600
+ {
601
+ text: {
602
+ text: this.data.quadrant1Text,
603
+ fill: this.themeConfig.quadrant1TextFill,
604
+ x: 0,
605
+ y: 0,
606
+ fontSize: this.config.quadrantLabelFontSize,
607
+ verticalPos: "center",
608
+ horizontalPos: "middle",
609
+ rotation: 0
610
+ },
611
+ x: f + d,
612
+ y: c,
613
+ width: d,
614
+ height: x,
615
+ fill: this.themeConfig.quadrant1Fill
616
+ },
617
+ {
618
+ text: {
619
+ text: this.data.quadrant2Text,
620
+ fill: this.themeConfig.quadrant2TextFill,
621
+ x: 0,
622
+ y: 0,
623
+ fontSize: this.config.quadrantLabelFontSize,
624
+ verticalPos: "center",
625
+ horizontalPos: "middle",
626
+ rotation: 0
627
+ },
628
+ x: f,
629
+ y: c,
630
+ width: d,
631
+ height: x,
632
+ fill: this.themeConfig.quadrant2Fill
633
+ },
634
+ {
635
+ text: {
636
+ text: this.data.quadrant3Text,
637
+ fill: this.themeConfig.quadrant3TextFill,
638
+ x: 0,
639
+ y: 0,
640
+ fontSize: this.config.quadrantLabelFontSize,
641
+ verticalPos: "center",
642
+ horizontalPos: "middle",
643
+ rotation: 0
644
+ },
645
+ x: f,
646
+ y: c + x,
647
+ width: d,
648
+ height: x,
649
+ fill: this.themeConfig.quadrant3Fill
650
+ },
651
+ {
652
+ text: {
653
+ text: this.data.quadrant4Text,
654
+ fill: this.themeConfig.quadrant4TextFill,
655
+ x: 0,
656
+ y: 0,
657
+ fontSize: this.config.quadrantLabelFontSize,
658
+ verticalPos: "center",
659
+ horizontalPos: "middle",
660
+ rotation: 0
661
+ },
662
+ x: f + d,
663
+ y: c + x,
664
+ width: d,
665
+ height: x,
666
+ fill: this.themeConfig.quadrant4Fill
667
+ }
668
+ ];
669
+ for (const i of g)
670
+ i.text.x = i.x + i.width / 2, this.data.points.length === 0 ? (i.text.y = i.y + i.height / 2, i.text.horizontalPos = "middle") : (i.text.y = i.y + this.config.quadrantTextTopPadding, i.text.horizontalPos = "top");
671
+ return g;
672
+ }
673
+ getQuadrantPoints(s) {
674
+ const { quadrantSpace: h } = s, { quadrantHeight: x, quadrantLeft: f, quadrantTop: d, quadrantWidth: c } = h, g = mt().domain([0, 1]).range([f, c + f]), i = mt().domain([0, 1]).range([x + d, d]);
675
+ return this.data.points.map((p) => ({
676
+ x: g(p.x),
677
+ y: i(p.y),
678
+ fill: this.themeConfig.quadrantPointFill,
679
+ radius: this.config.pointRadius,
680
+ text: {
681
+ text: p.text,
682
+ fill: this.themeConfig.quadrantPointTextFill,
683
+ x: g(p.x),
684
+ y: i(p.y) + this.config.pointTextPadding,
685
+ verticalPos: "center",
686
+ horizontalPos: "top",
687
+ fontSize: this.config.pointLabelFontSize,
688
+ rotation: 0
689
+ }
690
+ }));
691
+ }
692
+ getBorders(s) {
693
+ const h = this.config.quadrantExternalBorderStrokeWidth / 2, { quadrantSpace: x } = s, {
694
+ quadrantHalfHeight: f,
695
+ quadrantHeight: d,
696
+ quadrantLeft: c,
697
+ quadrantHalfWidth: g,
698
+ quadrantTop: i,
699
+ quadrantWidth: y
700
+ } = x;
701
+ return [
702
+ // top border
703
+ {
704
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
705
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
706
+ x1: c - h,
707
+ y1: i,
708
+ x2: c + y + h,
709
+ y2: i
710
+ },
711
+ // right border
712
+ {
713
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
714
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
715
+ x1: c + y,
716
+ y1: i + h,
717
+ x2: c + y,
718
+ y2: i + d - h
719
+ },
720
+ // bottom border
721
+ {
722
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
723
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
724
+ x1: c - h,
725
+ y1: i + d,
726
+ x2: c + y + h,
727
+ y2: i + d
728
+ },
729
+ // left border
730
+ {
731
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
732
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
733
+ x1: c,
734
+ y1: i + h,
735
+ x2: c,
736
+ y2: i + d - h
737
+ },
738
+ // vertical inner border
739
+ {
740
+ strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
741
+ strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
742
+ x1: c + g,
743
+ y1: i + h,
744
+ x2: c + g,
745
+ y2: i + d - h
746
+ },
747
+ // horizontal inner border
748
+ {
749
+ strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
750
+ strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
751
+ x1: c + h,
752
+ y1: i + f,
753
+ x2: c + y - h,
754
+ y2: i + f
755
+ }
756
+ ];
757
+ }
758
+ getTitle(s) {
759
+ if (s)
760
+ return {
761
+ text: this.data.titleText,
762
+ fill: this.themeConfig.quadrantTitleFill,
763
+ fontSize: this.config.titleFontSize,
764
+ horizontalPos: "top",
765
+ verticalPos: "center",
766
+ rotation: 0,
767
+ y: this.config.titlePadding,
768
+ x: this.config.chartWidth / 2
769
+ };
770
+ }
771
+ build() {
772
+ const s = this.config.showXAxis && !!(this.data.xAxisLeftText || this.data.xAxisRightText), h = this.config.showYAxis && !!(this.data.yAxisTopText || this.data.yAxisBottomText), x = this.config.showTitle && !!this.data.titleText, f = this.data.points.length > 0 ? "bottom" : this.config.xAxisPosition, d = this.calculateSpace(f, s, h, x);
773
+ return {
774
+ points: this.getQuadrantPoints(d),
775
+ quadrants: this.getQuadrants(d),
776
+ axisLabels: this.getAxisLabels(f, s, h, d),
777
+ borderLines: this.getBorders(d),
778
+ title: this.getTitle(x)
779
+ };
780
+ }
781
+ }
782
+ const Wt = yt();
783
+ function G(e) {
784
+ return wt(e.trim(), Wt);
785
+ }
786
+ const w = new Vt();
787
+ function Nt(e) {
788
+ w.setData({ quadrant1Text: G(e.text) });
789
+ }
790
+ function Ut(e) {
791
+ w.setData({ quadrant2Text: G(e.text) });
792
+ }
793
+ function Qt(e) {
794
+ w.setData({ quadrant3Text: G(e.text) });
795
+ }
796
+ function Ht(e) {
797
+ w.setData({ quadrant4Text: G(e.text) });
798
+ }
799
+ function Xt(e) {
800
+ w.setData({ xAxisLeftText: G(e.text) });
801
+ }
802
+ function Mt(e) {
803
+ w.setData({ xAxisRightText: G(e.text) });
804
+ }
805
+ function Ot(e) {
806
+ w.setData({ yAxisTopText: G(e.text) });
807
+ }
808
+ function Yt(e) {
809
+ w.setData({ yAxisBottomText: G(e.text) });
810
+ }
811
+ function $t(e, s, h) {
812
+ w.addPoints([{ x: s, y: h, text: G(e.text) }]);
813
+ }
814
+ function jt(e) {
815
+ w.setConfig({ chartWidth: e });
816
+ }
817
+ function Gt(e) {
818
+ w.setConfig({ chartHeight: e });
819
+ }
820
+ function Kt() {
821
+ const e = yt(), { themeVariables: s, quadrantChart: h } = e;
822
+ return h && w.setConfig(h), w.setThemeConfig({
823
+ quadrant1Fill: s.quadrant1Fill,
824
+ quadrant2Fill: s.quadrant2Fill,
825
+ quadrant3Fill: s.quadrant3Fill,
826
+ quadrant4Fill: s.quadrant4Fill,
827
+ quadrant1TextFill: s.quadrant1TextFill,
828
+ quadrant2TextFill: s.quadrant2TextFill,
829
+ quadrant3TextFill: s.quadrant3TextFill,
830
+ quadrant4TextFill: s.quadrant4TextFill,
831
+ quadrantPointFill: s.quadrantPointFill,
832
+ quadrantPointTextFill: s.quadrantPointTextFill,
833
+ quadrantXAxisTextFill: s.quadrantXAxisTextFill,
834
+ quadrantYAxisTextFill: s.quadrantYAxisTextFill,
835
+ quadrantExternalBorderStrokeFill: s.quadrantExternalBorderStrokeFill,
836
+ quadrantInternalBorderStrokeFill: s.quadrantInternalBorderStrokeFill,
837
+ quadrantTitleFill: s.quadrantTitleFill
838
+ }), w.setData({ titleText: bt() }), w.build();
839
+ }
840
+ const Zt = function() {
841
+ w.clear(), It();
842
+ }, Jt = {
843
+ setWidth: jt,
844
+ setHeight: Gt,
845
+ setQuadrant1Text: Nt,
846
+ setQuadrant2Text: Ut,
847
+ setQuadrant3Text: Qt,
848
+ setQuadrant4Text: Ht,
849
+ setXAxisLeftText: Xt,
850
+ setXAxisRightText: Mt,
851
+ setYAxisTopText: Ot,
852
+ setYAxisBottomText: Yt,
853
+ addPoint: $t,
854
+ getQuadrantData: Kt,
855
+ clear: Zt,
856
+ setAccTitle: Et,
857
+ getAccTitle: zt,
858
+ setDiagramTitle: Ct,
859
+ getDiagramTitle: bt,
860
+ getAccDescription: Lt,
861
+ setAccDescription: vt
862
+ }, te = (e, s, h, x) => {
863
+ var f, d, c;
864
+ function g(t) {
865
+ return t === "top" ? "hanging" : "middle";
866
+ }
867
+ function i(t) {
868
+ return t === "left" ? "start" : "middle";
869
+ }
870
+ function y(t) {
871
+ return `translate(${t.x}, ${t.y}) rotate(${t.rotation || 0})`;
872
+ }
873
+ const p = yt();
874
+ ot.debug(`Rendering quadrant chart
875
+ ` + e);
876
+ const B = p.securityLevel;
877
+ let N;
878
+ B === "sandbox" && (N = gt("#i" + s));
879
+ const I = (B === "sandbox" ? gt(N.nodes()[0].contentDocument.body) : gt("body")).select(`[id="${s}"]`), b = I.append("g").attr("class", "main"), X = ((f = p.quadrantChart) == null ? void 0 : f.chartWidth) || 500, M = ((d = p.quadrantChart) == null ? void 0 : d.chartHeight) || 500;
880
+ Dt(I, M, X, ((c = p.quadrantChart) == null ? void 0 : c.useMaxWidth) || !0), I.attr("viewBox", "0 0 " + X + " " + M), x.db.setHeight(M), x.db.setWidth(X);
881
+ const C = x.db.getQuadrantData(), it = b.append("g").attr("class", "quadrants"), at = b.append("g").attr("class", "border"), nt = b.append("g").attr("class", "data-points"), U = b.append("g").attr("class", "labels"), Q = b.append("g").attr("class", "title");
882
+ C.title && Q.append("text").attr("x", 0).attr("y", 0).attr("fill", C.title.fill).attr("font-size", C.title.fontSize).attr("dominant-baseline", g(C.title.horizontalPos)).attr("text-anchor", i(C.title.verticalPos)).attr("transform", y(C.title)).text(C.title.text), C.borderLines && at.selectAll("line").data(C.borderLines).enter().append("line").attr("x1", (t) => t.x1).attr("y1", (t) => t.y1).attr("x2", (t) => t.x2).attr("y2", (t) => t.y2).style("stroke", (t) => t.strokeFill).style("stroke-width", (t) => t.strokeWidth);
883
+ const T = it.selectAll("g.quadrant").data(C.quadrants).enter().append("g").attr("class", "quadrant");
884
+ T.append("rect").attr("x", (t) => t.x).attr("y", (t) => t.y).attr("width", (t) => t.width).attr("height", (t) => t.height).attr("fill", (t) => t.fill), T.append("text").attr("x", 0).attr("y", 0).attr("fill", (t) => t.text.fill).attr("font-size", (t) => t.text.fontSize).attr(
885
+ "dominant-baseline",
886
+ (t) => g(t.text.horizontalPos)
887
+ ).attr("text-anchor", (t) => i(t.text.verticalPos)).attr("transform", (t) => y(t.text)).text((t) => t.text.text), U.selectAll("g.label").data(C.axisLabels).enter().append("g").attr("class", "label").append("text").attr("x", 0).attr("y", 0).text((t) => t.text).attr("fill", (t) => t.fill).attr("font-size", (t) => t.fontSize).attr("dominant-baseline", (t) => g(t.horizontalPos)).attr("text-anchor", (t) => i(t.verticalPos)).attr("transform", (t) => y(t));
888
+ const _ = nt.selectAll("g.data-point").data(C.points).enter().append("g").attr("class", "data-point");
889
+ _.append("circle").attr("cx", (t) => t.x).attr("cy", (t) => t.y).attr("r", (t) => t.radius).attr("fill", (t) => t.fill), _.append("text").attr("x", 0).attr("y", 0).text((t) => t.text.text).attr("fill", (t) => t.text.fill).attr("font-size", (t) => t.text.fontSize).attr(
890
+ "dominant-baseline",
891
+ (t) => g(t.text.horizontalPos)
892
+ ).attr("text-anchor", (t) => i(t.text.verticalPos)).attr("transform", (t) => y(t.text));
893
+ }, ee = {
894
+ draw: te
895
+ }, ne = {
896
+ parser: Rt,
897
+ db: Jt,
898
+ renderer: ee,
899
+ styles: () => ""
900
+ };
901
+ export {
902
+ ne as diagram
903
+ };