UNPKG

mirador

Version:

An open-source, web-based 'multi-up' viewer that supports zoom-pan-rotate functionality, ability to display/compare simple images, and images with annotations.

1,427 lines (1,425 loc) 2.09 MB
import { jsx as y, jsxs as B, Fragment as st } from "react/jsx-runtime"; import { createRoot as JF } from "react-dom/client"; import * as re from "react"; import V, { createContext as Li, forwardRef as Bc, useContext as zt, useMemo as vt, memo as jc, useState as Ze, useImperativeHandle as MO, useEffect as je, createElement as wr, useLayoutEffect as Ms, useRef as ke, useCallback as Ye, PureComponent as My, cloneElement as jo, Children as kO, createRef as ky, isValidElement as LO, useId as Ut, Suspense as Ly, lazy as Wi, Component as ez, Fragment as OT, useReducer as tz } from "react"; import _r from "@mui/material/Paper"; import { useTranslation as Se, initReactI18next as nz, I18nextProvider as rz } from "react-i18next"; import { useTranslation as fve, withTranslation as pve } from "react-i18next"; import { styled as ce, useThemeProps as iz, alpha as Qr, StyledEngineProvider as oz, ThemeProvider as az, createTheme as sz, useTheme as lz, lighten as cz, darken as uz } from "@mui/material/styles"; import xe from "@mui/material/Typography"; import { createSvgIcon as Be } from "@mui/material/utils"; import Zl from "@mui/material/Badge"; import Wy from "@mui/material/IconButton"; import wi from "@mui/material/Tooltip"; import Hc from "@mui/material/Chip"; import ks from "@mui/material/MenuList"; import wn from "@mui/material/MenuItem"; import Ri from "@mui/material/ListItemText"; import Ls from "@mui/material/Toolbar"; import Vc, { flushSync as Uc } from "react-dom"; import Fy from "@mui/material/Accordion"; import zy from "@mui/material/AccordionDetails"; import By from "@mui/material/AccordionSummary"; import dz from "@mui/material/InputLabel"; import WO from "@mui/material/FormControl"; import FO from "@mui/material/Select"; import Qt from "@mui/material/Button"; import No from "@mui/material/Link"; import zO from "@mui/material/Tabs"; import Yl from "@mui/material/Tab"; import { useRtl as hz } from "@mui/system/RtlProvider"; import BO from "@mui/material/Collapse"; import { shouldForwardProp as jO } from "@mui/system/createStyled"; import fz from "@mui/material/Checkbox"; import { shouldForwardProp as pz } from "@mui/system"; import pn from "@mui/material/Skeleton"; import gz from "@mui/material/Autocomplete"; import mz from "@mui/material/CircularProgress"; import HO from "@mui/material/TextField"; import VO from "@mui/material/InputAdornment"; import qc from "@mui/material/List"; import jy from "@mui/material/ListItem"; import UO from "@mui/material/ListItemButton"; import vz from "@mui/material/Input"; import yz from "@mui/material/Slider"; import Ho from "@mui/material/ListItemIcon"; import { CacheProvider as bz } from "@emotion/react"; import pr from "@mui/material/SvgIcon"; import Hy from "@mui/material/DialogContent"; import Gc from "@mui/material/Menu"; import qO from "@mui/material/DialogActions"; import Kc from "@mui/material/DialogTitle"; import wz from "@mui/material/Snackbar"; import { Dialog as Vy, DialogTitle as Uy, Typography as yi, Button as PT, Link as _z, Chip as AT, MenuList as vc, MenuItem as us, DialogActions as qy, DialogContent as Tz, ListItemIcon as Ez, ListItemText as Sz, DialogContentText as Cz, Card as DT, CardContent as NT, TextField as xz } from "@mui/material"; import $c from "@mui/material/AppBar"; import Zc from "@mui/material/ListSubheader"; import Rz from "@mui/material/Popover"; import Xl from "@mui/material/FormControlLabel"; import GO from "@mui/material/Drawer"; import Iz from "@mui/material/Slide"; import Yc from "@mui/material/Stack"; import Oz from "@mui/material/Alert"; import Pz from "@mui/material/Dialog"; import Dt from "@mui/material/Grid"; import Az from "@mui/material/ButtonBase"; import Dz from "@mui/material/Box"; import Nz from "@mui/material/Divider"; import Mz from "@mui/material/GlobalStyles"; import kz from "@mui/material/Backdrop"; import { grey as Lz } from "@mui/material/colors"; import KO from "@mui/material/Fab"; import Wz from "@mui/material/useMediaQuery"; var Sl = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function ot(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } function Fz(e) { if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e; var t = e.default; if (typeof t == "function") { var n = function r() { var i = !1; try { i = this instanceof r; } catch { } return i ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments); }; n.prototype = t.prototype; } else n = {}; return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) { var i = Object.getOwnPropertyDescriptor(e, r); Object.defineProperty(n, r, i.get ? i : { enumerable: !0, get: function() { return e[r]; } }); }), n; } var Cl = { exports: {} }, Od = {}; var MT; function zz() { if (MT) return Od; MT = 1; var e = V; function t(l, c) { return l === c && (l !== 0 || 1 / l === 1 / c) || l !== l && c !== c; } var n = typeof Object.is == "function" ? Object.is : t, r = e.useSyncExternalStore, i = e.useRef, o = e.useEffect, a = e.useMemo, s = e.useDebugValue; return Od.useSyncExternalStoreWithSelector = function(l, c, u, d, h) { var f = i(null); if (f.current === null) { var p = { hasValue: !1, value: null }; f.current = p; } else p = f.current; f = a( function() { function v(E) { if (!b) { if (b = !0, w = E, E = d(E), h !== void 0 && p.hasValue) { var C = p.value; if (h(C, E)) return T = C; } return T = E; } if (C = T, n(w, E)) return C; var I = d(E); return h !== void 0 && h(C, I) ? (w = E, C) : (w = E, T = I); } var b = !1, w, T, S = u === void 0 ? null : u; return [ function() { return v(c()); }, S === null ? void 0 : function() { return v(S()); } ]; }, [c, u, d, h] ); var g = r(l, f[0], f[1]); return o( function() { p.hasValue = !0, p.value = g; }, [g] ), s(g), g; }, Od; } var Pd = {}, kT; function Bz() { if (kT) return Pd; kT = 1; var e = {}; return e.NODE_ENV !== "production" && (function() { function t(c, u) { return c === u && (c !== 0 || 1 / c === 1 / u) || c !== c && u !== u; } typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var n = V, r = typeof Object.is == "function" ? Object.is : t, i = n.useSyncExternalStore, o = n.useRef, a = n.useEffect, s = n.useMemo, l = n.useDebugValue; Pd.useSyncExternalStoreWithSelector = function(c, u, d, h, f) { var p = o(null); if (p.current === null) { var g = { hasValue: !1, value: null }; p.current = g; } else g = p.current; p = s( function() { function b(C) { if (!w) { if (w = !0, T = C, C = h(C), f !== void 0 && g.hasValue) { var I = g.value; if (f(I, C)) return S = I; } return S = C; } if (I = S, r(T, C)) return I; var O = h(C); return f !== void 0 && f(I, O) ? (T = C, I) : (T = C, S = O); } var w = !1, T, S, E = d === void 0 ? null : d; return [ function() { return b(u()); }, E === null ? void 0 : function() { return b(E()); } ]; }, [u, d, h, f] ); var v = i(c, p[0], p[1]); return a( function() { g.hasValue = !0, g.value = v; }, [v] ), l(v), v; }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(), Pd; } var LT; function jz() { if (LT) return Cl.exports; LT = 1; var e = {}; return e.NODE_ENV === "production" ? Cl.exports = zz() : Cl.exports = Bz(), Cl.exports; } var Hz = jz(), ir = {}, $O = /* @__PURE__ */ re.version.startsWith("19"), Vz = /* @__PURE__ */ Symbol.for( $O ? "react.transitional.element" : "react.element" ), Uz = /* @__PURE__ */ Symbol.for("react.portal"), ZO = /* @__PURE__ */ Symbol.for("react.fragment"), YO = /* @__PURE__ */ Symbol.for("react.strict_mode"), XO = /* @__PURE__ */ Symbol.for("react.profiler"), Gy = /* @__PURE__ */ Symbol.for("react.consumer"), Ky = /* @__PURE__ */ Symbol.for("react.context"), $y = /* @__PURE__ */ Symbol.for("react.forward_ref"), QO = /* @__PURE__ */ Symbol.for("react.suspense"), JO = /* @__PURE__ */ Symbol.for( "react.suspense_list" ), Xc = /* @__PURE__ */ Symbol.for("react.memo"), eP = /* @__PURE__ */ Symbol.for("react.lazy"), qz = /* @__PURE__ */ Symbol.for("react.offscreen"), Gz = /* @__PURE__ */ Symbol.for( "react.client.reference" ), Kz = $y, $z = Xc; function Zz(e) { return typeof e == "string" || typeof e == "function" || e === ZO || e === XO || e === YO || e === QO || e === JO || e === qz || typeof e == "object" && e !== null && (e.$$typeof === eP || e.$$typeof === Xc || e.$$typeof === Ky || e.$$typeof === Gy || e.$$typeof === $y || e.$$typeof === Gz || e.getModuleId !== void 0); } function Fv(e) { if (typeof e == "object" && e !== null) { const { $$typeof: t } = e; switch (t) { case Vz: switch (e = e.type, e) { case ZO: case XO: case YO: case QO: case JO: return e; default: switch (e = e && e.$$typeof, e) { case Ky: case $y: case eP: case Xc: return e; case Gy: return e; default: return t; } } case Uz: return t; } } } function Yz(e) { return $O ? Fv(e) === Gy : Fv(e) === Ky; } function Xz(e) { return Fv(e) === Xc; } function Zy(e) { typeof console < "u" && typeof console.error == "function" && console.error(e); try { throw new Error(e); } catch { } } function Ad(e, t) { if (e) (t === "mapStateToProps" || t === "mapDispatchToProps") && (Object.prototype.hasOwnProperty.call(e, "dependsOnOwnProps") || Zy( `The selector for ${t} of connect did not specify a value for dependsOnOwnProps.` )); else throw new Error(`Unexpected value for ${t} in connect.`); } function Qz(e, t, n) { Ad(e, "mapStateToProps"), Ad(t, "mapDispatchToProps"), Ad(n, "mergeProps"); } function Jz(e, t, n, r, { areStatesEqual: i, areOwnPropsEqual: o, areStatePropsEqual: a }) { let s = !1, l, c, u, d, h; function f(w, T) { return l = w, c = T, u = e(l, c), d = t(r, c), h = n(u, d, c), s = !0, h; } function p() { return u = e(l, c), t.dependsOnOwnProps && (d = t(r, c)), h = n(u, d, c), h; } function g() { return e.dependsOnOwnProps && (u = e(l, c)), t.dependsOnOwnProps && (d = t(r, c)), h = n(u, d, c), h; } function v() { const w = e(l, c), T = !a(w, u); return u = w, T && (h = n(u, d, c)), h; } function b(w, T) { const S = !o(T, c), E = !i( w, l, T, c ); return l = w, c = T, S && E ? p() : S ? g() : E ? v() : h; } return function(T, S) { return s ? b(T, S) : f(T, S); }; } function eB(e, { initMapStateToProps: t, initMapDispatchToProps: n, initMergeProps: r, ...i }) { const o = t(e, i), a = n(e, i), s = r(e, i); return ir.NODE_ENV !== "production" && Qz(o, a, s), Jz(o, a, s, e, i); } function tB(e, t) { const n = {}; for (const r in e) { const i = e[r]; typeof i == "function" && (n[r] = (...o) => t(i(...o))); } return n; } function nB(e) { if (typeof e != "object" || e === null) return !1; const t = Object.getPrototypeOf(e); if (t === null) return !0; let n = t; for (; Object.getPrototypeOf(n) !== null; ) n = Object.getPrototypeOf(n); return t === n; } function tP(e, t, n) { nB(e) || Zy( `${n}() in ${t} must return a plain object. Instead received ${e}.` ); } function zv(e) { return function(n) { const r = e(n); function i() { return r; } return i.dependsOnOwnProps = !1, i; }; } function WT(e) { return e.dependsOnOwnProps ? !!e.dependsOnOwnProps : e.length !== 1; } function nP(e, t) { return function(r, { displayName: i }) { const o = function(s, l) { return o.dependsOnOwnProps ? o.mapToProps(s, l) : o.mapToProps(s, void 0); }; return o.dependsOnOwnProps = !0, o.mapToProps = function(s, l) { o.mapToProps = e, o.dependsOnOwnProps = WT(e); let c = o(s, l); return typeof c == "function" && (o.mapToProps = c, o.dependsOnOwnProps = WT(c), c = o(s, l)), ir.NODE_ENV !== "production" && tP(c, i, t), c; }, o; }; } function Yy(e, t) { return (n, r) => { throw new Error( `Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.` ); }; } function rB(e) { return e && typeof e == "object" ? zv( (t) => ( // @ts-ignore tB(e, t) ) ) : e ? typeof e == "function" ? ( // @ts-ignore nP(e, "mapDispatchToProps") ) : Yy(e, "mapDispatchToProps") : zv((t) => ({ dispatch: t })); } function iB(e) { return e ? typeof e == "function" ? ( // @ts-ignore nP(e, "mapStateToProps") ) : Yy(e, "mapStateToProps") : zv(() => ({})); } function oB(e, t, n) { return { ...n, ...e, ...t }; } function aB(e) { return function(n, { displayName: r, areMergedPropsEqual: i }) { let o = !1, a; return function(l, c, u) { const d = e(l, c, u); return o ? i(d, a) || (a = d) : (o = !0, a = d, ir.NODE_ENV !== "production" && tP(a, r, "mergeProps")), a; }; }; } function sB(e) { return e ? typeof e == "function" ? aB(e) : Yy(e, "mergeProps") : () => oB; } function lB(e) { e(); } function cB() { let e = null, t = null; return { clear() { e = null, t = null; }, notify() { lB(() => { let n = e; for (; n; ) n.callback(), n = n.next; }); }, get() { const n = []; let r = e; for (; r; ) n.push(r), r = r.next; return n; }, subscribe(n) { let r = !0; const i = t = { callback: n, next: null, prev: t }; return i.prev ? i.prev.next = i : e = i, function() { !r || e === null || (r = !1, i.next ? i.next.prev = i.prev : t = i.prev, i.prev ? i.prev.next = i.next : e = i.next); }; } }; } var FT = { notify() { }, get: () => [] }; function rP(e, t) { let n, r = FT, i = 0, o = !1; function a(g) { u(); const v = r.subscribe(g); let b = !1; return () => { b || (b = !0, v(), d()); }; } function s() { r.notify(); } function l() { p.onStateChange && p.onStateChange(); } function c() { return o; } function u() { i++, n || (n = t ? t.addNestedSub(l) : e.subscribe(l), r = cB()); } function d() { i--, n && i === 0 && (n(), n = void 0, r.clear(), r = FT); } function h() { o || (o = !0, u()); } function f() { o && (o = !1, d()); } const p = { addNestedSub: a, notifyNestedSubs: s, handleChangeWrapper: l, isSubscribed: c, trySubscribe: h, tryUnsubscribe: f, getListeners: () => r }; return p; } var uB = () => typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", dB = /* @__PURE__ */ uB(), hB = () => typeof navigator < "u" && navigator.product === "ReactNative", fB = /* @__PURE__ */ hB(), pB = () => dB || fB ? re.useLayoutEffect : re.useEffect, yc = /* @__PURE__ */ pB(); function zT(e, t) { return e === t ? e !== 0 || t !== 0 || 1 / e === 1 / t : e !== e && t !== t; } function Dd(e, t) { if (zT(e, t)) return !0; if (typeof e != "object" || e === null || typeof t != "object" || t === null) return !1; const n = Object.keys(e), r = Object.keys(t); if (n.length !== r.length) return !1; for (let i = 0; i < n.length; i++) if (!Object.prototype.hasOwnProperty.call(t, n[i]) || !zT(e[n[i]], t[n[i]])) return !1; return !0; } var gB = { childContextTypes: !0, contextType: !0, contextTypes: !0, defaultProps: !0, displayName: !0, getDefaultProps: !0, getDerivedStateFromError: !0, getDerivedStateFromProps: !0, mixins: !0, propTypes: !0, type: !0 }, mB = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 }, vB = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, iP = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, yB = { [Kz]: vB, [$z]: iP }; function BT(e) { return Xz(e) ? iP : yB[e.$$typeof] || gB; } var bB = Object.defineProperty, wB = Object.getOwnPropertyNames, jT = Object.getOwnPropertySymbols, _B = Object.getOwnPropertyDescriptor, TB = Object.getPrototypeOf, HT = Object.prototype; function Bv(e, t) { if (typeof t != "string") { if (HT) { const o = TB(t); o && o !== HT && Bv(e, o); } let n = wB(t); jT && (n = n.concat(jT(t))); const r = BT(e), i = BT(t); for (let o = 0; o < n.length; ++o) { const a = n[o]; if (!mB[a] && !(i && i[a]) && !(r && r[a])) { const s = _B(t, a); try { bB(e, a, s); } catch { } } } } return e; } var EB = /* @__PURE__ */ Symbol.for("react-redux-context"), SB = typeof globalThis < "u" ? globalThis : ( /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */ {} ); function CB() { if (!re.createContext) return {}; const e = SB[EB] ??= /* @__PURE__ */ new Map(); let t = e.get(re.createContext); return t || (t = re.createContext( null ), ir.NODE_ENV !== "production" && (t.displayName = "ReactRedux"), e.set(re.createContext, t)), t; } var ds = /* @__PURE__ */ CB(), xB = [null, null], RB = (e) => { try { return JSON.stringify(e); } catch { return String(e); } }; function IB(e, t, n) { yc(() => e(...t), n); } function OB(e, t, n, r, i, o) { e.current = r, n.current = !1, i.current && (i.current = null, o()); } function PB(e, t, n, r, i, o, a, s, l, c, u) { if (!e) return () => { }; let d = !1, h = null; const f = () => { if (d || !s.current) return; const g = t.getState(); let v, b; try { v = r( g, i.current ); } catch (w) { b = w, h = w; } b || (h = null), v === o.current ? a.current || c() : (o.current = v, l.current = v, a.current = !0, u()); }; return n.onStateChange = f, n.trySubscribe(), f(), () => { if (d = !0, n.tryUnsubscribe(), n.onStateChange = null, h) throw h; }; } function AB(e, t) { return e === t; } var VT = !1; function DB(e, t, n, { // The `pure` option has been removed, so TS doesn't like us destructuring this to check its existence. // @ts-ignore pure: r, areStatesEqual: i = AB, areOwnPropsEqual: o = Dd, areStatePropsEqual: a = Dd, areMergedPropsEqual: s = Dd, // use React's forwardRef to expose a ref of the wrapped component forwardRef: l = !1, // the context consumer to use context: c = ds } = {}) { ir.NODE_ENV !== "production" && r !== void 0 && !VT && (VT = !0, Zy( 'The `pure` option has been removed. `connect` is now always a "pure/memoized" component' )); const u = c, d = iB(e), h = rB(t), f = sB(n), p = !!e; return (v) => { if (ir.NODE_ENV !== "production" && !/* @__PURE__ */ Zz(v)) throw new Error( `You must pass a component to the function returned by connect. Instead received ${RB( v )}` ); const b = v.displayName || v.name || "Component", w = `Connect(${b})`, T = { shouldHandleStateChanges: p, displayName: w, wrappedComponentName: b, WrappedComponent: v, // @ts-ignore initMapStateToProps: d, initMapDispatchToProps: h, initMergeProps: f, areStatesEqual: i, areStatePropsEqual: a, areOwnPropsEqual: o, areMergedPropsEqual: s }; function S(I) { const [O, A, N] = re.useMemo(() => { const { reactReduxForwardedRef: $e, ...J } = I; return [I.context, $e, J]; }, [I]), L = re.useMemo(() => { let $e = u; if (O?.Consumer && ir.NODE_ENV !== "production") { if (!/* @__PURE__ */ Yz( // @ts-ignore /* @__PURE__ */ re.createElement(O.Consumer, null) )) throw new Error( "You must pass a valid React context consumer as `props.context`" ); $e = O; } return $e; }, [O, u]), W = re.useContext(L), H = !!I.store && !!I.store.getState && !!I.store.dispatch, G = !!W && !!W.store; if (ir.NODE_ENV !== "production" && !H && !G) throw new Error( `Could not find "store" in the context of "${w}". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${w} in connect options.` ); const ie = H ? I.store : W.store, Z = G ? W.getServerState : ie.getState, oe = re.useMemo(() => eB(ie.dispatch, T), [ie]), [se, Re] = re.useMemo(() => { if (!p) return xB; const $e = rP( ie, H ? void 0 : W.subscription ), J = $e.notifyNestedSubs.bind($e); return [$e, J]; }, [ie, H, W]), be = re.useMemo(() => H ? W : { ...W, subscription: se }, [H, W, se]), U = re.useRef(void 0), le = re.useRef(N), ne = re.useRef(void 0), pe = re.useRef(!1), we = re.useRef(!1), Ce = re.useRef( void 0 ); yc(() => (we.current = !0, () => { we.current = !1; }), []); const Te = re.useMemo(() => () => ne.current && N === le.current ? ne.current : oe(ie.getState(), N), [ie, N]), _e = re.useMemo(() => (J) => se ? PB( p, ie, se, // @ts-ignore oe, le, U, pe, we, ne, Re, J ) : () => { }, [se]); IB(OB, [ le, U, pe, N, ne, Re ]); let ze; try { ze = re.useSyncExternalStore( // TODO We're passing through a big wrapper that does a bunch of extra side effects besides subscribing _e, // TODO This is incredibly hacky. We've already processed the store update and calculated new child props, // TODO and we're just passing that through so it triggers a re-render for us rather than relying on `uSES`. Te, Z ? () => oe(Z(), N) : Te ); } catch ($e) { throw Ce.current && ($e.message += ` The error may be correlated with this previous error: ${Ce.current.stack} `), $e; } yc(() => { Ce.current = void 0, ne.current = void 0, U.current = ze; }); const He = re.useMemo(() => ( // @ts-ignore /* @__PURE__ */ re.createElement( v, { ...ze, ref: A } ) ), [A, v, ze]); return re.useMemo(() => p ? /* @__PURE__ */ re.createElement(L.Provider, { value: be }, He) : He, [L, He, be]); } const C = re.memo(S); if (C.WrappedComponent = v, C.displayName = S.displayName = w, l) { const O = re.forwardRef( function(N, L) { return /* @__PURE__ */ re.createElement(C, { ...N, reactReduxForwardedRef: L }); } ); return O.displayName = w, O.WrappedComponent = v, /* @__PURE__ */ Bv(O, v); } return /* @__PURE__ */ Bv(C, v); }; } var ye = DB; function NB(e) { const { children: t, context: n, serverState: r, store: i } = e, o = re.useMemo(() => { const l = rP(i), c = { store: i, subscription: l, getServerState: r ? () => r : void 0 }; if (ir.NODE_ENV === "production") return c; { const { identityFunctionCheck: u = "once", stabilityCheck: d = "once" } = e; return /* @__PURE__ */ Object.assign(c, { stabilityCheck: d, identityFunctionCheck: u }); } }, [i, r]), a = re.useMemo(() => i.getState(), [i]); yc(() => { const { subscription: l } = o; return l.onStateChange = l.notifyNestedSubs, l.trySubscribe(), a !== i.getState() && l.notifyNestedSubs(), () => { l.tryUnsubscribe(), l.onStateChange = void 0; }; }, [o, a]); const s = n || ds; return /* @__PURE__ */ re.createElement(s.Provider, { value: o }, t); } var oP = NB; function aP(e = ds) { return function() { const n = re.useContext(e); if (ir.NODE_ENV !== "production" && !n) throw new Error( "could not find react-redux context value; please ensure the component is wrapped in a <Provider>" ); return n; }; } var MB = /* @__PURE__ */ aP(), kB = (e, t) => e === t; function LB(e = ds) { const t = e === ds ? MB : aP(e), n = (r, i = {}) => { const { equalityFn: o = kB } = typeof i == "function" ? { equalityFn: i } : i; if (ir.NODE_ENV !== "production") { if (!r) throw new Error("You must pass a selector to useSelector"); if (typeof r != "function") throw new Error("You must pass a function as a selector to useSelector"); if (typeof o != "function") throw new Error( "You must pass a function as an equality function to useSelector" ); } const a = t(), { store: s, subscription: l, getServerState: c } = a, u = re.useRef(!0), d = re.useCallback( { [r.name](f) { const p = r(f); if (ir.NODE_ENV !== "production") { const { devModeChecks: g = {} } = typeof i == "function" ? {} : i, { identityFunctionCheck: v, stabilityCheck: b } = a, { identityFunctionCheck: w, stabilityCheck: T } = { stabilityCheck: b, identityFunctionCheck: v, ...g }; if (T === "always" || T === "once" && u.current) { const S = r(f); if (!o(p, S)) { let E; try { throw new Error(); } catch (C) { ({ stack: E } = C); } console.warn( "Selector " + (r.name || "unknown") + ` returned a different result when called with the same parameters. This can lead to unnecessary rerenders. Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`, { state: f, selected: p, selected2: S, stack: E } ); } } if ((w === "always" || w === "once" && u.current) && p === f) { let S; try { throw new Error(); } catch (E) { ({ stack: S } = E); } console.warn( "Selector " + (r.name || "unknown") + ` returned the root state when called. This can lead to unnecessary rerenders. Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`, { stack: S } ); } u.current && (u.current = !1); } return p; } }[r.name], [r] ), h = Hz.useSyncExternalStoreWithSelector( l.addNestedSub, s.getState, c || s.getState, d, o ); return re.useDebugValue(h), h; }; return Object.assign(n, { withTypes: () => n }), n; } var Ws = /* @__PURE__ */ LB(), xl = { exports: {} }, Rl = { exports: {} }, yt = {}; var UT; function WB() { if (UT) return yt; UT = 1; var e = typeof Symbol == "function" && Symbol.for, t = e ? /* @__PURE__ */ Symbol.for("react.element") : 60103, n = e ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, r = e ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, i = e ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, o = e ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, a = e ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, s = e ? /* @__PURE__ */ Symbol.for("react.context") : 60110, l = e ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, c = e ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, u = e ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, d = e ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, h = e ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, f = e ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, p = e ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, g = e ? /* @__PURE__ */ Symbol.for("react.block") : 60121, v = e ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, b = e ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, w = e ? /* @__PURE__ */ Symbol.for("react.scope") : 60119; function T(E) { if (typeof E == "object" && E !== null) { var C = E.$$typeof; switch (C) { case t: switch (E = E.type, E) { case l: case c: case r: case o: case i: case d: return E; default: switch (E = E && E.$$typeof, E) { case s: case u: case p: case f: case a: return E; default: return C; } } case n: return C; } } } function S(E) { return T(E) === c; } return yt.AsyncMode = l, yt.ConcurrentMode = c, yt.ContextConsumer = s, yt.ContextProvider = a, yt.Element = t, yt.ForwardRef = u, yt.Fragment = r, yt.Lazy = p, yt.Memo = f, yt.Portal = n, yt.Profiler = o, yt.StrictMode = i, yt.Suspense = d, yt.isAsyncMode = function(E) { return S(E) || T(E) === l; }, yt.isConcurrentMode = S, yt.isContextConsumer = function(E) { return T(E) === s; }, yt.isContextProvider = function(E) { return T(E) === a; }, yt.isElement = function(E) { return typeof E == "object" && E !== null && E.$$typeof === t; }, yt.isForwardRef = function(E) { return T(E) === u; }, yt.isFragment = function(E) { return T(E) === r; }, yt.isLazy = function(E) { return T(E) === p; }, yt.isMemo = function(E) { return T(E) === f; }, yt.isPortal = function(E) { return T(E) === n; }, yt.isProfiler = function(E) { return T(E) === o; }, yt.isStrictMode = function(E) { return T(E) === i; }, yt.isSuspense = function(E) { return T(E) === d; }, yt.isValidElementType = function(E) { return typeof E == "string" || typeof E == "function" || E === r || E === c || E === o || E === i || E === d || E === h || typeof E == "object" && E !== null && (E.$$typeof === p || E.$$typeof === f || E.$$typeof === a || E.$$typeof === s || E.$$typeof === u || E.$$typeof === v || E.$$typeof === b || E.$$typeof === w || E.$$typeof === g); }, yt.typeOf = T, yt; } var bt = {}, qT; function FB() { if (qT) return bt; qT = 1; var e = {}; return e.NODE_ENV !== "production" && (function() { var t = typeof Symbol == "function" && Symbol.for, n = t ? /* @__PURE__ */ Symbol.for("react.element") : 60103, r = t ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, i = t ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, o = t ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, a = t ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, s = t ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, l = t ? /* @__PURE__ */ Symbol.for("react.context") : 60110, c = t ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, u = t ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, d = t ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, h = t ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, f = t ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, p = t ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, g = t ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, v = t ? /* @__PURE__ */ Symbol.for("react.block") : 60121, b = t ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, w = t ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, T = t ? /* @__PURE__ */ Symbol.for("react.scope") : 60119; function S(J) { return typeof J == "string" || typeof J == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. J === i || J === u || J === a || J === o || J === h || J === f || typeof J == "object" && J !== null && (J.$$typeof === g || J.$$typeof === p || J.$$typeof === s || J.$$typeof === l || J.$$typeof === d || J.$$typeof === b || J.$$typeof === w || J.$$typeof === T || J.$$typeof === v); } function E(J) { if (typeof J == "object" && J !== null) { var _t = J.$$typeof; switch (_t) { case n: var te = J.type; switch (te) { case c: case u: case i: case a: case o: case h: return te; default: var ue = te && te.$$typeof; switch (ue) { case l: case d: case g: case p: case s: return ue; default: return _t; } } case r: return _t; } } } var C = c, I = u, O = l, A = s, N = n, L = d, W = i, H = g, G = p, ie = r, Z = a, oe = o, se = h, Re = !1; function be(J) { return Re || (Re = !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.")), U(J) || E(J) === c; } function U(J) { return E(J) === u; } function le(J) { return E(J) === l; } function ne(J) { return E(J) === s; } function pe(J) { return typeof J == "object" && J !== null && J.$$typeof === n; } function we(J) { return E(J) === d; } function Ce(J) { return E(J) === i; } function Te(J) { return E(J) === g; } function _e(J) { return E(J) === p; } function ze(J) { return E(J) === r; } function He(J) { return E(J) === a; } function Ee(J) { return E(J) === o; } function $e(J) { return E(J) === h; } bt.AsyncMode = C, bt.ConcurrentMode = I, bt.ContextConsumer = O, bt.ContextProvider = A, bt.Element = N, bt.ForwardRef = L, bt.Fragment = W, bt.Lazy = H, bt.Memo = G, bt.Portal = ie, bt.Profiler = Z, bt.StrictMode = oe, bt.Suspense = se, bt.isAsyncMode = be, bt.isConcurrentMode = U, bt.isContextConsumer = le, bt.isContextProvider = ne, bt.isElement = pe, bt.isForwardRef = we, bt.isFragment = Ce, bt.isLazy = Te, bt.isMemo = _e, bt.isPortal = ze, bt.isProfiler = He, bt.isStrictMode = Ee, bt.isSuspense = $e, bt.isValidElementType = S, bt.typeOf = E; })(), bt; } var GT; function sP() { if (GT) return Rl.exports; GT = 1; var e = {}; return e.NODE_ENV === "production" ? Rl.exports = WB() : Rl.exports = FB(), Rl.exports; } var Nd, KT; function zB() { if (KT) return Nd; KT = 1; var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable; function r(o) { if (o == null) throw new TypeError("Object.assign cannot be called with null or undefined"); return Object(o); } function i() { try { if (!Object.assign) return !1; var o = new String("abc"); if (o[5] = "de", Object.getOwnPropertyNames(o)[0] === "5") return !1; for (var a = {}, s = 0; s < 10; s++) a["_" + String.fromCharCode(s)] = s; var l = Object.getOwnPropertyNames(a).map(function(u) { return a[u]; }); if (l.join("") !== "0123456789") return !1; var c = {}; return "abcdefghijklmnopqrst".split("").forEach(function(u) { c[u] = u; }), Object.keys(Object.assign({}, c)).join("") === "abcdefghijklmnopqrst"; } catch { return !1; } } return Nd = i() ? Object.assign : function(o, a) { for (var s, l = r(o), c, u = 1; u < arguments.length; u++) { s = Object(arguments[u]); for (var d in s) t.call(s, d) && (l[d] = s[d]); if (e) { c = e(s); for (var h = 0; h < c.length; h++) n.call(s, c[h]) && (l[c[h]] = s[c[h]]); } } return l; }, Nd; } var Md, $T; function Xy() { if ($T) return Md; $T = 1; var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; return Md = e, Md; } var kd, ZT; function lP() { return ZT || (ZT = 1, kd = Function.call.bind(Object.prototype.hasOwnProperty)), kd; } var Ld, YT; function BB() { if (YT) return Ld; YT = 1; var e = {}, t = function() { }; if (e.NODE_ENV !== "production") { var n = /* @__PURE__ */ Xy(), r = {}, i = /* @__PURE__ */ lP(); t = function(a) { var s = "Warning: " + a; typeof console < "u" && console.error(s); try { throw new Error(s); } catch { } }; } function o(a, s, l, c, u) { if (e.NODE_ENV !== "production") { for (var d in a) if (i(a, d)) { var h; try { if (typeof a[d] != "function") { var f = Error( (c || "React class") + ": " + l + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." ); throw f.name = "Invariant Violation", f; } h = a[d](s, d, c, l, null, n); } catch (g) { h = g; } if (h && !(h instanceof Error) && t( (c || "React class") + ": type specification of " + l + " `" + d + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof h + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." ), h instanceof Error && !(h.message in r)) { r[h.message] = !0; var p = u ? u() : ""; t( "Failed " + l + " type: " + h.message + (p ?? "") ); } } } } return o.resetWarningCache = function() { e.NODE_ENV !== "production" && (r = {}); }, Ld = o, Ld; } var Wd, XT; function jB() { if (XT) return Wd; XT = 1; var e = {}, t = sP(), n = zB(), r = /* @__PURE__ */ Xy(), i = /* @__PURE__ */ lP(), o = /* @__PURE__ */ BB(), a = function() { }; e.NODE_ENV !== "production" && (a = function(l) { var c = "Warning: " + l; typeof console < "u" && console.error(c); try { throw new Error(c); } catch { } }); function s() { return null; } return Wd = function(l, c) { var u = typeof Symbol == "function" && Symbol.iterator, d = "@@iterator"; function h(U) { var le = U && (u && U[u] || U[d]); if (typeof le == "function") return le; } var f = "<<anonymous>>", p = { array: w("array"), bigint: w("bigint"), bool: w("boolean"), func: w("function"), number: w("number"), object: w("object"), string: w("string"), symbol: w("symbol"), any: T(), arrayOf: S, element: E(), elementType: C(), instanceOf: I, node: L(), objectOf: A, oneOf: O, oneOfType: N, shape: H, exact: G }; function g(U, le) { return U === le ? U !== 0 || 1 / U === 1 / le : U !== U && le !== le; } function v(U, le) { this.message = U, this.data = le && typeof le == "object" ? le : {}, this.stack = ""; } v.prototype = Error.prototype; function b(U) { if (e.NODE_ENV !== "production") var le = {}, ne = 0; function pe(Ce, Te, _e, ze, He, Ee, $e) { if (ze = ze || f, Ee = Ee || _e, $e !== r) { if (c) { var J = new Error( "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types" ); throw J.name = "Invariant Violation", J; } else if (e.NODE_ENV !== "production" && typeof console < "u") { var _t = ze + ":" + _e; !le[_t] && // Avoid spamming the console because they are often not actionable except for lib authors ne < 3 && (a( "You are manually calling a React.PropTypes validation function for the `" + Ee + "` prop on `" + ze + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." ), le[_t] = !0, ne++); } } return Te[_e] == null ? Ce ? Te[_e] === null ? new v("The " + He + " `" + Ee + "` is marked as required " + ("in `" + ze + "`, but its value is `null`.")) : new v("The " + He + " `" + Ee + "` is marked as required in " + ("`" + ze + "`, but its value is `undefined`.")) : null : U(Te, _e, ze, He, Ee); } var we = pe.bind(null, !1); return we.isRequired = pe.bind(null, !0), we; } function w(U) { function le(ne, pe, we, Ce, Te, _e) { var ze = ne[pe], He = oe(ze); if (He !== U) { var Ee = se(ze); return new v( "Invalid " + Ce + " `" + Te + "` of type " + ("`" + Ee + "` supplied to `" + we + "`, expected ") + ("`" + U + "`."), { expectedType: U } ); } return null; } return b(le); } function T() { return b(s); } function S(U) { function le(ne, pe, we, Ce, Te) { if (typeof U != "function") return new v("Property `" + Te + "` of component `" + we + "` has invalid PropType notation inside arrayOf."); var _e = ne[pe]; if (!Array.isArray(_e)) { var ze = oe(_e); return new v("Invalid " + Ce + " `" + Te + "` of type " + ("`" + ze + "` supplied to `" + we + "`, expected an array.")); } for (var He = 0; He < _e.length; He++) { var Ee = U(_e, He, we, Ce, Te + "[" + He + "]", r); if (Ee instanceof Error) return Ee; } return null; } return b(le); } function E() { function U(le, ne, pe, we, Ce) { var Te = le[ne]; if (!l(Te)) { var _e = oe(Te); return new v("Invalid " + we + " `" + Ce + "` of type " + ("`" + _e + "` supplied to `" + pe + "`, expected a single ReactElement.")); } return null; } return b(U); } function C() { function U(le, ne, pe, we, Ce) { var Te = le[ne]; if (!t.isValidElementType(Te)) { var _e = oe(Te); return new v("Invalid " + we + " `" + Ce + "` of type " + ("`" + _e + "` supplied to `" + pe + "`, expected a single ReactElement type.")); } return null; } return b(U); } function I(U) { function le(ne, pe, we, Ce, Te) { if (!(ne[pe] instanceof U)) { var _e = U.name || f, ze = be(ne[pe]); return new v("Invalid " + Ce + " `" + Te + "` of type " + ("`" + ze + "` supplied to `" + we + "`, expected ") + ("instance of `" + _e + "`.")); } return null; } return b(le); } function O(U) { if (!Array.isArray(U)) return e.NODE_ENV !== "production" && (arguments.length > 1 ? a( "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." ) : a("Invalid argument supplied to oneOf, expected an array.")), s; function le(ne, pe, we, Ce, Te) { for (var _e = ne[pe], ze = 0; ze < U.length; ze++) if (g(_e, U[ze])) return null; var He = JSON.stringify(U, function($e, J) { var _t = se(J); return _t === "symbol" ? String(J) : J; }); return new v("Invalid " + Ce + " `" + Te + "` of value `" + String(_e) + "` " + ("supplied to `" + we + "`, expected one of " + He + ".")); } return b(le); } function A(U) { function le(ne, pe, we, Ce, Te) { if (typeof U != "function") return new v("Property `" + Te + "` of component `" + we + "` has invalid PropType notation inside objectOf."); var _e = ne[pe], ze = oe(_e); if (ze !== "object") return new v("Invalid " + Ce + " `" + Te + "` of type " + ("`" + ze + "` supplied to `" + we + "`, expected an object.")); for (var He in _e) if (i(_e, He)) { var Ee = U(_e, He, we, Ce, Te + "." + He, r); if (Ee instanceof Error) return Ee; } return null; } return b(le); } function N(U) { if (!Array.isArray(U)) return e.NODE_ENV !== "production" && a("Invalid argument supplied to oneOfType, expected an instance of array."), s; for (var le = 0; le < U.length; le++) { var ne = U[le]; if (typeof ne != "function") return a( "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + Re(ne) + " at index " + le + "." ), s; } function pe(we, Ce, Te, _e, ze) { for (var He = [], Ee = 0; Ee < U.length; Ee++) { var $e = U[Ee], J = $e(we, Ce, Te, _e, ze, r); if (J == null) return null; J.data && i(J.data, "expectedType") && He.push(J.data.expectedType); } var _t = He.length > 0 ? ", expected one of type [" + He.join(", ") + "]" : ""; return new v("Invalid " + _e + " `" + ze + "` supplied to " + ("`" + Te + "`" + _t + ".")); } return b(pe); } function L() { function U(le, ne, pe, we, Ce) { return ie(le[ne]) ? null : new v("Invalid " + we + " `" + Ce + "` supplied to " + ("`" + pe + "`, expected a ReactNode.")); } return b(U); } function W(U, le, ne, pe, we) { return new v( (U || "React class") + ": " + le + " type `" + ne + "." + pe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + we + "`." ); } function H(U) { function le(ne, pe, we, Ce, Te) { var _e = ne[pe], ze = oe(_e); if (ze !== "object") return new v("Invalid " + Ce + " `" + Te + "` of type `" + ze + "` " + ("supplied to `" + we + "`, expected `object`.")); for (var He in U) { var Ee = U[He]; if (typeof Ee != "function") return W(we, Ce, Te, He, se(Ee)); var $e = Ee(_e, He, we, Ce, Te + "." + He, r); if ($e) return $e; } return null; } return b(le); } function G(U) { function le(ne, pe, we, Ce, Te) { var _e = ne[pe], ze = oe(_e); if (ze !== "object") return new v("Invalid " + Ce + " `" + Te + "` of type `" + ze + "` " + ("supplied to `" + we + "`, expected `object`.")); var He = n({}, ne[pe], U); for (var Ee in He) { var $e = U[Ee]; if (i(U, Ee) && typeof $e != "function") return W(we, Ce, Te, Ee, se($e)); if (!$e) return new v( "Invalid " + Ce + " `" + Te + "` key `" + Ee + "` supplied to `" + we + "`.\nBad object: " + JSON.stringify(ne[pe], null, " ") + ` Valid keys: ` + JSON.stringify(Object.keys(U), null, " ") ); var J = $e(_e, Ee, we, Ce, Te + "." + Ee, r); if (J) return J; } return null; } return b(le); } function ie(U) { switch (typeof U) { case "number": case "string": case "undefined": return !0; case "boolean": return !U; case "object": if (Array.isArray(U)) return U.every(ie); if (U === null || l(U)) return !0; var le = h(U); if (le) { var ne = le.call(U), pe; if (le !== U.entries) { for (; !(pe = ne.next()).done; ) if (!ie(pe.value)) return !1; } else for (; !(pe = ne.next()).done; ) { var we = pe.value; if (we && !ie(we[1])) return !1; } } else return !1; return !0; default: return !1; }