1(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([typeof document === "object" ? document.currentScript : undefined, 2175555, 915823, 3((__turbopack_context__) => { 4"use strict"; 5 6// MERGED MODULE: [project]/node_modules/@tanstack/query-core/build/modern/focusManager.js [app-client] (ecmascript) 7; 8// MERGED MODULE: [project]/node_modules/@tanstack/query-core/build/modern/subscribable.js [app-client] (ecmascript) 9;
10// src/subscribable.ts 11var Subscribable = class { 12 constructor(){ 13 this.listeners = /* @__PURE__ */ new Set(); 14 this.subscribe = this.subscribe.bind(this); 15 } 16 subscribe(listener) { 17 this.listeners.add(listener); 18 this.onSubscribe(); 19 return ()=>{ 20 this.listeners.delete(listener); 21 this.onUnsubscribe(); 22 }; 23 } 24 hasListeners() { 25 return this.listeners.size > 0; 26 } 27 onSubscribe() {} 28 onUnsubscribe() {} 29}; 30; 31__turbopack_context__.s([ 32 "Subscribable", 33 0, 34 Subscribable 35], 915823); 36; 37var FocusManager = class extends Subscribable { 38 #focused; 39 #cleanup; 40 #setup; 41 constructor(){ 42 super(); 43 this.#setup = (onFocus)=>{ 44 if (typeof window !== "undefined" && window.addEventListener) { 45 const listener = ()=>onFocus(); 46 window.addEventListener("visibilitychange", listener, false); 47 return ()=>{ 48 window.removeEventListener("visibilitychange", listener); 49 }; 50 } 51 return; 52 }; 53 } 54 onSubscribe() { 55 if (!this.#cleanup) { 56 this.setEventListener(this.#setup); 57 } 58 } 59 onUnsubscribe() { 60 if (!this.hasListeners()) { 61 this.#cleanup?.(); 62 this.#cleanup = void 0; 63 } 64 } 65 setEventListener(setup) { 66 this.#setup = setup; 67 this.#cleanup?.(); 68 this.#cleanup = setup((focused)=>{ 69 if (typeof focused === "boolean") { 70 this.setFocused(focused); 71 } else { 72 this.onFocus(); 73 } 74 }); 75 } 76 setFocused(focused) { 77 const changed = this.#focused !== focused; 78 if (changed) { 79 this.#focused = focused; 80 this.onFocus(); 81 } 82 } 83 onFocus() { 84 const isFocused = this.isFocused(); 85 this.listeners.forEach((listener)=>{ 86 listener(isFocused); 87 }); 88 } 89 isFocused() { 90 if (typeof this.#focused === "boolean") { 91 return this.#focused; 92 } 93 return globalThis.document?.visibilityState !== "hidden"; 94 } 95}; 96var focusManager = new FocusManager(); 97; 98__turbopack_context__.s([ 99 "focusManager", 100 0, 101 focusManager 102], 175555); 103}), 104180166, ((__turbopack_context__) => { 105"use strict"; 106 107var __TURBOPACK__imported__module__247167__ = /*#__PURE__*/ __turbopack_context__.i(247167);
108// src/timeoutManager.ts 109var defaultTimeoutProvider = { 110 // We need the wrapper function syntax below instead of direct references to 111 // global setTimeout etc. 112 // 113 // BAD: `setTimeout: setTimeout` 114 // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)` 115 // 116 // If we use direct references here, then anything that wants to spy on or 117 // replace the global setTimeout (like tests) won't work since we'll already 118 // have a hard reference to the original implementation at the time when this 119 // file was imported. 120 setTimeout: (callback, delay)=>setTimeout(callback, delay), 121 clearTimeout: (timeoutId)=>clearTimeout(timeoutId), 122 setInterval: (callback, delay)=>setInterval(callback, delay), 123 clearInterval: (intervalId)=>clearInterval(intervalId) 124}; 125var TimeoutManager = class { 126 // We cannot have TimeoutManager<T> as we must instantiate it with a concrete 127 // type at app boot; and if we leave that type, then any new timer provider 128 // would need to support the default provider's concrete timer ID, which is 129 // infeasible across environments. 130 // 131 // We settle for type safety for the TimeoutProvider type, and accept that 132 // this class is unsafe internally to allow for extension. 133 #provider = defaultTimeoutProvider; 134 #providerCalled = false; 135 setTimeoutProvider(provider) { 136 if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable 137 ; 138 this.#provider = provider; 139 if (("TURBOPACK compile-time value", "production") !== "production") { 140 this.#providerCalled = false; 141 } 142 } 143 setTimeout(callback, delay) { 144 if (("TURBOPACK compile-time value", "production") !== "production") { 145 this.#providerCalled = true; 146 } 147 return this.#provider.setTimeout(callback, delay); 148 } 149 clearTimeout(timeoutId) { 150 this.#provider.clearTimeout(timeoutId); 151 } 152 setInterval(callback, delay) { 153 if (("TURBOPACK compile-time value", "production") !== "production") { 154 this.#providerCalled = true; 155 } 156 return this.#provider.setInterval(callback, delay); 157 } 158 clearInterval(intervalId) { 159 this.#provider.clearInterval(intervalId); 160 } 161}; 162var timeoutManager = new TimeoutManager(); 163function systemSetTimeoutZero(callback) { 164 setTimeout(callback, 0); 165} 166; 167__turbopack_context__.s([ 168 "systemSetTimeoutZero", 169 0, 170 systemSetTimeoutZero, 171 "timeoutManager", 172 0, 173 timeoutManager 174]); 175}), 176273911, 619273, 177((__turbopack_context__) => { 178"use strict"; 179 180// MERGED MODULE: [project]/node_modules/@tanstack/query-core/build/modern/environmentManager.js [app-client] (ecmascript) 181; 182// MERGED MODULE: [project]/node_modules/@tanstack/query-core/build/modern/utils.js [app-client] (ecmascript) 183; 184var __TURBOPACK__imported__module__247167__ = __turbopack_context__.i(247167);
vendor: 4,245 bytes, lines 185-313
185// src/utils.ts 186var __TURBOPACK__imported__module__180166__ = __turbopack_context__.i(180166); 187; 188var isServer = typeof window === "undefined" || "Deno" in globalThis; 189function noop() {} 190function functionalUpdate(updater, input) { 191 return typeof updater === "function" ? updater(input) : updater; 192} 193function isValidTimeout(value) { 194 return typeof value === "number" && value >= 0 && value !== Infinity; 195} 196function timeUntilStale(updatedAt, staleTime) { 197 return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); 198} 199function resolveStaleTime(staleTime, query) { 200 return typeof staleTime === "function" ? staleTime(query) : staleTime; 201} 202function resolveQueryBoolean(option, query) { 203 return typeof option === "function" ? option(query) : option; 204} 205function matchQuery(filters, query) { 206 const { type = "all", exact, fetchStatus, predicate, queryKey, stale } = filters; 207 if (queryKey) { 208 if (exact) { 209 if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { 210 return false; 211 } 212 } else if (!partialMatchKey(query.queryKey, queryKey)) { 213 return false; 214 } 215 } 216 if (type !== "all") { 217 const isActive = query.isActive(); 218 if (type === "active" && !isActive) { 219 return false; 220 } 221 if (type === "inactive" && isActive) { 222 return false; 223 } 224 } 225 if (typeof stale === "boolean" && query.isStale() !== stale) { 226 return false; 227 } 228 if (fetchStatus && fetchStatus !== query.state.fetchStatus) { 229 return false; 230 } 231 if (predicate && !predicate(query)) { 232 return false; 233 } 234 return true; 235} 236function matchMutation(filters, mutation) { 237 const { exact, status, predicate, mutationKey } = filters; 238 if (mutationKey) { 239 if (!mutation.options.mutationKey) { 240 return false; 241 } 242 if (exact) { 243 if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { 244 return false; 245 } 246 } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { 247 return false; 248 } 249 } 250 if (status && mutation.state.status !== status) { 251 return false; 252 } 253 if (predicate && !predicate(mutation)) { 254 return false; 255 } 256 return true; 257} 258function hashQueryKeyByOptions(queryKey, options) { 259 const hashFn = options?.queryKeyHashFn || hashKey; 260 return hashFn(queryKey); 261} 262function hashKey(queryKey) { 263 return JSON.stringify(queryKey, (_, val)=>isPlainObject(val) ? Object.keys(val).sort().reduce((result, key)=>{ 264 result[key] = val[key]; 265 return result; 266 }, {}) : val); 267} 268function partialMatchKey(a, b) { 269 if (a === b) { 270 return true; 271 } 272 if (typeof a !== typeof b) { 273 return false; 274 } 275 if (a && b && typeof a === "object" && typeof b === "object") { 276 return Object.keys(b).every((key)=>partialMatchKey(a[key], b[key])); 277 } 278 return false; 279} 280var hasOwn = Object.prototype.hasOwnProperty; 281function replaceEqualDeep(a, b, depth = 0) { 282 if (a === b) { 283 return a; 284 } 285 if (depth > 500) return b; 286 const array = isPlainArray(a) && isPlainArray(b); 287 if (!array && !(isPlainObject(a) && isPlainObject(b))) return b; 288 const aItems = array ? a : Object.keys(a); 289 const aSize = aItems.length; 290 const bItems = array ? b : Object.keys(b); 291 const bSize = bItems.length; 292 const copy = array ? new Array(bSize) : {}; 293 let equalItems = 0; 294 for(let i = 0; i < bSize; i++){ 295 const key = array ? i : bItems[i]; 296 const aItem = a[key]; 297 const bItem = b[key]; 298 if (aItem === bItem) { 299 copy[key] = aItem; 300 if (array ? i < aSize : hasOwn.call(a, key)) equalItems++; 301 continue; 302 } 303 if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") { 304 copy[key] = bItem; 305 continue; 306 } 307 const v = replaceEqualDeep(aItem, bItem, depth + 1); 308 copy[key] = v; 309 if (v === aItem) equalItems++; 310 } 311 return aSize === bSize && equalItems === aSize ? a : copy; 312} 313function shallowEqualObjects(a, b) {
314 if (!b || Object.keys(a).length !== Object.keys(b).length) { 315 return false; 316 } 317 for(const key in a){ 318 if (a[key] !== b[key]) { 319 return false; 320 } 321 } 322 return true; 323} 324function isPlainArray(value) { 325 return Array.isArray(value) && value.length === Object.keys(value).length; 326} 327function isPlainObject(o) { 328 if (!hasObjectPrototype(o)) { 329 return false; 330 } 331 const ctor = o.constructor; 332 if (ctor === void 0) { 333 return true; 334 } 335 const prot = ctor.prototype; 336 if (!hasObjectPrototype(prot)) { 337 return false; 338 } 339 if (!prot.hasOwnProperty("isPrototypeOf")) { 340 return false; 341 } 342 if (Object.getPrototypeOf(o) !== Object.prototype) { 343 return false; 344 } 345 return true; 346} 347function hasObjectPrototype(o) { 348 return Object.prototype.toString.call(o) === "[object Object]"; 349} 350function sleep(timeout) { 351 return new Promise((resolve)=>{ 352 __TURBOPACK__imported__module__180166__["timeoutManager"].setTimeout(resolve, timeout); 353 }); 354} 355function replaceData(prevData, data, options) { 356 if (typeof options.structuralSharing === "function") { 357 return options.structuralSharing(prevData, data); 358 } else if (options.structuralSharing !== false) { 359 if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable 360 ; 361 return replaceEqualDeep(prevData, data); 362 } 363 return data; 364} 365function keepPreviousData(previousData) { 366 return previousData; 367} 368function addToEnd(items, item, max = 0) { 369 const newItems = [ 370 ...items, 371 item 372 ]; 373 return max && newItems.length > max ? newItems.slice(1) : newItems; 374} 375function addToStart(items, item, max = 0) { 376 const newItems = [ 377 item, 378 ...items 379 ]; 380 return max && newItems.length > max ? newItems.slice(0, -1) : newItems; 381} 382var skipToken = /* @__PURE__ */ Symbol(); 383function ensureQueryFn(options, fetchOptions) { 384 if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable 385 ; 386 if (!options.queryFn && fetchOptions?.initialPromise) { 387 return ()=>fetchOptions.initialPromise; 388 } 389 if (!options.queryFn || options.queryFn === skipToken) { 390 return ()=>Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); 391 } 392 return options.queryFn; 393} 394function shouldThrowError(throwOnError, params) { 395 if (typeof throwOnError === "function") { 396 return throwOnError(...params); 397 } 398 return !!throwOnError; 399} 400function addConsumeAwareSignal(object, getSignal, onCancelled) {
401 let consumed = false; 402 let signal; 403 Object.defineProperty(object, "signal", { 404 enumerable: true, 405 get: ()=>{ 406 signal ??= getSignal(); 407 if (consumed) { 408 return signal; 409 } 410 consumed = true; 411 if (signal.aborted) { 412 onCancelled(); 413 } else { 414 signal.addEventListener("abort", onCancelled, { 415 once: true 416 }); 417 } 418 return signal; 419 } 420 }); 421 return object; 422} 423; 424__turbopack_context__.s([ 425 "addConsumeAwareSignal", 426 0, 427 addConsumeAwareSignal, 428 "addToEnd", 429 0, 430 addToEnd, 431 "addToStart", 432 0, 433 addToStart, 434 "ensureQueryFn", 435 0, 436 ensureQueryFn, 437 "functionalUpdate", 438 0, 439 functionalUpdate, 440 "hashKey", 441 0, 442 hashKey, 443 "hashQueryKeyByOptions", 444 0, 445 hashQueryKeyByOptions, 446 "isServer", 447 0, 448 isServer, 449 "isValidTimeout", 450 0, 451 isValidTimeout, 452 "keepPreviousData", 453 0, 454 keepPreviousData, 455 "matchMutation", 456 0, 457 matchMutation, 458 "matchQuery", 459 0, 460 matchQuery, 461 "noop", 462 0, 463 noop, 464 "partialMatchKey", 465 0, 466 partialMatchKey, 467 "replaceData", 468 0, 469 replaceData, 470 "replaceEqualDeep", 471 0, 472 replaceEqualDeep, 473 "resolveQueryBoolean", 474 0, 475 resolveQueryBoolean, 476 "resolveStaleTime", 477 0, 478 resolveStaleTime, 479 "shallowEqualObjects", 480 0, 481 shallowEqualObjects, 482 "shouldThrowError", 483 0, 484 shouldThrowError, 485 "skipToken", 486 0, 487 skipToken, 488 "sleep", 489 0, 490 sleep, 491 "timeUntilStale", 492 0, 493 timeUntilStale 494], 619273); 495; 496var environmentManager = /* @__PURE__ */ (()=>{ 497 let isServerFn = ()=>isServer; 498 return { 499 /** 500 * Returns whether the current runtime should be treated as a server environment. 501 */ isServer () { 502 return isServerFn(); 503 }, 504 /** 505 * Overrides the server check globally. 506 */ setIsServer (isServerValue) { 507 isServerFn = isServerValue; 508 } 509 }; 510})(); 511; 512__turbopack_context__.s([ 513 "environmentManager", 514 0, 515 environmentManager 516], 273911); 517}), 518540143, ((__turbopack_context__) => { 519"use strict"; 520
521// src/notifyManager.ts 522var __TURBOPACK__imported__module__180166__ = __turbopack_context__.i(180166); 523; 524var defaultScheduler = __TURBOPACK__imported__module__180166__["systemSetTimeoutZero"]; 525function createNotifyManager() { 526 let queue = []; 527 let transactions = 0; 528 let notifyFn = (callback)=>{ 529 callback(); 530 }; 531 let batchNotifyFn = (callback)=>{ 532 callback(); 533 }; 534 let scheduleFn = defaultScheduler; 535 const schedule = (callback)=>{ 536 if (transactions) { 537 queue.push(callback); 538 } else { 539 scheduleFn(()=>{ 540 notifyFn(callback); 541 }); 542 } 543 }; 544 const flush = ()=>{ 545 const originalQueue = queue; 546 queue = []; 547 if (originalQueue.length) { 548 scheduleFn(()=>{ 549 batchNotifyFn(()=>{ 550 originalQueue.forEach((callback)=>{ 551 notifyFn(callback); 552 }); 553 }); 554 }); 555 } 556 }; 557 return { 558 batch: (callback)=>{ 559 let result; 560 transactions++; 561 try { 562 result = callback(); 563 } finally{ 564 transactions--; 565 if (!transactions) { 566 flush(); 567 } 568 } 569 return result; 570 }, 571 /** 572 * All calls to the wrapped function will be batched. 573 */ batchCalls: (callback)=>{ 574 return (...args)=>{ 575 schedule(()=>{ 576 callback(...args); 577 }); 578 }; 579 }, 580 schedule, 581 /** 582 * Use this method to set a custom notify function. 583 * This can be used to for example wrap notifications with `React.act` while running tests. 584 */ setNotifyFunction: (fn)=>{ 585 notifyFn = fn; 586 }, 587 /** 588 * Use this method to set a custom function to batch notifications together into a single tick. 589 * By default React Query will use the batch function provided by ReactDOM or React Native. 590 */ setBatchNotifyFunction: (fn)=>{ 591 batchNotifyFn = fn; 592 }, 593 setScheduler: (fn)=>{ 594 scheduleFn = fn; 595 } 596 }; 597} 598var notifyManager = createNotifyManager(); 599; 600__turbopack_context__.s([ 601 "notifyManager", 602 0, 603 notifyManager 604]); 605}), 606936553, 814448, 607793803, 608((__turbopack_context__) => { 609"use strict"; 610 611// MERGED MODULE: [project]/node_modules/@tanstack/query-core/build/modern/retryer.js [app-client] (ecmascript) 612;
613// src/retryer.ts 614var __TURBOPACK__imported__module__175555__ = __turbopack_context__.i(175555); 615// MERGED MODULE: [project]/node_modules/@tanstack/query-core/build/modern/onlineManager.js [app-client] (ecmascript) 616;
617// src/onlineManager.ts 618var __TURBOPACK__imported__module__915823__ = __turbopack_context__.i(915823); 619; 620var OnlineManager = class extends __TURBOPACK__imported__module__915823__["Subscribable"] { 621 #online = true; 622 #cleanup; 623 #setup; 624 constructor(){ 625 super(); 626 this.#setup = (onOnline)=>{ 627 if (typeof window !== "undefined" && window.addEventListener) { 628 const onlineListener = ()=>onOnline(true); 629 const offlineListener = ()=>onOnline(false); 630 window.addEventListener("online", onlineListener, false); 631 window.addEventListener("offline", offlineListener, false); 632 return ()=>{ 633 window.removeEventListener("online", onlineListener); 634 window.removeEventListener("offline", offlineListener); 635 }; 636 } 637 return; 638 }; 639 } 640 onSubscribe() { 641 if (!this.#cleanup) { 642 this.setEventListener(this.#setup); 643 } 644 } 645 onUnsubscribe() { 646 if (!this.hasListeners()) { 647 this.#cleanup?.(); 648 this.#cleanup = void 0; 649 } 650 } 651 setEventListener(setup) { 652 this.#setup = setup; 653 this.#cleanup?.(); 654 this.#cleanup = setup(this.setOnline.bind(this)); 655 } 656 setOnline(online) { 657 const changed = this.#online !== online; 658 if (changed) { 659 this.#online = online; 660 this.listeners.forEach((listener)=>{ 661 listener(online); 662 }); 663 } 664 } 665 isOnline() { 666 return this.#online; 667 } 668}; 669var onlineManager = new OnlineManager(); 670; 671__turbopack_context__.s([ 672 "onlineManager", 673 0, 674 onlineManager 675], 814448); 676// MERGED MODULE: [project]/node_modules/@tanstack/query-core/build/modern/thenable.js [app-client] (ecmascript) 677;
678// src/thenable.ts 679var __TURBOPACK__imported__module__619273__ = __turbopack_context__.i(619273); 680; 681function pendingThenable() { 682 let resolve; 683 let reject; 684 const thenable = new Promise((_resolve, _reject)=>{ 685 resolve = _resolve; 686 reject = _reject; 687 }); 688 thenable.status = "pending"; 689 thenable.catch(()=>{}); 690 function finalize(data) { 691 Object.assign(thenable, data); 692 delete thenable.resolve; 693 delete thenable.reject; 694 } 695 thenable.resolve = (value)=>{ 696 finalize({ 697 status: "fulfilled", 698 value 699 }); 700 resolve(value); 701 }; 702 thenable.reject = (reason)=>{ 703 finalize({ 704 status: "rejected", 705 reason 706 }); 707 reject(reason); 708 }; 709 return thenable; 710} 711function tryResolveSync(promise) { 712 let data; 713 promise.then((result)=>{ 714 data = result; 715 return result; 716 }, __TURBOPACK__imported__module__619273__["noop"])?.catch(__TURBOPACK__imported__module__619273__["noop"]); 717 if (data !== void 0) { 718 return { 719 data 720 }; 721 } 722 return void 0; 723} 724; 725__turbopack_context__.s([ 726 "pendingThenable", 727 0, 728 pendingThenable 729], 793803); 730var __TURBOPACK__imported__module__273911__ = __turbopack_context__.i(273911); 731var __TURBOPACK__imported__module__619273__1 = __TURBOPACK__imported__module__619273__; 732; 733; 734; 735; 736; 737function defaultRetryDelay(failureCount) { 738 return Math.min(1e3 * 2 ** failureCount, 3e4); 739} 740function canFetch(networkMode) { 741 return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true; 742} 743var CancelledError = class extends Error { 744 constructor(options){ 745 super("CancelledError"); 746 this.revert = options?.revert; 747 this.silent = options?.silent; 748 } 749}; 750function isCancelledError(value) { 751 return value instanceof CancelledError; 752} 753function createRetryer(config) { 754 let isRetryCancelled = false; 755 let failureCount = 0; 756 let continueFn; 757 const thenable = pendingThenable(); 758 const isResolved = ()=>thenable.status !== "pending"; 759 const cancel = (cancelOptions)=>{ 760 if (!isResolved()) { 761 const error = new CancelledError(cancelOptions); 762 reject(error); 763 config.onCancel?.(error); 764 } 765 }; 766 const cancelRetry = ()=>{ 767 isRetryCancelled = true; 768 }; 769 const continueRetry = ()=>{ 770 isRetryCancelled = false; 771 }; 772 const canContinue = ()=>__TURBOPACK__imported__module__175555__["focusManager"].isFocused() && (config.networkMode === "always" || onlineManager.isOnline()) && config.canRun(); 773 const canStart = ()=>canFetch(config.networkMode) && config.canRun(); 774 const resolve = (value)=>{ 775 if (!isResolved()) { 776 continueFn?.(); 777 thenable.resolve(value); 778 } 779 }; 780 const reject = (value)=>{ 781 if (!isResolved()) { 782 continueFn?.(); 783 thenable.reject(value); 784 } 785 }; 786 const pause = ()=>{ 787 return new Promise((continueResolve)=>{ 788 continueFn = (value)=>{ 789 if (isResolved() || canContinue()) { 790 continueResolve(value); 791 } 792 }; 793 config.onPause?.(); 794 }).then(()=>{ 795 continueFn = void 0; 796 if (!isResolved()) { 797 config.onContinue?.(); 798 } 799 }); 800 }; 801 const run = ()=>{ 802 if (isResolved()) { 803 return; 804 } 805 let promiseOrValue; 806 const initialPromise = failureCount === 0 ? config.initialPromise : void 0; 807 try { 808 promiseOrValue = initialPromise ?? config.fn(); 809 } catch (error) { 810 promiseOrValue = Promise.reject(error); 811 } 812 Promise.resolve(promiseOrValue).then(resolve).catch((error)=>{ 813 if (isResolved()) { 814 return; 815 } 816 const retry = config.retry ?? (__TURBOPACK__imported__module__273911__["environmentManager"].isServer() ? 0 : 3); 817 const retryDelay = config.retryDelay ?? defaultRetryDelay;
818 const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; 819 const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); 820 if (isRetryCancelled || !shouldRetry) { 821 reject(error); 822 return; 823 } 824 failureCount++; 825 config.onFail?.(failureCount, error); 826 (0, __TURBOPACK__imported__module__619273__1["sleep"])(delay).then(()=>{ 827 return canContinue() ? void 0 : pause(); 828 }).then(()=>{ 829 if (isRetryCancelled) { 830 reject(error); 831 } else { 832 run(); 833 } 834 }); 835 }); 836 }; 837 return { 838 promise: thenable, 839 status: ()=>thenable.status, 840 cancel, 841 continue: ()=>{ 842 continueFn?.(); 843 return thenable; 844 }, 845 cancelRetry, 846 continueRetry, 847 canStart, 848 start: ()=>{ 849 if (canStart()) { 850 run(); 851 } else { 852 pause().then(run); 853 } 854 return thenable; 855 } 856 }; 857} 858; 859__turbopack_context__.s([ 860 "CancelledError", 861 0, 862 CancelledError, 863 "canFetch", 864 0, 865 canFetch, 866 "createRetryer", 867 0, 868 createRetryer 869], 936553); 870}), 87188587, ((__turbopack_context__) => { 872"use strict"; 873
874// src/removable.ts 875var __TURBOPACK__imported__module__180166__ = __turbopack_context__.i(180166); 876var __TURBOPACK__imported__module__273911__ = __turbopack_context__.i(273911); 877var __TURBOPACK__imported__module__619273__ = __turbopack_context__.i(619273); 878; 879; 880; 881var Removable = class { 882 #gcTimeout; 883 destroy() { 884 this.clearGcTimeout(); 885 } 886 scheduleGc() { 887 this.clearGcTimeout(); 888 if ((0, __TURBOPACK__imported__module__619273__["isValidTimeout"])(this.gcTime)) { 889 this.#gcTimeout = __TURBOPACK__imported__module__180166__["timeoutManager"].setTimeout(()=>{ 890 this.optionalRemove(); 891 }, this.gcTime); 892 } 893 } 894 updateGcTime(newGcTime) { 895 this.gcTime = Math.max(this.gcTime || 0, newGcTime ?? (__TURBOPACK__imported__module__273911__["environmentManager"].isServer() ? Infinity : 5 * 60 * 1e3)); 896 } 897 clearGcTimeout() { 898 if (this.#gcTimeout !== void 0) { 899 __TURBOPACK__imported__module__180166__["timeoutManager"].clearTimeout(this.#gcTimeout); 900 this.#gcTimeout = void 0; 901 } 902 } 903}; 904; 905__turbopack_context__.s([ 906 "Removable", 907 0, 908 Removable 909]); 910}), 911286491, ((__turbopack_context__) => { 912"use strict"; 913 914var __TURBOPACK__imported__module__247167__ = /*#__PURE__*/ __turbopack_context__.i(247167);
915// src/query.ts 916var __TURBOPACK__imported__module__619273__ = __turbopack_context__.i(619273); 917var __TURBOPACK__imported__module__540143__ = __turbopack_context__.i(540143); 918var __TURBOPACK__imported__module__936553__ = __turbopack_context__.i(936553); 919var __TURBOPACK__imported__module__88587__ = __turbopack_context__.i(88587); 920; 921; 922; 923; 924var Query = class extends __TURBOPACK__imported__module__88587__["Removable"] { 925 #initialState; 926 #revertState; 927 #cache; 928 #client; 929 #retryer; 930 #defaultOptions; 931 #abortSignalConsumed; 932 constructor(config){ 933 super(); 934 this.#abortSignalConsumed = false; 935 this.#defaultOptions = config.defaultOptions; 936 this.setOptions(config.options); 937 this.observers = []; 938 this.#client = config.client; 939 this.#cache = this.#client.getQueryCache(); 940 this.queryKey = config.queryKey; 941 this.queryHash = config.queryHash; 942 this.#initialState = getDefaultState(this.options); 943 this.state = config.state ?? this.#initialState; 944 this.scheduleGc(); 945 } 946 get meta() { 947 return this.options.meta; 948 } 949 get promise() { 950 return this.#retryer?.promise; 951 } 952 setOptions(options) { 953 this.options = { 954 ...this.#defaultOptions, 955 ...options 956 }; 957 this.updateGcTime(this.options.gcTime); 958 if (this.state && this.state.data === void 0) { 959 const defaultState = getDefaultState(this.options); 960 if (defaultState.data !== void 0) { 961 this.setState(successState(defaultState.data, defaultState.dataUpdatedAt)); 962 this.#initialState = defaultState; 963 } 964 } 965 } 966 optionalRemove() { 967 if (!this.observers.length && this.state.fetchStatus === "idle") { 968 this.#cache.remove(this); 969 } 970 } 971 setData(newData, options) { 972 const data = (0, __TURBOPACK__imported__module__619273__["replaceData"])(this.state.data, newData, this.options); 973 this.#dispatch({ 974 data, 975 type: "success", 976 dataUpdatedAt: options?.updatedAt, 977 manual: options?.manual 978 }); 979 return data; 980 } 981 setState(state, setStateOptions) { 982 this.#dispatch({ 983 type: "setState", 984 state, 985 setStateOptions 986 }); 987 } 988 cancel(options) { 989 const promise = this.#retryer?.promise; 990 this.#retryer?.cancel(options); 991 return promise ? promise.then(__TURBOPACK__imported__module__619273__["noop"]).catch(__TURBOPACK__imported__module__619273__["noop"]) : Promise.resolve(); 992 } 993 destroy() { 994 super.destroy(); 995 this.cancel({ 996 silent: true 997 }); 998 } 999 get resetState() { 1000 return this.#initialState; 1001 } 1002 reset() { 1003 this.destroy(); 1004 this.setState(this.resetState); 1005 } 1006 isActive() { 1007 return this.observers.some((observer)=>(0, __TURBOPACK__imported__module__619273__["resolveQueryBoolean"])(observer.options.enabled, this) !== false); 1008 } 1009 isDisabled() { 1010 if (this.getObserversCount() > 0) { 1011 return !this.isActive(); 1012 } 1013 return this.options.queryFn === __TURBOPACK__imported__module__619273__["skipToken"] || !this.isFetched(); 1014 } 1015 isFetched() { 1016 return this.state.dataUpdateCount + this.state.errorUpdateCount > 0; 1017 } 1018 isStatic() { 1019 if (this.getObserversCount() > 0) { 1020 return this.observers.some((observer)=>(0, __TURBOPACK__imported__module__619273__["resolveStaleTime"])(observer.options.staleTime, this) === "static"); 1021 } 1022 return false; 1023 } 1024 isStale() { 1025 if (this.getObserversCount() > 0) { 1026 return this.observers.some((observer)=>observer.getCurrentResult().isStale); 1027 } 1028 return this.state.data === void 0 || this.state.isInvalidated; 1029 } 1030 isStaleByTime(staleTime = 0) { 1031 if (this.state.data === void 0) { 1032 return true; 1033 } 1034 if (staleTime === "static") { 1035 return false; 1036 } 1037 if (this.state.isInvalidated) { 1038 return true; 1039 } 1040 return !(0, __TURBOPACK__imported__module__619273__["timeUntilStale"])(this.state.dataUpdatedAt, staleTime); 1041 } 1042 onFocus() { 1043 const observer = this.observers.find((x)=>x.shouldFetchOnWindowFocus()); 1044 observer?.refetch({ 1045 cancelRefetch: false 1046 }); 1047 this.#retryer?.continue(); 1048 } 1049 onOnline() { 1050 const observer = this.observers.find((x)=>x.shouldFetchOnReconnect()); 1051 observer?.refetch({ 1052 cancelRefetch: false 1053 }); 1054 this.#retryer?.continue(); 1055 } 1056 addObserver(observer) { 1057 if (!this.observers.includes(observer)) { 1058 this.observers.push(observer); 1059 this.clearGcTimeout(); 1060 this.#cache.notify({ 1061 type: "observerAdded", 1062 query: this, 1063 observer 1064 }); 1065 } 1066 } 1067 removeObserver(observer) { 1068 if (this.observers.includes(observer)) { 1069 this.observers = this.observers.filter((x)=>x !== observer); 1070 if (!this.observers.length) { 1071 if (this.#retryer) { 1072 if (this.#abortSignalConsumed || this.#isInitialPausedFetch()) { 1073 this.#retryer.cancel({ 1074 revert: true 1075 }); 1076 } else { 1077 this.#retryer.cancelRetry(); 1078 } 1079 } 1080 this.scheduleGc(); 1081 } 1082 this.#cache.notify({ 1083 type: "observerRemoved", 1084 query: this, 1085 observer 1086 }); 1087 } 1088 } 1089 getObserversCount() { 1090 return this.observers.length; 1091 } 1092 #isInitialPausedFetch() { 1093 return this.state.fetchStatus === "paused" && this.state.status === "pending"; 1094 } 1095 invalidate() { 1096 if (!this.state.isInvalidated) { 1097 this.#dispatch({
1098 type: "invalidate" 1099 }); 1100 } 1101 } 1102 async fetch(options, fetchOptions) { 1103 if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely 1104 // re-start the fetch; there is a chance that the query is still in a 1105 // pending state when that happens 1106 this.#retryer?.status() !== "rejected") { 1107 if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) { 1108 this.cancel({ 1109 silent: true 1110 }); 1111 } else if (this.#retryer) { 1112 this.#retryer.continueRetry(); 1113 return this.#retryer.promise; 1114 } 1115 } 1116 if (options) { 1117 this.setOptions(options); 1118 } 1119 if (!this.options.queryFn) { 1120 const observer = this.observers.find((x)=>x.options.queryFn); 1121 if (observer) { 1122 this.setOptions(observer.options); 1123 } 1124 } 1125 if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable 1126 ; 1127 const abortController = new AbortController(); 1128 const addSignalProperty = (object)=>{ 1129 Object.defineProperty(object, "signal", { 1130 enumerable: true, 1131 get: ()=>{ 1132 this.#abortSignalConsumed = true; 1133 return abortController.signal; 1134 } 1135 }); 1136 }; 1137 const fetchFn = ()=>{ 1138 const queryFn = (0, __TURBOPACK__imported__module__619273__["ensureQueryFn"])(this.options, fetchOptions); 1139 const createQueryFnContext = ()=>{ 1140 const queryFnContext2 = { 1141 client: this.#client, 1142 queryKey: this.queryKey, 1143 meta: this.meta 1144 }; 1145 addSignalProperty(queryFnContext2); 1146 return queryFnContext2; 1147 }; 1148 const queryFnContext = createQueryFnContext(); 1149 this.#abortSignalConsumed = false; 1150 if (this.options.persister) { 1151 return this.options.persister(queryFn, queryFnContext, this); 1152 } 1153 return queryFn(queryFnContext); 1154 }; 1155 const createFetchContext = ()=>{ 1156 const context2 = { 1157 fetchOptions, 1158 options: this.options, 1159 queryKey: this.queryKey, 1160 client: this.#client, 1161 state: this.state, 1162 fetchFn 1163 }; 1164 addSignalProperty(context2); 1165 return context2; 1166 }; 1167 const context = createFetchContext(); 1168 this.options.behavior?.onFetch(context, this); 1169 this.#revertState = this.state; 1170 if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) { 1171 this.#dispatch({ 1172 type: "fetch", 1173 meta: context.fetchOptions?.meta 1174 }); 1175 } 1176 this.#retryer = (0, __TURBOPACK__imported__module__936553__["createRetryer"])({ 1177 initialPromise: fetchOptions?.initialPromise, 1178 fn: context.fetchFn, 1179 onCancel: (error)=>{ 1180 if (error instanceof __TURBOPACK__imported__module__936553__["CancelledError"] && error.revert) { 1181 this.setState({ 1182 ...this.#revertState, 1183 fetchStatus: "idle" 1184 }); 1185 } 1186 abortController.abort(); 1187 }, 1188 onFail: (failureCount, error)=>{ 1189 this.#dispatch({ 1190 type: "failed", 1191 failureCount, 1192 error 1193 }); 1194 }, 1195 onPause: ()=>{ 1196 this.#dispatch({ 1197 type: "pause" 1198 }); 1199 }, 1200 onContinue: ()=>{ 1201 this.#dispatch({ 1202 type: "continue" 1203 }); 1204 }, 1205 retry: context.options.retry, 1206 retryDelay: context.options.retryDelay, 1207 networkMode: context.options.networkMode, 1208 canRun: ()=>true 1209 }); 1210 try { 1211 const data = await this.#retryer.start(); 1212 if (data === void 0) { 1213 if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable 1214 ; 1215 throw new Error(`${this.queryHash} data is undefined`); 1216 } 1217 this.setData(data); 1218 this.#cache.config.onSuccess?.(data, this); 1219 this.#cache.config.onSettled?.(data, this.state.error, this); 1220 return data; 1221 } catch (error) { 1222 if (error instanceof __TURBOPACK__imported__module__936553__["CancelledError"]) { 1223 if (error.silent) { 1224 return this.#retryer.promise; 1225 } else if (error.revert) { 1226 if (this.state.data === void 0) { 1227 throw error; 1228 } 1229 return this.state.data; 1230 } 1231 } 1232 this.#dispatch({ 1233 type: "error", 1234 error 1235 }); 1236 this.#cache.config.onError?.(error, this); 1237 this.#cache.config.onSettled?.(this.state.data, error, this); 1238 throw error; 1239 } finally{ 1240 this.scheduleGc(); 1241 } 1242 } 1243 #dispatch(action) { 1244 const reducer = (state)=>{ 1245 switch(action.type){ 1246 case "failed": 1247 return { 1248 ...state, 1249 fetchFailureCount: action.failureCount, 1250 fetchFailureReason: action.error 1251 }; 1252 case "pause": 1253 return { 1254 ...state, 1255 fetchStatus: "paused" 1256 }; 1257 case "continue": 1258 return { 1259 ...state, 1260 fetchStatus: "fetching" 1261 }; 1262 case "fetch": 1263 return { 1264 ...state, 1265 ...fetchState(state.data, this.options), 1266 fetchMeta: action.meta ?? null 1267 }; 1268 case "success": 1269 const newState = { 1270 ...state, 1271 ...successState(action.data, action.dataUpdatedAt), 1272 dataUpdateCount: state.dataUpdateCount + 1, 1273 ...!action.manual && { 1274 fetchStatus: "idle", 1275 fetchFailureCount: 0, 1276 fetchFailureReason: null 1277 } 1278 }; 1279 this.#revertState = action.manual ? newState : void 0; 1280 return newState; 1281 case "error": 1282 const error = action.error; 1283 return { 1284 ...state, 1285 error,
1286 errorUpdateCount: state.errorUpdateCount + 1, 1287 errorUpdatedAt: Date.now(), 1288 fetchFailureCount: state.fetchFailureCount + 1, 1289 fetchFailureReason: error, 1290 fetchStatus: "idle", 1291 status: "error", 1292 // flag existing data as invalidated if we get a background error 1293 // note that "no data" always means stale so we can set unconditionally here 1294 isInvalidated: true 1295 }; 1296 case "invalidate": 1297 return { 1298 ...state, 1299 isInvalidated: true 1300 }; 1301 case "setState": 1302 return { 1303 ...state, 1304 ...action.state 1305 }; 1306 } 1307 }; 1308 this.state = reducer(this.state); 1309 __TURBOPACK__imported__module__540143__["notifyManager"].batch(()=>{ 1310 this.observers.forEach((observer)=>{ 1311 observer.onQueryUpdate(); 1312 }); 1313 this.#cache.notify({ 1314 query: this, 1315 type: "updated", 1316 action 1317 }); 1318 }); 1319 } 1320}; 1321function fetchState(data, options) { 1322 return { 1323 fetchFailureCount: 0, 1324 fetchFailureReason: null, 1325 fetchStatus: (0, __TURBOPACK__imported__module__936553__["canFetch"])(options.networkMode) ? "fetching" : "paused", 1326 ...data === void 0 && { 1327 error: null, 1328 status: "pending" 1329 } 1330 }; 1331} 1332function successState(data, dataUpdatedAt) { 1333 return { 1334 data, 1335 dataUpdatedAt: dataUpdatedAt ?? Date.now(), 1336 error: null, 1337 isInvalidated: false, 1338 status: "success" 1339 }; 1340} 1341function getDefaultState(options) { 1342 const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; 1343 const hasData = data !== void 0; 1344 const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; 1345 return { 1346 data, 1347 dataUpdateCount: 0, 1348 dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, 1349 error: null, 1350 errorUpdateCount: 0, 1351 errorUpdatedAt: 0, 1352 fetchFailureCount: 0, 1353 fetchFailureReason: null, 1354 fetchMeta: null, 1355 isInvalidated: false, 1356 status: hasData ? "success" : "pending", 1357 fetchStatus: "idle" 1358 }; 1359} 1360; 1361__turbopack_context__.s([ 1362 "Query", 1363 0, 1364 Query, 1365 "fetchState", 1366 0, 1367 fetchState 1368]); 1369}), 1370912598, ((__turbopack_context__) => { 1371"use strict"; 1372
1373// src/QueryClientProvider.tsx 1374var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 1375var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476); 1376"use client"; 1377; 1378; 1379var QueryClientContext = __TURBOPACK__imported__module__271645__["createContext"](void 0); 1380var useQueryClient = (queryClient)=>{ 1381 const client = __TURBOPACK__imported__module__271645__["useContext"](QueryClientContext); 1382 if (queryClient) { 1383 return queryClient; 1384 } 1385 if (!client) { 1386 throw new Error("No QueryClient set, use QueryClientProvider to set one"); 1387 } 1388 return client; 1389}; 1390var QueryClientProvider = ({ client, children })=>{ 1391 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 1392 client.mount(); 1393 return ()=>{ 1394 client.unmount(); 1395 }; 1396 }, [ 1397 client 1398 ]); 1399 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(QueryClientContext.Provider, { 1400 value: client, 1401 children 1402 }); 1403}; 1404; 1405__turbopack_context__.s([ 1406 "QueryClientProvider", 1407 0, 1408 QueryClientProvider, 1409 "useQueryClient", 1410 0, 1411 useQueryClient 1412]); 1413}), 1414869230, ((__turbopack_context__) => { 1415"use strict"; 1416
1417// src/queryObserver.ts 1418var __TURBOPACK__imported__module__175555__ = __turbopack_context__.i(175555); 1419var __TURBOPACK__imported__module__273911__ = __turbopack_context__.i(273911); 1420var __TURBOPACK__imported__module__540143__ = __turbopack_context__.i(540143); 1421var __TURBOPACK__imported__module__286491__ = __turbopack_context__.i(286491); 1422var __TURBOPACK__imported__module__915823__ = __turbopack_context__.i(915823); 1423var __TURBOPACK__imported__module__793803__ = __turbopack_context__.i(793803); 1424var __TURBOPACK__imported__module__619273__ = __turbopack_context__.i(619273); 1425var __TURBOPACK__imported__module__180166__ = __turbopack_context__.i(180166); 1426; 1427; 1428; 1429; 1430; 1431; 1432; 1433; 1434var QueryObserver = class extends __TURBOPACK__imported__module__915823__["Subscribable"] { 1435 constructor(client, options){ 1436 super(); 1437 this.options = options; 1438 this.#client = client; 1439 this.#selectError = null; 1440 this.#currentThenable = (0, __TURBOPACK__imported__module__793803__["pendingThenable"])(); 1441 this.bindMethods(); 1442 this.setOptions(options); 1443 } 1444 #client; 1445 #currentQuery = void 0; 1446 #currentQueryInitialState = void 0; 1447 #currentResult = void 0; 1448 #currentResultState; 1449 #currentResultOptions; 1450 #currentThenable; 1451 #selectError; 1452 #selectFn; 1453 #selectResult; 1454 // This property keeps track of the last query with defined data. 1455 // It will be used to pass the previous data and query to the placeholder function between renders. 1456 #lastQueryWithDefinedData; 1457 #staleTimeoutId; 1458 #refetchIntervalId; 1459 #currentRefetchInterval; 1460 #trackedProps = /* @__PURE__ */ new Set(); 1461 bindMethods() { 1462 this.refetch = this.refetch.bind(this); 1463 } 1464 onSubscribe() { 1465 if (this.listeners.size === 1) { 1466 this.#currentQuery.addObserver(this); 1467 if (shouldFetchOnMount(this.#currentQuery, this.options)) { 1468 this.#executeFetch(); 1469 } else { 1470 this.updateResult(); 1471 } 1472 this.#updateTimers(); 1473 } 1474 } 1475 onUnsubscribe() { 1476 if (!this.hasListeners()) { 1477 this.destroy(); 1478 } 1479 } 1480 shouldFetchOnReconnect() { 1481 return shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnReconnect); 1482 } 1483 shouldFetchOnWindowFocus() { 1484 return shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnWindowFocus); 1485 } 1486 destroy() { 1487 this.listeners = /* @__PURE__ */ new Set(); 1488 this.#clearStaleTimeout(); 1489 this.#clearRefetchInterval(); 1490 this.#currentQuery.removeObserver(this); 1491 } 1492 setOptions(options) { 1493 const prevOptions = this.options; 1494 const prevQuery = this.#currentQuery; 1495 this.options = this.#client.defaultQueryOptions(options); 1496 if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof (0, __TURBOPACK__imported__module__619273__["resolveQueryBoolean"])(this.options.enabled, this.#currentQuery) !== "boolean") { 1497 throw new Error("Expected enabled to be a boolean or a callback that returns a boolean"); 1498 } 1499 this.#updateQuery(); 1500 this.#currentQuery.setOptions(this.options); 1501 if (prevOptions._defaulted && !(0, __TURBOPACK__imported__module__619273__["shallowEqualObjects"])(this.options, prevOptions)) { 1502 this.#client.getQueryCache().notify({ 1503 type: "observerOptionsUpdated", 1504 query: this.#currentQuery, 1505 observer: this 1506 }); 1507 } 1508 const mounted = this.hasListeners(); 1509 if (mounted && shouldFetchOptionally(this.#currentQuery, prevQuery, this.options, prevOptions)) { 1510 this.#executeFetch(); 1511 } 1512 this.updateResult(); 1513 if (mounted && (this.#currentQuery !== prevQuery || (0, __TURBOPACK__imported__module__619273__["resolveQueryBoolean"])(this.options.enabled, this.#currentQuery) !== (0, __TURBOPACK__imported__module__619273__["resolveQueryBoolean"])(prevOptions.enabled, this.#currentQuery) || (0, __TURBOPACK__imported__module__619273__["resolveStaleTime"])(this.options.staleTime, this.#currentQuery) !== (0, __TURBOPACK__imported__module__619273__["resolveStaleTime"])(prevOptions.staleTime, this.#currentQuery))) { 1514 this.#updateStaleTimeout(); 1515 } 1516 const nextRefetchInterval = this.#computeRefetchInterval(); 1517 if (mounted && (this.#currentQuery !== prevQuery || (0, __TURBOPACK__imported__module__619273__["resolveQueryBoolean"])(this.options.enabled, this.#currentQuery) !== (0, __TURBOPACK__imported__module__619273__["resolveQueryBoolean"])(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) { 1518 this.#updateRefetchInterval(nextRefetchInterval); 1519 } 1520 } 1521 getOptimisticResult(options) { 1522 const query = this.#client.getQueryCache().build(this.#client, options); 1523 const result = this.createResult(query, options); 1524 if (shouldAssignObserverCurrentProperties(this, result)) { 1525 this.#currentResult = result; 1526 this.#currentResultOptions = this.options; 1527 this.#currentResultState = this.#currentQuery.state; 1528 } 1529 return result; 1530 } 1531 getCurrentResult() { 1532 return this.#currentResult; 1533 } 1534 trackResult(result, onPropTracked) { 1535 return new Proxy(result, { 1536 get: (target, key)=>{ 1537 this.trackProp(key); 1538 onPropTracked?.(key); 1539 if (key === "promise") { 1540 this.trackProp("data"); 1541 if (!this.options.experimental_prefetchInRender && this.#currentThenable.status === "pending") { 1542 this.#currentThenable.reject(new Error("experimental_prefetchInRender feature flag is not enabled")); 1543 } 1544 } 1545 return Reflect.get(target, key); 1546 } 1547 }); 1548 } 1549 trackProp(key) { 1550 this.#trackedProps.add(key); 1551 } 1552 getCurrentQuery() { 1553 return this.#currentQuery; 1554 } 1555 refetch({ ...options } = {}) { 1556 return this.fetch({ 1557 ...options 1558 }); 1559 } 1560 fetchOptimistic(options) { 1561 const defaultedOptions = this.#client.defaultQueryOptions(options); 1562 const query = this.#client.getQueryCache().build(this.#client, defaultedOptions); 1563 return query.fetch().then(()=>this.createResult(query, defaultedOptions)); 1564 } 1565 fetch(fetchOptions) { 1566 return this.#executeFetch({ 1567 ...fetchOptions, 1568 cancelRefetch: fetchOptions.cancelRefetch ?? true 1569 }).then(()=>{ 1570 this.updateResult(); 1571 return this.#currentResult; 1572 }); 1573 } 1574 #executeFetch(fetchOptions) { 1575 this.#updateQuery(); 1576 let promise = this.#currentQuery.fetch(this.options, fetchOptions); 1577 if (!fetchOptions?.throwOnError) { 1578 promise = promise.catch(__TURBOPACK__imported__module__619273__["noop"]); 1579 } 1580 return promise; 1581 } 1582 #updateStaleTimeout() { 1583 this.#clearStaleTimeout(); 1584 const staleTime = (0, __TURBOPACK__imported__module__619273__["resolveStaleTime"])(this.options.staleTime, this.#currentQuery); 1585 if (__TURBOPACK__imported__module__273911__["environmentManager"].isServer() || this.#currentResult.isStale || !(0, __TURBOPACK__imported__module__619273__["isValidTimeout"])(staleTime)) { 1586 return; 1587 } 1588 const time = (0, __TURBOPACK__imported__module__619273__["timeUntilStale"])(this.#currentResult.dataUpdatedAt, staleTime); 1589 const timeout = time + 1; 1590 this.#staleTimeoutId = __TURBOPACK__imported__module__180166__["timeoutManager"].setTimeout(()=>{ 1591 if (!this.#currentResult.isStale) { 1592 this.updateResult(); 1593 } 1594 }, timeout); 1595 } 1596 #computeRefetchInterval() { 1597 return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false; 1598 } 1599 #updateRefetchInterval(nextInterval) { 1600 this.#clearRefetchInterval(); 1601 this.#currentRefetchInterval = nextInterval; 1602 if (__TURBOPACK__imported__module__273911__["environmentManager"].isServer() || (0, __TURBOPACK__imported__module__619273__["resolveQueryBoolean"])(this.options.enabled, this.#currentQuery) === false || !(0, __TURBOPACK__imported__module__619273__["isValidTimeout"])(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) { 1603 return; 1604 } 1605 this.#refetchIntervalId = __TURBOPACK__imported__module__180166__["timeoutManager"].setInterval(()=>{
1606 if (this.options.refetchIntervalInBackground || __TURBOPACK__imported__module__175555__["focusManager"].isFocused()) { 1607 this.#executeFetch(); 1608 } 1609 }, this.#currentRefetchInterval); 1610 } 1611 #updateTimers() { 1612 this.#updateStaleTimeout(); 1613 this.#updateRefetchInterval(this.#computeRefetchInterval()); 1614 } 1615 #clearStaleTimeout() { 1616 if (this.#staleTimeoutId !== void 0) { 1617 __TURBOPACK__imported__module__180166__["timeoutManager"].clearTimeout(this.#staleTimeoutId); 1618 this.#staleTimeoutId = void 0; 1619 } 1620 } 1621 #clearRefetchInterval() { 1622 if (this.#refetchIntervalId !== void 0) { 1623 __TURBOPACK__imported__module__180166__["timeoutManager"].clearInterval(this.#refetchIntervalId); 1624 this.#refetchIntervalId = void 0; 1625 } 1626 } 1627 createResult(query, options) { 1628 const prevQuery = this.#currentQuery; 1629 const prevOptions = this.options; 1630 const prevResult = this.#currentResult; 1631 const prevResultState = this.#currentResultState; 1632 const prevResultOptions = this.#currentResultOptions; 1633 const queryChange = query !== prevQuery; 1634 const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState; 1635 const { state } = query; 1636 let newState = { 1637 ...state 1638 }; 1639 let isPlaceholderData = false; 1640 let data; 1641 if (options._optimisticResults) { 1642 const mounted = this.hasListeners(); 1643 const fetchOnMount = !mounted && shouldFetchOnMount(query, options); 1644 const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); 1645 if (fetchOnMount || fetchOptionally) { 1646 newState = { 1647 ...newState, 1648 ...(0, __TURBOPACK__imported__module__286491__["fetchState"])(state.data, query.options) 1649 }; 1650 } 1651 if (options._optimisticResults === "isRestoring") { 1652 newState.fetchStatus = "idle"; 1653 } 1654 } 1655 let { error, errorUpdatedAt, status } = newState; 1656 data = newState.data; 1657 let skipSelect = false; 1658 if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { 1659 let placeholderData; 1660 if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) { 1661 placeholderData = prevResult.data; 1662 skipSelect = true; 1663 } else { 1664 placeholderData = typeof options.placeholderData === "function" ? options.placeholderData(this.#lastQueryWithDefinedData?.state.data, this.#lastQueryWithDefinedData) : options.placeholderData; 1665 } 1666 if (placeholderData !== void 0) { 1667 status = "success"; 1668 data = (0, __TURBOPACK__imported__module__619273__["replaceData"])(prevResult?.data, placeholderData, options); 1669 isPlaceholderData = true; 1670 } 1671 } 1672 if (options.select && data !== void 0 && !skipSelect) { 1673 if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) { 1674 data = this.#selectResult; 1675 } else { 1676 try { 1677 this.#selectFn = options.select; 1678 data = options.select(data); 1679 data = (0, __TURBOPACK__imported__module__619273__["replaceData"])(prevResult?.data, data, options); 1680 this.#selectResult = data; 1681 this.#selectError = null; 1682 } catch (selectError) { 1683 this.#selectError = selectError; 1684 } 1685 } 1686 } 1687 if (this.#selectError) { 1688 error = this.#selectError; 1689 data = this.#selectResult; 1690 errorUpdatedAt = Date.now(); 1691 status = "error"; 1692 } 1693 const isFetching = newState.fetchStatus === "fetching"; 1694 const isPending = status === "pending"; 1695 const isError = status === "error"; 1696 const isLoading = isPending && isFetching; 1697 const hasData = data !== void 0; 1698 const result = { 1699 status, 1700 fetchStatus: newState.fetchStatus, 1701 isPending, 1702 isSuccess: status === "success", 1703 isError, 1704 isInitialLoading: isLoading, 1705 isLoading, 1706 data, 1707 dataUpdatedAt: newState.dataUpdatedAt, 1708 error, 1709 errorUpdatedAt, 1710 failureCount: newState.fetchFailureCount, 1711 failureReason: newState.fetchFailureReason,
1712 errorUpdateCount: newState.errorUpdateCount, 1713 isFetched: query.isFetched(), 1714 isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, 1715 isFetching, 1716 isRefetching: isFetching && !isPending, 1717 isLoadingError: isError && !hasData, 1718 isPaused: newState.fetchStatus === "paused", 1719 isPlaceholderData, 1720 isRefetchError: isError && hasData, 1721 isStale: isStale(query, options), 1722 refetch: this.refetch, 1723 promise: this.#currentThenable, 1724 isEnabled: (0, __TURBOPACK__imported__module__619273__["resolveQueryBoolean"])(options.enabled, query) !== false 1725 }; 1726 const nextResult = result; 1727 if (this.options.experimental_prefetchInRender) { 1728 const hasResultData = nextResult.data !== void 0; 1729 const isErrorWithoutData = nextResult.status === "error" && !hasResultData; 1730 const finalizeThenableIfPossible = (thenable)=>{ 1731 if (isErrorWithoutData) { 1732 thenable.reject(nextResult.error); 1733 } else if (hasResultData) { 1734 thenable.resolve(nextResult.data); 1735 } 1736 }; 1737 const recreateThenable = ()=>{ 1738 const pending = this.#currentThenable = nextResult.promise = (0, __TURBOPACK__imported__module__793803__["pendingThenable"])(); 1739 finalizeThenableIfPossible(pending); 1740 }; 1741 const prevThenable = this.#currentThenable; 1742 switch(prevThenable.status){ 1743 case "pending": 1744 if (query.queryHash === prevQuery.queryHash) { 1745 finalizeThenableIfPossible(prevThenable); 1746 } 1747 break; 1748 case "fulfilled": 1749 if (isErrorWithoutData || nextResult.data !== prevThenable.value) { 1750 recreateThenable(); 1751 } 1752 break; 1753 case "rejected": 1754 if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) { 1755 recreateThenable(); 1756 } 1757 break; 1758 } 1759 } 1760 return nextResult; 1761 } 1762 updateResult() { 1763 const prevResult = this.#currentResult; 1764 const nextResult = this.createResult(this.#currentQuery, this.options); 1765 this.#currentResultState = this.#currentQuery.state; 1766 this.#currentResultOptions = this.options; 1767 if (this.#currentResultState.data !== void 0) { 1768 this.#lastQueryWithDefinedData = this.#currentQuery; 1769 } 1770 if ((0, __TURBOPACK__imported__module__619273__["shallowEqualObjects"])(nextResult, prevResult)) { 1771 return; 1772 } 1773 this.#currentResult = nextResult; 1774 const shouldNotifyListeners = ()=>{ 1775 if (!prevResult) { 1776 return true; 1777 } 1778 const { notifyOnChangeProps } = this.options; 1779 const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; 1780 if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) { 1781 return true; 1782 } 1783 const includedProps = new Set(notifyOnChangePropsValue ?? this.#trackedProps); 1784 if (this.options.throwOnError) { 1785 includedProps.add("error"); 1786 } 1787 return Object.keys(this.#currentResult).some((key)=>{ 1788 const typedKey = key; 1789 const changed = this.#currentResult[typedKey] !== prevResult[typedKey]; 1790 return changed && includedProps.has(typedKey); 1791 }); 1792 }; 1793 this.#notify({ 1794 listeners: shouldNotifyListeners() 1795 }); 1796 } 1797 #updateQuery() { 1798 const query = this.#client.getQueryCache().build(this.#client, this.options); 1799 if (query === this.#currentQuery) { 1800 return; 1801 } 1802 const prevQuery = this.#currentQuery; 1803 this.#currentQuery = query; 1804 this.#currentQueryInitialState = query.state; 1805 if (this.hasListeners()) { 1806 prevQuery?.removeObserver(this); 1807 query.addObserver(this); 1808 } 1809 } 1810 onQueryUpdate() { 1811 this.updateResult(); 1812 if (this.hasListeners()) { 1813 this.#updateTimers(); 1814 } 1815 } 1816 #notify(notifyOptions) { 1817 __TURBOPACK__imported__module__540143__["notifyManager"].batch(()=>{ 1818 if (notifyOptions.listeners) {
1819 this.listeners.forEach((listener)=>{ 1820 listener(this.#currentResult); 1821 }); 1822 } 1823 this.#client.getQueryCache().notify({ 1824 query: this.#currentQuery, 1825 type: "observerResultsUpdated" 1826 }); 1827 }); 1828 } 1829}; 1830function shouldLoadOnMount(query, options) { 1831 return (0, __TURBOPACK__imported__module__619273__["resolveQueryBoolean"])(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && (0, __TURBOPACK__imported__module__619273__["resolveQueryBoolean"])(options.retryOnMount, query) === false); 1832} 1833function shouldFetchOnMount(query, options) { 1834 return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); 1835} 1836function shouldFetchOn(query, options, field) { 1837 if ((0, __TURBOPACK__imported__module__619273__["resolveQueryBoolean"])(options.enabled, query) !== false && (0, __TURBOPACK__imported__module__619273__["resolveStaleTime"])(options.staleTime, query) !== "static") { 1838 const value = typeof field === "function" ? field(query) : field; 1839 return value === "always" || value !== false && isStale(query, options); 1840 } 1841 return false; 1842} 1843function shouldFetchOptionally(query, prevQuery, options, prevOptions) { 1844 return (query !== prevQuery || (0, __TURBOPACK__imported__module__619273__["resolveQueryBoolean"])(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); 1845} 1846function isStale(query, options) { 1847 return (0, __TURBOPACK__imported__module__619273__["resolveQueryBoolean"])(options.enabled, query) !== false && query.isStaleByTime((0, __TURBOPACK__imported__module__619273__["resolveStaleTime"])(options.staleTime, query)); 1848} 1849function shouldAssignObserverCurrentProperties(observer, optimisticResult) { 1850 if (!(0, __TURBOPACK__imported__module__619273__["shallowEqualObjects"])(observer.getCurrentResult(), optimisticResult)) { 1851 return true; 1852 } 1853 return false; 1854} 1855; 1856__turbopack_context__.s([ 1857 "QueryObserver", 1858 0, 1859 QueryObserver 1860]); 1861}), 1862673664, 427001, 1863((__turbopack_context__) => { 1864"use strict"; 1865 1866// MERGED MODULE: [project]/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js [app-client] (ecmascript) 1867;
1868// src/QueryErrorResetBoundary.tsx 1869var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 1870var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476); 1871"use client"; 1872; 1873; 1874function createValue() { 1875 let isReset = false; 1876 return { 1877 clearReset: ()=>{ 1878 isReset = false; 1879 }, 1880 reset: ()=>{ 1881 isReset = true; 1882 }, 1883 isReset: ()=>{ 1884 return isReset; 1885 } 1886 }; 1887} 1888var QueryErrorResetBoundaryContext = __TURBOPACK__imported__module__271645__["createContext"](createValue()); 1889var useQueryErrorResetBoundary = ()=>__TURBOPACK__imported__module__271645__["useContext"](QueryErrorResetBoundaryContext); 1890var QueryErrorResetBoundary = ({ children })=>{ 1891 const [value] = __TURBOPACK__imported__module__271645__["useState"](()=>createValue()); 1892 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(QueryErrorResetBoundaryContext.Provider, { 1893 value, 1894 children: typeof children === "function" ? children(value) : children 1895 }); 1896}; 1897; 1898__turbopack_context__.s([ 1899 "useQueryErrorResetBoundary", 1900 0, 1901 useQueryErrorResetBoundary 1902], 673664); 1903// MERGED MODULE: [project]/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js [app-client] (ecmascript) 1904; 1905var __TURBOPACK__imported__module__271645__1 = __TURBOPACK__imported__module__271645__; 1906var __TURBOPACK__imported__module__619273__ = __turbopack_context__.i(619273); 1907"use client"; 1908; 1909; 1910var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query)=>{ 1911 const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? (0, __TURBOPACK__imported__module__619273__["shouldThrowError"])(options.throwOnError, [ 1912 query.state.error, 1913 query 1914 ]) : options.throwOnError; 1915 if (options.suspense || options.experimental_prefetchInRender || throwOnError) { 1916 if (!errorResetBoundary.isReset()) { 1917 options.retryOnMount = false; 1918 } 1919 } 1920}; 1921var useClearResetErrorBoundary = (errorResetBoundary)=>{ 1922 __TURBOPACK__imported__module__271645__1["useEffect"](()=>{ 1923 errorResetBoundary.clearReset(); 1924 }, [ 1925 errorResetBoundary 1926 ]); 1927}; 1928var getHasError = ({ result, errorResetBoundary, throwOnError, query, suspense })=>{ 1929 return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || (0, __TURBOPACK__imported__module__619273__["shouldThrowError"])(throwOnError, [ 1930 result.error, 1931 query 1932 ])); 1933}; 1934; 1935__turbopack_context__.s([ 1936 "ensurePreventErrorBoundaryRetry", 1937 0, 1938 ensurePreventErrorBoundaryRetry, 1939 "getHasError", 1940 0, 1941 getHasError, 1942 "useClearResetErrorBoundary", 1943 0, 1944 useClearResetErrorBoundary 1945], 427001); 1946}), 1947381384, ((__turbopack_context__) => { 1948"use strict"; 1949
1950// src/IsRestoringProvider.ts 1951var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 1952"use client"; 1953; 1954var IsRestoringContext = __TURBOPACK__imported__module__271645__["createContext"](false); 1955var useIsRestoring = ()=>__TURBOPACK__imported__module__271645__["useContext"](IsRestoringContext); 1956var IsRestoringProvider = IsRestoringContext.Provider; 1957; 1958__turbopack_context__.s([ 1959 "useIsRestoring", 1960 0, 1961 useIsRestoring 1962]); 1963}), 1964266027, 254440, 1965((__turbopack_context__) => { 1966"use strict"; 1967 1968// MERGED MODULE: [project]/node_modules/@tanstack/react-query/build/modern/useQuery.js [app-client] (ecmascript) 1969;
1970// src/useQuery.ts 1971var __TURBOPACK__imported__module__869230__ = __turbopack_context__.i(869230); 1972// MERGED MODULE: [project]/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js [app-client] (ecmascript) 1973; 1974var __TURBOPACK__imported__module__247167__ = __turbopack_context__.i(247167);
1975// src/useBaseQuery.ts 1976var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 1977var __TURBOPACK__imported__module__273911__ = __turbopack_context__.i(273911); 1978var __TURBOPACK__imported__module__619273__ = __turbopack_context__.i(619273); 1979var __TURBOPACK__imported__module__540143__ = __turbopack_context__.i(540143); 1980var __TURBOPACK__imported__module__912598__ = __turbopack_context__.i(912598); 1981var __TURBOPACK__imported__module__673664__ = __turbopack_context__.i(673664); 1982var __TURBOPACK__imported__module__427001__ = __turbopack_context__.i(427001); 1983var __TURBOPACK__imported__module__381384__ = __turbopack_context__.i(381384); 1984// MERGED MODULE: [project]/node_modules/@tanstack/react-query/build/modern/suspense.js [app-client] (ecmascript) 1985;
1986// src/suspense.ts 1987var defaultThrowOnError = (_error, query)=>query.state.data === void 0; 1988var ensureSuspenseTimers = (defaultedOptions)=>{ 1989 if (defaultedOptions.suspense) { 1990 const MIN_SUSPENSE_TIME_MS = 1e3; 1991 const clamp = (value)=>value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS); 1992 const originalStaleTime = defaultedOptions.staleTime; 1993 defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args)=>clamp(originalStaleTime(...args)) : clamp(originalStaleTime); 1994 if (typeof defaultedOptions.gcTime === "number") { 1995 defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, MIN_SUSPENSE_TIME_MS); 1996 } 1997 } 1998}; 1999var willFetch = (result, isRestoring)=>result.isLoading && result.isFetching && !isRestoring; 2000var shouldSuspend = (defaultedOptions, result)=>defaultedOptions?.suspense && result.isPending; 2001var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary)=>observer.fetchOptimistic(defaultedOptions).catch(()=>{ 2002 errorResetBoundary.clearReset(); 2003 }); 2004; 2005__turbopack_context__.s([ 2006 "ensureSuspenseTimers", 2007 0, 2008 ensureSuspenseTimers, 2009 "fetchOptimistic", 2010 0, 2011 fetchOptimistic, 2012 "shouldSuspend", 2013 0, 2014 shouldSuspend, 2015 "willFetch", 2016 0, 2017 willFetch 2018], 254440); 2019"use client"; 2020; 2021; 2022; 2023; 2024; 2025; 2026; 2027function useBaseQuery(options, Observer, queryClient) { 2028 if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable 2029 ; 2030 const isRestoring = (0, __TURBOPACK__imported__module__381384__["useIsRestoring"])(); 2031 const errorResetBoundary = (0, __TURBOPACK__imported__module__673664__["useQueryErrorResetBoundary"])(); 2032 const client = (0, __TURBOPACK__imported__module__912598__["useQueryClient"])(queryClient); 2033 const defaultedOptions = client.defaultQueryOptions(options); 2034 client.getDefaultOptions().queries?._experimental_beforeQuery?.(defaultedOptions); 2035 const query = client.getQueryCache().get(defaultedOptions.queryHash); 2036 if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable 2037 ; 2038 defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; 2039 ensureSuspenseTimers(defaultedOptions); 2040 (0, __TURBOPACK__imported__module__427001__["ensurePreventErrorBoundaryRetry"])(defaultedOptions, errorResetBoundary, query); 2041 (0, __TURBOPACK__imported__module__427001__["useClearResetErrorBoundary"])(errorResetBoundary); 2042 const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); 2043 const [observer] = __TURBOPACK__imported__module__271645__["useState"](()=>new Observer(client, defaultedOptions)); 2044 const result = observer.getOptimisticResult(defaultedOptions); 2045 const shouldSubscribe = !isRestoring && options.subscribed !== false; 2046 __TURBOPACK__imported__module__271645__["useSyncExternalStore"](__TURBOPACK__imported__module__271645__["useCallback"]((onStoreChange)=>{ 2047 const unsubscribe = shouldSubscribe ? observer.subscribe(__TURBOPACK__imported__module__540143__["notifyManager"].batchCalls(onStoreChange)) : __TURBOPACK__imported__module__619273__["noop"]; 2048 observer.updateResult(); 2049 return unsubscribe; 2050 }, [ 2051 observer, 2052 shouldSubscribe 2053 ]), ()=>observer.getCurrentResult(), ()=>observer.getCurrentResult()); 2054 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 2055 observer.setOptions(defaultedOptions); 2056 }, [ 2057 defaultedOptions, 2058 observer 2059 ]); 2060 if (shouldSuspend(defaultedOptions, result)) { 2061 throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary); 2062 } 2063 if ((0, __TURBOPACK__imported__module__427001__["getHasError"])({ 2064 result, 2065 errorResetBoundary, 2066 throwOnError: defaultedOptions.throwOnError, 2067 query, 2068 suspense: defaultedOptions.suspense 2069 })) { 2070 throw result.error; 2071 } 2072 ; 2073 client.getDefaultOptions().queries?._experimental_afterQuery?.(defaultedOptions, result); 2074 if (defaultedOptions.experimental_prefetchInRender && !__TURBOPACK__imported__module__273911__["environmentManager"].isServer() && willFetch(result, isRestoring)) { 2075 const promise = isNewCacheEntry ? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted 2076 fetchOptimistic(defaultedOptions, observer, errorResetBoundary) : // subscribe to the "cac
2076he promise" so that we can finalize the currentThenable once data comes in 2077 query?.promise; 2078 promise?.catch(__TURBOPACK__imported__module__619273__["noop"]).finally(()=>{ 2079 observer.updateResult(); 2080 }); 2081 } 2082 return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; 2083} 2084; 2085"use client"; 2086; 2087; 2088function useQuery(options, queryClient) { 2089 return useBaseQuery(options, __TURBOPACK__imported__module__869230__["QueryObserver"], queryClient); 2090} 2091; 2092__turbopack_context__.s([ 2093 "useQuery", 2094 0, 2095 useQuery 2096], 266027); 2097}), 2098]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.