UNPKG

@konstructio/ui

Version:

A set of reusable and customizable React components built for konstruct.io

1,724 lines 250 kB
import { forwardRef as Us, useEffect as Tt, useRef as Pi } from "react"; import { jsx as Xs } from "react/jsx-runtime"; function re(t) { return t + 0.5 | 0; } var ct = (t, e, i) => Math.max(Math.min(t, i), e); function Xt(t) { return ct(re(t * 2.55), 0, 255); } function ut(t) { return ct(re(t * 255), 0, 255); } function at(t) { return ct(re(t / 2.55) / 100, 0, 1); } function Ci(t) { return ct(re(t * 100), 0, 100); } var Z = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15 }, ti = [..."0123456789ABCDEF"], $n = (t) => ti[t & 15], Yn = (t) => ti[(t & 240) >> 4] + ti[t & 15], he = (t) => (t & 240) >> 4 === (t & 15), Un = (t) => he(t.r) && he(t.g) && he(t.b) && he(t.a); function Xn(t) { var e = t.length, i; return t[0] === "#" && (e === 4 || e === 5 ? i = { r: 255 & Z[t[1]] * 17, g: 255 & Z[t[2]] * 17, b: 255 & Z[t[3]] * 17, a: e === 5 ? Z[t[4]] * 17 : 255 } : (e === 7 || e === 9) && (i = { r: Z[t[1]] << 4 | Z[t[2]], g: Z[t[3]] << 4 | Z[t[4]], b: Z[t[5]] << 4 | Z[t[6]], a: e === 9 ? Z[t[7]] << 4 | Z[t[8]] : 255 })), i; } var Kn = (t, e) => t < 255 ? e(t) : ""; function qn(t) { var e = Un(t) ? $n : Yn; return t ? "#" + e(t.r) + e(t.g) + e(t.b) + Kn(t.a, e) : void 0; } var Gn = /^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/; function Ks(t, e, i) { const s = e * Math.min(i, 1 - i), n = (o, r = (o + t / 30) % 12) => i - s * Math.max(Math.min(r - 3, 9 - r, 1), -1); return [ n(0), n(8), n(4) ]; } function Jn(t, e, i) { const s = (n, o = (n + t / 60) % 6) => i - i * e * Math.max(Math.min(o, 4 - o, 1), 0); return [ s(5), s(3), s(1) ]; } function Zn(t, e, i) { const s = Ks(t, 1, 0.5); let n; for (e + i > 1 && (n = 1 / (e + i), e *= n, i *= n), n = 0; n < 3; n++) s[n] *= 1 - e - i, s[n] += e; return s; } function Qn(t, e, i, s, n) { return t === n ? (e - i) / s + (e < i ? 6 : 0) : e === n ? (i - t) / s + 2 : (t - e) / s + 4; } function hi(t) { const i = t.r / 255, s = t.g / 255, n = t.b / 255, o = Math.max(i, s, n), r = Math.min(i, s, n), a = (o + r) / 2; let l, c, h; return o !== r && (h = o - r, c = a > 0.5 ? h / (2 - o - r) : h / (o + r), l = Qn(i, s, n, h, o), l = l * 60 + 0.5), [ l | 0, c || 0, a ]; } function di(t, e, i, s) { return (Array.isArray(e) ? t(e[0], e[1], e[2]) : t(e, i, s)).map(ut); } function fi(t, e, i) { return di(Ks, t, e, i); } function to(t, e, i) { return di(Zn, t, e, i); } function eo(t, e, i) { return di(Jn, t, e, i); } function qs(t) { return (t % 360 + 360) % 360; } function io(t) { const e = Gn.exec(t); let i = 255, s; if (!e) return; e[5] !== s && (i = e[6] ? Xt(+e[5]) : ut(+e[5])); const n = qs(+e[2]), o = +e[3] / 100, r = +e[4] / 100; return e[1] === "hwb" ? s = to(n, o, r) : e[1] === "hsv" ? s = eo(n, o, r) : s = fi(n, o, r), { r: s[0], g: s[1], b: s[2], a: i }; } function so(t, e) { var i = hi(t); i[0] = qs(i[0] + e), i = fi(i), t.r = i[0], t.g = i[1], t.b = i[2]; } function no(t) { if (!t) return; const e = hi(t), i = e[0], s = Ci(e[1]), n = Ci(e[2]); return t.a < 255 ? `hsla(${i}, ${s}%, ${n}%, ${at(t.a)})` : `hsl(${i}, ${s}%, ${n}%)`; } var Di = { x: "dark", Z: "light", Y: "re", X: "blu", W: "gr", V: "medium", U: "slate", A: "ee", T: "ol", S: "or", B: "ra", C: "lateg", D: "ights", R: "in", Q: "turquois", E: "hi", P: "ro", O: "al", N: "le", M: "de", L: "yello", F: "en", K: "ch", G: "arks", H: "ea", I: "ightg", J: "wh" }, Oi = { OiceXe: "f0f8ff", antiquewEte: "faebd7", aqua: "ffff", aquamarRe: "7fffd4", azuY: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "0", blanKedOmond: "ffebcd", Xe: "ff", XeviTet: "8a2be2", bPwn: "a52a2a", burlywood: "deb887", caMtXe: "5f9ea0", KartYuse: "7fff00", KocTate: "d2691e", cSO: "ff7f50", cSnflowerXe: "6495ed", cSnsilk: "fff8dc", crimson: "dc143c", cyan: "ffff", xXe: "8b", xcyan: "8b8b", xgTMnPd: "b8860b", xWay: "a9a9a9", xgYF: "6400", xgYy: "a9a9a9", xkhaki: "bdb76b", xmagFta: "8b008b", xTivegYF: "556b2f", xSange: "ff8c00", xScEd: "9932cc", xYd: "8b0000", xsOmon: "e9967a", xsHgYF: "8fbc8f", xUXe: "483d8b", xUWay: "2f4f4f", xUgYy: "2f4f4f", xQe: "ced1", xviTet: "9400d3", dAppRk: "ff1493", dApskyXe: "bfff", dimWay: "696969", dimgYy: "696969", dodgerXe: "1e90ff", fiYbrick: "b22222", flSOwEte: "fffaf0", foYstWAn: "228b22", fuKsia: "ff00ff", gaRsbSo: "dcdcdc", ghostwEte: "f8f8ff", gTd: "ffd700", gTMnPd: "daa520", Way: "808080", gYF: "8000", gYFLw: "adff2f", gYy: "808080", honeyMw: "f0fff0", hotpRk: "ff69b4", RdianYd: "cd5c5c", Rdigo: "4b0082", ivSy: "fffff0", khaki: "f0e68c", lavFMr: "e6e6fa", lavFMrXsh: "fff0f5", lawngYF: "7cfc00", NmoncEffon: "fffacd", ZXe: "add8e6", ZcSO: "f08080", Zcyan: "e0ffff", ZgTMnPdLw: "fafad2", ZWay: "d3d3d3", ZgYF: "90ee90", ZgYy: "d3d3d3", ZpRk: "ffb6c1", ZsOmon: "ffa07a", ZsHgYF: "20b2aa", ZskyXe: "87cefa", ZUWay: "778899", ZUgYy: "778899", ZstAlXe: "b0c4de", ZLw: "ffffe0", lime: "ff00", limegYF: "32cd32", lRF: "faf0e6", magFta: "ff00ff", maPon: "800000", VaquamarRe: "66cdaa", VXe: "cd", VScEd: "ba55d3", VpurpN: "9370db", VsHgYF: "3cb371", VUXe: "7b68ee", VsprRggYF: "fa9a", VQe: "48d1cc", VviTetYd: "c71585", midnightXe: "191970", mRtcYam: "f5fffa", mistyPse: "ffe4e1", moccasR: "ffe4b5", navajowEte: "ffdead", navy: "80", Tdlace: "fdf5e6", Tive: "808000", TivedBb: "6b8e23", Sange: "ffa500", SangeYd: "ff4500", ScEd: "da70d6", pOegTMnPd: "eee8aa", pOegYF: "98fb98", pOeQe: "afeeee", pOeviTetYd: "db7093", papayawEp: "ffefd5", pHKpuff: "ffdab9", peru: "cd853f", pRk: "ffc0cb", plum: "dda0dd", powMrXe: "b0e0e6", purpN: "800080", YbeccapurpN: "663399", Yd: "ff0000", Psybrown: "bc8f8f", PyOXe: "4169e1", saddNbPwn: "8b4513", sOmon: "fa8072", sandybPwn: "f4a460", sHgYF: "2e8b57", sHshell: "fff5ee", siFna: "a0522d", silver: "c0c0c0", skyXe: "87ceeb", UXe: "6a5acd", UWay: "708090", UgYy: "708090", snow: "fffafa", sprRggYF: "ff7f", stAlXe: "4682b4", tan: "d2b48c", teO: "8080", tEstN: "d8bfd8", tomato: "ff6347", Qe: "40e0d0", viTet: "ee82ee", JHt: "f5deb3", wEte: "ffffff", wEtesmoke: "f5f5f5", Lw: "ffff00", LwgYF: "9acd32" }; function oo() { const t = {}, e = Object.keys(Oi), i = Object.keys(Di); let s, n, o, r, a; for (s = 0; s < e.length; s++) { for (r = a = e[s], n = 0; n < i.length; n++) o = i[n], a = a.replace(o, Di[o]); o = parseInt(Oi[r], 16), t[a] = [ o >> 16 & 255, o >> 8 & 255, o & 255 ]; } return t; } var de; function ro(t) { de || (de = oo(), de.transparent = [ 0, 0, 0, 0 ]); const e = de[t.toLowerCase()]; return e && { r: e[0], g: e[1], b: e[2], a: e.length === 4 ? e[3] : 255 }; } var ao = /^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/; function lo(t) { const e = ao.exec(t); let i = 255, s, n, o; if (e) { if (e[7] !== s) { const r = +e[7]; i = e[8] ? Xt(r) : ct(r * 255, 0, 255); } return s = +e[1], n = +e[3], o = +e[5], s = 255 & (e[2] ? Xt(s) : ct(s, 0, 255)), n = 255 & (e[4] ? Xt(n) : ct(n, 0, 255)), o = 255 & (e[6] ? Xt(o) : ct(o, 0, 255)), { r: s, g: n, b: o, a: i }; } } function co(t) { return t && (t.a < 255 ? `rgba(${t.r}, ${t.g}, ${t.b}, ${at(t.a)})` : `rgb(${t.r}, ${t.g}, ${t.b})`); } var je = (t) => t <= 31308e-7 ? t * 12.92 : Math.pow(t, 1 / 2.4) * 1.055 - 0.055, At = (t) => t <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4); function ho(t, e, i) { const s = At(at(t.r)), n = At(at(t.g)), o = At(at(t.b)); return { r: ut(je(s + i * (At(at(e.r)) - s))), g: ut(je(n + i * (At(at(e.g)) - n))), b: ut(je(o + i * (At(at(e.b)) - o))), a: t.a + i * (e.a - t.a) }; } function fe(t, e, i) { if (t) { let s = hi(t); s[e] = Math.max(0, Math.min(s[e] + s[e] * i, e === 0 ? 360 : 1)), s = fi(s), t.r = s[0], t.g = s[1], t.b = s[2]; } } function Gs(t, e) { return t && Object.assign(e || {}, t); } function Ti(t) { var e = { r: 0, g: 0, b: 0, a: 255 }; return Array.isArray(t) ? t.length >= 3 && (e = { r: t[0], g: t[1], b: t[2], a: 255 }, t.length > 3 && (e.a = ut(t[3]))) : (e = Gs(t, { r: 0, g: 0, b: 0, a: 1 }), e.a = ut(e.a)), e; } function fo(t) { return t.charAt(0) === "r" ? lo(t) : io(t); } var Js = class ei { constructor(e) { if (e instanceof ei) return e; const i = typeof e; let s; i === "object" ? s = Ti(e) : i === "string" && (s = Xn(e) || ro(e) || fo(e)), this._rgb = s, this._valid = !!s; } get valid() { return this._valid; } get rgb() { var e = Gs(this._rgb); return e && (e.a = at(e.a)), e; } set rgb(e) { this._rgb = Ti(e); } rgbString() { return this._valid ? co(this._rgb) : void 0; } hexString() { return this._valid ? qn(this._rgb) : void 0; } hslString() { return this._valid ? no(this._rgb) : void 0; } mix(e, i) { if (e) { const s = this.rgb, n = e.rgb; let o; const r = i === o ? 0.5 : i, a = 2 * r - 1, l = s.a - n.a, c = ((a * l === -1 ? a : (a + l) / (1 + a * l)) + 1) / 2; o = 1 - c, s.r = 255 & c * s.r + o * n.r + 0.5, s.g = 255 & c * s.g + o * n.g + 0.5, s.b = 255 & c * s.b + o * n.b + 0.5, s.a = r * s.a + (1 - r) * n.a, this.rgb = s; } return this; } interpolate(e, i) { return e && (this._rgb = ho(this._rgb, e._rgb, i)), this; } clone() { return new ei(this.rgb); } alpha(e) { return this._rgb.a = ut(e), this; } clearer(e) { const i = this._rgb; return i.a *= 1 - e, this; } greyscale() { const e = this._rgb; return e.r = e.g = e.b = re(e.r * 0.3 + e.g * 0.59 + e.b * 0.11), this; } opaquer(e) { const i = this._rgb; return i.a *= 1 + e, this; } negate() { const e = this._rgb; return e.r = 255 - e.r, e.g = 255 - e.g, e.b = 255 - e.b, this; } lighten(e) { return fe(this._rgb, 2, e), this; } darken(e) { return fe(this._rgb, 2, -e), this; } saturate(e) { return fe(this._rgb, 1, e), this; } desaturate(e) { return fe(this._rgb, 1, -e), this; } rotate(e) { return so(this._rgb, e), this; } }; function nt() { } var uo = /* @__PURE__ */ (() => { let t = 0; return () => t++; })(); function R(t) { return t == null; } function z(t) { if (Array.isArray && Array.isArray(t)) return !0; const e = Object.prototype.toString.call(t); return e.slice(0, 7) === "[object" && e.slice(-6) === "Array]"; } function O(t) { return t !== null && Object.prototype.toString.call(t) === "[object Object]"; } function W(t) { return (typeof t == "number" || t instanceof Number) && isFinite(+t); } function J(t, e) { return W(t) ? t : e; } function P(t, e) { return typeof t > "u" ? e : t; } var go = (t, e) => typeof t == "string" && t.endsWith("%") ? parseFloat(t) / 100 : +t / e, Zs = (t, e) => typeof t == "string" && t.endsWith("%") ? parseFloat(t) / 100 * e : +t; function E(t, e, i) { if (t && typeof t.call == "function") return t.apply(i, e); } function A(t, e, i, s) { let n, o, r; if (z(t)) if (o = t.length, s) for (n = o - 1; n >= 0; n--) e.call(i, t[n], n); else for (n = 0; n < o; n++) e.call(i, t[n], n); else if (O(t)) for (r = Object.keys(t), o = r.length, n = 0; n < o; n++) e.call(i, t[r[n]], r[n]); } function Se(t, e) { let i, s, n, o; if (!t || !e || t.length !== e.length) return !1; for (i = 0, s = t.length; i < s; ++i) if (n = t[i], o = e[i], n.datasetIndex !== o.datasetIndex || n.index !== o.index) return !1; return !0; } function Pe(t) { if (z(t)) return t.map(Pe); if (O(t)) { const e = /* @__PURE__ */ Object.create(null), i = Object.keys(t), s = i.length; let n = 0; for (; n < s; ++n) e[i[n]] = Pe(t[i[n]]); return e; } return t; } function Qs(t) { return [ "__proto__", "prototype", "constructor" ].indexOf(t) === -1; } function po(t, e, i, s) { if (!Qs(t)) return; const n = e[t], o = i[t]; O(n) && O(o) ? te(n, o, s) : e[t] = Pe(o); } function te(t, e, i) { const s = z(e) ? e : [e], n = s.length; if (!O(t)) return t; i = i || {}; const o = i.merger || po; let r; for (let a = 0; a < n; ++a) { if (r = s[a], !O(r)) continue; const l = Object.keys(r); for (let c = 0, h = l.length; c < h; ++c) o(l[c], t, r, i); } return t; } function Gt(t, e) { return te(t, e, { merger: mo }); } function mo(t, e, i) { if (!Qs(t)) return; const s = e[t], n = i[t]; O(s) && O(n) ? Gt(s, n) : Object.prototype.hasOwnProperty.call(e, t) || (e[t] = Pe(n)); } var Ai = { "": (t) => t, x: (t) => t.x, y: (t) => t.y }; function bo(t) { const e = t.split("."), i = []; let s = ""; for (const n of e) s += n, s.endsWith("\\") ? s = s.slice(0, -1) + "." : (i.push(s), s = ""); return i; } function _o(t) { const e = bo(t); return (i) => { for (const s of e) { if (s === "") break; i = i && i[s]; } return i; }; } function ee(t, e) { return (Ai[e] || (Ai[e] = _o(e)))(t); } function ui(t) { return t.charAt(0).toUpperCase() + t.slice(1); } var Ce = (t) => typeof t < "u", gt = (t) => typeof t == "function", Li = (t, e) => { if (t.size !== e.size) return !1; for (const i of t) if (!e.has(i)) return !1; return !0; }; function xo(t) { return t.type === "mouseup" || t.type === "click" || t.type === "contextmenu"; } var L = Math.PI, F = 2 * L, yo = F + L, De = Number.POSITIVE_INFINITY, vo = L / 180, N = L / 2, bt = L / 4, Ri = L * 2 / 3, ht = Math.log10, Et = Math.sign; function Jt(t, e, i) { return Math.abs(t - e) < i; } function Ii(t) { const e = Math.round(t); t = Jt(t, e, t / 1e3) ? e : t; const i = Math.pow(10, Math.floor(ht(t))), s = t / i; return (s <= 1 ? 1 : s <= 2 ? 2 : s <= 5 ? 5 : 10) * i; } function Mo(t) { const e = [], i = Math.sqrt(t); let s; for (s = 1; s < i; s++) t % s === 0 && (e.push(s), e.push(t / s)); return i === (i | 0) && e.push(i), e.sort((n, o) => n - o).pop(), e; } function wo(t) { return typeof t == "symbol" || typeof t == "object" && t !== null && !(Symbol.toPrimitive in t || "toString" in t || "valueOf" in t); } function ie(t) { return !wo(t) && !isNaN(parseFloat(t)) && isFinite(t); } function ko(t, e) { const i = Math.round(t); return i - e <= t && i + e >= t; } function tn(t, e, i) { let s, n, o; for (s = 0, n = t.length; s < n; s++) o = t[s][i], isNaN(o) || (e.min = Math.min(e.min, o), e.max = Math.max(e.max, o)); } function et(t) { return t * (L / 180); } function gi(t) { return t * (180 / L); } function Ei(t) { if (!W(t)) return; let e = 1, i = 0; for (; Math.round(t * e) / e !== t; ) e *= 10, i++; return i; } function en(t, e) { const i = e.x - t.x, s = e.y - t.y, n = Math.sqrt(i * i + s * s); let o = Math.atan2(s, i); return o < -0.5 * L && (o += F), { angle: o, distance: n }; } function ii(t, e) { return Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2)); } function So(t, e) { return (t - e + yo) % F - L; } function Y(t) { return (t % F + F) % F; } function se(t, e, i, s) { const n = Y(t), o = Y(e), r = Y(i), a = Y(o - n), l = Y(r - n), c = Y(n - o), h = Y(n - r); return n === o || n === r || s && o === r || a > l && c < h; } function U(t, e, i) { return Math.max(e, Math.min(i, t)); } function Po(t) { return U(t, -32768, 32767); } function wt(t, e, i, s = 1e-6) { return t >= Math.min(e, i) - s && t <= Math.max(e, i) + s; } function pi(t, e, i) { i = i || ((r) => t[r] < e); let s = t.length - 1, n = 0, o; for (; s - n > 1; ) o = n + s >> 1, i(o) ? n = o : s = o; return { lo: n, hi: s }; } var kt = (t, e, i, s) => pi(t, i, s ? (n) => { const o = t[n][e]; return o < i || o === i && t[n + 1][e] === i; } : (n) => t[n][e] < i), Co = (t, e, i) => pi(t, i, (s) => t[s][e] >= i); function Do(t, e, i) { let s = 0, n = t.length; for (; s < n && t[s] < e; ) s++; for (; n > s && t[n - 1] > i; ) n--; return s > 0 || n < t.length ? t.slice(s, n) : t; } var sn = [ "push", "pop", "shift", "splice", "unshift" ]; function Oo(t, e) { if (t._chartjs) { t._chartjs.listeners.push(e); return; } Object.defineProperty(t, "_chartjs", { configurable: !0, enumerable: !1, value: { listeners: [e] } }), sn.forEach((i) => { const s = "_onData" + ui(i), n = t[i]; Object.defineProperty(t, i, { configurable: !0, enumerable: !1, value(...o) { const r = n.apply(this, o); return t._chartjs.listeners.forEach((a) => { typeof a[s] == "function" && a[s](...o); }), r; } }); }); } function Fi(t, e) { const i = t._chartjs; if (!i) return; const s = i.listeners, n = s.indexOf(e); n !== -1 && s.splice(n, 1), !(s.length > 0) && (sn.forEach((o) => { delete t[o]; }), delete t._chartjs); } function To(t) { const e = new Set(t); return e.size === t.length ? t : Array.from(e); } var nn = (function() { return typeof window > "u" ? function(t) { return t(); } : window.requestAnimationFrame; })(); function on(t, e) { let i = [], s = !1; return function(...n) { i = n, s || (s = !0, nn.call(window, () => { s = !1, t.apply(e, i); })); }; } function Ao(t, e) { let i; return function(...s) { return e ? (clearTimeout(i), i = setTimeout(t, e, s)) : t.apply(this, s), e; }; } var rn = (t) => t === "start" ? "left" : t === "end" ? "right" : "center", G = (t, e, i) => t === "start" ? e : t === "end" ? i : (e + i) / 2, Lo = (t, e, i, s) => t === (s ? "left" : "right") ? i : t === "center" ? (e + i) / 2 : e; function Ro(t, e, i) { const s = e.length; let n = 0, o = s; if (t._sorted) { const { iScale: r, vScale: a, _parsed: l } = t, c = t.dataset && t.dataset.options ? t.dataset.options.spanGaps : null, h = r.axis, { min: d, max: f, minDefined: u, maxDefined: p } = r.getUserBounds(); if (u) { if (n = Math.min(kt(l, h, d).lo, i ? s : kt(e, h, r.getPixelForValue(d)).lo), c) { const m = l.slice(0, n + 1).reverse().findIndex((g) => !R(g[a.axis])); n -= Math.max(0, m); } n = U(n, 0, s - 1); } if (p) { let m = Math.max(kt(l, r.axis, f, !0).hi + 1, i ? 0 : kt(e, h, r.getPixelForValue(f), !0).hi + 1); if (c) { const g = l.slice(m - 1).findIndex((b) => !R(b[a.axis])); m += Math.max(0, g); } o = U(m, n, s) - n; } else o = s - n; } return { start: n, count: o }; } function Io(t) { const { xScale: e, yScale: i, _scaleRanges: s } = t, n = { xmin: e.min, xmax: e.max, ymin: i.min, ymax: i.max }; if (!s) return t._scaleRanges = n, !0; const o = s.xmin !== e.min || s.xmax !== e.max || s.ymin !== i.min || s.ymax !== i.max; return Object.assign(s, n), o; } var ue = (t) => t === 0 || t === 1, zi = (t, e, i) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - e) * F / i)), Bi = (t, e, i) => Math.pow(2, -10 * t) * Math.sin((t - e) * F / i) + 1, Zt = { linear: (t) => t, easeInQuad: (t) => t * t, easeOutQuad: (t) => -t * (t - 2), easeInOutQuad: (t) => (t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1), easeInCubic: (t) => t * t * t, easeOutCubic: (t) => (t -= 1) * t * t + 1, easeInOutCubic: (t) => (t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2), easeInQuart: (t) => t * t * t * t, easeOutQuart: (t) => -((t -= 1) * t * t * t - 1), easeInOutQuart: (t) => (t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2), easeInQuint: (t) => t * t * t * t * t, easeOutQuint: (t) => (t -= 1) * t * t * t * t + 1, easeInOutQuint: (t) => (t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2), easeInSine: (t) => -Math.cos(t * N) + 1, easeOutSine: (t) => Math.sin(t * N), easeInOutSine: (t) => -0.5 * (Math.cos(L * t) - 1), easeInExpo: (t) => t === 0 ? 0 : Math.pow(2, 10 * (t - 1)), easeOutExpo: (t) => t === 1 ? 1 : -Math.pow(2, -10 * t) + 1, easeInOutExpo: (t) => ue(t) ? t : t < 0.5 ? 0.5 * Math.pow(2, 10 * (t * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2), easeInCirc: (t) => t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1), easeOutCirc: (t) => Math.sqrt(1 - (t -= 1) * t), easeInOutCirc: (t) => (t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1), easeInElastic: (t) => ue(t) ? t : zi(t, 0.075, 0.3), easeOutElastic: (t) => ue(t) ? t : Bi(t, 0.075, 0.3), easeInOutElastic(t) { return ue(t) ? t : t < 0.5 ? 0.5 * zi(t * 2, 0.1125, 0.45) : 0.5 + 0.5 * Bi(t * 2 - 1, 0.1125, 0.45); }, easeInBack(t) { return t * t * ((1.70158 + 1) * t - 1.70158); }, easeOutBack(t) { return (t -= 1) * t * ((1.70158 + 1) * t + 1.70158) + 1; }, easeInOutBack(t) { let e = 1.70158; return (t /= 0.5) < 1 ? 0.5 * (t * t * (((e *= 1.525) + 1) * t - e)) : 0.5 * ((t -= 2) * t * (((e *= 1.525) + 1) * t + e) + 2); }, easeInBounce: (t) => 1 - Zt.easeOutBounce(1 - t), easeOutBounce(t) { return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375 : 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375; }, easeInOutBounce: (t) => t < 0.5 ? Zt.easeInBounce(t * 2) * 0.5 : Zt.easeOutBounce(t * 2 - 1) * 0.5 + 0.5 }; function mi(t) { if (t && typeof t == "object") { const e = t.toString(); return e === "[object CanvasPattern]" || e === "[object CanvasGradient]"; } return !1; } function Wi(t) { return mi(t) ? t : new Js(t); } function $e(t) { return mi(t) ? t : new Js(t).saturate(0.5).darken(0.1).hexString(); } var Eo = [ "x", "y", "borderWidth", "radius", "tension" ], Fo = [ "color", "borderColor", "backgroundColor" ]; function zo(t) { t.set("animation", { delay: void 0, duration: 1e3, easing: "easeOutQuart", fn: void 0, from: void 0, loop: void 0, to: void 0, type: void 0 }), t.describe("animation", { _fallback: !1, _indexable: !1, _scriptable: (e) => e !== "onProgress" && e !== "onComplete" && e !== "fn" }), t.set("animations", { colors: { type: "color", properties: Fo }, numbers: { type: "number", properties: Eo } }), t.describe("animations", { _fallback: "animation" }), t.set("transitions", { active: { animation: { duration: 400 } }, resize: { animation: { duration: 0 } }, show: { animations: { colors: { from: "transparent" }, visible: { type: "boolean", duration: 0 } } }, hide: { animations: { colors: { to: "transparent" }, visible: { type: "boolean", easing: "linear", fn: (e) => e | 0 } } } }); } function Bo(t) { t.set("layout", { autoPadding: !0, padding: { top: 0, right: 0, bottom: 0, left: 0 } }); } var Hi = /* @__PURE__ */ new Map(); function Wo(t, e) { e = e || {}; const i = t + JSON.stringify(e); let s = Hi.get(i); return s || (s = new Intl.NumberFormat(t, e), Hi.set(i, s)), s; } function Ee(t, e, i) { return Wo(e, i).format(t); } var an = { values(t) { return z(t) ? t : "" + t; }, numeric(t, e, i) { if (t === 0) return "0"; const s = this.chart.options.locale; let n, o = t; if (i.length > 1) { const c = Math.max(Math.abs(i[0].value), Math.abs(i[i.length - 1].value)); (c < 1e-4 || c > 1e15) && (n = "scientific"), o = Ho(t, i); } const r = ht(Math.abs(o)), a = isNaN(r) ? 1 : Math.max(Math.min(-1 * Math.floor(r), 20), 0), l = { notation: n, minimumFractionDigits: a, maximumFractionDigits: a }; return Object.assign(l, this.options.ticks.format), Ee(t, s, l); }, logarithmic(t, e, i) { if (t === 0) return "0"; const s = i[e].significand || t / Math.pow(10, Math.floor(ht(t))); return [ 1, 2, 3, 5, 10, 15 ].includes(s) || e > 0.8 * i.length ? an.numeric.call(this, t, e, i) : ""; } }; function Ho(t, e) { let i = e.length > 3 ? e[2].value - e[1].value : e[1].value - e[0].value; return Math.abs(i) >= 1 && t !== Math.floor(t) && (i = t - Math.floor(t)), i; } var Fe = { formatters: an }; function No(t) { t.set("scale", { display: !0, offset: !1, reverse: !1, beginAtZero: !1, bounds: "ticks", clip: !0, grace: 0, grid: { display: !0, lineWidth: 1, drawOnChartArea: !0, drawTicks: !0, tickLength: 8, tickWidth: (e, i) => i.lineWidth, tickColor: (e, i) => i.color, offset: !1 }, border: { display: !0, dash: [], dashOffset: 0, width: 1 }, title: { display: !1, text: "", padding: { top: 4, bottom: 4 } }, ticks: { minRotation: 0, maxRotation: 50, mirror: !1, textStrokeWidth: 0, textStrokeColor: "", padding: 3, display: !0, autoSkip: !0, autoSkipPadding: 3, labelOffset: 0, callback: Fe.formatters.values, minor: {}, major: {}, align: "center", crossAlign: "near", showLabelBackdrop: !1, backdropColor: "rgba(255, 255, 255, 0.75)", backdropPadding: 2 } }), t.route("scale.ticks", "color", "", "color"), t.route("scale.grid", "color", "", "borderColor"), t.route("scale.border", "color", "", "borderColor"), t.route("scale.title", "color", "", "color"), t.describe("scale", { _fallback: !1, _scriptable: (e) => !e.startsWith("before") && !e.startsWith("after") && e !== "callback" && e !== "parser", _indexable: (e) => e !== "borderDash" && e !== "tickBorderDash" && e !== "dash" }), t.describe("scales", { _fallback: "scale" }), t.describe("scale.ticks", { _scriptable: (e) => e !== "backdropPadding" && e !== "callback", _indexable: (e) => e !== "backdropPadding" }); } var Pt = /* @__PURE__ */ Object.create(null), si = /* @__PURE__ */ Object.create(null); function Qt(t, e) { if (!e) return t; const i = e.split("."); for (let s = 0, n = i.length; s < n; ++s) { const o = i[s]; t = t[o] || (t[o] = /* @__PURE__ */ Object.create(null)); } return t; } function Ye(t, e, i) { return typeof e == "string" ? te(Qt(t, e), i) : te(Qt(t, ""), e); } var Vo = class { constructor(t, e) { this.animation = void 0, this.backgroundColor = "rgba(0,0,0,0.1)", this.borderColor = "rgba(0,0,0,0.1)", this.color = "#666", this.datasets = {}, this.devicePixelRatio = (i) => i.chart.platform.getDevicePixelRatio(), this.elements = {}, this.events = [ "mousemove", "mouseout", "click", "touchstart", "touchmove" ], this.font = { family: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", size: 12, style: "normal", lineHeight: 1.2, weight: null }, this.hover = {}, this.hoverBackgroundColor = (i, s) => $e(s.backgroundColor), this.hoverBorderColor = (i, s) => $e(s.borderColor), this.hoverColor = (i, s) => $e(s.color), this.indexAxis = "x", this.interaction = { mode: "nearest", intersect: !0, includeInvisible: !1 }, this.maintainAspectRatio = !0, this.onHover = null, this.onClick = null, this.parsing = !0, this.plugins = {}, this.responsive = !0, this.scale = void 0, this.scales = {}, this.showLine = !0, this.drawActiveElementsOnTop = !0, this.describe(t), this.apply(e); } set(t, e) { return Ye(this, t, e); } get(t) { return Qt(this, t); } describe(t, e) { return Ye(si, t, e); } override(t, e) { return Ye(Pt, t, e); } route(t, e, i, s) { const n = Qt(this, t), o = Qt(this, i), r = "_" + e; Object.defineProperties(n, { [r]: { value: n[e], writable: !0 }, [e]: { enumerable: !0, get() { const a = this[r], l = o[s]; return O(a) ? Object.assign({}, l, a) : P(a, l); }, set(a) { this[r] = a; } } }); } apply(t) { t.forEach((e) => e(this)); } }, H = /* @__PURE__ */ new Vo({ _scriptable: (t) => !t.startsWith("on"), _indexable: (t) => t !== "events", hover: { _fallback: "interaction" }, interaction: { _scriptable: !1, _indexable: !1 } }, [ zo, Bo, No ]); function jo(t) { return !t || R(t.size) || R(t.family) ? null : (t.style ? t.style + " " : "") + (t.weight ? t.weight + " " : "") + t.size + "px " + t.family; } function Oe(t, e, i, s, n) { let o = e[n]; return o || (o = e[n] = t.measureText(n).width, i.push(n)), o > s && (s = o), s; } function $o(t, e, i, s) { s = s || {}; let n = s.data = s.data || {}, o = s.garbageCollect = s.garbageCollect || []; s.font !== e && (n = s.data = {}, o = s.garbageCollect = [], s.font = e), t.save(), t.font = e; let r = 0; const a = i.length; let l, c, h, d, f; for (l = 0; l < a; l++) if (d = i[l], d != null && !z(d)) r = Oe(t, n, o, r, d); else if (z(d)) for (c = 0, h = d.length; c < h; c++) f = d[c], f != null && !z(f) && (r = Oe(t, n, o, r, f)); t.restore(); const u = o.length / 2; if (u > i.length) { for (l = 0; l < u; l++) delete n[o[l]]; o.splice(0, u); } return r; } function _t(t, e, i) { const s = t.currentDevicePixelRatio, n = i !== 0 ? Math.max(i / 2, 0.5) : 0; return Math.round((e - n) * s) / s + n; } function Ni(t, e) { !e && !t || (e = e || t.getContext("2d"), e.save(), e.resetTransform(), e.clearRect(0, 0, t.width, t.height), e.restore()); } function ni(t, e, i, s) { ln(t, e, i, s, null); } function ln(t, e, i, s, n) { let o, r, a, l, c, h, d, f; const u = e.pointStyle, p = e.rotation, m = e.radius; let g = (p || 0) * vo; if (u && typeof u == "object" && (o = u.toString(), o === "[object HTMLImageElement]" || o === "[object HTMLCanvasElement]")) { t.save(), t.translate(i, s), t.rotate(g), t.drawImage(u, -u.width / 2, -u.height / 2, u.width, u.height), t.restore(); return; } if (!(isNaN(m) || m <= 0)) { switch (t.beginPath(), u) { default: n ? t.ellipse(i, s, n / 2, m, 0, 0, F) : t.arc(i, s, m, 0, F), t.closePath(); break; case "triangle": h = n ? n / 2 : m, t.moveTo(i + Math.sin(g) * h, s - Math.cos(g) * m), g += Ri, t.lineTo(i + Math.sin(g) * h, s - Math.cos(g) * m), g += Ri, t.lineTo(i + Math.sin(g) * h, s - Math.cos(g) * m), t.closePath(); break; case "rectRounded": c = m * 0.516, l = m - c, r = Math.cos(g + bt) * l, d = Math.cos(g + bt) * (n ? n / 2 - c : l), a = Math.sin(g + bt) * l, f = Math.sin(g + bt) * (n ? n / 2 - c : l), t.arc(i - d, s - a, c, g - L, g - N), t.arc(i + f, s - r, c, g - N, g), t.arc(i + d, s + a, c, g, g + N), t.arc(i - f, s + r, c, g + N, g + L), t.closePath(); break; case "rect": if (!p) { l = Math.SQRT1_2 * m, h = n ? n / 2 : l, t.rect(i - h, s - l, 2 * h, 2 * l); break; } g += bt; case "rectRot": d = Math.cos(g) * (n ? n / 2 : m), r = Math.cos(g) * m, a = Math.sin(g) * m, f = Math.sin(g) * (n ? n / 2 : m), t.moveTo(i - d, s - a), t.lineTo(i + f, s - r), t.lineTo(i + d, s + a), t.lineTo(i - f, s + r), t.closePath(); break; case "crossRot": g += bt; case "cross": d = Math.cos(g) * (n ? n / 2 : m), r = Math.cos(g) * m, a = Math.sin(g) * m, f = Math.sin(g) * (n ? n / 2 : m), t.moveTo(i - d, s - a), t.lineTo(i + d, s + a), t.moveTo(i + f, s - r), t.lineTo(i - f, s + r); break; case "star": d = Math.cos(g) * (n ? n / 2 : m), r = Math.cos(g) * m, a = Math.sin(g) * m, f = Math.sin(g) * (n ? n / 2 : m), t.moveTo(i - d, s - a), t.lineTo(i + d, s + a), t.moveTo(i + f, s - r), t.lineTo(i - f, s + r), g += bt, d = Math.cos(g) * (n ? n / 2 : m), r = Math.cos(g) * m, a = Math.sin(g) * m, f = Math.sin(g) * (n ? n / 2 : m), t.moveTo(i - d, s - a), t.lineTo(i + d, s + a), t.moveTo(i + f, s - r), t.lineTo(i - f, s + r); break; case "line": r = n ? n / 2 : Math.cos(g) * m, a = Math.sin(g) * m, t.moveTo(i - r, s - a), t.lineTo(i + r, s + a); break; case "dash": t.moveTo(i, s), t.lineTo(i + Math.cos(g) * (n ? n / 2 : m), s + Math.sin(g) * m); break; case !1: t.closePath(); break; } t.fill(), e.borderWidth > 0 && t.stroke(); } } function lt(t, e, i) { return i = i || 0.5, !e || t && t.x > e.left - i && t.x < e.right + i && t.y > e.top - i && t.y < e.bottom + i; } function ze(t, e) { t.save(), t.beginPath(), t.rect(e.left, e.top, e.right - e.left, e.bottom - e.top), t.clip(); } function Be(t) { t.restore(); } function Yo(t, e, i, s, n) { if (!e) return t.lineTo(i.x, i.y); if (n === "middle") { const o = (e.x + i.x) / 2; t.lineTo(o, e.y), t.lineTo(o, i.y); } else n === "after" != !!s ? t.lineTo(e.x, i.y) : t.lineTo(i.x, e.y); t.lineTo(i.x, i.y); } function Uo(t, e, i, s) { if (!e) return t.lineTo(i.x, i.y); t.bezierCurveTo(s ? e.cp1x : e.cp2x, s ? e.cp1y : e.cp2y, s ? i.cp2x : i.cp1x, s ? i.cp2y : i.cp1y, i.x, i.y); } function Xo(t, e) { e.translation && t.translate(e.translation[0], e.translation[1]), R(e.rotation) || t.rotate(e.rotation), e.color && (t.fillStyle = e.color), e.textAlign && (t.textAlign = e.textAlign), e.textBaseline && (t.textBaseline = e.textBaseline); } function Ko(t, e, i, s, n) { if (n.strikethrough || n.underline) { const o = t.measureText(s), r = e - o.actualBoundingBoxLeft, a = e + o.actualBoundingBoxRight, l = i - o.actualBoundingBoxAscent, c = i + o.actualBoundingBoxDescent, h = n.strikethrough ? (l + c) / 2 : c; t.strokeStyle = t.fillStyle, t.beginPath(), t.lineWidth = n.decorationWidth || 2, t.moveTo(r, h), t.lineTo(a, h), t.stroke(); } } function qo(t, e) { const i = t.fillStyle; t.fillStyle = e.color, t.fillRect(e.left, e.top, e.width, e.height), t.fillStyle = i; } function Ft(t, e, i, s, n, o = {}) { const r = z(e) ? e : [e], a = o.strokeWidth > 0 && o.strokeColor !== ""; let l, c; for (t.save(), t.font = n.string, Xo(t, o), l = 0; l < r.length; ++l) c = r[l], o.backdrop && qo(t, o.backdrop), a && (o.strokeColor && (t.strokeStyle = o.strokeColor), R(o.strokeWidth) || (t.lineWidth = o.strokeWidth), t.strokeText(c, i, s, o.maxWidth)), t.fillText(c, i, s, o.maxWidth), Ko(t, i, s, c, o), s += Number(n.lineHeight); t.restore(); } function Te(t, e) { const { x: i, y: s, w: n, h: o, radius: r } = e; t.arc(i + r.topLeft, s + r.topLeft, r.topLeft, 1.5 * L, L, !0), t.lineTo(i, s + o - r.bottomLeft), t.arc(i + r.bottomLeft, s + o - r.bottomLeft, r.bottomLeft, L, N, !0), t.lineTo(i + n - r.bottomRight, s + o), t.arc(i + n - r.bottomRight, s + o - r.bottomRight, r.bottomRight, N, 0, !0), t.lineTo(i + n, s + r.topRight), t.arc(i + n - r.topRight, s + r.topRight, r.topRight, 0, -N, !0), t.lineTo(i + r.topLeft, s); } var Go = /^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/, Jo = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/; function Zo(t, e) { const i = ("" + t).match(Go); if (!i || i[1] === "normal") return e * 1.2; switch (t = +i[2], i[3]) { case "px": return t; case "%": t /= 100; break; } return e * t; } var Qo = (t) => +t || 0; function bi(t, e) { const i = {}, s = O(e), n = s ? Object.keys(e) : e, o = O(t) ? s ? (r) => P(t[r], t[e[r]]) : (r) => t[r] : () => t; for (const r of n) i[r] = Qo(o(r)); return i; } function tr(t) { return bi(t, { top: "y", right: "x", bottom: "y", left: "x" }); } function Rt(t) { return bi(t, [ "topLeft", "topRight", "bottomLeft", "bottomRight" ]); } function X(t) { const e = tr(t); return e.width = e.left + e.right, e.height = e.top + e.bottom, e; } function j(t, e) { t = t || {}, e = e || H.font; let i = P(t.size, e.size); typeof i == "string" && (i = parseInt(i, 10)); let s = P(t.style, e.style); s && !("" + s).match(Jo) && (console.warn('Invalid font style specified: "' + s + '"'), s = void 0); const n = { family: P(t.family, e.family), lineHeight: Zo(P(t.lineHeight, e.lineHeight), i), size: i, style: s, weight: P(t.weight, e.weight), string: "" }; return n.string = jo(n), n; } function ge(t, e, i, s) { let n = !0, o, r, a; for (o = 0, r = t.length; o < r; ++o) if (a = t[o], a !== void 0 && (e !== void 0 && typeof a == "function" && (a = a(e), n = !1), i !== void 0 && z(a) && (a = a[i % a.length], n = !1), a !== void 0)) return s && !n && (s.cacheable = !1), a; } function er(t, e, i) { const { min: s, max: n } = t, o = Zs(e, (n - s) / 2), r = (a, l) => i && a === 0 ? 0 : a + l; return { min: r(s, -Math.abs(o)), max: r(n, o) }; } function pt(t, e) { return Object.assign(Object.create(t), e); } function _i(t, e = [""], i, s, n = () => t[0]) { const o = i || t; return typeof s > "u" && (s = fn("_fallback", t)), new Proxy({ [Symbol.toStringTag]: "Object", _cacheable: !0, _scopes: t, _rootScopes: o, _fallback: s, _getTarget: n, override: (r) => _i([r, ...t], e, o, s) }, { deleteProperty(r, a) { return delete r[a], delete r._keys, delete t[0][a], !0; }, get(r, a) { return hn(r, a, () => cr(a, e, t, r)); }, getOwnPropertyDescriptor(r, a) { return Reflect.getOwnPropertyDescriptor(r._scopes[0], a); }, getPrototypeOf() { return Reflect.getPrototypeOf(t[0]); }, has(r, a) { return ji(r).includes(a); }, ownKeys(r) { return ji(r); }, set(r, a, l) { const c = r._storage || (r._storage = n()); return r[a] = c[a] = l, delete r._keys, !0; } }); } function zt(t, e, i, s) { const n = { _cacheable: !1, _proxy: t, _context: e, _subProxy: i, _stack: /* @__PURE__ */ new Set(), _descriptors: cn(t, s), setContext: (o) => zt(t, o, i, s), override: (o) => zt(t.override(o), e, i, s) }; return new Proxy(n, { deleteProperty(o, r) { return delete o[r], delete t[r], !0; }, get(o, r, a) { return hn(o, r, () => sr(o, r, a)); }, getOwnPropertyDescriptor(o, r) { return o._descriptors.allKeys ? Reflect.has(t, r) ? { enumerable: !0, configurable: !0 } : void 0 : Reflect.getOwnPropertyDescriptor(t, r); }, getPrototypeOf() { return Reflect.getPrototypeOf(t); }, has(o, r) { return Reflect.has(t, r); }, ownKeys() { return Reflect.ownKeys(t); }, set(o, r, a) { return t[r] = a, delete o[r], !0; } }); } function cn(t, e = { scriptable: !0, indexable: !0 }) { const { _scriptable: i = e.scriptable, _indexable: s = e.indexable, _allKeys: n = e.allKeys } = t; return { allKeys: n, scriptable: i, indexable: s, isScriptable: gt(i) ? i : () => i, isIndexable: gt(s) ? s : () => s }; } var ir = (t, e) => t ? t + ui(e) : e, xi = (t, e) => O(e) && t !== "adapters" && (Object.getPrototypeOf(e) === null || e.constructor === Object); function hn(t, e, i) { if (Object.prototype.hasOwnProperty.call(t, e) || e === "constructor") return t[e]; const s = i(); return t[e] = s, s; } function sr(t, e, i) { const { _proxy: s, _context: n, _subProxy: o, _descriptors: r } = t; let a = s[e]; return gt(a) && r.isScriptable(e) && (a = nr(e, a, t, i)), z(a) && a.length && (a = or(e, a, t, r.isIndexable)), xi(e, a) && (a = zt(a, n, o && o[e], r)), a; } function nr(t, e, i, s) { const { _proxy: n, _context: o, _subProxy: r, _stack: a } = i; if (a.has(t)) throw new Error("Recursion detected: " + Array.from(a).join("->") + "->" + t); a.add(t); let l = e(o, r || s); return a.delete(t), xi(t, l) && (l = yi(n._scopes, n, t, l)), l; } function or(t, e, i, s) { const { _proxy: n, _context: o, _subProxy: r, _descriptors: a } = i; if (typeof o.index < "u" && s(t)) return e[o.index % e.length]; if (O(e[0])) { const l = e, c = n._scopes.filter((h) => h !== l); e = []; for (const h of l) { const d = yi(c, n, t, h); e.push(zt(d, o, r && r[t], a)); } } return e; } function dn(t, e, i) { return gt(t) ? t(e, i) : t; } var rr = (t, e) => t === !0 ? e : typeof t == "string" ? ee(e, t) : void 0; function ar(t, e, i, s, n) { for (const o of e) { const r = rr(i, o); if (r) { t.add(r); const a = dn(r._fallback, i, n); if (typeof a < "u" && a !== i && a !== s) return a; } else if (r === !1 && typeof s < "u" && i !== s) return null; } return !1; } function yi(t, e, i, s) { const n = e._rootScopes, o = dn(e._fallback, i, s), r = [...t, ...n], a = /* @__PURE__ */ new Set(); a.add(s); let l = Vi(a, r, i, o || i, s); return l === null || typeof o < "u" && o !== i && (l = Vi(a, r, o, l, s), l === null) ? !1 : _i(Array.from(a), [""], n, o, () => lr(e, i, s)); } function Vi(t, e, i, s, n) { for (; i; ) i = ar(t, e, i, s, n); return i; } function lr(t, e, i) { const s = t._getTarget(); e in s || (s[e] = {}); const n = s[e]; return z(n) && O(i) ? i : n || {}; } function cr(t, e, i, s) { let n; for (const o of e) if (n = fn(ir(o, t), i), typeof n < "u") return xi(t, n) ? yi(i, s, t, n) : n; } function fn(t, e) { for (const i of e) { if (!i) continue; const s = i[t]; if (typeof s < "u") return s; } } function ji(t) { let e = t._keys; return e || (e = t._keys = hr(t._scopes)), e; } function hr(t) { const e = /* @__PURE__ */ new Set(); for (const i of t) for (const s of Object.keys(i).filter((n) => !n.startsWith("_"))) e.add(s); return Array.from(e); } var dr = Number.EPSILON || 1e-14, Bt = (t, e) => e < t.length && !t[e].skip && t[e], un = (t) => t === "x" ? "y" : "x"; function fr(t, e, i, s) { const n = t.skip ? e : t, o = e, r = i.skip ? e : i, a = ii(o, n), l = ii(r, o); let c = a / (a + l), h = l / (a + l); c = isNaN(c) ? 0 : c, h = isNaN(h) ? 0 : h; const d = s * c, f = s * h; return { previous: { x: o.x - d * (r.x - n.x), y: o.y - d * (r.y - n.y) }, next: { x: o.x + f * (r.x - n.x), y: o.y + f * (r.y - n.y) } }; } function ur(t, e, i) { const s = t.length; let n, o, r, a, l, c = Bt(t, 0); for (let h = 0; h < s - 1; ++h) if (l = c, c = Bt(t, h + 1), !(!l || !c)) { if (Jt(e[h], 0, dr)) { i[h] = i[h + 1] = 0; continue; } n = i[h] / e[h], o = i[h + 1] / e[h], a = Math.pow(n, 2) + Math.pow(o, 2), !(a <= 9) && (r = 3 / Math.sqrt(a), i[h] = n * r * e[h], i[h + 1] = o * r * e[h]); } } function gr(t, e, i = "x") { const s = un(i), n = t.length; let o, r, a, l = Bt(t, 0); for (let c = 0; c < n; ++c) { if (r = a, a = l, l = Bt(t, c + 1), !a) continue; const h = a[i], d = a[s]; r && (o = (h - r[i]) / 3, a[`cp1${i}`] = h - o, a[`cp1${s}`] = d - o * e[c]), l && (o = (l[i] - h) / 3, a[`cp2${i}`] = h + o, a[`cp2${s}`] = d + o * e[c]); } } function pr(t, e = "x") { const i = un(e), s = t.length, n = Array(s).fill(0), o = Array(s); let r, a, l, c = Bt(t, 0); for (r = 0; r < s; ++r) if (a = l, l = c, c = Bt(t, r + 1), !!l) { if (c) { const h = c[e] - l[e]; n[r] = h !== 0 ? (c[i] - l[i]) / h : 0; } o[r] = a ? c ? Et(n[r - 1]) !== Et(n[r]) ? 0 : (n[r - 1] + n[r]) / 2 : n[r - 1] : n[r]; } ur(t, n, o), gr(t, o, e); } function pe(t, e, i) { return Math.max(Math.min(t, i), e); } function mr(t, e) { let i, s, n, o, r, a = lt(t[0], e); for (i = 0, s = t.length; i < s; ++i) r = o, o = a, a = i < s - 1 && lt(t[i + 1], e), o && (n = t[i], r && (n.cp1x = pe(n.cp1x, e.left, e.right), n.cp1y = pe(n.cp1y, e.top, e.bottom)), a && (n.cp2x = pe(n.cp2x, e.left, e.right), n.cp2y = pe(n.cp2y, e.top, e.bottom))); } function br(t, e, i, s, n) { let o, r, a, l; if (e.spanGaps && (t = t.filter((c) => !c.skip)), e.cubicInterpolationMode === "monotone") pr(t, n); else { let c = s ? t[t.length - 1] : t[0]; for (o = 0, r = t.length; o < r; ++o) a = t[o], l = fr(c, a, t[Math.min(o + 1, r - (s ? 0 : 1)) % r], e.tension), a.cp1x = l.previous.x, a.cp1y = l.previous.y, a.cp2x = l.next.x, a.cp2y = l.next.y, c = a; } e.capBezierPoints && mr(t, i); } function vi() { return typeof window < "u" && typeof document < "u"; } function Mi(t) { let e = t.parentNode; return e && e.toString() === "[object ShadowRoot]" && (e = e.host), e; } function Ae(t, e, i) { let s; return typeof t == "string" ? (s = parseInt(t, 10), t.indexOf("%") !== -1 && (s = s / 100 * e.parentNode[i])) : s = t, s; } var We = (t) => t.ownerDocument.defaultView.getComputedStyle(t, null); function _r(t, e) { return We(t).getPropertyValue(e); } var xr = [ "top", "right", "bottom", "left" ]; function St(t, e, i) { const s = {}; i = i ? "-" + i : ""; for (let n = 0; n < 4; n++) { const o = xr[n]; s[o] = parseFloat(t[e + "-" + o + i]) || 0; } return s.width = s.left + s.right, s.height = s.top + s.bottom, s; } var yr = (t, e, i) => (t > 0 || e > 0) && (!i || !i.shadowRoot); function vr(t, e) { const i = t.touches, s = i && i.length ? i[0] : t, { offsetX: n, offsetY: o } = s; let r = !1, a, l; if (yr(n, o, t.target)) a = n, l = o; else { const c = e.getBoundingClientRect(); a = s.clientX - c.left, l = s.clientY - c.top, r = !0; } return { x: a, y: l, box: r }; } function vt(t, e) { if ("native" in t) return t; const { canvas: i, currentDevicePixelRatio: s } = e, n = We(i), o = n.boxSizing === "border-box", r = St(n, "padding"), a = St(n, "border", "width"), { x: l, y: c, box: h } = vr(t, i), d = r.left + (h && a.left), f = r.top + (h && a.top); let { width: u, height: p } = e; return o && (u -= r.width + a.width, p -= r.height + a.height), { x: Math.round((l - d) / u * i.width / s), y: Math.round((c - f) / p * i.height / s) }; } function Mr(t, e, i) { let s, n; if (e === void 0 || i === void 0) { const o = t && Mi(t); if (!o) e = t.clientWidth, i = t.clientHeight; else { const r = o.getBoundingClientRect(), a = We(o), l = St(a, "border", "width"), c = St(a, "padding"); e = r.width - c.width - l.width, i = r.height - c.height - l.height, s = Ae(a.maxWidth, o, "clientWidth"), n = Ae(a.maxHeight, o, "clientHeight"); } } return { width: e, height: i, maxWidth: s || De, maxHeight: n || De }; } var dt = (t) => Math.round(t * 10) / 10; function wr(t, e, i, s) { const n = We(t), o = St(n, "margin"), r = Ae(n.maxWidth, t, "clientWidth") || De, a = Ae(n.maxHeight, t, "clientHeight") || De, l = Mr(t, e, i); let { width: c, height: h } = l; if (n.boxSizing === "content-box") { const d = St(n, "border", "width"), f = St(n, "padding"); c -= f.width + d.width, h -= f.height + d.height; } return c = Math.max(0, c - o.width), h = Math.max(0, s ? c / s : h - o.height), c = dt(Math.min(c, r, l.maxWidth)), h = dt(Math.min(h, a, l.maxHeight)), c && !h && (h = dt(c / 2)), (e !== void 0 || i !== void 0) && s && l.height && h > l.height && (h = l.height, c = dt(Math.floor(h * s))), { width: c, height: h }; } function $i(t, e, i) { const s = e || 1, n = dt(t.height * s), o = dt(t.width * s); t.height = dt(t.height), t.width = dt(t.width); const r = t.canvas; return r.style && (i || !r.style.height && !r.style.width) && (r.style.height = `${t.height}px`, r.style.width = `${t.width}px`), t.currentDevicePixelRatio !== s || r.height !== n || r.width !== o ? (t.currentDevicePixelRatio = s, r.height = n, r.width = o, t.ctx.setTransform(s, 0, 0, s, 0, 0), !0) : !1; } var kr = (function() { let t = !1; try { const e = { get passive() { return t = !0, !1; } }; vi() && (window.addEventListener("test", null, e), window.removeEventListener("test", null, e)); } catch { } return t; })(); function Yi(t, e) { const i = _r(t, e), s = i && i.match(/^(\d+)(\.\d+)?px$/); return s ? +s[1] : void 0; } function Mt(t, e, i, s) { return { x: t.x + i * (e.x - t.x), y: t.y + i * (e.y - t.y) }; } function Sr(t, e, i, s) { return { x: t.x + i * (e.x - t.x), y: s === "middle" ? i < 0.5 ? t.y : e.y : s === "after" ? i < 1 ? t.y : e.y : i > 0 ? e.y : t.y }; } function Pr(t, e, i, s) { const n = { x: t.cp2x, y: t.cp2y }, o = { x: e.cp1x, y: e.cp1y }, r = Mt(t, n, i), a = Mt(n, o, i), l = Mt(o, e, i); return Mt(Mt(r, a, i), Mt(a, l, i), i); } var Cr = function(t, e) { return { x(i) { return t + t + e - i; }, setWidth(i) { e = i; }, textAlign(i) { return i === "center" ? i : i === "right" ? "left" : "right"; }, xPlus(i, s) { return i - s; }, leftForLtr(i, s) { return i - s; } }; }, Dr = function() { return { x(t) { return t; }, setWidth(t) { }, textAlign(t) { return t; }, xPlus(t, e) { return t + e; }, leftForLtr(t, e) { return t; } }; }; function It(t, e, i) { return t ? Cr(e, i) : Dr(); } function gn(t, e) { let i, s; (e === "ltr" || e === "rtl") && (i = t.canvas.style, s = [i.getPropertyValue("direction"), i.getPropertyPriority("direction")], i.setProperty("direction", e, "important"), t.prevTextDirection = s); } function pn(t, e) { e !== void 0 && (delete t.prevTextDirection, t.canvas.style.setProperty("direction", e[0], e[1])); } function mn(t) { return t === "angle" ? {