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,OACvDkL,EAAAA,EAAAA,IAAgBlE,EAAahH,EAAEgH,YADH,IAoB9B,aAAOiE,OAAP,EAAOA,EAAuBhP,cAvB7B,CAwBF,oCAEDwI,SAOEtI,GAgBA,SAAIA,GAAAA,EAASiP,WACX,OAAOjP,EAST,IAAMqN,GAAmB,kCACpB3O,KAAKoB,eAAekI,SACpBtJ,KAAK6J,iBAAL,MAAsBvI,OAAtB,EAAsBA,EAASI,WAC/BJ,GAHoB,IAIvBiP,YAAY,IAmBd,OAhBK5B,EAAiBhN,WAAagN,EAAiBjN,WAClDiN,EAAiBhN,WAAY+H,EAAAA,EAAAA,IAC3BiF,EAAiBjN,SACjBiN,IAK+C,qBAAxCA,EAAiB6B,qBAC1B7B,EAAiB6B,mBACkB,WAAjC7B,EAAiB9F,aAE4B,qBAAtC8F,EAAiB8B,mBAC1B9B,EAAiB8B,mBAAqB9B,EAAiB+B,UAGlD/B,CAOR,uCAEDzC,SACE5K,GAEA,aAAIA,GAAAA,EAASiP,WACJjP,GAEF,kCACFtB,KAAKoB,eAAe6K,WACpBjM,KAAKoM,oBAAL,MAAyB9K,OAAzB,EAAyBA,EAAS6K,cAClC7K,GAHE,IAILiP,YAAY,GAEf,sBAEDvG,WACEhK,KAAK2M,WAAW3C,QAChBhK,KAAKgL,cAAchB,OACpB,OA/tBI,E","sources":["../../../node_modules/.pnpm/@tanstack+query-core@4.32.0/node_modules/@tanstack/query-core/src/logger.ts","../../../node_modules/.pnpm/@tanstack+query-core@4.32.0/node_modules/@tanstack/query-core/src/removable.ts","../../../node_modules/.pnpm/@tanstack+query-core@4.32.0/node_modules/@tanstack/query-core/src/query.ts","../../../node_modules/.pnpm/@tanstack+query-core@4.32.0/node_modules/@tanstack/query-core/src/queryCache.ts","../../../node_modules/.pnpm/@tanstack+query-core@4.32.0/node_modules/@tanstack/query-core/src/mutation.ts","../../../node_modules/.pnpm/@tanstack+query-core@4.32.0/node_modules/@tanstack/query-core/src/mutationCache.ts","../../../node_modules/.pnpm/@tanstack+query-core@4.32.0/node_modules/@tanstack/query-core/src/queryClient.ts"],"sourcesContent":["export interface Logger {\n log: LogFunction\n warn: LogFunction\n error: LogFunction\n}\n\ntype LogFunction = (...args: any[]) => void\n\nexport const defaultLogger: Logger = console\n","import { isServer, isValidTimeout } from './utils'\n\nexport abstract class Removable {\n cacheTime!: number\n private gcTimeout?: ReturnType\n\n destroy(): void {\n this.clearGcTimeout()\n }\n\n protected scheduleGc(): void {\n this.clearGcTimeout()\n\n if (isValidTimeout(this.cacheTime)) {\n this.gcTimeout = setTimeout(() => {\n this.optionalRemove()\n }, this.cacheTime)\n }\n }\n\n protected updateCacheTime(newCacheTime: number | undefined): void {\n // Default to 5 minutes (Infinity for server-side) if no cache time is set\n this.cacheTime = Math.max(\n this.cacheTime || 0,\n newCacheTime ?? (isServer ? Infinity : 5 * 60 * 1000),\n )\n }\n\n protected clearGcTimeout() {\n if (this.gcTimeout) {\n clearTimeout(this.gcTimeout)\n this.gcTimeout = undefined\n }\n }\n\n protected abstract optionalRemove(): void\n}\n","import { getAbortController, noop, replaceData, timeUntilStale } from './utils'\nimport { defaultLogger } from './logger'\nimport { notifyManager } from './notifyManager'\nimport { canFetch, createRetryer, isCancelledError } from './retryer'\nimport { Removable } from './removable'\nimport type {\n CancelOptions,\n FetchStatus,\n InitialDataFunction,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n} from './types'\nimport type { QueryCache } from './queryCache'\nimport type { QueryObserver } from './queryObserver'\nimport type { Logger } from './logger'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n cache: QueryCache\n queryKey: TQueryKey\n queryHash: string\n logger?: Logger\n options?: QueryOptions\n defaultOptions?: QueryOptions\n state?: QueryState\n}\n\nexport interface QueryState {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: any\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise\n fetchOptions?: FetchOptions\n signal?: AbortSignal\n options: QueryOptions\n queryKey: TQueryKey\n state: QueryState\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext,\n ) => void\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: any\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: any\n}\n\ninterface SuccessAction {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: Partial>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions\n initialState: QueryState\n revertState?: QueryState\n state: QueryState\n isFetchingOptimistic?: boolean\n\n private cache: QueryCache\n private logger: Logger\n private promise?: Promise\n private retryer?: Retryer\n private observers: QueryObserver[]\n private defaultOptions?: QueryOptions\n private abortSignalConsumed: boolean\n\n constructor(config: QueryConfig) {\n super()\n\n this.abortSignalConsumed = false\n this.defaultOptions = config.defaultOptions\n this.setOptions(config.options)\n this.observers = []\n this.cache = config.cache\n this.logger = config.logger || defaultLogger\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.initialState = config.state || getDefaultState(this.options)\n this.state = this.initialState\n this.scheduleGc()\n }\n\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n private setOptions(\n options?: QueryOptions,\n ): void {\n this.options = { ...this.defaultOptions, ...options }\n\n this.updateCacheTime(this.options.cacheTime)\n }\n\n protected optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise {\n const promise = this.promise\n this.retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.initialState)\n }\n\n isActive(): boolean {\n return this.observers.some((observer) => observer.options.enabled !== false)\n }\n\n isDisabled(): boolean {\n return this.getObserversCount() > 0 && !this.isActive()\n }\n\n isStale(): boolean {\n return (\n this.state.isInvalidated ||\n !this.state.dataUpdatedAt ||\n this.observers.some((observer) => observer.getCurrentResult().isStale)\n )\n }\n\n isStaleByTime(staleTime = 0): boolean {\n return (\n this.state.isInvalidated ||\n !this.state.dataUpdatedAt ||\n !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n )\n }\n\n onFocus(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus())\n\n if (observer) {\n observer.refetch({ cancelRefetch: false })\n }\n\n // Continue fetch if currently paused\n this.retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect())\n\n if (observer) {\n observer.refetch({ cancelRefetch: false })\n }\n\n // Continue fetch if currently paused\n this.retryer?.continue()\n }\n\n addObserver(observer: QueryObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver): void {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer)\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.retryer) {\n if (this.abortSignalConsumed) {\n this.retryer.cancel({ revert: true })\n } else {\n this.retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.dispatch({ type: 'invalidate' })\n }\n }\n\n fetch(\n options?: QueryOptions,\n fetchOptions?: FetchOptions,\n ): Promise {\n if (this.state.fetchStatus !== 'idle') {\n if (this.state.dataUpdatedAt && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetches\n this.cancel({ silent: true })\n } else if (this.promise) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.retryer?.continueRetry()\n // Return current promise if we are already fetching\n return this.promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn)\n if (observer) {\n this.setOptions(observer.options)\n }\n }\n\n if (!Array.isArray(this.options.queryKey)) {\n if (process.env.NODE_ENV !== 'production') {\n this.logger.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`,\n )\n }\n }\n\n const abortController = getAbortController()\n\n // Create query function context\n const queryFnContext: QueryFunctionContext = {\n queryKey: this.queryKey,\n pageParam: undefined,\n meta: this.meta,\n }\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n if (abortController) {\n this.abortSignalConsumed = true\n return abortController.signal\n }\n return undefined\n },\n })\n }\n\n addSignalProperty(queryFnContext)\n\n // Create fetch function\n const fetchFn = () => {\n if (!this.options.queryFn) {\n return Promise.reject(\n `Missing queryFn for queryKey '${this.options.queryHash}'`,\n )\n }\n this.abortSignalConsumed = false\n return this.options.queryFn(queryFnContext)\n }\n\n // Trigger behavior hook\n const context: FetchContext = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n\n this.options.behavior?.onFetch(context)\n\n // Store state in case the current fetch needs to be reverted\n this.revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n const onError = (error: TError | { silent?: boolean }) => {\n // Optimistically update state if needed\n if (!(isCancelledError(error) && error.silent)) {\n this.dispatch({\n type: 'error',\n error: error as TError,\n })\n }\n\n if (!isCancelledError(error)) {\n // Notify cache callback\n this.cache.config.onError?.(error, this as Query)\n this.cache.config.onSettled?.(\n this.state.data,\n error,\n this as Query,\n )\n\n if (process.env.NODE_ENV !== 'production') {\n this.logger.error(error)\n }\n }\n\n if (!this.isFetchingOptimistic) {\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n this.isFetchingOptimistic = false\n }\n\n // Try to fetch the data\n this.retryer = createRetryer({\n fn: context.fetchFn as () => TData,\n abort: abortController?.abort.bind(abortController),\n onSuccess: (data) => {\n if (typeof data === 'undefined') {\n if (process.env.NODE_ENV !== 'production') {\n this.logger.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n onError(new Error(`${this.queryHash} data is undefined`) as any)\n return\n }\n\n this.setData(data as TData)\n\n // Notify cache callback\n this.cache.config.onSuccess?.(data, this as Query)\n this.cache.config.onSettled?.(\n data,\n this.state.error,\n this as Query,\n )\n\n if (!this.isFetchingOptimistic) {\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n this.isFetchingOptimistic = false\n },\n onError,\n onFail: (failureCount, error) => {\n this.dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n })\n\n this.promise = this.retryer.promise\n\n return this.promise\n }\n\n private dispatch(action: Action): void {\n const reducer = (\n state: QueryState,\n ): QueryState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: action.meta ?? null,\n fetchStatus: canFetch(this.options.networkMode)\n ? 'fetching'\n : 'paused',\n ...(!state.dataUpdatedAt && {\n error: null,\n status: 'loading',\n }),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success',\n ...(!action.manual && {\n fetchStatus: 'idle',\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n case 'error':\n const error = action.error as unknown\n\n if (isCancelledError(error) && error.revert && this.revertState) {\n return { ...this.revertState }\n }\n\n return {\n ...state,\n error: error as TError,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error as TError,\n fetchStatus: 'idle',\n status: 'error',\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate(action)\n })\n\n this.cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions,\n): QueryState {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction)()\n : options.initialData\n\n const hasData = typeof data !== 'undefined'\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? (options.initialDataUpdatedAt as () => number | undefined)()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? 'success' : 'loading',\n fetchStatus: 'idle',\n }\n}\n","import { hashQueryKeyByOptions, matchQuery, parseFilterArgs } from './utils'\nimport { Query } from './query'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport type { QueryFilters } from './utils'\nimport type { Action, QueryState } from './query'\nimport type { NotifyEvent, QueryKey, QueryOptions } from './types'\nimport type { QueryClient } from './queryClient'\nimport type { QueryObserver } from './queryObserver'\n\n// TYPES\n\ninterface QueryCacheConfig {\n onError?: (error: unknown, query: Query) => void\n onSuccess?: (data: unknown, query: Query) => void\n onSettled?: (\n data: unknown | undefined,\n error: unknown | null,\n query: Query,\n ) => void\n}\n\ninterface QueryHashMap {\n [hash: string]: Query\n}\n\ninterface NotifyEventQueryAdded extends NotifyEvent {\n type: 'added'\n query: Query\n}\n\ninterface NotifyEventQueryRemoved extends NotifyEvent {\n type: 'removed'\n query: Query\n}\n\ninterface NotifyEventQueryUpdated extends NotifyEvent {\n type: 'updated'\n query: Query\n action: Action\n}\n\ninterface NotifyEventQueryObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverResultsUpdated extends NotifyEvent {\n type: 'observerResultsUpdated'\n query: Query\n}\n\ninterface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n query: Query\n observer: QueryObserver\n}\n\nexport type QueryCacheNotifyEvent =\n | NotifyEventQueryAdded\n | NotifyEventQueryRemoved\n | NotifyEventQueryUpdated\n | NotifyEventQueryObserverAdded\n | NotifyEventQueryObserverRemoved\n | NotifyEventQueryObserverResultsUpdated\n | NotifyEventQueryObserverOptionsUpdated\n\ntype QueryCacheListener = (event: QueryCacheNotifyEvent) => void\n\n// CLASS\n\nexport class QueryCache extends Subscribable {\n config: QueryCacheConfig\n\n private queries: Query[]\n private queriesMap: QueryHashMap\n\n constructor(config?: QueryCacheConfig) {\n super()\n this.config = config || {}\n this.queries = []\n this.queriesMap = {}\n }\n\n build(\n client: QueryClient,\n options: QueryOptions,\n state?: QueryState,\n ): Query {\n const queryKey = options.queryKey!\n const queryHash =\n options.queryHash ?? hashQueryKeyByOptions(queryKey, options)\n let query = this.get(queryHash)\n\n if (!query) {\n query = new Query({\n cache: this,\n logger: client.getLogger(),\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey),\n })\n this.add(query)\n }\n\n return query\n }\n\n add(query: Query): void {\n if (!this.queriesMap[query.queryHash]) {\n this.queriesMap[query.queryHash] = query\n this.queries.push(query)\n this.notify({\n type: 'added',\n query,\n })\n }\n }\n\n remove(query: Query): void {\n const queryInMap = this.queriesMap[query.queryHash]\n\n if (queryInMap) {\n query.destroy()\n\n this.queries = this.queries.filter((x) => x !== query)\n\n if (queryInMap === query) {\n delete this.queriesMap[query.queryHash]\n }\n\n this.notify({ type: 'removed', query })\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.queries.forEach((query) => {\n this.remove(query)\n })\n })\n }\n\n get<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryHash: string,\n ): Query | undefined {\n return this.queriesMap[queryHash]\n }\n\n getAll(): Query[] {\n return this.queries\n }\n\n find(\n arg1: QueryKey,\n arg2?: QueryFilters,\n ): Query | undefined {\n const [filters] = parseFilterArgs(arg1, arg2)\n\n if (typeof filters.exact === 'undefined') {\n filters.exact = true\n }\n\n return this.queries.find((query) => matchQuery(filters, query))\n }\n\n findAll(queryKey?: QueryKey, filters?: QueryFilters): Query[]\n findAll(filters?: QueryFilters): Query[]\n findAll(arg1?: QueryKey | QueryFilters, arg2?: QueryFilters): Query[]\n findAll(arg1?: QueryKey | QueryFilters, arg2?: QueryFilters): Query[] {\n const [filters] = parseFilterArgs(arg1, arg2)\n return Object.keys(filters).length > 0\n ? this.queries.filter((query) => matchQuery(filters, query))\n : this.queries\n }\n\n notify(event: QueryCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach(({ listener }) => {\n listener(event)\n })\n })\n }\n\n onFocus(): void {\n notifyManager.batch(() => {\n this.queries.forEach((query) => {\n query.onFocus()\n })\n })\n }\n\n onOnline(): void {\n notifyManager.batch(() => {\n this.queries.forEach((query) => {\n query.onOnline()\n })\n })\n }\n}\n","import { defaultLogger } from './logger'\nimport { notifyManager } from './notifyManager'\nimport { Removable } from './removable'\nimport { canFetch, createRetryer } from './retryer'\nimport type { MutationMeta, MutationOptions, MutationStatus } from './types'\nimport type { MutationCache } from './mutationCache'\nimport type { MutationObserver } from './mutationObserver'\nimport type { Logger } from './logger'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface MutationConfig {\n mutationId: number\n mutationCache: MutationCache\n options: MutationOptions\n logger?: Logger\n defaultOptions?: MutationOptions\n state?: MutationState\n meta?: MutationMeta\n}\n\nexport interface MutationState<\n TData = unknown,\n TError = unknown,\n TVariables = void,\n TContext = unknown,\n> {\n context: TContext | undefined\n data: TData | undefined\n error: TError | null\n failureCount: number\n failureReason: TError | null\n isPaused: boolean\n status: MutationStatus\n variables: TVariables | undefined\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError | null\n}\n\ninterface LoadingAction {\n type: 'loading'\n variables?: TVariables\n context?: TContext\n}\n\ninterface SuccessAction {\n type: 'success'\n data: TData\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: MutationState\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | LoadingAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\n// CLASS\n\nexport class Mutation<\n TData = unknown,\n TError = unknown,\n TVariables = void,\n TContext = unknown,\n> extends Removable {\n state: MutationState\n options!: MutationOptions\n mutationId: number\n\n private observers: MutationObserver[]\n private defaultOptions?: MutationOptions\n private mutationCache: MutationCache\n private logger: Logger\n private retryer?: Retryer\n\n constructor(config: MutationConfig) {\n super()\n\n this.defaultOptions = config.defaultOptions\n this.mutationId = config.mutationId\n this.mutationCache = config.mutationCache\n this.logger = config.logger || defaultLogger\n this.observers = []\n this.state = config.state || getDefaultState()\n\n this.setOptions(config.options)\n this.scheduleGc()\n }\n\n setOptions(\n options?: MutationOptions,\n ): void {\n this.options = { ...this.defaultOptions, ...options }\n\n this.updateCacheTime(this.options.cacheTime)\n }\n\n get meta(): MutationMeta | undefined {\n return this.options.meta\n }\n\n setState(state: MutationState): void {\n this.dispatch({ type: 'setState', state })\n }\n\n addObserver(observer: MutationObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the mutation from being garbage collected\n this.clearGcTimeout()\n\n this.mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer,\n })\n }\n }\n\n removeObserver(observer: MutationObserver): void {\n this.observers = this.observers.filter((x) => x !== observer)\n\n this.scheduleGc()\n\n this.mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer,\n })\n }\n\n protected optionalRemove() {\n if (!this.observers.length) {\n if (this.state.status === 'loading') {\n this.scheduleGc()\n } else {\n this.mutationCache.remove(this)\n }\n }\n }\n\n continue(): Promise {\n return this.retryer?.continue() ?? this.execute()\n }\n\n async execute(): Promise {\n const executeMutation = () => {\n this.retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject('No mutationFn found')\n }\n return this.options.mutationFn(this.state.variables!)\n },\n onFail: (failureCount, error) => {\n this.dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.dispatch({ type: 'continue' })\n },\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n })\n\n return this.retryer.promise\n }\n\n const restored = this.state.status === 'loading'\n try {\n if (!restored) {\n this.dispatch({ type: 'loading', variables: this.options.variables! })\n // Notify cache callback\n await this.mutationCache.config.onMutate?.(\n this.state.variables,\n this as Mutation,\n )\n const context = await this.options.onMutate?.(this.state.variables!)\n if (context !== this.state.context) {\n this.dispatch({\n type: 'loading',\n context,\n variables: this.state.variables,\n })\n }\n }\n const data = await executeMutation()\n\n // Notify cache callback\n await this.mutationCache.config.onSuccess?.(\n data,\n this.state.variables,\n this.state.context,\n this as Mutation,\n )\n\n await this.options.onSuccess?.(\n data,\n this.state.variables!,\n this.state.context!,\n )\n\n // Notify cache callback\n await this.mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this as Mutation,\n )\n\n await this.options.onSettled?.(\n data,\n null,\n this.state.variables!,\n this.state.context,\n )\n\n this.dispatch({ type: 'success', data })\n return data\n } catch (error) {\n try {\n // Notify cache callback\n await this.mutationCache.config.onError?.(\n error,\n this.state.variables,\n this.state.context,\n this as Mutation,\n )\n\n if (process.env.NODE_ENV !== 'production') {\n this.logger.error(error)\n }\n\n await this.options.onError?.(\n error as TError,\n this.state.variables!,\n this.state.context,\n )\n\n // Notify cache callback\n await this.mutationCache.config.onSettled?.(\n undefined,\n error,\n this.state.variables,\n this.state.context,\n this as Mutation,\n )\n\n await this.options.onSettled?.(\n undefined,\n error as TError,\n this.state.variables!,\n this.state.context,\n )\n throw error\n } finally {\n this.dispatch({ type: 'error', error: error as TError })\n }\n }\n }\n\n private dispatch(action: Action): void {\n const reducer = (\n state: MutationState,\n ): MutationState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n isPaused: true,\n }\n case 'continue':\n return {\n ...state,\n isPaused: false,\n }\n case 'loading':\n return {\n ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: !canFetch(this.options.networkMode),\n status: 'loading',\n variables: action.variables,\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false,\n }\n case 'error':\n return {\n ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error',\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onMutationUpdate(action)\n })\n this.mutationCache.notify({\n mutation: this,\n type: 'updated',\n action,\n })\n })\n }\n}\n\nexport function getDefaultState<\n TData,\n TError,\n TVariables,\n TContext,\n>(): MutationState {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined,\n }\n}\n","import { notifyManager } from './notifyManager'\nimport { Mutation } from './mutation'\nimport { matchMutation, noop } from './utils'\nimport { Subscribable } from './subscribable'\nimport type { MutationObserver } from './mutationObserver'\nimport type { MutationOptions, NotifyEvent } from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Action, MutationState } from './mutation'\nimport type { MutationFilters } from './utils'\n\n// TYPES\n\ninterface MutationCacheConfig {\n onError?: (\n error: unknown,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onSuccess?: (\n data: unknown,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onMutate?: (\n variables: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n onSettled?: (\n data: unknown | undefined,\n error: unknown | null,\n variables: unknown,\n context: unknown,\n mutation: Mutation,\n ) => Promise | unknown\n}\n\ninterface NotifyEventMutationAdded extends NotifyEvent {\n type: 'added'\n mutation: Mutation\n}\ninterface NotifyEventMutationRemoved extends NotifyEvent {\n type: 'removed'\n mutation: Mutation\n}\n\ninterface NotifyEventMutationObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n mutation?: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationUpdated extends NotifyEvent {\n type: 'updated'\n mutation: Mutation\n action: Action\n}\n\ntype MutationCacheNotifyEvent =\n | NotifyEventMutationAdded\n | NotifyEventMutationRemoved\n | NotifyEventMutationObserverAdded\n | NotifyEventMutationObserverRemoved\n | NotifyEventMutationObserverOptionsUpdated\n | NotifyEventMutationUpdated\n\ntype MutationCacheListener = (event: MutationCacheNotifyEvent) => void\n\n// CLASS\n\nexport class MutationCache extends Subscribable {\n config: MutationCacheConfig\n\n private mutations: Mutation[]\n private mutationId: number\n private resuming: Promise | undefined\n\n constructor(config?: MutationCacheConfig) {\n super()\n this.config = config || {}\n this.mutations = []\n this.mutationId = 0\n }\n\n build(\n client: QueryClient,\n options: MutationOptions,\n state?: MutationState,\n ): Mutation {\n const mutation = new Mutation({\n mutationCache: this,\n logger: client.getLogger(),\n mutationId: ++this.mutationId,\n options: client.defaultMutationOptions(options),\n state,\n defaultOptions: options.mutationKey\n ? client.getMutationDefaults(options.mutationKey)\n : undefined,\n })\n\n this.add(mutation)\n\n return mutation\n }\n\n add(mutation: Mutation): void {\n this.mutations.push(mutation)\n this.notify({ type: 'added', mutation })\n }\n\n remove(mutation: Mutation): void {\n this.mutations = this.mutations.filter((x) => x !== mutation)\n this.notify({ type: 'removed', mutation })\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.mutations.forEach((mutation) => {\n this.remove(mutation)\n })\n })\n }\n\n getAll(): Mutation[] {\n return this.mutations\n }\n\n find(\n filters: MutationFilters,\n ): Mutation | undefined {\n if (typeof filters.exact === 'undefined') {\n filters.exact = true\n }\n\n return this.mutations.find((mutation) => matchMutation(filters, mutation))\n }\n\n findAll(filters: MutationFilters): Mutation[] {\n return this.mutations.filter((mutation) => matchMutation(filters, mutation))\n }\n\n notify(event: MutationCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach(({ listener }) => {\n listener(event)\n })\n })\n }\n\n resumePausedMutations(): Promise {\n this.resuming = (this.resuming ?? Promise.resolve())\n .then(() => {\n const pausedMutations = this.mutations.filter((x) => x.state.isPaused)\n return notifyManager.batch(() =>\n pausedMutations.reduce(\n (promise, mutation) =>\n promise.then(() => mutation.continue().catch(noop)),\n Promise.resolve() as Promise,\n ),\n )\n })\n .then(() => {\n this.resuming = undefined\n })\n\n return this.resuming\n }\n}\n","import {\n functionalUpdate,\n hashQueryKey,\n hashQueryKeyByOptions,\n noop,\n parseFilterArgs,\n parseQueryArgs,\n partialMatchKey,\n} from './utils'\nimport { QueryCache } from './queryCache'\nimport { MutationCache } from './mutationCache'\nimport { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { notifyManager } from './notifyManager'\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior'\nimport { defaultLogger } from './logger'\nimport type { CancelOptions, DefaultedQueryObserverOptions } from './types'\nimport type { Logger } from './logger'\nimport type { QueryState } from './query'\nimport type {\n DefaultOptions,\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n InfiniteData,\n InvalidateOptions,\n InvalidateQueryFilters,\n MutationKey,\n MutationObserverOptions,\n MutationOptions,\n QueryClientConfig,\n QueryFunction,\n QueryKey,\n QueryObserverOptions,\n QueryOptions,\n RefetchOptions,\n RefetchQueryFilters,\n ResetOptions,\n ResetQueryFilters,\n SetDataOptions,\n WithRequired,\n} from './types'\nimport type { MutationFilters, QueryFilters, Updater } from './utils'\n\n// TYPES\n\ninterface QueryDefaults {\n queryKey: QueryKey\n defaultOptions: QueryOptions\n}\n\ninterface MutationDefaults {\n mutationKey: MutationKey\n defaultOptions: MutationOptions\n}\n\n// CLASS\n\nexport class QueryClient {\n private queryCache: QueryCache\n private mutationCache: MutationCache\n private logger: Logger\n private defaultOptions: DefaultOptions\n private queryDefaults: QueryDefaults[]\n private mutationDefaults: MutationDefaults[]\n private mountCount: number\n private unsubscribeFocus?: () => void\n private unsubscribeOnline?: () => void\n\n constructor(config: QueryClientConfig = {}) {\n this.queryCache = config.queryCache || new QueryCache()\n this.mutationCache = config.mutationCache || new MutationCache()\n this.logger = config.logger || defaultLogger\n this.defaultOptions = config.defaultOptions || {}\n this.queryDefaults = []\n this.mutationDefaults = []\n this.mountCount = 0\n\n if (process.env.NODE_ENV !== 'production' && config.logger) {\n this.logger.error(\n `Passing a custom logger has been deprecated and will be removed in the next major version.`,\n )\n }\n }\n\n mount(): void {\n this.mountCount++\n if (this.mountCount !== 1) return\n\n this.unsubscribeFocus = focusManager.subscribe(() => {\n if (focusManager.isFocused()) {\n this.resumePausedMutations()\n this.queryCache.onFocus()\n }\n })\n this.unsubscribeOnline = onlineManager.subscribe(() => {\n if (onlineManager.isOnline()) {\n this.resumePausedMutations()\n this.queryCache.onOnline()\n }\n })\n }\n\n unmount(): void {\n this.mountCount--\n if (this.mountCount !== 0) return\n\n this.unsubscribeFocus?.()\n this.unsubscribeFocus = undefined\n\n this.unsubscribeOnline?.()\n this.unsubscribeOnline = undefined\n }\n\n isFetching(filters?: QueryFilters): number\n isFetching(queryKey?: QueryKey, filters?: QueryFilters): number\n isFetching(arg1?: QueryKey | QueryFilters, arg2?: QueryFilters): number {\n const [filters] = parseFilterArgs(arg1, arg2)\n filters.fetchStatus = 'fetching'\n return this.queryCache.findAll(filters).length\n }\n\n isMutating(filters?: MutationFilters): number {\n return this.mutationCache.findAll({ ...filters, fetching: true }).length\n }\n\n getQueryData(\n queryKey: QueryKey,\n filters?: QueryFilters,\n ): TQueryFnData | undefined {\n return this.queryCache.find(queryKey, filters)?.state.data\n }\n\n ensureQueryData<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: WithRequired<\n FetchQueryOptions,\n 'queryKey'\n >,\n ): Promise\n ensureQueryData<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryKey: TQueryKey,\n options?: Omit<\n FetchQueryOptions,\n 'queryKey'\n >,\n ): Promise\n ensureQueryData<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryKey: TQueryKey,\n queryFn: QueryFunction,\n options?: Omit<\n FetchQueryOptions,\n 'queryKey' | 'queryFn'\n >,\n ): Promise\n ensureQueryData<\n TQueryFnData,\n TError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n arg1:\n | TQueryKey\n | WithRequired<\n FetchQueryOptions,\n 'queryKey'\n >,\n arg2?:\n | QueryFunction\n | FetchQueryOptions,\n arg3?: FetchQueryOptions,\n ): Promise {\n const parsedOptions = parseQueryArgs(arg1, arg2, arg3)\n const cachedData = this.getQueryData(parsedOptions.queryKey!)\n\n return cachedData\n ? Promise.resolve(cachedData)\n : this.fetchQuery(parsedOptions)\n }\n\n getQueriesData(\n queryKey: QueryKey,\n ): [QueryKey, TQueryFnData | undefined][]\n getQueriesData(\n filters: QueryFilters,\n ): [QueryKey, TQueryFnData | undefined][]\n getQueriesData(\n queryKeyOrFilters: QueryKey | QueryFilters,\n ): [QueryKey, TQueryFnData | undefined][] {\n return this.getQueryCache()\n .findAll(queryKeyOrFilters)\n .map(({ queryKey, state }) => {\n const data = state.data as TQueryFnData | undefined\n return [queryKey, data]\n })\n }\n\n setQueryData(\n queryKey: QueryKey,\n updater: Updater,\n options?: SetDataOptions,\n ): TQueryFnData | undefined {\n const query = this.queryCache.find(queryKey)\n const prevData = query?.state.data\n const data = functionalUpdate(updater, prevData)\n\n if (typeof data === 'undefined') {\n return undefined\n }\n\n const parsedOptions = parseQueryArgs(queryKey)\n const defaultedOptions = this.defaultQueryOptions(parsedOptions)\n return this.queryCache\n .build(this, defaultedOptions)\n .setData(data, { ...options, manual: true })\n }\n\n setQueriesData(\n queryKey: QueryKey,\n updater: Updater,\n options?: SetDataOptions,\n ): [QueryKey, TQueryFnData | undefined][]\n\n setQueriesData(\n filters: QueryFilters,\n updater: Updater,\n options?: SetDataOptions,\n ): [QueryKey, TQueryFnData | undefined][]\n\n setQueriesData(\n queryKeyOrFilters: QueryKey | QueryFilters,\n updater: Updater,\n options?: SetDataOptions,\n ): [QueryKey, TQueryFnData | undefined][] {\n return notifyManager.batch(() =>\n this.getQueryCache()\n .findAll(queryKeyOrFilters)\n .map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options),\n ]),\n )\n }\n\n getQueryState(\n queryKey: QueryKey,\n filters?: QueryFilters,\n ): QueryState | undefined {\n return this.queryCache.find(queryKey, filters)?.state\n }\n\n removeQueries(filters?: QueryFilters): void\n removeQueries(queryKey?: QueryKey, filters?: QueryFilters): void\n removeQueries(arg1?: QueryKey | QueryFilters, arg2?: QueryFilters): void {\n const [filters] = parseFilterArgs(arg1, arg2)\n const queryCache = this.queryCache\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query)\n })\n })\n }\n\n resetQueries(\n filters?: ResetQueryFilters,\n options?: ResetOptions,\n ): Promise\n resetQueries(\n queryKey?: QueryKey,\n filters?: ResetQueryFilters,\n options?: ResetOptions,\n ): Promise\n resetQueries(\n arg1?: QueryKey | ResetQueryFilters,\n arg2?: ResetQueryFilters | ResetOptions,\n arg3?: ResetOptions,\n ): Promise {\n const [filters, options] = parseFilterArgs(arg1, arg2, arg3)\n const queryCache = this.queryCache\n\n const refetchFilters: RefetchQueryFilters = {\n type: 'active',\n ...filters,\n }\n\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset()\n })\n return this.refetchQueries(refetchFilters, options)\n })\n }\n\n cancelQueries(filters?: QueryFilters, options?: CancelOptions): Promise\n cancelQueries(\n queryKey?: QueryKey,\n filters?: QueryFilters,\n options?: CancelOptions,\n ): Promise\n cancelQueries(\n arg1?: QueryKey | QueryFilters,\n arg2?: QueryFilters | CancelOptions,\n arg3?: CancelOptions,\n ): Promise {\n const [filters, cancelOptions = {}] = parseFilterArgs(arg1, arg2, arg3)\n\n if (typeof cancelOptions.revert === 'undefined') {\n cancelOptions.revert = true\n }\n\n const promises = notifyManager.batch(() =>\n this.queryCache\n .findAll(filters)\n .map((query) => query.cancel(cancelOptions)),\n )\n\n return Promise.all(promises).then(noop).catch(noop)\n }\n\n invalidateQueries(\n filters?: InvalidateQueryFilters,\n options?: InvalidateOptions,\n ): Promise\n invalidateQueries(\n queryKey?: QueryKey,\n filters?: InvalidateQueryFilters,\n options?: InvalidateOptions,\n ): Promise\n invalidateQueries(\n arg1?: QueryKey | InvalidateQueryFilters,\n arg2?: InvalidateQueryFilters | InvalidateOptions,\n arg3?: InvalidateOptions,\n ): Promise {\n const [filters, options] = parseFilterArgs(arg1, arg2, arg3)\n\n return notifyManager.batch(() => {\n this.queryCache.findAll(filters).forEach((query) => {\n query.invalidate()\n })\n\n if (filters.refetchType === 'none') {\n return Promise.resolve()\n }\n const refetchFilters: RefetchQueryFilters = {\n ...filters,\n type: filters.refetchType ?? filters.type ?? 'active',\n }\n return this.refetchQueries(refetchFilters, options)\n })\n }\n\n refetchQueries(\n filters?: RefetchQueryFilters,\n options?: RefetchOptions,\n ): Promise\n refetchQueries(\n queryKey?: QueryKey,\n filters?: RefetchQueryFilters,\n options?: RefetchOptions,\n ): Promise\n refetchQueries(\n arg1?: QueryKey | RefetchQueryFilters,\n arg2?: RefetchQueryFilters | RefetchOptions,\n arg3?: RefetchOptions,\n ): Promise {\n const [filters, options] = parseFilterArgs(arg1, arg2, arg3)\n\n const promises = notifyManager.batch(() =>\n this.queryCache\n .findAll(filters)\n .filter((query) => !query.isDisabled())\n .map((query) =>\n query.fetch(undefined, {\n ...options,\n cancelRefetch: options?.cancelRefetch ?? true,\n meta: { refetchPage: filters.refetchPage },\n }),\n ),\n )\n\n let promise = Promise.all(promises).then(noop)\n\n if (!options?.throwOnError) {\n promise = promise.catch(noop)\n }\n\n return promise\n }\n\n fetchQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise\n fetchQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryKey: TQueryKey,\n options?: FetchQueryOptions,\n ): Promise\n fetchQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryKey: TQueryKey,\n queryFn: QueryFunction,\n options?: FetchQueryOptions,\n ): Promise\n fetchQuery<\n TQueryFnData,\n TError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n arg1: TQueryKey | FetchQueryOptions,\n arg2?:\n | QueryFunction\n | FetchQueryOptions,\n arg3?: FetchQueryOptions,\n ): Promise {\n const parsedOptions = parseQueryArgs(arg1, arg2, arg3)\n const defaultedOptions = this.defaultQueryOptions(parsedOptions)\n\n // https://github.com/tannerlinsley/react-query/issues/652\n if (typeof defaultedOptions.retry === 'undefined') {\n defaultedOptions.retry = false\n }\n\n const query = this.queryCache.build(this, defaultedOptions)\n\n return query.isStaleByTime(defaultedOptions.staleTime)\n ? query.fetch(defaultedOptions)\n : Promise.resolve(query.state.data as TData)\n }\n\n prefetchQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise\n prefetchQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryKey: TQueryKey,\n options?: FetchQueryOptions,\n ): Promise\n prefetchQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryKey: TQueryKey,\n queryFn: QueryFunction,\n options?: FetchQueryOptions,\n ): Promise\n prefetchQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n arg1: TQueryKey | FetchQueryOptions,\n arg2?:\n | QueryFunction\n | FetchQueryOptions,\n arg3?: FetchQueryOptions,\n ): Promise {\n return this.fetchQuery(arg1 as any, arg2 as any, arg3)\n .then(noop)\n .catch(noop)\n }\n\n fetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchInfiniteQueryOptions,\n ): Promise>\n fetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryKey: TQueryKey,\n options?: FetchInfiniteQueryOptions,\n ): Promise>\n fetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryKey: TQueryKey,\n queryFn: QueryFunction,\n options?: FetchInfiniteQueryOptions,\n ): Promise>\n fetchInfiniteQuery<\n TQueryFnData,\n TError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n arg1:\n | TQueryKey\n | FetchInfiniteQueryOptions,\n arg2?:\n | QueryFunction\n | FetchInfiniteQueryOptions,\n arg3?: FetchInfiniteQueryOptions,\n ): Promise> {\n const parsedOptions = parseQueryArgs(arg1, arg2, arg3)\n parsedOptions.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData\n >()\n return this.fetchQuery(parsedOptions)\n }\n\n prefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchInfiniteQueryOptions,\n ): Promise\n prefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryKey: TQueryKey,\n options?: FetchInfiniteQueryOptions,\n ): Promise\n prefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryKey: TQueryKey,\n queryFn: QueryFunction,\n options?: FetchInfiniteQueryOptions,\n ): Promise\n prefetchInfiniteQuery<\n TQueryFnData,\n TError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n arg1:\n | TQueryKey\n | FetchInfiniteQueryOptions,\n arg2?:\n | QueryFunction\n | FetchInfiniteQueryOptions,\n arg3?: FetchInfiniteQueryOptions,\n ): Promise {\n return this.fetchInfiniteQuery(arg1 as any, arg2 as any, arg3)\n .then(noop)\n .catch(noop)\n }\n\n resumePausedMutations(): Promise {\n return this.mutationCache.resumePausedMutations()\n }\n\n getQueryCache(): QueryCache {\n return this.queryCache\n }\n\n getMutationCache(): MutationCache {\n return this.mutationCache\n }\n\n getLogger(): Logger {\n return this.logger\n }\n\n getDefaultOptions(): DefaultOptions {\n return this.defaultOptions\n }\n\n setDefaultOptions(options: DefaultOptions): void {\n this.defaultOptions = options\n }\n\n setQueryDefaults(\n queryKey: QueryKey,\n options: QueryObserverOptions,\n ): void {\n const result = this.queryDefaults.find(\n (x) => hashQueryKey(queryKey) === hashQueryKey(x.queryKey),\n )\n if (result) {\n result.defaultOptions = options\n } else {\n this.queryDefaults.push({ queryKey, defaultOptions: options })\n }\n }\n\n getQueryDefaults(\n queryKey?: QueryKey,\n ): QueryObserverOptions | undefined {\n if (!queryKey) {\n return undefined\n }\n\n // Get the first matching defaults\n const firstMatchingDefaults = this.queryDefaults.find((x) =>\n partialMatchKey(queryKey, x.queryKey),\n )\n\n // Additional checks and error in dev mode\n if (process.env.NODE_ENV !== 'production') {\n // Retrieve all matching defaults for the given key\n const matchingDefaults = this.queryDefaults.filter((x) =>\n partialMatchKey(queryKey, x.queryKey),\n )\n // It is ok not having defaults, but it is error prone to have more than 1 default for a given key\n if (matchingDefaults.length > 1) {\n this.logger.error(\n `[QueryClient] Several query defaults match with key '${JSON.stringify(\n queryKey,\n )}'. The first matching query defaults are used. Please check how query defaults are registered. Order does matter here. cf. https://react-query.tanstack.com/reference/QueryClient#queryclientsetquerydefaults.`,\n )\n }\n }\n\n return firstMatchingDefaults?.defaultOptions\n }\n\n setMutationDefaults(\n mutationKey: MutationKey,\n options: MutationObserverOptions,\n ): void {\n const result = this.mutationDefaults.find(\n (x) => hashQueryKey(mutationKey) === hashQueryKey(x.mutationKey),\n )\n if (result) {\n result.defaultOptions = options\n } else {\n this.mutationDefaults.push({ mutationKey, defaultOptions: options })\n }\n }\n\n getMutationDefaults(\n mutationKey?: MutationKey,\n ): MutationObserverOptions | undefined {\n if (!mutationKey) {\n return undefined\n }\n\n // Get the first matching defaults\n const firstMatchingDefaults = this.mutationDefaults.find((x) =>\n partialMatchKey(mutationKey, x.mutationKey),\n )\n\n // Additional checks and error in dev mode\n if (process.env.NODE_ENV !== 'production') {\n // Retrieve all matching defaults for the given key\n const matchingDefaults = this.mutationDefaults.filter((x) =>\n partialMatchKey(mutationKey, x.mutationKey),\n )\n // It is ok not having defaults, but it is error prone to have more than 1 default for a given key\n if (matchingDefaults.length > 1) {\n this.logger.error(\n `[QueryClient] Several mutation defaults match with key '${JSON.stringify(\n mutationKey,\n )}'. The first matching mutation defaults are used. Please check how mutation defaults are registered. Order does matter here. cf. https://react-query.tanstack.com/reference/QueryClient#queryclientsetmutationdefaults.`,\n )\n }\n }\n\n return firstMatchingDefaults?.defaultOptions\n }\n\n defaultQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n >(\n options?:\n | QueryObserverOptions\n | DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n > {\n if (options?._defaulted) {\n return options as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n const defaultedOptions = {\n ...this.defaultOptions.queries,\n ...this.getQueryDefaults(options?.queryKey),\n ...options,\n _defaulted: true,\n }\n\n if (!defaultedOptions.queryHash && defaultedOptions.queryKey) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions,\n )\n }\n\n // dependent default values\n if (typeof defaultedOptions.refetchOnReconnect === 'undefined') {\n defaultedOptions.refetchOnReconnect =\n defaultedOptions.networkMode !== 'always'\n }\n if (typeof defaultedOptions.useErrorBoundary === 'undefined') {\n defaultedOptions.useErrorBoundary = !!defaultedOptions.suspense\n }\n\n return defaultedOptions as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n defaultMutationOptions>(\n options?: T,\n ): T {\n if (options?._defaulted) {\n return options\n }\n return {\n ...this.defaultOptions.mutations,\n ...this.getMutationDefaults(options?.mutationKey),\n ...options,\n _defaulted: true,\n } as T\n }\n\n clear(): void {\n this.queryCache.clear()\n this.mutationCache.clear()\n }\n}\n"],"names":["defaultLogger","console","Removable","destroy","this","clearGcTimeout","scheduleGc","isValidTimeout","cacheTime","gcTimeout","setTimeout","optionalRemove","updateCacheTime","newCacheTime","Math","max","isServer","Infinity","clearTimeout","undefined","Query","constructor","config","abortSignalConsumed","defaultOptions","setOptions","options","observers","cache","logger","queryKey","queryHash","initialState","state","data","initialData","hasData","initialDataUpdatedAt","dataUpdateCount","dataUpdatedAt","Date","now","error","errorUpdateCount","errorUpdatedAt","fetchFailureCount","fetchFailureReason","fetchMeta","isInvalidated","status","fetchStatus","getDefaultState","meta","length","remove","setData","newData","replaceData","dispatch","type","updatedAt","manual","setState","setStateOptions","cancel","promise","retryer","then","noop","catch","Promise","resolve","silent","reset","isActive","some","observer","enabled","isDisabled","getObserversCount","isStale","getCurrentResult","isStaleByTime","staleTime","timeUntilStale","onFocus","find","x","shouldFetchOnWindowFocus","refetch","cancelRefetch","continue","onOnline","shouldFetchOnReconnect","addObserver","includes","push","notify","query","removeObserver","filter","revert","cancelRetry","invalidate","fetch","fetchOptions","continueRetry","queryFn","Array","isArray","abortController","getAbortController","queryFnContext","pageParam","addSignalProperty","object","Object","defineProperty","enumerable","get","signal","context","fetchFn","reject","behavior","onFetch","revertState","_context$fetchOptions","_context$fetchOptions2","onError","isCancelledError","onSettled","isFetchingOptimistic","createRetryer","fn","abort","bind","onSuccess","Error","onFail","failureCount","onPause","onContinue","retry","retryDelay","networkMode","action","canFetch","reducer","notifyManager","batch","forEach","onQueryUpdate","QueryCache","queries","queriesMap","build","client","hashQueryKeyByOptions","getLogger","defaultQueryOptions","getQueryDefaults","add","queryInMap","clear","getAll","arg1","arg2","parseFilterArgs","filters","exact","matchQuery","findAll","keys","event","listeners","listener","Subscribable","Mutation","mutationId","mutationCache","failureReason","isPaused","variables","mutation","execute","executeMutation","mutationFn","restored","onMutate","_this$mutationCache$c","_this$mutationCache$c3","_this$mutationCache$c5","_this$mutationCache$c7","_this$mutationCache$c9","onMutationUpdate","MutationCache","mutations","defaultMutationOptions","mutationKey","getMutationDefaults","matchMutation","resumePausedMutations","resuming","pausedMutations","reduce","QueryClient","queryCache","queryDefaults","mutationDefaults","mountCount","mount","unsubscribeFocus","focusManager","subscribe","isFocused","unsubscribeOnline","onlineManager","isOnline","unmount","isFetching","isMutating","fetching","getQueryData","_this$queryCache$find","ensureQueryData","arg3","parsedOptions","parseQueryArgs","cachedData","fetchQuery","getQueriesData","queryKeyOrFilters","getQueryCache","map","setQueryData","updater","prevData","functionalUpdate","defaultedOptions","setQueriesData","getQueryState","removeQueries","resetQueries","refetchFilters","refetchQueries","cancelQueries","cancelOptions","promises","all","invalidateQueries","refetchType","refetchPage","throwOnError","prefetchQuery","fetchInfiniteQuery","infiniteQueryBehavior","prefetchInfiniteQuery","getMutationCache","getDefaultOptions","setDefaultOptions","setQueryDefaults","result","hashQueryKey","firstMatchingDefaults","partialMatchKey","setMutationDefaults","_defaulted","refetchOnReconnect","useErrorBoundary","suspense"],"sourceRoot":""}