UNPKG

@abdullah-waseem/klinecharts-pro

Version:

Financial chart built out of the box based on KLineChart. Edited by Abdullah-Waseem

1,666 lines 238 kB
var D5 = Object.defineProperty; var O5 = (e, t, n) => t in e ? D5(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var O1 = (e, t, n) => (O5(e, typeof t != "symbol" ? t + "" : t, n), n); import { utils as B, registerFigure as Ae, registerOverlay as Ne, init as B5, dispose as F5 } from "klinecharts"; function H1(e, t, n) { const r = (e.x - t.x) * Math.cos(n) - (e.y - t.y) * Math.sin(n) + t.x, a = (e.x - t.x) * Math.sin(n) + (e.y - t.y) * Math.cos(n) + t.y; return { x: r, y: a }; } function De(e, t) { if (e.length > 1) { let n; return e[0].x === e[1].x && e[0].y !== e[1].y ? e[0].y < e[1].y ? n = { x: e[0].x, y: t.height } : n = { x: e[0].x, y: 0 } : e[0].x > e[1].x ? n = { x: 0, y: B.getLinearYFromCoordinates(e[0], e[1], { x: 0, y: e[0].y }) } : n = { x: t.width, y: B.getLinearYFromCoordinates(e[0], e[1], { x: t.width, y: e[0].y }) }, { coordinates: [e[0], n] }; } return []; } function z0(e, t) { const n = Math.abs(e.x - t.x), r = Math.abs(e.y - t.y); return Math.sqrt(n * n + r * r); } const E5 = { name: "arrow", totalStep: 3, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, createPointFigures: ({ coordinates: e }) => { if (e.length > 1) { const t = e[1].x > e[0].x ? 0 : 1, n = B.getLinearSlopeIntercept(e[0], e[1]); let r; n ? r = Math.atan(n[0]) + Math.PI * t : e[1].y > e[0].y ? r = Math.PI / 2 : r = Math.PI / 2 * 3; const a = H1({ x: e[1].x - 8, y: e[1].y + 4 }, e[1], r), i = H1({ x: e[1].x - 8, y: e[1].y - 4 }, e[1], r); return [ { type: "line", attrs: { coordinates: e } }, { type: "line", ignoreEvent: !0, attrs: { coordinates: [a, e[1], i] } } ]; } return []; } }, K5 = { name: "circle", totalStep: 3, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, styles: { circle: { color: "rgba(22, 119, 255, 0.15)" } }, createPointFigures: ({ coordinates: e }) => { if (e.length > 1) { const t = z0(e[0], e[1]); return { type: "circle", attrs: { ...e[0], r: t }, styles: { style: "stroke_fill" } }; } return []; } }, j5 = { name: "rect", totalStep: 3, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, styles: { polygon: { color: "rgba(22, 119, 255, 0.15)" } }, createPointFigures: ({ coordinates: e }) => e.length > 1 ? [ { type: "polygon", attrs: { coordinates: [ e[0], { x: e[1].x, y: e[0].y }, e[1], { x: e[0].x, y: e[1].y } ] }, styles: { style: "stroke_fill" } } ] : [] }, R5 = { name: "parallelogram", totalStep: 4, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, styles: { polygon: { color: "rgba(22, 119, 255, 0.15)" } }, createPointFigures: ({ coordinates: e }) => { if (e.length === 2) return [ { type: "line", ignoreEvent: !0, attrs: { coordinates: e } } ]; if (e.length === 3) { const t = { x: e[0].x + (e[2].x - e[1].x), y: e[2].y }; return [ { type: "polygon", attrs: { coordinates: [e[0], e[1], e[2], t] }, styles: { style: "stroke_fill" } } ]; } return []; }, performEventPressedMove: ({ points: e, performPointIndex: t, performPoint: n }) => { t < 2 && (e[0].price = n.price, e[1].price = n.price); }, performEventMoveForDrawing: ({ currentStep: e, points: t, performPoint: n }) => { e === 2 && (t[0].price = n.price); } }, Q5 = { name: "triangle", totalStep: 4, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, styles: { polygon: { color: "rgba(22, 119, 255, 0.15)" } }, createPointFigures: ({ coordinates: e }) => [ { type: "polygon", attrs: { coordinates: e }, styles: { style: "stroke_fill" } } ] }, z5 = { name: "fibonacciCircle", totalStep: 3, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, createPointFigures: ({ coordinates: e }) => { if (e.length > 1) { const t = Math.abs(e[0].x - e[1].x), n = Math.abs(e[0].y - e[1].y), r = Math.sqrt(t * t + n * n), a = [0.236, 0.382, 0.5, 0.618, 0.786, 1], i = [], o = []; return a.forEach((s) => { const c = r * s; i.push( { ...e[0], r: c } ), o.push({ x: e[0].x, y: e[0].y + c + 6, text: `${(s * 100).toFixed(1)}%` }); }), [ { type: "circle", attrs: i, styles: { style: "stroke" } }, { type: "text", ignoreEvent: !0, attrs: o } ]; } return []; } }, Z5 = { name: "fibonacciSegment", totalStep: 3, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, createPointFigures: ({ coordinates: e, overlay: t }) => { const n = [], r = []; if (e.length > 1) { const a = e[1].x > e[0].x ? e[0].x : e[1].x, i = [1, 0.786, 0.618, 0.5, 0.382, 0.236, 0], o = e[0].y - e[1].y, s = t.points, c = s[0].value - s[1].value; i.forEach((u) => { const l = e[1].y + o * u, m = (s[1].value + c * u).toFixed(4); n.push({ coordinates: [ { x: e[0].x, y: l }, { x: e[1].x, y: l } ] }), r.push({ x: a, y: l, text: `${m} (${(u * 100).toFixed(1)}%)`, baseline: "bottom" }); }); } return [ { type: "line", attrs: n }, { type: "text", ignoreEvent: !0, attrs: r } ]; } }, U5 = { name: "fibonacciSpiral", totalStep: 3, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, createPointFigures: ({ coordinates: e, bounding: t }) => { if (e.length > 1) { const n = z0(e[0], e[1]) / Math.sqrt(24), r = e[1].x > e[0].x ? 0 : 1, a = B.getLinearSlopeIntercept(e[0], e[1]); let i; a ? i = Math.atan(a[0]) + Math.PI * r : e[1].y > e[0].y ? i = Math.PI / 2 : i = Math.PI / 2 * 3; const o = H1( { x: e[0].x - n, y: e[0].y }, e[0], i ), s = H1( { x: e[0].x - n, y: e[0].y - n }, e[0], i ), c = [{ ...o, r: n, startAngle: i, endAngle: i + Math.PI / 2 }, { ...s, r: n * 2, startAngle: i + Math.PI / 2, endAngle: i + Math.PI }]; let u = e[0].x - n, l = e[0].y - n; for (let m = 2; m < 9; m++) { const h = c[m - 2].r + c[m - 1].r; let b = 0; switch (m % 4) { case 0: { b = i, u -= c[m - 2].r; break; } case 1: { b = i + Math.PI / 2, l -= c[m - 2].r; break; } case 2: { b = i + Math.PI, u += c[m - 2].r; break; } case 3: { b = i + Math.PI / 2 * 3, l += c[m - 2].r; break; } } const M = b + Math.PI / 2, T = H1({ x: u, y: l }, e[0], i); c.push({ ...T, r: h, startAngle: b, endAngle: M }); } return [ { type: "arc", attrs: c }, { type: "line", attrs: De(e, t) } ]; } return []; } }, V5 = { name: "fibonacciSpeedResistanceFan", totalStep: 3, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, createPointFigures: ({ coordinates: e, bounding: t }) => { const n = []; let r = []; const a = []; if (e.length > 1) { const i = e[1].x > e[0].x ? -38 : 4, o = e[1].y > e[0].y ? -2 : 20, s = e[1].x - e[0].x, c = e[1].y - e[0].y; [1, 0.75, 0.618, 0.5, 0.382, 0.25, 0].forEach((l) => { const m = e[1].x - s * l, h = e[1].y - c * l; n.push({ coordinates: [{ x: m, y: e[0].y }, { x: m, y: e[1].y }] }), n.push({ coordinates: [{ x: e[0].x, y: h }, { x: e[1].x, y: h }] }), r = r.concat(De([e[0], { x: m, y: e[1].y }], t)), r = r.concat(De([e[0], { x: e[1].x, y: h }], t)), a.unshift({ x: e[0].x + i, y: h + 10, text: `${l.toFixed(3)}` }), a.unshift({ x: m - 18, y: e[0].y + o, text: `${l.toFixed(3)}` }); }); } return [ { type: "line", attrs: n }, { type: "line", attrs: r }, { type: "text", ignoreEvent: !0, attrs: a } ]; } }, Y5 = { name: "fibonacciExtension", totalStep: 4, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, createPointFigures: ({ coordinates: e, overlay: t }) => { const n = [], r = []; if (e.length > 2) { const a = t.points, i = a[1].value - a[0].value, o = e[1].y - e[0].y, s = [0, 0.236, 0.382, 0.5, 0.618, 0.786, 1], c = e[2].x > e[1].x ? e[1].x : e[2].x; s.forEach((u) => { const l = e[2].y + o * u, m = (a[2].value + i * u).toFixed(4); n.push({ coordinates: [ { x: e[1].x, y: l }, { x: e[2].x, y: l } ] }), r.push({ x: c, y: l, text: `${m} (${(u * 100).toFixed(1)}%)`, baseline: "bottom" }); }); } return [ { type: "line", attrs: { coordinates: e }, styles: { style: "dashed" } }, { type: "line", attrs: n }, { type: "text", ignoreEvent: !0, attrs: r } ]; } }, H5 = { name: "gannBox", totalStep: 3, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, styles: { polygon: { color: "rgba(22, 119, 255, 0.15)" } }, createPointFigures: ({ coordinates: e }) => { if (e.length > 1) { const t = (e[1].y - e[0].y) / 4, n = e[1].x - e[0].x, r = [ { coordinates: [e[0], { x: e[1].x, y: e[1].y - t }] }, { coordinates: [e[0], { x: e[1].x, y: e[1].y - t * 2 }] }, { coordinates: [{ x: e[0].x, y: e[1].y }, { x: e[1].x, y: e[0].y + t }] }, { coordinates: [{ x: e[0].x, y: e[1].y }, { x: e[1].x, y: e[0].y + t * 2 }] }, { coordinates: [{ ...e[0] }, { x: e[0].x + n * 0.236, y: e[1].y }] }, { coordinates: [{ ...e[0] }, { x: e[0].x + n * 0.5, y: e[1].y }] }, { coordinates: [{ x: e[0].x, y: e[1].y }, { x: e[0].x + n * 0.236, y: e[0].y }] }, { coordinates: [{ x: e[0].x, y: e[1].y }, { x: e[0].x + n * 0.5, y: e[0].y }] } ], a = [ { coordinates: [e[0], e[1]] }, { coordinates: [{ x: e[0].x, y: e[1].y }, { x: e[1].x, y: e[0].y }] } ]; return [ { type: "line", attrs: [ { coordinates: [e[0], { x: e[1].x, y: e[0].y }] }, { coordinates: [{ x: e[1].x, y: e[0].y }, e[1]] }, { coordinates: [e[1], { x: e[0].x, y: e[1].y }] }, { coordinates: [{ x: e[0].x, y: e[1].y }, e[0]] } ] }, { type: "polygon", ignoreEvent: !0, attrs: { coordinates: [ e[0], { x: e[1].x, y: e[0].y }, e[1], { x: e[0].x, y: e[1].y } ] }, styles: { style: "fill" } }, { type: "line", attrs: r, styles: { style: "dashed" } }, { type: "line", attrs: a } ]; } return []; } }, G5 = { name: "threeWaves", totalStep: 5, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, createPointFigures: ({ coordinates: e }) => { const t = e.map((n, r) => ({ ...n, text: `(${r})`, baseline: "bottom" })); return [ { type: "line", attrs: { coordinates: e } }, { type: "text", ignoreEvent: !0, attrs: t } ]; } }, X5 = { name: "fiveWaves", totalStep: 7, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, createPointFigures: ({ coordinates: e }) => { const t = e.map((n, r) => ({ ...n, text: `(${r})`, baseline: "bottom" })); return [ { type: "line", attrs: { coordinates: e } }, { type: "text", ignoreEvent: !0, attrs: t } ]; } }, J5 = { name: "eightWaves", totalStep: 10, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, createPointFigures: ({ coordinates: e }) => { const t = e.map((n, r) => ({ ...n, text: `(${r})`, baseline: "bottom" })); return [ { type: "line", attrs: { coordinates: e } }, { type: "text", ignoreEvent: !0, attrs: t } ]; } }, q5 = { name: "anyWaves", totalStep: Number.MAX_SAFE_INTEGER, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, createPointFigures: ({ coordinates: e }) => { const t = e.map((n, r) => ({ ...n, text: `(${r})`, baseline: "bottom" })); return [ { type: "line", attrs: { coordinates: e } }, { type: "text", ignoreEvent: !0, attrs: t } ]; } }, W5 = { name: "abcd", totalStep: 5, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, createPointFigures: ({ coordinates: e }) => { let t = [], n = []; const r = ["A", "B", "C", "D"], a = e.map((i, o) => ({ ...i, baseline: "bottom", text: `(${r[o]})` })); return e.length > 2 && (t = [e[0], e[2]], e.length > 3 && (n = [e[1], e[3]])), [ { type: "line", attrs: { coordinates: e } }, { type: "line", attrs: [{ coordinates: t }, { coordinates: n }], styles: { style: "dashed" } }, { type: "text", ignoreEvent: !0, attrs: a } ]; } }, e9 = { name: "xabcd", totalStep: 6, needDefaultPointFigure: !0, needDefaultXAxisFigure: !0, needDefaultYAxisFigure: !0, styles: { polygon: { color: "rgba(22, 119, 255, 0.15)" } }, createPointFigures: ({ coordinates: e, overlay: t }) => { const n = [], r = [], a = ["X", "A", "B", "C", "D"], i = e.map((o, s) => ({ ...o, baseline: "bottom", text: `(${a[s]})` })); return e.length > 2 && (n.push({ coordinates: [e[0], e[2]] }), r.push({ coordinates: [e[0], e[1], e[2]] }), e.length > 3 && (n.push({ coordinates: [e[1], e[3]] }), e.length > 4 && (n.push({ coordinates: [e[2], e[4]] }), r.push({ coordinates: [e[2], e[3], e[4]] })))), [ { type: "line", attrs: { coordinates: e } }, { type: "line", attrs: n, styles: { style: "dashed" } }, { type: "polygon", ignoreEvent: !0, attrs: r }, { type: "text", ignoreEvent: !0, attrs: i } ]; } }, t9 = [ E5, K5, j5, Q5, R5, z5, Z5, U5, V5, Y5, H5, G5, X5, J5, q5, W5, e9 ]; class Qu { constructor(t) { O1(this, "_apiKey"); O1(this, "_prevSymbolMarket"); O1(this, "_ws"); O1(this, "_currentPeriod"); this._apiKey = t; } async searchSymbols(t) { return await ((await (await fetch( `https://api.polygon.io/v3/reference/tickers?market=fx&apiKey=${this._apiKey}&active=true&search=${t ?? ""}` )).json()).results || []).map((a) => ({ ticker: a.ticker, name: a.name, shortName: a.ticker, market: a.market, exchange: a.primary_exchange, priceCurrency: a.currency_name, type: a.type, logo: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAA66SURBVHic7Z17cFTVGcB/527AiKGgRA0ShG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Qs4GACBuZycJJpE3Aj/YQYJJ4nZ2mviYEQMAEHfQRJIJ5JcDL2kkyQRxh7nKbsbLxMtaBpJkFZJRpr99XCPYbK/5RhN3jM0AKcQs9mAxjjDnGUaPOizGmVY+eDADpLD9BA8CLlJ58qTxEFX8NJejXnd43ilEVnMz8Bj5uwNdDgJ3uvXwOcWXVjH2BdIr9PSy9OZooIAr3fj2dTG+B+gMcSvbiFGRjydwgGABMf1bPffD+YysYQKSxeTDyzJpQjBTJ5jDBL7MAOmIKuqRjAYegKOVKo5jDgMPIBntt/IhgBkgHfkkw0jwaOTyDkwhWEmMuX5N952LEALkE1yKZH4k0tBMIHgHwb3iNv4avCghQtYwHcl9hD0r2T0bEMwTVeFxkoXKAFLIhUzE4q5QF6nQQVBHkkfEHN4MWpRMQmkAKexyNbcguAkZsRb3gj12vaWnMsuyhIlQG0AKuYwY+6hEcgMqBO3koGXqgv1AHYLnGMDqzIJMYSQSBpCOXEZvWhmPYBqSy4CRAYu0BcHrSFZQzJr0IoxRIHIGkImsZSAJxiK4BMl5wBjAqz7y7cAmu8HGOmKs9eKGzk8ibwCZ2LeQZVgMR1KOpAwYBJQAxUB/lIEUIr5smBEHOlAKbgNagRZgF4ImBI0k2UoVTV7dygXF/wF+fTz59Jc5ygAAAABJRU5ErkJggg==" })); } async getHistoryKLineData(t, n, r, a) { return await ((await (await fetch( `https://api.polygon.io/v2/aggs/ticker/${t.ticker}/range/${n.multiplier}/${n.timespan}/${r}/${a}?apiKey=${this._apiKey}` )).json()).results || []).map((s) => ({ timestamp: s.t, open: s.o, high: s.h, low: s.l, close: s.c, volume: s.v, turnover: s.vw })); } subscribe(t, n, r) { var a, i; this._currentPeriod = n, this._prevSymbolMarket !== t.market ? ((a = this._ws) == null || a.close(), this._ws = new WebSocket(`wss://socket.polygon.io/${t.market}`), this._ws.onopen = () => { var o; (o = this._ws) == null || o.send( JSON.stringify({ action: "auth", params: this._apiKey }) ); }, this._ws.onmessage = (o) => { var c; const s = JSON.parse(o.data); if (s[0].ev === "status") s[0].status === "auth_success" && ((c = this._ws) == null || c.send( JSON.stringify({ action: "subscribe", params: `CAS.${t.ticker}` }) )); else if (s[0].ev == "CAS") { const u = s[0].s; let l = this.alignTimestampToPeriodBoundary( u, this._currentPeriod ); r({ timestamp: l, // Use the aligned timestamp open: s[0].o, high: s[0].h, low: s[0].l, close: s[0].c, volume: s[0].v }); } }) : (i = this._ws) == null || i.send( JSON.stringify({ action: "subscribe", params: `CAS.${t.ticker}` }) ), this._prevSymbolMarket = t.market; } // Add this helper method to align timestamps to period boundaries alignTimestampToPeriodBoundary(t, n) { if (n.timespan === "second") { const r = Math.floor(t / 1e3) % n.multiplier; return Math.floor(t / 1e3) * 1e3 - r * 1e3; } if (n.timespan === "minute") { const r = Math.floor(t / 6e4) % n.multiplier; return Math.floor(t / (60 * 1e3)) * (60 * 1e3) - r * (60 * 1e3); } return t; } unsubscribe(t, n) { } } const a1 = {}; function n9(e) { a1.context = e; } const r9 = (e, t) => e === t, Oe = Symbol("solid-proxy"), a9 = Symbol("solid-track"), ue = { equals: r9 }; let Z0 = G0; const $1 = 1, de = 2, U0 = { owned: null, cleanups: null, context: null, owner: null }, Me = {}; var J = null; let A1 = null, Z = null, t1 = null, v1 = null, ze = 0; function oe(e, t) { const n = Z, r = J, a = e.length === 0, i = a ? U0 : { owned: null, cleanups: null, context: null, owner: t === void 0 ? r : t }, o = a ? e : () => e(() => _1(() => _e(i))); J = i, Z = null; try { return L1(o, !0); } finally { Z = n, J = r; } } function k(e, t) { t = t ? Object.assign({}, ue, t) : ue; const n = { value: e, observers: null, observerSlots: null, comparator: t.equals || void 0 }, r = (a) => (typeof a == "function" && (a = a(n.value)), H0(n, a)); return [Y0.bind(n), r]; } function r0(e, t, n) { const r = ve(e, t, !0, $1); F1(r); } function X(e, t, n) { const r = ve(e, t, !1, $1); F1(r); } function f1(e, t, n) { Z0 = u9; const r = ve(e, t, !1, $1); r.user = !0, v1 ? v1.push(r) : F1(r); } function Y(e, t, n) { n = n ? Object.assign({}, ue, n) : ue; const r = ve(e, t, !0, 0); return r.observers = null, r.observerSlots = null, r.comparator = n.equals || void 0, F1(r), Y0.bind(r); } function V0(e, t, n) { let r, a, i; arguments.length === 2 && typeof t == "object" || arguments.length === 1 ? (r = !0, a = e, i = t || {}) : (r = e, a = t, i = n || {}); let o = null, s = Me, c = null, u = !1, l = "initialValue" in i, m = typeof r == "function" && Y(r); const h = /* @__PURE__ */ new Set(), [b, M] = (i.storage || k)(i.initialValue), [T, F] = k(void 0), [K, S] = k(void 0, { equals: !1 }), [x, A] = k(l ? "ready" : "unresolved"); if (a1.context) { c = `${a1.context.id}${a1.context.count++}`; let I; i.ssrLoadFrom === "initial" ? s = i.initialValue : a1.load && (I = a1.load(c)) && (s = I[0]); } function H(I, D, R, h1) { return o === I && (o = null, l = !0, (I === s || D === s) && i.onHydrated && queueMicrotask(() => i.onHydrated(h1, { value: D })), s = Me, G(D, R)), D; } function G(I, D) { L1(() => { D === void 0 && M(() => I), A(D !== void 0 ? "errored" : "ready"), F(D); for (const R of h.keys()) R.decrement(); h.clear(); }, !1); } function s1() { const I = o9, D = b(), R = T(); if (R !== void 0 && !o) throw R; return Z && !Z.user && I && r0(() => { K(), o && (I.resolved || h.has(I) || (I.increment(), h.add(I))); }), D; } function q(I = !0) { if (I !== !1 && u) return; u = !1; const D = m ? m() : r; if (D == null || D === !1) { H(o, _1(b)); return; } const R = s !== Me ? s : _1(() => a(D, { value: b(), refetching: I })); return typeof R != "object" || !(R && "then" in R) ? (H(o, R, void 0, D), R) : (o = R, u = !0, queueMicrotask(() => u = !1), L1(() => { A(l ? "refreshing" : "pending"), S(); }, !1), R.then((h1) => H(R, h1, void 0, D), (h1) => H(R, void 0, J0(h1), D))); } return Object.defineProperties(s1, { state: { get: () => x() }, error: { get: () => T() }, loading: { get() { const I = x(); return I === "pending" || I === "refreshing"; } }, latest: { get() { if (!l) return s1(); const I = T(); if (I && !o) throw I; return b(); } } }), m ? r0(() => q(!1)) : q(!1), [s1, { refetch: q, mutate: M }]; } function _1(e) { if (Z === null) return e(); const t = Z; Z = null; try { return e(); } finally { Z = t; } } function i9(e) { f1(() => _1(e)); } function le(e) { return J === null || (J.cleanups === null ? J.cleanups = [e] : J.cleanups.push(e)), e; } function s9(e) { const t = Z, n = J; return Promise.resolve().then(() => { Z = t, J = n; let r; return L1(e, !1), Z = J = null, r ? r.done : void 0; }); } let o9; function Y0() { const e = A1; if (this.sources && (this.state || e)) if (this.state === $1 || e) F1(this); else { const t = t1; t1 = null, L1(() => ge(this), !1), t1 = t; } if (Z) { const t = this.observers ? this.observers.length : 0; Z.sources ? (Z.sources.push(this), Z.sourceSlots.push(t)) : (Z.sources = [this], Z.sourceSlots = [t]), this.observers ? (this.observers.push(Z), this.observerSlots.push(Z.sources.length - 1)) : (this.observers = [Z], this.observerSlots = [Z.sources.length - 1]); } return this.value; } function H0(e, t, n) { let r = e.value; return (!e.comparator || !e.comparator(r, t)) && (e.value = t, e.observers && e.observers.length && L1(() => { for (let a = 0; a < e.observers.length; a += 1) { const i = e.observers[a], o = A1 && A1.running; o && A1.disposed.has(i), (o && !i.tState || !o && !i.state) && (i.pure ? t1.push(i) : v1.push(i), i.observers && X0(i)), o || (i.state = $1); } if (t1.length > 1e6) throw t1 = [], new Error(); }, !1)), t; } function F1(e) { if (!e.fn) return; _e(e); const t = J, n = Z, r = ze; Z = J = e, l9(e, e.value, r), Z = n, J = t; } function l9(e, t, n) { let r; try { r = e.fn(t); } catch (a) { e.pure && (e.state = $1, e.owned && e.owned.forEach(_e), e.owned = null), q0(a); } (!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? H0(e, r) : e.value = r, e.updatedAt = n); } function ve(e, t, n, r = $1, a) { const i = { fn: e, state: r, updatedAt: null, owned: null, sources: null, sourceSlots: null, cleanups: null, value: t, owner: J, context: null, pure: n }; return J === null || J !== U0 && (J.owned ? J.owned.push(i) : J.owned = [i]), i; } function fe(e) { const t = A1; if (e.state === 0 || t) return; if (e.state === de || t) return ge(e); if (e.suspense && _1(e.suspense.inFallback)) return e.suspense.effects.push(e); const n = [e]; for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < ze); ) (e.state || t) && n.push(e); for (let r = n.length - 1; r >= 0; r--) if (e = n[r], e.state === $1 || t) F1(e); else if (e.state === de || t) { const a = t1; t1 = null, L1(() => ge(e, n[0]), !1), t1 = a; } } function L1(e, t) { if (t1) return e(); let n = !1; t || (t1 = []), v1 ? n = !0 : v1 = [], ze++; try { const r = e(); return c9(n), r; } catch (r) { n || (v1 = null), t1 = null, q0(r); } } function c9(e) { if (t1 && (G0(t1), t1 = null), e) return; const t = v1; v1 = null, t.length && L1(() => Z0(t), !1); } function G0(e) { for (let t = 0; t < e.length; t++) fe(e[t]); } function u9(e) { let t, n = 0; for (t = 0; t < e.length; t++) { const r = e[t]; r.user ? e[n++] = r : fe(r); } for (a1.context && n9(), t = 0; t < n; t++) fe(e[t]); } function ge(e, t) { const n = A1; e.state = 0; for (let r = 0; r < e.sources.length; r += 1) { const a = e.sources[r]; a.sources && (a.state === $1 || n ? a !== t && fe(a) : (a.state === de || n) && ge(a, t)); } } function X0(e) { const t = A1; for (let n = 0; n < e.observers.length; n += 1) { const r = e.observers[n]; (!r.state || t) && (r.state = de, r.pure ? t1.push(r) : v1.push(r), r.observers && X0(r)); } } function _e(e) { let t; if (e.sources) for (; e.sources.length; ) { const n = e.sources.pop(), r = e.sourceSlots.pop(), a = n.observers; if (a && a.length) { const i = a.pop(), o = n.observerSlots.pop(); r < a.length && (i.sourceSlots[o] = r, a[r] = i, n.observerSlots[r] = o); } } if (e.owned) { for (t = 0; t < e.owned.length; t++) _e(e.owned[t]); e.owned = null; } if (e.cleanups) { for (t = 0; t < e.cleanups.length; t++) e.cleanups[t](); e.cleanups = null; } e.state = 0, e.context = null; } function J0(e) { return e instanceof Error || typeof e == "string" ? e : new Error("Unknown error"); } function q0(e) { throw e = J0(e), e; } const d9 = Symbol("fallback"); function a0(e) { for (let t = 0; t < e.length; t++) e[t](); } function f9(e, t, n = {}) { let r = [], a = [], i = [], o = 0, s = t.length > 1 ? [] : null; return le(() => a0(i)), () => { let c = e() || [], u, l; return c[a9], _1(() => { let h = c.length, b, M, T, F, K, S, x, A, H; if (h === 0) o !== 0 && (a0(i), i = [], r = [], a = [], o = 0, s && (s = [])), n.fallback && (r = [d9], a[0] = oe((G) => (i[0] = G, n.fallback())), o = 1); else if (o === 0) { for (a = new Array(h), l = 0; l < h; l++) r[l] = c[l], a[l] = oe(m); o = h; } else { for (T = new Array(h), F = new Array(h), s && (K = new Array(h)), S = 0, x = Math.min(o, h); S < x && r[S] === c[S]; S++) ; for (x = o - 1, A = h - 1; x >= S && A >= S && r[x] === c[A]; x--, A--) T[A] = a[x], F[A] = i[x], s && (K[A] = s[x]); for (b = /* @__PURE__ */ new Map(), M = new Array(A + 1), l = A; l >= S; l--) H = c[l], u = b.get(H), M[l] = u === void 0 ? -1 : u, b.set(H, l); for (u = S; u <= x; u++) H = r[u], l = b.get(H), l !== void 0 && l !== -1 ? (T[l] = a[u], F[l] = i[u], s && (K[l] = s[u]), l = M[l], b.set(H, l)) : i[u](); for (l = S; l < h; l++) l in T ? (a[l] = T[l], i[l] = F[l], s && (s[l] = K[l], s[l](l))) : a[l] = oe(m); a = a.slice(0, o = h), r = c.slice(0); } return a; }); function m(h) { if (i[l] = h, s) { const [b, M] = k(l); return s[l] = M, t(c[l], b); } return t(c[l]); } }; } function $(e, t) { return _1(() => e(t || {})); } function ie() { return !0; } const g9 = { get(e, t, n) { return t === Oe ? n : e.get(t); }, has(e, t) { return t === Oe ? !0 : e.has(t); }, set: ie, deleteProperty: ie, getOwnPropertyDescriptor(e, t) { return { configurable: !0, enumerable: !0, get() { return e.get(t); }, set: ie, deleteProperty: ie }; }, ownKeys(e) { return e.keys(); } }; function Te(e) { return (e = typeof e == "function" ? e() : e) ? e : {}; } function W0(...e) { let t = !1; for (let r = 0; r < e.length; r++) { const a = e[r]; t = t || !!a && Oe in a, e[r] = typeof a == "function" ? (t = !0, Y(a)) : a; } if (t) return new Proxy({ get(r) { for (let a = e.length - 1; a >= 0; a--) { const i = Te(e[a])[r]; if (i !== void 0) return i; } }, has(r) { for (let a = e.length - 1; a >= 0; a--) if (r in Te(e[a])) return !0; return !1; }, keys() { const r = []; for (let a = 0; a < e.length; a++) r.push(...Object.keys(Te(e[a]))); return [...new Set(r)]; } }, g9); const n = {}; for (let r = e.length - 1; r >= 0; r--) if (e[r]) { const a = Object.getOwnPropertyDescriptors(e[r]); for (const i in a) i in n || Object.defineProperty(n, i, { enumerable: !0, get() { for (let o = e.length - 1; o >= 0; o--) { const s = (e[o] || {})[i]; if (s !== void 0) return s; } } }); } return n; } function e5(e) { const t = "fallback" in e && { fallback: () => e.fallback }; return Y(f9(() => e.each, e.children, t || void 0)); } function r1(e) { let t = !1; const n = e.keyed, r = Y(() => e.when, void 0, { equals: (a, i) => t ? a === i : !a == !i }); return Y(() => { const a = r(); if (a) { const i = e.children, o = typeof i == "function" && i.length > 0; return t = n || o, o ? _1(() => i(a)) : i; } return e.fallback; }, void 0, void 0); } function h9(e, t, n) { let r = n.length, a = t.length, i = r, o = 0, s = 0, c = t[a - 1].nextSibling, u = null; for (; o < a || s < i; ) { if (t[o] === n[s]) { o++, s++; continue; } for (; t[a - 1] === n[i - 1]; ) a--, i--; if (a === o) { const l = i < r ? s ? n[s - 1].nextSibling : n[i - s] : c; for (; s < i; ) e.insertBefore(n[s++], l); } else if (i === s) for (; o < a; ) (!u || !u.has(t[o])) && t[o].remove(), o++; else if (t[o] === n[i - 1] && n[s] === t[a - 1]) { const l = t[--a].nextSibling; e.insertBefore(n[s++], t[o++].nextSibling), e.insertBefore(n[--i], l), t[a] = n[i]; } else { if (!u) { u = /* @__PURE__ */ new Map(); let m = s; for (; m < i; ) u.set(n[m], m++); } const l = u.get(t[o]); if (l != null) if (s < l && l < i) { let m = o, h = 1, b; for (; ++m < a && m < i && !((b = u.get(t[m])) == null || b !== l + h); ) h++; if (h > l - s) { const M = t[o]; for (; s < l; ) e.insertBefore(n[s++], M); } else e.replaceChild(n[s++], t[o++]); } else o++; else t[o++].remove(); } } } const i0 = "_$DX_DELEGATE"; function m9(e, t, n, r = {}) { let a; return oe((i) => { a = i, t === document ? e() : L(t, e(), t.firstChild ? null : void 0, n); }, r.owner), () => { a(), t.textContent = ""; }; } function p(e, t, n) { const r = document.createElement("template"); r.innerHTML = e; let a = r.content.firstChild; return n && (a = a.firstChild), a; } function g1(e, t = window.document) { const n = t[i0] || (t[i0] = /* @__PURE__ */ new Set()); for (let r = 0, a = e.length; r < a; r++) { const i = e[r]; n.has(i) || (n.add(i), t.addEventListener(i, y9)); } } function l1(e, t, n) { n == null ? e.removeAttribute(t) : e.setAttribute(t, n); } function m1(e, t) { t == null ? e.removeAttribute("class") : e.className = t; } function G1(e, t, n, r) { if (r) Array.isArray(n) ? (e[`$$${t}`] = n[0], e[`$$${t}Data`] = n[1]) : e[`$$${t}`] = n; else if (Array.isArray(n)) { const a = n[0]; e.addEventListener(t, n[0] = (i) => a.call(e, n[1], i)); } else e.addEventListener(t, n); } function J1(e, t, n) { if (!t) return n ? l1(e, "style") : t; const r = e.style; if (typeof t == "string") return r.cssText = t; typeof n == "string" && (r.cssText = n = void 0), n || (n = {}), t || (t = {}); let a, i; for (i in n) t[i] == null && r.removeProperty(i), delete n[i]; for (i in t) a = t[i], a !== n[i] && (r.setProperty(i, a), n[i] = a); return n; } function Ze(e, t, n) { return _1(() => e(t, n)); } function L(e, t, n, r) { if (n !== void 0 && !r && (r = []), typeof t != "function") return he(e, t, r, n); X((a) => he(e, t(), a, n), r); } function y9(e) { const t = `$$${e.type}`; let n = e.composedPath && e.composedPath()[0] || e.target; for (e.target !== n && Object.defineProperty(e, "target", { configurable: !0, value: n }), Object.defineProperty(e, "currentTarget", { configurable: !0, get() { return n || document; } }), a1.registry && !a1.done && (a1.done = !0, document.querySelectorAll("[id^=pl-]").forEach((r) => { for (; r && r.nodeType !== 8 && r.nodeValue !== "pl-" + e; ) { let a = r.nextSibling; r.remove(), r = a; } r && r.remove(); })); n; ) { const r = n[t]; if (r && !n.disabled) { const a = n[`${t}Data`]; if (a !== void 0 ? r.call(n, a, e) : r.call(n, e), e.cancelBubble) return; } n = n._$host || n.parentNode || n.host; } } function he(e, t, n, r, a) { for (a1.context && !n && (n = [...e.childNodes]); typeof n == "function"; ) n = n(); if (t === n) return n; const i = typeof t, o = r !== void 0; if (e = o && n[0] && n[0].parentNode || e, i === "string" || i === "number") { if (a1.context) return n; if (i === "number" && (t = t.toString()), o) { let s = n[0]; s && s.nodeType === 3 ? s.data = t : s = document.createTextNode(t), n = B1(e, n, r, s); } else n !== "" && typeof n == "string" ? n = e.firstChild.data = t : n = e.textContent = t; } else if (t == null || i === "boolean") { if (a1.context) return n; n = B1(e, n, r); } else { if (i === "function") return X(() => { let s = t(); for (; typeof s == "function"; ) s = s(); n = he(e, s, n, r); }), () => n; if (Array.isArray(t)) { const s = [], c = n && Array.isArray(n); if (Be(s, t, n, a)) return X(() => n = he(e, s, n, r, !0)), () => n; if (a1.context) { if (!s.length) return n; for (let u = 0; u < s.length; u++) if (s[u].parentNode) return n = s; } if (s.length === 0) { if (n = B1(e, n, r), o) return n; } else c ? n.length === 0 ? s0(e, s, r) : h9(e, n, s) : (n && B1(e), s0(e, s)); n = s; } else if (t instanceof Node) { if (a1.context && t.parentNode) return n = o ? [t] : t; if (Array.isArray(n)) { if (o) return n = B1(e, n, r, t); B1(e, n, null, t); } else n == null || n === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild); n = t; } } return n; } function Be(e, t, n, r) { let a = !1; for (let i = 0, o = t.length; i < o; i++) { let s = t[i], c = n && n[i]; if (s instanceof Node) e.push(s); else if (!(s == null || s === !0 || s === !1)) if (Array.isArray(s)) a = Be(e, s, c) || a; else if (typeof s == "function") if (r) { for (; typeof s == "function"; ) s = s(); a = Be(e, Array.isArray(s) ? s : [s], Array.isArray(c) ? c : [c]) || a; } else e.push(s), a = !0; else { const u = String(s); c && c.nodeType === 3 && c.data === u ? e.push(c) : e.push(document.createTextNode(u)); } } return a; } function s0(e, t, n = null) { for (let r = 0, a = t.length; r < a; r++) e.insertBefore(t[r], n); } function B1(e, t, n, r) { if (n === void 0) return e.textContent = ""; const a = r || document.createTextNode(""); if (t.length) { let i = !1; for (let o = t.length - 1; o >= 0; o--) { const s = t[o]; if (a !== s) { const c = s.parentNode === e; !i && !o ? c ? e.replaceChild(a, s) : e.insertBefore(a, n) : c && s.remove(); } else i = !0; } } else e.insertBefore(a, n); return [a]; } var se = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function t5(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } var p9 = typeof se == "object" && se && se.Object === Object && se, n5 = p9, C9 = n5, v9 = typeof self == "object" && self && self.Object === Object && self, _9 = C9 || v9 || Function("return this")(), y1 = _9, $9 = y1, b9 = $9.Symbol, $e = b9, o0 = $e, r5 = Object.prototype, L9 = r5.hasOwnProperty, x9 = r5.toString, Y1 = o0 ? o0.toStringTag : void 0; function k9(e) { var t = L9.call(e, Y1), n = e[Y1]; try { e[Y1] = void 0; var r = !0; } catch { } var a = x9.call(e); return r && (t ? e[Y1] = n : delete e[Y1]), a; } var w9 = k9, S9 = Object.prototype, A9 = S9.toString; function M9(e) { return A9.call(e); } var T9 = M9, l0 = $e, I9 = w9, P9 = T9, N9 = "[object Null]", D9 = "[object Undefined]", c0 = l0 ? l0.toStringTag : void 0; function O9(e) { return e == null ? e === void 0 ? D9 : N9 : c0 && c0 in Object(e) ? I9(e) : P9(e); } var q1 = O9; function B9(e) { var t = typeof e; return e != null && (t == "object" || t == "function"); } var E1 = B9, F9 = q1, E9 = E1, K9 = "[object AsyncFunction]", j9 = "[object Function]", R9 = "[object GeneratorFunction]", Q9 = "[object Proxy]"; function z9(e) { if (!E9(e)) return !1; var t = F9(e); return t == j9 || t == R9 || t == K9 || t == Q9; } var a5 = z9, Z9 = y1, U9 = Z9["__core-js_shared__"], V9 = U9, Ie = V9, u0 = function() { var e = /[^.]+$/.exec(Ie && Ie.keys && Ie.keys.IE_PROTO || ""); return e ? "Symbol(src)_1." + e : ""; }(); function Y9(e) { return !!u0 && u0 in e; } var H9 = Y9, G9 = Function.prototype, X9 = G9.toString; function J9(e) { if (e != null) { try { return X9.call(e); } catch { } try { return e + ""; } catch { } } return ""; } var i5 = J9, q9 = a5, W9 = H9, et = E1, tt = i5, nt = /[\\^$.*+?()[\]{}|]/g, rt = /^\[object .+?Constructor\]$/, at = Function.prototype, it = Object.prototype, st = at.toString, ot = it.hasOwnProperty, lt = RegExp( "^" + st.call(ot).replace(nt, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function ct(e) { if (!et(e) || W9(e)) return !1; var t = q9(e) ? lt : rt; return t.test(tt(e)); } var ut = ct; function dt(e, t) { return e == null ? void 0 : e[t]; } var ft = dt, gt = ut, ht = ft; function mt(e, t) { var n = ht(e, t); return gt(n) ? n : void 0; } var M1 = mt, yt = M1, pt = function() { try { var e = yt(Object, "defineProperty"); return e({}, "", {}), e; } catch { } }(), Ct = pt, d0 = Ct; function vt(e, t, n) { t == "__proto__" && d0 ? d0(e, t, { configurable: !0, enumerable: !0, value: n, writable: !0 }) : e[t] = n; } var s5 = vt; function _t(e, t) { return e === t || e !== e && t !== t; } var o5 = _t, $t = s5, bt = o5, Lt = Object.prototype, xt = Lt.hasOwnProperty; function kt(e, t, n) { var r = e[t]; (!(xt.call(e, t) && bt(r, n)) || n === void 0 && !(t in e)) && $t(e, t, n); } var Ue = kt, wt = Array.isArray, K1 = wt; function St(e) { return e != null && typeof e == "object"; } var j1 = St, At = q1, Mt = j1, Tt = "[object Symbol]"; function It(e) { return typeof e == "symbol" || Mt(e) && At(e) == Tt; } var Ve = It, Pt = K1, Nt = Ve, Dt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Ot = /^\w*$/; function Bt(e, t) { if (Pt(e)) return !1; var n = typeof e; return n == "number" || n == "symbol" || n == "boolean" || e == null || Nt(e) ? !0 : Ot.test(e) || !Dt.test(e) || t != null && e in Object(t); } var Ft = Bt, Et = M1, Kt = Et(Object, "create"), be = Kt, f0 = be; function jt() { this.__data__ = f0 ? f0(null) : {}, this.size = 0; } var Rt = jt; function Qt(e) { var t = this.has(e) && delete this.__data__[e]; return this.size -= t ? 1 : 0, t; } var zt = Qt, Zt = be, Ut = "__lodash_hash_undefined__", Vt = Object.prototype, Yt = Vt.hasOwnProperty; function Ht(e) { var t = this.__data__; if (Zt) { var n = t[e]; return n === Ut ? void 0 : n; } return Yt.call(t, e) ? t[e] : void 0; } var Gt = Ht, Xt = be, Jt = Object.prototype, qt = Jt.hasOwnProperty; function Wt(e) { var t = this.__data__; return Xt ? t[e] !== void 0 : qt.call(t, e); } var e6 = Wt, t6 = be, n6 = "__lodash_hash_undefined__"; function r6(e, t) { var n = this.__data__; return this.size += this.has(e) ? 0 : 1, n[e] = t6 && t === void 0 ? n6 : t, this; } var a6 = r6, i6 = Rt, s6 = zt, o6 = Gt, l6 = e6, c6 = a6; function R1(e) { var t = -1, n = e == null ? 0 : e.length; for (this.clear(); ++t < n; ) { var r = e[t]; this.set(r[0], r[1]); } } R1.prototype.clear = i6; R1.prototype.delete = s6; R1.prototype.get = o6; R1.prototype.has = l6; R1.prototype.set = c6; var u6 = R1; function d6() { this.__data__ = [], this.size = 0; } var f6 = d6, g6 = o5; function h6(e, t) { for (var n = e.length; n--; ) if (g6(e[n][0], t)) return n; return -1; } var Le = h6, m6 = Le, y6 = Array.prototype, p6 = y6.splice; function C6(e) { var t = this.__data__, n = m6(t, e); if (n < 0) return !1; var r = t.length - 1; return n == r ? t.pop() : p6.call(t, n, 1), --this.size, !0; } var v6 = C6, _6 = Le; function $6(e) { var t = this.__data__, n = _6(t, e); return n < 0 ? void 0 : t[n][1]; } var b6 = $6, L6 = Le; function x6(e) { return L6(this.__data__, e) > -1; } var k6 = x6, w6 = Le; function S6(e, t) { var n = this.__data__, r = w6(n, e); return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this; } var A6 = S6, M6 = f6, T6 = v6, I6 = b6, P6 = k6, N6 = A6; function Q1(e) { var t = -1, n = e == null ? 0 : e.length; for (this.clear(); ++t < n; ) { var r = e[t]; this.set(r[0], r[1]); } } Q1.prototype.clear = M6; Q1.prototype.delete = T6; Q1.prototype.get = I6; Q1.prototype.has = P6; Q1.prototype.set = N6; var xe = Q1, D6 = M1, O6 = y1, B6 = D6(O6, "Map"), Ye = B6, g0 = u6, F6 = xe, E6 = Ye; function K6() { this.size = 0, this.__data__ = { hash: new g0(), map: new (E6 || F6)(), string: new g0() }; } var j6 = K6; function R6(e) { var t = typeof e; return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null; } var Q6 = R6, z6 = Q6; function Z6(e, t) { var n = e.__data__; return z6(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map; } var ke = Z6, U6 = ke; function V6(e) { var t = U6(this, e).delete(e); return this.size -= t ? 1 : 0, t; } var Y6 = V6, H6 = ke; function G6(e) { return H6(this, e).get(e); } var X6 = G6, J6 = ke; function q6(e) { return J6(this, e).has(e); } var W6 = q6, e2 = ke; function t2(e, t) { var n = e2(this, e), r = n.size; return n.set(e, t), this.size += n.size == r ? 0 : 1, this; } var n2 = t2, r2 = j6, a2 = Y6, i2 = X6, s2 = W6, o2 = n2; function z1(e) { var t = -1, n = e == null ? 0 : e.length; for (this.clear(); ++t < n; ) { var r = e[t]; this.set(r[0], r[1]); } } z1.prototype.clear = r2; z1.prototype.delete = a2; z1.prototype.get = i2; z1.prototype.has = s2; z1.prototype.set = o2; var l5 = z1, c5 = l5, l2 = "Expected a function"; function He(e, t) { if (typeof e != "function" || t != null && typeof t != "function") throw new TypeError(l2); var n = function() { var r = arguments, a = t ? t.apply(this, r) : r[0], i = n.cache; if (i.has(a)) return i.get(a); var o = e.apply(this,