PluginProbe
Elementor Website Builder – more than just a page builder / 3.17.2
Elementor Website Builder – more than just a page builder v3.17.2
4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 All 455 releases
← All changes | assets/js/packages/query/query.js +4117 -3080 4.3.0 → 3.17.2 View file →
@@ -1,3116 +1,4153 @@
1 -(function(react) {
1 +/******/ (function() { // webpackBootstrap
2 +/******/ "use strict";
3 +/******/ var __webpack_modules__ = ({
2 4
3 -//#region \0rolldown/runtime.js
4 - var __create = Object.create;
5 - var __defProp = Object.defineProperty;
6 - var __name = (target, value) => __defProp(target, "name", {
7 - value,
8 - configurable: true
9 - });
10 - var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11 - var __getOwnPropNames = Object.getOwnPropertyNames;
12 - var __getProtoOf = Object.getPrototypeOf;
13 - var __hasOwnProp = Object.prototype.hasOwnProperty;
14 - var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
15 - var __exportAll = (all, no_symbols) => {
16 - let target = {};
17 - for (var name in all) {
18 - __defProp(target, name, {
19 - get: all[name],
20 - enumerable: true
21 - });
22 - }
23 - if (!no_symbols) {
24 - __defProp(target, Symbol.toStringTag, { value: "Module" });
25 - }
26 - return target;
27 - };
28 - var __copyProps = (to, from, except, desc) => {
29 - if (from && typeof from === "object" || typeof from === "function") {
30 - for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
31 - key = keys[i];
32 - if (!__hasOwnProp.call(to, key) && key !== except) {
33 - __defProp(to, key, {
34 - get: ((k) => from[k]).bind(null, key),
35 - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
36 - });
37 - }
38 - }
39 - }
40 - return to;
41 - };
42 - var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
43 - value: mod,
44 - enumerable: true
45 - }) : target, mod));
5 +/***/ "./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js":
6 +/*!**********************************************************************************************!*\
7 + !*** ./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js ***!
8 + \**********************************************************************************************/
9 +/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
46 10
47 -//#endregion
48 -react = __toESM(react, 1);
11 +/**
12 + * @license React
13 + * use-sync-external-store-shim.development.js
14 + *
15 + * Copyright (c) Facebook, Inc. and its affiliates.
16 + *
17 + * This source code is licensed under the MIT license found in the
18 + * LICENSE file in the root directory of this source tree.
19 + */
49 20
50 -//#region node_modules/@tanstack/query-core/build/modern/subscribable.js
51 - var Subscribable = class {
52 - constructor() {
53 - this.listeners = /* @__PURE__ */ new Set();
54 - this.subscribe = this.subscribe.bind(this);
55 - }
56 - subscribe(listener) {
57 - this.listeners.add(listener);
58 - this.onSubscribe();
59 - return () => {
60 - this.listeners.delete(listener);
61 - this.onUnsubscribe();
62 - };
63 - }
64 - hasListeners() {
65 - return this.listeners.size > 0;
66 - }
67 - onSubscribe() {}
68 - onUnsubscribe() {}
69 - };
70 21
71 -//#endregion
72 -//#region node_modules/@tanstack/query-core/build/modern/timeoutManager.js
73 - var defaultTimeoutProvider = {
74 - setTimeout: (callback, delay) => setTimeout(callback, delay),
75 - clearTimeout: (timeoutId) => clearTimeout(timeoutId),
76 - setInterval: (callback, delay) => setInterval(callback, delay),
77 - clearInterval: (intervalId) => clearInterval(intervalId)
78 - };
79 - var TimeoutManager = class {
80 - #provider = defaultTimeoutProvider;
81 - #providerCalled = false;
82 - setTimeoutProvider(provider) {
83 - if (this.#providerCalled && provider !== this.#provider) console.error(`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, {
84 - previous: this.#provider,
85 - provider
86 - });
87 - this.#provider = provider;
88 - this.#providerCalled = false;
89 - }
90 - setTimeout(callback, delay) {
91 - this.#providerCalled = true;
92 - return this.#provider.setTimeout(callback, delay);
93 - }
94 - clearTimeout(timeoutId) {
95 - this.#provider.clearTimeout(timeoutId);
96 - }
97 - setInterval(callback, delay) {
98 - this.#providerCalled = true;
99 - return this.#provider.setInterval(callback, delay);
100 - }
101 - clearInterval(intervalId) {
102 - this.#provider.clearInterval(intervalId);
103 - }
104 - };
105 - var timeoutManager = new TimeoutManager();
106 - function systemSetTimeoutZero(callback) {
107 - setTimeout(callback, 0);
108 - }
109 22
110 -//#endregion
111 -//#region node_modules/@tanstack/query-core/build/modern/utils.js
112 - var isServer = typeof window === "undefined" || "Deno" in globalThis;
113 - function noop() {}
114 - function functionalUpdate(updater, input) {
115 - return typeof updater === "function" ? updater(input) : updater;
116 - }
117 - function isValidTimeout(value) {
118 - return typeof value === "number" && value >= 0 && value !== Infinity;
119 - }
120 - function timeUntilStale(updatedAt, staleTime) {
121 - return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);
122 - }
123 - function resolveStaleTime(staleTime, query) {
124 - return typeof staleTime === "function" ? staleTime(query) : staleTime;
125 - }
126 - function resolveEnabled(enabled, query) {
127 - return typeof enabled === "function" ? enabled(query) : enabled;
128 - }
129 - function matchQuery(filters, query) {
130 - const { type = "all", exact, fetchStatus, predicate, queryKey, stale } = filters;
131 - if (queryKey) {
132 - if (exact) {
133 - if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) return false;
134 - } else if (!partialMatchKey(query.queryKey, queryKey)) return false;
135 - }
136 - if (type !== "all") {
137 - const isActive = query.isActive();
138 - if (type === "active" && !isActive) return false;
139 - if (type === "inactive" && isActive) return false;
140 - }
141 - if (typeof stale === "boolean" && query.isStale() !== stale) return false;
142 - if (fetchStatus && fetchStatus !== query.state.fetchStatus) return false;
143 - if (predicate && !predicate(query)) return false;
144 - return true;
145 - }
146 - function matchMutation(filters, mutation) {
147 - const { exact, status, predicate, mutationKey } = filters;
148 - if (mutationKey) {
149 - if (!mutation.options.mutationKey) return false;
150 - if (exact) {
151 - if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) return false;
152 - } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) return false;
153 - }
154 - if (status && mutation.state.status !== status) return false;
155 - if (predicate && !predicate(mutation)) return false;
156 - return true;
157 - }
158 - function hashQueryKeyByOptions(queryKey, options) {
159 - return (options?.queryKeyHashFn || hashKey)(queryKey);
160 - }
161 - function hashKey(queryKey) {
162 - return JSON.stringify(queryKey, (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {
163 - result[key] = val[key];
164 - return result;
165 - }, {}) : val);
166 - }
167 - function partialMatchKey(a, b) {
168 - if (a === b) return true;
169 - if (typeof a !== typeof b) return false;
170 - if (a && b && typeof a === "object" && typeof b === "object") return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]));
171 - return false;
172 - }
173 - var hasOwn = Object.prototype.hasOwnProperty;
174 - function replaceEqualDeep(a, b) {
175 - if (a === b) return a;
176 - const array = isPlainArray(a) && isPlainArray(b);
177 - if (!array && !(isPlainObject(a) && isPlainObject(b))) return b;
178 - const aSize = (array ? a : Object.keys(a)).length;
179 - const bItems = array ? b : Object.keys(b);
180 - const bSize = bItems.length;
181 - const copy = array ? new Array(bSize) : {};
182 - let equalItems = 0;
183 - for (let i = 0; i < bSize; i++) {
184 - const key = array ? i : bItems[i];
185 - const aItem = a[key];
186 - const bItem = b[key];
187 - if (aItem === bItem) {
188 - copy[key] = aItem;
189 - if (array ? i < aSize : hasOwn.call(a, key)) equalItems++;
190 - continue;
191 - }
192 - if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") {
193 - copy[key] = bItem;
194 - continue;
195 - }
196 - const v = replaceEqualDeep(aItem, bItem);
197 - copy[key] = v;
198 - if (v === aItem) equalItems++;
199 - }
200 - return aSize === bSize && equalItems === aSize ? a : copy;
201 - }
202 - function shallowEqualObjects(a, b) {
203 - if (!b || Object.keys(a).length !== Object.keys(b).length) return false;
204 - for (const key in a) if (a[key] !== b[key]) return false;
205 - return true;
206 - }
207 - function isPlainArray(value) {
208 - return Array.isArray(value) && value.length === Object.keys(value).length;
209 - }
210 - function isPlainObject(o) {
211 - if (!hasObjectPrototype(o)) return false;
212 - const ctor = o.constructor;
213 - if (ctor === void 0) return true;
214 - const prot = ctor.prototype;
215 - if (!hasObjectPrototype(prot)) return false;
216 - if (!prot.hasOwnProperty("isPrototypeOf")) return false;
217 - if (Object.getPrototypeOf(o) !== Object.prototype) return false;
218 - return true;
219 - }
220 - function hasObjectPrototype(o) {
221 - return Object.prototype.toString.call(o) === "[object Object]";
222 - }
223 - function sleep(timeout) {
224 - return new Promise((resolve) => {
225 - timeoutManager.setTimeout(resolve, timeout);
226 - });
227 - }
228 - function replaceData(prevData, data, options) {
229 - if (typeof options.structuralSharing === "function") return options.structuralSharing(prevData, data);
230 - else if (options.structuralSharing !== false) try {
231 - return replaceEqualDeep(prevData, data);
232 - } catch (error) {
233 - console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`);
234 - throw error;
235 - }
236 - return data;
237 - }
238 - function addToEnd(items, item, max = 0) {
239 - const newItems = [...items, item];
240 - return max && newItems.length > max ? newItems.slice(1) : newItems;
241 - }
242 - function addToStart(items, item, max = 0) {
243 - const newItems = [item, ...items];
244 - return max && newItems.length > max ? newItems.slice(0, -1) : newItems;
245 - }
246 - var skipToken = Symbol();
247 - function ensureQueryFn(options, fetchOptions) {
248 - if (options.queryFn === skipToken) console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`);
249 - if (!options.queryFn && fetchOptions?.initialPromise) return () => fetchOptions.initialPromise;
250 - if (!options.queryFn || options.queryFn === skipToken) return () => Promise.reject(/* @__PURE__ */ new Error(`Missing queryFn: '${options.queryHash}'`));
251 - return options.queryFn;
252 - }
253 - function shouldThrowError(throwOnError, params) {
254 - if (typeof throwOnError === "function") return throwOnError(...params);
255 - return !!throwOnError;
256 - }
257 - function addConsumeAwareSignal(object, getSignal, onCancelled) {
258 - let consumed = false;
259 - let signal;
260 - Object.defineProperty(object, "signal", {
261 - enumerable: true,
262 - get: () => {
263 - signal ??= getSignal();
264 - if (consumed) return signal;
265 - consumed = true;
266 - if (signal.aborted) onCancelled();
267 - else signal.addEventListener("abort", onCancelled, { once: true });
268 - return signal;
269 - }
270 - });
271 - return object;
272 - }
23 +if (true) {
24 + (function() {
273 25
274 -//#endregion
275 -//#region node_modules/@tanstack/query-core/build/modern/focusManager.js
276 - var FocusManager = class extends Subscribable {
277 - #focused;
278 - #cleanup;
279 - #setup;
280 - constructor() {
281 - super();
282 - this.#setup = (onFocus) => {
283 - if (!isServer && window.addEventListener) {
284 - const listener = () => onFocus();
285 - window.addEventListener("visibilitychange", listener, false);
286 - return () => {
287 - window.removeEventListener("visibilitychange", listener);
288 - };
289 - }
290 - };
291 - }
292 - onSubscribe() {
293 - if (!this.#cleanup) this.setEventListener(this.#setup);
294 - }
295 - onUnsubscribe() {
296 - if (!this.hasListeners()) {
297 - this.#cleanup?.();
298 - this.#cleanup = void 0;
299 - }
300 - }
301 - setEventListener(setup) {
302 - this.#setup = setup;
303 - this.#cleanup?.();
304 - this.#cleanup = setup((focused) => {
305 - if (typeof focused === "boolean") this.setFocused(focused);
306 - else this.onFocus();
307 - });
308 - }
309 - setFocused(focused) {
310 - if (this.#focused !== focused) {
311 - this.#focused = focused;
312 - this.onFocus();
313 - }
314 - }
315 - onFocus() {
316 - const isFocused = this.isFocused();
317 - this.listeners.forEach((listener) => {
318 - listener(isFocused);
319 - });
320 - }
321 - isFocused() {
322 - if (typeof this.#focused === "boolean") return this.#focused;
323 - return globalThis.document?.visibilityState !== "hidden";
324 - }
325 - };
326 - var focusManager = new FocusManager();
26 + 'use strict';
327 27
328 -//#endregion
329 -//#region node_modules/@tanstack/query-core/build/modern/thenable.js
330 - function pendingThenable() {
331 - let resolve;
332 - let reject;
333 - const thenable = new Promise((_resolve, _reject) => {
334 - resolve = _resolve;
335 - reject = _reject;
336 - });
337 - thenable.status = "pending";
338 - thenable.catch(() => {});
339 - function finalize(data) {
340 - Object.assign(thenable, data);
341 - delete thenable.resolve;
342 - delete thenable.reject;
343 - }
344 - thenable.resolve = (value) => {
345 - finalize({
346 - status: "fulfilled",
347 - value
348 - });
349 - resolve(value);
350 - };
351 - thenable.reject = (reason) => {
352 - finalize({
353 - status: "rejected",
354 - reason
355 - });
356 - reject(reason);
357 - };
358 - return thenable;
359 - }
28 +/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
29 +if (
30 + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
31 + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
32 + 'function'
33 +) {
34 + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
35 +}
36 + var React = __webpack_require__(/*! react */ "react");
360 37
361 -//#endregion
362 -//#region node_modules/@tanstack/query-core/build/modern/notifyManager.js
363 - var defaultScheduler = systemSetTimeoutZero;
364 - function createNotifyManager() {
365 - let queue = [];
366 - let transactions = 0;
367 - let notifyFn = (callback) => {
368 - callback();
369 - };
370 - let batchNotifyFn = (callback) => {
371 - callback();
372 - };
373 - let scheduleFn = defaultScheduler;
374 - const schedule = (callback) => {
375 - if (transactions) queue.push(callback);
376 - else scheduleFn(() => {
377 - notifyFn(callback);
378 - });
379 - };
380 - const flush = () => {
381 - const originalQueue = queue;
382 - queue = [];
383 - if (originalQueue.length) scheduleFn(() => {
384 - batchNotifyFn(() => {
385 - originalQueue.forEach((callback) => {
386 - notifyFn(callback);
387 - });
388 - });
389 - });
390 - };
391 - return {
392 - batch: (callback) => {
393 - let result;
394 - transactions++;
395 - try {
396 - result = callback();
397 - } finally {
398 - transactions--;
399 - if (!transactions) flush();
400 - }
401 - return result;
402 - },
403 - /**
404 - * All calls to the wrapped function will be batched.
405 - */
406 - batchCalls: (callback) => {
407 - return (...args) => {
408 - schedule(() => {
409 - callback(...args);
410 - });
411 - };
412 - },
413 - schedule,
414 - /**
415 - * Use this method to set a custom notify function.
416 - * This can be used to for example wrap notifications with `React.act` while running tests.
417 - */
418 - setNotifyFunction: (fn) => {
419 - notifyFn = fn;
420 - },
421 - /**
422 - * Use this method to set a custom function to batch notifications together into a single tick.
423 - * By default React Query will use the batch function provided by ReactDOM or React Native.
424 - */
425 - setBatchNotifyFunction: (fn) => {
426 - batchNotifyFn = fn;
427 - },
428 - setScheduler: (fn) => {
429 - scheduleFn = fn;
430 - }
431 - };
432 - }
433 - var notifyManager = createNotifyManager();
38 +var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
434 39
435 -//#endregion
436 -//#region node_modules/@tanstack/query-core/build/modern/onlineManager.js
437 - var OnlineManager = class extends Subscribable {
438 - #online = true;
439 - #cleanup;
440 - #setup;
441 - constructor() {
442 - super();
443 - this.#setup = (onOnline) => {
444 - if (!isServer && window.addEventListener) {
445 - const onlineListener = () => onOnline(true);
446 - const offlineListener = () => onOnline(false);
447 - window.addEventListener("online", onlineListener, false);
448 - window.addEventListener("offline", offlineListener, false);
449 - return () => {
450 - window.removeEventListener("online", onlineListener);
451 - window.removeEventListener("offline", offlineListener);
452 - };
453 - }
454 - };
455 - }
456 - onSubscribe() {
457 - if (!this.#cleanup) this.setEventListener(this.#setup);
458 - }
459 - onUnsubscribe() {
460 - if (!this.hasListeners()) {
461 - this.#cleanup?.();
462 - this.#cleanup = void 0;
463 - }
464 - }
465 - setEventListener(setup) {
466 - this.#setup = setup;
467 - this.#cleanup?.();
468 - this.#cleanup = setup(this.setOnline.bind(this));
469 - }
470 - setOnline(online) {
471 - if (this.#online !== online) {
472 - this.#online = online;
473 - this.listeners.forEach((listener) => {
474 - listener(online);
475 - });
476 - }
477 - }
478 - isOnline() {
479 - return this.#online;
480 - }
481 - };
482 - var onlineManager = new OnlineManager();
40 +function error(format) {
41 + {
42 + {
43 + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
44 + args[_key2 - 1] = arguments[_key2];
45 + }
483 46
484 -//#endregion
485 -//#region node_modules/@tanstack/query-core/build/modern/retryer.js
486 - function defaultRetryDelay(failureCount) {
487 - return Math.min(1e3 * 2 ** failureCount, 3e4);
488 - }
489 - function canFetch(networkMode) {
490 - return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true;
491 - }
492 - var CancelledError = class extends Error {
493 - constructor(options) {
494 - super("CancelledError");
495 - this.revert = options?.revert;
496 - this.silent = options?.silent;
497 - }
498 - };
499 - function createRetryer(config) {
500 - let isRetryCancelled = false;
501 - let failureCount = 0;
502 - let continueFn;
503 - const thenable = pendingThenable();
504 - const isResolved = () => thenable.status !== "pending";
505 - const cancel = (cancelOptions) => {
506 - if (!isResolved()) {
507 - const error = new CancelledError(cancelOptions);
508 - reject(error);
509 - config.onCancel?.(error);
510 - }
511 - };
512 - const cancelRetry = () => {
513 - isRetryCancelled = true;
514 - };
515 - const continueRetry = () => {
516 - isRetryCancelled = false;
517 - };
518 - const canContinue = () => focusManager.isFocused() && (config.networkMode === "always" || onlineManager.isOnline()) && config.canRun();
519 - const canStart = () => canFetch(config.networkMode) && config.canRun();
520 - const resolve = (value) => {
521 - if (!isResolved()) {
522 - continueFn?.();
523 - thenable.resolve(value);
524 - }
525 - };
526 - const reject = (value) => {
527 - if (!isResolved()) {
528 - continueFn?.();
529 - thenable.reject(value);
530 - }
531 - };
532 - const pause = () => {
533 - return new Promise((continueResolve) => {
534 - continueFn = (value) => {
535 - if (isResolved() || canContinue()) continueResolve(value);
536 - };
537 - config.onPause?.();
538 - }).then(() => {
539 - continueFn = void 0;
540 - if (!isResolved()) config.onContinue?.();
541 - });
542 - };
543 - const run = () => {
544 - if (isResolved()) return;
545 - let promiseOrValue;
546 - const initialPromise = failureCount === 0 ? config.initialPromise : void 0;
547 - try {
548 - promiseOrValue = initialPromise ?? config.fn();
549 - } catch (error) {
550 - promiseOrValue = Promise.reject(error);
551 - }
552 - Promise.resolve(promiseOrValue).then(resolve).catch((error) => {
553 - if (isResolved()) return;
554 - const retry = config.retry ?? (isServer ? 0 : 3);
555 - const retryDelay = config.retryDelay ?? defaultRetryDelay;
556 - const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay;
557 - const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error);
558 - if (isRetryCancelled || !shouldRetry) {
559 - reject(error);
560 - return;
561 - }
562 - failureCount++;
563 - config.onFail?.(failureCount, error);
564 - sleep(delay).then(() => {
565 - return canContinue() ? void 0 : pause();
566 - }).then(() => {
567 - if (isRetryCancelled) reject(error);
568 - else run();
569 - });
570 - });
571 - };
572 - return {
573 - promise: thenable,
574 - status: () => thenable.status,
575 - cancel,
576 - continue: () => {
577 - continueFn?.();
578 - return thenable;
579 - },
580 - cancelRetry,
581 - continueRetry,
582 - canStart,
583 - start: () => {
584 - if (canStart()) run();
585 - else pause().then(run);
586 - return thenable;
587 - }
588 - };
589 - }
47 + printWarning('error', format, args);
48 + }
49 + }
50 +}
590 51
591 -//#endregion
592 -//#region node_modules/@tanstack/query-core/build/modern/removable.js
593 - var Removable = class {
594 - #gcTimeout;
595 - destroy() {
596 - this.clearGcTimeout();
597 - }
598 - scheduleGc() {
599 - this.clearGcTimeout();
600 - if (isValidTimeout(this.gcTime)) this.#gcTimeout = timeoutManager.setTimeout(() => {
601 - this.optionalRemove();
602 - }, this.gcTime);
603 - }
604 - updateGcTime(newGcTime) {
605 - this.gcTime = Math.max(this.gcTime || 0, newGcTime ?? (isServer ? Infinity : 300 * 1e3));
606 - }
607 - clearGcTimeout() {
608 - if (this.#gcTimeout) {
609 - timeoutManager.clearTimeout(this.#gcTimeout);
610 - this.#gcTimeout = void 0;
611 - }
612 - }
613 - };
52 +function printWarning(level, format, args) {
53 + // When changing this logic, you might want to also
54 + // update consoleWithStackDev.www.js as well.
55 + {
56 + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
57 + var stack = ReactDebugCurrentFrame.getStackAddendum();
614 58
615 -//#endregion
616 -//#region node_modules/@tanstack/query-core/build/modern/query.js
617 - var Query = class extends Removable {
618 - #initialState;
619 - #revertState;
620 - #cache;
621 - #client;
622 - #retryer;
623 - #defaultOptions;
624 - #abortSignalConsumed;
625 - constructor(config) {
626 - super();
627 - this.#abortSignalConsumed = false;
628 - this.#defaultOptions = config.defaultOptions;
629 - this.setOptions(config.options);
630 - this.observers = [];
631 - this.#client = config.client;
632 - this.#cache = this.#client.getQueryCache();
633 - this.queryKey = config.queryKey;
634 - this.queryHash = config.queryHash;
635 - this.#initialState = getDefaultState$1(this.options);
636 - this.state = config.state ?? this.#initialState;
637 - this.scheduleGc();
638 - }
639 - get meta() {
640 - return this.options.meta;
641 - }
642 - get promise() {
643 - return this.#retryer?.promise;
644 - }
645 - setOptions(options) {
646 - this.options = {
647 - ...this.#defaultOptions,
648 - ...options
649 - };
650 - this.updateGcTime(this.options.gcTime);
651 - if (this.state && this.state.data === void 0) {
652 - const defaultState = getDefaultState$1(this.options);
653 - if (defaultState.data !== void 0) {
654 - this.setState(successState(defaultState.data, defaultState.dataUpdatedAt));
655 - this.#initialState = defaultState;
656 - }
657 - }
658 - }
659 - optionalRemove() {
660 - if (!this.observers.length && this.state.fetchStatus === "idle") this.#cache.remove(this);
661 - }
662 - setData(newData, options) {
663 - const data = replaceData(this.state.data, newData, this.options);
664 - this.#dispatch({
665 - data,
666 - type: "success",
667 - dataUpdatedAt: options?.updatedAt,
668 - manual: options?.manual
669 - });
670 - return data;
671 - }
672 - setState(state, setStateOptions) {
673 - this.#dispatch({
674 - type: "setState",
675 - state,
676 - setStateOptions
677 - });
678 - }
679 - cancel(options) {
680 - const promise = this.#retryer?.promise;
681 - this.#retryer?.cancel(options);
682 - return promise ? promise.then(noop).catch(noop) : Promise.resolve();
683 - }
684 - destroy() {
685 - super.destroy();
686 - this.cancel({ silent: true });
687 - }
688 - reset() {
689 - this.destroy();
690 - this.setState(this.#initialState);
691 - }
692 - isActive() {
693 - return this.observers.some((observer) => resolveEnabled(observer.options.enabled, this) !== false);
694 - }
695 - isDisabled() {
696 - if (this.getObserversCount() > 0) return !this.isActive();
697 - return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
698 - }
699 - isStatic() {
700 - if (this.getObserversCount() > 0) return this.observers.some((observer) => resolveStaleTime(observer.options.staleTime, this) === "static");
701 - return false;
702 - }
703 - isStale() {
704 - if (this.getObserversCount() > 0) return this.observers.some((observer) => observer.getCurrentResult().isStale);
705 - return this.state.data === void 0 || this.state.isInvalidated;
706 - }
707 - isStaleByTime(staleTime = 0) {
708 - if (this.state.data === void 0) return true;
709 - if (staleTime === "static") return false;
710 - if (this.state.isInvalidated) return true;
711 - return !timeUntilStale(this.state.dataUpdatedAt, staleTime);
712 - }
713 - onFocus() {
714 - this.observers.find((x) => x.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: false });
715 - this.#retryer?.continue();
716 - }
717 - onOnline() {
718 - this.observers.find((x) => x.shouldFetchOnReconnect())?.refetch({ cancelRefetch: false });
719 - this.#retryer?.continue();
720 - }
721 - addObserver(observer) {
722 - if (!this.observers.includes(observer)) {
723 - this.observers.push(observer);
724 - this.clearGcTimeout();
725 - this.#cache.notify({
726 - type: "observerAdded",
727 - query: this,
728 - observer
729 - });
730 - }
731 - }
732 - removeObserver(observer) {
733 - if (this.observers.includes(observer)) {
734 - this.observers = this.observers.filter((x) => x !== observer);
735 - if (!this.observers.length) {
736 - if (this.#retryer) if (this.#abortSignalConsumed) this.#retryer.cancel({ revert: true });
737 - else this.#retryer.cancelRetry();
738 - this.scheduleGc();
739 - }
740 - this.#cache.notify({
741 - type: "observerRemoved",
742 - query: this,
743 - observer
744 - });
745 - }
746 - }
747 - getObserversCount() {
748 - return this.observers.length;
749 - }
750 - invalidate() {
751 - if (!this.state.isInvalidated) this.#dispatch({ type: "invalidate" });
752 - }
753 - async fetch(options, fetchOptions) {
754 - if (this.state.fetchStatus !== "idle" && this.#retryer?.status() !== "rejected") {
755 - if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) this.cancel({ silent: true });
756 - else if (this.#retryer) {
757 - this.#retryer.continueRetry();
758 - return this.#retryer.promise;
759 - }
760 - }
761 - if (options) this.setOptions(options);
762 - if (!this.options.queryFn) {
763 - const observer = this.observers.find((x) => x.options.queryFn);
764 - if (observer) this.setOptions(observer.options);
765 - }
766 - if (!Array.isArray(this.options.queryKey)) console.error(`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']`);
767 - const abortController = new AbortController();
768 - const addSignalProperty = (object) => {
769 - Object.defineProperty(object, "signal", {
770 - enumerable: true,
771 - get: () => {
772 - this.#abortSignalConsumed = true;
773 - return abortController.signal;
774 - }
775 - });
776 - };
777 - const fetchFn = () => {
778 - const queryFn = ensureQueryFn(this.options, fetchOptions);
779 - const createQueryFnContext = () => {
780 - const queryFnContext2 = {
781 - client: this.#client,
782 - queryKey: this.queryKey,
783 - meta: this.meta
784 - };
785 - addSignalProperty(queryFnContext2);
786 - return queryFnContext2;
787 - };
788 - const queryFnContext = createQueryFnContext();
789 - this.#abortSignalConsumed = false;
790 - if (this.options.persister) return this.options.persister(queryFn, queryFnContext, this);
791 - return queryFn(queryFnContext);
792 - };
793 - const createFetchContext = () => {
794 - const context2 = {
795 - fetchOptions,
796 - options: this.options,
797 - queryKey: this.queryKey,
798 - client: this.#client,
799 - state: this.state,
800 - fetchFn
801 - };
802 - addSignalProperty(context2);
803 - return context2;
804 - };
805 - const context = createFetchContext();
806 - this.options.behavior?.onFetch(context, this);
807 - this.#revertState = this.state;
808 - if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) this.#dispatch({
809 - type: "fetch",
810 - meta: context.fetchOptions?.meta
811 - });
812 - this.#retryer = createRetryer({
813 - initialPromise: fetchOptions?.initialPromise,
814 - fn: context.fetchFn,
815 - onCancel: (error) => {
816 - if (error instanceof CancelledError && error.revert) this.setState({
817 - ...this.#revertState,
818 - fetchStatus: "idle"
819 - });
820 - abortController.abort();
821 - },
822 - onFail: (failureCount, error) => {
823 - this.#dispatch({
824 - type: "failed",
825 - failureCount,
826 - error
827 - });
828 - },
829 - onPause: () => {
830 - this.#dispatch({ type: "pause" });
831 - },
832 - onContinue: () => {
833 - this.#dispatch({ type: "continue" });
834 - },
835 - retry: context.options.retry,
836 - retryDelay: context.options.retryDelay,
837 - networkMode: context.options.networkMode,
838 - canRun: () => true
839 - });
840 - try {
841 - const data = await this.#retryer.start();
842 - if (data === void 0) {
843 - console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`);
844 - throw new Error(`${this.queryHash} data is undefined`);
845 - }
846 - this.setData(data);
847 - this.#cache.config.onSuccess?.(data, this);
848 - this.#cache.config.onSettled?.(data, this.state.error, this);
849 - return data;
850 - } catch (error) {
851 - if (error instanceof CancelledError) {
852 - if (error.silent) return this.#retryer.promise;
853 - else if (error.revert) {
854 - if (this.state.data === void 0) throw error;
855 - return this.state.data;
856 - }
857 - }
858 - this.#dispatch({
859 - type: "error",
860 - error
861 - });
862 - this.#cache.config.onError?.(error, this);
863 - this.#cache.config.onSettled?.(this.state.data, error, this);
864 - throw error;
865 - } finally {
866 - this.scheduleGc();
867 - }
868 - }
869 - #dispatch(action) {
870 - const reducer = (state) => {
871 - switch (action.type) {
872 - case "failed": return {
873 - ...state,
874 - fetchFailureCount: action.failureCount,
875 - fetchFailureReason: action.error
876 - };
877 - case "pause": return {
878 - ...state,
879 - fetchStatus: "paused"
880 - };
881 - case "continue": return {
882 - ...state,
883 - fetchStatus: "fetching"
884 - };
885 - case "fetch": return {
886 - ...state,
887 - ...fetchState(state.data, this.options),
888 - fetchMeta: action.meta ?? null
889 - };
890 - case "success":
891 - const newState = {
892 - ...state,
893 - ...successState(action.data, action.dataUpdatedAt),
894 - dataUpdateCount: state.dataUpdateCount + 1,
895 - ...!action.manual && {
896 - fetchStatus: "idle",
897 - fetchFailureCount: 0,
898 - fetchFailureReason: null
899 - }
900 - };
901 - this.#revertState = action.manual ? newState : void 0;
902 - return newState;
903 - case "error":
904 - const error = action.error;
905 - return {
906 - ...state,
907 - error,
908 - errorUpdateCount: state.errorUpdateCount + 1,
909 - errorUpdatedAt: Date.now(),
910 - fetchFailureCount: state.fetchFailureCount + 1,
911 - fetchFailureReason: error,
912 - fetchStatus: "idle",
913 - status: "error"
914 - };
915 - case "invalidate": return {
916 - ...state,
917 - isInvalidated: true
918 - };
919 - case "setState": return {
920 - ...state,
921 - ...action.state
922 - };
923 - }
924 - };
925 - this.state = reducer(this.state);
926 - notifyManager.batch(() => {
927 - this.observers.forEach((observer) => {
928 - observer.onQueryUpdate();
929 - });
930 - this.#cache.notify({
931 - query: this,
932 - type: "updated",
933 - action
934 - });
935 - });
936 - }
937 - };
938 - function fetchState(data, options) {
939 - return {
940 - fetchFailureCount: 0,
941 - fetchFailureReason: null,
942 - fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused",
943 - ...data === void 0 && {
944 - error: null,
945 - status: "pending"
946 - }
947 - };
948 - }
949 - function successState(data, dataUpdatedAt) {
950 - return {
951 - data,
952 - dataUpdatedAt: dataUpdatedAt ?? Date.now(),
953 - error: null,
954 - isInvalidated: false,
955 - status: "success"
956 - };
957 - }
958 - function getDefaultState$1(options) {
959 - const data = typeof options.initialData === "function" ? options.initialData() : options.initialData;
960 - const hasData = data !== void 0;
961 - const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;
962 - return {
963 - data,
964 - dataUpdateCount: 0,
965 - dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,
966 - error: null,
967 - errorUpdateCount: 0,
968 - errorUpdatedAt: 0,
969 - fetchFailureCount: 0,
970 - fetchFailureReason: null,
971 - fetchMeta: null,
972 - isInvalidated: false,
973 - status: hasData ? "success" : "pending",
974 - fetchStatus: "idle"
975 - };
976 - }
977 - __name(getDefaultState$1, "getDefaultState");
59 + if (stack !== '') {
60 + format += '%s';
61 + args = args.concat([stack]);
62 + } // eslint-disable-next-line react-internal/safe-string-coercion
978 63
979 -//#endregion
980 -//#region node_modules/@tanstack/query-core/build/modern/queryObserver.js
981 - var QueryObserver = class extends Subscribable {
982 - constructor(client, options) {
983 - super();
984 - this.options = options;
985 - this.#client = client;
986 - this.#selectError = null;
987 - this.#currentThenable = pendingThenable();
988 - this.bindMethods();
989 - this.setOptions(options);
990 - }
991 - #client;
992 - #currentQuery = void 0;
993 - #currentQueryInitialState = void 0;
994 - #currentResult = void 0;
995 - #currentResultState;
996 - #currentResultOptions;
997 - #currentThenable;
998 - #selectError;
999 - #selectFn;
1000 - #selectResult;
1001 - #lastQueryWithDefinedData;
1002 - #staleTimeoutId;
1003 - #refetchIntervalId;
1004 - #currentRefetchInterval;
1005 - #trackedProps = /* @__PURE__ */ new Set();
1006 - bindMethods() {
1007 - this.refetch = this.refetch.bind(this);
1008 - }
1009 - onSubscribe() {
1010 - if (this.listeners.size === 1) {
1011 - this.#currentQuery.addObserver(this);
1012 - if (shouldFetchOnMount(this.#currentQuery, this.options)) this.#executeFetch();
1013 - else this.updateResult();
1014 - this.#updateTimers();
1015 - }
1016 - }
1017 - onUnsubscribe() {
1018 - if (!this.hasListeners()) this.destroy();
1019 - }
1020 - shouldFetchOnReconnect() {
1021 - return shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnReconnect);
1022 - }
1023 - shouldFetchOnWindowFocus() {
1024 - return shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnWindowFocus);
1025 - }
1026 - destroy() {
1027 - this.listeners = /* @__PURE__ */ new Set();
1028 - this.#clearStaleTimeout();
1029 - this.#clearRefetchInterval();
1030 - this.#currentQuery.removeObserver(this);
1031 - }
1032 - setOptions(options) {
1033 - const prevOptions = this.options;
1034 - const prevQuery = this.#currentQuery;
1035 - this.options = this.#client.defaultQueryOptions(options);
1036 - if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveEnabled(this.options.enabled, this.#currentQuery) !== "boolean") throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");
1037 - this.#updateQuery();
1038 - this.#currentQuery.setOptions(this.options);
1039 - if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) this.#client.getQueryCache().notify({
1040 - type: "observerOptionsUpdated",
1041 - query: this.#currentQuery,
1042 - observer: this
1043 - });
1044 - const mounted = this.hasListeners();
1045 - if (mounted && shouldFetchOptionally(this.#currentQuery, prevQuery, this.options, prevOptions)) this.#executeFetch();
1046 - this.updateResult();
1047 - if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || resolveStaleTime(this.options.staleTime, this.#currentQuery) !== resolveStaleTime(prevOptions.staleTime, this.#currentQuery))) this.#updateStaleTimeout();
1048 - const nextRefetchInterval = this.#computeRefetchInterval();
1049 - if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) this.#updateRefetchInterval(nextRefetchInterval);
1050 - }
1051 - getOptimisticResult(options) {
1052 - const query = this.#client.getQueryCache().build(this.#client, options);
1053 - const result = this.createResult(query, options);
1054 - if (shouldAssignObserverCurrentProperties(this, result)) {
1055 - this.#currentResult = result;
1056 - this.#currentResultOptions = this.options;
1057 - this.#currentResultState = this.#currentQuery.state;
1058 - }
1059 - return result;
1060 - }
1061 - getCurrentResult() {
1062 - return this.#currentResult;
1063 - }
1064 - trackResult(result, onPropTracked) {
1065 - return new Proxy(result, { get: (target, key) => {
1066 - this.trackProp(key);
1067 - onPropTracked?.(key);
1068 - if (key === "promise") {
1069 - this.trackProp("data");
1070 - if (!this.options.experimental_prefetchInRender && this.#currentThenable.status === "pending") this.#currentThenable.reject(/* @__PURE__ */ new Error("experimental_prefetchInRender feature flag is not enabled"));
1071 - }
1072 - return Reflect.get(target, key);
1073 - } });
1074 - }
1075 - trackProp(key) {
1076 - this.#trackedProps.add(key);
1077 - }
1078 - getCurrentQuery() {
1079 - return this.#currentQuery;
1080 - }
1081 - refetch({ ...options } = {}) {
1082 - return this.fetch({ ...options });
1083 - }
1084 - fetchOptimistic(options) {
1085 - const defaultedOptions = this.#client.defaultQueryOptions(options);
1086 - const query = this.#client.getQueryCache().build(this.#client, defaultedOptions);
1087 - return query.fetch().then(() => this.createResult(query, defaultedOptions));
1088 - }
1089 - fetch(fetchOptions) {
1090 - return this.#executeFetch({
1091 - ...fetchOptions,
1092 - cancelRefetch: fetchOptions.cancelRefetch ?? true
1093 - }).then(() => {
1094 - this.updateResult();
1095 - return this.#currentResult;
1096 - });
1097 - }
1098 - #executeFetch(fetchOptions) {
1099 - this.#updateQuery();
1100 - let promise = this.#currentQuery.fetch(this.options, fetchOptions);
1101 - if (!fetchOptions?.throwOnError) promise = promise.catch(noop);
1102 - return promise;
1103 - }
1104 - #updateStaleTimeout() {
1105 - this.#clearStaleTimeout();
1106 - const staleTime = resolveStaleTime(this.options.staleTime, this.#currentQuery);
1107 - if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) return;
1108 - const timeout = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime) + 1;
1109 - this.#staleTimeoutId = timeoutManager.setTimeout(() => {
1110 - if (!this.#currentResult.isStale) this.updateResult();
1111 - }, timeout);
1112 - }
1113 - #computeRefetchInterval() {
1114 - return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false;
1115 - }
1116 - #updateRefetchInterval(nextInterval) {
1117 - this.#clearRefetchInterval();
1118 - this.#currentRefetchInterval = nextInterval;
1119 - if (isServer || resolveEnabled(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) return;
1120 - this.#refetchIntervalId = timeoutManager.setInterval(() => {
1121 - if (this.options.refetchIntervalInBackground || focusManager.isFocused()) this.#executeFetch();
1122 - }, this.#currentRefetchInterval);
1123 - }
1124 - #updateTimers() {
1125 - this.#updateStaleTimeout();
1126 - this.#updateRefetchInterval(this.#computeRefetchInterval());
1127 - }
1128 - #clearStaleTimeout() {
1129 - if (this.#staleTimeoutId) {
1130 - timeoutManager.clearTimeout(this.#staleTimeoutId);
1131 - this.#staleTimeoutId = void 0;
1132 - }
1133 - }
1134 - #clearRefetchInterval() {
1135 - if (this.#refetchIntervalId) {
1136 - timeoutManager.clearInterval(this.#refetchIntervalId);
1137 - this.#refetchIntervalId = void 0;
1138 - }
1139 - }
1140 - createResult(query, options) {
1141 - const prevQuery = this.#currentQuery;
1142 - const prevOptions = this.options;
1143 - const prevResult = this.#currentResult;
1144 - const prevResultState = this.#currentResultState;
1145 - const prevResultOptions = this.#currentResultOptions;
1146 - const queryInitialState = query !== prevQuery ? query.state : this.#currentQueryInitialState;
1147 - const { state } = query;
1148 - let newState = { ...state };
1149 - let isPlaceholderData = false;
1150 - let data;
1151 - if (options._optimisticResults) {
1152 - const mounted = this.hasListeners();
1153 - const fetchOnMount = !mounted && shouldFetchOnMount(query, options);
1154 - const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);
1155 - if (fetchOnMount || fetchOptionally) newState = {
1156 - ...newState,
1157 - ...fetchState(state.data, query.options)
1158 - };
1159 - if (options._optimisticResults === "isRestoring") newState.fetchStatus = "idle";
1160 - }
1161 - let { error, errorUpdatedAt, status } = newState;
1162 - data = newState.data;
1163 - let skipSelect = false;
1164 - if (options.placeholderData !== void 0 && data === void 0 && status === "pending") {
1165 - let placeholderData;
1166 - if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {
1167 - placeholderData = prevResult.data;
1168 - skipSelect = true;
1169 - } else placeholderData = typeof options.placeholderData === "function" ? options.placeholderData(this.#lastQueryWithDefinedData?.state.data, this.#lastQueryWithDefinedData) : options.placeholderData;
1170 - if (placeholderData !== void 0) {
1171 - status = "success";
1172 - data = replaceData(prevResult?.data, placeholderData, options);
1173 - isPlaceholderData = true;
1174 - }
1175 - }
1176 - if (options.select && data !== void 0 && !skipSelect) if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) data = this.#selectResult;
1177 - else try {
1178 - this.#selectFn = options.select;
1179 - data = options.select(data);
1180 - data = replaceData(prevResult?.data, data, options);
1181 - this.#selectResult = data;
1182 - this.#selectError = null;
1183 - } catch (selectError) {
1184 - this.#selectError = selectError;
1185 - }
1186 - if (this.#selectError) {
1187 - error = this.#selectError;
1188 - data = this.#selectResult;
1189 - errorUpdatedAt = Date.now();
1190 - status = "error";
1191 - }
1192 - const isFetching = newState.fetchStatus === "fetching";
1193 - const isPending = status === "pending";
1194 - const isError = status === "error";
1195 - const isLoading = isPending && isFetching;
1196 - const hasData = data !== void 0;
1197 - const nextResult = {
1198 - status,
1199 - fetchStatus: newState.fetchStatus,
1200 - isPending,
1201 - isSuccess: status === "success",
1202 - isError,
1203 - isInitialLoading: isLoading,
1204 - isLoading,
1205 - data,
1206 - dataUpdatedAt: newState.dataUpdatedAt,
1207 - error,
1208 - errorUpdatedAt,
1209 - failureCount: newState.fetchFailureCount,
1210 - failureReason: newState.fetchFailureReason,
1211 - errorUpdateCount: newState.errorUpdateCount,
1212 - isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,
1213 - isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,
1214 - isFetching,
1215 - isRefetching: isFetching && !isPending,
1216 - isLoadingError: isError && !hasData,
1217 - isPaused: newState.fetchStatus === "paused",
1218 - isPlaceholderData,
1219 - isRefetchError: isError && hasData,
1220 - isStale: isStale(query, options),
1221 - refetch: this.refetch,
1222 - promise: this.#currentThenable,
1223 - isEnabled: resolveEnabled(options.enabled, query) !== false
1224 - };
1225 - if (this.options.experimental_prefetchInRender) {
1226 - const finalizeThenableIfPossible = (thenable) => {
1227 - if (nextResult.status === "error") thenable.reject(nextResult.error);
1228 - else if (nextResult.data !== void 0) thenable.resolve(nextResult.data);
1229 - };
1230 - const recreateThenable = () => {
1231 - const pending = this.#currentThenable = nextResult.promise = pendingThenable();
1232 - finalizeThenableIfPossible(pending);
1233 - };
1234 - const prevThenable = this.#currentThenable;
1235 - switch (prevThenable.status) {
1236 - case "pending":
1237 - if (query.queryHash === prevQuery.queryHash) finalizeThenableIfPossible(prevThenable);
1238 - break;
1239 - case "fulfilled":
1240 - if (nextResult.status === "error" || nextResult.data !== prevThenable.value) recreateThenable();
1241 - break;
1242 - case "rejected":
1243 - if (nextResult.status !== "error" || nextResult.error !== prevThenable.reason) recreateThenable();
1244 - break;
1245 - }
1246 - }
1247 - return nextResult;
1248 - }
1249 - updateResult() {
1250 - const prevResult = this.#currentResult;
1251 - const nextResult = this.createResult(this.#currentQuery, this.options);
1252 - this.#currentResultState = this.#currentQuery.state;
1253 - this.#currentResultOptions = this.options;
1254 - if (this.#currentResultState.data !== void 0) this.#lastQueryWithDefinedData = this.#currentQuery;
1255 - if (shallowEqualObjects(nextResult, prevResult)) return;
1256 - this.#currentResult = nextResult;
1257 - const shouldNotifyListeners = () => {
1258 - if (!prevResult) return true;
1259 - const { notifyOnChangeProps } = this.options;
1260 - const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps;
1261 - if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) return true;
1262 - const includedProps = new Set(notifyOnChangePropsValue ?? this.#trackedProps);
1263 - if (this.options.throwOnError) includedProps.add("error");
1264 - return Object.keys(this.#currentResult).some((key) => {
1265 - const typedKey = key;
1266 - return this.#currentResult[typedKey] !== prevResult[typedKey] && includedProps.has(typedKey);
1267 - });
1268 - };
1269 - this.#notify({ listeners: shouldNotifyListeners() });
1270 - }
1271 - #updateQuery() {
1272 - const query = this.#client.getQueryCache().build(this.#client, this.options);
1273 - if (query === this.#currentQuery) return;
1274 - const prevQuery = this.#currentQuery;
1275 - this.#currentQuery = query;
1276 - this.#currentQueryInitialState = query.state;
1277 - if (this.hasListeners()) {
1278 - prevQuery?.removeObserver(this);
1279 - query.addObserver(this);
1280 - }
1281 - }
1282 - onQueryUpdate() {
1283 - this.updateResult();
1284 - if (this.hasListeners()) this.#updateTimers();
1285 - }
1286 - #notify(notifyOptions) {
1287 - notifyManager.batch(() => {
1288 - if (notifyOptions.listeners) this.listeners.forEach((listener) => {
1289 - listener(this.#currentResult);
1290 - });
1291 - this.#client.getQueryCache().notify({
1292 - query: this.#currentQuery,
1293 - type: "observerResultsUpdated"
1294 - });
1295 - });
1296 - }
1297 - };
1298 - function shouldLoadOnMount(query, options) {
1299 - return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false);
1300 - }
1301 - function shouldFetchOnMount(query, options) {
1302 - return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);
1303 - }
1304 - function shouldFetchOn(query, options, field) {
1305 - if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") {
1306 - const value = typeof field === "function" ? field(query) : field;
1307 - return value === "always" || value !== false && isStale(query, options);
1308 - }
1309 - return false;
1310 - }
1311 - function shouldFetchOptionally(query, prevQuery, options, prevOptions) {
1312 - return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options);
1313 - }
1314 - function isStale(query, options) {
1315 - return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query));
1316 - }
1317 - function shouldAssignObserverCurrentProperties(observer, optimisticResult) {
1318 - if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) return true;
1319 - return false;
1320 - }
1321 64
1322 -//#endregion
1323 -//#region node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
1324 - function infiniteQueryBehavior(pages) {
1325 - return { onFetch: (context, query) => {
1326 - const options = context.options;
1327 - const direction = context.fetchOptions?.meta?.fetchMore?.direction;
1328 - const oldPages = context.state.data?.pages || [];
1329 - const oldPageParams = context.state.data?.pageParams || [];
1330 - let result = {
1331 - pages: [],
1332 - pageParams: []
1333 - };
1334 - let currentPage = 0;
1335 - const fetchFn = async () => {
1336 - let cancelled = false;
1337 - const addSignalProperty = (object) => {
1338 - addConsumeAwareSignal(object, () => context.signal, () => cancelled = true);
1339 - };
1340 - const queryFn = ensureQueryFn(context.options, context.fetchOptions);
1341 - const fetchPage = async (data, param, previous) => {
1342 - if (cancelled) return Promise.reject();
1343 - if (param == null && data.pages.length) return Promise.resolve(data);
1344 - const createQueryFnContext = () => {
1345 - const queryFnContext2 = {
1346 - client: context.client,
1347 - queryKey: context.queryKey,
1348 - pageParam: param,
1349 - direction: previous ? "backward" : "forward",
1350 - meta: context.options.meta
1351 - };
1352 - addSignalProperty(queryFnContext2);
1353 - return queryFnContext2;
1354 - };
1355 - const queryFnContext = createQueryFnContext();
1356 - const page = await queryFn(queryFnContext);
1357 - const { maxPages } = context.options;
1358 - const addTo = previous ? addToStart : addToEnd;
1359 - return {
1360 - pages: addTo(data.pages, page, maxPages),
1361 - pageParams: addTo(data.pageParams, param, maxPages)
1362 - };
1363 - };
1364 - if (direction && oldPages.length) {
1365 - const previous = direction === "backward";
1366 - const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;
1367 - const oldData = {
1368 - pages: oldPages,
1369 - pageParams: oldPageParams
1370 - };
1371 - result = await fetchPage(oldData, pageParamFn(options, oldData), previous);
1372 - } else {
1373 - const remainingPages = pages ?? oldPages.length;
1374 - do {
1375 - const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result);
1376 - if (currentPage > 0 && param == null) break;
1377 - result = await fetchPage(result, param);
1378 - currentPage++;
1379 - } while (currentPage < remainingPages);
1380 - }
1381 - return result;
1382 - };
1383 - if (context.options.persister) context.fetchFn = () => {
1384 - return context.options.persister?.(fetchFn, {
1385 - client: context.client,
1386 - queryKey: context.queryKey,
1387 - meta: context.options.meta,
1388 - signal: context.signal
1389 - }, query);
1390 - };
1391 - else context.fetchFn = fetchFn;
1392 - } };
1393 - }
1394 - function getNextPageParam(options, { pages, pageParams }) {
1395 - const lastIndex = pages.length - 1;
1396 - return pages.length > 0 ? options.getNextPageParam(pages[lastIndex], pages, pageParams[lastIndex], pageParams) : void 0;
1397 - }
1398 - function getPreviousPageParam(options, { pages, pageParams }) {
1399 - return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;
1400 - }
1401 - function hasNextPage(options, data) {
1402 - if (!data) return false;
1403 - return getNextPageParam(options, data) != null;
1404 - }
1405 - function hasPreviousPage(options, data) {
1406 - if (!data || !options.getPreviousPageParam) return false;
1407 - return getPreviousPageParam(options, data) != null;
1408 - }
65 + var argsWithFormat = args.map(function (item) {
66 + return String(item);
67 + }); // Careful: RN currently depends on this prefix
1409 68
1410 -//#endregion
1411 -//#region node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js
1412 - var InfiniteQueryObserver = class extends QueryObserver {
1413 - constructor(client, options) {
1414 - super(client, options);
1415 - }
1416 - bindMethods() {
1417 - super.bindMethods();
1418 - this.fetchNextPage = this.fetchNextPage.bind(this);
1419 - this.fetchPreviousPage = this.fetchPreviousPage.bind(this);
1420 - }
1421 - setOptions(options) {
1422 - super.setOptions({
1423 - ...options,
1424 - behavior: infiniteQueryBehavior()
1425 - });
1426 - }
1427 - getOptimisticResult(options) {
1428 - options.behavior = infiniteQueryBehavior();
1429 - return super.getOptimisticResult(options);
1430 - }
1431 - fetchNextPage(options) {
1432 - return this.fetch({
1433 - ...options,
1434 - meta: { fetchMore: { direction: "forward" } }
1435 - });
1436 - }
1437 - fetchPreviousPage(options) {
1438 - return this.fetch({
1439 - ...options,
1440 - meta: { fetchMore: { direction: "backward" } }
1441 - });
1442 - }
1443 - createResult(query, options) {
1444 - const { state } = query;
1445 - const parentResult = super.createResult(query, options);
1446 - const { isFetching, isRefetching, isError, isRefetchError } = parentResult;
1447 - const fetchDirection = state.fetchMeta?.fetchMore?.direction;
1448 - const isFetchNextPageError = isError && fetchDirection === "forward";
1449 - const isFetchingNextPage = isFetching && fetchDirection === "forward";
1450 - const isFetchPreviousPageError = isError && fetchDirection === "backward";
1451 - const isFetchingPreviousPage = isFetching && fetchDirection === "backward";
1452 - return {
1453 - ...parentResult,
1454 - fetchNextPage: this.fetchNextPage,
1455 - fetchPreviousPage: this.fetchPreviousPage,
1456 - hasNextPage: hasNextPage(options, state.data),
1457 - hasPreviousPage: hasPreviousPage(options, state.data),
1458 - isFetchNextPageError,
1459 - isFetchingNextPage,
1460 - isFetchPreviousPageError,
1461 - isFetchingPreviousPage,
1462 - isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,
1463 - isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage
1464 - };
1465 - }
1466 - };
69 + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
70 + // breaks IE9: https://github.com/facebook/react/issues/13610
71 + // eslint-disable-next-line react-internal/no-production-logging
1467 72
1468 -//#endregion
1469 -//#region node_modules/@tanstack/query-core/build/modern/mutation.js
1470 - var Mutation = class extends Removable {
1471 - #client;
1472 - #observers;
1473 - #mutationCache;
1474 - #retryer;
1475 - constructor(config) {
1476 - super();
1477 - this.#client = config.client;
1478 - this.mutationId = config.mutationId;
1479 - this.#mutationCache = config.mutationCache;
1480 - this.#observers = [];
1481 - this.state = config.state || getDefaultState();
1482 - this.setOptions(config.options);
1483 - this.scheduleGc();
1484 - }
1485 - setOptions(options) {
1486 - this.options = options;
1487 - this.updateGcTime(this.options.gcTime);
1488 - }
1489 - get meta() {
1490 - return this.options.meta;
1491 - }
1492 - addObserver(observer) {
1493 - if (!this.#observers.includes(observer)) {
1494 - this.#observers.push(observer);
1495 - this.clearGcTimeout();
1496 - this.#mutationCache.notify({
1497 - type: "observerAdded",
1498 - mutation: this,
1499 - observer
1500 - });
1501 - }
1502 - }
1503 - removeObserver(observer) {
1504 - this.#observers = this.#observers.filter((x) => x !== observer);
1505 - this.scheduleGc();
1506 - this.#mutationCache.notify({
1507 - type: "observerRemoved",
1508 - mutation: this,
1509 - observer
1510 - });
1511 - }
1512 - optionalRemove() {
1513 - if (!this.#observers.length) if (this.state.status === "pending") this.scheduleGc();
1514 - else this.#mutationCache.remove(this);
1515 - }
1516 - continue() {
1517 - return this.#retryer?.continue() ?? this.execute(this.state.variables);
1518 - }
1519 - async execute(variables) {
1520 - const onContinue = () => {
1521 - this.#dispatch({ type: "continue" });
1522 - };
1523 - const mutationFnContext = {
1524 - client: this.#client,
1525 - meta: this.options.meta,
1526 - mutationKey: this.options.mutationKey
1527 - };
1528 - this.#retryer = createRetryer({
1529 - fn: () => {
1530 - if (!this.options.mutationFn) return Promise.reject(/* @__PURE__ */ new Error("No mutationFn found"));
1531 - return this.options.mutationFn(variables, mutationFnContext);
1532 - },
1533 - onFail: (failureCount, error) => {
1534 - this.#dispatch({
1535 - type: "failed",
1536 - failureCount,
1537 - error
1538 - });
1539 - },
1540 - onPause: () => {
1541 - this.#dispatch({ type: "pause" });
1542 - },
1543 - onContinue,
1544 - retry: this.options.retry ?? 0,
1545 - retryDelay: this.options.retryDelay,
1546 - networkMode: this.options.networkMode,
1547 - canRun: () => this.#mutationCache.canRun(this)
1548 - });
1549 - const restored = this.state.status === "pending";
1550 - const isPaused = !this.#retryer.canStart();
1551 - try {
1552 - if (restored) onContinue();
1553 - else {
1554 - this.#dispatch({
1555 - type: "pending",
1556 - variables,
1557 - isPaused
1558 - });
1559 - await this.#mutationCache.config.onMutate?.(variables, this, mutationFnContext);
1560 - const context = await this.options.onMutate?.(variables, mutationFnContext);
1561 - if (context !== this.state.context) this.#dispatch({
1562 - type: "pending",
1563 - context,
1564 - variables,
1565 - isPaused
1566 - });
1567 - }
1568 - const data = await this.#retryer.start();
1569 - await this.#mutationCache.config.onSuccess?.(data, variables, this.state.context, this, mutationFnContext);
1570 - await this.options.onSuccess?.(data, variables, this.state.context, mutationFnContext);
1571 - await this.#mutationCache.config.onSettled?.(data, null, this.state.variables, this.state.context, this, mutationFnContext);
1572 - await this.options.onSettled?.(data, null, variables, this.state.context, mutationFnContext);
1573 - this.#dispatch({
1574 - type: "success",
1575 - data
1576 - });
1577 - return data;
1578 - } catch (error) {
1579 - try {
1580 - await this.#mutationCache.config.onError?.(error, variables, this.state.context, this, mutationFnContext);
1581 - await this.options.onError?.(error, variables, this.state.context, mutationFnContext);
1582 - await this.#mutationCache.config.onSettled?.(void 0, error, this.state.variables, this.state.context, this, mutationFnContext);
1583 - await this.options.onSettled?.(void 0, error, variables, this.state.context, mutationFnContext);
1584 - throw error;
1585 - } finally {
1586 - this.#dispatch({
1587 - type: "error",
1588 - error
1589 - });
1590 - }
1591 - } finally {
1592 - this.#mutationCache.runNext(this);
1593 - }
1594 - }
1595 - #dispatch(action) {
1596 - const reducer = (state) => {
1597 - switch (action.type) {
1598 - case "failed": return {
1599 - ...state,
1600 - failureCount: action.failureCount,
1601 - failureReason: action.error
1602 - };
1603 - case "pause": return {
1604 - ...state,
1605 - isPaused: true
1606 - };
1607 - case "continue": return {
1608 - ...state,
1609 - isPaused: false
1610 - };
1611 - case "pending": return {
1612 - ...state,
1613 - context: action.context,
1614 - data: void 0,
1615 - failureCount: 0,
1616 - failureReason: null,
1617 - error: null,
1618 - isPaused: action.isPaused,
1619 - status: "pending",
1620 - variables: action.variables,
1621 - submittedAt: Date.now()
1622 - };
1623 - case "success": return {
1624 - ...state,
1625 - data: action.data,
1626 - failureCount: 0,
1627 - failureReason: null,
1628 - error: null,
1629 - status: "success",
1630 - isPaused: false
1631 - };
1632 - case "error": return {
1633 - ...state,
1634 - data: void 0,
1635 - error: action.error,
1636 - failureCount: state.failureCount + 1,
1637 - failureReason: action.error,
1638 - isPaused: false,
1639 - status: "error"
1640 - };
1641 - }
1642 - };
1643 - this.state = reducer(this.state);
1644 - notifyManager.batch(() => {
1645 - this.#observers.forEach((observer) => {
1646 - observer.onMutationUpdate(action);
1647 - });
1648 - this.#mutationCache.notify({
1649 - mutation: this,
1650 - type: "updated",
1651 - action
1652 - });
1653 - });
1654 - }
1655 - };
1656 - function getDefaultState() {
1657 - return {
1658 - context: void 0,
1659 - data: void 0,
1660 - error: null,
1661 - failureCount: 0,
1662 - failureReason: null,
1663 - isPaused: false,
1664 - status: "idle",
1665 - variables: void 0,
1666 - submittedAt: 0
1667 - };
1668 - }
73 + Function.prototype.apply.call(console[level], console, argsWithFormat);
74 + }
75 +}
1669 76
1670 -//#endregion
1671 -//#region node_modules/@tanstack/query-core/build/modern/mutationCache.js
1672 - var MutationCache = class extends Subscribable {
1673 - constructor(config = {}) {
1674 - super();
1675 - this.config = config;
1676 - this.#mutations = /* @__PURE__ */ new Set();
1677 - this.#scopes = /* @__PURE__ */ new Map();
1678 - this.#mutationId = 0;
1679 - }
1680 - #mutations;
1681 - #scopes;
1682 - #mutationId;
1683 - build(client, options, state) {
1684 - const mutation = new Mutation({
1685 - client,
1686 - mutationCache: this,
1687 - mutationId: ++this.#mutationId,
1688 - options: client.defaultMutationOptions(options),
1689 - state
1690 - });
1691 - this.add(mutation);
1692 - return mutation;
1693 - }
1694 - add(mutation) {
1695 - this.#mutations.add(mutation);
1696 - const scope = scopeFor(mutation);
1697 - if (typeof scope === "string") {
1698 - const scopedMutations = this.#scopes.get(scope);
1699 - if (scopedMutations) scopedMutations.push(mutation);
1700 - else this.#scopes.set(scope, [mutation]);
1701 - }
1702 - this.notify({
1703 - type: "added",
1704 - mutation
1705 - });
1706 - }
1707 - remove(mutation) {
1708 - if (this.#mutations.delete(mutation)) {
1709 - const scope = scopeFor(mutation);
1710 - if (typeof scope === "string") {
1711 - const scopedMutations = this.#scopes.get(scope);
1712 - if (scopedMutations) {
1713 - if (scopedMutations.length > 1) {
1714 - const index = scopedMutations.indexOf(mutation);
1715 - if (index !== -1) scopedMutations.splice(index, 1);
1716 - } else if (scopedMutations[0] === mutation) this.#scopes.delete(scope);
1717 - }
1718 - }
1719 - }
1720 - this.notify({
1721 - type: "removed",
1722 - mutation
1723 - });
1724 - }
1725 - canRun(mutation) {
1726 - const scope = scopeFor(mutation);
1727 - if (typeof scope === "string") {
1728 - const firstPendingMutation = this.#scopes.get(scope)?.find((m) => m.state.status === "pending");
1729 - return !firstPendingMutation || firstPendingMutation === mutation;
1730 - } else return true;
1731 - }
1732 - runNext(mutation) {
1733 - const scope = scopeFor(mutation);
1734 - if (typeof scope === "string") return (this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused))?.continue() ?? Promise.resolve();
1735 - else return Promise.resolve();
1736 - }
1737 - clear() {
1738 - notifyManager.batch(() => {
1739 - this.#mutations.forEach((mutation) => {
1740 - this.notify({
1741 - type: "removed",
1742 - mutation
1743 - });
1744 - });
1745 - this.#mutations.clear();
1746 - this.#scopes.clear();
1747 - });
1748 - }
1749 - getAll() {
1750 - return Array.from(this.#mutations);
1751 - }
1752 - find(filters) {
1753 - const defaultedFilters = {
1754 - exact: true,
1755 - ...filters
1756 - };
1757 - return this.getAll().find((mutation) => matchMutation(defaultedFilters, mutation));
1758 - }
1759 - findAll(filters = {}) {
1760 - return this.getAll().filter((mutation) => matchMutation(filters, mutation));
1761 - }
1762 - notify(event) {
1763 - notifyManager.batch(() => {
1764 - this.listeners.forEach((listener) => {
1765 - listener(event);
1766 - });
1767 - });
1768 - }
1769 - resumePausedMutations() {
1770 - const pausedMutations = this.getAll().filter((x) => x.state.isPaused);
1771 - return notifyManager.batch(() => Promise.all(pausedMutations.map((mutation) => mutation.continue().catch(noop))));
1772 - }
1773 - };
1774 - function scopeFor(mutation) {
1775 - return mutation.options.scope?.id;
1776 - }
77 +/**
78 + * inlined Object.is polyfill to avoid requiring consumers ship their own
79 + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
80 + */
81 +function is(x, y) {
82 + return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
83 + ;
84 +}
1777 85
1778 -//#endregion
1779 -//#region node_modules/@tanstack/query-core/build/modern/mutationObserver.js
1780 - var MutationObserver = class extends Subscribable {
1781 - #client;
1782 - #currentResult = void 0;
1783 - #currentMutation;
1784 - #mutateOptions;
1785 - constructor(client, options) {
1786 - super();
1787 - this.#client = client;
1788 - this.setOptions(options);
1789 - this.bindMethods();
1790 - this.#updateResult();
1791 - }
1792 - bindMethods() {
1793 - this.mutate = this.mutate.bind(this);
1794 - this.reset = this.reset.bind(this);
1795 - }
1796 - setOptions(options) {
1797 - const prevOptions = this.options;
1798 - this.options = this.#client.defaultMutationOptions(options);
1799 - if (!shallowEqualObjects(this.options, prevOptions)) this.#client.getMutationCache().notify({
1800 - type: "observerOptionsUpdated",
1801 - mutation: this.#currentMutation,
1802 - observer: this
1803 - });
1804 - if (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) this.reset();
1805 - else if (this.#currentMutation?.state.status === "pending") this.#currentMutation.setOptions(this.options);
1806 - }
1807 - onUnsubscribe() {
1808 - if (!this.hasListeners()) this.#currentMutation?.removeObserver(this);
1809 - }
1810 - onMutationUpdate(action) {
1811 - this.#updateResult();
1812 - this.#notify(action);
1813 - }
1814 - getCurrentResult() {
1815 - return this.#currentResult;
1816 - }
1817 - reset() {
1818 - this.#currentMutation?.removeObserver(this);
1819 - this.#currentMutation = void 0;
1820 - this.#updateResult();
1821 - this.#notify();
1822 - }
1823 - mutate(variables, options) {
1824 - this.#mutateOptions = options;
1825 - this.#currentMutation?.removeObserver(this);
1826 - this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options);
1827 - this.#currentMutation.addObserver(this);
1828 - return this.#currentMutation.execute(variables);
1829 - }
1830 - #updateResult() {
1831 - const state = this.#currentMutation?.state ?? getDefaultState();
1832 - this.#currentResult = {
1833 - ...state,
1834 - isPending: state.status === "pending",
1835 - isSuccess: state.status === "success",
1836 - isError: state.status === "error",
1837 - isIdle: state.status === "idle",
1838 - mutate: this.mutate,
1839 - reset: this.reset
1840 - };
1841 - }
1842 - #notify(action) {
1843 - notifyManager.batch(() => {
1844 - if (this.#mutateOptions && this.hasListeners()) {
1845 - const variables = this.#currentResult.variables;
1846 - const onMutateResult = this.#currentResult.context;
1847 - const context = {
1848 - client: this.#client,
1849 - meta: this.options.meta,
1850 - mutationKey: this.options.mutationKey
1851 - };
1852 - if (action?.type === "success") {
1853 - this.#mutateOptions.onSuccess?.(action.data, variables, onMutateResult, context);
1854 - this.#mutateOptions.onSettled?.(action.data, null, variables, onMutateResult, context);
1855 - } else if (action?.type === "error") {
1856 - this.#mutateOptions.onError?.(action.error, variables, onMutateResult, context);
1857 - this.#mutateOptions.onSettled?.(void 0, action.error, variables, onMutateResult, context);
1858 - }
1859 - }
1860 - this.listeners.forEach((listener) => {
1861 - listener(this.#currentResult);
1862 - });
1863 - });
1864 - }
1865 - };
86 +var objectIs = typeof Object.is === 'function' ? Object.is : is;
1866 87
1867 -//#endregion
1868 -//#region node_modules/@tanstack/query-core/build/modern/queryCache.js
1869 - var QueryCache = class extends Subscribable {
1870 - constructor(config = {}) {
1871 - super();
1872 - this.config = config;
1873 - this.#queries = /* @__PURE__ */ new Map();
1874 - }
1875 - #queries;
1876 - build(client, options, state) {
1877 - const queryKey = options.queryKey;
1878 - const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);
1879 - let query = this.get(queryHash);
1880 - if (!query) {
1881 - query = new Query({
1882 - client,
1883 - queryKey,
1884 - queryHash,
1885 - options: client.defaultQueryOptions(options),
1886 - state,
1887 - defaultOptions: client.getQueryDefaults(queryKey)
1888 - });
1889 - this.add(query);
1890 - }
1891 - return query;
1892 - }
1893 - add(query) {
1894 - if (!this.#queries.has(query.queryHash)) {
1895 - this.#queries.set(query.queryHash, query);
1896 - this.notify({
1897 - type: "added",
1898 - query
1899 - });
1900 - }
1901 - }
1902 - remove(query) {
1903 - const queryInMap = this.#queries.get(query.queryHash);
1904 - if (queryInMap) {
1905 - query.destroy();
1906 - if (queryInMap === query) this.#queries.delete(query.queryHash);
1907 - this.notify({
1908 - type: "removed",
1909 - query
1910 - });
1911 - }
1912 - }
1913 - clear() {
1914 - notifyManager.batch(() => {
1915 - this.getAll().forEach((query) => {
1916 - this.remove(query);
1917 - });
1918 - });
1919 - }
1920 - get(queryHash) {
1921 - return this.#queries.get(queryHash);
1922 - }
1923 - getAll() {
1924 - return [...this.#queries.values()];
1925 - }
1926 - find(filters) {
1927 - const defaultedFilters = {
1928 - exact: true,
1929 - ...filters
1930 - };
1931 - return this.getAll().find((query) => matchQuery(defaultedFilters, query));
1932 - }
1933 - findAll(filters = {}) {
1934 - const queries = this.getAll();
1935 - return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;
1936 - }
1937 - notify(event) {
1938 - notifyManager.batch(() => {
1939 - this.listeners.forEach((listener) => {
1940 - listener(event);
1941 - });
1942 - });
1943 - }
1944 - onFocus() {
1945 - notifyManager.batch(() => {
1946 - this.getAll().forEach((query) => {
1947 - query.onFocus();
1948 - });
1949 - });
1950 - }
1951 - onOnline() {
1952 - notifyManager.batch(() => {
1953 - this.getAll().forEach((query) => {
1954 - query.onOnline();
1955 - });
1956 - });
1957 - }
1958 - };
88 +// dispatch for CommonJS interop named imports.
1959 89
1960 -//#endregion
1961 -//#region node_modules/@tanstack/query-core/build/modern/queryClient.js
1962 - var QueryClient = class {
1963 - #queryCache;
1964 - #mutationCache;
1965 - #defaultOptions;
1966 - #queryDefaults;
1967 - #mutationDefaults;
1968 - #mountCount;
1969 - #unsubscribeFocus;
1970 - #unsubscribeOnline;
1971 - constructor(config = {}) {
1972 - this.#queryCache = config.queryCache || new QueryCache();
1973 - this.#mutationCache = config.mutationCache || new MutationCache();
1974 - this.#defaultOptions = config.defaultOptions || {};
1975 - this.#queryDefaults = /* @__PURE__ */ new Map();
1976 - this.#mutationDefaults = /* @__PURE__ */ new Map();
1977 - this.#mountCount = 0;
1978 - }
1979 - mount() {
1980 - this.#mountCount++;
1981 - if (this.#mountCount !== 1) return;
1982 - this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {
1983 - if (focused) {
1984 - await this.resumePausedMutations();
1985 - this.#queryCache.onFocus();
1986 - }
1987 - });
1988 - this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {
1989 - if (online) {
1990 - await this.resumePausedMutations();
1991 - this.#queryCache.onOnline();
1992 - }
1993 - });
1994 - }
1995 - unmount() {
1996 - this.#mountCount--;
1997 - if (this.#mountCount !== 0) return;
1998 - this.#unsubscribeFocus?.();
1999 - this.#unsubscribeFocus = void 0;
2000 - this.#unsubscribeOnline?.();
2001 - this.#unsubscribeOnline = void 0;
2002 - }
2003 - isFetching(filters) {
2004 - return this.#queryCache.findAll({
2005 - ...filters,
2006 - fetchStatus: "fetching"
2007 - }).length;
2008 - }
2009 - isMutating(filters) {
2010 - return this.#mutationCache.findAll({
2011 - ...filters,
2012 - status: "pending"
2013 - }).length;
2014 - }
2015 - /**
2016 - * Imperative (non-reactive) way to retrieve data for a QueryKey.
2017 - * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
2018 - *
2019 - * Hint: Do not use this function inside a component, because it won't receive updates.
2020 - * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
2021 - */
2022 - getQueryData(queryKey) {
2023 - const options = this.defaultQueryOptions({ queryKey });
2024 - return this.#queryCache.get(options.queryHash)?.state.data;
2025 - }
2026 - ensureQueryData(options) {
2027 - const defaultedOptions = this.defaultQueryOptions(options);
2028 - const query = this.#queryCache.build(this, defaultedOptions);
2029 - const cachedData = query.state.data;
2030 - if (cachedData === void 0) return this.fetchQuery(options);
2031 - if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) this.prefetchQuery(defaultedOptions);
2032 - return Promise.resolve(cachedData);
2033 - }
2034 - getQueriesData(filters) {
2035 - return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {
2036 - return [queryKey, state.data];
2037 - });
2038 - }
2039 - setQueryData(queryKey, updater, options) {
2040 - const defaultedOptions = this.defaultQueryOptions({ queryKey });
2041 - const prevData = this.#queryCache.get(defaultedOptions.queryHash)?.state.data;
2042 - const data = functionalUpdate(updater, prevData);
2043 - if (data === void 0) return;
2044 - return this.#queryCache.build(this, defaultedOptions).setData(data, {
2045 - ...options,
2046 - manual: true
2047 - });
2048 - }
2049 - setQueriesData(filters, updater, options) {
2050 - return notifyManager.batch(() => this.#queryCache.findAll(filters).map(({ queryKey }) => [queryKey, this.setQueryData(queryKey, updater, options)]));
2051 - }
2052 - getQueryState(queryKey) {
2053 - const options = this.defaultQueryOptions({ queryKey });
2054 - return this.#queryCache.get(options.queryHash)?.state;
2055 - }
2056 - removeQueries(filters) {
2057 - const queryCache = this.#queryCache;
2058 - notifyManager.batch(() => {
2059 - queryCache.findAll(filters).forEach((query) => {
2060 - queryCache.remove(query);
2061 - });
2062 - });
2063 - }
2064 - resetQueries(filters, options) {
2065 - const queryCache = this.#queryCache;
2066 - return notifyManager.batch(() => {
2067 - queryCache.findAll(filters).forEach((query) => {
2068 - query.reset();
2069 - });
2070 - return this.refetchQueries({
2071 - type: "active",
2072 - ...filters
2073 - }, options);
2074 - });
2075 - }
2076 - cancelQueries(filters, cancelOptions = {}) {
2077 - const defaultedCancelOptions = {
2078 - revert: true,
2079 - ...cancelOptions
2080 - };
2081 - const promises = notifyManager.batch(() => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)));
2082 - return Promise.all(promises).then(noop).catch(noop);
2083 - }
2084 - invalidateQueries(filters, options = {}) {
2085 - return notifyManager.batch(() => {
2086 - this.#queryCache.findAll(filters).forEach((query) => {
2087 - query.invalidate();
2088 - });
2089 - if (filters?.refetchType === "none") return Promise.resolve();
2090 - return this.refetchQueries({
2091 - ...filters,
2092 - type: filters?.refetchType ?? filters?.type ?? "active"
2093 - }, options);
2094 - });
2095 - }
2096 - refetchQueries(filters, options = {}) {
2097 - const fetchOptions = {
2098 - ...options,
2099 - cancelRefetch: options.cancelRefetch ?? true
2100 - };
2101 - const promises = notifyManager.batch(() => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => {
2102 - let promise = query.fetch(void 0, fetchOptions);
2103 - if (!fetchOptions.throwOnError) promise = promise.catch(noop);
2104 - return query.state.fetchStatus === "paused" ? Promise.resolve() : promise;
2105 - }));
2106 - return Promise.all(promises).then(noop);
2107 - }
2108 - fetchQuery(options) {
2109 - const defaultedOptions = this.defaultQueryOptions(options);
2110 - if (defaultedOptions.retry === void 0) defaultedOptions.retry = false;
2111 - const query = this.#queryCache.build(this, defaultedOptions);
2112 - return query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query)) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);
2113 - }
2114 - prefetchQuery(options) {
2115 - return this.fetchQuery(options).then(noop).catch(noop);
2116 - }
2117 - fetchInfiniteQuery(options) {
2118 - options.behavior = infiniteQueryBehavior(options.pages);
2119 - return this.fetchQuery(options);
2120 - }
2121 - prefetchInfiniteQuery(options) {
2122 - return this.fetchInfiniteQuery(options).then(noop).catch(noop);
2123 - }
2124 - ensureInfiniteQueryData(options) {
2125 - options.behavior = infiniteQueryBehavior(options.pages);
2126 - return this.ensureQueryData(options);
2127 - }
2128 - resumePausedMutations() {
2129 - if (onlineManager.isOnline()) return this.#mutationCache.resumePausedMutations();
2130 - return Promise.resolve();
2131 - }
2132 - getQueryCache() {
2133 - return this.#queryCache;
2134 - }
2135 - getMutationCache() {
2136 - return this.#mutationCache;
2137 - }
2138 - getDefaultOptions() {
2139 - return this.#defaultOptions;
2140 - }
2141 - setDefaultOptions(options) {
2142 - this.#defaultOptions = options;
2143 - }
2144 - setQueryDefaults(queryKey, options) {
2145 - this.#queryDefaults.set(hashKey(queryKey), {
2146 - queryKey,
2147 - defaultOptions: options
2148 - });
2149 - }
2150 - getQueryDefaults(queryKey) {
2151 - const defaults = [...this.#queryDefaults.values()];
2152 - const result = {};
2153 - defaults.forEach((queryDefault) => {
2154 - if (partialMatchKey(queryKey, queryDefault.queryKey)) Object.assign(result, queryDefault.defaultOptions);
2155 - });
2156 - return result;
2157 - }
2158 - setMutationDefaults(mutationKey, options) {
2159 - this.#mutationDefaults.set(hashKey(mutationKey), {
2160 - mutationKey,
2161 - defaultOptions: options
2162 - });
2163 - }
2164 - getMutationDefaults(mutationKey) {
2165 - const defaults = [...this.#mutationDefaults.values()];
2166 - const result = {};
2167 - defaults.forEach((queryDefault) => {
2168 - if (partialMatchKey(mutationKey, queryDefault.mutationKey)) Object.assign(result, queryDefault.defaultOptions);
2169 - });
2170 - return result;
2171 - }
2172 - defaultQueryOptions(options) {
2173 - if (options._defaulted) return options;
2174 - const defaultedOptions = {
2175 - ...this.#defaultOptions.queries,
2176 - ...this.getQueryDefaults(options.queryKey),
2177 - ...options,
2178 - _defaulted: true
2179 - };
2180 - if (!defaultedOptions.queryHash) defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions);
2181 - if (defaultedOptions.refetchOnReconnect === void 0) defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always";
2182 - if (defaultedOptions.throwOnError === void 0) defaultedOptions.throwOnError = !!defaultedOptions.suspense;
2183 - if (!defaultedOptions.networkMode && defaultedOptions.persister) defaultedOptions.networkMode = "offlineFirst";
2184 - if (defaultedOptions.queryFn === skipToken) defaultedOptions.enabled = false;
2185 - return defaultedOptions;
2186 - }
2187 - defaultMutationOptions(options) {
2188 - if (options?._defaulted) return options;
2189 - return {
2190 - ...this.#defaultOptions.mutations,
2191 - ...options?.mutationKey && this.getMutationDefaults(options.mutationKey),
2192 - ...options,
2193 - _defaulted: true
2194 - };
2195 - }
2196 - clear() {
2197 - this.#queryCache.clear();
2198 - this.#mutationCache.clear();
2199 - }
2200 - };
90 +var useState = React.useState,
91 + useEffect = React.useEffect,
92 + useLayoutEffect = React.useLayoutEffect,
93 + useDebugValue = React.useDebugValue;
94 +var didWarnOld18Alpha = false;
95 +var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works
96 +// because of a very particular set of implementation details and assumptions
97 +// -- change any one of them and it will break. The most important assumption
98 +// is that updates are always synchronous, because concurrent rendering is
99 +// only available in versions of React that also have a built-in
100 +// useSyncExternalStore API. And we only use this shim when the built-in API
101 +// does not exist.
102 +//
103 +// Do not assume that the clever hacks used by this hook also work in general.
104 +// The point of this shim is to replace the need for hacks by other libraries.
2201 105
2202 -//#endregion
2203 -//#region node_modules/react/cjs/react-jsx-runtime.development.js
106 +function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
107 +// React do not expose a way to check if we're hydrating. So users of the shim
108 +// will need to track that themselves and return the correct value
109 +// from `getSnapshot`.
110 +getServerSnapshot) {
111 + {
112 + if (!didWarnOld18Alpha) {
113 + if (React.startTransition !== undefined) {
114 + didWarnOld18Alpha = true;
115 +
116 + error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');
117 + }
118 + }
119 + } // Read the current snapshot from the store on every render. Again, this
120 + // breaks the rules of React, and only works here because of specific
121 + // implementation details, most importantly that updates are
122 + // always synchronous.
123 +
124 +
125 + var value = getSnapshot();
126 +
127 + {
128 + if (!didWarnUncachedGetSnapshot) {
129 + var cachedValue = getSnapshot();
130 +
131 + if (!objectIs(value, cachedValue)) {
132 + error('The result of getSnapshot should be cached to avoid an infinite loop');
133 +
134 + didWarnUncachedGetSnapshot = true;
135 + }
136 + }
137 + } // Because updates are synchronous, we don't queue them. Instead we force a
138 + // re-render whenever the subscribed state changes by updating an some
139 + // arbitrary useState hook. Then, during render, we call getSnapshot to read
140 + // the current value.
141 + //
142 + // Because we don't actually use the state returned by the useState hook, we
143 + // can save a bit of memory by storing other stuff in that slot.
144 + //
145 + // To implement the early bailout, we need to track some things on a mutable
146 + // object. Usually, we would put that in a useRef hook, but we can stash it in
147 + // our useState hook instead.
148 + //
149 + // To force a re-render, we call forceUpdate({inst}). That works because the
150 + // new object always fails an equality check.
151 +
152 +
153 + var _useState = useState({
154 + inst: {
155 + value: value,
156 + getSnapshot: getSnapshot
157 + }
158 + }),
159 + inst = _useState[0].inst,
160 + forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated
161 + // in the layout phase so we can access it during the tearing check that
162 + // happens on subscribe.
163 +
164 +
165 + useLayoutEffect(function () {
166 + inst.value = value;
167 + inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the
168 + // commit phase if there was an interleaved mutation. In concurrent mode
169 + // this can happen all the time, but even in synchronous mode, an earlier
170 + // effect may have mutated the store.
171 +
172 + if (checkIfSnapshotChanged(inst)) {
173 + // Force a re-render.
174 + forceUpdate({
175 + inst: inst
176 + });
177 + }
178 + }, [subscribe, value, getSnapshot]);
179 + useEffect(function () {
180 + // Check for changes right before subscribing. Subsequent changes will be
181 + // detected in the subscription handler.
182 + if (checkIfSnapshotChanged(inst)) {
183 + // Force a re-render.
184 + forceUpdate({
185 + inst: inst
186 + });
187 + }
188 +
189 + var handleStoreChange = function () {
190 + // TODO: Because there is no cross-renderer API for batching updates, it's
191 + // up to the consumer of this library to wrap their subscription event
192 + // with unstable_batchedUpdates. Should we try to detect when this isn't
193 + // the case and print a warning in development?
194 + // The store changed. Check if the snapshot changed since the last time we
195 + // read from the store.
196 + if (checkIfSnapshotChanged(inst)) {
197 + // Force a re-render.
198 + forceUpdate({
199 + inst: inst
200 + });
201 + }
202 + }; // Subscribe to the store and return a clean-up function.
203 +
204 +
205 + return subscribe(handleStoreChange);
206 + }, [subscribe]);
207 + useDebugValue(value);
208 + return value;
209 +}
210 +
211 +function checkIfSnapshotChanged(inst) {
212 + var latestGetSnapshot = inst.getSnapshot;
213 + var prevValue = inst.value;
214 +
215 + try {
216 + var nextValue = latestGetSnapshot();
217 + return !objectIs(prevValue, nextValue);
218 + } catch (error) {
219 + return true;
220 + }
221 +}
222 +
223 +function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
224 + // Note: The shim does not use getServerSnapshot, because pre-18 versions of
225 + // React do not expose a way to check if we're hydrating. So users of the shim
226 + // will need to track that themselves and return the correct value
227 + // from `getSnapshot`.
228 + return getSnapshot();
229 +}
230 +
231 +var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
232 +
233 +var isServerEnvironment = !canUseDOM;
234 +
235 +var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
236 +var useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;
237 +
238 +exports.useSyncExternalStore = useSyncExternalStore$2;
239 + /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
240 +if (
241 + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
242 + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
243 + 'function'
244 +) {
245 + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
246 +}
247 +
248 + })();
249 +}
250 +
251 +
252 +/***/ }),
253 +
254 +/***/ "./node_modules/use-sync-external-store/shim/index.js":
255 +/*!************************************************************!*\
256 + !*** ./node_modules/use-sync-external-store/shim/index.js ***!
257 + \************************************************************/
258 +/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
259 +
260 +
261 +
262 +if (false) {} else {
263 + module.exports = __webpack_require__(/*! ../cjs/use-sync-external-store-shim.development.js */ "./node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js");
264 +}
265 +
266 +
267 +/***/ }),
268 +
269 +/***/ "react":
270 +/*!**************************!*\
271 + !*** external ["React"] ***!
272 + \**************************/
273 +/***/ (function(module) {
274 +
275 +module.exports = window["React"];
276 +
277 +/***/ }),
278 +
279 +/***/ "./node_modules/@tanstack/query-core/build/lib/focusManager.mjs":
280 +/*!**********************************************************************!*\
281 + !*** ./node_modules/@tanstack/query-core/build/lib/focusManager.mjs ***!
282 + \**********************************************************************/
283 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
284 +
285 +__webpack_require__.r(__webpack_exports__);
286 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
287 +/* harmony export */ FocusManager: function() { return /* binding */ FocusManager; },
288 +/* harmony export */ focusManager: function() { return /* binding */ focusManager; }
289 +/* harmony export */ });
290 +/* harmony import */ var _subscribable_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./subscribable.mjs */ "./node_modules/@tanstack/query-core/build/lib/subscribable.mjs");
291 +/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@tanstack/query-core/build/lib/utils.mjs");
292 +
293 +
294 +
295 +class FocusManager extends _subscribable_mjs__WEBPACK_IMPORTED_MODULE_0__.Subscribable {
296 + constructor() {
297 + super();
298 +
299 + this.setup = onFocus => {
300 + // addEventListener does not exist in React Native, but window does
301 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
302 + if (!_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.isServer && window.addEventListener) {
303 + const listener = () => onFocus(); // Listen to visibillitychange and focus
304 +
305 +
306 + window.addEventListener('visibilitychange', listener, false);
307 + window.addEventListener('focus', listener, false);
308 + return () => {
309 + // Be sure to unsubscribe if a new handler is set
310 + window.removeEventListener('visibilitychange', listener);
311 + window.removeEventListener('focus', listener);
312 + };
313 + }
314 +
315 + return;
316 + };
317 + }
318 +
319 + onSubscribe() {
320 + if (!this.cleanup) {
321 + this.setEventListener(this.setup);
322 + }
323 + }
324 +
325 + onUnsubscribe() {
326 + if (!this.hasListeners()) {
327 + var _this$cleanup;
328 +
329 + (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this);
330 + this.cleanup = undefined;
331 + }
332 + }
333 +
334 + setEventListener(setup) {
335 + var _this$cleanup2;
336 +
337 + this.setup = setup;
338 + (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this);
339 + this.cleanup = setup(focused => {
340 + if (typeof focused === 'boolean') {
341 + this.setFocused(focused);
342 + } else {
343 + this.onFocus();
344 + }
345 + });
346 + }
347 +
348 + setFocused(focused) {
349 + const changed = this.focused !== focused;
350 +
351 + if (changed) {
352 + this.focused = focused;
353 + this.onFocus();
354 + }
355 + }
356 +
357 + onFocus() {
358 + this.listeners.forEach(({
359 + listener
360 + }) => {
361 + listener();
362 + });
363 + }
364 +
365 + isFocused() {
366 + if (typeof this.focused === 'boolean') {
367 + return this.focused;
368 + } // document global can be unavailable in react native
369 +
370 +
371 + if (typeof document === 'undefined') {
372 + return true;
373 + }
374 +
375 + return [undefined, 'visible', 'prerender'].includes(document.visibilityState);
376 + }
377 +
378 +}
379 +const focusManager = new FocusManager();
380 +
381 +
382 +//# sourceMappingURL=focusManager.mjs.map
383 +
384 +
385 +/***/ }),
386 +
387 +/***/ "./node_modules/@tanstack/query-core/build/lib/infiniteQueryBehavior.mjs":
388 +/*!*******************************************************************************!*\
389 + !*** ./node_modules/@tanstack/query-core/build/lib/infiniteQueryBehavior.mjs ***!
390 + \*******************************************************************************/
391 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
392 +
393 +__webpack_require__.r(__webpack_exports__);
394 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
395 +/* harmony export */ getNextPageParam: function() { return /* binding */ getNextPageParam; },
396 +/* harmony export */ getPreviousPageParam: function() { return /* binding */ getPreviousPageParam; },
397 +/* harmony export */ hasNextPage: function() { return /* binding */ hasNextPage; },
398 +/* harmony export */ hasPreviousPage: function() { return /* binding */ hasPreviousPage; },
399 +/* harmony export */ infiniteQueryBehavior: function() { return /* binding */ infiniteQueryBehavior; }
400 +/* harmony export */ });
401 +function infiniteQueryBehavior() {
402 + return {
403 + onFetch: context => {
404 + context.fetchFn = () => {
405 + var _context$fetchOptions, _context$fetchOptions2, _context$fetchOptions3, _context$fetchOptions4, _context$state$data, _context$state$data2;
406 +
407 + const refetchPage = (_context$fetchOptions = context.fetchOptions) == null ? void 0 : (_context$fetchOptions2 = _context$fetchOptions.meta) == null ? void 0 : _context$fetchOptions2.refetchPage;
408 + const fetchMore = (_context$fetchOptions3 = context.fetchOptions) == null ? void 0 : (_context$fetchOptions4 = _context$fetchOptions3.meta) == null ? void 0 : _context$fetchOptions4.fetchMore;
409 + const pageParam = fetchMore == null ? void 0 : fetchMore.pageParam;
410 + const isFetchingNextPage = (fetchMore == null ? void 0 : fetchMore.direction) === 'forward';
411 + const isFetchingPreviousPage = (fetchMore == null ? void 0 : fetchMore.direction) === 'backward';
412 + const oldPages = ((_context$state$data = context.state.data) == null ? void 0 : _context$state$data.pages) || [];
413 + const oldPageParams = ((_context$state$data2 = context.state.data) == null ? void 0 : _context$state$data2.pageParams) || [];
414 + let newPageParams = oldPageParams;
415 + let cancelled = false;
416 +
417 + const addSignalProperty = object => {
418 + Object.defineProperty(object, 'signal', {
419 + enumerable: true,
420 + get: () => {
421 + var _context$signal;
422 +
423 + if ((_context$signal = context.signal) != null && _context$signal.aborted) {
424 + cancelled = true;
425 + } else {
426 + var _context$signal2;
427 +
428 + (_context$signal2 = context.signal) == null ? void 0 : _context$signal2.addEventListener('abort', () => {
429 + cancelled = true;
430 + });
431 + }
432 +
433 + return context.signal;
434 + }
435 + });
436 + }; // Get query function
437 +
438 +
439 + const queryFn = context.options.queryFn || (() => Promise.reject("Missing queryFn for queryKey '" + context.options.queryHash + "'"));
440 +
441 + const buildNewPages = (pages, param, page, previous) => {
442 + newPageParams = previous ? [param, ...newPageParams] : [...newPageParams, param];
443 + return previous ? [page, ...pages] : [...pages, page];
444 + }; // Create function to fetch a page
445 +
446 +
447 + const fetchPage = (pages, manual, param, previous) => {
448 + if (cancelled) {
449 + return Promise.reject('Cancelled');
450 + }
451 +
452 + if (typeof param === 'undefined' && !manual && pages.length) {
453 + return Promise.resolve(pages);
454 + }
455 +
456 + const queryFnContext = {
457 + queryKey: context.queryKey,
458 + pageParam: param,
459 + meta: context.options.meta
460 + };
461 + addSignalProperty(queryFnContext);
462 + const queryFnResult = queryFn(queryFnContext);
463 + const promise = Promise.resolve(queryFnResult).then(page => buildNewPages(pages, param, page, previous));
464 + return promise;
465 + };
466 +
467 + let promise; // Fetch first page?
468 +
469 + if (!oldPages.length) {
470 + promise = fetchPage([]);
471 + } // Fetch next page?
472 + else if (isFetchingNextPage) {
473 + const manual = typeof pageParam !== 'undefined';
474 + const param = manual ? pageParam : getNextPageParam(context.options, oldPages);
475 + promise = fetchPage(oldPages, manual, param);
476 + } // Fetch previous page?
477 + else if (isFetchingPreviousPage) {
478 + const manual = typeof pageParam !== 'undefined';
479 + const param = manual ? pageParam : getPreviousPageParam(context.options, oldPages);
480 + promise = fetchPage(oldPages, manual, param, true);
481 + } // Refetch pages
482 + else {
483 + newPageParams = [];
484 + const manual = typeof context.options.getNextPageParam === 'undefined';
485 + const shouldFetchFirstPage = refetchPage && oldPages[0] ? refetchPage(oldPages[0], 0, oldPages) : true; // Fetch first page
486 +
487 + promise = shouldFetchFirstPage ? fetchPage([], manual, oldPageParams[0]) : Promise.resolve(buildNewPages([], oldPageParams[0], oldPages[0])); // Fetch remaining pages
488 +
489 + for (let i = 1; i < oldPages.length; i++) {
490 + promise = promise.then(pages => {
491 + const shouldFetchNextPage = refetchPage && oldPages[i] ? refetchPage(oldPages[i], i, oldPages) : true;
492 +
493 + if (shouldFetchNextPage) {
494 + const param = manual ? oldPageParams[i] : getNextPageParam(context.options, pages);
495 + return fetchPage(pages, manual, param);
496 + }
497 +
498 + return Promise.resolve(buildNewPages(pages, oldPageParams[i], oldPages[i]));
499 + });
500 + }
501 + }
502 +
503 + const finalPromise = promise.then(pages => ({
504 + pages,
505 + pageParams: newPageParams
506 + }));
507 + return finalPromise;
508 + };
509 + }
510 + };
511 +}
512 +function getNextPageParam(options, pages) {
513 + return options.getNextPageParam == null ? void 0 : options.getNextPageParam(pages[pages.length - 1], pages);
514 +}
515 +function getPreviousPageParam(options, pages) {
516 + return options.getPreviousPageParam == null ? void 0 : options.getPreviousPageParam(pages[0], pages);
517 +}
2204 518 /**
2205 - * @license React
2206 - * react-jsx-runtime.development.js
2207 - *
2208 - * Copyright (c) Facebook, Inc. and its affiliates.
2209 - *
2210 - * This source code is licensed under the MIT license found in the
2211 - * LICENSE file in the root directory of this source tree.
2212 - */
2213 - var require_react_jsx_runtime_development = /* @__PURE__ */ __commonJSMin(((exports) => {
2214 - (function() {
2215 - "use strict";
2216 - var React = (globalThis.React);
2217 - var REACT_ELEMENT_TYPE = Symbol.for("react.element");
2218 - var REACT_PORTAL_TYPE = Symbol.for("react.portal");
2219 - var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
2220 - var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
2221 - var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
2222 - var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
2223 - var REACT_CONTEXT_TYPE = Symbol.for("react.context");
2224 - var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
2225 - var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
2226 - var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
2227 - var REACT_MEMO_TYPE = Symbol.for("react.memo");
2228 - var REACT_LAZY_TYPE = Symbol.for("react.lazy");
2229 - var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
2230 - var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
2231 - var FAUX_ITERATOR_SYMBOL = "@@iterator";
2232 - function getIteratorFn(maybeIterable) {
2233 - if (maybeIterable === null || typeof maybeIterable !== "object") return null;
2234 - var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
2235 - if (typeof maybeIterator === "function") return maybeIterator;
2236 - return null;
2237 - }
2238 - var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2239 - function error(format) {
2240 - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
2241 - printWarning("error", format, args);
2242 - }
2243 - function printWarning(level, format, args) {
2244 - var stack = ReactSharedInternals.ReactDebugCurrentFrame.getStackAddendum();
2245 - if (stack !== "") {
2246 - format += "%s";
2247 - args = args.concat([stack]);
2248 - }
2249 - var argsWithFormat = args.map(function(item) {
2250 - return String(item);
2251 - });
2252 - argsWithFormat.unshift("Warning: " + format);
2253 - Function.prototype.apply.call(console[level], console, argsWithFormat);
2254 - }
2255 - var enableScopeAPI = false;
2256 - var enableCacheElement = false;
2257 - var enableTransitionTracing = false;
2258 - var enableLegacyHidden = false;
2259 - var enableDebugTracing = false;
2260 - var REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
2261 - function isValidElementType(type) {
2262 - if (typeof type === "string" || typeof type === "function") return true;
2263 - if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) return true;
2264 - if (typeof type === "object" && type !== null) {
2265 - if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) return true;
2266 - }
2267 - return false;
2268 - }
2269 - function getWrappedName(outerType, innerType, wrapperName) {
2270 - var displayName = outerType.displayName;
2271 - if (displayName) return displayName;
2272 - var functionName = innerType.displayName || innerType.name || "";
2273 - return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
2274 - }
2275 - function getContextName(type) {
2276 - return type.displayName || "Context";
2277 - }
2278 - function getComponentNameFromType(type) {
2279 - if (type == null) return null;
2280 - if (typeof type.tag === "number") error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
2281 - if (typeof type === "function") return type.displayName || type.name || null;
2282 - if (typeof type === "string") return type;
2283 - switch (type) {
2284 - case REACT_FRAGMENT_TYPE: return "Fragment";
2285 - case REACT_PORTAL_TYPE: return "Portal";
2286 - case REACT_PROFILER_TYPE: return "Profiler";
2287 - case REACT_STRICT_MODE_TYPE: return "StrictMode";
2288 - case REACT_SUSPENSE_TYPE: return "Suspense";
2289 - case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList";
2290 - }
2291 - if (typeof type === "object") switch (type.$$typeof) {
2292 - case REACT_CONTEXT_TYPE: return getContextName(type) + ".Consumer";
2293 - case REACT_PROVIDER_TYPE: return getContextName(type._context) + ".Provider";
2294 - case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, "ForwardRef");
2295 - case REACT_MEMO_TYPE:
2296 - var outerName = type.displayName || null;
2297 - if (outerName !== null) return outerName;
2298 - return getComponentNameFromType(type.type) || "Memo";
2299 - case REACT_LAZY_TYPE:
2300 - var lazyComponent = type;
2301 - var payload = lazyComponent._payload;
2302 - var init = lazyComponent._init;
2303 - try {
2304 - return getComponentNameFromType(init(payload));
2305 - } catch (x) {
2306 - return null;
2307 - }
2308 - }
2309 - return null;
2310 - }
2311 - var assign = Object.assign;
2312 - var disabledDepth = 0;
2313 - var prevLog;
2314 - var prevInfo;
2315 - var prevWarn;
2316 - var prevError;
2317 - var prevGroup;
2318 - var prevGroupCollapsed;
2319 - var prevGroupEnd;
2320 - function disabledLog() {}
2321 - disabledLog.__reactDisabledLog = true;
2322 - function disableLogs() {
2323 - if (disabledDepth === 0) {
2324 - prevLog = console.log;
2325 - prevInfo = console.info;
2326 - prevWarn = console.warn;
2327 - prevError = console.error;
2328 - prevGroup = console.group;
2329 - prevGroupCollapsed = console.groupCollapsed;
2330 - prevGroupEnd = console.groupEnd;
2331 - var props = {
2332 - configurable: true,
2333 - enumerable: true,
2334 - value: disabledLog,
2335 - writable: true
2336 - };
2337 - Object.defineProperties(console, {
2338 - info: props,
2339 - log: props,
2340 - warn: props,
2341 - error: props,
2342 - group: props,
2343 - groupCollapsed: props,
2344 - groupEnd: props
2345 - });
2346 - }
2347 - disabledDepth++;
2348 - }
2349 - function reenableLogs() {
2350 - disabledDepth--;
2351 - if (disabledDepth === 0) {
2352 - var props = {
2353 - configurable: true,
2354 - enumerable: true,
2355 - writable: true
2356 - };
2357 - Object.defineProperties(console, {
2358 - log: assign({}, props, { value: prevLog }),
2359 - info: assign({}, props, { value: prevInfo }),
2360 - warn: assign({}, props, { value: prevWarn }),
2361 - error: assign({}, props, { value: prevError }),
2362 - group: assign({}, props, { value: prevGroup }),
2363 - groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
2364 - groupEnd: assign({}, props, { value: prevGroupEnd })
2365 - });
2366 - }
2367 - if (disabledDepth < 0) error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
2368 - }
2369 - var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
2370 - var prefix;
2371 - function describeBuiltInComponentFrame(name, source, ownerFn) {
2372 - if (prefix === void 0) try {
2373 - throw Error();
2374 - } catch (x) {
2375 - var match = x.stack.trim().match(/\n( *(at )?)/);
2376 - prefix = match && match[1] || "";
2377 - }
2378 - return "\n" + prefix + name;
2379 - }
2380 - var reentry = false;
2381 - var componentFrameCache = new (typeof WeakMap === "function" ? WeakMap : Map)();
2382 - function describeNativeComponentFrame(fn, construct) {
2383 - if (!fn || reentry) return "";
2384 - var frame = componentFrameCache.get(fn);
2385 - if (frame !== void 0) return frame;
2386 - var control;
2387 - reentry = true;
2388 - var previousPrepareStackTrace = Error.prepareStackTrace;
2389 - Error.prepareStackTrace = void 0;
2390 - var previousDispatcher = ReactCurrentDispatcher.current;
2391 - ReactCurrentDispatcher.current = null;
2392 - disableLogs();
2393 - try {
2394 - if (construct) {
2395 - var Fake = function() {
2396 - throw Error();
2397 - };
2398 - Object.defineProperty(Fake.prototype, "props", { set: function() {
2399 - throw Error();
2400 - } });
2401 - if (typeof Reflect === "object" && Reflect.construct) {
2402 - try {
2403 - Reflect.construct(Fake, []);
2404 - } catch (x) {
2405 - control = x;
2406 - }
2407 - Reflect.construct(fn, [], Fake);
2408 - } else {
2409 - try {
2410 - Fake.call();
2411 - } catch (x) {
2412 - control = x;
2413 - }
2414 - fn.call(Fake.prototype);
2415 - }
2416 - } else {
2417 - try {
2418 - throw Error();
2419 - } catch (x) {
2420 - control = x;
2421 - }
2422 - fn();
2423 - }
2424 - } catch (sample) {
2425 - if (sample && control && typeof sample.stack === "string") {
2426 - var sampleLines = sample.stack.split("\n");
2427 - var controlLines = control.stack.split("\n");
2428 - var s = sampleLines.length - 1;
2429 - var c = controlLines.length - 1;
2430 - while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) c--;
2431 - for (; s >= 1 && c >= 0; s--, c--) if (sampleLines[s] !== controlLines[c]) {
2432 - if (s !== 1 || c !== 1) do {
2433 - s--;
2434 - c--;
2435 - if (c < 0 || sampleLines[s] !== controlLines[c]) {
2436 - var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
2437 - if (fn.displayName && _frame.includes("<anonymous>")) _frame = _frame.replace("<anonymous>", fn.displayName);
2438 - if (typeof fn === "function") componentFrameCache.set(fn, _frame);
2439 - return _frame;
2440 - }
2441 - } while (s >= 1 && c >= 0);
2442 - break;
2443 - }
2444 - }
2445 - } finally {
2446 - reentry = false;
2447 - ReactCurrentDispatcher.current = previousDispatcher;
2448 - reenableLogs();
2449 - Error.prepareStackTrace = previousPrepareStackTrace;
2450 - }
2451 - var name = fn ? fn.displayName || fn.name : "";
2452 - var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
2453 - if (typeof fn === "function") componentFrameCache.set(fn, syntheticFrame);
2454 - return syntheticFrame;
2455 - }
2456 - function describeFunctionComponentFrame(fn, source, ownerFn) {
2457 - return describeNativeComponentFrame(fn, false);
2458 - }
2459 - function shouldConstruct(Component) {
2460 - var prototype = Component.prototype;
2461 - return !!(prototype && prototype.isReactComponent);
2462 - }
2463 - function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
2464 - if (type == null) return "";
2465 - if (typeof type === "function") return describeNativeComponentFrame(type, shouldConstruct(type));
2466 - if (typeof type === "string") return describeBuiltInComponentFrame(type);
2467 - switch (type) {
2468 - case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame("Suspense");
2469 - case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame("SuspenseList");
2470 - }
2471 - if (typeof type === "object") switch (type.$$typeof) {
2472 - case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render);
2473 - case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
2474 - case REACT_LAZY_TYPE:
2475 - var lazyComponent = type;
2476 - var payload = lazyComponent._payload;
2477 - var init = lazyComponent._init;
2478 - try {
2479 - return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
2480 - } catch (x) {}
2481 - }
2482 - return "";
2483 - }
2484 - var hasOwnProperty = Object.prototype.hasOwnProperty;
2485 - var loggedTypeFailures = {};
2486 - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
2487 - function setCurrentlyValidatingElement(element) {
2488 - if (element) {
2489 - var owner = element._owner;
2490 - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2491 - ReactDebugCurrentFrame.setExtraStackFrame(stack);
2492 - } else ReactDebugCurrentFrame.setExtraStackFrame(null);
2493 - }
2494 - function checkPropTypes(typeSpecs, values, location, componentName, element) {
2495 - var has = Function.call.bind(hasOwnProperty);
2496 - for (var typeSpecName in typeSpecs) if (has(typeSpecs, typeSpecName)) {
2497 - var error$1 = void 0;
2498 - try {
2499 - if (typeof typeSpecs[typeSpecName] !== "function") {
2500 - var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
2501 - err.name = "Invariant Violation";
2502 - throw err;
2503 - }
2504 - error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
2505 - } catch (ex) {
2506 - error$1 = ex;
2507 - }
2508 - if (error$1 && !(error$1 instanceof Error)) {
2509 - setCurrentlyValidatingElement(element);
2510 - error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
2511 - setCurrentlyValidatingElement(null);
2512 - }
2513 - if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
2514 - loggedTypeFailures[error$1.message] = true;
2515 - setCurrentlyValidatingElement(element);
2516 - error("Failed %s type: %s", location, error$1.message);
2517 - setCurrentlyValidatingElement(null);
2518 - }
2519 - }
2520 - }
2521 - var isArrayImpl = Array.isArray;
2522 - function isArray(a) {
2523 - return isArrayImpl(a);
2524 - }
2525 - function typeName(value) {
2526 - return typeof Symbol === "function" && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
2527 - }
2528 - function willCoercionThrow(value) {
2529 - try {
2530 - testStringCoercion(value);
2531 - return false;
2532 - } catch (e) {
2533 - return true;
2534 - }
2535 - }
2536 - function testStringCoercion(value) {
2537 - return "" + value;
2538 - }
2539 - function checkKeyStringCoercion(value) {
2540 - if (willCoercionThrow(value)) {
2541 - error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
2542 - return testStringCoercion(value);
2543 - }
2544 - }
2545 - var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
2546 - var RESERVED_PROPS = {
2547 - key: true,
2548 - ref: true,
2549 - __self: true,
2550 - __source: true
2551 - };
2552 - var specialPropKeyWarningShown;
2553 - var specialPropRefWarningShown;
2554 - var didWarnAboutStringRefs = {};
2555 - function hasValidRef(config) {
2556 - if (hasOwnProperty.call(config, "ref")) {
2557 - var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
2558 - if (getter && getter.isReactWarning) return false;
2559 - }
2560 - return config.ref !== void 0;
2561 - }
2562 - function hasValidKey(config) {
2563 - if (hasOwnProperty.call(config, "key")) {
2564 - var getter = Object.getOwnPropertyDescriptor(config, "key").get;
2565 - if (getter && getter.isReactWarning) return false;
2566 - }
2567 - return config.key !== void 0;
2568 - }
2569 - function warnIfStringRefCannotBeAutoConverted(config, self) {
2570 - if (typeof config.ref === "string" && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
2571 - var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
2572 - if (!didWarnAboutStringRefs[componentName]) {
2573 - error("Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref", getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
2574 - didWarnAboutStringRefs[componentName] = true;
2575 - }
2576 - }
2577 - }
2578 - function defineKeyPropWarningGetter(props, displayName) {
2579 - var warnAboutAccessingKey = function() {
2580 - if (!specialPropKeyWarningShown) {
2581 - specialPropKeyWarningShown = true;
2582 - error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
2583 - }
2584 - };
2585 - warnAboutAccessingKey.isReactWarning = true;
2586 - Object.defineProperty(props, "key", {
2587 - get: warnAboutAccessingKey,
2588 - configurable: true
2589 - });
2590 - }
2591 - function defineRefPropWarningGetter(props, displayName) {
2592 - var warnAboutAccessingRef = function() {
2593 - if (!specialPropRefWarningShown) {
2594 - specialPropRefWarningShown = true;
2595 - error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
2596 - }
2597 - };
2598 - warnAboutAccessingRef.isReactWarning = true;
2599 - Object.defineProperty(props, "ref", {
2600 - get: warnAboutAccessingRef,
2601 - configurable: true
2602 - });
2603 - }
2604 - /**
2605 - * Factory method to create a new React element. This no longer adheres to
2606 - * the class pattern, so do not use new to call it. Also, instanceof check
2607 - * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
2608 - * if something is a React Element.
2609 - *
2610 - * @param {*} type
2611 - * @param {*} props
2612 - * @param {*} key
2613 - * @param {string|object} ref
2614 - * @param {*} owner
2615 - * @param {*} self A *temporary* helper to detect places where `this` is
2616 - * different from the `owner` when React.createElement is called, so that we
2617 - * can warn. We want to get rid of owner and replace string `ref`s with arrow
2618 - * functions, and as long as `this` and owner are the same, there will be no
2619 - * change in behavior.
2620 - * @param {*} source An annotation object (added by a transpiler or otherwise)
2621 - * indicating filename, line number, and/or other information.
2622 - * @internal
2623 - */
2624 - var ReactElement = function(type, key, ref, self, source, owner, props) {
2625 - var element = {
2626 - $$typeof: REACT_ELEMENT_TYPE,
2627 - type,
2628 - key,
2629 - ref,
2630 - props,
2631 - _owner: owner
2632 - };
2633 - element._store = {};
2634 - Object.defineProperty(element._store, "validated", {
2635 - configurable: false,
2636 - enumerable: false,
2637 - writable: true,
2638 - value: false
2639 - });
2640 - Object.defineProperty(element, "_self", {
2641 - configurable: false,
2642 - enumerable: false,
2643 - writable: false,
2644 - value: self
2645 - });
2646 - Object.defineProperty(element, "_source", {
2647 - configurable: false,
2648 - enumerable: false,
2649 - writable: false,
2650 - value: source
2651 - });
2652 - if (Object.freeze) {
2653 - Object.freeze(element.props);
2654 - Object.freeze(element);
2655 - }
2656 - return element;
2657 - };
2658 - /**
2659 - * https://github.com/reactjs/rfcs/pull/107
2660 - * @param {*} type
2661 - * @param {object} props
2662 - * @param {string} key
2663 - */
2664 - function jsxDEV(type, config, maybeKey, source, self) {
2665 - var propName;
2666 - var props = {};
2667 - var key = null;
2668 - var ref = null;
2669 - if (maybeKey !== void 0) {
2670 - checkKeyStringCoercion(maybeKey);
2671 - key = "" + maybeKey;
2672 - }
2673 - if (hasValidKey(config)) {
2674 - checkKeyStringCoercion(config.key);
2675 - key = "" + config.key;
2676 - }
2677 - if (hasValidRef(config)) {
2678 - ref = config.ref;
2679 - warnIfStringRefCannotBeAutoConverted(config, self);
2680 - }
2681 - for (propName in config) if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) props[propName] = config[propName];
2682 - if (type && type.defaultProps) {
2683 - var defaultProps = type.defaultProps;
2684 - for (propName in defaultProps) if (props[propName] === void 0) props[propName] = defaultProps[propName];
2685 - }
2686 - if (key || ref) {
2687 - var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
2688 - if (key) defineKeyPropWarningGetter(props, displayName);
2689 - if (ref) defineRefPropWarningGetter(props, displayName);
2690 - }
2691 - return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
2692 - }
2693 - var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
2694 - var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
2695 - function setCurrentlyValidatingElement$1(element) {
2696 - if (element) {
2697 - var owner = element._owner;
2698 - var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2699 - ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
2700 - } else ReactDebugCurrentFrame$1.setExtraStackFrame(null);
2701 - }
2702 - var propTypesMisspellWarningShown = false;
2703 - /**
2704 - * Verifies the object is a ReactElement.
2705 - * See https://reactjs.org/docs/react-api.html#isvalidelement
2706 - * @param {?object} object
2707 - * @return {boolean} True if `object` is a ReactElement.
2708 - * @final
2709 - */
2710 - function isValidElement(object) {
2711 - return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
2712 - }
2713 - function getDeclarationErrorAddendum() {
2714 - if (ReactCurrentOwner$1.current) {
2715 - var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
2716 - if (name) return "\n\nCheck the render method of `" + name + "`.";
2717 - }
2718 - return "";
2719 - }
2720 - function getSourceInfoErrorAddendum(source) {
2721 - if (source !== void 0) {
2722 - var fileName = source.fileName.replace(/^.*[\\\/]/, "");
2723 - var lineNumber = source.lineNumber;
2724 - return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
2725 - }
2726 - return "";
2727 - }
2728 - /**
2729 - * Warn if there's no key explicitly set on dynamic arrays of children or
2730 - * object keys are not valid. This allows us to keep track of children between
2731 - * updates.
2732 - */
2733 - var ownerHasKeyUseWarning = {};
2734 - function getCurrentComponentErrorInfo(parentType) {
2735 - var info = getDeclarationErrorAddendum();
2736 - if (!info) {
2737 - var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
2738 - if (parentName) info = "\n\nCheck the top-level render call using <" + parentName + ">.";
2739 - }
2740 - return info;
2741 - }
2742 - /**
2743 - * Warn if the element doesn't have an explicit key assigned to it.
2744 - * This element is in an array. The array could grow and shrink or be
2745 - * reordered. All children that haven't already been validated are required to
2746 - * have a "key" property assigned to it. Error statuses are cached so a warning
2747 - * will only be shown once.
2748 - *
2749 - * @internal
2750 - * @param {ReactElement} element Element that requires a key.
2751 - * @param {*} parentType element's parent's type.
2752 - */
2753 - function validateExplicitKey(element, parentType) {
2754 - if (!element._store || element._store.validated || element.key != null) return;
2755 - element._store.validated = true;
2756 - var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
2757 - if (ownerHasKeyUseWarning[currentComponentErrorInfo]) return;
2758 - ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
2759 - var childOwner = "";
2760 - if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
2761 - setCurrentlyValidatingElement$1(element);
2762 - error("Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.", currentComponentErrorInfo, childOwner);
2763 - setCurrentlyValidatingElement$1(null);
2764 - }
2765 - /**
2766 - * Ensure that every element either is passed in a static location, in an
2767 - * array with an explicit keys property defined, or in an object literal
2768 - * with valid key property.
2769 - *
2770 - * @internal
2771 - * @param {ReactNode} node Statically passed child of any type.
2772 - * @param {*} parentType node's parent's type.
2773 - */
2774 - function validateChildKeys(node, parentType) {
2775 - if (typeof node !== "object") return;
2776 - if (isArray(node)) for (var i = 0; i < node.length; i++) {
2777 - var child = node[i];
2778 - if (isValidElement(child)) validateExplicitKey(child, parentType);
2779 - }
2780 - else if (isValidElement(node)) {
2781 - if (node._store) node._store.validated = true;
2782 - } else if (node) {
2783 - var iteratorFn = getIteratorFn(node);
2784 - if (typeof iteratorFn === "function") {
2785 - if (iteratorFn !== node.entries) {
2786 - var iterator = iteratorFn.call(node);
2787 - var step;
2788 - while (!(step = iterator.next()).done) if (isValidElement(step.value)) validateExplicitKey(step.value, parentType);
2789 - }
2790 - }
2791 - }
2792 - }
2793 - /**
2794 - * Given an element, validate that its props follow the propTypes definition,
2795 - * provided by the type.
2796 - *
2797 - * @param {ReactElement} element
2798 - */
2799 - function validatePropTypes(element) {
2800 - var type = element.type;
2801 - if (type === null || type === void 0 || typeof type === "string") return;
2802 - var propTypes;
2803 - if (typeof type === "function") propTypes = type.propTypes;
2804 - else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) propTypes = type.propTypes;
2805 - else return;
2806 - if (propTypes) {
2807 - var name = getComponentNameFromType(type);
2808 - checkPropTypes(propTypes, element.props, "prop", name, element);
2809 - } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
2810 - propTypesMisspellWarningShown = true;
2811 - error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", getComponentNameFromType(type) || "Unknown");
2812 - }
2813 - if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
2814 - }
2815 - /**
2816 - * Given a fragment, validate that it can only be provided with fragment props
2817 - * @param {ReactElement} fragment
2818 - */
2819 - function validateFragmentProps(fragment) {
2820 - var keys = Object.keys(fragment.props);
2821 - for (var i = 0; i < keys.length; i++) {
2822 - var key = keys[i];
2823 - if (key !== "children" && key !== "key") {
2824 - setCurrentlyValidatingElement$1(fragment);
2825 - error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
2826 - setCurrentlyValidatingElement$1(null);
2827 - break;
2828 - }
2829 - }
2830 - if (fragment.ref !== null) {
2831 - setCurrentlyValidatingElement$1(fragment);
2832 - error("Invalid attribute `ref` supplied to `React.Fragment`.");
2833 - setCurrentlyValidatingElement$1(null);
2834 - }
2835 - }
2836 - var didWarnAboutKeySpread = {};
2837 - function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
2838 - var validType = isValidElementType(type);
2839 - if (!validType) {
2840 - var info = "";
2841 - if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
2842 - var sourceInfo = getSourceInfoErrorAddendum(source);
2843 - if (sourceInfo) info += sourceInfo;
2844 - else info += getDeclarationErrorAddendum();
2845 - var typeString;
2846 - if (type === null) typeString = "null";
2847 - else if (isArray(type)) typeString = "array";
2848 - else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
2849 - typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
2850 - info = " Did you accidentally export a JSX literal instead of a component?";
2851 - } else typeString = typeof type;
2852 - error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
2853 - }
2854 - var element = jsxDEV(type, props, key, source, self);
2855 - if (element == null) return element;
2856 - if (validType) {
2857 - var children = props.children;
2858 - if (children !== void 0) if (isStaticChildren) if (isArray(children)) {
2859 - for (var i = 0; i < children.length; i++) validateChildKeys(children[i], type);
2860 - if (Object.freeze) Object.freeze(children);
2861 - } else error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
2862 - else validateChildKeys(children, type);
2863 - }
2864 - if (hasOwnProperty.call(props, "key")) {
2865 - var componentName = getComponentNameFromType(type);
2866 - var keys = Object.keys(props).filter(function(k) {
2867 - return k !== "key";
2868 - });
2869 - var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
2870 - if (!didWarnAboutKeySpread[componentName + beforeExample]) {
2871 - error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", beforeExample, componentName, keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}", componentName);
2872 - didWarnAboutKeySpread[componentName + beforeExample] = true;
2873 - }
2874 - }
2875 - if (type === REACT_FRAGMENT_TYPE) validateFragmentProps(element);
2876 - else validatePropTypes(element);
2877 - return element;
2878 - }
2879 - function jsxWithValidationStatic(type, props, key) {
2880 - return jsxWithValidation(type, props, key, true);
2881 - }
2882 - function jsxWithValidationDynamic(type, props, key) {
2883 - return jsxWithValidation(type, props, key, false);
2884 - }
2885 - var jsx = jsxWithValidationDynamic;
2886 - var jsxs = jsxWithValidationStatic;
2887 - exports.Fragment = REACT_FRAGMENT_TYPE;
2888 - exports.jsx = jsx;
2889 - exports.jsxs = jsxs;
2890 - })();
2891 - }));
519 + * Checks if there is a next page.
520 + * Returns `undefined` if it cannot be determined.
521 + */
2892 522
2893 -//#endregion
2894 -//#region node_modules/react/jsx-runtime.js
2895 - var require_jsx_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2896 - module.exports = require_react_jsx_runtime_development();
2897 - }));
523 +function hasNextPage(options, pages) {
524 + if (options.getNextPageParam && Array.isArray(pages)) {
525 + const nextPageParam = getNextPageParam(options, pages);
526 + return typeof nextPageParam !== 'undefined' && nextPageParam !== null && nextPageParam !== false;
527 + }
2898 528
2899 -//#endregion
2900 -//#region node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js
2901 - var import_jsx_runtime = require_jsx_runtime();
2902 - var QueryClientContext = react.createContext(void 0);
2903 - var useQueryClient = (queryClient) => {
2904 - const client = react.useContext(QueryClientContext);
2905 - if (queryClient) return queryClient;
2906 - if (!client) throw new Error("No QueryClient set, use QueryClientProvider to set one");
2907 - return client;
2908 - };
2909 - var QueryClientProvider = ({ client, children }) => {
2910 - react.useEffect(() => {
2911 - client.mount();
2912 - return () => {
2913 - client.unmount();
2914 - };
2915 - }, [client]);
2916 - return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QueryClientContext.Provider, {
2917 - value: client,
2918 - children
2919 - });
2920 - };
529 + return;
530 +}
531 +/**
532 + * Checks if there is a previous page.
533 + * Returns `undefined` if it cannot be determined.
534 + */
2921 535
2922 -//#endregion
2923 -//#region node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js
2924 - var IsRestoringContext = react.createContext(false);
2925 - var useIsRestoring = () => react.useContext(IsRestoringContext);
2926 - var IsRestoringProvider = IsRestoringContext.Provider;
536 +function hasPreviousPage(options, pages) {
537 + if (options.getPreviousPageParam && Array.isArray(pages)) {
538 + const previousPageParam = getPreviousPageParam(options, pages);
539 + return typeof previousPageParam !== 'undefined' && previousPageParam !== null && previousPageParam !== false;
540 + }
2927 541
2928 -//#endregion
2929 -//#region node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js
2930 - function createValue() {
2931 - let isReset = false;
2932 - return {
2933 - clearReset: () => {
2934 - isReset = false;
2935 - },
2936 - reset: () => {
2937 - isReset = true;
2938 - },
2939 - isReset: () => {
2940 - return isReset;
2941 - }
2942 - };
2943 - }
2944 - var QueryErrorResetBoundaryContext = react.createContext(createValue());
2945 - var useQueryErrorResetBoundary = () => react.useContext(QueryErrorResetBoundaryContext);
542 + return;
543 +}
2946 544
2947 -//#endregion
2948 -//#region node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js
2949 - var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {
2950 - if (options.suspense || options.throwOnError || options.experimental_prefetchInRender) {
2951 - if (!errorResetBoundary.isReset()) options.retryOnMount = false;
2952 - }
2953 - };
2954 - var useClearResetErrorBoundary = (errorResetBoundary) => {
2955 - react.useEffect(() => {
2956 - errorResetBoundary.clearReset();
2957 - }, [errorResetBoundary]);
2958 - };
2959 - var getHasError = ({ result, errorResetBoundary, throwOnError, query, suspense }) => {
2960 - return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));
2961 - };
2962 545
2963 -//#endregion
2964 -//#region node_modules/@tanstack/react-query/build/modern/suspense.js
2965 - var ensureSuspenseTimers = (defaultedOptions) => {
2966 - if (defaultedOptions.suspense) {
2967 - const MIN_SUSPENSE_TIME_MS = 1e3;
2968 - const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS);
2969 - const originalStaleTime = defaultedOptions.staleTime;
2970 - defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime);
2971 - if (typeof defaultedOptions.gcTime === "number") defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, MIN_SUSPENSE_TIME_MS);
2972 - }
2973 - };
2974 - var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;
2975 - var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;
2976 - var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {
2977 - errorResetBoundary.clearReset();
2978 - });
546 +//# sourceMappingURL=infiniteQueryBehavior.mjs.map
2979 547
2980 -//#endregion
2981 -//#region node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
2982 - function useBaseQuery(options, Observer, queryClient) {
2983 - if (typeof options !== "object" || Array.isArray(options)) throw new Error("Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object");
2984 - const isRestoring = useIsRestoring();
2985 - const errorResetBoundary = useQueryErrorResetBoundary();
2986 - const client = useQueryClient(queryClient);
2987 - const defaultedOptions = client.defaultQueryOptions(options);
2988 - client.getDefaultOptions().queries?._experimental_beforeQuery?.(defaultedOptions);
2989 - if (!defaultedOptions.queryFn) console.error(`[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`);
2990 - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic";
2991 - ensureSuspenseTimers(defaultedOptions);
2992 - ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary);
2993 - useClearResetErrorBoundary(errorResetBoundary);
2994 - const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash);
2995 - const [observer] = react.useState(() => new Observer(client, defaultedOptions));
2996 - const result = observer.getOptimisticResult(defaultedOptions);
2997 - const shouldSubscribe = !isRestoring && options.subscribed !== false;
2998 - react.useSyncExternalStore(react.useCallback((onStoreChange) => {
2999 - const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;
3000 - observer.updateResult();
3001 - return unsubscribe;
3002 - }, [observer, shouldSubscribe]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
3003 - react.useEffect(() => {
3004 - observer.setOptions(defaultedOptions);
3005 - }, [defaultedOptions, observer]);
3006 - if (shouldSuspend(defaultedOptions, result)) throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);
3007 - if (getHasError({
3008 - result,
3009 - errorResetBoundary,
3010 - throwOnError: defaultedOptions.throwOnError,
3011 - query: client.getQueryCache().get(defaultedOptions.queryHash),
3012 - suspense: defaultedOptions.suspense
3013 - })) throw result.error;
3014 - client.getDefaultOptions().queries?._experimental_afterQuery?.(defaultedOptions, result);
3015 - if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) (isNewCacheEntry ? fetchOptimistic(defaultedOptions, observer, errorResetBoundary) : client.getQueryCache().get(defaultedOptions.queryHash)?.promise)?.catch(noop).finally(() => {
3016 - observer.updateResult();
3017 - });
3018 - return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;
3019 - }
3020 548
3021 -//#endregion
3022 -//#region node_modules/@tanstack/react-query/build/modern/useQuery.js
3023 - function useQuery(options, queryClient) {
3024 - return useBaseQuery(options, QueryObserver, queryClient);
3025 - }
549 +/***/ }),
3026 550
3027 -//#endregion
3028 -//#region node_modules/@tanstack/react-query/build/modern/useMutationState.js
3029 - function useIsMutating(filters, queryClient) {
3030 - const client = useQueryClient(queryClient);
3031 - return useMutationState({ filters: {
3032 - ...filters,
3033 - status: "pending"
3034 - } }, client).length;
3035 - }
3036 - function getResult(mutationCache, options) {
3037 - return mutationCache.findAll(options.filters).map((mutation) => options.select ? options.select(mutation) : mutation.state);
3038 - }
3039 - function useMutationState(options = {}, queryClient) {
3040 - const mutationCache = useQueryClient(queryClient).getMutationCache();
3041 - const optionsRef = react.useRef(options);
3042 - const result = react.useRef(null);
3043 - if (result.current === null) result.current = getResult(mutationCache, options);
3044 - react.useEffect(() => {
3045 - optionsRef.current = options;
3046 - });
3047 - return react.useSyncExternalStore(react.useCallback((onStoreChange) => mutationCache.subscribe(() => {
3048 - const nextResult = replaceEqualDeep(result.current, getResult(mutationCache, optionsRef.current));
3049 - if (result.current !== nextResult) {
3050 - result.current = nextResult;
3051 - notifyManager.schedule(onStoreChange);
3052 - }
3053 - }), [mutationCache]), () => result.current, () => result.current);
3054 - }
551 +/***/ "./node_modules/@tanstack/query-core/build/lib/logger.mjs":
552 +/*!****************************************************************!*\
553 + !*** ./node_modules/@tanstack/query-core/build/lib/logger.mjs ***!
554 + \****************************************************************/
555 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3055 556
3056 -//#endregion
3057 -//#region node_modules/@tanstack/react-query/build/modern/useMutation.js
3058 - function useMutation(options, queryClient) {
3059 - const client = useQueryClient(queryClient);
3060 - const [observer] = react.useState(() => new MutationObserver(client, options));
3061 - react.useEffect(() => {
3062 - observer.setOptions(options);
3063 - }, [observer, options]);
3064 - const result = react.useSyncExternalStore(react.useCallback((onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), [observer]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
3065 - const mutate = react.useCallback((variables, mutateOptions) => {
3066 - observer.mutate(variables, mutateOptions).catch(noop);
3067 - }, [observer]);
3068 - if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) throw result.error;
3069 - return {
3070 - ...result,
3071 - mutate,
3072 - mutateAsync: result.mutate
3073 - };
3074 - }
557 +__webpack_require__.r(__webpack_exports__);
558 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
559 +/* harmony export */ defaultLogger: function() { return /* binding */ defaultLogger; }
560 +/* harmony export */ });
561 +const defaultLogger = console;
3075 562
3076 -//#endregion
3077 -//#region node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js
3078 - function useInfiniteQuery(options, queryClient) {
3079 - return useBaseQuery(options, InfiniteQueryObserver, queryClient);
3080 - }
3081 563
3082 -//#endregion
3083 -//#region packages/packages/libs/query/src/index.ts
3084 - var src_exports = /* @__PURE__ */ __exportAll({
3085 - QueryClient: () => QueryClient,
3086 - QueryClientProvider: () => QueryClientProvider,
3087 - createQueryClient: () => createQueryClient,
3088 - getQueryClient: () => getQueryClient,
3089 - useInfiniteQuery: () => useInfiniteQuery,
3090 - useIsMutating: () => useIsMutating,
3091 - useMutation: () => useMutation,
3092 - useQuery: () => useQuery,
3093 - useQueryClient: () => useQueryClient
3094 - });
3095 - var queryClient;
3096 - function getQueryClient() {
3097 - if (!queryClient) throw new Error("Query client is not created yet.");
3098 - return queryClient;
3099 - }
3100 - function createQueryClient() {
3101 - if (queryClient) throw new Error("Query client is already created.");
3102 - queryClient = new QueryClient({ defaultOptions: { queries: {
3103 - refetchOnWindowFocus: false,
3104 - refetchOnReconnect: false
3105 - } } });
3106 - return queryClient;
3107 - }
564 +//# sourceMappingURL=logger.mjs.map
3108 565
3109 -//#endregion
3110 -//#region \0elementor-package-library-entry
3111 - (window.elementorV2 = window.elementorV2 || {}).query = src_exports;
3112 566
3113 -//#endregion
3114 -})(React);
3115 -window.elementorV2.query?.init?.();
3116 -//# sourceMappingURL=query.js.map
567 +/***/ }),
568 +
569 +/***/ "./node_modules/@tanstack/query-core/build/lib/mutation.mjs":
570 +/*!******************************************************************!*\
571 + !*** ./node_modules/@tanstack/query-core/build/lib/mutation.mjs ***!
572 + \******************************************************************/
573 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
574 +
575 +__webpack_require__.r(__webpack_exports__);
576 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
577 +/* harmony export */ Mutation: function() { return /* binding */ Mutation; },
578 +/* harmony export */ getDefaultState: function() { return /* binding */ getDefaultState; }
579 +/* harmony export */ });
580 +/* harmony import */ var _logger_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger.mjs */ "./node_modules/@tanstack/query-core/build/lib/logger.mjs");
581 +/* harmony import */ var _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./notifyManager.mjs */ "./node_modules/@tanstack/query-core/build/lib/notifyManager.mjs");
582 +/* harmony import */ var _removable_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./removable.mjs */ "./node_modules/@tanstack/query-core/build/lib/removable.mjs");
583 +/* harmony import */ var _retryer_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./retryer.mjs */ "./node_modules/@tanstack/query-core/build/lib/retryer.mjs");
584 +
585 +
586 +
587 +
588 +
589 +// CLASS
590 +class Mutation extends _removable_mjs__WEBPACK_IMPORTED_MODULE_0__.Removable {
591 + constructor(config) {
592 + super();
593 + this.defaultOptions = config.defaultOptions;
594 + this.mutationId = config.mutationId;
595 + this.mutationCache = config.mutationCache;
596 + this.logger = config.logger || _logger_mjs__WEBPACK_IMPORTED_MODULE_1__.defaultLogger;
597 + this.observers = [];
598 + this.state = config.state || getDefaultState();
599 + this.setOptions(config.options);
600 + this.scheduleGc();
601 + }
602 +
603 + setOptions(options) {
604 + this.options = { ...this.defaultOptions,
605 + ...options
606 + };
607 + this.updateCacheTime(this.options.cacheTime);
608 + }
609 +
610 + get meta() {
611 + return this.options.meta;
612 + }
613 +
614 + setState(state) {
615 + this.dispatch({
616 + type: 'setState',
617 + state
618 + });
619 + }
620 +
621 + addObserver(observer) {
622 + if (!this.observers.includes(observer)) {
623 + this.observers.push(observer); // Stop the mutation from being garbage collected
624 +
625 + this.clearGcTimeout();
626 + this.mutationCache.notify({
627 + type: 'observerAdded',
628 + mutation: this,
629 + observer
630 + });
631 + }
632 + }
633 +
634 + removeObserver(observer) {
635 + this.observers = this.observers.filter(x => x !== observer);
636 + this.scheduleGc();
637 + this.mutationCache.notify({
638 + type: 'observerRemoved',
639 + mutation: this,
640 + observer
641 + });
642 + }
643 +
644 + optionalRemove() {
645 + if (!this.observers.length) {
646 + if (this.state.status === 'loading') {
647 + this.scheduleGc();
648 + } else {
649 + this.mutationCache.remove(this);
650 + }
651 + }
652 + }
653 +
654 + continue() {
655 + var _this$retryer$continu, _this$retryer;
656 +
657 + return (_this$retryer$continu = (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.continue()) != null ? _this$retryer$continu : this.execute();
658 + }
659 +
660 + async execute() {
661 + const executeMutation = () => {
662 + var _this$options$retry;
663 +
664 + this.retryer = (0,_retryer_mjs__WEBPACK_IMPORTED_MODULE_2__.createRetryer)({
665 + fn: () => {
666 + if (!this.options.mutationFn) {
667 + return Promise.reject('No mutationFn found');
668 + }
669 +
670 + return this.options.mutationFn(this.state.variables);
671 + },
672 + onFail: (failureCount, error) => {
673 + this.dispatch({
674 + type: 'failed',
675 + failureCount,
676 + error
677 + });
678 + },
679 + onPause: () => {
680 + this.dispatch({
681 + type: 'pause'
682 + });
683 + },
684 + onContinue: () => {
685 + this.dispatch({
686 + type: 'continue'
687 + });
688 + },
689 + retry: (_this$options$retry = this.options.retry) != null ? _this$options$retry : 0,
690 + retryDelay: this.options.retryDelay,
691 + networkMode: this.options.networkMode
692 + });
693 + return this.retryer.promise;
694 + };
695 +
696 + const restored = this.state.status === 'loading';
697 +
698 + try {
699 + var _this$mutationCache$c3, _this$mutationCache$c4, _this$options$onSucce, _this$options2, _this$mutationCache$c5, _this$mutationCache$c6, _this$options$onSettl, _this$options3;
700 +
701 + if (!restored) {
702 + var _this$mutationCache$c, _this$mutationCache$c2, _this$options$onMutat, _this$options;
703 +
704 + this.dispatch({
705 + type: 'loading',
706 + variables: this.options.variables
707 + }); // Notify cache callback
708 +
709 + await ((_this$mutationCache$c = (_this$mutationCache$c2 = this.mutationCache.config).onMutate) == null ? void 0 : _this$mutationCache$c.call(_this$mutationCache$c2, this.state.variables, this));
710 + const context = await ((_this$options$onMutat = (_this$options = this.options).onMutate) == null ? void 0 : _this$options$onMutat.call(_this$options, this.state.variables));
711 +
712 + if (context !== this.state.context) {
713 + this.dispatch({
714 + type: 'loading',
715 + context,
716 + variables: this.state.variables
717 + });
718 + }
719 + }
720 +
721 + const data = await executeMutation(); // Notify cache callback
722 +
723 + await ((_this$mutationCache$c3 = (_this$mutationCache$c4 = this.mutationCache.config).onSuccess) == null ? void 0 : _this$mutationCache$c3.call(_this$mutationCache$c4, data, this.state.variables, this.state.context, this));
724 + await ((_this$options$onSucce = (_this$options2 = this.options).onSuccess) == null ? void 0 : _this$options$onSucce.call(_this$options2, data, this.state.variables, this.state.context)); // Notify cache callback
725 +
726 + await ((_this$mutationCache$c5 = (_this$mutationCache$c6 = this.mutationCache.config).onSettled) == null ? void 0 : _this$mutationCache$c5.call(_this$mutationCache$c6, data, null, this.state.variables, this.state.context, this));
727 + await ((_this$options$onSettl = (_this$options3 = this.options).onSettled) == null ? void 0 : _this$options$onSettl.call(_this$options3, data, null, this.state.variables, this.state.context));
728 + this.dispatch({
729 + type: 'success',
730 + data
731 + });
732 + return data;
733 + } catch (error) {
734 + try {
735 + var _this$mutationCache$c7, _this$mutationCache$c8, _this$options$onError, _this$options4, _this$mutationCache$c9, _this$mutationCache$c10, _this$options$onSettl2, _this$options5;
736 +
737 + // Notify cache callback
738 + await ((_this$mutationCache$c7 = (_this$mutationCache$c8 = this.mutationCache.config).onError) == null ? void 0 : _this$mutationCache$c7.call(_this$mutationCache$c8, error, this.state.variables, this.state.context, this));
739 +
740 + if (true) {
741 + this.logger.error(error);
742 + }
743 +
744 + await ((_this$options$onError = (_this$options4 = this.options).onError) == null ? void 0 : _this$options$onError.call(_this$options4, error, this.state.variables, this.state.context)); // Notify cache callback
745 +
746 + await ((_this$mutationCache$c9 = (_this$mutationCache$c10 = this.mutationCache.config).onSettled) == null ? void 0 : _this$mutationCache$c9.call(_this$mutationCache$c10, undefined, error, this.state.variables, this.state.context, this));
747 + await ((_this$options$onSettl2 = (_this$options5 = this.options).onSettled) == null ? void 0 : _this$options$onSettl2.call(_this$options5, undefined, error, this.state.variables, this.state.context));
748 + throw error;
749 + } finally {
750 + this.dispatch({
751 + type: 'error',
752 + error: error
753 + });
754 + }
755 + }
756 + }
757 +
758 + dispatch(action) {
759 + const reducer = state => {
760 + switch (action.type) {
761 + case 'failed':
762 + return { ...state,
763 + failureCount: action.failureCount,
764 + failureReason: action.error
765 + };
766 +
767 + case 'pause':
768 + return { ...state,
769 + isPaused: true
770 + };
771 +
772 + case 'continue':
773 + return { ...state,
774 + isPaused: false
775 + };
776 +
777 + case 'loading':
778 + return { ...state,
779 + context: action.context,
780 + data: undefined,
781 + failureCount: 0,
782 + failureReason: null,
783 + error: null,
784 + isPaused: !(0,_retryer_mjs__WEBPACK_IMPORTED_MODULE_2__.canFetch)(this.options.networkMode),
785 + status: 'loading',
786 + variables: action.variables
787 + };
788 +
789 + case 'success':
790 + return { ...state,
791 + data: action.data,
792 + failureCount: 0,
793 + failureReason: null,
794 + error: null,
795 + status: 'success',
796 + isPaused: false
797 + };
798 +
799 + case 'error':
800 + return { ...state,
801 + data: undefined,
802 + error: action.error,
803 + failureCount: state.failureCount + 1,
804 + failureReason: action.error,
805 + isPaused: false,
806 + status: 'error'
807 + };
808 +
809 + case 'setState':
810 + return { ...state,
811 + ...action.state
812 + };
813 + }
814 + };
815 +
816 + this.state = reducer(this.state);
817 + _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_3__.notifyManager.batch(() => {
818 + this.observers.forEach(observer => {
819 + observer.onMutationUpdate(action);
820 + });
821 + this.mutationCache.notify({
822 + mutation: this,
823 + type: 'updated',
824 + action
825 + });
826 + });
827 + }
828 +
829 +}
830 +function getDefaultState() {
831 + return {
832 + context: undefined,
833 + data: undefined,
834 + error: null,
835 + failureCount: 0,
836 + failureReason: null,
837 + isPaused: false,
838 + status: 'idle',
839 + variables: undefined
840 + };
841 +}
842 +
843 +
844 +//# sourceMappingURL=mutation.mjs.map
845 +
846 +
847 +/***/ }),
848 +
849 +/***/ "./node_modules/@tanstack/query-core/build/lib/mutationCache.mjs":
850 +/*!***********************************************************************!*\
851 + !*** ./node_modules/@tanstack/query-core/build/lib/mutationCache.mjs ***!
852 + \***********************************************************************/
853 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
854 +
855 +__webpack_require__.r(__webpack_exports__);
856 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
857 +/* harmony export */ MutationCache: function() { return /* binding */ MutationCache; }
858 +/* harmony export */ });
859 +/* harmony import */ var _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./notifyManager.mjs */ "./node_modules/@tanstack/query-core/build/lib/notifyManager.mjs");
860 +/* harmony import */ var _mutation_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mutation.mjs */ "./node_modules/@tanstack/query-core/build/lib/mutation.mjs");
861 +/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@tanstack/query-core/build/lib/utils.mjs");
862 +/* harmony import */ var _subscribable_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./subscribable.mjs */ "./node_modules/@tanstack/query-core/build/lib/subscribable.mjs");
863 +
864 +
865 +
866 +
867 +
868 +// CLASS
869 +class MutationCache extends _subscribable_mjs__WEBPACK_IMPORTED_MODULE_0__.Subscribable {
870 + constructor(config) {
871 + super();
872 + this.config = config || {};
873 + this.mutations = [];
874 + this.mutationId = 0;
875 + }
876 +
877 + build(client, options, state) {
878 + const mutation = new _mutation_mjs__WEBPACK_IMPORTED_MODULE_1__.Mutation({
879 + mutationCache: this,
880 + logger: client.getLogger(),
881 + mutationId: ++this.mutationId,
882 + options: client.defaultMutationOptions(options),
883 + state,
884 + defaultOptions: options.mutationKey ? client.getMutationDefaults(options.mutationKey) : undefined
885 + });
886 + this.add(mutation);
887 + return mutation;
888 + }
889 +
890 + add(mutation) {
891 + this.mutations.push(mutation);
892 + this.notify({
893 + type: 'added',
894 + mutation
895 + });
896 + }
897 +
898 + remove(mutation) {
899 + this.mutations = this.mutations.filter(x => x !== mutation);
900 + this.notify({
901 + type: 'removed',
902 + mutation
903 + });
904 + }
905 +
906 + clear() {
907 + _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_2__.notifyManager.batch(() => {
908 + this.mutations.forEach(mutation => {
909 + this.remove(mutation);
910 + });
911 + });
912 + }
913 +
914 + getAll() {
915 + return this.mutations;
916 + }
917 +
918 + find(filters) {
919 + if (typeof filters.exact === 'undefined') {
920 + filters.exact = true;
921 + }
922 +
923 + return this.mutations.find(mutation => (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_3__.matchMutation)(filters, mutation));
924 + }
925 +
926 + findAll(filters) {
927 + return this.mutations.filter(mutation => (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_3__.matchMutation)(filters, mutation));
928 + }
929 +
930 + notify(event) {
931 + _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_2__.notifyManager.batch(() => {
932 + this.listeners.forEach(({
933 + listener
934 + }) => {
935 + listener(event);
936 + });
937 + });
938 + }
939 +
940 + resumePausedMutations() {
941 + var _this$resuming;
942 +
943 + this.resuming = ((_this$resuming = this.resuming) != null ? _this$resuming : Promise.resolve()).then(() => {
944 + const pausedMutations = this.mutations.filter(x => x.state.isPaused);
945 + return _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_2__.notifyManager.batch(() => pausedMutations.reduce((promise, mutation) => promise.then(() => mutation.continue().catch(_utils_mjs__WEBPACK_IMPORTED_MODULE_3__.noop)), Promise.resolve()));
946 + }).then(() => {
947 + this.resuming = undefined;
948 + });
949 + return this.resuming;
950 + }
951 +
952 +}
953 +
954 +
955 +//# sourceMappingURL=mutationCache.mjs.map
956 +
957 +
958 +/***/ }),
959 +
960 +/***/ "./node_modules/@tanstack/query-core/build/lib/mutationObserver.mjs":
961 +/*!**************************************************************************!*\
962 + !*** ./node_modules/@tanstack/query-core/build/lib/mutationObserver.mjs ***!
963 + \**************************************************************************/
964 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
965 +
966 +__webpack_require__.r(__webpack_exports__);
967 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
968 +/* harmony export */ MutationObserver: function() { return /* binding */ MutationObserver; }
969 +/* harmony export */ });
970 +/* harmony import */ var _mutation_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mutation.mjs */ "./node_modules/@tanstack/query-core/build/lib/mutation.mjs");
971 +/* harmony import */ var _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./notifyManager.mjs */ "./node_modules/@tanstack/query-core/build/lib/notifyManager.mjs");
972 +/* harmony import */ var _subscribable_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./subscribable.mjs */ "./node_modules/@tanstack/query-core/build/lib/subscribable.mjs");
973 +/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@tanstack/query-core/build/lib/utils.mjs");
974 +
975 +
976 +
977 +
978 +
979 +// CLASS
980 +class MutationObserver extends _subscribable_mjs__WEBPACK_IMPORTED_MODULE_0__.Subscribable {
981 + constructor(client, options) {
982 + super();
983 + this.client = client;
984 + this.setOptions(options);
985 + this.bindMethods();
986 + this.updateResult();
987 + }
988 +
989 + bindMethods() {
990 + this.mutate = this.mutate.bind(this);
991 + this.reset = this.reset.bind(this);
992 + }
993 +
994 + setOptions(options) {
995 + var _this$currentMutation;
996 +
997 + const prevOptions = this.options;
998 + this.options = this.client.defaultMutationOptions(options);
999 +
1000 + if (!(0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.shallowEqualObjects)(prevOptions, this.options)) {
1001 + this.client.getMutationCache().notify({
1002 + type: 'observerOptionsUpdated',
1003 + mutation: this.currentMutation,
1004 + observer: this
1005 + });
1006 + }
1007 +
1008 + (_this$currentMutation = this.currentMutation) == null ? void 0 : _this$currentMutation.setOptions(this.options);
1009 + }
1010 +
1011 + onUnsubscribe() {
1012 + if (!this.hasListeners()) {
1013 + var _this$currentMutation2;
1014 +
1015 + (_this$currentMutation2 = this.currentMutation) == null ? void 0 : _this$currentMutation2.removeObserver(this);
1016 + }
1017 + }
1018 +
1019 + onMutationUpdate(action) {
1020 + this.updateResult(); // Determine which callbacks to trigger
1021 +
1022 + const notifyOptions = {
1023 + listeners: true
1024 + };
1025 +
1026 + if (action.type === 'success') {
1027 + notifyOptions.onSuccess = true;
1028 + } else if (action.type === 'error') {
1029 + notifyOptions.onError = true;
1030 + }
1031 +
1032 + this.notify(notifyOptions);
1033 + }
1034 +
1035 + getCurrentResult() {
1036 + return this.currentResult;
1037 + }
1038 +
1039 + reset() {
1040 + this.currentMutation = undefined;
1041 + this.updateResult();
1042 + this.notify({
1043 + listeners: true
1044 + });
1045 + }
1046 +
1047 + mutate(variables, options) {
1048 + this.mutateOptions = options;
1049 +
1050 + if (this.currentMutation) {
1051 + this.currentMutation.removeObserver(this);
1052 + }
1053 +
1054 + this.currentMutation = this.client.getMutationCache().build(this.client, { ...this.options,
1055 + variables: typeof variables !== 'undefined' ? variables : this.options.variables
1056 + });
1057 + this.currentMutation.addObserver(this);
1058 + return this.currentMutation.execute();
1059 + }
1060 +
1061 + updateResult() {
1062 + const state = this.currentMutation ? this.currentMutation.state : (0,_mutation_mjs__WEBPACK_IMPORTED_MODULE_2__.getDefaultState)();
1063 + const result = { ...state,
1064 + isLoading: state.status === 'loading',
1065 + isSuccess: state.status === 'success',
1066 + isError: state.status === 'error',
1067 + isIdle: state.status === 'idle',
1068 + mutate: this.mutate,
1069 + reset: this.reset
1070 + };
1071 + this.currentResult = result;
1072 + }
1073 +
1074 + notify(options) {
1075 + _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_3__.notifyManager.batch(() => {
1076 + // First trigger the mutate callbacks
1077 + if (this.mutateOptions && this.hasListeners()) {
1078 + if (options.onSuccess) {
1079 + var _this$mutateOptions$o, _this$mutateOptions, _this$mutateOptions$o2, _this$mutateOptions2;
1080 +
1081 + (_this$mutateOptions$o = (_this$mutateOptions = this.mutateOptions).onSuccess) == null ? void 0 : _this$mutateOptions$o.call(_this$mutateOptions, this.currentResult.data, this.currentResult.variables, this.currentResult.context);
1082 + (_this$mutateOptions$o2 = (_this$mutateOptions2 = this.mutateOptions).onSettled) == null ? void 0 : _this$mutateOptions$o2.call(_this$mutateOptions2, this.currentResult.data, null, this.currentResult.variables, this.currentResult.context);
1083 + } else if (options.onError) {
1084 + var _this$mutateOptions$o3, _this$mutateOptions3, _this$mutateOptions$o4, _this$mutateOptions4;
1085 +
1086 + (_this$mutateOptions$o3 = (_this$mutateOptions3 = this.mutateOptions).onError) == null ? void 0 : _this$mutateOptions$o3.call(_this$mutateOptions3, this.currentResult.error, this.currentResult.variables, this.currentResult.context);
1087 + (_this$mutateOptions$o4 = (_this$mutateOptions4 = this.mutateOptions).onSettled) == null ? void 0 : _this$mutateOptions$o4.call(_this$mutateOptions4, undefined, this.currentResult.error, this.currentResult.variables, this.currentResult.context);
1088 + }
1089 + } // Then trigger the listeners
1090 +
1091 +
1092 + if (options.listeners) {
1093 + this.listeners.forEach(({
1094 + listener
1095 + }) => {
1096 + listener(this.currentResult);
1097 + });
1098 + }
1099 + });
1100 + }
1101 +
1102 +}
1103 +
1104 +
1105 +//# sourceMappingURL=mutationObserver.mjs.map
1106 +
1107 +
1108 +/***/ }),
1109 +
1110 +/***/ "./node_modules/@tanstack/query-core/build/lib/notifyManager.mjs":
1111 +/*!***********************************************************************!*\
1112 + !*** ./node_modules/@tanstack/query-core/build/lib/notifyManager.mjs ***!
1113 + \***********************************************************************/
1114 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1115 +
1116 +__webpack_require__.r(__webpack_exports__);
1117 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
1118 +/* harmony export */ createNotifyManager: function() { return /* binding */ createNotifyManager; },
1119 +/* harmony export */ notifyManager: function() { return /* binding */ notifyManager; }
1120 +/* harmony export */ });
1121 +/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@tanstack/query-core/build/lib/utils.mjs");
1122 +
1123 +
1124 +function createNotifyManager() {
1125 + let queue = [];
1126 + let transactions = 0;
1127 +
1128 + let notifyFn = callback => {
1129 + callback();
1130 + };
1131 +
1132 + let batchNotifyFn = callback => {
1133 + callback();
1134 + };
1135 +
1136 + const batch = callback => {
1137 + let result;
1138 + transactions++;
1139 +
1140 + try {
1141 + result = callback();
1142 + } finally {
1143 + transactions--;
1144 +
1145 + if (!transactions) {
1146 + flush();
1147 + }
1148 + }
1149 +
1150 + return result;
1151 + };
1152 +
1153 + const schedule = callback => {
1154 + if (transactions) {
1155 + queue.push(callback);
1156 + } else {
1157 + (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.scheduleMicrotask)(() => {
1158 + notifyFn(callback);
1159 + });
1160 + }
1161 + };
1162 + /**
1163 + * All calls to the wrapped function will be batched.
1164 + */
1165 +
1166 +
1167 + const batchCalls = callback => {
1168 + return (...args) => {
1169 + schedule(() => {
1170 + callback(...args);
1171 + });
1172 + };
1173 + };
1174 +
1175 + const flush = () => {
1176 + const originalQueue = queue;
1177 + queue = [];
1178 +
1179 + if (originalQueue.length) {
1180 + (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.scheduleMicrotask)(() => {
1181 + batchNotifyFn(() => {
1182 + originalQueue.forEach(callback => {
1183 + notifyFn(callback);
1184 + });
1185 + });
1186 + });
1187 + }
1188 + };
1189 + /**
1190 + * Use this method to set a custom notify function.
1191 + * This can be used to for example wrap notifications with `React.act` while running tests.
1192 + */
1193 +
1194 +
1195 + const setNotifyFunction = fn => {
1196 + notifyFn = fn;
1197 + };
1198 + /**
1199 + * Use this method to set a custom function to batch notifications together into a single tick.
1200 + * By default React Query will use the batch function provided by ReactDOM or React Native.
1201 + */
1202 +
1203 +
1204 + const setBatchNotifyFunction = fn => {
1205 + batchNotifyFn = fn;
1206 + };
1207 +
1208 + return {
1209 + batch,
1210 + batchCalls,
1211 + schedule,
1212 + setNotifyFunction,
1213 + setBatchNotifyFunction
1214 + };
1215 +} // SINGLETON
1216 +
1217 +const notifyManager = createNotifyManager();
1218 +
1219 +
1220 +//# sourceMappingURL=notifyManager.mjs.map
1221 +
1222 +
1223 +/***/ }),
1224 +
1225 +/***/ "./node_modules/@tanstack/query-core/build/lib/onlineManager.mjs":
1226 +/*!***********************************************************************!*\
1227 + !*** ./node_modules/@tanstack/query-core/build/lib/onlineManager.mjs ***!
1228 + \***********************************************************************/
1229 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1230 +
1231 +__webpack_require__.r(__webpack_exports__);
1232 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
1233 +/* harmony export */ OnlineManager: function() { return /* binding */ OnlineManager; },
1234 +/* harmony export */ onlineManager: function() { return /* binding */ onlineManager; }
1235 +/* harmony export */ });
1236 +/* harmony import */ var _subscribable_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./subscribable.mjs */ "./node_modules/@tanstack/query-core/build/lib/subscribable.mjs");
1237 +/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@tanstack/query-core/build/lib/utils.mjs");
1238 +
1239 +
1240 +
1241 +const onlineEvents = ['online', 'offline'];
1242 +class OnlineManager extends _subscribable_mjs__WEBPACK_IMPORTED_MODULE_0__.Subscribable {
1243 + constructor() {
1244 + super();
1245 +
1246 + this.setup = onOnline => {
1247 + // addEventListener does not exist in React Native, but window does
1248 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1249 + if (!_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.isServer && window.addEventListener) {
1250 + const listener = () => onOnline(); // Listen to online
1251 +
1252 +
1253 + onlineEvents.forEach(event => {
1254 + window.addEventListener(event, listener, false);
1255 + });
1256 + return () => {
1257 + // Be sure to unsubscribe if a new handler is set
1258 + onlineEvents.forEach(event => {
1259 + window.removeEventListener(event, listener);
1260 + });
1261 + };
1262 + }
1263 +
1264 + return;
1265 + };
1266 + }
1267 +
1268 + onSubscribe() {
1269 + if (!this.cleanup) {
1270 + this.setEventListener(this.setup);
1271 + }
1272 + }
1273 +
1274 + onUnsubscribe() {
1275 + if (!this.hasListeners()) {
1276 + var _this$cleanup;
1277 +
1278 + (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this);
1279 + this.cleanup = undefined;
1280 + }
1281 + }
1282 +
1283 + setEventListener(setup) {
1284 + var _this$cleanup2;
1285 +
1286 + this.setup = setup;
1287 + (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this);
1288 + this.cleanup = setup(online => {
1289 + if (typeof online === 'boolean') {
1290 + this.setOnline(online);
1291 + } else {
1292 + this.onOnline();
1293 + }
1294 + });
1295 + }
1296 +
1297 + setOnline(online) {
1298 + const changed = this.online !== online;
1299 +
1300 + if (changed) {
1301 + this.online = online;
1302 + this.onOnline();
1303 + }
1304 + }
1305 +
1306 + onOnline() {
1307 + this.listeners.forEach(({
1308 + listener
1309 + }) => {
1310 + listener();
1311 + });
1312 + }
1313 +
1314 + isOnline() {
1315 + if (typeof this.online === 'boolean') {
1316 + return this.online;
1317 + }
1318 +
1319 + if (typeof navigator === 'undefined' || typeof navigator.onLine === 'undefined') {
1320 + return true;
1321 + }
1322 +
1323 + return navigator.onLine;
1324 + }
1325 +
1326 +}
1327 +const onlineManager = new OnlineManager();
1328 +
1329 +
1330 +//# sourceMappingURL=onlineManager.mjs.map
1331 +
1332 +
1333 +/***/ }),
1334 +
1335 +/***/ "./node_modules/@tanstack/query-core/build/lib/query.mjs":
1336 +/*!***************************************************************!*\
1337 + !*** ./node_modules/@tanstack/query-core/build/lib/query.mjs ***!
1338 + \***************************************************************/
1339 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1340 +
1341 +__webpack_require__.r(__webpack_exports__);
1342 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
1343 +/* harmony export */ Query: function() { return /* binding */ Query; }
1344 +/* harmony export */ });
1345 +/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@tanstack/query-core/build/lib/utils.mjs");
1346 +/* harmony import */ var _logger_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger.mjs */ "./node_modules/@tanstack/query-core/build/lib/logger.mjs");
1347 +/* harmony import */ var _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./notifyManager.mjs */ "./node_modules/@tanstack/query-core/build/lib/notifyManager.mjs");
1348 +/* harmony import */ var _retryer_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./retryer.mjs */ "./node_modules/@tanstack/query-core/build/lib/retryer.mjs");
1349 +/* harmony import */ var _removable_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./removable.mjs */ "./node_modules/@tanstack/query-core/build/lib/removable.mjs");
1350 +
1351 +
1352 +
1353 +
1354 +
1355 +
1356 +// CLASS
1357 +class Query extends _removable_mjs__WEBPACK_IMPORTED_MODULE_0__.Removable {
1358 + constructor(config) {
1359 + super();
1360 + this.abortSignalConsumed = false;
1361 + this.defaultOptions = config.defaultOptions;
1362 + this.setOptions(config.options);
1363 + this.observers = [];
1364 + this.cache = config.cache;
1365 + this.logger = config.logger || _logger_mjs__WEBPACK_IMPORTED_MODULE_1__.defaultLogger;
1366 + this.queryKey = config.queryKey;
1367 + this.queryHash = config.queryHash;
1368 + this.initialState = config.state || getDefaultState(this.options);
1369 + this.state = this.initialState;
1370 + this.scheduleGc();
1371 + }
1372 +
1373 + get meta() {
1374 + return this.options.meta;
1375 + }
1376 +
1377 + setOptions(options) {
1378 + this.options = { ...this.defaultOptions,
1379 + ...options
1380 + };
1381 + this.updateCacheTime(this.options.cacheTime);
1382 + }
1383 +
1384 + optionalRemove() {
1385 + if (!this.observers.length && this.state.fetchStatus === 'idle') {
1386 + this.cache.remove(this);
1387 + }
1388 + }
1389 +
1390 + setData(newData, options) {
1391 + const data = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.replaceData)(this.state.data, newData, this.options); // Set data and mark it as cached
1392 +
1393 + this.dispatch({
1394 + data,
1395 + type: 'success',
1396 + dataUpdatedAt: options == null ? void 0 : options.updatedAt,
1397 + manual: options == null ? void 0 : options.manual
1398 + });
1399 + return data;
1400 + }
1401 +
1402 + setState(state, setStateOptions) {
1403 + this.dispatch({
1404 + type: 'setState',
1405 + state,
1406 + setStateOptions
1407 + });
1408 + }
1409 +
1410 + cancel(options) {
1411 + var _this$retryer;
1412 +
1413 + const promise = this.promise;
1414 + (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.cancel(options);
1415 + return promise ? promise.then(_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.noop).catch(_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.noop) : Promise.resolve();
1416 + }
1417 +
1418 + destroy() {
1419 + super.destroy();
1420 + this.cancel({
1421 + silent: true
1422 + });
1423 + }
1424 +
1425 + reset() {
1426 + this.destroy();
1427 + this.setState(this.initialState);
1428 + }
1429 +
1430 + isActive() {
1431 + return this.observers.some(observer => observer.options.enabled !== false);
1432 + }
1433 +
1434 + isDisabled() {
1435 + return this.getObserversCount() > 0 && !this.isActive();
1436 + }
1437 +
1438 + isStale() {
1439 + return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some(observer => observer.getCurrentResult().isStale);
1440 + }
1441 +
1442 + isStaleByTime(staleTime = 0) {
1443 + return this.state.isInvalidated || !this.state.dataUpdatedAt || !(0,_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.timeUntilStale)(this.state.dataUpdatedAt, staleTime);
1444 + }
1445 +
1446 + onFocus() {
1447 + var _this$retryer2;
1448 +
1449 + const observer = this.observers.find(x => x.shouldFetchOnWindowFocus());
1450 +
1451 + if (observer) {
1452 + observer.refetch({
1453 + cancelRefetch: false
1454 + });
1455 + } // Continue fetch if currently paused
1456 +
1457 +
1458 + (_this$retryer2 = this.retryer) == null ? void 0 : _this$retryer2.continue();
1459 + }
1460 +
1461 + onOnline() {
1462 + var _this$retryer3;
1463 +
1464 + const observer = this.observers.find(x => x.shouldFetchOnReconnect());
1465 +
1466 + if (observer) {
1467 + observer.refetch({
1468 + cancelRefetch: false
1469 + });
1470 + } // Continue fetch if currently paused
1471 +
1472 +
1473 + (_this$retryer3 = this.retryer) == null ? void 0 : _this$retryer3.continue();
1474 + }
1475 +
1476 + addObserver(observer) {
1477 + if (!this.observers.includes(observer)) {
1478 + this.observers.push(observer); // Stop the query from being garbage collected
1479 +
1480 + this.clearGcTimeout();
1481 + this.cache.notify({
1482 + type: 'observerAdded',
1483 + query: this,
1484 + observer
1485 + });
1486 + }
1487 + }
1488 +
1489 + removeObserver(observer) {
1490 + if (this.observers.includes(observer)) {
1491 + this.observers = this.observers.filter(x => x !== observer);
1492 +
1493 + if (!this.observers.length) {
1494 + // If the transport layer does not support cancellation
1495 + // we'll let the query continue so the result can be cached
1496 + if (this.retryer) {
1497 + if (this.abortSignalConsumed) {
1498 + this.retryer.cancel({
1499 + revert: true
1500 + });
1501 + } else {
1502 + this.retryer.cancelRetry();
1503 + }
1504 + }
1505 +
1506 + this.scheduleGc();
1507 + }
1508 +
1509 + this.cache.notify({
1510 + type: 'observerRemoved',
1511 + query: this,
1512 + observer
1513 + });
1514 + }
1515 + }
1516 +
1517 + getObserversCount() {
1518 + return this.observers.length;
1519 + }
1520 +
1521 + invalidate() {
1522 + if (!this.state.isInvalidated) {
1523 + this.dispatch({
1524 + type: 'invalidate'
1525 + });
1526 + }
1527 + }
1528 +
1529 + fetch(options, fetchOptions) {
1530 + var _this$options$behavio, _context$fetchOptions;
1531 +
1532 + if (this.state.fetchStatus !== 'idle') {
1533 + if (this.state.dataUpdatedAt && fetchOptions != null && fetchOptions.cancelRefetch) {
1534 + // Silently cancel current fetch if the user wants to cancel refetches
1535 + this.cancel({
1536 + silent: true
1537 + });
1538 + } else if (this.promise) {
1539 + var _this$retryer4;
1540 +
1541 + // make sure that retries that were potentially cancelled due to unmounts can continue
1542 + (_this$retryer4 = this.retryer) == null ? void 0 : _this$retryer4.continueRetry(); // Return current promise if we are already fetching
1543 +
1544 + return this.promise;
1545 + }
1546 + } // Update config if passed, otherwise the config from the last execution is used
1547 +
1548 +
1549 + if (options) {
1550 + this.setOptions(options);
1551 + } // Use the options from the first observer with a query function if no function is found.
1552 + // This can happen when the query is hydrated or created with setQueryData.
1553 +
1554 +
1555 + if (!this.options.queryFn) {
1556 + const observer = this.observers.find(x => x.options.queryFn);
1557 +
1558 + if (observer) {
1559 + this.setOptions(observer.options);
1560 + }
1561 + }
1562 +
1563 + if (!Array.isArray(this.options.queryKey)) {
1564 + if (true) {
1565 + this.logger.error("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']");
1566 + }
1567 + }
1568 +
1569 + const abortController = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.getAbortController)(); // Create query function context
1570 +
1571 + const queryFnContext = {
1572 + queryKey: this.queryKey,
1573 + pageParam: undefined,
1574 + meta: this.meta
1575 + }; // Adds an enumerable signal property to the object that
1576 + // which sets abortSignalConsumed to true when the signal
1577 + // is read.
1578 +
1579 + const addSignalProperty = object => {
1580 + Object.defineProperty(object, 'signal', {
1581 + enumerable: true,
1582 + get: () => {
1583 + if (abortController) {
1584 + this.abortSignalConsumed = true;
1585 + return abortController.signal;
1586 + }
1587 +
1588 + return undefined;
1589 + }
1590 + });
1591 + };
1592 +
1593 + addSignalProperty(queryFnContext); // Create fetch function
1594 +
1595 + const fetchFn = () => {
1596 + if (!this.options.queryFn) {
1597 + return Promise.reject("Missing queryFn for queryKey '" + this.options.queryHash + "'");
1598 + }
1599 +
1600 + this.abortSignalConsumed = false;
1601 + return this.options.queryFn(queryFnContext);
1602 + }; // Trigger behavior hook
1603 +
1604 +
1605 + const context = {
1606 + fetchOptions,
1607 + options: this.options,
1608 + queryKey: this.queryKey,
1609 + state: this.state,
1610 + fetchFn
1611 + };
1612 + addSignalProperty(context);
1613 + (_this$options$behavio = this.options.behavior) == null ? void 0 : _this$options$behavio.onFetch(context); // Store state in case the current fetch needs to be reverted
1614 +
1615 + this.revertState = this.state; // Set to fetching state if not already in it
1616 +
1617 + if (this.state.fetchStatus === 'idle' || this.state.fetchMeta !== ((_context$fetchOptions = context.fetchOptions) == null ? void 0 : _context$fetchOptions.meta)) {
1618 + var _context$fetchOptions2;
1619 +
1620 + this.dispatch({
1621 + type: 'fetch',
1622 + meta: (_context$fetchOptions2 = context.fetchOptions) == null ? void 0 : _context$fetchOptions2.meta
1623 + });
1624 + }
1625 +
1626 + const onError = error => {
1627 + // Optimistically update state if needed
1628 + if (!((0,_retryer_mjs__WEBPACK_IMPORTED_MODULE_3__.isCancelledError)(error) && error.silent)) {
1629 + this.dispatch({
1630 + type: 'error',
1631 + error: error
1632 + });
1633 + }
1634 +
1635 + if (!(0,_retryer_mjs__WEBPACK_IMPORTED_MODULE_3__.isCancelledError)(error)) {
1636 + var _this$cache$config$on, _this$cache$config, _this$cache$config$on2, _this$cache$config2;
1637 +
1638 + // Notify cache callback
1639 + (_this$cache$config$on = (_this$cache$config = this.cache.config).onError) == null ? void 0 : _this$cache$config$on.call(_this$cache$config, error, this);
1640 + (_this$cache$config$on2 = (_this$cache$config2 = this.cache.config).onSettled) == null ? void 0 : _this$cache$config$on2.call(_this$cache$config2, this.state.data, error, this);
1641 +
1642 + if (true) {
1643 + this.logger.error(error);
1644 + }
1645 + }
1646 +
1647 + if (!this.isFetchingOptimistic) {
1648 + // Schedule query gc after fetching
1649 + this.scheduleGc();
1650 + }
1651 +
1652 + this.isFetchingOptimistic = false;
1653 + }; // Try to fetch the data
1654 +
1655 +
1656 + this.retryer = (0,_retryer_mjs__WEBPACK_IMPORTED_MODULE_3__.createRetryer)({
1657 + fn: context.fetchFn,
1658 + abort: abortController == null ? void 0 : abortController.abort.bind(abortController),
1659 + onSuccess: data => {
1660 + var _this$cache$config$on3, _this$cache$config3, _this$cache$config$on4, _this$cache$config4;
1661 +
1662 + if (typeof data === 'undefined') {
1663 + if (true) {
1664 + this.logger.error("Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: " + this.queryHash);
1665 + }
1666 +
1667 + onError(new Error(this.queryHash + " data is undefined"));
1668 + return;
1669 + }
1670 +
1671 + this.setData(data); // Notify cache callback
1672 +
1673 + (_this$cache$config$on3 = (_this$cache$config3 = this.cache.config).onSuccess) == null ? void 0 : _this$cache$config$on3.call(_this$cache$config3, data, this);
1674 + (_this$cache$config$on4 = (_this$cache$config4 = this.cache.config).onSettled) == null ? void 0 : _this$cache$config$on4.call(_this$cache$config4, data, this.state.error, this);
1675 +
1676 + if (!this.isFetchingOptimistic) {
1677 + // Schedule query gc after fetching
1678 + this.scheduleGc();
1679 + }
1680 +
1681 + this.isFetchingOptimistic = false;
1682 + },
1683 + onError,
1684 + onFail: (failureCount, error) => {
1685 + this.dispatch({
1686 + type: 'failed',
1687 + failureCount,
1688 + error
1689 + });
1690 + },
1691 + onPause: () => {
1692 + this.dispatch({
1693 + type: 'pause'
1694 + });
1695 + },
1696 + onContinue: () => {
1697 + this.dispatch({
1698 + type: 'continue'
1699 + });
1700 + },
1701 + retry: context.options.retry,
1702 + retryDelay: context.options.retryDelay,
1703 + networkMode: context.options.networkMode
1704 + });
1705 + this.promise = this.retryer.promise;
1706 + return this.promise;
1707 + }
1708 +
1709 + dispatch(action) {
1710 + const reducer = state => {
1711 + var _action$meta, _action$dataUpdatedAt;
1712 +
1713 + switch (action.type) {
1714 + case 'failed':
1715 + return { ...state,
1716 + fetchFailureCount: action.failureCount,
1717 + fetchFailureReason: action.error
1718 + };
1719 +
1720 + case 'pause':
1721 + return { ...state,
1722 + fetchStatus: 'paused'
1723 + };
1724 +
1725 + case 'continue':
1726 + return { ...state,
1727 + fetchStatus: 'fetching'
1728 + };
1729 +
1730 + case 'fetch':
1731 + return { ...state,
1732 + fetchFailureCount: 0,
1733 + fetchFailureReason: null,
1734 + fetchMeta: (_action$meta = action.meta) != null ? _action$meta : null,
1735 + fetchStatus: (0,_retryer_mjs__WEBPACK_IMPORTED_MODULE_3__.canFetch)(this.options.networkMode) ? 'fetching' : 'paused',
1736 + ...(!state.dataUpdatedAt && {
1737 + error: null,
1738 + status: 'loading'
1739 + })
1740 + };
1741 +
1742 + case 'success':
1743 + return { ...state,
1744 + data: action.data,
1745 + dataUpdateCount: state.dataUpdateCount + 1,
1746 + dataUpdatedAt: (_action$dataUpdatedAt = action.dataUpdatedAt) != null ? _action$dataUpdatedAt : Date.now(),
1747 + error: null,
1748 + isInvalidated: false,
1749 + status: 'success',
1750 + ...(!action.manual && {
1751 + fetchStatus: 'idle',
1752 + fetchFailureCount: 0,
1753 + fetchFailureReason: null
1754 + })
1755 + };
1756 +
1757 + case 'error':
1758 + const error = action.error;
1759 +
1760 + if ((0,_retryer_mjs__WEBPACK_IMPORTED_MODULE_3__.isCancelledError)(error) && error.revert && this.revertState) {
1761 + return { ...this.revertState
1762 + };
1763 + }
1764 +
1765 + return { ...state,
1766 + error: error,
1767 + errorUpdateCount: state.errorUpdateCount + 1,
1768 + errorUpdatedAt: Date.now(),
1769 + fetchFailureCount: state.fetchFailureCount + 1,
1770 + fetchFailureReason: error,
1771 + fetchStatus: 'idle',
1772 + status: 'error'
1773 + };
1774 +
1775 + case 'invalidate':
1776 + return { ...state,
1777 + isInvalidated: true
1778 + };
1779 +
1780 + case 'setState':
1781 + return { ...state,
1782 + ...action.state
1783 + };
1784 + }
1785 + };
1786 +
1787 + this.state = reducer(this.state);
1788 + _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_4__.notifyManager.batch(() => {
1789 + this.observers.forEach(observer => {
1790 + observer.onQueryUpdate(action);
1791 + });
1792 + this.cache.notify({
1793 + query: this,
1794 + type: 'updated',
1795 + action
1796 + });
1797 + });
1798 + }
1799 +
1800 +}
1801 +
1802 +function getDefaultState(options) {
1803 + const data = typeof options.initialData === 'function' ? options.initialData() : options.initialData;
1804 + const hasData = typeof data !== 'undefined';
1805 + const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === 'function' ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;
1806 + return {
1807 + data,
1808 + dataUpdateCount: 0,
1809 + dataUpdatedAt: hasData ? initialDataUpdatedAt != null ? initialDataUpdatedAt : Date.now() : 0,
1810 + error: null,
1811 + errorUpdateCount: 0,
1812 + errorUpdatedAt: 0,
1813 + fetchFailureCount: 0,
1814 + fetchFailureReason: null,
1815 + fetchMeta: null,
1816 + isInvalidated: false,
1817 + status: hasData ? 'success' : 'loading',
1818 + fetchStatus: 'idle'
1819 + };
1820 +}
1821 +
1822 +
1823 +//# sourceMappingURL=query.mjs.map
1824 +
1825 +
1826 +/***/ }),
1827 +
1828 +/***/ "./node_modules/@tanstack/query-core/build/lib/queryCache.mjs":
1829 +/*!********************************************************************!*\
1830 + !*** ./node_modules/@tanstack/query-core/build/lib/queryCache.mjs ***!
1831 + \********************************************************************/
1832 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1833 +
1834 +__webpack_require__.r(__webpack_exports__);
1835 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
1836 +/* harmony export */ QueryCache: function() { return /* binding */ QueryCache; }
1837 +/* harmony export */ });
1838 +/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@tanstack/query-core/build/lib/utils.mjs");
1839 +/* harmony import */ var _query_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./query.mjs */ "./node_modules/@tanstack/query-core/build/lib/query.mjs");
1840 +/* harmony import */ var _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./notifyManager.mjs */ "./node_modules/@tanstack/query-core/build/lib/notifyManager.mjs");
1841 +/* harmony import */ var _subscribable_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./subscribable.mjs */ "./node_modules/@tanstack/query-core/build/lib/subscribable.mjs");
1842 +
1843 +
1844 +
1845 +
1846 +
1847 +// CLASS
1848 +class QueryCache extends _subscribable_mjs__WEBPACK_IMPORTED_MODULE_0__.Subscribable {
1849 + constructor(config) {
1850 + super();
1851 + this.config = config || {};
1852 + this.queries = [];
1853 + this.queriesMap = {};
1854 + }
1855 +
1856 + build(client, options, state) {
1857 + var _options$queryHash;
1858 +
1859 + const queryKey = options.queryKey;
1860 + const queryHash = (_options$queryHash = options.queryHash) != null ? _options$queryHash : (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.hashQueryKeyByOptions)(queryKey, options);
1861 + let query = this.get(queryHash);
1862 +
1863 + if (!query) {
1864 + query = new _query_mjs__WEBPACK_IMPORTED_MODULE_2__.Query({
1865 + cache: this,
1866 + logger: client.getLogger(),
1867 + queryKey,
1868 + queryHash,
1869 + options: client.defaultQueryOptions(options),
1870 + state,
1871 + defaultOptions: client.getQueryDefaults(queryKey)
1872 + });
1873 + this.add(query);
1874 + }
1875 +
1876 + return query;
1877 + }
1878 +
1879 + add(query) {
1880 + if (!this.queriesMap[query.queryHash]) {
1881 + this.queriesMap[query.queryHash] = query;
1882 + this.queries.push(query);
1883 + this.notify({
1884 + type: 'added',
1885 + query
1886 + });
1887 + }
1888 + }
1889 +
1890 + remove(query) {
1891 + const queryInMap = this.queriesMap[query.queryHash];
1892 +
1893 + if (queryInMap) {
1894 + query.destroy();
1895 + this.queries = this.queries.filter(x => x !== query);
1896 +
1897 + if (queryInMap === query) {
1898 + delete this.queriesMap[query.queryHash];
1899 + }
1900 +
1901 + this.notify({
1902 + type: 'removed',
1903 + query
1904 + });
1905 + }
1906 + }
1907 +
1908 + clear() {
1909 + _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_3__.notifyManager.batch(() => {
1910 + this.queries.forEach(query => {
1911 + this.remove(query);
1912 + });
1913 + });
1914 + }
1915 +
1916 + get(queryHash) {
1917 + return this.queriesMap[queryHash];
1918 + }
1919 +
1920 + getAll() {
1921 + return this.queries;
1922 + }
1923 +
1924 + find(arg1, arg2) {
1925 + const [filters] = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.parseFilterArgs)(arg1, arg2);
1926 +
1927 + if (typeof filters.exact === 'undefined') {
1928 + filters.exact = true;
1929 + }
1930 +
1931 + return this.queries.find(query => (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.matchQuery)(filters, query));
1932 + }
1933 +
1934 + findAll(arg1, arg2) {
1935 + const [filters] = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.parseFilterArgs)(arg1, arg2);
1936 + return Object.keys(filters).length > 0 ? this.queries.filter(query => (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.matchQuery)(filters, query)) : this.queries;
1937 + }
1938 +
1939 + notify(event) {
1940 + _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_3__.notifyManager.batch(() => {
1941 + this.listeners.forEach(({
1942 + listener
1943 + }) => {
1944 + listener(event);
1945 + });
1946 + });
1947 + }
1948 +
1949 + onFocus() {
1950 + _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_3__.notifyManager.batch(() => {
1951 + this.queries.forEach(query => {
1952 + query.onFocus();
1953 + });
1954 + });
1955 + }
1956 +
1957 + onOnline() {
1958 + _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_3__.notifyManager.batch(() => {
1959 + this.queries.forEach(query => {
1960 + query.onOnline();
1961 + });
1962 + });
1963 + }
1964 +
1965 +}
1966 +
1967 +
1968 +//# sourceMappingURL=queryCache.mjs.map
1969 +
1970 +
1971 +/***/ }),
1972 +
1973 +/***/ "./node_modules/@tanstack/query-core/build/lib/queryClient.mjs":
1974 +/*!*********************************************************************!*\
1975 + !*** ./node_modules/@tanstack/query-core/build/lib/queryClient.mjs ***!
1976 + \*********************************************************************/
1977 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1978 +
1979 +__webpack_require__.r(__webpack_exports__);
1980 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
1981 +/* harmony export */ QueryClient: function() { return /* binding */ QueryClient; }
1982 +/* harmony export */ });
1983 +/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@tanstack/query-core/build/lib/utils.mjs");
1984 +/* harmony import */ var _queryCache_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./queryCache.mjs */ "./node_modules/@tanstack/query-core/build/lib/queryCache.mjs");
1985 +/* harmony import */ var _mutationCache_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mutationCache.mjs */ "./node_modules/@tanstack/query-core/build/lib/mutationCache.mjs");
1986 +/* harmony import */ var _focusManager_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./focusManager.mjs */ "./node_modules/@tanstack/query-core/build/lib/focusManager.mjs");
1987 +/* harmony import */ var _onlineManager_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./onlineManager.mjs */ "./node_modules/@tanstack/query-core/build/lib/onlineManager.mjs");
1988 +/* harmony import */ var _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./notifyManager.mjs */ "./node_modules/@tanstack/query-core/build/lib/notifyManager.mjs");
1989 +/* harmony import */ var _infiniteQueryBehavior_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./infiniteQueryBehavior.mjs */ "./node_modules/@tanstack/query-core/build/lib/infiniteQueryBehavior.mjs");
1990 +/* harmony import */ var _logger_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./logger.mjs */ "./node_modules/@tanstack/query-core/build/lib/logger.mjs");
1991 +
1992 +
1993 +
1994 +
1995 +
1996 +
1997 +
1998 +
1999 +
2000 +// CLASS
2001 +class QueryClient {
2002 + constructor(config = {}) {
2003 + this.queryCache = config.queryCache || new _queryCache_mjs__WEBPACK_IMPORTED_MODULE_0__.QueryCache();
2004 + this.mutationCache = config.mutationCache || new _mutationCache_mjs__WEBPACK_IMPORTED_MODULE_1__.MutationCache();
2005 + this.logger = config.logger || _logger_mjs__WEBPACK_IMPORTED_MODULE_2__.defaultLogger;
2006 + this.defaultOptions = config.defaultOptions || {};
2007 + this.queryDefaults = [];
2008 + this.mutationDefaults = [];
2009 + this.mountCount = 0;
2010 +
2011 + if ( true && config.logger) {
2012 + this.logger.error("Passing a custom logger has been deprecated and will be removed in the next major version.");
2013 + }
2014 + }
2015 +
2016 + mount() {
2017 + this.mountCount++;
2018 + if (this.mountCount !== 1) return;
2019 + this.unsubscribeFocus = _focusManager_mjs__WEBPACK_IMPORTED_MODULE_3__.focusManager.subscribe(() => {
2020 + if (_focusManager_mjs__WEBPACK_IMPORTED_MODULE_3__.focusManager.isFocused()) {
2021 + this.resumePausedMutations();
2022 + this.queryCache.onFocus();
2023 + }
2024 + });
2025 + this.unsubscribeOnline = _onlineManager_mjs__WEBPACK_IMPORTED_MODULE_4__.onlineManager.subscribe(() => {
2026 + if (_onlineManager_mjs__WEBPACK_IMPORTED_MODULE_4__.onlineManager.isOnline()) {
2027 + this.resumePausedMutations();
2028 + this.queryCache.onOnline();
2029 + }
2030 + });
2031 + }
2032 +
2033 + unmount() {
2034 + var _this$unsubscribeFocu, _this$unsubscribeOnli;
2035 +
2036 + this.mountCount--;
2037 + if (this.mountCount !== 0) return;
2038 + (_this$unsubscribeFocu = this.unsubscribeFocus) == null ? void 0 : _this$unsubscribeFocu.call(this);
2039 + this.unsubscribeFocus = undefined;
2040 + (_this$unsubscribeOnli = this.unsubscribeOnline) == null ? void 0 : _this$unsubscribeOnli.call(this);
2041 + this.unsubscribeOnline = undefined;
2042 + }
2043 +
2044 + isFetching(arg1, arg2) {
2045 + const [filters] = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.parseFilterArgs)(arg1, arg2);
2046 + filters.fetchStatus = 'fetching';
2047 + return this.queryCache.findAll(filters).length;
2048 + }
2049 +
2050 + isMutating(filters) {
2051 + return this.mutationCache.findAll({ ...filters,
2052 + fetching: true
2053 + }).length;
2054 + }
2055 +
2056 + getQueryData(queryKey, filters) {
2057 + var _this$queryCache$find;
2058 +
2059 + return (_this$queryCache$find = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find.state.data;
2060 + }
2061 +
2062 + ensureQueryData(arg1, arg2, arg3) {
2063 + const parsedOptions = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.parseQueryArgs)(arg1, arg2, arg3);
2064 + const cachedData = this.getQueryData(parsedOptions.queryKey);
2065 + return cachedData ? Promise.resolve(cachedData) : this.fetchQuery(parsedOptions);
2066 + }
2067 +
2068 + getQueriesData(queryKeyOrFilters) {
2069 + return this.getQueryCache().findAll(queryKeyOrFilters).map(({
2070 + queryKey,
2071 + state
2072 + }) => {
2073 + const data = state.data;
2074 + return [queryKey, data];
2075 + });
2076 + }
2077 +
2078 + setQueryData(queryKey, updater, options) {
2079 + const query = this.queryCache.find(queryKey);
2080 + const prevData = query == null ? void 0 : query.state.data;
2081 + const data = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.functionalUpdate)(updater, prevData);
2082 +
2083 + if (typeof data === 'undefined') {
2084 + return undefined;
2085 + }
2086 +
2087 + const parsedOptions = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.parseQueryArgs)(queryKey);
2088 + const defaultedOptions = this.defaultQueryOptions(parsedOptions);
2089 + return this.queryCache.build(this, defaultedOptions).setData(data, { ...options,
2090 + manual: true
2091 + });
2092 + }
2093 +
2094 + setQueriesData(queryKeyOrFilters, updater, options) {
2095 + return _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_6__.notifyManager.batch(() => this.getQueryCache().findAll(queryKeyOrFilters).map(({
2096 + queryKey
2097 + }) => [queryKey, this.setQueryData(queryKey, updater, options)]));
2098 + }
2099 +
2100 + getQueryState(queryKey, filters) {
2101 + var _this$queryCache$find2;
2102 +
2103 + return (_this$queryCache$find2 = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find2.state;
2104 + }
2105 +
2106 + removeQueries(arg1, arg2) {
2107 + const [filters] = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.parseFilterArgs)(arg1, arg2);
2108 + const queryCache = this.queryCache;
2109 + _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_6__.notifyManager.batch(() => {
2110 + queryCache.findAll(filters).forEach(query => {
2111 + queryCache.remove(query);
2112 + });
2113 + });
2114 + }
2115 +
2116 + resetQueries(arg1, arg2, arg3) {
2117 + const [filters, options] = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.parseFilterArgs)(arg1, arg2, arg3);
2118 + const queryCache = this.queryCache;
2119 + const refetchFilters = {
2120 + type: 'active',
2121 + ...filters
2122 + };
2123 + return _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_6__.notifyManager.batch(() => {
2124 + queryCache.findAll(filters).forEach(query => {
2125 + query.reset();
2126 + });
2127 + return this.refetchQueries(refetchFilters, options);
2128 + });
2129 + }
2130 +
2131 + cancelQueries(arg1, arg2, arg3) {
2132 + const [filters, cancelOptions = {}] = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.parseFilterArgs)(arg1, arg2, arg3);
2133 +
2134 + if (typeof cancelOptions.revert === 'undefined') {
2135 + cancelOptions.revert = true;
2136 + }
2137 +
2138 + const promises = _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_6__.notifyManager.batch(() => this.queryCache.findAll(filters).map(query => query.cancel(cancelOptions)));
2139 + return Promise.all(promises).then(_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.noop).catch(_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.noop);
2140 + }
2141 +
2142 + invalidateQueries(arg1, arg2, arg3) {
2143 + const [filters, options] = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.parseFilterArgs)(arg1, arg2, arg3);
2144 + return _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_6__.notifyManager.batch(() => {
2145 + var _ref, _filters$refetchType;
2146 +
2147 + this.queryCache.findAll(filters).forEach(query => {
2148 + query.invalidate();
2149 + });
2150 +
2151 + if (filters.refetchType === 'none') {
2152 + return Promise.resolve();
2153 + }
2154 +
2155 + const refetchFilters = { ...filters,
2156 + type: (_ref = (_filters$refetchType = filters.refetchType) != null ? _filters$refetchType : filters.type) != null ? _ref : 'active'
2157 + };
2158 + return this.refetchQueries(refetchFilters, options);
2159 + });
2160 + }
2161 +
2162 + refetchQueries(arg1, arg2, arg3) {
2163 + const [filters, options] = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.parseFilterArgs)(arg1, arg2, arg3);
2164 + const promises = _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_6__.notifyManager.batch(() => this.queryCache.findAll(filters).filter(query => !query.isDisabled()).map(query => {
2165 + var _options$cancelRefetc;
2166 +
2167 + return query.fetch(undefined, { ...options,
2168 + cancelRefetch: (_options$cancelRefetc = options == null ? void 0 : options.cancelRefetch) != null ? _options$cancelRefetc : true,
2169 + meta: {
2170 + refetchPage: filters.refetchPage
2171 + }
2172 + });
2173 + }));
2174 + let promise = Promise.all(promises).then(_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.noop);
2175 +
2176 + if (!(options != null && options.throwOnError)) {
2177 + promise = promise.catch(_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.noop);
2178 + }
2179 +
2180 + return promise;
2181 + }
2182 +
2183 + fetchQuery(arg1, arg2, arg3) {
2184 + const parsedOptions = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.parseQueryArgs)(arg1, arg2, arg3);
2185 + const defaultedOptions = this.defaultQueryOptions(parsedOptions); // https://github.com/tannerlinsley/react-query/issues/652
2186 +
2187 + if (typeof defaultedOptions.retry === 'undefined') {
2188 + defaultedOptions.retry = false;
2189 + }
2190 +
2191 + const query = this.queryCache.build(this, defaultedOptions);
2192 + return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);
2193 + }
2194 +
2195 + prefetchQuery(arg1, arg2, arg3) {
2196 + return this.fetchQuery(arg1, arg2, arg3).then(_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.noop).catch(_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.noop);
2197 + }
2198 +
2199 + fetchInfiniteQuery(arg1, arg2, arg3) {
2200 + const parsedOptions = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.parseQueryArgs)(arg1, arg2, arg3);
2201 + parsedOptions.behavior = (0,_infiniteQueryBehavior_mjs__WEBPACK_IMPORTED_MODULE_7__.infiniteQueryBehavior)();
2202 + return this.fetchQuery(parsedOptions);
2203 + }
2204 +
2205 + prefetchInfiniteQuery(arg1, arg2, arg3) {
2206 + return this.fetchInfiniteQuery(arg1, arg2, arg3).then(_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.noop).catch(_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.noop);
2207 + }
2208 +
2209 + resumePausedMutations() {
2210 + return this.mutationCache.resumePausedMutations();
2211 + }
2212 +
2213 + getQueryCache() {
2214 + return this.queryCache;
2215 + }
2216 +
2217 + getMutationCache() {
2218 + return this.mutationCache;
2219 + }
2220 +
2221 + getLogger() {
2222 + return this.logger;
2223 + }
2224 +
2225 + getDefaultOptions() {
2226 + return this.defaultOptions;
2227 + }
2228 +
2229 + setDefaultOptions(options) {
2230 + this.defaultOptions = options;
2231 + }
2232 +
2233 + setQueryDefaults(queryKey, options) {
2234 + const result = this.queryDefaults.find(x => (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.hashQueryKey)(queryKey) === (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.hashQueryKey)(x.queryKey));
2235 +
2236 + if (result) {
2237 + result.defaultOptions = options;
2238 + } else {
2239 + this.queryDefaults.push({
2240 + queryKey,
2241 + defaultOptions: options
2242 + });
2243 + }
2244 + }
2245 +
2246 + getQueryDefaults(queryKey) {
2247 + if (!queryKey) {
2248 + return undefined;
2249 + } // Get the first matching defaults
2250 +
2251 +
2252 + const firstMatchingDefaults = this.queryDefaults.find(x => (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.partialMatchKey)(queryKey, x.queryKey)); // Additional checks and error in dev mode
2253 +
2254 + if (true) {
2255 + // Retrieve all matching defaults for the given key
2256 + const matchingDefaults = this.queryDefaults.filter(x => (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.partialMatchKey)(queryKey, x.queryKey)); // It is ok not having defaults, but it is error prone to have more than 1 default for a given key
2257 +
2258 + if (matchingDefaults.length > 1) {
2259 + this.logger.error("[QueryClient] Several query defaults match with key '" + JSON.stringify(queryKey) + "'. 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.");
2260 + }
2261 + }
2262 +
2263 + return firstMatchingDefaults == null ? void 0 : firstMatchingDefaults.defaultOptions;
2264 + }
2265 +
2266 + setMutationDefaults(mutationKey, options) {
2267 + const result = this.mutationDefaults.find(x => (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.hashQueryKey)(mutationKey) === (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.hashQueryKey)(x.mutationKey));
2268 +
2269 + if (result) {
2270 + result.defaultOptions = options;
2271 + } else {
2272 + this.mutationDefaults.push({
2273 + mutationKey,
2274 + defaultOptions: options
2275 + });
2276 + }
2277 + }
2278 +
2279 + getMutationDefaults(mutationKey) {
2280 + if (!mutationKey) {
2281 + return undefined;
2282 + } // Get the first matching defaults
2283 +
2284 +
2285 + const firstMatchingDefaults = this.mutationDefaults.find(x => (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.partialMatchKey)(mutationKey, x.mutationKey)); // Additional checks and error in dev mode
2286 +
2287 + if (true) {
2288 + // Retrieve all matching defaults for the given key
2289 + const matchingDefaults = this.mutationDefaults.filter(x => (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.partialMatchKey)(mutationKey, x.mutationKey)); // It is ok not having defaults, but it is error prone to have more than 1 default for a given key
2290 +
2291 + if (matchingDefaults.length > 1) {
2292 + this.logger.error("[QueryClient] Several mutation defaults match with key '" + JSON.stringify(mutationKey) + "'. 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.");
2293 + }
2294 + }
2295 +
2296 + return firstMatchingDefaults == null ? void 0 : firstMatchingDefaults.defaultOptions;
2297 + }
2298 +
2299 + defaultQueryOptions(options) {
2300 + if (options != null && options._defaulted) {
2301 + return options;
2302 + }
2303 +
2304 + const defaultedOptions = { ...this.defaultOptions.queries,
2305 + ...this.getQueryDefaults(options == null ? void 0 : options.queryKey),
2306 + ...options,
2307 + _defaulted: true
2308 + };
2309 +
2310 + if (!defaultedOptions.queryHash && defaultedOptions.queryKey) {
2311 + defaultedOptions.queryHash = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_5__.hashQueryKeyByOptions)(defaultedOptions.queryKey, defaultedOptions);
2312 + } // dependent default values
2313 +
2314 +
2315 + if (typeof defaultedOptions.refetchOnReconnect === 'undefined') {
2316 + defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== 'always';
2317 + }
2318 +
2319 + if (typeof defaultedOptions.useErrorBoundary === 'undefined') {
2320 + defaultedOptions.useErrorBoundary = !!defaultedOptions.suspense;
2321 + }
2322 +
2323 + return defaultedOptions;
2324 + }
2325 +
2326 + defaultMutationOptions(options) {
2327 + if (options != null && options._defaulted) {
2328 + return options;
2329 + }
2330 +
2331 + return { ...this.defaultOptions.mutations,
2332 + ...this.getMutationDefaults(options == null ? void 0 : options.mutationKey),
2333 + ...options,
2334 + _defaulted: true
2335 + };
2336 + }
2337 +
2338 + clear() {
2339 + this.queryCache.clear();
2340 + this.mutationCache.clear();
2341 + }
2342 +
2343 +}
2344 +
2345 +
2346 +//# sourceMappingURL=queryClient.mjs.map
2347 +
2348 +
2349 +/***/ }),
2350 +
2351 +/***/ "./node_modules/@tanstack/query-core/build/lib/queryObserver.mjs":
2352 +/*!***********************************************************************!*\
2353 + !*** ./node_modules/@tanstack/query-core/build/lib/queryObserver.mjs ***!
2354 + \***********************************************************************/
2355 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
2356 +
2357 +__webpack_require__.r(__webpack_exports__);
2358 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
2359 +/* harmony export */ QueryObserver: function() { return /* binding */ QueryObserver; }
2360 +/* harmony export */ });
2361 +/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@tanstack/query-core/build/lib/utils.mjs");
2362 +/* harmony import */ var _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./notifyManager.mjs */ "./node_modules/@tanstack/query-core/build/lib/notifyManager.mjs");
2363 +/* harmony import */ var _focusManager_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./focusManager.mjs */ "./node_modules/@tanstack/query-core/build/lib/focusManager.mjs");
2364 +/* harmony import */ var _subscribable_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./subscribable.mjs */ "./node_modules/@tanstack/query-core/build/lib/subscribable.mjs");
2365 +/* harmony import */ var _retryer_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./retryer.mjs */ "./node_modules/@tanstack/query-core/build/lib/retryer.mjs");
2366 +
2367 +
2368 +
2369 +
2370 +
2371 +
2372 +class QueryObserver extends _subscribable_mjs__WEBPACK_IMPORTED_MODULE_0__.Subscribable {
2373 + constructor(client, options) {
2374 + super();
2375 + this.client = client;
2376 + this.options = options;
2377 + this.trackedProps = new Set();
2378 + this.selectError = null;
2379 + this.bindMethods();
2380 + this.setOptions(options);
2381 + }
2382 +
2383 + bindMethods() {
2384 + this.remove = this.remove.bind(this);
2385 + this.refetch = this.refetch.bind(this);
2386 + }
2387 +
2388 + onSubscribe() {
2389 + if (this.listeners.size === 1) {
2390 + this.currentQuery.addObserver(this);
2391 +
2392 + if (shouldFetchOnMount(this.currentQuery, this.options)) {
2393 + this.executeFetch();
2394 + }
2395 +
2396 + this.updateTimers();
2397 + }
2398 + }
2399 +
2400 + onUnsubscribe() {
2401 + if (!this.hasListeners()) {
2402 + this.destroy();
2403 + }
2404 + }
2405 +
2406 + shouldFetchOnReconnect() {
2407 + return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnReconnect);
2408 + }
2409 +
2410 + shouldFetchOnWindowFocus() {
2411 + return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnWindowFocus);
2412 + }
2413 +
2414 + destroy() {
2415 + this.listeners = new Set();
2416 + this.clearStaleTimeout();
2417 + this.clearRefetchInterval();
2418 + this.currentQuery.removeObserver(this);
2419 + }
2420 +
2421 + setOptions(options, notifyOptions) {
2422 + const prevOptions = this.options;
2423 + const prevQuery = this.currentQuery;
2424 + this.options = this.client.defaultQueryOptions(options);
2425 +
2426 + if ( true && typeof (options == null ? void 0 : options.isDataEqual) !== 'undefined') {
2427 + this.client.getLogger().error("The isDataEqual option has been deprecated and will be removed in the next major version. You can achieve the same functionality by passing a function as the structuralSharing option");
2428 + }
2429 +
2430 + if (!(0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.shallowEqualObjects)(prevOptions, this.options)) {
2431 + this.client.getQueryCache().notify({
2432 + type: 'observerOptionsUpdated',
2433 + query: this.currentQuery,
2434 + observer: this
2435 + });
2436 + }
2437 +
2438 + if (typeof this.options.enabled !== 'undefined' && typeof this.options.enabled !== 'boolean') {
2439 + throw new Error('Expected enabled to be a boolean');
2440 + } // Keep previous query key if the user does not supply one
2441 +
2442 +
2443 + if (!this.options.queryKey) {
2444 + this.options.queryKey = prevOptions.queryKey;
2445 + }
2446 +
2447 + this.updateQuery();
2448 + const mounted = this.hasListeners(); // Fetch if there are subscribers
2449 +
2450 + if (mounted && shouldFetchOptionally(this.currentQuery, prevQuery, this.options, prevOptions)) {
2451 + this.executeFetch();
2452 + } // Update result
2453 +
2454 +
2455 + this.updateResult(notifyOptions); // Update stale interval if needed
2456 +
2457 + if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) {
2458 + this.updateStaleTimeout();
2459 + }
2460 +
2461 + const nextRefetchInterval = this.computeRefetchInterval(); // Update refetch interval if needed
2462 +
2463 + if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.currentRefetchInterval)) {
2464 + this.updateRefetchInterval(nextRefetchInterval);
2465 + }
2466 + }
2467 +
2468 + getOptimisticResult(options) {
2469 + const query = this.client.getQueryCache().build(this.client, options);
2470 + const result = this.createResult(query, options);
2471 +
2472 + if (shouldAssignObserverCurrentProperties(this, result, options)) {
2473 + // this assigns the optimistic result to the current Observer
2474 + // because if the query function changes, useQuery will be performing
2475 + // an effect where it would fetch again.
2476 + // When the fetch finishes, we perform a deep data cloning in order
2477 + // to reuse objects references. This deep data clone is performed against
2478 + // the `observer.currentResult.data` property
2479 + // When QueryKey changes, we refresh the query and get new `optimistic`
2480 + // result, while we leave the `observer.currentResult`, so when new data
2481 + // arrives, it finds the old `observer.currentResult` which is related
2482 + // to the old QueryKey. Which means that currentResult and selectData are
2483 + // out of sync already.
2484 + // To solve this, we move the cursor of the currentResult everytime
2485 + // an observer reads an optimistic value.
2486 + // When keeping the previous data, the result doesn't change until new
2487 + // data arrives.
2488 + this.currentResult = result;
2489 + this.currentResultOptions = this.options;
2490 + this.currentResultState = this.currentQuery.state;
2491 + }
2492 +
2493 + return result;
2494 + }
2495 +
2496 + getCurrentResult() {
2497 + return this.currentResult;
2498 + }
2499 +
2500 + trackResult(result) {
2501 + const trackedResult = {};
2502 + Object.keys(result).forEach(key => {
2503 + Object.defineProperty(trackedResult, key, {
2504 + configurable: false,
2505 + enumerable: true,
2506 + get: () => {
2507 + this.trackedProps.add(key);
2508 + return result[key];
2509 + }
2510 + });
2511 + });
2512 + return trackedResult;
2513 + }
2514 +
2515 + getCurrentQuery() {
2516 + return this.currentQuery;
2517 + }
2518 +
2519 + remove() {
2520 + this.client.getQueryCache().remove(this.currentQuery);
2521 + }
2522 +
2523 + refetch({
2524 + refetchPage,
2525 + ...options
2526 + } = {}) {
2527 + return this.fetch({ ...options,
2528 + meta: {
2529 + refetchPage
2530 + }
2531 + });
2532 + }
2533 +
2534 + fetchOptimistic(options) {
2535 + const defaultedOptions = this.client.defaultQueryOptions(options);
2536 + const query = this.client.getQueryCache().build(this.client, defaultedOptions);
2537 + query.isFetchingOptimistic = true;
2538 + return query.fetch().then(() => this.createResult(query, defaultedOptions));
2539 + }
2540 +
2541 + fetch(fetchOptions) {
2542 + var _fetchOptions$cancelR;
2543 +
2544 + return this.executeFetch({ ...fetchOptions,
2545 + cancelRefetch: (_fetchOptions$cancelR = fetchOptions.cancelRefetch) != null ? _fetchOptions$cancelR : true
2546 + }).then(() => {
2547 + this.updateResult();
2548 + return this.currentResult;
2549 + });
2550 + }
2551 +
2552 + executeFetch(fetchOptions) {
2553 + // Make sure we reference the latest query as the current one might have been removed
2554 + this.updateQuery(); // Fetch
2555 +
2556 + let promise = this.currentQuery.fetch(this.options, fetchOptions);
2557 +
2558 + if (!(fetchOptions != null && fetchOptions.throwOnError)) {
2559 + promise = promise.catch(_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.noop);
2560 + }
2561 +
2562 + return promise;
2563 + }
2564 +
2565 + updateStaleTimeout() {
2566 + this.clearStaleTimeout();
2567 +
2568 + if (_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.isServer || this.currentResult.isStale || !(0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.isValidTimeout)(this.options.staleTime)) {
2569 + return;
2570 + }
2571 +
2572 + const time = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.timeUntilStale)(this.currentResult.dataUpdatedAt, this.options.staleTime); // The timeout is sometimes triggered 1 ms before the stale time expiration.
2573 + // To mitigate this issue we always add 1 ms to the timeout.
2574 +
2575 + const timeout = time + 1;
2576 + this.staleTimeoutId = setTimeout(() => {
2577 + if (!this.currentResult.isStale) {
2578 + this.updateResult();
2579 + }
2580 + }, timeout);
2581 + }
2582 +
2583 + computeRefetchInterval() {
2584 + var _this$options$refetch;
2585 +
2586 + return typeof this.options.refetchInterval === 'function' ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (_this$options$refetch = this.options.refetchInterval) != null ? _this$options$refetch : false;
2587 + }
2588 +
2589 + updateRefetchInterval(nextInterval) {
2590 + this.clearRefetchInterval();
2591 + this.currentRefetchInterval = nextInterval;
2592 +
2593 + if (_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.isServer || this.options.enabled === false || !(0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.isValidTimeout)(this.currentRefetchInterval) || this.currentRefetchInterval === 0) {
2594 + return;
2595 + }
2596 +
2597 + this.refetchIntervalId = setInterval(() => {
2598 + if (this.options.refetchIntervalInBackground || _focusManager_mjs__WEBPACK_IMPORTED_MODULE_2__.focusManager.isFocused()) {
2599 + this.executeFetch();
2600 + }
2601 + }, this.currentRefetchInterval);
2602 + }
2603 +
2604 + updateTimers() {
2605 + this.updateStaleTimeout();
2606 + this.updateRefetchInterval(this.computeRefetchInterval());
2607 + }
2608 +
2609 + clearStaleTimeout() {
2610 + if (this.staleTimeoutId) {
2611 + clearTimeout(this.staleTimeoutId);
2612 + this.staleTimeoutId = undefined;
2613 + }
2614 + }
2615 +
2616 + clearRefetchInterval() {
2617 + if (this.refetchIntervalId) {
2618 + clearInterval(this.refetchIntervalId);
2619 + this.refetchIntervalId = undefined;
2620 + }
2621 + }
2622 +
2623 + createResult(query, options) {
2624 + const prevQuery = this.currentQuery;
2625 + const prevOptions = this.options;
2626 + const prevResult = this.currentResult;
2627 + const prevResultState = this.currentResultState;
2628 + const prevResultOptions = this.currentResultOptions;
2629 + const queryChange = query !== prevQuery;
2630 + const queryInitialState = queryChange ? query.state : this.currentQueryInitialState;
2631 + const prevQueryResult = queryChange ? this.currentResult : this.previousQueryResult;
2632 + const {
2633 + state
2634 + } = query;
2635 + let {
2636 + dataUpdatedAt,
2637 + error,
2638 + errorUpdatedAt,
2639 + fetchStatus,
2640 + status
2641 + } = state;
2642 + let isPreviousData = false;
2643 + let isPlaceholderData = false;
2644 + let data; // Optimistically set result in fetching state if needed
2645 +
2646 + if (options._optimisticResults) {
2647 + const mounted = this.hasListeners();
2648 + const fetchOnMount = !mounted && shouldFetchOnMount(query, options);
2649 + const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);
2650 +
2651 + if (fetchOnMount || fetchOptionally) {
2652 + fetchStatus = (0,_retryer_mjs__WEBPACK_IMPORTED_MODULE_3__.canFetch)(query.options.networkMode) ? 'fetching' : 'paused';
2653 +
2654 + if (!dataUpdatedAt) {
2655 + status = 'loading';
2656 + }
2657 + }
2658 +
2659 + if (options._optimisticResults === 'isRestoring') {
2660 + fetchStatus = 'idle';
2661 + }
2662 + } // Keep previous data if needed
2663 +
2664 +
2665 + if (options.keepPreviousData && !state.dataUpdatedAt && prevQueryResult != null && prevQueryResult.isSuccess && status !== 'error') {
2666 + data = prevQueryResult.data;
2667 + dataUpdatedAt = prevQueryResult.dataUpdatedAt;
2668 + status = prevQueryResult.status;
2669 + isPreviousData = true;
2670 + } // Select data if needed
2671 + else if (options.select && typeof state.data !== 'undefined') {
2672 + // Memoize select result
2673 + if (prevResult && state.data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === this.selectFn) {
2674 + data = this.selectResult;
2675 + } else {
2676 + try {
2677 + this.selectFn = options.select;
2678 + data = options.select(state.data);
2679 + data = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.replaceData)(prevResult == null ? void 0 : prevResult.data, data, options);
2680 + this.selectResult = data;
2681 + this.selectError = null;
2682 + } catch (selectError) {
2683 + if (true) {
2684 + this.client.getLogger().error(selectError);
2685 + }
2686 +
2687 + this.selectError = selectError;
2688 + }
2689 + }
2690 + } // Use query data
2691 + else {
2692 + data = state.data;
2693 + } // Show placeholder data if needed
2694 +
2695 +
2696 + if (typeof options.placeholderData !== 'undefined' && typeof data === 'undefined' && status === 'loading') {
2697 + let placeholderData; // Memoize placeholder data
2698 +
2699 + if (prevResult != null && prevResult.isPlaceholderData && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) {
2700 + placeholderData = prevResult.data;
2701 + } else {
2702 + placeholderData = typeof options.placeholderData === 'function' ? options.placeholderData() : options.placeholderData;
2703 +
2704 + if (options.select && typeof placeholderData !== 'undefined') {
2705 + try {
2706 + placeholderData = options.select(placeholderData);
2707 + this.selectError = null;
2708 + } catch (selectError) {
2709 + if (true) {
2710 + this.client.getLogger().error(selectError);
2711 + }
2712 +
2713 + this.selectError = selectError;
2714 + }
2715 + }
2716 + }
2717 +
2718 + if (typeof placeholderData !== 'undefined') {
2719 + status = 'success';
2720 + data = (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.replaceData)(prevResult == null ? void 0 : prevResult.data, placeholderData, options);
2721 + isPlaceholderData = true;
2722 + }
2723 + }
2724 +
2725 + if (this.selectError) {
2726 + error = this.selectError;
2727 + data = this.selectResult;
2728 + errorUpdatedAt = Date.now();
2729 + status = 'error';
2730 + }
2731 +
2732 + const isFetching = fetchStatus === 'fetching';
2733 + const isLoading = status === 'loading';
2734 + const isError = status === 'error';
2735 + const result = {
2736 + status,
2737 + fetchStatus,
2738 + isLoading,
2739 + isSuccess: status === 'success',
2740 + isError,
2741 + isInitialLoading: isLoading && isFetching,
2742 + data,
2743 + dataUpdatedAt,
2744 + error,
2745 + errorUpdatedAt,
2746 + failureCount: state.fetchFailureCount,
2747 + failureReason: state.fetchFailureReason,
2748 + errorUpdateCount: state.errorUpdateCount,
2749 + isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0,
2750 + isFetchedAfterMount: state.dataUpdateCount > queryInitialState.dataUpdateCount || state.errorUpdateCount > queryInitialState.errorUpdateCount,
2751 + isFetching,
2752 + isRefetching: isFetching && !isLoading,
2753 + isLoadingError: isError && state.dataUpdatedAt === 0,
2754 + isPaused: fetchStatus === 'paused',
2755 + isPlaceholderData,
2756 + isPreviousData,
2757 + isRefetchError: isError && state.dataUpdatedAt !== 0,
2758 + isStale: isStale(query, options),
2759 + refetch: this.refetch,
2760 + remove: this.remove
2761 + };
2762 + return result;
2763 + }
2764 +
2765 + updateResult(notifyOptions) {
2766 + const prevResult = this.currentResult;
2767 + const nextResult = this.createResult(this.currentQuery, this.options);
2768 + this.currentResultState = this.currentQuery.state;
2769 + this.currentResultOptions = this.options; // Only notify and update result if something has changed
2770 +
2771 + if ((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.shallowEqualObjects)(nextResult, prevResult)) {
2772 + return;
2773 + }
2774 +
2775 + this.currentResult = nextResult; // Determine which callbacks to trigger
2776 +
2777 + const defaultNotifyOptions = {
2778 + cache: true
2779 + };
2780 +
2781 + const shouldNotifyListeners = () => {
2782 + if (!prevResult) {
2783 + return true;
2784 + }
2785 +
2786 + const {
2787 + notifyOnChangeProps
2788 + } = this.options;
2789 + const notifyOnChangePropsValue = typeof notifyOnChangeProps === 'function' ? notifyOnChangeProps() : notifyOnChangeProps;
2790 +
2791 + if (notifyOnChangePropsValue === 'all' || !notifyOnChangePropsValue && !this.trackedProps.size) {
2792 + return true;
2793 + }
2794 +
2795 + const includedProps = new Set(notifyOnChangePropsValue != null ? notifyOnChangePropsValue : this.trackedProps);
2796 +
2797 + if (this.options.useErrorBoundary) {
2798 + includedProps.add('error');
2799 + }
2800 +
2801 + return Object.keys(this.currentResult).some(key => {
2802 + const typedKey = key;
2803 + const changed = this.currentResult[typedKey] !== prevResult[typedKey];
2804 + return changed && includedProps.has(typedKey);
2805 + });
2806 + };
2807 +
2808 + if ((notifyOptions == null ? void 0 : notifyOptions.listeners) !== false && shouldNotifyListeners()) {
2809 + defaultNotifyOptions.listeners = true;
2810 + }
2811 +
2812 + this.notify({ ...defaultNotifyOptions,
2813 + ...notifyOptions
2814 + });
2815 + }
2816 +
2817 + updateQuery() {
2818 + const query = this.client.getQueryCache().build(this.client, this.options);
2819 +
2820 + if (query === this.currentQuery) {
2821 + return;
2822 + }
2823 +
2824 + const prevQuery = this.currentQuery;
2825 + this.currentQuery = query;
2826 + this.currentQueryInitialState = query.state;
2827 + this.previousQueryResult = this.currentResult;
2828 +
2829 + if (this.hasListeners()) {
2830 + prevQuery == null ? void 0 : prevQuery.removeObserver(this);
2831 + query.addObserver(this);
2832 + }
2833 + }
2834 +
2835 + onQueryUpdate(action) {
2836 + const notifyOptions = {};
2837 +
2838 + if (action.type === 'success') {
2839 + notifyOptions.onSuccess = !action.manual;
2840 + } else if (action.type === 'error' && !(0,_retryer_mjs__WEBPACK_IMPORTED_MODULE_3__.isCancelledError)(action.error)) {
2841 + notifyOptions.onError = true;
2842 + }
2843 +
2844 + this.updateResult(notifyOptions);
2845 +
2846 + if (this.hasListeners()) {
2847 + this.updateTimers();
2848 + }
2849 + }
2850 +
2851 + notify(notifyOptions) {
2852 + _notifyManager_mjs__WEBPACK_IMPORTED_MODULE_4__.notifyManager.batch(() => {
2853 + // First trigger the configuration callbacks
2854 + if (notifyOptions.onSuccess) {
2855 + var _this$options$onSucce, _this$options, _this$options$onSettl, _this$options2;
2856 +
2857 + (_this$options$onSucce = (_this$options = this.options).onSuccess) == null ? void 0 : _this$options$onSucce.call(_this$options, this.currentResult.data);
2858 + (_this$options$onSettl = (_this$options2 = this.options).onSettled) == null ? void 0 : _this$options$onSettl.call(_this$options2, this.currentResult.data, null);
2859 + } else if (notifyOptions.onError) {
2860 + var _this$options$onError, _this$options3, _this$options$onSettl2, _this$options4;
2861 +
2862 + (_this$options$onError = (_this$options3 = this.options).onError) == null ? void 0 : _this$options$onError.call(_this$options3, this.currentResult.error);
2863 + (_this$options$onSettl2 = (_this$options4 = this.options).onSettled) == null ? void 0 : _this$options$onSettl2.call(_this$options4, undefined, this.currentResult.error);
2864 + } // Then trigger the listeners
2865 +
2866 +
2867 + if (notifyOptions.listeners) {
2868 + this.listeners.forEach(({
2869 + listener
2870 + }) => {
2871 + listener(this.currentResult);
2872 + });
2873 + } // Then the cache listeners
2874 +
2875 +
2876 + if (notifyOptions.cache) {
2877 + this.client.getQueryCache().notify({
2878 + query: this.currentQuery,
2879 + type: 'observerResultsUpdated'
2880 + });
2881 + }
2882 + });
2883 + }
2884 +
2885 +}
2886 +
2887 +function shouldLoadOnMount(query, options) {
2888 + return options.enabled !== false && !query.state.dataUpdatedAt && !(query.state.status === 'error' && options.retryOnMount === false);
2889 +}
2890 +
2891 +function shouldFetchOnMount(query, options) {
2892 + return shouldLoadOnMount(query, options) || query.state.dataUpdatedAt > 0 && shouldFetchOn(query, options, options.refetchOnMount);
2893 +}
2894 +
2895 +function shouldFetchOn(query, options, field) {
2896 + if (options.enabled !== false) {
2897 + const value = typeof field === 'function' ? field(query) : field;
2898 + return value === 'always' || value !== false && isStale(query, options);
2899 + }
2900 +
2901 + return false;
2902 +}
2903 +
2904 +function shouldFetchOptionally(query, prevQuery, options, prevOptions) {
2905 + return options.enabled !== false && (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== 'error') && isStale(query, options);
2906 +}
2907 +
2908 +function isStale(query, options) {
2909 + return query.isStaleByTime(options.staleTime);
2910 +} // this function would decide if we will update the observer's 'current'
2911 +// properties after an optimistic reading via getOptimisticResult
2912 +
2913 +
2914 +function shouldAssignObserverCurrentProperties(observer, optimisticResult, options) {
2915 + // it is important to keep this condition like this for three reasons:
2916 + // 1. It will get removed in the v5
2917 + // 2. it reads: don't update the properties if we want to keep the previous
2918 + // data.
2919 + // 3. The opposite condition (!options.keepPreviousData) would fallthrough
2920 + // and will result in a bad decision
2921 + if (options.keepPreviousData) {
2922 + return false;
2923 + } // this means we want to put some placeholder data when pending and queryKey
2924 + // changed.
2925 +
2926 +
2927 + if (options.placeholderData !== undefined) {
2928 + // re-assign properties only if current data is placeholder data
2929 + // which means that data did not arrive yet, so, if there is some cached data
2930 + // we need to "prepare" to receive it
2931 + return optimisticResult.isPlaceholderData;
2932 + } // if the newly created result isn't what the observer is holding as current,
2933 + // then we'll need to update the properties as well
2934 +
2935 +
2936 + if (observer.getCurrentResult() !== optimisticResult) {
2937 + return true;
2938 + } // basically, just keep previous properties if nothing changed
2939 +
2940 +
2941 + return false;
2942 +}
2943 +
2944 +
2945 +//# sourceMappingURL=queryObserver.mjs.map
2946 +
2947 +
2948 +/***/ }),
2949 +
2950 +/***/ "./node_modules/@tanstack/query-core/build/lib/removable.mjs":
2951 +/*!*******************************************************************!*\
2952 + !*** ./node_modules/@tanstack/query-core/build/lib/removable.mjs ***!
2953 + \*******************************************************************/
2954 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
2955 +
2956 +__webpack_require__.r(__webpack_exports__);
2957 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
2958 +/* harmony export */ Removable: function() { return /* binding */ Removable; }
2959 +/* harmony export */ });
2960 +/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@tanstack/query-core/build/lib/utils.mjs");
2961 +
2962 +
2963 +class Removable {
2964 + destroy() {
2965 + this.clearGcTimeout();
2966 + }
2967 +
2968 + scheduleGc() {
2969 + this.clearGcTimeout();
2970 +
2971 + if ((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_0__.isValidTimeout)(this.cacheTime)) {
2972 + this.gcTimeout = setTimeout(() => {
2973 + this.optionalRemove();
2974 + }, this.cacheTime);
2975 + }
2976 + }
2977 +
2978 + updateCacheTime(newCacheTime) {
2979 + // Default to 5 minutes (Infinity for server-side) if no cache time is set
2980 + this.cacheTime = Math.max(this.cacheTime || 0, newCacheTime != null ? newCacheTime : _utils_mjs__WEBPACK_IMPORTED_MODULE_0__.isServer ? Infinity : 5 * 60 * 1000);
2981 + }
2982 +
2983 + clearGcTimeout() {
2984 + if (this.gcTimeout) {
2985 + clearTimeout(this.gcTimeout);
2986 + this.gcTimeout = undefined;
2987 + }
2988 + }
2989 +
2990 +}
2991 +
2992 +
2993 +//# sourceMappingURL=removable.mjs.map
2994 +
2995 +
2996 +/***/ }),
2997 +
2998 +/***/ "./node_modules/@tanstack/query-core/build/lib/retryer.mjs":
2999 +/*!*****************************************************************!*\
3000 + !*** ./node_modules/@tanstack/query-core/build/lib/retryer.mjs ***!
3001 + \*****************************************************************/
3002 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3003 +
3004 +__webpack_require__.r(__webpack_exports__);
3005 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3006 +/* harmony export */ CancelledError: function() { return /* binding */ CancelledError; },
3007 +/* harmony export */ canFetch: function() { return /* binding */ canFetch; },
3008 +/* harmony export */ createRetryer: function() { return /* binding */ createRetryer; },
3009 +/* harmony export */ isCancelledError: function() { return /* binding */ isCancelledError; }
3010 +/* harmony export */ });
3011 +/* harmony import */ var _focusManager_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./focusManager.mjs */ "./node_modules/@tanstack/query-core/build/lib/focusManager.mjs");
3012 +/* harmony import */ var _onlineManager_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./onlineManager.mjs */ "./node_modules/@tanstack/query-core/build/lib/onlineManager.mjs");
3013 +/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@tanstack/query-core/build/lib/utils.mjs");
3014 +
3015 +
3016 +
3017 +
3018 +function defaultRetryDelay(failureCount) {
3019 + return Math.min(1000 * 2 ** failureCount, 30000);
3020 +}
3021 +
3022 +function canFetch(networkMode) {
3023 + return (networkMode != null ? networkMode : 'online') === 'online' ? _onlineManager_mjs__WEBPACK_IMPORTED_MODULE_0__.onlineManager.isOnline() : true;
3024 +}
3025 +class CancelledError {
3026 + constructor(options) {
3027 + this.revert = options == null ? void 0 : options.revert;
3028 + this.silent = options == null ? void 0 : options.silent;
3029 + }
3030 +
3031 +}
3032 +function isCancelledError(value) {
3033 + return value instanceof CancelledError;
3034 +}
3035 +function createRetryer(config) {
3036 + let isRetryCancelled = false;
3037 + let failureCount = 0;
3038 + let isResolved = false;
3039 + let continueFn;
3040 + let promiseResolve;
3041 + let promiseReject;
3042 + const promise = new Promise((outerResolve, outerReject) => {
3043 + promiseResolve = outerResolve;
3044 + promiseReject = outerReject;
3045 + });
3046 +
3047 + const cancel = cancelOptions => {
3048 + if (!isResolved) {
3049 + reject(new CancelledError(cancelOptions));
3050 + config.abort == null ? void 0 : config.abort();
3051 + }
3052 + };
3053 +
3054 + const cancelRetry = () => {
3055 + isRetryCancelled = true;
3056 + };
3057 +
3058 + const continueRetry = () => {
3059 + isRetryCancelled = false;
3060 + };
3061 +
3062 + const shouldPause = () => !_focusManager_mjs__WEBPACK_IMPORTED_MODULE_1__.focusManager.isFocused() || config.networkMode !== 'always' && !_onlineManager_mjs__WEBPACK_IMPORTED_MODULE_0__.onlineManager.isOnline();
3063 +
3064 + const resolve = value => {
3065 + if (!isResolved) {
3066 + isResolved = true;
3067 + config.onSuccess == null ? void 0 : config.onSuccess(value);
3068 + continueFn == null ? void 0 : continueFn();
3069 + promiseResolve(value);
3070 + }
3071 + };
3072 +
3073 + const reject = value => {
3074 + if (!isResolved) {
3075 + isResolved = true;
3076 + config.onError == null ? void 0 : config.onError(value);
3077 + continueFn == null ? void 0 : continueFn();
3078 + promiseReject(value);
3079 + }
3080 + };
3081 +
3082 + const pause = () => {
3083 + return new Promise(continueResolve => {
3084 + continueFn = value => {
3085 + const canContinue = isResolved || !shouldPause();
3086 +
3087 + if (canContinue) {
3088 + continueResolve(value);
3089 + }
3090 +
3091 + return canContinue;
3092 + };
3093 +
3094 + config.onPause == null ? void 0 : config.onPause();
3095 + }).then(() => {
3096 + continueFn = undefined;
3097 +
3098 + if (!isResolved) {
3099 + config.onContinue == null ? void 0 : config.onContinue();
3100 + }
3101 + });
3102 + }; // Create loop function
3103 +
3104 +
3105 + const run = () => {
3106 + // Do nothing if already resolved
3107 + if (isResolved) {
3108 + return;
3109 + }
3110 +
3111 + let promiseOrValue; // Execute query
3112 +
3113 + try {
3114 + promiseOrValue = config.fn();
3115 + } catch (error) {
3116 + promiseOrValue = Promise.reject(error);
3117 + }
3118 +
3119 + Promise.resolve(promiseOrValue).then(resolve).catch(error => {
3120 + var _config$retry, _config$retryDelay;
3121 +
3122 + // Stop if the fetch is already resolved
3123 + if (isResolved) {
3124 + return;
3125 + } // Do we need to retry the request?
3126 +
3127 +
3128 + const retry = (_config$retry = config.retry) != null ? _config$retry : 3;
3129 + const retryDelay = (_config$retryDelay = config.retryDelay) != null ? _config$retryDelay : defaultRetryDelay;
3130 + const delay = typeof retryDelay === 'function' ? retryDelay(failureCount, error) : retryDelay;
3131 + const shouldRetry = retry === true || typeof retry === 'number' && failureCount < retry || typeof retry === 'function' && retry(failureCount, error);
3132 +
3133 + if (isRetryCancelled || !shouldRetry) {
3134 + // We are done if the query does not need to be retried
3135 + reject(error);
3136 + return;
3137 + }
3138 +
3139 + failureCount++; // Notify on fail
3140 +
3141 + config.onFail == null ? void 0 : config.onFail(failureCount, error); // Delay
3142 +
3143 + (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.sleep)(delay) // Pause if the document is not visible or when the device is offline
3144 + .then(() => {
3145 + if (shouldPause()) {
3146 + return pause();
3147 + }
3148 +
3149 + return;
3150 + }).then(() => {
3151 + if (isRetryCancelled) {
3152 + reject(error);
3153 + } else {
3154 + run();
3155 + }
3156 + });
3157 + });
3158 + }; // Start loop
3159 +
3160 +
3161 + if (canFetch(config.networkMode)) {
3162 + run();
3163 + } else {
3164 + pause().then(run);
3165 + }
3166 +
3167 + return {
3168 + promise,
3169 + cancel,
3170 + continue: () => {
3171 + const didContinue = continueFn == null ? void 0 : continueFn();
3172 + return didContinue ? promise : Promise.resolve();
3173 + },
3174 + cancelRetry,
3175 + continueRetry
3176 + };
3177 +}
3178 +
3179 +
3180 +//# sourceMappingURL=retryer.mjs.map
3181 +
3182 +
3183 +/***/ }),
3184 +
3185 +/***/ "./node_modules/@tanstack/query-core/build/lib/subscribable.mjs":
3186 +/*!**********************************************************************!*\
3187 + !*** ./node_modules/@tanstack/query-core/build/lib/subscribable.mjs ***!
3188 + \**********************************************************************/
3189 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3190 +
3191 +__webpack_require__.r(__webpack_exports__);
3192 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3193 +/* harmony export */ Subscribable: function() { return /* binding */ Subscribable; }
3194 +/* harmony export */ });
3195 +class Subscribable {
3196 + constructor() {
3197 + this.listeners = new Set();
3198 + this.subscribe = this.subscribe.bind(this);
3199 + }
3200 +
3201 + subscribe(listener) {
3202 + const identity = {
3203 + listener
3204 + };
3205 + this.listeners.add(identity);
3206 + this.onSubscribe();
3207 + return () => {
3208 + this.listeners.delete(identity);
3209 + this.onUnsubscribe();
3210 + };
3211 + }
3212 +
3213 + hasListeners() {
3214 + return this.listeners.size > 0;
3215 + }
3216 +
3217 + onSubscribe() {// Do nothing
3218 + }
3219 +
3220 + onUnsubscribe() {// Do nothing
3221 + }
3222 +
3223 +}
3224 +
3225 +
3226 +//# sourceMappingURL=subscribable.mjs.map
3227 +
3228 +
3229 +/***/ }),
3230 +
3231 +/***/ "./node_modules/@tanstack/query-core/build/lib/utils.mjs":
3232 +/*!***************************************************************!*\
3233 + !*** ./node_modules/@tanstack/query-core/build/lib/utils.mjs ***!
3234 + \***************************************************************/
3235 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3236 +
3237 +__webpack_require__.r(__webpack_exports__);
3238 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3239 +/* harmony export */ difference: function() { return /* binding */ difference; },
3240 +/* harmony export */ functionalUpdate: function() { return /* binding */ functionalUpdate; },
3241 +/* harmony export */ getAbortController: function() { return /* binding */ getAbortController; },
3242 +/* harmony export */ hashQueryKey: function() { return /* binding */ hashQueryKey; },
3243 +/* harmony export */ hashQueryKeyByOptions: function() { return /* binding */ hashQueryKeyByOptions; },
3244 +/* harmony export */ isError: function() { return /* binding */ isError; },
3245 +/* harmony export */ isPlainArray: function() { return /* binding */ isPlainArray; },
3246 +/* harmony export */ isPlainObject: function() { return /* binding */ isPlainObject; },
3247 +/* harmony export */ isQueryKey: function() { return /* binding */ isQueryKey; },
3248 +/* harmony export */ isServer: function() { return /* binding */ isServer; },
3249 +/* harmony export */ isValidTimeout: function() { return /* binding */ isValidTimeout; },
3250 +/* harmony export */ matchMutation: function() { return /* binding */ matchMutation; },
3251 +/* harmony export */ matchQuery: function() { return /* binding */ matchQuery; },
3252 +/* harmony export */ noop: function() { return /* binding */ noop; },
3253 +/* harmony export */ parseFilterArgs: function() { return /* binding */ parseFilterArgs; },
3254 +/* harmony export */ parseMutationArgs: function() { return /* binding */ parseMutationArgs; },
3255 +/* harmony export */ parseMutationFilterArgs: function() { return /* binding */ parseMutationFilterArgs; },
3256 +/* harmony export */ parseQueryArgs: function() { return /* binding */ parseQueryArgs; },
3257 +/* harmony export */ partialDeepEqual: function() { return /* binding */ partialDeepEqual; },
3258 +/* harmony export */ partialMatchKey: function() { return /* binding */ partialMatchKey; },
3259 +/* harmony export */ replaceAt: function() { return /* binding */ replaceAt; },
3260 +/* harmony export */ replaceData: function() { return /* binding */ replaceData; },
3261 +/* harmony export */ replaceEqualDeep: function() { return /* binding */ replaceEqualDeep; },
3262 +/* harmony export */ scheduleMicrotask: function() { return /* binding */ scheduleMicrotask; },
3263 +/* harmony export */ shallowEqualObjects: function() { return /* binding */ shallowEqualObjects; },
3264 +/* harmony export */ sleep: function() { return /* binding */ sleep; },
3265 +/* harmony export */ timeUntilStale: function() { return /* binding */ timeUntilStale; }
3266 +/* harmony export */ });
3267 +// TYPES
3268 +// UTILS
3269 +const isServer = typeof window === 'undefined' || 'Deno' in window;
3270 +function noop() {
3271 + return undefined;
3272 +}
3273 +function functionalUpdate(updater, input) {
3274 + return typeof updater === 'function' ? updater(input) : updater;
3275 +}
3276 +function isValidTimeout(value) {
3277 + return typeof value === 'number' && value >= 0 && value !== Infinity;
3278 +}
3279 +function difference(array1, array2) {
3280 + return array1.filter(x => !array2.includes(x));
3281 +}
3282 +function replaceAt(array, index, value) {
3283 + const copy = array.slice(0);
3284 + copy[index] = value;
3285 + return copy;
3286 +}
3287 +function timeUntilStale(updatedAt, staleTime) {
3288 + return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);
3289 +}
3290 +function parseQueryArgs(arg1, arg2, arg3) {
3291 + if (!isQueryKey(arg1)) {
3292 + return arg1;
3293 + }
3294 +
3295 + if (typeof arg2 === 'function') {
3296 + return { ...arg3,
3297 + queryKey: arg1,
3298 + queryFn: arg2
3299 + };
3300 + }
3301 +
3302 + return { ...arg2,
3303 + queryKey: arg1
3304 + };
3305 +}
3306 +function parseMutationArgs(arg1, arg2, arg3) {
3307 + if (isQueryKey(arg1)) {
3308 + if (typeof arg2 === 'function') {
3309 + return { ...arg3,
3310 + mutationKey: arg1,
3311 + mutationFn: arg2
3312 + };
3313 + }
3314 +
3315 + return { ...arg2,
3316 + mutationKey: arg1
3317 + };
3318 + }
3319 +
3320 + if (typeof arg1 === 'function') {
3321 + return { ...arg2,
3322 + mutationFn: arg1
3323 + };
3324 + }
3325 +
3326 + return { ...arg1
3327 + };
3328 +}
3329 +function parseFilterArgs(arg1, arg2, arg3) {
3330 + return isQueryKey(arg1) ? [{ ...arg2,
3331 + queryKey: arg1
3332 + }, arg3] : [arg1 || {}, arg2];
3333 +}
3334 +function parseMutationFilterArgs(arg1, arg2, arg3) {
3335 + return isQueryKey(arg1) ? [{ ...arg2,
3336 + mutationKey: arg1
3337 + }, arg3] : [arg1 || {}, arg2];
3338 +}
3339 +function matchQuery(filters, query) {
3340 + const {
3341 + type = 'all',
3342 + exact,
3343 + fetchStatus,
3344 + predicate,
3345 + queryKey,
3346 + stale
3347 + } = filters;
3348 +
3349 + if (isQueryKey(queryKey)) {
3350 + if (exact) {
3351 + if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {
3352 + return false;
3353 + }
3354 + } else if (!partialMatchKey(query.queryKey, queryKey)) {
3355 + return false;
3356 + }
3357 + }
3358 +
3359 + if (type !== 'all') {
3360 + const isActive = query.isActive();
3361 +
3362 + if (type === 'active' && !isActive) {
3363 + return false;
3364 + }
3365 +
3366 + if (type === 'inactive' && isActive) {
3367 + return false;
3368 + }
3369 + }
3370 +
3371 + if (typeof stale === 'boolean' && query.isStale() !== stale) {
3372 + return false;
3373 + }
3374 +
3375 + if (typeof fetchStatus !== 'undefined' && fetchStatus !== query.state.fetchStatus) {
3376 + return false;
3377 + }
3378 +
3379 + if (predicate && !predicate(query)) {
3380 + return false;
3381 + }
3382 +
3383 + return true;
3384 +}
3385 +function matchMutation(filters, mutation) {
3386 + const {
3387 + exact,
3388 + fetching,
3389 + predicate,
3390 + mutationKey
3391 + } = filters;
3392 +
3393 + if (isQueryKey(mutationKey)) {
3394 + if (!mutation.options.mutationKey) {
3395 + return false;
3396 + }
3397 +
3398 + if (exact) {
3399 + if (hashQueryKey(mutation.options.mutationKey) !== hashQueryKey(mutationKey)) {
3400 + return false;
3401 + }
3402 + } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {
3403 + return false;
3404 + }
3405 + }
3406 +
3407 + if (typeof fetching === 'boolean' && mutation.state.status === 'loading' !== fetching) {
3408 + return false;
3409 + }
3410 +
3411 + if (predicate && !predicate(mutation)) {
3412 + return false;
3413 + }
3414 +
3415 + return true;
3416 +}
3417 +function hashQueryKeyByOptions(queryKey, options) {
3418 + const hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashQueryKey;
3419 + return hashFn(queryKey);
3420 +}
3421 +/**
3422 + * Default query keys hash function.
3423 + * Hashes the value into a stable hash.
3424 + */
3425 +
3426 +function hashQueryKey(queryKey) {
3427 + return JSON.stringify(queryKey, (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {
3428 + result[key] = val[key];
3429 + return result;
3430 + }, {}) : val);
3431 +}
3432 +/**
3433 + * Checks if key `b` partially matches with key `a`.
3434 + */
3435 +
3436 +function partialMatchKey(a, b) {
3437 + return partialDeepEqual(a, b);
3438 +}
3439 +/**
3440 + * Checks if `b` partially matches with `a`.
3441 + */
3442 +
3443 +function partialDeepEqual(a, b) {
3444 + if (a === b) {
3445 + return true;
3446 + }
3447 +
3448 + if (typeof a !== typeof b) {
3449 + return false;
3450 + }
3451 +
3452 + if (a && b && typeof a === 'object' && typeof b === 'object') {
3453 + return !Object.keys(b).some(key => !partialDeepEqual(a[key], b[key]));
3454 + }
3455 +
3456 + return false;
3457 +}
3458 +/**
3459 + * This function returns `a` if `b` is deeply equal.
3460 + * If not, it will replace any deeply equal children of `b` with those of `a`.
3461 + * This can be used for structural sharing between JSON values for example.
3462 + */
3463 +
3464 +function replaceEqualDeep(a, b) {
3465 + if (a === b) {
3466 + return a;
3467 + }
3468 +
3469 + const array = isPlainArray(a) && isPlainArray(b);
3470 +
3471 + if (array || isPlainObject(a) && isPlainObject(b)) {
3472 + const aSize = array ? a.length : Object.keys(a).length;
3473 + const bItems = array ? b : Object.keys(b);
3474 + const bSize = bItems.length;
3475 + const copy = array ? [] : {};
3476 + let equalItems = 0;
3477 +
3478 + for (let i = 0; i < bSize; i++) {
3479 + const key = array ? i : bItems[i];
3480 + copy[key] = replaceEqualDeep(a[key], b[key]);
3481 +
3482 + if (copy[key] === a[key]) {
3483 + equalItems++;
3484 + }
3485 + }
3486 +
3487 + return aSize === bSize && equalItems === aSize ? a : copy;
3488 + }
3489 +
3490 + return b;
3491 +}
3492 +/**
3493 + * Shallow compare objects. Only works with objects that always have the same properties.
3494 + */
3495 +
3496 +function shallowEqualObjects(a, b) {
3497 + if (a && !b || b && !a) {
3498 + return false;
3499 + }
3500 +
3501 + for (const key in a) {
3502 + if (a[key] !== b[key]) {
3503 + return false;
3504 + }
3505 + }
3506 +
3507 + return true;
3508 +}
3509 +function isPlainArray(value) {
3510 + return Array.isArray(value) && value.length === Object.keys(value).length;
3511 +} // Copied from: https://github.com/jonschlinkert/is-plain-object
3512 +
3513 +function isPlainObject(o) {
3514 + if (!hasObjectPrototype(o)) {
3515 + return false;
3516 + } // If has modified constructor
3517 +
3518 +
3519 + const ctor = o.constructor;
3520 +
3521 + if (typeof ctor === 'undefined') {
3522 + return true;
3523 + } // If has modified prototype
3524 +
3525 +
3526 + const prot = ctor.prototype;
3527 +
3528 + if (!hasObjectPrototype(prot)) {
3529 + return false;
3530 + } // If constructor does not have an Object-specific method
3531 +
3532 +
3533 + if (!prot.hasOwnProperty('isPrototypeOf')) {
3534 + return false;
3535 + } // Most likely a plain Object
3536 +
3537 +
3538 + return true;
3539 +}
3540 +
3541 +function hasObjectPrototype(o) {
3542 + return Object.prototype.toString.call(o) === '[object Object]';
3543 +}
3544 +
3545 +function isQueryKey(value) {
3546 + return Array.isArray(value);
3547 +}
3548 +function isError(value) {
3549 + return value instanceof Error;
3550 +}
3551 +function sleep(timeout) {
3552 + return new Promise(resolve => {
3553 + setTimeout(resolve, timeout);
3554 + });
3555 +}
3556 +/**
3557 + * Schedules a microtask.
3558 + * This can be useful to schedule state updates after rendering.
3559 + */
3560 +
3561 +function scheduleMicrotask(callback) {
3562 + sleep(0).then(callback);
3563 +}
3564 +function getAbortController() {
3565 + if (typeof AbortController === 'function') {
3566 + return new AbortController();
3567 + }
3568 +
3569 + return;
3570 +}
3571 +function replaceData(prevData, data, options) {
3572 + // Use prev data if an isDataEqual function is defined and returns `true`
3573 + if (options.isDataEqual != null && options.isDataEqual(prevData, data)) {
3574 + return prevData;
3575 + } else if (typeof options.structuralSharing === 'function') {
3576 + return options.structuralSharing(prevData, data);
3577 + } else if (options.structuralSharing !== false) {
3578 + // Structurally share data between prev and new data if needed
3579 + return replaceEqualDeep(prevData, data);
3580 + }
3581 +
3582 + return data;
3583 +}
3584 +
3585 +
3586 +//# sourceMappingURL=utils.mjs.map
3587 +
3588 +
3589 +/***/ }),
3590 +
3591 +/***/ "./node_modules/@tanstack/react-query/build/lib/QueryClientProvider.mjs":
3592 +/*!******************************************************************************!*\
3593 + !*** ./node_modules/@tanstack/react-query/build/lib/QueryClientProvider.mjs ***!
3594 + \******************************************************************************/
3595 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3596 +
3597 +__webpack_require__.r(__webpack_exports__);
3598 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3599 +/* harmony export */ QueryClientProvider: function() { return /* binding */ QueryClientProvider; },
3600 +/* harmony export */ defaultContext: function() { return /* binding */ defaultContext; },
3601 +/* harmony export */ useQueryClient: function() { return /* binding */ useQueryClient; }
3602 +/* harmony export */ });
3603 +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
3604 +'use client';
3605 +
3606 +
3607 +const defaultContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(undefined);
3608 +const QueryClientSharingContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(false); // If we are given a context, we will use it.
3609 +// Otherwise, if contextSharing is on, we share the first and at least one
3610 +// instance of the context across the window
3611 +// to ensure that if React Query is used across
3612 +// different bundles or microfrontends they will
3613 +// all use the same **instance** of context, regardless
3614 +// of module scoping.
3615 +
3616 +function getQueryClientContext(context, contextSharing) {
3617 + if (context) {
3618 + return context;
3619 + }
3620 +
3621 + if (contextSharing && typeof window !== 'undefined') {
3622 + if (!window.ReactQueryClientContext) {
3623 + window.ReactQueryClientContext = defaultContext;
3624 + }
3625 +
3626 + return window.ReactQueryClientContext;
3627 + }
3628 +
3629 + return defaultContext;
3630 +}
3631 +
3632 +const useQueryClient = ({
3633 + context
3634 +} = {}) => {
3635 + const queryClient = react__WEBPACK_IMPORTED_MODULE_0__.useContext(getQueryClientContext(context, react__WEBPACK_IMPORTED_MODULE_0__.useContext(QueryClientSharingContext)));
3636 +
3637 + if (!queryClient) {
3638 + throw new Error('No QueryClient set, use QueryClientProvider to set one');
3639 + }
3640 +
3641 + return queryClient;
3642 +};
3643 +const QueryClientProvider = ({
3644 + client,
3645 + children,
3646 + context,
3647 + contextSharing = false
3648 +}) => {
3649 + react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
3650 + client.mount();
3651 + return () => {
3652 + client.unmount();
3653 + };
3654 + }, [client]);
3655 +
3656 + if ( true && contextSharing) {
3657 + client.getLogger().error("The contextSharing option has been deprecated and will be removed in the next major version");
3658 + }
3659 +
3660 + const Context = getQueryClientContext(context, contextSharing);
3661 + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(QueryClientSharingContext.Provider, {
3662 + value: !context && contextSharing
3663 + }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Context.Provider, {
3664 + value: client
3665 + }, children));
3666 +};
3667 +
3668 +
3669 +//# sourceMappingURL=QueryClientProvider.mjs.map
3670 +
3671 +
3672 +/***/ }),
3673 +
3674 +/***/ "./node_modules/@tanstack/react-query/build/lib/QueryErrorResetBoundary.mjs":
3675 +/*!**********************************************************************************!*\
3676 + !*** ./node_modules/@tanstack/react-query/build/lib/QueryErrorResetBoundary.mjs ***!
3677 + \**********************************************************************************/
3678 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3679 +
3680 +__webpack_require__.r(__webpack_exports__);
3681 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3682 +/* harmony export */ QueryErrorResetBoundary: function() { return /* binding */ QueryErrorResetBoundary; },
3683 +/* harmony export */ useQueryErrorResetBoundary: function() { return /* binding */ useQueryErrorResetBoundary; }
3684 +/* harmony export */ });
3685 +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
3686 +'use client';
3687 +
3688 +
3689 +function createValue() {
3690 + let isReset = false;
3691 + return {
3692 + clearReset: () => {
3693 + isReset = false;
3694 + },
3695 + reset: () => {
3696 + isReset = true;
3697 + },
3698 + isReset: () => {
3699 + return isReset;
3700 + }
3701 + };
3702 +}
3703 +
3704 +const QueryErrorResetBoundaryContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(createValue()); // HOOK
3705 +
3706 +const useQueryErrorResetBoundary = () => react__WEBPACK_IMPORTED_MODULE_0__.useContext(QueryErrorResetBoundaryContext); // COMPONENT
3707 +
3708 +const QueryErrorResetBoundary = ({
3709 + children
3710 +}) => {
3711 + const [value] = react__WEBPACK_IMPORTED_MODULE_0__.useState(() => createValue());
3712 + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(QueryErrorResetBoundaryContext.Provider, {
3713 + value: value
3714 + }, typeof children === 'function' ? children(value) : children);
3715 +};
3716 +
3717 +
3718 +//# sourceMappingURL=QueryErrorResetBoundary.mjs.map
3719 +
3720 +
3721 +/***/ }),
3722 +
3723 +/***/ "./node_modules/@tanstack/react-query/build/lib/errorBoundaryUtils.mjs":
3724 +/*!*****************************************************************************!*\
3725 + !*** ./node_modules/@tanstack/react-query/build/lib/errorBoundaryUtils.mjs ***!
3726 + \*****************************************************************************/
3727 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3728 +
3729 +__webpack_require__.r(__webpack_exports__);
3730 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3731 +/* harmony export */ ensurePreventErrorBoundaryRetry: function() { return /* binding */ ensurePreventErrorBoundaryRetry; },
3732 +/* harmony export */ getHasError: function() { return /* binding */ getHasError; },
3733 +/* harmony export */ useClearResetErrorBoundary: function() { return /* binding */ useClearResetErrorBoundary; }
3734 +/* harmony export */ });
3735 +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
3736 +/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@tanstack/react-query/build/lib/utils.mjs");
3737 +'use client';
3738 +
3739 +
3740 +
3741 +const ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {
3742 + if (options.suspense || options.useErrorBoundary) {
3743 + // Prevent retrying failed query if the error boundary has not been reset yet
3744 + if (!errorResetBoundary.isReset()) {
3745 + options.retryOnMount = false;
3746 + }
3747 + }
3748 +};
3749 +const useClearResetErrorBoundary = errorResetBoundary => {
3750 + react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
3751 + errorResetBoundary.clearReset();
3752 + }, [errorResetBoundary]);
3753 +};
3754 +const getHasError = ({
3755 + result,
3756 + errorResetBoundary,
3757 + useErrorBoundary,
3758 + query
3759 +}) => {
3760 + return result.isError && !errorResetBoundary.isReset() && !result.isFetching && (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.shouldThrowError)(useErrorBoundary, [result.error, query]);
3761 +};
3762 +
3763 +
3764 +//# sourceMappingURL=errorBoundaryUtils.mjs.map
3765 +
3766 +
3767 +/***/ }),
3768 +
3769 +/***/ "./node_modules/@tanstack/react-query/build/lib/isRestoring.mjs":
3770 +/*!**********************************************************************!*\
3771 + !*** ./node_modules/@tanstack/react-query/build/lib/isRestoring.mjs ***!
3772 + \**********************************************************************/
3773 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3774 +
3775 +__webpack_require__.r(__webpack_exports__);
3776 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3777 +/* harmony export */ IsRestoringProvider: function() { return /* binding */ IsRestoringProvider; },
3778 +/* harmony export */ useIsRestoring: function() { return /* binding */ useIsRestoring; }
3779 +/* harmony export */ });
3780 +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
3781 +'use client';
3782 +
3783 +
3784 +const IsRestoringContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(false);
3785 +const useIsRestoring = () => react__WEBPACK_IMPORTED_MODULE_0__.useContext(IsRestoringContext);
3786 +const IsRestoringProvider = IsRestoringContext.Provider;
3787 +
3788 +
3789 +//# sourceMappingURL=isRestoring.mjs.map
3790 +
3791 +
3792 +/***/ }),
3793 +
3794 +/***/ "./node_modules/@tanstack/react-query/build/lib/suspense.mjs":
3795 +/*!*******************************************************************!*\
3796 + !*** ./node_modules/@tanstack/react-query/build/lib/suspense.mjs ***!
3797 + \*******************************************************************/
3798 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3799 +
3800 +__webpack_require__.r(__webpack_exports__);
3801 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3802 +/* harmony export */ ensureStaleTime: function() { return /* binding */ ensureStaleTime; },
3803 +/* harmony export */ fetchOptimistic: function() { return /* binding */ fetchOptimistic; },
3804 +/* harmony export */ shouldSuspend: function() { return /* binding */ shouldSuspend; },
3805 +/* harmony export */ willFetch: function() { return /* binding */ willFetch; }
3806 +/* harmony export */ });
3807 +const ensureStaleTime = defaultedOptions => {
3808 + if (defaultedOptions.suspense) {
3809 + // Always set stale time when using suspense to prevent
3810 + // fetching again when directly mounting after suspending
3811 + if (typeof defaultedOptions.staleTime !== 'number') {
3812 + defaultedOptions.staleTime = 1000;
3813 + }
3814 + }
3815 +};
3816 +const willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;
3817 +const shouldSuspend = (defaultedOptions, result, isRestoring) => (defaultedOptions == null ? void 0 : defaultedOptions.suspense) && willFetch(result, isRestoring);
3818 +const fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).then(({
3819 + data
3820 +}) => {
3821 + defaultedOptions.onSuccess == null ? void 0 : defaultedOptions.onSuccess(data);
3822 + defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(data, null);
3823 +}).catch(error => {
3824 + errorResetBoundary.clearReset();
3825 + defaultedOptions.onError == null ? void 0 : defaultedOptions.onError(error);
3826 + defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(undefined, error);
3827 +});
3828 +
3829 +
3830 +//# sourceMappingURL=suspense.mjs.map
3831 +
3832 +
3833 +/***/ }),
3834 +
3835 +/***/ "./node_modules/@tanstack/react-query/build/lib/useBaseQuery.mjs":
3836 +/*!***********************************************************************!*\
3837 + !*** ./node_modules/@tanstack/react-query/build/lib/useBaseQuery.mjs ***!
3838 + \***********************************************************************/
3839 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3840 +
3841 +__webpack_require__.r(__webpack_exports__);
3842 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3843 +/* harmony export */ useBaseQuery: function() { return /* binding */ useBaseQuery; }
3844 +/* harmony export */ });
3845 +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
3846 +/* harmony import */ var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tanstack/query-core */ "./node_modules/@tanstack/query-core/build/lib/notifyManager.mjs");
3847 +/* harmony import */ var _useSyncExternalStore_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./useSyncExternalStore.mjs */ "./node_modules/@tanstack/react-query/build/lib/useSyncExternalStore.mjs");
3848 +/* harmony import */ var _QueryErrorResetBoundary_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./QueryErrorResetBoundary.mjs */ "./node_modules/@tanstack/react-query/build/lib/QueryErrorResetBoundary.mjs");
3849 +/* harmony import */ var _QueryClientProvider_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./QueryClientProvider.mjs */ "./node_modules/@tanstack/react-query/build/lib/QueryClientProvider.mjs");
3850 +/* harmony import */ var _isRestoring_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isRestoring.mjs */ "./node_modules/@tanstack/react-query/build/lib/isRestoring.mjs");
3851 +/* harmony import */ var _errorBoundaryUtils_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./errorBoundaryUtils.mjs */ "./node_modules/@tanstack/react-query/build/lib/errorBoundaryUtils.mjs");
3852 +/* harmony import */ var _suspense_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./suspense.mjs */ "./node_modules/@tanstack/react-query/build/lib/suspense.mjs");
3853 +'use client';
3854 +
3855 +
3856 +
3857 +
3858 +
3859 +
3860 +
3861 +
3862 +
3863 +function useBaseQuery(options, Observer) {
3864 + const queryClient = (0,_QueryClientProvider_mjs__WEBPACK_IMPORTED_MODULE_1__.useQueryClient)({
3865 + context: options.context
3866 + });
3867 + const isRestoring = (0,_isRestoring_mjs__WEBPACK_IMPORTED_MODULE_2__.useIsRestoring)();
3868 + const errorResetBoundary = (0,_QueryErrorResetBoundary_mjs__WEBPACK_IMPORTED_MODULE_3__.useQueryErrorResetBoundary)();
3869 + const defaultedOptions = queryClient.defaultQueryOptions(options); // Make sure results are optimistically set in fetching state before subscribing or updating options
3870 +
3871 + defaultedOptions._optimisticResults = isRestoring ? 'isRestoring' : 'optimistic'; // Include callbacks in batch renders
3872 +
3873 + if (defaultedOptions.onError) {
3874 + defaultedOptions.onError = _tanstack_query_core__WEBPACK_IMPORTED_MODULE_4__.notifyManager.batchCalls(defaultedOptions.onError);
3875 + }
3876 +
3877 + if (defaultedOptions.onSuccess) {
3878 + defaultedOptions.onSuccess = _tanstack_query_core__WEBPACK_IMPORTED_MODULE_4__.notifyManager.batchCalls(defaultedOptions.onSuccess);
3879 + }
3880 +
3881 + if (defaultedOptions.onSettled) {
3882 + defaultedOptions.onSettled = _tanstack_query_core__WEBPACK_IMPORTED_MODULE_4__.notifyManager.batchCalls(defaultedOptions.onSettled);
3883 + }
3884 +
3885 + (0,_suspense_mjs__WEBPACK_IMPORTED_MODULE_5__.ensureStaleTime)(defaultedOptions);
3886 + (0,_errorBoundaryUtils_mjs__WEBPACK_IMPORTED_MODULE_6__.ensurePreventErrorBoundaryRetry)(defaultedOptions, errorResetBoundary);
3887 + (0,_errorBoundaryUtils_mjs__WEBPACK_IMPORTED_MODULE_6__.useClearResetErrorBoundary)(errorResetBoundary);
3888 + const [observer] = react__WEBPACK_IMPORTED_MODULE_0__.useState(() => new Observer(queryClient, defaultedOptions));
3889 + const result = observer.getOptimisticResult(defaultedOptions);
3890 + (0,_useSyncExternalStore_mjs__WEBPACK_IMPORTED_MODULE_7__.useSyncExternalStore)(react__WEBPACK_IMPORTED_MODULE_0__.useCallback(onStoreChange => {
3891 + const unsubscribe = isRestoring ? () => undefined : observer.subscribe(_tanstack_query_core__WEBPACK_IMPORTED_MODULE_4__.notifyManager.batchCalls(onStoreChange)); // Update result to make sure we did not miss any query updates
3892 + // between creating the observer and subscribing to it.
3893 +
3894 + observer.updateResult();
3895 + return unsubscribe;
3896 + }, [observer, isRestoring]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
3897 + react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
3898 + // Do not notify on updates because of changes in the options because
3899 + // these changes should already be reflected in the optimistic result.
3900 + observer.setOptions(defaultedOptions, {
3901 + listeners: false
3902 + });
3903 + }, [defaultedOptions, observer]); // Handle suspense
3904 +
3905 + if ((0,_suspense_mjs__WEBPACK_IMPORTED_MODULE_5__.shouldSuspend)(defaultedOptions, result, isRestoring)) {
3906 + throw (0,_suspense_mjs__WEBPACK_IMPORTED_MODULE_5__.fetchOptimistic)(defaultedOptions, observer, errorResetBoundary);
3907 + } // Handle error boundary
3908 +
3909 +
3910 + if ((0,_errorBoundaryUtils_mjs__WEBPACK_IMPORTED_MODULE_6__.getHasError)({
3911 + result,
3912 + errorResetBoundary,
3913 + useErrorBoundary: defaultedOptions.useErrorBoundary,
3914 + query: observer.getCurrentQuery()
3915 + })) {
3916 + throw result.error;
3917 + } // Handle result property usage tracking
3918 +
3919 +
3920 + return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;
3921 +}
3922 +
3923 +
3924 +//# sourceMappingURL=useBaseQuery.mjs.map
3925 +
3926 +
3927 +/***/ }),
3928 +
3929 +/***/ "./node_modules/@tanstack/react-query/build/lib/useMutation.mjs":
3930 +/*!**********************************************************************!*\
3931 + !*** ./node_modules/@tanstack/react-query/build/lib/useMutation.mjs ***!
3932 + \**********************************************************************/
3933 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3934 +
3935 +__webpack_require__.r(__webpack_exports__);
3936 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3937 +/* harmony export */ useMutation: function() { return /* binding */ useMutation; }
3938 +/* harmony export */ });
3939 +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
3940 +/* harmony import */ var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tanstack/query-core */ "./node_modules/@tanstack/query-core/build/lib/utils.mjs");
3941 +/* harmony import */ var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tanstack/query-core */ "./node_modules/@tanstack/query-core/build/lib/mutationObserver.mjs");
3942 +/* harmony import */ var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @tanstack/query-core */ "./node_modules/@tanstack/query-core/build/lib/notifyManager.mjs");
3943 +/* harmony import */ var _useSyncExternalStore_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./useSyncExternalStore.mjs */ "./node_modules/@tanstack/react-query/build/lib/useSyncExternalStore.mjs");
3944 +/* harmony import */ var _QueryClientProvider_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./QueryClientProvider.mjs */ "./node_modules/@tanstack/react-query/build/lib/QueryClientProvider.mjs");
3945 +/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@tanstack/react-query/build/lib/utils.mjs");
3946 +'use client';
3947 +
3948 +
3949 +
3950 +
3951 +
3952 +
3953 +function useMutation(arg1, arg2, arg3) {
3954 + const options = (0,_tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__.parseMutationArgs)(arg1, arg2, arg3);
3955 + const queryClient = (0,_QueryClientProvider_mjs__WEBPACK_IMPORTED_MODULE_2__.useQueryClient)({
3956 + context: options.context
3957 + });
3958 + const [observer] = react__WEBPACK_IMPORTED_MODULE_0__.useState(() => new _tanstack_query_core__WEBPACK_IMPORTED_MODULE_3__.MutationObserver(queryClient, options));
3959 + react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
3960 + observer.setOptions(options);
3961 + }, [observer, options]);
3962 + const result = (0,_useSyncExternalStore_mjs__WEBPACK_IMPORTED_MODULE_4__.useSyncExternalStore)(react__WEBPACK_IMPORTED_MODULE_0__.useCallback(onStoreChange => observer.subscribe(_tanstack_query_core__WEBPACK_IMPORTED_MODULE_5__.notifyManager.batchCalls(onStoreChange)), [observer]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
3963 + const mutate = react__WEBPACK_IMPORTED_MODULE_0__.useCallback((variables, mutateOptions) => {
3964 + observer.mutate(variables, mutateOptions).catch(noop);
3965 + }, [observer]);
3966 +
3967 + if (result.error && (0,_utils_mjs__WEBPACK_IMPORTED_MODULE_6__.shouldThrowError)(observer.options.useErrorBoundary, [result.error])) {
3968 + throw result.error;
3969 + }
3970 +
3971 + return { ...result,
3972 + mutate,
3973 + mutateAsync: result.mutate
3974 + };
3975 +} // eslint-disable-next-line @typescript-eslint/no-empty-function
3976 +
3977 +function noop() {}
3978 +
3979 +
3980 +//# sourceMappingURL=useMutation.mjs.map
3981 +
3982 +
3983 +/***/ }),
3984 +
3985 +/***/ "./node_modules/@tanstack/react-query/build/lib/useQuery.mjs":
3986 +/*!*******************************************************************!*\
3987 + !*** ./node_modules/@tanstack/react-query/build/lib/useQuery.mjs ***!
3988 + \*******************************************************************/
3989 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3990 +
3991 +__webpack_require__.r(__webpack_exports__);
3992 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3993 +/* harmony export */ useQuery: function() { return /* binding */ useQuery; }
3994 +/* harmony export */ });
3995 +/* harmony import */ var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tanstack/query-core */ "./node_modules/@tanstack/query-core/build/lib/utils.mjs");
3996 +/* harmony import */ var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tanstack/query-core */ "./node_modules/@tanstack/query-core/build/lib/queryObserver.mjs");
3997 +/* harmony import */ var _useBaseQuery_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useBaseQuery.mjs */ "./node_modules/@tanstack/react-query/build/lib/useBaseQuery.mjs");
3998 +'use client';
3999 +
4000 +
4001 +
4002 +function useQuery(arg1, arg2, arg3) {
4003 + const parsedOptions = (0,_tanstack_query_core__WEBPACK_IMPORTED_MODULE_0__.parseQueryArgs)(arg1, arg2, arg3);
4004 + return (0,_useBaseQuery_mjs__WEBPACK_IMPORTED_MODULE_1__.useBaseQuery)(parsedOptions, _tanstack_query_core__WEBPACK_IMPORTED_MODULE_2__.QueryObserver);
4005 +}
4006 +
4007 +
4008 +//# sourceMappingURL=useQuery.mjs.map
4009 +
4010 +
4011 +/***/ }),
4012 +
4013 +/***/ "./node_modules/@tanstack/react-query/build/lib/useSyncExternalStore.mjs":
4014 +/*!*******************************************************************************!*\
4015 + !*** ./node_modules/@tanstack/react-query/build/lib/useSyncExternalStore.mjs ***!
4016 + \*******************************************************************************/
4017 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
4018 +
4019 +__webpack_require__.r(__webpack_exports__);
4020 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
4021 +/* harmony export */ useSyncExternalStore: function() { return /* binding */ useSyncExternalStore; }
4022 +/* harmony export */ });
4023 +/* harmony import */ var use_sync_external_store_shim_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! use-sync-external-store/shim/index.js */ "./node_modules/use-sync-external-store/shim/index.js");
4024 +'use client';
4025 +
4026 +
4027 +const useSyncExternalStore = use_sync_external_store_shim_index_js__WEBPACK_IMPORTED_MODULE_0__.useSyncExternalStore;
4028 +
4029 +
4030 +//# sourceMappingURL=useSyncExternalStore.mjs.map
4031 +
4032 +
4033 +/***/ }),
4034 +
4035 +/***/ "./node_modules/@tanstack/react-query/build/lib/utils.mjs":
4036 +/*!****************************************************************!*\
4037 + !*** ./node_modules/@tanstack/react-query/build/lib/utils.mjs ***!
4038 + \****************************************************************/
4039 +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
4040 +
4041 +__webpack_require__.r(__webpack_exports__);
4042 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
4043 +/* harmony export */ shouldThrowError: function() { return /* binding */ shouldThrowError; }
4044 +/* harmony export */ });
4045 +function shouldThrowError(_useErrorBoundary, params) {
4046 + // Allow useErrorBoundary function to override throwing behavior on a per-error basis
4047 + if (typeof _useErrorBoundary === 'function') {
4048 + return _useErrorBoundary(...params);
4049 + }
4050 +
4051 + return !!_useErrorBoundary;
4052 +}
4053 +
4054 +
4055 +//# sourceMappingURL=utils.mjs.map
4056 +
4057 +
4058 +/***/ })
4059 +
4060 +/******/ });
4061 +/************************************************************************/
4062 +/******/ // The module cache
4063 +/******/ var __webpack_module_cache__ = {};
4064 +/******/
4065 +/******/ // The require function
4066 +/******/ function __webpack_require__(moduleId) {
4067 +/******/ // Check if module is in cache
4068 +/******/ var cachedModule = __webpack_module_cache__[moduleId];
4069 +/******/ if (cachedModule !== undefined) {
4070 +/******/ return cachedModule.exports;
4071 +/******/ }
4072 +/******/ // Create a new module (and put it into the cache)
4073 +/******/ var module = __webpack_module_cache__[moduleId] = {
4074 +/******/ // no module.id needed
4075 +/******/ // no module.loaded needed
4076 +/******/ exports: {}
4077 +/******/ };
4078 +/******/
4079 +/******/ // Execute the module function
4080 +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
4081 +/******/
4082 +/******/ // Return the exports of the module
4083 +/******/ return module.exports;
4084 +/******/ }
4085 +/******/
4086 +/************************************************************************/
4087 +/******/ /* webpack/runtime/define property getters */
4088 +/******/ !function() {
4089 +/******/ // define getter functions for harmony exports
4090 +/******/ __webpack_require__.d = function(exports, definition) {
4091 +/******/ for(var key in definition) {
4092 +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
4093 +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
4094 +/******/ }
4095 +/******/ }
4096 +/******/ };
4097 +/******/ }();
4098 +/******/
4099 +/******/ /* webpack/runtime/hasOwnProperty shorthand */
4100 +/******/ !function() {
4101 +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
4102 +/******/ }();
4103 +/******/
4104 +/******/ /* webpack/runtime/make namespace object */
4105 +/******/ !function() {
4106 +/******/ // define __esModule on exports
4107 +/******/ __webpack_require__.r = function(exports) {
4108 +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
4109 +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4110 +/******/ }
4111 +/******/ Object.defineProperty(exports, '__esModule', { value: true });
4112 +/******/ };
4113 +/******/ }();
4114 +/******/
4115 +/************************************************************************/
4116 +var __webpack_exports__ = {};
4117 +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
4118 +!function() {
4119 +/*!******************************************************!*\
4120 + !*** ./node_modules/@elementor/query/dist/index.mjs ***!
4121 + \******************************************************/
4122 +__webpack_require__.r(__webpack_exports__);
4123 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
4124 +/* harmony export */ QueryClient: function() { return /* reexport safe */ _tanstack_react_query__WEBPACK_IMPORTED_MODULE_0__.QueryClient; },
4125 +/* harmony export */ QueryClientProvider: function() { return /* reexport safe */ _tanstack_react_query__WEBPACK_IMPORTED_MODULE_1__.QueryClientProvider; },
4126 +/* harmony export */ createQueryClient: function() { return /* binding */ createQueryClient; },
4127 +/* harmony export */ useMutation: function() { return /* reexport safe */ _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.useMutation; },
4128 +/* harmony export */ useQuery: function() { return /* reexport safe */ _tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__.useQuery; },
4129 +/* harmony export */ useQueryClient: function() { return /* reexport safe */ _tanstack_react_query__WEBPACK_IMPORTED_MODULE_1__.useQueryClient; }
4130 +/* harmony export */ });
4131 +/* harmony import */ var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tanstack/react-query */ "./node_modules/@tanstack/query-core/build/lib/queryClient.mjs");
4132 +/* harmony import */ var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tanstack/react-query */ "./node_modules/@tanstack/react-query/build/lib/QueryClientProvider.mjs");
4133 +/* harmony import */ var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tanstack/react-query */ "./node_modules/@tanstack/react-query/build/lib/useMutation.mjs");
4134 +/* harmony import */ var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tanstack/react-query */ "./node_modules/@tanstack/react-query/build/lib/useQuery.mjs");
4135 +// src/index.ts
4136 +
4137 +
4138 +function createQueryClient() {
4139 + return new _tanstack_react_query__WEBPACK_IMPORTED_MODULE_0__.QueryClient({
4140 + defaultOptions: {
4141 + queries: {
4142 + refetchOnWindowFocus: false,
4143 + refetchOnReconnect: false
4144 + }
4145 + }
4146 + });
4147 +}
4148 +
4149 +//# sourceMappingURL=index.mjs.map
4150 +}();
4151 +(window.elementorV2 = window.elementorV2 || {}).query = __webpack_exports__;
4152 +/******/ })()
4153 +;