From 67c072217ea7330086b2a2b7e2df1892f15e4faf Mon Sep 17 00:00:00 2001 From: edvincandon Date: Sat, 10 Feb 2024 06:56:49 +0000 Subject: [PATCH] deploy: eef0b835ea31528c30d69b2e622d8dab76f289fd --- dist/index.js | 7127 ++++++++++++++++++------------ lib/components/todo/TodoItem.tsx | 29 +- lib/store/actions.ts | 5 + lib/store/middleware.ts | 4 +- lib/store/reducer.ts | 8 +- lib/store/selectors.ts | 2 +- thunks/index.tsx | 4 +- thunks/thunk.ts | 8 +- 8 files changed, 4379 insertions(+), 2808 deletions(-) diff --git a/dist/index.js b/dist/index.js index 4200b10..8bf1194 100644 --- a/dist/index.js +++ b/dist/index.js @@ -403,7 +403,7 @@ var require_react_development = __commonJS((exports, module) => { } } } - var ReactElement = function(type, key, ref, self, source, owner, props) { + var ReactElement = function(type, key, ref, self2, source, owner, props) { var element = { $$typeof: REACT_ELEMENT_TYPE, type, @@ -424,7 +424,7 @@ var require_react_development = __commonJS((exports, module) => { configurable: false, enumerable: false, writable: false, - value: self + value: self2 }); Object.defineProperty(element, "_source", { configurable: false, @@ -444,7 +444,7 @@ var require_react_development = __commonJS((exports, module) => { var props = {}; var key = null; var ref = null; - var self = null; + var self2 = null; var source = null; if (config != null) { if (hasValidRef(config)) { @@ -459,7 +459,7 @@ var require_react_development = __commonJS((exports, module) => { } key = "" + config.key; } - self = config.__self === undefined ? null : config.__self; + self2 = config.__self === undefined ? null : config.__self; source = config.__source === undefined ? null : config.__source; for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { @@ -501,7 +501,7 @@ var require_react_development = __commonJS((exports, module) => { } } } - return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props); } function cloneAndReplaceKey(oldElement, newKey) { var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); @@ -515,7 +515,7 @@ var require_react_development = __commonJS((exports, module) => { var props = assign({}, element.props); var key = element.key; var ref = element.ref; - var self = element._self; + var self2 = element._self; var source = element._source; var owner = element._owner; if (config != null) { @@ -553,7 +553,7 @@ var require_react_development = __commonJS((exports, module) => { } props.children = childArray; } - return ReactElement(element.type, key, ref, self, source, owner, props); + return ReactElement(element.type, key, ref, self2, source, owner, props); } function isValidElement(object) { return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; @@ -22609,146 +22609,19 @@ var require_client = __commonJS((exports) => { var i; }); -// node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js -var require_use_sync_external_store_shim_development = __commonJS((exports) => { +// node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +var require_use_sync_external_store_with_selector_development = __commonJS((exports) => { var React3 = __toESM(require_react(), 1); if (true) { (function() { if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error); } - var ReactSharedInternals = React3.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - function error(format) { - { - { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - printWarning("error", format, args); - } - } - } - function printWarning(level, format, args) { - { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - if (stack !== "") { - format += "%s"; - args = args.concat([stack]); - } - var argsWithFormat = args.map(function(item) { - return String(item); - }); - argsWithFormat.unshift("Warning: " + format); - Function.prototype.apply.call(console[level], console, argsWithFormat); - } - } - function is(x, y) { - return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y; - } - var objectIs = typeof Object.is === "function" ? Object.is : is; - var useState4 = React3.useState, useEffect4 = React3.useEffect, useLayoutEffect4 = React3.useLayoutEffect, useDebugValue2 = React3.useDebugValue; - var didWarnOld18Alpha = false; - var didWarnUncachedGetSnapshot = false; - function useSyncExternalStore2(subscribe, getSnapshot, getServerSnapshot) { - { - if (!didWarnOld18Alpha) { - if (React3.startTransition !== undefined) { - didWarnOld18Alpha = true; - error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."); - } - } - } - var value = getSnapshot(); - { - if (!didWarnUncachedGetSnapshot) { - var cachedValue = getSnapshot(); - if (!objectIs(value, cachedValue)) { - error("The result of getSnapshot should be cached to avoid an infinite loop"); - didWarnUncachedGetSnapshot = true; - } - } - } - var _useState = useState4({ - inst: { - value, - getSnapshot - } - }), inst = _useState[0].inst, forceUpdate = _useState[1]; - useLayoutEffect4(function() { - inst.value = value; - inst.getSnapshot = getSnapshot; - if (checkIfSnapshotChanged(inst)) { - forceUpdate({ - inst - }); - } - }, [subscribe, value, getSnapshot]); - useEffect4(function() { - if (checkIfSnapshotChanged(inst)) { - forceUpdate({ - inst - }); - } - var handleStoreChange = function() { - if (checkIfSnapshotChanged(inst)) { - forceUpdate({ - inst - }); - } - }; - return subscribe(handleStoreChange); - }, [subscribe]); - useDebugValue2(value); - return value; - } - function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - var prevValue = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(prevValue, nextValue); - } catch (error2) { - return true; - } - } - function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) { - return getSnapshot(); - } - var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); - var isServerEnvironment = !canUseDOM; - var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore2; - var useSyncExternalStore$2 = React3.useSyncExternalStore !== undefined ? React3.useSyncExternalStore : shim; - exports.useSyncExternalStore = useSyncExternalStore$2; - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error); - } - })(); - } -}); - -// node_modules/use-sync-external-store/shim/index.js -var require_shim = __commonJS((exports, module) => { - if (false) { - } else { - module.exports = require_use_sync_external_store_shim_development(); - } -}); - -// node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js -var require_with_selector_development = __commonJS((exports) => { - var React3 = __toESM(require_react(), 1); - if (true) { - (function() { - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error); - } - var shim = require_shim(); function is(x, y) { return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y; } var objectIs = typeof Object.is === "function" ? Object.is : is; - var useSyncExternalStore = shim.useSyncExternalStore; + var useSyncExternalStore2 = React3.useSyncExternalStore; var useRef4 = React3.useRef, useEffect4 = React3.useEffect, useMemo4 = React3.useMemo, useDebugValue2 = React3.useDebugValue; function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { var instRef = useRef4(null); @@ -22805,7 +22678,7 @@ var require_with_selector_development = __commonJS((exports) => { }; return [getSnapshotWithSelector, getServerSnapshotWithSelector]; }, [getSnapshot, getServerSnapshot, selector, isEqual]), getSelection = _useMemo[0], getServerSelection = _useMemo[1]; - var value = useSyncExternalStore(subscribe, getSelection, getServerSelection); + var value = useSyncExternalStore2(subscribe, getSelection, getServerSelection); useEffect4(function() { inst.hasValue = true; inst.value = value; @@ -22821,459 +22694,32 @@ var require_with_selector_development = __commonJS((exports) => { } }); -// node_modules/use-sync-external-store/shim/with-selector.js +// node_modules/use-sync-external-store/with-selector.js var require_with_selector = __commonJS((exports, module) => { if (false) { } else { - module.exports = require_with_selector_development(); - } -}); - -// node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js -var require_react_is_development = __commonJS((exports) => { - if (true) { - (function() { - var hasSymbol = typeof Symbol === "function" && Symbol.for; - var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103; - var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106; - var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107; - var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108; - var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114; - var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109; - var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110; - var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111; - var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111; - var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112; - var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113; - var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120; - var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115; - var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116; - var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121; - var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117; - var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118; - var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; - function isValidElementType(type) { - return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); - } - function typeOf(object) { - if (typeof object === "object" && object !== null) { - var $$typeof = object.$$typeof; - switch ($$typeof) { - case REACT_ELEMENT_TYPE: - var type = object.type; - switch (type) { - case REACT_ASYNC_MODE_TYPE: - case REACT_CONCURRENT_MODE_TYPE: - case REACT_FRAGMENT_TYPE: - case REACT_PROFILER_TYPE: - case REACT_STRICT_MODE_TYPE: - case REACT_SUSPENSE_TYPE: - return type; - default: - var $$typeofType = type && type.$$typeof; - switch ($$typeofType) { - case REACT_CONTEXT_TYPE: - case REACT_FORWARD_REF_TYPE: - case REACT_LAZY_TYPE: - case REACT_MEMO_TYPE: - case REACT_PROVIDER_TYPE: - return $$typeofType; - default: - return $$typeof; - } - } - case REACT_PORTAL_TYPE: - return $$typeof; - } - } - return; - } - var AsyncMode = REACT_ASYNC_MODE_TYPE; - var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; - var ContextConsumer = REACT_CONTEXT_TYPE; - var ContextProvider = REACT_PROVIDER_TYPE; - var Element = REACT_ELEMENT_TYPE; - var ForwardRef = REACT_FORWARD_REF_TYPE; - var Fragment3 = REACT_FRAGMENT_TYPE; - var Lazy = REACT_LAZY_TYPE; - var Memo = REACT_MEMO_TYPE; - var Portal = REACT_PORTAL_TYPE; - var Profiler = REACT_PROFILER_TYPE; - var StrictMode = REACT_STRICT_MODE_TYPE; - var Suspense = REACT_SUSPENSE_TYPE; - var hasWarnedAboutDeprecatedIsAsyncMode = false; - function isAsyncMode(object) { - { - if (!hasWarnedAboutDeprecatedIsAsyncMode) { - hasWarnedAboutDeprecatedIsAsyncMode = true; - 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."); - } - } - return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; - } - function isConcurrentMode(object) { - return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; - } - function isContextConsumer(object) { - return typeOf(object) === REACT_CONTEXT_TYPE; - } - function isContextProvider(object) { - return typeOf(object) === REACT_PROVIDER_TYPE; - } - function isElement(object) { - return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; - } - function isForwardRef(object) { - return typeOf(object) === REACT_FORWARD_REF_TYPE; - } - function isFragment(object) { - return typeOf(object) === REACT_FRAGMENT_TYPE; - } - function isLazy(object) { - return typeOf(object) === REACT_LAZY_TYPE; - } - function isMemo(object) { - return typeOf(object) === REACT_MEMO_TYPE; - } - function isPortal(object) { - return typeOf(object) === REACT_PORTAL_TYPE; - } - function isProfiler(object) { - return typeOf(object) === REACT_PROFILER_TYPE; - } - function isStrictMode(object) { - return typeOf(object) === REACT_STRICT_MODE_TYPE; - } - function isSuspense(object) { - return typeOf(object) === REACT_SUSPENSE_TYPE; - } - exports.AsyncMode = AsyncMode; - exports.ConcurrentMode = ConcurrentMode; - exports.ContextConsumer = ContextConsumer; - exports.ContextProvider = ContextProvider; - exports.Element = Element; - exports.ForwardRef = ForwardRef; - exports.Fragment = Fragment3; - exports.Lazy = Lazy; - exports.Memo = Memo; - exports.Portal = Portal; - exports.Profiler = Profiler; - exports.StrictMode = StrictMode; - exports.Suspense = Suspense; - exports.isAsyncMode = isAsyncMode; - exports.isConcurrentMode = isConcurrentMode; - exports.isContextConsumer = isContextConsumer; - exports.isContextProvider = isContextProvider; - exports.isElement = isElement; - exports.isForwardRef = isForwardRef; - exports.isFragment = isFragment; - exports.isLazy = isLazy; - exports.isMemo = isMemo; - exports.isPortal = isPortal; - exports.isProfiler = isProfiler; - exports.isStrictMode = isStrictMode; - exports.isSuspense = isSuspense; - exports.isValidElementType = isValidElementType; - exports.typeOf = typeOf; - })(); - } -}); - -// node_modules/hoist-non-react-statics/node_modules/react-is/index.js -var require_react_is = __commonJS((exports, module) => { - var react_is_development = __toESM(require_react_is_development(), 1); - if (false) { - } else { - module.exports = react_is_development; - } -}); - -// node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js -var require_hoist_non_react_statics_cjs = __commonJS((exports, module) => { - var reactIs = __toESM(require_react_is(), 1); - var getStatics = function(component) { - if (reactIs.isMemo(component)) { - return MEMO_STATICS; - } - return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS; - }; - var hoistNonReactStatics = function(targetComponent, sourceComponent, blacklist) { - if (typeof sourceComponent !== "string") { - if (objectPrototype) { - var inheritedComponent = getPrototypeOf(sourceComponent); - if (inheritedComponent && inheritedComponent !== objectPrototype) { - hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); - } - } - var keys = getOwnPropertyNames(sourceComponent); - if (getOwnPropertySymbols) { - keys = keys.concat(getOwnPropertySymbols(sourceComponent)); - } - var targetStatics = getStatics(targetComponent); - var sourceStatics = getStatics(sourceComponent); - for (var i = 0;i < keys.length; ++i) { - var key = keys[i]; - if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { - var descriptor = getOwnPropertyDescriptor(sourceComponent, key); - try { - defineProperty(targetComponent, key, descriptor); - } catch (e) { - } - } - } - } - return targetComponent; - }; - var REACT_STATICS = { - childContextTypes: true, - contextType: true, - contextTypes: true, - defaultProps: true, - displayName: true, - getDefaultProps: true, - getDerivedStateFromError: true, - getDerivedStateFromProps: true, - mixins: true, - propTypes: true, - type: true - }; - var KNOWN_STATICS = { - name: true, - length: true, - prototype: true, - caller: true, - callee: true, - arguments: true, - arity: true - }; - var FORWARD_REF_STATICS = { - $$typeof: true, - render: true, - defaultProps: true, - displayName: true, - propTypes: true - }; - var MEMO_STATICS = { - $$typeof: true, - compare: true, - defaultProps: true, - displayName: true, - propTypes: true, - type: true - }; - var TYPE_STATICS = {}; - TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; - TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; - var defineProperty = Object.defineProperty; - var getOwnPropertyNames = Object.getOwnPropertyNames; - var getOwnPropertySymbols = Object.getOwnPropertySymbols; - var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - var getPrototypeOf = Object.getPrototypeOf; - var objectPrototype = Object.prototype; - module.exports = hoistNonReactStatics; -}); - -// node_modules/react-is/cjs/react-is.development.js -var require_react_is_development2 = __commonJS((exports) => { - if (true) { - (function() { - var REACT_ELEMENT_TYPE = Symbol.for("react.element"); - var REACT_PORTAL_TYPE = Symbol.for("react.portal"); - var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); - var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); - var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); - var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); - var REACT_CONTEXT_TYPE = Symbol.for("react.context"); - var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"); - var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); - var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); - var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); - var REACT_MEMO_TYPE = Symbol.for("react.memo"); - var REACT_LAZY_TYPE = Symbol.for("react.lazy"); - var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); - var enableScopeAPI = false; - var enableCacheElement = false; - var enableTransitionTracing = false; - var enableLegacyHidden = false; - var enableDebugTracing = false; - var REACT_MODULE_REFERENCE; - { - REACT_MODULE_REFERENCE = Symbol.for("react.module.reference"); - } - function isValidElementType(type) { - if (typeof type === "string" || typeof type === "function") { - return true; - } - if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) { - return true; - } - if (typeof type === "object" && type !== null) { - if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { - return true; - } - } - return false; - } - function typeOf(object) { - if (typeof object === "object" && object !== null) { - var $$typeof = object.$$typeof; - switch ($$typeof) { - case REACT_ELEMENT_TYPE: - var type = object.type; - switch (type) { - case REACT_FRAGMENT_TYPE: - case REACT_PROFILER_TYPE: - case REACT_STRICT_MODE_TYPE: - case REACT_SUSPENSE_TYPE: - case REACT_SUSPENSE_LIST_TYPE: - return type; - default: - var $$typeofType = type && type.$$typeof; - switch ($$typeofType) { - case REACT_SERVER_CONTEXT_TYPE: - case REACT_CONTEXT_TYPE: - case REACT_FORWARD_REF_TYPE: - case REACT_LAZY_TYPE: - case REACT_MEMO_TYPE: - case REACT_PROVIDER_TYPE: - return $$typeofType; - default: - return $$typeof; - } - } - case REACT_PORTAL_TYPE: - return $$typeof; - } - } - return; - } - var ContextConsumer = REACT_CONTEXT_TYPE; - var ContextProvider = REACT_PROVIDER_TYPE; - var Element = REACT_ELEMENT_TYPE; - var ForwardRef = REACT_FORWARD_REF_TYPE; - var Fragment3 = REACT_FRAGMENT_TYPE; - var Lazy = REACT_LAZY_TYPE; - var Memo = REACT_MEMO_TYPE; - var Portal = REACT_PORTAL_TYPE; - var Profiler = REACT_PROFILER_TYPE; - var StrictMode = REACT_STRICT_MODE_TYPE; - var Suspense = REACT_SUSPENSE_TYPE; - var SuspenseList = REACT_SUSPENSE_LIST_TYPE; - var hasWarnedAboutDeprecatedIsAsyncMode = false; - var hasWarnedAboutDeprecatedIsConcurrentMode = false; - function isAsyncMode(object) { - { - if (!hasWarnedAboutDeprecatedIsAsyncMode) { - hasWarnedAboutDeprecatedIsAsyncMode = true; - console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+."); - } - } - return false; - } - function isConcurrentMode(object) { - { - if (!hasWarnedAboutDeprecatedIsConcurrentMode) { - hasWarnedAboutDeprecatedIsConcurrentMode = true; - console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+."); - } - } - return false; - } - function isContextConsumer(object) { - return typeOf(object) === REACT_CONTEXT_TYPE; - } - function isContextProvider(object) { - return typeOf(object) === REACT_PROVIDER_TYPE; - } - function isElement(object) { - return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; - } - function isForwardRef(object) { - return typeOf(object) === REACT_FORWARD_REF_TYPE; - } - function isFragment(object) { - return typeOf(object) === REACT_FRAGMENT_TYPE; - } - function isLazy(object) { - return typeOf(object) === REACT_LAZY_TYPE; - } - function isMemo(object) { - return typeOf(object) === REACT_MEMO_TYPE; - } - function isPortal(object) { - return typeOf(object) === REACT_PORTAL_TYPE; - } - function isProfiler(object) { - return typeOf(object) === REACT_PROFILER_TYPE; - } - function isStrictMode(object) { - return typeOf(object) === REACT_STRICT_MODE_TYPE; - } - function isSuspense(object) { - return typeOf(object) === REACT_SUSPENSE_TYPE; - } - function isSuspenseList(object) { - return typeOf(object) === REACT_SUSPENSE_LIST_TYPE; - } - exports.ContextConsumer = ContextConsumer; - exports.ContextProvider = ContextProvider; - exports.Element = Element; - exports.ForwardRef = ForwardRef; - exports.Fragment = Fragment3; - exports.Lazy = Lazy; - exports.Memo = Memo; - exports.Portal = Portal; - exports.Profiler = Profiler; - exports.StrictMode = StrictMode; - exports.Suspense = Suspense; - exports.SuspenseList = SuspenseList; - exports.isAsyncMode = isAsyncMode; - exports.isConcurrentMode = isConcurrentMode; - exports.isContextConsumer = isContextConsumer; - exports.isContextProvider = isContextProvider; - exports.isElement = isElement; - exports.isForwardRef = isForwardRef; - exports.isFragment = isFragment; - exports.isLazy = isLazy; - exports.isMemo = isMemo; - exports.isPortal = isPortal; - exports.isProfiler = isProfiler; - exports.isStrictMode = isStrictMode; - exports.isSuspense = isSuspense; - exports.isSuspenseList = isSuspenseList; - exports.isValidElementType = isValidElementType; - exports.typeOf = typeOf; - })(); - } -}); - -// node_modules/react-is/index.js -var require_react_is2 = __commonJS((exports, module) => { - var react_is_development = __toESM(require_react_is_development2(), 1); - if (false) { - } else { - module.exports = react_is_development; + module.exports = require_use_sync_external_store_with_selector_development(); } }); // node_modules/react/cjs/react-jsx-dev-runtime.development.js -var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { - var React7 = __toESM(require_react(), 1); +var require_react_jsx_dev_runtime_development = __commonJS((exports) => { + var React4 = __toESM(require_react(), 1); if (true) { (function() { - var REACT_ELEMENT_TYPE = Symbol.for("react.element"); - var REACT_PORTAL_TYPE = Symbol.for("react.portal"); - var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); - var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); - var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); - var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); - var REACT_CONTEXT_TYPE = Symbol.for("react.context"); - var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); - var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); - var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); - var REACT_MEMO_TYPE = Symbol.for("react.memo"); - var REACT_LAZY_TYPE = Symbol.for("react.lazy"); - var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); + var REACT_ELEMENT_TYPE2 = Symbol.for("react.element"); + var REACT_PORTAL_TYPE2 = Symbol.for("react.portal"); + var REACT_FRAGMENT_TYPE2 = Symbol.for("react.fragment"); + var REACT_STRICT_MODE_TYPE2 = Symbol.for("react.strict_mode"); + var REACT_PROFILER_TYPE2 = Symbol.for("react.profiler"); + var REACT_PROVIDER_TYPE2 = Symbol.for("react.provider"); + var REACT_CONTEXT_TYPE2 = Symbol.for("react.context"); + var REACT_FORWARD_REF_TYPE2 = Symbol.for("react.forward_ref"); + var REACT_SUSPENSE_TYPE2 = Symbol.for("react.suspense"); + var REACT_SUSPENSE_LIST_TYPE2 = Symbol.for("react.suspense_list"); + var REACT_MEMO_TYPE2 = Symbol.for("react.memo"); + var REACT_LAZY_TYPE2 = Symbol.for("react.lazy"); + var REACT_OFFSCREEN_TYPE2 = Symbol.for("react.offscreen"); var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var FAUX_ITERATOR_SYMBOL = "@@iterator"; function getIteratorFn(maybeIterable) { @@ -23286,7 +22732,7 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { } return null; } - var ReactSharedInternals = React7.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + var ReactSharedInternals = React4.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function error(format) { { { @@ -23321,15 +22767,15 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { { REACT_MODULE_REFERENCE = Symbol.for("react.module.reference"); } - function isValidElementType2(type) { + function isValidElementType(type) { if (typeof type === "string" || typeof type === "function") { return true; } - if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) { + if (type === REACT_FRAGMENT_TYPE2 || type === REACT_PROFILER_TYPE2 || enableDebugTracing || type === REACT_STRICT_MODE_TYPE2 || type === REACT_SUSPENSE_TYPE2 || type === REACT_SUSPENSE_LIST_TYPE2 || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE2 || enableScopeAPI || enableCacheElement || enableTransitionTracing) { return true; } if (typeof type === "object" && type !== null) { - if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { + if (type.$$typeof === REACT_LAZY_TYPE2 || type.$$typeof === REACT_MEMO_TYPE2 || type.$$typeof === REACT_PROVIDER_TYPE2 || type.$$typeof === REACT_CONTEXT_TYPE2 || type.$$typeof === REACT_FORWARD_REF_TYPE2 || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { return true; } } @@ -23362,42 +22808,42 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { return type; } switch (type) { - case REACT_FRAGMENT_TYPE: + case REACT_FRAGMENT_TYPE2: return "Fragment"; - case REACT_PORTAL_TYPE: + case REACT_PORTAL_TYPE2: return "Portal"; - case REACT_PROFILER_TYPE: + case REACT_PROFILER_TYPE2: return "Profiler"; - case REACT_STRICT_MODE_TYPE: + case REACT_STRICT_MODE_TYPE2: return "StrictMode"; - case REACT_SUSPENSE_TYPE: + case REACT_SUSPENSE_TYPE2: return "Suspense"; - case REACT_SUSPENSE_LIST_TYPE: + case REACT_SUSPENSE_LIST_TYPE2: return "SuspenseList"; } if (typeof type === "object") { switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: + case REACT_CONTEXT_TYPE2: var context = type; return getContextName(context) + ".Consumer"; - case REACT_PROVIDER_TYPE: + case REACT_PROVIDER_TYPE2: var provider = type; return getContextName(provider._context) + ".Provider"; - case REACT_FORWARD_REF_TYPE: + case REACT_FORWARD_REF_TYPE2: return getWrappedName(type, type.render, "ForwardRef"); - case REACT_MEMO_TYPE: + case REACT_MEMO_TYPE2: var outerName = type.displayName || null; if (outerName !== null) { return outerName; } return getComponentNameFromType(type.type) || "Memo"; - case REACT_LAZY_TYPE: { + case REACT_LAZY_TYPE2: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return getComponentNameFromType(init(payload)); - } catch (x2) { + } catch (x) { return null; } } @@ -23485,18 +22931,18 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { } } var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; - var prefix2; + var prefix; function describeBuiltInComponentFrame(name, source, ownerFn) { { - if (prefix2 === undefined) { + if (prefix === undefined) { try { throw Error(); - } catch (x2) { - var match = x2.stack.trim().match(/\n( *(at )?)/); - prefix2 = match && match[1] || ""; + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ""; } } - return "\n" + prefix2 + name; + return "\n" + prefix + name; } } var reentry = false; @@ -23505,12 +22951,12 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map; componentFrameCache = new PossiblyWeakMap; } - function describeNativeComponentFrame(fn2, construct) { - if (!fn2 || reentry) { + function describeNativeComponentFrame(fn, construct) { + if (!fn || reentry) { return ""; } { - var frame = componentFrameCache.get(fn2); + var frame = componentFrameCache.get(fn); if (frame !== undefined) { return frame; } @@ -23538,54 +22984,54 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { if (typeof Reflect === "object" && Reflect.construct) { try { Reflect.construct(Fake, []); - } catch (x2) { - control = x2; + } catch (x) { + control = x; } - Reflect.construct(fn2, [], Fake); + Reflect.construct(fn, [], Fake); } else { try { Fake.call(); - } catch (x2) { - control = x2; + } catch (x) { + control = x; } - fn2.call(Fake.prototype); + fn.call(Fake.prototype); } } else { try { throw Error(); - } catch (x2) { - control = x2; + } catch (x) { + control = x; } - fn2(); + fn(); } } catch (sample) { if (sample && control && typeof sample.stack === "string") { var sampleLines = sample.stack.split("\n"); var controlLines = control.stack.split("\n"); - var s2 = sampleLines.length - 1; - var c2 = controlLines.length - 1; - while (s2 >= 1 && c2 >= 0 && sampleLines[s2] !== controlLines[c2]) { - c2--; - } - for (;s2 >= 1 && c2 >= 0; s2--, c2--) { - if (sampleLines[s2] !== controlLines[c2]) { - if (s2 !== 1 || c2 !== 1) { + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + c--; + } + for (;s >= 1 && c >= 0; s--, c--) { + if (sampleLines[s] !== controlLines[c]) { + if (s !== 1 || c !== 1) { do { - s2--; - c2--; - if (c2 < 0 || sampleLines[s2] !== controlLines[c2]) { - var _frame = "\n" + sampleLines[s2].replace(" at new ", " at "); - if (fn2.displayName && _frame.includes("")) { - _frame = _frame.replace("", fn2.displayName); + s--; + c--; + if (c < 0 || sampleLines[s] !== controlLines[c]) { + var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); + if (fn.displayName && _frame.includes("")) { + _frame = _frame.replace("", fn.displayName); } { - if (typeof fn2 === "function") { - componentFrameCache.set(fn2, _frame); + if (typeof fn === "function") { + componentFrameCache.set(fn, _frame); } } return _frame; } - } while (s2 >= 1 && c2 >= 0); + } while (s >= 1 && c >= 0); } break; } @@ -23599,18 +23045,18 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { } Error.prepareStackTrace = previousPrepareStackTrace; } - var name = fn2 ? fn2.displayName || fn2.name : ""; + var name = fn ? fn.displayName || fn.name : ""; var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; { - if (typeof fn2 === "function") { - componentFrameCache.set(fn2, syntheticFrame); + if (typeof fn === "function") { + componentFrameCache.set(fn, syntheticFrame); } } return syntheticFrame; } - function describeFunctionComponentFrame(fn2, source, ownerFn) { + function describeFunctionComponentFrame(fn, source, ownerFn) { { - return describeNativeComponentFrame(fn2, false); + return describeNativeComponentFrame(fn, false); } } function shouldConstruct(Component2) { @@ -23630,24 +23076,24 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { return describeBuiltInComponentFrame(type); } switch (type) { - case REACT_SUSPENSE_TYPE: + case REACT_SUSPENSE_TYPE2: return describeBuiltInComponentFrame("Suspense"); - case REACT_SUSPENSE_LIST_TYPE: + case REACT_SUSPENSE_LIST_TYPE2: return describeBuiltInComponentFrame("SuspenseList"); } if (typeof type === "object") { switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: + case REACT_FORWARD_REF_TYPE2: return describeFunctionComponentFrame(type.render); - case REACT_MEMO_TYPE: + case REACT_MEMO_TYPE2: return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); - case REACT_LAZY_TYPE: { + case REACT_LAZY_TYPE2: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); - } catch (x2) { + } catch (x) { } } } @@ -23670,9 +23116,9 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { } function checkPropTypes(typeSpecs, values, location, componentName, element) { { - var has = Function.call.bind(hasOwnProperty); + var has2 = Function.call.bind(hasOwnProperty); for (var typeSpecName in typeSpecs) { - if (has(typeSpecs, typeSpecName)) { + if (has2(typeSpecs, typeSpecName)) { var error$1 = undefined; try { if (typeof typeSpecs[typeSpecName] !== "function") { @@ -23700,8 +23146,8 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { } } var isArrayImpl = Array.isArray; - function isArray(a2) { - return isArrayImpl(a2); + function isArray(a) { + return isArrayImpl(a); } function typeName(value) { { @@ -23766,9 +23212,9 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { } return config.key !== undefined; } - function warnIfStringRefCannotBeAutoConverted(config, self) { + function warnIfStringRefCannotBeAutoConverted(config, self2) { { - if (typeof config.ref === "string" && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { + if (typeof config.ref === "string" && ReactCurrentOwner.current && self2 && ReactCurrentOwner.current.stateNode !== self2) { var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); if (!didWarnAboutStringRefs[componentName]) { error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref); @@ -23807,9 +23253,9 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { }); } } - var ReactElement = function(type, key, ref, self, source, owner, props) { + var ReactElement = function(type, key, ref, self2, source, owner, props) { var element = { - $$typeof: REACT_ELEMENT_TYPE, + $$typeof: REACT_ELEMENT_TYPE2, type, key, ref, @@ -23828,7 +23274,7 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { configurable: false, enumerable: false, writable: false, - value: self + value: self2 }); Object.defineProperty(element, "_source", { configurable: false, @@ -23843,7 +23289,7 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { } return element; }; - function jsxDEV(type, config, maybeKey, source, self) { + function jsxDEV(type, config, maybeKey, source, self2) { { var propName; var props = {}; @@ -23863,7 +23309,7 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { } if (hasValidRef(config)) { ref = config.ref; - warnIfStringRefCannotBeAutoConverted(config, self); + warnIfStringRefCannotBeAutoConverted(config, self2); } for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { @@ -23887,7 +23333,7 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { defineRefPropWarningGetter(props, displayName); } } - return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props); } } var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; @@ -23909,7 +23355,7 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { } function isValidElement2(object) { { - return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE2; } } function getDeclarationErrorAddendum() { @@ -23972,8 +23418,8 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { return; } if (isArray(node)) { - for (var i2 = 0;i2 < node.length; i2++) { - var child = node[i2]; + for (var i = 0;i < node.length; i++) { + var child = node[i]; if (isValidElement2(child)) { validateExplicitKey(child, parentType); } @@ -24007,7 +23453,7 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { var propTypes; if (typeof type === "function") { propTypes = type.propTypes; - } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) { + } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE2 || type.$$typeof === REACT_MEMO_TYPE2)) { propTypes = type.propTypes; } else { return; @@ -24028,8 +23474,8 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { function validateFragmentProps(fragment) { { var keys = Object.keys(fragment.props); - for (var i2 = 0;i2 < keys.length; i2++) { - var key = keys[i2]; + for (var i = 0;i < keys.length; i++) { + var key = keys[i]; if (key !== "children" && key !== "key") { setCurrentlyValidatingElement$1(fragment); error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key); @@ -24044,9 +23490,9 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { } } } - function jsxWithValidation(type, props, key, isStaticChildren, source, self) { + function jsxWithValidation(type, props, key, isStaticChildren, source, self2) { { - var validType = isValidElementType2(type); + var validType = isValidElementType(type); if (!validType) { var info = ""; if (type === undefined || typeof type === "object" && type !== null && Object.keys(type).length === 0) { @@ -24063,7 +23509,7 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { typeString = "null"; } else if (isArray(type)) { typeString = "array"; - } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE2) { typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"; info = " Did you accidentally export a JSX literal instead of a component?"; } else { @@ -24071,7 +23517,7 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { } error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info); } - var element = jsxDEV(type, props, key, source, self); + var element = jsxDEV(type, props, key, source, self2); if (element == null) { return element; } @@ -24080,8 +23526,8 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { if (children !== undefined) { if (isStaticChildren) { if (isArray(children)) { - for (var i2 = 0;i2 < children.length; i2++) { - validateChildKeys(children[i2], type); + for (var i = 0;i < children.length; i++) { + validateChildKeys(children[i], type); } if (Object.freeze) { Object.freeze(children); @@ -24094,7 +23540,7 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { } } } - if (type === REACT_FRAGMENT_TYPE) { + if (type === REACT_FRAGMENT_TYPE2) { validateFragmentProps(element); } else { validatePropTypes(element); @@ -24103,14 +23549,14 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => { } } var jsxDEV$1 = jsxWithValidation; - exports2.Fragment = REACT_FRAGMENT_TYPE; - exports2.jsxDEV = jsxDEV$1; + exports.Fragment = REACT_FRAGMENT_TYPE2; + exports.jsxDEV = jsxDEV$1; })(); } }); // node_modules/react/jsx-dev-runtime.js -var require_jsx_dev_runtime = __commonJS((exports2, module) => { +var require_jsx_dev_runtime = __commonJS((exports, module) => { var react_jsx_dev_runtime_development = __toESM(require_react_jsx_dev_runtime_development(), 1); if (false) { } else { @@ -24118,171 +23564,1745 @@ var require_jsx_dev_runtime = __commonJS((exports2, module) => { } }); -// usecases/index.tsx -var import_react12 = __toESM(require_react(), 1); -var client = __toESM(require_client(), 1); - -// node_modules/react-router-dom/dist/index.js -var React2 = __toESM(require_react(), 1); -var ReactDOM = __toESM(require_react_dom(), 1); +// node_modules/lodash/_listCacheClear.js +var require__listCacheClear = __commonJS((exports, module) => { + var listCacheClear = function() { + this.__data__ = []; + this.size = 0; + }; + module.exports = listCacheClear; +}); -// node_modules/react-router/dist/index.js -var React = __toESM(require_react(), 1); +// node_modules/lodash/eq.js +var require_eq = __commonJS((exports, module) => { + var eq = function(value, other) { + return value === other || value !== value && other !== other; + }; + module.exports = eq; +}); -// node_modules/@remix-run/router/dist/router.js -var _extends = function() { - _extends = Object.assign ? Object.assign.bind() : function(target) { - for (var i = 1;i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } +// node_modules/lodash/_assocIndexOf.js +var require__assocIndexOf = __commonJS((exports, module) => { + var assocIndexOf = function(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; } } - return target; + return -1; }; - return _extends.apply(this, arguments); -}; -var createHashHistory = function(options) { - if (options === undefined) { - options = {}; - } - function createHashLocation(window2, globalHistory) { - let { - pathname = "/", - search = "", - hash = "" - } = parsePath(window2.location.hash.substr(1)); - if (!pathname.startsWith("/") && !pathname.startsWith(".")) { - pathname = "/" + pathname; + var eq = require_eq(); + module.exports = assocIndexOf; +}); + +// node_modules/lodash/_listCacheDelete.js +var require__listCacheDelete = __commonJS((exports, module) => { + var listCacheDelete = function(key) { + var data = this.__data__, index = assocIndexOf(data, key); + if (index < 0) { + return false; } - return createLocation("", { - pathname, - search, - hash - }, globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || "default"); - } - function createHashHref(window2, to) { - let base = window2.document.querySelector("base"); - let href = ""; - if (base && base.getAttribute("href")) { - let url = window2.location.href; - let hashIndex = url.indexOf("#"); - href = hashIndex === -1 ? url : url.slice(0, hashIndex); + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); } - return href + "#" + (typeof to === "string" ? to : createPath(to)); - } - function validateHashLocation(location, to) { - warning(location.pathname.charAt(0) === "/", "relative pathnames are not supported in hash history.push(" + JSON.stringify(to) + ")"); - } - return getUrlBasedHistory(createHashLocation, createHashHref, validateHashLocation, options); -}; -var invariant = function(value, message) { - if (value === false || value === null || typeof value === "undefined") { - throw new Error(message); - } -}; -var warning = function(cond, message) { - if (!cond) { - if (typeof console !== "undefined") - console.warn(message); + --this.size; + return true; + }; + var assocIndexOf = require__assocIndexOf(); + var arrayProto = Array.prototype; + var splice = arrayProto.splice; + module.exports = listCacheDelete; +}); + +// node_modules/lodash/_listCacheGet.js +var require__listCacheGet = __commonJS((exports, module) => { + var listCacheGet = function(key) { + var data = this.__data__, index = assocIndexOf(data, key); + return index < 0 ? undefined : data[index][1]; + }; + var assocIndexOf = require__assocIndexOf(); + module.exports = listCacheGet; +}); + +// node_modules/lodash/_listCacheHas.js +var require__listCacheHas = __commonJS((exports, module) => { + var listCacheHas = function(key) { + return assocIndexOf(this.__data__, key) > -1; + }; + var assocIndexOf = require__assocIndexOf(); + module.exports = listCacheHas; +}); + +// node_modules/lodash/_listCacheSet.js +var require__listCacheSet = __commonJS((exports, module) => { + var listCacheSet = function(key, value) { + var data = this.__data__, index = assocIndexOf(data, key); + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + }; + var assocIndexOf = require__assocIndexOf(); + module.exports = listCacheSet; +}); + +// node_modules/lodash/_ListCache.js +var require__ListCache = __commonJS((exports, module) => { + var ListCache = function(entries) { + var index = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + }; + var listCacheClear = require__listCacheClear(); + var listCacheDelete = require__listCacheDelete(); + var listCacheGet = require__listCacheGet(); + var listCacheHas = require__listCacheHas(); + var listCacheSet = require__listCacheSet(); + ListCache.prototype.clear = listCacheClear; + ListCache.prototype["delete"] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + module.exports = ListCache; +}); + +// node_modules/lodash/_stackClear.js +var require__stackClear = __commonJS((exports, module) => { + var stackClear = function() { + this.__data__ = new ListCache; + this.size = 0; + }; + var ListCache = require__ListCache(); + module.exports = stackClear; +}); + +// node_modules/lodash/_stackDelete.js +var require__stackDelete = __commonJS((exports, module) => { + var stackDelete = function(key) { + var data = this.__data__, result = data["delete"](key); + this.size = data.size; + return result; + }; + module.exports = stackDelete; +}); + +// node_modules/lodash/_stackGet.js +var require__stackGet = __commonJS((exports, module) => { + var stackGet = function(key) { + return this.__data__.get(key); + }; + module.exports = stackGet; +}); + +// node_modules/lodash/_stackHas.js +var require__stackHas = __commonJS((exports, module) => { + var stackHas = function(key) { + return this.__data__.has(key); + }; + module.exports = stackHas; +}); + +// node_modules/lodash/_freeGlobal.js +var require__freeGlobal = __commonJS((exports, module) => { + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + module.exports = freeGlobal; +}); + +// node_modules/lodash/_root.js +var require__root = __commonJS((exports, module) => { + var freeGlobal = require__freeGlobal(); + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function("return this")(); + module.exports = root; +}); + +// node_modules/lodash/_Symbol.js +var require__Symbol = __commonJS((exports, module) => { + var root = require__root(); + var Symbol2 = root.Symbol; + module.exports = Symbol2; +}); + +// node_modules/lodash/_getRawTag.js +var require__getRawTag = __commonJS((exports, module) => { + var getRawTag = function(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { - throw new Error(message); + value[symToStringTag] = undefined; + var unmasked = true; } catch (e) { } - } -}; -var createKey = function() { - return Math.random().toString(36).substr(2, 8); -}; -var getHistoryState = function(location, index) { - return { - usr: location.state, - key: location.key, - idx: index - }; -}; -var createLocation = function(current, to, state, key) { - if (state === undefined) { - state = null; - } - let location = _extends({ - pathname: typeof current === "string" ? current : current.pathname, - search: "", - hash: "" - }, typeof to === "string" ? parsePath(to) : to, { - state, - key: to && to.key || key || createKey() - }); - return location; -}; -var createPath = function(_ref) { - let { - pathname = "/", - search = "", - hash = "" - } = _ref; - if (search && search !== "?") - pathname += search.charAt(0) === "?" ? search : "?" + search; - if (hash && hash !== "#") - pathname += hash.charAt(0) === "#" ? hash : "#" + hash; - return pathname; -}; -var parsePath = function(path) { - let parsedPath = {}; - if (path) { - let hashIndex = path.indexOf("#"); - if (hashIndex >= 0) { - parsedPath.hash = path.substr(hashIndex); - path = path.substr(0, hashIndex); + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } } - let searchIndex = path.indexOf("?"); - if (searchIndex >= 0) { - parsedPath.search = path.substr(searchIndex); - path = path.substr(0, searchIndex); + return result; + }; + var Symbol2 = require__Symbol(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var nativeObjectToString = objectProto.toString; + var symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined; + module.exports = getRawTag; +}); + +// node_modules/lodash/_objectToString.js +var require__objectToString = __commonJS((exports, module) => { + var objectToString = function(value) { + return nativeObjectToString.call(value); + }; + var objectProto = Object.prototype; + var nativeObjectToString = objectProto.toString; + module.exports = objectToString; +}); + +// node_modules/lodash/_baseGetTag.js +var require__baseGetTag = __commonJS((exports, module) => { + var baseGetTag = function(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; } - if (path) { - parsedPath.pathname = path; + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + }; + var Symbol2 = require__Symbol(); + var getRawTag = require__getRawTag(); + var objectToString = require__objectToString(); + var nullTag = "[object Null]"; + var undefinedTag = "[object Undefined]"; + var symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined; + module.exports = baseGetTag; +}); + +// node_modules/lodash/isObject.js +var require_isObject = __commonJS((exports, module) => { + var isObject = function(value) { + var type = typeof value; + return value != null && (type == "object" || type == "function"); + }; + module.exports = isObject; +}); + +// node_modules/lodash/isFunction.js +var require_isFunction = __commonJS((exports, module) => { + var isFunction = function(value) { + if (!isObject(value)) { + return false; } - } - return parsedPath; -}; -var getUrlBasedHistory = function(getLocation, createHref, validateLocation, options) { - if (options === undefined) { - options = {}; - } - let { - window: window2 = document.defaultView, - v5Compat = false - } = options; - let globalHistory = window2.history; - let action = Action.Pop; - let listener = null; - let index = getIndex(); - if (index == null) { - index = 0; - globalHistory.replaceState(_extends({}, globalHistory.state, { - idx: index - }), ""); - } - function getIndex() { - let state = globalHistory.state || { - idx: null - }; - return state.idx; - } - function handlePop() { - action = Action.Pop; - let nextIndex = getIndex(); - let delta = nextIndex == null ? null : nextIndex - index; - index = nextIndex; - if (listener) { - listener({ - action, - location: history.location, - delta - }); + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + }; + var baseGetTag = require__baseGetTag(); + var isObject = require_isObject(); + var asyncTag = "[object AsyncFunction]"; + var funcTag = "[object Function]"; + var genTag = "[object GeneratorFunction]"; + var proxyTag = "[object Proxy]"; + module.exports = isFunction; +}); + +// node_modules/lodash/_coreJsData.js +var require__coreJsData = __commonJS((exports, module) => { + var root = require__root(); + var coreJsData = root["__core-js_shared__"]; + module.exports = coreJsData; +}); + +// node_modules/lodash/_isMasked.js +var require__isMasked = __commonJS((exports, module) => { + var isMasked = function(func) { + return !!maskSrcKey && maskSrcKey in func; + }; + var coreJsData = require__coreJsData(); + var maskSrcKey = function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); + return uid ? "Symbol(src)_1." + uid : ""; + }(); + module.exports = isMasked; +}); + +// node_modules/lodash/_toSource.js +var require__toSource = __commonJS((exports, module) => { + var toSource = function(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) { + } + try { + return func + ""; + } catch (e) { + } + } + return ""; + }; + var funcProto = Function.prototype; + var funcToString = funcProto.toString; + module.exports = toSource; +}); + +// node_modules/lodash/_baseIsNative.js +var require__baseIsNative = __commonJS((exports, module) => { + var baseIsNative = function(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + }; + var isFunction = require_isFunction(); + var isMasked = require__isMasked(); + var isObject = require_isObject(); + var toSource = require__toSource(); + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + var reIsHostCtor = /^\[object .+?Constructor\]$/; + var funcProto = Function.prototype; + var objectProto = Object.prototype; + var funcToString = funcProto.toString; + var hasOwnProperty = objectProto.hasOwnProperty; + var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); + module.exports = baseIsNative; +}); + +// node_modules/lodash/_getValue.js +var require__getValue = __commonJS((exports, module) => { + var getValue2 = function(object, key) { + return object == null ? undefined : object[key]; + }; + module.exports = getValue2; +}); + +// node_modules/lodash/_getNative.js +var require__getNative = __commonJS((exports, module) => { + var getNative = function(object, key) { + var value = getValue2(object, key); + return baseIsNative(value) ? value : undefined; + }; + var baseIsNative = require__baseIsNative(); + var getValue2 = require__getValue(); + module.exports = getNative; +}); + +// node_modules/lodash/_Map.js +var require__Map = __commonJS((exports, module) => { + var getNative = require__getNative(); + var root = require__root(); + var Map2 = getNative(root, "Map"); + module.exports = Map2; +}); + +// node_modules/lodash/_nativeCreate.js +var require__nativeCreate = __commonJS((exports, module) => { + var getNative = require__getNative(); + var nativeCreate = getNative(Object, "create"); + module.exports = nativeCreate; +}); + +// node_modules/lodash/_hashClear.js +var require__hashClear = __commonJS((exports, module) => { + var hashClear = function() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + }; + var nativeCreate = require__nativeCreate(); + module.exports = hashClear; +}); + +// node_modules/lodash/_hashDelete.js +var require__hashDelete = __commonJS((exports, module) => { + var hashDelete = function(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + }; + module.exports = hashDelete; +}); + +// node_modules/lodash/_hashGet.js +var require__hashGet = __commonJS((exports, module) => { + var hashGet = function(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + }; + var nativeCreate = require__nativeCreate(); + var HASH_UNDEFINED = "__lodash_hash_undefined__"; + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + module.exports = hashGet; +}); + +// node_modules/lodash/_hashHas.js +var require__hashHas = __commonJS((exports, module) => { + var hashHas = function(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); + }; + var nativeCreate = require__nativeCreate(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + module.exports = hashHas; +}); + +// node_modules/lodash/_hashSet.js +var require__hashSet = __commonJS((exports, module) => { + var hashSet = function(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value; + return this; + }; + var nativeCreate = require__nativeCreate(); + var HASH_UNDEFINED = "__lodash_hash_undefined__"; + module.exports = hashSet; +}); + +// node_modules/lodash/_Hash.js +var require__Hash = __commonJS((exports, module) => { + var Hash = function(entries) { + var index = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + }; + var hashClear = require__hashClear(); + var hashDelete = require__hashDelete(); + var hashGet = require__hashGet(); + var hashHas = require__hashHas(); + var hashSet = require__hashSet(); + Hash.prototype.clear = hashClear; + Hash.prototype["delete"] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + module.exports = Hash; +}); + +// node_modules/lodash/_mapCacheClear.js +var require__mapCacheClear = __commonJS((exports, module) => { + var mapCacheClear = function() { + this.size = 0; + this.__data__ = { + hash: new Hash, + map: new (Map2 || ListCache), + string: new Hash + }; + }; + var Hash = require__Hash(); + var ListCache = require__ListCache(); + var Map2 = require__Map(); + module.exports = mapCacheClear; +}); + +// node_modules/lodash/_isKeyable.js +var require__isKeyable = __commonJS((exports, module) => { + var isKeyable = function(value) { + var type = typeof value; + return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; + }; + module.exports = isKeyable; +}); + +// node_modules/lodash/_getMapData.js +var require__getMapData = __commonJS((exports, module) => { + var getMapData = function(map, key) { + var data = map.__data__; + return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; + }; + var isKeyable = require__isKeyable(); + module.exports = getMapData; +}); + +// node_modules/lodash/_mapCacheDelete.js +var require__mapCacheDelete = __commonJS((exports, module) => { + var mapCacheDelete = function(key) { + var result = getMapData(this, key)["delete"](key); + this.size -= result ? 1 : 0; + return result; + }; + var getMapData = require__getMapData(); + module.exports = mapCacheDelete; +}); + +// node_modules/lodash/_mapCacheGet.js +var require__mapCacheGet = __commonJS((exports, module) => { + var mapCacheGet = function(key) { + return getMapData(this, key).get(key); + }; + var getMapData = require__getMapData(); + module.exports = mapCacheGet; +}); + +// node_modules/lodash/_mapCacheHas.js +var require__mapCacheHas = __commonJS((exports, module) => { + var mapCacheHas = function(key) { + return getMapData(this, key).has(key); + }; + var getMapData = require__getMapData(); + module.exports = mapCacheHas; +}); + +// node_modules/lodash/_mapCacheSet.js +var require__mapCacheSet = __commonJS((exports, module) => { + var mapCacheSet = function(key, value) { + var data = getMapData(this, key), size = data.size; + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + }; + var getMapData = require__getMapData(); + module.exports = mapCacheSet; +}); + +// node_modules/lodash/_MapCache.js +var require__MapCache = __commonJS((exports, module) => { + var MapCache = function(entries) { + var index = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + }; + var mapCacheClear = require__mapCacheClear(); + var mapCacheDelete = require__mapCacheDelete(); + var mapCacheGet = require__mapCacheGet(); + var mapCacheHas = require__mapCacheHas(); + var mapCacheSet = require__mapCacheSet(); + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype["delete"] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + module.exports = MapCache; +}); + +// node_modules/lodash/_stackSet.js +var require__stackSet = __commonJS((exports, module) => { + var stackSet = function(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + }; + var ListCache = require__ListCache(); + var Map2 = require__Map(); + var MapCache = require__MapCache(); + var LARGE_ARRAY_SIZE = 200; + module.exports = stackSet; +}); + +// node_modules/lodash/_Stack.js +var require__Stack = __commonJS((exports, module) => { + var Stack = function(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + }; + var ListCache = require__ListCache(); + var stackClear = require__stackClear(); + var stackDelete = require__stackDelete(); + var stackGet = require__stackGet(); + var stackHas = require__stackHas(); + var stackSet = require__stackSet(); + Stack.prototype.clear = stackClear; + Stack.prototype["delete"] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + module.exports = Stack; +}); + +// node_modules/lodash/_arrayEach.js +var require__arrayEach = __commonJS((exports, module) => { + var arrayEach = function(array, iteratee) { + var index = -1, length = array == null ? 0 : array.length; + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + }; + module.exports = arrayEach; +}); + +// node_modules/lodash/_defineProperty.js +var require__defineProperty = __commonJS((exports, module) => { + var getNative = require__getNative(); + var defineProperty = function() { + try { + var func = getNative(Object, "defineProperty"); + func({}, "", {}); + return func; + } catch (e) { + } + }(); + module.exports = defineProperty; +}); + +// node_modules/lodash/_baseAssignValue.js +var require__baseAssignValue = __commonJS((exports, module) => { + var baseAssignValue = function(object, key, value) { + if (key == "__proto__" && defineProperty) { + defineProperty(object, key, { + configurable: true, + enumerable: true, + value, + writable: true + }); + } else { + object[key] = value; + } + }; + var defineProperty = require__defineProperty(); + module.exports = baseAssignValue; +}); + +// node_modules/lodash/_assignValue.js +var require__assignValue = __commonJS((exports, module) => { + var assignValue = function(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) { + baseAssignValue(object, key, value); + } + }; + var baseAssignValue = require__baseAssignValue(); + var eq = require_eq(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + module.exports = assignValue; +}); + +// node_modules/lodash/_copyObject.js +var require__copyObject = __commonJS((exports, module) => { + var copyObject = function(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + var index = -1, length = props.length; + while (++index < length) { + var key = props[index]; + var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + }; + var assignValue = require__assignValue(); + var baseAssignValue = require__baseAssignValue(); + module.exports = copyObject; +}); + +// node_modules/lodash/_baseTimes.js +var require__baseTimes = __commonJS((exports, module) => { + var baseTimes = function(n, iteratee) { + var index = -1, result = Array(n); + while (++index < n) { + result[index] = iteratee(index); + } + return result; + }; + module.exports = baseTimes; +}); + +// node_modules/lodash/isObjectLike.js +var require_isObjectLike = __commonJS((exports, module) => { + var isObjectLike = function(value) { + return value != null && typeof value == "object"; + }; + module.exports = isObjectLike; +}); + +// node_modules/lodash/_baseIsArguments.js +var require__baseIsArguments = __commonJS((exports, module) => { + var baseIsArguments = function(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + }; + var baseGetTag = require__baseGetTag(); + var isObjectLike = require_isObjectLike(); + var argsTag = "[object Arguments]"; + module.exports = baseIsArguments; +}); + +// node_modules/lodash/isArguments.js +var require_isArguments = __commonJS((exports, module) => { + var baseIsArguments = require__baseIsArguments(); + var isObjectLike = require_isObjectLike(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + var isArguments = baseIsArguments(function() { + return arguments; + }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); + }; + module.exports = isArguments; +}); + +// node_modules/lodash/isArray.js +var require_isArray = __commonJS((exports, module) => { + var isArray = Array.isArray; + module.exports = isArray; +}); + +// node_modules/lodash/stubFalse.js +var require_stubFalse = __commonJS((exports, module) => { + var stubFalse = function() { + return false; + }; + module.exports = stubFalse; +}); + +// node_modules/lodash/isBuffer.js +var require_isBuffer = __commonJS((exports, module) => { + var root = require__root(); + var stubFalse = require_stubFalse(); + var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; + var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; + var moduleExports = freeModule && freeModule.exports === freeExports; + var Buffer = moduleExports ? root.Buffer : undefined; + var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + var isBuffer = nativeIsBuffer || stubFalse; + module.exports = isBuffer; +}); + +// node_modules/lodash/_isIndex.js +var require__isIndex = __commonJS((exports, module) => { + var isIndex = function(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); + }; + var MAX_SAFE_INTEGER = 9007199254740991; + var reIsUint = /^(?:0|[1-9]\d*)$/; + module.exports = isIndex; +}); + +// node_modules/lodash/isLength.js +var require_isLength = __commonJS((exports, module) => { + var isLength = function(value) { + return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + }; + var MAX_SAFE_INTEGER = 9007199254740991; + module.exports = isLength; +}); + +// node_modules/lodash/_baseIsTypedArray.js +var require__baseIsTypedArray = __commonJS((exports, module) => { + var baseIsTypedArray = function(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + }; + var baseGetTag = require__baseGetTag(); + var isLength = require_isLength(); + var isObjectLike = require_isObjectLike(); + var argsTag = "[object Arguments]"; + var arrayTag = "[object Array]"; + var boolTag = "[object Boolean]"; + var dateTag = "[object Date]"; + var errorTag = "[object Error]"; + var funcTag = "[object Function]"; + var mapTag = "[object Map]"; + var numberTag = "[object Number]"; + var objectTag = "[object Object]"; + var regexpTag = "[object RegExp]"; + var setTag = "[object Set]"; + var stringTag = "[object String]"; + var weakMapTag = "[object WeakMap]"; + var arrayBufferTag = "[object ArrayBuffer]"; + var dataViewTag = "[object DataView]"; + var float32Tag = "[object Float32Array]"; + var float64Tag = "[object Float64Array]"; + var int8Tag = "[object Int8Array]"; + var int16Tag = "[object Int16Array]"; + var int32Tag = "[object Int32Array]"; + var uint8Tag = "[object Uint8Array]"; + var uint8ClampedTag = "[object Uint8ClampedArray]"; + var uint16Tag = "[object Uint16Array]"; + var uint32Tag = "[object Uint32Array]"; + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + module.exports = baseIsTypedArray; +}); + +// node_modules/lodash/_baseUnary.js +var require__baseUnary = __commonJS((exports, module) => { + var baseUnary = function(func) { + return function(value) { + return func(value); + }; + }; + module.exports = baseUnary; +}); + +// node_modules/lodash/_nodeUtil.js +var require__nodeUtil = __commonJS((exports, module) => { + var freeGlobal = require__freeGlobal(); + var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; + var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; + var moduleExports = freeModule && freeModule.exports === freeExports; + var freeProcess = moduleExports && freeGlobal.process; + var nodeUtil = function() { + try { + var types = freeModule && freeModule.require && freeModule.require("util").types; + if (types) { + return types; + } + return freeProcess && freeProcess.binding && freeProcess.binding("util"); + } catch (e) { + } + }(); + module.exports = nodeUtil; +}); + +// node_modules/lodash/isTypedArray.js +var require_isTypedArray = __commonJS((exports, module) => { + var baseIsTypedArray = require__baseIsTypedArray(); + var baseUnary = require__baseUnary(); + var nodeUtil = require__nodeUtil(); + var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + module.exports = isTypedArray; +}); + +// node_modules/lodash/_arrayLikeKeys.js +var require__arrayLikeKeys = __commonJS((exports, module) => { + var arrayLikeKeys = function(value, inherited) { + var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) { + result.push(key); + } + } + return result; + }; + var baseTimes = require__baseTimes(); + var isArguments = require_isArguments(); + var isArray = require_isArray(); + var isBuffer = require_isBuffer(); + var isIndex = require__isIndex(); + var isTypedArray = require_isTypedArray(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + module.exports = arrayLikeKeys; +}); + +// node_modules/lodash/_isPrototype.js +var require__isPrototype = __commonJS((exports, module) => { + var isPrototype = function(value) { + var Ctor = value && value.constructor, proto2 = typeof Ctor == "function" && Ctor.prototype || objectProto; + return value === proto2; + }; + var objectProto = Object.prototype; + module.exports = isPrototype; +}); + +// node_modules/lodash/_overArg.js +var require__overArg = __commonJS((exports, module) => { + var overArg = function(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + }; + module.exports = overArg; +}); + +// node_modules/lodash/_nativeKeys.js +var require__nativeKeys = __commonJS((exports, module) => { + var overArg = require__overArg(); + var nativeKeys = overArg(Object.keys, Object); + module.exports = nativeKeys; +}); + +// node_modules/lodash/_baseKeys.js +var require__baseKeys = __commonJS((exports, module) => { + var baseKeys = function(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != "constructor") { + result.push(key); + } + } + return result; + }; + var isPrototype = require__isPrototype(); + var nativeKeys = require__nativeKeys(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + module.exports = baseKeys; +}); + +// node_modules/lodash/isArrayLike.js +var require_isArrayLike = __commonJS((exports, module) => { + var isArrayLike = function(value) { + return value != null && isLength(value.length) && !isFunction(value); + }; + var isFunction = require_isFunction(); + var isLength = require_isLength(); + module.exports = isArrayLike; +}); + +// node_modules/lodash/keys.js +var require_keys = __commonJS((exports, module) => { + var keys = function(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + }; + var arrayLikeKeys = require__arrayLikeKeys(); + var baseKeys = require__baseKeys(); + var isArrayLike = require_isArrayLike(); + module.exports = keys; +}); + +// node_modules/lodash/_baseAssign.js +var require__baseAssign = __commonJS((exports, module) => { + var baseAssign = function(object, source) { + return object && copyObject(source, keys(source), object); + }; + var copyObject = require__copyObject(); + var keys = require_keys(); + module.exports = baseAssign; +}); + +// node_modules/lodash/_nativeKeysIn.js +var require__nativeKeysIn = __commonJS((exports, module) => { + var nativeKeysIn = function(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + }; + module.exports = nativeKeysIn; +}); + +// node_modules/lodash/_baseKeysIn.js +var require__baseKeysIn = __commonJS((exports, module) => { + var baseKeysIn = function(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), result = []; + for (var key in object) { + if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + }; + var isObject = require_isObject(); + var isPrototype = require__isPrototype(); + var nativeKeysIn = require__nativeKeysIn(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + module.exports = baseKeysIn; +}); + +// node_modules/lodash/keysIn.js +var require_keysIn = __commonJS((exports, module) => { + var keysIn = function(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + }; + var arrayLikeKeys = require__arrayLikeKeys(); + var baseKeysIn = require__baseKeysIn(); + var isArrayLike = require_isArrayLike(); + module.exports = keysIn; +}); + +// node_modules/lodash/_baseAssignIn.js +var require__baseAssignIn = __commonJS((exports, module) => { + var baseAssignIn = function(object, source) { + return object && copyObject(source, keysIn(source), object); + }; + var copyObject = require__copyObject(); + var keysIn = require_keysIn(); + module.exports = baseAssignIn; +}); + +// node_modules/lodash/_cloneBuffer.js +var require__cloneBuffer = __commonJS((exports, module) => { + var cloneBuffer = function(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + buffer.copy(result); + return result; + }; + var root = require__root(); + var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; + var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; + var moduleExports = freeModule && freeModule.exports === freeExports; + var Buffer = moduleExports ? root.Buffer : undefined; + var allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + module.exports = cloneBuffer; +}); + +// node_modules/lodash/_copyArray.js +var require__copyArray = __commonJS((exports, module) => { + var copyArray = function(source, array) { + var index = -1, length = source.length; + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + }; + module.exports = copyArray; +}); + +// node_modules/lodash/_arrayFilter.js +var require__arrayFilter = __commonJS((exports, module) => { + var arrayFilter = function(array, predicate) { + var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + }; + module.exports = arrayFilter; +}); + +// node_modules/lodash/stubArray.js +var require_stubArray = __commonJS((exports, module) => { + var stubArray = function() { + return []; + }; + module.exports = stubArray; +}); + +// node_modules/lodash/_getSymbols.js +var require__getSymbols = __commonJS((exports, module) => { + var arrayFilter = require__arrayFilter(); + var stubArray = require_stubArray(); + var objectProto = Object.prototype; + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + var nativeGetSymbols = Object.getOwnPropertySymbols; + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + module.exports = getSymbols; +}); + +// node_modules/lodash/_copySymbols.js +var require__copySymbols = __commonJS((exports, module) => { + var copySymbols = function(source, object) { + return copyObject(source, getSymbols(source), object); + }; + var copyObject = require__copyObject(); + var getSymbols = require__getSymbols(); + module.exports = copySymbols; +}); + +// node_modules/lodash/_arrayPush.js +var require__arrayPush = __commonJS((exports, module) => { + var arrayPush = function(array, values) { + var index = -1, length = values.length, offset = array.length; + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + }; + module.exports = arrayPush; +}); + +// node_modules/lodash/_getPrototype.js +var require__getPrototype = __commonJS((exports, module) => { + var overArg = require__overArg(); + var getPrototype = overArg(Object.getPrototypeOf, Object); + module.exports = getPrototype; +}); + +// node_modules/lodash/_getSymbolsIn.js +var require__getSymbolsIn = __commonJS((exports, module) => { + var arrayPush = require__arrayPush(); + var getPrototype = require__getPrototype(); + var getSymbols = require__getSymbols(); + var stubArray = require_stubArray(); + var nativeGetSymbols = Object.getOwnPropertySymbols; + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + module.exports = getSymbolsIn; +}); + +// node_modules/lodash/_copySymbolsIn.js +var require__copySymbolsIn = __commonJS((exports, module) => { + var copySymbolsIn = function(source, object) { + return copyObject(source, getSymbolsIn(source), object); + }; + var copyObject = require__copyObject(); + var getSymbolsIn = require__getSymbolsIn(); + module.exports = copySymbolsIn; +}); + +// node_modules/lodash/_baseGetAllKeys.js +var require__baseGetAllKeys = __commonJS((exports, module) => { + var baseGetAllKeys = function(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + }; + var arrayPush = require__arrayPush(); + var isArray = require_isArray(); + module.exports = baseGetAllKeys; +}); + +// node_modules/lodash/_getAllKeys.js +var require__getAllKeys = __commonJS((exports, module) => { + var getAllKeys = function(object) { + return baseGetAllKeys(object, keys, getSymbols); + }; + var baseGetAllKeys = require__baseGetAllKeys(); + var getSymbols = require__getSymbols(); + var keys = require_keys(); + module.exports = getAllKeys; +}); + +// node_modules/lodash/_getAllKeysIn.js +var require__getAllKeysIn = __commonJS((exports, module) => { + var getAllKeysIn = function(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + }; + var baseGetAllKeys = require__baseGetAllKeys(); + var getSymbolsIn = require__getSymbolsIn(); + var keysIn = require_keysIn(); + module.exports = getAllKeysIn; +}); + +// node_modules/lodash/_DataView.js +var require__DataView = __commonJS((exports, module) => { + var getNative = require__getNative(); + var root = require__root(); + var DataView = getNative(root, "DataView"); + module.exports = DataView; +}); + +// node_modules/lodash/_Promise.js +var require__Promise = __commonJS((exports, module) => { + var getNative = require__getNative(); + var root = require__root(); + var Promise2 = getNative(root, "Promise"); + module.exports = Promise2; +}); + +// node_modules/lodash/_Set.js +var require__Set = __commonJS((exports, module) => { + var getNative = require__getNative(); + var root = require__root(); + var Set2 = getNative(root, "Set"); + module.exports = Set2; +}); + +// node_modules/lodash/_WeakMap.js +var require__WeakMap = __commonJS((exports, module) => { + var getNative = require__getNative(); + var root = require__root(); + var WeakMap2 = getNative(root, "WeakMap"); + module.exports = WeakMap2; +}); + +// node_modules/lodash/_getTag.js +var require__getTag = __commonJS((exports, module) => { + var DataView = require__DataView(); + var Map2 = require__Map(); + var Promise2 = require__Promise(); + var Set2 = require__Set(); + var WeakMap2 = require__WeakMap(); + var baseGetTag = require__baseGetTag(); + var toSource = require__toSource(); + var mapTag = "[object Map]"; + var objectTag = "[object Object]"; + var promiseTag = "[object Promise]"; + var setTag = "[object Set]"; + var weakMapTag = "[object WeakMap]"; + var dataViewTag = "[object DataView]"; + var dataViewCtorString = toSource(DataView); + var mapCtorString = toSource(Map2); + var promiseCtorString = toSource(Promise2); + var setCtorString = toSource(Set2); + var weakMapCtorString = toSource(WeakMap2); + var getTag = baseGetTag; + if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2) != setTag || WeakMap2 && getTag(new WeakMap2) != weakMapTag) { + getTag = function(value) { + var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : ""; + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: + return dataViewTag; + case mapCtorString: + return mapTag; + case promiseCtorString: + return promiseTag; + case setCtorString: + return setTag; + case weakMapCtorString: + return weakMapTag; + } + } + return result; + }; + } + module.exports = getTag; +}); + +// node_modules/lodash/_initCloneArray.js +var require__initCloneArray = __commonJS((exports, module) => { + var initCloneArray = function(array) { + var length = array.length, result = new array.constructor(length); + if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) { + result.index = array.index; + result.input = array.input; + } + return result; + }; + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + module.exports = initCloneArray; +}); + +// node_modules/lodash/_Uint8Array.js +var require__Uint8Array = __commonJS((exports, module) => { + var root = require__root(); + var Uint8Array2 = root.Uint8Array; + module.exports = Uint8Array2; +}); + +// node_modules/lodash/_cloneArrayBuffer.js +var require__cloneArrayBuffer = __commonJS((exports, module) => { + var cloneArrayBuffer = function(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array2(result).set(new Uint8Array2(arrayBuffer)); + return result; + }; + var Uint8Array2 = require__Uint8Array(); + module.exports = cloneArrayBuffer; +}); + +// node_modules/lodash/_cloneDataView.js +var require__cloneDataView = __commonJS((exports, module) => { + var cloneDataView = function(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + }; + var cloneArrayBuffer = require__cloneArrayBuffer(); + module.exports = cloneDataView; +}); + +// node_modules/lodash/_cloneRegExp.js +var require__cloneRegExp = __commonJS((exports, module) => { + var cloneRegExp = function(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + }; + var reFlags = /\w*$/; + module.exports = cloneRegExp; +}); + +// node_modules/lodash/_cloneSymbol.js +var require__cloneSymbol = __commonJS((exports, module) => { + var cloneSymbol = function(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + }; + var Symbol2 = require__Symbol(); + var symbolProto = Symbol2 ? Symbol2.prototype : undefined; + var symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + module.exports = cloneSymbol; +}); + +// node_modules/lodash/_cloneTypedArray.js +var require__cloneTypedArray = __commonJS((exports, module) => { + var cloneTypedArray = function(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + }; + var cloneArrayBuffer = require__cloneArrayBuffer(); + module.exports = cloneTypedArray; +}); + +// node_modules/lodash/_initCloneByTag.js +var require__initCloneByTag = __commonJS((exports, module) => { + var initCloneByTag = function(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + case boolTag: + case dateTag: + return new Ctor(+object); + case dataViewTag: + return cloneDataView(object, isDeep); + case float32Tag: + case float64Tag: + case int8Tag: + case int16Tag: + case int32Tag: + case uint8Tag: + case uint8ClampedTag: + case uint16Tag: + case uint32Tag: + return cloneTypedArray(object, isDeep); + case mapTag: + return new Ctor; + case numberTag: + case stringTag: + return new Ctor(object); + case regexpTag: + return cloneRegExp(object); + case setTag: + return new Ctor; + case symbolTag: + return cloneSymbol(object); + } + }; + var cloneArrayBuffer = require__cloneArrayBuffer(); + var cloneDataView = require__cloneDataView(); + var cloneRegExp = require__cloneRegExp(); + var cloneSymbol = require__cloneSymbol(); + var cloneTypedArray = require__cloneTypedArray(); + var boolTag = "[object Boolean]"; + var dateTag = "[object Date]"; + var mapTag = "[object Map]"; + var numberTag = "[object Number]"; + var regexpTag = "[object RegExp]"; + var setTag = "[object Set]"; + var stringTag = "[object String]"; + var symbolTag = "[object Symbol]"; + var arrayBufferTag = "[object ArrayBuffer]"; + var dataViewTag = "[object DataView]"; + var float32Tag = "[object Float32Array]"; + var float64Tag = "[object Float64Array]"; + var int8Tag = "[object Int8Array]"; + var int16Tag = "[object Int16Array]"; + var int32Tag = "[object Int32Array]"; + var uint8Tag = "[object Uint8Array]"; + var uint8ClampedTag = "[object Uint8ClampedArray]"; + var uint16Tag = "[object Uint16Array]"; + var uint32Tag = "[object Uint32Array]"; + module.exports = initCloneByTag; +}); + +// node_modules/lodash/_baseCreate.js +var require__baseCreate = __commonJS((exports, module) => { + var isObject = require_isObject(); + var objectCreate = Object.create; + var baseCreate = function() { + function object() { + } + return function(proto2) { + if (!isObject(proto2)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto2); + } + object.prototype = proto2; + var result = new object; + object.prototype = undefined; + return result; + }; + }(); + module.exports = baseCreate; +}); + +// node_modules/lodash/_initCloneObject.js +var require__initCloneObject = __commonJS((exports, module) => { + var initCloneObject = function(object) { + return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {}; + }; + var baseCreate = require__baseCreate(); + var getPrototype = require__getPrototype(); + var isPrototype = require__isPrototype(); + module.exports = initCloneObject; +}); + +// node_modules/lodash/_baseIsMap.js +var require__baseIsMap = __commonJS((exports, module) => { + var baseIsMap = function(value) { + return isObjectLike(value) && getTag(value) == mapTag; + }; + var getTag = require__getTag(); + var isObjectLike = require_isObjectLike(); + var mapTag = "[object Map]"; + module.exports = baseIsMap; +}); + +// node_modules/lodash/isMap.js +var require_isMap = __commonJS((exports, module) => { + var baseIsMap = require__baseIsMap(); + var baseUnary = require__baseUnary(); + var nodeUtil = require__nodeUtil(); + var nodeIsMap = nodeUtil && nodeUtil.isMap; + var isMap2 = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + module.exports = isMap2; +}); + +// node_modules/lodash/_baseIsSet.js +var require__baseIsSet = __commonJS((exports, module) => { + var baseIsSet = function(value) { + return isObjectLike(value) && getTag(value) == setTag; + }; + var getTag = require__getTag(); + var isObjectLike = require_isObjectLike(); + var setTag = "[object Set]"; + module.exports = baseIsSet; +}); + +// node_modules/lodash/isSet.js +var require_isSet = __commonJS((exports, module) => { + var baseIsSet = require__baseIsSet(); + var baseUnary = require__baseUnary(); + var nodeUtil = require__nodeUtil(); + var nodeIsSet = nodeUtil && nodeUtil.isSet; + var isSet2 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + module.exports = isSet2; +}); + +// node_modules/lodash/_baseClone.js +var require__baseClone = __commonJS((exports, module) => { + var baseClone = function(value, bitmask, customizer, key, object, stack) { + var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || isFunc && !object) { + result = isFlat || isFunc ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + if (isSet2(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap2(value)) { + value.forEach(function(subValue, key2) { + result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack)); + }); + } + var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys; + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key2) { + if (props) { + key2 = subValue; + subValue = value[key2]; + } + assignValue(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack)); + }); + return result; + }; + var Stack = require__Stack(); + var arrayEach = require__arrayEach(); + var assignValue = require__assignValue(); + var baseAssign = require__baseAssign(); + var baseAssignIn = require__baseAssignIn(); + var cloneBuffer = require__cloneBuffer(); + var copyArray = require__copyArray(); + var copySymbols = require__copySymbols(); + var copySymbolsIn = require__copySymbolsIn(); + var getAllKeys = require__getAllKeys(); + var getAllKeysIn = require__getAllKeysIn(); + var getTag = require__getTag(); + var initCloneArray = require__initCloneArray(); + var initCloneByTag = require__initCloneByTag(); + var initCloneObject = require__initCloneObject(); + var isArray = require_isArray(); + var isBuffer = require_isBuffer(); + var isMap2 = require_isMap(); + var isObject = require_isObject(); + var isSet2 = require_isSet(); + var keys = require_keys(); + var keysIn = require_keysIn(); + var CLONE_DEEP_FLAG = 1; + var CLONE_FLAT_FLAG = 2; + var CLONE_SYMBOLS_FLAG = 4; + var argsTag = "[object Arguments]"; + var arrayTag = "[object Array]"; + var boolTag = "[object Boolean]"; + var dateTag = "[object Date]"; + var errorTag = "[object Error]"; + var funcTag = "[object Function]"; + var genTag = "[object GeneratorFunction]"; + var mapTag = "[object Map]"; + var numberTag = "[object Number]"; + var objectTag = "[object Object]"; + var regexpTag = "[object RegExp]"; + var setTag = "[object Set]"; + var stringTag = "[object String]"; + var symbolTag = "[object Symbol]"; + var weakMapTag = "[object WeakMap]"; + var arrayBufferTag = "[object ArrayBuffer]"; + var dataViewTag = "[object DataView]"; + var float32Tag = "[object Float32Array]"; + var float64Tag = "[object Float64Array]"; + var int8Tag = "[object Int8Array]"; + var int16Tag = "[object Int16Array]"; + var int32Tag = "[object Int32Array]"; + var uint8Tag = "[object Uint8Array]"; + var uint8ClampedTag = "[object Uint8ClampedArray]"; + var uint16Tag = "[object Uint16Array]"; + var uint32Tag = "[object Uint32Array]"; + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; + module.exports = baseClone; +}); + +// node_modules/lodash/cloneDeep.js +var require_cloneDeep = __commonJS((exports, module) => { + var cloneDeep = function(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + }; + var baseClone = require__baseClone(); + var CLONE_DEEP_FLAG = 1; + var CLONE_SYMBOLS_FLAG = 4; + module.exports = cloneDeep; +}); + +// usecases/index.tsx +var import_react10 = __toESM(require_react(), 1); +var client = __toESM(require_client(), 1); + +// node_modules/react-router-dom/dist/index.js +var React2 = __toESM(require_react(), 1); +var ReactDOM = __toESM(require_react_dom(), 1); + +// node_modules/react-router/dist/index.js +var React = __toESM(require_react(), 1); + +// node_modules/@remix-run/router/dist/router.js +var _extends = function() { + _extends = Object.assign ? Object.assign.bind() : function(target) { + for (var i = 1;i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); +}; +var createHashHistory = function(options) { + if (options === undefined) { + options = {}; + } + function createHashLocation(window2, globalHistory) { + let { + pathname = "/", + search = "", + hash = "" + } = parsePath(window2.location.hash.substr(1)); + if (!pathname.startsWith("/") && !pathname.startsWith(".")) { + pathname = "/" + pathname; + } + return createLocation("", { + pathname, + search, + hash + }, globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || "default"); + } + function createHashHref(window2, to) { + let base = window2.document.querySelector("base"); + let href = ""; + if (base && base.getAttribute("href")) { + let url = window2.location.href; + let hashIndex = url.indexOf("#"); + href = hashIndex === -1 ? url : url.slice(0, hashIndex); + } + return href + "#" + (typeof to === "string" ? to : createPath(to)); + } + function validateHashLocation(location, to) { + warning(location.pathname.charAt(0) === "/", "relative pathnames are not supported in hash history.push(" + JSON.stringify(to) + ")"); + } + return getUrlBasedHistory(createHashLocation, createHashHref, validateHashLocation, options); +}; +var invariant = function(value, message) { + if (value === false || value === null || typeof value === "undefined") { + throw new Error(message); + } +}; +var warning = function(cond, message) { + if (!cond) { + if (typeof console !== "undefined") + console.warn(message); + try { + throw new Error(message); + } catch (e) { + } + } +}; +var createKey = function() { + return Math.random().toString(36).substr(2, 8); +}; +var getHistoryState = function(location, index) { + return { + usr: location.state, + key: location.key, + idx: index + }; +}; +var createLocation = function(current, to, state, key) { + if (state === undefined) { + state = null; + } + let location = _extends({ + pathname: typeof current === "string" ? current : current.pathname, + search: "", + hash: "" + }, typeof to === "string" ? parsePath(to) : to, { + state, + key: to && to.key || key || createKey() + }); + return location; +}; +var createPath = function(_ref) { + let { + pathname = "/", + search = "", + hash = "" + } = _ref; + if (search && search !== "?") + pathname += search.charAt(0) === "?" ? search : "?" + search; + if (hash && hash !== "#") + pathname += hash.charAt(0) === "#" ? hash : "#" + hash; + return pathname; +}; +var parsePath = function(path) { + let parsedPath = {}; + if (path) { + let hashIndex = path.indexOf("#"); + if (hashIndex >= 0) { + parsedPath.hash = path.substr(hashIndex); + path = path.substr(0, hashIndex); + } + let searchIndex = path.indexOf("?"); + if (searchIndex >= 0) { + parsedPath.search = path.substr(searchIndex); + path = path.substr(0, searchIndex); + } + if (path) { + parsedPath.pathname = path; + } + } + return parsedPath; +}; +var getUrlBasedHistory = function(getLocation, createHref, validateLocation, options) { + if (options === undefined) { + options = {}; + } + let { + window: window2 = document.defaultView, + v5Compat = false + } = options; + let globalHistory = window2.history; + let action = Action.Pop; + let listener = null; + let index = getIndex(); + if (index == null) { + index = 0; + globalHistory.replaceState(_extends({}, globalHistory.state, { + idx: index + }), ""); + } + function getIndex() { + let state = globalHistory.state || { + idx: null + }; + return state.idx; + } + function handlePop() { + action = Action.Pop; + let nextIndex = getIndex(); + let delta = nextIndex == null ? null : nextIndex - index; + index = nextIndex; + if (listener) { + listener({ + action, + location: history.location, + delta + }); } } function push(to, state) { @@ -24565,7 +25585,7 @@ var compilePath = function(path, caseSensitive, end) { } warning(path === "*" || !path.endsWith("*") || path.endsWith("/*"), "Route path \"" + path + "\" will be treated as if it were " + ("\"" + path.replace(/\*$/, "/*") + "\" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, ") + ("please change the route path to \"" + path.replace(/\*$/, "/*") + "\".")); let params = []; - let regexpSource = "^" + path.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:(\w+)(\?)?/g, (_, paramName, isOptional) => { + let regexpSource = "^" + path.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (_, paramName, isOptional) => { params.push({ paramName, isOptional: isOptional != null @@ -24713,7 +25733,7 @@ var ResultType; ResultType2["error"] = "error"; })(ResultType || (ResultType = {})); var immutableRouteKeys = new Set(["lazy", "caseSensitive", "path", "id", "index", "children"]); -var paramRe = /^:\w+$/; +var paramRe = /^:[\w-]+$/; var dynamicSegmentValue = 3; var indexRouteValue = 2; var emptySegmentValue = 1; @@ -25781,6 +26801,11 @@ var supportedFormEncTypes = new Set(["application/x-www-form-urlencoded", "multi var _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "unstable_viewTransition"]; var _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "unstable_viewTransition", "children"]; var _excluded3 = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "unstable_viewTransition"]; +var REACT_ROUTER_VERSION = "6"; +try { + window.__reactRouterVersion = REACT_ROUTER_VERSION; +} catch (e) { +} var ViewTransitionContext = React2.createContext({ isTransitioning: false }); @@ -25795,6 +26820,8 @@ var START_TRANSITION2 = "startTransition"; var startTransitionImpl2 = React2[START_TRANSITION2]; var FLUSH_SYNC = "flushSync"; var flushSyncImpl = ReactDOM[FLUSH_SYNC]; +var USE_ID = "useId"; +var useIdImpl = React2[USE_ID]; if (true) { HistoryRouter.displayName = "unstable_HistoryRouter"; } @@ -25879,7 +26906,8 @@ var NavLink = React2.forwardRef(function NavLinkWithRef(_ref8, ref) { let location = useLocation(); let routerState = React2.useContext(DataRouterStateContext); let { - navigator: navigator2 + navigator: navigator2, + basename } = React2.useContext(NavigationContext); let isTransitioning = routerState != null && useViewTransitionState(path) && unstable_viewTransition === true; let toPathname = navigator2.encodeLocation ? navigator2.encodeLocation(path).pathname : path.pathname; @@ -25890,6 +26918,9 @@ var NavLink = React2.forwardRef(function NavLinkWithRef(_ref8, ref) { nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null; toPathname = toPathname.toLowerCase(); } + if (nextLocationPathname && basename) { + nextLocationPathname = stripBasename(nextLocationPathname, basename) || nextLocationPathname; + } const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length; let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/"; let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/"); @@ -25988,36 +27019,16 @@ var SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions"; var savedScrollPositions = {}; // usecases/basic/index.tsx -var import_react9 = __toESM(require_react(), 1); +var import_react7 = __toESM(require_react(), 1); -// node_modules/react-redux/es/index.js -var shim = __toESM(require_shim(), 1); +// node_modules/react-redux/dist/react-redux.mjs +var React22 = __toESM(require_react(), 1); var with_selector = __toESM(require_with_selector(), 1); - -// node_modules/react-redux/es/utils/reactBatchedUpdates.js -var import_react_dom = __toESM(require_react_dom(), 1); - -// node_modules/react-redux/es/utils/batch.js -var defaultNoopBatch = function(callback) { - callback(); -}; -var batch = defaultNoopBatch; -var setBatch = (newBatch) => batch = newBatch; -var getBatch = () => batch; - -// node_modules/react-redux/es/hooks/useSelector.js -var import_react2 = __toESM(require_react(), 1); - -// node_modules/react-redux/es/hooks/useReduxContext.js -var import_react = __toESM(require_react(), 1); - -// node_modules/react-redux/es/components/Context.js -var React3 = __toESM(require_react(), 1); +var ReactOriginal = __toESM(require_react(), 1); var getContext = function() { - var _gT$ContextKey; if (!React3.createContext) return {}; - const contextMap = (_gT$ContextKey = gT[ContextKey]) != null ? _gT$ContextKey : gT[ContextKey] = new Map; + const contextMap = gT[ContextKey] ?? (gT[ContextKey] = new Map); let realContext = contextMap.get(React3.createContext); if (!realContext) { realContext = React3.createContext(null); @@ -26028,38 +27039,19 @@ var getContext = function() { } return realContext; }; -var ContextKey = Symbol.for(`react-redux-context`); -var gT = typeof globalThis !== "undefined" ? globalThis : {}; -var ReactReduxContext = getContext(); - -// node_modules/react-redux/es/hooks/useReduxContext.js -function createReduxContextHook(context = ReactReduxContext) { - return function useReduxContext() { - const contextValue = import_react.useContext(context); +var createReduxContextHook = function(context = ReactReduxContext) { + return function useReduxContext2() { + const contextValue = React3.useContext(context); if (!contextValue) { throw new Error("could not find react-redux context value; please ensure the component is wrapped in a "); } return contextValue; }; -} -var useReduxContext = createReduxContextHook(); - -// node_modules/react-redux/es/utils/useSyncExternalStore.js -var notInitialized = () => { - throw new Error("uSES not initialized!"); }; - -// node_modules/react-redux/es/hooks/useSelector.js -function createSelectorHook(context = ReactReduxContext) { - const useReduxContext3 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context); - return function useSelector(selector, equalityFnOrOptions = {}) { - const { - equalityFn = refEquality, - stabilityCheck = undefined, - noopCheck = undefined - } = typeof equalityFnOrOptions === "function" ? { - equalityFn: equalityFnOrOptions - } : equalityFnOrOptions; +var createSelectorHook = function(context = ReactReduxContext) { + const useReduxContext2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context); + const useSelector2 = (selector, equalityFnOrOptions = {}) => { + const { equalityFn = refEquality, devModeChecks = {} } = typeof equalityFnOrOptions === "function" ? { equalityFn: equalityFnOrOptions } : equalityFnOrOptions; if (true) { if (!selector) { throw new Error(`You must pass a selector to useSelector`); @@ -26075,15 +27067,22 @@ function createSelectorHook(context = ReactReduxContext) { store, subscription, getServerState, - stabilityCheck: globalStabilityCheck, - noopCheck: globalNoopCheck - } = useReduxContext3(); - const firstRun = import_react2.useRef(true); - const wrappedSelector = import_react2.useCallback({ + stabilityCheck, + identityFunctionCheck + } = useReduxContext2(); + const firstRun = React3.useRef(true); + const wrappedSelector = React3.useCallback({ [selector.name](state) { const selected = selector(state); if (true) { - const finalStabilityCheck = typeof stabilityCheck === "undefined" ? globalStabilityCheck : stabilityCheck; + const { + identityFunctionCheck: finalIdentityFunctionCheck, + stabilityCheck: finalStabilityCheck + } = { + stabilityCheck, + identityFunctionCheck, + ...devModeChecks + }; if (finalStabilityCheck === "always" || finalStabilityCheck === "once" && firstRun.current) { const toCompare = selector(state); if (!equalityFn(selected, toCompare)) { @@ -26091,9 +27090,7 @@ function createSelectorHook(context = ReactReduxContext) { try { throw new Error; } catch (e) { - ({ - stack - } = e); + ({ stack } = e); } console.warn("Selector " + (selector.name || "unknown") + " returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\nSelectors 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, @@ -26103,20 +27100,15 @@ function createSelectorHook(context = ReactReduxContext) { }); } } - const finalNoopCheck = typeof noopCheck === "undefined" ? globalNoopCheck : noopCheck; - if (finalNoopCheck === "always" || finalNoopCheck === "once" && firstRun.current) { + if (finalIdentityFunctionCheck === "always" || finalIdentityFunctionCheck === "once" && firstRun.current) { if (selected === state) { let stack = undefined; try { throw new Error; } catch (e) { - ({ - stack - } = e); + ({ stack } = e); } - console.warn("Selector " + (selector.name || "unknown") + " returned the root state when called. This can lead to unnecessary rerenders.\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.", { - stack - }); + console.warn("Selector " + (selector.name || "unknown") + " returned the root state when called. This can lead to unnecessary rerenders.\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.", { stack }); } } if (firstRun.current) @@ -26124,59 +27116,20 @@ function createSelectorHook(context = ReactReduxContext) { } return selected; } - }[selector.name], [selector, globalStabilityCheck, stabilityCheck]); + }[selector.name], [selector, stabilityCheck, devModeChecks.stabilityCheck]); const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn); - import_react2.useDebugValue(selectedState); + React3.useDebugValue(selectedState); return selectedState; }; -} -var useSyncExternalStoreWithSelector = notInitialized; -var initializeUseSelector = (fn) => { - useSyncExternalStoreWithSelector = fn; + Object.assign(useSelector2, { + withTypes: () => useSelector2 + }); + return useSelector2; +}; +var defaultNoopBatch = function(callback) { + callback(); }; -var refEquality = (a, b) => a === b; -var useSelector = createSelectorHook(); - -// node_modules/@babel/runtime/helpers/esm/extends.js -function _extends4() { - _extends4 = Object.assign ? Object.assign.bind() : function(target) { - for (var i = 1;i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - return target; - }; - return _extends4.apply(this, arguments); -} - -// node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js -function _objectWithoutPropertiesLoose2(source, excluded) { - if (source == null) - return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0;i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) - continue; - target[key] = source[key]; - } - return target; -} - -// node_modules/react-redux/es/components/connect.js -var import_hoist_non_react_statics = __toESM(require_hoist_non_react_statics_cjs(), 1); -var React5 = __toESM(require_react(), 1); -var import_react_is = __toESM(require_react_is2(), 1); - -// node_modules/react-redux/es/utils/Subscription.js var createListenerCollection = function() { - const batch3 = getBatch(); let first = null; let last = null; return { @@ -26185,7 +27138,7 @@ var createListenerCollection = function() { last = null; }, notify() { - batch3(() => { + defaultNoopBatch(() => { let listener = first; while (listener) { listener.callback(); @@ -26194,7 +27147,7 @@ var createListenerCollection = function() { }); }, get() { - let listeners = []; + const listeners = []; let listener = first; while (listener) { listeners.push(listener); @@ -26204,7 +27157,7 @@ var createListenerCollection = function() { }, subscribe(callback) { let isSubscribed = true; - let listener = last = { + const listener = last = { callback, next: null, prev: last @@ -26232,7 +27185,7 @@ var createListenerCollection = function() { } }; }; -function createSubscription(store, parentSub) { +var createSubscription = function(store, parentSub) { let unsubscribe; let listeners = nullListeners; let subscriptionsAmount = 0; @@ -26298,49 +27251,28 @@ function createSubscription(store, parentSub) { getListeners: () => listeners }; return subscription; -} -var nullListeners = { - notify() { - }, - get: () => [] -}; - -// node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js -var React4 = __toESM(require_react(), 1); -var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); -var useIsomorphicLayoutEffect2 = canUseDOM ? React4.useLayoutEffect : React4.useEffect; - -// node_modules/react-redux/es/components/connect.js -var useSyncExternalStore3 = notInitialized; -var initializeConnect = (fn) => { - useSyncExternalStore3 = fn; }; - -// node_modules/react-redux/es/components/Provider.js -var React6 = __toESM(require_react(), 1); var Provider = function({ store, context, children, serverState, stabilityCheck = "once", - noopCheck = "once" + identityFunctionCheck = "once" }) { - const contextValue = React6.useMemo(() => { + const contextValue = React3.useMemo(() => { const subscription = createSubscription(store); return { store, subscription, getServerState: serverState ? () => serverState : undefined, stabilityCheck, - noopCheck + identityFunctionCheck }; - }, [store, serverState, stabilityCheck, noopCheck]); - const previousState = React6.useMemo(() => store.getState(), [store]); + }, [store, serverState, stabilityCheck, identityFunctionCheck]); + const previousState = React3.useMemo(() => store.getState(), [store]); useIsomorphicLayoutEffect2(() => { - const { - subscription - } = contextValue; + const { subscription } = contextValue; subscription.onStateChange = subscription.notifyNestedSubs; subscription.trySubscribe(); if (previousState !== store.getState()) { @@ -26351,41 +27283,101 @@ var Provider = function({ subscription.onStateChange = undefined; }; }, [contextValue, previousState]); - const Context5 = context || ReactReduxContext; - return React6.createElement(Context5.Provider, { - value: contextValue - }, children); + const Context = context || ReactReduxContext; + return React3.createElement(Context.Provider, { value: contextValue }, children); }; -var Provider_default = Provider; - -// node_modules/react-redux/es/hooks/useStore.js -function createStoreHook(context = ReactReduxContext) { - const useReduxContext4 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context); - return function useStore() { - const { - store - } = useReduxContext4(); +var createStoreHook = function(context = ReactReduxContext) { + const useReduxContext2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context); + const useStore2 = () => { + const { store } = useReduxContext2(); return store; }; -} -var useStore = createStoreHook(); - -// node_modules/react-redux/es/hooks/useDispatch.js -function createDispatchHook(context = ReactReduxContext) { - const useStore3 = context === ReactReduxContext ? useStore : createStoreHook(context); - return function useDispatch() { - const store = useStore3(); + Object.assign(useStore2, { + withTypes: () => useStore2 + }); + return useStore2; +}; +var createDispatchHook = function(context = ReactReduxContext) { + const useStore2 = context === ReactReduxContext ? useStore : createStoreHook(context); + const useDispatch2 = () => { + const store = useStore2(); return store.dispatch; }; -} + Object.assign(useDispatch2, { + withTypes: () => useDispatch2 + }); + return useDispatch2; +}; +var React3 = "default" in ReactOriginal ? ReactOriginal.default : ReactOriginal; +var ContextKey = Symbol.for(`react-redux-context`); +var gT = typeof globalThis !== "undefined" ? globalThis : {}; +var ReactReduxContext = getContext(); +var notInitialized = () => { + throw new Error("uSES not initialized!"); +}; +var useReduxContext = createReduxContextHook(); +var useSyncExternalStoreWithSelector = notInitialized; +var initializeUseSelector = (fn) => { + useSyncExternalStoreWithSelector = fn; +}; +var refEquality = (a, b) => a === b; +var useSelector = createSelectorHook(); +var REACT_ELEMENT_TYPE = Symbol.for("react.element"); +var REACT_PORTAL_TYPE = Symbol.for("react.portal"); +var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); +var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); +var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); +var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); +var REACT_CONTEXT_TYPE = Symbol.for("react.context"); +var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"); +var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); +var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); +var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); +var REACT_MEMO_TYPE = Symbol.for("react.memo"); +var REACT_LAZY_TYPE = Symbol.for("react.lazy"); +var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); +var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); +var ForwardRef = REACT_FORWARD_REF_TYPE; +var Memo = REACT_MEMO_TYPE; +var nullListeners = { + notify() { + }, + get: () => [] +}; +var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); +var useIsomorphicLayoutEffect2 = canUseDOM ? React3.useLayoutEffect : React3.useEffect; +var FORWARD_REF_STATICS = { + $$typeof: true, + render: true, + defaultProps: true, + displayName: true, + propTypes: true +}; +var MEMO_STATICS = { + $$typeof: true, + compare: true, + defaultProps: true, + displayName: true, + propTypes: true, + type: true +}; +var TYPE_STATICS = { + [ForwardRef]: FORWARD_REF_STATICS, + [Memo]: MEMO_STATICS +}; +var objectPrototype = Object.prototype; +var useSyncExternalStore2 = notInitialized; +var initializeConnect = (fn) => { + useSyncExternalStore2 = fn; +}; +var Provider_default = Provider; +var useStore = createStoreHook(); var useDispatch = createDispatchHook(); -// node_modules/react-redux/es/index.js initializeUseSelector(with_selector.useSyncExternalStoreWithSelector); -initializeConnect(shim.useSyncExternalStore); -setBatch(import_react_dom.unstable_batchedUpdates); +initializeConnect(React22.useSyncExternalStore); // usecases/lib/components/graph/TransitionGraph.tsx -var import_react4 = __toESM(require_react(), 1); +var import_react2 = __toESM(require_react(), 1); // src/constants.ts var MetaKey = "__OPTIMISTRON_META__"; @@ -26445,7 +27437,7 @@ var withTransitionMeta = (action, options) => ({ [MetaKey]: options } }); -var isTransition = (action) => action?.meta && (MetaKey in action.meta); +var isTransition = (action) => ("meta" in action) && typeof action.meta === "object" && action.meta !== null && (MetaKey in action.meta); var isTransitionForNamespace = (action, namespace) => isTransition(action) && action.type.startsWith(`${namespace}::`); var updateTransition = (action, update) => ({ ...action, @@ -26508,599 +27500,44 @@ var sanitizeTransitions = (boundReducer, bindState) => (state) => { acc.transitionState.state = bindState(acc.transitionState.state).merge(nextState); acc.transitions.push(action); } - } catch (mergeError) { - acc.mutated = true; - switch (mergeError) { - case OptimisticMergeResult.SKIP: - break; - case OptimisticMergeResult.CONFLICT: - acc.transitions.push(updateTransition(action, { conflict: true })); - break; - } - } - return acc; - }, { - mutated: false, - transitions: [], - transitionState: cloneTransitionState(state) - }); - return sanitized.mutated ? sanitized.transitions : state.transitions; -}; - -// usecases/lib/components/graph/TransitionHistoryProvider.tsx -var import_react3 = __toESM(require_react(), 1); - -// node_modules/immer/dist/immer.esm.mjs -var n = function(n2) { - for (var r = arguments.length, t = Array(r > 1 ? r - 1 : 0), e = 1;e < r; e++) - t[e - 1] = arguments[e]; - if (true) { - var i = Y[n2], o = i ? typeof i == "function" ? i.apply(null, t) : i : "unknown error nr: " + n2; - throw Error("[Immer] " + o); - } - throw Error("[Immer] minified error nr: " + n2 + (t.length ? " " + t.map(function(n3) { - return "'" + n3 + "'"; - }).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf"); -}; -var r = function(n2) { - return !!n2 && !!n2[Q]; -}; -var t = function(n2) { - var r2; - return !!n2 && (function(n3) { - if (!n3 || typeof n3 != "object") - return false; - var r3 = Object.getPrototypeOf(n3); - if (r3 === null) - return true; - var t2 = Object.hasOwnProperty.call(r3, "constructor") && r3.constructor; - return t2 === Object || typeof t2 == "function" && Function.toString.call(t2) === Z; - }(n2) || Array.isArray(n2) || !!n2[L] || !!((r2 = n2.constructor) === null || r2 === undefined ? undefined : r2[L]) || s(n2) || v(n2)); -}; -var i = function(n2, r2, t2) { - t2 === undefined && (t2 = false), o(n2) === 0 ? (t2 ? Object.keys : nn)(n2).forEach(function(e) { - t2 && typeof e == "symbol" || r2(e, n2[e], n2); - }) : n2.forEach(function(t3, e) { - return r2(e, t3, n2); - }); -}; -var o = function(n2) { - var r2 = n2[Q]; - return r2 ? r2.i > 3 ? r2.i - 4 : r2.i : Array.isArray(n2) ? 1 : s(n2) ? 2 : v(n2) ? 3 : 0; -}; -var u = function(n2, r2) { - return o(n2) === 2 ? n2.has(r2) : Object.prototype.hasOwnProperty.call(n2, r2); -}; -var a = function(n2, r2) { - return o(n2) === 2 ? n2.get(r2) : n2[r2]; -}; -var f = function(n2, r2, t2) { - var e = o(n2); - e === 2 ? n2.set(r2, t2) : e === 3 ? n2.add(t2) : n2[r2] = t2; -}; -var c = function(n2, r2) { - return n2 === r2 ? n2 !== 0 || 1 / n2 == 1 / r2 : n2 != n2 && r2 != r2; -}; -var s = function(n2) { - return X && n2 instanceof Map; -}; -var v = function(n2) { - return q && n2 instanceof Set; -}; -var p = function(n2) { - return n2.o || n2.t; -}; -var l = function(n2) { - if (Array.isArray(n2)) - return Array.prototype.slice.call(n2); - var r2 = rn(n2); - delete r2[Q]; - for (var t2 = nn(r2), e = 0;e < t2.length; e++) { - var i2 = t2[e], o2 = r2[i2]; - o2.writable === false && (o2.writable = true, o2.configurable = true), (o2.get || o2.set) && (r2[i2] = { configurable: true, writable: true, enumerable: o2.enumerable, value: n2[i2] }); - } - return Object.create(Object.getPrototypeOf(n2), r2); -}; -var d = function(n2, e) { - return e === undefined && (e = false), y(n2) || r(n2) || !t(n2) || (o(n2) > 1 && (n2.set = n2.add = n2.clear = n2.delete = h), Object.freeze(n2), e && i(n2, function(n3, r2) { - return d(r2, true); - }, true)), n2; -}; -var h = function() { - n(2); -}; -var y = function(n2) { - return n2 == null || typeof n2 != "object" || Object.isFrozen(n2); -}; -var b = function(r2) { - var t2 = tn[r2]; - return t2 || n(18, r2), t2; -}; -var m = function(n2, r2) { - tn[n2] || (tn[n2] = r2); -}; -var _ = function() { - return U || n(0), U; -}; -var j = function(n2, r2) { - r2 && (b("Patches"), n2.u = [], n2.s = [], n2.v = r2); -}; -var g = function(n2) { - O(n2), n2.p.forEach(S), n2.p = null; -}; -var O = function(n2) { - n2 === U && (U = n2.l); -}; -var w = function(n2) { - return U = { p: [], l: U, h: n2, m: true, _: 0 }; -}; -var S = function(n2) { - var r2 = n2[Q]; - r2.i === 0 || r2.i === 1 ? r2.j() : r2.g = true; -}; -var P = function(r2, e) { - e._ = e.p.length; - var i2 = e.p[0], o2 = r2 !== undefined && r2 !== i2; - return e.h.O || b("ES5").S(e, r2, o2), o2 ? (i2[Q].P && (g(e), n(4)), t(r2) && (r2 = M(e, r2), e.l || x(e, r2)), e.u && b("Patches").M(i2[Q].t, r2, e.u, e.s)) : r2 = M(e, i2, []), g(e), e.u && e.v(e.u, e.s), r2 !== H ? r2 : undefined; -}; -var M = function(n2, r2, t2) { - if (y(r2)) - return r2; - var e = r2[Q]; - if (!e) - return i(r2, function(i2, o3) { - return A(n2, e, r2, i2, o3, t2); - }, true), r2; - if (e.A !== n2) - return r2; - if (!e.P) - return x(n2, e.t, true), e.t; - if (!e.I) { - e.I = true, e.A._--; - var o2 = e.i === 4 || e.i === 5 ? e.o = l(e.k) : e.o, u2 = o2, a2 = false; - e.i === 3 && (u2 = new Set(o2), o2.clear(), a2 = true), i(u2, function(r3, i2) { - return A(n2, e, o2, r3, i2, t2, a2); - }), x(n2, o2, false), t2 && n2.u && b("Patches").N(e, t2, n2.u, n2.s); - } - return e.o; -}; -var A = function(e, i2, o2, a2, c2, s2, v2) { - if (c2 === o2 && n(5), r(c2)) { - var p2 = M(e, c2, s2 && i2 && i2.i !== 3 && !u(i2.R, a2) ? s2.concat(a2) : undefined); - if (f(o2, a2, p2), !r(p2)) - return; - e.m = false; - } else - v2 && o2.add(c2); - if (t(c2) && !y(c2)) { - if (!e.h.D && e._ < 1) - return; - M(e, c2), i2 && i2.A.l || x(e, c2); - } -}; -var x = function(n2, r2, t2) { - t2 === undefined && (t2 = false), !n2.l && n2.h.D && n2.m && d(r2, t2); -}; -var z = function(n2, r2) { - var t2 = n2[Q]; - return (t2 ? p(t2) : n2)[r2]; -}; -var I = function(n2, r2) { - if (r2 in n2) - for (var t2 = Object.getPrototypeOf(n2);t2; ) { - var e = Object.getOwnPropertyDescriptor(t2, r2); - if (e) - return e; - t2 = Object.getPrototypeOf(t2); - } -}; -var k = function(n2) { - n2.P || (n2.P = true, n2.l && k(n2.l)); -}; -var E = function(n2) { - n2.o || (n2.o = l(n2.t)); -}; -var N = function(n2, r2, t2) { - var e = s(r2) ? b("MapSet").F(r2, t2) : v(r2) ? b("MapSet").T(r2, t2) : n2.O ? function(n3, r3) { - var t3 = Array.isArray(n3), e2 = { i: t3 ? 1 : 0, A: r3 ? r3.A : _(), P: false, I: false, R: {}, l: r3, t: n3, k: null, o: null, j: null, C: false }, i2 = e2, o2 = en; - t3 && (i2 = [e2], o2 = on); - var u2 = Proxy.revocable(i2, o2), a2 = u2.revoke, f2 = u2.proxy; - return e2.k = f2, e2.j = a2, f2; - }(r2, t2) : b("ES5").J(r2, t2); - return (t2 ? t2.A : _()).p.push(e), e; -}; -var R = function(e) { - return r(e) || n(22, e), function n(r2) { - if (!t(r2)) - return r2; - var e2, u2 = r2[Q], c2 = o(r2); - if (u2) { - if (!u2.P && (u2.i < 4 || !b("ES5").K(u2))) - return u2.t; - u2.I = true, e2 = D(r2, c2), u2.I = false; - } else - e2 = D(r2, c2); - return i(e2, function(r3, t2) { - u2 && a(u2.t, r3) === t2 || f(e2, r3, n(t2)); - }), c2 === 3 ? new Set(e2) : e2; - }(e); -}; -var D = function(n2, r2) { - switch (r2) { - case 2: - return new Map(n2); - case 3: - return Array.from(n2); - } - return l(n2); -}; -var F = function() { - function t2(n2, r2) { - var t3 = s2[n2]; - return t3 ? t3.enumerable = r2 : s2[n2] = t3 = { configurable: true, enumerable: r2, get: function() { - var r3 = this[Q]; - return f2(r3), en.get(r3, n2); - }, set: function(r3) { - var t4 = this[Q]; - f2(t4), en.set(t4, n2, r3); - } }, t3; - } - function e(n2) { - for (var r2 = n2.length - 1;r2 >= 0; r2--) { - var t3 = n2[r2][Q]; - if (!t3.P) - switch (t3.i) { - case 5: - a2(t3) && k(t3); - break; - case 4: - o2(t3) && k(t3); - } - } - } - function o2(n2) { - for (var { t: r2, k: t3 } = n2, e2 = nn(t3), i2 = e2.length - 1;i2 >= 0; i2--) { - var o3 = e2[i2]; - if (o3 !== Q) { - var a3 = r2[o3]; - if (a3 === undefined && !u(r2, o3)) - return true; - var f3 = t3[o3], s3 = f3 && f3[Q]; - if (s3 ? s3.t !== a3 : !c(f3, a3)) - return true; - } - } - var v2 = !!r2[Q]; - return e2.length !== nn(r2).length + (v2 ? 0 : 1); - } - function a2(n2) { - var r2 = n2.k; - if (r2.length !== n2.t.length) - return true; - var t3 = Object.getOwnPropertyDescriptor(r2, r2.length - 1); - if (t3 && !t3.get) - return true; - for (var e2 = 0;e2 < r2.length; e2++) - if (!r2.hasOwnProperty(e2)) - return true; - return false; - } - function f2(r2) { - r2.g && n(3, JSON.stringify(p(r2))); - } - var s2 = {}; - m("ES5", { J: function(n2, r2) { - var e2 = Array.isArray(n2), i2 = function(n3, r3) { - if (n3) { - for (var e3 = Array(r3.length), i3 = 0;i3 < r3.length; i3++) - Object.defineProperty(e3, "" + i3, t2(i3, true)); - return e3; - } - var o4 = rn(r3); - delete o4[Q]; - for (var u2 = nn(o4), a3 = 0;a3 < u2.length; a3++) { - var f3 = u2[a3]; - o4[f3] = t2(f3, n3 || !!o4[f3].enumerable); - } - return Object.create(Object.getPrototypeOf(r3), o4); - }(e2, n2), o3 = { i: e2 ? 5 : 4, A: r2 ? r2.A : _(), P: false, I: false, R: {}, l: r2, t: n2, k: i2, o: null, g: false, C: false }; - return Object.defineProperty(i2, Q, { value: o3, writable: true }), i2; - }, S: function(n2, t3, o3) { - o3 ? r(t3) && t3[Q].A === n2 && e(n2.p) : (n2.u && function n(r2) { - if (r2 && typeof r2 == "object") { - var t4 = r2[Q]; - if (t4) { - var { t: e2, k: o4, R: f3, i: c2 } = t4; - if (c2 === 4) - i(o4, function(r3) { - r3 !== Q && (e2[r3] !== undefined || u(e2, r3) ? f3[r3] || n(o4[r3]) : (f3[r3] = true, k(t4))); - }), i(e2, function(n3) { - o4[n3] !== undefined || u(o4, n3) || (f3[n3] = false, k(t4)); - }); - else if (c2 === 5) { - if (a2(t4) && (k(t4), f3.length = true), o4.length < e2.length) - for (var s3 = o4.length;s3 < e2.length; s3++) - f3[s3] = false; - else - for (var v2 = e2.length;v2 < o4.length; v2++) - f3[v2] = true; - for (var p2 = Math.min(o4.length, e2.length), l2 = 0;l2 < p2; l2++) - o4.hasOwnProperty(l2) || (f3[l2] = true), f3[l2] === undefined && n(o4[l2]); - } - } - } - }(n2.p[0]), e(n2.p)); - }, K: function(n2) { - return n2.i === 4 ? o2(n2) : a2(n2); - } }); -}; -var G; -var U; -var W = typeof Symbol != "undefined" && typeof Symbol("x") == "symbol"; -var X = typeof Map != "undefined"; -var q = typeof Set != "undefined"; -var B = typeof Proxy != "undefined" && Proxy.revocable !== undefined && typeof Reflect != "undefined"; -var H = W ? Symbol.for("immer-nothing") : ((G = {})["immer-nothing"] = true, G); -var L = W ? Symbol.for("immer-draftable") : "__$immer_draftable"; -var Q = W ? Symbol.for("immer-state") : "__$immer_state"; -var Y = { 0: "Illegal state", 1: "Immer drafts cannot have computed properties", 2: "This object has been frozen and should not be mutated", 3: function(n2) { - return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + n2; -}, 4: "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.", 5: "Immer forbids circular references", 6: "The first or second argument to `produce` must be a function", 7: "The third argument to `produce` must be a function or undefined", 8: "First argument to `createDraft` must be a plain object, an array, or an immerable object", 9: "First argument to `finishDraft` must be a draft returned by `createDraft`", 10: "The given draft is already finalized", 11: "Object.defineProperty() cannot be used on an Immer draft", 12: "Object.setPrototypeOf() cannot be used on an Immer draft", 13: "Immer only supports deleting array indices", 14: "Immer only supports setting array indices and the 'length' property", 15: function(n2) { - return "Cannot apply patch, path doesn't resolve: " + n2; -}, 16: 'Sets cannot have "replace" patches.', 17: function(n2) { - return "Unsupported patch operation: " + n2; -}, 18: function(n2) { - return "The plugin for '" + n2 + "' has not been loaded into Immer. To enable the plugin, import and call `enable" + n2 + "()` when initializing your application."; -}, 20: "Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available", 21: function(n2) { - 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 '" + n2 + "'"; -}, 22: function(n2) { - return "'current' expects a draft, got: " + n2; -}, 23: function(n2) { - return "'original' expects a draft, got: " + n2; -}, 24: "Patching reserved attributes like __proto__, prototype and constructor is not allowed" }; -var Z = "" + Object.prototype.constructor; -var nn = typeof Reflect != "undefined" && Reflect.ownKeys ? Reflect.ownKeys : Object.getOwnPropertySymbols !== undefined ? function(n2) { - return Object.getOwnPropertyNames(n2).concat(Object.getOwnPropertySymbols(n2)); -} : Object.getOwnPropertyNames; -var rn = Object.getOwnPropertyDescriptors || function(n2) { - var r2 = {}; - return nn(n2).forEach(function(t2) { - r2[t2] = Object.getOwnPropertyDescriptor(n2, t2); - }), r2; -}; -var tn = {}; -var en = { get: function(n2, r2) { - if (r2 === Q) - return n2; - var e = p(n2); - if (!u(e, r2)) - return function(n3, r3, t2) { - var e2, i3 = I(r3, t2); - return i3 ? "value" in i3 ? i3.value : (e2 = i3.get) === null || e2 === undefined ? undefined : e2.call(n3.k) : undefined; - }(n2, e, r2); - var i2 = e[r2]; - return n2.I || !t(i2) ? i2 : i2 === z(n2.t, r2) ? (E(n2), n2.o[r2] = N(n2.A.h, i2, n2)) : i2; -}, has: function(n2, r2) { - return r2 in p(n2); -}, ownKeys: function(n2) { - return Reflect.ownKeys(p(n2)); -}, set: function(n2, r2, t2) { - var e = I(p(n2), r2); - if (e == null ? undefined : e.set) - return e.set.call(n2.k, t2), true; - if (!n2.P) { - var i2 = z(p(n2), r2), o2 = i2 == null ? undefined : i2[Q]; - if (o2 && o2.t === t2) - return n2.o[r2] = t2, n2.R[r2] = false, true; - if (c(t2, i2) && (t2 !== undefined || u(n2.t, r2))) - return true; - E(n2), k(n2); - } - return n2.o[r2] === t2 && (t2 !== undefined || (r2 in n2.o)) || Number.isNaN(t2) && Number.isNaN(n2.o[r2]) || (n2.o[r2] = t2, n2.R[r2] = true), true; -}, deleteProperty: function(n2, r2) { - return z(n2.t, r2) !== undefined || r2 in n2.t ? (n2.R[r2] = false, E(n2), k(n2)) : delete n2.R[r2], n2.o && delete n2.o[r2], true; -}, getOwnPropertyDescriptor: function(n2, r2) { - var t2 = p(n2), e = Reflect.getOwnPropertyDescriptor(t2, r2); - return e ? { writable: true, configurable: n2.i !== 1 || r2 !== "length", enumerable: e.enumerable, value: t2[r2] } : e; -}, defineProperty: function() { - n(11); -}, getPrototypeOf: function(n2) { - return Object.getPrototypeOf(n2.t); -}, setPrototypeOf: function() { - n(12); -} }; -var on = {}; -i(en, function(n2, r2) { - on[n2] = function() { - return arguments[0] = arguments[0][0], r2.apply(this, arguments); - }; -}), on.deleteProperty = function(r2, t2) { - return isNaN(parseInt(t2)) && n(13), on.set.call(this, r2, t2, undefined); -}, on.set = function(r2, t2, e) { - return t2 !== "length" && isNaN(parseInt(t2)) && n(14), en.set.call(this, r2[0], t2, e, r2[0]); -}; -var un = function() { - function e(r2) { - var e2 = this; - this.O = B, this.D = true, this.produce = function(r3, i3, o2) { - if (typeof r3 == "function" && typeof i3 != "function") { - var u2 = i3; - i3 = r3; - var a2 = e2; - return function(n2) { - var r4 = this; - n2 === undefined && (n2 = u2); - for (var t2 = arguments.length, e3 = Array(t2 > 1 ? t2 - 1 : 0), o3 = 1;o3 < t2; o3++) - e3[o3 - 1] = arguments[o3]; - return a2.produce(n2, function(n3) { - var t3; - return (t3 = i3).call.apply(t3, [r4, n3].concat(e3)); - }); - }; - } - var f2; - if (typeof i3 != "function" && n(6), o2 !== undefined && typeof o2 != "function" && n(7), t(r3)) { - var c2 = w(e2), s2 = N(e2, r3, undefined), v2 = true; - try { - f2 = i3(s2), v2 = false; - } finally { - v2 ? g(c2) : O(c2); - } - return typeof Promise != "undefined" && f2 instanceof Promise ? f2.then(function(n2) { - return j(c2, o2), P(n2, c2); - }, function(n2) { - throw g(c2), n2; - }) : (j(c2, o2), P(f2, c2)); - } - if (!r3 || typeof r3 != "object") { - if ((f2 = i3(r3)) === undefined && (f2 = r3), f2 === H && (f2 = undefined), e2.D && d(f2, true), o2) { - var p2 = [], l2 = []; - b("Patches").M(r3, f2, p2, l2), o2(p2, l2); - } - return f2; - } - n(21, r3); - }, this.produceWithPatches = function(n2, r3) { - if (typeof n2 == "function") - return function(r4) { - for (var t3 = arguments.length, i4 = Array(t3 > 1 ? t3 - 1 : 0), o3 = 1;o3 < t3; o3++) - i4[o3 - 1] = arguments[o3]; - return e2.produceWithPatches(r4, function(r5) { - return n2.apply(undefined, [r5].concat(i4)); - }); - }; - var t2, i3, o2 = e2.produce(n2, r3, function(n3, r4) { - t2 = n3, i3 = r4; - }); - return typeof Promise != "undefined" && o2 instanceof Promise ? o2.then(function(n3) { - return [n3, t2, i3]; - }) : [o2, t2, i3]; - }, typeof (r2 == null ? undefined : r2.useProxies) == "boolean" && this.setUseProxies(r2.useProxies), typeof (r2 == null ? undefined : r2.autoFreeze) == "boolean" && this.setAutoFreeze(r2.autoFreeze); - } - var i2 = e.prototype; - return i2.createDraft = function(e2) { - t(e2) || n(8), r(e2) && (e2 = R(e2)); - var i3 = w(this), o2 = N(this, e2, undefined); - return o2[Q].C = true, O(i3), o2; - }, i2.finishDraft = function(r2, t2) { - var e2 = r2 && r2[Q]; - e2 && e2.C || n(9), e2.I && n(10); - var i3 = e2.A; - return j(i3, t2), P(undefined, i3); - }, i2.setAutoFreeze = function(n2) { - this.D = n2; - }, i2.setUseProxies = function(r2) { - r2 && !B && n(20), this.O = r2; - }, i2.applyPatches = function(n2, t2) { - var e2; - for (e2 = t2.length - 1;e2 >= 0; e2--) { - var i3 = t2[e2]; - if (i3.path.length === 0 && i3.op === "replace") { - n2 = i3.value; - break; - } - } - e2 > -1 && (t2 = t2.slice(e2 + 1)); - var o2 = b("Patches").$; - return r(n2) ? o2(n2, t2) : this.produce(n2, function(n3) { - return o2(n3, t2); - }); - }, e; -}(); -var an = new un; -var fn = an.produce; -var cn = an.produceWithPatches.bind(an); -var sn = an.setAutoFreeze.bind(an); -var vn = an.setUseProxies.bind(an); -var pn = an.applyPatches.bind(an); -var ln = an.createDraft.bind(an); -var dn = an.finishDraft.bind(an); - -// node_modules/@babel/runtime/helpers/esm/typeof.js -function _typeof(o2) { - "@babel/helpers - typeof"; - return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o3) { - return typeof o3; - } : function(o3) { - return o3 && typeof Symbol == "function" && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; - }, _typeof(o2); -} - -// node_modules/@babel/runtime/helpers/esm/toPrimitive.js -function _toPrimitive(input, hint) { - if (_typeof(input) !== "object" || input === null) - return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || "default"); - if (_typeof(res) !== "object") - return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return (hint === "string" ? String : Number)(input); -} - -// node_modules/@babel/runtime/helpers/esm/toPropertyKey.js -function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); - return _typeof(key) === "symbol" ? key : String(key); -} - -// node_modules/@babel/runtime/helpers/esm/defineProperty.js -function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; -} + } catch (mergeError) { + acc.mutated = true; + switch (mergeError) { + case OptimisticMergeResult.SKIP: + break; + case OptimisticMergeResult.CONFLICT: + acc.transitions.push(updateTransition(action, { conflict: true })); + break; + } + } + return acc; + }, { + mutated: false, + transitions: [], + transitionState: cloneTransitionState(state) + }); + return sanitized.mutated ? sanitized.transitions : state.transitions; +}; -// node_modules/@babel/runtime/helpers/esm/objectSpread2.js -var ownKeys = function(e, r2) { - var t2 = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o2 = Object.getOwnPropertySymbols(e); - r2 && (o2 = o2.filter(function(r3) { - return Object.getOwnPropertyDescriptor(e, r3).enumerable; - })), t2.push.apply(t2, o2); - } - return t2; -}; -function _objectSpread2(e) { - for (var r2 = 1;r2 < arguments.length; r2++) { - var t2 = arguments[r2] != null ? arguments[r2] : {}; - r2 % 2 ? ownKeys(Object(t2), true).forEach(function(r3) { - _defineProperty(e, r3, t2[r3]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r3) { - Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3)); - }); - } - return e; -} +// usecases/lib/components/graph/TransitionHistoryProvider.tsx +var import_react = __toESM(require_react(), 1); -// node_modules/redux/es/redux.js -var isPlainObject3 = function(obj) { +// node_modules/redux/dist/redux.mjs +var isPlainObject = function(obj) { if (typeof obj !== "object" || obj === null) return false; - var proto = obj; + let proto = obj; while (Object.getPrototypeOf(proto) !== null) { proto = Object.getPrototypeOf(proto); } - return Object.getPrototypeOf(obj) === proto; + return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null; }; var miniKindOf = function(val) { if (val === undefined) return "undefined"; if (val === null) return "null"; - var type = typeof val; + const type = typeof val; switch (type) { case "boolean": case "string": @@ -27116,7 +27553,7 @@ var miniKindOf = function(val) { return "date"; if (isError(val)) return "error"; - var constructorName = ctorName(val); + const constructorName = ctorName(val); switch (constructorName) { case "Symbol": case "Promise": @@ -27126,7 +27563,7 @@ var miniKindOf = function(val) { case "Set": return constructorName; } - return type.slice(8, -1).toLowerCase().replace(/\s/g, ""); + return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, ""); }; var ctorName = function(val) { return typeof val.constructor === "function" ? val.constructor.name : null; @@ -27140,14 +27577,16 @@ var isDate = function(val) { return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function"; }; var kindOf = function(val) { - var typeOfVal = typeof val; + let typeOfVal = typeof val; if (true) { typeOfVal = miniKindOf(val); } return typeOfVal; }; var createStore = function(reducer, preloadedState, enhancer) { - var _ref2; + if (typeof reducer !== "function") { + throw new Error(`Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`); + } if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") { throw new Error("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."); } @@ -27157,21 +27596,22 @@ var createStore = function(reducer, preloadedState, enhancer) { } if (typeof enhancer !== "undefined") { if (typeof enhancer !== "function") { - throw new Error("Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'"); + throw new Error(`Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`); } return enhancer(createStore)(reducer, preloadedState); } - if (typeof reducer !== "function") { - throw new Error("Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'"); - } - var currentReducer = reducer; - var currentState = preloadedState; - var currentListeners = []; - var nextListeners = currentListeners; - var isDispatching = false; + let currentReducer = reducer; + let currentState = preloadedState; + let currentListeners = new Map; + let nextListeners = currentListeners; + let listenerIdCounter = 0; + let isDispatching = false; function ensureCanMutateNextListeners() { if (nextListeners === currentListeners) { - nextListeners = currentListeners.slice(); + nextListeners = new Map; + currentListeners.forEach((listener, key) => { + nextListeners.set(key, listener); + }); } } function getState() { @@ -27182,14 +27622,15 @@ var createStore = function(reducer, preloadedState, enhancer) { } function subscribe(listener) { if (typeof listener !== "function") { - throw new Error("Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'"); + throw new Error(`Expected the listener to be a function. Instead, received: '${kindOf(listener)}'`); } if (isDispatching) { throw new Error("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."); } - var isSubscribed = true; + let isSubscribed = true; ensureCanMutateNextListeners(); - nextListeners.push(listener); + const listenerId = listenerIdCounter++; + nextListeners.set(listenerId, listener); return function unsubscribe() { if (!isSubscribed) { return; @@ -27199,18 +27640,20 @@ var createStore = function(reducer, preloadedState, enhancer) { } isSubscribed = false; ensureCanMutateNextListeners(); - var index = nextListeners.indexOf(listener); - nextListeners.splice(index, 1); + nextListeners.delete(listenerId); currentListeners = null; }; } function dispatch(action) { - if (!isPlainObject3(action)) { - throw new Error("Actions must be plain objects. Instead, the actual type was: '" + kindOf(action) + "'. 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 (!isPlainObject(action)) { + throw new Error(`Actions must be plain objects. Instead, the actual type was: '${kindOf(action)}'. 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 action.type === "undefined") { throw new Error('Actions may not have an undefined "type" property. You may have misspelled an action type string constant.'); } + if (typeof action.type !== "string") { + throw new Error(`Action "type" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`); + } if (isDispatching) { throw new Error("Reducers may not dispatch actions."); } @@ -27220,56 +27663,58 @@ var createStore = function(reducer, preloadedState, enhancer) { } finally { isDispatching = false; } - var listeners = currentListeners = nextListeners; - for (var i2 = 0;i2 < listeners.length; i2++) { - var listener = listeners[i2]; + const listeners = currentListeners = nextListeners; + listeners.forEach((listener) => { listener(); - } + }); return action; } function replaceReducer(nextReducer) { if (typeof nextReducer !== "function") { - throw new Error("Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer)); + throw new Error(`Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`); } currentReducer = nextReducer; dispatch({ - type: ActionTypes.REPLACE + type: actionTypes_default.REPLACE }); } function observable() { - var _ref; - var outerSubscribe = subscribe; - return _ref = { - subscribe: function subscribe(observer) { + const outerSubscribe = subscribe; + return { + subscribe(observer) { if (typeof observer !== "object" || observer === null) { - throw new Error("Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'"); + throw new Error(`Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`); } function observeState() { - if (observer.next) { - observer.next(getState()); + const observerAsObserver = observer; + if (observerAsObserver.next) { + observerAsObserver.next(getState()); } } observeState(); - var unsubscribe = outerSubscribe(observeState); + const unsubscribe = outerSubscribe(observeState); return { unsubscribe }; + }, + [symbol_observable_default]() { + return this; } - }, _ref[$$observable] = function() { - return this; - }, _ref; + }; } dispatch({ - type: ActionTypes.INIT + type: actionTypes_default.INIT }); - return _ref2 = { + const store = { dispatch, subscribe, getState, - replaceReducer - }, _ref2[$$observable] = observable, _ref2; + replaceReducer, + [symbol_observable_default]: observable + }; + return store; }; -var warning6 = function(message) { +var warning2 = function(message) { if (typeof console !== "undefined" && typeof console.error === "function") { console.error(message); } @@ -27279,502 +27724,1270 @@ var warning6 = function(message) { } }; var getUnexpectedStateShapeWarningMessage = function(inputState, reducers, action, unexpectedKeyCache) { - var reducerKeys = Object.keys(reducers); - var argumentName = action && action.type === ActionTypes.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer"; + const reducerKeys = Object.keys(reducers); + const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer"; if (reducerKeys.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 (!isPlainObject3(inputState)) { - return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\""); + if (!isPlainObject(inputState)) { + return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`; } - var unexpectedKeys = Object.keys(inputState).filter(function(key) { - return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; - }); - unexpectedKeys.forEach(function(key) { + const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]); + unexpectedKeys.forEach((key) => { unexpectedKeyCache[key] = true; }); - if (action && action.type === ActionTypes.REPLACE) + if (action && action.type === actionTypes_default.REPLACE) return; if (unexpectedKeys.length > 0) { - return "Unexpected " + (unexpectedKeys.length > 1 ? "keys" : "key") + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". Expected to find one of the known reducer keys instead: ") + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored."); + return `Unexpected ${unexpectedKeys.length > 1 ? "keys" : "key"} "${unexpectedKeys.join('", "')}" found in ${argumentName}. Expected to find one of the known reducer keys instead: "${reducerKeys.join('", "')}". Unexpected keys will be ignored.`; } }; var assertReducerShape = function(reducers) { - Object.keys(reducers).forEach(function(key) { - var reducer = reducers[key]; - var initialState = reducer(undefined, { - type: ActionTypes.INIT + Object.keys(reducers).forEach((key) => { + const reducer = reducers[key]; + const initialState = reducer(undefined, { + type: actionTypes_default.INIT }); if (typeof initialState === "undefined") { - throw new Error("The slice reducer for key \"" + key + "\" 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."); + throw new Error(`The slice reducer for key "${key}" 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 reducer(undefined, { - type: ActionTypes.PROBE_UNKNOWN_ACTION() + type: actionTypes_default.PROBE_UNKNOWN_ACTION() }) === "undefined") { - throw new Error("The slice reducer for key \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle '" + ActionTypes.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.")); + throw new Error(`The slice reducer for key "${key}" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.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.`); } }); }; var combineReducers = function(reducers) { - var reducerKeys = Object.keys(reducers); - var finalReducers = {}; - for (var i2 = 0;i2 < reducerKeys.length; i2++) { - var key = reducerKeys[i2]; + const reducerKeys = Object.keys(reducers); + const finalReducers = {}; + for (let i = 0;i < reducerKeys.length; i++) { + const key = reducerKeys[i]; if (true) { if (typeof reducers[key] === "undefined") { - warning6("No reducer provided for key \"" + key + "\""); + warning2(`No reducer provided for key "${key}"`); } } if (typeof reducers[key] === "function") { finalReducers[key] = reducers[key]; } } - var finalReducerKeys = Object.keys(finalReducers); - var unexpectedKeyCache; + const finalReducerKeys = Object.keys(finalReducers); + let unexpectedKeyCache; if (true) { unexpectedKeyCache = {}; } - var shapeAssertionError; + let shapeAssertionError; try { assertReducerShape(finalReducers); } catch (e) { shapeAssertionError = e; } - return function combination(state, action) { - if (state === undefined) { - state = {}; - } + return function combination(state = {}, action) { if (shapeAssertionError) { throw shapeAssertionError; } if (true) { - var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); + const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); if (warningMessage) { - warning6(warningMessage); + warning2(warningMessage); } } - var hasChanged = false; - var nextState = {}; - for (var _i = 0;_i < finalReducerKeys.length; _i++) { - var _key = finalReducerKeys[_i]; - var reducer = finalReducers[_key]; - var previousStateForKey = state[_key]; - var nextStateForKey = reducer(previousStateForKey, action); + let hasChanged = false; + const nextState = {}; + for (let i = 0;i < finalReducerKeys.length; i++) { + const key = finalReducerKeys[i]; + const reducer = finalReducers[key]; + const previousStateForKey = state[key]; + const nextStateForKey = reducer(previousStateForKey, action); if (typeof nextStateForKey === "undefined") { - var actionType = action && action.type; - throw new Error("When called with an action of type " + (actionType ? "\"" + String(actionType) + "\"" : "(unknown type)") + ", the slice reducer for key \"" + _key + "\" 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."); + const actionType = action && action.type; + throw new Error(`When called with an action of type ${actionType ? `"${String(actionType)}"` : "(unknown type)"}, the slice reducer for key "${key}" 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.`); } - nextState[_key] = nextStateForKey; + nextState[key] = nextStateForKey; hasChanged = hasChanged || nextStateForKey !== previousStateForKey; } hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length; return hasChanged ? nextState : state; }; }; -var compose = function() { - for (var _len = arguments.length, funcs = new Array(_len), _key = 0;_key < _len; _key++) { - funcs[_key] = arguments[_key]; - } +var compose = function(...funcs) { if (funcs.length === 0) { - return function(arg) { - return arg; - }; + return (arg) => arg; } if (funcs.length === 1) { return funcs[0]; } - return funcs.reduce(function(a2, b2) { - return function() { - return a2(b2.apply(undefined, arguments)); - }; - }); + return funcs.reduce((a, b) => (...args) => a(b(...args))); }; -var applyMiddleware = function() { - for (var _len = arguments.length, middlewares = new Array(_len), _key = 0;_key < _len; _key++) { - middlewares[_key] = arguments[_key]; - } - return function(createStore2) { - return function() { - var store = createStore2.apply(undefined, arguments); - var _dispatch = function dispatch() { - throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch."); - }; - var middlewareAPI = { - getState: store.getState, - dispatch: function dispatch() { - return _dispatch.apply(undefined, arguments); - } - }; - var chain = middlewares.map(function(middleware) { - return middleware(middlewareAPI); - }); - _dispatch = compose.apply(undefined, chain)(store.dispatch); - return _objectSpread2(_objectSpread2({}, store), {}, { - dispatch: _dispatch - }); +var applyMiddleware = function(...middlewares) { + return (createStore2) => (reducer, preloadedState) => { + const store = createStore2(reducer, preloadedState); + let dispatch = () => { + throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch."); + }; + const middlewareAPI = { + getState: store.getState, + dispatch: (action, ...args) => dispatch(action, ...args) + }; + const chain = middlewares.map((middleware) => middleware(middlewareAPI)); + dispatch = compose(...chain)(store.dispatch); + return { + ...store, + dispatch }; }; }; -var $$observable = function() { - return typeof Symbol === "function" && Symbol.observable || "@@observable"; -}(); -var randomString = function randomString2() { - return Math.random().toString(36).substring(7).split("").join("."); +var isAction = function(action) { + return isPlainObject(action) && "type" in action && typeof action.type === "string"; }; +var $$observable = (() => typeof Symbol === "function" && Symbol.observable || "@@observable")(); +var symbol_observable_default = $$observable; +var randomString = () => Math.random().toString(36).substring(7).split("").join("."); var ActionTypes = { - INIT: "@@redux/INIT" + randomString(), - REPLACE: "@@redux/REPLACE" + randomString(), - PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() { - return "@@redux/PROBE_UNKNOWN_ACTION" + randomString(); + INIT: `@@redux/INIT${randomString()}`, + REPLACE: `@@redux/REPLACE${randomString()}`, + PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}` +}; +var actionTypes_default = ActionTypes; +// node_modules/immer/dist/immer.mjs +var die = function(error, ...args) { + if (true) { + const e = errors[error]; + const msg = typeof e === "function" ? e.apply(null, args) : e; + throw new Error(`[Immer] ${msg}`); } + throw new Error(`[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`); }; -// node_modules/reselect/es/defaultMemoize.js -var createSingletonCache = function(equals) { - var entry; - return { - get: function get(key) { - if (entry && equals(entry.key, key)) { - return entry.value; - } - return NOT_FOUND; - }, - put: function put(key, value) { - entry = { - key, - value - }; - }, - getEntries: function getEntries() { - return entry ? [entry] : []; - }, - clear: function clear() { - entry = undefined; - } - }; +var isDraft = function(value) { + return !!value && !!value[DRAFT_STATE]; +}; +var isDraftable = function(value) { + if (!value) + return false; + return isPlainObject2(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value); +}; +var isPlainObject2 = function(value) { + if (!value || typeof value !== "object") + return false; + const proto = getPrototypeOf(value); + if (proto === null) { + return true; + } + const Ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor; + if (Ctor === Object) + return true; + return typeof Ctor == "function" && Function.toString.call(Ctor) === objectCtorString; }; -var createLruCache = function(maxSize, equals) { - var entries = []; - function get(key) { - var cacheIndex = entries.findIndex(function(entry2) { - return equals(key, entry2.key); +var each = function(obj, iter) { + if (getArchtype(obj) === 0) { + Object.entries(obj).forEach(([key, value]) => { + iter(key, value, obj); }); - if (cacheIndex > -1) { - var entry = entries[cacheIndex]; - if (cacheIndex > 0) { - entries.splice(cacheIndex, 1); - entries.unshift(entry); - } - return entry.value; - } - return NOT_FOUND; + } else { + obj.forEach((entry, index) => iter(index, entry, obj)); } - function put(key, value) { - if (get(key) === NOT_FOUND) { - entries.unshift({ - key, - value - }); - if (entries.length > maxSize) { - entries.pop(); - } +}; +var getArchtype = function(thing) { + const state = thing[DRAFT_STATE]; + return state ? state.type_ : Array.isArray(thing) ? 1 : isMap(thing) ? 2 : isSet(thing) ? 3 : 0; +}; +var has = function(thing, prop) { + return getArchtype(thing) === 2 ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop); +}; +var set = function(thing, propOrOldValue, value) { + const t = getArchtype(thing); + if (t === 2) + thing.set(propOrOldValue, value); + else if (t === 3) { + thing.add(value); + } else + thing[propOrOldValue] = value; +}; +var is = function(x, y) { + if (x === y) { + return x !== 0 || 1 / x === 1 / y; + } else { + return x !== x && y !== y; + } +}; +var isMap = function(target) { + return target instanceof Map; +}; +var isSet = function(target) { + return target instanceof Set; +}; +var latest = function(state) { + return state.copy_ || state.base_; +}; +var shallowCopy = function(base, strict) { + if (isMap(base)) { + return new Map(base); + } + if (isSet(base)) { + return new Set(base); + } + if (Array.isArray(base)) + return Array.prototype.slice.call(base); + if (!strict && isPlainObject2(base)) { + if (!getPrototypeOf(base)) { + const obj = Object.create(null); + return Object.assign(obj, base); } + return { ...base }; + } + const descriptors = Object.getOwnPropertyDescriptors(base); + delete descriptors[DRAFT_STATE]; + let keys = Reflect.ownKeys(descriptors); + for (let i = 0;i < keys.length; i++) { + const key = keys[i]; + const desc = descriptors[key]; + if (desc.writable === false) { + desc.writable = true; + desc.configurable = true; + } + if (desc.get || desc.set) + descriptors[key] = { + configurable: true, + writable: true, + enumerable: desc.enumerable, + value: base[key] + }; } - function getEntries() { - return entries; + return Object.create(getPrototypeOf(base), descriptors); +}; +var freeze = function(obj, deep = false) { + if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj)) + return obj; + if (getArchtype(obj) > 1) { + obj.set = obj.add = obj.clear = obj.delete = dontMutateFrozenCollections; } - function clear() { - entries = []; + Object.freeze(obj); + if (deep) + each(obj, (_key, value) => freeze(value, true), true); + return obj; +}; +var dontMutateFrozenCollections = function() { + die(2); +}; +var isFrozen = function(obj) { + return Object.isFrozen(obj); +}; +var getPlugin = function(pluginKey) { + const plugin = plugins[pluginKey]; + if (!plugin) { + die(0, pluginKey); } + return plugin; +}; +var getCurrentScope = function() { + return currentScope; +}; +var createScope = function(parent_, immer_) { return { - get, - put, - getEntries, - clear + drafts_: [], + parent_, + immer_, + canAutoFreeze_: true, + unfinalizedDrafts_: 0 }; }; -function createCacheKeyComparator(equalityCheck) { - return function areArgumentsShallowlyEqual(prev, next) { - if (prev === null || next === null || prev.length !== next.length) { - return false; +var usePatchesInScope = function(scope, patchListener) { + if (patchListener) { + getPlugin("Patches"); + scope.patches_ = []; + scope.inversePatches_ = []; + scope.patchListener_ = patchListener; + } +}; +var revokeScope = function(scope) { + leaveScope(scope); + scope.drafts_.forEach(revokeDraft); + scope.drafts_ = null; +}; +var leaveScope = function(scope) { + if (scope === currentScope) { + currentScope = scope.parent_; + } +}; +var enterScope = function(immer2) { + return currentScope = createScope(currentScope, immer2); +}; +var revokeDraft = function(draft) { + const state = draft[DRAFT_STATE]; + if (state.type_ === 0 || state.type_ === 1) + state.revoke_(); + else + state.revoked_ = true; +}; +var processResult = function(result, scope) { + scope.unfinalizedDrafts_ = scope.drafts_.length; + const baseDraft = scope.drafts_[0]; + const isReplaced = result !== undefined && result !== baseDraft; + if (isReplaced) { + if (baseDraft[DRAFT_STATE].modified_) { + revokeScope(scope); + die(4); } - var length = prev.length; - for (var i2 = 0;i2 < length; i2++) { - if (!equalityCheck(prev[i2], next[i2])) { - return false; + if (isDraftable(result)) { + result = finalize(scope, result); + if (!scope.parent_) + maybeFreeze(scope, result); + } + if (scope.patches_) { + getPlugin("Patches").generateReplacementPatches_(baseDraft[DRAFT_STATE].base_, result, scope.patches_, scope.inversePatches_); + } + } else { + result = finalize(scope, baseDraft, []); + } + revokeScope(scope); + if (scope.patches_) { + scope.patchListener_(scope.patches_, scope.inversePatches_); + } + return result !== NOTHING ? result : undefined; +}; +var finalize = function(rootScope, value, path) { + if (isFrozen(value)) + return value; + const state = value[DRAFT_STATE]; + if (!state) { + each(value, (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path), true); + return value; + } + if (state.scope_ !== rootScope) + return value; + if (!state.modified_) { + maybeFreeze(rootScope, state.base_, true); + return state.base_; + } + if (!state.finalized_) { + state.finalized_ = true; + state.scope_.unfinalizedDrafts_--; + const result = state.copy_; + let resultEach = result; + let isSet2 = false; + if (state.type_ === 3) { + resultEach = new Set(result); + result.clear(); + isSet2 = true; + } + each(resultEach, (key, childValue) => finalizeProperty(rootScope, state, result, key, childValue, path, isSet2)); + maybeFreeze(rootScope, result, false); + if (path && rootScope.patches_) { + getPlugin("Patches").generatePatches_(state, path, rootScope.patches_, rootScope.inversePatches_); + } + } + return state.copy_; +}; +var finalizeProperty = function(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) { + if (childValue === targetObject) + die(5); + if (isDraft(childValue)) { + const path = rootPath && parentState && parentState.type_ !== 3 && !has(parentState.assigned_, prop) ? rootPath.concat(prop) : undefined; + const res = finalize(rootScope, childValue, path); + set(targetObject, prop, res); + if (isDraft(res)) { + rootScope.canAutoFreeze_ = false; + } else + return; + } else if (targetIsSet) { + targetObject.add(childValue); + } + if (isDraftable(childValue) && !isFrozen(childValue)) { + if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) { + return; + } + finalize(rootScope, childValue); + if (!parentState || !parentState.scope_.parent_) + maybeFreeze(rootScope, childValue); + } +}; +var maybeFreeze = function(scope, value, deep = false) { + if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) { + freeze(value, deep); + } +}; +var createProxyProxy = function(base, parent) { + const isArray = Array.isArray(base); + const state = { + type_: isArray ? 1 : 0, + scope_: parent ? parent.scope_ : getCurrentScope(), + modified_: false, + finalized_: false, + assigned_: {}, + parent_: parent, + base_: base, + draft_: null, + copy_: null, + revoke_: null, + isManual_: false + }; + let target = state; + let traps = objectTraps; + if (isArray) { + target = [state]; + traps = arrayTraps; + } + const { revoke, proxy } = Proxy.revocable(target, traps); + state.draft_ = proxy; + state.revoke_ = revoke; + return proxy; +}; +var peek = function(draft, prop) { + const state = draft[DRAFT_STATE]; + const source = state ? latest(state) : draft; + return source[prop]; +}; +var readPropFromProto = function(state, source, prop) { + const desc = getDescriptorFromProto(source, prop); + return desc ? `value` in desc ? desc.value : desc.get?.call(state.draft_) : undefined; +}; +var getDescriptorFromProto = function(source, prop) { + if (!(prop in source)) + return; + let proto = getPrototypeOf(source); + while (proto) { + const desc = Object.getOwnPropertyDescriptor(proto, prop); + if (desc) + return desc; + proto = getPrototypeOf(proto); + } + return; +}; +var markChanged = function(state) { + if (!state.modified_) { + state.modified_ = true; + if (state.parent_) { + markChanged(state.parent_); + } + } +}; +var prepareCopy = function(state) { + if (!state.copy_) { + state.copy_ = shallowCopy(state.base_, state.scope_.immer_.useStrictShallowCopy_); + } +}; +var createProxy = function(value, parent) { + const draft = isMap(value) ? getPlugin("MapSet").proxyMap_(value, parent) : isSet(value) ? getPlugin("MapSet").proxySet_(value, parent) : createProxyProxy(value, parent); + const scope = parent ? parent.scope_ : getCurrentScope(); + scope.drafts_.push(draft); + return draft; +}; +var current = function(value) { + if (!isDraft(value)) + die(10, value); + return currentImpl(value); +}; +var currentImpl = function(value) { + if (!isDraftable(value) || isFrozen(value)) + return value; + const state = value[DRAFT_STATE]; + let copy; + if (state) { + if (!state.modified_) + return state.base_; + state.finalized_ = true; + copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_); + } else { + copy = shallowCopy(value, true); + } + each(copy, (key, childValue) => { + set(copy, key, currentImpl(childValue)); + }); + if (state) { + state.finalized_ = false; + } + return copy; +}; +var NOTHING = Symbol.for("immer-nothing"); +var DRAFTABLE = Symbol.for("immer-draftable"); +var DRAFT_STATE = Symbol.for("immer-state"); +var errors = [ + function(plugin) { + return `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \`enable${plugin}()\` when initializing your application.`; + }, + function(thing) { + 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 '${thing}'`; + }, + "This object has been frozen and should not be mutated", + function(data) { + return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + data; + }, + "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(thing) { + return `'current' expects a draft, got: ${thing}`; + }, + "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(thing) { + return `'original' expects a draft, got: ${thing}`; + } +]; +var getPrototypeOf = Object.getPrototypeOf; +var objectCtorString = Object.prototype.constructor.toString(); +var plugins = {}; +var currentScope; +var objectTraps = { + get(state, prop) { + if (prop === DRAFT_STATE) + return state; + const source = latest(state); + if (!has(source, prop)) { + return readPropFromProto(state, source, prop); + } + const value = source[prop]; + if (state.finalized_ || !isDraftable(value)) { + return value; + } + if (value === peek(state.base_, prop)) { + prepareCopy(state); + return state.copy_[prop] = createProxy(value, state); + } + return value; + }, + has(state, prop) { + return prop in latest(state); + }, + ownKeys(state) { + return Reflect.ownKeys(latest(state)); + }, + set(state, prop, value) { + const desc = getDescriptorFromProto(latest(state), prop); + if (desc?.set) { + desc.set.call(state.draft_, value); + return true; + } + if (!state.modified_) { + const current2 = peek(latest(state), prop); + const currentState = current2?.[DRAFT_STATE]; + if (currentState && currentState.base_ === value) { + state.copy_[prop] = value; + state.assigned_[prop] = false; + return true; } + if (is(value, current2) && (value !== undefined || has(state.base_, prop))) + return true; + prepareCopy(state); + markChanged(state); } + if (state.copy_[prop] === value && (value !== undefined || (prop in state.copy_)) || Number.isNaN(value) && Number.isNaN(state.copy_[prop])) + return true; + state.copy_[prop] = value; + state.assigned_[prop] = true; return true; + }, + deleteProperty(state, prop) { + if (peek(state.base_, prop) !== undefined || prop in state.base_) { + state.assigned_[prop] = false; + prepareCopy(state); + markChanged(state); + } else { + delete state.assigned_[prop]; + } + if (state.copy_) { + delete state.copy_[prop]; + } + return true; + }, + getOwnPropertyDescriptor(state, prop) { + const owner = latest(state); + const desc = Reflect.getOwnPropertyDescriptor(owner, prop); + if (!desc) + return desc; + return { + writable: true, + configurable: state.type_ !== 1 || prop !== "length", + enumerable: desc.enumerable, + value: owner[prop] + }; + }, + defineProperty() { + die(11); + }, + getPrototypeOf(state) { + return getPrototypeOf(state.base_); + }, + setPrototypeOf() { + die(12); + } +}; +var arrayTraps = {}; +each(objectTraps, (key, fn) => { + arrayTraps[key] = function() { + arguments[0] = arguments[0][0]; + return fn.apply(this, arguments); }; -} -function defaultMemoize(func, equalityCheckOrOptions) { - var providedOptions = typeof equalityCheckOrOptions === "object" ? equalityCheckOrOptions : { - equalityCheck: equalityCheckOrOptions - }; - var _providedOptions$equa = providedOptions.equalityCheck, equalityCheck = _providedOptions$equa === undefined ? defaultEqualityCheck : _providedOptions$equa, _providedOptions$maxS = providedOptions.maxSize, maxSize = _providedOptions$maxS === undefined ? 1 : _providedOptions$maxS, resultEqualityCheck = providedOptions.resultEqualityCheck; - var comparator = createCacheKeyComparator(equalityCheck); - var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); - function memoized() { - var value = cache.get(arguments); - if (value === NOT_FOUND) { - value = func.apply(null, arguments); - if (resultEqualityCheck) { - var entries = cache.getEntries(); - var matchingEntry = entries.find(function(entry) { - return resultEqualityCheck(entry.value, value); - }); - if (matchingEntry) { - value = matchingEntry.value; +}); +arrayTraps.deleteProperty = function(state, prop) { + if (isNaN(parseInt(prop))) + die(13); + return arrayTraps.set.call(this, state, prop, undefined); +}; +arrayTraps.set = function(state, prop, value) { + if (prop !== "length" && isNaN(parseInt(prop))) + die(14); + return objectTraps.set.call(this, state[0], prop, value, state[0]); +}; +var Immer2 = class { + constructor(config) { + this.autoFreeze_ = true; + this.useStrictShallowCopy_ = false; + this.produce = (base, recipe, patchListener) => { + if (typeof base === "function" && typeof recipe !== "function") { + const defaultBase = recipe; + recipe = base; + const self2 = this; + return function curriedProduce(base2 = defaultBase, ...args) { + return self2.produce(base2, (draft) => recipe.call(this, draft, ...args)); + }; + } + if (typeof recipe !== "function") + die(6); + if (patchListener !== undefined && typeof patchListener !== "function") + die(7); + let result; + if (isDraftable(base)) { + const scope = enterScope(this); + const proxy = createProxy(base, undefined); + let hasError = true; + try { + result = recipe(proxy); + hasError = false; + } finally { + if (hasError) + revokeScope(scope); + else + leaveScope(scope); + } + usePatchesInScope(scope, patchListener); + return processResult(result, scope); + } else if (!base || typeof base !== "object") { + result = recipe(base); + if (result === undefined) + result = base; + if (result === NOTHING) + result = undefined; + if (this.autoFreeze_) + freeze(result, true); + if (patchListener) { + const p = []; + const ip = []; + getPlugin("Patches").generateReplacementPatches_(base, result, p, ip); + patchListener(p, ip); } + return result; + } else + die(1, base); + }; + this.produceWithPatches = (base, recipe) => { + if (typeof base === "function") { + return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args)); + } + let patches, inversePatches; + const result = this.produce(base, recipe, (p, ip) => { + patches = p; + inversePatches = ip; + }); + return [result, patches, inversePatches]; + }; + if (typeof config?.autoFreeze === "boolean") + this.setAutoFreeze(config.autoFreeze); + if (typeof config?.useStrictShallowCopy === "boolean") + this.setUseStrictShallowCopy(config.useStrictShallowCopy); + } + createDraft(base) { + if (!isDraftable(base)) + die(8); + if (isDraft(base)) + base = current(base); + const scope = enterScope(this); + const proxy = createProxy(base, undefined); + proxy[DRAFT_STATE].isManual_ = true; + leaveScope(scope); + return proxy; + } + finishDraft(draft, patchListener) { + const state = draft && draft[DRAFT_STATE]; + if (!state || !state.isManual_) + die(9); + const { scope_: scope } = state; + usePatchesInScope(scope, patchListener); + return processResult(undefined, scope); + } + setAutoFreeze(value) { + this.autoFreeze_ = value; + } + setUseStrictShallowCopy(value) { + this.useStrictShallowCopy_ = value; + } + applyPatches(base, patches) { + let i; + for (i = patches.length - 1;i >= 0; i--) { + const patch = patches[i]; + if (patch.path.length === 0 && patch.op === "replace") { + base = patch.value; + break; } - cache.put(arguments, value); } - return value; + if (i > -1) { + patches = patches.slice(i + 1); + } + const applyPatchesImpl = getPlugin("Patches").applyPatches_; + if (isDraft(base)) { + return applyPatchesImpl(base, patches); + } + return this.produce(base, (draft) => applyPatchesImpl(draft, patches)); } - memoized.clearCache = function() { - return cache.clear(); - }; - return memoized; -} -var NOT_FOUND = "NOT_FOUND"; -var defaultEqualityCheck = function defaultEqualityCheck2(a2, b2) { - return a2 === b2; }; +var immer = new Immer2; +var produce = immer.produce; +var produceWithPatches = immer.produceWithPatches.bind(immer); +var setAutoFreeze = immer.setAutoFreeze.bind(immer); +var setUseStrictShallowCopy = immer.setUseStrictShallowCopy.bind(immer); +var applyPatches = immer.applyPatches.bind(immer); +var createDraft = immer.createDraft.bind(immer); +var finishDraft = immer.finishDraft.bind(immer); -// node_modules/reselect/es/index.js -var getDependencies = function(funcs) { - var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs; - if (!dependencies.every(function(dep) { - return typeof dep === "function"; - })) { - var dependencyTypes = dependencies.map(function(dep) { - return typeof dep === "function" ? "function " + (dep.name || "unnamed") + "()" : typeof dep; - }).join(", "); - throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]"); +// node_modules/reselect/dist/reselect.mjs +var assertIsFunction = function(func, errorMessage = `expected a function, instead received ${typeof func}`) { + if (typeof func !== "function") { + throw new TypeError(errorMessage); + } +}; +var assertIsObject = function(object, errorMessage = `expected an object, instead received ${typeof object}`) { + if (typeof object !== "object") { + throw new TypeError(errorMessage); + } +}; +var assertIsArrayOfFunctions = function(array, errorMessage = `expected all items to be functions, instead received the following types: `) { + if (!array.every((item) => typeof item === "function")) { + const itemTypes = array.map((item) => typeof item === "function" ? `function ${item.name || "unnamed"}()` : typeof item).join(", "); + throw new TypeError(`${errorMessage}[${itemTypes}]`); } +}; +var getDependencies = function(createSelectorArgs) { + const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs; + assertIsArrayOfFunctions(dependencies, `createSelector expects all input-selectors to be functions, but received the following types: `); return dependencies; }; -function createSelectorCreator(memoize) { - for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1;_key < _len; _key++) { - memoizeOptionsFromArgs[_key - 1] = arguments[_key]; +var collectInputSelectorResults = function(dependencies, inputSelectorArgs) { + const inputSelectorResults = []; + const { length } = dependencies; + for (let i = 0;i < length; i++) { + inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs)); + } + return inputSelectorResults; +}; +var tripleEq = function(a, b) { + return a === b; +}; +var getValue = function(cell) { + if (!(cell instanceof Cell)) { + console.warn("Not a valid cell! ", cell); + } + return cell.value; +}; +var createCell = function(initialValue, isEqual = tripleEq) { + return new Cell(initialValue, isEqual); +}; +var createTag = function() { + return createCell(null, neverEq); +}; +var createNode = function(value) { + if (Array.isArray(value)) { + return new ArrayTreeNode(value); } - var createSelector = function createSelector() { - for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0;_key2 < _len2; _key2++) { - funcs[_key2] = arguments[_key2]; + return new ObjectTreeNode(value); +}; +var createCacheNode = function() { + return { + s: UNTERMINATED, + v: undefined, + o: null, + p: null + }; +}; +var weakMapMemoize = function(func, options = {}) { + let fnNode = createCacheNode(); + const { resultEqualityCheck } = options; + let lastResult; + let resultsCount = 0; + function memoized() { + let cacheNode = fnNode; + const { length } = arguments; + for (let i = 0, l = length;i < l; i++) { + const arg = arguments[i]; + if (typeof arg === "function" || typeof arg === "object" && arg !== null) { + let objectCache = cacheNode.o; + if (objectCache === null) { + cacheNode.o = objectCache = new WeakMap; + } + const objectNode = objectCache.get(arg); + if (objectNode === undefined) { + cacheNode = createCacheNode(); + objectCache.set(arg, cacheNode); + } else { + cacheNode = objectNode; + } + } else { + let primitiveCache = cacheNode.p; + if (primitiveCache === null) { + cacheNode.p = primitiveCache = new Map; + } + const primitiveNode = primitiveCache.get(arg); + if (primitiveNode === undefined) { + cacheNode = createCacheNode(); + primitiveCache.set(arg, cacheNode); + } else { + cacheNode = primitiveNode; + } + } } - var _recomputations = 0; - var _lastResult; - var directlyPassedOptions = { - memoizeOptions: undefined - }; - var resultFunc = funcs.pop(); + const terminatedNode = cacheNode; + let result; + if (cacheNode.s === TERMINATED) { + result = cacheNode.v; + } else { + result = func.apply(null, arguments); + resultsCount++; + } + terminatedNode.s = TERMINATED; + if (resultEqualityCheck) { + const lastResultValue = lastResult?.deref?.() ?? lastResult; + if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) { + result = lastResultValue; + resultsCount !== 0 && resultsCount--; + } + const needsWeakRef = typeof result === "object" && result !== null || typeof result === "function"; + lastResult = needsWeakRef ? new Ref(result) : result; + } + terminatedNode.v = result; + return result; + } + memoized.clearCache = () => { + fnNode = createCacheNode(); + memoized.resetResultsCount(); + }; + memoized.resultsCount = () => resultsCount; + memoized.resetResultsCount = () => { + resultsCount = 0; + }; + return memoized; +}; +var createSelectorCreator = function(memoizeOrOptions, ...memoizeOptionsFromArgs) { + const createSelectorCreatorOptions = typeof memoizeOrOptions === "function" ? { + memoize: memoizeOrOptions, + memoizeOptions: memoizeOptionsFromArgs + } : memoizeOrOptions; + const createSelector2 = (...createSelectorArgs) => { + let recomputations = 0; + let dependencyRecomputations = 0; + let lastResult; + let directlyPassedOptions = {}; + let resultFunc = createSelectorArgs.pop(); if (typeof resultFunc === "object") { directlyPassedOptions = resultFunc; - resultFunc = funcs.pop(); - } - if (typeof resultFunc !== "function") { - throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]"); + resultFunc = createSelectorArgs.pop(); } - var _directlyPassedOption = directlyPassedOptions, _directlyPassedOption2 = _directlyPassedOption.memoizeOptions, memoizeOptions = _directlyPassedOption2 === undefined ? memoizeOptionsFromArgs : _directlyPassedOption2; - var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions]; - var dependencies = getDependencies(funcs); - var memoizedResultFunc = memoize.apply(undefined, [function recomputationWrapper() { - _recomputations++; + assertIsFunction(resultFunc, `createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]`); + const combinedOptions = { + ...createSelectorCreatorOptions, + ...directlyPassedOptions + }; + const { + memoize, + memoizeOptions = [], + argsMemoize = weakMapMemoize, + argsMemoizeOptions = [], + devModeChecks = {} + } = combinedOptions; + const finalMemoizeOptions = ensureIsArray(memoizeOptions); + const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions); + const dependencies = getDependencies(createSelectorArgs); + const memoizedResultFunc = memoize(function recomputationWrapper() { + recomputations++; return resultFunc.apply(null, arguments); - }].concat(finalMemoizeOptions)); - var selector = memoize(function dependenciesChecker() { - var params = []; - var length = dependencies.length; - for (var i2 = 0;i2 < length; i2++) { - params.push(dependencies[i2].apply(null, arguments)); - } - _lastResult = memoizedResultFunc.apply(null, params); - return _lastResult; - }); - Object.assign(selector, { + }, ...finalMemoizeOptions); + let firstRun = true; + const selector = argsMemoize(function dependenciesChecker() { + dependencyRecomputations++; + const inputSelectorResults = collectInputSelectorResults(dependencies, arguments); + lastResult = memoizedResultFunc.apply(null, inputSelectorResults); + if (true) { + const { identityFunctionCheck, inputStabilityCheck } = getDevModeChecksExecutionInfo(firstRun, devModeChecks); + if (identityFunctionCheck.shouldRun) { + identityFunctionCheck.run(resultFunc, inputSelectorResults, lastResult); + } + if (inputStabilityCheck.shouldRun) { + const inputSelectorResultsCopy = collectInputSelectorResults(dependencies, arguments); + inputStabilityCheck.run({ inputSelectorResults, inputSelectorResultsCopy }, { memoize, memoizeOptions: finalMemoizeOptions }, arguments); + } + if (firstRun) + firstRun = false; + } + return lastResult; + }, ...finalArgsMemoizeOptions); + return Object.assign(selector, { resultFunc, memoizedResultFunc, dependencies, - lastResult: function lastResult() { - return _lastResult; + dependencyRecomputations: () => dependencyRecomputations, + resetDependencyRecomputations: () => { + dependencyRecomputations = 0; }, - recomputations: function recomputations() { - return _recomputations; + lastResult: () => lastResult, + recomputations: () => recomputations, + resetRecomputations: () => { + recomputations = 0; }, - resetRecomputations: function resetRecomputations() { - return _recomputations = 0; - } + memoize, + argsMemoize }); - return selector; }; - return createSelector; -} -var createSelector = createSelectorCreator(defaultMemoize); - -// node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js -var isPlainObject4 = function(value) { - if (typeof value !== "object" || value === null) - return false; - var proto = Object.getPrototypeOf(value); - if (proto === null) - return true; - var baseProto = proto; - while (Object.getPrototypeOf(baseProto) !== null) { - baseProto = Object.getPrototypeOf(baseProto); + Object.assign(createSelector2, { + withTypes: () => createSelector2 + }); + return createSelector2; +}; +var runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => { + if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) { + let isInputSameAsOutput = false; + try { + const emptyObject = {}; + if (resultFunc(emptyObject) === emptyObject) + isInputSameAsOutput = true; + } catch { + } + if (isInputSameAsOutput) { + let stack = undefined; + try { + throw new Error; + } catch (e) { + ({ stack } = e); + } + console.warn("The result function returned its own inputs without modification. e.g\n`createSelector([state => state.todos], todos => todos)`\nThis could lead to inefficient memoization and unnecessary re-renders.\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.", { stack }); + } + } +}; +var runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => { + const { memoize, memoizeOptions } = options; + const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject; + const createAnEmptyObject = memoize(() => ({}), ...memoizeOptions); + const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy); + if (!areInputSelectorResultsEqual) { + let stack = undefined; + try { + throw new Error; + } catch (e) { + ({ stack } = e); + } + console.warn("An input selector returned a different result when passed same arguments.\nThis means your output selector will likely run more frequently than intended.\nAvoid returning a new reference inside your input selector, e.g.\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`", { + arguments: inputSelectorArgs, + firstInputs: inputSelectorResults, + secondInputs: inputSelectorResultsCopy, + stack + }); } - return proto === baseProto; }; +var globalDevModeChecks = { + inputStabilityCheck: "once", + identityFunctionCheck: "once" +}; +var ensureIsArray = (item) => { + return Array.isArray(item) ? item : [item]; +}; +var getDevModeChecksExecutionInfo = (firstRun, devModeChecks) => { + const { identityFunctionCheck, inputStabilityCheck } = { + ...globalDevModeChecks, + ...devModeChecks + }; + return { + identityFunctionCheck: { + shouldRun: identityFunctionCheck === "always" || identityFunctionCheck === "once" && firstRun, + run: runIdentityFunctionCheck + }, + inputStabilityCheck: { + shouldRun: inputStabilityCheck === "always" || inputStabilityCheck === "once" && firstRun, + run: runInputStabilityCheck + } + }; +}; +var $REVISION = 0; +var CURRENT_TRACKER = null; +var Cell = class { + revision = $REVISION; + _value; + _lastValue; + _isEqual = tripleEq; + constructor(initialValue, isEqual = tripleEq) { + this._value = this._lastValue = initialValue; + this._isEqual = isEqual; + } + get value() { + CURRENT_TRACKER?.add(this); + return this._value; + } + set value(newValue) { + if (this.value === newValue) + return; + this._value = newValue; + this.revision = ++$REVISION; + } +}; +var neverEq = (a, b) => false; +var consumeCollection = (node) => { + let tag = node.collectionTag; + if (tag === null) { + tag = node.collectionTag = createTag(); + } + getValue(tag); +}; +var REDUX_PROXY_LABEL = Symbol(); +var nextId = 0; +var proto = Object.getPrototypeOf({}); +var ObjectTreeNode = class { + constructor(value) { + this.value = value; + this.value = value; + this.tag.value = value; + } + proxy = new Proxy(this, objectProxyHandler); + tag = createTag(); + tags = {}; + children = {}; + collectionTag = null; + id = nextId++; +}; +var objectProxyHandler = { + get(node, key) { + function calculateResult() { + const { value } = node; + const childValue = Reflect.get(value, key); + if (typeof key === "symbol") { + return childValue; + } + if (key in proto) { + return childValue; + } + if (typeof childValue === "object" && childValue !== null) { + let childNode = node.children[key]; + if (childNode === undefined) { + childNode = node.children[key] = createNode(childValue); + } + if (childNode.tag) { + getValue(childNode.tag); + } + return childNode.proxy; + } else { + let tag = node.tags[key]; + if (tag === undefined) { + tag = node.tags[key] = createTag(); + tag.value = childValue; + } + getValue(tag); + return childValue; + } + } + const res = calculateResult(); + return res; + }, + ownKeys(node) { + consumeCollection(node); + return Reflect.ownKeys(node.value); + }, + getOwnPropertyDescriptor(node, prop) { + return Reflect.getOwnPropertyDescriptor(node.value, prop); + }, + has(node, prop) { + return Reflect.has(node.value, prop); + } +}; +var ArrayTreeNode = class { + constructor(value) { + this.value = value; + this.value = value; + this.tag.value = value; + } + proxy = new Proxy([this], arrayProxyHandler); + tag = createTag(); + tags = {}; + children = {}; + collectionTag = null; + id = nextId++; +}; +var arrayProxyHandler = { + get([node], key) { + if (key === "length") { + consumeCollection(node); + } + return objectProxyHandler.get(node, key); + }, + ownKeys([node]) { + return objectProxyHandler.ownKeys(node); + }, + getOwnPropertyDescriptor([node], prop) { + return objectProxyHandler.getOwnPropertyDescriptor(node, prop); + }, + has([node], prop) { + return objectProxyHandler.has(node, prop); + } +}; +var StrongRef = class { + constructor(value) { + this.value = value; + } + deref() { + return this.value; + } +}; +var Ref = typeof WeakRef !== "undefined" ? WeakRef : StrongRef; +var UNTERMINATED = 0; +var TERMINATED = 1; +var createSelector = createSelectorCreator(weakMapMemoize); +var createStructuredSelector = Object.assign((inputSelectorsObject, selectorCreator = createSelector) => { + assertIsObject(inputSelectorsObject, `createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof inputSelectorsObject}`); + const inputSelectorKeys = Object.keys(inputSelectorsObject); + const dependencies = inputSelectorKeys.map((key) => inputSelectorsObject[key]); + const structuredSelector = selectorCreator(dependencies, (...inputSelectorResults) => { + return inputSelectorResults.reduce((composition, value, index) => { + composition[inputSelectorKeys[index]] = value; + return composition; + }, {}); + }); + return structuredSelector; +}, { withTypes: () => createStructuredSelector }); -// node_modules/redux-thunk/es/index.js +// node_modules/redux-thunk/dist/redux-thunk.mjs var createThunkMiddleware = function(extraArgument) { - var middleware = function middleware(_ref) { - var { dispatch, getState } = _ref; - return function(next) { - return function(action) { - if (typeof action === "function") { - return action(dispatch, getState, extraArgument); - } - return next(action); - }; - }; + const middleware = ({ dispatch, getState }) => (next) => (action) => { + if (typeof action === "function") { + return action(dispatch, getState, extraArgument); + } + return next(action); }; return middleware; }; var thunk = createThunkMiddleware(); -thunk.withExtraArgument = createThunkMiddleware; -var es_default = thunk; +var withExtraArgument = createThunkMiddleware; -// node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js +// node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.mjs var createAction = function(type, prepareAction) { - function actionCreator() { - var args = []; - for (var _i = 0;_i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } + function actionCreator(...args) { if (prepareAction) { - var prepared = prepareAction.apply(undefined, args); + let prepared = prepareAction(...args); if (!prepared) { throw new Error("prepareAction did not return an object"); } - return __spreadValues(__spreadValues({ + return { type, - payload: prepared.payload - }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error }); + payload: prepared.payload, + ..."meta" in prepared && { + meta: prepared.meta + }, + ..."error" in prepared && { + error: prepared.error + } + }; } - return { type, payload: args[0] }; + return { + type, + payload: args[0] + }; } - actionCreator.toString = function() { - return "" + type; - }; + actionCreator.toString = () => `${type}`; actionCreator.type = type; - actionCreator.match = function(action) { - return action.type === type; - }; + actionCreator.match = (action) => isAction(action) && action.type === type; return actionCreator; }; var isActionCreator = function(action) { return typeof action === "function" && "type" in action && hasMatchFunction(action); }; var getMessage = function(type) { - var splitType = type ? ("" + type).split("/") : []; - var actionName = splitType[splitType.length - 1] || "actionCreator"; - return "Detected an action creator with type \"" + (type || "unknown") + "\" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. `dispatch(" + actionName + "())` instead of `dispatch(" + actionName + ")`. This is necessary even if the action has no payload."; + const splitType = type ? `${type}`.split("/") : []; + const actionName = splitType[splitType.length - 1] || "actionCreator"; + return `Detected an action creator with type "${type || "unknown"}" being dispatched. +Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${actionName}())\` instead of \`dispatch(${actionName})\`. This is necessary even if the action has no payload.`; }; -var createActionCreatorInvariantMiddleware = function(options) { - if (options === undefined) { - options = {}; - } +var createActionCreatorInvariantMiddleware = function(options = {}) { if (false) { } - var _c = options.isActionCreator, isActionCreator2 = _c === undefined ? isActionCreator : _c; - return function() { - return function(next) { - return function(action) { - if (isActionCreator2(action)) { - console.warn(getMessage(action.type)); - } - return next(action); - }; - }; + const { + isActionCreator: isActionCreator2 = isActionCreator + } = options; + return () => (next) => (action) => { + if (isActionCreator2(action)) { + console.warn(getMessage(action.type)); + } + return next(action); }; }; var getTimeMeasureUtils = function(maxDelay, fnName) { - var elapsed = 0; + let elapsed = 0; return { - measureTime: function(fn2) { - var started = Date.now(); + measureTime(fn) { + const started = Date.now(); try { - return fn2(); + return fn(); } finally { - var finished = Date.now(); + const finished = Date.now(); elapsed += finished - started; } }, - warnIfExceeded: function() { + warnIfExceeded() { if (elapsed > maxDelay) { - console.warn(fnName + " took " + elapsed + "ms, which is more than the warning threshold of " + maxDelay + "ms. \nIf 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.\nIt is disabled in production builds, so you don't need to worry about that."); + console.warn(`${fnName} took ${elapsed}ms, which is more than the warning threshold of ${maxDelay}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 invariant2 = function(condition, message) { - if (condition) { - return; - } - if (isProduction) { - throw new Error(prefix); - } - throw new Error(prefix + ": " + (message || "")); -}; -var stringify = function(obj, serializer, indent, decycler) { - return JSON.stringify(obj, getSerialize(serializer, decycler), indent); +var freezeDraftable = function(val) { + return isDraftable(val) ? produce(val, () => { + }) : val; }; -var getSerialize = function(serializer, decycler) { - var stack = [], keys = []; - if (!decycler) - decycler = function(_2, value) { - if (stack[0] === value) - return "[Circular ~]"; - return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"; - }; - return function(key, value) { - if (stack.length > 0) { - var thisPos = stack.indexOf(this); - ~thisPos ? stack.splice(thisPos + 1) : stack.push(this); - ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key); - if (~stack.indexOf(value)) - value = decycler.call(this, key, value); - } else - stack.push(value); - return serializer == null ? value : serializer.call(this, key, value); - }; +var emplace = function(map, key, handler) { + if (map.has(key)) { + let value = map.get(key); + if (handler.update) { + value = handler.update(value, key, map); + map.set(key, value); + } + return value; + } + if (!handler.insert) + throw new Error("No insert provided for key not already in map"); + const inserted = handler.insert(key, map); + map.set(key, inserted); + return inserted; }; var isImmutableDefault = function(value) { return typeof value !== "object" || value == null || Object.isFrozen(value); }; var trackForMutations = function(isImmutable, ignorePaths, obj) { - var trackedProperties = trackProperties(isImmutable, ignorePaths, obj); + const trackedProperties = trackProperties(isImmutable, ignorePaths, obj); return { - detectMutations: function() { + detectMutations() { return detectMutations(isImmutable, ignorePaths, trackedProperties, obj); } }; }; -var trackProperties = function(isImmutable, ignorePaths, obj, path, checkedObjects) { - if (ignorePaths === undefined) { - ignorePaths = []; - } - if (path === undefined) { - path = ""; - } - if (checkedObjects === undefined) { - checkedObjects = new Set; - } - var tracked = { value: obj }; +var trackProperties = function(isImmutable, ignorePaths = [], obj, path = "", checkedObjects = new Set) { + const tracked = { + value: obj + }; if (!isImmutable(obj) && !checkedObjects.has(obj)) { checkedObjects.add(obj); tracked.children = {}; - for (var key in obj) { - var childPath = path ? path + "." + key : key; + for (const key in obj) { + const childPath = path ? path + "." + key : key; if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) { continue; } @@ -27783,108 +28996,119 @@ var trackProperties = function(isImmutable, ignorePaths, obj, path, checkedObjec } return tracked; }; -var detectMutations = function(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) { - if (ignoredPaths === undefined) { - ignoredPaths = []; - } - if (sameParentRef === undefined) { - sameParentRef = false; - } - if (path === undefined) { - path = ""; - } - var prevObj = trackedProperty ? trackedProperty.value : undefined; - var sameRef = prevObj === obj; +var detectMutations = function(isImmutable, ignoredPaths = [], trackedProperty, obj, sameParentRef = false, path = "") { + const prevObj = trackedProperty ? trackedProperty.value : undefined; + const sameRef = prevObj === obj; if (sameParentRef && !sameRef && !Number.isNaN(obj)) { - return { wasMutated: true, path }; + return { + wasMutated: true, + path + }; } if (isImmutable(prevObj) || isImmutable(obj)) { - return { wasMutated: false }; + return { + wasMutated: false + }; } - var keysToDetect = {}; - for (var key in trackedProperty.children) { + const keysToDetect = {}; + for (let key in trackedProperty.children) { keysToDetect[key] = true; } - for (var key in obj) { + for (let key in obj) { keysToDetect[key] = true; } - var hasIgnoredPaths = ignoredPaths.length > 0; - var _loop_1 = function(key2) { - var nestedPath = path ? path + "." + key2 : key2; + const hasIgnoredPaths = ignoredPaths.length > 0; + for (let key in keysToDetect) { + const nestedPath = path ? path + "." + key : key; if (hasIgnoredPaths) { - var hasMatches = ignoredPaths.some(function(ignored) { + const hasMatches = ignoredPaths.some((ignored) => { if (ignored instanceof RegExp) { return ignored.test(nestedPath); } return nestedPath === ignored; }); if (hasMatches) { - return "continue"; + continue; } } - var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key2], obj[key2], sameRef, nestedPath); + const result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath); if (result.wasMutated) { - return { value: result }; + return result; } - }; - for (var key in keysToDetect) { - var state_1 = _loop_1(key); - if (typeof state_1 === "object") - return state_1.value; } - return { wasMutated: false }; + return { + wasMutated: false + }; }; -var createImmutableStateInvariantMiddleware = function(options) { - if (options === undefined) { - options = {}; - } +var createImmutableStateInvariantMiddleware = function(options = {}) { if (false) { - } - var _c = options.isImmutable, isImmutable = _c === undefined ? isImmutableDefault : _c, ignoredPaths = options.ignoredPaths, _d = options.warnAfter, warnAfter = _d === undefined ? 32 : _d, ignore = options.ignore; - ignoredPaths = ignoredPaths || ignore; - var track = trackForMutations.bind(null, isImmutable, ignoredPaths); - return function(_c2) { - var getState = _c2.getState; - var state = getState(); - var tracker = track(state); - var result; - return function(next) { - return function(action) { - var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware"); - measureUtils.measureTime(function() { + } else { + let stringify2 = function(obj, serializer, indent, decycler) { + return JSON.stringify(obj, getSerialize2(serializer, decycler), indent); + }, getSerialize2 = function(serializer, decycler) { + let stack = [], keys = []; + if (!decycler) + decycler = function(_, value) { + if (stack[0] === value) + return "[Circular ~]"; + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"; + }; + return function(key, value) { + if (stack.length > 0) { + var thisPos = stack.indexOf(this); + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this); + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key); + if (~stack.indexOf(value)) + value = decycler.call(this, key, value); + } else + stack.push(value); + return serializer == null ? value : serializer.call(this, key, value); + }; + }; + var stringify = stringify2, getSerialize = getSerialize2; + let { + isImmutable = isImmutableDefault, + ignoredPaths, + warnAfter = 32 + } = options; + const track = trackForMutations.bind(null, isImmutable, ignoredPaths); + return ({ + getState + }) => { + let state = getState(); + let tracker = track(state); + let result; + return (next) => (action) => { + const measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware"); + measureUtils.measureTime(() => { state = getState(); result = tracker.detectMutations(); tracker = track(state); - invariant2(!result.wasMutated, "A state mutation was detected between dispatches, in the path '" + (result.path || "") + "'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)"); + if (result.wasMutated) { + throw new Error(`A state mutation was detected between dispatches, in the path '${result.path || ""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`); + } }); - var dispatchedAction = next(action); - measureUtils.measureTime(function() { + const dispatchedAction = next(action); + measureUtils.measureTime(() => { state = getState(); result = tracker.detectMutations(); tracker = track(state); - result.wasMutated && invariant2(!result.wasMutated, "A state mutation was detected inside a dispatch, in the path: " + (result.path || "") + ". Take a look at the reducer(s) handling the action " + stringify(action) + ". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)"); + if (result.wasMutated) { + throw new Error(`A state mutation was detected inside a dispatch, in the path: ${result.path || ""}. Take a look at the reducer(s) handling the action ${stringify2(action)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`); + } }); measureUtils.warnIfExceeded(); return dispatchedAction; }; }; - }; + } }; var isPlain = function(val) { - var type = typeof val; - return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject4(val); + const type = typeof val; + return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val); }; -var findNonSerializableValue = function(value, path, isSerializable, getEntries, ignoredPaths, cache) { - if (path === undefined) { - path = ""; - } - if (isSerializable === undefined) { - isSerializable = isPlain; - } - if (ignoredPaths === undefined) { - ignoredPaths = []; - } - var foundNestedSerializable; +var findNonSerializableValue = function(value, path = "", isSerializable = isPlain, getEntries, ignoredPaths = [], cache) { + let foundNestedSerializable; if (!isSerializable(value)) { return { keyPath: path || "", @@ -27894,41 +29118,35 @@ var findNonSerializableValue = function(value, path, isSerializable, getEntries, if (typeof value !== "object" || value === null) { return false; } - if (cache == null ? undefined : cache.has(value)) + if (cache?.has(value)) return false; - var entries = getEntries != null ? getEntries(value) : Object.entries(value); - var hasIgnoredPaths = ignoredPaths.length > 0; - var _loop_2 = function(key2, nestedValue2) { - var nestedPath = path ? path + "." + key2 : key2; + const entries = getEntries != null ? getEntries(value) : Object.entries(value); + const hasIgnoredPaths = ignoredPaths.length > 0; + for (const [key, nestedValue] of entries) { + const nestedPath = path ? path + "." + key : key; if (hasIgnoredPaths) { - var hasMatches = ignoredPaths.some(function(ignored) { + const hasMatches = ignoredPaths.some((ignored) => { if (ignored instanceof RegExp) { return ignored.test(nestedPath); } return nestedPath === ignored; }); if (hasMatches) { - return "continue"; + continue; } } - if (!isSerializable(nestedValue2)) { - return { value: { + if (!isSerializable(nestedValue)) { + return { keyPath: nestedPath, - value: nestedValue2 - } }; + value: nestedValue + }; } - if (typeof nestedValue2 === "object") { - foundNestedSerializable = findNonSerializableValue(nestedValue2, nestedPath, isSerializable, getEntries, ignoredPaths, cache); + if (typeof nestedValue === "object") { + foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache); if (foundNestedSerializable) { - return { value: foundNestedSerializable }; + return foundNestedSerializable; } } - }; - for (var _i = 0, entries_1 = entries;_i < entries_1.length; _i++) { - var _c = entries_1[_i], key = _c[0], nestedValue = _c[1]; - var state_2 = _loop_2(key, nestedValue); - if (typeof state_2 === "object") - return state_2.value; } if (cache && isNestedFrozen(value)) cache.add(value); @@ -27937,8 +29155,7 @@ var findNonSerializableValue = function(value, path, isSerializable, getEntries, var isNestedFrozen = function(value) { if (!Object.isFrozen(value)) return false; - for (var _i = 0, _c = Object.values(value);_i < _c.length; _i++) { - var nestedValue = _c[_i]; + for (const nestedValue of Object.values(value)) { if (typeof nestedValue !== "object" || nestedValue === null) continue; if (!isNestedFrozen(nestedValue)) @@ -27946,82 +29163,593 @@ var isNestedFrozen = function(value) { } return true; }; -var createSerializableStateInvariantMiddleware = function(options) { - if (options === undefined) { - options = {}; - } +var createSerializableStateInvariantMiddleware = function(options = {}) { if (false) { + } else { + const { + isSerializable = isPlain, + getEntries, + ignoredActions = [], + ignoredActionPaths = ["meta.arg", "meta.baseQueryMeta"], + ignoredPaths = [], + warnAfter = 32, + ignoreState = false, + ignoreActions = false, + disableCache = false + } = options; + const cache = !disableCache && WeakSet ? new WeakSet : undefined; + return (storeAPI) => (next) => (action) => { + if (!isAction(action)) { + return next(action); + } + const result = next(action); + const measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware"); + if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) { + measureUtils.measureTime(() => { + const foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache); + if (foundActionNonSerializableValue) { + const { + keyPath, + value + } = foundActionNonSerializableValue; + console.error(`A non-serializable value was detected in an action, in the path: \`${keyPath}\`. Value:`, value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)"); + } + }); + } + if (!ignoreState) { + measureUtils.measureTime(() => { + const state = storeAPI.getState(); + const foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache); + if (foundStateNonSerializableValue) { + const { + keyPath, + value + } = foundStateNonSerializableValue; + console.error(`A non-serializable value was detected in the state, in the path: \`${keyPath}\`. Value:`, value, ` +Take a look at the reducer(s) handling this action type: ${action.type}. +(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`); + } + }); + measureUtils.warnIfExceeded(); + } + return result; + }; } - var _c = options.isSerializable, isSerializable = _c === undefined ? isPlain : _c, getEntries = options.getEntries, _d = options.ignoredActions, ignoredActions = _d === undefined ? [] : _d, _e = options.ignoredActionPaths, ignoredActionPaths = _e === undefined ? ["meta.arg", "meta.baseQueryMeta"] : _e, _f = options.ignoredPaths, ignoredPaths = _f === undefined ? [] : _f, _g = options.warnAfter, warnAfter = _g === undefined ? 32 : _g, _h = options.ignoreState, ignoreState = _h === undefined ? false : _h, _j = options.ignoreActions, ignoreActions = _j === undefined ? false : _j, _k = options.disableCache, disableCache = _k === undefined ? false : _k; - var cache = !disableCache && WeakSet ? new WeakSet : undefined; - return function(storeAPI) { - return function(next) { - return function(action) { - var result = next(action); - var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware"); - if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) { - measureUtils.measureTime(function() { - var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache); - if (foundActionNonSerializableValue) { - var { keyPath, value } = foundActionNonSerializableValue; - console.error("A non-serializable value was detected in an action, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)"); - } - }); +}; +var isBoolean = function(x) { + return typeof x === "boolean"; +}; +var configureStore = function(options) { + const getDefaultMiddleware = buildGetDefaultMiddleware(); + const { + reducer = undefined, + middleware, + devTools = true, + preloadedState = undefined, + enhancers = undefined + } = options || {}; + let rootReducer; + if (typeof reducer === "function") { + rootReducer = reducer; + } else if (isPlainObject(reducer)) { + rootReducer = combineReducers(reducer); + } else { + throw new Error("`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers"); + } + if (!IS_PRODUCTION && middleware && typeof middleware !== "function") { + throw new Error("`middleware` field must be a callback"); + } + let finalMiddleware; + if (typeof middleware === "function") { + finalMiddleware = middleware(getDefaultMiddleware); + if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) { + throw new Error("when using a middleware builder function, an array of middleware must be returned"); + } + } else { + finalMiddleware = getDefaultMiddleware(); + } + if (!IS_PRODUCTION && finalMiddleware.some((item) => typeof item !== "function")) { + throw new Error("each middleware provided to configureStore must be a function"); + } + let finalCompose = compose; + if (devTools) { + finalCompose = composeWithDevTools({ + trace: !IS_PRODUCTION, + ...typeof devTools === "object" && devTools + }); + } + const middlewareEnhancer = applyMiddleware(...finalMiddleware); + const getDefaultEnhancers = buildGetDefaultEnhancers(middlewareEnhancer); + if (!IS_PRODUCTION && enhancers && typeof enhancers !== "function") { + throw new Error("`enhancers` field must be a callback"); + } + let storeEnhancers = typeof enhancers === "function" ? enhancers(getDefaultEnhancers) : getDefaultEnhancers(); + if (!IS_PRODUCTION && !Array.isArray(storeEnhancers)) { + throw new Error("`enhancers` callback must return an array"); + } + if (!IS_PRODUCTION && storeEnhancers.some((item) => typeof item !== "function")) { + throw new Error("each enhancer provided to configureStore must be a function"); + } + if (!IS_PRODUCTION && finalMiddleware.length && !storeEnhancers.includes(middlewareEnhancer)) { + console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`"); + } + const composedEnhancer = finalCompose(...storeEnhancers); + return createStore(rootReducer, preloadedState, composedEnhancer); +}; +var executeReducerBuilderCallback = function(builderCallback) { + const actionsMap = {}; + const actionMatchers = []; + let defaultCaseReducer; + const builder = { + addCase(typeOrActionCreator, reducer) { + if (true) { + if (actionMatchers.length > 0) { + throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`"); } - if (!ignoreState) { - measureUtils.measureTime(function() { - var state = storeAPI.getState(); - var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache); - if (foundStateNonSerializableValue) { - var { keyPath, value } = foundStateNonSerializableValue; - console.error("A non-serializable value was detected in the state, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the reducer(s) handling this action type: " + action.type + ".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)"); - } + if (defaultCaseReducer) { + throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`"); + } + } + const type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type; + if (!type) { + throw new Error("`builder.addCase` cannot be called with an empty action type"); + } + if (type in actionsMap) { + throw new Error(`\`builder.addCase\` cannot be called with two reducers for the same action type '${type}'`); + } + actionsMap[type] = reducer; + return builder; + }, + addMatcher(matcher, reducer) { + if (true) { + if (defaultCaseReducer) { + throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`"); + } + } + actionMatchers.push({ + matcher, + reducer + }); + return builder; + }, + addDefaultCase(reducer) { + if (true) { + if (defaultCaseReducer) { + throw new Error("`builder.addDefaultCase` can only be called once"); + } + } + defaultCaseReducer = reducer; + return builder; + } + }; + builderCallback(builder); + return [actionsMap, actionMatchers, defaultCaseReducer]; +}; +var isStateFunction = function(x) { + return typeof x === "function"; +}; +var createReducer = function(initialState, mapOrBuilderCallback) { + if (true) { + if (typeof mapOrBuilderCallback === "object") { + throw new Error("The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer"); + } + } + let [actionsMap, finalActionMatchers, finalDefaultCaseReducer] = executeReducerBuilderCallback(mapOrBuilderCallback); + let getInitialState; + if (isStateFunction(initialState)) { + getInitialState = () => freezeDraftable(initialState()); + } else { + const frozenInitialState = freezeDraftable(initialState); + getInitialState = () => frozenInitialState; + } + function reducer(state = getInitialState(), action) { + let caseReducers = [actionsMap[action.type], ...finalActionMatchers.filter(({ + matcher + }) => matcher(action)).map(({ + reducer: reducer2 + }) => reducer2)]; + if (caseReducers.filter((cr) => !!cr).length === 0) { + caseReducers = [finalDefaultCaseReducer]; + } + return caseReducers.reduce((previousState, caseReducer) => { + if (caseReducer) { + if (isDraft(previousState)) { + const draft = previousState; + const result = caseReducer(draft, action); + if (result === undefined) { + return previousState; + } + return result; + } else if (!isDraftable(previousState)) { + const result = caseReducer(previousState, action); + if (result === undefined) { + if (previousState === null) { + return previousState; + } + throw new Error("A case reducer on a non-draftable value must not return undefined"); + } + return result; + } else { + return produce(previousState, (draft) => { + return caseReducer(draft, action); }); - measureUtils.warnIfExceeded(); } - return result; + } + return previousState; + }, state); + } + reducer.getInitialState = getInitialState; + return reducer; +}; +var isAnyOf = function(...matchers) { + return (action) => { + return matchers.some((matcher) => matches(matcher, action)); + }; +}; +var unwrapResult = function(action) { + if (action.meta && action.meta.rejectedWithValue) { + throw action.payload; + } + if (action.error) { + throw action.error; + } + return action.payload; +}; +var isThenable = function(value) { + return value !== null && typeof value === "object" && typeof value.then === "function"; +}; +var getType = function(slice, actionKey) { + return `${slice}/${actionKey}`; +}; +var buildCreateSlice = function({ + creators +} = {}) { + const cAT = creators?.asyncThunk?.[asyncThunkSymbol]; + return function createSlice2(options) { + const { + name, + reducerPath = name + } = options; + if (!name) { + throw new Error("`name` is a required option for createSlice"); + } + if (typeof process !== "undefined" && true) { + if (options.initialState === undefined) { + console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`"); + } + } + const reducers = (typeof options.reducers === "function" ? options.reducers(buildReducerCreators()) : options.reducers) || {}; + const reducerNames = Object.keys(reducers); + const context = { + sliceCaseReducersByName: {}, + sliceCaseReducersByType: {}, + actionCreators: {}, + sliceMatchers: [] + }; + const contextMethods = { + addCase(typeOrActionCreator, reducer2) { + const type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type; + if (!type) { + throw new Error("`context.addCase` cannot be called with an empty action type"); + } + if (type in context.sliceCaseReducersByType) { + throw new Error("`context.addCase` cannot be called with two reducers for the same action type: " + type); + } + context.sliceCaseReducersByType[type] = reducer2; + return contextMethods; + }, + addMatcher(matcher, reducer2) { + context.sliceMatchers.push({ + matcher, + reducer: reducer2 + }); + return contextMethods; + }, + exposeAction(name2, actionCreator) { + context.actionCreators[name2] = actionCreator; + return contextMethods; + }, + exposeCaseReducer(name2, reducer2) { + context.sliceCaseReducersByName[name2] = reducer2; + return contextMethods; + } + }; + reducerNames.forEach((reducerName) => { + const reducerDefinition = reducers[reducerName]; + const reducerDetails = { + reducerName, + type: getType(name, reducerName), + createNotation: typeof options.reducers === "function" + }; + if (isAsyncThunkSliceReducerDefinition(reducerDefinition)) { + handleThunkCaseReducerDefinition(reducerDetails, reducerDefinition, contextMethods, cAT); + } else { + handleNormalReducerDefinition(reducerDetails, reducerDefinition, contextMethods); + } + }); + function buildReducer() { + if (true) { + if (typeof options.extraReducers === "object") { + throw new Error("The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice"); + } + } + const [extraReducers = {}, actionMatchers = [], defaultCaseReducer = undefined] = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers]; + const finalCaseReducers = { + ...extraReducers, + ...context.sliceCaseReducersByType + }; + return createReducer(options.initialState, (builder) => { + for (let key in finalCaseReducers) { + builder.addCase(key, finalCaseReducers[key]); + } + for (let sM of context.sliceMatchers) { + builder.addMatcher(sM.matcher, sM.reducer); + } + for (let m of actionMatchers) { + builder.addMatcher(m.matcher, m.reducer); + } + if (defaultCaseReducer) { + builder.addDefaultCase(defaultCaseReducer); + } + }); + } + const selectSelf = (state) => state; + const injectedSelectorCache = new Map; + let _reducer; + function reducer(state, action) { + if (!_reducer) + _reducer = buildReducer(); + return _reducer(state, action); + } + function getInitialState() { + if (!_reducer) + _reducer = buildReducer(); + return _reducer.getInitialState(); + } + function makeSelectorProps(reducerPath2, injected = false) { + function selectSlice(state) { + let sliceState = state[reducerPath2]; + if (typeof sliceState === "undefined") { + if (injected) { + sliceState = getInitialState(); + } else if (true) { + throw new Error("selectSlice returned undefined for an uninjected slice reducer"); + } + } + return sliceState; + } + function getSelectors(selectState = selectSelf) { + const selectorCache = emplace(injectedSelectorCache, injected, { + insert: () => new WeakMap + }); + return emplace(selectorCache, selectState, { + insert: () => { + const map = {}; + for (const [name2, selector] of Object.entries(options.selectors ?? {})) { + map[name2] = wrapSelector(selector, selectState, getInitialState, injected); + } + return map; + } + }); + } + return { + reducerPath: reducerPath2, + getSelectors, + get selectors() { + return getSelectors(selectSlice); + }, + selectSlice }; + } + const slice = { + name, + reducer, + actions: context.actionCreators, + caseReducers: context.sliceCaseReducersByName, + getInitialState, + ...makeSelectorProps(reducerPath), + injectInto(injectable, { + reducerPath: pathOpt, + ...config + } = {}) { + const newReducerPath = pathOpt ?? reducerPath; + injectable.inject({ + reducerPath: newReducerPath, + reducer + }, config); + return { + ...slice, + ...makeSelectorProps(newReducerPath, true) + }; + } + }; + return slice; + }; +}; +var wrapSelector = function(selector, selectState, getInitialState, injected) { + function wrapper(rootState, ...args) { + let sliceState = selectState(rootState); + if (typeof sliceState === "undefined") { + if (injected) { + sliceState = getInitialState(); + } else if (true) { + throw new Error("selectState returned undefined for an uninjected slice reducer"); + } + } + return selector(sliceState, ...args); + } + wrapper.unwrapped = selector; + return wrapper; +}; +var buildReducerCreators = function() { + function asyncThunk(payloadCreator, config) { + return { + _reducerDefinitionType: "asyncThunk", + payloadCreator, + ...config }; + } + asyncThunk.withTypes = () => asyncThunk; + return { + reducer(caseReducer) { + return Object.assign({ + [caseReducer.name](...args) { + return caseReducer(...args); + } + }[caseReducer.name], { + _reducerDefinitionType: "reducer" + }); + }, + preparedReducer(prepare, reducer) { + return { + _reducerDefinitionType: "reducerWithPrepare", + prepare, + reducer + }; + }, + asyncThunk }; }; -var isBoolean = function(x2) { - return typeof x2 === "boolean"; +var handleNormalReducerDefinition = function({ + type, + reducerName, + createNotation +}, maybeReducerWithPrepare, context) { + let caseReducer; + let prepareCallback; + if ("reducer" in maybeReducerWithPrepare) { + if (createNotation && !isCaseReducerWithPrepareDefinition(maybeReducerWithPrepare)) { + throw new Error("Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation."); + } + caseReducer = maybeReducerWithPrepare.reducer; + prepareCallback = maybeReducerWithPrepare.prepare; + } else { + caseReducer = maybeReducerWithPrepare; + } + context.addCase(type, caseReducer).exposeCaseReducer(reducerName, caseReducer).exposeAction(reducerName, prepareCallback ? createAction(type, prepareCallback) : createAction(type)); +}; +var isAsyncThunkSliceReducerDefinition = function(reducerDefinition) { + return reducerDefinition._reducerDefinitionType === "asyncThunk"; +}; +var isCaseReducerWithPrepareDefinition = function(reducerDefinition) { + return reducerDefinition._reducerDefinitionType === "reducerWithPrepare"; +}; +var handleThunkCaseReducerDefinition = function({ + type, + reducerName +}, reducerDefinition, context, cAT) { + if (!cAT) { + throw new Error("Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`."); + } + const { + payloadCreator, + fulfilled, + pending, + rejected, + settled, + options + } = reducerDefinition; + const thunk2 = cAT(type, payloadCreator, options); + context.exposeAction(reducerName, thunk2); + if (fulfilled) { + context.addCase(thunk2.fulfilled, fulfilled); + } + if (pending) { + context.addCase(thunk2.pending, pending); + } + if (rejected) { + context.addCase(thunk2.rejected, rejected); + } + if (settled) { + context.addMatcher(thunk2.settled, settled); + } + context.exposeCaseReducer(reducerName, { + fulfilled: fulfilled || noop, + pending: pending || noop, + rejected: rejected || noop, + settled: settled || noop + }); +}; +var noop = function() { +}; +var createDraftSafeSelectorCreator = (...args) => { + const createSelector2 = createSelectorCreator(...args); + const createDraftSafeSelector2 = Object.assign((...args2) => { + const selector = createSelector2(...args2); + const wrappedSelector = (value, ...rest) => selector(isDraft(value) ? current(value) : value, ...rest); + Object.assign(wrappedSelector, selector); + return wrappedSelector; + }, { + withTypes: () => createDraftSafeSelector2 + }); + return createDraftSafeSelector2; +}; +var createDraftSafeSelector = createDraftSafeSelectorCreator(weakMapMemoize); +var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() { + if (arguments.length === 0) + return; + if (typeof arguments[0] === "object") + return compose; + return compose.apply(null, arguments); }; -var curryGetDefaultMiddleware = function() { - return function curriedGetDefaultMiddleware(options) { - return getDefaultMiddleware(options); +var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function() { + return function(noop3) { + return noop3; }; }; -var getDefaultMiddleware = function(options) { - if (options === undefined) { - options = {}; +var hasMatchFunction = (v) => { + return v && typeof v.match === "function"; +}; +var Tuple = class _Tuple extends Array { + constructor(...items) { + super(...items); + Object.setPrototypeOf(this, _Tuple.prototype); } - var _c = options.thunk, thunk2 = _c === undefined ? true : _c, _d = options.immutableCheck, immutableCheck = _d === undefined ? true : _d, _e = options.serializableCheck, serializableCheck = _e === undefined ? true : _e, _f = options.actionCreatorCheck, actionCreatorCheck = _f === undefined ? true : _f; - var middlewareArray = new MiddlewareArray; + static get [Symbol.species]() { + return _Tuple; + } + concat(...arr) { + return super.concat.apply(this, arr); + } + prepend(...arr) { + if (arr.length === 1 && Array.isArray(arr[0])) { + return new _Tuple(...arr[0].concat(this)); + } + return new _Tuple(...arr.concat(this)); + } +}; +var buildGetDefaultMiddleware = () => function getDefaultMiddleware(options) { + const { + thunk: thunk2 = true, + immutableCheck = true, + serializableCheck = true, + actionCreatorCheck = true + } = options ?? {}; + let middlewareArray = new Tuple; if (thunk2) { if (isBoolean(thunk2)) { - middlewareArray.push(es_default); + middlewareArray.push(thunk); } else { - middlewareArray.push(es_default.withExtraArgument(thunk2.extraArgument)); + middlewareArray.push(withExtraArgument(thunk2.extraArgument)); } } if (true) { if (immutableCheck) { - var immutableOptions = {}; + let immutableOptions = {}; if (!isBoolean(immutableCheck)) { immutableOptions = immutableCheck; } middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions)); } if (serializableCheck) { - var serializableOptions = {}; + let serializableOptions = {}; if (!isBoolean(serializableCheck)) { serializableOptions = serializableCheck; } middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions)); } if (actionCreatorCheck) { - var actionCreatorOptions = {}; + let actionCreatorOptions = {}; if (!isBoolean(actionCreatorCheck)) { actionCreatorOptions = actionCreatorCheck; } @@ -28030,497 +29758,228 @@ var getDefaultMiddleware = function(options) { } return middlewareArray; }; -var configureStore = function(options) { - var curriedGetDefaultMiddleware = curryGetDefaultMiddleware(); - var _c = options || {}, _d = _c.reducer, reducer = _d === undefined ? undefined : _d, _e = _c.middleware, middleware = _e === undefined ? curriedGetDefaultMiddleware() : _e, _f = _c.devTools, devTools = _f === undefined ? true : _f, _g = _c.preloadedState, preloadedState = _g === undefined ? undefined : _g, _h = _c.enhancers, enhancers = _h === undefined ? undefined : _h; - var rootReducer; - if (typeof reducer === "function") { - rootReducer = reducer; - } else if (isPlainObject4(reducer)) { - rootReducer = combineReducers(reducer); - } else { - throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers'); - } - var finalMiddleware = middleware; - if (typeof finalMiddleware === "function") { - finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware); - if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) { - throw new Error("when using a middleware builder function, an array of middleware must be returned"); - } - } - if (!IS_PRODUCTION && finalMiddleware.some(function(item) { - return typeof item !== "function"; - })) { - throw new Error("each middleware provided to configureStore must be a function"); - } - var middlewareEnhancer = applyMiddleware.apply(undefined, finalMiddleware); - var finalCompose = compose; - if (devTools) { - finalCompose = composeWithDevTools(__spreadValues({ - trace: !IS_PRODUCTION - }, typeof devTools === "object" && devTools)); - } - var defaultEnhancers = new EnhancerArray(middlewareEnhancer); - var storeEnhancers = defaultEnhancers; - if (Array.isArray(enhancers)) { - storeEnhancers = __spreadArray([middlewareEnhancer], enhancers); - } else if (typeof enhancers === "function") { - storeEnhancers = enhancers(defaultEnhancers); - } - var composedEnhancer = finalCompose.apply(undefined, storeEnhancers); - return createStore(rootReducer, preloadedState, composedEnhancer); -}; -var unwrapResult = function(action) { - if (action.meta && action.meta.rejectedWithValue) { - throw action.payload; - } - if (action.error) { - throw action.error; - } - return action.payload; -}; -var isThenable = function(value) { - return value !== null && typeof value === "object" && typeof value.then === "function"; -}; -var __extends = function() { - var extendStatics = function(d2, b2) { - extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) { - d3.__proto__ = b3; - } || function(d3, b3) { - for (var p2 in b3) - if (Object.prototype.hasOwnProperty.call(b3, p2)) - d3[p2] = b3[p2]; - }; - return extendStatics(d2, b2); +var SHOULD_AUTOBATCH = "RTK_autoBatch"; +var createQueueWithTimer = (timeout) => { + return (notify) => { + setTimeout(notify, timeout); }; - return function(d2, b2) { - if (typeof b2 !== "function" && b2 !== null) - throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null"); - extendStatics(d2, b2); - function __() { - this.constructor = d2; - } - d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __); +}; +var rAF = typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10); +var autoBatchEnhancer = (options = { + type: "raf" +}) => (next) => (...args) => { + const store = next(...args); + let notifying = true; + let shouldNotifyAtEndOfTick = false; + let notificationQueued = false; + const listeners = new Set; + const queueCallback = options.type === "tick" ? queueMicrotask : options.type === "raf" ? rAF : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout); + const notifyListeners = () => { + notificationQueued = false; + if (shouldNotifyAtEndOfTick) { + shouldNotifyAtEndOfTick = false; + listeners.forEach((l) => l()); + } }; -}(); -var __generator = function(thisArg, body) { - var _2 = { label: 0, sent: function() { - if (t2[0] & 1) - throw t2[1]; - return t2[1]; - }, trys: [], ops: [] }, f2, y2, t2, g2; - return g2 = { next: verb(0), throw: verb(1), return: verb(2) }, typeof Symbol === "function" && (g2[Symbol.iterator] = function() { - return this; - }), g2; - function verb(n2) { - return function(v2) { - return step([n2, v2]); - }; - } - function step(op) { - if (f2) - throw new TypeError("Generator is already executing."); - while (_2) + return Object.assign({}, store, { + subscribe(listener2) { + const wrappedListener = () => notifying && listener2(); + const unsubscribe = store.subscribe(wrappedListener); + listeners.add(listener2); + return () => { + unsubscribe(); + listeners.delete(listener2); + }; + }, + dispatch(action) { try { - if (f2 = 1, y2 && (t2 = op[0] & 2 ? y2["return"] : op[0] ? y2["throw"] || ((t2 = y2["return"]) && t2.call(y2), 0) : y2.next) && !(t2 = t2.call(y2, op[1])).done) - return t2; - if (y2 = 0, t2) - op = [op[0] & 2, t2.value]; - switch (op[0]) { - case 0: - case 1: - t2 = op; - break; - case 4: - _2.label++; - return { value: op[1], done: false }; - case 5: - _2.label++; - y2 = op[1]; - op = [0]; - continue; - case 7: - op = _2.ops.pop(); - _2.trys.pop(); - continue; - default: - if (!(t2 = _2.trys, t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _2 = 0; - continue; - } - if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) { - _2.label = op[1]; - break; - } - if (op[0] === 6 && _2.label < t2[1]) { - _2.label = t2[1]; - t2 = op; - break; - } - if (t2 && _2.label < t2[2]) { - _2.label = t2[2]; - _2.ops.push(op); - break; - } - if (t2[2]) - _2.ops.pop(); - _2.trys.pop(); - continue; + notifying = !action?.meta?.[SHOULD_AUTOBATCH]; + shouldNotifyAtEndOfTick = !notifying; + if (shouldNotifyAtEndOfTick) { + if (!notificationQueued) { + notificationQueued = true; + queueCallback(notifyListeners); + } } - op = body.call(thisArg, _2); - } catch (e) { - op = [6, e]; - y2 = 0; + return store.dispatch(action); } finally { - f2 = t2 = 0; - } - if (op[0] & 5) - throw op[1]; - return { value: op[0] ? op[1] : undefined, done: true }; - } -}; -var __spreadArray = function(to, from) { - for (var i2 = 0, il = from.length, j2 = to.length;i2 < il; i2++, j2++) - to[j2] = from[i2]; - return to; -}; -var __defProp2 = Object.defineProperty; -var __defProps = Object.defineProperties; -var __getOwnPropDescs = Object.getOwnPropertyDescriptors; -var __getOwnPropSymbols = Object.getOwnPropertySymbols; -var __hasOwnProp2 = Object.prototype.hasOwnProperty; -var __propIsEnum = Object.prototype.propertyIsEnumerable; -var __defNormalProp = function(obj, key, value) { - return key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -}; -var __spreadValues = function(a2, b2) { - for (var prop in b2 || (b2 = {})) - if (__hasOwnProp2.call(b2, prop)) - __defNormalProp(a2, prop, b2[prop]); - if (__getOwnPropSymbols) - for (var _i = 0, _c = __getOwnPropSymbols(b2);_i < _c.length; _i++) { - var prop = _c[_i]; - if (__propIsEnum.call(b2, prop)) - __defNormalProp(a2, prop, b2[prop]); - } - return a2; -}; -var __spreadProps = function(a2, b2) { - return __defProps(a2, __getOwnPropDescs(b2)); -}; -var __async = function(__this, __arguments, generator) { - return new Promise(function(resolve, reject) { - var fulfilled = function(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - }; - var rejected = function(value) { - try { - step(generator.throw(value)); - } catch (e) { - reject(e); + notifying = true; } - }; - var step = function(x2) { - return x2.done ? resolve(x2.value) : Promise.resolve(x2.value).then(fulfilled, rejected); - }; - step((generator = generator.apply(__this, __arguments)).next()); + } }); }; -var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() { - if (arguments.length === 0) - return; - if (typeof arguments[0] === "object") - return compose; - return compose.apply(null, arguments); -}; -var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function() { - return function(noop2) { - return noop2; - }; -}; -var hasMatchFunction = function(v2) { - return v2 && typeof v2.match === "function"; -}; -var MiddlewareArray = function(_super) { - __extends(MiddlewareArray2, _super); - function MiddlewareArray2() { - var args = []; - for (var _i = 0;_i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var _this = _super.apply(this, args) || this; - Object.setPrototypeOf(_this, MiddlewareArray2.prototype); - return _this; +var buildGetDefaultEnhancers = (middlewareEnhancer) => function getDefaultEnhancers(options) { + const { + autoBatch = true + } = options ?? {}; + let enhancerArray = new Tuple(middlewareEnhancer); + if (autoBatch) { + enhancerArray.push(autoBatchEnhancer(typeof autoBatch === "object" ? autoBatch : undefined)); } - Object.defineProperty(MiddlewareArray2, Symbol.species, { - get: function() { - return MiddlewareArray2; - }, - enumerable: false, - configurable: true - }); - MiddlewareArray2.prototype.concat = function() { - var arr = []; - for (var _i = 0;_i < arguments.length; _i++) { - arr[_i] = arguments[_i]; - } - return _super.prototype.concat.apply(this, arr); - }; - MiddlewareArray2.prototype.prepend = function() { - var arr = []; - for (var _i = 0;_i < arguments.length; _i++) { - arr[_i] = arguments[_i]; - } - if (arr.length === 1 && Array.isArray(arr[0])) { - return new (MiddlewareArray2.bind.apply(MiddlewareArray2, __spreadArray([undefined], arr[0].concat(this)))); - } - return new (MiddlewareArray2.bind.apply(MiddlewareArray2, __spreadArray([undefined], arr.concat(this)))); - }; - return MiddlewareArray2; -}(Array); -var EnhancerArray = function(_super) { - __extends(EnhancerArray2, _super); - function EnhancerArray2() { - var args = []; - for (var _i = 0;_i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var _this = _super.apply(this, args) || this; - Object.setPrototypeOf(_this, EnhancerArray2.prototype); - return _this; - } - Object.defineProperty(EnhancerArray2, Symbol.species, { - get: function() { - return EnhancerArray2; - }, - enumerable: false, - configurable: true - }); - EnhancerArray2.prototype.concat = function() { - var arr = []; - for (var _i = 0;_i < arguments.length; _i++) { - arr[_i] = arguments[_i]; - } - return _super.prototype.concat.apply(this, arr); - }; - EnhancerArray2.prototype.prepend = function() { - var arr = []; - for (var _i = 0;_i < arguments.length; _i++) { - arr[_i] = arguments[_i]; - } - if (arr.length === 1 && Array.isArray(arr[0])) { - return new (EnhancerArray2.bind.apply(EnhancerArray2, __spreadArray([undefined], arr[0].concat(this)))); - } - return new (EnhancerArray2.bind.apply(EnhancerArray2, __spreadArray([undefined], arr.concat(this)))); - }; - return EnhancerArray2; -}(Array); -var isProduction = false; -var prefix = "Invariant failed"; + return enhancerArray; +}; var IS_PRODUCTION = false; var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"; -var nanoid = function(size) { - if (size === undefined) { - size = 21; - } - var id = ""; - var i2 = size; - while (i2--) { +var nanoid = (size = 21) => { + let id = ""; + let i = size; + while (i--) { id += urlAlphabet[Math.random() * 64 | 0]; } return id; }; -var commonProperties = [ - "name", - "message", - "stack", - "code" -]; -var RejectWithValue = function() { - function RejectWithValue2(payload, meta) { +var matches = (matcher, action) => { + if (hasMatchFunction(matcher)) { + return matcher.match(action); + } else { + return matcher(action); + } +}; +var commonProperties = ["name", "message", "stack", "code"]; +var RejectWithValue = class { + constructor(payload, meta) { this.payload = payload; this.meta = meta; } - return RejectWithValue2; -}(); -var FulfillWithMeta = function() { - function FulfillWithMeta2(payload, meta) { + _type; +}; +var FulfillWithMeta = class { + constructor(payload, meta) { this.payload = payload; this.meta = meta; } - return FulfillWithMeta2; -}(); -var miniSerializeError = function(value) { + _type; +}; +var miniSerializeError = (value) => { if (typeof value === "object" && value !== null) { - var simpleError = {}; - for (var _i = 0, commonProperties_1 = commonProperties;_i < commonProperties_1.length; _i++) { - var property = commonProperties_1[_i]; + const simpleError = {}; + for (const property of commonProperties) { if (typeof value[property] === "string") { simpleError[property] = value[property]; } } return simpleError; } - return { message: String(value) }; + return { + message: String(value) + }; }; -var createAsyncThunk = function() { +var createAsyncThunk = (() => { function createAsyncThunk2(typePrefix, payloadCreator, options) { - var fulfilled = createAction(typePrefix + "/fulfilled", function(payload, requestId, arg, meta) { - return { - payload, - meta: __spreadProps(__spreadValues({}, meta || {}), { - arg, - requestId, - requestStatus: "fulfilled" - }) - }; - }); - var pending = createAction(typePrefix + "/pending", function(requestId, arg, meta) { - return { - payload: undefined, - meta: __spreadProps(__spreadValues({}, meta || {}), { - arg, - requestId, - requestStatus: "pending" - }) - }; - }); - var rejected = createAction(typePrefix + "/rejected", function(error, requestId, arg, payload, meta) { - return { - payload, - error: (options && options.serializeError || miniSerializeError)(error || "Rejected"), - meta: __spreadProps(__spreadValues({}, meta || {}), { - arg, - requestId, - rejectedWithValue: !!payload, - requestStatus: "rejected", - aborted: (error == null ? undefined : error.name) === "AbortError", - condition: (error == null ? undefined : error.name) === "ConditionError" - }) - }; - }); - var displayedWarning = false; - var AC = typeof AbortController !== "undefined" ? AbortController : function() { - function class_1() { - this.signal = { - aborted: false, - addEventListener: function() { - }, - dispatchEvent: function() { - return false; - }, - onabort: function() { - }, - removeEventListener: function() { - }, - reason: undefined, - throwIfAborted: function() { - } - }; + const fulfilled = createAction(typePrefix + "/fulfilled", (payload, requestId, arg, meta) => ({ + payload, + meta: { + ...meta || {}, + arg, + requestId, + requestStatus: "fulfilled" } - class_1.prototype.abort = function() { - if (true) { - if (!displayedWarning) { - displayedWarning = true; - console.info("This platform does not implement AbortController. \nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'."); - } - } - }; - return class_1; - }(); + })); + const pending = createAction(typePrefix + "/pending", (requestId, arg, meta) => ({ + payload: undefined, + meta: { + ...meta || {}, + arg, + requestId, + requestStatus: "pending" + } + })); + const rejected = createAction(typePrefix + "/rejected", (error, requestId, arg, payload, meta) => ({ + payload, + error: (options && options.serializeError || miniSerializeError)(error || "Rejected"), + meta: { + ...meta || {}, + arg, + requestId, + rejectedWithValue: !!payload, + requestStatus: "rejected", + aborted: error?.name === "AbortError", + condition: error?.name === "ConditionError" + } + })); function actionCreator(arg) { - return function(dispatch, getState, extra) { - var requestId = (options == null ? undefined : options.idGenerator) ? options.idGenerator(arg) : nanoid(); - var abortController = new AC; - var abortReason; - var started = false; + return (dispatch, getState, extra) => { + const requestId = options?.idGenerator ? options.idGenerator(arg) : nanoid(); + const abortController = new AbortController; + let abortHandler; + let abortReason; function abort(reason) { abortReason = reason; abortController.abort(); } - var promise2 = function() { - return __async(this, null, function() { - var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch; - return __generator(this, function(_c) { - switch (_c.label) { - case 0: - _c.trys.push([0, 4, , 5]); - conditionResult = (_a = options == null ? undefined : options.condition) == null ? undefined : _a.call(options, arg, { getState, extra }); - if (!isThenable(conditionResult)) - return [3, 2]; - return [4, conditionResult]; - case 1: - conditionResult = _c.sent(); - _c.label = 2; - case 2: - if (conditionResult === false || abortController.signal.aborted) { - throw { - name: "ConditionError", - message: "Aborted due to condition callback returning false." - }; - } - started = true; - abortedPromise = new Promise(function(_2, reject) { - return abortController.signal.addEventListener("abort", function() { - return reject({ - name: "AbortError", - message: abortReason || "Aborted" - }); - }); - }); - dispatch(pending(requestId, arg, (_b = options == null ? undefined : options.getPendingMeta) == null ? undefined : _b.call(options, { requestId, arg }, { getState, extra }))); - return [4, Promise.race([ - abortedPromise, - Promise.resolve(payloadCreator(arg, { - dispatch, - getState, - extra, - requestId, - signal: abortController.signal, - abort, - rejectWithValue: function(value, meta) { - return new RejectWithValue(value, meta); - }, - fulfillWithValue: function(value, meta) { - return new FulfillWithMeta(value, meta); - } - })).then(function(result) { - if (result instanceof RejectWithValue) { - throw result; - } - if (result instanceof FulfillWithMeta) { - return fulfilled(result.payload, requestId, arg, result.meta); - } - return fulfilled(result, requestId, arg); - }) - ])]; - case 3: - finalAction = _c.sent(); - return [3, 5]; - case 4: - err_1 = _c.sent(); - finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg); - return [3, 5]; - case 5: - skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition; - if (!skipDispatch) { - dispatch(finalAction); - } - return [2, finalAction]; - } + const promise = async function() { + let finalAction; + try { + let conditionResult = options?.condition?.(arg, { + getState, + extra }); - }); + if (isThenable(conditionResult)) { + conditionResult = await conditionResult; + } + if (conditionResult === false || abortController.signal.aborted) { + throw { + name: "ConditionError", + message: "Aborted due to condition callback returning false." + }; + } + const abortedPromise = new Promise((_, reject) => { + abortHandler = () => { + reject({ + name: "AbortError", + message: abortReason || "Aborted" + }); + }; + abortController.signal.addEventListener("abort", abortHandler); + }); + dispatch(pending(requestId, arg, options?.getPendingMeta?.({ + requestId, + arg + }, { + getState, + extra + }))); + finalAction = await Promise.race([abortedPromise, Promise.resolve(payloadCreator(arg, { + dispatch, + getState, + extra, + requestId, + signal: abortController.signal, + abort, + rejectWithValue: (value, meta) => { + return new RejectWithValue(value, meta); + }, + fulfillWithValue: (value, meta) => { + return new FulfillWithMeta(value, meta); + } + })).then((result) => { + if (result instanceof RejectWithValue) { + throw result; + } + if (result instanceof FulfillWithMeta) { + return fulfilled(result.payload, requestId, arg, result.meta); + } + return fulfilled(result, requestId, arg); + })]); + } catch (err) { + finalAction = err instanceof RejectWithValue ? rejected(null, requestId, arg, err.payload, err.meta) : rejected(err, requestId, arg); + } finally { + if (abortHandler) { + abortController.signal.removeEventListener("abort", abortHandler); + } + } + const skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition; + if (!skipDispatch) { + dispatch(finalAction); + } + return finalAction; }(); - return Object.assign(promise2, { + return Object.assign(promise, { abort, requestId, arg, - unwrap: function() { - return promise2.then(unwrapResult); + unwrap() { + return promise.then(unwrapResult); } }); }; @@ -28529,49 +29988,86 @@ var createAsyncThunk = function() { pending, rejected, fulfilled, + settled: isAnyOf(rejected, fulfilled), typePrefix }); } - createAsyncThunk2.withTypes = function() { - return createAsyncThunk2; - }; + createAsyncThunk2.withTypes = () => createAsyncThunk2; return createAsyncThunk2; -}(); -var task = "task"; +})(); +var asyncThunkSymbol = Symbol.for("rtk-slice-createasyncthunk"); +var asyncThunkCreator = { + [asyncThunkSymbol]: createAsyncThunk +}; +var createSlice = buildCreateSlice(); var listener = "listener"; var completed = "completed"; var cancelled = "cancelled"; -var taskCancelled = "task-" + cancelled; -var taskCompleted = "task-" + completed; -var listenerCancelled = listener + "-" + cancelled; -var listenerCompleted = listener + "-" + completed; -var TaskAbortError = function() { - function TaskAbortError2(code) { - this.code = code; - this.name = "TaskAbortError"; - this.message = task + " " + cancelled + " (reason: " + code + ")"; - } - return TaskAbortError2; -}(); -var alm = "listenerMiddleware"; -var addListener = createAction(alm + "/add"); -var clearAllListeners = createAction(alm + "/removeAll"); -var removeListener = createAction(alm + "/remove"); -var promise; -var queueMicrotaskShim = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : globalThis) : function(cb) { - return (promise || (promise = Promise.resolve())).then(cb).catch(function(err) { - return setTimeout(function() { - throw err; - }, 0); - }); +var taskCancelled = `task-${cancelled}`; +var taskCompleted = `task-${completed}`; +var listenerCancelled = `${listener}-${cancelled}`; +var listenerCompleted = `${listener}-${completed}`; +var assertFunction = (func, expected) => { + if (typeof func !== "function") { + throw new Error(`${expected} is not a function`); + } }; -var createQueueWithTimer = function(timeout) { - return function(notify) { - setTimeout(notify, timeout); +var alm = "listenerMiddleware"; +var getListenerEntryPropsFrom = (options) => { + let { + type, + actionCreator, + matcher, + predicate, + effect + } = options; + if (type) { + predicate = createAction(type).match; + } else if (actionCreator) { + type = actionCreator.type; + predicate = actionCreator.match; + } else if (matcher) { + predicate = matcher; + } else if (predicate) { + } else { + throw new Error("Creating or removing a listener requires one of the known fields for matching an action"); + } + assertFunction(effect, "options.listener"); + return { + predicate, + type, + effect }; }; -var rAF = typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10); -F(); +var createListenerEntry = Object.assign((options) => { + const { + type, + predicate, + effect + } = getListenerEntryPropsFrom(options); + const id = nanoid(); + const entry = { + id, + effect, + type, + predicate, + pending: new Set, + unsubscribe: () => { + throw new Error("Unsubscribe not initialized"); + } + }; + return entry; +}, { + withTypes: () => createListenerEntry +}); +var addListener = Object.assign(createAction(`${alm}/add`), { + withTypes: () => addListener +}); +var clearAllListeners = createAction(`${alm}/removeAll`); +var removeListener = Object.assign(createAction(`${alm}/remove`), { + withTypes: () => removeListener +}); +var ORIGINAL_STATE = Symbol.for("rtk-state-proxy-original"); // src/reducer.ts var ReducerMap = new Map; @@ -28610,7 +30106,7 @@ var selectIsConflicting = (transitionId) => (state) => selectConflictingTransiti // usecases/lib/store/selectors.ts var selectTodo = (id) => createSelector((state) => state.todos, ({ state }) => state[id]); -var selectOptimisticTodos = createSelector((state) => state.todos, selectOptimistic((todos) => Object.values(todos.state).sort((a2, b2) => b2.createdAt - a2.createdAt))); +var selectOptimisticTodos = createSelector((state) => state.todos, selectOptimistic((todos) => Object.values(todos.state).sort((a, b) => b.createdAt - a.createdAt))); var selectOptimisticTodoState = (id) => createSelector((state) => state.todos, (todos) => ({ optimistic: selectIsOptimistic(id)(todos), failed: selectIsFailed(id)(todos), @@ -28622,11 +30118,11 @@ var selectTransitions = createSelector((state) => state.todos, (todos) => todos. // usecases/lib/components/graph/TransitionHistoryProvider.tsx var jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1); -var TransitionHistoryContext = import_react3.createContext({ committed: [], staged: [] }); +var TransitionHistoryContext = import_react.createContext({ committed: [], staged: [] }); var TransitionHistoryProvider = ({ children, eventBus }) => { - const [committed, setCommitted] = import_react3.useState([]); + const [committed, setCommitted] = import_react.useState([]); const staged = useSelector(selectTransitions); - import_react3.useEffect(() => eventBus.subscribe((transition) => { + import_react.useEffect(() => eventBus.subscribe((transition) => { setCommitted((history) => { const meta = getTransitionMeta(transition); if (meta.operation === TransitionOperation.COMMIT) @@ -28634,13 +30130,13 @@ var TransitionHistoryProvider = ({ children, eventBus }) => { return history; }); }), []); - const value = import_react3.useMemo(() => ({ staged, committed }), [staged, committed]); + const value = import_react.useMemo(() => ({ staged, committed }), [staged, committed]); return jsx_dev_runtime.jsxDEV(TransitionHistoryContext.Provider, { value, children }, undefined, false, undefined, this); }; -var useTransitionHistory = () => import_react3.useContext(TransitionHistoryContext); +var useTransitionHistory = () => import_react.useContext(TransitionHistoryContext); // src/actions.ts var createMatcher = (namespace) => (action) => isTransitionForNamespace(action, namespace) && getTransitionMeta(action).operation === TransitionOperation.COMMIT; @@ -28710,9 +30206,9 @@ var getGraph = () => { }; var TransitionGraph = () => { const { committed, staged } = useTransitionHistory(); - const reflow = import_react4.useMemo(() => Math.random(), [committed, staged]); - const ref = import_react4.useRef(null); - import_react4.useEffect(() => { + const reflow = import_react2.useMemo(() => Math.random(), [committed, staged]); + const ref = import_react2.useRef(null); + import_react2.useEffect(() => { const { mermaid } = window; const el = ref.current; if (el && mermaid) { @@ -28788,10 +30284,10 @@ var Layout = ({ children, title, description }) => jsx_dev_runtime3.jsxDEV("div" }, undefined, true, undefined, this); // usecases/lib/components/todo/TodoApp.tsx -var import_react8 = __toESM(require_react(), 1); +var import_react6 = __toESM(require_react(), 1); // usecases/lib/components/mocks/MockApiProvider.tsx -var import_react5 = __toESM(require_react(), 1); +var import_react3 = __toESM(require_react(), 1); // usecases/lib/utils/mock-api.ts var getMockApiOnline = () => window.__mock_api_online ?? false; @@ -28811,15 +30307,15 @@ var simulateAPIRequest = async () => { // usecases/lib/components/mocks/MockApiProvider.tsx var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1); -var MockApiContext = import_react5.createContext(null); +var MockApiContext = import_react3.createContext(null); var MockApiProvider = ({ children }) => { - const [state, setState] = import_react5.useState({ online: getMockApiOnline(), timeout: getMockApiTimeout() }); - import_react5.useEffect(() => { + const [state, setState] = import_react3.useState({ online: getMockApiOnline(), timeout: getMockApiTimeout() }); + import_react3.useEffect(() => { setMockApiOnline(state.online); setMockApiTimeout(state.timeout); }, [state]); return jsx_dev_runtime4.jsxDEV(MockApiContext.Provider, { - value: import_react5.useMemo(() => ({ + value: import_react3.useMemo(() => ({ ...state, setResponseTime: (timeout) => setState((prev) => ({ ...prev, timeout })), setStore: (store) => setState((prev) => ({ ...prev, store })), @@ -28830,34 +30326,36 @@ var MockApiProvider = ({ children }) => { }, undefined, false, undefined, this); }; var useMockApi = () => { - const ctx = import_react5.useContext(MockApiContext); + const ctx = import_react3.useContext(MockApiContext); if (!ctx) throw new Error; return ctx; }; // node_modules/clsx/dist/clsx.mjs -var r2 = function(e) { - var t2, f2, n2 = ""; +var r = function(e) { + var t, f, n = ""; if (typeof e == "string" || typeof e == "number") - n2 += e; + n += e; else if (typeof e == "object") - if (Array.isArray(e)) - for (t2 = 0;t2 < e.length; t2++) - e[t2] && (f2 = r2(e[t2])) && (n2 && (n2 += " "), n2 += f2); - else - for (t2 in e) - e[t2] && (n2 && (n2 += " "), n2 += t2); - return n2; + if (Array.isArray(e)) { + var o = e.length; + for (t = 0;t < o; t++) + e[t] && (f = r(e[t])) && (n && (n += " "), n += f); + } else + for (f in e) + e[f] && (n && (n += " "), n += f); + return n; }; function clsx() { - for (var e, t2, f2 = 0, n2 = "";f2 < arguments.length; ) - (e = arguments[f2++]) && (t2 = r2(e)) && (n2 && (n2 += " "), n2 += t2); - return n2; + for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++) + (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); + return n; } // usecases/lib/components/todo/TodoItem.tsx -var import_react7 = __toESM(require_react(), 1); +var import_react5 = __toESM(require_react(), 1); +var cloneDeep = __toESM(require_cloneDeep(), 1); // usecases/lib/components/todo/Icons.tsx var jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1); @@ -28916,16 +30414,16 @@ var Cross = () => jsx_dev_runtime5.jsxDEV("svg", { }, undefined, false, undefined, this); // usecases/lib/store/hooks.ts -var import_react6 = __toESM(require_react(), 1); +var import_react4 = __toESM(require_react(), 1); var useTodoState = (todo) => { const state = useSelector(selectOptimisticTodoState(todo.id)); - const [stashed, setStashed] = import_react6.useState(false); - const revision = import_react6.useRef(todo.revision); - import_react6.useEffect(() => { + const [stashed, setStashed] = import_react4.useState(false); + const revision = import_react4.useRef(todo.revision); + import_react4.useEffect(() => { setStashed(revision.current > todo.revision); revision.current = todo.revision; }, [todo.revision]); - return import_react6.useMemo(() => ({ + return import_react4.useMemo(() => ({ conflict: state.conflict, failed: state.failed, failedAction: state.retry, @@ -28939,8 +30437,8 @@ var jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1); var TodoConflict = ({ id }) => { const todo = useSelector(selectTodo(id)); const Tag = todo.done ? "s" : "em"; - return jsx_dev_runtime6.jsxDEV("span", { - className: "text-xs text-red-400", + return jsx_dev_runtime6.jsxDEV("div", { + className: "text-[9px] text-red-300", children: [ 'Conflict : "', jsx_dev_runtime6.jsxDEV(Tag, { @@ -28953,25 +30451,26 @@ var TodoConflict = ({ id }) => { var TodoItem = ({ todo, onEdit, onRetry, onDelete }) => { const id = `todo-${todo.id}`; const { loading, stashed, failed, conflict, failedAction } = useTodoState(todo); - const [editable, setEditable] = import_react7.useState(false); + const [editable, setEditable] = import_react5.useState(false); const error = failed || conflict; const handleMutation = (mutation) => { if (loading) return; if (failedAction) { - onRetry({ - ...failedAction, - payload: { - todo: { - ...failedAction.payload.todo, - ...mutation - } - } - }); + if (createTodo.stage.match(failedAction)) { + const create2 = cloneDeep.default(failedAction); + create2.payload.todo = { ...create2.payload.todo, ...mutation }; + onRetry(create2); + } + if (editTodo.stage.match(failedAction)) { + const edit2 = cloneDeep.default(failedAction); + edit2.payload.todo = { ...edit2.payload.todo, ...mutation }; + onRetry(edit2); + } } else onEdit({ ...todo, revision: todo.revision + 1, ...mutation }); }; - const icon = import_react7.useMemo(() => { + const icon = import_react5.useMemo(() => { if (loading) return jsx_dev_runtime6.jsxDEV(Spinner, {}, undefined, false, undefined, this); if (failed) @@ -29048,7 +30547,7 @@ var TodoApp = ({ onCreateTodo, onDeleteTodo, onEditTodo }) => { const todos = useSelector(selectOptimisticTodos); const failedTransitions = useSelector(selectFailedTodos); const mockApi = useMockApi(); - const [value, setValue] = import_react8.useState(""); + const [value, setValue] = import_react6.useState(""); const handleAddTodo = (value2) => { const sanitized = value2.trim(); if (sanitized) { @@ -29062,7 +30561,7 @@ var TodoApp = ({ onCreateTodo, onDeleteTodo, onEditTodo }) => { if (editTodo.stage.match(action)) return onEditTodo(action.payload.todo); }; - import_react8.useEffect(() => { + import_react6.useEffect(() => { if (mockApi.online) { failedTransitions.forEach((action) => { if (createTodo.stage.match(action)) @@ -29186,7 +30685,7 @@ var createOptimistronMiddlware = () => { const eventBus = createEventBus(); return [ () => (next) => (action) => { - if (isTransition(action)) + if (isAction(action) && isTransition(action)) eventBus.publish(action); next(action); }, @@ -29298,14 +30797,14 @@ var initial = (() => { [todo3.id]: todo3 }; })(); -var compare = (a2) => (b2) => { - if (a2.revision === b2.revision) +var compare = (a) => (b) => { + if (a.revision === b.revision) return 0; - if (a2.revision > b2.revision) + if (a.revision > b.revision) return 1; return -1; }; -var eq = (a2) => (b2) => a2.done === b2.done && a2.value === b2.value; +var eq = (a) => (b) => a.done === b.done && a.value === b.value; var todos = optimistron("todos", initial, recordHandlerFactory({ itemIdKey: "id", compare, eq }), ({ getState, create: create2, update, remove: remove2 }, action) => { if (createTodo.match(action)) return create2(action.payload.todo); @@ -29314,7 +30813,13 @@ var todos = optimistron("todos", initial, recordHandlerFactory({ itemIdKey: "id" if (deleteTodo.match(action)) return remove2(action.payload.id); if (sync.match(action)) { - return Object.fromEntries(Object.entries(getState()).map(([key, todo]) => [key, { ...todo, revision: todo.revision + 10 }])); + return Object.fromEntries(Object.entries(getState()).map(([key, todo]) => [ + key, + { + ...todo, + revision: todo.revision + 10 + } + ])); } return getState(); }); @@ -29334,7 +30839,7 @@ var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1); var { store: store2, eventBus } = createDebugStore(); var Usecase = () => { const mockApi = useMockApi(); - import_react9.useEffect(() => mockApi.setStore(store2), []); + import_react7.useEffect(() => mockApi.setStore(store2), []); return jsx_dev_runtime9.jsxDEV(Provider_default, { store: store2, children: jsx_dev_runtime9.jsxDEV(TransitionHistoryProvider, { @@ -29434,25 +30939,57 @@ var TASK = createSymbol("TASK"); var TASK_CANCEL = createSymbol("TASK_CANCEL"); var TERMINATE = createSymbol("TERMINATE"); var SAGA_LOCATION = createSymbol("LOCATION"); +// node_modules/@babel/runtime/helpers/esm/extends.js +function _extends4() { + _extends4 = Object.assign ? Object.assign.bind() : function(target) { + for (var i = 1;i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends4.apply(this, arguments); +} + +// node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +function _objectWithoutPropertiesLoose2(source, excluded) { + if (source == null) + return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0;i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) + continue; + target[key] = source[key]; + } + return target; +} + // node_modules/@redux-saga/is/dist/redux-saga-is.esm.js -var undef = function undef2(v2) { - return v2 === null || v2 === undefined; +var undef = function undef2(v) { + return v === null || v === undefined; }; -var notUndef = function notUndef2(v2) { - return v2 !== null && v2 !== undefined; +var notUndef = function notUndef2(v) { + return v !== null && v !== undefined; }; -var func = function func2(f2) { - return typeof f2 === "function"; +var func = function func2(f) { + return typeof f === "function"; }; -var string = function string2(s2) { - return typeof s2 === "string"; +var string = function string2(s) { + return typeof s === "string"; }; var array = Array.isArray; var object = function object2(obj) { return obj && !array(obj) && typeof obj === "object"; }; -var promise2 = function promise3(p2) { - return p2 && func(p2.then); +var promise = function promise2(p) { + return p && func(p.then); }; var iterator = function iterator2(it) { return it && func(it.next) && func(it.throw); @@ -29466,8 +31003,8 @@ var pattern = function pattern2(pat) { var channel = function channel2(ch) { return ch && func(ch.take) && func(ch.close); }; -var stringableFunc = function stringableFunc2(f2) { - return func(f2) && f2.hasOwnProperty("toString"); +var stringableFunc = function stringableFunc2(f) { + return func(f) && f.hasOwnProperty("toString"); }; var symbol = function symbol2(sym) { return Boolean(sym) && typeof Symbol === "function" && sym.constructor === Symbol && sym !== Symbol.prototype; @@ -29479,7 +31016,7 @@ var effect = function effect2(eff) { return eff && eff[IO]; }; -// node_modules/@redux-saga/core/dist/io-c3792963.js +// node_modules/@redux-saga/core/dist/io-22ea0cf9.js var check = function(value, predicate, error) { if (!predicate(value)) { throw new Error(error); @@ -29491,14 +31028,14 @@ var remove2 = function(array2, item) { array2.splice(index, 1); } }; -var once = function(fn2) { +var once = function(fn) { var called = false; return function() { if (called) { return; } called = true; - fn2(); + fn(); }; }; var makeIterator = function(next, thro, name) { @@ -29533,8 +31070,8 @@ var createAllStyleChildCallbacks = function(shape, parentCallback) { var keys = Object.keys(shape); var totalCount = keys.length; if (true) { - check(totalCount, function(c2) { - return c2 > 0; + check(totalCount, function(c) { + return c > 0; }, "createAllStyleChildCallbacks: get an empty array or object"); } var completedCount = 0; @@ -29561,7 +31098,7 @@ var createAllStyleChildCallbacks = function(shape, parentCallback) { checkEnd(); } }; - chCbAtKey.cancel = noop; + chCbAtKey.cancel = noop2; childCallbacks[key] = chCbAtKey; }); parentCallback.cancel = function() { @@ -29574,15 +31111,33 @@ var createAllStyleChildCallbacks = function(shape, parentCallback) { }; return childCallbacks; }; -var getMetaInfo = function(fn2) { +var getMetaInfo = function(fn) { return { - name: fn2.name || "anonymous", - location: getLocation(fn2) + name: fn.name || "anonymous", + location: getLocation(fn) }; }; var getLocation = function(instrumented) { return instrumented[SAGA_LOCATION]; }; +var compose2 = function() { + for (var _len = arguments.length, funcs = new Array(_len), _key = 0;_key < _len; _key++) { + funcs[_key] = arguments[_key]; + } + if (funcs.length === 0) { + return function(arg) { + return arg; + }; + } + if (funcs.length === 1) { + return funcs[0]; + } + return funcs.reduce(function(a, b) { + return function() { + return a(b.apply(undefined, arguments)); + }; + }); +}; var ringBuffer = function(limit, overflowAction) { if (limit === undefined) { limit = 10; @@ -29701,24 +31256,24 @@ var put = function(channel$1, action) { }; var getFnCallDescriptor = function(fnDescriptor, args) { var context = null; - var fn2; + var fn; if (func(fnDescriptor)) { - fn2 = fnDescriptor; + fn = fnDescriptor; } else { if (array(fnDescriptor)) { context = fnDescriptor[0]; - fn2 = fnDescriptor[1]; + fn = fnDescriptor[1]; } else { context = fnDescriptor.context; - fn2 = fnDescriptor.fn; + fn = fnDescriptor.fn; } - if (context && string(fn2) && func(context[fn2])) { - fn2 = context[fn2]; + if (context && string(fn) && func(context[fn])) { + fn = context[fn]; } } return { context, - fn: fn2, + fn, args }; }; @@ -29734,31 +31289,31 @@ var fork = function(fnDescriptor) { } return makeEffect(FORK, getFnCallDescriptor(fnDescriptor, args)); }; -var konst = function konst2(v2) { +var konst = function konst2(v) { return function() { - return v2; + return v; }; }; var kTrue = konst(true); -var noop = function noop2() { +var noop2 = function noop3() { }; if (typeof Proxy !== "undefined") { - noop = new Proxy(noop, { + noop2 = new Proxy(noop2, { set: function set() { throw internalErr("There was an attempt to assign a property to internal `noop` function."); } }); } -var identity = function identity2(v2) { - return v2; +var identity = function identity2(v) { + return v; }; var hasSymbol = typeof Symbol === "function"; var asyncIteratorSymbol = hasSymbol && Symbol.asyncIterator ? Symbol.asyncIterator : "@@asyncIterator"; var assignWithSymbols = function assignWithSymbols2(target, source) { _extends4(target, source); if (Object.getOwnPropertySymbols) { - Object.getOwnPropertySymbols(source).forEach(function(s2) { - target[s2] = source[s2]; + Object.getOwnPropertySymbols(source).forEach(function(s) { + target[s] = source[s]; }); } }; @@ -29782,8 +31337,8 @@ var createSetContextWarning = function createSetContextWarning2(ctx, props) { return (ctx ? ctx + "." : "") + "setContext(props): argument " + props + " is not a plain object"; }; var FROZEN_ACTION_ERROR = "You can't put (a.k.a. dispatch from saga) frozen actions.\nWe have to define a special non-enumerable property on those actions for scheduling purposes.\nOtherwise you wouldn't be able to communicate properly between sagas & other subscribers (action ordering would become far less predictable).\nIf you are using redux and you care about this behaviour (frozen actions),\nthen you might want to switch to freezing actions in a middleware rather than in action creator.\nExample implementation:\n\nconst freezeActions = store => next => action => next(Object.freeze(action))\n"; -var createEmptyArray = function createEmptyArray2(n2) { - return Array.apply(null, new Array(n2)); +var createEmptyArray = function createEmptyArray2(n) { + return Array.apply(null, new Array(n)); }; var wrapSagaDispatch = function wrapSagaDispatch2(dispatch) { return function(action) { @@ -29838,24 +31393,24 @@ var validateFnDescriptor = function validateFnDescriptor2(effectName, fnDescript return; } var context = null; - var fn2; + var fn; if (array(fnDescriptor)) { context = fnDescriptor[0]; - fn2 = fnDescriptor[1]; - check(fn2, notUndef, effectName + ": argument of type [context, fn] has undefined or null `fn`"); + fn = fnDescriptor[1]; + check(fn, notUndef, effectName + ": argument of type [context, fn] has undefined or null `fn`"); } else if (object(fnDescriptor)) { context = fnDescriptor.context; - fn2 = fnDescriptor.fn; - check(fn2, notUndef, effectName + ": argument of type {context, fn} has undefined or null `fn`"); + fn = fnDescriptor.fn; + check(fn, notUndef, effectName + ": argument of type {context, fn} has undefined or null `fn`"); } else { check(fnDescriptor, func, effectName + ": argument fn is not function"); return; } - if (context && string(fn2)) { - check(context[fn2], func, effectName + ": context arguments has no such method - \"" + fn2 + "\""); + if (context && string(fn)) { + check(context[fn], func, effectName + ": context arguments has no such method - \"" + fn + "\""); return; } - check(fn2, func, effectName + ": unpacked fn argument (from [context, fn] or {context, fn}) is not a function"); + check(fn, func, effectName + ": unpacked fn argument (from [context, fn] or {context, fn}) is not a function"); }; // node_modules/@redux-saga/deferred/dist/redux-saga-deferred.esm.js var deferred = function() { @@ -29869,25 +31424,25 @@ var deferred = function() { var redux_saga_deferred_esm_default = deferred; // node_modules/@redux-saga/core/dist/redux-saga-core.esm.js -var exec = function(task3) { +var exec = function(task2) { try { suspend(); - task3(); + task2(); } finally { release(); } }; -var asap = function(task3) { - queue.push(task3); +var asap = function(task2) { + queue.push(task2); if (!semaphore) { suspend(); flush(); } }; -var immediately = function(task3) { +var immediately = function(task2) { try { suspend(); - return task3(); + return task2(); } finally { flush(); } @@ -29900,9 +31455,9 @@ var release = function() { }; var flush = function() { release(); - var task3; - while (!semaphore && (task3 = queue.shift()) !== undefined) { - exec(task3); + var task2; + while (!semaphore && (task2 = queue.shift()) !== undefined) { + exec(task2); } }; var matcher = function(pattern3) { @@ -29980,8 +31535,8 @@ var channel3 = function(buffer$1) { closed = true; var arr = takers; takers = []; - for (var i2 = 0, len = arr.length;i2 < len; i2++) { - var taker = arr[i2]; + for (var i = 0, len = arr.length;i < len; i++) { + var taker = arr[i]; taker(END); } } @@ -30032,8 +31587,8 @@ var multicastChannel = function() { return; } var takers = currentTakers = nextTakers; - for (var i2 = 0, len = takers.length;i2 < len; i2++) { - var taker = takers[i2]; + for (var i = 0, len = takers.length;i < len; i++) { + var taker = takers[i]; if (taker[MATCH](input)) { taker.cancel(); taker(input); @@ -30073,27 +31628,27 @@ var stdChannel = function() { }; return chan; }; -var resolvePromise = function(promise4, cb) { - var cancelPromise = promise4[CANCEL]; +var resolvePromise = function(promise3, cb) { + var cancelPromise = promise3[CANCEL]; if (func(cancelPromise)) { cb.cancel = cancelPromise; } - promise4.then(cb, function(error) { + promise3.then(cb, function(error) { cb(error, true); }); }; -var getIteratorMetaInfo = function(iterator3, fn2) { +var getIteratorMetaInfo = function(iterator3, fn) { if (iterator3.isSagaIterator) { return { name: iterator3.meta.name }; } - return getMetaInfo(fn2); + return getMetaInfo(fn); }; var createTaskIterator = function(_ref) { - var { context, fn: fn2, args } = _ref; + var { context, fn, args } = _ref; try { - var result = fn2.apply(context, args); + var result = fn.apply(context, args); if (iterator(result)) { return result; } @@ -30103,7 +31658,7 @@ var createTaskIterator = function(_ref) { resolved = true; return { value: result, - done: !promise2(result) + done: !promise(result) }; } else { return { @@ -30129,7 +31684,7 @@ var runPutEffect = function(env, _ref2, cb) { cb(error, true); return; } - if (resolve && promise2(result)) { + if (resolve && promise(result)) { resolvePromise(result, cb); } else { cb(result); @@ -30158,16 +31713,16 @@ var runTakeEffect = function(env, _ref3, cb) { cb.cancel = takeCb.cancel; }; var runCallEffect = function(env, _ref4, cb, _ref5) { - var { context, fn: fn2, args } = _ref4; - var task3 = _ref5.task; + var { context, fn, args } = _ref4; + var task2 = _ref5.task; try { - var result = fn2.apply(context, args); - if (promise2(result)) { + var result = fn.apply(context, args); + if (promise(result)) { resolvePromise(result, cb); return; } if (iterator(result)) { - proc(env, result, task3.context, current, getMetaInfo(fn2), false, cb); + proc(env, result, task2.context, current2, getMetaInfo(fn), false, cb); return; } cb(result); @@ -30176,7 +31731,7 @@ var runCallEffect = function(env, _ref4, cb, _ref5) { } }; var runCPSEffect = function(env, _ref6, cb) { - var { context, fn: fn2, args } = _ref6; + var { context, fn, args } = _ref6; try { var cpsCb = function cpsCb(err, res) { if (undef(err)) { @@ -30185,7 +31740,7 @@ var runCPSEffect = function(env, _ref6, cb) { cb(err, true); } }; - fn2.apply(context, args.concat(cpsCb)); + fn.apply(context, args.concat(cpsCb)); if (cpsCb.cancel) { cb.cancel = cpsCb.cancel; } @@ -30194,16 +31749,16 @@ var runCPSEffect = function(env, _ref6, cb) { } }; var runForkEffect = function(env, _ref7, cb, _ref8) { - var { context, fn: fn2, args, detached } = _ref7; + var { context, fn, args, detached } = _ref7; var parent = _ref8.task; var taskIterator = createTaskIterator({ context, - fn: fn2, + fn, args }); - var meta = getIteratorMetaInfo(taskIterator, fn2); + var meta = getIteratorMetaInfo(taskIterator, fn); immediately(function() { - var child = proc(env, taskIterator, parent.context, current, meta, detached, undefined); + var child = proc(env, taskIterator, parent.context, current2, meta, detached, undefined); if (detached) { cb(child); } else { @@ -30219,11 +31774,11 @@ var runForkEffect = function(env, _ref7, cb, _ref8) { }); }; var runJoinEffect = function(env, taskOrTasks, cb, _ref9) { - var task3 = _ref9.task; + var task2 = _ref9.task; var joinSingleTask = function joinSingleTask(taskToJoin, cb2) { if (taskToJoin.isRunning()) { var joiner = { - task: task3, + task: task2, cb: cb2 }; cb2.cancel = function() { @@ -30245,8 +31800,8 @@ var runJoinEffect = function(env, taskOrTasks, cb, _ref9) { return; } var childCallbacks = createAllStyleChildCallbacks(taskOrTasks, cb); - taskOrTasks.forEach(function(t2, i2) { - joinSingleTask(t2, childCallbacks[i2]); + taskOrTasks.forEach(function(t, i) { + joinSingleTask(t, childCallbacks[i]); }); } else { joinSingleTask(taskOrTasks, cb); @@ -30258,9 +31813,9 @@ var cancelSingleTask = function(taskToCancel) { } }; var runCancelEffect = function(env, taskOrTasks, cb, _ref10) { - var task3 = _ref10.task; + var task2 = _ref10.task; if (taskOrTasks === SELF_CANCELLATION) { - cancelSingleTask(task3); + cancelSingleTask(task2); } else if (array(taskOrTasks)) { taskOrTasks.forEach(cancelSingleTask); } else { @@ -30270,7 +31825,7 @@ var runCancelEffect = function(env, taskOrTasks, cb, _ref10) { }; var runAllEffect = function(env, effects, cb, _ref11) { var digestEffect = _ref11.digestEffect; - var effectId = current; + var effectId = current2; var keys = Object.keys(effects); if (keys.length === 0) { cb(array(effects) ? [] : {}); @@ -30283,7 +31838,7 @@ var runAllEffect = function(env, effects, cb, _ref11) { }; var runRaceEffect = function(env, effects, cb, _ref12) { var digestEffect = _ref12.digestEffect; - var effectId = current; + var effectId = current2; var keys = Object.keys(effects); var response = array(effects) ? createEmptyArray(keys.length) : {}; var childCbs = {}; @@ -30303,7 +31858,7 @@ var runRaceEffect = function(env, effects, cb, _ref12) { cb(response); } }; - chCbAtKey.cancel = noop; + chCbAtKey.cancel = noop2; childCbs[key] = chCbAtKey; }); cb.cancel = function() { @@ -30349,19 +31904,19 @@ var runChannelEffect = function(env, _ref14, cb) { cb(chan); }; var runCancelledEffect = function(env, data, cb, _ref15) { - var task3 = _ref15.task; - cb(task3.isCancelled()); + var task2 = _ref15.task; + cb(task2.isCancelled()); }; var runFlushEffect = function(env, channel4, cb) { channel4.flush(cb); }; var runGetContextEffect = function(env, prop, cb, _ref16) { - var task3 = _ref16.task; - cb(task3.context[prop]); + var task2 = _ref16.task; + cb(task2.context[prop]); }; var runSetContextEffect = function(env, props, cb, _ref17) { - var task3 = _ref17.task; - assignWithSymbols(task3.context, props); + var task2 = _ref17.task; + assignWithSymbols(task2.context, props); cb(); }; var forkQueue = function(mainTask, onAbort, cont) { @@ -30377,18 +31932,18 @@ var forkQueue = function(mainTask, onAbort, cont) { cancelAll(); cont(err, true); } - function addTask(task3) { - tasks.push(task3); - task3.cont = function(res, isErr) { + function addTask(task2) { + tasks.push(task2); + task2.cont = function(res, isErr) { if (completed2) { return; } - remove2(tasks, task3); - task3.cont = noop; + remove2(tasks, task2); + task2.cont = noop2; if (isErr) { abort(res); } else { - if (task3 === mainTask) { + if (task2 === mainTask) { result = res; } if (!tasks.length) { @@ -30403,9 +31958,9 @@ var forkQueue = function(mainTask, onAbort, cont) { return; } completed2 = true; - tasks.forEach(function(t2) { - t2.cont = noop; - t2.cancel(); + tasks.forEach(function(t) { + t.cont = noop2; + t.cancel(); }); tasks = []; } @@ -30436,8 +31991,8 @@ var sagaLocationAsString = function(sagaMeta) { return name; }; var cancelledTasksAsString = function(sagaStack) { - var cancelledTasks = flatMap(function(i2) { - return i2.cancelledTasks; + var cancelledTasks = flatMap(function(i) { + return i.cancelledTasks; }, sagaStack); if (!cancelledTasks.length) { return ""; @@ -30447,7 +32002,7 @@ var cancelledTasksAsString = function(sagaStack) { var newTask = function(env, mainTask, parentContext, parentEffectId, meta, isRoot, cont) { var _task; if (cont === undefined) { - cont = noop; + cont = noop2; } var status = RUNNING; var taskResult; @@ -30456,8 +32011,8 @@ var newTask = function(env, mainTask, parentContext, parentEffectId, meta, isRoo var cancelledDueToErrorTasks = []; var context = Object.create(parentContext); var queue = forkQueue(mainTask, function onAbort() { - cancelledDueToErrorTasks.push.apply(cancelledDueToErrorTasks, queue.getTasks().map(function(t2) { - return t2.meta.name; + cancelledDueToErrorTasks.push.apply(cancelledDueToErrorTasks, queue.getTasks().map(function(t) { + return t.meta.name; })); }, end); function cancel() { @@ -30482,7 +32037,7 @@ var newTask = function(env, mainTask, parentContext, parentEffectId, meta, isRoo meta, cancelledTasks: cancelledDueToErrorTasks }); - if (task3.isRoot) { + if (task2.isRoot) { var sagaStack = toString(); clear(); env.onError(result, { @@ -30492,11 +32047,11 @@ var newTask = function(env, mainTask, parentContext, parentEffectId, meta, isRoo taskError = result; deferredEnd && deferredEnd.reject(result); } - task3.cont(result, isErr); - task3.joiners.forEach(function(joiner) { + task2.cont(result, isErr); + task2.joiners.forEach(function(joiner) { joiner.cb(result, isErr); }); - task3.joiners = null; + task2.joiners = null; } function setContext(props) { if (true) { @@ -30516,7 +32071,7 @@ var newTask = function(env, mainTask, parentContext, parentEffectId, meta, isRoo } return deferredEnd.promise; } - var task3 = (_task = {}, _task[TASK] = true, _task.id = parentEffectId, _task.meta = meta, _task.isRoot = isRoot, _task.context = context, _task.joiners = [], _task.queue = queue, _task.cancel = cancel, _task.cont = cont, _task.end = end, _task.setContext = setContext, _task.toPromise = toPromise, _task.isRunning = function isRunning() { + var task2 = (_task = {}, _task[TASK] = true, _task.id = parentEffectId, _task.meta = meta, _task.isRoot = isRoot, _task.context = context, _task.joiners = [], _task.queue = queue, _task.cancel = cancel, _task.cont = cont, _task.end = end, _task.setContext = setContext, _task.toPromise = toPromise, _task.isRunning = function isRunning() { return status === RUNNING; }, _task.isCancelled = function isCancelled() { return status === CANCELLED2 || status === RUNNING && mainTask.status === CANCELLED2; @@ -30527,22 +32082,22 @@ var newTask = function(env, mainTask, parentContext, parentEffectId, meta, isRoo }, _task.error = function error() { return taskError; }, _task); - return task3; + return task2; }; var proc = function(env, iterator$1, parentContext, parentEffectId, meta, isRoot, cont) { if (iterator$1[asyncIteratorSymbol]) { throw new Error("redux-saga doesn't support async generators, please use only regular ones"); } var finalRunEffect = env.finalizeRunEffect(runEffect); - next.cancel = noop; + next.cancel = noop2; var mainTask = { meta, cancel: cancelMain, status: RUNNING }; - var task3 = newTask(env, mainTask, parentContext, parentEffectId, meta, isRoot, cont); + var task2 = newTask(env, mainTask, parentContext, parentEffectId, meta, isRoot, cont); var executingContext = { - task: task3, + task: task2, digestEffect }; function cancelMain() { @@ -30552,10 +32107,10 @@ var proc = function(env, iterator$1, parentContext, parentEffectId, meta, isRoot } } if (cont) { - cont.cancel = task3.cancel; + cont.cancel = task2.cancel; } next(); - return task3; + return task2; function next(arg, isErr) { try { var result; @@ -30593,10 +32148,10 @@ var proc = function(env, iterator$1, parentContext, parentEffectId, meta, isRoot } } function runEffect(effect3, effectId, currCb) { - if (promise2(effect3)) { + if (promise(effect3)) { resolvePromise(effect3, currCb); } else if (iterator(effect3)) { - proc(env, effect3, task3.context, effectId, meta, false, currCb); + proc(env, effect3, task2.context, effectId, meta, false, currCb); } else if (effect3 && effect3[IO]) { var effectRunner = effectRunnerMap[effect3.type]; effectRunner(env, effect3.payload, currCb, executingContext); @@ -30621,7 +32176,7 @@ var proc = function(env, iterator$1, parentContext, parentEffectId, meta, isRoot return; } effectSettled = true; - cb.cancel = noop; + cb.cancel = noop2; if (env.sagaMonitor) { if (isErr) { env.sagaMonitor.effectRejected(effectId, res); @@ -30634,14 +32189,14 @@ var proc = function(env, iterator$1, parentContext, parentEffectId, meta, isRoot } cb(res, isErr); } - currCb.cancel = noop; + currCb.cancel = noop2; cb.cancel = function() { if (effectSettled) { return; } effectSettled = true; currCb.cancel(); - currCb.cancel = noop; + currCb.cancel = noop2; env.sagaMonitor && env.sagaMonitor.effectCancelled(effectId); }; finalRunEffect(effect3, effectId, currCb); @@ -30661,12 +32216,12 @@ var runSaga = function(_ref, saga) { } var effectId = nextSagaId(); if (sagaMonitor) { - sagaMonitor.rootSagaStarted = sagaMonitor.rootSagaStarted || noop; - sagaMonitor.effectTriggered = sagaMonitor.effectTriggered || noop; - sagaMonitor.effectResolved = sagaMonitor.effectResolved || noop; - sagaMonitor.effectRejected = sagaMonitor.effectRejected || noop; - sagaMonitor.effectCancelled = sagaMonitor.effectCancelled || noop; - sagaMonitor.actionDispatched = sagaMonitor.actionDispatched || noop; + sagaMonitor.rootSagaStarted = sagaMonitor.rootSagaStarted || noop2; + sagaMonitor.effectTriggered = sagaMonitor.effectTriggered || noop2; + sagaMonitor.effectResolved = sagaMonitor.effectResolved || noop2; + sagaMonitor.effectRejected = sagaMonitor.effectRejected || noop2; + sagaMonitor.effectCancelled = sagaMonitor.effectCancelled || noop2; + sagaMonitor.actionDispatched = sagaMonitor.actionDispatched || noop2; sagaMonitor.rootSagaStarted({ effectId, saga, @@ -30691,7 +32246,7 @@ var runSaga = function(_ref, saga) { } var finalizeRunEffect; if (effectMiddlewares) { - var middleware2 = compose.apply(undefined, effectMiddlewares); + var middleware2 = compose2.apply(undefined, effectMiddlewares); finalizeRunEffect = function finalizeRunEffect(runEffect) { return function(effect3, effectId2, currCb) { var plainRunEffect = function plainRunEffect(eff) { @@ -30712,11 +32267,11 @@ var runSaga = function(_ref, saga) { finalizeRunEffect }; return immediately(function() { - var task3 = proc(env, iterator$1, context, effectId, getMetaInfo(saga), true, undefined); + var task2 = proc(env, iterator$1, context, effectId, getMetaInfo(saga), true, undefined); if (sagaMonitor) { - sagaMonitor.effectResolved(effectId, task3); + sagaMonitor.effectResolved(effectId, task2); } - return task3; + return task2; }); }; var sagaMiddlewareFactory = function(_temp) { @@ -30763,8 +32318,8 @@ var queue = []; var semaphore = 0; var array2 = function array3(patterns) { return function(input) { - return patterns.some(function(p2) { - return matcher(p2)(input); + return patterns.some(function(p) { + return matcher(p)(input); }); }; }; @@ -30789,8 +32344,8 @@ var wildcard = function wildcard2() { var END = { type: CHANNEL_END_TYPE }; -var isEnd = function isEnd2(a2) { - return a2 && a2.type === CHANNEL_END_TYPE; +var isEnd = function isEnd2(a) { + return a && a.type === CHANNEL_END_TYPE; }; var CLOSED_CHANNEL_WITH_TAKERS = "Cannot have a closed channel with pending takers"; var INVALID_BUFFER = "invalid buffer passed to channel factory function"; @@ -30799,9 +32354,9 @@ var RUNNING = 0; var CANCELLED2 = 1; var ABORTED = 2; var DONE = 3; -var current = 0; +var current2 = 0; var nextSagaId = function() { - return ++current; + return ++current2; }; var _effectRunnerMap; var effectRunnerMap = (_effectRunnerMap = {}, _effectRunnerMap[TAKE] = runTakeEffect, _effectRunnerMap[PUT] = runPutEffect, _effectRunnerMap[ALL] = runAllEffect, _effectRunnerMap[RACE] = runRaceEffect, _effectRunnerMap[CALL] = runCallEffect, _effectRunnerMap[CPS] = runCPSEffect, _effectRunnerMap[FORK] = runForkEffect, _effectRunnerMap[JOIN] = runJoinEffect, _effectRunnerMap[CANCEL2] = runCancelEffect, _effectRunnerMap[SELECT] = runSelectEffect, _effectRunnerMap[ACTION_CHANNEL] = runChannelEffect, _effectRunnerMap[CANCELLED] = runCancelledEffect, _effectRunnerMap[FLUSH] = runFlushEffect, _effectRunnerMap[GET_CONTEXT] = runGetContextEffect, _effectRunnerMap[SET_CONTEXT] = runSetContextEffect, _effectRunnerMap); @@ -30822,8 +32377,8 @@ var toString = function toString2() { var firstSaga = sagaStack[0], otherSagas = sagaStack.slice(1); var crashedEffectLocation = firstSaga.crashedEffect ? effectLocationAsString(firstSaga.crashedEffect) : null; var errorMessage = "The above error occurred in task " + sagaLocationAsString(firstSaga.meta) + (crashedEffectLocation ? " \n when executing effect " + crashedEffectLocation : ""); - return [errorMessage].concat(otherSagas.map(function(s2) { - return " created by " + sagaLocationAsString(s2.meta); + return [errorMessage].concat(otherSagas.map(function(s) { + return " created by " + sagaLocationAsString(s.meta); }), [cancelledTasksAsString(sagaStack)]).join("\n"); }; var RUN_SAGA_SIGNATURE = "runSaga(options, saga, ...args)"; @@ -30834,7 +32389,7 @@ var redux_saga_core_esm_default = sagaMiddlewareFactory; var redux_saga_core_npm_proxy_esm_default = redux_saga_core_esm_default; // usecases/sagas/index.tsx -var import_react10 = __toESM(require_react(), 1); +var import_react8 = __toESM(require_react(), 1); // usecases/sagas/App.tsx var jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1); @@ -30951,9 +32506,9 @@ var done = function done2(value) { }; }; var qEnd = {}; -var validateTakeEffect = function validateTakeEffect2(fn2, patternOrChannel, worker) { - check(patternOrChannel, notUndef, fn2.name + " requires a pattern or channel"); - check(worker, notUndef, fn2.name + " requires a saga parameter"); +var validateTakeEffect = function validateTakeEffect2(fn, patternOrChannel, worker) { + check(patternOrChannel, notUndef, fn.name + " requires a pattern or channel"); + check(worker, notUndef, fn.name + " requires a saga parameter"); }; // usecases/sagas/saga.ts function* rootSaga() { @@ -30994,7 +32549,7 @@ var { store: store4, eventBus: eventBus2 } = createDebugStore(sagaMiddleware); sagaMiddleware.run(rootSaga); var Usecase2 = () => { const mockApi = useMockApi(); - import_react10.useEffect(() => mockApi.setStore(store4), []); + import_react8.useEffect(() => mockApi.setStore(store4), []); return jsx_dev_runtime12.jsxDEV(Provider_default, { store: store4, children: jsx_dev_runtime12.jsxDEV(TransitionHistoryProvider, { @@ -31006,7 +32561,7 @@ var Usecase2 = () => { var sagas_default = Usecase2; // usecases/thunks/index.tsx -var import_react11 = __toESM(require_react(), 1); +var import_react9 = __toESM(require_react(), 1); // usecases/thunks/thunk.ts var createTodoThunk = (todo) => { @@ -31068,10 +32623,10 @@ var App5 = () => { // usecases/thunks/index.tsx var jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1); -var { store: store6, eventBus: eventBus3 } = createDebugStore(es_default.withExtraArgument({})); +var { store: store6, eventBus: eventBus3 } = createDebugStore(thunk); var Usecase3 = () => { const mockApi = useMockApi(); - import_react11.useEffect(() => mockApi.setStore(store6), []); + import_react9.useEffect(() => mockApi.setStore(store6), []); return jsx_dev_runtime14.jsxDEV(Provider_default, { store: store6, children: jsx_dev_runtime14.jsxDEV(TransitionHistoryProvider, { @@ -31084,7 +32639,7 @@ var thunks_default = Usecase3; // usecases/index.tsx var jsx_dev_runtime15 = __toESM(require_jsx_dev_runtime(), 1); var usecases = [ - { key: "Home", path: "/", component: import_react12.Fragment }, + { key: "Home", path: "/", component: import_react10.Fragment }, { key: "Basic", path: "/basic", component: basic_default }, { key: "Sagas", path: "/sagas", component: sagas_default }, { key: "Thunks", path: "/thunks", component: thunks_default } diff --git a/lib/components/todo/TodoItem.tsx b/lib/components/todo/TodoItem.tsx index 5b18894..591b474 100644 --- a/lib/components/todo/TodoItem.tsx +++ b/lib/components/todo/TodoItem.tsx @@ -4,14 +4,17 @@ import { useSelector } from 'react-redux'; import type { TransitionAction } from '~transitions'; +import cloneDeep from 'lodash/cloneDeep'; import { CheckMark, Cross, Spinner } from '~usecases/lib/components/todo/Icons'; +import type { OptimisticActions } from '~usecases/lib/store/actions'; +import { createTodo, editTodo } from '~usecases/lib/store/actions'; import { useTodoState } from '~usecases/lib/store/hooks'; import { selectTodo } from '~usecases/lib/store/selectors'; import type { Todo } from '~usecases/lib/store/types'; type Props = { todo: Todo; - onRetry: (action: TransitionAction) => void; + onRetry: (action: TransitionAction) => void; onEdit: (todo: Todo) => void; onDelete: (todo: Todo) => void; }; @@ -21,9 +24,9 @@ const TodoConflict: FC<{ id: string }> = ({ id }) => { const Tag: keyof JSX.IntrinsicElements = todo.done ? 's' : 'em'; return ( - +
Conflict : "{todo.value}" - +
); }; @@ -37,15 +40,17 @@ export const TodoItem: FC = ({ todo, onEdit, onRetry, onDelete }) => { if (loading) return; if (failedAction) { - onRetry({ - ...failedAction, - payload: { - todo: { - ...failedAction.payload.todo, - ...mutation, - }, - }, - }); + if (createTodo.stage.match(failedAction)) { + const create = cloneDeep(failedAction); + create.payload.todo = { ...create.payload.todo, ...mutation }; + onRetry(create); + } + + if (editTodo.stage.match(failedAction)) { + const edit = cloneDeep(failedAction); + edit.payload.todo = { ...edit.payload.todo, ...mutation }; + onRetry(edit); + } } else onEdit({ ...todo, revision: todo.revision + 1, ...mutation }); }; diff --git a/lib/store/actions.ts b/lib/store/actions.ts index 7957af0..4ed4ca1 100644 --- a/lib/store/actions.ts +++ b/lib/store/actions.ts @@ -11,4 +11,9 @@ export const createTodo = createTransitions('todos::add')(create); export const editTodo = createTransitions('todos::edit')(edit); export const deleteTodo = createTransitions('todos::delete', TransitionDedupeMode.TRAILING)(remove); +export type OptimisticActions = + | ReturnType + | ReturnType + | ReturnType; + export const sync = createAction('todos::sync'); diff --git a/lib/store/middleware.ts b/lib/store/middleware.ts index 1ff9b67..f0268d3 100644 --- a/lib/store/middleware.ts +++ b/lib/store/middleware.ts @@ -1,4 +1,4 @@ -import type { Middleware } from 'redux'; +import { isAction, type Middleware } from 'redux'; import { isTransition, type TransitionAction } from '~transitions'; type TransitionEvent = CustomEvent; @@ -31,7 +31,7 @@ export const createOptimistronMiddlware = (): [Middleware, TransitionEventBus] = return [ () => (next) => (action) => { - if (isTransition(action)) eventBus.publish(action); + if (isAction(action) && isTransition(action)) eventBus.publish(action); next(action); }, eventBus, diff --git a/lib/store/reducer.ts b/lib/store/reducer.ts index ed4ce8a..113bc79 100644 --- a/lib/store/reducer.ts +++ b/lib/store/reducer.ts @@ -39,7 +39,13 @@ export const todos = optimistron( /** Simulate items all being bumped to a new revision. If we * have ongoing transitions, these should create conflicts */ return Object.fromEntries( - Object.entries(getState()).map(([key, todo]) => [key, { ...todo, revision: todo.revision + 10 }]), + Object.entries(getState()).map(([key, todo]) => [ + key, + { + ...todo, + revision: todo.revision + 10, + }, + ]), ); } diff --git a/lib/store/selectors.ts b/lib/store/selectors.ts index b0f84f3..792e995 100644 --- a/lib/store/selectors.ts +++ b/lib/store/selectors.ts @@ -7,7 +7,7 @@ import { selectIsOptimistic, selectOptimistic, } from '~selectors'; -import { type State } from '~usecases/lib/store/store'; +import type { State } from '~usecases/lib/store/store'; export const selectTodo = (id: string) => createSelector( diff --git a/thunks/index.tsx b/thunks/index.tsx index c63c12b..7ae67b1 100644 --- a/thunks/index.tsx +++ b/thunks/index.tsx @@ -1,14 +1,14 @@ import type { FC } from 'react'; import { useEffect } from 'react'; import { Provider } from 'react-redux'; -import thunk from 'redux-thunk'; +import { thunk } from 'redux-thunk'; import { TransitionHistoryProvider } from '~usecases/lib/components/graph/TransitionHistoryProvider'; import { useMockApi } from '~usecases/lib/components/mocks/MockApiProvider'; import { createDebugStore } from '~usecases/lib/store/store'; import { App } from '~usecases/thunks/App'; -export const { store, eventBus } = createDebugStore(thunk.withExtraArgument({})); +export const { store, eventBus } = createDebugStore(thunk); const Usecase: FC = () => { const mockApi = useMockApi(); diff --git a/thunks/thunk.ts b/thunks/thunk.ts index 9ea8d59..81db5ca 100644 --- a/thunks/thunk.ts +++ b/thunks/thunk.ts @@ -1,4 +1,4 @@ -import type { AnyAction } from 'redux'; +import type { Action } from 'redux'; import type { ThunkAction } from 'redux-thunk'; import { createTodo, deleteTodo, editTodo } from '~usecases/lib/store/actions'; @@ -6,7 +6,7 @@ import type { State } from '~usecases/lib/store/store'; import type { Todo } from '~usecases/lib/store/types'; import { generateId, simulateAPIRequest } from '~usecases/lib/utils/mock-api'; -export const createTodoThunk = (todo: Todo): ThunkAction => { +export const createTodoThunk = (todo: Todo): ThunkAction => { return async (dispatch) => { const transitionId = todo.id; @@ -21,7 +21,7 @@ export const createTodoThunk = (todo: Todo): ThunkAction => { +export const editTodoThunk = (id: string, update: Todo): ThunkAction => { return async (dispatch) => { const transitionId = id; @@ -35,7 +35,7 @@ export const editTodoThunk = (id: string, update: Todo): ThunkAction => { +export const deleteTodoTunk = (id: string): ThunkAction => { return async (dispatch) => { const transitionId = id;