UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

1,755 lines 64.1 kB
import { n as a } from "./chunk-Y2CYZVJY-0JxdZxki.js"; import { m as It } from "./src-DtRLxcYO.js"; import { D as ai, H as ni, K as oi, U as ri, a as hi, b as pt, c as li, f as ci, v as ui, w as Mt, y as gi, z as xi } from "./chunk-WYO6CB5R-DDHkKowO.js"; import { t as Lt } from "./linear-B2AM4ZBe.js"; import { t as di } from "./ordinal-BMN81JG2.js"; import { t as fi } from "./init-1VpIn1S3.js"; import { i as zt } from "./chunk-ICXQ74PX-DR8rL-xF.js"; import { t as vt } from "./line-BIPmUVxO.js"; import { t as pi } from "./chunk-VAUOI2AC-izt0o4id.js"; import "./chunk-HOUHSVGY-DRQcQeMT.js"; import { t as mi } from "./chunk-Q4XR5HBZ-3BHjjc9u.js"; function yi(t, i, s) { t = +t, i = +i, s = (n = arguments.length) < 2 ? (i = t, t = 0, 1) : n < 3 ? 1 : +s; for (var e = -1, n = Math.max(0, Math.ceil((i - t) / s)) | 0, c = new Array(n); ++e < n; ) c[e] = t + e * s; return c; } function ut() { var t = di().unknown(void 0), i = t.domain, s = t.range, e = 0, n = 1, c, l, f = !1, S = 0, T = 0, P = 0.5; delete t.unknown; function _() { var y = i().length, M = n < e, v = M ? n : e, E = M ? e : n; c = (E - v) / Math.max(1, y - S + T * 2), f && (c = Math.floor(c)), v += (E - v - c * (y - S)) * P, l = c * (1 - S), f && (v = Math.round(v), l = Math.round(l)); var z = yi(y).map(function(p) { return v + c * p; }); return s(M ? z.reverse() : z); } return t.domain = function(y) { return arguments.length ? (i(y), _()) : i(); }, t.range = function(y) { return arguments.length ? ([e, n] = y, e = +e, n = +n, _()) : [e, n]; }, t.rangeRound = function(y) { return [e, n] = y, e = +e, n = +n, f = !0, _(); }, t.bandwidth = function() { return l; }, t.step = function() { return c; }, t.round = function(y) { return arguments.length ? (f = !!y, _()) : f; }, t.padding = function(y) { return arguments.length ? (S = Math.min(1, T = +y), _()) : S; }, t.paddingInner = function(y) { return arguments.length ? (S = Math.min(1, y), _()) : S; }, t.paddingOuter = function(y) { return arguments.length ? (T = +y, _()) : T; }, t.align = function(y) { return arguments.length ? (P = Math.max(0, Math.min(1, y)), _()) : P; }, t.copy = function() { return ut(i(), [e, n]).round(f).paddingInner(S).paddingOuter(T).align(P); }, fi.apply(_(), arguments); } var gt = (function() { var t = /* @__PURE__ */ a(function(o, u, A, g) { for (A = A || {}, g = o.length; g--; A[o[g]] = u) ; return A; }, "o"), i = [ 1, 10, 12, 14, 16, 18, 19, 21, 23 ], s = [2, 6], e = [1, 3], n = [1, 5], c = [1, 6], l = [1, 7], f = [ 1, 5, 10, 12, 14, 16, 18, 19, 21, 23, 36, 37, 38 ], S = [1, 25], T = [1, 26], P = [1, 28], _ = [1, 29], y = [1, 30], M = [1, 31], v = [1, 32], E = [1, 33], z = [1, 34], p = [1, 35], D = [1, 36], h = [1, 37], V = [1, 43], F = [1, 42], X = [1, 47], Y = [1, 50], C = [ 1, 10, 12, 14, 16, 18, 19, 21, 23, 36, 37, 38 ], U = [ 1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 28, 29, 36, 37, 38 ], b = [ 1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 28, 29, 36, 37, 38, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 ], w = [1, 65], B = [26, 28], R = { trace: /* @__PURE__ */ a(function() { }, "trace"), yy: {}, symbols_: { error: 2, start: 3, eol: 4, XYCHART: 5, chartConfig: 6, document: 7, CHART_ORIENTATION: 8, statement: 9, title: 10, text: 11, X_AXIS: 12, parseXAxis: 13, Y_AXIS: 14, parseYAxis: 15, LINE: 16, plotData: 17, BAR: 18, acc_title: 19, acc_title_value: 20, acc_descr: 21, acc_descr_value: 22, acc_descr_multiline_value: 23, SQUARE_BRACES_START: 24, dataPoints: 25, SQUARE_BRACES_END: 26, dataPoint: 27, COMMA: 28, NUMBER_WITH_DECIMAL: 29, STR: 30, xAxisData: 31, bandData: 32, ARROW_DELIMITER: 33, commaSeparatedTexts: 34, yAxisData: 35, NEWLINE: 36, SEMI: 37, EOF: 38, alphaNum: 39, MD_STR: 40, alphaNumToken: 41, AMP: 42, NUM: 43, ALPHA: 44, PLUS: 45, EQUALS: 46, MULT: 47, DOT: 48, BRKT: 49, MINUS: 50, UNDERSCORE: 51, $accept: 0, $end: 1 }, terminals_: { 2: "error", 5: "XYCHART", 8: "CHART_ORIENTATION", 10: "title", 12: "X_AXIS", 14: "Y_AXIS", 16: "LINE", 18: "BAR", 19: "acc_title", 20: "acc_title_value", 21: "acc_descr", 22: "acc_descr_value", 23: "acc_descr_multiline_value", 24: "SQUARE_BRACES_START", 26: "SQUARE_BRACES_END", 28: "COMMA", 29: "NUMBER_WITH_DECIMAL", 30: "STR", 33: "ARROW_DELIMITER", 36: "NEWLINE", 37: "SEMI", 38: "EOF", 40: "MD_STR", 42: "AMP", 43: "NUM", 44: "ALPHA", 45: "PLUS", 46: "EQUALS", 47: "MULT", 48: "DOT", 49: "BRKT", 50: "MINUS", 51: "UNDERSCORE" }, productions_: [ 0, [3, 2], [3, 3], [3, 2], [3, 1], [6, 1], [7, 0], [7, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 3], [9, 2], [9, 3], [9, 2], [9, 2], [9, 1], [17, 3], [25, 3], [25, 1], [27, 2], [27, 1], [13, 1], [13, 2], [13, 1], [31, 1], [31, 3], [32, 3], [34, 3], [34, 1], [15, 1], [15, 2], [15, 1], [35, 3], [4, 1], [4, 1], [4, 1], [11, 1], [11, 1], [11, 1], [39, 1], [39, 2], [41, 1], [41, 1], [41, 1], [41, 1], [41, 1], [41, 1], [41, 1], [41, 1], [41, 1], [41, 1] ], performAction: /* @__PURE__ */ a(function(u, A, g, x, k, r, Q) { var d = r.length - 1; switch (k) { case 5: x.setOrientation(r[d]); break; case 9: x.setDiagramTitle(r[d].text.trim()); break; case 12: x.setLineData({ text: "", type: "text" }, r[d]); break; case 13: x.setLineData(r[d - 1], r[d]); break; case 14: x.setBarData({ text: "", type: "text" }, r[d]); break; case 15: x.setBarData(r[d - 1], r[d]); break; case 16: this.$ = r[d].trim(), x.setAccTitle(this.$); break; case 17: case 18: this.$ = r[d].trim(), x.setAccDescription(this.$); break; case 19: this.$ = r[d - 1]; break; case 20: case 30: this.$ = [r[d - 2], ...r[d]]; break; case 21: case 31: this.$ = [r[d]]; break; case 22: this.$ = { value: Number(r[d - 1]), label: r[d] }; break; case 23: this.$ = { value: Number(r[d]), label: "" }; break; case 24: x.setXAxisTitle(r[d]); break; case 25: x.setXAxisTitle(r[d - 1]); break; case 26: x.setXAxisTitle({ type: "text", text: "" }); break; case 27: x.setXAxisBand(r[d]); break; case 28: x.setXAxisRangeData(Number(r[d - 2]), Number(r[d])); break; case 29: this.$ = r[d - 1]; break; case 32: x.setYAxisTitle(r[d]); break; case 33: x.setYAxisTitle(r[d - 1]); break; case 34: x.setYAxisTitle({ type: "text", text: "" }); break; case 35: x.setYAxisRangeData(Number(r[d - 2]), Number(r[d])); break; case 39: this.$ = { text: r[d], type: "text" }; break; case 40: this.$ = { text: r[d], type: "text" }; break; case 41: this.$ = { text: r[d], type: "markdown" }; break; case 42: this.$ = r[d]; break; case 43: this.$ = r[d - 1] + "" + r[d]; break; } }, "anonymous"), table: [ t(i, s, { 3: 1, 4: 2, 7: 4, 5: e, 36: n, 37: c, 38: l }), { 1: [3] }, t(i, s, { 4: 2, 7: 4, 3: 8, 5: e, 36: n, 37: c, 38: l }), t(i, s, { 4: 2, 7: 4, 6: 9, 3: 10, 5: e, 8: [1, 11], 36: n, 37: c, 38: l }), { 1: [2, 4], 9: 12, 10: [1, 13], 12: [1, 14], 14: [1, 15], 16: [1, 16], 18: [1, 17], 19: [1, 18], 21: [1, 19], 23: [1, 20] }, t(f, [2, 36]), t(f, [2, 37]), t(f, [2, 38]), { 1: [2, 1] }, t(i, s, { 4: 2, 7: 4, 3: 21, 5: e, 36: n, 37: c, 38: l }), { 1: [2, 3] }, t(f, [2, 5]), t(i, [2, 7], { 4: 22, 36: n, 37: c, 38: l }), { 11: 23, 30: S, 39: 24, 40: T, 41: 27, 42: P, 43: _, 44: y, 45: M, 46: v, 47: E, 48: z, 49: p, 50: D, 51: h }, { 11: 39, 13: 38, 24: V, 29: F, 30: S, 31: 40, 32: 41, 39: 24, 40: T, 41: 27, 42: P, 43: _, 44: y, 45: M, 46: v, 47: E, 48: z, 49: p, 50: D, 51: h }, { 11: 45, 15: 44, 29: X, 30: S, 35: 46, 39: 24, 40: T, 41: 27, 42: P, 43: _, 44: y, 45: M, 46: v, 47: E, 48: z, 49: p, 50: D, 51: h }, { 11: 49, 17: 48, 24: Y, 30: S, 39: 24, 40: T, 41: 27, 42: P, 43: _, 44: y, 45: M, 46: v, 47: E, 48: z, 49: p, 50: D, 51: h }, { 11: 52, 17: 51, 24: Y, 30: S, 39: 24, 40: T, 41: 27, 42: P, 43: _, 44: y, 45: M, 46: v, 47: E, 48: z, 49: p, 50: D, 51: h }, { 20: [1, 53] }, { 22: [1, 54] }, t(C, [2, 18]), { 1: [2, 2] }, t(C, [2, 8]), t(C, [2, 9]), t(U, [2, 39], { 41: 55, 42: P, 43: _, 44: y, 45: M, 46: v, 47: E, 48: z, 49: p, 50: D, 51: h }), t(U, [2, 40]), t(U, [2, 41]), t(b, [2, 42]), t(b, [2, 44]), t(b, [2, 45]), t(b, [2, 46]), t(b, [2, 47]), t(b, [2, 48]), t(b, [2, 49]), t(b, [2, 50]), t(b, [2, 51]), t(b, [2, 52]), t(b, [2, 53]), t(C, [2, 10]), t(C, [2, 24], { 32: 41, 31: 56, 24: V, 29: F }), t(C, [2, 26]), t(C, [2, 27]), { 33: [1, 57] }, { 11: 59, 30: S, 34: 58, 39: 24, 40: T, 41: 27, 42: P, 43: _, 44: y, 45: M, 46: v, 47: E, 48: z, 49: p, 50: D, 51: h }, t(C, [2, 11]), t(C, [2, 32], { 35: 60, 29: X }), t(C, [2, 34]), { 33: [1, 61] }, t(C, [2, 12]), { 17: 62, 24: Y }, { 25: 63, 27: 64, 29: w }, t(C, [2, 14]), { 17: 66, 24: Y }, t(C, [2, 16]), t(C, [2, 17]), t(b, [2, 43]), t(C, [2, 25]), { 29: [1, 67] }, { 26: [1, 68] }, { 26: [2, 31], 28: [1, 69] }, t(C, [2, 33]), { 29: [1, 70] }, t(C, [2, 13]), { 26: [1, 71] }, { 26: [2, 21], 28: [1, 72] }, t(B, [2, 23], { 30: [1, 73] }), t(C, [2, 15]), t(C, [2, 28]), t(C, [2, 29]), { 11: 59, 30: S, 34: 74, 39: 24, 40: T, 41: 27, 42: P, 43: _, 44: y, 45: M, 46: v, 47: E, 48: z, 49: p, 50: D, 51: h }, t(C, [2, 35]), t(C, [2, 19]), { 25: 75, 27: 64, 29: w }, t(B, [2, 22]), { 26: [2, 30] }, { 26: [2, 20] } ], defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 74: [2, 30], 75: [2, 20] }, parseError: /* @__PURE__ */ a(function(u, A) { if (A.recoverable) this.trace(u); else { var g = new Error(u); throw g.hash = A, g; } }, "parseError"), parse: /* @__PURE__ */ a(function(u) { var A = this, g = [0], x = [], k = [null], r = [], Q = this.table, d = "", it = 0, Rt = 0, _t = 0, ti = 2, kt = 1, ii = r.slice.call(arguments, 1), L = Object.create(this.lexer), $ = { yy: {} }; for (var ot in this.yy) Object.prototype.hasOwnProperty.call(this.yy, ot) && ($.yy[ot] = this.yy[ot]); L.setInput(u, $.yy), $.yy.lexer = L, $.yy.parser = this, typeof L.yylloc > "u" && (L.yylloc = {}); var rt = L.yylloc; r.push(rt); var ei = L.options && L.options.ranges; typeof $.yy.parseError == "function" ? this.parseError = $.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function si(W) { g.length = g.length - 2 * W, k.length = k.length - W, r.length = r.length - W; } a(si, "popStack"); function Tt() { var W = x.pop() || L.lex() || kt; return typeof W != "number" && (W instanceof Array && (x = W, W = x.pop()), W = A.symbols_[W] || W), W; } a(Tt, "lex"); for (var I, ht, q, O, lt, G = {}, et, N, Dt, st; ; ) { if (q = g[g.length - 1], this.defaultActions[q] ? O = this.defaultActions[q] : ((I === null || typeof I > "u") && (I = Tt()), O = Q[q] && Q[q][I]), typeof O > "u" || !O.length || !O[0]) { var ct = ""; st = []; for (et in Q[q]) this.terminals_[et] && et > ti && st.push("'" + this.terminals_[et] + "'"); L.showPosition ? ct = "Parse error on line " + (it + 1) + `: ` + L.showPosition() + ` Expecting ` + st.join(", ") + ", got '" + (this.terminals_[I] || I) + "'" : ct = "Parse error on line " + (it + 1) + ": Unexpected " + (I == kt ? "end of input" : "'" + (this.terminals_[I] || I) + "'"), this.parseError(ct, { text: L.match, token: this.terminals_[I] || I, line: L.yylineno, loc: rt, expected: st }); } if (O[0] instanceof Array && O.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + q + ", token: " + I); switch (O[0]) { case 1: g.push(I), k.push(L.yytext), r.push(L.yylloc), g.push(O[1]), I = null, ht ? (I = ht, ht = null) : (Rt = L.yyleng, d = L.yytext, it = L.yylineno, rt = L.yylloc, _t > 0 && _t--); break; case 2: if (N = this.productions_[O[1]][1], G.$ = k[k.length - N], G._$ = { first_line: r[r.length - (N || 1)].first_line, last_line: r[r.length - 1].last_line, first_column: r[r.length - (N || 1)].first_column, last_column: r[r.length - 1].last_column }, ei && (G._$.range = [r[r.length - (N || 1)].range[0], r[r.length - 1].range[1]]), lt = this.performAction.apply(G, [ d, Rt, it, $.yy, O[1], k, r ].concat(ii)), typeof lt < "u") return lt; N && (g = g.slice(0, -1 * N * 2), k = k.slice(0, -1 * N), r = r.slice(0, -1 * N)), g.push(this.productions_[O[1]][0]), k.push(G.$), r.push(G._$), Dt = Q[g[g.length - 2]][g[g.length - 1]], g.push(Dt); break; case 3: return !0; } } return !0; }, "parse") }; R.lexer = /* @__PURE__ */ (function() { return { EOF: 1, parseError: /* @__PURE__ */ a(function(u, A) { if (this.yy.parser) this.yy.parser.parseError(u, A); else throw new Error(u); }, "parseError"), setInput: /* @__PURE__ */ a(function(o, u) { return this.yy = u || this.yy || {}, this._input = o, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), input: /* @__PURE__ */ a(function() { var o = this._input[0]; return this.yytext += o, this.yyleng++, this.offset++, this.match += o, this.matched += o, o.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), o; }, "input"), unput: /* @__PURE__ */ a(function(o) { var u = o.length, A = o.split(/(?:\r\n?|\n)/g); this._input = o + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - u), this.offset -= u; var g = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), A.length - 1 && (this.yylineno -= A.length - 1); var x = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: A ? (A.length === g.length ? this.yylloc.first_column : 0) + g[g.length - A.length].length - A[0].length : this.yylloc.first_column - u }, this.options.ranges && (this.yylloc.range = [x[0], x[0] + this.yyleng - u]), this.yyleng = this.yytext.length, this; }, "unput"), more: /* @__PURE__ */ a(function() { return this._more = !0, this; }, "more"), reject: /* @__PURE__ */ a(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else 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). ` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), less: /* @__PURE__ */ a(function(o) { this.unput(this.match.slice(o)); }, "less"), pastInput: /* @__PURE__ */ a(function() { var o = this.matched.substr(0, this.matched.length - this.match.length); return (o.length > 20 ? "..." : "") + o.substr(-20).replace(/\n/g, ""); }, "pastInput"), upcomingInput: /* @__PURE__ */ a(function() { var o = this.match; return o.length < 20 && (o += this._input.substr(0, 20 - o.length)), (o.substr(0, 20) + (o.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), showPosition: /* @__PURE__ */ a(function() { var o = this.pastInput(), u = new Array(o.length + 1).join("-"); return o + this.upcomingInput() + ` ` + u + "^"; }, "showPosition"), test_match: /* @__PURE__ */ a(function(o, u) { var A, g, x; if (this.options.backtrack_lexer && (x = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (x.yylloc.range = this.yylloc.range.slice(0))), g = o[0].match(/(?:\r\n?|\n).*/g), g && (this.yylineno += g.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: g ? g[g.length - 1].length - g[g.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + o[0].length }, this.yytext += o[0], this.match += o[0], this.matches = o, 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(o[0].length), this.matched += o[0], A = this.performAction.call(this, this.yy, this, u, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), A) return A; if (this._backtrack) { for (var k in x) this[k] = x[k]; return !1; } return !1; }, "test_match"), next: /* @__PURE__ */ a(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var o, u, A, g; this._more || (this.yytext = "", this.match = ""); for (var x = this._currentRules(), k = 0; k < x.length; k++) if (A = this._input.match(this.rules[x[k]]), A && (!u || A[0].length > u[0].length)) { if (u = A, g = k, this.options.backtrack_lexer) { if (o = this.test_match(A, x[k]), o !== !1) return o; if (this._backtrack) { u = !1; continue; } else return !1; } else if (!this.options.flex) break; } return u ? (o = this.test_match(u, x[g]), o !== !1 ? o : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text. ` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), lex: /* @__PURE__ */ a(function() { var u = this.next(); return u || this.lex(); }, "lex"), begin: /* @__PURE__ */ a(function(u) { this.conditionStack.push(u); }, "begin"), popState: /* @__PURE__ */ a(function() { return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), _currentRules: /* @__PURE__ */ a(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), topState: /* @__PURE__ */ a(function(u) { return u = this.conditionStack.length - 1 - Math.abs(u || 0), u >= 0 ? this.conditionStack[u] : "INITIAL"; }, "topState"), pushState: /* @__PURE__ */ a(function(u) { this.begin(u); }, "pushState"), stateStackSize: /* @__PURE__ */ a(function() { return this.conditionStack.length; }, "stateStackSize"), options: { "case-insensitive": !0 }, performAction: /* @__PURE__ */ a(function(u, A, g, x) { switch (g) { case 0: break; case 1: break; case 2: return this.popState(), 36; case 3: return this.popState(), 36; case 4: return 36; case 5: break; case 6: return 10; case 7: return this.pushState("acc_title"), 19; case 8: return this.popState(), "acc_title_value"; case 9: return this.pushState("acc_descr"), 21; case 10: return this.popState(), "acc_descr_value"; case 11: this.pushState("acc_descr_multiline"); break; case 12: this.popState(); break; case 13: return "acc_descr_multiline_value"; case 14: return 5; case 15: return 5; case 16: return 8; case 17: return this.pushState("axis_data"), "X_AXIS"; case 18: return this.pushState("axis_data"), "Y_AXIS"; case 19: return this.pushState("axis_band_data"), 24; case 20: return 33; case 21: return this.pushState("data"), 16; case 22: return this.pushState("data"), 18; case 23: return this.pushState("data_inner"), 24; case 24: return 29; case 25: return this.popState(), 26; case 26: this.popState(); break; case 27: this.pushState("string"); break; case 28: this.popState(); break; case 29: return "STR"; case 30: return 24; case 31: return 26; case 32: return 44; case 33: return "COLON"; case 34: return 45; case 35: return 28; case 36: return 46; case 37: return 47; case 38: return 49; case 39: return 51; case 40: return 48; case 41: return 42; case 42: return 50; case 43: return 43; case 44: break; case 45: return 37; case 46: return 38; } }, "anonymous"), rules: [ /^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:(\r?\n))/i, /^(?:(\r?\n))/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:\})/i, /^(?:[^\}]*)/i, /^(?:xychart-beta\b)/i, /^(?:xychart\b)/i, /^(?:(?:vertical|horizontal))/i, /^(?:x-axis\b)/i, /^(?:y-axis\b)/i, /^(?:\[)/i, /^(?:-->)/i, /^(?:line\b)/i, /^(?:bar\b)/i, /^(?:\[)/i, /^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i, /^(?:\])/i, /^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s+)/i, /^(?:;)/i, /^(?:$)/i ], conditions: { data_inner: { rules: [ 0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 21, 22, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46 ], inclusive: !0 }, data: { rules: [ 0, 1, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 21, 22, 23, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46 ], inclusive: !0 }, axis_band_data: { rules: [ 0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 21, 22, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46 ], inclusive: !0 }, axis_data: { rules: [ 0, 1, 2, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46 ], inclusive: !0 }, acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, title: { rules: [], inclusive: !1 }, md_string: { rules: [], inclusive: !1 }, string: { rules: [28, 29], inclusive: !1 }, INITIAL: { rules: [ 0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 21, 22, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46 ], inclusive: !0 } } }; })(); function H() { this.yy = {}; } return a(H, "Parser"), H.prototype = R, R.Parser = H, new H(); })(); gt.parser = gt; var bi = gt; function xt(t) { return t.type === "bar"; } a(xt, "isBarPlot"); function at(t) { return t.type === "band"; } a(at, "isBandAxisData"); function j(t) { return t.type === "linear"; } a(j, "isLinearAxisData"); var Vt = class { constructor(t) { this.parentGroup = t; } static { a(this, "TextDimensionCalculatorWithFont"); } getMaxDimension(t, i) { if (!this.parentGroup) return { width: t.reduce((n, c) => Math.max(c.length, n), 0) * i, height: i }; const s = { width: 0, height: 0 }, e = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", i); for (const n of t) { const c = mi(e, 1, n), l = c ? c.width : n.length * i, f = c ? c.height : i; s.width = Math.max(s.width, l), s.height = Math.max(s.height, f); } return e.remove(), s; } }, Pt = 0.7, Et = 0.2, Bt = class { constructor(t, i, s, e) { this.axisConfig = t, this.title = i, this.textDimensionCalculator = s, this.axisThemeConfig = e, this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left", this.showTitle = !1, this.showLabel = !1, this.showTick = !1, this.showAxisLine = !1, this.outerPadding = 0, this.titleTextHeight = 0, this.labelTextHeight = 0, this.normalizedLabelRotationInRad = 0, this.range = [0, 10], this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left", this.normalizedLabelRotationInRad = this.axisConfig.labelRotation >= -90 && this.axisConfig.labelRotation <= 90 ? this.axisConfig.labelRotation * Math.PI / 180 : 0; } static { a(this, "BaseAxis"); } setRange(t) { this.range = t, this.axisPosition === "left" || this.axisPosition === "right" ? this.boundingRect.height = t[1] - t[0] : this.boundingRect.width = t[1] - t[0], this.recalculateScale(); } getRange() { return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding]; } setAxisPosition(t) { this.axisPosition = t, this.setRange(this.range); } getTickDistance() { const t = this.getRange(); return Math.abs(t[0] - t[1]) / this.getTickValues().length; } getAxisOuterPadding() { return this.outerPadding; } getLabelDimension() { return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((t) => t.toString()), this.axisConfig.labelFontSize); } recalculateOuterPaddingToDrawBar() { Pt * this.getTickDistance() > this.outerPadding * 2 && (this.outerPadding = Math.floor(Pt * this.getTickDistance() / 2)), this.recalculateScale(); } calculateSpaceIfDrawnHorizontally(t) { let i = t.height; if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) { const s = this.getLabelDimension(), e = Et * t.width; this.outerPadding = Math.min(s.width / 2, e); let n = s.height; this.axisPosition === "bottom" && this.normalizedLabelRotationInRad !== 0 && (n = Math.max(n, Math.abs(Math.sin(this.normalizedLabelRotationInRad) * s.width) + Math.abs(Math.cos(this.normalizedLabelRotationInRad) * s.height))), n += this.axisConfig.labelPadding * 2, this.labelTextHeight = s.height, n <= i && (i -= n, this.showLabel = !0); } if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) { const s = this.textDimensionCalculator.getMaxDimension([this.title], this.axisConfig.titleFontSize), e = s.height + this.axisConfig.titlePadding * 2; this.titleTextHeight = s.height, e <= i && (i -= e, this.showTitle = !0); } this.boundingRect.width = t.width, this.boundingRect.height = t.height - i; } calculateSpaceIfDrawnVertical(t) { let i = t.width; if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) { const s = this.getLabelDimension(), e = Et * t.height; this.outerPadding = Math.min(s.height / 2, e); const n = s.width + this.axisConfig.labelPadding * 2; n <= i && (i -= n, this.showLabel = !0); } if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) { const s = this.textDimensionCalculator.getMaxDimension([this.title], this.axisConfig.titleFontSize), e = s.height + this.axisConfig.titlePadding * 2; this.titleTextHeight = s.height, e <= i && (i -= e, this.showTitle = !0); } this.boundingRect.width = t.width - i, this.boundingRect.height = t.height; } calculateSpace(t) { return this.axisPosition === "left" || this.axisPosition === "right" ? this.calculateSpaceIfDrawnVertical(t) : this.calculateSpaceIfDrawnHorizontally(t), this.recalculateScale(), { width: this.boundingRect.width, height: this.boundingRect.height }; } setBoundingBoxXY(t) { this.boundingRect.x = t.x, this.boundingRect.y = t.y; } calculateOffsetByRotation(t) { const i = this.normalizedLabelRotationInRad; return i === 0 ? 0 : Math.sin(i) * this.getLabelDimension()[t] / 2; } getDrawableElementsForLeftAxis() { const t = []; if (this.showAxisLine) { const i = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2; t.push({ type: "path", groupTexts: ["left-axis", "axisl-line"], data: [{ path: `M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y + this.boundingRect.height} `, strokeFill: this.axisThemeConfig.axisLineColor, strokeWidth: this.axisConfig.axisLineWidth }] }); } if (this.showLabel && t.push({ type: "text", groupTexts: ["left-axis", "label"], data: this.getTickValues().map((i) => ({ text: i.toString(), x: this.boundingRect.x + this.boundingRect.width - (this.showLabel ? this.axisConfig.labelPadding : 0) - (this.showTick ? this.axisConfig.tickLength : 0) - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0), y: this.getScaleValue(i), fill: this.axisThemeConfig.labelColor, fontSize: this.axisConfig.labelFontSize, rotation: 0, verticalPos: "middle", horizontalPos: "right" })) }), this.showTick) { const i = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0); t.push({ type: "path", groupTexts: ["left-axis", "ticks"], data: this.getTickValues().map((s) => ({ path: `M ${i},${this.getScaleValue(s)} L ${i - this.axisConfig.tickLength},${this.getScaleValue(s)}`, strokeFill: this.axisThemeConfig.tickColor, strokeWidth: this.axisConfig.tickWidth })) }); } return this.showTitle && t.push({ type: "text", groupTexts: ["left-axis", "title"], data: [{ text: this.title, x: this.boundingRect.x + this.axisConfig.titlePadding, y: this.boundingRect.y + this.boundingRect.height / 2, fill: this.axisThemeConfig.titleColor, fontSize: this.axisConfig.titleFontSize, rotation: 270, verticalPos: "top", horizontalPos: "center" }] }), t; } getDrawableElementsForBottomAxis() { const t = []; if (this.showAxisLine) { const i = this.boundingRect.y + this.axisConfig.axisLineWidth / 2; t.push({ type: "path", groupTexts: ["bottom-axis", "axis-line"], data: [{ path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`, strokeFill: this.axisThemeConfig.axisLineColor, strokeWidth: this.axisConfig.axisLineWidth }] }); } if (this.showLabel && t.push({ type: "text", groupTexts: ["bottom-axis", "label"], data: this.getTickValues().map((i) => ({ text: i.toString(), x: this.getScaleValue(i) + this.calculateOffsetByRotation("height"), y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0) + Math.abs(this.calculateOffsetByRotation("width")), fill: this.axisThemeConfig.labelColor, fontSize: this.axisConfig.labelFontSize, rotation: this.normalizedLabelRotationInRad * 180 / Math.PI, verticalPos: "top", horizontalPos: "center" })) }), this.showTick) { const i = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0); t.push({ type: "path", groupTexts: ["bottom-axis", "ticks"], data: this.getTickValues().map((s) => ({ path: `M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i + this.axisConfig.tickLength}`, strokeFill: this.axisThemeConfig.tickColor, strokeWidth: this.axisConfig.tickWidth })) }); } return this.showTitle && t.push({ type: "text", groupTexts: ["bottom-axis", "title"], data: [{ text: this.title, x: this.range[0] + (this.range[1] - this.range[0]) / 2, y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight, fill: this.axisThemeConfig.titleColor, fontSize: this.axisConfig.titleFontSize, rotation: 0, verticalPos: "top", horizontalPos: "center" }] }), t; } getDrawableElementsForTopAxis() { const t = []; if (this.showAxisLine) { const i = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2; t.push({ type: "path", groupTexts: ["top-axis", "axis-line"], data: [{ path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`, strokeFill: this.axisThemeConfig.axisLineColor, strokeWidth: this.axisConfig.axisLineWidth }] }); } if (this.showLabel && t.push({ type: "text", groupTexts: ["top-axis", "label"], data: this.getTickValues().map((i) => ({ text: i.toString(), x: this.getScaleValue(i), y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding, fill: this.axisThemeConfig.labelColor, fontSize: this.axisConfig.labelFontSize, rotation: 0, verticalPos: "top", horizontalPos: "center" })) }), this.showTick) { const i = this.boundingRect.y; t.push({ type: "path", groupTexts: ["top-axis", "ticks"], data: this.getTickValues().map((s) => ({ path: `M ${this.getScaleValue(s)},${i + this.boundingRect.height - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)} L ${this.getScaleValue(s)},${i + this.boundingRect.height - this.axisConfig.tickLength - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)}`, strokeFill: this.axisThemeConfig.tickColor, strokeWidth: this.axisConfig.tickWidth })) }); } return this.showTitle && t.push({ type: "text", groupTexts: ["top-axis", "title"], data: [{ text: this.title, x: this.boundingRect.x + this.boundingRect.width / 2, y: this.boundingRect.y + this.axisConfig.titlePadding, fill: this.axisThemeConfig.titleColor, fontSize: this.axisConfig.titleFontSize, rotation: 0, verticalPos: "top", horizontalPos: "center" }] }), t; } getDrawableElements() { if (this.axisPosition === "left") return this.getDrawableElementsForLeftAxis(); if (this.axisPosition === "right") throw Error("Drawing of right axis is not implemented"); return this.axisPosition === "bottom" ? this.getDrawableElementsForBottomAxis() : this.axisPosition === "top" ? this.getDrawableElementsForTopAxis() : []; } }, Ai = class extends Bt { static { a(this, "BandAxis"); } constructor(t, i, s, e, n) { super(t, e, n, i), this.categories = s, this.scale = ut().domain(this.categories).range(this.getRange()); } setRange(t) { super.setRange(t); } recalculateScale() { this.scale = ut().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5), It.trace("BandAxis axis final categories, range: ", this.categories, this.getRange()); } getTickValues() { return this.categories; } getScaleValue(t) { return this.scale(t) ?? this.getRange()[0]; } }, wi = class extends Bt { static { a(this, "LinearAxis"); } constructor(t, i, s, e, n) { super(t, e, n, i), this.domain = s, this.scale = Lt().domain(this.domain).range(this.getRange()); } getTickValues() { return this.scale.ticks(); } recalculateScale() { const t = [...this.domain]; this.axisPosition === "left" && t.reverse(), this.scale = Lt().domain(t).range(this.getRange()); } getScaleValue(t) { return this.scale(t); } }; function dt(t, i, s, e) { const n = new Vt(e); return at(t) ? new Ai(i, s, t.categories, t.title, n) : new wi(i, s, [t.min, t.max], t.title, n); } a(dt, "getAxis"); var Ci = class { constructor(t, i, s, e) { this.textDimensionCalculator = t, this.chartConfig = i, this.chartData = s, this.chartThemeConfig = e, this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.showChartTitle = !1; } static { a(this, "ChartTitle"); } setBoundingBoxXY(t) { this.boundingRect.x = t.x, this.boundingRect.y = t.y; } calculateSpace(t) { const i = this.textDimensionCalculator.getMaxDimension([this.chartData.title], this.chartConfig.titleFontSize), s = Math.max(i.width, t.width), e = i.height + 2 * this.chartConfig.titlePadding; return i.width <= s && i.height <= e && this.chartConfig.showTitle && this.chartData.title && (this.boundingRect.width = s, this.boundingRect.height = e, this.showChartTitle = !0), { width: this.boundingRect.width, height: this.boundingRect.height }; } getDrawableElements() { const t = []; return this.showChartTitle && t.push({ groupTexts: ["chart-title"], type: "text", data: [{ fontSize: this.chartConfig.titleFontSize, text: this.chartData.title, verticalPos: "middle", horizontalPos: "center", x: this.boundingRect.x + this.boundingRect.width / 2, y: this.boundingRect.y + this.boundingRect.height / 2, fill: this.chartThemeConfig.titleColor, rotation: 0 }] }), t; } }; function Ot(t, i, s, e) { return new Ci(new Vt(e), t, i, s); } a(Ot, "getChartTitleComponent"); var Si = class { constructor(t, i, s, e, n) { this.plotData = t, this.xAxis = i, this.yAxis = s, this.orientation = e, this.plotIndex = n; } static { a(this, "LinePlot"); } getDrawableElement() { const t = this.plotData.data.map((e) => [this.xAxis.getScaleValue(e[0]), this.yAxis.getScaleValue(e[1])]); let i; if (this.orientation === "horizontal" ? i = vt().y((e) => e[0]).x((e) => e[1])(t) : i = vt().x((e) => e[0]).y((e) => e[1])(t), !i) return []; const s = [{ groupTexts: ["plot", `line-plot-${this.plotIndex}`], type: "path", data: [{ path: i, strokeFill: this.plotData.strokeFill, strokeWidth: this.plotData.strokeWidth }] }]; if (this.plotData.pointLabels && this.plotData.pointLabels.length > 0) { const c = []; for (const [l, [f, S]] of t.entries()) { const T = this.plotData.pointLabels[l]; T && (this.orientation === "horizontal" ? c.push({ x: S + 10, y: f, text: T, fill: this.plotData.strokeFill, verticalPos: "middle", horizontalPos: "left", fontSize: 12, rotation: 0 }) : c.push({ x: f, y: S - 10, text: T, fill: this.plotData.strokeFill, verticalPos: "middle", horizontalPos: "center", fontSize: 12, rotation: 0 })); } c.length > 0 && s.push({ groupTexts: [ "plot", `line-plot-${this.plotIndex}`, "labels" ], type: "text", data: c }); } return s; } }, Ri = class { constructor(t, i, s, e, n, c) { this.barData = t, this.boundingRect = i, this.xAxis = s, this.yAxis = e, this.orientation = n, this.plotIndex = c; } static { a(this, "BarPlot"); } getDrawableElement() { const t = this.barData.data.map((e) => [this.xAxis.getScaleValue(e[0]), this.yAxis.getScaleValue(e[1])]), i = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * 0.95, s = i / 2; return this.orientation === "horizontal" ? [{ groupTexts: ["plot", `bar-plot-${this.plotIndex}`], type: "rect", data: t.map((e) => ({ x: this.boundingRect.x, y: e[0] - s, height: i, width: e[1] - this.boundingRect.x, fill: this.barData.fill, strokeWidth: 0, strokeFill: this.barData.fill })) }] : [{ groupTexts: ["plot", `bar-plot-${this.plotIndex}`], type: "rect", data: t.map((e) => ({ x: e[0] - s, y: e[1], width: i, height: this.boundingRect.y + this.boundingRect.height - e