` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `
` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","import React from 'react';\nexport default React.createContext(null);","/**\n * @license React\n * use-sync-external-store-with-selector.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var g=require(\"react\");function n(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var p=\"function\"===typeof Object.is?Object.is:n,q=g.useSyncExternalStore,r=g.useRef,t=g.useEffect,u=g.useMemo,v=g.useDebugValue;\nexports.useSyncExternalStoreWithSelector=function(a,b,e,l,h){var c=r(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=u(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==h&&f.hasValue){var b=f.value;if(h(b,a))return k=b}return k=a}b=k;if(p(d,a))return b;var e=l(a);if(void 0!==h&&h(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,h]);var d=q(a,c[0],c[1]);\nt(function(){f.hasValue=!0;f.value=d},[d]);v(d);return d};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/use-sync-external-store-with-selector.production.min.js');\n} else {\n module.exports = require('./cjs/use-sync-external-store-with-selector.development.js');\n}\n","function _extends() {\n module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _extends.apply(this, arguments);\n}\nmodule.exports = _extends, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n }\n return target;\n}\nmodule.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","// src/query/react/index.ts\nimport { buildCreateApi, coreModule } from \"@reduxjs/toolkit/query\";\n\n// src/query/react/module.ts\nimport { formatProdErrorMessage as _formatProdErrorMessage3 } from \"@reduxjs/toolkit\";\n\n// src/query/endpointDefinitions.ts\nfunction isQueryDefinition(e) {\n return e.type === \"query\" /* query */;\n}\nfunction isMutationDefinition(e) {\n return e.type === \"mutation\" /* mutation */;\n}\n\n// src/query/tsHelpers.ts\nfunction safeAssign(target, ...args) {\n return Object.assign(target, ...args);\n}\n\n// src/query/utils/capitalize.ts\nfunction capitalize(str) {\n return str.replace(str[0], str[0].toUpperCase());\n}\n\n// src/query/core/rtkImports.ts\nimport { createAction, createSlice, createSelector, createAsyncThunk, combineReducers, createNextState, isAnyOf, isAllOf, isAction, isPending, isRejected, isFulfilled, isRejectedWithValue, isAsyncThunkAction, prepareAutoBatched, SHOULD_AUTOBATCH, isPlainObject, nanoid } from \"@reduxjs/toolkit\";\n\n// src/query/react/buildHooks.ts\nimport { formatProdErrorMessage as _formatProdErrorMessage2 } from \"@reduxjs/toolkit\";\nimport { formatProdErrorMessage as _formatProdErrorMessage } from \"@reduxjs/toolkit\";\nimport { QueryStatus, skipToken } from \"@reduxjs/toolkit/query\";\nimport { useCallback, useDebugValue, useEffect as useEffect3, useLayoutEffect, useMemo as useMemo2, useRef as useRef3, useState } from \"react\";\nimport { shallowEqual as shallowEqual2 } from \"react-redux\";\n\n// src/query/defaultSerializeQueryArgs.ts\nvar cache = WeakMap ? /* @__PURE__ */ new WeakMap() : void 0;\nvar defaultSerializeQueryArgs = ({\n endpointName,\n queryArgs\n}) => {\n let serialized = \"\";\n const cached = cache?.get(queryArgs);\n if (typeof cached === \"string\") {\n serialized = cached;\n } else {\n const stringified = JSON.stringify(queryArgs, (key, value) => {\n value = typeof value === \"bigint\" ? {\n $bigint: value.toString()\n } : value;\n value = isPlainObject(value) ? Object.keys(value).sort().reduce((acc, key2) => {\n acc[key2] = value[key2];\n return acc;\n }, {}) : value;\n return value;\n });\n if (isPlainObject(queryArgs)) {\n cache?.set(queryArgs, stringified);\n }\n serialized = stringified;\n }\n return `${endpointName}(${serialized})`;\n};\n\n// src/query/react/constants.ts\nvar UNINITIALIZED_VALUE = Symbol();\n\n// src/query/react/useSerializedStableValue.ts\nimport { useEffect, useRef, useMemo } from \"react\";\nfunction useStableQueryArgs(queryArgs, serialize, endpointDefinition, endpointName) {\n const incoming = useMemo(() => ({\n queryArgs,\n serialized: typeof queryArgs == \"object\" ? serialize({\n queryArgs,\n endpointDefinition,\n endpointName\n }) : queryArgs\n }), [queryArgs, serialize, endpointDefinition, endpointName]);\n const cache2 = useRef(incoming);\n useEffect(() => {\n if (cache2.current.serialized !== incoming.serialized) {\n cache2.current = incoming;\n }\n }, [incoming]);\n return cache2.current.serialized === incoming.serialized ? cache2.current.queryArgs : queryArgs;\n}\n\n// src/query/react/useShallowStableValue.ts\nimport { useEffect as useEffect2, useRef as useRef2 } from \"react\";\nimport { shallowEqual } from \"react-redux\";\nfunction useShallowStableValue(value) {\n const cache2 = useRef2(value);\n useEffect2(() => {\n if (!shallowEqual(cache2.current, value)) {\n cache2.current = value;\n }\n }, [value]);\n return shallowEqual(cache2.current, value) ? cache2.current : value;\n}\n\n// src/query/react/buildHooks.ts\nvar useIsomorphicLayoutEffect = typeof window !== \"undefined\" && !!window.document && !!window.document.createElement ? useLayoutEffect : useEffect3;\nvar noPendingQueryStateSelector = (selected) => {\n if (selected.isUninitialized) {\n return {\n ...selected,\n isUninitialized: false,\n isFetching: true,\n isLoading: selected.data !== void 0 ? false : true,\n status: QueryStatus.pending\n };\n }\n return selected;\n};\nfunction buildHooks({\n api,\n moduleOptions: {\n batch,\n hooks: {\n useDispatch,\n useSelector,\n useStore\n },\n unstable__sideEffectsInRender,\n createSelector: createSelector2\n },\n serializeQueryArgs,\n context\n}) {\n const usePossiblyImmediateEffect = unstable__sideEffectsInRender ? (cb) => cb() : useEffect3;\n return {\n buildQueryHooks,\n buildMutationHook,\n usePrefetch\n };\n function queryStatePreSelector(currentState, lastResult, queryArgs) {\n if (lastResult?.endpointName && currentState.isUninitialized) {\n const {\n endpointName\n } = lastResult;\n const endpointDefinition = context.endpointDefinitions[endpointName];\n if (serializeQueryArgs({\n queryArgs: lastResult.originalArgs,\n endpointDefinition,\n endpointName\n }) === serializeQueryArgs({\n queryArgs,\n endpointDefinition,\n endpointName\n }))\n lastResult = void 0;\n }\n let data = currentState.isSuccess ? currentState.data : lastResult?.data;\n if (data === void 0)\n data = currentState.data;\n const hasData = data !== void 0;\n const isFetching = currentState.isLoading;\n const isLoading = (!lastResult || lastResult.isLoading || lastResult.isUninitialized) && !hasData && isFetching;\n const isSuccess = currentState.isSuccess || isFetching && hasData;\n return {\n ...currentState,\n data,\n currentData: currentState.data,\n isFetching,\n isLoading,\n isSuccess\n };\n }\n function usePrefetch(endpointName, defaultOptions) {\n const dispatch = useDispatch();\n const stableDefaultOptions = useShallowStableValue(defaultOptions);\n return useCallback((arg, options) => dispatch(api.util.prefetch(endpointName, arg, {\n ...stableDefaultOptions,\n ...options\n })), [endpointName, dispatch, stableDefaultOptions]);\n }\n function buildQueryHooks(name) {\n const useQuerySubscription = (arg, {\n refetchOnReconnect,\n refetchOnFocus,\n refetchOnMountOrArgChange,\n skip = false,\n pollingInterval = 0,\n skipPollingIfUnfocused = false\n } = {}) => {\n const {\n initiate\n } = api.endpoints[name];\n const dispatch = useDispatch();\n const subscriptionSelectorsRef = useRef3(void 0);\n if (!subscriptionSelectorsRef.current) {\n const returnedValue = dispatch(api.internalActions.internal_getRTKQSubscriptions());\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof returnedValue !== \"object\" || typeof returnedValue?.type === \"string\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(37) : `Warning: Middleware for RTK-Query API at reducerPath \"${api.reducerPath}\" has not been added to the store.\n You must add the middleware for RTK-Query to function correctly!`);\n }\n }\n subscriptionSelectorsRef.current = returnedValue;\n }\n const stableArg = useStableQueryArgs(\n skip ? skipToken : arg,\n // Even if the user provided a per-endpoint `serializeQueryArgs` with\n // a consistent return value, _here_ we want to use the default behavior\n // so we can tell if _anything_ actually changed. Otherwise, we can end up\n // with a case where the query args did change but the serialization doesn't,\n // and then we never try to initiate a refetch.\n defaultSerializeQueryArgs,\n context.endpointDefinitions[name],\n name\n );\n const stableSubscriptionOptions = useShallowStableValue({\n refetchOnReconnect,\n refetchOnFocus,\n pollingInterval,\n skipPollingIfUnfocused\n });\n const lastRenderHadSubscription = useRef3(false);\n const promiseRef = useRef3(void 0);\n let {\n queryCacheKey,\n requestId\n } = promiseRef.current || {};\n let currentRenderHasSubscription = false;\n if (queryCacheKey && requestId) {\n currentRenderHasSubscription = subscriptionSelectorsRef.current.isRequestSubscribed(queryCacheKey, requestId);\n }\n const subscriptionRemoved = !currentRenderHasSubscription && lastRenderHadSubscription.current;\n usePossiblyImmediateEffect(() => {\n lastRenderHadSubscription.current = currentRenderHasSubscription;\n });\n usePossiblyImmediateEffect(() => {\n if (subscriptionRemoved) {\n promiseRef.current = void 0;\n }\n }, [subscriptionRemoved]);\n usePossiblyImmediateEffect(() => {\n const lastPromise = promiseRef.current;\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"removeMeOnCompilation\") {\n console.log(subscriptionRemoved);\n }\n if (stableArg === skipToken) {\n lastPromise?.unsubscribe();\n promiseRef.current = void 0;\n return;\n }\n const lastSubscriptionOptions = promiseRef.current?.subscriptionOptions;\n if (!lastPromise || lastPromise.arg !== stableArg) {\n lastPromise?.unsubscribe();\n const promise = dispatch(initiate(stableArg, {\n subscriptionOptions: stableSubscriptionOptions,\n forceRefetch: refetchOnMountOrArgChange\n }));\n promiseRef.current = promise;\n } else if (stableSubscriptionOptions !== lastSubscriptionOptions) {\n lastPromise.updateSubscriptionOptions(stableSubscriptionOptions);\n }\n }, [dispatch, initiate, refetchOnMountOrArgChange, stableArg, stableSubscriptionOptions, subscriptionRemoved]);\n useEffect3(() => {\n return () => {\n promiseRef.current?.unsubscribe();\n promiseRef.current = void 0;\n };\n }, []);\n return useMemo2(() => ({\n /**\n * A method to manually refetch data for the query\n */\n refetch: () => {\n if (!promiseRef.current)\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(38) : \"Cannot refetch a query that has not been started yet.\");\n return promiseRef.current?.refetch();\n }\n }), []);\n };\n const useLazyQuerySubscription = ({\n refetchOnReconnect,\n refetchOnFocus,\n pollingInterval = 0,\n skipPollingIfUnfocused = false\n } = {}) => {\n const {\n initiate\n } = api.endpoints[name];\n const dispatch = useDispatch();\n const [arg, setArg] = useState(UNINITIALIZED_VALUE);\n const promiseRef = useRef3(void 0);\n const stableSubscriptionOptions = useShallowStableValue({\n refetchOnReconnect,\n refetchOnFocus,\n pollingInterval,\n skipPollingIfUnfocused\n });\n usePossiblyImmediateEffect(() => {\n const lastSubscriptionOptions = promiseRef.current?.subscriptionOptions;\n if (stableSubscriptionOptions !== lastSubscriptionOptions) {\n promiseRef.current?.updateSubscriptionOptions(stableSubscriptionOptions);\n }\n }, [stableSubscriptionOptions]);\n const subscriptionOptionsRef = useRef3(stableSubscriptionOptions);\n usePossiblyImmediateEffect(() => {\n subscriptionOptionsRef.current = stableSubscriptionOptions;\n }, [stableSubscriptionOptions]);\n const trigger = useCallback(function(arg2, preferCacheValue = false) {\n let promise;\n batch(() => {\n promiseRef.current?.unsubscribe();\n promiseRef.current = promise = dispatch(initiate(arg2, {\n subscriptionOptions: subscriptionOptionsRef.current,\n forceRefetch: !preferCacheValue\n }));\n setArg(arg2);\n });\n return promise;\n }, [dispatch, initiate]);\n useEffect3(() => {\n return () => {\n promiseRef?.current?.unsubscribe();\n };\n }, []);\n useEffect3(() => {\n if (arg !== UNINITIALIZED_VALUE && !promiseRef.current) {\n trigger(arg, true);\n }\n }, [arg, trigger]);\n return useMemo2(() => [trigger, arg], [trigger, arg]);\n };\n const useQueryState = (arg, {\n skip = false,\n selectFromResult\n } = {}) => {\n const {\n select\n } = api.endpoints[name];\n const stableArg = useStableQueryArgs(skip ? skipToken : arg, serializeQueryArgs, context.endpointDefinitions[name], name);\n const lastValue = useRef3(void 0);\n const selectDefaultResult = useMemo2(() => createSelector2([select(stableArg), (_, lastResult) => lastResult, (_) => stableArg], queryStatePreSelector, {\n memoizeOptions: {\n resultEqualityCheck: shallowEqual2\n }\n }), [select, stableArg]);\n const querySelector = useMemo2(() => selectFromResult ? createSelector2([selectDefaultResult], selectFromResult, {\n devModeChecks: {\n identityFunctionCheck: \"never\"\n }\n }) : selectDefaultResult, [selectDefaultResult, selectFromResult]);\n const currentState = useSelector((state) => querySelector(state, lastValue.current), shallowEqual2);\n const store = useStore();\n const newLastValue = selectDefaultResult(store.getState(), lastValue.current);\n useIsomorphicLayoutEffect(() => {\n lastValue.current = newLastValue;\n }, [newLastValue]);\n return currentState;\n };\n return {\n useQueryState,\n useQuerySubscription,\n useLazyQuerySubscription,\n useLazyQuery(options) {\n const [trigger, arg] = useLazyQuerySubscription(options);\n const queryStateResults = useQueryState(arg, {\n ...options,\n skip: arg === UNINITIALIZED_VALUE\n });\n const info = useMemo2(() => ({\n lastArg: arg\n }), [arg]);\n return useMemo2(() => [trigger, queryStateResults, info], [trigger, queryStateResults, info]);\n },\n useQuery(arg, options) {\n const querySubscriptionResults = useQuerySubscription(arg, options);\n const queryStateResults = useQueryState(arg, {\n selectFromResult: arg === skipToken || options?.skip ? void 0 : noPendingQueryStateSelector,\n ...options\n });\n const {\n data,\n status,\n isLoading,\n isSuccess,\n isError,\n error\n } = queryStateResults;\n useDebugValue({\n data,\n status,\n isLoading,\n isSuccess,\n isError,\n error\n });\n return useMemo2(() => ({\n ...queryStateResults,\n ...querySubscriptionResults\n }), [queryStateResults, querySubscriptionResults]);\n }\n };\n }\n function buildMutationHook(name) {\n return ({\n selectFromResult,\n fixedCacheKey\n } = {}) => {\n const {\n select,\n initiate\n } = api.endpoints[name];\n const dispatch = useDispatch();\n const [promise, setPromise] = useState();\n useEffect3(() => () => {\n if (!promise?.arg.fixedCacheKey) {\n promise?.reset();\n }\n }, [promise]);\n const triggerMutation = useCallback(function(arg) {\n const promise2 = dispatch(initiate(arg, {\n fixedCacheKey\n }));\n setPromise(promise2);\n return promise2;\n }, [dispatch, initiate, fixedCacheKey]);\n const {\n requestId\n } = promise || {};\n const selectDefaultResult = useMemo2(() => select({\n fixedCacheKey,\n requestId: promise?.requestId\n }), [fixedCacheKey, promise, select]);\n const mutationSelector = useMemo2(() => selectFromResult ? createSelector2([selectDefaultResult], selectFromResult) : selectDefaultResult, [selectFromResult, selectDefaultResult]);\n const currentState = useSelector(mutationSelector, shallowEqual2);\n const originalArgs = fixedCacheKey == null ? promise?.arg.originalArgs : void 0;\n const reset = useCallback(() => {\n batch(() => {\n if (promise) {\n setPromise(void 0);\n }\n if (fixedCacheKey) {\n dispatch(api.internalActions.removeMutationResult({\n requestId,\n fixedCacheKey\n }));\n }\n });\n }, [dispatch, fixedCacheKey, promise, requestId]);\n const {\n endpointName,\n data,\n status,\n isLoading,\n isSuccess,\n isError,\n error\n } = currentState;\n useDebugValue({\n endpointName,\n data,\n status,\n isLoading,\n isSuccess,\n isError,\n error\n });\n const finalState = useMemo2(() => ({\n ...currentState,\n originalArgs,\n reset\n }), [currentState, originalArgs, reset]);\n return useMemo2(() => [triggerMutation, finalState], [triggerMutation, finalState]);\n };\n }\n}\n\n// src/query/react/module.ts\nimport { batch as rrBatch, useDispatch as rrUseDispatch, useSelector as rrUseSelector, useStore as rrUseStore } from \"react-redux\";\nimport { createSelector as _createSelector } from \"reselect\";\n\n// src/query/utils/countObjectKeys.ts\nfunction countObjectKeys(obj) {\n let count = 0;\n for (const _key in obj) {\n count++;\n }\n return count;\n}\n\n// src/query/react/module.ts\nvar reactHooksModuleName = /* @__PURE__ */ Symbol();\nvar reactHooksModule = ({\n batch = rrBatch,\n hooks = {\n useDispatch: rrUseDispatch,\n useSelector: rrUseSelector,\n useStore: rrUseStore\n },\n createSelector: createSelector2 = _createSelector,\n unstable__sideEffectsInRender = false,\n ...rest\n} = {}) => {\n if (process.env.NODE_ENV !== \"production\") {\n const hookNames = [\"useDispatch\", \"useSelector\", \"useStore\"];\n let warned = false;\n for (const hookName of hookNames) {\n if (countObjectKeys(rest) > 0) {\n if (rest[hookName]) {\n if (!warned) {\n console.warn(\"As of RTK 2.0, the hooks now need to be specified as one object, provided under a `hooks` key:\\n`reactHooksModule({ hooks: { useDispatch, useSelector, useStore } })`\");\n warned = true;\n }\n }\n hooks[hookName] = rest[hookName];\n }\n if (typeof hooks[hookName] !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage3(36) : `When using custom hooks for context, all ${hookNames.length} hooks need to be provided: ${hookNames.join(\", \")}.\nHook ${hookName} was either not provided or not a function.`);\n }\n }\n }\n return {\n name: reactHooksModuleName,\n init(api, {\n serializeQueryArgs\n }, context) {\n const anyApi = api;\n const {\n buildQueryHooks,\n buildMutationHook,\n usePrefetch\n } = buildHooks({\n api,\n moduleOptions: {\n batch,\n hooks,\n unstable__sideEffectsInRender,\n createSelector: createSelector2\n },\n serializeQueryArgs,\n context\n });\n safeAssign(anyApi, {\n usePrefetch\n });\n safeAssign(context, {\n batch\n });\n return {\n injectEndpoint(endpointName, definition) {\n if (isQueryDefinition(definition)) {\n const {\n useQuery,\n useLazyQuery,\n useLazyQuerySubscription,\n useQueryState,\n useQuerySubscription\n } = buildQueryHooks(endpointName);\n safeAssign(anyApi.endpoints[endpointName], {\n useQuery,\n useLazyQuery,\n useLazyQuerySubscription,\n useQueryState,\n useQuerySubscription\n });\n api[`use${capitalize(endpointName)}Query`] = useQuery;\n api[`useLazy${capitalize(endpointName)}Query`] = useLazyQuery;\n } else if (isMutationDefinition(definition)) {\n const useMutation = buildMutationHook(endpointName);\n safeAssign(anyApi.endpoints[endpointName], {\n useMutation\n });\n api[`use${capitalize(endpointName)}Mutation`] = useMutation;\n }\n }\n };\n }\n };\n};\n\n// src/query/react/index.ts\nexport * from \"@reduxjs/toolkit/query\";\n\n// src/query/react/ApiProvider.tsx\nimport { formatProdErrorMessage as _formatProdErrorMessage4 } from \"@reduxjs/toolkit\";\nimport { configureStore } from \"@reduxjs/toolkit\";\nimport { useContext } from \"react\";\nimport { useEffect as useEffect4 } from \"react\";\nimport React from \"react\";\nimport { Provider, ReactReduxContext } from \"react-redux\";\nimport { setupListeners } from \"@reduxjs/toolkit/query\";\nfunction ApiProvider(props) {\n const context = props.context || ReactReduxContext;\n const existingContext = useContext(context);\n if (existingContext) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage4(35) : \"Existing Redux context detected. If you already have a store set up, please use the traditional Redux setup.\");\n }\n const [store] = React.useState(() => configureStore({\n reducer: {\n [props.api.reducerPath]: props.api.reducer\n },\n middleware: (gDM) => gDM().concat(props.api.middleware)\n }));\n useEffect4(() => props.setupListeners === false ? void 0 : setupListeners(store.dispatch, props.setupListeners), [props.setupListeners, store.dispatch]);\n return /* @__PURE__ */ React.createElement(Provider, { store, context }, props.children);\n}\n\n// src/query/react/index.ts\nvar createApi = /* @__PURE__ */ buildCreateApi(coreModule(), reactHooksModule());\nexport {\n ApiProvider,\n createApi,\n reactHooksModule,\n reactHooksModuleName\n};\n//# sourceMappingURL=rtk-query-react.modern.mjs.map","// src/query/core/apiState.ts\nvar QueryStatus = /* @__PURE__ */ ((QueryStatus2) => {\n QueryStatus2[\"uninitialized\"] = \"uninitialized\";\n QueryStatus2[\"pending\"] = \"pending\";\n QueryStatus2[\"fulfilled\"] = \"fulfilled\";\n QueryStatus2[\"rejected\"] = \"rejected\";\n return QueryStatus2;\n})(QueryStatus || {});\nfunction getRequestStatusFlags(status) {\n return {\n status,\n isUninitialized: status === \"uninitialized\" /* uninitialized */,\n isLoading: status === \"pending\" /* pending */,\n isSuccess: status === \"fulfilled\" /* fulfilled */,\n isError: status === \"rejected\" /* rejected */\n };\n}\n\n// src/query/utils/isAbsoluteUrl.ts\nfunction isAbsoluteUrl(url) {\n return new RegExp(`(^|:)//`).test(url);\n}\n\n// src/query/utils/joinUrls.ts\nvar withoutTrailingSlash = (url) => url.replace(/\\/$/, \"\");\nvar withoutLeadingSlash = (url) => url.replace(/^\\//, \"\");\nfunction joinUrls(base, url) {\n if (!base) {\n return url;\n }\n if (!url) {\n return base;\n }\n if (isAbsoluteUrl(url)) {\n return url;\n }\n const delimiter = base.endsWith(\"/\") || !url.startsWith(\"?\") ? \"/\" : \"\";\n base = withoutTrailingSlash(base);\n url = withoutLeadingSlash(url);\n return `${base}${delimiter}${url}`;\n}\n\n// src/query/utils/flatten.ts\nvar flatten = (arr) => [].concat(...arr);\n\n// src/query/utils/isOnline.ts\nfunction isOnline() {\n return typeof navigator === \"undefined\" ? true : navigator.onLine === void 0 ? true : navigator.onLine;\n}\n\n// src/query/utils/isDocumentVisible.ts\nfunction isDocumentVisible() {\n if (typeof document === \"undefined\") {\n return true;\n }\n return document.visibilityState !== \"hidden\";\n}\n\n// src/query/core/rtkImports.ts\nimport { createAction, createSlice, createSelector, createAsyncThunk, combineReducers, createNextState, isAnyOf, isAllOf, isAction, isPending, isRejected, isFulfilled, isRejectedWithValue, isAsyncThunkAction, prepareAutoBatched, SHOULD_AUTOBATCH, isPlainObject, nanoid } from \"@reduxjs/toolkit\";\n\n// src/query/utils/copyWithStructuralSharing.ts\nvar isPlainObject2 = isPlainObject;\nfunction copyWithStructuralSharing(oldObj, newObj) {\n if (oldObj === newObj || !(isPlainObject2(oldObj) && isPlainObject2(newObj) || Array.isArray(oldObj) && Array.isArray(newObj))) {\n return newObj;\n }\n const newKeys = Object.keys(newObj);\n const oldKeys = Object.keys(oldObj);\n let isSameObject = newKeys.length === oldKeys.length;\n const mergeObj = Array.isArray(newObj) ? [] : {};\n for (const key of newKeys) {\n mergeObj[key] = copyWithStructuralSharing(oldObj[key], newObj[key]);\n if (isSameObject)\n isSameObject = oldObj[key] === mergeObj[key];\n }\n return isSameObject ? oldObj : mergeObj;\n}\n\n// src/query/fetchBaseQuery.ts\nvar defaultFetchFn = (...args) => fetch(...args);\nvar defaultValidateStatus = (response) => response.status >= 200 && response.status <= 299;\nvar defaultIsJsonContentType = (headers) => (\n /*applicat*/\n /ion\\/(vnd\\.api\\+)?json/.test(headers.get(\"content-type\") || \"\")\n);\nfunction stripUndefined(obj) {\n if (!isPlainObject(obj)) {\n return obj;\n }\n const copy = {\n ...obj\n };\n for (const [k, v] of Object.entries(copy)) {\n if (v === void 0)\n delete copy[k];\n }\n return copy;\n}\nfunction fetchBaseQuery({\n baseUrl,\n prepareHeaders = (x) => x,\n fetchFn = defaultFetchFn,\n paramsSerializer,\n isJsonContentType = defaultIsJsonContentType,\n jsonContentType = \"application/json\",\n jsonReplacer,\n timeout: defaultTimeout,\n responseHandler: globalResponseHandler,\n validateStatus: globalValidateStatus,\n ...baseFetchOptions\n} = {}) {\n if (typeof fetch === \"undefined\" && fetchFn === defaultFetchFn) {\n console.warn(\"Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments.\");\n }\n return async (arg, api) => {\n const {\n signal,\n getState,\n extra,\n endpoint,\n forced,\n type\n } = api;\n let meta;\n let {\n url,\n headers = new Headers(baseFetchOptions.headers),\n params = void 0,\n responseHandler = globalResponseHandler ?? \"json\",\n validateStatus = globalValidateStatus ?? defaultValidateStatus,\n timeout = defaultTimeout,\n ...rest\n } = typeof arg == \"string\" ? {\n url: arg\n } : arg;\n let config = {\n ...baseFetchOptions,\n signal,\n ...rest\n };\n headers = new Headers(stripUndefined(headers));\n config.headers = await prepareHeaders(headers, {\n getState,\n extra,\n endpoint,\n forced,\n type\n }) || headers;\n const isJsonifiable = (body) => typeof body === \"object\" && (isPlainObject(body) || Array.isArray(body) || typeof body.toJSON === \"function\");\n if (!config.headers.has(\"content-type\") && isJsonifiable(config.body)) {\n config.headers.set(\"content-type\", jsonContentType);\n }\n if (isJsonifiable(config.body) && isJsonContentType(config.headers)) {\n config.body = JSON.stringify(config.body, jsonReplacer);\n }\n if (params) {\n const divider = ~url.indexOf(\"?\") ? \"&\" : \"?\";\n const query = paramsSerializer ? paramsSerializer(params) : new URLSearchParams(stripUndefined(params));\n url += divider + query;\n }\n url = joinUrls(baseUrl, url);\n const request = new Request(url, config);\n const requestClone = new Request(url, config);\n meta = {\n request: requestClone\n };\n let response, timedOut = false, timeoutId = timeout && setTimeout(() => {\n timedOut = true;\n api.abort();\n }, timeout);\n try {\n response = await fetchFn(request);\n } catch (e) {\n return {\n error: {\n status: timedOut ? \"TIMEOUT_ERROR\" : \"FETCH_ERROR\",\n error: String(e)\n },\n meta\n };\n } finally {\n if (timeoutId)\n clearTimeout(timeoutId);\n }\n const responseClone = response.clone();\n meta.response = responseClone;\n let resultData;\n let responseText = \"\";\n try {\n let handleResponseError;\n await Promise.all([\n handleResponse(response, responseHandler).then((r) => resultData = r, (e) => handleResponseError = e),\n // see https://github.com/node-fetch/node-fetch/issues/665#issuecomment-538995182\n // we *have* to \"use up\" both streams at the same time or they will stop running in node-fetch scenarios\n responseClone.text().then((r) => responseText = r, () => {\n })\n ]);\n if (handleResponseError)\n throw handleResponseError;\n } catch (e) {\n return {\n error: {\n status: \"PARSING_ERROR\",\n originalStatus: response.status,\n data: responseText,\n error: String(e)\n },\n meta\n };\n }\n return validateStatus(response, resultData) ? {\n data: resultData,\n meta\n } : {\n error: {\n status: response.status,\n data: resultData\n },\n meta\n };\n };\n async function handleResponse(response, responseHandler) {\n if (typeof responseHandler === \"function\") {\n return responseHandler(response);\n }\n if (responseHandler === \"content-type\") {\n responseHandler = isJsonContentType(response.headers) ? \"json\" : \"text\";\n }\n if (responseHandler === \"json\") {\n const text = await response.text();\n return text.length ? JSON.parse(text) : null;\n }\n return response.text();\n }\n}\n\n// src/query/HandledError.ts\nvar HandledError = class {\n constructor(value, meta = void 0) {\n this.value = value;\n this.meta = meta;\n }\n};\n\n// src/query/retry.ts\nasync function defaultBackoff(attempt = 0, maxRetries = 5) {\n const attempts = Math.min(attempt, maxRetries);\n const timeout = ~~((Math.random() + 0.4) * (300 << attempts));\n await new Promise((resolve) => setTimeout((res) => resolve(res), timeout));\n}\nfunction fail(e) {\n throw Object.assign(new HandledError({\n error: e\n }), {\n throwImmediately: true\n });\n}\nvar EMPTY_OPTIONS = {};\nvar retryWithBackoff = (baseQuery, defaultOptions) => async (args, api, extraOptions) => {\n const possibleMaxRetries = [5, (defaultOptions || EMPTY_OPTIONS).maxRetries, (extraOptions || EMPTY_OPTIONS).maxRetries].filter((x) => x !== void 0);\n const [maxRetries] = possibleMaxRetries.slice(-1);\n const defaultRetryCondition = (_, __, {\n attempt\n }) => attempt <= maxRetries;\n const options = {\n maxRetries,\n backoff: defaultBackoff,\n retryCondition: defaultRetryCondition,\n ...defaultOptions,\n ...extraOptions\n };\n let retry2 = 0;\n while (true) {\n try {\n const result = await baseQuery(args, api, extraOptions);\n if (result.error) {\n throw new HandledError(result);\n }\n return result;\n } catch (e) {\n retry2++;\n if (e.throwImmediately) {\n if (e instanceof HandledError) {\n return e.value;\n }\n throw e;\n }\n if (e instanceof HandledError && !options.retryCondition(e.value.error, args, {\n attempt: retry2,\n baseQueryApi: api,\n extraOptions\n })) {\n return e.value;\n }\n await options.backoff(retry2, options.maxRetries);\n }\n }\n};\nvar retry = /* @__PURE__ */ Object.assign(retryWithBackoff, {\n fail\n});\n\n// src/query/core/setupListeners.ts\nvar onFocus = /* @__PURE__ */ createAction(\"__rtkq/focused\");\nvar onFocusLost = /* @__PURE__ */ createAction(\"__rtkq/unfocused\");\nvar onOnline = /* @__PURE__ */ createAction(\"__rtkq/online\");\nvar onOffline = /* @__PURE__ */ createAction(\"__rtkq/offline\");\nvar initialized = false;\nfunction setupListeners(dispatch, customHandler) {\n function defaultHandler() {\n const handleFocus = () => dispatch(onFocus());\n const handleFocusLost = () => dispatch(onFocusLost());\n const handleOnline = () => dispatch(onOnline());\n const handleOffline = () => dispatch(onOffline());\n const handleVisibilityChange = () => {\n if (window.document.visibilityState === \"visible\") {\n handleFocus();\n } else {\n handleFocusLost();\n }\n };\n if (!initialized) {\n if (typeof window !== \"undefined\" && window.addEventListener) {\n window.addEventListener(\"visibilitychange\", handleVisibilityChange, false);\n window.addEventListener(\"focus\", handleFocus, false);\n window.addEventListener(\"online\", handleOnline, false);\n window.addEventListener(\"offline\", handleOffline, false);\n initialized = true;\n }\n }\n const unsubscribe = () => {\n window.removeEventListener(\"focus\", handleFocus);\n window.removeEventListener(\"visibilitychange\", handleVisibilityChange);\n window.removeEventListener(\"online\", handleOnline);\n window.removeEventListener(\"offline\", handleOffline);\n initialized = false;\n };\n return unsubscribe;\n }\n return customHandler ? customHandler(dispatch, {\n onFocus,\n onFocusLost,\n onOffline,\n onOnline\n }) : defaultHandler();\n}\n\n// src/query/endpointDefinitions.ts\nfunction isQueryDefinition(e) {\n return e.type === \"query\" /* query */;\n}\nfunction isMutationDefinition(e) {\n return e.type === \"mutation\" /* mutation */;\n}\nfunction calculateProvidedBy(description, result, error, queryArg, meta, assertTagTypes) {\n if (isFunction(description)) {\n return description(result, error, queryArg, meta).map(expandTagDescription).map(assertTagTypes);\n }\n if (Array.isArray(description)) {\n return description.map(expandTagDescription).map(assertTagTypes);\n }\n return [];\n}\nfunction isFunction(t) {\n return typeof t === \"function\";\n}\nfunction expandTagDescription(description) {\n return typeof description === \"string\" ? {\n type: description\n } : description;\n}\n\n// src/query/core/buildInitiate.ts\nimport { formatProdErrorMessage as _formatProdErrorMessage } from \"@reduxjs/toolkit\";\n\n// src/query/utils/isNotNullish.ts\nfunction isNotNullish(v) {\n return v != null;\n}\n\n// src/query/utils/countObjectKeys.ts\nfunction countObjectKeys(obj) {\n let count = 0;\n for (const _key in obj) {\n count++;\n }\n return count;\n}\n\n// src/tsHelpers.ts\nfunction asSafePromise(promise, fallback) {\n return promise.catch(fallback);\n}\n\n// src/query/core/buildInitiate.ts\nvar forceQueryFnSymbol = Symbol(\"forceQueryFn\");\nvar isUpsertQuery = (arg) => typeof arg[forceQueryFnSymbol] === \"function\";\nfunction buildInitiate({\n serializeQueryArgs,\n queryThunk,\n mutationThunk,\n api,\n context\n}) {\n const runningQueries = /* @__PURE__ */ new Map();\n const runningMutations = /* @__PURE__ */ new Map();\n const {\n unsubscribeQueryResult,\n removeMutationResult,\n updateSubscriptionOptions\n } = api.internalActions;\n return {\n buildInitiateQuery,\n buildInitiateMutation,\n getRunningQueryThunk,\n getRunningMutationThunk,\n getRunningQueriesThunk,\n getRunningMutationsThunk\n };\n function getRunningQueryThunk(endpointName, queryArgs) {\n return (dispatch) => {\n const endpointDefinition = context.endpointDefinitions[endpointName];\n const queryCacheKey = serializeQueryArgs({\n queryArgs,\n endpointDefinition,\n endpointName\n });\n return runningQueries.get(dispatch)?.[queryCacheKey];\n };\n }\n function getRunningMutationThunk(_endpointName, fixedCacheKeyOrRequestId) {\n return (dispatch) => {\n return runningMutations.get(dispatch)?.[fixedCacheKeyOrRequestId];\n };\n }\n function getRunningQueriesThunk() {\n return (dispatch) => Object.values(runningQueries.get(dispatch) || {}).filter(isNotNullish);\n }\n function getRunningMutationsThunk() {\n return (dispatch) => Object.values(runningMutations.get(dispatch) || {}).filter(isNotNullish);\n }\n function middlewareWarning(dispatch) {\n if (process.env.NODE_ENV !== \"production\") {\n if (middlewareWarning.triggered)\n return;\n const returnedValue = dispatch(api.internalActions.internal_getRTKQSubscriptions());\n middlewareWarning.triggered = true;\n if (typeof returnedValue !== \"object\" || typeof returnedValue?.type === \"string\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(34) : `Warning: Middleware for RTK-Query API at reducerPath \"${api.reducerPath}\" has not been added to the store.\nYou must add the middleware for RTK-Query to function correctly!`);\n }\n }\n }\n function buildInitiateQuery(endpointName, endpointDefinition) {\n const queryAction = (arg, {\n subscribe = true,\n forceRefetch,\n subscriptionOptions,\n [forceQueryFnSymbol]: forceQueryFn,\n ...rest\n } = {}) => (dispatch, getState) => {\n const queryCacheKey = serializeQueryArgs({\n queryArgs: arg,\n endpointDefinition,\n endpointName\n });\n const thunk = queryThunk({\n ...rest,\n type: \"query\",\n subscribe,\n forceRefetch,\n subscriptionOptions,\n endpointName,\n originalArgs: arg,\n queryCacheKey,\n [forceQueryFnSymbol]: forceQueryFn\n });\n const selector = api.endpoints[endpointName].select(arg);\n const thunkResult = dispatch(thunk);\n const stateAfter = selector(getState());\n middlewareWarning(dispatch);\n const {\n requestId,\n abort\n } = thunkResult;\n const skippedSynchronously = stateAfter.requestId !== requestId;\n const runningQuery = runningQueries.get(dispatch)?.[queryCacheKey];\n const selectFromState = () => selector(getState());\n const statePromise = Object.assign(forceQueryFn ? (\n // a query has been forced (upsertQueryData)\n // -> we want to resolve it once data has been written with the data that will be written\n thunkResult.then(selectFromState)\n ) : skippedSynchronously && !runningQuery ? (\n // a query has been skipped due to a condition and we do not have any currently running query\n // -> we want to resolve it immediately with the current data\n Promise.resolve(stateAfter)\n ) : (\n // query just started or one is already in flight\n // -> wait for the running query, then resolve with data from after that\n Promise.all([runningQuery, thunkResult]).then(selectFromState)\n ), {\n arg,\n requestId,\n subscriptionOptions,\n queryCacheKey,\n abort,\n async unwrap() {\n const result = await statePromise;\n if (result.isError) {\n throw result.error;\n }\n return result.data;\n },\n refetch: () => dispatch(queryAction(arg, {\n subscribe: false,\n forceRefetch: true\n })),\n unsubscribe() {\n if (subscribe)\n dispatch(unsubscribeQueryResult({\n queryCacheKey,\n requestId\n }));\n },\n updateSubscriptionOptions(options) {\n statePromise.subscriptionOptions = options;\n dispatch(updateSubscriptionOptions({\n endpointName,\n requestId,\n queryCacheKey,\n options\n }));\n }\n });\n if (!runningQuery && !skippedSynchronously && !forceQueryFn) {\n const running = runningQueries.get(dispatch) || {};\n running[queryCacheKey] = statePromise;\n runningQueries.set(dispatch, running);\n statePromise.then(() => {\n delete running[queryCacheKey];\n if (!countObjectKeys(running)) {\n runningQueries.delete(dispatch);\n }\n });\n }\n return statePromise;\n };\n return queryAction;\n }\n function buildInitiateMutation(endpointName) {\n return (arg, {\n track = true,\n fixedCacheKey\n } = {}) => (dispatch, getState) => {\n const thunk = mutationThunk({\n type: \"mutation\",\n endpointName,\n originalArgs: arg,\n track,\n fixedCacheKey\n });\n const thunkResult = dispatch(thunk);\n middlewareWarning(dispatch);\n const {\n requestId,\n abort,\n unwrap\n } = thunkResult;\n const returnValuePromise = asSafePromise(thunkResult.unwrap().then((data) => ({\n data\n })), (error) => ({\n error\n }));\n const reset = () => {\n dispatch(removeMutationResult({\n requestId,\n fixedCacheKey\n }));\n };\n const ret = Object.assign(returnValuePromise, {\n arg: thunkResult.arg,\n requestId,\n abort,\n unwrap,\n reset\n });\n const running = runningMutations.get(dispatch) || {};\n runningMutations.set(dispatch, running);\n running[requestId] = ret;\n ret.then(() => {\n delete running[requestId];\n if (!countObjectKeys(running)) {\n runningMutations.delete(dispatch);\n }\n });\n if (fixedCacheKey) {\n running[fixedCacheKey] = ret;\n ret.then(() => {\n if (running[fixedCacheKey] === ret) {\n delete running[fixedCacheKey];\n if (!countObjectKeys(running)) {\n runningMutations.delete(dispatch);\n }\n }\n });\n }\n return ret;\n };\n }\n}\n\n// src/query/core/buildThunks.ts\nimport { isDraftable, produceWithPatches } from \"immer\";\nfunction defaultTransformResponse(baseQueryReturnValue) {\n return baseQueryReturnValue;\n}\nfunction buildThunks({\n reducerPath,\n baseQuery,\n context: {\n endpointDefinitions\n },\n serializeQueryArgs,\n api,\n assertTagType\n}) {\n const patchQueryData = (endpointName, args, patches, updateProvided) => (dispatch, getState) => {\n const endpointDefinition = endpointDefinitions[endpointName];\n const queryCacheKey = serializeQueryArgs({\n queryArgs: args,\n endpointDefinition,\n endpointName\n });\n dispatch(api.internalActions.queryResultPatched({\n queryCacheKey,\n patches\n }));\n if (!updateProvided) {\n return;\n }\n const newValue = api.endpoints[endpointName].select(args)(\n // Work around TS 4.1 mismatch\n getState()\n );\n const providedTags = calculateProvidedBy(endpointDefinition.providesTags, newValue.data, void 0, args, {}, assertTagType);\n dispatch(api.internalActions.updateProvidedBy({\n queryCacheKey,\n providedTags\n }));\n };\n const updateQueryData = (endpointName, args, updateRecipe, updateProvided = true) => (dispatch, getState) => {\n const endpointDefinition = api.endpoints[endpointName];\n const currentState = endpointDefinition.select(args)(\n // Work around TS 4.1 mismatch\n getState()\n );\n let ret = {\n patches: [],\n inversePatches: [],\n undo: () => dispatch(api.util.patchQueryData(endpointName, args, ret.inversePatches, updateProvided))\n };\n if (currentState.status === \"uninitialized\" /* uninitialized */) {\n return ret;\n }\n let newValue;\n if (\"data\" in currentState) {\n if (isDraftable(currentState.data)) {\n const [value, patches, inversePatches] = produceWithPatches(currentState.data, updateRecipe);\n ret.patches.push(...patches);\n ret.inversePatches.push(...inversePatches);\n newValue = value;\n } else {\n newValue = updateRecipe(currentState.data);\n ret.patches.push({\n op: \"replace\",\n path: [],\n value: newValue\n });\n ret.inversePatches.push({\n op: \"replace\",\n path: [],\n value: currentState.data\n });\n }\n }\n if (ret.patches.length === 0) {\n return ret;\n }\n dispatch(api.util.patchQueryData(endpointName, args, ret.patches, updateProvided));\n return ret;\n };\n const upsertQueryData = (endpointName, args, value) => (dispatch) => {\n return dispatch(api.endpoints[endpointName].initiate(args, {\n subscribe: false,\n forceRefetch: true,\n [forceQueryFnSymbol]: () => ({\n data: value\n })\n }));\n };\n const executeEndpoint = async (arg, {\n signal,\n abort,\n rejectWithValue,\n fulfillWithValue,\n dispatch,\n getState,\n extra\n }) => {\n const endpointDefinition = endpointDefinitions[arg.endpointName];\n try {\n let transformResponse = defaultTransformResponse;\n let result;\n const baseQueryApi = {\n signal,\n abort,\n dispatch,\n getState,\n extra,\n endpoint: arg.endpointName,\n type: arg.type,\n forced: arg.type === \"query\" ? isForcedQuery(arg, getState()) : void 0\n };\n const forceQueryFn = arg.type === \"query\" ? arg[forceQueryFnSymbol] : void 0;\n if (forceQueryFn) {\n result = forceQueryFn();\n } else if (endpointDefinition.query) {\n result = await baseQuery(endpointDefinition.query(arg.originalArgs), baseQueryApi, endpointDefinition.extraOptions);\n if (endpointDefinition.transformResponse) {\n transformResponse = endpointDefinition.transformResponse;\n }\n } else {\n result = await endpointDefinition.queryFn(arg.originalArgs, baseQueryApi, endpointDefinition.extraOptions, (arg2) => baseQuery(arg2, baseQueryApi, endpointDefinition.extraOptions));\n }\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n const what = endpointDefinition.query ? \"`baseQuery`\" : \"`queryFn`\";\n let err;\n if (!result) {\n err = `${what} did not return anything.`;\n } else if (typeof result !== \"object\") {\n err = `${what} did not return an object.`;\n } else if (result.error && result.data) {\n err = `${what} returned an object containing both \\`error\\` and \\`result\\`.`;\n } else if (result.error === void 0 && result.data === void 0) {\n err = `${what} returned an object containing neither a valid \\`error\\` and \\`result\\`. At least one of them should not be \\`undefined\\``;\n } else {\n for (const key of Object.keys(result)) {\n if (key !== \"error\" && key !== \"data\" && key !== \"meta\") {\n err = `The object returned by ${what} has the unknown property ${key}.`;\n break;\n }\n }\n }\n if (err) {\n console.error(`Error encountered handling the endpoint ${arg.endpointName}.\n ${err}\n It needs to return an object with either the shape \\`{ data: }\\` or \\`{ error: }\\` that may contain an optional \\`meta\\` property.\n Object returned was:`, result);\n }\n }\n if (result.error)\n throw new HandledError(result.error, result.meta);\n return fulfillWithValue(await transformResponse(result.data, result.meta, arg.originalArgs), {\n fulfilledTimeStamp: Date.now(),\n baseQueryMeta: result.meta,\n [SHOULD_AUTOBATCH]: true\n });\n } catch (error) {\n let catchedError = error;\n if (catchedError instanceof HandledError) {\n let transformErrorResponse = defaultTransformResponse;\n if (endpointDefinition.query && endpointDefinition.transformErrorResponse) {\n transformErrorResponse = endpointDefinition.transformErrorResponse;\n }\n try {\n return rejectWithValue(await transformErrorResponse(catchedError.value, catchedError.meta, arg.originalArgs), {\n baseQueryMeta: catchedError.meta,\n [SHOULD_AUTOBATCH]: true\n });\n } catch (e) {\n catchedError = e;\n }\n }\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n console.error(`An unhandled error occurred processing a request for the endpoint \"${arg.endpointName}\".\nIn the case of an unhandled error, no tags will be \"provided\" or \"invalidated\".`, catchedError);\n } else {\n console.error(catchedError);\n }\n throw catchedError;\n }\n };\n function isForcedQuery(arg, state) {\n const requestState = state[reducerPath]?.queries?.[arg.queryCacheKey];\n const baseFetchOnMountOrArgChange = state[reducerPath]?.config.refetchOnMountOrArgChange;\n const fulfilledVal = requestState?.fulfilledTimeStamp;\n const refetchVal = arg.forceRefetch ?? (arg.subscribe && baseFetchOnMountOrArgChange);\n if (refetchVal) {\n return refetchVal === true || (Number(/* @__PURE__ */ new Date()) - Number(fulfilledVal)) / 1e3 >= refetchVal;\n }\n return false;\n }\n const queryThunk = createAsyncThunk(`${reducerPath}/executeQuery`, executeEndpoint, {\n getPendingMeta() {\n return {\n startedTimeStamp: Date.now(),\n [SHOULD_AUTOBATCH]: true\n };\n },\n condition(queryThunkArgs, {\n getState\n }) {\n const state = getState();\n const requestState = state[reducerPath]?.queries?.[queryThunkArgs.queryCacheKey];\n const fulfilledVal = requestState?.fulfilledTimeStamp;\n const currentArg = queryThunkArgs.originalArgs;\n const previousArg = requestState?.originalArgs;\n const endpointDefinition = endpointDefinitions[queryThunkArgs.endpointName];\n if (isUpsertQuery(queryThunkArgs)) {\n return true;\n }\n if (requestState?.status === \"pending\") {\n return false;\n }\n if (isForcedQuery(queryThunkArgs, state)) {\n return true;\n }\n if (isQueryDefinition(endpointDefinition) && endpointDefinition?.forceRefetch?.({\n currentArg,\n previousArg,\n endpointState: requestState,\n state\n })) {\n return true;\n }\n if (fulfilledVal) {\n return false;\n }\n return true;\n },\n dispatchConditionRejection: true\n });\n const mutationThunk = createAsyncThunk(`${reducerPath}/executeMutation`, executeEndpoint, {\n getPendingMeta() {\n return {\n startedTimeStamp: Date.now(),\n [SHOULD_AUTOBATCH]: true\n };\n }\n });\n const hasTheForce = (options) => \"force\" in options;\n const hasMaxAge = (options) => \"ifOlderThan\" in options;\n const prefetch = (endpointName, arg, options) => (dispatch, getState) => {\n const force = hasTheForce(options) && options.force;\n const maxAge = hasMaxAge(options) && options.ifOlderThan;\n const queryAction = (force2 = true) => {\n const options2 = {\n forceRefetch: force2,\n isPrefetch: true\n };\n return api.endpoints[endpointName].initiate(arg, options2);\n };\n const latestStateValue = api.endpoints[endpointName].select(arg)(getState());\n if (force) {\n dispatch(queryAction());\n } else if (maxAge) {\n const lastFulfilledTs = latestStateValue?.fulfilledTimeStamp;\n if (!lastFulfilledTs) {\n dispatch(queryAction());\n return;\n }\n const shouldRetrigger = (Number(/* @__PURE__ */ new Date()) - Number(new Date(lastFulfilledTs))) / 1e3 >= maxAge;\n if (shouldRetrigger) {\n dispatch(queryAction());\n }\n } else {\n dispatch(queryAction(false));\n }\n };\n function matchesEndpoint(endpointName) {\n return (action) => action?.meta?.arg?.endpointName === endpointName;\n }\n function buildMatchThunkActions(thunk, endpointName) {\n return {\n matchPending: isAllOf(isPending(thunk), matchesEndpoint(endpointName)),\n matchFulfilled: isAllOf(isFulfilled(thunk), matchesEndpoint(endpointName)),\n matchRejected: isAllOf(isRejected(thunk), matchesEndpoint(endpointName))\n };\n }\n return {\n queryThunk,\n mutationThunk,\n prefetch,\n updateQueryData,\n upsertQueryData,\n patchQueryData,\n buildMatchThunkActions\n };\n}\nfunction calculateProvidedByThunk(action, type, endpointDefinitions, assertTagType) {\n return calculateProvidedBy(endpointDefinitions[action.meta.arg.endpointName][type], isFulfilled(action) ? action.payload : void 0, isRejectedWithValue(action) ? action.payload : void 0, action.meta.arg.originalArgs, \"baseQueryMeta\" in action.meta ? action.meta.baseQueryMeta : void 0, assertTagType);\n}\n\n// src/query/core/buildSlice.ts\nimport { isDraft } from \"immer\";\nimport { applyPatches, original } from \"immer\";\nfunction updateQuerySubstateIfExists(state, queryCacheKey, update) {\n const substate = state[queryCacheKey];\n if (substate) {\n update(substate);\n }\n}\nfunction getMutationCacheKey(id) {\n return (\"arg\" in id ? id.arg.fixedCacheKey : id.fixedCacheKey) ?? id.requestId;\n}\nfunction updateMutationSubstateIfExists(state, id, update) {\n const substate = state[getMutationCacheKey(id)];\n if (substate) {\n update(substate);\n }\n}\nvar initialState = {};\nfunction buildSlice({\n reducerPath,\n queryThunk,\n mutationThunk,\n context: {\n endpointDefinitions: definitions,\n apiUid,\n extractRehydrationInfo,\n hasRehydrationInfo\n },\n assertTagType,\n config\n}) {\n const resetApiState = createAction(`${reducerPath}/resetApiState`);\n const querySlice = createSlice({\n name: `${reducerPath}/queries`,\n initialState,\n reducers: {\n removeQueryResult: {\n reducer(draft, {\n payload: {\n queryCacheKey\n }\n }) {\n delete draft[queryCacheKey];\n },\n prepare: prepareAutoBatched()\n },\n queryResultPatched: {\n reducer(draft, {\n payload: {\n queryCacheKey,\n patches\n }\n }) {\n updateQuerySubstateIfExists(draft, queryCacheKey, (substate) => {\n substate.data = applyPatches(substate.data, patches.concat());\n });\n },\n prepare: prepareAutoBatched()\n }\n },\n extraReducers(builder) {\n builder.addCase(queryThunk.pending, (draft, {\n meta,\n meta: {\n arg\n }\n }) => {\n const upserting = isUpsertQuery(arg);\n draft[arg.queryCacheKey] ??= {\n status: \"uninitialized\" /* uninitialized */,\n endpointName: arg.endpointName\n };\n updateQuerySubstateIfExists(draft, arg.queryCacheKey, (substate) => {\n substate.status = \"pending\" /* pending */;\n substate.requestId = upserting && substate.requestId ? (\n // for `upsertQuery` **updates**, keep the current `requestId`\n substate.requestId\n ) : (\n // for normal queries or `upsertQuery` **inserts** always update the `requestId`\n meta.requestId\n );\n if (arg.originalArgs !== void 0) {\n substate.originalArgs = arg.originalArgs;\n }\n substate.startedTimeStamp = meta.startedTimeStamp;\n });\n }).addCase(queryThunk.fulfilled, (draft, {\n meta,\n payload\n }) => {\n updateQuerySubstateIfExists(draft, meta.arg.queryCacheKey, (substate) => {\n if (substate.requestId !== meta.requestId && !isUpsertQuery(meta.arg))\n return;\n const {\n merge\n } = definitions[meta.arg.endpointName];\n substate.status = \"fulfilled\" /* fulfilled */;\n if (merge) {\n if (substate.data !== void 0) {\n const {\n fulfilledTimeStamp,\n arg,\n baseQueryMeta,\n requestId\n } = meta;\n let newData = createNextState(substate.data, (draftSubstateData) => {\n return merge(draftSubstateData, payload, {\n arg: arg.originalArgs,\n baseQueryMeta,\n fulfilledTimeStamp,\n requestId\n });\n });\n substate.data = newData;\n } else {\n substate.data = payload;\n }\n } else {\n substate.data = definitions[meta.arg.endpointName].structuralSharing ?? true ? copyWithStructuralSharing(isDraft(substate.data) ? original(substate.data) : substate.data, payload) : payload;\n }\n delete substate.error;\n substate.fulfilledTimeStamp = meta.fulfilledTimeStamp;\n });\n }).addCase(queryThunk.rejected, (draft, {\n meta: {\n condition,\n arg,\n requestId\n },\n error,\n payload\n }) => {\n updateQuerySubstateIfExists(draft, arg.queryCacheKey, (substate) => {\n if (condition) {\n } else {\n if (substate.requestId !== requestId)\n return;\n substate.status = \"rejected\" /* rejected */;\n substate.error = payload ?? error;\n }\n });\n }).addMatcher(hasRehydrationInfo, (draft, action) => {\n const {\n queries\n } = extractRehydrationInfo(action);\n for (const [key, entry] of Object.entries(queries)) {\n if (\n // do not rehydrate entries that were currently in flight.\n entry?.status === \"fulfilled\" /* fulfilled */ || entry?.status === \"rejected\" /* rejected */\n ) {\n draft[key] = entry;\n }\n }\n });\n }\n });\n const mutationSlice = createSlice({\n name: `${reducerPath}/mutations`,\n initialState,\n reducers: {\n removeMutationResult: {\n reducer(draft, {\n payload\n }) {\n const cacheKey = getMutationCacheKey(payload);\n if (cacheKey in draft) {\n delete draft[cacheKey];\n }\n },\n prepare: prepareAutoBatched()\n }\n },\n extraReducers(builder) {\n builder.addCase(mutationThunk.pending, (draft, {\n meta,\n meta: {\n requestId,\n arg,\n startedTimeStamp\n }\n }) => {\n if (!arg.track)\n return;\n draft[getMutationCacheKey(meta)] = {\n requestId,\n status: \"pending\" /* pending */,\n endpointName: arg.endpointName,\n startedTimeStamp\n };\n }).addCase(mutationThunk.fulfilled, (draft, {\n payload,\n meta\n }) => {\n if (!meta.arg.track)\n return;\n updateMutationSubstateIfExists(draft, meta, (substate) => {\n if (substate.requestId !== meta.requestId)\n return;\n substate.status = \"fulfilled\" /* fulfilled */;\n substate.data = payload;\n substate.fulfilledTimeStamp = meta.fulfilledTimeStamp;\n });\n }).addCase(mutationThunk.rejected, (draft, {\n payload,\n error,\n meta\n }) => {\n if (!meta.arg.track)\n return;\n updateMutationSubstateIfExists(draft, meta, (substate) => {\n if (substate.requestId !== meta.requestId)\n return;\n substate.status = \"rejected\" /* rejected */;\n substate.error = payload ?? error;\n });\n }).addMatcher(hasRehydrationInfo, (draft, action) => {\n const {\n mutations\n } = extractRehydrationInfo(action);\n for (const [key, entry] of Object.entries(mutations)) {\n if (\n // do not rehydrate entries that were currently in flight.\n (entry?.status === \"fulfilled\" /* fulfilled */ || entry?.status === \"rejected\" /* rejected */) && // only rehydrate endpoints that were persisted using a `fixedCacheKey`\n key !== entry?.requestId\n ) {\n draft[key] = entry;\n }\n }\n });\n }\n });\n const invalidationSlice = createSlice({\n name: `${reducerPath}/invalidation`,\n initialState,\n reducers: {\n updateProvidedBy: {\n reducer(draft, action) {\n const {\n queryCacheKey,\n providedTags\n } = action.payload;\n for (const tagTypeSubscriptions of Object.values(draft)) {\n for (const idSubscriptions of Object.values(tagTypeSubscriptions)) {\n const foundAt = idSubscriptions.indexOf(queryCacheKey);\n if (foundAt !== -1) {\n idSubscriptions.splice(foundAt, 1);\n }\n }\n }\n for (const {\n type,\n id\n } of providedTags) {\n const subscribedQueries = (draft[type] ??= {})[id || \"__internal_without_id\"] ??= [];\n const alreadySubscribed = subscribedQueries.includes(queryCacheKey);\n if (!alreadySubscribed) {\n subscribedQueries.push(queryCacheKey);\n }\n }\n },\n prepare: prepareAutoBatched()\n }\n },\n extraReducers(builder) {\n builder.addCase(querySlice.actions.removeQueryResult, (draft, {\n payload: {\n queryCacheKey\n }\n }) => {\n for (const tagTypeSubscriptions of Object.values(draft)) {\n for (const idSubscriptions of Object.values(tagTypeSubscriptions)) {\n const foundAt = idSubscriptions.indexOf(queryCacheKey);\n if (foundAt !== -1) {\n idSubscriptions.splice(foundAt, 1);\n }\n }\n }\n }).addMatcher(hasRehydrationInfo, (draft, action) => {\n const {\n provided\n } = extractRehydrationInfo(action);\n for (const [type, incomingTags] of Object.entries(provided)) {\n for (const [id, cacheKeys] of Object.entries(incomingTags)) {\n const subscribedQueries = (draft[type] ??= {})[id || \"__internal_without_id\"] ??= [];\n for (const queryCacheKey of cacheKeys) {\n const alreadySubscribed = subscribedQueries.includes(queryCacheKey);\n if (!alreadySubscribed) {\n subscribedQueries.push(queryCacheKey);\n }\n }\n }\n }\n }).addMatcher(isAnyOf(isFulfilled(queryThunk), isRejectedWithValue(queryThunk)), (draft, action) => {\n const providedTags = calculateProvidedByThunk(action, \"providesTags\", definitions, assertTagType);\n const {\n queryCacheKey\n } = action.meta.arg;\n invalidationSlice.caseReducers.updateProvidedBy(draft, invalidationSlice.actions.updateProvidedBy({\n queryCacheKey,\n providedTags\n }));\n });\n }\n });\n const subscriptionSlice = createSlice({\n name: `${reducerPath}/subscriptions`,\n initialState,\n reducers: {\n updateSubscriptionOptions(d, a) {\n },\n unsubscribeQueryResult(d, a) {\n },\n internal_getRTKQSubscriptions() {\n }\n }\n });\n const internalSubscriptionsSlice = createSlice({\n name: `${reducerPath}/internalSubscriptions`,\n initialState,\n reducers: {\n subscriptionsUpdated: {\n reducer(state, action) {\n return applyPatches(state, action.payload);\n },\n prepare: prepareAutoBatched()\n }\n }\n });\n const configSlice = createSlice({\n name: `${reducerPath}/config`,\n initialState: {\n online: isOnline(),\n focused: isDocumentVisible(),\n middlewareRegistered: false,\n ...config\n },\n reducers: {\n middlewareRegistered(state, {\n payload\n }) {\n state.middlewareRegistered = state.middlewareRegistered === \"conflict\" || apiUid !== payload ? \"conflict\" : true;\n }\n },\n extraReducers: (builder) => {\n builder.addCase(onOnline, (state) => {\n state.online = true;\n }).addCase(onOffline, (state) => {\n state.online = false;\n }).addCase(onFocus, (state) => {\n state.focused = true;\n }).addCase(onFocusLost, (state) => {\n state.focused = false;\n }).addMatcher(hasRehydrationInfo, (draft) => ({\n ...draft\n }));\n }\n });\n const combinedReducer = combineReducers({\n queries: querySlice.reducer,\n mutations: mutationSlice.reducer,\n provided: invalidationSlice.reducer,\n subscriptions: internalSubscriptionsSlice.reducer,\n config: configSlice.reducer\n });\n const reducer = (state, action) => combinedReducer(resetApiState.match(action) ? void 0 : state, action);\n const actions = {\n ...configSlice.actions,\n ...querySlice.actions,\n ...subscriptionSlice.actions,\n ...internalSubscriptionsSlice.actions,\n ...mutationSlice.actions,\n ...invalidationSlice.actions,\n resetApiState\n };\n return {\n reducer,\n actions\n };\n}\n\n// src/query/core/buildSelectors.ts\nvar skipToken = /* @__PURE__ */ Symbol.for(\"RTKQ/skipToken\");\nvar initialSubState = {\n status: \"uninitialized\" /* uninitialized */\n};\nvar defaultQuerySubState = /* @__PURE__ */ createNextState(initialSubState, () => {\n});\nvar defaultMutationSubState = /* @__PURE__ */ createNextState(initialSubState, () => {\n});\nfunction buildSelectors({\n serializeQueryArgs,\n reducerPath,\n createSelector: createSelector2\n}) {\n const selectSkippedQuery = (state) => defaultQuerySubState;\n const selectSkippedMutation = (state) => defaultMutationSubState;\n return {\n buildQuerySelector,\n buildMutationSelector,\n selectInvalidatedBy,\n selectCachedArgsForQuery\n };\n function withRequestFlags(substate) {\n return {\n ...substate,\n ...getRequestStatusFlags(substate.status)\n };\n }\n function selectInternalState(rootState) {\n const state = rootState[reducerPath];\n if (process.env.NODE_ENV !== \"production\") {\n if (!state) {\n if (selectInternalState.triggered)\n return state;\n selectInternalState.triggered = true;\n console.error(`Error: No data found at \\`state.${reducerPath}\\`. Did you forget to add the reducer to the store?`);\n }\n }\n return state;\n }\n function buildQuerySelector(endpointName, endpointDefinition) {\n return (queryArgs) => {\n const serializedArgs = serializeQueryArgs({\n queryArgs,\n endpointDefinition,\n endpointName\n });\n const selectQuerySubstate = (state) => selectInternalState(state)?.queries?.[serializedArgs] ?? defaultQuerySubState;\n const finalSelectQuerySubState = queryArgs === skipToken ? selectSkippedQuery : selectQuerySubstate;\n return createSelector2(finalSelectQuerySubState, withRequestFlags);\n };\n }\n function buildMutationSelector() {\n return (id) => {\n let mutationId;\n if (typeof id === \"object\") {\n mutationId = getMutationCacheKey(id) ?? skipToken;\n } else {\n mutationId = id;\n }\n const selectMutationSubstate = (state) => selectInternalState(state)?.mutations?.[mutationId] ?? defaultMutationSubState;\n const finalSelectMutationSubstate = mutationId === skipToken ? selectSkippedMutation : selectMutationSubstate;\n return createSelector2(finalSelectMutationSubstate, withRequestFlags);\n };\n }\n function selectInvalidatedBy(state, tags) {\n const apiState = state[reducerPath];\n const toInvalidate = /* @__PURE__ */ new Set();\n for (const tag of tags.map(expandTagDescription)) {\n const provided = apiState.provided[tag.type];\n if (!provided) {\n continue;\n }\n let invalidateSubscriptions = (tag.id !== void 0 ? (\n // id given: invalidate all queries that provide this type & id\n provided[tag.id]\n ) : (\n // no id: invalidate all queries that provide this type\n flatten(Object.values(provided))\n )) ?? [];\n for (const invalidate of invalidateSubscriptions) {\n toInvalidate.add(invalidate);\n }\n }\n return flatten(Array.from(toInvalidate.values()).map((queryCacheKey) => {\n const querySubState = apiState.queries[queryCacheKey];\n return querySubState ? [{\n queryCacheKey,\n endpointName: querySubState.endpointName,\n originalArgs: querySubState.originalArgs\n }] : [];\n }));\n }\n function selectCachedArgsForQuery(state, queryName) {\n return Object.values(state[reducerPath].queries).filter((entry) => entry?.endpointName === queryName && entry.status !== \"uninitialized\" /* uninitialized */).map((entry) => entry.originalArgs);\n }\n}\n\n// src/query/createApi.ts\nimport { formatProdErrorMessage as _formatProdErrorMessage2 } from \"@reduxjs/toolkit\";\n\n// src/query/defaultSerializeQueryArgs.ts\nvar cache = WeakMap ? /* @__PURE__ */ new WeakMap() : void 0;\nvar defaultSerializeQueryArgs = ({\n endpointName,\n queryArgs\n}) => {\n let serialized = \"\";\n const cached = cache?.get(queryArgs);\n if (typeof cached === \"string\") {\n serialized = cached;\n } else {\n const stringified = JSON.stringify(queryArgs, (key, value) => {\n value = typeof value === \"bigint\" ? {\n $bigint: value.toString()\n } : value;\n value = isPlainObject(value) ? Object.keys(value).sort().reduce((acc, key2) => {\n acc[key2] = value[key2];\n return acc;\n }, {}) : value;\n return value;\n });\n if (isPlainObject(queryArgs)) {\n cache?.set(queryArgs, stringified);\n }\n serialized = stringified;\n }\n return `${endpointName}(${serialized})`;\n};\n\n// src/query/createApi.ts\nimport { weakMapMemoize } from \"reselect\";\nfunction buildCreateApi(...modules) {\n return function baseCreateApi(options) {\n const extractRehydrationInfo = weakMapMemoize((action) => options.extractRehydrationInfo?.(action, {\n reducerPath: options.reducerPath ?? \"api\"\n }));\n const optionsWithDefaults = {\n reducerPath: \"api\",\n keepUnusedDataFor: 60,\n refetchOnMountOrArgChange: false,\n refetchOnFocus: false,\n refetchOnReconnect: false,\n invalidationBehavior: \"delayed\",\n ...options,\n extractRehydrationInfo,\n serializeQueryArgs(queryArgsApi) {\n let finalSerializeQueryArgs = defaultSerializeQueryArgs;\n if (\"serializeQueryArgs\" in queryArgsApi.endpointDefinition) {\n const endpointSQA = queryArgsApi.endpointDefinition.serializeQueryArgs;\n finalSerializeQueryArgs = (queryArgsApi2) => {\n const initialResult = endpointSQA(queryArgsApi2);\n if (typeof initialResult === \"string\") {\n return initialResult;\n } else {\n return defaultSerializeQueryArgs({\n ...queryArgsApi2,\n queryArgs: initialResult\n });\n }\n };\n } else if (options.serializeQueryArgs) {\n finalSerializeQueryArgs = options.serializeQueryArgs;\n }\n return finalSerializeQueryArgs(queryArgsApi);\n },\n tagTypes: [...options.tagTypes || []]\n };\n const context = {\n endpointDefinitions: {},\n batch(fn) {\n fn();\n },\n apiUid: nanoid(),\n extractRehydrationInfo,\n hasRehydrationInfo: weakMapMemoize((action) => extractRehydrationInfo(action) != null)\n };\n const api = {\n injectEndpoints,\n enhanceEndpoints({\n addTagTypes,\n endpoints\n }) {\n if (addTagTypes) {\n for (const eT of addTagTypes) {\n if (!optionsWithDefaults.tagTypes.includes(eT)) {\n ;\n optionsWithDefaults.tagTypes.push(eT);\n }\n }\n }\n if (endpoints) {\n for (const [endpointName, partialDefinition] of Object.entries(endpoints)) {\n if (typeof partialDefinition === \"function\") {\n partialDefinition(context.endpointDefinitions[endpointName]);\n } else {\n Object.assign(context.endpointDefinitions[endpointName] || {}, partialDefinition);\n }\n }\n }\n return api;\n }\n };\n const initializedModules = modules.map((m) => m.init(api, optionsWithDefaults, context));\n function injectEndpoints(inject) {\n const evaluatedEndpoints = inject.endpoints({\n query: (x) => ({\n ...x,\n type: \"query\" /* query */\n }),\n mutation: (x) => ({\n ...x,\n type: \"mutation\" /* mutation */\n })\n });\n for (const [endpointName, definition] of Object.entries(evaluatedEndpoints)) {\n if (inject.overrideExisting !== true && endpointName in context.endpointDefinitions) {\n if (inject.overrideExisting === \"throw\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(39) : `called \\`injectEndpoints\\` to override already-existing endpointName ${endpointName} without specifying \\`overrideExisting: true\\``);\n } else if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n console.error(`called \\`injectEndpoints\\` to override already-existing endpointName ${endpointName} without specifying \\`overrideExisting: true\\``);\n }\n continue;\n }\n context.endpointDefinitions[endpointName] = definition;\n for (const m of initializedModules) {\n m.injectEndpoint(endpointName, definition);\n }\n }\n return api;\n }\n return api.injectEndpoints({\n endpoints: options.endpoints\n });\n };\n}\n\n// src/query/fakeBaseQuery.ts\nimport { formatProdErrorMessage as _formatProdErrorMessage3 } from \"@reduxjs/toolkit\";\nfunction fakeBaseQuery() {\n return function() {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage3(33) : \"When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.\");\n };\n}\n\n// src/query/core/buildMiddleware/cacheCollection.ts\nimport { isAnyOf as isAnyOf2 } from \"@reduxjs/toolkit\";\nfunction isObjectEmpty(obj) {\n for (let k in obj) {\n return false;\n }\n return true;\n}\nvar THIRTY_TWO_BIT_MAX_TIMER_SECONDS = 2147483647 / 1e3 - 1;\nvar buildCacheCollectionHandler = ({\n reducerPath,\n api,\n queryThunk,\n context,\n internalState\n}) => {\n const {\n removeQueryResult,\n unsubscribeQueryResult\n } = api.internalActions;\n const canTriggerUnsubscribe = isAnyOf2(unsubscribeQueryResult.match, queryThunk.fulfilled, queryThunk.rejected);\n function anySubscriptionsRemainingForKey(queryCacheKey) {\n const subscriptions = internalState.currentSubscriptions[queryCacheKey];\n return !!subscriptions && !isObjectEmpty(subscriptions);\n }\n const currentRemovalTimeouts = {};\n const handler = (action, mwApi, internalState2) => {\n if (canTriggerUnsubscribe(action)) {\n const state = mwApi.getState()[reducerPath];\n const {\n queryCacheKey\n } = unsubscribeQueryResult.match(action) ? action.payload : action.meta.arg;\n handleUnsubscribe(queryCacheKey, state.queries[queryCacheKey]?.endpointName, mwApi, state.config);\n }\n if (api.util.resetApiState.match(action)) {\n for (const [key, timeout] of Object.entries(currentRemovalTimeouts)) {\n if (timeout)\n clearTimeout(timeout);\n delete currentRemovalTimeouts[key];\n }\n }\n if (context.hasRehydrationInfo(action)) {\n const state = mwApi.getState()[reducerPath];\n const {\n queries\n } = context.extractRehydrationInfo(action);\n for (const [queryCacheKey, queryState] of Object.entries(queries)) {\n handleUnsubscribe(queryCacheKey, queryState?.endpointName, mwApi, state.config);\n }\n }\n };\n function handleUnsubscribe(queryCacheKey, endpointName, api2, config) {\n const endpointDefinition = context.endpointDefinitions[endpointName];\n const keepUnusedDataFor = endpointDefinition?.keepUnusedDataFor ?? config.keepUnusedDataFor;\n if (keepUnusedDataFor === Infinity) {\n return;\n }\n const finalKeepUnusedDataFor = Math.max(0, Math.min(keepUnusedDataFor, THIRTY_TWO_BIT_MAX_TIMER_SECONDS));\n if (!anySubscriptionsRemainingForKey(queryCacheKey)) {\n const currentTimeout = currentRemovalTimeouts[queryCacheKey];\n if (currentTimeout) {\n clearTimeout(currentTimeout);\n }\n currentRemovalTimeouts[queryCacheKey] = setTimeout(() => {\n if (!anySubscriptionsRemainingForKey(queryCacheKey)) {\n api2.dispatch(removeQueryResult({\n queryCacheKey\n }));\n }\n delete currentRemovalTimeouts[queryCacheKey];\n }, finalKeepUnusedDataFor * 1e3);\n }\n }\n return handler;\n};\n\n// src/query/core/buildMiddleware/invalidationByTags.ts\nvar buildInvalidationByTagsHandler = ({\n reducerPath,\n context,\n context: {\n endpointDefinitions\n },\n mutationThunk,\n queryThunk,\n api,\n assertTagType,\n refetchQuery,\n internalState\n}) => {\n const {\n removeQueryResult\n } = api.internalActions;\n const isThunkActionWithTags = isAnyOf(isFulfilled(mutationThunk), isRejectedWithValue(mutationThunk));\n const isQueryEnd = isAnyOf(isFulfilled(mutationThunk, queryThunk), isRejected(mutationThunk, queryThunk));\n let pendingTagInvalidations = [];\n const handler = (action, mwApi) => {\n if (isThunkActionWithTags(action)) {\n invalidateTags(calculateProvidedByThunk(action, \"invalidatesTags\", endpointDefinitions, assertTagType), mwApi);\n } else if (isQueryEnd(action)) {\n invalidateTags([], mwApi);\n } else if (api.util.invalidateTags.match(action)) {\n invalidateTags(calculateProvidedBy(action.payload, void 0, void 0, void 0, void 0, assertTagType), mwApi);\n }\n };\n function hasPendingRequests(state) {\n for (const key in state.queries) {\n if (state.queries[key]?.status === \"pending\" /* pending */)\n return true;\n }\n for (const key in state.mutations) {\n if (state.mutations[key]?.status === \"pending\" /* pending */)\n return true;\n }\n return false;\n }\n function invalidateTags(newTags, mwApi) {\n const rootState = mwApi.getState();\n const state = rootState[reducerPath];\n pendingTagInvalidations.push(...newTags);\n if (state.config.invalidationBehavior === \"delayed\" && hasPendingRequests(state)) {\n return;\n }\n const tags = pendingTagInvalidations;\n pendingTagInvalidations = [];\n if (tags.length === 0)\n return;\n const toInvalidate = api.util.selectInvalidatedBy(rootState, tags);\n context.batch(() => {\n const valuesArray = Array.from(toInvalidate.values());\n for (const {\n queryCacheKey\n } of valuesArray) {\n const querySubState = state.queries[queryCacheKey];\n const subscriptionSubState = internalState.currentSubscriptions[queryCacheKey] ?? {};\n if (querySubState) {\n if (countObjectKeys(subscriptionSubState) === 0) {\n mwApi.dispatch(removeQueryResult({\n queryCacheKey\n }));\n } else if (querySubState.status !== \"uninitialized\" /* uninitialized */) {\n mwApi.dispatch(refetchQuery(querySubState, queryCacheKey));\n }\n }\n }\n });\n }\n return handler;\n};\n\n// src/query/core/buildMiddleware/polling.ts\nvar buildPollingHandler = ({\n reducerPath,\n queryThunk,\n api,\n refetchQuery,\n internalState\n}) => {\n const currentPolls = {};\n const handler = (action, mwApi) => {\n if (api.internalActions.updateSubscriptionOptions.match(action) || api.internalActions.unsubscribeQueryResult.match(action)) {\n updatePollingInterval(action.payload, mwApi);\n }\n if (queryThunk.pending.match(action) || queryThunk.rejected.match(action) && action.meta.condition) {\n updatePollingInterval(action.meta.arg, mwApi);\n }\n if (queryThunk.fulfilled.match(action) || queryThunk.rejected.match(action) && !action.meta.condition) {\n startNextPoll(action.meta.arg, mwApi);\n }\n if (api.util.resetApiState.match(action)) {\n clearPolls();\n }\n };\n function startNextPoll({\n queryCacheKey\n }, api2) {\n const state = api2.getState()[reducerPath];\n const querySubState = state.queries[queryCacheKey];\n const subscriptions = internalState.currentSubscriptions[queryCacheKey];\n if (!querySubState || querySubState.status === \"uninitialized\" /* uninitialized */)\n return;\n const {\n lowestPollingInterval,\n skipPollingIfUnfocused\n } = findLowestPollingInterval(subscriptions);\n if (!Number.isFinite(lowestPollingInterval))\n return;\n const currentPoll = currentPolls[queryCacheKey];\n if (currentPoll?.timeout) {\n clearTimeout(currentPoll.timeout);\n currentPoll.timeout = void 0;\n }\n const nextPollTimestamp = Date.now() + lowestPollingInterval;\n currentPolls[queryCacheKey] = {\n nextPollTimestamp,\n pollingInterval: lowestPollingInterval,\n timeout: setTimeout(() => {\n if (state.config.focused || !skipPollingIfUnfocused) {\n api2.dispatch(refetchQuery(querySubState, queryCacheKey));\n }\n startNextPoll({\n queryCacheKey\n }, api2);\n }, lowestPollingInterval)\n };\n }\n function updatePollingInterval({\n queryCacheKey\n }, api2) {\n const state = api2.getState()[reducerPath];\n const querySubState = state.queries[queryCacheKey];\n const subscriptions = internalState.currentSubscriptions[queryCacheKey];\n if (!querySubState || querySubState.status === \"uninitialized\" /* uninitialized */) {\n return;\n }\n const {\n lowestPollingInterval\n } = findLowestPollingInterval(subscriptions);\n if (!Number.isFinite(lowestPollingInterval)) {\n cleanupPollForKey(queryCacheKey);\n return;\n }\n const currentPoll = currentPolls[queryCacheKey];\n const nextPollTimestamp = Date.now() + lowestPollingInterval;\n if (!currentPoll || nextPollTimestamp < currentPoll.nextPollTimestamp) {\n startNextPoll({\n queryCacheKey\n }, api2);\n }\n }\n function cleanupPollForKey(key) {\n const existingPoll = currentPolls[key];\n if (existingPoll?.timeout) {\n clearTimeout(existingPoll.timeout);\n }\n delete currentPolls[key];\n }\n function clearPolls() {\n for (const key of Object.keys(currentPolls)) {\n cleanupPollForKey(key);\n }\n }\n function findLowestPollingInterval(subscribers = {}) {\n let skipPollingIfUnfocused = false;\n let lowestPollingInterval = Number.POSITIVE_INFINITY;\n for (let key in subscribers) {\n if (!!subscribers[key].pollingInterval) {\n lowestPollingInterval = Math.min(subscribers[key].pollingInterval, lowestPollingInterval);\n skipPollingIfUnfocused = subscribers[key].skipPollingIfUnfocused || skipPollingIfUnfocused;\n }\n }\n return {\n lowestPollingInterval,\n skipPollingIfUnfocused\n };\n }\n return handler;\n};\n\n// src/query/core/buildMiddleware/windowEventHandling.ts\nvar buildWindowEventHandler = ({\n reducerPath,\n context,\n api,\n refetchQuery,\n internalState\n}) => {\n const {\n removeQueryResult\n } = api.internalActions;\n const handler = (action, mwApi) => {\n if (onFocus.match(action)) {\n refetchValidQueries(mwApi, \"refetchOnFocus\");\n }\n if (onOnline.match(action)) {\n refetchValidQueries(mwApi, \"refetchOnReconnect\");\n }\n };\n function refetchValidQueries(api2, type) {\n const state = api2.getState()[reducerPath];\n const queries = state.queries;\n const subscriptions = internalState.currentSubscriptions;\n context.batch(() => {\n for (const queryCacheKey of Object.keys(subscriptions)) {\n const querySubState = queries[queryCacheKey];\n const subscriptionSubState = subscriptions[queryCacheKey];\n if (!subscriptionSubState || !querySubState)\n continue;\n const shouldRefetch = Object.values(subscriptionSubState).some((sub) => sub[type] === true) || Object.values(subscriptionSubState).every((sub) => sub[type] === void 0) && state.config[type];\n if (shouldRefetch) {\n if (countObjectKeys(subscriptionSubState) === 0) {\n api2.dispatch(removeQueryResult({\n queryCacheKey\n }));\n } else if (querySubState.status !== \"uninitialized\" /* uninitialized */) {\n api2.dispatch(refetchQuery(querySubState, queryCacheKey));\n }\n }\n }\n });\n }\n return handler;\n};\n\n// src/query/core/buildMiddleware/cacheLifecycle.ts\nvar neverResolvedError = new Error(\"Promise never resolved before cacheEntryRemoved.\");\nvar buildCacheLifecycleHandler = ({\n api,\n reducerPath,\n context,\n queryThunk,\n mutationThunk,\n internalState\n}) => {\n const isQueryThunk = isAsyncThunkAction(queryThunk);\n const isMutationThunk = isAsyncThunkAction(mutationThunk);\n const isFulfilledThunk = isFulfilled(queryThunk, mutationThunk);\n const lifecycleMap = {};\n const handler = (action, mwApi, stateBefore) => {\n const cacheKey = getCacheKey(action);\n if (queryThunk.pending.match(action)) {\n const oldState = stateBefore[reducerPath].queries[cacheKey];\n const state = mwApi.getState()[reducerPath].queries[cacheKey];\n if (!oldState && state) {\n handleNewKey(action.meta.arg.endpointName, action.meta.arg.originalArgs, cacheKey, mwApi, action.meta.requestId);\n }\n } else if (mutationThunk.pending.match(action)) {\n const state = mwApi.getState()[reducerPath].mutations[cacheKey];\n if (state) {\n handleNewKey(action.meta.arg.endpointName, action.meta.arg.originalArgs, cacheKey, mwApi, action.meta.requestId);\n }\n } else if (isFulfilledThunk(action)) {\n const lifecycle = lifecycleMap[cacheKey];\n if (lifecycle?.valueResolved) {\n lifecycle.valueResolved({\n data: action.payload,\n meta: action.meta.baseQueryMeta\n });\n delete lifecycle.valueResolved;\n }\n } else if (api.internalActions.removeQueryResult.match(action) || api.internalActions.removeMutationResult.match(action)) {\n const lifecycle = lifecycleMap[cacheKey];\n if (lifecycle) {\n delete lifecycleMap[cacheKey];\n lifecycle.cacheEntryRemoved();\n }\n } else if (api.util.resetApiState.match(action)) {\n for (const [cacheKey2, lifecycle] of Object.entries(lifecycleMap)) {\n delete lifecycleMap[cacheKey2];\n lifecycle.cacheEntryRemoved();\n }\n }\n };\n function getCacheKey(action) {\n if (isQueryThunk(action))\n return action.meta.arg.queryCacheKey;\n if (isMutationThunk(action)) {\n return action.meta.arg.fixedCacheKey ?? action.meta.requestId;\n }\n if (api.internalActions.removeQueryResult.match(action))\n return action.payload.queryCacheKey;\n if (api.internalActions.removeMutationResult.match(action))\n return getMutationCacheKey(action.payload);\n return \"\";\n }\n function handleNewKey(endpointName, originalArgs, queryCacheKey, mwApi, requestId) {\n const endpointDefinition = context.endpointDefinitions[endpointName];\n const onCacheEntryAdded = endpointDefinition?.onCacheEntryAdded;\n if (!onCacheEntryAdded)\n return;\n let lifecycle = {};\n const cacheEntryRemoved = new Promise((resolve) => {\n lifecycle.cacheEntryRemoved = resolve;\n });\n const cacheDataLoaded = Promise.race([new Promise((resolve) => {\n lifecycle.valueResolved = resolve;\n }), cacheEntryRemoved.then(() => {\n throw neverResolvedError;\n })]);\n cacheDataLoaded.catch(() => {\n });\n lifecycleMap[queryCacheKey] = lifecycle;\n const selector = api.endpoints[endpointName].select(endpointDefinition.type === \"query\" /* query */ ? originalArgs : queryCacheKey);\n const extra = mwApi.dispatch((_, __, extra2) => extra2);\n const lifecycleApi = {\n ...mwApi,\n getCacheEntry: () => selector(mwApi.getState()),\n requestId,\n extra,\n updateCachedData: endpointDefinition.type === \"query\" /* query */ ? (updateRecipe) => mwApi.dispatch(api.util.updateQueryData(endpointName, originalArgs, updateRecipe)) : void 0,\n cacheDataLoaded,\n cacheEntryRemoved\n };\n const runningHandler = onCacheEntryAdded(originalArgs, lifecycleApi);\n Promise.resolve(runningHandler).catch((e) => {\n if (e === neverResolvedError)\n return;\n throw e;\n });\n }\n return handler;\n};\n\n// src/query/core/buildMiddleware/queryLifecycle.ts\nvar buildQueryLifecycleHandler = ({\n api,\n context,\n queryThunk,\n mutationThunk\n}) => {\n const isPendingThunk = isPending(queryThunk, mutationThunk);\n const isRejectedThunk = isRejected(queryThunk, mutationThunk);\n const isFullfilledThunk = isFulfilled(queryThunk, mutationThunk);\n const lifecycleMap = {};\n const handler = (action, mwApi) => {\n if (isPendingThunk(action)) {\n const {\n requestId,\n arg: {\n endpointName,\n originalArgs\n }\n } = action.meta;\n const endpointDefinition = context.endpointDefinitions[endpointName];\n const onQueryStarted = endpointDefinition?.onQueryStarted;\n if (onQueryStarted) {\n const lifecycle = {};\n const queryFulfilled = new Promise((resolve, reject) => {\n lifecycle.resolve = resolve;\n lifecycle.reject = reject;\n });\n queryFulfilled.catch(() => {\n });\n lifecycleMap[requestId] = lifecycle;\n const selector = api.endpoints[endpointName].select(endpointDefinition.type === \"query\" /* query */ ? originalArgs : requestId);\n const extra = mwApi.dispatch((_, __, extra2) => extra2);\n const lifecycleApi = {\n ...mwApi,\n getCacheEntry: () => selector(mwApi.getState()),\n requestId,\n extra,\n updateCachedData: endpointDefinition.type === \"query\" /* query */ ? (updateRecipe) => mwApi.dispatch(api.util.updateQueryData(endpointName, originalArgs, updateRecipe)) : void 0,\n queryFulfilled\n };\n onQueryStarted(originalArgs, lifecycleApi);\n }\n } else if (isFullfilledThunk(action)) {\n const {\n requestId,\n baseQueryMeta\n } = action.meta;\n lifecycleMap[requestId]?.resolve({\n data: action.payload,\n meta: baseQueryMeta\n });\n delete lifecycleMap[requestId];\n } else if (isRejectedThunk(action)) {\n const {\n requestId,\n rejectedWithValue,\n baseQueryMeta\n } = action.meta;\n lifecycleMap[requestId]?.reject({\n error: action.payload ?? action.error,\n isUnhandledError: !rejectedWithValue,\n meta: baseQueryMeta\n });\n delete lifecycleMap[requestId];\n }\n };\n return handler;\n};\n\n// src/query/core/buildMiddleware/devMiddleware.ts\nvar buildDevCheckHandler = ({\n api,\n context: {\n apiUid\n },\n reducerPath\n}) => {\n return (action, mwApi) => {\n if (api.util.resetApiState.match(action)) {\n mwApi.dispatch(api.internalActions.middlewareRegistered(apiUid));\n }\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n if (api.internalActions.middlewareRegistered.match(action) && action.payload === apiUid && mwApi.getState()[reducerPath]?.config?.middlewareRegistered === \"conflict\") {\n console.warn(`There is a mismatch between slice and middleware for the reducerPath \"${reducerPath}\".\nYou can only have one api per reducer path, this will lead to crashes in various situations!${reducerPath === \"api\" ? `\nIf you have multiple apis, you *have* to specify the reducerPath option when using createApi!` : \"\"}`);\n }\n }\n };\n};\n\n// src/query/core/buildMiddleware/batchActions.ts\nimport { produceWithPatches as produceWithPatches2 } from \"immer\";\nvar buildBatchedActionsHandler = ({\n api,\n queryThunk,\n internalState\n}) => {\n const subscriptionsPrefix = `${api.reducerPath}/subscriptions`;\n let previousSubscriptions = null;\n let updateSyncTimer = null;\n const {\n updateSubscriptionOptions,\n unsubscribeQueryResult\n } = api.internalActions;\n const actuallyMutateSubscriptions = (mutableState, action) => {\n if (updateSubscriptionOptions.match(action)) {\n const {\n queryCacheKey,\n requestId,\n options\n } = action.payload;\n if (mutableState?.[queryCacheKey]?.[requestId]) {\n mutableState[queryCacheKey][requestId] = options;\n }\n return true;\n }\n if (unsubscribeQueryResult.match(action)) {\n const {\n queryCacheKey,\n requestId\n } = action.payload;\n if (mutableState[queryCacheKey]) {\n delete mutableState[queryCacheKey][requestId];\n }\n return true;\n }\n if (api.internalActions.removeQueryResult.match(action)) {\n delete mutableState[action.payload.queryCacheKey];\n return true;\n }\n if (queryThunk.pending.match(action)) {\n const {\n meta: {\n arg,\n requestId\n }\n } = action;\n const substate = mutableState[arg.queryCacheKey] ??= {};\n substate[`${requestId}_running`] = {};\n if (arg.subscribe) {\n substate[requestId] = arg.subscriptionOptions ?? substate[requestId] ?? {};\n }\n return true;\n }\n let mutated = false;\n if (queryThunk.fulfilled.match(action) || queryThunk.rejected.match(action)) {\n const state = mutableState[action.meta.arg.queryCacheKey] || {};\n const key = `${action.meta.requestId}_running`;\n mutated ||= !!state[key];\n delete state[key];\n }\n if (queryThunk.rejected.match(action)) {\n const {\n meta: {\n condition,\n arg,\n requestId\n }\n } = action;\n if (condition && arg.subscribe) {\n const substate = mutableState[arg.queryCacheKey] ??= {};\n substate[requestId] = arg.subscriptionOptions ?? substate[requestId] ?? {};\n mutated = true;\n }\n }\n return mutated;\n };\n const getSubscriptions = () => internalState.currentSubscriptions;\n const getSubscriptionCount = (queryCacheKey) => {\n const subscriptions = getSubscriptions();\n const subscriptionsForQueryArg = subscriptions[queryCacheKey] ?? {};\n return countObjectKeys(subscriptionsForQueryArg);\n };\n const isRequestSubscribed = (queryCacheKey, requestId) => {\n const subscriptions = getSubscriptions();\n return !!subscriptions?.[queryCacheKey]?.[requestId];\n };\n const subscriptionSelectors = {\n getSubscriptions,\n getSubscriptionCount,\n isRequestSubscribed\n };\n return (action, mwApi) => {\n if (!previousSubscriptions) {\n previousSubscriptions = JSON.parse(JSON.stringify(internalState.currentSubscriptions));\n }\n if (api.util.resetApiState.match(action)) {\n previousSubscriptions = internalState.currentSubscriptions = {};\n updateSyncTimer = null;\n return [true, false];\n }\n if (api.internalActions.internal_getRTKQSubscriptions.match(action)) {\n return [false, subscriptionSelectors];\n }\n const didMutate = actuallyMutateSubscriptions(internalState.currentSubscriptions, action);\n let actionShouldContinue = true;\n if (didMutate) {\n if (!updateSyncTimer) {\n updateSyncTimer = setTimeout(() => {\n const newSubscriptions = JSON.parse(JSON.stringify(internalState.currentSubscriptions));\n const [, patches] = produceWithPatches2(previousSubscriptions, () => newSubscriptions);\n mwApi.next(api.internalActions.subscriptionsUpdated(patches));\n previousSubscriptions = newSubscriptions;\n updateSyncTimer = null;\n }, 500);\n }\n const isSubscriptionSliceAction = typeof action.type == \"string\" && !!action.type.startsWith(subscriptionsPrefix);\n const isAdditionalSubscriptionAction = queryThunk.rejected.match(action) && action.meta.condition && !!action.meta.arg.subscribe;\n actionShouldContinue = !isSubscriptionSliceAction && !isAdditionalSubscriptionAction;\n }\n return [actionShouldContinue, false];\n };\n};\n\n// src/query/core/buildMiddleware/index.ts\nfunction buildMiddleware(input) {\n const {\n reducerPath,\n queryThunk,\n api,\n context\n } = input;\n const {\n apiUid\n } = context;\n const actions = {\n invalidateTags: createAction(`${reducerPath}/invalidateTags`)\n };\n const isThisApiSliceAction = (action) => action.type.startsWith(`${reducerPath}/`);\n const handlerBuilders = [buildDevCheckHandler, buildCacheCollectionHandler, buildInvalidationByTagsHandler, buildPollingHandler, buildCacheLifecycleHandler, buildQueryLifecycleHandler];\n const middleware = (mwApi) => {\n let initialized2 = false;\n let internalState = {\n currentSubscriptions: {}\n };\n const builderArgs = {\n ...input,\n internalState,\n refetchQuery,\n isThisApiSliceAction\n };\n const handlers = handlerBuilders.map((build) => build(builderArgs));\n const batchedActionsHandler = buildBatchedActionsHandler(builderArgs);\n const windowEventsHandler = buildWindowEventHandler(builderArgs);\n return (next) => {\n return (action) => {\n if (!isAction(action)) {\n return next(action);\n }\n if (!initialized2) {\n initialized2 = true;\n mwApi.dispatch(api.internalActions.middlewareRegistered(apiUid));\n }\n const mwApiWithNext = {\n ...mwApi,\n next\n };\n const stateBefore = mwApi.getState();\n const [actionShouldContinue, internalProbeResult] = batchedActionsHandler(action, mwApiWithNext, stateBefore);\n let res;\n if (actionShouldContinue) {\n res = next(action);\n } else {\n res = internalProbeResult;\n }\n if (!!mwApi.getState()[reducerPath]) {\n windowEventsHandler(action, mwApiWithNext, stateBefore);\n if (isThisApiSliceAction(action) || context.hasRehydrationInfo(action)) {\n for (let handler of handlers) {\n handler(action, mwApiWithNext, stateBefore);\n }\n }\n }\n return res;\n };\n };\n };\n return {\n middleware,\n actions\n };\n function refetchQuery(querySubState, queryCacheKey, override = {}) {\n return queryThunk({\n type: \"query\",\n endpointName: querySubState.endpointName,\n originalArgs: querySubState.originalArgs,\n subscribe: false,\n forceRefetch: true,\n queryCacheKey,\n ...override\n });\n }\n}\n\n// src/query/tsHelpers.ts\nfunction assertCast(v) {\n}\nfunction safeAssign(target, ...args) {\n return Object.assign(target, ...args);\n}\n\n// src/query/core/module.ts\nimport { enablePatches } from \"immer\";\nvar coreModuleName = /* @__PURE__ */ Symbol();\nvar coreModule = ({\n createSelector: createSelector2 = createSelector\n} = {}) => ({\n name: coreModuleName,\n init(api, {\n baseQuery,\n tagTypes,\n reducerPath,\n serializeQueryArgs,\n keepUnusedDataFor,\n refetchOnMountOrArgChange,\n refetchOnFocus,\n refetchOnReconnect,\n invalidationBehavior\n }, context) {\n enablePatches();\n assertCast(serializeQueryArgs);\n const assertTagType = (tag) => {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n if (!tagTypes.includes(tag.type)) {\n console.error(`Tag type '${tag.type}' was used, but not specified in \\`tagTypes\\`!`);\n }\n }\n return tag;\n };\n Object.assign(api, {\n reducerPath,\n endpoints: {},\n internalActions: {\n onOnline,\n onOffline,\n onFocus,\n onFocusLost\n },\n util: {}\n });\n const {\n queryThunk,\n mutationThunk,\n patchQueryData,\n updateQueryData,\n upsertQueryData,\n prefetch,\n buildMatchThunkActions\n } = buildThunks({\n baseQuery,\n reducerPath,\n context,\n api,\n serializeQueryArgs,\n assertTagType\n });\n const {\n reducer,\n actions: sliceActions\n } = buildSlice({\n context,\n queryThunk,\n mutationThunk,\n reducerPath,\n assertTagType,\n config: {\n refetchOnFocus,\n refetchOnReconnect,\n refetchOnMountOrArgChange,\n keepUnusedDataFor,\n reducerPath,\n invalidationBehavior\n }\n });\n safeAssign(api.util, {\n patchQueryData,\n updateQueryData,\n upsertQueryData,\n prefetch,\n resetApiState: sliceActions.resetApiState\n });\n safeAssign(api.internalActions, sliceActions);\n const {\n middleware,\n actions: middlewareActions\n } = buildMiddleware({\n reducerPath,\n context,\n queryThunk,\n mutationThunk,\n api,\n assertTagType\n });\n safeAssign(api.util, middlewareActions);\n safeAssign(api, {\n reducer,\n middleware\n });\n const {\n buildQuerySelector,\n buildMutationSelector,\n selectInvalidatedBy,\n selectCachedArgsForQuery\n } = buildSelectors({\n serializeQueryArgs,\n reducerPath,\n createSelector: createSelector2\n });\n safeAssign(api.util, {\n selectInvalidatedBy,\n selectCachedArgsForQuery\n });\n const {\n buildInitiateQuery,\n buildInitiateMutation,\n getRunningMutationThunk,\n getRunningMutationsThunk,\n getRunningQueriesThunk,\n getRunningQueryThunk\n } = buildInitiate({\n queryThunk,\n mutationThunk,\n api,\n serializeQueryArgs,\n context\n });\n safeAssign(api.util, {\n getRunningMutationThunk,\n getRunningMutationsThunk,\n getRunningQueryThunk,\n getRunningQueriesThunk\n });\n return {\n name: coreModuleName,\n injectEndpoint(endpointName, definition) {\n const anyApi = api;\n anyApi.endpoints[endpointName] ??= {};\n if (isQueryDefinition(definition)) {\n safeAssign(anyApi.endpoints[endpointName], {\n name: endpointName,\n select: buildQuerySelector(endpointName, definition),\n initiate: buildInitiateQuery(endpointName, definition)\n }, buildMatchThunkActions(queryThunk, endpointName));\n } else if (isMutationDefinition(definition)) {\n safeAssign(anyApi.endpoints[endpointName], {\n name: endpointName,\n select: buildMutationSelector(),\n initiate: buildInitiateMutation(endpointName)\n }, buildMatchThunkActions(mutationThunk, endpointName));\n }\n }\n };\n }\n});\n\n// src/query/core/index.ts\nvar createApi = /* @__PURE__ */ buildCreateApi(coreModule());\nexport {\n QueryStatus,\n buildCreateApi,\n copyWithStructuralSharing,\n coreModule,\n coreModuleName,\n createApi,\n defaultSerializeQueryArgs,\n fakeBaseQuery,\n fetchBaseQuery,\n retry,\n setupListeners,\n skipToken\n};\n//# sourceMappingURL=rtk-query.modern.mjs.map","// src/index.ts\nfunction createThunkMiddleware(extraArgument) {\n const middleware = ({ dispatch, getState }) => (next) => (action) => {\n if (typeof action === \"function\") {\n return action(dispatch, getState, extraArgument);\n }\n return next(action);\n };\n return middleware;\n}\nvar thunk = createThunkMiddleware();\nvar withExtraArgument = createThunkMiddleware;\nexport {\n thunk,\n withExtraArgument\n};\n","// src/index.ts\nexport * from \"redux\";\nimport { produce, current as current4, freeze, original as original2, isDraft as isDraft6 } from \"immer\";\nimport { createSelector, createSelectorCreator as createSelectorCreator2, lruMemoize, weakMapMemoize as weakMapMemoize2 } from \"reselect\";\n\n// src/createDraftSafeSelector.ts\nimport { current, isDraft } from \"immer\";\nimport { createSelectorCreator, weakMapMemoize } from \"reselect\";\nvar createDraftSafeSelectorCreator = (...args) => {\n const createSelector2 = createSelectorCreator(...args);\n const createDraftSafeSelector2 = Object.assign((...args2) => {\n const selector = createSelector2(...args2);\n const wrappedSelector = (value, ...rest) => selector(isDraft(value) ? current(value) : value, ...rest);\n Object.assign(wrappedSelector, selector);\n return wrappedSelector;\n }, {\n withTypes: () => createDraftSafeSelector2\n });\n return createDraftSafeSelector2;\n};\nvar createDraftSafeSelector = createDraftSafeSelectorCreator(weakMapMemoize);\n\n// src/configureStore.ts\nimport { applyMiddleware, createStore, compose as compose2, combineReducers, isPlainObject as isPlainObject2 } from \"redux\";\n\n// src/devtoolsExtension.ts\nimport { compose } from \"redux\";\nvar composeWithDevTools = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {\n if (arguments.length === 0)\n return void 0;\n if (typeof arguments[0] === \"object\")\n return compose;\n return compose.apply(null, arguments);\n};\nvar devToolsEnhancer = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function() {\n return function(noop3) {\n return noop3;\n };\n};\n\n// src/getDefaultMiddleware.ts\nimport { thunk as thunkMiddleware, withExtraArgument } from \"redux-thunk\";\n\n// src/createAction.ts\nimport { isAction } from \"redux\";\n\n// src/tsHelpers.ts\nvar hasMatchFunction = (v) => {\n return v && typeof v.match === \"function\";\n};\n\n// src/createAction.ts\nfunction createAction(type, prepareAction) {\n function actionCreator(...args) {\n if (prepareAction) {\n let prepared = prepareAction(...args);\n if (!prepared) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : \"prepareAction did not return an object\");\n }\n return {\n type,\n payload: prepared.payload,\n ...\"meta\" in prepared && {\n meta: prepared.meta\n },\n ...\"error\" in prepared && {\n error: prepared.error\n }\n };\n }\n return {\n type,\n payload: args[0]\n };\n }\n actionCreator.toString = () => `${type}`;\n actionCreator.type = type;\n actionCreator.match = (action) => isAction(action) && action.type === type;\n return actionCreator;\n}\nfunction isActionCreator(action) {\n return typeof action === \"function\" && \"type\" in action && // hasMatchFunction only wants Matchers but I don't see the point in rewriting it\n hasMatchFunction(action);\n}\nfunction isFSA(action) {\n return isAction(action) && Object.keys(action).every(isValidKey);\n}\nfunction isValidKey(key) {\n return [\"type\", \"payload\", \"error\", \"meta\"].indexOf(key) > -1;\n}\n\n// src/actionCreatorInvariantMiddleware.ts\nfunction getMessage(type) {\n const splitType = type ? `${type}`.split(\"/\") : [];\n const actionName = splitType[splitType.length - 1] || \"actionCreator\";\n 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.`;\n}\nfunction createActionCreatorInvariantMiddleware(options = {}) {\n if (process.env.NODE_ENV === \"production\") {\n return () => (next) => (action) => next(action);\n }\n const {\n isActionCreator: isActionCreator2 = isActionCreator\n } = options;\n return () => (next) => (action) => {\n if (isActionCreator2(action)) {\n console.warn(getMessage(action.type));\n }\n return next(action);\n };\n}\n\n// src/utils.ts\nimport { produce as createNextState, isDraftable } from \"immer\";\nfunction getTimeMeasureUtils(maxDelay, fnName) {\n let elapsed = 0;\n return {\n measureTime(fn) {\n const started = Date.now();\n try {\n return fn();\n } finally {\n const finished = Date.now();\n elapsed += finished - started;\n }\n },\n warnIfExceeded() {\n if (elapsed > maxDelay) {\n 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.`);\n }\n }\n };\n}\nfunction find(iterable, comparator) {\n for (const entry of iterable) {\n if (comparator(entry)) {\n return entry;\n }\n }\n return void 0;\n}\nvar Tuple = class _Tuple extends Array {\n constructor(...items) {\n super(...items);\n Object.setPrototypeOf(this, _Tuple.prototype);\n }\n static get [Symbol.species]() {\n return _Tuple;\n }\n concat(...arr) {\n return super.concat.apply(this, arr);\n }\n prepend(...arr) {\n if (arr.length === 1 && Array.isArray(arr[0])) {\n return new _Tuple(...arr[0].concat(this));\n }\n return new _Tuple(...arr.concat(this));\n }\n};\nfunction freezeDraftable(val) {\n return isDraftable(val) ? createNextState(val, () => {\n }) : val;\n}\nfunction emplace(map, key, handler) {\n if (map.has(key)) {\n let value = map.get(key);\n if (handler.update) {\n value = handler.update(value, key, map);\n map.set(key, value);\n }\n return value;\n }\n if (!handler.insert)\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : \"No insert provided for key not already in map\");\n const inserted = handler.insert(key, map);\n map.set(key, inserted);\n return inserted;\n}\n\n// src/immutableStateInvariantMiddleware.ts\nfunction isImmutableDefault(value) {\n return typeof value !== \"object\" || value == null || Object.isFrozen(value);\n}\nfunction trackForMutations(isImmutable, ignorePaths, obj) {\n const trackedProperties = trackProperties(isImmutable, ignorePaths, obj);\n return {\n detectMutations() {\n return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);\n }\n };\n}\nfunction trackProperties(isImmutable, ignorePaths = [], obj, path = \"\", checkedObjects = /* @__PURE__ */ new Set()) {\n const tracked = {\n value: obj\n };\n if (!isImmutable(obj) && !checkedObjects.has(obj)) {\n checkedObjects.add(obj);\n tracked.children = {};\n for (const key in obj) {\n const childPath = path ? path + \".\" + key : key;\n if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {\n continue;\n }\n tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);\n }\n }\n return tracked;\n}\nfunction detectMutations(isImmutable, ignoredPaths = [], trackedProperty, obj, sameParentRef = false, path = \"\") {\n const prevObj = trackedProperty ? trackedProperty.value : void 0;\n const sameRef = prevObj === obj;\n if (sameParentRef && !sameRef && !Number.isNaN(obj)) {\n return {\n wasMutated: true,\n path\n };\n }\n if (isImmutable(prevObj) || isImmutable(obj)) {\n return {\n wasMutated: false\n };\n }\n const keysToDetect = {};\n for (let key in trackedProperty.children) {\n keysToDetect[key] = true;\n }\n for (let key in obj) {\n keysToDetect[key] = true;\n }\n const hasIgnoredPaths = ignoredPaths.length > 0;\n for (let key in keysToDetect) {\n const nestedPath = path ? path + \".\" + key : key;\n if (hasIgnoredPaths) {\n const hasMatches = ignoredPaths.some((ignored) => {\n if (ignored instanceof RegExp) {\n return ignored.test(nestedPath);\n }\n return nestedPath === ignored;\n });\n if (hasMatches) {\n continue;\n }\n }\n const result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);\n if (result.wasMutated) {\n return result;\n }\n }\n return {\n wasMutated: false\n };\n}\nfunction createImmutableStateInvariantMiddleware(options = {}) {\n if (process.env.NODE_ENV === \"production\") {\n return () => (next) => (action) => next(action);\n } else {\n let stringify2 = function(obj, serializer, indent, decycler) {\n return JSON.stringify(obj, getSerialize2(serializer, decycler), indent);\n }, getSerialize2 = function(serializer, decycler) {\n let stack = [], keys = [];\n if (!decycler)\n decycler = function(_, value) {\n if (stack[0] === value)\n return \"[Circular ~]\";\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\";\n };\n return function(key, value) {\n if (stack.length > 0) {\n var thisPos = stack.indexOf(this);\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);\n if (~stack.indexOf(value))\n value = decycler.call(this, key, value);\n } else\n stack.push(value);\n return serializer == null ? value : serializer.call(this, key, value);\n };\n };\n var stringify = stringify2, getSerialize = getSerialize2;\n let {\n isImmutable = isImmutableDefault,\n ignoredPaths,\n warnAfter = 32\n } = options;\n const track = trackForMutations.bind(null, isImmutable, ignoredPaths);\n return ({\n getState\n }) => {\n let state = getState();\n let tracker = track(state);\n let result;\n return (next) => (action) => {\n const measureUtils = getTimeMeasureUtils(warnAfter, \"ImmutableStateInvariantMiddleware\");\n measureUtils.measureTime(() => {\n state = getState();\n result = tracker.detectMutations();\n tracker = track(state);\n if (result.wasMutated) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(19) : `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)`);\n }\n });\n const dispatchedAction = next(action);\n measureUtils.measureTime(() => {\n state = getState();\n result = tracker.detectMutations();\n tracker = track(state);\n if (result.wasMutated) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(20) : `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)`);\n }\n });\n measureUtils.warnIfExceeded();\n return dispatchedAction;\n };\n };\n }\n}\n\n// src/serializableStateInvariantMiddleware.ts\nimport { isAction as isAction2, isPlainObject } from \"redux\";\nfunction isPlain(val) {\n const type = typeof val;\n return val == null || type === \"string\" || type === \"boolean\" || type === \"number\" || Array.isArray(val) || isPlainObject(val);\n}\nfunction findNonSerializableValue(value, path = \"\", isSerializable = isPlain, getEntries, ignoredPaths = [], cache) {\n let foundNestedSerializable;\n if (!isSerializable(value)) {\n return {\n keyPath: path || \"\",\n value\n };\n }\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n if (cache?.has(value))\n return false;\n const entries = getEntries != null ? getEntries(value) : Object.entries(value);\n const hasIgnoredPaths = ignoredPaths.length > 0;\n for (const [key, nestedValue] of entries) {\n const nestedPath = path ? path + \".\" + key : key;\n if (hasIgnoredPaths) {\n const hasMatches = ignoredPaths.some((ignored) => {\n if (ignored instanceof RegExp) {\n return ignored.test(nestedPath);\n }\n return nestedPath === ignored;\n });\n if (hasMatches) {\n continue;\n }\n }\n if (!isSerializable(nestedValue)) {\n return {\n keyPath: nestedPath,\n value: nestedValue\n };\n }\n if (typeof nestedValue === \"object\") {\n foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);\n if (foundNestedSerializable) {\n return foundNestedSerializable;\n }\n }\n }\n if (cache && isNestedFrozen(value))\n cache.add(value);\n return false;\n}\nfunction isNestedFrozen(value) {\n if (!Object.isFrozen(value))\n return false;\n for (const nestedValue of Object.values(value)) {\n if (typeof nestedValue !== \"object\" || nestedValue === null)\n continue;\n if (!isNestedFrozen(nestedValue))\n return false;\n }\n return true;\n}\nfunction createSerializableStateInvariantMiddleware(options = {}) {\n if (process.env.NODE_ENV === \"production\") {\n return () => (next) => (action) => next(action);\n } else {\n const {\n isSerializable = isPlain,\n getEntries,\n ignoredActions = [],\n ignoredActionPaths = [\"meta.arg\", \"meta.baseQueryMeta\"],\n ignoredPaths = [],\n warnAfter = 32,\n ignoreState = false,\n ignoreActions = false,\n disableCache = false\n } = options;\n const cache = !disableCache && WeakSet ? /* @__PURE__ */ new WeakSet() : void 0;\n return (storeAPI) => (next) => (action) => {\n if (!isAction2(action)) {\n return next(action);\n }\n const result = next(action);\n const measureUtils = getTimeMeasureUtils(warnAfter, \"SerializableStateInvariantMiddleware\");\n if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {\n measureUtils.measureTime(() => {\n const foundActionNonSerializableValue = findNonSerializableValue(action, \"\", isSerializable, getEntries, ignoredActionPaths, cache);\n if (foundActionNonSerializableValue) {\n const {\n keyPath,\n value\n } = foundActionNonSerializableValue;\n 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)\");\n }\n });\n }\n if (!ignoreState) {\n measureUtils.measureTime(() => {\n const state = storeAPI.getState();\n const foundStateNonSerializableValue = findNonSerializableValue(state, \"\", isSerializable, getEntries, ignoredPaths, cache);\n if (foundStateNonSerializableValue) {\n const {\n keyPath,\n value\n } = foundStateNonSerializableValue;\n 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)`);\n }\n });\n measureUtils.warnIfExceeded();\n }\n return result;\n };\n }\n}\n\n// src/getDefaultMiddleware.ts\nfunction isBoolean(x) {\n return typeof x === \"boolean\";\n}\nvar buildGetDefaultMiddleware = () => function getDefaultMiddleware(options) {\n const {\n thunk = true,\n immutableCheck = true,\n serializableCheck = true,\n actionCreatorCheck = true\n } = options ?? {};\n let middlewareArray = new Tuple();\n if (thunk) {\n if (isBoolean(thunk)) {\n middlewareArray.push(thunkMiddleware);\n } else {\n middlewareArray.push(withExtraArgument(thunk.extraArgument));\n }\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (immutableCheck) {\n let immutableOptions = {};\n if (!isBoolean(immutableCheck)) {\n immutableOptions = immutableCheck;\n }\n middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));\n }\n if (serializableCheck) {\n let serializableOptions = {};\n if (!isBoolean(serializableCheck)) {\n serializableOptions = serializableCheck;\n }\n middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));\n }\n if (actionCreatorCheck) {\n let actionCreatorOptions = {};\n if (!isBoolean(actionCreatorCheck)) {\n actionCreatorOptions = actionCreatorCheck;\n }\n middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions));\n }\n }\n return middlewareArray;\n};\n\n// src/autoBatchEnhancer.ts\nvar SHOULD_AUTOBATCH = \"RTK_autoBatch\";\nvar prepareAutoBatched = () => (payload) => ({\n payload,\n meta: {\n [SHOULD_AUTOBATCH]: true\n }\n});\nvar createQueueWithTimer = (timeout) => {\n return (notify) => {\n setTimeout(notify, timeout);\n };\n};\nvar rAF = typeof window !== \"undefined\" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10);\nvar autoBatchEnhancer = (options = {\n type: \"raf\"\n}) => (next) => (...args) => {\n const store = next(...args);\n let notifying = true;\n let shouldNotifyAtEndOfTick = false;\n let notificationQueued = false;\n const listeners = /* @__PURE__ */ new Set();\n const queueCallback = options.type === \"tick\" ? queueMicrotask : options.type === \"raf\" ? rAF : options.type === \"callback\" ? options.queueNotification : createQueueWithTimer(options.timeout);\n const notifyListeners = () => {\n notificationQueued = false;\n if (shouldNotifyAtEndOfTick) {\n shouldNotifyAtEndOfTick = false;\n listeners.forEach((l) => l());\n }\n };\n return Object.assign({}, store, {\n // Override the base `store.subscribe` method to keep original listeners\n // from running if we're delaying notifications\n subscribe(listener2) {\n const wrappedListener = () => notifying && listener2();\n const unsubscribe = store.subscribe(wrappedListener);\n listeners.add(listener2);\n return () => {\n unsubscribe();\n listeners.delete(listener2);\n };\n },\n // Override the base `store.dispatch` method so that we can check actions\n // for the `shouldAutoBatch` flag and determine if batching is active\n dispatch(action) {\n try {\n notifying = !action?.meta?.[SHOULD_AUTOBATCH];\n shouldNotifyAtEndOfTick = !notifying;\n if (shouldNotifyAtEndOfTick) {\n if (!notificationQueued) {\n notificationQueued = true;\n queueCallback(notifyListeners);\n }\n }\n return store.dispatch(action);\n } finally {\n notifying = true;\n }\n }\n });\n};\n\n// src/getDefaultEnhancers.ts\nvar buildGetDefaultEnhancers = (middlewareEnhancer) => function getDefaultEnhancers(options) {\n const {\n autoBatch = true\n } = options ?? {};\n let enhancerArray = new Tuple(middlewareEnhancer);\n if (autoBatch) {\n enhancerArray.push(autoBatchEnhancer(typeof autoBatch === \"object\" ? autoBatch : void 0));\n }\n return enhancerArray;\n};\n\n// src/configureStore.ts\nvar IS_PRODUCTION = process.env.NODE_ENV === \"production\";\nfunction configureStore(options) {\n const getDefaultMiddleware = buildGetDefaultMiddleware();\n const {\n reducer = void 0,\n middleware,\n devTools = true,\n preloadedState = void 0,\n enhancers = void 0\n } = options || {};\n let rootReducer;\n if (typeof reducer === \"function\") {\n rootReducer = reducer;\n } else if (isPlainObject2(reducer)) {\n rootReducer = combineReducers(reducer);\n } else {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : \"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers\");\n }\n if (!IS_PRODUCTION && middleware && typeof middleware !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : \"`middleware` field must be a callback\");\n }\n let finalMiddleware;\n if (typeof middleware === \"function\") {\n finalMiddleware = middleware(getDefaultMiddleware);\n if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : \"when using a middleware builder function, an array of middleware must be returned\");\n }\n } else {\n finalMiddleware = getDefaultMiddleware();\n }\n if (!IS_PRODUCTION && finalMiddleware.some((item) => typeof item !== \"function\")) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : \"each middleware provided to configureStore must be a function\");\n }\n let finalCompose = compose2;\n if (devTools) {\n finalCompose = composeWithDevTools({\n // Enable capture of stack traces for dispatched Redux actions\n trace: !IS_PRODUCTION,\n ...typeof devTools === \"object\" && devTools\n });\n }\n const middlewareEnhancer = applyMiddleware(...finalMiddleware);\n const getDefaultEnhancers = buildGetDefaultEnhancers(middlewareEnhancer);\n if (!IS_PRODUCTION && enhancers && typeof enhancers !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : \"`enhancers` field must be a callback\");\n }\n let storeEnhancers = typeof enhancers === \"function\" ? enhancers(getDefaultEnhancers) : getDefaultEnhancers();\n if (!IS_PRODUCTION && !Array.isArray(storeEnhancers)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : \"`enhancers` callback must return an array\");\n }\n if (!IS_PRODUCTION && storeEnhancers.some((item) => typeof item !== \"function\")) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : \"each enhancer provided to configureStore must be a function\");\n }\n if (!IS_PRODUCTION && finalMiddleware.length && !storeEnhancers.includes(middlewareEnhancer)) {\n console.error(\"middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`\");\n }\n const composedEnhancer = finalCompose(...storeEnhancers);\n return createStore(rootReducer, preloadedState, composedEnhancer);\n}\n\n// src/createReducer.ts\nimport { produce as createNextState2, isDraft as isDraft2, isDraftable as isDraftable2 } from \"immer\";\n\n// src/mapBuilders.ts\nfunction executeReducerBuilderCallback(builderCallback) {\n const actionsMap = {};\n const actionMatchers = [];\n let defaultCaseReducer;\n const builder = {\n addCase(typeOrActionCreator, reducer) {\n if (process.env.NODE_ENV !== \"production\") {\n if (actionMatchers.length > 0) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(26) : \"`builder.addCase` should only be called before calling `builder.addMatcher`\");\n }\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(27) : \"`builder.addCase` should only be called before calling `builder.addDefaultCase`\");\n }\n }\n const type = typeof typeOrActionCreator === \"string\" ? typeOrActionCreator : typeOrActionCreator.type;\n if (!type) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(28) : \"`builder.addCase` cannot be called with an empty action type\");\n }\n if (type in actionsMap) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(29) : `\\`builder.addCase\\` cannot be called with two reducers for the same action type '${type}'`);\n }\n actionsMap[type] = reducer;\n return builder;\n },\n addMatcher(matcher, reducer) {\n if (process.env.NODE_ENV !== \"production\") {\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(30) : \"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`\");\n }\n }\n actionMatchers.push({\n matcher,\n reducer\n });\n return builder;\n },\n addDefaultCase(reducer) {\n if (process.env.NODE_ENV !== \"production\") {\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(31) : \"`builder.addDefaultCase` can only be called once\");\n }\n }\n defaultCaseReducer = reducer;\n return builder;\n }\n };\n builderCallback(builder);\n return [actionsMap, actionMatchers, defaultCaseReducer];\n}\n\n// src/createReducer.ts\nfunction isStateFunction(x) {\n return typeof x === \"function\";\n}\nfunction createReducer(initialState, mapOrBuilderCallback) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof mapOrBuilderCallback === \"object\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : \"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer\");\n }\n }\n let [actionsMap, finalActionMatchers, finalDefaultCaseReducer] = executeReducerBuilderCallback(mapOrBuilderCallback);\n let getInitialState;\n if (isStateFunction(initialState)) {\n getInitialState = () => freezeDraftable(initialState());\n } else {\n const frozenInitialState = freezeDraftable(initialState);\n getInitialState = () => frozenInitialState;\n }\n function reducer(state = getInitialState(), action) {\n let caseReducers = [actionsMap[action.type], ...finalActionMatchers.filter(({\n matcher\n }) => matcher(action)).map(({\n reducer: reducer2\n }) => reducer2)];\n if (caseReducers.filter((cr) => !!cr).length === 0) {\n caseReducers = [finalDefaultCaseReducer];\n }\n return caseReducers.reduce((previousState, caseReducer) => {\n if (caseReducer) {\n if (isDraft2(previousState)) {\n const draft = previousState;\n const result = caseReducer(draft, action);\n if (result === void 0) {\n return previousState;\n }\n return result;\n } else if (!isDraftable2(previousState)) {\n const result = caseReducer(previousState, action);\n if (result === void 0) {\n if (previousState === null) {\n return previousState;\n }\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : \"A case reducer on a non-draftable value must not return undefined\");\n }\n return result;\n } else {\n return createNextState2(previousState, (draft) => {\n return caseReducer(draft, action);\n });\n }\n }\n return previousState;\n }, state);\n }\n reducer.getInitialState = getInitialState;\n return reducer;\n}\n\n// src/nanoid.ts\nvar urlAlphabet = \"ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW\";\nvar nanoid = (size = 21) => {\n let id = \"\";\n let i = size;\n while (i--) {\n id += urlAlphabet[Math.random() * 64 | 0];\n }\n return id;\n};\n\n// src/matchers.ts\nvar matches = (matcher, action) => {\n if (hasMatchFunction(matcher)) {\n return matcher.match(action);\n } else {\n return matcher(action);\n }\n};\nfunction isAnyOf(...matchers) {\n return (action) => {\n return matchers.some((matcher) => matches(matcher, action));\n };\n}\nfunction isAllOf(...matchers) {\n return (action) => {\n return matchers.every((matcher) => matches(matcher, action));\n };\n}\nfunction hasExpectedRequestMetadata(action, validStatus) {\n if (!action || !action.meta)\n return false;\n const hasValidRequestId = typeof action.meta.requestId === \"string\";\n const hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;\n return hasValidRequestId && hasValidRequestStatus;\n}\nfunction isAsyncThunkArray(a) {\n return typeof a[0] === \"function\" && \"pending\" in a[0] && \"fulfilled\" in a[0] && \"rejected\" in a[0];\n}\nfunction isPending(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"pending\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isPending()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.pending));\n}\nfunction isRejected(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"rejected\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isRejected()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.rejected));\n}\nfunction isRejectedWithValue(...asyncThunks) {\n const hasFlag = (action) => {\n return action && action.meta && action.meta.rejectedWithValue;\n };\n if (asyncThunks.length === 0) {\n return isAllOf(isRejected(...asyncThunks), hasFlag);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isRejectedWithValue()(asyncThunks[0]);\n }\n return isAllOf(isRejected(...asyncThunks), hasFlag);\n}\nfunction isFulfilled(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"fulfilled\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isFulfilled()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.fulfilled));\n}\nfunction isAsyncThunkAction(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"pending\", \"fulfilled\", \"rejected\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isAsyncThunkAction()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.flatMap((asyncThunk) => [asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled]));\n}\n\n// src/createAsyncThunk.ts\nvar commonProperties = [\"name\", \"message\", \"stack\", \"code\"];\nvar RejectWithValue = class {\n constructor(payload, meta) {\n this.payload = payload;\n this.meta = meta;\n }\n /*\n type-only property to distinguish between RejectWithValue and FulfillWithMeta\n does not exist at runtime\n */\n _type;\n};\nvar FulfillWithMeta = class {\n constructor(payload, meta) {\n this.payload = payload;\n this.meta = meta;\n }\n /*\n type-only property to distinguish between RejectWithValue and FulfillWithMeta\n does not exist at runtime\n */\n _type;\n};\nvar miniSerializeError = (value) => {\n if (typeof value === \"object\" && value !== null) {\n const simpleError = {};\n for (const property of commonProperties) {\n if (typeof value[property] === \"string\") {\n simpleError[property] = value[property];\n }\n }\n return simpleError;\n }\n return {\n message: String(value)\n };\n};\nvar createAsyncThunk = /* @__PURE__ */ (() => {\n function createAsyncThunk2(typePrefix, payloadCreator, options) {\n const fulfilled = createAction(typePrefix + \"/fulfilled\", (payload, requestId, arg, meta) => ({\n payload,\n meta: {\n ...meta || {},\n arg,\n requestId,\n requestStatus: \"fulfilled\"\n }\n }));\n const pending = createAction(typePrefix + \"/pending\", (requestId, arg, meta) => ({\n payload: void 0,\n meta: {\n ...meta || {},\n arg,\n requestId,\n requestStatus: \"pending\"\n }\n }));\n const rejected = createAction(typePrefix + \"/rejected\", (error, requestId, arg, payload, meta) => ({\n payload,\n error: (options && options.serializeError || miniSerializeError)(error || \"Rejected\"),\n meta: {\n ...meta || {},\n arg,\n requestId,\n rejectedWithValue: !!payload,\n requestStatus: \"rejected\",\n aborted: error?.name === \"AbortError\",\n condition: error?.name === \"ConditionError\"\n }\n }));\n function actionCreator(arg) {\n return (dispatch, getState, extra) => {\n const requestId = options?.idGenerator ? options.idGenerator(arg) : nanoid();\n const abortController = new AbortController();\n let abortHandler;\n let abortReason;\n function abort(reason) {\n abortReason = reason;\n abortController.abort();\n }\n const promise = async function() {\n let finalAction;\n try {\n let conditionResult = options?.condition?.(arg, {\n getState,\n extra\n });\n if (isThenable(conditionResult)) {\n conditionResult = await conditionResult;\n }\n if (conditionResult === false || abortController.signal.aborted) {\n throw {\n name: \"ConditionError\",\n message: \"Aborted due to condition callback returning false.\"\n };\n }\n const abortedPromise = new Promise((_, reject) => {\n abortHandler = () => {\n reject({\n name: \"AbortError\",\n message: abortReason || \"Aborted\"\n });\n };\n abortController.signal.addEventListener(\"abort\", abortHandler);\n });\n dispatch(pending(requestId, arg, options?.getPendingMeta?.({\n requestId,\n arg\n }, {\n getState,\n extra\n })));\n finalAction = await Promise.race([abortedPromise, Promise.resolve(payloadCreator(arg, {\n dispatch,\n getState,\n extra,\n requestId,\n signal: abortController.signal,\n abort,\n rejectWithValue: (value, meta) => {\n return new RejectWithValue(value, meta);\n },\n fulfillWithValue: (value, meta) => {\n return new FulfillWithMeta(value, meta);\n }\n })).then((result) => {\n if (result instanceof RejectWithValue) {\n throw result;\n }\n if (result instanceof FulfillWithMeta) {\n return fulfilled(result.payload, requestId, arg, result.meta);\n }\n return fulfilled(result, requestId, arg);\n })]);\n } catch (err) {\n finalAction = err instanceof RejectWithValue ? rejected(null, requestId, arg, err.payload, err.meta) : rejected(err, requestId, arg);\n } finally {\n if (abortHandler) {\n abortController.signal.removeEventListener(\"abort\", abortHandler);\n }\n }\n const skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;\n if (!skipDispatch) {\n dispatch(finalAction);\n }\n return finalAction;\n }();\n return Object.assign(promise, {\n abort,\n requestId,\n arg,\n unwrap() {\n return promise.then(unwrapResult);\n }\n });\n };\n }\n return Object.assign(actionCreator, {\n pending,\n rejected,\n fulfilled,\n settled: isAnyOf(rejected, fulfilled),\n typePrefix\n });\n }\n createAsyncThunk2.withTypes = () => createAsyncThunk2;\n return createAsyncThunk2;\n})();\nfunction unwrapResult(action) {\n if (action.meta && action.meta.rejectedWithValue) {\n throw action.payload;\n }\n if (action.error) {\n throw action.error;\n }\n return action.payload;\n}\nfunction isThenable(value) {\n return value !== null && typeof value === \"object\" && typeof value.then === \"function\";\n}\n\n// src/createSlice.ts\nvar asyncThunkSymbol = /* @__PURE__ */ Symbol.for(\"rtk-slice-createasyncthunk\");\nvar asyncThunkCreator = {\n [asyncThunkSymbol]: createAsyncThunk\n};\nvar ReducerType = /* @__PURE__ */ ((ReducerType2) => {\n ReducerType2[\"reducer\"] = \"reducer\";\n ReducerType2[\"reducerWithPrepare\"] = \"reducerWithPrepare\";\n ReducerType2[\"asyncThunk\"] = \"asyncThunk\";\n return ReducerType2;\n})(ReducerType || {});\nfunction getType(slice, actionKey) {\n return `${slice}/${actionKey}`;\n}\nfunction buildCreateSlice({\n creators\n} = {}) {\n const cAT = creators?.asyncThunk?.[asyncThunkSymbol];\n return function createSlice2(options) {\n const {\n name,\n reducerPath = name\n } = options;\n if (!name) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : \"`name` is a required option for createSlice\");\n }\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n if (options.initialState === void 0) {\n console.error(\"You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`\");\n }\n }\n const reducers = (typeof options.reducers === \"function\" ? options.reducers(buildReducerCreators()) : options.reducers) || {};\n const reducerNames = Object.keys(reducers);\n const context = {\n sliceCaseReducersByName: {},\n sliceCaseReducersByType: {},\n actionCreators: {},\n sliceMatchers: []\n };\n const contextMethods = {\n addCase(typeOrActionCreator, reducer2) {\n const type = typeof typeOrActionCreator === \"string\" ? typeOrActionCreator : typeOrActionCreator.type;\n if (!type) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : \"`context.addCase` cannot be called with an empty action type\");\n }\n if (type in context.sliceCaseReducersByType) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : \"`context.addCase` cannot be called with two reducers for the same action type: \" + type);\n }\n context.sliceCaseReducersByType[type] = reducer2;\n return contextMethods;\n },\n addMatcher(matcher, reducer2) {\n context.sliceMatchers.push({\n matcher,\n reducer: reducer2\n });\n return contextMethods;\n },\n exposeAction(name2, actionCreator) {\n context.actionCreators[name2] = actionCreator;\n return contextMethods;\n },\n exposeCaseReducer(name2, reducer2) {\n context.sliceCaseReducersByName[name2] = reducer2;\n return contextMethods;\n }\n };\n reducerNames.forEach((reducerName) => {\n const reducerDefinition = reducers[reducerName];\n const reducerDetails = {\n reducerName,\n type: getType(name, reducerName),\n createNotation: typeof options.reducers === \"function\"\n };\n if (isAsyncThunkSliceReducerDefinition(reducerDefinition)) {\n handleThunkCaseReducerDefinition(reducerDetails, reducerDefinition, contextMethods, cAT);\n } else {\n handleNormalReducerDefinition(reducerDetails, reducerDefinition, contextMethods);\n }\n });\n function buildReducer() {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof options.extraReducers === \"object\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : \"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice\");\n }\n }\n const [extraReducers = {}, actionMatchers = [], defaultCaseReducer = void 0] = typeof options.extraReducers === \"function\" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers];\n const finalCaseReducers = {\n ...extraReducers,\n ...context.sliceCaseReducersByType\n };\n return createReducer(options.initialState, (builder) => {\n for (let key in finalCaseReducers) {\n builder.addCase(key, finalCaseReducers[key]);\n }\n for (let sM of context.sliceMatchers) {\n builder.addMatcher(sM.matcher, sM.reducer);\n }\n for (let m of actionMatchers) {\n builder.addMatcher(m.matcher, m.reducer);\n }\n if (defaultCaseReducer) {\n builder.addDefaultCase(defaultCaseReducer);\n }\n });\n }\n const selectSelf = (state) => state;\n const injectedSelectorCache = /* @__PURE__ */ new Map();\n let _reducer;\n function reducer(state, action) {\n if (!_reducer)\n _reducer = buildReducer();\n return _reducer(state, action);\n }\n function getInitialState() {\n if (!_reducer)\n _reducer = buildReducer();\n return _reducer.getInitialState();\n }\n function makeSelectorProps(reducerPath2, injected = false) {\n function selectSlice(state) {\n let sliceState = state[reducerPath2];\n if (typeof sliceState === \"undefined\") {\n if (injected) {\n sliceState = getInitialState();\n } else if (process.env.NODE_ENV !== \"production\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : \"selectSlice returned undefined for an uninjected slice reducer\");\n }\n }\n return sliceState;\n }\n function getSelectors(selectState = selectSelf) {\n const selectorCache = emplace(injectedSelectorCache, injected, {\n insert: () => /* @__PURE__ */ new WeakMap()\n });\n return emplace(selectorCache, selectState, {\n insert: () => {\n const map = {};\n for (const [name2, selector] of Object.entries(options.selectors ?? {})) {\n map[name2] = wrapSelector(selector, selectState, getInitialState, injected);\n }\n return map;\n }\n });\n }\n return {\n reducerPath: reducerPath2,\n getSelectors,\n get selectors() {\n return getSelectors(selectSlice);\n },\n selectSlice\n };\n }\n const slice = {\n name,\n reducer,\n actions: context.actionCreators,\n caseReducers: context.sliceCaseReducersByName,\n getInitialState,\n ...makeSelectorProps(reducerPath),\n injectInto(injectable, {\n reducerPath: pathOpt,\n ...config\n } = {}) {\n const newReducerPath = pathOpt ?? reducerPath;\n injectable.inject({\n reducerPath: newReducerPath,\n reducer\n }, config);\n return {\n ...slice,\n ...makeSelectorProps(newReducerPath, true)\n };\n }\n };\n return slice;\n };\n}\nfunction wrapSelector(selector, selectState, getInitialState, injected) {\n function wrapper(rootState, ...args) {\n let sliceState = selectState(rootState);\n if (typeof sliceState === \"undefined\") {\n if (injected) {\n sliceState = getInitialState();\n } else if (process.env.NODE_ENV !== \"production\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : \"selectState returned undefined for an uninjected slice reducer\");\n }\n }\n return selector(sliceState, ...args);\n }\n wrapper.unwrapped = selector;\n return wrapper;\n}\nvar createSlice = /* @__PURE__ */ buildCreateSlice();\nfunction buildReducerCreators() {\n function asyncThunk(payloadCreator, config) {\n return {\n _reducerDefinitionType: \"asyncThunk\" /* asyncThunk */,\n payloadCreator,\n ...config\n };\n }\n asyncThunk.withTypes = () => asyncThunk;\n return {\n reducer(caseReducer) {\n return Object.assign({\n // hack so the wrapping function has the same name as the original\n // we need to create a wrapper so the `reducerDefinitionType` is not assigned to the original\n [caseReducer.name](...args) {\n return caseReducer(...args);\n }\n }[caseReducer.name], {\n _reducerDefinitionType: \"reducer\" /* reducer */\n });\n },\n preparedReducer(prepare, reducer) {\n return {\n _reducerDefinitionType: \"reducerWithPrepare\" /* reducerWithPrepare */,\n prepare,\n reducer\n };\n },\n asyncThunk\n };\n}\nfunction handleNormalReducerDefinition({\n type,\n reducerName,\n createNotation\n}, maybeReducerWithPrepare, context) {\n let caseReducer;\n let prepareCallback;\n if (\"reducer\" in maybeReducerWithPrepare) {\n if (createNotation && !isCaseReducerWithPrepareDefinition(maybeReducerWithPrepare)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(17) : \"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.\");\n }\n caseReducer = maybeReducerWithPrepare.reducer;\n prepareCallback = maybeReducerWithPrepare.prepare;\n } else {\n caseReducer = maybeReducerWithPrepare;\n }\n context.addCase(type, caseReducer).exposeCaseReducer(reducerName, caseReducer).exposeAction(reducerName, prepareCallback ? createAction(type, prepareCallback) : createAction(type));\n}\nfunction isAsyncThunkSliceReducerDefinition(reducerDefinition) {\n return reducerDefinition._reducerDefinitionType === \"asyncThunk\" /* asyncThunk */;\n}\nfunction isCaseReducerWithPrepareDefinition(reducerDefinition) {\n return reducerDefinition._reducerDefinitionType === \"reducerWithPrepare\" /* reducerWithPrepare */;\n}\nfunction handleThunkCaseReducerDefinition({\n type,\n reducerName\n}, reducerDefinition, context, cAT) {\n if (!cAT) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(18) : \"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.\");\n }\n const {\n payloadCreator,\n fulfilled,\n pending,\n rejected,\n settled,\n options\n } = reducerDefinition;\n const thunk = cAT(type, payloadCreator, options);\n context.exposeAction(reducerName, thunk);\n if (fulfilled) {\n context.addCase(thunk.fulfilled, fulfilled);\n }\n if (pending) {\n context.addCase(thunk.pending, pending);\n }\n if (rejected) {\n context.addCase(thunk.rejected, rejected);\n }\n if (settled) {\n context.addMatcher(thunk.settled, settled);\n }\n context.exposeCaseReducer(reducerName, {\n fulfilled: fulfilled || noop,\n pending: pending || noop,\n rejected: rejected || noop,\n settled: settled || noop\n });\n}\nfunction noop() {\n}\n\n// src/entities/entity_state.ts\nfunction getInitialEntityState() {\n return {\n ids: [],\n entities: {}\n };\n}\nfunction createInitialStateFactory(stateAdapter) {\n function getInitialState(additionalState = {}, entities) {\n const state = Object.assign(getInitialEntityState(), additionalState);\n return entities ? stateAdapter.setAll(state, entities) : state;\n }\n return {\n getInitialState\n };\n}\n\n// src/entities/state_selectors.ts\nfunction createSelectorsFactory() {\n function getSelectors(selectState, options = {}) {\n const {\n createSelector: createSelector2 = createDraftSafeSelector\n } = options;\n const selectIds = (state) => state.ids;\n const selectEntities = (state) => state.entities;\n const selectAll = createSelector2(selectIds, selectEntities, (ids, entities) => ids.map((id) => entities[id]));\n const selectId = (_, id) => id;\n const selectById = (entities, id) => entities[id];\n const selectTotal = createSelector2(selectIds, (ids) => ids.length);\n if (!selectState) {\n return {\n selectIds,\n selectEntities,\n selectAll,\n selectTotal,\n selectById: createSelector2(selectEntities, selectId, selectById)\n };\n }\n const selectGlobalizedEntities = createSelector2(selectState, selectEntities);\n return {\n selectIds: createSelector2(selectState, selectIds),\n selectEntities: selectGlobalizedEntities,\n selectAll: createSelector2(selectState, selectAll),\n selectTotal: createSelector2(selectState, selectTotal),\n selectById: createSelector2(selectGlobalizedEntities, selectId, selectById)\n };\n }\n return {\n getSelectors\n };\n}\n\n// src/entities/sorted_state_adapter.ts\nimport { current as current3 } from \"immer\";\n\n// src/entities/state_adapter.ts\nimport { produce as createNextState3, isDraft as isDraft3 } from \"immer\";\nvar isDraftTyped = isDraft3;\nfunction createSingleArgumentStateOperator(mutator) {\n const operator = createStateOperator((_, state) => mutator(state));\n return function operation(state) {\n return operator(state, void 0);\n };\n}\nfunction createStateOperator(mutator) {\n return function operation(state, arg) {\n function isPayloadActionArgument(arg2) {\n return isFSA(arg2);\n }\n const runMutator = (draft) => {\n if (isPayloadActionArgument(arg)) {\n mutator(arg.payload, draft);\n } else {\n mutator(arg, draft);\n }\n };\n if (isDraftTyped(state)) {\n runMutator(state);\n return state;\n }\n return createNextState3(state, runMutator);\n };\n}\n\n// src/entities/utils.ts\nimport { current as current2, isDraft as isDraft4 } from \"immer\";\nfunction selectIdValue(entity, selectId) {\n const key = selectId(entity);\n if (process.env.NODE_ENV !== \"production\" && key === void 0) {\n console.warn(\"The entity passed to the `selectId` implementation returned undefined.\", \"You should probably provide your own `selectId` implementation.\", \"The entity that was passed:\", entity, \"The `selectId` implementation:\", selectId.toString());\n }\n return key;\n}\nfunction ensureEntitiesArray(entities) {\n if (!Array.isArray(entities)) {\n entities = Object.values(entities);\n }\n return entities;\n}\nfunction getCurrent(value) {\n return isDraft4(value) ? current2(value) : value;\n}\nfunction splitAddedUpdatedEntities(newEntities, selectId, state) {\n newEntities = ensureEntitiesArray(newEntities);\n const existingIdsArray = getCurrent(state.ids);\n const existingIds = new Set(existingIdsArray);\n const added = [];\n const updated = [];\n for (const entity of newEntities) {\n const id = selectIdValue(entity, selectId);\n if (existingIds.has(id)) {\n updated.push({\n id,\n changes: entity\n });\n } else {\n added.push(entity);\n }\n }\n return [added, updated, existingIdsArray];\n}\n\n// src/entities/unsorted_state_adapter.ts\nfunction createUnsortedStateAdapter(selectId) {\n function addOneMutably(entity, state) {\n const key = selectIdValue(entity, selectId);\n if (key in state.entities) {\n return;\n }\n state.ids.push(key);\n state.entities[key] = entity;\n }\n function addManyMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n for (const entity of newEntities) {\n addOneMutably(entity, state);\n }\n }\n function setOneMutably(entity, state) {\n const key = selectIdValue(entity, selectId);\n if (!(key in state.entities)) {\n state.ids.push(key);\n }\n ;\n state.entities[key] = entity;\n }\n function setManyMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n for (const entity of newEntities) {\n setOneMutably(entity, state);\n }\n }\n function setAllMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n state.ids = [];\n state.entities = {};\n addManyMutably(newEntities, state);\n }\n function removeOneMutably(key, state) {\n return removeManyMutably([key], state);\n }\n function removeManyMutably(keys, state) {\n let didMutate = false;\n keys.forEach((key) => {\n if (key in state.entities) {\n delete state.entities[key];\n didMutate = true;\n }\n });\n if (didMutate) {\n state.ids = state.ids.filter((id) => id in state.entities);\n }\n }\n function removeAllMutably(state) {\n Object.assign(state, {\n ids: [],\n entities: {}\n });\n }\n function takeNewKey(keys, update, state) {\n const original3 = state.entities[update.id];\n if (original3 === void 0) {\n return false;\n }\n const updated = Object.assign({}, original3, update.changes);\n const newKey = selectIdValue(updated, selectId);\n const hasNewKey = newKey !== update.id;\n if (hasNewKey) {\n keys[update.id] = newKey;\n delete state.entities[update.id];\n }\n ;\n state.entities[newKey] = updated;\n return hasNewKey;\n }\n function updateOneMutably(update, state) {\n return updateManyMutably([update], state);\n }\n function updateManyMutably(updates, state) {\n const newKeys = {};\n const updatesPerEntity = {};\n updates.forEach((update) => {\n if (update.id in state.entities) {\n updatesPerEntity[update.id] = {\n id: update.id,\n // Spreads ignore falsy values, so this works even if there isn't\n // an existing update already at this key\n changes: {\n ...updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null,\n ...update.changes\n }\n };\n }\n });\n updates = Object.values(updatesPerEntity);\n const didMutateEntities = updates.length > 0;\n if (didMutateEntities) {\n const didMutateIds = updates.filter((update) => takeNewKey(newKeys, update, state)).length > 0;\n if (didMutateIds) {\n state.ids = Object.values(state.entities).map((e) => selectIdValue(e, selectId));\n }\n }\n }\n function upsertOneMutably(entity, state) {\n return upsertManyMutably([entity], state);\n }\n function upsertManyMutably(newEntities, state) {\n const [added, updated] = splitAddedUpdatedEntities(newEntities, selectId, state);\n updateManyMutably(updated, state);\n addManyMutably(added, state);\n }\n return {\n removeAll: createSingleArgumentStateOperator(removeAllMutably),\n addOne: createStateOperator(addOneMutably),\n addMany: createStateOperator(addManyMutably),\n setOne: createStateOperator(setOneMutably),\n setMany: createStateOperator(setManyMutably),\n setAll: createStateOperator(setAllMutably),\n updateOne: createStateOperator(updateOneMutably),\n updateMany: createStateOperator(updateManyMutably),\n upsertOne: createStateOperator(upsertOneMutably),\n upsertMany: createStateOperator(upsertManyMutably),\n removeOne: createStateOperator(removeOneMutably),\n removeMany: createStateOperator(removeManyMutably)\n };\n}\n\n// src/entities/sorted_state_adapter.ts\nfunction findInsertIndex(sortedItems, item, comparisonFunction) {\n let lowIndex = 0;\n let highIndex = sortedItems.length;\n while (lowIndex < highIndex) {\n let middleIndex = lowIndex + highIndex >>> 1;\n const currentItem = sortedItems[middleIndex];\n const res = comparisonFunction(item, currentItem);\n if (res >= 0) {\n lowIndex = middleIndex + 1;\n } else {\n highIndex = middleIndex;\n }\n }\n return lowIndex;\n}\nfunction insert(sortedItems, item, comparisonFunction) {\n const insertAtIndex = findInsertIndex(sortedItems, item, comparisonFunction);\n sortedItems.splice(insertAtIndex, 0, item);\n return sortedItems;\n}\nfunction createSortedStateAdapter(selectId, comparer) {\n const {\n removeOne,\n removeMany,\n removeAll\n } = createUnsortedStateAdapter(selectId);\n function addOneMutably(entity, state) {\n return addManyMutably([entity], state);\n }\n function addManyMutably(newEntities, state, existingIds) {\n newEntities = ensureEntitiesArray(newEntities);\n const existingKeys = new Set(existingIds ?? current3(state.ids));\n const models = newEntities.filter((model) => !existingKeys.has(selectIdValue(model, selectId)));\n if (models.length !== 0) {\n mergeFunction(state, models);\n }\n }\n function setOneMutably(entity, state) {\n return setManyMutably([entity], state);\n }\n function setManyMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n if (newEntities.length !== 0) {\n for (const item of newEntities) {\n delete state.entities[selectId(item)];\n }\n mergeFunction(state, newEntities);\n }\n }\n function setAllMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n state.entities = {};\n state.ids = [];\n addManyMutably(newEntities, state, []);\n }\n function updateOneMutably(update, state) {\n return updateManyMutably([update], state);\n }\n function updateManyMutably(updates, state) {\n let appliedUpdates = false;\n let replacedIds = false;\n for (let update of updates) {\n const entity = state.entities[update.id];\n if (!entity) {\n continue;\n }\n appliedUpdates = true;\n Object.assign(entity, update.changes);\n const newId = selectId(entity);\n if (update.id !== newId) {\n replacedIds = true;\n delete state.entities[update.id];\n const oldIndex = state.ids.indexOf(update.id);\n state.ids[oldIndex] = newId;\n state.entities[newId] = entity;\n }\n }\n if (appliedUpdates) {\n mergeFunction(state, [], appliedUpdates, replacedIds);\n }\n }\n function upsertOneMutably(entity, state) {\n return upsertManyMutably([entity], state);\n }\n function upsertManyMutably(newEntities, state) {\n const [added, updated, existingIdsArray] = splitAddedUpdatedEntities(newEntities, selectId, state);\n if (updated.length) {\n updateManyMutably(updated, state);\n }\n if (added.length) {\n addManyMutably(added, state, existingIdsArray);\n }\n }\n function areArraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length && i < b.length; i++) {\n if (a[i] === b[i]) {\n continue;\n }\n return false;\n }\n return true;\n }\n const mergeInsertion = (state, addedItems, appliedUpdates, replacedIds) => {\n const currentEntities = getCurrent(state.entities);\n const currentIds = getCurrent(state.ids);\n const stateEntities = state.entities;\n let ids = currentIds;\n if (replacedIds) {\n ids = Array.from(new Set(currentIds));\n }\n let sortedEntities = [];\n for (const id of ids) {\n const entity = currentEntities[id];\n if (entity) {\n sortedEntities.push(entity);\n }\n }\n const wasPreviouslyEmpty = sortedEntities.length === 0;\n for (const item of addedItems) {\n stateEntities[selectId(item)] = item;\n if (!wasPreviouslyEmpty) {\n insert(sortedEntities, item, comparer);\n }\n }\n if (wasPreviouslyEmpty) {\n sortedEntities = addedItems.slice().sort(comparer);\n } else if (appliedUpdates) {\n sortedEntities.sort(comparer);\n }\n const newSortedIds = sortedEntities.map(selectId);\n if (!areArraysEqual(currentIds, newSortedIds)) {\n state.ids = newSortedIds;\n }\n };\n const mergeFunction = mergeInsertion;\n return {\n removeOne,\n removeMany,\n removeAll,\n addOne: createStateOperator(addOneMutably),\n updateOne: createStateOperator(updateOneMutably),\n upsertOne: createStateOperator(upsertOneMutably),\n setOne: createStateOperator(setOneMutably),\n setMany: createStateOperator(setManyMutably),\n setAll: createStateOperator(setAllMutably),\n addMany: createStateOperator(addManyMutably),\n updateMany: createStateOperator(updateManyMutably),\n upsertMany: createStateOperator(upsertManyMutably)\n };\n}\n\n// src/entities/create_adapter.ts\nfunction createEntityAdapter(options = {}) {\n const {\n selectId,\n sortComparer\n } = {\n sortComparer: false,\n selectId: (instance) => instance.id,\n ...options\n };\n const stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);\n const stateFactory = createInitialStateFactory(stateAdapter);\n const selectorsFactory = createSelectorsFactory();\n return {\n selectId,\n sortComparer,\n ...stateFactory,\n ...selectorsFactory,\n ...stateAdapter\n };\n}\n\n// src/listenerMiddleware/index.ts\nimport { isAction as isAction3 } from \"redux\";\n\n// src/listenerMiddleware/exceptions.ts\nvar task = \"task\";\nvar listener = \"listener\";\nvar completed = \"completed\";\nvar cancelled = \"cancelled\";\nvar taskCancelled = `task-${cancelled}`;\nvar taskCompleted = `task-${completed}`;\nvar listenerCancelled = `${listener}-${cancelled}`;\nvar listenerCompleted = `${listener}-${completed}`;\nvar TaskAbortError = class {\n constructor(code) {\n this.code = code;\n this.message = `${task} ${cancelled} (reason: ${code})`;\n }\n name = \"TaskAbortError\";\n message;\n};\n\n// src/listenerMiddleware/utils.ts\nvar assertFunction = (func, expected) => {\n if (typeof func !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(32) : `${expected} is not a function`);\n }\n};\nvar noop2 = () => {\n};\nvar catchRejection = (promise, onError = noop2) => {\n promise.catch(onError);\n return promise;\n};\nvar addAbortSignalListener = (abortSignal, callback) => {\n abortSignal.addEventListener(\"abort\", callback, {\n once: true\n });\n return () => abortSignal.removeEventListener(\"abort\", callback);\n};\nvar abortControllerWithReason = (abortController, reason) => {\n const signal = abortController.signal;\n if (signal.aborted) {\n return;\n }\n if (!(\"reason\" in signal)) {\n Object.defineProperty(signal, \"reason\", {\n enumerable: true,\n value: reason,\n configurable: true,\n writable: true\n });\n }\n ;\n abortController.abort(reason);\n};\n\n// src/listenerMiddleware/task.ts\nvar validateActive = (signal) => {\n if (signal.aborted) {\n const {\n reason\n } = signal;\n throw new TaskAbortError(reason);\n }\n};\nfunction raceWithSignal(signal, promise) {\n let cleanup = noop2;\n return new Promise((resolve, reject) => {\n const notifyRejection = () => reject(new TaskAbortError(signal.reason));\n if (signal.aborted) {\n notifyRejection();\n return;\n }\n cleanup = addAbortSignalListener(signal, notifyRejection);\n promise.finally(() => cleanup()).then(resolve, reject);\n }).finally(() => {\n cleanup = noop2;\n });\n}\nvar runTask = async (task2, cleanUp) => {\n try {\n await Promise.resolve();\n const value = await task2();\n return {\n status: \"ok\",\n value\n };\n } catch (error) {\n return {\n status: error instanceof TaskAbortError ? \"cancelled\" : \"rejected\",\n error\n };\n } finally {\n cleanUp?.();\n }\n};\nvar createPause = (signal) => {\n return (promise) => {\n return catchRejection(raceWithSignal(signal, promise).then((output) => {\n validateActive(signal);\n return output;\n }));\n };\n};\nvar createDelay = (signal) => {\n const pause = createPause(signal);\n return (timeoutMs) => {\n return pause(new Promise((resolve) => setTimeout(resolve, timeoutMs)));\n };\n};\n\n// src/listenerMiddleware/index.ts\nvar {\n assign\n} = Object;\nvar INTERNAL_NIL_TOKEN = {};\nvar alm = \"listenerMiddleware\";\nvar createFork = (parentAbortSignal, parentBlockingPromises) => {\n const linkControllers = (controller) => addAbortSignalListener(parentAbortSignal, () => abortControllerWithReason(controller, parentAbortSignal.reason));\n return (taskExecutor, opts) => {\n assertFunction(taskExecutor, \"taskExecutor\");\n const childAbortController = new AbortController();\n linkControllers(childAbortController);\n const result = runTask(async () => {\n validateActive(parentAbortSignal);\n validateActive(childAbortController.signal);\n const result2 = await taskExecutor({\n pause: createPause(childAbortController.signal),\n delay: createDelay(childAbortController.signal),\n signal: childAbortController.signal\n });\n validateActive(childAbortController.signal);\n return result2;\n }, () => abortControllerWithReason(childAbortController, taskCompleted));\n if (opts?.autoJoin) {\n parentBlockingPromises.push(result.catch(noop2));\n }\n return {\n result: createPause(parentAbortSignal)(result),\n cancel() {\n abortControllerWithReason(childAbortController, taskCancelled);\n }\n };\n };\n};\nvar createTakePattern = (startListening, signal) => {\n const take = async (predicate, timeout) => {\n validateActive(signal);\n let unsubscribe = () => {\n };\n const tuplePromise = new Promise((resolve, reject) => {\n let stopListening = startListening({\n predicate,\n effect: (action, listenerApi) => {\n listenerApi.unsubscribe();\n resolve([action, listenerApi.getState(), listenerApi.getOriginalState()]);\n }\n });\n unsubscribe = () => {\n stopListening();\n reject();\n };\n });\n const promises = [tuplePromise];\n if (timeout != null) {\n promises.push(new Promise((resolve) => setTimeout(resolve, timeout, null)));\n }\n try {\n const output = await raceWithSignal(signal, Promise.race(promises));\n validateActive(signal);\n return output;\n } finally {\n unsubscribe();\n }\n };\n return (predicate, timeout) => catchRejection(take(predicate, timeout));\n};\nvar getListenerEntryPropsFrom = (options) => {\n let {\n type,\n actionCreator,\n matcher,\n predicate,\n effect\n } = options;\n if (type) {\n predicate = createAction(type).match;\n } else if (actionCreator) {\n type = actionCreator.type;\n predicate = actionCreator.match;\n } else if (matcher) {\n predicate = matcher;\n } else if (predicate) {\n } else {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(21) : \"Creating or removing a listener requires one of the known fields for matching an action\");\n }\n assertFunction(effect, \"options.listener\");\n return {\n predicate,\n type,\n effect\n };\n};\nvar createListenerEntry = Object.assign((options) => {\n const {\n type,\n predicate,\n effect\n } = getListenerEntryPropsFrom(options);\n const id = nanoid();\n const entry = {\n id,\n effect,\n type,\n predicate,\n pending: /* @__PURE__ */ new Set(),\n unsubscribe: () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(22) : \"Unsubscribe not initialized\");\n }\n };\n return entry;\n}, {\n withTypes: () => createListenerEntry\n});\nvar cancelActiveListeners = (entry) => {\n entry.pending.forEach((controller) => {\n abortControllerWithReason(controller, listenerCancelled);\n });\n};\nvar createClearListenerMiddleware = (listenerMap) => {\n return () => {\n listenerMap.forEach(cancelActiveListeners);\n listenerMap.clear();\n };\n};\nvar safelyNotifyError = (errorHandler, errorToNotify, errorInfo) => {\n try {\n errorHandler(errorToNotify, errorInfo);\n } catch (errorHandlerError) {\n setTimeout(() => {\n throw errorHandlerError;\n }, 0);\n }\n};\nvar addListener = Object.assign(createAction(`${alm}/add`), {\n withTypes: () => addListener\n});\nvar clearAllListeners = createAction(`${alm}/removeAll`);\nvar removeListener = Object.assign(createAction(`${alm}/remove`), {\n withTypes: () => removeListener\n});\nvar defaultErrorHandler = (...args) => {\n console.error(`${alm}/error`, ...args);\n};\nvar createListenerMiddleware = (middlewareOptions = {}) => {\n const listenerMap = /* @__PURE__ */ new Map();\n const {\n extra,\n onError = defaultErrorHandler\n } = middlewareOptions;\n assertFunction(onError, \"onError\");\n const insertEntry = (entry) => {\n entry.unsubscribe = () => listenerMap.delete(entry.id);\n listenerMap.set(entry.id, entry);\n return (cancelOptions) => {\n entry.unsubscribe();\n if (cancelOptions?.cancelActive) {\n cancelActiveListeners(entry);\n }\n };\n };\n const startListening = (options) => {\n let entry = find(Array.from(listenerMap.values()), (existingEntry) => existingEntry.effect === options.effect);\n if (!entry) {\n entry = createListenerEntry(options);\n }\n return insertEntry(entry);\n };\n Object.assign(startListening, {\n withTypes: () => startListening\n });\n const stopListening = (options) => {\n const {\n type,\n effect,\n predicate\n } = getListenerEntryPropsFrom(options);\n const entry = find(Array.from(listenerMap.values()), (entry2) => {\n const matchPredicateOrType = typeof type === \"string\" ? entry2.type === type : entry2.predicate === predicate;\n return matchPredicateOrType && entry2.effect === effect;\n });\n if (entry) {\n entry.unsubscribe();\n if (options.cancelActive) {\n cancelActiveListeners(entry);\n }\n }\n return !!entry;\n };\n Object.assign(stopListening, {\n withTypes: () => stopListening\n });\n const notifyListener = async (entry, action, api, getOriginalState) => {\n const internalTaskController = new AbortController();\n const take = createTakePattern(startListening, internalTaskController.signal);\n const autoJoinPromises = [];\n try {\n entry.pending.add(internalTaskController);\n await Promise.resolve(entry.effect(\n action,\n // Use assign() rather than ... to avoid extra helper functions added to bundle\n assign({}, api, {\n getOriginalState,\n condition: (predicate, timeout) => take(predicate, timeout).then(Boolean),\n take,\n delay: createDelay(internalTaskController.signal),\n pause: createPause(internalTaskController.signal),\n extra,\n signal: internalTaskController.signal,\n fork: createFork(internalTaskController.signal, autoJoinPromises),\n unsubscribe: entry.unsubscribe,\n subscribe: () => {\n listenerMap.set(entry.id, entry);\n },\n cancelActiveListeners: () => {\n entry.pending.forEach((controller, _, set) => {\n if (controller !== internalTaskController) {\n abortControllerWithReason(controller, listenerCancelled);\n set.delete(controller);\n }\n });\n },\n cancel: () => {\n abortControllerWithReason(internalTaskController, listenerCancelled);\n entry.pending.delete(internalTaskController);\n },\n throwIfCancelled: () => {\n validateActive(internalTaskController.signal);\n }\n })\n ));\n } catch (listenerError) {\n if (!(listenerError instanceof TaskAbortError)) {\n safelyNotifyError(onError, listenerError, {\n raisedBy: \"effect\"\n });\n }\n } finally {\n await Promise.all(autoJoinPromises);\n abortControllerWithReason(internalTaskController, listenerCompleted);\n entry.pending.delete(internalTaskController);\n }\n };\n const clearListenerMiddleware = createClearListenerMiddleware(listenerMap);\n const middleware = (api) => (next) => (action) => {\n if (!isAction3(action)) {\n return next(action);\n }\n if (addListener.match(action)) {\n return startListening(action.payload);\n }\n if (clearAllListeners.match(action)) {\n clearListenerMiddleware();\n return;\n }\n if (removeListener.match(action)) {\n return stopListening(action.payload);\n }\n let originalState = api.getState();\n const getOriginalState = () => {\n if (originalState === INTERNAL_NIL_TOKEN) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(23) : `${alm}: getOriginalState can only be called synchronously`);\n }\n return originalState;\n };\n let result;\n try {\n result = next(action);\n if (listenerMap.size > 0) {\n const currentState = api.getState();\n const listenerEntries = Array.from(listenerMap.values());\n for (const entry of listenerEntries) {\n let runListener = false;\n try {\n runListener = entry.predicate(action, currentState, originalState);\n } catch (predicateError) {\n runListener = false;\n safelyNotifyError(onError, predicateError, {\n raisedBy: \"predicate\"\n });\n }\n if (!runListener) {\n continue;\n }\n notifyListener(entry, action, api, getOriginalState);\n }\n }\n } finally {\n originalState = INTERNAL_NIL_TOKEN;\n }\n return result;\n };\n return {\n middleware,\n startListening,\n stopListening,\n clearListeners: clearListenerMiddleware\n };\n};\n\n// src/dynamicMiddleware/index.ts\nimport { compose as compose3 } from \"redux\";\nvar createMiddlewareEntry = (middleware) => ({\n id: nanoid(),\n middleware,\n applied: /* @__PURE__ */ new Map()\n});\nvar matchInstance = (instanceId) => (action) => action?.meta?.instanceId === instanceId;\nvar createDynamicMiddleware = () => {\n const instanceId = nanoid();\n const middlewareMap = /* @__PURE__ */ new Map();\n const withMiddleware = Object.assign(createAction(\"dynamicMiddleware/add\", (...middlewares) => ({\n payload: middlewares,\n meta: {\n instanceId\n }\n })), {\n withTypes: () => withMiddleware\n });\n const addMiddleware = Object.assign(function addMiddleware2(...middlewares) {\n middlewares.forEach((middleware2) => {\n let entry = find(Array.from(middlewareMap.values()), (entry2) => entry2.middleware === middleware2);\n if (!entry) {\n entry = createMiddlewareEntry(middleware2);\n }\n middlewareMap.set(entry.id, entry);\n });\n }, {\n withTypes: () => addMiddleware\n });\n const getFinalMiddleware = (api) => {\n const appliedMiddleware = Array.from(middlewareMap.values()).map((entry) => emplace(entry.applied, api, {\n insert: () => entry.middleware(api)\n }));\n return compose3(...appliedMiddleware);\n };\n const isWithMiddleware = isAllOf(withMiddleware, matchInstance(instanceId));\n const middleware = (api) => (next) => (action) => {\n if (isWithMiddleware(action)) {\n addMiddleware(...action.payload);\n return api.dispatch;\n }\n return getFinalMiddleware(api)(next)(action);\n };\n return {\n middleware,\n addMiddleware,\n withMiddleware,\n instanceId\n };\n};\n\n// src/combineSlices.ts\nimport { combineReducers as combineReducers2 } from \"redux\";\nvar isSliceLike = (maybeSliceLike) => \"reducerPath\" in maybeSliceLike && typeof maybeSliceLike.reducerPath === \"string\";\nvar getReducers = (slices) => slices.flatMap((sliceOrMap) => isSliceLike(sliceOrMap) ? [[sliceOrMap.reducerPath, sliceOrMap.reducer]] : Object.entries(sliceOrMap));\nvar ORIGINAL_STATE = Symbol.for(\"rtk-state-proxy-original\");\nvar isStateProxy = (value) => !!value && !!value[ORIGINAL_STATE];\nvar stateProxyMap = /* @__PURE__ */ new WeakMap();\nvar createStateProxy = (state, reducerMap) => emplace(stateProxyMap, state, {\n insert: () => new Proxy(state, {\n get: (target, prop, receiver) => {\n if (prop === ORIGINAL_STATE)\n return target;\n const result = Reflect.get(target, prop, receiver);\n if (typeof result === \"undefined\") {\n const reducer = reducerMap[prop.toString()];\n if (reducer) {\n const reducerResult = reducer(void 0, {\n type: nanoid()\n });\n if (typeof reducerResult === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(24) : `The slice reducer for key \"${prop.toString()}\" returned undefined when called for selector(). 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.`);\n }\n return reducerResult;\n }\n }\n return result;\n }\n })\n});\nvar original = (state) => {\n if (!isStateProxy(state)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(25) : \"original must be used on state Proxy\");\n }\n return state[ORIGINAL_STATE];\n};\nvar noopReducer = (state = {}) => state;\nfunction combineSlices(...slices) {\n const reducerMap = Object.fromEntries(getReducers(slices));\n const getReducer = () => Object.keys(reducerMap).length ? combineReducers2(reducerMap) : noopReducer;\n let reducer = getReducer();\n function combinedReducer(state, action) {\n return reducer(state, action);\n }\n combinedReducer.withLazyLoadedSlices = () => combinedReducer;\n const inject = (slice, config = {}) => {\n const {\n reducerPath,\n reducer: reducerToInject\n } = slice;\n const currentReducer = reducerMap[reducerPath];\n if (!config.overrideExisting && currentReducer && currentReducer !== reducerToInject) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n console.error(`called \\`inject\\` to override already-existing reducer ${reducerPath} without specifying \\`overrideExisting: true\\``);\n }\n return combinedReducer;\n }\n reducerMap[reducerPath] = reducerToInject;\n reducer = getReducer();\n return combinedReducer;\n };\n const selector = Object.assign(function makeSelector(selectorFn, selectState) {\n return function selector2(state, ...args) {\n return selectorFn(createStateProxy(selectState ? selectState(state, ...args) : state, reducerMap), ...args);\n };\n }, {\n original\n });\n return Object.assign(combinedReducer, {\n inject,\n selector\n });\n}\n\n// src/formatProdErrorMessage.ts\nfunction formatProdErrorMessage(code) {\n return `Minified Redux Toolkit error #${code}; visit https://redux-toolkit.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;\n}\nexport {\n ReducerType,\n SHOULD_AUTOBATCH,\n TaskAbortError,\n Tuple,\n addListener,\n asyncThunkCreator,\n autoBatchEnhancer,\n buildCreateSlice,\n clearAllListeners,\n combineSlices,\n configureStore,\n createAction,\n createActionCreatorInvariantMiddleware,\n createAsyncThunk,\n createDraftSafeSelector,\n createDraftSafeSelectorCreator,\n createDynamicMiddleware,\n createEntityAdapter,\n createImmutableStateInvariantMiddleware,\n createListenerMiddleware,\n produce as createNextState,\n createReducer,\n createSelector,\n createSelectorCreator2 as createSelectorCreator,\n createSerializableStateInvariantMiddleware,\n createSlice,\n current4 as current,\n findNonSerializableValue,\n formatProdErrorMessage,\n freeze,\n isActionCreator,\n isAllOf,\n isAnyOf,\n isAsyncThunkAction,\n isDraft6 as isDraft,\n isFSA as isFluxStandardAction,\n isFulfilled,\n isImmutableDefault,\n isPending,\n isPlain,\n isRejected,\n isRejectedWithValue,\n lruMemoize,\n miniSerializeError,\n nanoid,\n original2 as original,\n prepareAutoBatched,\n removeListener,\n unwrapResult,\n weakMapMemoize2 as weakMapMemoize\n};\n//# sourceMappingURL=redux-toolkit.modern.mjs.map","export function _tagged_template_literal(strings, raw) {\n if (!raw) raw = strings.slice(0);\n\n return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } }));\n}\nexport { _tagged_template_literal as _ };\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t {\n iter(key, obj[key], obj);\n });\n } else {\n obj.forEach((entry, index) => iter(index, entry, obj));\n }\n}\nfunction getArchtype(thing) {\n const state = thing[DRAFT_STATE];\n return state ? state.type_ : Array.isArray(thing) ? 1 /* Array */ : isMap(thing) ? 2 /* Map */ : isSet(thing) ? 3 /* Set */ : 0 /* Object */;\n}\nfunction has(thing, prop) {\n return getArchtype(thing) === 2 /* Map */ ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop);\n}\nfunction get(thing, prop) {\n return getArchtype(thing) === 2 /* Map */ ? thing.get(prop) : thing[prop];\n}\nfunction set(thing, propOrOldValue, value) {\n const t = getArchtype(thing);\n if (t === 2 /* Map */)\n thing.set(propOrOldValue, value);\n else if (t === 3 /* Set */) {\n thing.add(value);\n } else\n thing[propOrOldValue] = value;\n}\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\nfunction isMap(target) {\n return target instanceof Map;\n}\nfunction isSet(target) {\n return target instanceof Set;\n}\nfunction latest(state) {\n return state.copy_ || state.base_;\n}\nfunction shallowCopy(base, strict) {\n if (isMap(base)) {\n return new Map(base);\n }\n if (isSet(base)) {\n return new Set(base);\n }\n if (Array.isArray(base))\n return Array.prototype.slice.call(base);\n const isPlain = isPlainObject(base);\n if (strict === true || strict === \"class_only\" && !isPlain) {\n const descriptors = Object.getOwnPropertyDescriptors(base);\n delete descriptors[DRAFT_STATE];\n let keys = Reflect.ownKeys(descriptors);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const desc = descriptors[key];\n if (desc.writable === false) {\n desc.writable = true;\n desc.configurable = true;\n }\n if (desc.get || desc.set)\n descriptors[key] = {\n configurable: true,\n writable: true,\n // could live with !!desc.set as well here...\n enumerable: desc.enumerable,\n value: base[key]\n };\n }\n return Object.create(getPrototypeOf(base), descriptors);\n } else {\n const proto = getPrototypeOf(base);\n if (proto !== null && isPlain) {\n return { ...base };\n }\n const obj = Object.create(proto);\n return Object.assign(obj, base);\n }\n}\nfunction freeze(obj, deep = false) {\n if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj))\n return obj;\n if (getArchtype(obj) > 1) {\n obj.set = obj.add = obj.clear = obj.delete = dontMutateFrozenCollections;\n }\n Object.freeze(obj);\n if (deep)\n Object.entries(obj).forEach(([key, value]) => freeze(value, true));\n return obj;\n}\nfunction dontMutateFrozenCollections() {\n die(2);\n}\nfunction isFrozen(obj) {\n return Object.isFrozen(obj);\n}\n\n// src/utils/plugins.ts\nvar plugins = {};\nfunction getPlugin(pluginKey) {\n const plugin = plugins[pluginKey];\n if (!plugin) {\n die(0, pluginKey);\n }\n return plugin;\n}\nfunction loadPlugin(pluginKey, implementation) {\n if (!plugins[pluginKey])\n plugins[pluginKey] = implementation;\n}\n\n// src/core/scope.ts\nvar currentScope;\nfunction getCurrentScope() {\n return currentScope;\n}\nfunction createScope(parent_, immer_) {\n return {\n drafts_: [],\n parent_,\n immer_,\n // Whenever the modified draft contains a draft from another scope, we\n // need to prevent auto-freezing so the unowned draft can be finalized.\n canAutoFreeze_: true,\n unfinalizedDrafts_: 0\n };\n}\nfunction usePatchesInScope(scope, patchListener) {\n if (patchListener) {\n getPlugin(\"Patches\");\n scope.patches_ = [];\n scope.inversePatches_ = [];\n scope.patchListener_ = patchListener;\n }\n}\nfunction revokeScope(scope) {\n leaveScope(scope);\n scope.drafts_.forEach(revokeDraft);\n scope.drafts_ = null;\n}\nfunction leaveScope(scope) {\n if (scope === currentScope) {\n currentScope = scope.parent_;\n }\n}\nfunction enterScope(immer2) {\n return currentScope = createScope(currentScope, immer2);\n}\nfunction revokeDraft(draft) {\n const state = draft[DRAFT_STATE];\n if (state.type_ === 0 /* Object */ || state.type_ === 1 /* Array */)\n state.revoke_();\n else\n state.revoked_ = true;\n}\n\n// src/core/finalize.ts\nfunction processResult(result, scope) {\n scope.unfinalizedDrafts_ = scope.drafts_.length;\n const baseDraft = scope.drafts_[0];\n const isReplaced = result !== void 0 && result !== baseDraft;\n if (isReplaced) {\n if (baseDraft[DRAFT_STATE].modified_) {\n revokeScope(scope);\n die(4);\n }\n if (isDraftable(result)) {\n result = finalize(scope, result);\n if (!scope.parent_)\n maybeFreeze(scope, result);\n }\n if (scope.patches_) {\n getPlugin(\"Patches\").generateReplacementPatches_(\n baseDraft[DRAFT_STATE].base_,\n result,\n scope.patches_,\n scope.inversePatches_\n );\n }\n } else {\n result = finalize(scope, baseDraft, []);\n }\n revokeScope(scope);\n if (scope.patches_) {\n scope.patchListener_(scope.patches_, scope.inversePatches_);\n }\n return result !== NOTHING ? result : void 0;\n}\nfunction finalize(rootScope, value, path) {\n if (isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n if (!state) {\n each(\n value,\n (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path)\n );\n return value;\n }\n if (state.scope_ !== rootScope)\n return value;\n if (!state.modified_) {\n maybeFreeze(rootScope, state.base_, true);\n return state.base_;\n }\n if (!state.finalized_) {\n state.finalized_ = true;\n state.scope_.unfinalizedDrafts_--;\n const result = state.copy_;\n let resultEach = result;\n let isSet2 = false;\n if (state.type_ === 3 /* Set */) {\n resultEach = new Set(result);\n result.clear();\n isSet2 = true;\n }\n each(\n resultEach,\n (key, childValue) => finalizeProperty(rootScope, state, result, key, childValue, path, isSet2)\n );\n maybeFreeze(rootScope, result, false);\n if (path && rootScope.patches_) {\n getPlugin(\"Patches\").generatePatches_(\n state,\n path,\n rootScope.patches_,\n rootScope.inversePatches_\n );\n }\n }\n return state.copy_;\n}\nfunction finalizeProperty(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) {\n if (process.env.NODE_ENV !== \"production\" && childValue === targetObject)\n die(5);\n if (isDraft(childValue)) {\n const path = rootPath && parentState && parentState.type_ !== 3 /* Set */ && // Set objects are atomic since they have no keys.\n !has(parentState.assigned_, prop) ? rootPath.concat(prop) : void 0;\n const res = finalize(rootScope, childValue, path);\n set(targetObject, prop, res);\n if (isDraft(res)) {\n rootScope.canAutoFreeze_ = false;\n } else\n return;\n } else if (targetIsSet) {\n targetObject.add(childValue);\n }\n if (isDraftable(childValue) && !isFrozen(childValue)) {\n if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n return;\n }\n finalize(rootScope, childValue);\n if ((!parentState || !parentState.scope_.parent_) && typeof prop !== \"symbol\" && Object.prototype.propertyIsEnumerable.call(targetObject, prop))\n maybeFreeze(rootScope, childValue);\n }\n}\nfunction maybeFreeze(scope, value, deep = false) {\n if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n freeze(value, deep);\n }\n}\n\n// src/core/proxy.ts\nfunction createProxyProxy(base, parent) {\n const isArray = Array.isArray(base);\n const state = {\n type_: isArray ? 1 /* Array */ : 0 /* Object */,\n // Track which produce call this is associated with.\n scope_: parent ? parent.scope_ : getCurrentScope(),\n // True for both shallow and deep changes.\n modified_: false,\n // Used during finalization.\n finalized_: false,\n // Track which properties have been assigned (true) or deleted (false).\n assigned_: {},\n // The parent draft state.\n parent_: parent,\n // The base state.\n base_: base,\n // The base proxy.\n draft_: null,\n // set below\n // The base copy with any updated values.\n copy_: null,\n // Called by the `produce` function.\n revoke_: null,\n isManual_: false\n };\n let target = state;\n let traps = objectTraps;\n if (isArray) {\n target = [state];\n traps = arrayTraps;\n }\n const { revoke, proxy } = Proxy.revocable(target, traps);\n state.draft_ = proxy;\n state.revoke_ = revoke;\n return proxy;\n}\nvar objectTraps = {\n get(state, prop) {\n if (prop === DRAFT_STATE)\n return state;\n const source = latest(state);\n if (!has(source, prop)) {\n return readPropFromProto(state, source, prop);\n }\n const value = source[prop];\n if (state.finalized_ || !isDraftable(value)) {\n return value;\n }\n if (value === peek(state.base_, prop)) {\n prepareCopy(state);\n return state.copy_[prop] = createProxy(value, state);\n }\n return value;\n },\n has(state, prop) {\n return prop in latest(state);\n },\n ownKeys(state) {\n return Reflect.ownKeys(latest(state));\n },\n set(state, prop, value) {\n const desc = getDescriptorFromProto(latest(state), prop);\n if (desc?.set) {\n desc.set.call(state.draft_, value);\n return true;\n }\n if (!state.modified_) {\n const current2 = peek(latest(state), prop);\n const currentState = current2?.[DRAFT_STATE];\n if (currentState && currentState.base_ === value) {\n state.copy_[prop] = value;\n state.assigned_[prop] = false;\n return true;\n }\n if (is(value, current2) && (value !== void 0 || has(state.base_, prop)))\n return true;\n prepareCopy(state);\n markChanged(state);\n }\n if (state.copy_[prop] === value && // special case: handle new props with value 'undefined'\n (value !== void 0 || prop in state.copy_) || // special case: NaN\n Number.isNaN(value) && Number.isNaN(state.copy_[prop]))\n return true;\n state.copy_[prop] = value;\n state.assigned_[prop] = true;\n return true;\n },\n deleteProperty(state, prop) {\n if (peek(state.base_, prop) !== void 0 || prop in state.base_) {\n state.assigned_[prop] = false;\n prepareCopy(state);\n markChanged(state);\n } else {\n delete state.assigned_[prop];\n }\n if (state.copy_) {\n delete state.copy_[prop];\n }\n return true;\n },\n // Note: We never coerce `desc.value` into an Immer draft, because we can't make\n // the same guarantee in ES5 mode.\n getOwnPropertyDescriptor(state, prop) {\n const owner = latest(state);\n const desc = Reflect.getOwnPropertyDescriptor(owner, prop);\n if (!desc)\n return desc;\n return {\n writable: true,\n configurable: state.type_ !== 1 /* Array */ || prop !== \"length\",\n enumerable: desc.enumerable,\n value: owner[prop]\n };\n },\n defineProperty() {\n die(11);\n },\n getPrototypeOf(state) {\n return getPrototypeOf(state.base_);\n },\n setPrototypeOf() {\n die(12);\n }\n};\nvar arrayTraps = {};\neach(objectTraps, (key, fn) => {\n arrayTraps[key] = function() {\n arguments[0] = arguments[0][0];\n return fn.apply(this, arguments);\n };\n});\narrayTraps.deleteProperty = function(state, prop) {\n if (process.env.NODE_ENV !== \"production\" && isNaN(parseInt(prop)))\n die(13);\n return arrayTraps.set.call(this, state, prop, void 0);\n};\narrayTraps.set = function(state, prop, value) {\n if (process.env.NODE_ENV !== \"production\" && prop !== \"length\" && isNaN(parseInt(prop)))\n die(14);\n return objectTraps.set.call(this, state[0], prop, value, state[0]);\n};\nfunction peek(draft, prop) {\n const state = draft[DRAFT_STATE];\n const source = state ? latest(state) : draft;\n return source[prop];\n}\nfunction readPropFromProto(state, source, prop) {\n const desc = getDescriptorFromProto(source, prop);\n return desc ? `value` in desc ? desc.value : (\n // This is a very special case, if the prop is a getter defined by the\n // prototype, we should invoke it with the draft as context!\n desc.get?.call(state.draft_)\n ) : void 0;\n}\nfunction getDescriptorFromProto(source, prop) {\n if (!(prop in source))\n return void 0;\n let proto = getPrototypeOf(source);\n while (proto) {\n const desc = Object.getOwnPropertyDescriptor(proto, prop);\n if (desc)\n return desc;\n proto = getPrototypeOf(proto);\n }\n return void 0;\n}\nfunction markChanged(state) {\n if (!state.modified_) {\n state.modified_ = true;\n if (state.parent_) {\n markChanged(state.parent_);\n }\n }\n}\nfunction prepareCopy(state) {\n if (!state.copy_) {\n state.copy_ = shallowCopy(\n state.base_,\n state.scope_.immer_.useStrictShallowCopy_\n );\n }\n}\n\n// src/core/immerClass.ts\nvar Immer2 = class {\n constructor(config) {\n this.autoFreeze_ = true;\n this.useStrictShallowCopy_ = false;\n /**\n * The `produce` function takes a value and a \"recipe function\" (whose\n * return value often depends on the base state). The recipe function is\n * free to mutate its first argument however it wants. All mutations are\n * only ever applied to a __copy__ of the base state.\n *\n * Pass only a function to create a \"curried producer\" which relieves you\n * from passing the recipe function every time.\n *\n * Only plain objects and arrays are made mutable. All other objects are\n * considered uncopyable.\n *\n * Note: This function is __bound__ to its `Immer` instance.\n *\n * @param {any} base - the initial state\n * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the initial state if nothing was modified\n */\n this.produce = (base, recipe, patchListener) => {\n if (typeof base === \"function\" && typeof recipe !== \"function\") {\n const defaultBase = recipe;\n recipe = base;\n const self = this;\n return function curriedProduce(base2 = defaultBase, ...args) {\n return self.produce(base2, (draft) => recipe.call(this, draft, ...args));\n };\n }\n if (typeof recipe !== \"function\")\n die(6);\n if (patchListener !== void 0 && typeof patchListener !== \"function\")\n die(7);\n let result;\n if (isDraftable(base)) {\n const scope = enterScope(this);\n const proxy = createProxy(base, void 0);\n let hasError = true;\n try {\n result = recipe(proxy);\n hasError = false;\n } finally {\n if (hasError)\n revokeScope(scope);\n else\n leaveScope(scope);\n }\n usePatchesInScope(scope, patchListener);\n return processResult(result, scope);\n } else if (!base || typeof base !== \"object\") {\n result = recipe(base);\n if (result === void 0)\n result = base;\n if (result === NOTHING)\n result = void 0;\n if (this.autoFreeze_)\n freeze(result, true);\n if (patchListener) {\n const p = [];\n const ip = [];\n getPlugin(\"Patches\").generateReplacementPatches_(base, result, p, ip);\n patchListener(p, ip);\n }\n return result;\n } else\n die(1, base);\n };\n this.produceWithPatches = (base, recipe) => {\n if (typeof base === \"function\") {\n return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));\n }\n let patches, inversePatches;\n const result = this.produce(base, recipe, (p, ip) => {\n patches = p;\n inversePatches = ip;\n });\n return [result, patches, inversePatches];\n };\n if (typeof config?.autoFreeze === \"boolean\")\n this.setAutoFreeze(config.autoFreeze);\n if (typeof config?.useStrictShallowCopy === \"boolean\")\n this.setUseStrictShallowCopy(config.useStrictShallowCopy);\n }\n createDraft(base) {\n if (!isDraftable(base))\n die(8);\n if (isDraft(base))\n base = current(base);\n const scope = enterScope(this);\n const proxy = createProxy(base, void 0);\n proxy[DRAFT_STATE].isManual_ = true;\n leaveScope(scope);\n return proxy;\n }\n finishDraft(draft, patchListener) {\n const state = draft && draft[DRAFT_STATE];\n if (!state || !state.isManual_)\n die(9);\n const { scope_: scope } = state;\n usePatchesInScope(scope, patchListener);\n return processResult(void 0, scope);\n }\n /**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * By default, auto-freezing is enabled.\n */\n setAutoFreeze(value) {\n this.autoFreeze_ = value;\n }\n /**\n * Pass true to enable strict shallow copy.\n *\n * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n */\n setUseStrictShallowCopy(value) {\n this.useStrictShallowCopy_ = value;\n }\n applyPatches(base, patches) {\n let i;\n for (i = patches.length - 1; i >= 0; i--) {\n const patch = patches[i];\n if (patch.path.length === 0 && patch.op === \"replace\") {\n base = patch.value;\n break;\n }\n }\n if (i > -1) {\n patches = patches.slice(i + 1);\n }\n const applyPatchesImpl = getPlugin(\"Patches\").applyPatches_;\n if (isDraft(base)) {\n return applyPatchesImpl(base, patches);\n }\n return this.produce(\n base,\n (draft) => applyPatchesImpl(draft, patches)\n );\n }\n};\nfunction createProxy(value, parent) {\n const draft = isMap(value) ? getPlugin(\"MapSet\").proxyMap_(value, parent) : isSet(value) ? getPlugin(\"MapSet\").proxySet_(value, parent) : createProxyProxy(value, parent);\n const scope = parent ? parent.scope_ : getCurrentScope();\n scope.drafts_.push(draft);\n return draft;\n}\n\n// src/core/current.ts\nfunction current(value) {\n if (!isDraft(value))\n die(10, value);\n return currentImpl(value);\n}\nfunction currentImpl(value) {\n if (!isDraftable(value) || isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n let copy;\n if (state) {\n if (!state.modified_)\n return state.base_;\n state.finalized_ = true;\n copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);\n } else {\n copy = shallowCopy(value, true);\n }\n each(copy, (key, childValue) => {\n set(copy, key, currentImpl(childValue));\n });\n if (state) {\n state.finalized_ = false;\n }\n return copy;\n}\n\n// src/plugins/patches.ts\nfunction enablePatches() {\n const errorOffset = 16;\n if (process.env.NODE_ENV !== \"production\") {\n errors.push(\n 'Sets cannot have \"replace\" patches.',\n function(op) {\n return \"Unsupported patch operation: \" + op;\n },\n function(path) {\n return \"Cannot apply patch, path doesn't resolve: \" + path;\n },\n \"Patching reserved attributes like __proto__, prototype and constructor is not allowed\"\n );\n }\n const REPLACE = \"replace\";\n const ADD = \"add\";\n const REMOVE = \"remove\";\n function generatePatches_(state, basePath, patches, inversePatches) {\n switch (state.type_) {\n case 0 /* Object */:\n case 2 /* Map */:\n return generatePatchesFromAssigned(\n state,\n basePath,\n patches,\n inversePatches\n );\n case 1 /* Array */:\n return generateArrayPatches(state, basePath, patches, inversePatches);\n case 3 /* Set */:\n return generateSetPatches(\n state,\n basePath,\n patches,\n inversePatches\n );\n }\n }\n function generateArrayPatches(state, basePath, patches, inversePatches) {\n let { base_, assigned_ } = state;\n let copy_ = state.copy_;\n if (copy_.length < base_.length) {\n ;\n [base_, copy_] = [copy_, base_];\n [patches, inversePatches] = [inversePatches, patches];\n }\n for (let i = 0; i < base_.length; i++) {\n if (assigned_[i] && copy_[i] !== base_[i]) {\n const path = basePath.concat([i]);\n patches.push({\n op: REPLACE,\n path,\n // Need to maybe clone it, as it can in fact be the original value\n // due to the base/copy inversion at the start of this function\n value: clonePatchValueIfNeeded(copy_[i])\n });\n inversePatches.push({\n op: REPLACE,\n path,\n value: clonePatchValueIfNeeded(base_[i])\n });\n }\n }\n for (let i = base_.length; i < copy_.length; i++) {\n const path = basePath.concat([i]);\n patches.push({\n op: ADD,\n path,\n // Need to maybe clone it, as it can in fact be the original value\n // due to the base/copy inversion at the start of this function\n value: clonePatchValueIfNeeded(copy_[i])\n });\n }\n for (let i = copy_.length - 1; base_.length <= i; --i) {\n const path = basePath.concat([i]);\n inversePatches.push({\n op: REMOVE,\n path\n });\n }\n }\n function generatePatchesFromAssigned(state, basePath, patches, inversePatches) {\n const { base_, copy_ } = state;\n each(state.assigned_, (key, assignedValue) => {\n const origValue = get(base_, key);\n const value = get(copy_, key);\n const op = !assignedValue ? REMOVE : has(base_, key) ? REPLACE : ADD;\n if (origValue === value && op === REPLACE)\n return;\n const path = basePath.concat(key);\n patches.push(op === REMOVE ? { op, path } : { op, path, value });\n inversePatches.push(\n op === ADD ? { op: REMOVE, path } : op === REMOVE ? { op: ADD, path, value: clonePatchValueIfNeeded(origValue) } : { op: REPLACE, path, value: clonePatchValueIfNeeded(origValue) }\n );\n });\n }\n function generateSetPatches(state, basePath, patches, inversePatches) {\n let { base_, copy_ } = state;\n let i = 0;\n base_.forEach((value) => {\n if (!copy_.has(value)) {\n const path = basePath.concat([i]);\n patches.push({\n op: REMOVE,\n path,\n value\n });\n inversePatches.unshift({\n op: ADD,\n path,\n value\n });\n }\n i++;\n });\n i = 0;\n copy_.forEach((value) => {\n if (!base_.has(value)) {\n const path = basePath.concat([i]);\n patches.push({\n op: ADD,\n path,\n value\n });\n inversePatches.unshift({\n op: REMOVE,\n path,\n value\n });\n }\n i++;\n });\n }\n function generateReplacementPatches_(baseValue, replacement, patches, inversePatches) {\n patches.push({\n op: REPLACE,\n path: [],\n value: replacement === NOTHING ? void 0 : replacement\n });\n inversePatches.push({\n op: REPLACE,\n path: [],\n value: baseValue\n });\n }\n function applyPatches_(draft, patches) {\n patches.forEach((patch) => {\n const { path, op } = patch;\n let base = draft;\n for (let i = 0; i < path.length - 1; i++) {\n const parentType = getArchtype(base);\n let p = path[i];\n if (typeof p !== \"string\" && typeof p !== \"number\") {\n p = \"\" + p;\n }\n if ((parentType === 0 /* Object */ || parentType === 1 /* Array */) && (p === \"__proto__\" || p === \"constructor\"))\n die(errorOffset + 3);\n if (typeof base === \"function\" && p === \"prototype\")\n die(errorOffset + 3);\n base = get(base, p);\n if (typeof base !== \"object\")\n die(errorOffset + 2, path.join(\"/\"));\n }\n const type = getArchtype(base);\n const value = deepClonePatchValue(patch.value);\n const key = path[path.length - 1];\n switch (op) {\n case REPLACE:\n switch (type) {\n case 2 /* Map */:\n return base.set(key, value);\n case 3 /* Set */:\n die(errorOffset);\n default:\n return base[key] = value;\n }\n case ADD:\n switch (type) {\n case 1 /* Array */:\n return key === \"-\" ? base.push(value) : base.splice(key, 0, value);\n case 2 /* Map */:\n return base.set(key, value);\n case 3 /* Set */:\n return base.add(value);\n default:\n return base[key] = value;\n }\n case REMOVE:\n switch (type) {\n case 1 /* Array */:\n return base.splice(key, 1);\n case 2 /* Map */:\n return base.delete(key);\n case 3 /* Set */:\n return base.delete(patch.value);\n default:\n return delete base[key];\n }\n default:\n die(errorOffset + 1, op);\n }\n });\n return draft;\n }\n function deepClonePatchValue(obj) {\n if (!isDraftable(obj))\n return obj;\n if (Array.isArray(obj))\n return obj.map(deepClonePatchValue);\n if (isMap(obj))\n return new Map(\n Array.from(obj.entries()).map(([k, v]) => [k, deepClonePatchValue(v)])\n );\n if (isSet(obj))\n return new Set(Array.from(obj).map(deepClonePatchValue));\n const cloned = Object.create(getPrototypeOf(obj));\n for (const key in obj)\n cloned[key] = deepClonePatchValue(obj[key]);\n if (has(obj, DRAFTABLE))\n cloned[DRAFTABLE] = obj[DRAFTABLE];\n return cloned;\n }\n function clonePatchValueIfNeeded(obj) {\n if (isDraft(obj)) {\n return deepClonePatchValue(obj);\n } else\n return obj;\n }\n loadPlugin(\"Patches\", {\n applyPatches_,\n generatePatches_,\n generateReplacementPatches_\n });\n}\n\n// src/plugins/mapset.ts\nfunction enableMapSet() {\n class DraftMap extends Map {\n constructor(target, parent) {\n super();\n this[DRAFT_STATE] = {\n type_: 2 /* Map */,\n parent_: parent,\n scope_: parent ? parent.scope_ : getCurrentScope(),\n modified_: false,\n finalized_: false,\n copy_: void 0,\n assigned_: void 0,\n base_: target,\n draft_: this,\n isManual_: false,\n revoked_: false\n };\n }\n get size() {\n return latest(this[DRAFT_STATE]).size;\n }\n has(key) {\n return latest(this[DRAFT_STATE]).has(key);\n }\n set(key, value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!latest(state).has(key) || latest(state).get(key) !== value) {\n prepareMapCopy(state);\n markChanged(state);\n state.assigned_.set(key, true);\n state.copy_.set(key, value);\n state.assigned_.set(key, true);\n }\n return this;\n }\n delete(key) {\n if (!this.has(key)) {\n return false;\n }\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareMapCopy(state);\n markChanged(state);\n if (state.base_.has(key)) {\n state.assigned_.set(key, false);\n } else {\n state.assigned_.delete(key);\n }\n state.copy_.delete(key);\n return true;\n }\n clear() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (latest(state).size) {\n prepareMapCopy(state);\n markChanged(state);\n state.assigned_ = /* @__PURE__ */ new Map();\n each(state.base_, (key) => {\n state.assigned_.set(key, false);\n });\n state.copy_.clear();\n }\n }\n forEach(cb, thisArg) {\n const state = this[DRAFT_STATE];\n latest(state).forEach((_value, key, _map) => {\n cb.call(thisArg, this.get(key), key, this);\n });\n }\n get(key) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n const value = latest(state).get(key);\n if (state.finalized_ || !isDraftable(value)) {\n return value;\n }\n if (value !== state.base_.get(key)) {\n return value;\n }\n const draft = createProxy(value, state);\n prepareMapCopy(state);\n state.copy_.set(key, draft);\n return draft;\n }\n keys() {\n return latest(this[DRAFT_STATE]).keys();\n }\n values() {\n const iterator = this.keys();\n return {\n [Symbol.iterator]: () => this.values(),\n next: () => {\n const r = iterator.next();\n if (r.done)\n return r;\n const value = this.get(r.value);\n return {\n done: false,\n value\n };\n }\n };\n }\n entries() {\n const iterator = this.keys();\n return {\n [Symbol.iterator]: () => this.entries(),\n next: () => {\n const r = iterator.next();\n if (r.done)\n return r;\n const value = this.get(r.value);\n return {\n done: false,\n value: [r.value, value]\n };\n }\n };\n }\n [(DRAFT_STATE, Symbol.iterator)]() {\n return this.entries();\n }\n }\n function proxyMap_(target, parent) {\n return new DraftMap(target, parent);\n }\n function prepareMapCopy(state) {\n if (!state.copy_) {\n state.assigned_ = /* @__PURE__ */ new Map();\n state.copy_ = new Map(state.base_);\n }\n }\n class DraftSet extends Set {\n constructor(target, parent) {\n super();\n this[DRAFT_STATE] = {\n type_: 3 /* Set */,\n parent_: parent,\n scope_: parent ? parent.scope_ : getCurrentScope(),\n modified_: false,\n finalized_: false,\n copy_: void 0,\n base_: target,\n draft_: this,\n drafts_: /* @__PURE__ */ new Map(),\n revoked_: false,\n isManual_: false\n };\n }\n get size() {\n return latest(this[DRAFT_STATE]).size;\n }\n has(value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!state.copy_) {\n return state.base_.has(value);\n }\n if (state.copy_.has(value))\n return true;\n if (state.drafts_.has(value) && state.copy_.has(state.drafts_.get(value)))\n return true;\n return false;\n }\n add(value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!this.has(value)) {\n prepareSetCopy(state);\n markChanged(state);\n state.copy_.add(value);\n }\n return this;\n }\n delete(value) {\n if (!this.has(value)) {\n return false;\n }\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n markChanged(state);\n return state.copy_.delete(value) || (state.drafts_.has(value) ? state.copy_.delete(state.drafts_.get(value)) : (\n /* istanbul ignore next */\n false\n ));\n }\n clear() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (latest(state).size) {\n prepareSetCopy(state);\n markChanged(state);\n state.copy_.clear();\n }\n }\n values() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n return state.copy_.values();\n }\n entries() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n return state.copy_.entries();\n }\n keys() {\n return this.values();\n }\n [(DRAFT_STATE, Symbol.iterator)]() {\n return this.values();\n }\n forEach(cb, thisArg) {\n const iterator = this.values();\n let result = iterator.next();\n while (!result.done) {\n cb.call(thisArg, result.value, result.value, this);\n result = iterator.next();\n }\n }\n }\n function proxySet_(target, parent) {\n return new DraftSet(target, parent);\n }\n function prepareSetCopy(state) {\n if (!state.copy_) {\n state.copy_ = /* @__PURE__ */ new Set();\n state.base_.forEach((value) => {\n if (isDraftable(value)) {\n const draft = createProxy(value, state);\n state.drafts_.set(value, draft);\n state.copy_.add(draft);\n } else {\n state.copy_.add(value);\n }\n });\n }\n }\n function assertUnrevoked(state) {\n if (state.revoked_)\n die(3, JSON.stringify(latest(state)));\n }\n loadPlugin(\"MapSet\", { proxyMap_, proxySet_ });\n}\n\n// src/immer.ts\nvar immer = new Immer2();\nvar produce = immer.produce;\nvar produceWithPatches = immer.produceWithPatches.bind(\n immer\n);\nvar setAutoFreeze = immer.setAutoFreeze.bind(immer);\nvar setUseStrictShallowCopy = immer.setUseStrictShallowCopy.bind(immer);\nvar applyPatches = immer.applyPatches.bind(immer);\nvar createDraft = immer.createDraft.bind(immer);\nvar finishDraft = immer.finishDraft.bind(immer);\nfunction castDraft(value) {\n return value;\n}\nfunction castImmutable(value) {\n return value;\n}\nexport {\n Immer2 as Immer,\n applyPatches,\n castDraft,\n castImmutable,\n createDraft,\n current,\n enableMapSet,\n enablePatches,\n finishDraft,\n freeze,\n DRAFTABLE as immerable,\n isDraft,\n isDraftable,\n NOTHING as nothing,\n original,\n produce,\n produceWithPatches,\n setAutoFreeze,\n setUseStrictShallowCopy\n};\n//# sourceMappingURL=immer.mjs.map","// src/index.ts\nimport * as React2 from \"react\";\nimport { useSyncExternalStoreWithSelector as useSyncExternalStoreWithSelector2 } from \"use-sync-external-store/with-selector.js\";\n\n// src/utils/react.ts\nimport * as ReactOriginal from \"react\";\nvar React = (\n // prettier-ignore\n // @ts-ignore\n \"default\" in ReactOriginal ? ReactOriginal[\"default\"] : ReactOriginal\n);\n\n// src/components/Context.ts\nvar ContextKey = Symbol.for(`react-redux-context`);\nvar gT = typeof globalThis !== \"undefined\" ? globalThis : (\n /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */\n {}\n);\nfunction getContext() {\n if (!React.createContext)\n return {};\n const contextMap = gT[ContextKey] ?? (gT[ContextKey] = /* @__PURE__ */ new Map());\n let realContext = contextMap.get(React.createContext);\n if (!realContext) {\n realContext = React.createContext(\n null\n );\n if (process.env.NODE_ENV !== \"production\") {\n realContext.displayName = \"ReactRedux\";\n }\n contextMap.set(React.createContext, realContext);\n }\n return realContext;\n}\nvar ReactReduxContext = /* @__PURE__ */ getContext();\n\n// src/utils/useSyncExternalStore.ts\nvar notInitialized = () => {\n throw new Error(\"uSES not initialized!\");\n};\n\n// src/hooks/useReduxContext.ts\nfunction createReduxContextHook(context = ReactReduxContext) {\n return function useReduxContext2() {\n const contextValue = React.useContext(context);\n if (process.env.NODE_ENV !== \"production\" && !contextValue) {\n throw new Error(\n \"could not find react-redux context value; please ensure the component is wrapped in a \"\n );\n }\n return contextValue;\n };\n}\nvar useReduxContext = /* @__PURE__ */ createReduxContextHook();\n\n// src/hooks/useSelector.ts\nvar useSyncExternalStoreWithSelector = notInitialized;\nvar initializeUseSelector = (fn) => {\n useSyncExternalStoreWithSelector = fn;\n};\nvar refEquality = (a, b) => a === b;\nfunction createSelectorHook(context = ReactReduxContext) {\n const useReduxContext2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context);\n const useSelector2 = (selector, equalityFnOrOptions = {}) => {\n const { equalityFn = refEquality, devModeChecks = {} } = typeof equalityFnOrOptions === \"function\" ? { equalityFn: equalityFnOrOptions } : equalityFnOrOptions;\n if (process.env.NODE_ENV !== \"production\") {\n if (!selector) {\n throw new Error(`You must pass a selector to useSelector`);\n }\n if (typeof selector !== \"function\") {\n throw new Error(`You must pass a function as a selector to useSelector`);\n }\n if (typeof equalityFn !== \"function\") {\n throw new Error(\n `You must pass a function as an equality function to useSelector`\n );\n }\n }\n const {\n store,\n subscription,\n getServerState,\n stabilityCheck,\n identityFunctionCheck\n } = useReduxContext2();\n const firstRun = React.useRef(true);\n const wrappedSelector = React.useCallback(\n {\n [selector.name](state) {\n const selected = selector(state);\n if (process.env.NODE_ENV !== \"production\") {\n const {\n identityFunctionCheck: finalIdentityFunctionCheck,\n stabilityCheck: finalStabilityCheck\n } = {\n stabilityCheck,\n identityFunctionCheck,\n ...devModeChecks\n };\n if (finalStabilityCheck === \"always\" || finalStabilityCheck === \"once\" && firstRun.current) {\n const toCompare = selector(state);\n if (!equalityFn(selected, toCompare)) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"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\",\n {\n state,\n selected,\n selected2: toCompare,\n stack\n }\n );\n }\n }\n if (finalIdentityFunctionCheck === \"always\" || finalIdentityFunctionCheck === \"once\" && firstRun.current) {\n if (selected === state) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"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.\",\n { stack }\n );\n }\n }\n if (firstRun.current)\n firstRun.current = false;\n }\n return selected;\n }\n }[selector.name],\n [selector, stabilityCheck, devModeChecks.stabilityCheck]\n );\n const selectedState = useSyncExternalStoreWithSelector(\n subscription.addNestedSub,\n store.getState,\n getServerState || store.getState,\n wrappedSelector,\n equalityFn\n );\n React.useDebugValue(selectedState);\n return selectedState;\n };\n Object.assign(useSelector2, {\n withTypes: () => useSelector2\n });\n return useSelector2;\n}\nvar useSelector = /* @__PURE__ */ createSelectorHook();\n\n// src/utils/react-is.ts\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.element\");\nvar REACT_PORTAL_TYPE = Symbol.for(\"react.portal\");\nvar REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nvar REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\");\nvar REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\");\nvar REACT_PROVIDER_TYPE = Symbol.for(\"react.provider\");\nvar REACT_CONTEXT_TYPE = Symbol.for(\"react.context\");\nvar REACT_SERVER_CONTEXT_TYPE = Symbol.for(\"react.server_context\");\nvar REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\");\nvar REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\");\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\");\nvar REACT_MEMO_TYPE = Symbol.for(\"react.memo\");\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nvar REACT_OFFSCREEN_TYPE = Symbol.for(\"react.offscreen\");\nvar REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\");\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nfunction isValidElementType(type) {\n if (typeof type === \"string\" || typeof type === \"function\") {\n return true;\n }\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_OFFSCREEN_TYPE) {\n return true;\n }\n if (typeof type === \"object\" && type !== null) {\n 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 || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== void 0) {\n return true;\n }\n }\n return false;\n}\nfunction typeOf(object) {\n if (typeof object === \"object\" && object !== null) {\n const $$typeof = object.$$typeof;\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE: {\n const type = object.type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n case REACT_SUSPENSE_LIST_TYPE:\n return type;\n default: {\n const $$typeofType = type && type.$$typeof;\n switch ($$typeofType) {\n case REACT_SERVER_CONTEXT_TYPE:\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n default:\n return $$typeof;\n }\n }\n }\n }\n case REACT_PORTAL_TYPE: {\n return $$typeof;\n }\n }\n }\n return void 0;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\n\n// src/utils/warning.ts\nfunction warning(message) {\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(message);\n }\n try {\n throw new Error(message);\n } catch (e) {\n }\n}\n\n// src/connect/verifySubselectors.ts\nfunction verify(selector, methodName) {\n if (!selector) {\n throw new Error(`Unexpected value for ${methodName} in connect.`);\n } else if (methodName === \"mapStateToProps\" || methodName === \"mapDispatchToProps\") {\n if (!Object.prototype.hasOwnProperty.call(selector, \"dependsOnOwnProps\")) {\n warning(\n `The selector for ${methodName} of connect did not specify a value for dependsOnOwnProps.`\n );\n }\n }\n}\nfunction verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps) {\n verify(mapStateToProps, \"mapStateToProps\");\n verify(mapDispatchToProps, \"mapDispatchToProps\");\n verify(mergeProps, \"mergeProps\");\n}\n\n// src/connect/selectorFactory.ts\nfunction pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, {\n areStatesEqual,\n areOwnPropsEqual,\n areStatePropsEqual\n}) {\n let hasRunAtLeastOnce = false;\n let state;\n let ownProps;\n let stateProps;\n let dispatchProps;\n let mergedProps;\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps)\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps)\n stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps)\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n function handleNewState() {\n const nextStateProps = mapStateToProps(state, ownProps);\n const statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n if (statePropsChanged)\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n function handleSubsequentCalls(nextState, nextOwnProps) {\n const propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n const stateChanged = !areStatesEqual(\n nextState,\n state,\n nextOwnProps,\n ownProps\n );\n state = nextState;\n ownProps = nextOwnProps;\n if (propsChanged && stateChanged)\n return handleNewPropsAndNewState();\n if (propsChanged)\n return handleNewProps();\n if (stateChanged)\n return handleNewState();\n return mergedProps;\n }\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n}\nfunction finalPropsSelectorFactory(dispatch, {\n initMapStateToProps,\n initMapDispatchToProps,\n initMergeProps,\n ...options\n}) {\n const mapStateToProps = initMapStateToProps(dispatch, options);\n const mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n const mergeProps = initMergeProps(dispatch, options);\n if (process.env.NODE_ENV !== \"production\") {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps);\n }\n return pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}\n\n// src/utils/bindActionCreators.ts\nfunction bindActionCreators(actionCreators, dispatch) {\n const boundActionCreators = {};\n for (const key in actionCreators) {\n const actionCreator = actionCreators[key];\n if (typeof actionCreator === \"function\") {\n boundActionCreators[key] = (...args) => dispatch(actionCreator(...args));\n }\n }\n return boundActionCreators;\n}\n\n// src/utils/isPlainObject.ts\nfunction isPlainObject(obj) {\n if (typeof obj !== \"object\" || obj === null)\n return false;\n const proto = Object.getPrototypeOf(obj);\n if (proto === null)\n return true;\n let baseProto = proto;\n while (Object.getPrototypeOf(baseProto) !== null) {\n baseProto = Object.getPrototypeOf(baseProto);\n }\n return proto === baseProto;\n}\n\n// src/utils/verifyPlainObject.ts\nfunction verifyPlainObject(value, displayName, methodName) {\n if (!isPlainObject(value)) {\n warning(\n `${methodName}() in ${displayName} must return a plain object. Instead received ${value}.`\n );\n }\n}\n\n// src/connect/wrapMapToProps.ts\nfunction wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch) {\n const constant = getConstant(dispatch);\n function constantSelector() {\n return constant;\n }\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n}\nfunction getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n}\nfunction wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, { displayName }) {\n const proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch, void 0);\n };\n proxy.dependsOnOwnProps = true;\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n let props = proxy(stateOrDispatch, ownProps);\n if (typeof props === \"function\") {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n if (process.env.NODE_ENV !== \"production\")\n verifyPlainObject(props, displayName, methodName);\n return props;\n };\n return proxy;\n };\n}\n\n// src/connect/invalidArgFactory.ts\nfunction createInvalidArgFactory(arg, name) {\n return (dispatch, options) => {\n throw new Error(\n `Invalid value of type ${typeof arg} for ${name} argument when connecting component ${options.wrappedComponentName}.`\n );\n };\n}\n\n// src/connect/mapDispatchToProps.ts\nfunction mapDispatchToPropsFactory(mapDispatchToProps) {\n return mapDispatchToProps && typeof mapDispatchToProps === \"object\" ? wrapMapToPropsConstant(\n (dispatch) => (\n // @ts-ignore\n bindActionCreators(mapDispatchToProps, dispatch)\n )\n ) : !mapDispatchToProps ? wrapMapToPropsConstant((dispatch) => ({\n dispatch\n })) : typeof mapDispatchToProps === \"function\" ? (\n // @ts-ignore\n wrapMapToPropsFunc(mapDispatchToProps, \"mapDispatchToProps\")\n ) : createInvalidArgFactory(mapDispatchToProps, \"mapDispatchToProps\");\n}\n\n// src/connect/mapStateToProps.ts\nfunction mapStateToPropsFactory(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(() => ({})) : typeof mapStateToProps === \"function\" ? (\n // @ts-ignore\n wrapMapToPropsFunc(mapStateToProps, \"mapStateToProps\")\n ) : createInvalidArgFactory(mapStateToProps, \"mapStateToProps\");\n}\n\n// src/connect/mergeProps.ts\nfunction defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return { ...ownProps, ...stateProps, ...dispatchProps };\n}\nfunction wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, { displayName, areMergedPropsEqual }) {\n let hasRunOnce = false;\n let mergedProps;\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n const nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n if (hasRunOnce) {\n if (!areMergedPropsEqual(nextMergedProps, mergedProps))\n mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n if (process.env.NODE_ENV !== \"production\")\n verifyPlainObject(mergedProps, displayName, \"mergeProps\");\n }\n return mergedProps;\n };\n };\n}\nfunction mergePropsFactory(mergeProps) {\n return !mergeProps ? () => defaultMergeProps : typeof mergeProps === \"function\" ? wrapMergePropsFunc(mergeProps) : createInvalidArgFactory(mergeProps, \"mergeProps\");\n}\n\n// src/utils/batch.ts\nfunction defaultNoopBatch(callback) {\n callback();\n}\n\n// src/utils/Subscription.ts\nfunction createListenerCollection() {\n let first = null;\n let last = null;\n return {\n clear() {\n first = null;\n last = null;\n },\n notify() {\n defaultNoopBatch(() => {\n let listener = first;\n while (listener) {\n listener.callback();\n listener = listener.next;\n }\n });\n },\n get() {\n const listeners = [];\n let listener = first;\n while (listener) {\n listeners.push(listener);\n listener = listener.next;\n }\n return listeners;\n },\n subscribe(callback) {\n let isSubscribed = true;\n const listener = last = {\n callback,\n next: null,\n prev: last\n };\n if (listener.prev) {\n listener.prev.next = listener;\n } else {\n first = listener;\n }\n return function unsubscribe() {\n if (!isSubscribed || first === null)\n return;\n isSubscribed = false;\n if (listener.next) {\n listener.next.prev = listener.prev;\n } else {\n last = listener.prev;\n }\n if (listener.prev) {\n listener.prev.next = listener.next;\n } else {\n first = listener.next;\n }\n };\n }\n };\n}\nvar nullListeners = {\n notify() {\n },\n get: () => []\n};\nfunction createSubscription(store, parentSub) {\n let unsubscribe;\n let listeners = nullListeners;\n let subscriptionsAmount = 0;\n let selfSubscribed = false;\n function addNestedSub(listener) {\n trySubscribe();\n const cleanupListener = listeners.subscribe(listener);\n let removed = false;\n return () => {\n if (!removed) {\n removed = true;\n cleanupListener();\n tryUnsubscribe();\n }\n };\n }\n function notifyNestedSubs() {\n listeners.notify();\n }\n function handleChangeWrapper() {\n if (subscription.onStateChange) {\n subscription.onStateChange();\n }\n }\n function isSubscribed() {\n return selfSubscribed;\n }\n function trySubscribe() {\n subscriptionsAmount++;\n if (!unsubscribe) {\n unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);\n listeners = createListenerCollection();\n }\n }\n function tryUnsubscribe() {\n subscriptionsAmount--;\n if (unsubscribe && subscriptionsAmount === 0) {\n unsubscribe();\n unsubscribe = void 0;\n listeners.clear();\n listeners = nullListeners;\n }\n }\n function trySubscribeSelf() {\n if (!selfSubscribed) {\n selfSubscribed = true;\n trySubscribe();\n }\n }\n function tryUnsubscribeSelf() {\n if (selfSubscribed) {\n selfSubscribed = false;\n tryUnsubscribe();\n }\n }\n const subscription = {\n addNestedSub,\n notifyNestedSubs,\n handleChangeWrapper,\n isSubscribed,\n trySubscribe: trySubscribeSelf,\n tryUnsubscribe: tryUnsubscribeSelf,\n getListeners: () => listeners\n };\n return subscription;\n}\n\n// src/utils/useIsomorphicLayoutEffect.ts\nvar canUseDOM = !!(typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\");\nvar isReactNative = typeof navigator !== \"undefined\" && navigator.product === \"ReactNative\";\nvar useIsomorphicLayoutEffect = canUseDOM || isReactNative ? React.useLayoutEffect : React.useEffect;\n\n// src/utils/shallowEqual.ts\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\nfunction shallowEqual(objA, objB) {\n if (is(objA, objB))\n return true;\n if (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) {\n return false;\n }\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n if (keysA.length !== keysB.length)\n return false;\n for (let i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n return true;\n}\n\n// src/utils/hoistStatics.ts\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n $$typeof: true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n $$typeof: true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {\n [ForwardRef]: FORWARD_REF_STATICS,\n [Memo]: MEMO_STATICS\n};\nfunction getStatics(component) {\n if (isMemo(component)) {\n return MEMO_STATICS;\n }\n return TYPE_STATICS[component[\"$$typeof\"]] || REACT_STATICS;\n}\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent) {\n if (typeof sourceComponent !== \"string\") {\n if (objectPrototype) {\n const inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent);\n }\n }\n let keys = getOwnPropertyNames(sourceComponent);\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n const targetStatics = getStatics(targetComponent);\n const sourceStatics = getStatics(sourceComponent);\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!KNOWN_STATICS[key] && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n const descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n try {\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {\n }\n }\n }\n }\n return targetComponent;\n}\n\n// src/components/connect.tsx\nvar useSyncExternalStore = notInitialized;\nvar initializeConnect = (fn) => {\n useSyncExternalStore = fn;\n};\nvar NO_SUBSCRIPTION_ARRAY = [null, null];\nvar stringifyComponent = (Comp) => {\n try {\n return JSON.stringify(Comp);\n } catch (err) {\n return String(Comp);\n }\n};\nfunction useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {\n useIsomorphicLayoutEffect(() => effectFunc(...effectArgs), dependencies);\n}\nfunction captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs) {\n lastWrapperProps.current = wrapperProps;\n renderIsScheduled.current = false;\n if (childPropsFromStoreUpdate.current) {\n childPropsFromStoreUpdate.current = null;\n notifyNestedSubs();\n }\n}\nfunction subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, additionalSubscribeListener) {\n if (!shouldHandleStateChanges)\n return () => {\n };\n let didUnsubscribe = false;\n let lastThrownError = null;\n const checkForUpdates = () => {\n if (didUnsubscribe || !isMounted.current) {\n return;\n }\n const latestStoreState = store.getState();\n let newChildProps, error;\n try {\n newChildProps = childPropsSelector(\n latestStoreState,\n lastWrapperProps.current\n );\n } catch (e) {\n error = e;\n lastThrownError = e;\n }\n if (!error) {\n lastThrownError = null;\n }\n if (newChildProps === lastChildProps.current) {\n if (!renderIsScheduled.current) {\n notifyNestedSubs();\n }\n } else {\n lastChildProps.current = newChildProps;\n childPropsFromStoreUpdate.current = newChildProps;\n renderIsScheduled.current = true;\n additionalSubscribeListener();\n }\n };\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe();\n checkForUpdates();\n const unsubscribeWrapper = () => {\n didUnsubscribe = true;\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n if (lastThrownError) {\n throw lastThrownError;\n }\n };\n return unsubscribeWrapper;\n}\nfunction strictEqual(a, b) {\n return a === b;\n}\nvar hasWarnedAboutDeprecatedPureOption = false;\nfunction connect(mapStateToProps, mapDispatchToProps, mergeProps, {\n // The `pure` option has been removed, so TS doesn't like us destructuring this to check its existence.\n // @ts-ignore\n pure,\n areStatesEqual = strictEqual,\n areOwnPropsEqual = shallowEqual,\n areStatePropsEqual = shallowEqual,\n areMergedPropsEqual = shallowEqual,\n // use React's forwardRef to expose a ref of the wrapped component\n forwardRef = false,\n // the context consumer to use\n context = ReactReduxContext\n} = {}) {\n if (process.env.NODE_ENV !== \"production\") {\n if (pure !== void 0 && !hasWarnedAboutDeprecatedPureOption) {\n hasWarnedAboutDeprecatedPureOption = true;\n warning(\n 'The `pure` option has been removed. `connect` is now always a \"pure/memoized\" component'\n );\n }\n }\n const Context = context;\n const initMapStateToProps = mapStateToPropsFactory(mapStateToProps);\n const initMapDispatchToProps = mapDispatchToPropsFactory(mapDispatchToProps);\n const initMergeProps = mergePropsFactory(mergeProps);\n const shouldHandleStateChanges = Boolean(mapStateToProps);\n const wrapWithConnect = (WrappedComponent) => {\n if (process.env.NODE_ENV !== \"production\") {\n const isValid = /* @__PURE__ */ isValidElementType(WrappedComponent);\n if (!isValid)\n throw new Error(\n `You must pass a component to the function returned by connect. Instead received ${stringifyComponent(\n WrappedComponent\n )}`\n );\n }\n const wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || \"Component\";\n const displayName = `Connect(${wrappedComponentName})`;\n const selectorFactoryOptions = {\n shouldHandleStateChanges,\n displayName,\n wrappedComponentName,\n WrappedComponent,\n // @ts-ignore\n initMapStateToProps,\n // @ts-ignore\n initMapDispatchToProps,\n initMergeProps,\n areStatesEqual,\n areStatePropsEqual,\n areOwnPropsEqual,\n areMergedPropsEqual\n };\n function ConnectFunction(props) {\n const [propsContext, reactReduxForwardedRef, wrapperProps] = React.useMemo(() => {\n const { reactReduxForwardedRef: reactReduxForwardedRef2, ...wrapperProps2 } = props;\n return [props.context, reactReduxForwardedRef2, wrapperProps2];\n }, [props]);\n const ContextToUse = React.useMemo(() => {\n let ResultContext = Context;\n if (propsContext?.Consumer) {\n if (process.env.NODE_ENV !== \"production\") {\n const isValid = /* @__PURE__ */ isContextConsumer(\n // @ts-ignore\n /* @__PURE__ */ React.createElement(propsContext.Consumer, null)\n );\n if (!isValid) {\n throw new Error(\n \"You must pass a valid React context consumer as `props.context`\"\n );\n }\n ResultContext = propsContext;\n }\n }\n return ResultContext;\n }, [propsContext, Context]);\n const contextValue = React.useContext(ContextToUse);\n const didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);\n const didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);\n if (process.env.NODE_ENV !== \"production\" && !didStoreComeFromProps && !didStoreComeFromContext) {\n throw new Error(\n `Could not find \"store\" in the context of \"${displayName}\". Either wrap the root component in a , or pass a custom React context provider to and the corresponding React context consumer to ${displayName} in connect options.`\n );\n }\n const store = didStoreComeFromProps ? props.store : contextValue.store;\n const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState;\n const childPropsSelector = React.useMemo(() => {\n return finalPropsSelectorFactory(store.dispatch, selectorFactoryOptions);\n }, [store]);\n const [subscription, notifyNestedSubs] = React.useMemo(() => {\n if (!shouldHandleStateChanges)\n return NO_SUBSCRIPTION_ARRAY;\n const subscription2 = createSubscription(\n store,\n didStoreComeFromProps ? void 0 : contextValue.subscription\n );\n const notifyNestedSubs2 = subscription2.notifyNestedSubs.bind(subscription2);\n return [subscription2, notifyNestedSubs2];\n }, [store, didStoreComeFromProps, contextValue]);\n const overriddenContextValue = React.useMemo(() => {\n if (didStoreComeFromProps) {\n return contextValue;\n }\n return {\n ...contextValue,\n subscription\n };\n }, [didStoreComeFromProps, contextValue, subscription]);\n const lastChildProps = React.useRef(void 0);\n const lastWrapperProps = React.useRef(wrapperProps);\n const childPropsFromStoreUpdate = React.useRef(void 0);\n const renderIsScheduled = React.useRef(false);\n const isMounted = React.useRef(false);\n const latestSubscriptionCallbackError = React.useRef(\n void 0\n );\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n const actualChildPropsSelector = React.useMemo(() => {\n const selector = () => {\n if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {\n return childPropsFromStoreUpdate.current;\n }\n return childPropsSelector(store.getState(), wrapperProps);\n };\n return selector;\n }, [store, wrapperProps]);\n const subscribeForReact = React.useMemo(() => {\n const subscribe = (reactListener) => {\n if (!subscription) {\n return () => {\n };\n }\n return subscribeUpdates(\n shouldHandleStateChanges,\n store,\n subscription,\n // @ts-ignore\n childPropsSelector,\n lastWrapperProps,\n lastChildProps,\n renderIsScheduled,\n isMounted,\n childPropsFromStoreUpdate,\n notifyNestedSubs,\n reactListener\n );\n };\n return subscribe;\n }, [subscription]);\n useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [\n lastWrapperProps,\n lastChildProps,\n renderIsScheduled,\n wrapperProps,\n childPropsFromStoreUpdate,\n notifyNestedSubs\n ]);\n let actualChildProps;\n try {\n actualChildProps = useSyncExternalStore(\n // TODO We're passing through a big wrapper that does a bunch of extra side effects besides subscribing\n subscribeForReact,\n // TODO This is incredibly hacky. We've already processed the store update and calculated new child props,\n // TODO and we're just passing that through so it triggers a re-render for us rather than relying on `uSES`.\n actualChildPropsSelector,\n getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector\n );\n } catch (err) {\n if (latestSubscriptionCallbackError.current) {\n ;\n err.message += `\nThe error may be correlated with this previous error:\n${latestSubscriptionCallbackError.current.stack}\n\n`;\n }\n throw err;\n }\n useIsomorphicLayoutEffect(() => {\n latestSubscriptionCallbackError.current = void 0;\n childPropsFromStoreUpdate.current = void 0;\n lastChildProps.current = actualChildProps;\n });\n const renderedWrappedComponent = React.useMemo(() => {\n return (\n // @ts-ignore\n /* @__PURE__ */ React.createElement(\n WrappedComponent,\n {\n ...actualChildProps,\n ref: reactReduxForwardedRef\n }\n )\n );\n }, [reactReduxForwardedRef, WrappedComponent, actualChildProps]);\n const renderedChild = React.useMemo(() => {\n if (shouldHandleStateChanges) {\n return /* @__PURE__ */ React.createElement(ContextToUse.Provider, { value: overriddenContextValue }, renderedWrappedComponent);\n }\n return renderedWrappedComponent;\n }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);\n return renderedChild;\n }\n const _Connect = React.memo(ConnectFunction);\n const Connect = _Connect;\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = ConnectFunction.displayName = displayName;\n if (forwardRef) {\n const _forwarded = React.forwardRef(\n function forwardConnectRef(props, ref) {\n return /* @__PURE__ */ React.createElement(Connect, { ...props, reactReduxForwardedRef: ref });\n }\n );\n const forwarded = _forwarded;\n forwarded.displayName = displayName;\n forwarded.WrappedComponent = WrappedComponent;\n return /* @__PURE__ */ hoistNonReactStatics(forwarded, WrappedComponent);\n }\n return /* @__PURE__ */ hoistNonReactStatics(Connect, WrappedComponent);\n };\n return wrapWithConnect;\n}\nvar connect_default = connect;\n\n// src/components/Provider.tsx\nfunction Provider({\n store,\n context,\n children,\n serverState,\n stabilityCheck = \"once\",\n identityFunctionCheck = \"once\"\n}) {\n const contextValue = React.useMemo(() => {\n const subscription = createSubscription(store);\n return {\n store,\n subscription,\n getServerState: serverState ? () => serverState : void 0,\n stabilityCheck,\n identityFunctionCheck\n };\n }, [store, serverState, stabilityCheck, identityFunctionCheck]);\n const previousState = React.useMemo(() => store.getState(), [store]);\n useIsomorphicLayoutEffect(() => {\n const { subscription } = contextValue;\n subscription.onStateChange = subscription.notifyNestedSubs;\n subscription.trySubscribe();\n if (previousState !== store.getState()) {\n subscription.notifyNestedSubs();\n }\n return () => {\n subscription.tryUnsubscribe();\n subscription.onStateChange = void 0;\n };\n }, [contextValue, previousState]);\n const Context = context || ReactReduxContext;\n return /* @__PURE__ */ React.createElement(Context.Provider, { value: contextValue }, children);\n}\nvar Provider_default = Provider;\n\n// src/hooks/useStore.ts\nfunction createStoreHook(context = ReactReduxContext) {\n const useReduxContext2 = context === ReactReduxContext ? useReduxContext : (\n // @ts-ignore\n createReduxContextHook(context)\n );\n const useStore2 = () => {\n const { store } = useReduxContext2();\n return store;\n };\n Object.assign(useStore2, {\n withTypes: () => useStore2\n });\n return useStore2;\n}\nvar useStore = /* @__PURE__ */ createStoreHook();\n\n// src/hooks/useDispatch.ts\nfunction createDispatchHook(context = ReactReduxContext) {\n const useStore2 = context === ReactReduxContext ? useStore : createStoreHook(context);\n const useDispatch2 = () => {\n const store = useStore2();\n return store.dispatch;\n };\n Object.assign(useDispatch2, {\n withTypes: () => useDispatch2\n });\n return useDispatch2;\n}\nvar useDispatch = /* @__PURE__ */ createDispatchHook();\n\n// src/exports.ts\nvar batch = defaultNoopBatch;\n\n// src/index.ts\ninitializeUseSelector(useSyncExternalStoreWithSelector2);\ninitializeConnect(React2.useSyncExternalStore);\nexport {\n Provider_default as Provider,\n ReactReduxContext,\n batch,\n connect_default as connect,\n createDispatchHook,\n createSelectorHook,\n createStoreHook,\n shallowEqual,\n useDispatch,\n useSelector,\n useStore\n};\n//# sourceMappingURL=react-redux.mjs.map","// src/utils/formatProdErrorMessage.ts\nfunction formatProdErrorMessage(code) {\n return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;\n}\n\n// src/utils/symbol-observable.ts\nvar $$observable = /* @__PURE__ */ (() => typeof Symbol === \"function\" && Symbol.observable || \"@@observable\")();\nvar symbol_observable_default = $$observable;\n\n// src/utils/actionTypes.ts\nvar randomString = () => Math.random().toString(36).substring(7).split(\"\").join(\".\");\nvar ActionTypes = {\n INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,\n REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,\n PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`\n};\nvar actionTypes_default = ActionTypes;\n\n// src/utils/isPlainObject.ts\nfunction isPlainObject(obj) {\n if (typeof obj !== \"object\" || obj === null)\n return false;\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;\n}\n\n// src/utils/kindOf.ts\nfunction miniKindOf(val) {\n if (val === void 0)\n return \"undefined\";\n if (val === null)\n return \"null\";\n const type = typeof val;\n switch (type) {\n case \"boolean\":\n case \"string\":\n case \"number\":\n case \"symbol\":\n case \"function\": {\n return type;\n }\n }\n if (Array.isArray(val))\n return \"array\";\n if (isDate(val))\n return \"date\";\n if (isError(val))\n return \"error\";\n const constructorName = ctorName(val);\n switch (constructorName) {\n case \"Symbol\":\n case \"Promise\":\n case \"WeakMap\":\n case \"WeakSet\":\n case \"Map\":\n case \"Set\":\n return constructorName;\n }\n return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\\s/g, \"\");\n}\nfunction ctorName(val) {\n return typeof val.constructor === \"function\" ? val.constructor.name : null;\n}\nfunction isError(val) {\n return val instanceof Error || typeof val.message === \"string\" && val.constructor && typeof val.constructor.stackTraceLimit === \"number\";\n}\nfunction isDate(val) {\n if (val instanceof Date)\n return true;\n return typeof val.toDateString === \"function\" && typeof val.getDate === \"function\" && typeof val.setDate === \"function\";\n}\nfunction kindOf(val) {\n let typeOfVal = typeof val;\n if (process.env.NODE_ENV !== \"production\") {\n typeOfVal = miniKindOf(val);\n }\n return typeOfVal;\n}\n\n// src/createStore.ts\nfunction createStore(reducer, preloadedState, enhancer) {\n if (typeof reducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : `Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`);\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"function\" || typeof enhancer === \"function\" && typeof arguments[3] === \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : \"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.\");\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"undefined\") {\n enhancer = preloadedState;\n preloadedState = void 0;\n }\n if (typeof enhancer !== \"undefined\") {\n if (typeof enhancer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : `Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`);\n }\n return enhancer(createStore)(reducer, preloadedState);\n }\n let currentReducer = reducer;\n let currentState = preloadedState;\n let currentListeners = /* @__PURE__ */ new Map();\n let nextListeners = currentListeners;\n let listenerIdCounter = 0;\n let isDispatching = false;\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = /* @__PURE__ */ new Map();\n currentListeners.forEach((listener, key) => {\n nextListeners.set(key, listener);\n });\n }\n }\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : \"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.\");\n }\n return currentState;\n }\n function subscribe(listener) {\n if (typeof listener !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : `Expected the listener to be a function. Instead, received: '${kindOf(listener)}'`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : \"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n let isSubscribed = true;\n ensureCanMutateNextListeners();\n const listenerId = listenerIdCounter++;\n nextListeners.set(listenerId, listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : \"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n isSubscribed = false;\n ensureCanMutateNextListeners();\n nextListeners.delete(listenerId);\n currentListeners = null;\n };\n }\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : `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.`);\n }\n if (typeof action.type === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n if (typeof action.type !== \"string\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(17) : `Action \"type\" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : \"Reducers may not dispatch actions.\");\n }\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n const listeners = currentListeners = nextListeners;\n listeners.forEach((listener) => {\n listener();\n });\n return action;\n }\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : `Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`);\n }\n currentReducer = nextReducer;\n dispatch({\n type: actionTypes_default.REPLACE\n });\n }\n function observable() {\n const outerSubscribe = subscribe;\n return {\n /**\n * The minimal observable subscription method.\n * @param observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe(observer) {\n if (typeof observer !== \"object\" || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : `Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`);\n }\n function observeState() {\n const observerAsObserver = observer;\n if (observerAsObserver.next) {\n observerAsObserver.next(getState());\n }\n }\n observeState();\n const unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe\n };\n },\n [symbol_observable_default]() {\n return this;\n }\n };\n }\n dispatch({\n type: actionTypes_default.INIT\n });\n const store = {\n dispatch,\n subscribe,\n getState,\n replaceReducer,\n [symbol_observable_default]: observable\n };\n return store;\n}\nfunction legacy_createStore(reducer, preloadedState, enhancer) {\n return createStore(reducer, preloadedState, enhancer);\n}\n\n// src/utils/warning.ts\nfunction warning(message) {\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(message);\n }\n try {\n throw new Error(message);\n } catch (e) {\n }\n}\n\n// src/combineReducers.ts\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n const reducerKeys = Object.keys(reducers);\n const argumentName = action && action.type === actionTypes_default.INIT ? \"preloadedState argument passed to createStore\" : \"previous state received by the reducer\";\n if (reducerKeys.length === 0) {\n return \"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.\";\n }\n if (!isPlainObject(inputState)) {\n return `The ${argumentName} has unexpected type of \"${kindOf(inputState)}\". Expected argument to be an object with the following keys: \"${reducerKeys.join('\", \"')}\"`;\n }\n const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);\n unexpectedKeys.forEach((key) => {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === actionTypes_default.REPLACE)\n return;\n if (unexpectedKeys.length > 0) {\n 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.`;\n }\n}\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach((key) => {\n const reducer = reducers[key];\n const initialState = reducer(void 0, {\n type: actionTypes_default.INIT\n });\n if (typeof initialState === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : `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.`);\n }\n if (typeof reducer(void 0, {\n type: actionTypes_default.PROBE_UNKNOWN_ACTION()\n }) === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : `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.`);\n }\n });\n}\nfunction combineReducers(reducers) {\n const reducerKeys = Object.keys(reducers);\n const finalReducers = {};\n for (let i = 0; i < reducerKeys.length; i++) {\n const key = reducerKeys[i];\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof reducers[key] === \"undefined\") {\n warning(`No reducer provided for key \"${key}\"`);\n }\n }\n if (typeof reducers[key] === \"function\") {\n finalReducers[key] = reducers[key];\n }\n }\n const finalReducerKeys = Object.keys(finalReducers);\n let unexpectedKeyCache;\n if (process.env.NODE_ENV !== \"production\") {\n unexpectedKeyCache = {};\n }\n let shapeAssertionError;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n return function combination(state = {}, action) {\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n if (process.env.NODE_ENV !== \"production\") {\n const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n let hasChanged = false;\n const nextState = {};\n for (let i = 0; i < finalReducerKeys.length; i++) {\n const key = finalReducerKeys[i];\n const reducer = finalReducers[key];\n const previousStateForKey = state[key];\n const nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === \"undefined\") {\n const actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : `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.`);\n }\n nextState[key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\n// src/bindActionCreators.ts\nfunction bindActionCreator(actionCreator, dispatch) {\n return function(...args) {\n return dispatch(actionCreator.apply(this, args));\n };\n}\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === \"function\") {\n return bindActionCreator(actionCreators, dispatch);\n }\n if (typeof actionCreators !== \"object\" || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : `bindActionCreators expected an object or a function, but instead received: '${kindOf(actionCreators)}'. Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?`);\n }\n const boundActionCreators = {};\n for (const key in actionCreators) {\n const actionCreator = actionCreators[key];\n if (typeof actionCreator === \"function\") {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n return boundActionCreators;\n}\n\n// src/compose.ts\nfunction compose(...funcs) {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n if (funcs.length === 1) {\n return funcs[0];\n }\n return funcs.reduce((a, b) => (...args) => a(b(...args)));\n}\n\n// src/applyMiddleware.ts\nfunction applyMiddleware(...middlewares) {\n return (createStore2) => (reducer, preloadedState) => {\n const store = createStore2(reducer, preloadedState);\n let dispatch = () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : \"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.\");\n };\n const middlewareAPI = {\n getState: store.getState,\n dispatch: (action, ...args) => dispatch(action, ...args)\n };\n const chain = middlewares.map((middleware) => middleware(middlewareAPI));\n dispatch = compose(...chain)(store.dispatch);\n return {\n ...store,\n dispatch\n };\n };\n}\n\n// src/utils/isAction.ts\nfunction isAction(action) {\n return isPlainObject(action) && \"type\" in action && typeof action.type === \"string\";\n}\nexport {\n actionTypes_default as __DO_NOT_USE__ActionTypes,\n applyMiddleware,\n bindActionCreators,\n combineReducers,\n compose,\n createStore,\n isAction,\n isPlainObject,\n legacy_createStore\n};\n//# sourceMappingURL=redux.mjs.map","// src/devModeChecks/identityFunctionCheck.ts\nvar runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => {\n if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) {\n let isInputSameAsOutput = false;\n try {\n const emptyObject = {};\n if (resultFunc(emptyObject) === emptyObject)\n isInputSameAsOutput = true;\n } catch {\n }\n if (isInputSameAsOutput) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"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.\",\n { stack }\n );\n }\n }\n};\n\n// src/devModeChecks/inputStabilityCheck.ts\nvar runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => {\n const { memoize, memoizeOptions } = options;\n const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject;\n const createAnEmptyObject = memoize(() => ({}), ...memoizeOptions);\n const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy);\n if (!areInputSelectorResultsEqual) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"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)`\",\n {\n arguments: inputSelectorArgs,\n firstInputs: inputSelectorResults,\n secondInputs: inputSelectorResultsCopy,\n stack\n }\n );\n }\n};\n\n// src/devModeChecks/setGlobalDevModeChecks.ts\nvar globalDevModeChecks = {\n inputStabilityCheck: \"once\",\n identityFunctionCheck: \"once\"\n};\nvar setGlobalDevModeChecks = (devModeChecks) => {\n Object.assign(globalDevModeChecks, devModeChecks);\n};\n\n// src/utils.ts\nvar NOT_FOUND = \"NOT_FOUND\";\nfunction assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) {\n if (typeof func !== \"function\") {\n throw new TypeError(errorMessage);\n }\n}\nfunction assertIsObject(object, errorMessage = `expected an object, instead received ${typeof object}`) {\n if (typeof object !== \"object\") {\n throw new TypeError(errorMessage);\n }\n}\nfunction assertIsArrayOfFunctions(array, errorMessage = `expected all items to be functions, instead received the following types: `) {\n if (!array.every((item) => typeof item === \"function\")) {\n const itemTypes = array.map(\n (item) => typeof item === \"function\" ? `function ${item.name || \"unnamed\"}()` : typeof item\n ).join(\", \");\n throw new TypeError(`${errorMessage}[${itemTypes}]`);\n }\n}\nvar ensureIsArray = (item) => {\n return Array.isArray(item) ? item : [item];\n};\nfunction getDependencies(createSelectorArgs) {\n const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs;\n assertIsArrayOfFunctions(\n dependencies,\n `createSelector expects all input-selectors to be functions, but received the following types: `\n );\n return dependencies;\n}\nfunction collectInputSelectorResults(dependencies, inputSelectorArgs) {\n const inputSelectorResults = [];\n const { length } = dependencies;\n for (let i = 0; i < length; i++) {\n inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs));\n }\n return inputSelectorResults;\n}\nvar getDevModeChecksExecutionInfo = (firstRun, devModeChecks) => {\n const { identityFunctionCheck, inputStabilityCheck } = {\n ...globalDevModeChecks,\n ...devModeChecks\n };\n return {\n identityFunctionCheck: {\n shouldRun: identityFunctionCheck === \"always\" || identityFunctionCheck === \"once\" && firstRun,\n run: runIdentityFunctionCheck\n },\n inputStabilityCheck: {\n shouldRun: inputStabilityCheck === \"always\" || inputStabilityCheck === \"once\" && firstRun,\n run: runInputStabilityCheck\n }\n };\n};\n\n// src/autotrackMemoize/autotracking.ts\nvar $REVISION = 0;\nvar CURRENT_TRACKER = null;\nvar Cell = class {\n revision = $REVISION;\n _value;\n _lastValue;\n _isEqual = tripleEq;\n constructor(initialValue, isEqual = tripleEq) {\n this._value = this._lastValue = initialValue;\n this._isEqual = isEqual;\n }\n // Whenever a storage value is read, it'll add itself to the current tracker if\n // one exists, entangling its state with that cache.\n get value() {\n CURRENT_TRACKER?.add(this);\n return this._value;\n }\n // Whenever a storage value is updated, we bump the global revision clock,\n // assign the revision for this storage to the new value, _and_ we schedule a\n // rerender. This is important, and it's what makes autotracking _pull_\n // based. We don't actively tell the caches which depend on the storage that\n // anything has happened. Instead, we recompute the caches when needed.\n set value(newValue) {\n if (this.value === newValue)\n return;\n this._value = newValue;\n this.revision = ++$REVISION;\n }\n};\nfunction tripleEq(a, b) {\n return a === b;\n}\nvar TrackingCache = class {\n _cachedValue;\n _cachedRevision = -1;\n _deps = [];\n hits = 0;\n fn;\n constructor(fn) {\n this.fn = fn;\n }\n clear() {\n this._cachedValue = void 0;\n this._cachedRevision = -1;\n this._deps = [];\n this.hits = 0;\n }\n get value() {\n if (this.revision > this._cachedRevision) {\n const { fn } = this;\n const currentTracker = /* @__PURE__ */ new Set();\n const prevTracker = CURRENT_TRACKER;\n CURRENT_TRACKER = currentTracker;\n this._cachedValue = fn();\n CURRENT_TRACKER = prevTracker;\n this.hits++;\n this._deps = Array.from(currentTracker);\n this._cachedRevision = this.revision;\n }\n CURRENT_TRACKER?.add(this);\n return this._cachedValue;\n }\n get revision() {\n return Math.max(...this._deps.map((d) => d.revision), 0);\n }\n};\nfunction getValue(cell) {\n if (!(cell instanceof Cell)) {\n console.warn(\"Not a valid cell! \", cell);\n }\n return cell.value;\n}\nfunction setValue(storage, value) {\n if (!(storage instanceof Cell)) {\n throw new TypeError(\n \"setValue must be passed a tracked store created with `createStorage`.\"\n );\n }\n storage.value = storage._lastValue = value;\n}\nfunction createCell(initialValue, isEqual = tripleEq) {\n return new Cell(initialValue, isEqual);\n}\nfunction createCache(fn) {\n assertIsFunction(\n fn,\n \"the first parameter to `createCache` must be a function\"\n );\n return new TrackingCache(fn);\n}\n\n// src/autotrackMemoize/tracking.ts\nvar neverEq = (a, b) => false;\nfunction createTag() {\n return createCell(null, neverEq);\n}\nfunction dirtyTag(tag, value) {\n setValue(tag, value);\n}\nvar consumeCollection = (node) => {\n let tag = node.collectionTag;\n if (tag === null) {\n tag = node.collectionTag = createTag();\n }\n getValue(tag);\n};\nvar dirtyCollection = (node) => {\n const tag = node.collectionTag;\n if (tag !== null) {\n dirtyTag(tag, null);\n }\n};\n\n// src/autotrackMemoize/proxy.ts\nvar REDUX_PROXY_LABEL = Symbol();\nvar nextId = 0;\nvar proto = Object.getPrototypeOf({});\nvar ObjectTreeNode = class {\n constructor(value) {\n this.value = value;\n this.value = value;\n this.tag.value = value;\n }\n proxy = new Proxy(this, objectProxyHandler);\n tag = createTag();\n tags = {};\n children = {};\n collectionTag = null;\n id = nextId++;\n};\nvar objectProxyHandler = {\n get(node, key) {\n function calculateResult() {\n const { value } = node;\n const childValue = Reflect.get(value, key);\n if (typeof key === \"symbol\") {\n return childValue;\n }\n if (key in proto) {\n return childValue;\n }\n if (typeof childValue === \"object\" && childValue !== null) {\n let childNode = node.children[key];\n if (childNode === void 0) {\n childNode = node.children[key] = createNode(childValue);\n }\n if (childNode.tag) {\n getValue(childNode.tag);\n }\n return childNode.proxy;\n } else {\n let tag = node.tags[key];\n if (tag === void 0) {\n tag = node.tags[key] = createTag();\n tag.value = childValue;\n }\n getValue(tag);\n return childValue;\n }\n }\n const res = calculateResult();\n return res;\n },\n ownKeys(node) {\n consumeCollection(node);\n return Reflect.ownKeys(node.value);\n },\n getOwnPropertyDescriptor(node, prop) {\n return Reflect.getOwnPropertyDescriptor(node.value, prop);\n },\n has(node, prop) {\n return Reflect.has(node.value, prop);\n }\n};\nvar ArrayTreeNode = class {\n constructor(value) {\n this.value = value;\n this.value = value;\n this.tag.value = value;\n }\n proxy = new Proxy([this], arrayProxyHandler);\n tag = createTag();\n tags = {};\n children = {};\n collectionTag = null;\n id = nextId++;\n};\nvar arrayProxyHandler = {\n get([node], key) {\n if (key === \"length\") {\n consumeCollection(node);\n }\n return objectProxyHandler.get(node, key);\n },\n ownKeys([node]) {\n return objectProxyHandler.ownKeys(node);\n },\n getOwnPropertyDescriptor([node], prop) {\n return objectProxyHandler.getOwnPropertyDescriptor(node, prop);\n },\n has([node], prop) {\n return objectProxyHandler.has(node, prop);\n }\n};\nfunction createNode(value) {\n if (Array.isArray(value)) {\n return new ArrayTreeNode(value);\n }\n return new ObjectTreeNode(value);\n}\nfunction updateNode(node, newValue) {\n const { value, tags, children } = node;\n node.value = newValue;\n if (Array.isArray(value) && Array.isArray(newValue) && value.length !== newValue.length) {\n dirtyCollection(node);\n } else {\n if (value !== newValue) {\n let oldKeysSize = 0;\n let newKeysSize = 0;\n let anyKeysAdded = false;\n for (const _key in value) {\n oldKeysSize++;\n }\n for (const key in newValue) {\n newKeysSize++;\n if (!(key in value)) {\n anyKeysAdded = true;\n break;\n }\n }\n const isDifferent = anyKeysAdded || oldKeysSize !== newKeysSize;\n if (isDifferent) {\n dirtyCollection(node);\n }\n }\n }\n for (const key in tags) {\n const childValue = value[key];\n const newChildValue = newValue[key];\n if (childValue !== newChildValue) {\n dirtyCollection(node);\n dirtyTag(tags[key], newChildValue);\n }\n if (typeof newChildValue === \"object\" && newChildValue !== null) {\n delete tags[key];\n }\n }\n for (const key in children) {\n const childNode = children[key];\n const newChildValue = newValue[key];\n const childValue = childNode.value;\n if (childValue === newChildValue) {\n continue;\n } else if (typeof newChildValue === \"object\" && newChildValue !== null) {\n updateNode(childNode, newChildValue);\n } else {\n deleteNode(childNode);\n delete children[key];\n }\n }\n}\nfunction deleteNode(node) {\n if (node.tag) {\n dirtyTag(node.tag, null);\n }\n dirtyCollection(node);\n for (const key in node.tags) {\n dirtyTag(node.tags[key], null);\n }\n for (const key in node.children) {\n deleteNode(node.children[key]);\n }\n}\n\n// src/lruMemoize.ts\nfunction createSingletonCache(equals) {\n let entry;\n return {\n get(key) {\n if (entry && equals(entry.key, key)) {\n return entry.value;\n }\n return NOT_FOUND;\n },\n put(key, value) {\n entry = { key, value };\n },\n getEntries() {\n return entry ? [entry] : [];\n },\n clear() {\n entry = void 0;\n }\n };\n}\nfunction createLruCache(maxSize, equals) {\n let entries = [];\n function get(key) {\n const cacheIndex = entries.findIndex((entry) => equals(key, entry.key));\n if (cacheIndex > -1) {\n const entry = entries[cacheIndex];\n if (cacheIndex > 0) {\n entries.splice(cacheIndex, 1);\n entries.unshift(entry);\n }\n return entry.value;\n }\n return NOT_FOUND;\n }\n function put(key, value) {\n if (get(key) === NOT_FOUND) {\n entries.unshift({ key, value });\n if (entries.length > maxSize) {\n entries.pop();\n }\n }\n }\n function getEntries() {\n return entries;\n }\n function clear() {\n entries = [];\n }\n return { get, put, getEntries, clear };\n}\nvar referenceEqualityCheck = (a, b) => a === b;\nfunction createCacheKeyComparator(equalityCheck) {\n return function areArgumentsShallowlyEqual(prev, next) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n const { length } = prev;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n return true;\n };\n}\nfunction lruMemoize(func, equalityCheckOrOptions) {\n const providedOptions = typeof equalityCheckOrOptions === \"object\" ? equalityCheckOrOptions : { equalityCheck: equalityCheckOrOptions };\n const {\n equalityCheck = referenceEqualityCheck,\n maxSize = 1,\n resultEqualityCheck\n } = providedOptions;\n const comparator = createCacheKeyComparator(equalityCheck);\n let resultsCount = 0;\n const cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator);\n function memoized() {\n let value = cache.get(arguments);\n if (value === NOT_FOUND) {\n value = func.apply(null, arguments);\n resultsCount++;\n if (resultEqualityCheck) {\n const entries = cache.getEntries();\n const matchingEntry = entries.find(\n (entry) => resultEqualityCheck(entry.value, value)\n );\n if (matchingEntry) {\n value = matchingEntry.value;\n resultsCount !== 0 && resultsCount--;\n }\n }\n cache.put(arguments, value);\n }\n return value;\n }\n memoized.clearCache = () => {\n cache.clear();\n memoized.resetResultsCount();\n };\n memoized.resultsCount = () => resultsCount;\n memoized.resetResultsCount = () => {\n resultsCount = 0;\n };\n return memoized;\n}\n\n// src/autotrackMemoize/autotrackMemoize.ts\nfunction autotrackMemoize(func) {\n const node = createNode(\n []\n );\n let lastArgs = null;\n const shallowEqual = createCacheKeyComparator(referenceEqualityCheck);\n const cache = createCache(() => {\n const res = func.apply(null, node.proxy);\n return res;\n });\n function memoized() {\n if (!shallowEqual(lastArgs, arguments)) {\n updateNode(node, arguments);\n lastArgs = arguments;\n }\n return cache.value;\n }\n memoized.clearCache = () => {\n return cache.clear();\n };\n return memoized;\n}\n\n// src/weakMapMemoize.ts\nvar StrongRef = class {\n constructor(value) {\n this.value = value;\n }\n deref() {\n return this.value;\n }\n};\nvar Ref = typeof WeakRef !== \"undefined\" ? WeakRef : StrongRef;\nvar UNTERMINATED = 0;\nvar TERMINATED = 1;\nfunction createCacheNode() {\n return {\n s: UNTERMINATED,\n v: void 0,\n o: null,\n p: null\n };\n}\nfunction weakMapMemoize(func, options = {}) {\n let fnNode = createCacheNode();\n const { resultEqualityCheck } = options;\n let lastResult;\n let resultsCount = 0;\n function memoized() {\n let cacheNode = fnNode;\n const { length } = arguments;\n for (let i = 0, l = length; i < l; i++) {\n const arg = arguments[i];\n if (typeof arg === \"function\" || typeof arg === \"object\" && arg !== null) {\n let objectCache = cacheNode.o;\n if (objectCache === null) {\n cacheNode.o = objectCache = /* @__PURE__ */ new WeakMap();\n }\n const objectNode = objectCache.get(arg);\n if (objectNode === void 0) {\n cacheNode = createCacheNode();\n objectCache.set(arg, cacheNode);\n } else {\n cacheNode = objectNode;\n }\n } else {\n let primitiveCache = cacheNode.p;\n if (primitiveCache === null) {\n cacheNode.p = primitiveCache = /* @__PURE__ */ new Map();\n }\n const primitiveNode = primitiveCache.get(arg);\n if (primitiveNode === void 0) {\n cacheNode = createCacheNode();\n primitiveCache.set(arg, cacheNode);\n } else {\n cacheNode = primitiveNode;\n }\n }\n }\n const terminatedNode = cacheNode;\n let result;\n if (cacheNode.s === TERMINATED) {\n result = cacheNode.v;\n } else {\n result = func.apply(null, arguments);\n resultsCount++;\n }\n terminatedNode.s = TERMINATED;\n if (resultEqualityCheck) {\n const lastResultValue = lastResult?.deref?.() ?? lastResult;\n if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) {\n result = lastResultValue;\n resultsCount !== 0 && resultsCount--;\n }\n const needsWeakRef = typeof result === \"object\" && result !== null || typeof result === \"function\";\n lastResult = needsWeakRef ? new Ref(result) : result;\n }\n terminatedNode.v = result;\n return result;\n }\n memoized.clearCache = () => {\n fnNode = createCacheNode();\n memoized.resetResultsCount();\n };\n memoized.resultsCount = () => resultsCount;\n memoized.resetResultsCount = () => {\n resultsCount = 0;\n };\n return memoized;\n}\n\n// src/createSelectorCreator.ts\nfunction createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) {\n const createSelectorCreatorOptions = typeof memoizeOrOptions === \"function\" ? {\n memoize: memoizeOrOptions,\n memoizeOptions: memoizeOptionsFromArgs\n } : memoizeOrOptions;\n const createSelector2 = (...createSelectorArgs) => {\n let recomputations = 0;\n let dependencyRecomputations = 0;\n let lastResult;\n let directlyPassedOptions = {};\n let resultFunc = createSelectorArgs.pop();\n if (typeof resultFunc === \"object\") {\n directlyPassedOptions = resultFunc;\n resultFunc = createSelectorArgs.pop();\n }\n assertIsFunction(\n resultFunc,\n `createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]`\n );\n const combinedOptions = {\n ...createSelectorCreatorOptions,\n ...directlyPassedOptions\n };\n const {\n memoize,\n memoizeOptions = [],\n argsMemoize = weakMapMemoize,\n argsMemoizeOptions = [],\n devModeChecks = {}\n } = combinedOptions;\n const finalMemoizeOptions = ensureIsArray(memoizeOptions);\n const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions);\n const dependencies = getDependencies(createSelectorArgs);\n const memoizedResultFunc = memoize(function recomputationWrapper() {\n recomputations++;\n return resultFunc.apply(\n null,\n arguments\n );\n }, ...finalMemoizeOptions);\n let firstRun = true;\n const selector = argsMemoize(function dependenciesChecker() {\n dependencyRecomputations++;\n const inputSelectorResults = collectInputSelectorResults(\n dependencies,\n arguments\n );\n lastResult = memoizedResultFunc.apply(null, inputSelectorResults);\n if (process.env.NODE_ENV !== \"production\") {\n const { identityFunctionCheck, inputStabilityCheck } = getDevModeChecksExecutionInfo(firstRun, devModeChecks);\n if (identityFunctionCheck.shouldRun) {\n identityFunctionCheck.run(\n resultFunc,\n inputSelectorResults,\n lastResult\n );\n }\n if (inputStabilityCheck.shouldRun) {\n const inputSelectorResultsCopy = collectInputSelectorResults(\n dependencies,\n arguments\n );\n inputStabilityCheck.run(\n { inputSelectorResults, inputSelectorResultsCopy },\n { memoize, memoizeOptions: finalMemoizeOptions },\n arguments\n );\n }\n if (firstRun)\n firstRun = false;\n }\n return lastResult;\n }, ...finalArgsMemoizeOptions);\n return Object.assign(selector, {\n resultFunc,\n memoizedResultFunc,\n dependencies,\n dependencyRecomputations: () => dependencyRecomputations,\n resetDependencyRecomputations: () => {\n dependencyRecomputations = 0;\n },\n lastResult: () => lastResult,\n recomputations: () => recomputations,\n resetRecomputations: () => {\n recomputations = 0;\n },\n memoize,\n argsMemoize\n });\n };\n Object.assign(createSelector2, {\n withTypes: () => createSelector2\n });\n return createSelector2;\n}\nvar createSelector = /* @__PURE__ */ createSelectorCreator(weakMapMemoize);\n\n// src/createStructuredSelector.ts\nvar createStructuredSelector = Object.assign(\n (inputSelectorsObject, selectorCreator = createSelector) => {\n assertIsObject(\n inputSelectorsObject,\n `createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof inputSelectorsObject}`\n );\n const inputSelectorKeys = Object.keys(inputSelectorsObject);\n const dependencies = inputSelectorKeys.map(\n (key) => inputSelectorsObject[key]\n );\n const structuredSelector = selectorCreator(\n dependencies,\n (...inputSelectorResults) => {\n return inputSelectorResults.reduce((composition, value, index) => {\n composition[inputSelectorKeys[index]] = value;\n return composition;\n }, {});\n }\n );\n return structuredSelector;\n },\n { withTypes: () => createStructuredSelector }\n);\nexport {\n createSelector,\n createSelectorCreator,\n createStructuredSelector,\n lruMemoize,\n referenceEqualityCheck,\n setGlobalDevModeChecks,\n autotrackMemoize as unstable_autotrackMemoize,\n weakMapMemoize\n};\n//# sourceMappingURL=reselect.mjs.map"],"names":["StyleSheet","options","_this","_insertTag","tag","before","tags","length","insertionPoint","nextSibling","prepend","container","firstChild","insertBefore","push","isSpeedy","undefined","speedy","ctr","nonce","key","_proto","prototype","hydrate","nodes","forEach","insert","rule","document","createElement","setAttribute","appendChild","createTextNode","sheet","sheetForTag","i","styleSheets","ownerNode","insertRule","cssRules","e","flush","parentNode","removeChild","abs","Math","Utility_from","String","fromCharCode","Utility_assign","Object","assign","Utility_replace","value","pattern","replacement","replace","indexof","search","indexOf","Utility_charat","index","charCodeAt","Utility_substr","begin","end","slice","Utility_strlen","Utility_append","array","line","column","Tokenizer_length","position","character","characters","node","root","parent","type","props","children","return","Tokenizer_copy","next","peek","token","alloc","delimit","delimiter","trim","Enum_MS","Enum_MOZ","Enum_WEBKIT","COMMENT","Enum_RULESET","Enum_DECLARATION","Enum_KEYFRAMES","Serializer_serialize","callback","output","stringify","element","join","ruleset","offset","rules","points","post","size","j","k","x","y","z","declaration","identifierWithPointTracking","previous","toRules","parsed","getRules","fixedElements","WeakMap","compat","isImplicitRule","get","set","parentRules","removeLabel","defaultStylisPlugins","emotion_cache_browser_esm_prefix","exec","map","createCache","collection","_insert","currentSheet","ssrStyles","querySelectorAll","Array","call","dataEmotionAttribute","getAttribute","head","stylisPlugins","inserted","nodesToHydrate","attrib","split","serializer","omnipresentPlugins","concat","stylis","styles","parse","rulesets","pseudo","declarations","atrule","property","variable","scanning","ampersand","reference","whitespace","escaping","count","caret","commenter","prev","identifier","selector","serialized","shouldCache","cache","name","registered","memoize","fn","create","arg","isBrowser","EmotionCacheContext","react__WEBPACK_IMPORTED_MODULE_0__","createContext","HTMLElement","_emotion_cache__WEBPACK_IMPORTED_MODULE_1__","Z","CacheProvider","Provider","withEmotionCache","func","forwardRef","ref","useContext","ThemeContext","Global","_emotion_element_43c6fea0_browser_esm_js__WEBPACK_IMPORTED_MODULE_5__","w","_emotion_serialize__WEBPACK_IMPORTED_MODULE_2__","O","T","_ref","serializedNames","serializedStyles","dangerouslySetInnerHTML","__html","sheetRef","useRef","_emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_1__","constructor","rehydrating","querySelector","current","sheetRefCurrent","_emotion_utils__WEBPACK_IMPORTED_MODULE_6__","My","nextElementSibling","css","_len","arguments","args","_key","keyframes","insertable","apply","anim","toString","cursor","unitlessKeys","animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","msGridRow","msGridRowSpan","msGridColumn","msGridColumnSpan","fontWeight","lineHeight","opacity","order","orphans","tabSize","widows","zIndex","zoom","WebkitLineClamp","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","hyphenateRegex","animationRegex","isCustomProperty","isProcessableValue","processStyleName","emotion_memoize_esm","styleName","toLowerCase","processStyleValue","match","p1","p2","handleInterpolation","mergedProps","interpolation","__emotion_styles","createStringFromObject","obj","string","isArray","_i","interpolated","previousCursor","result","cached","labelPattern","serializeStyles","stringMode","strings","raw","lastIndex","identifierName","murmur2","str","h","len","useInsertionEffect","react__WEBPACK_IMPORTED_MODULE_0___namespace_cache","__webpack_require__","t","useInsertionEffectAlwaysWithSyncFallback","useInsertionEffectWithLayoutFallback","useLayoutEffect","getRegisteredStyles","registeredStyles","classNames","rawClassName","className","registerStyles","isStringTag","insertStyles","_excluded","useUtilityClasses","ownerState","color","disableElevation","fullWidth","variant","classes","slots","capitalize","label","startIcon","endIcon","composedClasses","composeClasses","getButtonUtilityClass","_extends","commonIconStyles","fontSize","ButtonRoot","styled","ButtonBase","shouldForwardProp","prop","rootShouldForwardProp","slot","overridesResolver","colorInherit","_theme$palette$getCon","_theme$palette","theme","param","inheritContainedBackgroundColor","palette","mode","grey","inheritContainedHoverBackgroundColor","A100","typography","button","minWidth","padding","borderRadius","vars","shape","transition","transitions","duration","short","textDecoration","backgroundColor","text","primaryChannel","action","hoverOpacity","alpha","primary","mainChannel","main","border","Button","inheritContainedHoverBg","boxShadow","shadows","dark","buttonClasses","focusVisible","disabled","disabledBackground","getContrastText","inheritContainedBg","contrastText","borderColor","pxToRem","width","ButtonStartIcon","display","marginRight","marginLeft","ButtonEndIcon","React","inProps","contextProps","ButtonGroupContext","buttonGroupButtonContextPositionClassName","ButtonGroupButtonContext","resolvedProps","resolveProps","useThemeProps","component","disableFocusRipple","endIconProp","focusVisibleClassName","startIconProp","other","_objectWithoutPropertiesLoose","_jsx","_jsxs","clsx","focusRipple","__webpack_exports__","generateUtilityClass","generateUtilityClasses","_t","_t2","_t3","_t4","enterKeyframe","_","exitKeyframe","pulsateKeyframe","TouchRippleRoot","overflow","pointerEvents","top","right","bottom","left","TouchRippleRipple","pulsate","rippleX","rippleY","rippleSize","in","inProp","onExited","timeout","leaving","setLeaving","rippleClassName","ripple","rippleVisible","ripplePulsate","childClassName","child","childLeaving","childPulsate","timeoutId","setTimeout","clearTimeout","style","height","touchRippleClasses","easing","easeInOut","shorter","TouchRipple","center","centerProp","ripples","setRipples","nextKey","rippleCallback","ignoringMouseDown","startTimer","useTimeout","startTimerCommit","startCommit","params","cb","oldRipples","start","event","fakeElement","rect","getBoundingClientRect","clientX","clientY","touches","round","sqrt","sizeX","max","clientWidth","sizeY","clientHeight","stop","clear","TransitionGroup","exit","getButtonBaseUtilityClass","ButtonBaseRoot","alignItems","justifyContent","boxSizing","WebkitTapHighlightColor","outline","margin","userSelect","verticalAlign","MozAppearance","WebkitAppearance","borderStyle","buttonBaseClasses","colorAdjust","ButtonBase_ButtonBase","centerRipple","disableRipple","disableTouchRipple","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","buttonRef","rippleRef","handleRippleRef","useForkRef","isFocusVisibleRef","handleFocusVisible","handleBlurVisible","focusVisibleRef","useIsFocusVisible","setFocusVisible","focus","mountedState","setMountedState","enableTouchRipple","useRippleHandler","rippleAction","eventCallback","skipRippleAction","useEventCallback","handleMouseDown","handleContextMenu","handleDragLeave","handleMouseUp","handleMouseLeave","preventDefault","handleTouchStart","handleTouchEnd","handleTouchMove","handleBlur","handleFocus","currentTarget","isNonNativeButton","tagName","href","keydownRef","handleKeyDown","target","handleKeyUp","defaultPrevented","ComponentProp","to","buttonProps","role","handleRef","as","getTouchRippleUtilityClass","GridContext","getOffset","val","parseFloat","extractZeroValueBreakpointKeys","breakpoints","values","nonZeroKey","keys","sortedBreakpointKeysByValue","sort","a","b","GridRoot","direction","item","spacing","wrap","zeroMinWidth","spacingStyles","resolveSpacingStyles","Number","isNaN","breakpoint","breakpointsStyles","flexWrap","directionValues","resolveBreakpointValues","handleBreakpoints","propValue","flexDirection","gridClasses","maxWidth","rowSpacing","zeroValueBreakpointKeys","rowSpacingValues","_zeroValueBreakpointK","themeSpacing","marginTop","paddingTop","includes","columnSpacing","columnSpacingValues","_zeroValueBreakpointK2","paddingLeft","reduce","globalStyles","flexBasis","columnsBreakpointValues","columnValue","more","up","spacingClasses","resolveSpacingClasses","breakpointsClasses","getGridUtilityClass","Grid_Grid","themeProps","useTheme","extendSxProp","columnsProp","columnSpacingProp","rowSpacingProp","columnsContext","breakpointsValues","otherFiltered","GRID_SIZES","SPACINGS","DIRECTIONS","WRAPS","square","elevation","getPaperUtilityClass","PaperRoot","rounded","_theme$vars$overlays","background","paper","divider","backgroundImage","getOverlayAlpha","overlays","Paper","paperClasses","align","gutterBottom","noWrap","paragraph","getTypographyUtilityClass","TypographyRoot","font","textAlign","textOverflow","whiteSpace","marginBottom","defaultVariantMapping","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","colorTransformations","textPrimary","secondary","textSecondary","error","transformDeprecatedColors","Typography","variantMapping","Component","typographyClasses","A200","A400","A700","black","white","createMixins","mixins","toolbar","minHeight","light","common","default","active","hover","selected","selectedOpacity","disabledOpacity","focusOpacity","activatedOpacity","icon","addLightOrDark","intent","shade","tonalOffset","tonalOffsetLight","tonalOffsetDark","hasOwnProperty","lighten","darken","createShadow","px","shadowKeyUmbraOpacity","shadowKeyPenumbraOpacity","shadowAmbientShadowOpacity","styles_zIndex","mobileStepper","fab","speedDial","appBar","drawer","modal","snackbar","tooltip","createTheme","mixinsInput","paletteInput","transitionsInput","typographyInput","_formatMuiErrorMessage","createPalette","contrastThreshold","getDefaultPrimary","blue","getDefaultSecondary","purple","getDefaultError","red","info","getDefaultInfo","lightBlue","success","getDefaultSuccess","green","warning","getDefaultWarning","orange","getContrastRatio","augmentColor","mainShade","lightShade","darkShade","JSON","deepmerge","modes","systemTheme","systemCreateTheme","muiTheme","createTypography","createTransitions","acc","argument","unstable_sxConfig","defaultSxConfig","unstable_sx","styleFunctionSx","sx","createMuiTheme","styles_createTheme","easeOut","easeIn","sharp","shortest","standard","complex","enteringScreen","leavingScreen","formatMs","milliseconds","getAutoHeightDuration","constant","inputTransitions","mergedEasing","mergedDuration","durationOption","easingOption","delay","animatedProp","caseAllCaps","textTransform","defaultFontFamily","fontFamily","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem2","coef","buildVariant","letterSpacing","casing","variants","caption","overline","clone","defaultTheme","alphaValue","log","toFixed","slotShouldForwardProp","createStyled","themeId","THEME_ID","ZP","useThemeSystem","systemUseThemeProps","GlobalStyles","themeInput","isEmpty","StyledEngineProvider","injectFirst","reactPropsRegex","isPropValid","test","testOmitPropsOnComponent","getDefaultShouldForwardProp","composeShouldForwardProps","isReal","optionsShouldForwardProp","__emotion_forwardProp","propName","Insertion","emotion_utils_browser_esm","hC","emotion_use_insertion_effect_with_fallbacks_browser_esm","L","newStyled","targetClassName","__emotion_real","baseTag","__emotion_base","defaultShouldForwardProp","shouldUseAs","Styled","emotion_element_43c6fea0_browser_esm","FinalTag","classInterpolations","react","fp","emotion_serialize_browser_esm","finalShouldForwardProp","newProps","Fragment","displayName","defaultProps","defineProperty","withComponent","nextTag","nextOptions","esm_extends","bind","emStyled","internal_processStyles","processor","_interopRequireDefault","exports","Fq","_j","_4","emphasize","mi","foreground","lumA","getLuminance","lumB","min","ve","hslToRgb","$n","zp","LR","q8","coefficient","fk","ux","_formatMuiErrorMessage2","_clamp","clampWrapper","decomposeColor","colorSpace","charAt","hexToRgb","re","colors","n","parseInt","marker","substring","shift","colorChannel","decomposedColor","idx","recomposeColor","s","l","f","rgb","input","systemDefaultTheme","systemSx","_styleFunctionSx","_extends2","resolveTheme","__mui_systemSx","inputOptions","_styledEngine","filter","componentName","componentSlot","skipVariantsResolver","inputSkipVariantsResolver","skipSx","inputSkipSx","lowercaseFirstLetter","_objectWithoutPropertiesLoose2","_excluded3","shouldForwardPropOption","defaultStyledResolver","transformStyleArg","stylesArg","_deepmerge","isPlainObject","processStyleArg","muiStyledResolver","styleArg","expressions","transformedStyleArg","expressionsWithDefaultTheme","components","styleOverrides","resolvedStyleOverrides","entries","slotKey","slotStyle","_theme$components","numOfCustomFnsApplied","placeholders","fill","muiName","withConfig","_interopRequireWildcard","r","__esModule","_getRequireWildcardCache","has","__proto__","getOwnPropertyDescriptor","u","_createTheme","_excluded2","callableStyle","resolvedStylesArg","flatMap","resolvedStyle","isMatch","xs","sm","md","lg","xl","defaultBreakpoints","styleFromPropValue","themeBreakpoints","createEmptyBreakpointObject","breakpointsInput","_breakpointsInput$key","breakpointsInOrder","removeUnusedBreakpoints","breakpointKeys","breakpointOutput","mergeBreakpointsInOrder","emptyBreakpoints","mergedOutput","_mui_utils_deepmerge__WEBPACK_IMPORTED_MODULE_0__","breakpointValues","base","customBase","computeBreakpointsBase","breakpointsKeys","applyStyles","getColorSchemeSelector","sortBreakpointsValues","breakpointsAsArray","breakpoint1","breakpoint2","_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__","createBreakpoints","unit","step","_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__","sortedValues","down","between","endIndex","only","not","keyIndex","createSpacing","spacingInput","mui","transform","_spacing__WEBPACK_IMPORTED_MODULE_0__","hB","argsInput","createTheme_shape","createTheme_createTheme","shapeInput","objectWithoutPropertiesLoose","properties","m","p","directions","aliases","marginX","marginY","paddingX","paddingY","getCssProperties","dir","marginKeys","paddingKeys","spacingKeys","createUnaryUnit","themeKey","defaultValue","_getPath","DW","createUnarySpacing","getValue","transformer","transformed","spacing_style","resolveCssProperty","cssProperties","cssProperty","k9","merge","propTypes","filterProps","getPath","path","checkVars","getStyleValue","themeMapping","propValueFinal","userValue","_breakpoints__WEBPACK_IMPORTED_MODULE_1__","_mui_utils_capitalize__WEBPACK_IMPORTED_MODULE_0__","esm_compose","handlers","borderTransform","createBorderStyle","borderTop","borderRight","borderBottom","borderLeft","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","eI","NA","gap","columnGap","rowGap","gridAutoFlow","gridAutoColumns","gridAutoRows","gridTemplateColumns","paletteTransform","sizingTransform","_props$theme","_props$theme2","VO","maxHeight","styleFunctionSx_defaultSxConfig","bgcolor","o3","pt","pr","pb","pl","py","paddingRight","paddingBottom","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd","e6","mt","mr","mb","ml","mx","my","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd","displayPrint","visibility","alignContent","alignSelf","justifyItems","justifySelf","gridTemplateRows","gridTemplateAreas","gridArea","fontStyle","splitProps","_props$theme$unstable","systemProps","otherProps","config","_defaultSxConfig__WEBPACK_IMPORTED_MODULE_0__","finalSx","inSx","_mui_utils_deepmerge__WEBPACK_IMPORTED_MODULE_2__","P","_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_3__","unstable_createStyleFunctionSx","getThemeValue","_style__WEBPACK_IMPORTED_MODULE_0__","_breakpoints__WEBPACK_IMPORTED_MODULE_2__","Jq","_mui_utils_capitalize__WEBPACK_IMPORTED_MODULE_1__","_theme$unstable_sxCon","_defaultSxConfig__WEBPACK_IMPORTED_MODULE_3__","traverse","sxInput","sxObject","W8","styleKey","maybeFn","_merge__WEBPACK_IMPORTED_MODULE_4__","objectsHaveSameKeys","objects","union","Set","object","every","L7","useThemeWithoutDefault","getThemeProps","_mui_utils_resolveProps__WEBPACK_IMPORTED_MODULE_0__","contextTheme","generate","defaultGenerator","ClassNameGenerator","configure","generator","reset","_mui_utils_formatMuiErrorMessage__WEBPACK_IMPORTED_MODULE_0__","toUpperCase","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","getUtilityClass","utilityClass","source","deepClone","getPrototypeOf","Symbol","toStringTag","iterator","formatMuiErrorMessage","code","url","encodeURIComponent","globalStateClasses","checked","completed","expanded","focused","open","readOnly","required","globalStatePrefix","globalStateClass","_ClassNameGenerator__WEBPACK_IMPORTED_MODULE_0__","_generateUtilityClass__WEBPACK_IMPORTED_MODULE_0__","fnNameMatchRegex","getFunctionName","getFunctionComponentName","fallback","getWrappedName","outerType","innerType","wrapperName","functionName","getDisplayName","$$typeof","react_is","ForwardRef","render","Memo","for","module","defaultSlotProps","slotProps","slotPropName","setRef","useEnhancedEffect","window","refs","instance","hadKeyboardEvent","hadFocusVisibleRecently","hadFocusVisibleRecentlyTimeout","Timeout","inputTypesWhitelist","tel","email","password","number","date","month","week","time","datetime","metaKey","altKey","ctrlKey","handlePointerDown","handleVisibilityChange","visibilityState","doc","ownerDocument","addEventListener","isFocusVisible","matches","focusTriggersKeyboardModality","isContentEditable","UNINITIALIZED","EMPTY","currentId","disposeEffect","useLazyRef","init","initArg","reactIs","REACT_STATICS","childContextTypes","contextType","contextTypes","getDefaultProps","getDerivedStateFromError","getDerivedStateFromProps","KNOWN_STATICS","caller","callee","arity","MEMO_STATICS","compare","TYPE_STATICS","getStatics","isMemo","getOwnPropertyNames","getOwnPropertySymbols","objectPrototype","hoistNonReactStatics","targetComponent","sourceComponent","blacklist","inheritedComponent","targetStatics","sourceStatics","descriptor","_global_process","_global_process1","g","process","env","defaultSetTimout","defaultClearTimeout","runTimeout","o","cleanUpNextTick","drainQueue","run","runClearTimeout","Item","fun","noop","nextTick","title","browser","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","umask","__nccwpck_require__","ab","__dirname","c","d","q","v","A","AsyncMode","ConcurrentMode","ContextConsumer","ContextProvider","Element","Lazy","Portal","Profiler","StrictMode","Suspense","isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isPortal","isProfiler","isStrictMode","isSuspense","isValidElementType","typeOf","getChildMapping","mapFn","Children","isValidElement","getProp","_React$Component","context","handleExited","assertThisInitialized","state","contextValue","isMounting","firstRender","inheritsLoose","componentDidMount","mounted","setState","componentWillUnmount","nextProps","nextChildMapping","prevChildMapping","cloneElement","appear","enter","mergeChildMappings","getValueForKey","nextKeysPending","pendingKeys","prevKey","childMapping","pendingNextKey","hasPrev","hasNext","prevChild","isLeaving","currentChildMapping","_this$props","childFactory","TransitionGroupContext","esm_TransitionGroup","is","useSyncExternalStore","useEffect","useMemo","useDebugValue","useSyncExternalStoreWithSelector","hasValue","excluded","_assertThisInitialized","self","_inheritsLoose","subClass","superClass","_setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__","_setPrototypeOf","setPrototypeOf","safeAssign","defaultSerializeQueryArgs","endpointName","queryArgs","stringified","$bigint","_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_1__","PO","key2","UNINITIALIZED_VALUE","useStableQueryArgs","serialize","endpointDefinition","incoming","cache2","useShallowStableValue","react_redux__WEBPACK_IMPORTED_MODULE_2__","wU","useIsomorphicLayoutEffect","noPendingQueryStateSelector","isUninitialized","isFetching","isLoading","data","status","_reduxjs_toolkit_query__WEBPACK_IMPORTED_MODULE_3__","oZ","pending","reactHooksModuleName","createApi","Tk","hF","reactHooksModule","batch","dC","hooks","useDispatch","I0","useSelector","v9","useStore","oR","createSelector","createSelector2","reselect__WEBPACK_IMPORTED_MODULE_5__","P1","unstable__sideEffectsInRender","rest","api","serializeQueryArgs","buildQueryHooks","buildMutationHook","usePrefetch","buildHooks","moduleOptions","usePossiblyImmediateEffect","useQuerySubscription","refetchOnReconnect","refetchOnFocus","refetchOnMountOrArgChange","skip","pollingInterval","skipPollingIfUnfocused","initiate","endpoints","dispatch","subscriptionSelectorsRef","returnedValue","internalActions","internal_getRTKQSubscriptions","stableArg","CN","endpointDefinitions","stableSubscriptionOptions","lastRenderHadSubscription","promiseRef","queryCacheKey","requestId","currentRenderHasSubscription","isRequestSubscribed","subscriptionRemoved","lastPromise","unsubscribe","lastSubscriptionOptions","subscriptionOptions","updateSubscriptionOptions","promise","forceRefetch","refetch","_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_4__","rJ","useLazyQuerySubscription","setArg","useState","subscriptionOptionsRef","trigger","useCallback","arg2","preferCacheValue","useQueryState","selectFromResult","select","lastValue","selectDefaultResult","lastResult","queryStatePreSelector","memoizeOptions","resultEqualityCheck","devModeChecks","identityFunctionCheck","currentState","newLastValue","store","getState","useLazyQuery","queryStateResults","lastArg","useQuery","querySubscriptionResults","isSuccess","isError","fixedCacheKey","setPromise","triggerMutation","promise2","originalArgs","removeMutationResult","finalState","defaultOptions","stableDefaultOptions","util","prefetch","hasData","currentData","injectEndpoint","definition","anyApi","useMutation","QueryStatus2","QueryStatus","withoutTrailingSlash","withoutLeadingSlash","flatten","arr","isPlainObject2","_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__","defaultFetchFn","fetch","defaultValidateStatus","response","defaultIsJsonContentType","headers","stripUndefined","copy","fetchBaseQuery","baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","defaultTimeout","responseHandler","globalResponseHandler","validateStatus","globalValidateStatus","baseFetchOptions","console","warn","meta","resultData","signal","extra","endpoint","forced","Headers","isJsonifiable","body","toJSON","URLSearchParams","request","Request","joinUrls","endsWith","startsWith","timedOut","abort","responseClone","responseText","handleResponseError","Promise","all","handleResponse","then","originalStatus","HandledError","PH","onFocusLost","onOnline","onOffline","initialized","setupListeners","customHandler","defaultHandler","handleFocusLost","handleOnline","handleOffline","removeEventListener","isQueryDefinition","calculateProvidedBy","description","queryArg","assertTagTypes","expandTagDescription","isNotNullish","countObjectKeys","forceQueryFnSymbol","isUpsertQuery","defaultTransformResponse","baseQueryReturnValue","calculateProvidedByThunk","assertTagType","KD","payload","h_","baseQueryMeta","updateQuerySubstateIfExists","update","substate","getMutationCacheKey","id","updateMutationSubstateIfExists","initialState","skipToken","initialSubState","defaultQuerySubState","immer__WEBPACK_IMPORTED_MODULE_2__","Uy","defaultMutationSubState","buildCreateApi","modules","extractRehydrationInfo","reselect__WEBPACK_IMPORTED_MODULE_3__","kO","reducerPath","optionsWithDefaults","keepUnusedDataFor","invalidationBehavior","queryArgsApi","finalSerializeQueryArgs","endpointSQA","initialResult","queryArgsApi2","tagTypes","apiUid","x0","hasRehydrationInfo","injectEndpoints","inject","query","mutation","overrideExisting","initializedModules","enhanceEndpoints","addTagTypes","eT","partialDefinition","buildCacheCollectionHandler","queryThunk","internalState","removeQueryResult","unsubscribeQueryResult","canTriggerUnsubscribe","Q","fulfilled","rejected","anySubscriptionsRemainingForKey","subscriptions","currentSubscriptions","isObjectEmpty","currentRemovalTimeouts","handleUnsubscribe","api2","Infinity","currentTimeout","finalKeepUnusedDataFor","mwApi","internalState2","queries","resetApiState","queryState","buildInvalidationByTagsHandler","mutationThunk","refetchQuery","isThunkActionWithTags","isQueryEnd","Iv","pendingTagInvalidations","invalidateTags","newTags","rootState","hasPendingRequests","mutations","toInvalidate","selectInvalidatedBy","from","querySubState","subscriptionSubState","buildPollingHandler","currentPolls","startNextPoll","lowestPollingInterval","findLowestPollingInterval","isFinite","currentPoll","nextPollTimestamp","Date","now","updatePollingInterval","cleanupPollForKey","existingPoll","subscribers","POSITIVE_INFINITY","condition","clearPolls","buildWindowEventHandler","refetchValidQueries","some","sub","neverResolvedError","buildCacheLifecycleHandler","isQueryThunk","Gx","isMutationThunk","isFulfilledThunk","lifecycleMap","handleNewKey","onCacheEntryAdded","lifecycle","cacheEntryRemoved","resolve","cacheDataLoaded","race","valueResolved","catch","__","extra2","lifecycleApi","getCacheEntry","updateCachedData","updateQueryData","updateRecipe","stateBefore","cacheKey","oldState","cacheKey2","buildQueryLifecycleHandler","isPendingThunk","zR","isRejectedThunk","isFullfilledThunk","onQueryStarted","queryFulfilled","reject","rejectedWithValue","isUnhandledError","buildDevCheckHandler","middlewareRegistered","buildBatchedActionsHandler","subscriptionsPrefix","previousSubscriptions","updateSyncTimer","actuallyMutateSubscriptions","mutableState","subscribe","mutated","getSubscriptions","subscriptionSelectors","getSubscriptionCount","didMutate","actionShouldContinue","newSubscriptions","patches","aS","subscriptionsUpdated","isSubscriptionSliceAction","isAdditionalSubscriptionAction","coreModuleName","coreModule","baseQuery","vI","patchQueryData","upsertQueryData","buildMatchThunkActions","buildThunks","executeEndpoint","rejectWithValue","fulfillWithValue","transformResponse","baseQueryApi","isForcedQuery","forceQueryFn","extraOptions","queryFn","fulfilledTimeStamp","s4","catchedError","transformErrorResponse","requestState","baseFetchOnMountOrArgChange","fulfilledVal","refetchVal","hg","getPendingMeta","startedTimeStamp","queryThunkArgs","currentArg","previousArg","endpointState","dispatchConditionRejection","hasTheForce","hasMaxAge","matchesEndpoint","force","maxAge","ifOlderThan","queryAction","force2","isPrefetch","latestStateValue","lastFulfilledTs","updateProvided","newValue","ret","inversePatches","undo","o$","op","queryResultPatched","providedTags","providesTags","updateProvidedBy","thunk","matchPending","A6","matchFulfilled","matchRejected","reducer","actions","sliceActions","buildSlice","definitions","querySlice","oM","reducers","draft","prepare","cw","QE","extraReducers","builder","addCase","upserting","newData","draftSubstateData","structuralSharing","copyWithStructuralSharing","oldObj","newObj","newKeys","oldKeys","isSameObject","mergeObj","mv","Js","addMatcher","entry","mutationSlice","track","invalidationSlice","tagTypeSubscriptions","idSubscriptions","foundAt","splice","subscribedQueries","provided","incomingTags","cacheKeys","caseReducers","subscriptionSlice","internalSubscriptionsSlice","configSlice","online","navigator","onLine","combinedReducer","UY","middleware","middlewareActions","buildMiddleware","isThisApiSliceAction","handlerBuilders","initialized2","builderArgs","build","batchedActionsHandler","windowEventsHandler","res","LG","mwApiWithNext","internalProbeResult","handler","override","buildQuerySelector","buildMutationSelector","selectCachedArgsForQuery","buildSelectors","selectSkippedQuery","selectSkippedMutation","serializedArgs","selectInternalState","withRequestFlags","mutationId","apiState","invalidate","add","queryName","buildInitiateQuery","buildInitiateMutation","getRunningMutationThunk","getRunningMutationsThunk","getRunningQueriesThunk","getRunningQueryThunk","buildInitiate","runningQueries","Map","runningMutations","thunkResult","stateAfter","skippedSynchronously","runningQuery","selectFromState","statePromise","unwrap","running","delete","_endpointName","fixedCacheKeyOrRequestId","isAsyncThunkAction","asyncThunks","hasExpectedRequestMetadata","isAsyncThunkArray","isAnyOf","asyncThunk","isFulfilled","isPending","isRejectedWithValue","hasFlag","isAllOf","isRejected","ReducerType2","createThunkMiddleware","extraArgument","redux_thunk_thunk","createDraftSafeSelectorCreator","reselect","wN","createDraftSafeSelector2","args2","wrappedSelector","immer","Vk","withTypes","composeWithDevTools","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","redux","qC","__REDUX_DEVTOOLS_EXTENSION__","hasMatchFunction","createAction","prepareAction","actionCreator","prepared","formatProdErrorMessage","Tuple","_Tuple","items","species","freezeDraftable","emplace","buildGetDefaultMiddleware","immutableCheck","serializableCheck","actionCreatorCheck","middlewareArray","withExtraArgument","SHOULD_AUTOBATCH","prepareAutoBatched","createQueueWithTimer","notify","rAF","requestAnimationFrame","autoBatchEnhancer","notifying","shouldNotifyAtEndOfTick","notificationQueued","queueCallback","queueMicrotask","queueNotification","notifyListeners","listener2","buildGetDefaultEnhancers","autoBatch","enhancerArray","middlewareEnhancer","configureStore","rootReducer","finalMiddleware","getDefaultMiddleware","devTools","preloadedState","enhancers","finalCompose","trace","getDefaultEnhancers","composedEnhancer","MT","executeReducerBuilderCallback","builderCallback","defaultCaseReducer","actionsMap","actionMatchers","typeOrActionCreator","matcher","addDefaultCase","nanoid","urlAlphabet","random","matchers","validStatus","hasValidRequestId","hasValidRequestStatus","requestStatus","commonProperties","RejectWithValue","_type","FulfillWithMeta","miniSerializeError","simpleError","message","createAsyncThunk","createAsyncThunk2","typePrefix","payloadCreator","serializeError","aborted","abortHandler","abortReason","idGenerator","abortController","AbortController","reason","finalAction","conditionResult","abortedPromise","err","unwrapResult","settled","asyncThunkSymbol","ReducerType","createSlice","buildCreateSlice","creators","cAT","_reducer","buildReducerCreators","_reducerDefinitionType","caseReducer","preparedReducer","reducerNames","contextMethods","reducer2","exposeAction","name2","exposeCaseReducer","buildReducer","finalCaseReducers","createReducer","mapOrBuilderCallback","getInitialState","finalActionMatchers","finalDefaultCaseReducer","frozenInitialState","cr","previousState","sM","reducerDefinition","reducerName","reducerDetails","createNotation","handleThunkCaseReducerDefinition","handleNormalReducerDefinition","maybeReducerWithPrepare","prepareCallback","selectSelf","injectedSelectorCache","makeSelectorProps","reducerPath2","injected","selectSlice","sliceState","getSelectors","selectState","selectorCache","selectors","wrapSelector","wrapper","unwrapped","injectInto","injectable","pathOpt","newReducerPath","assertFunction","expected","redux_toolkit_modern_assign","alm","getListenerEntryPropsFrom","predicate","effect","createListenerEntry","_tagged_template_literal","freeze","defineProperties","currentScope","NOTHING","DRAFTABLE","DRAFT_STATE","die","isDraft","isDraftable","isMap","isSet","objectCtorString","proto","Ctor","Function","original","base_","each","iter","getArchtype","Reflect","ownKeys","thing","type_","propOrOldValue","latest","copy_","shallowCopy","strict","isPlain","descriptors","getOwnPropertyDescriptors","desc","writable","configurable","enumerable","deep","isFrozen","dontMutateFrozenCollections","plugins","getPlugin","pluginKey","plugin","usePatchesInScope","scope","patchListener","patches_","inversePatches_","patchListener_","revokeScope","leaveScope","drafts_","revokeDraft","parent_","enterScope","immer2","immer_","canAutoFreeze_","unfinalizedDrafts_","revoke_","revoked_","processResult","baseDraft","modified_","finalize","maybeFreeze","generateReplacementPatches_","rootScope","childValue","finalizeProperty","scope_","finalized_","resultEach","isSet2","generatePatches_","parentState","targetObject","rootPath","targetIsSet","assigned_","autoFreeze_","propertyIsEnumerable","objectTraps","readPropFromProto","getDescriptorFromProto","draft_","prepareCopy","createProxy","current2","markChanged","deleteProperty","owner","arrayTraps","useStrictShallowCopy_","proxyMap_","proxySet_","createProxyProxy","isManual_","traps","revoke","proxy","Proxy","revocable","currentImpl","enablePatches","implementation","REPLACE","REMOVE","deepClonePatchValue","cloned","clonePatchValueIfNeeded","applyPatches_","patch","parentType","errorOffset","basePath","generatePatchesFromAssigned","assignedValue","origValue","generateArrayPatches","generateSetPatches","unshift","baseValue","produce","recipe","defaultBase","base2","hasError","ip","produceWithPatches","autoFreeze","setAutoFreeze","useStrictShallowCopy","setUseStrictShallowCopy","createDraft","finishDraft","applyPatches","applyPatchesImpl","ContextKey","gT","globalThis","ReactReduxContext","getContext","contextMap","realContext","createReduxContextHook","useReduxContext","refEquality","createSelectorHook","useReduxContext2","useSelector2","equalityFnOrOptions","equalityFn","subscription","getServerState","stabilityCheck","selectedState","addNestedSub","nullListeners","canUseDOM","isReactNative","product","shallowEqual","objA","objB","keysA","keysB","Provider_default","serverState","createSubscription","parentSub","subscriptionsAmount","selfSubscribed","handleChangeWrapper","onStateChange","trySubscribe","first","last","listener","isSubscribed","tryUnsubscribe","cleanupListener","removed","notifyNestedSubs","getListeners","Context","createStoreHook","useStore2","createDispatchHook","useDispatch2","use_sync_external_store_with_selector_js__WEBPACK_IMPORTED_MODULE_1__","$$observable","observable","randomString","ActionTypes","INIT","PROBE_UNKNOWN_ACTION","createStore","enhancer","currentReducer","currentListeners","nextListeners","listenerIdCounter","isDispatching","ensureCanMutateNextListeners","listenerId","actionTypes_default","replaceReducer","nextReducer","observer","observeState","observerAsObserver","outerSubscribe","combineReducers","shapeAssertionError","reducerKeys","finalReducers","finalReducerKeys","assertReducerShape","hasChanged","nextState","previousStateForKey","nextStateForKey","compose","funcs","applyMiddleware","middlewares","createStore2","middlewareAPI","isAction","ensureIsArray","$REVISION","Cell","revision","_value","_lastValue","_isEqual","tripleEq","initialValue","isEqual","cell","neverEq","createTag","createCell","consumeCollection","collectionTag","nextId","ObjectTreeNode","objectProxyHandler","calculateResult","childNode","ArrayTreeNode","arrayProxyHandler","Ref","WeakRef","deref","createCacheNode","weakMapMemoize","fnNode","resultsCount","memoized","cacheNode","objectCache","objectNode","primitiveCache","primitiveNode","terminatedNode","lastResultValue","needsWeakRef","clearCache","resetResultsCount","createSelectorCreator","memoizeOrOptions","memoizeOptionsFromArgs","createSelectorCreatorOptions","createSelectorArgs","recomputations","dependencyRecomputations","directlyPassedOptions","resultFunc","pop","assertIsFunction","errorMessage","argsMemoize","argsMemoizeOptions","finalMemoizeOptions","finalArgsMemoizeOptions","dependencies","getDependencies","assertIsArrayOfFunctions","itemTypes","memoizedResultFunc","inputSelectorResults","collectInputSelectorResults","inputSelectorArgs","resetDependencyRecomputations","resetRecomputations","createStructuredSelector","inputSelectorsObject","selectorCreator","assertIsObject","inputSelectorKeys","composition"],"sourceRoot":""}