UNPKG

@spratch/whtable

Version:

A typescript react accessible table component for WealthHealth

1,520 lines 295 kB
import './whtable.css'; import * as F from "react"; import B1, { useMemo as ne, forwardRef as i } from "react"; import { Select as no, Button as Q, SelectValue as oo, FieldError as io, Popover as so, ListBox as ao, ListBoxItem as co, SearchField as lo, Input as uo, ResizableTableContainer as ho, Table as wo, TableHeader as fo, TableBody as po, Column as Co, Group as mo, ColumnResizer as go, Row as xo, Cell as ko, Link as vo } from "react-aria-components"; var o1 = { exports: {} }, K = {}; /** * @license React * react-jsx-runtime.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 oe; function yo() { if (oe) return K; oe = 1; var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment"); function n(o, s, a) { var c = null; if (a !== void 0 && (c = "" + a), s.key !== void 0 && (c = "" + s.key), "key" in s) { a = {}; for (var l in s) l !== "key" && (a[l] = s[l]); } else a = s; return s = a.ref, { $$typeof: e, type: o, key: c, ref: s !== void 0 ? s : null, props: a }; } return K.Fragment = t, K.jsx = n, K.jsxs = n, K; } var J = {}; /** * @license React * react-jsx-runtime.development.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 ie; function jo() { return ie || (ie = 1, process.env.NODE_ENV !== "production" && function() { function e(w) { if (w == null) return null; if (typeof w == "function") return w.$$typeof === C1 ? null : w.displayName || w.name || null; if (typeof w == "string") return w; switch (w) { case j: return "Fragment"; case L: return "Profiler"; case g: return "StrictMode"; case k: return "Suspense"; case V: return "SuspenseList"; case n1: return "Activity"; } if (typeof w == "object") switch (typeof w.tag == "number" && console.error( "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." ), w.$$typeof) { case C: return "Portal"; case x: return (w.displayName || "Context") + ".Provider"; case M: return (w._context.displayName || "Context") + ".Consumer"; case v: var y = w.render; return w = w.displayName, w || (w = y.displayName || y.name || "", w = w !== "" ? "ForwardRef(" + w + ")" : "ForwardRef"), w; case I: return y = w.displayName || null, y !== null ? y : e(w.type) || "Memo"; case N: y = w._payload, w = w._init; try { return e(w(y)); } catch { } } return null; } function t(w) { return "" + w; } function n(w) { try { t(w); var y = !1; } catch { y = !0; } if (y) { y = console; var b = y.error, E = typeof Symbol == "function" && Symbol.toStringTag && w[Symbol.toStringTag] || w.constructor.name || "Object"; return b.call( y, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", E ), t(w); } } function o(w) { if (w === j) return "<>"; if (typeof w == "object" && w !== null && w.$$typeof === N) return "<...>"; try { var y = e(w); return y ? "<" + y + ">" : "<...>"; } catch { return "<...>"; } } function s() { var w = G.A; return w === null ? null : w.getOwner(); } function a() { return Error("react-stack-top-frame"); } function c(w) { if (J1.call(w, "key")) { var y = Object.getOwnPropertyDescriptor(w, "key").get; if (y && y.isReactWarning) return !1; } return w.key !== void 0; } function l(w, y) { function b() { X1 || (X1 = !0, console.error( "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", y )); } b.isReactWarning = !0, Object.defineProperty(w, "key", { get: b, configurable: !0 }); } function u() { var w = e(this.type); return Q1[w] || (Q1[w] = !0, console.error( "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." )), w = this.props.ref, w !== void 0 ? w : null; } function h(w, y, b, E, D, Z, g1, x1) { return b = Z.ref, w = { $$typeof: m, type: w, key: y, props: Z, _owner: D }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(w, "ref", { enumerable: !1, get: u }) : Object.defineProperty(w, "ref", { enumerable: !1, value: null }), w._store = {}, Object.defineProperty(w._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: 0 }), Object.defineProperty(w, "_debugInfo", { configurable: !1, enumerable: !1, writable: !0, value: null }), Object.defineProperty(w, "_debugStack", { configurable: !1, enumerable: !1, writable: !0, value: g1 }), Object.defineProperty(w, "_debugTask", { configurable: !1, enumerable: !1, writable: !0, value: x1 }), Object.freeze && (Object.freeze(w.props), Object.freeze(w)), w; } function d(w, y, b, E, D, Z, g1, x1) { var _ = y.children; if (_ !== void 0) if (E) if (to(_)) { for (E = 0; E < _.length; E++) f(_[E]); Object.freeze && Object.freeze(_); } else console.error( "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." ); else f(_); if (J1.call(y, "key")) { _ = e(w); var q = Object.keys(y).filter(function(ro) { return ro !== "key"; }); E = 0 < q.length ? "{key: someKey, " + q.join(": ..., ") + ": ...}" : "{key: someKey}", re[_ + E] || (q = 0 < q.length ? "{" + q.join(": ..., ") + ": ...}" : "{}", console.error( `A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`, E, _, q, _ ), re[_ + E] = !0); } if (_ = null, b !== void 0 && (n(b), _ = "" + b), c(y) && (n(y.key), _ = "" + y.key), "key" in y) { b = {}; for (var k1 in y) k1 !== "key" && (b[k1] = y[k1]); } else b = y; return _ && l( b, typeof w == "function" ? w.displayName || w.name || "Unknown" : w ), h( w, _, Z, D, s(), b, g1, x1 ); } function f(w) { typeof w == "object" && w !== null && w.$$typeof === m && w._store && (w._store.validated = 1); } var p = B1, m = Symbol.for("react.transitional.element"), C = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), L = Symbol.for("react.profiler"), M = Symbol.for("react.consumer"), x = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), k = Symbol.for("react.suspense"), V = Symbol.for("react.suspense_list"), I = Symbol.for("react.memo"), N = Symbol.for("react.lazy"), n1 = Symbol.for("react.activity"), C1 = Symbol.for("react.client.reference"), G = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J1 = Object.prototype.hasOwnProperty, to = Array.isArray, m1 = console.createTask ? console.createTask : function() { return null; }; p = { "react-stack-bottom-frame": function(w) { return w(); } }; var X1, Q1 = {}, ee = p["react-stack-bottom-frame"].bind( p, a )(), te = m1(o(a)), re = {}; J.Fragment = j, J.jsx = function(w, y, b, E, D) { var Z = 1e4 > G.recentlyCreatedOwnerStacks++; return d( w, y, b, !1, E, D, Z ? Error("react-stack-top-frame") : ee, Z ? m1(o(w)) : te ); }, J.jsxs = function(w, y, b, E, D) { var Z = 1e4 > G.recentlyCreatedOwnerStacks++; return d( w, y, b, !0, E, D, Z ? Error("react-stack-top-frame") : ee, Z ? m1(o(w)) : te ); }; }()), J; } var se; function Lo() { return se || (se = 1, process.env.NODE_ENV === "production" ? o1.exports = yo() : o1.exports = jo()), o1.exports; } var r = Lo(), i1 = { exports: {} }, v1 = {}; /** * @license React * use-sync-external-store-with-selector.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 ae; function Mo() { if (ae) return v1; ae = 1; var e = B1; function t(u, h) { return u === h && (u !== 0 || 1 / u === 1 / h) || u !== u && h !== h; } var n = typeof Object.is == "function" ? Object.is : t, o = e.useSyncExternalStore, s = e.useRef, a = e.useEffect, c = e.useMemo, l = e.useDebugValue; return v1.useSyncExternalStoreWithSelector = function(u, h, d, f, p) { var m = s(null); if (m.current === null) { var C = { hasValue: !1, value: null }; m.current = C; } else C = m.current; m = c( function() { function g(k) { if (!L) { if (L = !0, M = k, k = f(k), p !== void 0 && C.hasValue) { var V = C.value; if (p(V, k)) return x = V; } return x = k; } if (V = x, n(M, k)) return V; var I = f(k); return p !== void 0 && p(V, I) ? (M = k, V) : (M = k, x = I); } var L = !1, M, x, v = d === void 0 ? null : d; return [ function() { return g(h()); }, v === null ? void 0 : function() { return g(v()); } ]; }, [h, d, f, p] ); var j = o(u, m[0], m[1]); return a( function() { C.hasValue = !0, C.value = j; }, [j] ), l(j), j; }, v1; } var y1 = {}; /** * @license React * use-sync-external-store-with-selector.development.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 ce; function Vo() { return ce || (ce = 1, process.env.NODE_ENV !== "production" && function() { function e(u, h) { return u === h && (u !== 0 || 1 / u === 1 / h) || u !== u && h !== h; } typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var t = B1, n = typeof Object.is == "function" ? Object.is : e, o = t.useSyncExternalStore, s = t.useRef, a = t.useEffect, c = t.useMemo, l = t.useDebugValue; y1.useSyncExternalStoreWithSelector = function(u, h, d, f, p) { var m = s(null); if (m.current === null) { var C = { hasValue: !1, value: null }; m.current = C; } else C = m.current; m = c( function() { function g(k) { if (!L) { if (L = !0, M = k, k = f(k), p !== void 0 && C.hasValue) { var V = C.value; if (p(V, k)) return x = V; } return x = k; } if (V = x, n(M, k)) return V; var I = f(k); return p !== void 0 && p(V, I) ? (M = k, V) : (M = k, x = I); } var L = !1, M, x, v = d === void 0 ? null : d; return [ function() { return g(h()); }, v === null ? void 0 : function() { return g(v()); } ]; }, [h, d, f, p] ); var j = o(u, m[0], m[1]); return a( function() { C.hasValue = !0, C.value = j; }, [j] ), l(j), j; }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); }()), y1; } var le; function Ho() { return le || (le = 1, process.env.NODE_ENV === "production" ? i1.exports = Mo() : i1.exports = Vo()), i1.exports; } var bo = Ho(); function Io(e) { e(); } function No() { let e = null, t = null; return { clear() { e = null, t = null; }, notify() { Io(() => { let n = e; for (; n; ) n.callback(), n = n.next; }); }, get() { const n = []; let o = e; for (; o; ) n.push(o), o = o.next; return n; }, subscribe(n) { let o = !0; const s = t = { callback: n, next: null, prev: t }; return s.prev ? s.prev.next = s : e = s, function() { !o || e === null || (o = !1, s.next ? s.next.prev = s.prev : t = s.prev, s.prev ? s.prev.next = s.next : e = s.next); }; } }; } var de = { notify() { }, get: () => [] }; function Ro(e, t) { let n, o = de, s = 0, a = !1; function c(j) { d(); const g = o.subscribe(j); let L = !1; return () => { L || (L = !0, g(), f()); }; } function l() { o.notify(); } function u() { C.onStateChange && C.onStateChange(); } function h() { return a; } function d() { s++, n || (n = e.subscribe(u), o = No()); } function f() { s--, n && s === 0 && (n(), n = void 0, o.clear(), o = de); } function p() { a || (a = !0, d()); } function m() { a && (a = !1, f()); } const C = { addNestedSub: c, notifyNestedSubs: l, handleChangeWrapper: u, isSubscribed: h, trySubscribe: p, tryUnsubscribe: m, getListeners: () => o }; return C; } var Eo = () => typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", _o = /* @__PURE__ */ Eo(), Wo = () => typeof navigator < "u" && navigator.product === "ReactNative", Fo = /* @__PURE__ */ Wo(), Bo = () => _o || Fo ? F.useLayoutEffect : F.useEffect, So = /* @__PURE__ */ Bo(), j1 = /* @__PURE__ */ Symbol.for("react-redux-context"), L1 = typeof globalThis < "u" ? globalThis : ( /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */ {} ); function Zo() { if (!F.createContext) return {}; const e = L1[j1] ?? (L1[j1] = /* @__PURE__ */ new Map()); let t = e.get(F.createContext); return t || (t = F.createContext( null ), process.env.NODE_ENV !== "production" && (t.displayName = "ReactRedux"), e.set(F.createContext, t)), t; } var P = /* @__PURE__ */ Zo(); function Oo(e) { const { children: t, context: n, serverState: o, store: s } = e, a = F.useMemo(() => { const u = Ro(s), h = { store: s, subscription: u, getServerState: o ? () => o : void 0 }; if (process.env.NODE_ENV === "production") return h; { const { identityFunctionCheck: d = "once", stabilityCheck: f = "once" } = e; return /* @__PURE__ */ Object.assign(h, { stabilityCheck: f, identityFunctionCheck: d }); } }, [s, o]), c = F.useMemo(() => s.getState(), [s]); So(() => { const { subscription: u } = a; return u.onStateChange = u.notifyNestedSubs, u.trySubscribe(), c !== s.getState() && u.notifyNestedSubs(), () => { u.tryUnsubscribe(), u.onStateChange = void 0; }; }, [a, c]); const l = n || P; return /* @__PURE__ */ F.createElement(l.Provider, { value: a }, t); } var Do = Oo; function S1(e = P) { return function() { const n = F.useContext(e); if (process.env.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 ye = /* @__PURE__ */ S1(); function je(e = P) { const t = e === P ? ye : ( // @ts-ignore S1(e) ), n = () => { const { store: o } = t(); return o; }; return Object.assign(n, { withTypes: () => n }), n; } var To = /* @__PURE__ */ je(); function Po(e = P) { const t = e === P ? To : je(e), n = () => t().dispatch; return Object.assign(n, { withTypes: () => n }), n; } var Le = /* @__PURE__ */ Po(), Ao = (e, t) => e === t; function zo(e = P) { const t = e === P ? ye : S1(e), n = (o, s = {}) => { const { equalityFn: a = Ao } = typeof s == "function" ? { equalityFn: s } : s; if (process.env.NODE_ENV !== "production") { if (!o) throw new Error("You must pass a selector to useSelector"); if (typeof o != "function") throw new Error("You must pass a function as a selector to useSelector"); if (typeof a != "function") throw new Error( "You must pass a function as an equality function to useSelector" ); } const c = t(), { store: l, subscription: u, getServerState: h } = c, d = F.useRef(!0), f = F.useCallback( { [o.name](m) { const C = o(m); if (process.env.NODE_ENV !== "production") { const { devModeChecks: j = {} } = typeof s == "function" ? {} : s, { identityFunctionCheck: g, stabilityCheck: L } = c, { identityFunctionCheck: M, stabilityCheck: x } = { stabilityCheck: L, identityFunctionCheck: g, ...j }; if (x === "always" || x === "once" && d.current) { const v = o(m); if (!a(C, v)) { let k; try { throw new Error(); } catch (V) { ({ stack: k } = V); } console.warn( "Selector " + (o.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: m, selected: C, selected2: v, stack: k } ); } } if ((M === "always" || M === "once" && d.current) && C === m) { let v; try { throw new Error(); } catch (k) { ({ stack: v } = k); } console.warn( "Selector " + (o.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: v } ); } d.current && (d.current = !1); } return C; } }[o.name], [o] ), p = bo.useSyncExternalStoreWithSelector( u.addNestedSub, l.getState, h || l.getState, f, a ); return F.useDebugValue(p), p; }; return Object.assign(n, { withTypes: () => n }), n; } var Me = /* @__PURE__ */ zo(); function R(e) { return `Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `; } var $o = typeof Symbol == "function" && Symbol.observable || "@@observable", ue = $o, M1 = () => Math.random().toString(36).substring(7).split("").join("."), Uo = { INIT: `@@redux/INIT${/* @__PURE__ */ M1()}`, REPLACE: `@@redux/REPLACE${/* @__PURE__ */ M1()}`, PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${M1()}` }, z = Uo; function r1(e) { if (typeof e != "object" || e === null) return !1; let t = e; for (; Object.getPrototypeOf(t) !== null; ) t = Object.getPrototypeOf(t); return Object.getPrototypeOf(e) === t || Object.getPrototypeOf(e) === null; } function qo(e) { if (e === void 0) return "undefined"; if (e === null) return "null"; const t = typeof e; switch (t) { case "boolean": case "string": case "number": case "symbol": case "function": return t; } if (Array.isArray(e)) return "array"; if (Ko(e)) return "date"; if (Go(e)) return "error"; const n = Yo(e); switch (n) { case "Symbol": case "Promise": case "WeakMap": case "WeakSet": case "Map": case "Set": return n; } return Object.prototype.toString.call(e).slice(8, -1).toLowerCase().replace(/\s/g, ""); } function Yo(e) { return typeof e.constructor == "function" ? e.constructor.name : null; } function Go(e) { return e instanceof Error || typeof e.message == "string" && e.constructor && typeof e.constructor.stackTraceLimit == "number"; } function Ko(e) { return e instanceof Date ? !0 : typeof e.toDateString == "function" && typeof e.getDate == "function" && typeof e.setDate == "function"; } function T(e) { let t = typeof e; return process.env.NODE_ENV !== "production" && (t = qo(e)), t; } function Ve(e, t, n) { if (typeof e != "function") throw new Error(process.env.NODE_ENV === "production" ? R(2) : `Expected the root reducer to be a function. Instead, received: '${T(e)}'`); if (typeof t == "function" && typeof n == "function" || typeof n == "function" && typeof arguments[3] == "function") throw new Error(process.env.NODE_ENV === "production" ? R(0) : "It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example."); if (typeof t == "function" && typeof n > "u" && (n = t, t = void 0), typeof n < "u") { if (typeof n != "function") throw new Error(process.env.NODE_ENV === "production" ? R(1) : `Expected the enhancer to be a function. Instead, received: '${T(n)}'`); return n(Ve)(e, t); } let o = e, s = t, a = /* @__PURE__ */ new Map(), c = a, l = 0, u = !1; function h() { c === a && (c = /* @__PURE__ */ new Map(), a.forEach((g, L) => { c.set(L, g); })); } function d() { if (u) throw new Error(process.env.NODE_ENV === "production" ? R(3) : "You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store."); return s; } function f(g) { if (typeof g != "function") throw new Error(process.env.NODE_ENV === "production" ? R(4) : `Expected the listener to be a function. Instead, received: '${T(g)}'`); if (u) throw new Error(process.env.NODE_ENV === "production" ? R(5) : "You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details."); let L = !0; h(); const M = l++; return c.set(M, g), function() { if (L) { if (u) throw new Error(process.env.NODE_ENV === "production" ? R(6) : "You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details."); L = !1, h(), c.delete(M), a = null; } }; } function p(g) { if (!r1(g)) throw new Error(process.env.NODE_ENV === "production" ? R(7) : `Actions must be plain objects. Instead, the actual type was: '${T(g)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`); if (typeof g.type > "u") throw new Error(process.env.NODE_ENV === "production" ? R(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.'); if (typeof g.type != "string") throw new Error(process.env.NODE_ENV === "production" ? R(17) : `Action "type" property must be a string. Instead, the actual type was: '${T(g.type)}'. Value was: '${g.type}' (stringified)`); if (u) throw new Error(process.env.NODE_ENV === "production" ? R(9) : "Reducers may not dispatch actions."); try { u = !0, s = o(s, g); } finally { u = !1; } return (a = c).forEach((M) => { M(); }), g; } function m(g) { if (typeof g != "function") throw new Error(process.env.NODE_ENV === "production" ? R(10) : `Expected the nextReducer to be a function. Instead, received: '${T(g)}`); o = g, p({ type: z.REPLACE }); } function C() { const g = f; return { /** * The minimal observable subscription method. * @param observer Any object that can be used as an observer. * The observer object should have a `next` method. * @returns An object with an `unsubscribe` method that can * be used to unsubscribe the observable from the store, and prevent further * emission of values from the observable. */ subscribe(L) { if (typeof L != "object" || L === null) throw new Error(process.env.NODE_ENV === "production" ? R(11) : `Expected the observer to be an object. Instead, received: '${T(L)}'`); function M() { const v = L; v.next && v.next(d()); } return M(), { unsubscribe: g(M) }; }, [ue]() { return this; } }; } return p({ type: z.INIT }), { dispatch: p, subscribe: f, getState: d, replaceReducer: m, [ue]: C }; } function he(e) { typeof console < "u" && typeof console.error == "function" && console.error(e); try { throw new Error(e); } catch { } } function Jo(e, t, n, o) { const s = Object.keys(t), a = n && n.type === z.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer"; if (s.length === 0) return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers."; if (!r1(e)) return `The ${a} has unexpected type of "${T(e)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`; const c = Object.keys(e).filter((l) => !t.hasOwnProperty(l) && !o[l]); if (c.forEach((l) => { o[l] = !0; }), !(n && n.type === z.REPLACE) && c.length > 0) return `Unexpected ${c.length > 1 ? "keys" : "key"} "${c.join('", "')}" found in ${a}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`; } function Xo(e) { Object.keys(e).forEach((t) => { const n = e[t]; if (typeof n(void 0, { type: z.INIT }) > "u") throw new Error(process.env.NODE_ENV === "production" ? R(12) : `The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`); if (typeof n(void 0, { type: z.PROBE_UNKNOWN_ACTION() }) > "u") throw new Error(process.env.NODE_ENV === "production" ? R(13) : `The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${z.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`); }); } function Qo(e) { const t = Object.keys(e), n = {}; for (let c = 0; c < t.length; c++) { const l = t[c]; process.env.NODE_ENV !== "production" && typeof e[l] > "u" && he(`No reducer provided for key "${l}"`), typeof e[l] == "function" && (n[l] = e[l]); } const o = Object.keys(n); let s; process.env.NODE_ENV !== "production" && (s = {}); let a; try { Xo(n); } catch (c) { a = c; } return function(l = {}, u) { if (a) throw a; if (process.env.NODE_ENV !== "production") { const f = Jo(l, n, u, s); f && he(f); } let h = !1; const d = {}; for (let f = 0; f < o.length; f++) { const p = o[f], m = n[p], C = l[p], j = m(C, u); if (typeof j > "u") { const g = u && u.type; throw new Error(process.env.NODE_ENV === "production" ? R(14) : `When called with an action of type ${g ? `"${String(g)}"` : "(unknown type)"}, the slice reducer for key "${p}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`); } d[p] = j, h = h || j !== C; } return h = h || o.length !== Object.keys(l).length, h ? d : l; }; } function c1(...e) { return e.length === 0 ? (t) => t : e.length === 1 ? e[0] : e.reduce((t, n) => (...o) => t(n(...o))); } function ei(...e) { return (t) => (n, o) => { const s = t(n, o); let a = () => { throw new Error(process.env.NODE_ENV === "production" ? R(15) : "Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch."); }; const c = { getState: s.getState, dispatch: (u, ...h) => a(u, ...h) }, l = e.map((u) => u(c)); return a = c1(...l)(s.dispatch), { ...s, dispatch: a }; }; } function He(e) { return r1(e) && "type" in e && typeof e.type == "string"; } var be = Symbol.for("immer-nothing"), we = Symbol.for("immer-draftable"), B = Symbol.for("immer-state"), ti = process.env.NODE_ENV !== "production" ? [ // All error codes, starting by 0: function(e) { return `The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`; }, function(e) { return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`; }, "This object has been frozen and should not be mutated", function(e) { return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + e; }, "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.", "Immer forbids circular references", "The first or second argument to `produce` must be a function", "The third argument to `produce` must be a function or undefined", "First argument to `createDraft` must be a plain object, an array, or an immerable object", "First argument to `finishDraft` must be a draft returned by `createDraft`", function(e) { return `'current' expects a draft, got: ${e}`; }, "Object.defineProperty() cannot be used on an Immer draft", "Object.setPrototypeOf() cannot be used on an Immer draft", "Immer only supports deleting array indices", "Immer only supports setting array indices and the 'length' property", function(e) { return `'original' expects a draft, got: ${e}`; } // Note: if more errors are added, the errorOffset in Patches.ts should be increased // See Patches.ts for additional errors ] : []; function W(e, ...t) { if (process.env.NODE_ENV !== "production") { const n = ti[e], o = typeof n == "function" ? n.apply(null, t) : n; throw new Error(`[Immer] ${o}`); } throw new Error( `[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf` ); } var Y = Object.getPrototypeOf; function $(e) { return !!e && !!e[B]; } function O(e) { var t; return e ? Ie(e) || Array.isArray(e) || !!e[we] || !!((t = e.constructor) != null && t[we]) || w1(e) || f1(e) : !1; } var ri = Object.prototype.constructor.toString(); function Ie(e) { if (!e || typeof e != "object") return !1; const t = Y(e); if (t === null) return !0; const n = Object.hasOwnProperty.call(t, "constructor") && t.constructor; return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) === ri; } function l1(e, t) { h1(e) === 0 ? Reflect.ownKeys(e).forEach((n) => { t(n, e[n], e); }) : e.forEach((n, o) => t(o, n, e)); } function h1(e) { const t = e[B]; return t ? t.type_ : Array.isArray(e) ? 1 : w1(e) ? 2 : f1(e) ? 3 : 0; } function I1(e, t) { return h1(e) === 2 ? e.has(t) : Object.prototype.hasOwnProperty.call(e, t); } function Ne(e, t, n) { const o = h1(e); o === 2 ? e.set(t, n) : o === 3 ? e.add(n) : e[t] = n; } function ni(e, t) { return e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t; } function w1(e) { return e instanceof Map; } function f1(e) { return e instanceof Set; } function A(e) { return e.copy_ || e.base_; } function N1(e, t) { if (w1(e)) return new Map(e); if (f1(e)) return new Set(e); if (Array.isArray(e)) return Array.prototype.slice.call(e); const n = Ie(e); if (t === !0 || t === "class_only" && !n) { const o = Object.getOwnPropertyDescriptors(e); delete o[B]; let s = Reflect.ownKeys(o); for (let a = 0; a < s.length; a++) { const c = s[a], l = o[c]; l.writable === !1 && (l.writable = !0, l.configurable = !0), (l.get || l.set) && (o[c] = { configurable: !0, writable: !0, // could live with !!desc.set as well here... enumerable: l.enumerable, value: e[c] }); } return Object.create(Y(e), o); } else { const o = Y(e); if (o !== null && n) return { ...e }; const s = Object.create(o); return Object.assign(s, e); } } function Z1(e, t = !1) { return p1(e) || $(e) || !O(e) || (h1(e) > 1 && (e.set = e.add = e.clear = e.delete = oi), Object.freeze(e), t && Object.entries(e).forEach(([n, o]) => Z1(o, !0))), e; } function oi() { W(2); } function p1(e) { return Object.isFrozen(e); } var ii = {}; function U(e) { const t = ii[e]; return t || W(0, e), t; } var e1; function Re() { return e1; } function si(e, t) { return { drafts_: [], parent_: e, immer_: t, // Whenever the modified draft contains a draft from another scope, we // need to prevent auto-freezing so the unowned draft can be finalized. canAutoFreeze_: !0, unfinalizedDrafts_: 0 }; } function fe(e, t) { t && (U("Patches"), e.patches_ = [], e.inversePatches_ = [], e.patchListener_ = t); } function R1(e) { E1(e), e.drafts_.forEach(ai), e.drafts_ = null; } function E1(e) { e === e1 && (e1 = e.parent_); } function pe(e) { return e1 = si(e1, e); } function ai(e) { const t = e[B]; t.type_ === 0 || t.type_ === 1 ? t.revoke_() : t.revoked_ = !0; } function Ce(e, t) { t.unfinalizedDrafts_ = t.drafts_.length; const n = t.drafts_[0]; return e !== void 0 && e !== n ? (n[B].modified_ && (R1(t), W(4)), O(e) && (e = d1(t, e), t.parent_ || u1(t, e)), t.patches_ && U("Patches").generateReplacementPatches_( n[B].base_, e, t.patches_, t.inversePatches_ )) : e = d1(t, n, []), R1(t), t.patches_ && t.patchListener_(t.patches_, t.inversePatches_), e !== be ? e : void 0; } function d1(e, t, n) { if (p1(t)) return t; const o = t[B]; if (!o) return l1( t, (s, a) => me(e, o, t, s, a, n) ), t; if (o.scope_ !== e) return t; if (!o.modified_) return u1(e, o.base_, !0), o.base_; if (!o.finalized_) { o.finalized_ = !0, o.scope_.unfinalizedDrafts_--; const s = o.copy_; let a = s, c = !1; o.type_ === 3 && (a = new Set(s), s.clear(), c = !0), l1( a, (l, u) => me(e, o, s, l, u, n, c) ), u1(e, s, !1), n && e.patches_ && U("Patches").generatePatches_( o, n, e.patches_, e.inversePatches_ ); } return o.copy_; } function me(e, t, n, o, s, a, c) { if (process.env.NODE_ENV !== "production" && s === n && W(5), $(s)) { const l = a && t && t.type_ !== 3 && // Set objects are atomic since they have no keys. !I1(t.assigned_, o) ? a.concat(o) : void 0, u = d1(e, s, l); if (Ne(n, o, u), $(u)) e.canAutoFreeze_ = !1; else return; } else c && n.add(s); if (O(s) && !p1(s)) { if (!e.immer_.autoFreeze_ && e.unfinalizedDrafts_ < 1) return; d1(e, s), (!t || !t.scope_.parent_) && typeof o != "symbol" && Object.prototype.propertyIsEnumerable.call(n, o) && u1(e, s); } } function u1(e, t, n = !1) { !e.parent_ && e.immer_.autoFreeze_ && e.canAutoFreeze_ && Z1(t, n); } function ci(e, t) { const n = Array.isArray(e), o = { type_: n ? 1 : 0, // Track which produce call this is associated with. scope_: t ? t.scope_ : Re(), // True for both shallow and deep changes. modified_: !1, // Used during finalization. finalized_: !1, // Track which properties have been assigned (true) or deleted (false). assigned_: {}, // The parent draft state. parent_: t, // The base state. base_: e, // The base proxy. draft_: null, // set below // The base copy with any updated values. copy_: null, // Called by the `produce` function. revoke_: null, isManual_: !1 }; let s = o, a = O1; n && (s = [o], a = t1); const { revoke: c, proxy: l } = Proxy.revocable(s, a); return o.draft_ = l, o.revoke_ = c, l; } var O1 = { get(e, t) { if (t === B) return e; const n = A(e); if (!I1(n, t)) return li(e, n, t); const o = n[t]; return e.finalized_ || !O(o) ? o : o === V1(e.base_, t) ? (H1(e), e.copy_[t] = W1(o, e)) : o; }, has(e, t) { return t in A(e); }, ownKeys(e) { return Reflect.ownKeys(A(e)); }, set(e, t, n) { const o = Ee(A(e), t); if (o != null && o.set) return o.set.call(e.draft_, n), !0; if (!e.modified_) { const s = V1(A(e), t), a = s == null ? void 0 : s[B]; if (a && a.base_ === n) return e.copy_[t] = n, e.assigned_[t] = !1, !0; if (ni(n, s) && (n !== void 0 || I1(e.base_, t))) return !0; H1(e), _1(e); } return e.copy_[t] === n && // special case: handle new props with value 'undefined' (n !== void 0 || t in e.copy_) || // special case: NaN Number.isNaN(n) && Number.isNaN(e.copy_[t]) || (e.copy_[t] = n, e.assigned_[t] = !0), !0; }, deleteProperty(e, t) { return V1(e.base_, t) !== void 0 || t in e.base_ ? (e.assigned_[t] = !1, H1(e), _1(e)) : delete e.assigned_[t], e.copy_ && delete e.copy_[t], !0; }, // Note: We never coerce `desc.value` into an Immer draft, because we can't make // the same guarantee in ES5 mode. getOwnPropertyDescriptor(e, t) { const n = A(e), o = Reflect.getOwnPropertyDescriptor(n, t); return o && { writable: !0, configurable: e.type_ !== 1 || t !== "length", enumerable: o.enumerable, value: n[t] }; }, defineProperty() { W(11); }, getPrototypeOf(e) { return Y(e.base_); }, setPrototypeOf() { W(12); } }, t1 = {}; l1(O1, (e, t) => { t1[e] = function() { return arguments[0] = arguments[0][0], t.apply(this, arguments); }; }); t1.deleteProperty = function(e, t) { return process.env.NODE_ENV !== "production" && isNaN(parseInt(t)) && W(13), t1.set.call(this, e, t, void 0); }; t1.set = function(e, t, n) { return process.env.NODE_ENV !== "production" && t !== "length" && isNaN(parseInt(t)) && W(14), O1.set.call(this, e[0], t, n, e[0]); }; function V1(e, t) { const n = e[B]; return (n ? A(n) : e)[t]; } function li(e, t, n) { var s; const o = Ee(t, n); return o ? "value" in o ? o.value : ( // This is a very special case, if the prop is a getter defined by the // prototype, we should invoke it with the draft as context! (s = o.get) == null ? void 0 : s.call(e.draft_) ) : void 0; } function Ee(e, t) { if (!(t in e)) return; let n = Y(e); for (; n; ) { const o = Object.getOwnPropertyDescriptor(n, t); if (o) return o; n = Y(n); } } function _1(e) { e.modified_ || (e.modified_ = !0, e.parent_ && _1(e.parent_)); } function H1(e) { e.copy_ || (e.copy_ = N1( e.base_, e.scope_.immer_.useStrictShallowCopy_ )); } var di = class { constructor(e) { this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.produce = (t, n, o) => { if (typeof t == "function" && typeof n != "function") { const a = n; n = t; const c = this; return function(u = a, ...h) { return c.produce(u, (d) => n.call(this, d, ...h)); }; } typeof n != "function" && W(6), o !== void 0 && typeof o != "function" && W(7); let s; if (O(t)) { const a = pe(this), c = W1(t, void 0); let l = !0; try { s = n(c), l = !1; } finally { l ? R1(a) : E1(a); } return fe(a, o), Ce(s, a); } else if (!t || typeof t != "object") { if (s = n(t), s === void 0 && (s = t), s === be && (s = void 0), this.autoFreeze_ && Z1(s, !0), o) { const a = [], c = []; U("Patches").generateReplacementPatches_(t, s, a, c), o(a, c); } return s; } else W(1, t); }, this.produceWithPatches = (t, n) => { if (typeof t == "function") return (c, ...l) => this.produceWithPatches(c, (u) => t(u, ...l)); let o, s; return [this.produce(t, n, (c, l) => { o = c, s = l; }), o, s]; }, typeof (e == null ? void 0 : e.autoFreeze) == "boolean" && this.setAutoFreeze(e.autoFreeze), typeof (e == null ? void 0 : e.useStrictShallowCopy) == "boolean" && this.setUseStrictShallowCopy(e.useStrictShallowCopy); } createDraft(e) { O(e) || W(8), $(e) && (e = ui(e)); const t = pe(this), n = W1(e, void 0); return n[B].isManual_ = !0, E1(t), n; } finishDraft(e, t) { const n = e && e[B]; (!n || !n.isManual_) && W(9); const { scope_: o } = n; return fe(o, t), Ce(void 0, o); } /** * Pass true to automatically freeze all copies created by Immer. * * By default, auto-freezing is enabled. */ setAutoFreeze(e) { this.autoFreeze_ = e; } /** * Pass true to enable strict shallow copy. * * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties. */ setUseStrictShallowCopy(e) { this.useStrictShallowCopy_ = e; } applyPatches(e, t) { let n; for (n = t.length - 1; n >= 0; n--) { const s = t[n]; if (s.path.length === 0 && s.op === "replace") { e = s.value; break; } } n > -1 && (t = t.slice(n + 1)); const o = U("Patches").applyPatches_; return $(e) ? o(e, t) : this.produce( e, (s) => o(s, t) ); } }; function W1(e, t) { const n = w1(e) ? U("MapSet").proxyMap_(e, t) : f1(e) ? U("MapSet").proxySet_(e, t) : ci(e, t); return (t ? t.scope_ : Re()).drafts_.push(n), n; } function ui(e) { return $(e) || W(10, e), _e(e); } function _e(e) { if (!O(e) || p1(e)) return e; const t = e[B]; let n; if (t) { if (!t.modified_) return t.base_; t.finalized_ = !0, n = N1(e, t.scope_.immer_.useStrictShallowCopy_); } else n = N1(e, !0); return l1(n, (o, s) => { Ne(n, o, _e(s)); }), t && (t.finalized_ = !1), n; } var S = new di(), We = S.produce; S.produceWithPatches.bind( S ); S.setAutoFreeze.bind(S); S.setUseStrictShallowCopy.bind(S); S.applyPatches.bind(S); S.createDraft.bind(S); S.finishDraft.bind(S); function Fe(e) { return ({ dispatch: n, getState: o }) => (s) => (a) => typeof a == "function" ? a(n, o, e) : s(a); } var hi = Fe(), wi = Fe, fi = typeof window < "u" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() { if (arguments.length !== 0) return typeof arguments[0] == "object" ? c1 : c1.apply(null, arguments); }, pi = (e) => e && typeof e.match == "function"; function ge(e, t) { function n(...o) { if (t) { let s = t(...o); if (!s) throw new Error(process.env.NODE_ENV === "production" ? H(0) : "prepareAction did not return an object"); return { type: e, payload: s.payload, ..."meta" in s && { meta: s.meta }, ..."error" in s && { error: s.error } }; } return { type: e, payload: o[0] }; } return n.toString = () => `${e}`, n.type = e, n.match = (o) => He(o) && o.type === e, n; } function Ci(e) { return typeof e == "function" && "type" in e && // hasMatchFunction only wants Matchers but I don't see the point in rewriting it pi(e); } function mi(e) { const t = e ? `${e}`.split("/") : [], n = t[t.length - 1] || "actionCreator"; return `Detected an action creator with type "${e || "unknown"}" being dispatched. Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`; } function gi(e = {}) { if (process.env.NODE_ENV === "production") return () => (n) => (o) => n(o); const { isActionCreator: t = Ci } = e; return () => (n) => (o) => (t(o) && console.warn(mi(o.type)), n(o)); } function Be(e, t) { let n = 0; return { measureTime(o) { const s = Date.now(); try { return o(); } finally { const a = Date.now(); n += a - s; } }, warnIfExceeded() { n > e && console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms. If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions. It is disabled in production builds, so you don't need to worry about that.`); } }; } var Se = class X extends Array { constructor(...t) { super(...t), Object.setPrototypeOf(this, X.prototype); } static get [Symbol.species]() { return X; } concat(...t) { return super.concat.apply(this, t); } prepend(...t) { return t.length === 1 && Array.isArray(t[0]) ? new X(...t[0].concat(this)) : new X(...t.concat(this)); } }; function xe(e) { return O(e) ? We(e, () => { }) : e; } function ke(e, t, n) { return e.has(t) ? e.get(t) : e.set(t, n(t)).get(t); } function xi(e) { return typeof e != "object" || e == null || Object.isFrozen(e); } function ki(e, t, n) { const o = Ze(e, t, n); return { detectMutations() { return Oe(e, t, o, n); } }; } function Ze(e, t = [], n, o = "", s = /* @__PURE__ */ new Set()) { const a = { value: n }; if (!e(n) && !s.has(n)) { s.add(n), a.children = {}; for (const c in n) { const l = o ? o + "." + c : c; t.length && t.indexOf(l) !== -1 || (a.children[c] = Ze(e, t, n[c], l)); } } return a; } function Oe(e, t = [], n, o, s = !1, a = "") { const c = n ? n.value : void 0, l = c === o; if (s && !l && !Number.isNaN(o)) return { wasMutated: !0, path: a }; if (e(c) || e(o)) return { wasMutated: !1 }; const u = {}; for (let d in n.children) u[d] = !0; for (let d in o) u[d] = !0; const h = t.length > 0; for (let d in u) { const f = a ? a + "." + d : d; if (h && t.some((C) => C instanceof RegExp ? C.test(f) : f === C)) continue; const p = Oe(e, t, n.children[d], o[d], l, f); if (p.wasMutated) return p; } return { wasMutated: !1 }; } function vi(e = {}) { if (process.env.NODE_ENV === "production") return () => (t) => (n) => t(n); { let t = function(l, u, h, d) { return JSON.stringify(l, n(u, d), h); }, n = function(l, u) { let h = [], d = []; return u || (u = function(f, p) { return h[0] === p ? "[Circular ~]" : "[Circular ~." + d.slice(0, h.indexOf(p)).join(".") + "]"; }), function(f, p) { if (h.length > 0) { var m = h.indexOf(this); ~m ? h.splice(m + 1) : h.push(this), ~m ? d.splice(m, 1 / 0, f) : d.push(f), ~h.indexOf(p) && (p = u.call(this, f, p)); } else h.push(p); return l == null ? p : l.call(this, f, p); }; }, { isImmutable: o = xi, ignoredPaths: s, warnAfter: a = 32 } = e; const