{"version":3,"sources":["../../../../src/query/react/index.ts","../../../../src/query/react/module.ts","../../../../src/query/utils/capitalize.ts","../../../../src/query/endpointDefinitions.ts","../../../../src/query/tsHelpers.ts","../../../../src/query/react/buildHooks.ts","../../../../src/query/react/constants.ts","../../../../src/query/react/useSerializedStableValue.ts","../../../../src/query/react/useShallowStableValue.ts","../../../../src/query/react/ApiProvider.tsx"],"sourcesContent":["// This must remain here so that the `mangleErrors.cjs` build script\n// does not have to import this into each source file it rewrites.\nimport { formatProdErrorMessage } from '@reduxjs/toolkit';\nimport { buildCreateApi, coreModule } from '@reduxjs/toolkit/query';\nimport { reactHooksModule, reactHooksModuleName } from './module';\nexport * from '@reduxjs/toolkit/query';\nexport { ApiProvider } from './ApiProvider';\nconst createApi = /* @__PURE__ */buildCreateApi(coreModule(), reactHooksModule());\nexport type { TypedUseMutationResult, TypedUseQueryHookResult, TypedUseQueryStateResult, TypedUseQuerySubscriptionResult, TypedLazyQueryTrigger, TypedUseLazyQuery, TypedUseMutation, TypedMutationTrigger, TypedQueryStateSelector, TypedUseQueryState, TypedUseQuery, TypedUseQuerySubscription, TypedUseLazyQuerySubscription, TypedUseQueryStateOptions, TypedUseLazyQueryStateResult } from './buildHooks';\nexport { UNINITIALIZED_VALUE } from './constants';\nexport { createApi, reactHooksModule, reactHooksModuleName };","import { formatProdErrorMessage as _formatProdErrorMessage } from \"@reduxjs/toolkit\";\nimport type { Api, BaseQueryFn, EndpointDefinitions, InfiniteQueryDefinition, Module, MutationDefinition, PrefetchOptions, QueryArgFrom, QueryDefinition, QueryKeys } from '@reduxjs/toolkit/query';\nimport { batch as rrBatch, useDispatch as rrUseDispatch, useSelector as rrUseSelector, useStore as rrUseStore } from 'react-redux';\nimport { createSelector as _createSelector } from 'reselect';\nimport { isInfiniteQueryDefinition, isMutationDefinition, isQueryDefinition } from '../endpointDefinitions';\nimport { safeAssign } from '../tsHelpers';\nimport { capitalize, countObjectKeys } from '../utils';\nimport type { InfiniteQueryHooks, MutationHooks, QueryHooks } from './buildHooks';\nimport { buildHooks } from './buildHooks';\nimport type { HooksWithUniqueNames } from './namedHooks';\nexport const reactHooksModuleName = /* @__PURE__ */Symbol();\nexport type ReactHooksModule = typeof reactHooksModuleName;\ndeclare module '@reduxjs/toolkit/query' {\n export interface ApiModules<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n BaseQuery extends BaseQueryFn, Definitions extends EndpointDefinitions,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ReducerPath extends string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TagTypes extends string> {\n [reactHooksModuleName]: {\n /**\n * Endpoints based on the input endpoints provided to `createApi`, containing `select`, `hooks` and `action matchers`.\n */\n endpoints: { [K in keyof Definitions]: Definitions[K] extends QueryDefinition ? QueryHooks : Definitions[K] extends MutationDefinition ? MutationHooks : Definitions[K] extends InfiniteQueryDefinition ? InfiniteQueryHooks : never };\n /**\n * A hook that accepts a string endpoint name, and provides a callback that when called, pre-fetches the data for that endpoint.\n */\n usePrefetch>(endpointName: EndpointName, options?: PrefetchOptions): (arg: QueryArgFrom, options?: PrefetchOptions) => void;\n } & HooksWithUniqueNames;\n }\n}\ntype RR = typeof import('react-redux');\nexport interface ReactHooksModuleOptions {\n /**\n * The hooks from React Redux to be used\n */\n hooks?: {\n /**\n * The version of the `useDispatch` hook to be used\n */\n useDispatch: RR['useDispatch'];\n /**\n * The version of the `useSelector` hook to be used\n */\n useSelector: RR['useSelector'];\n /**\n * The version of the `useStore` hook to be used\n */\n useStore: RR['useStore'];\n };\n /**\n * The version of the `batchedUpdates` function to be used\n */\n batch?: RR['batch'];\n /**\n * Enables performing asynchronous tasks immediately within a render.\n *\n * @example\n *\n * ```ts\n * import {\n * buildCreateApi,\n * coreModule,\n * reactHooksModule\n * } from '@reduxjs/toolkit/query/react'\n *\n * const createApi = buildCreateApi(\n * coreModule(),\n * reactHooksModule({ unstable__sideEffectsInRender: true })\n * )\n * ```\n */\n unstable__sideEffectsInRender?: boolean;\n /**\n * A selector creator (usually from `reselect`, or matching the same signature)\n */\n createSelector?: typeof _createSelector;\n}\n\n/**\n * Creates a module that generates react hooks from endpoints, for use with `buildCreateApi`.\n *\n * @example\n * ```ts\n * const MyContext = React.createContext(null);\n * const customCreateApi = buildCreateApi(\n * coreModule(),\n * reactHooksModule({\n * hooks: {\n * useDispatch: createDispatchHook(MyContext),\n * useSelector: createSelectorHook(MyContext),\n * useStore: createStoreHook(MyContext)\n * }\n * })\n * );\n * ```\n *\n * @returns A module for use with `buildCreateApi`\n */\nexport const reactHooksModule = ({\n batch = rrBatch,\n hooks = {\n useDispatch: rrUseDispatch,\n useSelector: rrUseSelector,\n useStore: rrUseStore\n },\n createSelector = _createSelector,\n unstable__sideEffectsInRender = false,\n ...rest\n}: ReactHooksModuleOptions = {}): Module => {\n if (process.env.NODE_ENV !== 'production') {\n const hookNames = ['useDispatch', 'useSelector', 'useStore'] as const;\n let warned = false;\n for (const hookName of hookNames) {\n // warn for old hook options\n if (countObjectKeys(rest) > 0) {\n if ((rest as Partial)[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 // migrate\n // @ts-ignore\n hooks[hookName] = rest[hookName];\n }\n // then make sure we have them all\n if (typeof hooks[hookName] !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(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 as any as Api, any, any, ReactHooksModule>;\n const {\n buildQueryHooks,\n buildInfiniteQueryHooks,\n buildMutationHook,\n usePrefetch\n } = buildHooks({\n api,\n moduleOptions: {\n batch,\n hooks,\n unstable__sideEffectsInRender,\n createSelector\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 as any)[`use${capitalize(endpointName)}Query`] = useQuery;\n (api as any)[`useLazy${capitalize(endpointName)}Query`] = useLazyQuery;\n }\n if (isMutationDefinition(definition)) {\n const useMutation = buildMutationHook(endpointName);\n safeAssign(anyApi.endpoints[endpointName], {\n useMutation\n });\n (api as any)[`use${capitalize(endpointName)}Mutation`] = useMutation;\n } else if (isInfiniteQueryDefinition(definition)) {\n const {\n useInfiniteQuery,\n useInfiniteQuerySubscription,\n useInfiniteQueryState\n } = buildInfiniteQueryHooks(endpointName);\n safeAssign(anyApi.endpoints[endpointName], {\n useInfiniteQuery,\n useInfiniteQuerySubscription,\n useInfiniteQueryState\n });\n (api as any)[`use${capitalize(endpointName)}InfiniteQuery`] = useInfiniteQuery;\n }\n }\n };\n }\n };\n};","export function capitalize(str: string) {\n return str.replace(str[0], str[0].toUpperCase());\n}","import type { Api } from '@reduxjs/toolkit/query';\nimport type { BaseQueryApi, BaseQueryArg, BaseQueryError, BaseQueryExtraOptions, BaseQueryFn, BaseQueryMeta, BaseQueryResult, QueryReturnValue } from './baseQueryTypes';\nimport type { CacheCollectionQueryExtraOptions } from './core/buildMiddleware/cacheCollection';\nimport type { CacheLifecycleInfiniteQueryExtraOptions, CacheLifecycleMutationExtraOptions, CacheLifecycleQueryExtraOptions } from './core/buildMiddleware/cacheLifecycle';\nimport type { QueryLifecycleInfiniteQueryExtraOptions, QueryLifecycleMutationExtraOptions, QueryLifecycleQueryExtraOptions } from './core/buildMiddleware/queryLifecycle';\nimport type { InfiniteData, InfiniteQueryConfigOptions, QuerySubState, RootState } from './core/index';\nimport type { SerializeQueryArgs } from './defaultSerializeQueryArgs';\nimport type { NEVER } from './fakeBaseQuery';\nimport type { CastAny, HasRequiredProps, MaybePromise, NonUndefined, OmitFromUnion, UnwrapPromise } from './tsHelpers';\nimport { isNotNullish } from './utils';\nconst resultType = /* @__PURE__ */Symbol();\nconst baseQuery = /* @__PURE__ */Symbol();\ntype EndpointDefinitionWithQuery = {\n /**\n * `query` can be a function that returns either a `string` or an `object` which is passed to your `baseQuery`. If you are using [fetchBaseQuery](./fetchBaseQuery), this can return either a `string` or an `object` of properties in `FetchArgs`. If you use your own custom [`baseQuery`](../../rtk-query/usage/customizing-queries), you can customize this behavior to your liking.\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"query example\"\n *\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n * type PostsResponse = Post[]\n *\n * const api = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * tagTypes: ['Post'],\n * endpoints: (build) => ({\n * getPosts: build.query({\n * // highlight-start\n * query: () => 'posts',\n * // highlight-end\n * }),\n * addPost: build.mutation>({\n * // highlight-start\n * query: (body) => ({\n * url: `posts`,\n * method: 'POST',\n * body,\n * }),\n * // highlight-end\n * invalidatesTags: [{ type: 'Post', id: 'LIST' }],\n * }),\n * })\n * })\n * ```\n */\n query(arg: QueryArg): BaseQueryArg;\n queryFn?: never;\n /**\n * A function to manipulate the data returned by a query or mutation.\n */\n transformResponse?(baseQueryReturnValue: BaseQueryResult, meta: BaseQueryMeta, arg: QueryArg): ResultType | Promise;\n /**\n * A function to manipulate the data returned by a failed query or mutation.\n */\n transformErrorResponse?(baseQueryReturnValue: BaseQueryError, meta: BaseQueryMeta, arg: QueryArg): unknown;\n /**\n * Defaults to `true`.\n *\n * Most apps should leave this setting on. The only time it can be a performance issue\n * is if an API returns extremely large amounts of data (e.g. 10,000 rows per request) and\n * you're unable to paginate it.\n *\n * For details of how this works, please see the below. When it is set to `false`,\n * every request will cause subscribed components to rerender, even when the data has not changed.\n *\n * @see https://redux-toolkit.js.org/api/other-exports#copywithstructuralsharing\n */\n structuralSharing?: boolean;\n};\ntype EndpointDefinitionWithQueryFn = {\n /**\n * Can be used in place of `query` as an inline function that bypasses `baseQuery` completely for the endpoint.\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Basic queryFn example\"\n *\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n * type PostsResponse = Post[]\n *\n * const api = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * endpoints: (build) => ({\n * getPosts: build.query({\n * query: () => 'posts',\n * }),\n * flipCoin: build.query<'heads' | 'tails', void>({\n * // highlight-start\n * queryFn(arg, queryApi, extraOptions, baseQuery) {\n * const randomVal = Math.random()\n * if (randomVal < 0.45) {\n * return { data: 'heads' }\n * }\n * if (randomVal < 0.9) {\n * return { data: 'tails' }\n * }\n * return { error: { status: 500, statusText: 'Internal Server Error', data: \"Coin landed on its edge!\" } }\n * }\n * // highlight-end\n * })\n * })\n * })\n * ```\n */\n queryFn(arg: QueryArg, api: BaseQueryApi, extraOptions: BaseQueryExtraOptions, baseQuery: (arg: Parameters[0]) => ReturnType): MaybePromise, BaseQueryMeta>>;\n query?: never;\n transformResponse?: never;\n transformErrorResponse?: never;\n /**\n * Defaults to `true`.\n *\n * Most apps should leave this setting on. The only time it can be a performance issue\n * is if an API returns extremely large amounts of data (e.g. 10,000 rows per request) and\n * you're unable to paginate it.\n *\n * For details of how this works, please see the below. When it is set to `false`,\n * every request will cause subscribed components to rerender, even when the data has not changed.\n *\n * @see https://redux-toolkit.js.org/api/other-exports#copywithstructuralsharing\n */\n structuralSharing?: boolean;\n};\ntype BaseEndpointTypes = {\n QueryArg: QueryArg;\n BaseQuery: BaseQuery;\n ResultType: ResultType;\n};\nexport type BaseEndpointDefinition = (([CastAny, {}>] extends [NEVER] ? never : EndpointDefinitionWithQuery) | EndpointDefinitionWithQueryFn) & {\n /* phantom type */\n [resultType]?: ResultType;\n /* phantom type */\n [baseQuery]?: BaseQuery;\n} & HasRequiredProps, {\n extraOptions: BaseQueryExtraOptions;\n}, {\n extraOptions?: BaseQueryExtraOptions;\n}>;\nexport enum DefinitionType {\n query = 'query',\n mutation = 'mutation',\n infinitequery = 'infinitequery',\n}\nexport type GetResultDescriptionFn = (result: ResultType | undefined, error: ErrorType | undefined, arg: QueryArg, meta: MetaType) => ReadonlyArray | undefined | null>;\nexport type FullTagDescription = {\n type: TagType;\n id?: number | string;\n};\nexport type TagDescription = TagType | FullTagDescription;\n\n/**\n * @public\n */\nexport type ResultDescription = ReadonlyArray | undefined | null> | GetResultDescriptionFn;\ntype QueryTypes = BaseEndpointTypes & {\n /**\n * The endpoint definition type. To be used with some internal generic types.\n * @example\n * ```ts\n * const useMyWrappedHook: UseQuery = ...\n * ```\n */\n QueryDefinition: QueryDefinition;\n TagTypes: TagTypes;\n ReducerPath: ReducerPath;\n};\n\n/**\n * @public\n */\nexport interface QueryExtraOptions extends CacheLifecycleQueryExtraOptions, QueryLifecycleQueryExtraOptions, CacheCollectionQueryExtraOptions {\n type: DefinitionType.query;\n\n /**\n * Used by `query` endpoints. Determines which 'tag' is attached to the cached data returned by the query.\n * Expects an array of tag type strings, an array of objects of tag types with ids, or a function that returns such an array.\n * 1. `['Post']` - equivalent to `2`\n * 2. `[{ type: 'Post' }]` - equivalent to `1`\n * 3. `[{ type: 'Post', id: 1 }]`\n * 4. `(result, error, arg) => ['Post']` - equivalent to `5`\n * 5. `(result, error, arg) => [{ type: 'Post' }]` - equivalent to `4`\n * 6. `(result, error, arg) => [{ type: 'Post', id: 1 }]`\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"providesTags example\"\n *\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n * type PostsResponse = Post[]\n *\n * const api = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * tagTypes: ['Posts'],\n * endpoints: (build) => ({\n * getPosts: build.query({\n * query: () => 'posts',\n * // highlight-start\n * providesTags: (result) =>\n * result\n * ? [\n * ...result.map(({ id }) => ({ type: 'Posts' as const, id })),\n * { type: 'Posts', id: 'LIST' },\n * ]\n * : [{ type: 'Posts', id: 'LIST' }],\n * // highlight-end\n * })\n * })\n * })\n * ```\n */\n providesTags?: ResultDescription, BaseQueryMeta>;\n /**\n * Not to be used. A query should not invalidate tags in the cache.\n */\n invalidatesTags?: never;\n\n /**\n * Can be provided to return a custom cache key value based on the query arguments.\n *\n * This is primarily intended for cases where a non-serializable value is passed as part of the query arg object and should be excluded from the cache key. It may also be used for cases where an endpoint should only have a single cache entry, such as an infinite loading / pagination implementation.\n *\n * Unlike the `createApi` version which can _only_ return a string, this per-endpoint option can also return an an object, number, or boolean. If it returns a string, that value will be used as the cache key directly. If it returns an object / number / boolean, that value will be passed to the built-in `defaultSerializeQueryArgs`. This simplifies the use case of stripping out args you don't want included in the cache key.\n *\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"serializeQueryArgs : exclude value\"\n *\n * import { createApi, fetchBaseQuery, defaultSerializeQueryArgs } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n *\n * interface MyApiClient {\n * fetchPost: (id: string) => Promise\n * }\n *\n * createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * endpoints: (build) => ({\n * // Example: an endpoint with an API client passed in as an argument,\n * // but only the item ID should be used as the cache key\n * getPost: build.query({\n * queryFn: async ({ id, client }) => {\n * const post = await client.fetchPost(id)\n * return { data: post }\n * },\n * // highlight-start\n * serializeQueryArgs: ({ queryArgs, endpointDefinition, endpointName }) => {\n * const { id } = queryArgs\n * // This can return a string, an object, a number, or a boolean.\n * // If it returns an object, number or boolean, that value\n * // will be serialized automatically via `defaultSerializeQueryArgs`\n * return { id } // omit `client` from the cache key\n *\n * // Alternately, you can use `defaultSerializeQueryArgs` yourself:\n * // return defaultSerializeQueryArgs({\n * // endpointName,\n * // queryArgs: { id },\n * // endpointDefinition\n * // })\n * // Or create and return a string yourself:\n * // return `getPost(${id})`\n * },\n * // highlight-end\n * }),\n * }),\n *})\n * ```\n */\n serializeQueryArgs?: SerializeQueryArgs>;\n\n /**\n * Can be provided to merge an incoming response value into the current cache data.\n * If supplied, no automatic structural sharing will be applied - it's up to\n * you to update the cache appropriately.\n *\n * Since RTKQ normally replaces cache entries with the new response, you will usually\n * need to use this with the `serializeQueryArgs` or `forceRefetch` options to keep\n * an existing cache entry so that it can be updated.\n *\n * Since this is wrapped with Immer, you may either mutate the `currentCacheValue` directly,\n * or return a new value, but _not_ both at once.\n *\n * Will only be called if the existing `currentCacheData` is _not_ `undefined` - on first response,\n * the cache entry will just save the response data directly.\n *\n * Useful if you don't want a new request to completely override the current cache value,\n * maybe because you have manually updated it from another source and don't want those\n * updates to get lost.\n *\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"merge: pagination\"\n *\n * import { createApi, fetchBaseQuery, defaultSerializeQueryArgs } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n *\n * createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * endpoints: (build) => ({\n * listItems: build.query({\n * query: (pageNumber) => `/listItems?page=${pageNumber}`,\n * // Only have one cache entry because the arg always maps to one string\n * serializeQueryArgs: ({ endpointName }) => {\n * return endpointName\n * },\n * // Always merge incoming data to the cache entry\n * merge: (currentCache, newItems) => {\n * currentCache.push(...newItems)\n * },\n * // Refetch when the page arg changes\n * forceRefetch({ currentArg, previousArg }) {\n * return currentArg !== previousArg\n * },\n * }),\n * }),\n *})\n * ```\n */\n merge?(currentCacheData: ResultType, responseData: ResultType, otherArgs: {\n arg: QueryArg;\n baseQueryMeta: BaseQueryMeta;\n requestId: string;\n fulfilledTimeStamp: number;\n }): ResultType | void;\n\n /**\n * Check to see if the endpoint should force a refetch in cases where it normally wouldn't.\n * This is primarily useful for \"infinite scroll\" / pagination use cases where\n * RTKQ is keeping a single cache entry that is added to over time, in combination\n * with `serializeQueryArgs` returning a fixed cache key and a `merge` callback\n * set to add incoming data to the cache entry each time.\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"forceRefresh: pagination\"\n *\n * import { createApi, fetchBaseQuery, defaultSerializeQueryArgs } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n *\n * createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * endpoints: (build) => ({\n * listItems: build.query({\n * query: (pageNumber) => `/listItems?page=${pageNumber}`,\n * // Only have one cache entry because the arg always maps to one string\n * serializeQueryArgs: ({ endpointName }) => {\n * return endpointName\n * },\n * // Always merge incoming data to the cache entry\n * merge: (currentCache, newItems) => {\n * currentCache.push(...newItems)\n * },\n * // Refetch when the page arg changes\n * forceRefetch({ currentArg, previousArg }) {\n * return currentArg !== previousArg\n * },\n * }),\n * }),\n *})\n * ```\n */\n forceRefetch?(params: {\n currentArg: QueryArg | undefined;\n previousArg: QueryArg | undefined;\n state: RootState;\n endpointState?: QuerySubState;\n }): boolean;\n\n /**\n * All of these are `undefined` at runtime, purely to be used in TypeScript declarations!\n */\n Types?: QueryTypes;\n}\nexport type QueryDefinition = BaseEndpointDefinition & QueryExtraOptions;\nexport interface InfiniteQueryTypes extends BaseEndpointTypes {\n /**\n * The endpoint definition type. To be used with some internal generic types.\n * @example\n * ```ts\n * const useMyWrappedHook: UseQuery = ...\n * ```\n */\n InfiniteQueryDefinition: InfiniteQueryDefinition;\n TagTypes: TagTypes;\n ReducerPath: ReducerPath;\n}\nexport interface InfiniteQueryExtraOptions extends CacheLifecycleInfiniteQueryExtraOptions, QueryArg, BaseQuery, ReducerPath>, QueryLifecycleInfiniteQueryExtraOptions, QueryArg, BaseQuery, ReducerPath>, CacheCollectionQueryExtraOptions {\n type: DefinitionType.infinitequery;\n providesTags?: ResultDescription, BaseQueryMeta>;\n /**\n * Not to be used. A query should not invalidate tags in the cache.\n */\n invalidatesTags?: never;\n\n /**\n * Required options to configure the infinite query behavior.\n * `initialPageParam` and `getNextPageParam` are required, to\n * ensure the infinite query can properly fetch the next page of data.\n * `initialPageParam` may be specified when using the\n * endpoint, to override the default value.\n * `maxPages` and `getPreviousPageParam` are both optional.\n * \n * @example\n * \n * ```ts\n * // codeblock-meta title=\"infiniteQueryOptions example\"\n * import { createApi, fetchBaseQuery, defaultSerializeQueryArgs } from '@reduxjs/toolkit/query/react'\n * \n * type Pokemon = {\n * id: string\n * name: string\n * }\n * \n * const pokemonApi = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: 'https://pokeapi.co/api/v2/' }),\n * endpoints: (build) => ({\n * getInfinitePokemonWithMax: build.infiniteQuery({\n * infiniteQueryOptions: {\n * initialPageParam: 0,\n * maxPages: 3,\n * getNextPageParam: (lastPage, allPages, lastPageParam, allPageParams) =>\n * lastPageParam + 1,\n * getPreviousPageParam: (\n * firstPage,\n * allPages,\n * firstPageParam,\n * allPageParams,\n * ) => {\n * return firstPageParam > 0 ? firstPageParam - 1 : undefined\n * },\n * },\n * query({pageParam}) {\n * return `https://example.com/listItems?page=${pageParam}`\n * },\n * }),\n * }),\n * })\n \n * ```\n */\n infiniteQueryOptions: InfiniteQueryConfigOptions;\n\n /**\n * Can be provided to return a custom cache key value based on the query arguments.\n *\n * This is primarily intended for cases where a non-serializable value is passed as part of the query arg object and should be excluded from the cache key. It may also be used for cases where an endpoint should only have a single cache entry, such as an infinite loading / pagination implementation.\n *\n * Unlike the `createApi` version which can _only_ return a string, this per-endpoint option can also return an an object, number, or boolean. If it returns a string, that value will be used as the cache key directly. If it returns an object / number / boolean, that value will be passed to the built-in `defaultSerializeQueryArgs`. This simplifies the use case of stripping out args you don't want included in the cache key.\n *\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"serializeQueryArgs : exclude value\"\n *\n * import { createApi, fetchBaseQuery, defaultSerializeQueryArgs } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n *\n * interface MyApiClient {\n * fetchPost: (id: string) => Promise\n * }\n *\n * createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * endpoints: (build) => ({\n * // Example: an endpoint with an API client passed in as an argument,\n * // but only the item ID should be used as the cache key\n * getPost: build.query({\n * queryFn: async ({ id, client }) => {\n * const post = await client.fetchPost(id)\n * return { data: post }\n * },\n * // highlight-start\n * serializeQueryArgs: ({ queryArgs, endpointDefinition, endpointName }) => {\n * const { id } = queryArgs\n * // This can return a string, an object, a number, or a boolean.\n * // If it returns an object, number or boolean, that value\n * // will be serialized automatically via `defaultSerializeQueryArgs`\n * return { id } // omit `client` from the cache key\n *\n * // Alternately, you can use `defaultSerializeQueryArgs` yourself:\n * // return defaultSerializeQueryArgs({\n * // endpointName,\n * // queryArgs: { id },\n * // endpointDefinition\n * // })\n * // Or create and return a string yourself:\n * // return `getPost(${id})`\n * },\n * // highlight-end\n * }),\n * }),\n *})\n * ```\n */\n serializeQueryArgs?: SerializeQueryArgs>;\n\n /**\n * All of these are `undefined` at runtime, purely to be used in TypeScript declarations!\n */\n Types?: InfiniteQueryTypes;\n}\nexport type InfiniteQueryDefinition =\n// Infinite query endpoints receive `{queryArg, pageParam}`\nBaseEndpointDefinition, BaseQuery, ResultType> & InfiniteQueryExtraOptions;\ntype MutationTypes = BaseEndpointTypes & {\n /**\n * The endpoint definition type. To be used with some internal generic types.\n * @example\n * ```ts\n * const useMyWrappedHook: UseMutation = ...\n * ```\n */\n MutationDefinition: MutationDefinition;\n TagTypes: TagTypes;\n ReducerPath: ReducerPath;\n};\n\n/**\n * @public\n */\nexport interface MutationExtraOptions extends CacheLifecycleMutationExtraOptions, QueryLifecycleMutationExtraOptions {\n type: DefinitionType.mutation;\n\n /**\n * Used by `mutation` endpoints. Determines which cached data should be either re-fetched or removed from the cache.\n * Expects the same shapes as `providesTags`.\n *\n * @example\n *\n * ```ts\n * // codeblock-meta title=\"invalidatesTags example\"\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n * interface Post {\n * id: number\n * name: string\n * }\n * type PostsResponse = Post[]\n *\n * const api = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * tagTypes: ['Posts'],\n * endpoints: (build) => ({\n * getPosts: build.query({\n * query: () => 'posts',\n * providesTags: (result) =>\n * result\n * ? [\n * ...result.map(({ id }) => ({ type: 'Posts' as const, id })),\n * { type: 'Posts', id: 'LIST' },\n * ]\n * : [{ type: 'Posts', id: 'LIST' }],\n * }),\n * addPost: build.mutation>({\n * query(body) {\n * return {\n * url: `posts`,\n * method: 'POST',\n * body,\n * }\n * },\n * // highlight-start\n * invalidatesTags: [{ type: 'Posts', id: 'LIST' }],\n * // highlight-end\n * }),\n * })\n * })\n * ```\n */\n invalidatesTags?: ResultDescription, BaseQueryMeta>;\n /**\n * Not to be used. A mutation should not provide tags to the cache.\n */\n providesTags?: never;\n\n /**\n * All of these are `undefined` at runtime, purely to be used in TypeScript declarations!\n */\n Types?: MutationTypes;\n}\nexport type MutationDefinition = BaseEndpointDefinition & MutationExtraOptions;\nexport type EndpointDefinition = QueryDefinition | MutationDefinition | InfiniteQueryDefinition;\nexport type EndpointDefinitions = Record>;\nexport function isQueryDefinition(e: EndpointDefinition): e is QueryDefinition {\n return e.type === DefinitionType.query;\n}\nexport function isMutationDefinition(e: EndpointDefinition): e is MutationDefinition {\n return e.type === DefinitionType.mutation;\n}\nexport function isInfiniteQueryDefinition(e: EndpointDefinition): e is InfiniteQueryDefinition {\n return e.type === DefinitionType.infinitequery;\n}\nexport type EndpointBuilder = {\n /**\n * An endpoint definition that retrieves data, and may provide tags to the cache.\n *\n * @example\n * ```js\n * // codeblock-meta title=\"Example of all query endpoint options\"\n * const api = createApi({\n * baseQuery,\n * endpoints: (build) => ({\n * getPost: build.query({\n * query: (id) => ({ url: `post/${id}` }),\n * // Pick out data and prevent nested properties in a hook or selector\n * transformResponse: (response) => response.data,\n * // Pick out error and prevent nested properties in a hook or selector\n * transformErrorResponse: (response) => response.error,\n * // `result` is the server response\n * providesTags: (result, error, id) => [{ type: 'Post', id }],\n * // trigger side effects or optimistic updates\n * onQueryStarted(id, { dispatch, getState, extra, requestId, queryFulfilled, getCacheEntry, updateCachedData }) {},\n * // handle subscriptions etc\n * onCacheEntryAdded(id, { dispatch, getState, extra, requestId, cacheEntryRemoved, cacheDataLoaded, getCacheEntry, updateCachedData }) {},\n * }),\n * }),\n *});\n *```\n */\n query(definition: OmitFromUnion, 'type'>): QueryDefinition;\n /**\n * An endpoint definition that alters data on the server or will possibly invalidate the cache.\n *\n * @example\n * ```js\n * // codeblock-meta title=\"Example of all mutation endpoint options\"\n * const api = createApi({\n * baseQuery,\n * endpoints: (build) => ({\n * updatePost: build.mutation({\n * query: ({ id, ...patch }) => ({ url: `post/${id}`, method: 'PATCH', body: patch }),\n * // Pick out data and prevent nested properties in a hook or selector\n * transformResponse: (response) => response.data,\n * // Pick out error and prevent nested properties in a hook or selector\n * transformErrorResponse: (response) => response.error,\n * // `result` is the server response\n * invalidatesTags: (result, error, id) => [{ type: 'Post', id }],\n * // trigger side effects or optimistic updates\n * onQueryStarted(id, { dispatch, getState, extra, requestId, queryFulfilled, getCacheEntry }) {},\n * // handle subscriptions etc\n * onCacheEntryAdded(id, { dispatch, getState, extra, requestId, cacheEntryRemoved, cacheDataLoaded, getCacheEntry }) {},\n * }),\n * }),\n * });\n * ```\n */\n mutation(definition: OmitFromUnion, 'type'>): MutationDefinition;\n infiniteQuery(definition: OmitFromUnion, 'type'>): InfiniteQueryDefinition;\n};\nexport type AssertTagTypes = >(t: T) => T;\nexport function calculateProvidedBy(description: ResultDescription | undefined, result: ResultType | undefined, error: ErrorType | undefined, queryArg: QueryArg, meta: MetaType | undefined, assertTagTypes: AssertTagTypes): readonly FullTagDescription[] {\n if (isFunction(description)) {\n return description(result as ResultType, error as undefined, queryArg, meta as MetaType).filter(isNotNullish).map(expandTagDescription).map(assertTagTypes);\n }\n if (Array.isArray(description)) {\n return description.map(expandTagDescription).map(assertTagTypes);\n }\n return [];\n}\nfunction isFunction(t: T): t is Extract {\n return typeof t === 'function';\n}\nexport function expandTagDescription(description: TagDescription): FullTagDescription {\n return typeof description === 'string' ? {\n type: description\n } : description;\n}\nexport type QueryArgFrom> = D extends BaseEndpointDefinition ? QA : never;\n\n// Just extracting `QueryArg` from `BaseEndpointDefinition`\n// doesn't sufficiently match here.\n// We need to explicitly match against `InfiniteQueryDefinition`\nexport type InfiniteQueryArgFrom> = D extends InfiniteQueryDefinition ? QA : never;\nexport type ResultTypeFrom> = D extends BaseEndpointDefinition ? RT : unknown;\nexport type ReducerPathFrom> = D extends EndpointDefinition ? RP : unknown;\nexport type TagTypesFrom> = D extends EndpointDefinition ? RP : unknown;\nexport type PageParamFrom> = D extends InfiniteQueryDefinition ? PP : unknown;\nexport type InfiniteQueryCombinedArg = {\n queryArg: QueryArg;\n pageParam: PageParam;\n};\nexport type TagTypesFromApi = T extends Api ? TagTypes : never;\nexport type DefinitionsFromApi = T extends Api ? Definitions : never;\nexport type TransformedResponse = K extends keyof NewDefinitions ? NewDefinitions[K]['transformResponse'] extends undefined ? ResultType : UnwrapPromise>> : ResultType;\nexport type OverrideResultType = Definition extends QueryDefinition ? QueryDefinition : Definition extends MutationDefinition ? MutationDefinition : Definition extends InfiniteQueryDefinition ? InfiniteQueryDefinition : never;\nexport type UpdateDefinitions = { [K in keyof Definitions]: Definitions[K] extends QueryDefinition ? QueryDefinition, ReducerPath> : Definitions[K] extends MutationDefinition ? MutationDefinition, ReducerPath> : Definitions[K] extends InfiniteQueryDefinition ? InfiniteQueryDefinition, ReducerPath> : never };","export type Id = { [K in keyof T]: T[K] } & {};\nexport type WithRequiredProp = Omit & Required>;\nexport type Override = T2 extends any ? Omit & T2 : never;\nexport function assertCast(v: any): asserts v is T {}\nexport function safeAssign(target: T, ...args: Array>>): T {\n return Object.assign(target, ...args);\n}\n\n/**\n * Convert a Union type `(A|B)` to an intersection type `(A&B)`\n */\nexport type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;\nexport type NonOptionalKeys = { [K in keyof T]-?: undefined extends T[K] ? never : K }[keyof T];\nexport type HasRequiredProps = NonOptionalKeys extends never ? False : True;\nexport type OptionalIfAllPropsOptional = HasRequiredProps;\nexport type NoInfer = [T][T extends any ? 0 : never];\nexport type NonUndefined = T extends undefined ? never : T;\nexport type UnwrapPromise = T extends PromiseLike ? V : T;\nexport type MaybePromise = T | PromiseLike;\nexport type OmitFromUnion = T extends any ? Omit : never;\nexport type IsAny = true | false extends (T extends never ? true : false) ? True : False;\nexport type CastAny = IsAny;","import { formatProdErrorMessage as _formatProdErrorMessage, formatProdErrorMessage as _formatProdErrorMessage2 } from \"@reduxjs/toolkit\";\nimport type { Selector, ThunkAction, ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';\nimport type { Api, ApiContext, ApiEndpointInfiniteQuery, ApiEndpointMutation, ApiEndpointQuery, BaseQueryFn, CoreModule, EndpointDefinitions, InfiniteQueryActionCreatorResult, InfiniteQueryArgFrom, InfiniteQueryDefinition, InfiniteQueryResultSelectorResult, InfiniteQuerySubState, MutationActionCreatorResult, MutationDefinition, MutationResultSelectorResult, PageParamFrom, PrefetchOptions, QueryActionCreatorResult, QueryArgFrom, QueryCacheKey, QueryDefinition, QueryKeys, QueryResultSelectorResult, QuerySubState, ResultTypeFrom, RootState, SerializeQueryArgs, SkipToken, SubscriptionOptions, TSHelpersId, TSHelpersNoInfer, TSHelpersOverride } from '@reduxjs/toolkit/query';\nimport { defaultSerializeQueryArgs, QueryStatus, skipToken } from '@reduxjs/toolkit/query';\nimport type { DependencyList } from 'react';\nimport { useCallback, useDebugValue, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { shallowEqual } from 'react-redux';\nimport type { SubscriptionSelectors } from '../core/buildMiddleware/index';\nimport type { InfiniteData, InfiniteQueryConfigOptions } from '../core/index';\nimport type { UninitializedValue } from './constants';\nimport { UNINITIALIZED_VALUE } from './constants';\nimport type { ReactHooksModuleOptions } from './module';\nimport { useStableQueryArgs } from './useSerializedStableValue';\nimport { useShallowStableValue } from './useShallowStableValue';\nimport type { InfiniteQueryDirection } from '../core/apiState';\nimport { isInfiniteQueryDefinition } from '../endpointDefinitions';\nimport type { StartInfiniteQueryActionCreator } from '../core/buildInitiate';\n\n// Copy-pasted from React-Redux\nconst canUseDOM = () => !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\nconst isDOM = /* @__PURE__ */canUseDOM();\n\n// Under React Native, we know that we always want to use useLayoutEffect\n\nconst isRunningInReactNative = () => typeof navigator !== 'undefined' && navigator.product === 'ReactNative';\nconst isReactNative = /* @__PURE__ */isRunningInReactNative();\nconst getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? useLayoutEffect : useEffect;\nexport const useIsomorphicLayoutEffect = /* @__PURE__ */getUseIsomorphicLayoutEffect();\nexport type QueryHooks> = {\n useQuery: UseQuery;\n useLazyQuery: UseLazyQuery;\n useQuerySubscription: UseQuerySubscription;\n useLazyQuerySubscription: UseLazyQuerySubscription;\n useQueryState: UseQueryState;\n};\nexport type InfiniteQueryHooks> = {\n useInfiniteQuery: UseInfiniteQuery;\n useInfiniteQuerySubscription: UseInfiniteQuerySubscription;\n useInfiniteQueryState: UseInfiniteQueryState;\n};\nexport type MutationHooks> = {\n useMutation: UseMutation;\n};\n\n/**\n * A React hook that automatically triggers fetches of data from an endpoint, 'subscribes' the component to the cached data, and reads the request status and cached data from the Redux store. The component will re-render as the loading status changes and the data becomes available.\n *\n * The query arg is used as a cache key. Changing the query arg will tell the hook to re-fetch the data if it does not exist in the cache already, and the hook will return the data for that query arg once it's available.\n *\n * This hook combines the functionality of both [`useQueryState`](#usequerystate) and [`useQuerySubscription`](#usequerysubscription) together, and is intended to be used in the majority of situations.\n *\n * #### Features\n *\n * - Automatically triggers requests to retrieve data based on the hook argument and whether cached data exists by default\n * - 'Subscribes' the component to keep cached data in the store, and 'unsubscribes' when the component unmounts\n * - Accepts polling/re-fetching options to trigger automatic re-fetches when the corresponding criteria is met\n * - Returns the latest request status and cached data from the Redux store\n * - Re-renders as the request status changes and data becomes available\n */\nexport type UseQuery> = = UseQueryStateDefaultResult>(arg: QueryArgFrom | SkipToken, options?: UseQuerySubscriptionOptions & UseQueryStateOptions) => UseQueryHookResult;\nexport type TypedUseQuery = UseQuery>;\nexport type UseQueryHookResult, R = UseQueryStateDefaultResult> = UseQueryStateResult & UseQuerySubscriptionResult;\n\n/**\n * Helper type to manually type the result\n * of the `useQuery` hook in userland code.\n */\nexport type TypedUseQueryHookResult>> = TypedUseQueryStateResult & TypedUseQuerySubscriptionResult;\ntype UseQuerySubscriptionOptions = SubscriptionOptions & {\n /**\n * Prevents a query from automatically running.\n *\n * @remarks\n * When `skip` is true (or `skipToken` is passed in as `arg`):\n *\n * - **If the query has cached data:**\n * * The cached data **will not be used** on the initial load, and will ignore updates from any identical query until the `skip` condition is removed\n * * The query will have a status of `uninitialized`\n * * If `skip: false` is set after the initial load, the cached result will be used\n * - **If the query does not have cached data:**\n * * The query will have a status of `uninitialized`\n * * The query will not exist in the state when viewed with the dev tools\n * * The query will not automatically fetch on mount\n * * The query will not automatically run when additional components with the same query are added that do run\n *\n * @example\n * ```tsx\n * // codeblock-meta no-transpile title=\"Skip example\"\n * const Pokemon = ({ name, skip }: { name: string; skip: boolean }) => {\n * const { data, error, status } = useGetPokemonByNameQuery(name, {\n * skip,\n * });\n *\n * return (\n *
\n * {name} - {status}\n *
\n * );\n * };\n * ```\n */\n skip?: boolean;\n /**\n * Defaults to `false`. This setting allows you to control whether if a cached result is already available, RTK Query will only serve a cached result, or if it should `refetch` when set to `true` or if an adequate amount of time has passed since the last successful query result.\n * - `false` - Will not cause a query to be performed _unless_ it does not exist yet.\n * - `true` - Will always refetch when a new subscriber to a query is added. Behaves the same as calling the `refetch` callback or passing `forceRefetch: true` in the action creator.\n * - `number` - **Value is in seconds**. If a number is provided and there is an existing query in the cache, it will compare the current time vs the last fulfilled timestamp, and only refetch if enough time has elapsed.\n *\n * If you specify this option alongside `skip: true`, this **will not be evaluated** until `skip` is false.\n */\n refetchOnMountOrArgChange?: boolean | number;\n};\n\n/**\n * A React hook that automatically triggers fetches of data from an endpoint, and 'subscribes' the component to the cached data.\n *\n * The query arg is used as a cache key. Changing the query arg will tell the hook to re-fetch the data if it does not exist in the cache already.\n *\n * Note that this hook does not return a request status or cached data. For that use-case, see [`useQuery`](#usequery) or [`useQueryState`](#usequerystate).\n *\n * #### Features\n *\n * - Automatically triggers requests to retrieve data based on the hook argument and whether cached data exists by default\n * - 'Subscribes' the component to keep cached data in the store, and 'unsubscribes' when the component unmounts\n * - Accepts polling/re-fetching options to trigger automatic re-fetches when the corresponding criteria is met\n */\nexport type UseQuerySubscription> = (arg: QueryArgFrom | SkipToken, options?: UseQuerySubscriptionOptions) => UseQuerySubscriptionResult;\nexport type TypedUseQuerySubscription = UseQuerySubscription>;\nexport type UseQuerySubscriptionResult> = Pick, 'refetch'>;\n\n/**\n * Helper type to manually type the result\n * of the `useQuerySubscription` hook in userland code.\n */\nexport type TypedUseQuerySubscriptionResult = UseQuerySubscriptionResult>;\nexport type UseLazyQueryLastPromiseInfo> = {\n lastArg: QueryArgFrom;\n};\n\n/**\n * A React hook similar to [`useQuery`](#usequery), but with manual control over when the data fetching occurs.\n *\n * This hook includes the functionality of [`useLazyQuerySubscription`](#uselazyquerysubscription).\n *\n * #### Features\n *\n * - Manual control over firing a request to retrieve data\n * - 'Subscribes' the component to keep cached data in the store, and 'unsubscribes' when the component unmounts\n * - Returns the latest request status and cached data from the Redux store\n * - Re-renders as the request status changes and data becomes available\n * - Accepts polling/re-fetching options to trigger automatic re-fetches when the corresponding criteria is met and the fetch has been manually called at least once\n *\n * #### Note\n *\n * When the trigger function returned from a LazyQuery is called, it always initiates a new request to the server even if there is cached data. Set `preferCacheValue`(the second argument to the function) as `true` if you want it to immediately return a cached value if one exists.\n */\nexport type UseLazyQuery> = = UseQueryStateDefaultResult>(options?: SubscriptionOptions & Omit, 'skip'>) => [LazyQueryTrigger, UseLazyQueryStateResult, UseLazyQueryLastPromiseInfo];\nexport type TypedUseLazyQuery = UseLazyQuery>;\nexport type UseLazyQueryStateResult, R = UseQueryStateDefaultResult> = UseQueryStateResult & {\n /**\n * Resets the hook state to its initial `uninitialized` state.\n * This will also remove the last result from the cache.\n */\n reset: () => void;\n};\n\n/**\n * Helper type to manually type the result\n * of the `useLazyQuery` hook in userland code.\n */\nexport type TypedUseLazyQueryStateResult>> = UseLazyQueryStateResult, R>;\nexport type LazyQueryTrigger> = {\n /**\n * Triggers a lazy query.\n *\n * By default, this will start a new request even if there is already a value in the cache.\n * If you want to use the cache value and only start a request if there is no cache value, set the second argument to `true`.\n *\n * @remarks\n * If you need to access the error or success payload immediately after a lazy query, you can chain .unwrap().\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Using .unwrap with async await\"\n * try {\n * const payload = await getUserById(1).unwrap();\n * console.log('fulfilled', payload)\n * } catch (error) {\n * console.error('rejected', error);\n * }\n * ```\n */\n (arg: QueryArgFrom, preferCacheValue?: boolean): QueryActionCreatorResult;\n};\nexport type TypedLazyQueryTrigger = LazyQueryTrigger>;\n\n/**\n * A React hook similar to [`useQuerySubscription`](#usequerysubscription), but with manual control over when the data fetching occurs.\n *\n * Note that this hook does not return a request status or cached data. For that use-case, see [`useLazyQuery`](#uselazyquery).\n *\n * #### Features\n *\n * - Manual control over firing a request to retrieve data\n * - 'Subscribes' the component to keep cached data in the store, and 'unsubscribes' when the component unmounts\n * - Accepts polling/re-fetching options to trigger automatic re-fetches when the corresponding criteria is met and the fetch has been manually called at least once\n */\nexport type UseLazyQuerySubscription> = (options?: SubscriptionOptions) => readonly [LazyQueryTrigger, QueryArgFrom | UninitializedValue, {\n reset: () => void;\n}];\nexport type TypedUseLazyQuerySubscription = UseLazyQuerySubscription>;\n\n/**\n * @internal\n */\nexport type QueryStateSelector, D extends QueryDefinition> = (state: UseQueryStateDefaultResult) => R;\n\n/**\n * Provides a way to define a strongly-typed version of\n * {@linkcode QueryStateSelector} for use with a specific query.\n * This is useful for scenarios where you want to create a \"pre-typed\"\n * {@linkcode UseQueryStateOptions.selectFromResult | selectFromResult}\n * function.\n *\n * @example\n * #### __Create a strongly-typed `selectFromResult` selector function__\n *\n * ```tsx\n * import type { TypedQueryStateSelector } from '@reduxjs/toolkit/query/react'\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n *\n * type Post = {\n * id: number\n * title: string\n * }\n *\n * type PostsApiResponse = {\n * posts: Post[]\n * total: number\n * skip: number\n * limit: number\n * }\n *\n * type QueryArgument = number | undefined\n *\n * type BaseQueryFunction = ReturnType\n *\n * type SelectedResult = Pick\n *\n * const postsApiSlice = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: 'https://dummyjson.com/posts' }),\n * reducerPath: 'postsApi',\n * tagTypes: ['Posts'],\n * endpoints: (build) => ({\n * getPosts: build.query({\n * query: (limit = 5) => `?limit=${limit}&select=title`,\n * }),\n * }),\n * })\n *\n * const { useGetPostsQuery } = postsApiSlice\n *\n * function PostById({ id }: { id: number }) {\n * const { post } = useGetPostsQuery(undefined, {\n * selectFromResult: (state) => ({\n * post: state.data?.posts.find((post) => post.id === id),\n * }),\n * })\n *\n * return
  • {post?.title}
  • \n * }\n *\n * const EMPTY_ARRAY: Post[] = []\n *\n * const typedSelectFromResult: TypedQueryStateSelector<\n * PostsApiResponse,\n * QueryArgument,\n * BaseQueryFunction,\n * SelectedResult\n * > = (state) => ({ posts: state.data?.posts ?? EMPTY_ARRAY })\n *\n * function PostsList() {\n * const { posts } = useGetPostsQuery(undefined, {\n * selectFromResult: typedSelectFromResult,\n * })\n *\n * return (\n *
    \n *
      \n * {posts.map((post) => (\n * \n * ))}\n *
    \n *
    \n * )\n * }\n * ```\n *\n * @template ResultType - The type of the result `data` returned by the query.\n * @template QueryArgumentType - The type of the argument passed into the query.\n * @template BaseQueryFunctionType - The type of the base query function being used.\n * @template SelectedResultType - The type of the selected result returned by the __`selectFromResult`__ function.\n *\n * @since 2.3.0\n * @public\n */\nexport type TypedQueryStateSelector = UseQueryStateDefaultResult>> = QueryStateSelector>;\n\n/**\n * A React hook that reads the request status and cached data from the Redux store. The component will re-render as the loading status changes and the data becomes available.\n *\n * Note that this hook does not trigger fetching new data. For that use-case, see [`useQuery`](#usequery) or [`useQuerySubscription`](#usequerysubscription).\n *\n * #### Features\n *\n * - Returns the latest request status and cached data from the Redux store\n * - Re-renders as the request status changes and data becomes available\n */\nexport type UseQueryState> = = UseQueryStateDefaultResult>(arg: QueryArgFrom | SkipToken, options?: UseQueryStateOptions) => UseQueryStateResult;\nexport type TypedUseQueryState = UseQueryState>;\n\n/**\n * @internal\n */\nexport type UseQueryStateOptions, R extends Record> = {\n /**\n * Prevents a query from automatically running.\n *\n * @remarks\n * When skip is true:\n *\n * - **If the query has cached data:**\n * * The cached data **will not be used** on the initial load, and will ignore updates from any identical query until the `skip` condition is removed\n * * The query will have a status of `uninitialized`\n * * If `skip: false` is set after skipping the initial load, the cached result will be used\n * - **If the query does not have cached data:**\n * * The query will have a status of `uninitialized`\n * * The query will not exist in the state when viewed with the dev tools\n * * The query will not automatically fetch on mount\n * * The query will not automatically run when additional components with the same query are added that do run\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Skip example\"\n * const Pokemon = ({ name, skip }: { name: string; skip: boolean }) => {\n * const { data, error, status } = useGetPokemonByNameQuery(name, {\n * skip,\n * });\n *\n * return (\n *
    \n * {name} - {status}\n *
    \n * );\n * };\n * ```\n */\n skip?: boolean;\n /**\n * `selectFromResult` allows you to get a specific segment from a query result in a performant manner.\n * When using this feature, the component will not rerender unless the underlying data of the selected item has changed.\n * If the selected item is one element in a larger collection, it will disregard changes to elements in the same collection.\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Using selectFromResult to extract a single result\"\n * function PostsList() {\n * const { data: posts } = api.useGetPostsQuery();\n *\n * return (\n *
      \n * {posts?.data?.map((post) => (\n * \n * ))}\n *
    \n * );\n * }\n *\n * function PostById({ id }: { id: number }) {\n * // Will select the post with the given id, and will only rerender if the given posts data changes\n * const { post } = api.useGetPostsQuery(undefined, {\n * selectFromResult: ({ data }) => ({ post: data?.find((post) => post.id === id) }),\n * });\n *\n * return
  • {post?.name}
  • ;\n * }\n * ```\n */\n selectFromResult?: QueryStateSelector;\n};\n\n/**\n * Provides a way to define a \"pre-typed\" version of\n * {@linkcode UseQueryStateOptions} with specific options for a given query.\n * This is particularly useful for setting default query behaviors such as\n * refetching strategies, which can be overridden as needed.\n *\n * @example\n * #### __Create a `useQuery` hook with default options__\n *\n * ```ts\n * import type {\n * SubscriptionOptions,\n * TypedUseQueryStateOptions,\n * } from '@reduxjs/toolkit/query/react'\n * import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\n *\n * type Post = {\n * id: number\n * name: string\n * }\n *\n * const api = createApi({\n * baseQuery: fetchBaseQuery({ baseUrl: '/' }),\n * tagTypes: ['Post'],\n * endpoints: (build) => ({\n * getPosts: build.query({\n * query: () => 'posts',\n * }),\n * }),\n * })\n *\n * const { useGetPostsQuery } = api\n *\n * export const useGetPostsQueryWithDefaults = <\n * SelectedResult extends Record,\n * >(\n * overrideOptions: TypedUseQueryStateOptions<\n * Post[],\n * void,\n * ReturnType,\n * SelectedResult\n * > &\n * SubscriptionOptions,\n * ) =>\n * useGetPostsQuery(undefined, {\n * // Insert default options here\n *\n * refetchOnMountOrArgChange: true,\n * refetchOnFocus: true,\n * ...overrideOptions,\n * })\n * ```\n *\n * @template ResultType - The type of the result `data` returned by the query.\n * @template QueryArg - The type of the argument passed into the query.\n * @template BaseQuery - The type of the base query function being used.\n * @template SelectedResult - The type of the selected result returned by the __`selectFromResult`__ function.\n *\n * @since 2.2.8\n * @public\n */\nexport type TypedUseQueryStateOptions = UseQueryStateDefaultResult>> = UseQueryStateOptions, SelectedResult>;\nexport type UseQueryStateResult<_ extends QueryDefinition, R> = TSHelpersNoInfer;\n\n/**\n * Helper type to manually type the result\n * of the `useQueryState` hook in userland code.\n */\nexport type TypedUseQueryStateResult>> = TSHelpersNoInfer;\ntype UseQueryStateBaseResult> = QuerySubState & {\n /**\n * Where `data` tries to hold data as much as possible, also re-using\n * data from the last arguments passed into the hook, this property\n * will always contain the received data from the query, for the current query arguments.\n */\n currentData?: ResultTypeFrom;\n /**\n * Query has not started yet.\n */\n isUninitialized: false;\n /**\n * Query is currently loading for the first time. No data yet.\n */\n isLoading: false;\n /**\n * Query is currently fetching, but might have data from an earlier request.\n */\n isFetching: false;\n /**\n * Query has data from a successful load.\n */\n isSuccess: false;\n /**\n * Query is currently in \"error\" state.\n */\n isError: false;\n};\ntype UseQueryStateDefaultResult> = TSHelpersId, {\n status: QueryStatus.uninitialized;\n}>, {\n isUninitialized: true;\n}> | TSHelpersOverride, {\n isLoading: true;\n isFetching: boolean;\n data: undefined;\n} | ({\n isSuccess: true;\n isFetching: true;\n error: undefined;\n} & Required, 'data' | 'fulfilledTimeStamp'>>) | ({\n isSuccess: true;\n isFetching: false;\n error: undefined;\n} & Required, 'data' | 'fulfilledTimeStamp' | 'currentData'>>) | ({\n isError: true;\n} & Required, 'error'>>)>> & {\n /**\n * @deprecated Included for completeness, but discouraged.\n * Please use the `isLoading`, `isFetching`, `isSuccess`, `isError`\n * and `isUninitialized` flags instead\n */\n status: QueryStatus;\n};\nexport type LazyInfiniteQueryTrigger> = {\n /**\n * Triggers a lazy query.\n *\n * By default, this will start a new request even if there is already a value in the cache.\n * If you want to use the cache value and only start a request if there is no cache value, set the second argument to `true`.\n *\n * @remarks\n * If you need to access the error or success payload immediately after a lazy query, you can chain .unwrap().\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Using .unwrap with async await\"\n * try {\n * const payload = await getUserById(1).unwrap();\n * console.log('fulfilled', payload)\n * } catch (error) {\n * console.error('rejected', error);\n * }\n * ```\n */\n (arg: QueryArgFrom, direction: InfiniteQueryDirection): InfiniteQueryActionCreatorResult;\n};\ninterface UseInfiniteQuerySubscriptionOptions> extends SubscriptionOptions {\n /**\n * Prevents a query from automatically running.\n *\n * @remarks\n * When `skip` is true (or `skipToken` is passed in as `arg`):\n *\n * - **If the query has cached data:**\n * * The cached data **will not be used** on the initial load, and will ignore updates from any identical query until the `skip` condition is removed\n * * The query will have a status of `uninitialized`\n * * If `skip: false` is set after the initial load, the cached result will be used\n * - **If the query does not have cached data:**\n * * The query will have a status of `uninitialized`\n * * The query will not exist in the state when viewed with the dev tools\n * * The query will not automatically fetch on mount\n * * The query will not automatically run when additional components with the same query are added that do run\n *\n * @example\n * ```tsx\n * // codeblock-meta no-transpile title=\"Skip example\"\n * const Pokemon = ({ name, skip }: { name: string; skip: boolean }) => {\n * const { data, error, status } = useGetPokemonByNameQuery(name, {\n * skip,\n * });\n *\n * return (\n *
    \n * {name} - {status}\n *
    \n * );\n * };\n * ```\n */\n skip?: boolean;\n /**\n * Defaults to `false`. This setting allows you to control whether if a cached result is already available, RTK Query will only serve a cached result, or if it should `refetch` when set to `true` or if an adequate amount of time has passed since the last successful query result.\n * - `false` - Will not cause a query to be performed _unless_ it does not exist yet.\n * - `true` - Will always refetch when a new subscriber to a query is added. Behaves the same as calling the `refetch` callback or passing `forceRefetch: true` in the action creator.\n * - `number` - **Value is in seconds**. If a number is provided and there is an existing query in the cache, it will compare the current time vs the last fulfilled timestamp, and only refetch if enough time has elapsed.\n *\n * If you specify this option alongside `skip: true`, this **will not be evaluated** until `skip` is false.\n */\n refetchOnMountOrArgChange?: boolean | number;\n initialPageParam?: PageParamFrom;\n}\nexport type TypedUseInfiniteQuerySubscription = UseInfiniteQuerySubscription>;\nexport type UseInfiniteQuerySubscriptionResult> = Pick, 'refetch'> & {\n trigger: LazyInfiniteQueryTrigger;\n fetchNextPage: () => InfiniteQueryActionCreatorResult;\n fetchPreviousPage: () => InfiniteQueryActionCreatorResult;\n};\n\n/**\n * Helper type to manually type the result\n * of the `useQuerySubscription` hook in userland code.\n */\nexport type TypedUseInfiniteQuerySubscriptionResult = UseInfiniteQuerySubscriptionResult>;\nexport type InfiniteQueryStateSelector, D extends InfiniteQueryDefinition> = (state: UseInfiniteQueryStateDefaultResult) => R;\n\n/**\n * A React hook that automatically triggers fetches of data from an endpoint, 'subscribes' the component to the cached data, and reads the request status and cached data from the Redux store. The component will re-render as the loading status changes and the data becomes available. Additionally, it will cache multiple \"pages\" worth of responses within a single cache entry, and allows fetching more pages forwards and backwards from the current cached pages.\n *\n * The query arg is used as a cache key. Changing the query arg will tell the hook to re-fetch the data if it does not exist in the cache already, and the hook will return the data for that query arg once it's available.\n *\n * The `data` field will be a `{pages: Data[], pageParams: PageParam[]}` structure containing all fetched page responses and the corresponding page param values for each page. You may use this to render individual pages, combine all pages into a single infinite list, or other display logic as needed.\n *\n * This hook combines the functionality of both [`useInfiniteQueryState`](#useinfinitequerystate) and [`useInfiniteQuerySubscription`](#useinfinitequerysubscription) together, and is intended to be used in the majority of situations.\n *\n * As with normal query hooks, `skipToken` is a valid argument that will skip the query from executing.\n *\n * By default, the initial request will use the `initialPageParam` value that was defined on the infinite query endpoint. If you want to start from a different value, you can pass `initialPageParam` as part of the hook options to override that initial request value.\n *\n * Use the returned `fetchNextPage` and `fetchPreviousPage` methods on the hook result object to trigger fetches forwards and backwards. These will always calculate the next or previous page param based on the current cached pages and the provided `getNext/PreviousPageParam` callbacks defined in the endpoint.\n *\n *\n * #### Features\n *\n * - Automatically triggers requests to retrieve data based on the hook argument and whether cached data exists by default\n * - 'Subscribes' the component to keep cached data in the store, and 'unsubscribes' when the component unmounts\n * - Caches multiple pages worth of responses, and provides methods to trigger more page fetches forwards and backwards\n * - Accepts polling/re-fetching options to trigger automatic re-fetches when the corresponding criteria is met\n * - Returns the latest request status and cached data from the Redux store\n * - Re-renders as the request status changes and data becomes available\n */\nexport type UseInfiniteQuery> = = UseInfiniteQueryStateDefaultResult>(arg: InfiniteQueryArgFrom | SkipToken, options?: UseInfiniteQuerySubscriptionOptions & UseInfiniteQueryStateOptions) => UseInfiniteQueryHookResult & Pick, 'fetchNextPage' | 'fetchPreviousPage'>;\n\n/**\n * A React hook that reads the request status and cached data from the Redux store. The component will re-render as the loading status changes and the data becomes available.\n *\n * Note that this hook does not trigger fetching new data. For that use-case, see [`useInfiniteQuery`](#useinfinitequery) or [`useInfiniteQuerySubscription`](#useinfinitequerysubscription).\n *\n * #### Features\n *\n * - Returns the latest request status and cached data from the Redux store\n * - Re-renders as the request status changes and data becomes available\n */\nexport type UseInfiniteQueryState> = = UseInfiniteQueryStateDefaultResult>(arg: QueryArgFrom | SkipToken, options?: UseInfiniteQueryStateOptions) => UseInfiniteQueryStateResult;\nexport type TypedUseInfiniteQueryState = UseInfiniteQueryState>;\n\n/**\n * A React hook that automatically triggers fetches of data from an endpoint, and 'subscribes' the component to the cached data. Additionally, it will cache multiple \"pages\" worth of responses within a single cache entry, and allows fetching more pages forwards and backwards from the current cached pages.\n *\n * The query arg is used as a cache key. Changing the query arg will tell the hook to re-fetch the data if it does not exist in the cache already.\n *\n * Note that this hook does not return a request status or cached data. For that use-case, see [`useInfiniteQuery`](#useinfinitequery) or [`useInfiniteQueryState`](#useinfinitequerystate).\n *\n * #### Features\n *\n * - Automatically triggers requests to retrieve data based on the hook argument and whether cached data exists by default\n * - 'Subscribes' the component to keep cached data in the store, and 'unsubscribes' when the component unmounts\n * - Caches multiple pages worth of responses, and provides methods to trigger more page fetches forwards and backwards\n * - Accepts polling/re-fetching options to trigger automatic re-fetches when the corresponding criteria is met\n */\nexport type UseInfiniteQuerySubscription> = (arg: QueryArgFrom | SkipToken, options?: UseInfiniteQuerySubscriptionOptions) => UseInfiniteQuerySubscriptionResult;\nexport type UseInfiniteQueryHookResult, R = UseInfiniteQueryStateDefaultResult> = UseInfiniteQueryStateResult & Pick, 'refetch'>;\nexport type UseInfiniteQueryStateOptions, R extends Record> = {\n /**\n * Prevents a query from automatically running.\n *\n * @remarks\n * When skip is true:\n *\n * - **If the query has cached data:**\n * * The cached data **will not be used** on the initial load, and will ignore updates from any identical query until the `skip` condition is removed\n * * The query will have a status of `uninitialized`\n * * If `skip: false` is set after skipping the initial load, the cached result will be used\n * - **If the query does not have cached data:**\n * * The query will have a status of `uninitialized`\n * * The query will not exist in the state when viewed with the dev tools\n * * The query will not automatically fetch on mount\n * * The query will not automatically run when additional components with the same query are added that do run\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Skip example\"\n * const Pokemon = ({ name, skip }: { name: string; skip: boolean }) => {\n * const { data, error, status } = useGetPokemonByNameQuery(name, {\n * skip,\n * });\n *\n * return (\n *
    \n * {name} - {status}\n *
    \n * );\n * };\n * ```\n */\n skip?: boolean;\n /**\n * `selectFromResult` allows you to get a specific segment from a query result in a performant manner.\n * When using this feature, the component will not rerender unless the underlying data of the selected item has changed.\n * If the selected item is one element in a larger collection, it will disregard changes to elements in the same collection.\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Using selectFromResult to extract a single result\"\n * function PostsList() {\n * const { data: posts } = api.useGetPostsQuery();\n *\n * return (\n *
      \n * {posts?.data?.map((post) => (\n * \n * ))}\n *
    \n * );\n * }\n *\n * function PostById({ id }: { id: number }) {\n * // Will select the post with the given id, and will only rerender if the given posts data changes\n * const { post } = api.useGetPostsQuery(undefined, {\n * selectFromResult: ({ data }) => ({ post: data?.find((post) => post.id === id) }),\n * });\n *\n * return
  • {post?.name}
  • ;\n * }\n * ```\n */\n selectFromResult?: InfiniteQueryStateSelector;\n};\nexport type UseInfiniteQueryStateResult<_ extends InfiniteQueryDefinition, R> = TSHelpersNoInfer;\ntype UseInfiniteQueryStateBaseResult> = InfiniteQuerySubState & {\n /**\n * Where `data` tries to hold data as much as possible, also re-using\n * data from the last arguments passed into the hook, this property\n * will always contain the received data from the query, for the current query arguments.\n */\n currentData?: InfiniteData, PageParamFrom>;\n /**\n * Query has not started yet.\n */\n isUninitialized: false;\n /**\n * Query is currently loading for the first time. No data yet.\n */\n isLoading: false;\n /**\n * Query is currently fetching, but might have data from an earlier request.\n */\n isFetching: false;\n /**\n * Query has data from a successful load.\n */\n isSuccess: false;\n /**\n * Query is currently in \"error\" state.\n */\n isError: false;\n hasNextPage: false;\n hasPreviousPage: false;\n isFetchingNextPage: false;\n isFetchingPreviousPage: false;\n};\ntype UseInfiniteQueryStateDefaultResult> = TSHelpersId, {\n status: QueryStatus.uninitialized;\n}>, {\n isUninitialized: true;\n}> | TSHelpersOverride, {\n isLoading: true;\n isFetching: boolean;\n data: undefined;\n} | ({\n isSuccess: true;\n isFetching: true;\n error: undefined;\n} & Required, 'data' | 'fulfilledTimeStamp'>>) | ({\n isSuccess: true;\n isFetching: false;\n error: undefined;\n} & Required, 'data' | 'fulfilledTimeStamp' | 'currentData'>>) | ({\n isError: true;\n} & Required, 'error'>>)>> & {\n /**\n * @deprecated Included for completeness, but discouraged.\n * Please use the `isLoading`, `isFetching`, `isSuccess`, `isError`\n * and `isUninitialized` flags instead\n */\n status: QueryStatus;\n};\nexport type MutationStateSelector, D extends MutationDefinition> = (state: MutationResultSelectorResult) => R;\nexport type UseMutationStateOptions, R extends Record> = {\n selectFromResult?: MutationStateSelector;\n fixedCacheKey?: string;\n};\nexport type UseMutationStateResult, R> = TSHelpersNoInfer & {\n originalArgs?: QueryArgFrom;\n /**\n * Resets the hook state to its initial `uninitialized` state.\n * This will also remove the last result from the cache.\n */\n reset: () => void;\n};\n\n/**\n * Helper type to manually type the result\n * of the `useMutation` hook in userland code.\n */\nexport type TypedUseMutationResult>> = UseMutationStateResult, R>;\n\n/**\n * A React hook that lets you trigger an update request for a given endpoint, and subscribes the component to read the request status from the Redux store. The component will re-render as the loading status changes.\n *\n * #### Features\n *\n * - Manual control over firing a request to alter data on the server or possibly invalidate the cache\n * - 'Subscribes' the component to keep cached data in the store, and 'unsubscribes' when the component unmounts\n * - Returns the latest request status and cached data from the Redux store\n * - Re-renders as the request status changes and data becomes available\n */\nexport type UseMutation> = = MutationResultSelectorResult>(options?: UseMutationStateOptions) => readonly [MutationTrigger, UseMutationStateResult];\nexport type TypedUseMutation = UseMutation>;\nexport type MutationTrigger> = {\n /**\n * Triggers the mutation and returns a Promise.\n * @remarks\n * If you need to access the error or success payload immediately after a mutation, you can chain .unwrap().\n *\n * @example\n * ```ts\n * // codeblock-meta title=\"Using .unwrap with async await\"\n * try {\n * const payload = await addPost({ id: 1, name: 'Example' }).unwrap();\n * console.log('fulfilled', payload)\n * } catch (error) {\n * console.error('rejected', error);\n * }\n * ```\n */\n (arg: QueryArgFrom): MutationActionCreatorResult;\n};\nexport type TypedMutationTrigger = MutationTrigger>;\n\n/**\n * Wrapper around `defaultQueryStateSelector` to be used in `useQuery`.\n * We want the initial render to already come back with\n * `{ isUninitialized: false, isFetching: true, isLoading: true }`\n * to prevent that the library user has to do an additional check for `isUninitialized`/\n */\nconst noPendingQueryStateSelector: QueryStateSelector = selected => {\n if (selected.isUninitialized) {\n return {\n ...selected,\n isUninitialized: false,\n isFetching: true,\n isLoading: selected.data !== undefined ? false : true,\n status: QueryStatus.pending\n } as any;\n }\n return selected;\n};\nfunction pick(obj: T, ...keys: K[]): Pick {\n const ret: any = {};\n keys.forEach(key => {\n ret[key] = obj[key];\n });\n return ret;\n}\nconst COMMON_HOOK_DEBUG_FIELDS = ['data', 'status', 'isLoading', 'isSuccess', 'isError', 'error'] as const;\ntype GenericPrefetchThunk = (endpointName: any, arg: any, options: PrefetchOptions) => ThunkAction;\n\n/**\n *\n * @param opts.api - An API with defined endpoints to create hooks for\n * @param opts.moduleOptions.batch - The version of the `batchedUpdates` function to be used\n * @param opts.moduleOptions.useDispatch - The version of the `useDispatch` hook to be used\n * @param opts.moduleOptions.useSelector - The version of the `useSelector` hook to be used\n * @returns An object containing functions to generate hooks based on an endpoint\n */\nexport function buildHooks({\n api,\n moduleOptions: {\n batch,\n hooks: {\n useDispatch,\n useSelector,\n useStore\n },\n unstable__sideEffectsInRender,\n createSelector\n },\n serializeQueryArgs,\n context\n}: {\n api: Api;\n moduleOptions: Required;\n serializeQueryArgs: SerializeQueryArgs;\n context: ApiContext;\n}) {\n const usePossiblyImmediateEffect: (effect: () => void | undefined, deps?: DependencyList) => void = unstable__sideEffectsInRender ? cb => cb() : useEffect;\n return {\n buildQueryHooks,\n buildInfiniteQueryHooks,\n buildMutationHook,\n usePrefetch\n };\n function queryStatePreSelector(currentState: QueryResultSelectorResult, lastResult: UseQueryStateDefaultResult | undefined, queryArgs: any): UseQueryStateDefaultResult {\n // if we had a last result and the current result is uninitialized,\n // we might have called `api.util.resetApiState`\n // in this case, reset the hook\n if (lastResult?.endpointName && currentState.isUninitialized) {\n const {\n endpointName\n } = lastResult;\n const endpointDefinition = context.endpointDefinitions[endpointName];\n if (queryArgs !== skipToken && serializeQueryArgs({\n queryArgs: lastResult.originalArgs,\n endpointDefinition,\n endpointName\n }) === serializeQueryArgs({\n queryArgs,\n endpointDefinition,\n endpointName\n })) lastResult = undefined;\n }\n\n // data is the last known good request result we have tracked - or if none has been tracked yet the last good result for the current args\n let data = currentState.isSuccess ? currentState.data : lastResult?.data;\n if (data === undefined) data = currentState.data;\n const hasData = data !== undefined;\n\n // isFetching = true any time a request is in flight\n const isFetching = currentState.isLoading;\n\n // isLoading = true only when loading while no data is present yet (initial load with no data in the cache)\n const isLoading = (!lastResult || lastResult.isLoading || lastResult.isUninitialized) && !hasData && isFetching;\n\n // isSuccess = true when data is present and we're not refetching after an error.\n // That includes cases where the _current_ item is either actively\n // fetching or about to fetch due to an uninitialized entry.\n const isSuccess = currentState.isSuccess || hasData && (isFetching && !lastResult?.isError || currentState.isUninitialized);\n return {\n ...currentState,\n data,\n currentData: currentState.data,\n isFetching,\n isLoading,\n isSuccess\n } as UseQueryStateDefaultResult;\n }\n function infiniteQueryStatePreSelector(currentState: InfiniteQueryResultSelectorResult, lastResult: UseInfiniteQueryStateDefaultResult | undefined, queryArgs: any): UseInfiniteQueryStateDefaultResult {\n // if we had a last result and the current result is uninitialized,\n // we might have called `api.util.resetApiState`\n // in this case, reset the hook\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 })) lastResult = undefined;\n }\n\n // data is the last known good request result we have tracked - or if none has been tracked yet the last good result for the current args\n let data = currentState.isSuccess ? currentState.data : lastResult?.data;\n if (data === undefined) data = currentState.data;\n const hasData = data !== undefined;\n\n // isFetching = true any time a request is in flight\n const isFetching = currentState.isLoading;\n // isLoading = true only when loading while no data is present yet (initial load with no data in the cache)\n const isLoading = (!lastResult || lastResult.isLoading || lastResult.isUninitialized) && !hasData && isFetching;\n // isSuccess = true when data is present\n const isSuccess = currentState.isSuccess || isFetching && hasData;\n return {\n ...currentState,\n data,\n currentData: currentState.data,\n isFetching,\n isLoading,\n isSuccess\n } as UseInfiniteQueryStateDefaultResult;\n }\n function usePrefetch>(endpointName: EndpointName, defaultOptions?: PrefetchOptions) {\n const dispatch = useDispatch>();\n const stableDefaultOptions = useShallowStableValue(defaultOptions);\n return useCallback((arg: any, options?: PrefetchOptions) => dispatch((api.util.prefetch as GenericPrefetchThunk)(endpointName, arg, {\n ...stableDefaultOptions,\n ...options\n })), [endpointName, dispatch, stableDefaultOptions]);\n }\n function useQuerySubscriptionCommonImpl | InfiniteQueryActionCreatorResult>(endpointName: string, arg: unknown | SkipToken, {\n refetchOnReconnect,\n refetchOnFocus,\n refetchOnMountOrArgChange,\n skip = false,\n pollingInterval = 0,\n skipPollingIfUnfocused = false,\n ...rest\n }: UseQuerySubscriptionOptions = {}) {\n const {\n initiate\n } = api.endpoints[endpointName] as ApiEndpointQuery, Definitions>;\n const dispatch = useDispatch>();\n\n // TODO: Change this to `useRef(undefined)` after upgrading to React 19.\n const subscriptionSelectorsRef = useRef(undefined);\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 as unknown as SubscriptionSelectors;\n }\n const stableArg = useStableQueryArgs(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, context.endpointDefinitions[endpointName], endpointName);\n const stableSubscriptionOptions = useShallowStableValue({\n refetchOnReconnect,\n refetchOnFocus,\n pollingInterval,\n skipPollingIfUnfocused\n });\n const lastRenderHadSubscription = useRef(false);\n const initialPageParam = (rest as UseInfiniteQuerySubscriptionOptions).initialPageParam;\n const stableInitialPageParam = useShallowStableValue(initialPageParam);\n\n /**\n * @todo Change this to `useRef>(undefined)` after upgrading to React 19.\n */\n const promiseRef = useRef(undefined);\n let {\n queryCacheKey,\n requestId\n } = promiseRef.current || {};\n\n // HACK We've saved the middleware subscription lookup callbacks into a ref,\n // so we can directly check here if the subscription exists for this query.\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((): void | undefined => {\n if (subscriptionRemoved) {\n promiseRef.current = undefined;\n }\n }, [subscriptionRemoved]);\n usePossiblyImmediateEffect((): void | undefined => {\n const lastPromise = promiseRef.current;\n if (typeof process !== 'undefined' && process.env.NODE_ENV === 'removeMeOnCompilation') {\n // this is only present to enforce the rule of hooks to keep `isSubscribed` in the dependency array\n console.log(subscriptionRemoved);\n }\n if (stableArg === skipToken) {\n lastPromise?.unsubscribe();\n promiseRef.current = undefined;\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 ...(isInfiniteQueryDefinition(context.endpointDefinitions[endpointName]) ? {\n initialPageParam: stableInitialPageParam\n } : {})\n }));\n promiseRef.current = promise as T;\n } else if (stableSubscriptionOptions !== lastSubscriptionOptions) {\n lastPromise.updateSubscriptionOptions(stableSubscriptionOptions);\n }\n }, [dispatch, initiate, refetchOnMountOrArgChange, stableArg, stableSubscriptionOptions, subscriptionRemoved, stableInitialPageParam, endpointName]);\n return [promiseRef, dispatch, initiate, stableSubscriptionOptions] as const;\n }\n function buildUseQueryState(endpointName: string, preSelector: typeof queryStatePreSelector | typeof infiniteQueryStatePreSelector) {\n const useQueryState = (arg: any, {\n skip = false,\n selectFromResult\n }: UseQueryStateOptions | UseInfiniteQueryStateOptions = {}) => {\n const {\n select\n } = api.endpoints[endpointName] as ApiEndpointQuery, Definitions>;\n const stableArg = useStableQueryArgs(skip ? skipToken : arg, serializeQueryArgs, context.endpointDefinitions[endpointName], endpointName);\n type ApiRootState = Parameters>[0];\n const lastValue = useRef(undefined);\n const selectDefaultResult: Selector = useMemo(() =>\n // Normally ts-ignores are bad and should be avoided, but we're\n // already casting this selector to be `Selector` anyway,\n // so the inconsistencies don't matter here\n // @ts-ignore\n createSelector([\n // @ts-ignore\n select(stableArg), (_: ApiRootState, lastResult: any) => lastResult, (_: ApiRootState) => stableArg], preSelector, {\n memoizeOptions: {\n resultEqualityCheck: shallowEqual\n }\n }), [select, stableArg]);\n const querySelector: Selector = useMemo(() => selectFromResult ? createSelector([selectDefaultResult], selectFromResult, {\n devModeChecks: {\n identityFunctionCheck: 'never'\n }\n }) : selectDefaultResult, [selectDefaultResult, selectFromResult]);\n const currentState = useSelector((state: RootState) => querySelector(state, lastValue.current), shallowEqual);\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 useQueryState;\n }\n function usePromiseRefUnsubscribeOnUnmount(promiseRef: React.RefObject<{\n unsubscribe?: () => void;\n } | undefined>) {\n useEffect(() => {\n return () => {\n promiseRef.current?.unsubscribe?.()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ;\n (promiseRef.current as any) = undefined;\n };\n }, [promiseRef]);\n }\n function refetchOrErrorIfUnmounted | InfiniteQueryActionCreatorResult>(promiseRef: React.RefObject): T {\n if (!promiseRef.current) 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() as T;\n }\n function buildQueryHooks(endpointName: string): QueryHooks {\n const useQuerySubscription: UseQuerySubscription = (arg: any, options = {}) => {\n const [promiseRef] = useQuerySubscriptionCommonImpl>(endpointName, arg, options);\n usePromiseRefUnsubscribeOnUnmount(promiseRef);\n return useMemo(() => ({\n /**\n * A method to manually refetch data for the query\n */\n refetch: () => refetchOrErrorIfUnmounted(promiseRef)\n }), [promiseRef]);\n };\n const useLazyQuerySubscription: UseLazyQuerySubscription = ({\n refetchOnReconnect,\n refetchOnFocus,\n pollingInterval = 0,\n skipPollingIfUnfocused = false\n } = {}) => {\n const {\n initiate\n } = api.endpoints[endpointName] as ApiEndpointQuery, Definitions>;\n const dispatch = useDispatch>();\n const [arg, setArg] = useState(UNINITIALIZED_VALUE);\n\n // TODO: Change this to `useRef>(undefined)` after upgrading to React 19.\n /**\n * @todo Change this to `useRef>(undefined)` after upgrading to React 19.\n */\n const promiseRef = useRef | undefined>(undefined);\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 = useRef(stableSubscriptionOptions);\n usePossiblyImmediateEffect(() => {\n subscriptionOptionsRef.current = stableSubscriptionOptions;\n }, [stableSubscriptionOptions]);\n const trigger = useCallback(function (arg: any, preferCacheValue = false) {\n let promise: QueryActionCreatorResult;\n batch(() => {\n promiseRef.current?.unsubscribe();\n promiseRef.current = promise = dispatch(initiate(arg, {\n subscriptionOptions: subscriptionOptionsRef.current,\n forceRefetch: !preferCacheValue\n }));\n setArg(arg);\n });\n return promise!;\n }, [dispatch, initiate]);\n const reset = useCallback(() => {\n if (promiseRef.current?.queryCacheKey) {\n dispatch(api.internalActions.removeQueryResult({\n queryCacheKey: promiseRef.current?.queryCacheKey as QueryCacheKey\n }));\n }\n }, [dispatch]);\n\n /* cleanup on unmount */\n useEffect(() => {\n return () => {\n promiseRef?.current?.unsubscribe();\n };\n }, []);\n\n /* if \"cleanup on unmount\" was triggered from a fast refresh, we want to reinstate the query */\n useEffect(() => {\n if (arg !== UNINITIALIZED_VALUE && !promiseRef.current) {\n trigger(arg, true);\n }\n }, [arg, trigger]);\n return useMemo(() => [trigger, arg, {\n reset\n }] as const, [trigger, arg, reset]);\n };\n const useQueryState: UseQueryState = buildUseQueryState(endpointName, queryStatePreSelector);\n return {\n useQueryState,\n useQuerySubscription,\n useLazyQuerySubscription,\n useLazyQuery(options) {\n const [trigger, arg, {\n reset\n }] = useLazyQuerySubscription(options);\n const queryStateResults = useQueryState(arg, {\n ...options,\n skip: arg === UNINITIALIZED_VALUE\n });\n const info = useMemo(() => ({\n lastArg: arg\n }), [arg]);\n return useMemo(() => [trigger, {\n ...queryStateResults,\n reset\n }, info], [trigger, queryStateResults, reset, info]);\n },\n useQuery(arg, options) {\n const querySubscriptionResults = useQuerySubscription(arg, options);\n const queryStateResults = useQueryState(arg, {\n selectFromResult: arg === skipToken || options?.skip ? undefined : noPendingQueryStateSelector,\n ...options\n });\n const debugValue = pick(queryStateResults, ...COMMON_HOOK_DEBUG_FIELDS);\n useDebugValue(debugValue);\n return useMemo(() => ({\n ...queryStateResults,\n ...querySubscriptionResults\n }), [queryStateResults, querySubscriptionResults]);\n }\n };\n }\n function buildInfiniteQueryHooks(endpointName: string): InfiniteQueryHooks {\n const useInfiniteQuerySubscription: UseInfiniteQuerySubscription = (arg: any, options = {}) => {\n const [promiseRef, dispatch, initiate, stableSubscriptionOptions] = useQuerySubscriptionCommonImpl>(endpointName, arg, options);\n const subscriptionOptionsRef = useRef(stableSubscriptionOptions);\n usePossiblyImmediateEffect(() => {\n subscriptionOptionsRef.current = stableSubscriptionOptions;\n }, [stableSubscriptionOptions]);\n const trigger: LazyInfiniteQueryTrigger = useCallback(function (arg: unknown, direction: 'forward' | 'backward') {\n let promise: InfiniteQueryActionCreatorResult;\n batch(() => {\n promiseRef.current?.unsubscribe();\n promiseRef.current = promise = dispatch((initiate as StartInfiniteQueryActionCreator)(arg, {\n subscriptionOptions: subscriptionOptionsRef.current,\n direction\n }));\n });\n return promise!;\n }, [promiseRef, dispatch, initiate]);\n usePromiseRefUnsubscribeOnUnmount(promiseRef);\n return useMemo(() => {\n const fetchNextPage = () => {\n return trigger(arg, 'forward');\n };\n const fetchPreviousPage = () => {\n return trigger(arg, 'backward');\n };\n return {\n trigger,\n /**\n * A method to manually refetch data for the query\n */\n refetch: () => refetchOrErrorIfUnmounted(promiseRef),\n fetchNextPage,\n fetchPreviousPage\n };\n }, [promiseRef, trigger, arg]);\n };\n const useInfiniteQueryState: UseInfiniteQueryState = buildUseQueryState(endpointName, infiniteQueryStatePreSelector);\n return {\n useInfiniteQueryState,\n useInfiniteQuerySubscription,\n useInfiniteQuery(arg, options) {\n const {\n refetch,\n fetchNextPage,\n fetchPreviousPage\n } = useInfiniteQuerySubscription(arg, options);\n const queryStateResults = useInfiniteQueryState(arg, {\n selectFromResult: arg === skipToken || options?.skip ? undefined : noPendingQueryStateSelector,\n ...options\n });\n const debugValue = pick(queryStateResults, ...COMMON_HOOK_DEBUG_FIELDS, 'hasNextPage', 'hasPreviousPage');\n useDebugValue(debugValue);\n return useMemo(() => ({\n ...queryStateResults,\n fetchNextPage,\n fetchPreviousPage,\n refetch\n }), [queryStateResults, fetchNextPage, fetchPreviousPage, refetch]);\n }\n };\n }\n function buildMutationHook(name: string): UseMutation {\n return ({\n selectFromResult,\n fixedCacheKey\n } = {}) => {\n const {\n select,\n initiate\n } = api.endpoints[name] as ApiEndpointMutation, Definitions>;\n const dispatch = useDispatch>();\n const [promise, setPromise] = useState>();\n useEffect(() => () => {\n if (!promise?.arg.fixedCacheKey) {\n promise?.reset();\n }\n }, [promise]);\n const triggerMutation = useCallback(function (arg: Parameters['0']) {\n const promise = dispatch(initiate(arg, {\n fixedCacheKey\n }));\n setPromise(promise);\n return promise;\n }, [dispatch, initiate, fixedCacheKey]);\n const {\n requestId\n } = promise || {};\n const selectDefaultResult = useMemo(() => select({\n fixedCacheKey,\n requestId: promise?.requestId\n }), [fixedCacheKey, promise, select]);\n const mutationSelector = useMemo((): Selector, any> => selectFromResult ? createSelector([selectDefaultResult], selectFromResult) : selectDefaultResult, [selectFromResult, selectDefaultResult]);\n const currentState = useSelector(mutationSelector, shallowEqual);\n const originalArgs = fixedCacheKey == null ? promise?.arg.originalArgs : undefined;\n const reset = useCallback(() => {\n batch(() => {\n if (promise) {\n setPromise(undefined);\n }\n if (fixedCacheKey) {\n dispatch(api.internalActions.removeMutationResult({\n requestId,\n fixedCacheKey\n }));\n }\n });\n }, [dispatch, fixedCacheKey, promise, requestId]);\n const debugValue = pick(currentState, ...COMMON_HOOK_DEBUG_FIELDS, 'endpointName');\n useDebugValue(debugValue);\n const finalState = useMemo(() => ({\n ...currentState,\n originalArgs,\n reset\n }), [currentState, originalArgs, reset]);\n return useMemo(() => [triggerMutation, finalState] as const, [triggerMutation, finalState]);\n };\n }\n}","export const UNINITIALIZED_VALUE = Symbol();\nexport type UninitializedValue = typeof UNINITIALIZED_VALUE;","import { useEffect, useRef, useMemo } from 'react';\nimport type { SerializeQueryArgs } from '@reduxjs/toolkit/query';\nimport type { EndpointDefinition } from '@reduxjs/toolkit/query';\nexport function useStableQueryArgs(queryArgs: T, serialize: SerializeQueryArgs, endpointDefinition: EndpointDefinition, endpointName: string) {\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 cache = useRef(incoming);\n useEffect(() => {\n if (cache.current.serialized !== incoming.serialized) {\n cache.current = incoming;\n }\n }, [incoming]);\n return cache.current.serialized === incoming.serialized ? cache.current.queryArgs : queryArgs;\n}","import { useEffect, useRef } from 'react';\nimport { shallowEqual } from 'react-redux';\nexport function useShallowStableValue(value: T) {\n const cache = useRef(value);\n useEffect(() => {\n if (!shallowEqual(cache.current, value)) {\n cache.current = value;\n }\n }, [value]);\n return shallowEqual(cache.current, value) ? cache.current : value;\n}","import { configureStore, formatProdErrorMessage as _formatProdErrorMessage } from '@reduxjs/toolkit';\nimport type { Context } from 'react';\nimport { useContext } from 'react';\nimport { useEffect } from 'react';\nimport * as React from 'react';\nimport type { ReactReduxContextValue } from 'react-redux';\nimport { Provider, ReactReduxContext } from 'react-redux';\nimport { setupListeners } from '@reduxjs/toolkit/query';\nimport type { Api } from '@reduxjs/toolkit/query';\n\n/**\n * Can be used as a `Provider` if you **do not already have a Redux store**.\n *\n * @example\n * ```tsx\n * // codeblock-meta no-transpile title=\"Basic usage - wrap your App with ApiProvider\"\n * import * as React from 'react';\n * import { ApiProvider } from '@reduxjs/toolkit/query/react';\n * import { Pokemon } from './features/Pokemon';\n *\n * function App() {\n * return (\n * \n * \n * \n * );\n * }\n * ```\n *\n * @remarks\n * Using this together with an existing redux store, both will\n * conflict with each other - please use the traditional redux setup\n * in that case.\n */\nexport function ApiProvider(props: {\n children: any;\n api: Api;\n setupListeners?: Parameters[1] | false;\n context?: Context;\n}) {\n const context = props.context || ReactReduxContext;\n const existingContext = useContext(context);\n if (existingContext) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(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 // Adds the event listeners for online/offline/focus/etc\n useEffect((): undefined | (() => void) => props.setupListeners === false ? undefined : setupListeners(store.dispatch, props.setupListeners), [props.setupListeners, store.dispatch]);\n return \n {props.children}\n ;\n}"],"mappings":"qnBAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,iBAAAE,GAAA,wBAAAC,EAAA,cAAAC,GAAA,qBAAAC,GAAA,yBAAAC,KAAA,eAAAC,GAAAP,GAGA,IAAAQ,GAA2C,kCCH3C,IAAAC,GAAkE,4BAElEC,EAAqH,uBACrHC,GAAkD,oBCH3C,SAASC,EAAWC,EAAa,CACtC,OAAOA,EAAI,QAAQA,EAAI,CAAC,EAAGA,EAAI,CAAC,EAAE,YAAY,CAAC,CACjD,CCmmBO,SAASC,GAAkB,EAAqF,CACrH,OAAO,EAAE,OAAS,OACpB,CACO,SAASC,GAAqB,EAAwF,CAC3H,OAAO,EAAE,OAAS,UACpB,CACO,SAASC,EAA0B,EAAkG,CAC1I,OAAO,EAAE,OAAS,eACpB,CCzmBO,SAASC,EAA6BC,KAAcC,EAAqC,CAC9F,OAAO,OAAO,OAAOD,EAAQ,GAAGC,CAAI,CAC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AAM,eAAgBG,EAAM,QAAQ,CAAC,EAC5K,gBAAC,YAAS,MAAOA,EAAO,QAASF,GACnCD,EAAM,QACT,CACJ,CTjDA,IAAMK,MAA2B,sBAAe,eAAW,EAAGC,GAAiB,CAAC","names":["react_exports","__export","ApiProvider","UNINITIALIZED_VALUE","createApi","reactHooksModule","reactHooksModuleName","__toCommonJS","import_query","import_toolkit","import_react_redux","import_reselect","capitalize","str","isQueryDefinition","isMutationDefinition","isInfiniteQueryDefinition","safeAssign","target","args","import_toolkit","import_query","import_react","import_react_redux","UNINITIALIZED_VALUE","import_react","useStableQueryArgs","queryArgs","serialize","endpointDefinition","endpointName","incoming","cache","import_react","import_react_redux","useShallowStableValue","value","cache","canUseDOM","isDOM","isRunningInReactNative","isReactNative","getUseIsomorphicLayoutEffect","useIsomorphicLayoutEffect","noPendingQueryStateSelector","selected","pick","obj","keys","ret","key","COMMON_HOOK_DEBUG_FIELDS","buildHooks","api","batch","useDispatch","useSelector","useStore","unstable__sideEffectsInRender","createSelector","serializeQueryArgs","context","usePossiblyImmediateEffect","cb","buildQueryHooks","buildInfiniteQueryHooks","buildMutationHook","usePrefetch","queryStatePreSelector","currentState","lastResult","queryArgs","endpointName","endpointDefinition","data","hasData","isFetching","isLoading","isSuccess","infiniteQueryStatePreSelector","defaultOptions","dispatch","stableDefaultOptions","useShallowStableValue","arg","options","useQuerySubscriptionCommonImpl","refetchOnReconnect","refetchOnFocus","refetchOnMountOrArgChange","skip","pollingInterval","skipPollingIfUnfocused","rest","initiate","subscriptionSelectorsRef","returnedValue","stableArg","useStableQueryArgs","stableSubscriptionOptions","lastRenderHadSubscription","initialPageParam","stableInitialPageParam","promiseRef","queryCacheKey","requestId","currentRenderHasSubscription","subscriptionRemoved","lastPromise","lastSubscriptionOptions","promise","isInfiniteQueryDefinition","buildUseQueryState","preSelector","selectFromResult","select","lastValue","selectDefaultResult","_","querySelector","state","store","newLastValue","usePromiseRefUnsubscribeOnUnmount","refetchOrErrorIfUnmounted","_formatProdErrorMessage2","useQuerySubscription","useLazyQuerySubscription","setArg","UNINITIALIZED_VALUE","subscriptionOptionsRef","trigger","preferCacheValue","reset","useQueryState","queryStateResults","info","querySubscriptionResults","debugValue","useInfiniteQuerySubscription","direction","useInfiniteQueryState","refetch","fetchNextPage","fetchPreviousPage","name","fixedCacheKey","setPromise","triggerMutation","mutationSelector","originalArgs","finalState","reactHooksModuleName","reactHooksModule","batch","rrBatch","hooks","rrUseDispatch","rrUseSelector","rrUseStore","createSelector","_createSelector","unstable__sideEffectsInRender","rest","api","serializeQueryArgs","context","anyApi","buildQueryHooks","buildInfiniteQueryHooks","buildMutationHook","usePrefetch","buildHooks","safeAssign","endpointName","definition","isQueryDefinition","useQuery","useLazyQuery","useLazyQuerySubscription","useQueryState","useQuerySubscription","capitalize","isMutationDefinition","useMutation","isInfiniteQueryDefinition","useInfiniteQuery","useInfiniteQuerySubscription","useInfiniteQueryState","__reExport","react_exports","import_toolkit","import_react","React","import_react_redux","import_query","ApiProvider","props","context","_formatProdErrorMessage","store","gDM","createApi","reactHooksModule"]}