@memoraiz/react-widgets
Version:
A collection of React-based widgets for educational applications, powered by AI-driven functionalities from **MemorAIz**. This package provides flexible and interactive UI components designed to integrate seamlessly with React projects, enabling developer
1,781 lines • 149 kB
JavaScript
import * as se from "react";
import Te, { createContext as Ce, useContext as qe, useRef as G, useEffect as re, useLayoutEffect as Yu, useMemo as K, useCallback as O, useDebugValue as Xu, useState as W, forwardRef as Ze, useTransition as Zu, memo as ec, Children as Oo, isValidElement as Io } from "react";
import rc from "swr";
import { Eye as tc, EyeClosed as nc, Trophy as La, Target as Do, BarChart2 as ac, RotateCcw as sc, ThumbsUp as Mo, ThumbsDown as ko, ListChecks as ic, Clock as oc, Timer as uc, X as cc, TimerIcon as lc, HelpCircle as mc, ArrowRight as dc, TrendingUp as fc, GalleryHorizontalEnd as hc, Copy as pc } from "lucide-react";
import { Slottable as vc, Slot as Pe } from "@radix-ui/react-slot";
import { clsx as va } from "clsx";
import { twMerge as gc } from "tailwind-merge";
import { cva as Le } from "class-variance-authority";
import * as sa from "@radix-ui/react-progress";
import * as we from "@radix-ui/react-tooltip";
import yc from "embla-carousel-fade";
import bc from "embla-carousel-react";
import * as er from "@radix-ui/react-toggle-group";
import _c from "react-markdown";
const Fo = Ce(null);
function rr() {
const e = qe(Fo);
if (!e)
throw new Error("ProviderContext not found.");
return e;
}
function xc(e, r, t = {}) {
const { namespace: n = "domain", tags: a, ...s } = t, { data: i, isLoading: o, mutate: u, isValidating: c } = rc(
e && { namespace: n, key: e, tags: a },
r,
{
...s,
revalidateOnFocus: !1,
revalidateIfStale: !1,
errorRetryCount: 0
}
), m = G(o);
return o || (m.current = !0), {
data: i || null,
loading: o || c,
loaded: m.current,
reload: u
};
}
var Ge = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function ga(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var _r = { exports: {} }, xr = {};
/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var za;
function Sc() {
if (za) return xr;
za = 1;
var e = Te;
function r(d, f) {
return d === f && (d !== 0 || 1 / d === 1 / f) || d !== d && f !== f;
}
var t = typeof Object.is == "function" ? Object.is : r, n = e.useState, a = e.useEffect, s = e.useLayoutEffect, i = e.useDebugValue;
function o(d, f) {
var v = f(), _ = n({ inst: { value: v, getSnapshot: f } }), h = _[0].inst, y = _[1];
return s(
function() {
h.value = v, h.getSnapshot = f, u(h) && y({ inst: h });
},
[d, v, f]
), a(
function() {
return u(h) && y({ inst: h }), d(function() {
u(h) && y({ inst: h });
});
},
[d]
), i(v), v;
}
function u(d) {
var f = d.getSnapshot;
d = d.value;
try {
var v = f();
return !t(d, v);
} catch {
return !0;
}
}
function c(d, f) {
return f();
}
var m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? c : o;
return xr.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : m, xr;
}
var Ba;
function Rc() {
return Ba || (Ba = 1, _r.exports = Sc()), _r.exports;
}
var wc = Rc(), $a = Object.prototype.hasOwnProperty;
function ia(e, r) {
var t, n;
if (e === r) return !0;
if (e && r && (t = e.constructor) === r.constructor) {
if (t === Date) return e.getTime() === r.getTime();
if (t === RegExp) return e.toString() === r.toString();
if (t === Array) {
if ((n = e.length) === r.length)
for (; n-- && ia(e[n], r[n]); ) ;
return n === -1;
}
if (!t || typeof e == "object") {
n = 0;
for (t in e)
if ($a.call(e, t) && ++n && !$a.call(r, t) || !(t in r) || !ia(e[t], r[t])) return !1;
return Object.keys(r).length === n;
}
}
return e !== e && r !== r;
}
const he = /* @__PURE__ */ new WeakMap(), ge = () => {
}, V = (
/*#__NOINLINE__*/
ge()
), oa = Object, M = (e) => e === V, le = (e) => typeof e == "function", oe = (e, r) => ({
...e,
...r
}), Po = (e) => le(e.then), Sr = {}, Ve = {}, ya = "undefined", tr = typeof window != ya, ua = typeof document != ya, Tc = () => tr && typeof window.requestAnimationFrame != ya, Lo = (e, r) => {
const t = he.get(e);
return [
// Getter
() => !M(r) && e.get(r) || Sr,
// Setter
(n) => {
if (!M(r)) {
const a = e.get(r);
r in Ve || (Ve[r] = a), t[5](r, oe(a, n), a || Sr);
}
},
// Subscriber
t[6],
// Get server cache snapshot
() => !M(r) && r in Ve ? Ve[r] : !M(r) && e.get(r) || Sr
];
};
let ca = !0;
const Cc = () => ca, [la, ma] = tr && window.addEventListener ? [
window.addEventListener.bind(window),
window.removeEventListener.bind(window)
] : [
ge,
ge
], qc = () => {
const e = ua && document.visibilityState;
return M(e) || e !== "hidden";
}, jc = (e) => (ua && document.addEventListener("visibilitychange", e), la("focus", e), () => {
ua && document.removeEventListener("visibilitychange", e), ma("focus", e);
}), Ac = (e) => {
const r = () => {
ca = !0, e();
}, t = () => {
ca = !1;
};
return la("online", r), la("offline", t), () => {
ma("online", r), ma("offline", t);
};
}, Nc = {
isOnline: Cc,
isVisible: qc
}, Ec = {
initFocus: jc,
initReconnect: Ac
}, da = !Te.useId, De = !tr || "Deno" in globalThis, Oc = (e) => Tc() ? window.requestAnimationFrame(e) : setTimeout(e, 1), Ie = De ? re : Yu, Rr = typeof navigator < "u" && navigator.connection, Ua = !De && Rr && ([
"slow-2g",
"2g"
].includes(Rr.effectiveType) || Rr.saveData), Ke = /* @__PURE__ */ new WeakMap(), wr = (e, r) => oa.prototype.toString.call(e) === `[object ${r}]`;
let Ic = 0;
const fa = (e) => {
const r = typeof e, t = wr(e, "Date"), n = wr(e, "RegExp"), a = wr(e, "Object");
let s, i;
if (oa(e) === e && !t && !n) {
if (s = Ke.get(e), s) return s;
if (s = ++Ic + "~", Ke.set(e, s), Array.isArray(e)) {
for (s = "@", i = 0; i < e.length; i++)
s += fa(e[i]) + ",";
Ke.set(e, s);
}
if (a) {
s = "#";
const o = oa.keys(e).sort();
for (; !M(i = o.pop()); )
M(e[i]) || (s += i + ":" + fa(e[i]) + ",");
Ke.set(e, s);
}
} else
s = t ? e.toJSON() : r == "symbol" ? e.toString() : r == "string" ? JSON.stringify(e) : "" + e;
return s;
}, nr = (e) => {
if (le(e))
try {
e = e();
} catch {
e = "";
}
const r = e;
return e = typeof e == "string" ? e : (Array.isArray(e) ? e.length : e) ? fa(e) : "", [
e,
r
];
};
let Dc = 0;
const Me = () => ++Dc, zo = 0, Bo = 1, $o = 2, Mc = 3;
var Ae = {
__proto__: null,
ERROR_REVALIDATE_EVENT: Mc,
FOCUS_EVENT: zo,
MUTATE_EVENT: $o,
RECONNECT_EVENT: Bo
};
async function Uo(...e) {
const [r, t, n, a] = e, s = oe({
populateCache: !0,
throwOnError: !0
}, typeof a == "boolean" ? {
revalidate: a
} : a || {});
let i = s.populateCache;
const o = s.rollbackOnError;
let u = s.optimisticData;
const c = (f) => typeof o == "function" ? o(f) : o !== !1, m = s.throwOnError;
if (le(t)) {
const f = t, v = [], _ = r.keys();
for (const h of _)
// Skip the special useSWRInfinite and useSWRSubscription keys.
!/^\$(inf|sub)\$/.test(h) && f(r.get(h)._k) && v.push(h);
return Promise.all(v.map(d));
}
return d(t);
async function d(f) {
const [v] = nr(f);
if (!v) return;
const [_, h] = Lo(r, v), [y, p, g, C] = he.get(r), b = () => {
const q = y[v];
return (le(s.revalidate) ? s.revalidate(_().data, f) : s.revalidate !== !1) && (delete g[v], delete C[v], q && q[0]) ? q[0]($o).then(() => _().data) : _().data;
};
if (e.length < 3)
return b();
let S = n, x;
const R = Me();
p[v] = [
R,
0
];
const w = !M(u), N = _(), E = N.data, T = N._c, I = M(T) ? E : T;
if (w && (u = le(u) ? u(I, E) : u, h({
data: u,
_c: I
})), le(S))
try {
S = S(I);
} catch (q) {
x = q;
}
if (S && Po(S))
if (S = await S.catch((q) => {
x = q;
}), R !== p[v][0]) {
if (x) throw x;
return S;
} else x && w && c(x) && (i = !0, h({
data: I,
_c: V
}));
if (i && !x)
if (le(i)) {
const q = i(S, I);
h({
data: q,
error: V,
_c: V
});
} else
h({
data: S,
error: V,
_c: V
});
if (p[v][1] = Me(), Promise.resolve(b()).then(() => {
h({
_c: V
});
}), x) {
if (m) throw x;
return;
}
return S;
}
}
const Ha = (e, r) => {
for (const t in e)
e[t][0] && e[t][0](r);
}, kc = (e, r) => {
if (!he.has(e)) {
const t = oe(Ec, r), n = {}, a = Uo.bind(V, e);
let s = ge;
const i = {}, o = (m, d) => {
const f = i[m] || [];
return i[m] = f, f.push(d), () => f.splice(f.indexOf(d), 1);
}, u = (m, d, f) => {
e.set(m, d);
const v = i[m];
if (v)
for (const _ of v)
_(d, f);
}, c = () => {
if (!he.has(e) && (he.set(e, [
n,
{},
{},
{},
a,
u,
o
]), !De)) {
const m = t.initFocus(setTimeout.bind(V, Ha.bind(V, n, zo))), d = t.initReconnect(setTimeout.bind(V, Ha.bind(V, n, Bo)));
s = () => {
m && m(), d && d(), he.delete(e);
};
}
};
return c(), [
e,
a,
c,
s
];
}
return [
e,
he.get(e)[4]
];
}, Fc = (e, r, t, n, a) => {
const s = t.errorRetryCount, i = a.retryCount, o = ~~((Math.random() + 0.5) * (1 << (i < 8 ? i : 8))) * t.errorRetryInterval;
!M(s) && i > s || setTimeout(n, o, a);
}, Pc = ia, [Ho, Lc] = kc(/* @__PURE__ */ new Map()), zc = oe(
{
// events
onLoadingSlow: ge,
onSuccess: ge,
onError: ge,
onErrorRetry: Fc,
onDiscarded: ge,
// switches
revalidateOnFocus: !0,
revalidateOnReconnect: !0,
revalidateIfStale: !0,
shouldRetryOnError: !0,
// timeouts
errorRetryInterval: Ua ? 1e4 : 5e3,
focusThrottleInterval: 5 * 1e3,
dedupingInterval: 2 * 1e3,
loadingTimeout: Ua ? 5e3 : 3e3,
// providers
compare: Pc,
isPaused: () => !1,
cache: Ho,
mutate: Lc,
fallback: {}
},
// use web preset by default
Nc
), Bc = (e, r) => {
const t = oe(e, r);
if (r) {
const { use: n, fallback: a } = e, { use: s, fallback: i } = r;
n && s && (t.use = n.concat(s)), a && i && (t.fallback = oe(a, i));
}
return t;
}, $c = Ce({}), Uc = "$inf$", Go = tr && window.__SWR_DEVTOOLS_USE__, Hc = Go ? window.__SWR_DEVTOOLS_USE__ : [], Gc = () => {
Go && (window.__SWR_DEVTOOLS_REACT__ = Te);
}, Vo = (e) => le(e[1]) ? [
e[0],
e[1],
e[2] || {}
] : [
e[0],
null,
(e[1] === null ? e[2] : e[1]) || {}
], Ko = () => oe(zc, qe($c)), Vc = (e) => (r, t, n) => e(r, t && ((...s) => {
const [i] = nr(r), [, , , o] = he.get(Ho);
if (i.startsWith(Uc))
return t(...s);
const u = o[i];
return M(u) ? t(...s) : (delete o[i], u);
}), n), Kc = Hc.concat(Vc), Qc = (e) => function(...t) {
const n = Ko(), [a, s, i] = Vo(t), o = Bc(n, i);
let u = e;
const { use: c } = o, m = (c || []).concat(Kc);
for (let d = m.length; d--; )
u = m[d](u);
return u(a, s || o.fetcher || null, o);
}, Wc = (e, r, t) => {
const n = r[e] || (r[e] = []);
return n.push(t), () => {
const a = n.indexOf(t);
a >= 0 && (n[a] = n[n.length - 1], n.pop());
};
}, Jc = (e, r) => (...t) => {
const [n, a, s] = Vo(t), i = (s.use || []).concat(r);
return e(n, a, {
...s,
use: i
});
};
Gc();
const Tr = Te.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
// and emitting an error.
// We assume that this is only for the `use(thenable)` case, not `use(context)`.
// https://github.com/facebook/react/blob/aed00dacfb79d17c53218404c52b1c7aa59c4a89/packages/react-server/src/ReactFizzThenable.js#L45
((e) => {
switch (e.status) {
case "pending":
throw e;
case "fulfilled":
return e.value;
case "rejected":
throw e.reason;
default:
throw e.status = "pending", e.then((r) => {
e.status = "fulfilled", e.value = r;
}, (r) => {
e.status = "rejected", e.reason = r;
}), e;
}
}), Cr = {
dedupe: !0
}, Yc = (e, r, t) => {
const { cache: n, compare: a, suspense: s, fallbackData: i, revalidateOnMount: o, revalidateIfStale: u, refreshInterval: c, refreshWhenHidden: m, refreshWhenOffline: d, keepPreviousData: f } = t, [v, _, h, y] = he.get(n), [p, g] = nr(e), C = G(!1), b = G(!1), S = G(p), x = G(r), R = G(t), w = () => R.current, N = () => w().isVisible() && w().isOnline(), [E, T, I, q] = Lo(n, p), B = G({}).current, F = M(i) ? M(t.fallback) ? V : t.fallback[p] : i, z = (k, P) => {
for (const Q in B) {
const U = Q;
if (U === "data") {
if (!a(k[U], P[U]) && (!M(k[U]) || !a(Se, P[U])))
return !1;
} else if (P[U] !== k[U])
return !1;
}
return !0;
}, ne = K(() => {
const k = !p || !r ? !1 : M(o) ? w().isPaused() || s ? !1 : u !== !1 : o, P = (Z) => {
const de = oe(Z);
return delete de._k, k ? {
isValidating: !0,
isLoading: !0,
...de
} : de;
}, Q = E(), U = q(), ce = P(Q), Re = Q === U ? ce : P(U);
let J = ce;
return [
() => {
const Z = P(E());
return z(Z, J) ? (J.data = Z.data, J.isLoading = Z.isLoading, J.isValidating = Z.isValidating, J.error = Z.error, J) : (J = Z, Z);
},
() => Re
];
}, [
n,
p
]), A = wc.useSyncExternalStore(O(
(k) => I(p, (P, Q) => {
z(Q, P) || k();
}),
// eslint-disable-next-line react-hooks/exhaustive-deps
[
n,
p
]
), ne[0], ne[1]), Y = !C.current, te = v[p] && v[p].length > 0, ee = A.data, ue = M(ee) ? F && Po(F) ? Tr(F) : F : ee, xe = A.error, Ue = G(ue), Se = f ? M(ee) ? Ue.current : ee : ue, He = te && !M(xe) ? !1 : Y && !M(o) ? o : w().isPaused() ? !1 : s ? M(ue) ? !1 : u : M(ue) || u, D = !!(p && r && Y && He), L = M(A.isValidating) ? D : A.isValidating, X = M(A.isLoading) ? D : A.isLoading, $ = O(
async (k) => {
const P = x.current;
if (!p || !P || b.current || w().isPaused())
return !1;
let Q, U, ce = !0;
const Re = k || {}, J = !h[p] || !Re.dedupe, Z = () => da ? !b.current && p === S.current && C.current : p === S.current, de = {
isValidating: !1,
isLoading: !1
}, ka = () => {
T(de);
}, Fa = () => {
const ae = h[p];
ae && ae[1] === U && delete h[p];
}, Pa = {
isValidating: !0
};
M(E().data) && (Pa.isLoading = !0);
try {
if (J && (T(Pa), t.loadingTimeout && M(E().data) && setTimeout(() => {
ce && Z() && w().onLoadingSlow(p, t);
}, t.loadingTimeout), h[p] = [
P(g),
Me()
]), [Q, U] = h[p], Q = await Q, J && setTimeout(Fa, t.dedupingInterval), !h[p] || h[p][1] !== U)
return J && Z() && w().onDiscarded(p), !1;
de.error = V;
const ae = _[p];
if (!M(ae) && // case 1
(U <= ae[0] || // case 2
U <= ae[1] || // case 3
ae[1] === 0))
return ka(), J && Z() && w().onDiscarded(p), !1;
const fe = E().data;
de.data = a(fe, Q) ? fe : Q, J && Z() && w().onSuccess(Q, p, t);
} catch (ae) {
Fa();
const fe = w(), { shouldRetryOnError: yr } = fe;
fe.isPaused() || (de.error = ae, J && Z() && (fe.onError(ae, p, fe), (yr === !0 || le(yr) && yr(ae)) && (!w().revalidateOnFocus || !w().revalidateOnReconnect || N()) && fe.onErrorRetry(ae, p, fe, (Ju) => {
const br = v[p];
br && br[0] && br[0](Ae.ERROR_REVALIDATE_EVENT, Ju);
}, {
retryCount: (Re.retryCount || 0) + 1,
dedupe: !0
})));
}
return ce = !1, ka(), !0;
},
// `setState` is immutable, and `eventsCallback`, `fnArg`, and
// `keyValidating` are depending on `key`, so we can exclude them from
// the deps array.
//
// FIXME:
// `fn` and `config` might be changed during the lifecycle,
// but they might be changed every render like this.
// `useSWR('key', () => fetch('/api/'), { suspense: true })`
// So we omit the values from the deps array
// even though it might cause unexpected behaviors.
// eslint-disable-next-line react-hooks/exhaustive-deps
[
p,
n
]
), ie = O(
// Use callback to make sure `keyRef.current` returns latest result every time
(...k) => Uo(n, S.current, ...k),
// eslint-disable-next-line react-hooks/exhaustive-deps
[]
);
if (Ie(() => {
x.current = r, R.current = t, M(ee) || (Ue.current = ee);
}), Ie(() => {
if (!p) return;
const k = $.bind(V, Cr);
let P = 0;
const U = Wc(p, v, (ce, Re = {}) => {
if (ce == Ae.FOCUS_EVENT) {
const J = Date.now();
w().revalidateOnFocus && J > P && N() && (P = J + w().focusThrottleInterval, k());
} else if (ce == Ae.RECONNECT_EVENT)
w().revalidateOnReconnect && N() && k();
else {
if (ce == Ae.MUTATE_EVENT)
return $();
if (ce == Ae.ERROR_REVALIDATE_EVENT)
return $(Re);
}
});
return b.current = !1, S.current = p, C.current = !0, T({
_k: g
}), He && (M(ue) || De ? k() : Oc(k)), () => {
b.current = !0, U();
};
}, [
p
]), Ie(() => {
let k;
function P() {
const U = le(c) ? c(E().data) : c;
U && k !== -1 && (k = setTimeout(Q, U));
}
function Q() {
!E().error && (m || w().isVisible()) && (d || w().isOnline()) ? $(Cr).then(P) : P();
}
return P(), () => {
k && (clearTimeout(k), k = -1);
};
}, [
c,
m,
d,
p
]), Xu(Se), s && M(ue) && p) {
if (!da && De)
throw new Error("Fallback data is required when using Suspense in SSR.");
x.current = r, R.current = t, b.current = !1;
const k = y[p];
if (!M(k)) {
const P = ie(k);
Tr(P);
}
if (M(xe)) {
const P = $(Cr);
M(Se) || (P.status = "fulfilled", P.value = !0), Tr(P);
} else
throw xe;
}
return {
mutate: ie,
get data() {
return B.data = !0, Se;
},
get error() {
return B.error = !0, xe;
},
get isValidating() {
return B.isValidating = !0, L;
},
get isLoading() {
return B.isLoading = !0, X;
}
};
}, Xc = Qc(Yc), Ga = da ? (e) => {
e();
} : Te.startTransition, Zc = (e) => {
const [, r] = W({}), t = G(!1), n = G(e), a = G({
data: !1,
error: !1,
isValidating: !1
}), s = O((i) => {
let o = !1;
const u = n.current;
for (const c in i)
if (Object.prototype.hasOwnProperty.call(i, c)) {
const m = c;
u[m] !== i[m] && (u[m] = i[m], a.current[m] && (o = !0));
}
o && !t.current && r({});
}, []);
return Ie(() => (t.current = !1, () => {
t.current = !0;
})), [
n,
a.current,
s
];
}, el = () => (e, r, t = {}) => {
const { mutate: n } = Ko(), a = G(e), s = G(r), i = G(t), o = G(0), [u, c, m] = Zc({
data: V,
error: V,
isMutating: !1
}), d = u.current, f = O(
async (_, h) => {
const [y, p] = nr(a.current);
if (!s.current)
throw new Error("Can’t trigger the mutation: missing fetcher.");
if (!y)
throw new Error("Can’t trigger the mutation: missing key.");
const g = oe(oe({
populateCache: !1,
throwOnError: !0
}, i.current), h), C = Me();
o.current = C, m({
isMutating: !0
});
try {
const b = await n(
y,
s.current(p, {
arg: _
}),
// We must throw the error here so we can catch and update the states.
oe(g, {
throwOnError: !0
})
);
return o.current <= C && (Ga(() => m({
data: b,
isMutating: !1,
error: void 0
})), g.onSuccess == null || g.onSuccess.call(g, b, y, g)), b;
} catch (b) {
if (o.current <= C && (Ga(() => m({
error: b,
isMutating: !1
})), g.onError == null || g.onError.call(g, b, y, g), g.throwOnError))
throw b;
}
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[]
), v = O(() => {
o.current = Me(), m({
data: V,
error: V,
isMutating: !1
});
}, []);
return Ie(() => {
a.current = e, s.current = r, i.current = t;
}), {
trigger: f,
reset: v,
get data() {
return c.data = !0, d.data;
},
get error() {
return c.error = !0, d.error;
},
get isMutating() {
return c.isMutating = !0, d.isMutating;
}
};
}, rl = Jc(Xc, el);
function tl(e, r, t = {}) {
const { namespace: n = "domain", tags: a, ...s } = t, { data: i, isMutating: o, error: u, trigger: c, reset: m } = rl(
{ namespace: n, tags: a, key: e },
(d, { arg: f }) => r(f),
s
);
return [
{ data: i || null, error: u || null, submitting: o, reset: m },
c
];
}
const Qo = (e) => (r) => `${e.client.authToken || ""}-${r}`;
function ke(e, r, t) {
const { sdk: n } = rr(), a = Qo(n);
return xc(e && a(e), () => r(n, void 0), t);
}
function nl(e, r, t) {
const { sdk: n } = rr(), a = Qo(n);
return tl(
e && a(e),
(s) => r(n, s),
t
);
}
var qr = { exports: {} }, Ne = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Va;
function al() {
if (Va) return Ne;
Va = 1;
var e = Te, r = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, a = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
function i(o, u, c) {
var m, d = {}, f = null, v = null;
c !== void 0 && (f = "" + c), u.key !== void 0 && (f = "" + u.key), u.ref !== void 0 && (v = u.ref);
for (m in u) n.call(u, m) && !s.hasOwnProperty(m) && (d[m] = u[m]);
if (o && o.defaultProps) for (m in u = o.defaultProps, u) d[m] === void 0 && (d[m] = u[m]);
return { $$typeof: r, type: o, key: f, ref: v, props: d, _owner: a.current };
}
return Ne.Fragment = t, Ne.jsx = i, Ne.jsxs = i, Ne;
}
var Ka;
function sl() {
return Ka || (Ka = 1, qr.exports = al()), qr.exports;
}
var l = sl();
function il(e) {
return (r) => e(r);
}
const be = {
from: il
}, ol = be.from((e) => ({
getByReference: (r, t) => e.GET("/widgets/activities", {
params: { query: { filter: JSON.stringify({ ...t, reference: r }) } }
}).then(({ data: n }) => (n == null ? void 0 : n.data) || [])
})), ul = be.from((e) => ({
create: (r) => e.POST("/widgets/attempts", { body: r }).then(({ data: t }) => {
if (!t)
throw new Error("Invalid response");
return t.data;
}),
update: (r, t) => e.POST("/widgets/attempts/{id}", { body: t, params: { path: { id: r } } }).then(({ data: n }) => {
if (!n)
throw new Error("Invalid response");
return n.data;
})
})), cl = be.from((e) => ({
getById: (r) => e.GET("/flashcard/{id}", {
params: { path: { id: r } }
}).then(({ data: t }) => (t == null ? void 0 : t.data) || null),
getByReference: (r) => e.GET("/flashcard", {
params: { query: { filter: JSON.stringify({ reference: r }) } }
}).then(({ data: t }) => (t == null ? void 0 : t.data) || []),
getDeckByReference: (r) => e.GET("/flashcard-deck", {
params: { query: { filter: JSON.stringify({ reference: r }) } }
}).then(({ data: t }) => (t == null ? void 0 : t.data) || [])
})), ll = be.from((e) => ({
create: (r) => e.POST("/widgets/feedbacks", { body: r }).then(({ data: t }) => {
if (!t)
throw new Error("Invalid response");
return t.data;
})
})), ml = be.from((e) => ({
getById: (r) => e.GET("/quiz/{id}", {
params: { path: { id: r } }
}).then(({ data: t }) => (t == null ? void 0 : t.data) || null)
})), dl = be.from((e) => ({
getById: (r) => e.GET("/summary/{id}", {
params: { path: { id: r } }
}).then(({ data: t }) => (t == null ? void 0 : t.data) || null),
getByReference: (r) => e.GET("/summary", {
params: { query: { filter: JSON.stringify({ reference: r }) } }
}).then(({ data: t }) => (t == null ? void 0 : t.data) || [])
})), fl = /\{[^{}]+\}/g;
function hl() {
return Math.random().toString(36).slice(2, 11);
}
function pl(e) {
let {
baseUrl: r = "",
Request: t = globalThis.Request,
fetch: n = globalThis.fetch,
querySerializer: a,
bodySerializer: s,
headers: i,
...o
} = { ...e };
r = Wa(r);
const u = [];
async function c(m, d) {
const {
baseUrl: f,
fetch: v = n,
Request: _ = t,
headers: h,
params: y = {},
parseAs: p = "json",
querySerializer: g,
bodySerializer: C = s ?? gl,
body: b,
...S
} = d || {};
f && (r = Wa(f));
let x = typeof a == "function" ? a : Qa(a);
g && (x = typeof g == "function" ? g : Qa({
...typeof a == "object" ? a : {},
...g
}));
const R = b === void 0 ? void 0 : C(b), w = (
// with no body, we should not to set Content-Type
R === void 0 || // if serialized body is FormData; browser will correctly set Content-Type & boundary expression
R instanceof FormData ? {} : {
"Content-Type": "application/json"
}
), N = {
redirect: "follow",
...o,
...S,
body: R,
headers: bl(w, i, h, y.header)
};
let E, T, I = new t(yl(m, { baseUrl: r, params: y, querySerializer: x }), N);
for (const F in S)
F in I || (I[F] = S[F]);
if (u.length) {
E = hl(), T = Object.freeze({
baseUrl: r,
fetch: v,
parseAs: p,
querySerializer: x,
bodySerializer: C
});
for (const F of u)
if (F && typeof F == "object" && typeof F.onRequest == "function") {
const z = await F.onRequest({
request: I,
schemaPath: m,
params: y,
options: T,
id: E
});
if (z) {
if (!(z instanceof t))
throw new Error("onRequest: must return new Request() when modifying the request");
I = z;
}
}
}
let q = await v(I);
if (u.length)
for (let F = u.length - 1; F >= 0; F--) {
const z = u[F];
if (z && typeof z == "object" && typeof z.onResponse == "function") {
const ne = await z.onResponse({
request: I,
response: q,
schemaPath: m,
params: y,
options: T,
id: E
});
if (ne) {
if (!(ne instanceof Response))
throw new Error("onResponse: must return new Response() when modifying the response");
q = ne;
}
}
}
if (q.status === 204 || q.headers.get("Content-Length") === "0")
return q.ok ? { data: {}, response: q } : { error: {}, response: q };
if (q.ok)
return p === "stream" ? { data: q.body, response: q } : { data: await q[p](), response: q };
let B = await q.text();
try {
B = JSON.parse(B);
} catch {
}
return { error: B, response: q };
}
return {
/** Call a GET endpoint */
GET(m, d) {
return c(m, { ...d, method: "GET" });
},
/** Call a PUT endpoint */
PUT(m, d) {
return c(m, { ...d, method: "PUT" });
},
/** Call a POST endpoint */
POST(m, d) {
return c(m, { ...d, method: "POST" });
},
/** Call a DELETE endpoint */
DELETE(m, d) {
return c(m, { ...d, method: "DELETE" });
},
/** Call a OPTIONS endpoint */
OPTIONS(m, d) {
return c(m, { ...d, method: "OPTIONS" });
},
/** Call a HEAD endpoint */
HEAD(m, d) {
return c(m, { ...d, method: "HEAD" });
},
/** Call a PATCH endpoint */
PATCH(m, d) {
return c(m, { ...d, method: "PATCH" });
},
/** Call a TRACE endpoint */
TRACE(m, d) {
return c(m, { ...d, method: "TRACE" });
},
/** Register middleware */
use(...m) {
for (const d of m)
if (d) {
if (typeof d != "object" || !("onRequest" in d || "onResponse" in d))
throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");
u.push(d);
}
},
/** Unregister middleware */
eject(...m) {
for (const d of m) {
const f = u.indexOf(d);
f !== -1 && u.splice(f, 1);
}
}
};
}
function ar(e, r, t) {
if (r == null)
return "";
if (typeof r == "object")
throw new Error(
"Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these."
);
return `${e}=${(t == null ? void 0 : t.allowReserved) === !0 ? r : encodeURIComponent(r)}`;
}
function Wo(e, r, t) {
if (!r || typeof r != "object")
return "";
const n = [], a = {
simple: ",",
label: ".",
matrix: ";"
}[t.style] || "&";
if (t.style !== "deepObject" && t.explode === !1) {
for (const o in r)
n.push(o, t.allowReserved === !0 ? r[o] : encodeURIComponent(r[o]));
const i = n.join(",");
switch (t.style) {
case "form":
return `${e}=${i}`;
case "label":
return `.${i}`;
case "matrix":
return `;${e}=${i}`;
default:
return i;
}
}
for (const i in r) {
const o = t.style === "deepObject" ? `${e}[${i}]` : i;
n.push(ar(o, r[i], t));
}
const s = n.join(a);
return t.style === "label" || t.style === "matrix" ? `${a}${s}` : s;
}
function Jo(e, r, t) {
if (!Array.isArray(r))
return "";
if (t.explode === !1) {
const s = { form: ",", spaceDelimited: "%20", pipeDelimited: "|" }[t.style] || ",", i = (t.allowReserved === !0 ? r : r.map((o) => encodeURIComponent(o))).join(s);
switch (t.style) {
case "simple":
return i;
case "label":
return `.${i}`;
case "matrix":
return `;${e}=${i}`;
// case "spaceDelimited":
// case "pipeDelimited":
default:
return `${e}=${i}`;
}
}
const n = { simple: ",", label: ".", matrix: ";" }[t.style] || "&", a = [];
for (const s of r)
t.style === "simple" || t.style === "label" ? a.push(t.allowReserved === !0 ? s : encodeURIComponent(s)) : a.push(ar(e, s, t));
return t.style === "label" || t.style === "matrix" ? `${n}${a.join(n)}` : a.join(n);
}
function Qa(e) {
return function(t) {
const n = [];
if (t && typeof t == "object")
for (const a in t) {
const s = t[a];
if (s != null) {
if (Array.isArray(s)) {
if (s.length === 0)
continue;
n.push(
Jo(a, s, {
style: "form",
explode: !0,
...e == null ? void 0 : e.array,
allowReserved: (e == null ? void 0 : e.allowReserved) || !1
})
);
continue;
}
if (typeof s == "object") {
n.push(
Wo(a, s, {
style: "deepObject",
explode: !0,
...e == null ? void 0 : e.object,
allowReserved: (e == null ? void 0 : e.allowReserved) || !1
})
);
continue;
}
n.push(ar(a, s, e));
}
}
return n.join("&");
};
}
function vl(e, r) {
let t = e;
for (const n of e.match(fl) ?? []) {
let a = n.substring(1, n.length - 1), s = !1, i = "simple";
if (a.endsWith("*") && (s = !0, a = a.substring(0, a.length - 1)), a.startsWith(".") ? (i = "label", a = a.substring(1)) : a.startsWith(";") && (i = "matrix", a = a.substring(1)), !r || r[a] === void 0 || r[a] === null)
continue;
const o = r[a];
if (Array.isArray(o)) {
t = t.replace(n, Jo(a, o, { style: i, explode: s }));
continue;
}
if (typeof o == "object") {
t = t.replace(n, Wo(a, o, { style: i, explode: s }));
continue;
}
if (i === "matrix") {
t = t.replace(n, `;${ar(a, o)}`);
continue;
}
t = t.replace(n, i === "label" ? `.${encodeURIComponent(o)}` : encodeURIComponent(o));
}
return t;
}
function gl(e) {
return e instanceof FormData ? e : JSON.stringify(e);
}
function yl(e, r) {
var a;
let t = `${r.baseUrl}${e}`;
(a = r.params) != null && a.path && (t = vl(t, r.params.path));
let n = r.querySerializer(r.params.query ?? {});
return n.startsWith("?") && (n = n.substring(1)), n && (t += `?${n}`), t;
}
function bl(...e) {
const r = new Headers();
for (const t of e) {
if (!t || typeof t != "object")
continue;
const n = t instanceof Headers ? t.entries() : Object.entries(t);
for (const [a, s] of n)
if (s === null)
r.delete(a);
else if (Array.isArray(s))
for (const i of s)
r.append(a, i);
else s !== void 0 && r.set(a, s);
}
return r;
}
function Wa(e) {
return e.endsWith("/") ? e.substring(0, e.length - 1) : e;
}
const _l = typeof process < "u" && process.env.MEMORAIZ_API_URL || "https://hdbnp00qlg.execute-api.eu-central-1.amazonaws.com", xl = ({ authToken: e }) => ({
onRequest: ({ request: r }) => (e && r.headers.set("Authorization", `Bearer ${e}`), r)
}), Sl = {
from: ({
authToken: e,
baseUrl: r = _l,
...t
} = {}) => {
const n = pl({
baseUrl: r,
...t
});
return n.use(xl({ authToken: e })), n.authToken = e || null, n;
}
}, Yo = {
from: (e, r) => {
const t = Sl.from(r), n = { client: t };
return Object.entries(e).reduce((a, [s, i]) => ({ ...a, [s]: i(t) }), n);
},
fromResources: (e) => ({
init: (r) => Yo.from(e, r)
})
}, Rl = be.from((e) => ({
getByDate: (r, t) => e.GET("/widgets/dashboard", {
params: {
query: {
fromDate: r.toISOString(),
toDate: t.toISOString()
}
}
}).then(({ data: n }) => n || [])
})), wl = {
activity: ol,
flashcard: cl,
feedback: ll,
quiz: ml,
summary: dl,
attempt: ul,
dashboard: Rl
}, Tl = Yo.fromResources(wl);
function nh({
sdk: e = {},
theme: r = {},
locale: t,
children: n
}) {
const { authToken: a } = e, s = K(() => (console.log("Initializing sdk...", e), Tl.init({ ...e, authToken: a })), [e, a]);
return re(() => {
const i = typeof r == "string" ? { id: r, darkmode: !1 } : r;
typeof window < "u" && (i.id && document.body.setAttribute("data-mm-theme", i.id), i.darkmode ? document.body.classList.add("mm-dark") : document.body.classList.contains("mm-dark") && document.body.classList.remove("mm-dark"), document.body.setAttribute("data-brand", i.variant || ""));
}, [r]), /* @__PURE__ */ l.jsx(Fo.Provider, { value: { sdk: s, i18n: t }, children: n });
}
function Ja() {
const [e, r] = W({
width: null,
height: null
}), t = G(null);
return [O((a) => {
if (t.current && (t.current.disconnect(), t.current = null), (a == null ? void 0 : a.nodeType) === Node.ELEMENT_NODE) {
const s = new ResizeObserver(([i]) => {
if (i != null && i.borderBoxSize[0]) {
const { inlineSize: o, blockSize: u } = i.borderBoxSize[0];
r({ width: o, height: u });
}
});
s.observe(a), t.current = s;
}
}, []), e];
}
const Ya = (e) => {
const r = e.slice();
for (let t = r.length - 1; t > 0; t--) {
const n = Math.floor(Math.random() * (t + 1));
[r[t], r[n]] = [r[n], r[t]];
}
return r;
};
function j(...e) {
return gc(va(e));
}
function H(e, r, t = {}) {
const { prefix: n = "Memo" } = t;
return r.reduce(
(s, i) => ({
...s,
[i]: `${n}${e}-${i}`
}),
{}
);
}
const Cl = Le(
"mm:border-0 mm:bg-background mm:inline-flex mm:items-center mm:justify-center mm:gap-2 mm:whitespace-nowrap mm:text-sm mm:font-medium mm:transition-all mm:cursor-pointer mm:focus-visible:outline-none mm:focus-visible:ring-1 mm:focus-visible:ring-ring mm:disabled:pointer-events-none mm:disabled:opacity-50 mm:[&_svg]:pointer-events-none mm:[&_svg]:size-4 mm:[&_svg]:shrink-0 mm:rounded-md mm:playful:rounded-full",
{
variants: {
variant: {
brand: "mm:bg-brand mm:text-primary-foreground mm:shadow mm:hover:bg-brand-accent",
primary: "mm:bg-primary mm:text-primary-foreground mm:shadow mm:hover:bg-primary/90",
outline: "mm:border mm:border-input mm:bg-background mm:shadow-sm mm:hover:bg-accent mm:hover:text-accent-foreground mm:rounded-md",
secondary: "mm:bg-secondary mm:text-secondary-foreground mm:shadow-sm mm:hover:bg-secondary/80",
ghost: "mm:hover:bg-accent mm:hover:text-accent-foreground",
link: "mm:text-primary mm:underline-offset-4 mm:hover:underline"
},
size: {
default: "mm:h-9 mm:px-4 mm:py-2",
xs: "mm:h-6 mm:w-6",
sm: "mm:h-8 mm:px-3 mm:text-xs",
lg: "mm:h-10 mm:px-8 mm:text-lg",
icon: "mm:h-9 mm:w-9"
}
},
defaultVariants: {
variant: "primary",
size: "default"
}
}
), ql = H("Button", ["root"]), pe = Ze(
({
className: e,
// variant,
size: r,
asChild: t = !1,
children: n,
startIcon: a,
variant: s,
endIcon: i,
helpText: o,
...u
}, c) => {
const m = t ? Pe : "button";
return /* @__PURE__ */ l.jsxs(
m,
{
className: j(
ql.root,
Cl({
variant: s,
size: r,
className: e
})
),
"data-size": r,
"data-variant": s,
ref: c,
title: o,
...u,
children: [
a,
/* @__PURE__ */ l.jsx(vc, { children: n }),
i
]
}
);
}
);
pe.displayName = "Button";
const je = H("Card", [
"root",
"header",
"title",
"description",
"content",
"footer"
]), ba = se.forwardRef(
({ className: e, ...r }, t) => /* @__PURE__ */ l.jsx(
"div",
{
ref: t,
className: j(
je.root,
"mm:rounded-xl mm:border mm:bg-card mm:text-card-foreground mm:shadow",
e
),
...r
}
)
);
ba.displayName = "Card";
const Xo = se.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ l.jsx(
"div",
{
ref: t,
className: j(
je.header,
"mm:flex mm:flex-col mm:space-y-1.5 mm:p-6",
e
),
...r
}
));
Xo.displayName = "CardHeader";
const Zo = se.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ l.jsx(
"div",
{
ref: t,
className: j(
je.title,
"mm:font-semibold mm:leading-none mm:tracking-tight",
e
),
...r
}
));
Zo.displayName = "CardTitle";
const jl = se.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ l.jsx(
"div",
{
ref: t,
className: j(
je.description,
"mm:text-sm mm:text-muted-foreground",
e
),
...r
}
));
jl.displayName = "CardDescription";
const _a = se.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ l.jsx(
"div",
{
ref: t,
className: j(je.content, "mm:p-6 mm:pt-0", e),
...r
}
));
_a.displayName = "CardContent";
const Al = se.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ l.jsx(
"div",
{
ref: t,
className: j(
je.footer,
"mm:flex mm:items-center mm:p-6 mm:pt-0",
e
),
...r
}
));
Al.displayName = "CardFooter";
const Ye = H("Flipcard", [
"root",
"card",
"content",
"button"
]), eu = Ze(
(e, r) => {
const {
front: t,
back: n,
flip: a,
children: s,
className: i,
height: o,
slots: u = {},
slotProps: c,
...m
} = e, { Card: d = ba } = u, [f, v] = Ja(), [_, h] = Ja(), y = {
front: v.height || 0,
back: h.height || 0
};
console.log(y);
const p = Math.max(y.front, y.back) || "auto";
return /* @__PURE__ */ l.jsxs(
"div",
{
className: j(Ye.root, "mm:w-full", i),
"data-flipped": a ? !0 : void 0,
ref: r,
...m,
children: [
/* @__PURE__ */ l.jsx(
"div",
{
className: "mm:relative mm:transition-transform mm:duration-600 mm:transform-3d mm:in-data-flipped:rotate-y-180",
style: { height: p },
children: ["front", "back"].map((g) => {
var S;
const C = { front: f, back: _ }[g], b = { front: t, back: n }[g];
return /* @__PURE__ */ l.jsx(
"div",
{
className: j(
"mm:absolute mm:inset-x-0 mm:top-0 mm:min-h-full mm:backface-hidden",
{ "mm:rotate-y-180": g === "back" }
),
"data-side": g,
children: /* @__PURE__ */ l.jsx(
d,
{
...c == null ? void 0 : c.card,
ref: C,
className: j(
Ye.card,
"mm:flex-col mm:justify-center mm:border-2 mm:border-card-foreground mm:shadow-none",
(S = c == null ? void 0 : c.card) == null ? void 0 : S.className
),
children: typeof b == "string" ? /* @__PURE__ */ l.jsx(Xe, { children: b }) : b
}
)
},
g
);
})
}
),
s
]
}
);
}
);
eu.displayName = "Flashcard";
const Xe = ({
className: e,
...r
}) => /* @__PURE__ */ l.jsx(
_a,
{
...r,
className: j(Ye.content, "mm:text-center mm:p-8", e)
}
);
Xe.displayName = "FlipcardContent";
const ru = ({
flipped: e,
className: r,
label: t,
children: n,
...a
}) => {
const s = j(
Ye.button,
// { 'mm:flex-row-reverse': flipped },
r
);
return /* @__PURE__ */ l.jsx(
pe,
{
className: s,
startIcon: e ? /* @__PURE__ */ l.jsx(nc, {}) : /* @__PURE__ */ l.jsx(tc, {}),
...a,
children: n || t
}
);
};
ru.displayName = "FlipcardButton";
function Nl(e = !0) {
const [r, t] = W(e), n = O(() => {
t(!1);
}, []), a = O(() => {
t(!0);
}, []), s = O(() => {
t(!0);
}, []);
return {
isTimerActive: r,
pauseTimer: n,
resumeTimer: a,
resetTimer: s
};
}
function xa({
value: e,
defaultValue: r,
onChange: t = () => {
}
}) {
const [n, a] = W(r), s = typeof e == "boolean", i = s ? e : n, o = O(
(u) => {
const c = typeof u == "function" ? u(i) : u;
t(c), s || a(c);
},
[s, t, i]
);
return [i, o];
}
function El({
questions: e = [],
events: r = {},
attempts: t = [],
displayIndex: n,
validate: a,
requireConfirm: s,
defaultScreen: i = "welcome"
}) {
const [o, u] = W(i), c = K(() => {
const A = t.length, Y = A === 0 ? 0 : t.reduce((ee, ue) => ee + ue.score, 0) / A, te = Math.round(e.length * Y);
return { totalAttempts: A, avgScore: te };
}, [t, e]), [m, d] = xa({
value: n,
defaultValue: 0,
onChange: r.onNavigateTo
}), [f, v] = W(null), [_, h] = W(!1), [y, p] = W(!1), [g, C] = W(0), { isTimerActive: b, pauseTimer: S, resetTimer: x } = Nl(), R = e[m], w = async (A) => {
var te;
if (!R) return;
let Y = A === R.correctAnswer;
if (console.log({ choice: A, currentQuestion: R, isAnswerCorrect: Y }), a)
try {
Y = await a(A, R.correctAnswer);
} catch (ee) {
console.error("Validation error:", ee);
}
p(Y), h(!0), Y && C((ee) => ee + 1), (te = r.onAnswer) == null || te.call(r, R.id, A, Y), S();
}, N = () => {
var A;
u("quiz"), (A = r.onStart) == null || A.call(r);
}, E = () => {
d(0), v(null), h(!1), x(), C(0);
}, T = O(() => {
var A;
u("end"), (A = r.onFinish) == null || A.call(r, g, e.length);
}, [r, g, e]), I = (A) => {
v(A), s || w(A);
}, q = () => {
f && !_ && w(f);
}, B = O(() => {
var A;
R && !_ && ((A = r.onTimeUp) == null || A.call(r, R.id), h(!0), p(!1));
}, [R, r, _]), F = O(() => {
if (!(!f && !_)) {
if (m === e.length - 1) {
T();
return;
}
d((A) => A + 1), v(null), h(!1), x();
}
}, [
m,
e.length,
f,
_,
x,
d,
T
]);
return {
currentQuestion: R,
currentIndex: m,
selectedAnswer: f,
isAnswerValidated: _,
isCorrect: y,
score: g,
screen: o,
stats: c,
handleAnswerSelection: I,
handleConfirmAnswer: q,
handleNext: F,
handleCancel: () => {
var A;
E(), u(i), (A = r.onCancel) == null || A.call(r);
},
handleTimeUp: B,
handleStart: N,
handleRestart: () => {
var A;
o === "end" && (E(), u("quiz"), (A = r.onRestart) == null || A.call(r));
},
isTimerActive: b
};
}
var jr, Xa;
function me() {
if (Xa) return jr;
Xa = 1;
var e = Array.isArray;
return jr = e, jr;
}
var Ar, Za;
function tu() {
if (Za) return Ar;
Za = 1;
var e = typeof Ge == "object" && Ge && Ge.Object === Object && Ge;
return Ar = e, Ar;
}
var Nr, es;
function ve() {
if (es) return Nr;
es = 1;
var e = tu(), r = typeof self == "object" && self && self.Object === Object && self, t = e || r || Function("return this")();
return Nr = t, Nr;
}
var Er, rs;
function ze() {
if (rs) return Er;
rs = 1;
var e = ve(), r = e.Symbol;
return Er = r, Er;
}
var Or, ts;
function Ol() {
if (ts) return Or;
ts = 1;
var e = ze(), r = Object.prototype, t = r.hasOwnProperty, n = r.toString, a = e ? e.toStringTag : void 0;
function s(i) {
var o = t.call(i, a), u = i[a];
try {
i[a] = void 0;
var c = !0;
} catch {
}
var m = n.call(i);
return c && (o ? i[a] = u : delete i[a]), m;
}
return Or = s, Or;
}
var Ir, ns;
function Il() {
if (ns) return Ir;
ns = 1;
var e = Object.prototype, r = e.toString;
function t(n) {
return r.call(n);
}
return Ir = t, Ir;
}
var Dr, as;
function Be() {
if (as) return Dr;
as = 1;
var e = ze(), r = Ol(), t = Il(), n = "[object Null]", a = "[object Undefined]", s = e ? e.toStringTag : void 0;
function i(o) {
return o == null ? o === void 0 ? a : n : s && s in Object(o) ? r(o) : t(o);
}
return Dr = i, Dr;
}
var Mr, ss;
function $e() {
if (ss) return Mr;
ss = 1;
function e(r) {
return r != null && typeof r == "object";
}
return Mr = e, Mr;
}
var kr, is;
function sr() {
if (is) return kr;
is = 1;
var e = Be(), r = $e(), t = "[object Symbol]";
function n(a) {
return typeof a == "symbol" || r(a) && e(a) == t;
}
return kr = n, kr;
}
var Fr, os;
function Sa() {
if (os) return Fr;
os = 1;
var e = me(), r = sr(), t = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, n = /^\w*$/;
function a(s, i) {
if (e(s))
return !1;
var o = typeof s;
return o == "number" || o == "symbol" || o == "boolean" || s == null || r(s) ? !0 : n.test(s) || !t.test(s) || i != null && s in Object(i);
}
return Fr = a, Fr;
}
var Pr, us;
function ir() {
if (us) return Pr;
us = 1;
function e(r) {
var t = typeof r;
return r != null && (t == "object" || t == "function");
}
return Pr = e, Pr;
}
var Lr, cs;
function nu() {
if (cs) return Lr;
cs = 1;
var e = Be(), r = ir(), t = "[object AsyncFunction]", n = "[object Function]", a = "[object GeneratorFunction]", s = "[object Proxy]";
function i(o) {
if (!r(o))
return !1;
var u = e(o);
return u == n || u == a || u == t || u == s;
}
return Lr = i, Lr;
}
var zr, ls;
function Dl() {
if (ls) return zr;
ls = 1;
var e = ve(), r = e["__core-js_shared__"];
return zr = r, zr;
}
var Br, ms;
function Ml() {
if (ms) return Br;
ms = 1;
var e = Dl(), r = function() {
var n = /[^.]+$/.exec(e && e.keys && e.keys.IE_PROTO || "");
return n ? "Symbol(src)_1." + n : "";
}();
function t(n) {
return !!r && r in n;
}
return Br = t, Br;
}
var $r, ds;
function au() {
if (ds) return $r;
ds = 1;
var e = Function.prototype, r = e.toString;
function t(n) {
if (n != null) {
try {
return r.call(n);
} catch {
}
try {
return n + "";
} catch {
}
}
return "";
}
return $r = t, $r;
}
var Ur, fs;
function kl() {
if (fs) return Ur;
fs = 1;
var e = nu(), r = Ml(), t = ir(), n = au(), a = /[\\^$.*+?()[\]{}|]/g, s = /^\[object .+?Constructor\]$/, i = Function.prototype, o = Object.prototype, u = i.toString, c = o.hasOwnProperty, m = RegExp(
"^" + u.call(c).replace(a, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function d(f) {
if (!t(f) || r(f))
return !1;
var v = e(f) ? m : s;
return v.test(n(f));
}
return Ur = d, Ur;
}
var Hr, hs;
function Fl() {
if (hs) return Hr;
hs = 1;
function e(r, t) {
return r == null ? void 0 : r[t];
}
return Hr = e, Hr;
}
var Gr, ps;
function _e() {
if (ps) return Gr;
ps = 1;
var e = kl(), r = Fl();
function t(n, a) {
var s = r(n, a);
return e(s) ? s : void 0;
}
return Gr = t, Gr;
}
var Vr, vs;
function or() {
if (vs) return Vr;
vs = 1;
var e = _e(), r = e(Object, "create");
return Vr = r, Vr;
}
var Kr, gs;
function Pl() {
if (gs) r