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