diff --git a/dist/index.js b/dist/index.js index ad81fff..3834b66 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,53 +1,53 @@ import { jsxs as L, jsx as g } from "react/jsx-runtime"; import * as W from "react"; -import { useState as N, useRef as te, useEffect as B, useCallback as k, createContext as He, useMemo as le, useContext as Qe, forwardRef as Kr } from "react"; -import { HStack as G, IconButton as H, Button as we, Input as Te, Text as X, extendTheme as Pr, withDefaultColorScheme as Vr, ChakraProvider as kr, Spinner as Ur, Box as Jr, VStack as je, Image as _e } from "@chakra-ui/react"; +import { useState as N, useRef as te, useEffect as B, useCallback as U, createContext as He, useMemo as le, useContext as Qe, forwardRef as Kr } from "react"; +import { HStack as G, IconButton as H, Button as we, Input as Te, Text as X, extendTheme as Pr, withDefaultColorScheme as Vr, ChakraProvider as Ur, Spinner as kr, Box as Jr, VStack as je, Image as _e } from "@chakra-ui/react"; import { IoChevronForwardOutline as Ze, IoChevronBackOutline as Fe } from "react-icons/io5"; import Hr from "keycloak-js"; import { useQuery as Qr, QueryClient as jr, QueryClientProvider as _r } from "@tanstack/react-query"; import $r from "axios"; -const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => String(e).replace(/\d/g, (r) => "۰۱۲۳۴۵۶۷۸۹"[Number(r)]), U = (e) => String(e).replace(/[۰-۹]/g, (t) => String("۰۱۲۳۴۵۶۷۸۹".indexOf(t))), zn = ({ +const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => String(e).replace(/\d/g, (r) => "۰۱۲۳۴۵۶۷۸۹"[Number(r)]), k = (e) => String(e).replace(/[۰-۹]/g, (t) => String("۰۱۲۳۴۵۶۷۸۹".indexOf(t))), zn = ({ currentPage: e, totalPages: r, totalCount: t, onPageChange: n }) => { - const [i, o] = N(Z(e)), [s, a] = N(!1), [u, c] = N(null), f = te(null), m = [.../* @__PURE__ */ new Set([1, e, r])].filter( - (l) => l >= 1 && l <= r + const [i, o] = N(Z(e)), [s, a] = N(!1), [l, c] = N(null), A = te(null), p = [.../* @__PURE__ */ new Set([1, e, r])].filter( + (u) => u >= 1 && u <= r ); B(() => { - if (u !== null) { - e === u && (c(null), a(!1), o(Z(e))); + if (l !== null) { + e === l && (c(null), a(!1), o(Z(e))); return; } s || o(Z(e)); - }, [e, s, u]), B(() => { - if (!s || !i || u !== null) return; - const l = parseInt(U(i), 10); - if (isNaN(l)) return; - const p = setTimeout(() => { + }, [e, s, l]), B(() => { + if (!s || !i || l !== null) return; + const u = parseInt(k(i), 10); + if (isNaN(u)) return; + const h = setTimeout(() => { var b; - const A = Math.min(Math.max(l, 1), r); - A !== e ? (c(A), o(Z(A)), n(A)) : (a(!1), o(Z(e))), (b = f.current) == null || b.blur(); + const f = Math.min(Math.max(u, 1), r); + f !== e ? (c(f), o(Z(f)), n(f)) : (a(!1), o(Z(e))), (b = A.current) == null || b.blur(); }, 1e3); - return () => clearTimeout(p); + return () => clearTimeout(h); }, [ i, s, - u, + l, r, e, n ]); - const S = () => { - var A, b; - const l = parseInt(U(i), 10); - if (isNaN(l)) { - o(Z(e)), a(!1), c(null), (A = f.current) == null || A.blur(); + const E = () => { + var f, b; + const u = parseInt(k(i), 10); + if (isNaN(u)) { + o(Z(e)), a(!1), c(null), (f = A.current) == null || f.blur(); return; } - const p = Math.min(Math.max(l, 1), r); - p !== e ? (c(p), o(Z(p)), n(p)) : (o(Z(e)), a(!1), c(null)), (b = f.current) == null || b.blur(); + const h = Math.min(Math.max(u, 1), r); + h !== e ? (c(h), o(Z(h)), n(h)) : (o(Z(e)), a(!1), c(null)), (b = A.current) == null || b.blur(); }; return r === 0 || !t ? null : /* @__PURE__ */ L( G, @@ -75,19 +75,19 @@ const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => S "aria-label": "صفحه قبلی" } ), - m.map((l) => /* @__PURE__ */ g( + p.map((u) => /* @__PURE__ */ g( we, { size: "md", px: 2, - bg: e === l ? "#4B49AC" : "#e6e6f1", - color: e === l ? "#e6e6f1" : "#4B49AC", - _hover: { bg: e === l ? "#4B49AC" : "#cbcbe8" }, - onClick: () => n(l), + bg: e === u ? "#4B49AC" : "#e6e6f1", + color: e === u ? "#e6e6f1" : "#4B49AC", + _hover: { bg: e === u ? "#4B49AC" : "#cbcbe8" }, + onClick: () => n(u), variant: "soft", - children: Z(l) + children: Z(u) }, - l + u )), /* @__PURE__ */ g( H, @@ -105,7 +105,7 @@ const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => S /* @__PURE__ */ g( Te, { - ref: f, + ref: A, type: "text", inputMode: "numeric", placeholder: "صفحه", @@ -114,15 +114,15 @@ const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => S onFocus: () => { a(!0), c(null), o(""); }, - onChange: (l) => { - const p = l.target.value, A = U(p).replace(/\D/g, ""); - o(Z(A)); + onChange: (u) => { + const h = u.target.value, f = k(h).replace(/\D/g, ""); + o(Z(f)); }, onBlur: () => { i || (o(Z(e)), a(!1), c(null)); }, - onKeyDown: (l) => { - l.key === "Enter" && S(); + onKeyDown: (u) => { + u.key === "Enter" && E(); }, textAlign: "center", color: "#1D2939", @@ -145,42 +145,42 @@ const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => S totalCount: t, onPageChange: n }) => { - const [i, o] = N(Z(e)), [s, a] = N(!1), [u, c] = N(null), f = te(null), m = Array.from( + const [i, o] = N(Z(e)), [s, a] = N(!1), [l, c] = N(null), A = te(null), p = Array.from( /* @__PURE__ */ new Set([1, e, e + 1, r]) - ).filter((l) => l >= 1 && l <= r).sort((l, p) => l - p); + ).filter((u) => u >= 1 && u <= r).sort((u, h) => u - h); B(() => { - if (u !== null) { - e === u && (c(null), a(!1), o(Z(e))); + if (l !== null) { + e === l && (c(null), a(!1), o(Z(e))); return; } s || o(Z(e)); - }, [e, s, u]), B(() => { - if (!s || !i || u !== null) return; - const l = parseInt(U(i), 10); - if (isNaN(l)) return; - const p = setTimeout(() => { + }, [e, s, l]), B(() => { + if (!s || !i || l !== null) return; + const u = parseInt(k(i), 10); + if (isNaN(u)) return; + const h = setTimeout(() => { var b; - const A = Math.min(Math.max(l, 1), r); - A !== e ? (c(A), o(Z(A)), n(A)) : (a(!1), o(Z(e))), (b = f.current) == null || b.blur(); + const f = Math.min(Math.max(u, 1), r); + f !== e ? (c(f), o(Z(f)), n(f)) : (a(!1), o(Z(e))), (b = A.current) == null || b.blur(); }, 1e3); - return () => clearTimeout(p); + return () => clearTimeout(h); }, [ i, s, - u, + l, r, e, n ]); - const S = () => { - var A, b; - const l = parseInt(U(i), 10); - if (isNaN(l)) { - o(Z(e)), a(!1), c(null), (A = f.current) == null || A.blur(); + const E = () => { + var f, b; + const u = parseInt(k(i), 10); + if (isNaN(u)) { + o(Z(e)), a(!1), c(null), (f = A.current) == null || f.blur(); return; } - const p = Math.min(Math.max(l, 1), r); - p !== e ? (c(p), o(Z(p)), n(p)) : (o(Z(e)), a(!1), c(null)), (b = f.current) == null || b.blur(); + const h = Math.min(Math.max(u, 1), r); + h !== e ? (c(h), o(Z(h)), n(h)) : (o(Z(e)), a(!1), c(null)), (b = A.current) == null || b.blur(); }; return r === 0 || !t ? null : /* @__PURE__ */ L( G, @@ -214,18 +214,18 @@ const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => S "aria-label": "صفحه قبلی" } ), - m.map((l) => /* @__PURE__ */ g( + p.map((u) => /* @__PURE__ */ g( we, { size: "md", - bg: e === l ? "#4B49AC" : "#e6e6f1", - color: e === l ? "#e6e6f1" : "#4B49AC", - _hover: { bg: e === l ? "#4B49AC" : "#cbcbe8" }, - onClick: () => n(l), + bg: e === u ? "#4B49AC" : "#e6e6f1", + color: e === u ? "#e6e6f1" : "#4B49AC", + _hover: { bg: e === u ? "#4B49AC" : "#cbcbe8" }, + onClick: () => n(u), variant: "soft", - children: Z(l) + children: Z(u) }, - l + u )), /* @__PURE__ */ g( H, @@ -243,7 +243,7 @@ const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => S /* @__PURE__ */ g( Te, { - ref: f, + ref: A, type: "text", inputMode: "numeric", placeholder: "صفحه", @@ -252,15 +252,15 @@ const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => S onFocus: () => { a(!0), c(null), o(""); }, - onChange: (l) => { - const p = l.target.value, A = U(p).replace(/\D/g, ""); - o(Z(A)); + onChange: (u) => { + const h = u.target.value, f = k(h).replace(/\D/g, ""); + o(Z(f)); }, onBlur: () => { i || (o(Z(e)), a(!1), c(null)); }, - onKeyDown: (l) => { - l.key === "Enter" && S(); + onKeyDown: (u) => { + u.key === "Enter" && E(); }, textAlign: "center", color: "#1D2939", @@ -283,18 +283,18 @@ const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => S totalCount: t, onPageChange: n }) => { - const [i, o] = N(""), [s, a] = N(!1), [u, c] = N(null), f = te(null), m = u ?? e, S = k( + const [i, o] = N(""), [s, a] = N(!1), [l, c] = N(null), A = te(null), p = l ?? e, E = U( (y) => { const C = Math.min(Math.max(y, 1), r); a(!1), o(""), c(null), C !== e && n(C); }, [e, r, n] - ), l = k(() => { + ), u = U(() => { if (!i) { a(!1), o(""), c(null); return; } - const y = parseInt(U(i), 10); + const y = parseInt(k(i), 10); if (isNaN(y)) { a(!1), o(""), c(null); return; @@ -304,33 +304,33 @@ const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => S }, [i, e, r, n]); B(() => { var y; - s && ((y = f.current) == null || y.focus()); + s && ((y = A.current) == null || y.focus()); }, [s]), B(() => { - u !== null && e === u && c(null); - }, [e, u]), B(() => { + l !== null && e === l && c(null); + }, [e, l]), B(() => { if (!s || !i) return; const y = setTimeout(() => { - l(); + u(); }, 1e3); return () => clearTimeout(y); - }, [i, s, l]); - const p = () => { + }, [i, s, u]); + const h = () => { c(null), o(""), a(!0); - }, A = (y, C = !1) => /* @__PURE__ */ g( + }, f = (y, C = !1) => /* @__PURE__ */ g( we, { size: "md", bg: C ? "#4B49AC" : "#e6e6f1", color: C ? "#e6e6f1" : "#4B49AC", _hover: { bg: C ? "#4B49AC" : "#cbcbe8" }, - onClick: C ? p : () => S(y), + onClick: C ? h : () => E(y), variant: "soft", children: Z(y) }, y ); if (r === 0 || !t) return null; - const b = r > 1 && m !== 1, T = r > 1 && m !== r; + const b = r > 1 && p !== 1, S = r > 1 && p !== r; return /* @__PURE__ */ g( G, { @@ -350,31 +350,31 @@ const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => S bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, - onClick: () => S(m - 1), - isDisabled: m === 1, + onClick: () => E(p - 1), + isDisabled: p === 1, icon: /* @__PURE__ */ g(Ze, {}), "aria-label": "صفحه قبلی" } ), - b && A(1), + b && f(1), s ? /* @__PURE__ */ g( Te, { - ref: f, + ref: A, type: "text", inputMode: "numeric", placeholder: "صفحه", w: "48px", value: i, onChange: (y) => { - const C = y.target.value, M = U(C).replace(/\D/g, ""); + const C = y.target.value, M = k(C).replace(/\D/g, ""); o(Z(M)); }, onBlur: () => { - i ? l() : (o(""), a(!1), c(null)); + i ? u() : (o(""), a(!1), c(null)); }, onKeyDown: (y) => { - y.key === "Enter" && l(), y.key === "Escape" && (o(""), a(!1), c(null)); + y.key === "Enter" && u(), y.key === "Escape" && (o(""), a(!1), c(null)); }, textAlign: "center", color: "#1D2939", @@ -382,8 +382,8 @@ const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => S minW: 0, dir: "ltr" } - ) : A(m, !0), - T && A(r), + ) : f(p, !0), + S && f(r), /* @__PURE__ */ g( H, { @@ -391,8 +391,8 @@ const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => S bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, - onClick: () => S(m + 1), - isDisabled: m === r, + onClick: () => E(p + 1), + isDisabled: p === r, icon: /* @__PURE__ */ g(Fe, {}), "aria-label": "صفحه بعدی" } @@ -401,12 +401,12 @@ const Dn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), Z = (e) => S } ); }; -let ye = null, v = null, be = null, Se = !1; -const et = He(null), rt = ({ url: e, realm: r, clientId: t }) => (v || (v = new Hr({ +let ye = null, x = null, be = null, Se = !1; +const et = He(null), rt = ({ url: e, realm: r, clientId: t }) => (x || (x = new Hr({ url: e, realm: r, clientId: t -})), v), tt = (e) => (ye = e, ye), nt = () => Se, $e = () => !!(v != null && v.authenticated), se = () => (v == null ? void 0 : v.token) ?? null, Be = async (e = 30) => v ? v.updateToken(e) : !1, er = (e) => v == null ? void 0 : v.logout(e), Wn = (e) => v == null ? void 0 : v.login(e), rr = ({ config: e, initOptions: r = {} } = {}) => { +})), x), tt = (e) => (ye = e, ye), nt = () => Se, $e = () => !!(x != null && x.authenticated), se = () => (x == null ? void 0 : x.token) ?? null, Be = async (e = 30) => x ? x.updateToken(e) : !1, er = (e) => x == null ? void 0 : x.logout(e), Wn = (e) => x == null ? void 0 : x.login(e), rr = ({ config: e, initOptions: r = {} } = {}) => { const t = e ?? ye; if (!(t != null && t.url) || !(t != null && t.realm) || !(t != null && t.clientId)) throw new Error("Keycloak config is required."); @@ -426,35 +426,35 @@ const et = He(null), rt = ({ url: e, realm: r, clientId: t }) => (v || (v = new initOptions: t, loading: n = null }) => { - const [i, o] = N(!1), [s, a] = N(!1), [u, c] = N(null), f = te(!1), m = k(() => { - v && (a(!!v.authenticated), c(v.token ?? null)); + const [i, o] = N(!1), [s, a] = N(!1), [l, c] = N(null), A = te(!1), p = U(() => { + x && (a(!!x.authenticated), c(x.token ?? null)); }, []); - B(() => (f.current = !0, rr({ config: r, initOptions: t }).then((b) => { - f.current && (a(!!b), c((v == null ? void 0 : v.token) ?? null), o(!0)); + B(() => (A.current = !0, rr({ config: r, initOptions: t }).then((b) => { + A.current && (a(!!b), c((x == null ? void 0 : x.token) ?? null), o(!0)); }).catch(() => { - f.current && (a(!1), c(null), o(!0)); + A.current && (a(!1), c(null), o(!0)); }), () => { - f.current = !1; + A.current = !1; }), [r, t]); - const S = k(() => v == null ? void 0 : v.login(), []), l = k((b) => v == null ? void 0 : v.logout(b), []), p = k( + const E = U(() => x == null ? void 0 : x.login(), []), u = U((b) => x == null ? void 0 : x.logout(b), []), h = U( async (b = 30) => { - if (!v) return !1; - const T = await v.updateToken(b); - return m(), T; + if (!x) return !1; + const S = await x.updateToken(b); + return p(), S; }, - [m] - ), A = le( + [p] + ), f = le( () => ({ initialized: i, authenticated: s, - token: u, - login: S, - logout: l, - updateToken: p + token: l, + login: E, + logout: u, + updateToken: h }), - [i, s, u, S, l, p] + [i, s, l, E, u, h] ); - return i ? /* @__PURE__ */ g(et.Provider, { value: A, children: e }) : n; + return i ? /* @__PURE__ */ g(et.Provider, { value: f, children: e }) : n; }, tr = He(null), Ae = "permissions", ot = (e) => (e == null ? void 0 : e.storageKey) || Ae, st = ({ user: e = null, children: r, @@ -464,28 +464,28 @@ const et = He(null), rt = ({ url: e, realm: r, clientId: t }) => (v || (v = new }) => { const o = ot(t), [s, a] = N( () => at(o) - ), { data: u, isLoading: c, error: f } = ft(t), m = u ?? s; + ), { data: l, isLoading: c, error: A } = ft(t), p = l ?? s; B(() => { - u && (ct(o, u), a(u)); - }, [u, o]); - const S = le( - () => ut(m), - [m] - ), l = k( - (b = "") => lt(S, b), - [S] - ), p = k((b = "") => !l(b), [l]), A = le( + l && (ct(o, l), a(l)); + }, [l, o]); + const E = le( + () => ut(p), + [p] + ), u = U( + (b = "") => lt(E, b), + [E] + ), h = U((b = "") => !u(b), [u]), f = le( () => ({ user: e, - can: l, - cannot: p, - permissions: m, + can: u, + cannot: h, + permissions: p, isLoading: c, - error: f + error: A }), - [e, l, p, m, c, f] + [e, u, h, p, c, A] ); - return f && !m ? i : c && !m ? n : /* @__PURE__ */ g(tr.Provider, { value: A, children: r }); + return A && !p ? i : c && !p ? n : /* @__PURE__ */ g(tr.Provider, { value: f, children: r }); }, at = (e = Ae) => { if (!(typeof window > "u")) try { @@ -579,9 +579,9 @@ const At = (e) => { } return s; }, o = async (s) => { - var u; + var l; const a = s.config; - if (((u = s == null ? void 0 : s.response) == null ? void 0 : u.status) === 401 && !(a != null && a._retry)) { + if (((l = s == null ? void 0 : s.response) == null ? void 0 : l.status) === 401 && !(a != null && a._retry)) { a._retry = !0; try { await Be(30); @@ -711,7 +711,7 @@ var yt = /* @__PURE__ */ function() { return (i = n.parentNode) == null ? void 0 : i.removeChild(n); }), this.tags = [], this.ctr = 0; }, e; -}(), Y = "-ms-", fe = "-moz-", E = "-webkit-", ir = "comm", Re = "rule", De = "decl", St = "@import", or = "@keyframes", Et = "@layer", It = Math.abs, he = String.fromCharCode, vt = Object.assign; +}(), Y = "-ms-", fe = "-moz-", I = "-webkit-", ir = "comm", Re = "rule", De = "decl", St = "@import", or = "@keyframes", Et = "@layer", It = Math.abs, he = String.fromCharCode, vt = Object.assign; function xt(e, r) { return D(e, 0) ^ 45 ? (((r << 2 ^ D(e, 0)) << 2 ^ D(e, 1)) << 2 ^ D(e, 2)) << 2 ^ D(e, 3) : 0; } @@ -721,7 +721,7 @@ function sr(e) { function wt(e, r) { return (e = r.exec(e)) ? e[0] : e; } -function I(e, r, t) { +function v(e, r, t) { return e.replace(r, t); } function Ee(e, r) { @@ -853,12 +853,12 @@ function zt(e) { function Yt(e) { return ur(ue("", null, null, null, [""], e = cr(e), 0, [0], e)); } -function ue(e, r, t, n, i, o, s, a, u) { - for (var c = 0, f = 0, m = s, S = 0, l = 0, p = 0, A = 1, b = 1, T = 1, y = 0, C = "", M = i, d = o, z = n, F = C; b; ) - switch (p = y, y = q()) { +function ue(e, r, t, n, i, o, s, a, l) { + for (var c = 0, A = 0, p = s, E = 0, u = 0, h = 0, f = 1, b = 1, S = 1, y = 0, C = "", M = i, d = o, z = n, F = C; b; ) + switch (h = y, y = q()) { case 40: - if (p != 108 && D(F, m - 1) == 58) { - Ee(F += I(ce(y), "&", "&\f"), "&\f") != -1 && (T = -1); + if (h != 108 && D(F, p - 1) == 58) { + Ee(F += v(ce(y), "&", "&\f"), "&\f") != -1 && (S = -1); break; } case 34: @@ -870,7 +870,7 @@ function ue(e, r, t, n, i, o, s, a, u) { case 10: case 13: case 32: - F += Mt(p); + F += Mt(h); break; case 92: F += Rt(ae() - 1, 7); @@ -879,74 +879,74 @@ function ue(e, r, t, n, i, o, s, a, u) { switch (V()) { case 42: case 47: - oe(Nt(Dt(q(), ae()), r, t), u); + oe(Nt(Dt(q(), ae()), r, t), l); break; default: F += "/"; } break; - case 123 * A: - a[c++] = K(F) * T; - case 125 * A: + case 123 * f: + a[c++] = K(F) * S; + case 125 * f: case 59: case 0: switch (y) { case 0: case 125: b = 0; - case 59 + f: - T == -1 && (F = I(F, /\f/g, "")), l > 0 && K(F) - m && oe(l > 32 ? Xe(F + ";", n, t, m - 1) : Xe(I(F, " ", "") + ";", n, t, m - 2), u); + case 59 + A: + S == -1 && (F = v(F, /\f/g, "")), u > 0 && K(F) - p && oe(u > 32 ? Xe(F + ";", n, t, p - 1) : Xe(v(F, " ", "") + ";", n, t, p - 2), l); break; case 59: F += ";"; default: - if (oe(z = qe(F, r, t, c, f, i, a, C, M = [], d = [], m), o), y === 123) - if (f === 0) - ue(F, r, z, z, M, o, m, a, d); + if (oe(z = qe(F, r, t, c, A, i, a, C, M = [], d = [], p), o), y === 123) + if (A === 0) + ue(F, r, z, z, M, o, p, a, d); else - switch (S === 99 && D(F, 3) === 110 ? 100 : S) { + switch (E === 99 && D(F, 3) === 110 ? 100 : E) { case 100: case 108: case 109: case 115: - ue(e, z, z, n && oe(qe(e, z, z, 0, 0, i, a, C, i, M = [], m), d), i, d, m, a, n ? M : d); + ue(e, z, z, n && oe(qe(e, z, z, 0, 0, i, a, C, i, M = [], p), d), i, d, p, a, n ? M : d); break; default: ue(F, z, z, z, [""], d, 0, a, d); } } - c = f = l = 0, A = T = 1, C = F = "", m = s; + c = A = u = 0, f = S = 1, C = F = "", p = s; break; case 58: - m = 1 + K(F), l = p; + p = 1 + K(F), u = h; default: - if (A < 1) { + if (f < 1) { if (y == 123) - --A; - else if (y == 125 && A++ == 0 && Ft() == 125) + --f; + else if (y == 125 && f++ == 0 && Ft() == 125) continue; } - switch (F += he(y), y * A) { + switch (F += he(y), y * f) { case 38: - T = f > 0 ? 1 : (F += "\f", -1); + S = A > 0 ? 1 : (F += "\f", -1); break; case 44: - a[c++] = (K(F) - 1) * T, T = 1; + a[c++] = (K(F) - 1) * S, S = 1; break; case 64: - V() === 45 && (F += ce(q())), S = V(), f = m = K(C = F += zt(ae())), y++; + V() === 45 && (F += ce(q())), E = V(), A = p = K(C = F += zt(ae())), y++; break; case 45: - p === 45 && K(F) == 2 && (A = 0); + h === 45 && K(F) == 2 && (f = 0); } } return o; } -function qe(e, r, t, n, i, o, s, a, u, c, f) { - for (var m = i - 1, S = i === 0 ? o : [""], l = ze(S), p = 0, A = 0, b = 0; p < n; ++p) - for (var T = 0, y = $(e, m + 1, m = It(A = s[p])), C = e; T < l; ++T) - (C = sr(A > 0 ? S[T] + " " + y : I(y, /&\f/g, S[T]))) && (u[b++] = C); - return pe(e, r, t, i === 0 ? Re : a, u, c, f); +function qe(e, r, t, n, i, o, s, a, l, c, A) { + for (var p = i - 1, E = i === 0 ? o : [""], u = ze(E), h = 0, f = 0, b = 0; h < n; ++h) + for (var S = 0, y = $(e, p + 1, p = It(f = s[h])), C = e; S < u; ++S) + (C = sr(f > 0 ? E[S] + " " + y : v(y, /&\f/g, E[S]))) && (l[b++] = C); + return pe(e, r, t, i === 0 ? Re : a, l, c, A); } function Nt(e, r, t) { return pe(e, r, t, ir, he(Zt()), $(e, 2, -2), 0); @@ -1028,9 +1028,9 @@ var Xt = function(r, t, n) { if (n = n.parent, !n) return; if (!(r.props.length === 1 && t.charCodeAt(0) !== 58 && !Le.get(n)) && !i) { Le.set(r, !0); - for (var o = [], s = Gt(t, o), a = n.props, u = 0, c = 0; u < s.length; u++) - for (var f = 0; f < a.length; f++, c++) - r.props[c] = o[u] ? s[u].replace(/&\f/g, a[f]) : a[f] + " " + s[u]; + for (var o = [], s = Gt(t, o), a = n.props, l = 0, c = 0; l < s.length; l++) + for (var A = 0; A < a.length; A++, c++) + r.props[c] = o[l] ? s[l].replace(/&\f/g, a[A]) : a[A] + " " + s[l]; } } }, Pt = function(r) { @@ -1044,7 +1044,7 @@ var Xt = function(r, t, n) { function lr(e, r) { switch (xt(e, r)) { case 5103: - return E + "print-" + e + e; + return I + "print-" + e + e; case 5737: case 4201: case 3177: @@ -1070,44 +1070,44 @@ function lr(e, r) { case 5365: case 5621: case 3829: - return E + e + e; + return I + e + e; case 5349: case 4246: case 4810: case 6968: case 2756: - return E + e + fe + e + Y + e + e; + return I + e + fe + e + Y + e + e; case 6828: case 4268: - return E + e + Y + e + e; + return I + e + Y + e + e; case 6165: - return E + e + Y + "flex-" + e + e; + return I + e + Y + "flex-" + e + e; case 5187: - return E + e + I(e, /(\w+).+(:[^]+)/, E + "box-$1$2" + Y + "flex-$1$2") + e; + return I + e + v(e, /(\w+).+(:[^]+)/, I + "box-$1$2" + Y + "flex-$1$2") + e; case 5443: - return E + e + Y + "flex-item-" + I(e, /flex-|-self/, "") + e; + return I + e + Y + "flex-item-" + v(e, /flex-|-self/, "") + e; case 4675: - return E + e + Y + "flex-line-pack" + I(e, /align-content|flex-|-self/, "") + e; + return I + e + Y + "flex-line-pack" + v(e, /align-content|flex-|-self/, "") + e; case 5548: - return E + e + Y + I(e, "shrink", "negative") + e; + return I + e + Y + v(e, "shrink", "negative") + e; case 5292: - return E + e + Y + I(e, "basis", "preferred-size") + e; + return I + e + Y + v(e, "basis", "preferred-size") + e; case 6060: - return E + "box-" + I(e, "-grow", "") + E + e + Y + I(e, "grow", "positive") + e; + return I + "box-" + v(e, "-grow", "") + I + e + Y + v(e, "grow", "positive") + e; case 4554: - return E + I(e, /([^-])(transform)/g, "$1" + E + "$2") + e; + return I + v(e, /([^-])(transform)/g, "$1" + I + "$2") + e; case 6187: - return I(I(I(e, /(zoom-|grab)/, E + "$1"), /(image-set)/, E + "$1"), e, "") + e; + return v(v(v(e, /(zoom-|grab)/, I + "$1"), /(image-set)/, I + "$1"), e, "") + e; case 5495: case 3959: - return I(e, /(image-set\([^]*)/, E + "$1$`$1"); + return v(e, /(image-set\([^]*)/, I + "$1$`$1"); case 4968: - return I(I(e, /(.+:)(flex-)?(.*)/, E + "box-pack:$3" + Y + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + E + e + e; + return v(v(e, /(.+:)(flex-)?(.*)/, I + "box-pack:$3" + Y + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + I + e + e; case 4095: case 3583: case 4068: case 2532: - return I(e, /(.+)-inline(.+)/, E + "$1$2") + e; + return v(e, /(.+)-inline(.+)/, I + "$1$2") + e; case 8116: case 7059: case 5753: @@ -1124,9 +1124,9 @@ function lr(e, r) { case 109: if (D(e, r + 4) !== 45) break; case 102: - return I(e, /(.+:)(.+)-([^]+)/, "$1" + E + "$2-$3$1" + fe + (D(e, r + 3) == 108 ? "$3" : "$2-$3")) + e; + return v(e, /(.+:)(.+)-([^]+)/, "$1" + I + "$2-$3$1" + fe + (D(e, r + 3) == 108 ? "$3" : "$2-$3")) + e; case 115: - return ~Ee(e, "stretch") ? lr(I(e, "stretch", "fill-available"), r) + e : e; + return ~Ee(e, "stretch") ? lr(v(e, "stretch", "fill-available"), r) + e : e; } break; case 4949: @@ -1134,21 +1134,21 @@ function lr(e, r) { case 6444: switch (D(e, K(e) - 3 - (~Ee(e, "!important") && 10))) { case 107: - return I(e, ":", ":" + E) + e; + return v(e, ":", ":" + I) + e; case 101: - return I(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + E + (D(e, 14) === 45 ? "inline-" : "") + "box$3$1" + E + "$2$3$1" + Y + "$2box$3") + e; + return v(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + I + (D(e, 14) === 45 ? "inline-" : "") + "box$3$1" + I + "$2$3$1" + Y + "$2box$3") + e; } break; case 5936: switch (D(e, r + 11)) { case 114: - return E + e + Y + I(e, /[svh]\w+-[tblr]{2}/, "tb") + e; + return I + e + Y + v(e, /[svh]\w+-[tblr]{2}/, "tb") + e; case 108: - return E + e + Y + I(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e; + return I + e + Y + v(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e; case 45: - return E + e + Y + I(e, /[svh]\w+-[tblr]{2}/, "lr") + e; + return I + e + Y + v(e, /[svh]\w+-[tblr]{2}/, "lr") + e; } - return E + e + Y + e + e; + return I + e + Y + e + e; } return e; } @@ -1159,7 +1159,7 @@ var Vt = function(r, t, n, i) { break; case or: return J([_(r, { - value: I(r.value, "@", "@" + E) + value: v(r.value, "@", "@" + I) })], i); case Re: if (r.length) return Tt(r.props, function(o) { @@ -1167,52 +1167,52 @@ var Vt = function(r, t, n, i) { case ":read-only": case ":read-write": return J([_(r, { - props: [I(o, /:(read-\w+)/, ":" + fe + "$1")] + props: [v(o, /:(read-\w+)/, ":" + fe + "$1")] })], i); case "::placeholder": return J([_(r, { - props: [I(o, /:(plac\w+)/, ":" + E + "input-$1")] + props: [v(o, /:(plac\w+)/, ":" + I + "input-$1")] }), _(r, { - props: [I(o, /:(plac\w+)/, ":" + fe + "$1")] + props: [v(o, /:(plac\w+)/, ":" + fe + "$1")] }), _(r, { - props: [I(o, /:(plac\w+)/, Y + "input-$1")] + props: [v(o, /:(plac\w+)/, Y + "input-$1")] })], i); } return ""; }); } -}, kt = [Vt], Ut = function(r) { +}, Ut = [Vt], kt = function(r) { var t = r.key; if (t === "css") { var n = document.querySelectorAll("style[data-emotion]:not([data-s])"); - Array.prototype.forEach.call(n, function(A) { - var b = A.getAttribute("data-emotion"); - b.indexOf(" ") !== -1 && (document.head.appendChild(A), A.setAttribute("data-s", "")); + Array.prototype.forEach.call(n, function(f) { + var b = f.getAttribute("data-emotion"); + b.indexOf(" ") !== -1 && (document.head.appendChild(f), f.setAttribute("data-s", "")); }); } - var i = r.stylisPlugins || kt, o = {}, s, a = []; + var i = r.stylisPlugins || Ut, o = {}, s, a = []; s = r.container || document.head, Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which // means that the style elements we're looking at are only Emotion 11 server-rendered style elements document.querySelectorAll('style[data-emotion^="' + t + ' "]'), - function(A) { - for (var b = A.getAttribute("data-emotion").split(" "), T = 1; T < b.length; T++) - o[b[T]] = !0; - a.push(A); + function(f) { + for (var b = f.getAttribute("data-emotion").split(" "), S = 1; S < b.length; S++) + o[b[S]] = !0; + a.push(f); } ); - var u, c = [Kt, Pt]; + var l, c = [Kt, Pt]; { - var f, m = [Wt, Bt(function(A) { - f.insert(A); - })], S = Ot(c.concat(i, m)), l = function(b) { - return J(Yt(b), S); + var A, p = [Wt, Bt(function(f) { + A.insert(f); + })], E = Ot(c.concat(i, p)), u = function(b) { + return J(Yt(b), E); }; - u = function(b, T, y, C) { - f = y, l(b ? b + "{" + T.styles + "}" : T.styles), C && (p.inserted[T.name] = !0); + l = function(b, S, y, C) { + A = y, u(b ? b + "{" + S.styles + "}" : S.styles), C && (h.inserted[S.name] = !0); }; } - var p = { + var h = { key: t, sheet: new yt({ key: t, @@ -1225,10 +1225,10 @@ var Vt = function(r, t, n, i) { nonce: r.nonce, inserted: o, registered: {}, - insert: u + insert: l }; - return p.sheet.hydrate(a), p; -}, ve = { exports: {} }, x = {}; + return h.sheet.hydrate(a), h; +}, ve = { exports: {} }, w = {}; /** @license React v16.13.1 * react-is.production.min.js * @@ -1239,28 +1239,28 @@ var Vt = function(r, t, n, i) { */ var Ge; function Jt() { - if (Ge) return x; + if (Ge) return w; Ge = 1; - var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, o = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, u = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, f = e ? Symbol.for("react.forward_ref") : 60112, m = e ? Symbol.for("react.suspense") : 60113, S = e ? Symbol.for("react.suspense_list") : 60120, l = e ? Symbol.for("react.memo") : 60115, p = e ? Symbol.for("react.lazy") : 60116, A = e ? Symbol.for("react.block") : 60121, b = e ? Symbol.for("react.fundamental") : 60117, T = e ? Symbol.for("react.responder") : 60118, y = e ? Symbol.for("react.scope") : 60119; + var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, o = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, l = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, A = e ? Symbol.for("react.forward_ref") : 60112, p = e ? Symbol.for("react.suspense") : 60113, E = e ? Symbol.for("react.suspense_list") : 60120, u = e ? Symbol.for("react.memo") : 60115, h = e ? Symbol.for("react.lazy") : 60116, f = e ? Symbol.for("react.block") : 60121, b = e ? Symbol.for("react.fundamental") : 60117, S = e ? Symbol.for("react.responder") : 60118, y = e ? Symbol.for("react.scope") : 60119; function C(d) { if (typeof d == "object" && d !== null) { var z = d.$$typeof; switch (z) { case r: switch (d = d.type, d) { - case u: + case l: case c: case n: case o: case i: - case m: + case p: return d; default: switch (d = d && d.$$typeof, d) { case a: - case f: - case p: - case l: + case A: + case h: + case u: case s: return d; default: @@ -1275,35 +1275,35 @@ function Jt() { function M(d) { return C(d) === c; } - return x.AsyncMode = u, x.ConcurrentMode = c, x.ContextConsumer = a, x.ContextProvider = s, x.Element = r, x.ForwardRef = f, x.Fragment = n, x.Lazy = p, x.Memo = l, x.Portal = t, x.Profiler = o, x.StrictMode = i, x.Suspense = m, x.isAsyncMode = function(d) { - return M(d) || C(d) === u; - }, x.isConcurrentMode = M, x.isContextConsumer = function(d) { + return w.AsyncMode = l, w.ConcurrentMode = c, w.ContextConsumer = a, w.ContextProvider = s, w.Element = r, w.ForwardRef = A, w.Fragment = n, w.Lazy = h, w.Memo = u, w.Portal = t, w.Profiler = o, w.StrictMode = i, w.Suspense = p, w.isAsyncMode = function(d) { + return M(d) || C(d) === l; + }, w.isConcurrentMode = M, w.isContextConsumer = function(d) { return C(d) === a; - }, x.isContextProvider = function(d) { + }, w.isContextProvider = function(d) { return C(d) === s; - }, x.isElement = function(d) { + }, w.isElement = function(d) { return typeof d == "object" && d !== null && d.$$typeof === r; - }, x.isForwardRef = function(d) { - return C(d) === f; - }, x.isFragment = function(d) { + }, w.isForwardRef = function(d) { + return C(d) === A; + }, w.isFragment = function(d) { return C(d) === n; - }, x.isLazy = function(d) { - return C(d) === p; - }, x.isMemo = function(d) { - return C(d) === l; - }, x.isPortal = function(d) { + }, w.isLazy = function(d) { + return C(d) === h; + }, w.isMemo = function(d) { + return C(d) === u; + }, w.isPortal = function(d) { return C(d) === t; - }, x.isProfiler = function(d) { + }, w.isProfiler = function(d) { return C(d) === o; - }, x.isStrictMode = function(d) { + }, w.isStrictMode = function(d) { return C(d) === i; - }, x.isSuspense = function(d) { - return C(d) === m; - }, x.isValidElementType = function(d) { - return typeof d == "string" || typeof d == "function" || d === n || d === c || d === o || d === i || d === m || d === S || typeof d == "object" && d !== null && (d.$$typeof === p || d.$$typeof === l || d.$$typeof === s || d.$$typeof === a || d.$$typeof === f || d.$$typeof === b || d.$$typeof === T || d.$$typeof === y || d.$$typeof === A); - }, x.typeOf = C, x; + }, w.isSuspense = function(d) { + return C(d) === p; + }, w.isValidElementType = function(d) { + return typeof d == "string" || typeof d == "function" || d === n || d === c || d === o || d === i || d === p || d === E || typeof d == "object" && d !== null && (d.$$typeof === h || d.$$typeof === u || d.$$typeof === s || d.$$typeof === a || d.$$typeof === A || d.$$typeof === b || d.$$typeof === S || d.$$typeof === y || d.$$typeof === f); + }, w.typeOf = C, w; } -var w = {}; +var T = {}; /** @license React v16.13.1 * react-is.development.js * @@ -1315,32 +1315,32 @@ var w = {}; var Ke; function Ht() { return Ke || (Ke = 1, process.env.NODE_ENV !== "production" && function() { - var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, o = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, u = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, f = e ? Symbol.for("react.forward_ref") : 60112, m = e ? Symbol.for("react.suspense") : 60113, S = e ? Symbol.for("react.suspense_list") : 60120, l = e ? Symbol.for("react.memo") : 60115, p = e ? Symbol.for("react.lazy") : 60116, A = e ? Symbol.for("react.block") : 60121, b = e ? Symbol.for("react.fundamental") : 60117, T = e ? Symbol.for("react.responder") : 60118, y = e ? Symbol.for("react.scope") : 60119; - function C(h) { - return typeof h == "string" || typeof h == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. - h === n || h === c || h === o || h === i || h === m || h === S || typeof h == "object" && h !== null && (h.$$typeof === p || h.$$typeof === l || h.$$typeof === s || h.$$typeof === a || h.$$typeof === f || h.$$typeof === b || h.$$typeof === T || h.$$typeof === y || h.$$typeof === A); + var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, o = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, l = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, A = e ? Symbol.for("react.forward_ref") : 60112, p = e ? Symbol.for("react.suspense") : 60113, E = e ? Symbol.for("react.suspense_list") : 60120, u = e ? Symbol.for("react.memo") : 60115, h = e ? Symbol.for("react.lazy") : 60116, f = e ? Symbol.for("react.block") : 60121, b = e ? Symbol.for("react.fundamental") : 60117, S = e ? Symbol.for("react.responder") : 60118, y = e ? Symbol.for("react.scope") : 60119; + function C(m) { + return typeof m == "string" || typeof m == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + m === n || m === c || m === o || m === i || m === p || m === E || typeof m == "object" && m !== null && (m.$$typeof === h || m.$$typeof === u || m.$$typeof === s || m.$$typeof === a || m.$$typeof === A || m.$$typeof === b || m.$$typeof === S || m.$$typeof === y || m.$$typeof === f); } - function M(h) { - if (typeof h == "object" && h !== null) { - var ge = h.$$typeof; + function M(m) { + if (typeof m == "object" && m !== null) { + var ge = m.$$typeof; switch (ge) { case r: - var ie = h.type; + var ie = m.type; switch (ie) { - case u: + case l: case c: case n: case o: case i: - case m: + case p: return ie; default: var Oe = ie && ie.$$typeof; switch (Oe) { case a: - case f: - case p: - case l: + case A: + case h: + case u: case s: return Oe; default: @@ -1352,48 +1352,48 @@ function Ht() { } } } - var d = u, z = c, F = a, Sr = s, Er = r, Ir = f, vr = n, xr = p, wr = l, Tr = t, Zr = o, Fr = i, Mr = m, Ne = !1; - function Rr(h) { - return Ne || (Ne = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), We(h) || M(h) === u; + var d = l, z = c, F = a, Sr = s, Er = r, Ir = A, vr = n, xr = h, wr = u, Tr = t, Zr = o, Fr = i, Mr = p, Ne = !1; + function Rr(m) { + return Ne || (Ne = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), We(m) || M(m) === l; } - function We(h) { - return M(h) === c; + function We(m) { + return M(m) === c; } - function Dr(h) { - return M(h) === a; + function Dr(m) { + return M(m) === a; } - function zr(h) { - return M(h) === s; + function zr(m) { + return M(m) === s; } - function Yr(h) { - return typeof h == "object" && h !== null && h.$$typeof === r; + function Yr(m) { + return typeof m == "object" && m !== null && m.$$typeof === r; } - function Nr(h) { - return M(h) === f; + function Nr(m) { + return M(m) === A; } - function Wr(h) { - return M(h) === n; + function Wr(m) { + return M(m) === n; } - function Or(h) { - return M(h) === p; + function Or(m) { + return M(m) === h; } - function Br(h) { - return M(h) === l; + function Br(m) { + return M(m) === u; } - function qr(h) { - return M(h) === t; + function qr(m) { + return M(m) === t; } - function Xr(h) { - return M(h) === o; + function Xr(m) { + return M(m) === o; } - function Lr(h) { - return M(h) === i; + function Lr(m) { + return M(m) === i; } - function Gr(h) { - return M(h) === m; + function Gr(m) { + return M(m) === p; } - w.AsyncMode = d, w.ConcurrentMode = z, w.ContextConsumer = F, w.ContextProvider = Sr, w.Element = Er, w.ForwardRef = Ir, w.Fragment = vr, w.Lazy = xr, w.Memo = wr, w.Portal = Tr, w.Profiler = Zr, w.StrictMode = Fr, w.Suspense = Mr, w.isAsyncMode = Rr, w.isConcurrentMode = We, w.isContextConsumer = Dr, w.isContextProvider = zr, w.isElement = Yr, w.isForwardRef = Nr, w.isFragment = Wr, w.isLazy = Or, w.isMemo = Br, w.isPortal = qr, w.isProfiler = Xr, w.isStrictMode = Lr, w.isSuspense = Gr, w.isValidElementType = C, w.typeOf = M; - }()), w; + T.AsyncMode = d, T.ConcurrentMode = z, T.ContextConsumer = F, T.ContextProvider = Sr, T.Element = Er, T.ForwardRef = Ir, T.Fragment = vr, T.Lazy = xr, T.Memo = wr, T.Portal = Tr, T.Profiler = Zr, T.StrictMode = Fr, T.Suspense = Mr, T.isAsyncMode = Rr, T.isConcurrentMode = We, T.isContextConsumer = Dr, T.isContextProvider = zr, T.isElement = Yr, T.isForwardRef = Nr, T.isFragment = Wr, T.isLazy = Or, T.isMemo = Br, T.isPortal = qr, T.isProfiler = Xr, T.isStrictMode = Lr, T.isSuspense = Gr, T.isValidElementType = C, T.typeOf = M; + }()), T; } process.env.NODE_ENV === "production" ? ve.exports = Jt() : ve.exports = Ht(); var Qt = ve.exports, dr = Qt, jt = { @@ -1564,14 +1564,14 @@ function re(e, r, t) { } case "function": { if (e !== void 0) { - var u = P, c = t(e); - return P = u, re(e, r, c); + var l = P, c = t(e); + return P = l, re(e, r, c); } break; } } - var f = t; - return f; + var A = t; + return A; } function sn(e, r, t) { var n = ""; @@ -1585,8 +1585,8 @@ function sn(e, r, t) { var a = s; Pe(a) && (n += Ce(o) + ":" + Ve(o, a) + ";"); } else if (Array.isArray(s) && typeof s[0] == "string" && r == null) - for (var u = 0; u < s.length; u++) - Pe(s[u]) && (n += Ce(o) + ":" + Ve(o, s[u]) + ";"); + for (var l = 0; l < s.length; l++) + Pe(s[l]) && (n += Ce(o) + ":" + Ve(o, s[l]) + ";"); else { var c = re(e, r, s); switch (o) { @@ -1602,7 +1602,7 @@ function sn(e, r, t) { } return n; } -var ke = /label:\s*([^\s;{]+)\s*(;|$)/g, P; +var Ue = /label:\s*([^\s;{]+)\s*(;|$)/g, P; function pr(e, r, t) { if (e.length === 1 && typeof e[0] == "object" && e[0] !== null && e[0].styles !== void 0) return e[0]; @@ -1617,29 +1617,29 @@ function pr(e, r, t) { } for (var a = 1; a < e.length; a++) if (i += re(t, r, e[a]), n) { - var u = o; - i += u[a]; + var l = o; + i += l[a]; } - ke.lastIndex = 0; - for (var c = "", f; (f = ke.exec(i)) !== null; ) - c += "-" + f[1]; - var m = rn(i) + c; + Ue.lastIndex = 0; + for (var c = "", A; (A = Ue.exec(i)) !== null; ) + c += "-" + A[1]; + var p = rn(i) + c; return { - name: m, + name: p, styles: i, next: P }; } var an = function(r) { return r(); -}, gr = W.useInsertionEffect ? W.useInsertionEffect : !1, cn = gr || an, Ue = gr || W.useLayoutEffect, br = /* @__PURE__ */ W.createContext( +}, gr = W.useInsertionEffect ? W.useInsertionEffect : !1, cn = gr || an, ke = gr || W.useLayoutEffect, br = /* @__PURE__ */ W.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case // because this module is primarily intended for the browser and node // but it's also required in react native and similar environments sometimes // and we could have a special build just for that // but this is much easier and the native packages // might use a different theme context in the future anyway - typeof HTMLElement < "u" ? /* @__PURE__ */ Ut({ + typeof HTMLElement < "u" ? /* @__PURE__ */ kt({ key: "css" }) : null ); @@ -1666,14 +1666,14 @@ var Cr = function(r) { typeof e.className == "string" ? s = en(r.registered, o, e.className) : e.className != null && (s = e.className + " "); var a = pr(o, void 0, W.useContext(yr)); s += r.key + "-" + a.name; - var u = {}; + var l = {}; for (var c in e) - Ye.call(e, c) && c !== "css" && c !== xe && (u[c] = e[c]); - return u.className = s, t && (u.ref = t), /* @__PURE__ */ W.createElement(W.Fragment, null, /* @__PURE__ */ W.createElement(ln, { + Ye.call(e, c) && c !== "css" && c !== xe && (l[c] = e[c]); + return l.className = s, t && (l.ref = t), /* @__PURE__ */ W.createElement(W.Fragment, null, /* @__PURE__ */ W.createElement(ln, { cache: r, serialized: a, isStringTag: typeof i == "string" - }), /* @__PURE__ */ W.createElement(i, u)); + }), /* @__PURE__ */ W.createElement(i, l)); }), fn = dn, Je = function(r, t) { var n = arguments; if (t == null || !Ye.call(t, "css")) @@ -1690,25 +1690,25 @@ var Cr = function(r) { })(Je || (Je = {})); var An = /* @__PURE__ */ Cr(function(e, r) { var t = e.styles, n = pr([t], void 0, W.useContext(yr)), i = W.useRef(); - return Ue(function() { + return ke(function() { var o = r.key + "-global", s = new r.sheet.constructor({ key: o, nonce: r.sheet.nonce, container: r.sheet.container, speedy: r.sheet.isSpeedy - }), a = !1, u = document.querySelector('style[data-emotion="' + o + " " + n.name + '"]'); - return r.sheet.tags.length && (s.before = r.sheet.tags[0]), u !== null && (a = !0, u.setAttribute("data-emotion", o), s.hydrate([u])), i.current = [s, a], function() { + }), a = !1, l = document.querySelector('style[data-emotion="' + o + " " + n.name + '"]'); + return r.sheet.tags.length && (s.before = r.sheet.tags[0]), l !== null && (a = !0, l.setAttribute("data-emotion", o), s.hydrate([l])), i.current = [s, a], function() { s.flush(); }; - }, [r]), Ue(function() { + }, [r]), ke(function() { var o = i.current, s = o[0], a = o[1]; if (a) { o[1] = !1; return; } if (n.next !== void 0 && hr(r, n.next, !0), s.tags.length) { - var u = s.tags[s.tags.length - 1].nextElementSibling; - s.before = u, s.flush(); + var l = s.tags[s.tags.length - 1].nextElementSibling; + s.before = l, s.flush(); } r.insert("", n, s, !1); }, [r, n.name]), null; @@ -1751,48 +1751,55 @@ function Gn({ apiBaseUrl: r, keycloakClientId: t, permissionClientId: n, - loading: i = /* @__PURE__ */ g(Ur, {}), - updateChecker: o = !0, + loading: i = /* @__PURE__ */ g(kr, {}), + updateChecker: o = !1, updateCheckerProps: s, keycloakUrl: a = "https://auth.ibagher.ir", - keycloakRealm: u = "bi", - permissionUrl: c = "https://api.d.aiengines.ir/user_api/v1/permissions/list" + keycloakRealm: l = "bi", + permissionUrl: c = "https://api.d.aiengines.ir/user_api/v1/permissions/list", + keycloakEnabled: A, + permissionEnabled: p }) { - const [f, m] = N(!1), S = le( + const [E, u] = N(!1), h = A ?? !!t, f = p ?? !!n, b = le( () => ({ api: { - baseUrl: r + baseUrl: r || "" }, - keycloak: { + keycloak: h ? { url: a, - realm: u, + realm: l, clientId: t - }, - permission: { + } : null, + permission: f ? { url: c, clientId: n - } + } : null }), [ r, - t, - n, + h, + f, a, - u, - c + l, + t, + c, + n ] ); - return B(() => { - m(!0); + if (B(() => { + u(!0); }, []), B(() => { - f && ht(S); - }, [f, S]), f ? /* @__PURE__ */ L(kr, { theme: mn, children: [ + E && ht(b); + }, [E, b]), !E) + return null; + let S = e; + return f && (S = /* @__PURE__ */ g(st, { config: b.permission, loading: i, children: S })), h && (S = /* @__PURE__ */ g(it, { config: b.keycloak, loading: i, children: S })), /* @__PURE__ */ L(Ur, { theme: mn, children: [ /* @__PURE__ */ g(pn, {}), /* @__PURE__ */ L(_r, { client: gt, children: [ o && /* @__PURE__ */ g(pt, { ...s }), - /* @__PURE__ */ g(it, { config: S.keycloak, loading: i, children: /* @__PURE__ */ g(st, { config: S.permission, loading: i, children: e }) }) + S ] }) - ] }) : null; + ] }); } const gn = "data:image/webp;base64,UklGRpwQAABXRUJQVlA4WAoAAAAcAAAAKQAAOwAAQUxQSFQEAAABoHbb2rG3HtB6FdS2bQ03qW3btm3btm3btm3bbnCyP9xP3jd9T0RMABHsSorXZsvtPb3Se41jZVyvSXXa32uqP/Xxmq7fo3jNACXzmn4q7jUdNdRryuuG3bAbztgR4R9evC9hBQ2Gzk0EgVE9i5U1PLZpndFDup+IkgU9K5LDjSr6kwGqSVIu8rXwbEAaN3wfajUkGPxHo6DAYI+c2xO4QVuFBAC1xgGVZ3mU8HYcd/we6DAwbFs26LnIoxxfkrhDM6kcfaRPmdky1qOCyuWW7y3tKiVJAT6fWnqUXy3dor7CKtT5oOE0VGGPMmu9e77XtIjCw3FeDUrkUZyfH2K4RW29iwE00GE8tl1Qs3Di1BrQIZ7rhvJAjEfq5obdiv46Z7do8ELSYfqrLMzW3zRuOCd3SGik+auaRh2Z3xwVVJry0lpMu0FX/ZqRAtigm/4Q/YvFTWorTYznCs5lEdMi9efDwX/aQb7/1AWyL2nc7oHUN9G1R6yVZgE2GzEsIt9Ll3SqxsNSfUiMDVgkbXuunk2kuzEMO1EtYj5MC4U/NyXlZ21wAY1/SNLDZj/1KwvW0Szy3/IBcp2IwhDp7Ojhh2W+bPBA6tRlXhqL2BZjV2G2CCRDkMIN2lTguDRzqnQvlhHPcN0raZEoN7bL4XzJyRppZxdJam9kNMrdcVpgh1nhDGeadDXba2M94FvJ2DEYM3ZMoIPVadpIb1MMk3kQKNIESPwogRHw9k03GBYSJIUuj1w8WF/zscFiI7AwIzBwBeZiSU0jvVmWvWfnnKT8qOBKkPzg3VVPNBoqbQVs50pYnJb06oCKA/ickZpjOqmgokS/XwzIdtvfcNyQecJpTJBGYp1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gICAgICAgPHBob3Rvc2hvcDpEb2N1bWVudEFuY2VzdG9ycz4KICAgICAgICAgICAgPHJkZjpCYWc+CiAgICAgICAgICAgICAgIDxyZGY6bGk+YWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOmEwYjgxNWMzLTkzYjMtODU0MC04NmY0LTA0OTEyZTY5Y2Y4NTwvcmRmOmxpPgogICAgICAgICAgICA8L3JkZjpCYWc+CiAgICAgICAgIDwvcGhvdG9zaG9wOkRvY3VtZW50QW5jZXN0b3JzPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4K"; function bn({ children: e, ...r }) { @@ -1891,7 +1898,7 @@ export { er as logoutKeycloak, nr as permissionKeys, ct as setCachedPermissions, - U as toEnDigits, + k as toEnDigits, Z as toFaDigits, Dn as toFaNumber, Be as updateKeycloakToken, diff --git a/src/provider/BiProvider.jsx b/src/provider/BiProvider.jsx index 8ab1271..abc4738 100644 --- a/src/provider/BiProvider.jsx +++ b/src/provider/BiProvider.jsx @@ -10,40 +10,59 @@ import { Fonts, theme } from "../core/style.jsx"; export function BiProvider({ children, + apiBaseUrl, + keycloakClientId, permissionClientId, + loading = , - updateChecker = true, + + updateChecker = false, updateCheckerProps, + keycloakUrl = "https://auth.ibagher.ir", keycloakRealm = "bi", permissionUrl = "https://api.d.aiengines.ir/user_api/v1/permissions/list", + + keycloakEnabled, + permissionEnabled, }) { const [mounted, setMounted] = useState(false); + const shouldUseKeycloak = keycloakEnabled ?? Boolean(keycloakClientId); + const shouldUsePermission = permissionEnabled ?? Boolean(permissionClientId); + const config = useMemo( () => ({ api: { - baseUrl: apiBaseUrl, - }, - keycloak: { - url: keycloakUrl, - realm: keycloakRealm, - clientId: keycloakClientId, - }, - permission: { - url: permissionUrl, - clientId: permissionClientId, + baseUrl: apiBaseUrl || "", }, + + keycloak: shouldUseKeycloak + ? { + url: keycloakUrl, + realm: keycloakRealm, + clientId: keycloakClientId, + } + : null, + + permission: shouldUsePermission + ? { + url: permissionUrl, + clientId: permissionClientId, + } + : null, }), [ apiBaseUrl, - keycloakClientId, - permissionClientId, + shouldUseKeycloak, + shouldUsePermission, keycloakUrl, keycloakRealm, + keycloakClientId, permissionUrl, + permissionClientId, ], ); @@ -61,16 +80,32 @@ export function BiProvider({ return null; } + let content = children; + + if (shouldUsePermission) { + content = ( + + {content} + + ); + } + + if (shouldUseKeycloak) { + content = ( + + {content} + + ); + } + return ( + {updateChecker && } - - - {children} - - + + {content} );