@scrippsproduct/networks-ui-library 1.1.9 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/{Form.module-Cd8qH2rj.mjs → Form.module-CarfWK5T.mjs} +1 -1
  2. package/dist/ResultsTable.module-wcNUQEKe.mjs +14 -0
  3. package/dist/_commonjsHelpers-DaMA6jEr.mjs +8 -0
  4. package/dist/assets/ResultsTable.css +1 -1
  5. package/dist/{chevron-left-DRvpaLmK.mjs → chevron-left-D0UjbrKw.mjs} +1 -1
  6. package/dist/{chevron-right-C8yCnmfx.mjs → chevron-right-0ZF3LruR.mjs} +1 -1
  7. package/dist/components/ActionButton/ActionButton.test.js +209 -0
  8. package/dist/components/AdBlock/AdBlock.test.js +286 -0
  9. package/dist/components/AdjustableTwoColumnGrid/AdjustableTwoColumnGrid.test.js +295 -0
  10. package/dist/components/AirDateFormatter/AirDateFormatter.test.js +192 -0
  11. package/dist/components/AnchorTag/AnchorTag.test.js +463 -0
  12. package/dist/components/BCVideoPlayer/BCVideoPlayer.test.js +295 -0
  13. package/dist/components/BasicGridModule/BasicGridModule.js +41 -37
  14. package/dist/components/BasicGridModule/BasicGridModule.test.js +227 -0
  15. package/dist/components/Button/Button.test.js +434 -0
  16. package/dist/components/Carousel/Carousel.js +2 -2
  17. package/dist/components/Carousel/Carousel.test.js +705 -0
  18. package/dist/components/CarouselSlide/CarouselSlide.test.js +378 -0
  19. package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.js +1 -1
  20. package/dist/components/CastInfoLayout/CastInfoLayout.test.js +294 -0
  21. package/dist/components/ChannelSearch/ChannelSearch.test.js +565 -0
  22. package/dist/components/ChoicesItem/ChoicesItem.test.js +428 -0
  23. package/dist/components/Concat/Concat.js +1 -1
  24. package/dist/components/Concat/Concat.test.js +115 -0
  25. package/dist/components/CtaBlock/CtaBlock.js +1 -1
  26. package/dist/components/CtaBlock/CtaBlock.test.js +226 -0
  27. package/dist/components/CustomDataList/CustomDataList.js +4 -4
  28. package/dist/components/CustomSelect/CustomSelect.js +86 -86
  29. package/dist/components/CustomSelect/CustomSelect.test.js +313 -0
  30. package/dist/components/DateNavigation/DateNavigation.js +10 -10
  31. package/dist/components/DateNavigation/DateNavigation.test.js +370 -0
  32. package/dist/components/DatePicker/DatePicker.js +1 -1
  33. package/dist/components/DeviceAndPlatformLists/DeviceAndPlatformLists.test.js +288 -0
  34. package/dist/components/DrawerNavigation/DrawerNavigation.test.js +316 -0
  35. package/dist/components/EqualSizeFlexRow/EqualSizeFlexRow.test.js +337 -0
  36. package/dist/components/EqualSizeGrid/EqualSizeGrid.test.js +358 -0
  37. package/dist/components/ErrorHandler/ErrorHandler.js +2 -2
  38. package/dist/components/ErrorHandler/ErrorHandler.test.js +158 -0
  39. package/dist/components/FeaturedList/FeaturedList.test.js +353 -0
  40. package/dist/components/Figure/Figure.js +1 -1
  41. package/dist/components/Figure/Figure.test.js +198 -0
  42. package/dist/components/FindUs/FindUs.test.js +499 -0
  43. package/dist/components/FooterNavigation/FooterNavigation.test.js +310 -0
  44. package/dist/components/GenericList/GenericList.js +1 -1
  45. package/dist/components/GenericList/GenericList.test.js +288 -0
  46. package/dist/components/GetAirdateWrapper/GetAirdateWrapper.test.js +689 -0
  47. package/dist/components/GradientButton/GradientButton.d.ts +1 -1
  48. package/dist/components/GradientButton/GradientButton.js +33 -31
  49. package/dist/components/GradientButton/GradientButton.test.js +457 -0
  50. package/dist/components/GridList/GridList.test.js +371 -0
  51. package/dist/components/ImageCard/ImageCard.test.js +668 -0
  52. package/dist/components/ImageCard/ImageCardCore.js +28 -28
  53. package/dist/components/ImageCard/ImageCardCore.test.js +577 -0
  54. package/dist/components/ImageReplacementAnchor/ImageReplacementAnchor.test.js +379 -0
  55. package/dist/components/InfoPanel/InfoPanel.js +1 -1
  56. package/dist/components/InlineNavigation/InlineNavigation.test.js +149 -0
  57. package/dist/components/Input/Input.js +1 -1
  58. package/dist/components/Input/Input.test.js +263 -0
  59. package/dist/components/InstructionsList/InstructionsList.js +11 -11
  60. package/dist/components/InstructionsList/InstructionsList.test.js +181 -0
  61. package/dist/components/LogoListItem/LogoListItem.test.js +303 -0
  62. package/dist/components/LogoNavigation/LogoNavigation.test.js +352 -0
  63. package/dist/components/ModalContainer/ModalContainer.js +2 -2
  64. package/dist/components/NavList/NavList.test.js +332 -0
  65. package/dist/components/Overlay/Overlay.js +24 -23
  66. package/dist/components/Overlay/Overlay.test.js +198 -0
  67. package/dist/components/PageHero/PageHero.test.js +241 -0
  68. package/dist/components/PageHero/page-hero-layouts/IONShow/IONShowHero.js +1 -1
  69. package/dist/components/ProgramAirdate/ProgramAirdate.js +1 -1
  70. package/dist/components/ProgramAirdate/ProgramAirdate.test.js +414 -0
  71. package/dist/components/PromotionBlock/PromotionBlock.test.js +208 -0
  72. package/dist/components/PromotionsRowBlock/PromotionsRowBlock.test.js +221 -0
  73. package/dist/components/PromotionsRowModule/PromotionsRowModule.test.js +349 -0
  74. package/dist/components/RescanInstructions/RescanInstructions.test.js +218 -0
  75. package/dist/components/ResponsiveImage/ResponsiveImage.test.js +264 -0
  76. package/dist/components/ResultsTable/ResultsTable.js +9 -2
  77. package/dist/components/ResultsTable/ResultsTable.test.js +402 -0
  78. package/dist/components/ResultsTableBody/ResultsTableBody.js +1 -1
  79. package/dist/components/ResultsTableBody/ResultsTableBody.test.js +445 -0
  80. package/dist/components/ResultsTableHeader/ResultsTableHeader.js +37 -15
  81. package/dist/components/ResultsTableHeader/ResultsTableHeader.test.js +275 -0
  82. package/dist/components/ScheduleLayout/ScheduleContext.js +654 -626
  83. package/dist/components/ScheduleLayout/ScheduleLayout.js +1 -1
  84. package/dist/components/ScheduleLayout/useScheduleContext.js +5 -10
  85. package/dist/components/ScheduleList/ScheduleList.js +1 -1
  86. package/dist/components/SectionedContent/SectionedContent.js +1 -1
  87. package/dist/components/SectionedContent/SectionedContent.test.js +341 -0
  88. package/dist/components/Select/Select.js +24 -24
  89. package/dist/components/Select/Select.test.js +367 -0
  90. package/dist/components/ShowAboutContent/ShowAboutContent.js +1 -1
  91. package/dist/components/ShowAboutContent/ShowAboutContent.test.js +535 -0
  92. package/dist/components/ShowAboutLayout/ShowAboutLayout.test.js +570 -0
  93. package/dist/components/SocialLinks/SocialLinks.js +1 -1
  94. package/dist/components/StringList/StringList.js +1 -1
  95. package/dist/components/StringList/StringList.test.js +311 -0
  96. package/dist/components/TabContent/TabContent.js +1 -1
  97. package/dist/components/TabContent/TabContent.test.js +274 -0
  98. package/dist/components/TabNavigation/TabNavigation.js +21 -21
  99. package/dist/components/TabNavigation/TabNavigation.test.js +535 -0
  100. package/dist/components/TabbedContent/TabbedContent.test.js +654 -0
  101. package/dist/components/TextArea/TextArea.js +1 -1
  102. package/dist/components/UpcomingList/UpcomingList.test.js +471 -0
  103. package/dist/{index-VjANCDXC.mjs → index-06PEPfBQ.mjs} +1 -1
  104. package/dist/index-BUN4jQ3m.mjs +3098 -0
  105. package/dist/index-BVxBrkZB.mjs +3 -0
  106. package/dist/{index-DC2JJV3a.mjs → index-D3kkcgee.mjs} +1 -1
  107. package/dist/{index-C-kn9Zhn.mjs → index-DzfYkULW.mjs} +2 -1
  108. package/dist/magic-string.es-uPKorP4O.mjs +663 -0
  109. package/dist/matchers-35e4d3bd-BBPNTlen.mjs +2404 -0
  110. package/dist/react.esm-DLSrfVwM.mjs +23410 -0
  111. package/dist/test/setupTests.d.ts +1 -0
  112. package/dist/test/setupTests.js +55 -0
  113. package/dist/{triangle-PcCcGXjr.mjs → triangle-C4z906Wf.mjs} +1 -1
  114. package/dist/useScheduleContext-D7FdzNxe.mjs +17 -0
  115. package/dist/utils/analytics.js +1 -1
  116. package/dist/utils/getOnNowProgram.js +10 -10
  117. package/dist/{x-C-QzJ-qD.mjs → x-Ck9Vk5Fo.mjs} +1 -1
  118. package/package.json +4 -1
  119. package/dist/ResultsTable.module-1zxhXaem.mjs +0 -14
  120. package/dist/_commonjsHelpers-C6fGbg64.mjs +0 -6
@@ -2,18 +2,18 @@ var pe = (e) => {
2
2
  throw TypeError(e);
3
3
  };
4
4
  var Wt = (e, t, s) => t.has(e) || pe("Cannot " + s);
5
- var r = (e, t, s) => (Wt(e, t, "read from private field"), s ? s.call(e) : t.get(e)), c = (e, t, s) => t.has(e) ? pe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), o = (e, t, s, i) => (Wt(e, t, "write to private field"), i ? i.call(e, s) : t.set(e, s), s), m = (e, t, s) => (Wt(e, t, "access private method"), s);
6
- var Ht = (e, t, s, i) => ({
5
+ var i = (e, t, s) => (Wt(e, t, "read from private field"), s ? s.call(e) : t.get(e)), c = (e, t, s) => t.has(e) ? pe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), o = (e, t, s, r) => (Wt(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), v = (e, t, s) => (Wt(e, t, "access private method"), s);
6
+ var Ht = (e, t, s, r) => ({
7
7
  set _(n) {
8
8
  o(e, t, n, s);
9
9
  },
10
10
  get _() {
11
- return r(e, t, i);
11
+ return i(e, t, r);
12
12
  }
13
13
  });
14
14
  import { jsx as Vt } from "react/jsx-runtime";
15
15
  import * as K from "react";
16
- import { createContext as $e, useState as me, useRef as We, useCallback as Je, useEffect as ve, useMemo as Ze } from "react";
16
+ import { createContext as We, useState as me, useRef as Je, useCallback as Ze, useEffect as ve, useMemo as Xe } from "react";
17
17
  import { f as Jt } from "../../format-YhWt2D8M.mjs";
18
18
  import { l as Gt } from "../../logger-C0N7U0YY.mjs";
19
19
  var Kt = class {
@@ -32,7 +32,7 @@ var Kt = class {
32
32
  }
33
33
  onUnsubscribe() {
34
34
  }
35
- }, Xe = {
35
+ }, Ye = {
36
36
  // We need the wrapper function syntax below instead of direct references to
37
37
  // global setTimeout etc.
38
38
  //
@@ -47,7 +47,7 @@ var Kt = class {
47
47
  clearTimeout: (e) => clearTimeout(e),
48
48
  setInterval: (e, t) => setInterval(e, t),
49
49
  clearInterval: (e) => clearInterval(e)
50
- }, G, ht, Qe, Ye = (Qe = class {
50
+ }, G, ht, Qe, ts = (Qe = class {
51
51
  constructor() {
52
52
  // We cannot have TimeoutManager<T> as we must instantiate it with a concrete
53
53
  // type at app boot; and if we leave that type, then any new timer provider
@@ -55,35 +55,35 @@ var Kt = class {
55
55
  //
56
56
  // We settle for type safety for the TimeoutProvider type, and accept that
57
57
  // this class is unsafe internally to allow for extension.
58
- c(this, G, Xe);
58
+ c(this, G, Ye);
59
59
  c(this, ht, !1);
60
60
  }
61
61
  setTimeoutProvider(e) {
62
- process.env.NODE_ENV !== "production" && r(this, ht) && e !== r(this, G) && console.error(
62
+ process.env.NODE_ENV !== "production" && i(this, ht) && e !== i(this, G) && console.error(
63
63
  "[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",
64
- { previous: r(this, G), provider: e }
64
+ { previous: i(this, G), provider: e }
65
65
  ), o(this, G, e), process.env.NODE_ENV !== "production" && o(this, ht, !1);
66
66
  }
67
67
  setTimeout(e, t) {
68
- return process.env.NODE_ENV !== "production" && o(this, ht, !0), r(this, G).setTimeout(e, t);
68
+ return process.env.NODE_ENV !== "production" && o(this, ht, !0), i(this, G).setTimeout(e, t);
69
69
  }
70
70
  clearTimeout(e) {
71
- r(this, G).clearTimeout(e);
71
+ i(this, G).clearTimeout(e);
72
72
  }
73
73
  setInterval(e, t) {
74
- return process.env.NODE_ENV !== "production" && o(this, ht, !0), r(this, G).setInterval(e, t);
74
+ return process.env.NODE_ENV !== "production" && o(this, ht, !0), i(this, G).setInterval(e, t);
75
75
  }
76
76
  clearInterval(e) {
77
- r(this, G).clearInterval(e);
77
+ i(this, G).clearInterval(e);
78
78
  }
79
- }, G = new WeakMap(), ht = new WeakMap(), Qe), ut = new Ye();
80
- function ts(e) {
79
+ }, G = new WeakMap(), ht = new WeakMap(), Qe), ut = new ts();
80
+ function es(e) {
81
81
  setTimeout(e, 0);
82
82
  }
83
83
  var bt = typeof window > "u" || "Deno" in globalThis;
84
- function j() {
84
+ function N() {
85
85
  }
86
- function es(e, t) {
86
+ function ss(e, t) {
87
87
  return typeof e == "function" ? e(t) : e;
88
88
  }
89
89
  function Zt(e) {
@@ -101,73 +101,73 @@ function k(e, t) {
101
101
  function ge(e, t) {
102
102
  const {
103
103
  type: s = "all",
104
- exact: i,
104
+ exact: r,
105
105
  fetchStatus: n,
106
106
  predicate: a,
107
107
  queryKey: h,
108
108
  stale: u
109
109
  } = e;
110
110
  if (h) {
111
- if (i) {
111
+ if (r) {
112
112
  if (t.queryHash !== de(h, t.options))
113
113
  return !1;
114
114
  } else if (!xt(t.queryKey, h))
115
115
  return !1;
116
116
  }
117
117
  if (s !== "all") {
118
- const l = t.isActive();
119
- if (s === "active" && !l || s === "inactive" && l)
118
+ const f = t.isActive();
119
+ if (s === "active" && !f || s === "inactive" && f)
120
120
  return !1;
121
121
  }
122
122
  return !(typeof u == "boolean" && t.isStale() !== u || n && n !== t.state.fetchStatus || a && !a(t));
123
123
  }
124
124
  function be(e, t) {
125
- const { exact: s, status: i, predicate: n, mutationKey: a } = e;
125
+ const { exact: s, status: r, predicate: n, mutationKey: a } = e;
126
126
  if (a) {
127
127
  if (!t.options.mutationKey)
128
128
  return !1;
129
129
  if (s) {
130
- if (At(t.options.mutationKey) !== At(a))
130
+ if (qt(t.options.mutationKey) !== qt(a))
131
131
  return !1;
132
132
  } else if (!xt(t.options.mutationKey, a))
133
133
  return !1;
134
134
  }
135
- return !(i && t.state.status !== i || n && !n(t));
135
+ return !(r && t.state.status !== r || n && !n(t));
136
136
  }
137
137
  function de(e, t) {
138
- return ((t == null ? void 0 : t.queryKeyHashFn) || At)(e);
138
+ return ((t == null ? void 0 : t.queryKeyHashFn) || qt)(e);
139
139
  }
140
- function At(e) {
140
+ function qt(e) {
141
141
  return JSON.stringify(
142
142
  e,
143
- (t, s) => te(s) ? Object.keys(s).sort().reduce((i, n) => (i[n] = s[n], i), {}) : s
143
+ (t, s) => te(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
144
144
  );
145
145
  }
146
146
  function xt(e, t) {
147
147
  return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) => xt(e[s], t[s])) : !1;
148
148
  }
149
- var ss = Object.prototype.hasOwnProperty;
149
+ var rs = Object.prototype.hasOwnProperty;
150
150
  function Xt(e, t) {
151
151
  if (e === t)
152
152
  return e;
153
153
  const s = we(e) && we(t);
154
154
  if (!s && !(te(e) && te(t))) return t;
155
155
  const n = (s ? e : Object.keys(e)).length, a = s ? t : Object.keys(t), h = a.length, u = s ? new Array(h) : {};
156
- let l = 0;
157
- for (let b = 0; b < h; b++) {
158
- const O = s ? b : a[b], f = e[O], P = t[O];
159
- if (f === P) {
160
- u[O] = f, (s ? b < n : ss.call(e, O)) && l++;
156
+ let f = 0;
157
+ for (let y = 0; y < h; y++) {
158
+ const w = s ? y : a[y], d = e[w], P = t[w];
159
+ if (d === P) {
160
+ u[w] = d, (s ? y < n : rs.call(e, w)) && f++;
161
161
  continue;
162
162
  }
163
- if (f === null || P === null || typeof f != "object" || typeof P != "object") {
164
- u[O] = P;
163
+ if (d === null || P === null || typeof d != "object" || typeof P != "object") {
164
+ u[w] = P;
165
165
  continue;
166
166
  }
167
- const y = Xt(f, P);
168
- u[O] = y, y === f && l++;
167
+ const p = Xt(d, P);
168
+ u[w] = p, p === d && f++;
169
169
  }
170
- return n === h && l === n ? e : u;
170
+ return n === h && f === n ? e : u;
171
171
  }
172
172
  function Yt(e, t) {
173
173
  if (!t || Object.keys(e).length !== Object.keys(t).length)
@@ -181,18 +181,18 @@ function we(e) {
181
181
  return Array.isArray(e) && e.length === Object.keys(e).length;
182
182
  }
183
183
  function te(e) {
184
- if (!Ce(e))
184
+ if (!Se(e))
185
185
  return !1;
186
186
  const t = e.constructor;
187
187
  if (t === void 0)
188
188
  return !0;
189
189
  const s = t.prototype;
190
- return !(!Ce(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
190
+ return !(!Se(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
191
191
  }
192
- function Ce(e) {
192
+ function Se(e) {
193
193
  return Object.prototype.toString.call(e) === "[object Object]";
194
194
  }
195
- function rs(e) {
195
+ function is(e) {
196
196
  return new Promise((t) => {
197
197
  ut.setTimeout(t, e);
198
198
  });
@@ -204,22 +204,22 @@ function ee(e, t, s) {
204
204
  if (process.env.NODE_ENV !== "production")
205
205
  try {
206
206
  return Xt(e, t);
207
- } catch (i) {
207
+ } catch (r) {
208
208
  throw console.error(
209
- `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${i}`
210
- ), i;
209
+ `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
210
+ ), r;
211
211
  }
212
212
  return Xt(e, t);
213
213
  }
214
214
  return t;
215
215
  }
216
- function is(e, t, s = 0) {
217
- const i = [...e, t];
218
- return s && i.length > s ? i.slice(1) : i;
219
- }
220
216
  function ns(e, t, s = 0) {
221
- const i = [t, ...e];
222
- return s && i.length > s ? i.slice(0, -1) : i;
217
+ const r = [...e, t];
218
+ return s && r.length > s ? r.slice(1) : r;
219
+ }
220
+ function as(e, t, s = 0) {
221
+ const r = [t, ...e];
222
+ return s && r.length > s ? r.slice(0, -1) : r;
223
223
  }
224
224
  var zt = Symbol();
225
225
  function ke(e, t) {
@@ -227,16 +227,23 @@ function ke(e, t) {
227
227
  `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
228
228
  ), !e.queryFn && (t != null && t.initialPromise) ? () => t.initialPromise : !e.queryFn || e.queryFn === zt ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
229
229
  }
230
- function as(e, t) {
230
+ function Ke(e, t) {
231
231
  return typeof e == "function" ? e(...t) : !!e;
232
232
  }
233
- var ct, tt, Ct, De, os = (De = class extends Kt {
233
+ function os(e, t, s) {
234
+ let r = !1, n;
235
+ return Object.defineProperty(e, "signal", {
236
+ enumerable: !0,
237
+ get: () => (n ?? (n = t()), r || (r = !0, n.aborted ? s() : n.addEventListener("abort", s, { once: !0 })), n)
238
+ }), e;
239
+ }
240
+ var ct, tt, St, De, us = (De = class extends Kt {
234
241
  constructor() {
235
242
  super();
236
243
  c(this, ct);
237
244
  c(this, tt);
238
- c(this, Ct);
239
- o(this, Ct, (t) => {
245
+ c(this, St);
246
+ o(this, St, (t) => {
240
247
  if (!bt && window.addEventListener) {
241
248
  const s = () => t();
242
249
  return window.addEventListener("visibilitychange", s, !1), () => {
@@ -246,20 +253,20 @@ var ct, tt, Ct, De, os = (De = class extends Kt {
246
253
  });
247
254
  }
248
255
  onSubscribe() {
249
- r(this, tt) || this.setEventListener(r(this, Ct));
256
+ i(this, tt) || this.setEventListener(i(this, St));
250
257
  }
251
258
  onUnsubscribe() {
252
259
  var t;
253
- this.hasListeners() || ((t = r(this, tt)) == null || t.call(this), o(this, tt, void 0));
260
+ this.hasListeners() || ((t = i(this, tt)) == null || t.call(this), o(this, tt, void 0));
254
261
  }
255
262
  setEventListener(t) {
256
263
  var s;
257
- o(this, Ct, t), (s = r(this, tt)) == null || s.call(this), o(this, tt, t((i) => {
258
- typeof i == "boolean" ? this.setFocused(i) : this.onFocus();
264
+ o(this, St, t), (s = i(this, tt)) == null || s.call(this), o(this, tt, t((r) => {
265
+ typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
259
266
  }));
260
267
  }
261
268
  setFocused(t) {
262
- r(this, ct) !== t && (o(this, ct, t), this.onFocus());
269
+ i(this, ct) !== t && (o(this, ct, t), this.onFocus());
263
270
  }
264
271
  onFocus() {
265
272
  const t = this.isFocused();
@@ -269,9 +276,9 @@ var ct, tt, Ct, De, os = (De = class extends Kt {
269
276
  }
270
277
  isFocused() {
271
278
  var t;
272
- return typeof r(this, ct) == "boolean" ? r(this, ct) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
279
+ return typeof i(this, ct) == "boolean" ? i(this, ct) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
273
280
  }
274
- }, ct = new WeakMap(), tt = new WeakMap(), Ct = new WeakMap(), De), fe = new os();
281
+ }, ct = new WeakMap(), tt = new WeakMap(), St = new WeakMap(), De), fe = new us();
275
282
  function se() {
276
283
  let e, t;
277
284
  const s = new Promise((n, a) => {
@@ -279,28 +286,28 @@ function se() {
279
286
  });
280
287
  s.status = "pending", s.catch(() => {
281
288
  });
282
- function i(n) {
289
+ function r(n) {
283
290
  Object.assign(s, n), delete s.resolve, delete s.reject;
284
291
  }
285
292
  return s.resolve = (n) => {
286
- i({
293
+ r({
287
294
  status: "fulfilled",
288
295
  value: n
289
296
  }), e(n);
290
297
  }, s.reject = (n) => {
291
- i({
298
+ r({
292
299
  status: "rejected",
293
300
  reason: n
294
301
  }), t(n);
295
302
  }, s;
296
303
  }
297
- var us = ts;
298
- function hs() {
304
+ var hs = es;
305
+ function cs() {
299
306
  let e = [], t = 0, s = (u) => {
300
307
  u();
301
- }, i = (u) => {
308
+ }, r = (u) => {
302
309
  u();
303
- }, n = us;
310
+ }, n = hs;
304
311
  const a = (u) => {
305
312
  t ? e.push(u) : n(() => {
306
313
  s(u);
@@ -308,30 +315,30 @@ function hs() {
308
315
  }, h = () => {
309
316
  const u = e;
310
317
  e = [], u.length && n(() => {
311
- i(() => {
312
- u.forEach((l) => {
313
- s(l);
318
+ r(() => {
319
+ u.forEach((f) => {
320
+ s(f);
314
321
  });
315
322
  });
316
323
  });
317
324
  };
318
325
  return {
319
326
  batch: (u) => {
320
- let l;
327
+ let f;
321
328
  t++;
322
329
  try {
323
- l = u();
330
+ f = u();
324
331
  } finally {
325
332
  t--, t || h();
326
333
  }
327
- return l;
334
+ return f;
328
335
  },
329
336
  /**
330
337
  * All calls to the wrapped function will be batched.
331
338
  */
332
- batchCalls: (u) => (...l) => {
339
+ batchCalls: (u) => (...f) => {
333
340
  a(() => {
334
- u(...l);
341
+ u(...f);
335
342
  });
336
343
  },
337
344
  schedule: a,
@@ -347,52 +354,52 @@ function hs() {
347
354
  * By default React Query will use the batch function provided by ReactDOM or React Native.
348
355
  */
349
356
  setBatchNotifyFunction: (u) => {
350
- i = u;
357
+ r = u;
351
358
  },
352
359
  setScheduler: (u) => {
353
360
  n = u;
354
361
  }
355
362
  };
356
363
  }
357
- var T = hs(), St, et, Ot, Te, cs = (Te = class extends Kt {
364
+ var I = cs(), Ct, et, Ot, Te, ls = (Te = class extends Kt {
358
365
  constructor() {
359
366
  super();
360
- c(this, St, !0);
367
+ c(this, Ct, !0);
361
368
  c(this, et);
362
369
  c(this, Ot);
363
370
  o(this, Ot, (t) => {
364
371
  if (!bt && window.addEventListener) {
365
- const s = () => t(!0), i = () => t(!1);
366
- return window.addEventListener("online", s, !1), window.addEventListener("offline", i, !1), () => {
367
- window.removeEventListener("online", s), window.removeEventListener("offline", i);
372
+ const s = () => t(!0), r = () => t(!1);
373
+ return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
374
+ window.removeEventListener("online", s), window.removeEventListener("offline", r);
368
375
  };
369
376
  }
370
377
  });
371
378
  }
372
379
  onSubscribe() {
373
- r(this, et) || this.setEventListener(r(this, Ot));
380
+ i(this, et) || this.setEventListener(i(this, Ot));
374
381
  }
375
382
  onUnsubscribe() {
376
383
  var t;
377
- this.hasListeners() || ((t = r(this, et)) == null || t.call(this), o(this, et, void 0));
384
+ this.hasListeners() || ((t = i(this, et)) == null || t.call(this), o(this, et, void 0));
378
385
  }
379
386
  setEventListener(t) {
380
387
  var s;
381
- o(this, Ot, t), (s = r(this, et)) == null || s.call(this), o(this, et, t(this.setOnline.bind(this)));
388
+ o(this, Ot, t), (s = i(this, et)) == null || s.call(this), o(this, et, t(this.setOnline.bind(this)));
382
389
  }
383
390
  setOnline(t) {
384
- r(this, St) !== t && (o(this, St, t), this.listeners.forEach((i) => {
385
- i(t);
391
+ i(this, Ct) !== t && (o(this, Ct, t), this.listeners.forEach((r) => {
392
+ r(t);
386
393
  }));
387
394
  }
388
395
  isOnline() {
389
- return r(this, St);
396
+ return i(this, Ct);
390
397
  }
391
- }, St = new WeakMap(), et = new WeakMap(), Ot = new WeakMap(), Te), $t = new cs();
392
- function ls(e) {
398
+ }, Ct = new WeakMap(), et = new WeakMap(), Ot = new WeakMap(), Te), $t = new ls();
399
+ function ds(e) {
393
400
  return Math.min(1e3 * 2 ** e, 3e4);
394
401
  }
395
- function Ke(e) {
402
+ function Le(e) {
396
403
  return (e ?? "online") === "online" ? $t.isOnline() : !0;
397
404
  }
398
405
  var re = class extends Error {
@@ -400,51 +407,51 @@ var re = class extends Error {
400
407
  super("CancelledError"), this.revert = e == null ? void 0 : e.revert, this.silent = e == null ? void 0 : e.silent;
401
408
  }
402
409
  };
403
- function Le(e) {
404
- let t = !1, s = 0, i;
405
- const n = se(), a = () => n.status !== "pending", h = (p) => {
406
- var g;
410
+ function He(e) {
411
+ let t = !1, s = 0, r;
412
+ const n = se(), a = () => n.status !== "pending", h = (m) => {
413
+ var b;
407
414
  if (!a()) {
408
- const w = new re(p);
409
- P(w), (g = e.onCancel) == null || g.call(e, w);
415
+ const S = new re(m);
416
+ P(S), (b = e.onCancel) == null || b.call(e, S);
410
417
  }
411
418
  }, u = () => {
412
419
  t = !0;
413
- }, l = () => {
420
+ }, f = () => {
414
421
  t = !1;
415
- }, b = () => fe.isFocused() && (e.networkMode === "always" || $t.isOnline()) && e.canRun(), O = () => Ke(e.networkMode) && e.canRun(), f = (p) => {
416
- a() || (i == null || i(), n.resolve(p));
417
- }, P = (p) => {
418
- a() || (i == null || i(), n.reject(p));
419
- }, y = () => new Promise((p) => {
420
- var g;
421
- i = (w) => {
422
- (a() || b()) && p(w);
423
- }, (g = e.onPause) == null || g.call(e);
422
+ }, y = () => fe.isFocused() && (e.networkMode === "always" || $t.isOnline()) && e.canRun(), w = () => Le(e.networkMode) && e.canRun(), d = (m) => {
423
+ a() || (r == null || r(), n.resolve(m));
424
+ }, P = (m) => {
425
+ a() || (r == null || r(), n.reject(m));
426
+ }, p = () => new Promise((m) => {
427
+ var b;
428
+ r = (S) => {
429
+ (a() || y()) && m(S);
430
+ }, (b = e.onPause) == null || b.call(e);
424
431
  }).then(() => {
425
- var p;
426
- i = void 0, a() || (p = e.onContinue) == null || p.call(e);
427
- }), F = () => {
432
+ var m;
433
+ r = void 0, a() || (m = e.onContinue) == null || m.call(e);
434
+ }), E = () => {
428
435
  if (a())
429
436
  return;
430
- let p;
431
- const g = s === 0 ? e.initialPromise : void 0;
437
+ let m;
438
+ const b = s === 0 ? e.initialPromise : void 0;
432
439
  try {
433
- p = g ?? e.fn();
434
- } catch (w) {
435
- p = Promise.reject(w);
440
+ m = b ?? e.fn();
441
+ } catch (S) {
442
+ m = Promise.reject(S);
436
443
  }
437
- Promise.resolve(p).then(f).catch((w) => {
438
- var x;
444
+ Promise.resolve(m).then(d).catch((S) => {
445
+ var j;
439
446
  if (a())
440
447
  return;
441
- const R = e.retry ?? (bt ? 0 : 3), E = e.retryDelay ?? ls, d = typeof E == "function" ? E(s, w) : E, Q = R === !0 || typeof R == "number" && s < R || typeof R == "function" && R(s, w);
442
- if (t || !Q) {
443
- P(w);
448
+ const R = e.retry ?? (bt ? 0 : 3), F = e.retryDelay ?? ds, l = typeof F == "function" ? F(s, S) : F, D = R === !0 || typeof R == "number" && s < R || typeof R == "function" && R(s, S);
449
+ if (t || !D) {
450
+ P(S);
444
451
  return;
445
452
  }
446
- s++, (x = e.onFail) == null || x.call(e, s, w), rs(d).then(() => b() ? void 0 : y()).then(() => {
447
- t ? P(w) : F();
453
+ s++, (j = e.onFail) == null || j.call(e, s, S), is(l).then(() => y() ? void 0 : p()).then(() => {
454
+ t ? P(S) : E();
448
455
  });
449
456
  });
450
457
  };
@@ -452,14 +459,14 @@ function Le(e) {
452
459
  promise: n,
453
460
  status: () => n.status,
454
461
  cancel: h,
455
- continue: () => (i == null || i(), n),
462
+ continue: () => (r == null || r(), n),
456
463
  cancelRetry: u,
457
- continueRetry: l,
458
- canStart: O,
459
- start: () => (O() ? F() : y().then(F), n)
464
+ continueRetry: f,
465
+ canStart: w,
466
+ start: () => (w() ? E() : p().then(E), n)
460
467
  };
461
468
  }
462
- var lt, Ie, He = (Ie = class {
469
+ var lt, Ie, Ge = (Ie = class {
463
470
  constructor() {
464
471
  c(this, lt);
465
472
  }
@@ -478,9 +485,9 @@ var lt, Ie, He = (Ie = class {
478
485
  );
479
486
  }
480
487
  clearGcTimeout() {
481
- r(this, lt) && (ut.clearTimeout(r(this, lt)), o(this, lt, void 0));
488
+ i(this, lt) && (ut.clearTimeout(i(this, lt)), o(this, lt, void 0));
482
489
  }
483
- }, lt = new WeakMap(), Ie), dt, Pt, _, ft, D, Ut, yt, L, $, qe, ds = (qe = class extends He {
490
+ }, lt = new WeakMap(), Ie), dt, Pt, _, ft, T, jt, yt, L, $, Ae, fs = (Ae = class extends Ge {
484
491
  constructor(t) {
485
492
  super();
486
493
  c(this, L);
@@ -488,51 +495,51 @@ var lt, Ie, He = (Ie = class {
488
495
  c(this, Pt);
489
496
  c(this, _);
490
497
  c(this, ft);
491
- c(this, D);
492
- c(this, Ut);
498
+ c(this, T);
499
+ c(this, jt);
493
500
  c(this, yt);
494
- o(this, yt, !1), o(this, Ut, t.defaultOptions), this.setOptions(t.options), this.observers = [], o(this, ft, t.client), o(this, _, r(this, ft).getQueryCache()), this.queryKey = t.queryKey, this.queryHash = t.queryHash, o(this, dt, Oe(this.options)), this.state = t.state ?? r(this, dt), this.scheduleGc();
501
+ o(this, yt, !1), o(this, jt, t.defaultOptions), this.setOptions(t.options), this.observers = [], o(this, ft, t.client), o(this, _, i(this, ft).getQueryCache()), this.queryKey = t.queryKey, this.queryHash = t.queryHash, o(this, dt, Oe(this.options)), this.state = t.state ?? i(this, dt), this.scheduleGc();
495
502
  }
496
503
  get meta() {
497
504
  return this.options.meta;
498
505
  }
499
506
  get promise() {
500
507
  var t;
501
- return (t = r(this, D)) == null ? void 0 : t.promise;
508
+ return (t = i(this, T)) == null ? void 0 : t.promise;
502
509
  }
503
510
  setOptions(t) {
504
- if (this.options = { ...r(this, Ut), ...t }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
511
+ if (this.options = { ...i(this, jt), ...t }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
505
512
  const s = Oe(this.options);
506
513
  s.data !== void 0 && (this.setState(
507
- Se(s.data, s.dataUpdatedAt)
514
+ Ce(s.data, s.dataUpdatedAt)
508
515
  ), o(this, dt, s));
509
516
  }
510
517
  }
511
518
  optionalRemove() {
512
- !this.observers.length && this.state.fetchStatus === "idle" && r(this, _).remove(this);
519
+ !this.observers.length && this.state.fetchStatus === "idle" && i(this, _).remove(this);
513
520
  }
514
521
  setData(t, s) {
515
- const i = ee(this.state.data, t, this.options);
516
- return m(this, L, $).call(this, {
517
- data: i,
522
+ const r = ee(this.state.data, t, this.options);
523
+ return v(this, L, $).call(this, {
524
+ data: r,
518
525
  type: "success",
519
526
  dataUpdatedAt: s == null ? void 0 : s.updatedAt,
520
527
  manual: s == null ? void 0 : s.manual
521
- }), i;
528
+ }), r;
522
529
  }
523
530
  setState(t, s) {
524
- m(this, L, $).call(this, { type: "setState", state: t, setStateOptions: s });
531
+ v(this, L, $).call(this, { type: "setState", state: t, setStateOptions: s });
525
532
  }
526
533
  cancel(t) {
527
- var i, n;
528
- const s = (i = r(this, D)) == null ? void 0 : i.promise;
529
- return (n = r(this, D)) == null || n.cancel(t), s ? s.then(j).catch(j) : Promise.resolve();
534
+ var r, n;
535
+ const s = (r = i(this, T)) == null ? void 0 : r.promise;
536
+ return (n = i(this, T)) == null || n.cancel(t), s ? s.then(N).catch(N) : Promise.resolve();
530
537
  }
531
538
  destroy() {
532
539
  super.destroy(), this.cancel({ silent: !0 });
533
540
  }
534
541
  reset() {
535
- this.destroy(), this.setState(r(this, dt));
542
+ this.destroy(), this.setState(i(this, dt));
536
543
  }
537
544
  isActive() {
538
545
  return this.observers.some(
@@ -557,91 +564,91 @@ var lt, Ie, He = (Ie = class {
557
564
  }
558
565
  onFocus() {
559
566
  var s;
560
- const t = this.observers.find((i) => i.shouldFetchOnWindowFocus());
561
- t == null || t.refetch({ cancelRefetch: !1 }), (s = r(this, D)) == null || s.continue();
567
+ const t = this.observers.find((r) => r.shouldFetchOnWindowFocus());
568
+ t == null || t.refetch({ cancelRefetch: !1 }), (s = i(this, T)) == null || s.continue();
562
569
  }
563
570
  onOnline() {
564
571
  var s;
565
- const t = this.observers.find((i) => i.shouldFetchOnReconnect());
566
- t == null || t.refetch({ cancelRefetch: !1 }), (s = r(this, D)) == null || s.continue();
572
+ const t = this.observers.find((r) => r.shouldFetchOnReconnect());
573
+ t == null || t.refetch({ cancelRefetch: !1 }), (s = i(this, T)) == null || s.continue();
567
574
  }
568
575
  addObserver(t) {
569
- this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), r(this, _).notify({ type: "observerAdded", query: this, observer: t }));
576
+ this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), i(this, _).notify({ type: "observerAdded", query: this, observer: t }));
570
577
  }
571
578
  removeObserver(t) {
572
- this.observers.includes(t) && (this.observers = this.observers.filter((s) => s !== t), this.observers.length || (r(this, D) && (r(this, yt) ? r(this, D).cancel({ revert: !0 }) : r(this, D).cancelRetry()), this.scheduleGc()), r(this, _).notify({ type: "observerRemoved", query: this, observer: t }));
579
+ this.observers.includes(t) && (this.observers = this.observers.filter((s) => s !== t), this.observers.length || (i(this, T) && (i(this, yt) ? i(this, T).cancel({ revert: !0 }) : i(this, T).cancelRetry()), this.scheduleGc()), i(this, _).notify({ type: "observerRemoved", query: this, observer: t }));
573
580
  }
574
581
  getObserversCount() {
575
582
  return this.observers.length;
576
583
  }
577
584
  invalidate() {
578
- this.state.isInvalidated || m(this, L, $).call(this, { type: "invalidate" });
585
+ this.state.isInvalidated || v(this, L, $).call(this, { type: "invalidate" });
579
586
  }
580
587
  async fetch(t, s) {
581
- var l, b, O, f, P, y, F, p, g, w, R, E;
588
+ var f, y, w, d, P, p, E, m, b, S, R, F;
582
589
  if (this.state.fetchStatus !== "idle" && // If the promise in the retyer is already rejected, we have to definitely
583
590
  // re-start the fetch; there is a chance that the query is still in a
584
591
  // pending state when that happens
585
- ((l = r(this, D)) == null ? void 0 : l.status()) !== "rejected") {
592
+ ((f = i(this, T)) == null ? void 0 : f.status()) !== "rejected") {
586
593
  if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
587
594
  this.cancel({ silent: !0 });
588
- else if (r(this, D))
589
- return r(this, D).continueRetry(), r(this, D).promise;
595
+ else if (i(this, T))
596
+ return i(this, T).continueRetry(), i(this, T).promise;
590
597
  }
591
598
  if (t && this.setOptions(t), !this.options.queryFn) {
592
- const d = this.observers.find((Q) => Q.options.queryFn);
593
- d && this.setOptions(d.options);
599
+ const l = this.observers.find((D) => D.options.queryFn);
600
+ l && this.setOptions(l.options);
594
601
  }
595
602
  process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
596
603
  "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']"
597
604
  ));
598
- const i = new AbortController(), n = (d) => {
599
- Object.defineProperty(d, "signal", {
605
+ const r = new AbortController(), n = (l) => {
606
+ Object.defineProperty(l, "signal", {
600
607
  enumerable: !0,
601
- get: () => (o(this, yt, !0), i.signal)
608
+ get: () => (o(this, yt, !0), r.signal)
602
609
  });
603
610
  }, a = () => {
604
- const d = ke(this.options, s), x = (() => {
611
+ const l = ke(this.options, s), j = (() => {
605
612
  const Z = {
606
- client: r(this, ft),
613
+ client: i(this, ft),
607
614
  queryKey: this.queryKey,
608
615
  meta: this.meta
609
616
  };
610
617
  return n(Z), Z;
611
618
  })();
612
619
  return o(this, yt, !1), this.options.persister ? this.options.persister(
613
- d,
614
- x,
620
+ l,
621
+ j,
615
622
  this
616
- ) : d(x);
623
+ ) : l(j);
617
624
  }, u = (() => {
618
- const d = {
625
+ const l = {
619
626
  fetchOptions: s,
620
627
  options: this.options,
621
628
  queryKey: this.queryKey,
622
- client: r(this, ft),
629
+ client: i(this, ft),
623
630
  state: this.state,
624
631
  fetchFn: a
625
632
  };
626
- return n(d), d;
633
+ return n(l), l;
627
634
  })();
628
- (b = this.options.behavior) == null || b.onFetch(u, this), o(this, Pt, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((O = u.fetchOptions) == null ? void 0 : O.meta)) && m(this, L, $).call(this, { type: "fetch", meta: (f = u.fetchOptions) == null ? void 0 : f.meta }), o(this, D, Le({
635
+ (y = this.options.behavior) == null || y.onFetch(u, this), o(this, Pt, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((w = u.fetchOptions) == null ? void 0 : w.meta)) && v(this, L, $).call(this, { type: "fetch", meta: (d = u.fetchOptions) == null ? void 0 : d.meta }), o(this, T, He({
629
636
  initialPromise: s == null ? void 0 : s.initialPromise,
630
637
  fn: u.fetchFn,
631
- onCancel: (d) => {
632
- d instanceof re && d.revert && this.setState({
633
- ...r(this, Pt),
638
+ onCancel: (l) => {
639
+ l instanceof re && l.revert && this.setState({
640
+ ...i(this, Pt),
634
641
  fetchStatus: "idle"
635
- }), i.abort();
642
+ }), r.abort();
636
643
  },
637
- onFail: (d, Q) => {
638
- m(this, L, $).call(this, { type: "failed", failureCount: d, error: Q });
644
+ onFail: (l, D) => {
645
+ v(this, L, $).call(this, { type: "failed", failureCount: l, error: D });
639
646
  },
640
647
  onPause: () => {
641
- m(this, L, $).call(this, { type: "pause" });
648
+ v(this, L, $).call(this, { type: "pause" });
642
649
  },
643
650
  onContinue: () => {
644
- m(this, L, $).call(this, { type: "continue" });
651
+ v(this, L, $).call(this, { type: "continue" });
645
652
  },
646
653
  retry: u.options.retry,
647
654
  retryDelay: u.options.retryDelay,
@@ -649,74 +656,74 @@ var lt, Ie, He = (Ie = class {
649
656
  canRun: () => !0
650
657
  }));
651
658
  try {
652
- const d = await r(this, D).start();
653
- if (d === void 0)
659
+ const l = await i(this, T).start();
660
+ if (l === void 0)
654
661
  throw process.env.NODE_ENV !== "production" && console.error(
655
662
  `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
656
663
  ), new Error(`${this.queryHash} data is undefined`);
657
- return this.setData(d), (y = (P = r(this, _).config).onSuccess) == null || y.call(P, d, this), (p = (F = r(this, _).config).onSettled) == null || p.call(
658
- F,
659
- d,
664
+ return this.setData(l), (p = (P = i(this, _).config).onSuccess) == null || p.call(P, l, this), (m = (E = i(this, _).config).onSettled) == null || m.call(
665
+ E,
666
+ l,
660
667
  this.state.error,
661
668
  this
662
- ), d;
663
- } catch (d) {
664
- if (d instanceof re) {
665
- if (d.silent)
666
- return r(this, D).promise;
667
- if (d.revert) {
669
+ ), l;
670
+ } catch (l) {
671
+ if (l instanceof re) {
672
+ if (l.silent)
673
+ return i(this, T).promise;
674
+ if (l.revert) {
668
675
  if (this.state.data === void 0)
669
- throw d;
676
+ throw l;
670
677
  return this.state.data;
671
678
  }
672
679
  }
673
- throw m(this, L, $).call(this, {
680
+ throw v(this, L, $).call(this, {
674
681
  type: "error",
675
- error: d
676
- }), (w = (g = r(this, _).config).onError) == null || w.call(
677
- g,
678
- d,
682
+ error: l
683
+ }), (S = (b = i(this, _).config).onError) == null || S.call(
684
+ b,
685
+ l,
679
686
  this
680
- ), (E = (R = r(this, _).config).onSettled) == null || E.call(
687
+ ), (F = (R = i(this, _).config).onSettled) == null || F.call(
681
688
  R,
682
689
  this.state.data,
683
- d,
690
+ l,
684
691
  this
685
- ), d;
692
+ ), l;
686
693
  } finally {
687
694
  this.scheduleGc();
688
695
  }
689
696
  }
690
- }, dt = new WeakMap(), Pt = new WeakMap(), _ = new WeakMap(), ft = new WeakMap(), D = new WeakMap(), Ut = new WeakMap(), yt = new WeakMap(), L = new WeakSet(), $ = function(t) {
691
- const s = (i) => {
697
+ }, dt = new WeakMap(), Pt = new WeakMap(), _ = new WeakMap(), ft = new WeakMap(), T = new WeakMap(), jt = new WeakMap(), yt = new WeakMap(), L = new WeakSet(), $ = function(t) {
698
+ const s = (r) => {
692
699
  switch (t.type) {
693
700
  case "failed":
694
701
  return {
695
- ...i,
702
+ ...r,
696
703
  fetchFailureCount: t.failureCount,
697
704
  fetchFailureReason: t.error
698
705
  };
699
706
  case "pause":
700
707
  return {
701
- ...i,
708
+ ...r,
702
709
  fetchStatus: "paused"
703
710
  };
704
711
  case "continue":
705
712
  return {
706
- ...i,
713
+ ...r,
707
714
  fetchStatus: "fetching"
708
715
  };
709
716
  case "fetch":
710
717
  return {
711
- ...i,
712
- ...Ge(i.data, this.options),
718
+ ...r,
719
+ ...Be(r.data, this.options),
713
720
  fetchMeta: t.meta ?? null
714
721
  };
715
722
  case "success":
716
723
  const n = {
717
- ...i,
718
- ...Se(t.data, t.dataUpdatedAt),
719
- dataUpdateCount: i.dataUpdateCount + 1,
724
+ ...r,
725
+ ...Ce(t.data, t.dataUpdatedAt),
726
+ dataUpdateCount: r.dataUpdateCount + 1,
720
727
  ...!t.manual && {
721
728
  fetchStatus: "idle",
722
729
  fetchFailureCount: 0,
@@ -727,45 +734,48 @@ var lt, Ie, He = (Ie = class {
727
734
  case "error":
728
735
  const a = t.error;
729
736
  return {
730
- ...i,
737
+ ...r,
731
738
  error: a,
732
- errorUpdateCount: i.errorUpdateCount + 1,
739
+ errorUpdateCount: r.errorUpdateCount + 1,
733
740
  errorUpdatedAt: Date.now(),
734
- fetchFailureCount: i.fetchFailureCount + 1,
741
+ fetchFailureCount: r.fetchFailureCount + 1,
735
742
  fetchFailureReason: a,
736
743
  fetchStatus: "idle",
737
- status: "error"
744
+ status: "error",
745
+ // flag existing data as invalidated if we get a background error
746
+ // note that "no data" always means stale so we can set unconditionally here
747
+ isInvalidated: !0
738
748
  };
739
749
  case "invalidate":
740
750
  return {
741
- ...i,
751
+ ...r,
742
752
  isInvalidated: !0
743
753
  };
744
754
  case "setState":
745
755
  return {
746
- ...i,
756
+ ...r,
747
757
  ...t.state
748
758
  };
749
759
  }
750
760
  };
751
- this.state = s(this.state), T.batch(() => {
752
- this.observers.forEach((i) => {
753
- i.onQueryUpdate();
754
- }), r(this, _).notify({ query: this, type: "updated", action: t });
761
+ this.state = s(this.state), I.batch(() => {
762
+ this.observers.forEach((r) => {
763
+ r.onQueryUpdate();
764
+ }), i(this, _).notify({ query: this, type: "updated", action: t });
755
765
  });
756
- }, qe);
757
- function Ge(e, t) {
766
+ }, Ae);
767
+ function Be(e, t) {
758
768
  return {
759
769
  fetchFailureCount: 0,
760
770
  fetchFailureReason: null,
761
- fetchStatus: Ke(t.networkMode) ? "fetching" : "paused",
771
+ fetchStatus: Le(t.networkMode) ? "fetching" : "paused",
762
772
  ...e === void 0 && {
763
773
  error: null,
764
774
  status: "pending"
765
775
  }
766
776
  };
767
777
  }
768
- function Se(e, t) {
778
+ function Ce(e, t) {
769
779
  return {
770
780
  data: e,
771
781
  dataUpdatedAt: t ?? Date.now(),
@@ -775,11 +785,11 @@ function Se(e, t) {
775
785
  };
776
786
  }
777
787
  function Oe(e) {
778
- const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = t !== void 0, i = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
788
+ const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = t !== void 0, r = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
779
789
  return {
780
790
  data: t,
781
791
  dataUpdateCount: 0,
782
- dataUpdatedAt: s ? i ?? Date.now() : 0,
792
+ dataUpdatedAt: s ? r ?? Date.now() : 0,
783
793
  error: null,
784
794
  errorUpdateCount: 0,
785
795
  errorUpdatedAt: 0,
@@ -791,13 +801,13 @@ function Oe(e) {
791
801
  fetchStatus: "idle"
792
802
  };
793
803
  }
794
- var U, v, jt, q, pt, Et, W, st, Nt, Ft, Rt, mt, vt, rt, Mt, S, qt, ie, ne, ae, oe, ue, he, ce, Be, Ae, fs = (Ae = class extends Kt {
804
+ var U, g, Ut, q, pt, Et, W, st, Nt, Ft, Rt, mt, vt, rt, Mt, O, At, ie, ne, ae, oe, ue, he, ce, Ve, qe, ys = (qe = class extends Kt {
795
805
  constructor(t, s) {
796
806
  super();
797
- c(this, S);
807
+ c(this, O);
798
808
  c(this, U);
799
- c(this, v);
800
- c(this, jt);
809
+ c(this, g);
810
+ c(this, Ut);
801
811
  c(this, q);
802
812
  c(this, pt);
803
813
  c(this, Et);
@@ -818,70 +828,70 @@ var U, v, jt, q, pt, Et, W, st, Nt, Ft, Rt, mt, vt, rt, Mt, S, qt, ie, ne, ae, o
818
828
  this.refetch = this.refetch.bind(this);
819
829
  }
820
830
  onSubscribe() {
821
- this.listeners.size === 1 && (r(this, v).addObserver(this), Pe(r(this, v), this.options) ? m(this, S, qt).call(this) : this.updateResult(), m(this, S, oe).call(this));
831
+ this.listeners.size === 1 && (i(this, g).addObserver(this), Pe(i(this, g), this.options) ? v(this, O, At).call(this) : this.updateResult(), v(this, O, oe).call(this));
822
832
  }
823
833
  onUnsubscribe() {
824
834
  this.hasListeners() || this.destroy();
825
835
  }
826
836
  shouldFetchOnReconnect() {
827
837
  return le(
828
- r(this, v),
838
+ i(this, g),
829
839
  this.options,
830
840
  this.options.refetchOnReconnect
831
841
  );
832
842
  }
833
843
  shouldFetchOnWindowFocus() {
834
844
  return le(
835
- r(this, v),
845
+ i(this, g),
836
846
  this.options,
837
847
  this.options.refetchOnWindowFocus
838
848
  );
839
849
  }
840
850
  destroy() {
841
- this.listeners = /* @__PURE__ */ new Set(), m(this, S, ue).call(this), m(this, S, he).call(this), r(this, v).removeObserver(this);
851
+ this.listeners = /* @__PURE__ */ new Set(), v(this, O, ue).call(this), v(this, O, he).call(this), i(this, g).removeObserver(this);
842
852
  }
843
853
  setOptions(t) {
844
- const s = this.options, i = r(this, v);
845
- if (this.options = r(this, U).defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof k(this.options.enabled, r(this, v)) != "boolean")
854
+ const s = this.options, r = i(this, g);
855
+ if (this.options = i(this, U).defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof k(this.options.enabled, i(this, g)) != "boolean")
846
856
  throw new Error(
847
857
  "Expected enabled to be a boolean or a callback that returns a boolean"
848
858
  );
849
- m(this, S, ce).call(this), r(this, v).setOptions(this.options), s._defaulted && !Yt(this.options, s) && r(this, U).getQueryCache().notify({
859
+ v(this, O, ce).call(this), i(this, g).setOptions(this.options), s._defaulted && !Yt(this.options, s) && i(this, U).getQueryCache().notify({
850
860
  type: "observerOptionsUpdated",
851
- query: r(this, v),
861
+ query: i(this, g),
852
862
  observer: this
853
863
  });
854
864
  const n = this.hasListeners();
855
865
  n && Ee(
856
- r(this, v),
857
- i,
866
+ i(this, g),
867
+ r,
858
868
  this.options,
859
869
  s
860
- ) && m(this, S, qt).call(this), this.updateResult(), n && (r(this, v) !== i || k(this.options.enabled, r(this, v)) !== k(s.enabled, r(this, v)) || ot(this.options.staleTime, r(this, v)) !== ot(s.staleTime, r(this, v))) && m(this, S, ie).call(this);
861
- const a = m(this, S, ne).call(this);
862
- n && (r(this, v) !== i || k(this.options.enabled, r(this, v)) !== k(s.enabled, r(this, v)) || a !== r(this, rt)) && m(this, S, ae).call(this, a);
870
+ ) && v(this, O, At).call(this), this.updateResult(), n && (i(this, g) !== r || k(this.options.enabled, i(this, g)) !== k(s.enabled, i(this, g)) || ot(this.options.staleTime, i(this, g)) !== ot(s.staleTime, i(this, g))) && v(this, O, ie).call(this);
871
+ const a = v(this, O, ne).call(this);
872
+ n && (i(this, g) !== r || k(this.options.enabled, i(this, g)) !== k(s.enabled, i(this, g)) || a !== i(this, rt)) && v(this, O, ae).call(this, a);
863
873
  }
864
874
  getOptimisticResult(t) {
865
- const s = r(this, U).getQueryCache().build(r(this, U), t), i = this.createResult(s, t);
866
- return ps(this, i) && (o(this, q, i), o(this, Et, this.options), o(this, pt, r(this, v).state)), i;
875
+ const s = i(this, U).getQueryCache().build(i(this, U), t), r = this.createResult(s, t);
876
+ return ms(this, r) && (o(this, q, r), o(this, Et, this.options), o(this, pt, i(this, g).state)), r;
867
877
  }
868
878
  getCurrentResult() {
869
- return r(this, q);
879
+ return i(this, q);
870
880
  }
871
881
  trackResult(t, s) {
872
882
  return new Proxy(t, {
873
- get: (i, n) => (this.trackProp(n), s == null || s(n), n === "promise" && (this.trackProp("data"), !this.options.experimental_prefetchInRender && r(this, W).status === "pending" && r(this, W).reject(
883
+ get: (r, n) => (this.trackProp(n), s == null || s(n), n === "promise" && (this.trackProp("data"), !this.options.experimental_prefetchInRender && i(this, W).status === "pending" && i(this, W).reject(
874
884
  new Error(
875
885
  "experimental_prefetchInRender feature flag is not enabled"
876
886
  )
877
- )), Reflect.get(i, n))
887
+ )), Reflect.get(r, n))
878
888
  });
879
889
  }
880
890
  trackProp(t) {
881
- r(this, Mt).add(t);
891
+ i(this, Mt).add(t);
882
892
  }
883
893
  getCurrentQuery() {
884
- return r(this, v);
894
+ return i(this, g);
885
895
  }
886
896
  refetch({ ...t } = {}) {
887
897
  return this.fetch({
@@ -889,249 +899,248 @@ var U, v, jt, q, pt, Et, W, st, Nt, Ft, Rt, mt, vt, rt, Mt, S, qt, ie, ne, ae, o
889
899
  });
890
900
  }
891
901
  fetchOptimistic(t) {
892
- const s = r(this, U).defaultQueryOptions(t), i = r(this, U).getQueryCache().build(r(this, U), s);
893
- return i.fetch().then(() => this.createResult(i, s));
902
+ const s = i(this, U).defaultQueryOptions(t), r = i(this, U).getQueryCache().build(i(this, U), s);
903
+ return r.fetch().then(() => this.createResult(r, s));
894
904
  }
895
905
  fetch(t) {
896
- return m(this, S, qt).call(this, {
906
+ return v(this, O, At).call(this, {
897
907
  ...t,
898
908
  cancelRefetch: t.cancelRefetch ?? !0
899
- }).then(() => (this.updateResult(), r(this, q)));
909
+ }).then(() => (this.updateResult(), i(this, q)));
900
910
  }
901
911
  createResult(t, s) {
902
912
  var X;
903
- const i = r(this, v), n = this.options, a = r(this, q), h = r(this, pt), u = r(this, Et), b = t !== i ? t.state : r(this, jt), { state: O } = t;
904
- let f = { ...O }, P = !1, y;
913
+ const r = i(this, g), n = this.options, a = i(this, q), h = i(this, pt), u = i(this, Et), y = t !== r ? t.state : i(this, Ut), { state: w } = t;
914
+ let d = { ...w }, P = !1, p;
905
915
  if (s._optimisticResults) {
906
- const C = this.hasListeners(), N = !C && Pe(t, s), wt = C && Ee(t, i, s, n);
907
- (N || wt) && (f = {
908
- ...f,
909
- ...Ge(O.data, t.options)
910
- }), s._optimisticResults === "isRestoring" && (f.fetchStatus = "idle");
916
+ const C = this.hasListeners(), Q = !C && Pe(t, s), wt = C && Ee(t, r, s, n);
917
+ (Q || wt) && (d = {
918
+ ...d,
919
+ ...Be(w.data, t.options)
920
+ }), s._optimisticResults === "isRestoring" && (d.fetchStatus = "idle");
911
921
  }
912
- let { error: F, errorUpdatedAt: p, status: g } = f;
913
- y = f.data;
914
- let w = !1;
915
- if (s.placeholderData !== void 0 && y === void 0 && g === "pending") {
922
+ let { error: E, errorUpdatedAt: m, status: b } = d;
923
+ p = d.data;
924
+ let S = !1;
925
+ if (s.placeholderData !== void 0 && p === void 0 && b === "pending") {
916
926
  let C;
917
- a != null && a.isPlaceholderData && s.placeholderData === (u == null ? void 0 : u.placeholderData) ? (C = a.data, w = !0) : C = typeof s.placeholderData == "function" ? s.placeholderData(
918
- (X = r(this, Rt)) == null ? void 0 : X.state.data,
919
- r(this, Rt)
920
- ) : s.placeholderData, C !== void 0 && (g = "success", y = ee(
927
+ a != null && a.isPlaceholderData && s.placeholderData === (u == null ? void 0 : u.placeholderData) ? (C = a.data, S = !0) : C = typeof s.placeholderData == "function" ? s.placeholderData(
928
+ (X = i(this, Rt)) == null ? void 0 : X.state.data,
929
+ i(this, Rt)
930
+ ) : s.placeholderData, C !== void 0 && (b = "success", p = ee(
921
931
  a == null ? void 0 : a.data,
922
932
  C,
923
933
  s
924
934
  ), P = !0);
925
935
  }
926
- if (s.select && y !== void 0 && !w)
927
- if (a && y === (h == null ? void 0 : h.data) && s.select === r(this, Nt))
928
- y = r(this, Ft);
936
+ if (s.select && p !== void 0 && !S)
937
+ if (a && p === (h == null ? void 0 : h.data) && s.select === i(this, Nt))
938
+ p = i(this, Ft);
929
939
  else
930
940
  try {
931
- o(this, Nt, s.select), y = s.select(y), y = ee(a == null ? void 0 : a.data, y, s), o(this, Ft, y), o(this, st, null);
941
+ o(this, Nt, s.select), p = s.select(p), p = ee(a == null ? void 0 : a.data, p, s), o(this, Ft, p), o(this, st, null);
932
942
  } catch (C) {
933
943
  o(this, st, C);
934
944
  }
935
- r(this, st) && (F = r(this, st), y = r(this, Ft), p = Date.now(), g = "error");
936
- const R = f.fetchStatus === "fetching", E = g === "pending", d = g === "error", Q = E && R, x = y !== void 0, I = {
937
- status: g,
938
- fetchStatus: f.fetchStatus,
939
- isPending: E,
940
- isSuccess: g === "success",
941
- isError: d,
942
- isInitialLoading: Q,
943
- isLoading: Q,
944
- data: y,
945
- dataUpdatedAt: f.dataUpdatedAt,
946
- error: F,
947
- errorUpdatedAt: p,
948
- failureCount: f.fetchFailureCount,
949
- failureReason: f.fetchFailureReason,
950
- errorUpdateCount: f.errorUpdateCount,
951
- isFetched: f.dataUpdateCount > 0 || f.errorUpdateCount > 0,
952
- isFetchedAfterMount: f.dataUpdateCount > b.dataUpdateCount || f.errorUpdateCount > b.errorUpdateCount,
945
+ i(this, st) && (E = i(this, st), p = i(this, Ft), m = Date.now(), b = "error");
946
+ const R = d.fetchStatus === "fetching", F = b === "pending", l = b === "error", D = F && R, j = p !== void 0, A = {
947
+ status: b,
948
+ fetchStatus: d.fetchStatus,
949
+ isPending: F,
950
+ isSuccess: b === "success",
951
+ isError: l,
952
+ isInitialLoading: D,
953
+ isLoading: D,
954
+ data: p,
955
+ dataUpdatedAt: d.dataUpdatedAt,
956
+ error: E,
957
+ errorUpdatedAt: m,
958
+ failureCount: d.fetchFailureCount,
959
+ failureReason: d.fetchFailureReason,
960
+ errorUpdateCount: d.errorUpdateCount,
961
+ isFetched: d.dataUpdateCount > 0 || d.errorUpdateCount > 0,
962
+ isFetchedAfterMount: d.dataUpdateCount > y.dataUpdateCount || d.errorUpdateCount > y.errorUpdateCount,
953
963
  isFetching: R,
954
- isRefetching: R && !E,
955
- isLoadingError: d && !x,
956
- isPaused: f.fetchStatus === "paused",
964
+ isRefetching: R && !F,
965
+ isLoadingError: l && !j,
966
+ isPaused: d.fetchStatus === "paused",
957
967
  isPlaceholderData: P,
958
- isRefetchError: d && x,
968
+ isRefetchError: l && j,
959
969
  isStale: ye(t, s),
960
970
  refetch: this.refetch,
961
- promise: r(this, W),
971
+ promise: i(this, W),
962
972
  isEnabled: k(s.enabled, t) !== !1
963
973
  };
964
974
  if (this.options.experimental_prefetchInRender) {
965
975
  const C = (Lt) => {
966
- I.status === "error" ? Lt.reject(I.error) : I.data !== void 0 && Lt.resolve(I.data);
967
- }, N = () => {
968
- const Lt = o(this, W, I.promise = se());
976
+ A.status === "error" ? Lt.reject(A.error) : A.data !== void 0 && Lt.resolve(A.data);
977
+ }, Q = () => {
978
+ const Lt = o(this, W, A.promise = se());
969
979
  C(Lt);
970
- }, wt = r(this, W);
980
+ }, wt = i(this, W);
971
981
  switch (wt.status) {
972
982
  case "pending":
973
- t.queryHash === i.queryHash && C(wt);
983
+ t.queryHash === r.queryHash && C(wt);
974
984
  break;
975
985
  case "fulfilled":
976
- (I.status === "error" || I.data !== wt.value) && N();
986
+ (A.status === "error" || A.data !== wt.value) && Q();
977
987
  break;
978
988
  case "rejected":
979
- (I.status !== "error" || I.error !== wt.reason) && N();
989
+ (A.status !== "error" || A.error !== wt.reason) && Q();
980
990
  break;
981
991
  }
982
992
  }
983
- return I;
993
+ return A;
984
994
  }
985
995
  updateResult() {
986
- const t = r(this, q), s = this.createResult(r(this, v), this.options);
987
- if (o(this, pt, r(this, v).state), o(this, Et, this.options), r(this, pt).data !== void 0 && o(this, Rt, r(this, v)), Yt(s, t))
996
+ const t = i(this, q), s = this.createResult(i(this, g), this.options);
997
+ if (o(this, pt, i(this, g).state), o(this, Et, this.options), i(this, pt).data !== void 0 && o(this, Rt, i(this, g)), Yt(s, t))
988
998
  return;
989
999
  o(this, q, s);
990
- const i = () => {
1000
+ const r = () => {
991
1001
  if (!t)
992
1002
  return !0;
993
1003
  const { notifyOnChangeProps: n } = this.options, a = typeof n == "function" ? n() : n;
994
- if (a === "all" || !a && !r(this, Mt).size)
1004
+ if (a === "all" || !a && !i(this, Mt).size)
995
1005
  return !0;
996
1006
  const h = new Set(
997
- a ?? r(this, Mt)
1007
+ a ?? i(this, Mt)
998
1008
  );
999
- return this.options.throwOnError && h.add("error"), Object.keys(r(this, q)).some((u) => {
1000
- const l = u;
1001
- return r(this, q)[l] !== t[l] && h.has(l);
1009
+ return this.options.throwOnError && h.add("error"), Object.keys(i(this, q)).some((u) => {
1010
+ const f = u;
1011
+ return i(this, q)[f] !== t[f] && h.has(f);
1002
1012
  });
1003
1013
  };
1004
- m(this, S, Be).call(this, { listeners: i() });
1014
+ v(this, O, Ve).call(this, { listeners: r() });
1005
1015
  }
1006
1016
  onQueryUpdate() {
1007
- this.updateResult(), this.hasListeners() && m(this, S, oe).call(this);
1017
+ this.updateResult(), this.hasListeners() && v(this, O, oe).call(this);
1008
1018
  }
1009
- }, U = new WeakMap(), v = new WeakMap(), jt = new WeakMap(), q = new WeakMap(), pt = new WeakMap(), Et = new WeakMap(), W = new WeakMap(), st = new WeakMap(), Nt = new WeakMap(), Ft = new WeakMap(), Rt = new WeakMap(), mt = new WeakMap(), vt = new WeakMap(), rt = new WeakMap(), Mt = new WeakMap(), S = new WeakSet(), qt = function(t) {
1010
- m(this, S, ce).call(this);
1011
- let s = r(this, v).fetch(
1019
+ }, U = new WeakMap(), g = new WeakMap(), Ut = new WeakMap(), q = new WeakMap(), pt = new WeakMap(), Et = new WeakMap(), W = new WeakMap(), st = new WeakMap(), Nt = new WeakMap(), Ft = new WeakMap(), Rt = new WeakMap(), mt = new WeakMap(), vt = new WeakMap(), rt = new WeakMap(), Mt = new WeakMap(), O = new WeakSet(), At = function(t) {
1020
+ v(this, O, ce).call(this);
1021
+ let s = i(this, g).fetch(
1012
1022
  this.options,
1013
1023
  t
1014
1024
  );
1015
- return t != null && t.throwOnError || (s = s.catch(j)), s;
1025
+ return t != null && t.throwOnError || (s = s.catch(N)), s;
1016
1026
  }, ie = function() {
1017
- m(this, S, ue).call(this);
1027
+ v(this, O, ue).call(this);
1018
1028
  const t = ot(
1019
1029
  this.options.staleTime,
1020
- r(this, v)
1030
+ i(this, g)
1021
1031
  );
1022
- if (bt || r(this, q).isStale || !Zt(t))
1032
+ if (bt || i(this, q).isStale || !Zt(t))
1023
1033
  return;
1024
- const i = _e(r(this, q).dataUpdatedAt, t) + 1;
1034
+ const r = _e(i(this, q).dataUpdatedAt, t) + 1;
1025
1035
  o(this, mt, ut.setTimeout(() => {
1026
- r(this, q).isStale || this.updateResult();
1027
- }, i));
1036
+ i(this, q).isStale || this.updateResult();
1037
+ }, r));
1028
1038
  }, ne = function() {
1029
- return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(r(this, v)) : this.options.refetchInterval) ?? !1;
1039
+ return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(i(this, g)) : this.options.refetchInterval) ?? !1;
1030
1040
  }, ae = function(t) {
1031
- m(this, S, he).call(this), o(this, rt, t), !(bt || k(this.options.enabled, r(this, v)) === !1 || !Zt(r(this, rt)) || r(this, rt) === 0) && o(this, vt, ut.setInterval(() => {
1032
- (this.options.refetchIntervalInBackground || fe.isFocused()) && m(this, S, qt).call(this);
1033
- }, r(this, rt)));
1041
+ v(this, O, he).call(this), o(this, rt, t), !(bt || k(this.options.enabled, i(this, g)) === !1 || !Zt(i(this, rt)) || i(this, rt) === 0) && o(this, vt, ut.setInterval(() => {
1042
+ (this.options.refetchIntervalInBackground || fe.isFocused()) && v(this, O, At).call(this);
1043
+ }, i(this, rt)));
1034
1044
  }, oe = function() {
1035
- m(this, S, ie).call(this), m(this, S, ae).call(this, m(this, S, ne).call(this));
1045
+ v(this, O, ie).call(this), v(this, O, ae).call(this, v(this, O, ne).call(this));
1036
1046
  }, ue = function() {
1037
- r(this, mt) && (ut.clearTimeout(r(this, mt)), o(this, mt, void 0));
1047
+ i(this, mt) && (ut.clearTimeout(i(this, mt)), o(this, mt, void 0));
1038
1048
  }, he = function() {
1039
- r(this, vt) && (ut.clearInterval(r(this, vt)), o(this, vt, void 0));
1049
+ i(this, vt) && (ut.clearInterval(i(this, vt)), o(this, vt, void 0));
1040
1050
  }, ce = function() {
1041
- const t = r(this, U).getQueryCache().build(r(this, U), this.options);
1042
- if (t === r(this, v))
1051
+ const t = i(this, U).getQueryCache().build(i(this, U), this.options);
1052
+ if (t === i(this, g))
1043
1053
  return;
1044
- const s = r(this, v);
1045
- o(this, v, t), o(this, jt, t.state), this.hasListeners() && (s == null || s.removeObserver(this), t.addObserver(this));
1046
- }, Be = function(t) {
1047
- T.batch(() => {
1054
+ const s = i(this, g);
1055
+ o(this, g, t), o(this, Ut, t.state), this.hasListeners() && (s == null || s.removeObserver(this), t.addObserver(this));
1056
+ }, Ve = function(t) {
1057
+ I.batch(() => {
1048
1058
  t.listeners && this.listeners.forEach((s) => {
1049
- s(r(this, q));
1050
- }), r(this, U).getQueryCache().notify({
1051
- query: r(this, v),
1059
+ s(i(this, q));
1060
+ }), i(this, U).getQueryCache().notify({
1061
+ query: i(this, g),
1052
1062
  type: "observerResultsUpdated"
1053
1063
  });
1054
1064
  });
1055
- }, Ae);
1056
- function ys(e, t) {
1065
+ }, qe);
1066
+ function ps(e, t) {
1057
1067
  return k(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
1058
1068
  }
1059
1069
  function Pe(e, t) {
1060
- return ys(e, t) || e.state.data !== void 0 && le(e, t, t.refetchOnMount);
1070
+ return ps(e, t) || e.state.data !== void 0 && le(e, t, t.refetchOnMount);
1061
1071
  }
1062
1072
  function le(e, t, s) {
1063
1073
  if (k(t.enabled, e) !== !1 && ot(t.staleTime, e) !== "static") {
1064
- const i = typeof s == "function" ? s(e) : s;
1065
- return i === "always" || i !== !1 && ye(e, t);
1074
+ const r = typeof s == "function" ? s(e) : s;
1075
+ return r === "always" || r !== !1 && ye(e, t);
1066
1076
  }
1067
1077
  return !1;
1068
1078
  }
1069
- function Ee(e, t, s, i) {
1070
- return (e !== t || k(i.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && ye(e, s);
1079
+ function Ee(e, t, s, r) {
1080
+ return (e !== t || k(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && ye(e, s);
1071
1081
  }
1072
1082
  function ye(e, t) {
1073
1083
  return k(t.enabled, e) !== !1 && e.isStaleByTime(ot(t.staleTime, e));
1074
1084
  }
1075
- function ps(e, t) {
1085
+ function ms(e, t) {
1076
1086
  return !Yt(e.getCurrentResult(), t);
1077
1087
  }
1078
1088
  function Fe(e) {
1079
1089
  return {
1080
1090
  onFetch: (t, s) => {
1081
- var O, f, P, y, F;
1082
- const i = t.options, n = (P = (f = (O = t.fetchOptions) == null ? void 0 : O.meta) == null ? void 0 : f.fetchMore) == null ? void 0 : P.direction, a = ((y = t.state.data) == null ? void 0 : y.pages) || [], h = ((F = t.state.data) == null ? void 0 : F.pageParams) || [];
1083
- let u = { pages: [], pageParams: [] }, l = 0;
1084
- const b = async () => {
1085
- let p = !1;
1086
- const g = (E) => {
1087
- Object.defineProperty(E, "signal", {
1088
- enumerable: !0,
1089
- get: () => (t.signal.aborted ? p = !0 : t.signal.addEventListener("abort", () => {
1090
- p = !0;
1091
- }), t.signal)
1092
- });
1093
- }, w = ke(t.options, t.fetchOptions), R = async (E, d, Q) => {
1094
- if (p)
1091
+ var w, d, P, p, E;
1092
+ const r = t.options, n = (P = (d = (w = t.fetchOptions) == null ? void 0 : w.meta) == null ? void 0 : d.fetchMore) == null ? void 0 : P.direction, a = ((p = t.state.data) == null ? void 0 : p.pages) || [], h = ((E = t.state.data) == null ? void 0 : E.pageParams) || [];
1093
+ let u = { pages: [], pageParams: [] }, f = 0;
1094
+ const y = async () => {
1095
+ let m = !1;
1096
+ const b = (F) => {
1097
+ os(
1098
+ F,
1099
+ () => t.signal,
1100
+ () => m = !0
1101
+ );
1102
+ }, S = ke(t.options, t.fetchOptions), R = async (F, l, D) => {
1103
+ if (m)
1095
1104
  return Promise.reject();
1096
- if (d == null && E.pages.length)
1097
- return Promise.resolve(E);
1105
+ if (l == null && F.pages.length)
1106
+ return Promise.resolve(F);
1098
1107
  const Z = (() => {
1099
- const N = {
1108
+ const Q = {
1100
1109
  client: t.client,
1101
1110
  queryKey: t.queryKey,
1102
- pageParam: d,
1103
- direction: Q ? "backward" : "forward",
1111
+ pageParam: l,
1112
+ direction: D ? "backward" : "forward",
1104
1113
  meta: t.options.meta
1105
1114
  };
1106
- return g(N), N;
1107
- })(), I = await w(Z), { maxPages: X } = t.options, C = Q ? ns : is;
1115
+ return b(Q), Q;
1116
+ })(), A = await S(Z), { maxPages: X } = t.options, C = D ? as : ns;
1108
1117
  return {
1109
- pages: C(E.pages, I, X),
1110
- pageParams: C(E.pageParams, d, X)
1118
+ pages: C(F.pages, A, X),
1119
+ pageParams: C(F.pageParams, l, X)
1111
1120
  };
1112
1121
  };
1113
1122
  if (n && a.length) {
1114
- const E = n === "backward", d = E ? ms : Re, Q = {
1123
+ const F = n === "backward", l = F ? vs : Re, D = {
1115
1124
  pages: a,
1116
1125
  pageParams: h
1117
- }, x = d(i, Q);
1118
- u = await R(Q, x, E);
1126
+ }, j = l(r, D);
1127
+ u = await R(D, j, F);
1119
1128
  } else {
1120
- const E = e ?? a.length;
1129
+ const F = e ?? a.length;
1121
1130
  do {
1122
- const d = l === 0 ? h[0] ?? i.initialPageParam : Re(i, u);
1123
- if (l > 0 && d == null)
1131
+ const l = f === 0 ? h[0] ?? r.initialPageParam : Re(r, u);
1132
+ if (f > 0 && l == null)
1124
1133
  break;
1125
- u = await R(u, d), l++;
1126
- } while (l < E);
1134
+ u = await R(u, l), f++;
1135
+ } while (f < F);
1127
1136
  }
1128
1137
  return u;
1129
1138
  };
1130
1139
  t.options.persister ? t.fetchFn = () => {
1131
- var p, g;
1132
- return (g = (p = t.options).persister) == null ? void 0 : g.call(
1133
- p,
1134
- b,
1140
+ var m, b;
1141
+ return (b = (m = t.options).persister) == null ? void 0 : b.call(
1142
+ m,
1143
+ y,
1135
1144
  {
1136
1145
  client: t.client,
1137
1146
  queryKey: t.queryKey,
@@ -1140,32 +1149,32 @@ function Fe(e) {
1140
1149
  },
1141
1150
  s
1142
1151
  );
1143
- } : t.fetchFn = b;
1152
+ } : t.fetchFn = y;
1144
1153
  }
1145
1154
  };
1146
1155
  }
1147
1156
  function Re(e, { pages: t, pageParams: s }) {
1148
- const i = t.length - 1;
1157
+ const r = t.length - 1;
1149
1158
  return t.length > 0 ? e.getNextPageParam(
1150
- t[i],
1159
+ t[r],
1151
1160
  t,
1152
- s[i],
1161
+ s[r],
1153
1162
  s
1154
1163
  ) : void 0;
1155
1164
  }
1156
- function ms(e, { pages: t, pageParams: s }) {
1157
- var i;
1158
- return t.length > 0 ? (i = e.getPreviousPageParam) == null ? void 0 : i.call(e, t[0], t, s[0], s) : void 0;
1165
+ function vs(e, { pages: t, pageParams: s }) {
1166
+ var r;
1167
+ return t.length > 0 ? (r = e.getPreviousPageParam) == null ? void 0 : r.call(e, t[0], t, s[0], s) : void 0;
1159
1168
  }
1160
- var _t, B, A, gt, V, Y, xe, vs = (xe = class extends He {
1169
+ var _t, B, x, gt, V, Y, xe, gs = (xe = class extends Ge {
1161
1170
  constructor(t) {
1162
1171
  super();
1163
1172
  c(this, V);
1164
1173
  c(this, _t);
1165
1174
  c(this, B);
1166
- c(this, A);
1175
+ c(this, x);
1167
1176
  c(this, gt);
1168
- o(this, _t, t.client), this.mutationId = t.mutationId, o(this, A, t.mutationCache), o(this, B, []), this.state = t.state || gs(), this.setOptions(t.options), this.scheduleGc();
1177
+ o(this, _t, t.client), this.mutationId = t.mutationId, o(this, x, t.mutationCache), o(this, B, []), this.state = t.state || bs(), this.setOptions(t.options), this.scheduleGc();
1169
1178
  }
1170
1179
  setOptions(t) {
1171
1180
  this.options = t, this.updateGcTime(this.options.gcTime);
@@ -1174,163 +1183,179 @@ var _t, B, A, gt, V, Y, xe, vs = (xe = class extends He {
1174
1183
  return this.options.meta;
1175
1184
  }
1176
1185
  addObserver(t) {
1177
- r(this, B).includes(t) || (r(this, B).push(t), this.clearGcTimeout(), r(this, A).notify({
1186
+ i(this, B).includes(t) || (i(this, B).push(t), this.clearGcTimeout(), i(this, x).notify({
1178
1187
  type: "observerAdded",
1179
1188
  mutation: this,
1180
1189
  observer: t
1181
1190
  }));
1182
1191
  }
1183
1192
  removeObserver(t) {
1184
- o(this, B, r(this, B).filter((s) => s !== t)), this.scheduleGc(), r(this, A).notify({
1193
+ o(this, B, i(this, B).filter((s) => s !== t)), this.scheduleGc(), i(this, x).notify({
1185
1194
  type: "observerRemoved",
1186
1195
  mutation: this,
1187
1196
  observer: t
1188
1197
  });
1189
1198
  }
1190
1199
  optionalRemove() {
1191
- r(this, B).length || (this.state.status === "pending" ? this.scheduleGc() : r(this, A).remove(this));
1200
+ i(this, B).length || (this.state.status === "pending" ? this.scheduleGc() : i(this, x).remove(this));
1192
1201
  }
1193
1202
  continue() {
1194
1203
  var t;
1195
- return ((t = r(this, gt)) == null ? void 0 : t.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
1204
+ return ((t = i(this, gt)) == null ? void 0 : t.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
1196
1205
  this.execute(this.state.variables);
1197
1206
  }
1198
1207
  async execute(t) {
1199
- var h, u, l, b, O, f, P, y, F, p, g, w, R, E, d, Q, x, Z, I, X;
1208
+ var h, u, f, y, w, d, P, p, E, m, b, S, R, F, l, D, j, Z, A, X;
1200
1209
  const s = () => {
1201
- m(this, V, Y).call(this, { type: "continue" });
1202
- }, i = {
1203
- client: r(this, _t),
1210
+ v(this, V, Y).call(this, { type: "continue" });
1211
+ }, r = {
1212
+ client: i(this, _t),
1204
1213
  meta: this.options.meta,
1205
1214
  mutationKey: this.options.mutationKey
1206
1215
  };
1207
- o(this, gt, Le({
1208
- fn: () => this.options.mutationFn ? this.options.mutationFn(t, i) : Promise.reject(new Error("No mutationFn found")),
1209
- onFail: (C, N) => {
1210
- m(this, V, Y).call(this, { type: "failed", failureCount: C, error: N });
1216
+ o(this, gt, He({
1217
+ fn: () => this.options.mutationFn ? this.options.mutationFn(t, r) : Promise.reject(new Error("No mutationFn found")),
1218
+ onFail: (C, Q) => {
1219
+ v(this, V, Y).call(this, { type: "failed", failureCount: C, error: Q });
1211
1220
  },
1212
1221
  onPause: () => {
1213
- m(this, V, Y).call(this, { type: "pause" });
1222
+ v(this, V, Y).call(this, { type: "pause" });
1214
1223
  },
1215
1224
  onContinue: s,
1216
1225
  retry: this.options.retry ?? 0,
1217
1226
  retryDelay: this.options.retryDelay,
1218
1227
  networkMode: this.options.networkMode,
1219
- canRun: () => r(this, A).canRun(this)
1228
+ canRun: () => i(this, x).canRun(this)
1220
1229
  }));
1221
- const n = this.state.status === "pending", a = !r(this, gt).canStart();
1230
+ const n = this.state.status === "pending", a = !i(this, gt).canStart();
1222
1231
  try {
1223
1232
  if (n)
1224
1233
  s();
1225
1234
  else {
1226
- m(this, V, Y).call(this, { type: "pending", variables: t, isPaused: a }), await ((u = (h = r(this, A).config).onMutate) == null ? void 0 : u.call(
1235
+ v(this, V, Y).call(this, { type: "pending", variables: t, isPaused: a }), await ((u = (h = i(this, x).config).onMutate) == null ? void 0 : u.call(
1227
1236
  h,
1228
1237
  t,
1229
1238
  this,
1230
- i
1239
+ r
1231
1240
  ));
1232
- const N = await ((b = (l = this.options).onMutate) == null ? void 0 : b.call(
1233
- l,
1241
+ const Q = await ((y = (f = this.options).onMutate) == null ? void 0 : y.call(
1242
+ f,
1234
1243
  t,
1235
- i
1244
+ r
1236
1245
  ));
1237
- N !== this.state.context && m(this, V, Y).call(this, {
1246
+ Q !== this.state.context && v(this, V, Y).call(this, {
1238
1247
  type: "pending",
1239
- context: N,
1248
+ context: Q,
1240
1249
  variables: t,
1241
1250
  isPaused: a
1242
1251
  });
1243
1252
  }
1244
- const C = await r(this, gt).start();
1245
- return await ((f = (O = r(this, A).config).onSuccess) == null ? void 0 : f.call(
1246
- O,
1253
+ const C = await i(this, gt).start();
1254
+ return await ((d = (w = i(this, x).config).onSuccess) == null ? void 0 : d.call(
1255
+ w,
1247
1256
  C,
1248
1257
  t,
1249
1258
  this.state.context,
1250
1259
  this,
1251
- i
1252
- )), await ((y = (P = this.options).onSuccess) == null ? void 0 : y.call(
1260
+ r
1261
+ )), await ((p = (P = this.options).onSuccess) == null ? void 0 : p.call(
1253
1262
  P,
1254
1263
  C,
1255
1264
  t,
1256
1265
  this.state.context,
1257
- i
1258
- )), await ((p = (F = r(this, A).config).onSettled) == null ? void 0 : p.call(
1259
- F,
1266
+ r
1267
+ )), await ((m = (E = i(this, x).config).onSettled) == null ? void 0 : m.call(
1268
+ E,
1260
1269
  C,
1261
1270
  null,
1262
1271
  this.state.variables,
1263
1272
  this.state.context,
1264
1273
  this,
1265
- i
1266
- )), await ((w = (g = this.options).onSettled) == null ? void 0 : w.call(
1267
- g,
1274
+ r
1275
+ )), await ((S = (b = this.options).onSettled) == null ? void 0 : S.call(
1276
+ b,
1268
1277
  C,
1269
1278
  null,
1270
1279
  t,
1271
1280
  this.state.context,
1272
- i
1273
- )), m(this, V, Y).call(this, { type: "success", data: C }), C;
1281
+ r
1282
+ )), v(this, V, Y).call(this, { type: "success", data: C }), C;
1274
1283
  } catch (C) {
1275
1284
  try {
1276
- throw await ((E = (R = r(this, A).config).onError) == null ? void 0 : E.call(
1285
+ await ((F = (R = i(this, x).config).onError) == null ? void 0 : F.call(
1277
1286
  R,
1278
1287
  C,
1279
1288
  t,
1280
1289
  this.state.context,
1281
1290
  this,
1282
- i
1283
- )), await ((Q = (d = this.options).onError) == null ? void 0 : Q.call(
1284
- d,
1291
+ r
1292
+ ));
1293
+ } catch (Q) {
1294
+ Promise.reject(Q);
1295
+ }
1296
+ try {
1297
+ await ((D = (l = this.options).onError) == null ? void 0 : D.call(
1298
+ l,
1285
1299
  C,
1286
1300
  t,
1287
1301
  this.state.context,
1288
- i
1289
- )), await ((Z = (x = r(this, A).config).onSettled) == null ? void 0 : Z.call(
1290
- x,
1302
+ r
1303
+ ));
1304
+ } catch (Q) {
1305
+ Promise.reject(Q);
1306
+ }
1307
+ try {
1308
+ await ((Z = (j = i(this, x).config).onSettled) == null ? void 0 : Z.call(
1309
+ j,
1291
1310
  void 0,
1292
1311
  C,
1293
1312
  this.state.variables,
1294
1313
  this.state.context,
1295
1314
  this,
1296
- i
1297
- )), await ((X = (I = this.options).onSettled) == null ? void 0 : X.call(
1298
- I,
1315
+ r
1316
+ ));
1317
+ } catch (Q) {
1318
+ Promise.reject(Q);
1319
+ }
1320
+ try {
1321
+ await ((X = (A = this.options).onSettled) == null ? void 0 : X.call(
1322
+ A,
1299
1323
  void 0,
1300
1324
  C,
1301
1325
  t,
1302
1326
  this.state.context,
1303
- i
1304
- )), C;
1305
- } finally {
1306
- m(this, V, Y).call(this, { type: "error", error: C });
1327
+ r
1328
+ ));
1329
+ } catch (Q) {
1330
+ Promise.reject(Q);
1307
1331
  }
1332
+ throw v(this, V, Y).call(this, { type: "error", error: C }), C;
1308
1333
  } finally {
1309
- r(this, A).runNext(this);
1334
+ i(this, x).runNext(this);
1310
1335
  }
1311
1336
  }
1312
- }, _t = new WeakMap(), B = new WeakMap(), A = new WeakMap(), gt = new WeakMap(), V = new WeakSet(), Y = function(t) {
1313
- const s = (i) => {
1337
+ }, _t = new WeakMap(), B = new WeakMap(), x = new WeakMap(), gt = new WeakMap(), V = new WeakSet(), Y = function(t) {
1338
+ const s = (r) => {
1314
1339
  switch (t.type) {
1315
1340
  case "failed":
1316
1341
  return {
1317
- ...i,
1342
+ ...r,
1318
1343
  failureCount: t.failureCount,
1319
1344
  failureReason: t.error
1320
1345
  };
1321
1346
  case "pause":
1322
1347
  return {
1323
- ...i,
1348
+ ...r,
1324
1349
  isPaused: !0
1325
1350
  };
1326
1351
  case "continue":
1327
1352
  return {
1328
- ...i,
1353
+ ...r,
1329
1354
  isPaused: !1
1330
1355
  };
1331
1356
  case "pending":
1332
1357
  return {
1333
- ...i,
1358
+ ...r,
1334
1359
  context: t.context,
1335
1360
  data: void 0,
1336
1361
  failureCount: 0,
@@ -1343,7 +1368,7 @@ var _t, B, A, gt, V, Y, xe, vs = (xe = class extends He {
1343
1368
  };
1344
1369
  case "success":
1345
1370
  return {
1346
- ...i,
1371
+ ...r,
1347
1372
  data: t.data,
1348
1373
  failureCount: 0,
1349
1374
  failureReason: null,
@@ -1353,27 +1378,27 @@ var _t, B, A, gt, V, Y, xe, vs = (xe = class extends He {
1353
1378
  };
1354
1379
  case "error":
1355
1380
  return {
1356
- ...i,
1381
+ ...r,
1357
1382
  data: void 0,
1358
1383
  error: t.error,
1359
- failureCount: i.failureCount + 1,
1384
+ failureCount: r.failureCount + 1,
1360
1385
  failureReason: t.error,
1361
1386
  isPaused: !1,
1362
1387
  status: "error"
1363
1388
  };
1364
1389
  }
1365
1390
  };
1366
- this.state = s(this.state), T.batch(() => {
1367
- r(this, B).forEach((i) => {
1368
- i.onMutationUpdate(t);
1369
- }), r(this, A).notify({
1391
+ this.state = s(this.state), I.batch(() => {
1392
+ i(this, B).forEach((r) => {
1393
+ r.onMutationUpdate(t);
1394
+ }), i(this, x).notify({
1370
1395
  mutation: this,
1371
1396
  type: "updated",
1372
1397
  action: t
1373
1398
  });
1374
1399
  });
1375
1400
  }, xe);
1376
- function gs() {
1401
+ function bs() {
1377
1402
  return {
1378
1403
  context: void 0,
1379
1404
  data: void 0,
@@ -1386,7 +1411,7 @@ function gs() {
1386
1411
  submittedAt: 0
1387
1412
  };
1388
1413
  }
1389
- var J, H, kt, Ue, bs = (Ue = class extends Kt {
1414
+ var J, H, kt, je, ws = (je = class extends Kt {
1390
1415
  constructor(t = {}) {
1391
1416
  super();
1392
1417
  c(this, J);
@@ -1394,35 +1419,35 @@ var J, H, kt, Ue, bs = (Ue = class extends Kt {
1394
1419
  c(this, kt);
1395
1420
  this.config = t, o(this, J, /* @__PURE__ */ new Set()), o(this, H, /* @__PURE__ */ new Map()), o(this, kt, 0);
1396
1421
  }
1397
- build(t, s, i) {
1398
- const n = new vs({
1422
+ build(t, s, r) {
1423
+ const n = new gs({
1399
1424
  client: t,
1400
1425
  mutationCache: this,
1401
1426
  mutationId: ++Ht(this, kt)._,
1402
1427
  options: t.defaultMutationOptions(s),
1403
- state: i
1428
+ state: r
1404
1429
  });
1405
1430
  return this.add(n), n;
1406
1431
  }
1407
1432
  add(t) {
1408
- r(this, J).add(t);
1433
+ i(this, J).add(t);
1409
1434
  const s = Bt(t);
1410
1435
  if (typeof s == "string") {
1411
- const i = r(this, H).get(s);
1412
- i ? i.push(t) : r(this, H).set(s, [t]);
1436
+ const r = i(this, H).get(s);
1437
+ r ? r.push(t) : i(this, H).set(s, [t]);
1413
1438
  }
1414
1439
  this.notify({ type: "added", mutation: t });
1415
1440
  }
1416
1441
  remove(t) {
1417
- if (r(this, J).delete(t)) {
1442
+ if (i(this, J).delete(t)) {
1418
1443
  const s = Bt(t);
1419
1444
  if (typeof s == "string") {
1420
- const i = r(this, H).get(s);
1421
- if (i)
1422
- if (i.length > 1) {
1423
- const n = i.indexOf(t);
1424
- n !== -1 && i.splice(n, 1);
1425
- } else i[0] === t && r(this, H).delete(s);
1445
+ const r = i(this, H).get(s);
1446
+ if (r)
1447
+ if (r.length > 1) {
1448
+ const n = r.indexOf(t);
1449
+ n !== -1 && r.splice(n, 1);
1450
+ } else r[0] === t && i(this, H).delete(s);
1426
1451
  }
1427
1452
  }
1428
1453
  this.notify({ type: "removed", mutation: t });
@@ -1430,7 +1455,7 @@ var J, H, kt, Ue, bs = (Ue = class extends Kt {
1430
1455
  canRun(t) {
1431
1456
  const s = Bt(t);
1432
1457
  if (typeof s == "string") {
1433
- const i = r(this, H).get(s), n = i == null ? void 0 : i.find(
1458
+ const r = i(this, H).get(s), n = r == null ? void 0 : r.find(
1434
1459
  (a) => a.state.status === "pending"
1435
1460
  );
1436
1461
  return !n || n === t;
@@ -1438,35 +1463,35 @@ var J, H, kt, Ue, bs = (Ue = class extends Kt {
1438
1463
  return !0;
1439
1464
  }
1440
1465
  runNext(t) {
1441
- var i;
1466
+ var r;
1442
1467
  const s = Bt(t);
1443
1468
  if (typeof s == "string") {
1444
- const n = (i = r(this, H).get(s)) == null ? void 0 : i.find((a) => a !== t && a.state.isPaused);
1469
+ const n = (r = i(this, H).get(s)) == null ? void 0 : r.find((a) => a !== t && a.state.isPaused);
1445
1470
  return (n == null ? void 0 : n.continue()) ?? Promise.resolve();
1446
1471
  } else
1447
1472
  return Promise.resolve();
1448
1473
  }
1449
1474
  clear() {
1450
- T.batch(() => {
1451
- r(this, J).forEach((t) => {
1475
+ I.batch(() => {
1476
+ i(this, J).forEach((t) => {
1452
1477
  this.notify({ type: "removed", mutation: t });
1453
- }), r(this, J).clear(), r(this, H).clear();
1478
+ }), i(this, J).clear(), i(this, H).clear();
1454
1479
  });
1455
1480
  }
1456
1481
  getAll() {
1457
- return Array.from(r(this, J));
1482
+ return Array.from(i(this, J));
1458
1483
  }
1459
1484
  find(t) {
1460
1485
  const s = { exact: !0, ...t };
1461
1486
  return this.getAll().find(
1462
- (i) => be(s, i)
1487
+ (r) => be(s, r)
1463
1488
  );
1464
1489
  }
1465
1490
  findAll(t = {}) {
1466
1491
  return this.getAll().filter((s) => be(t, s));
1467
1492
  }
1468
1493
  notify(t) {
1469
- T.batch(() => {
1494
+ I.batch(() => {
1470
1495
  this.listeners.forEach((s) => {
1471
1496
  s(t);
1472
1497
  });
@@ -1474,90 +1499,90 @@ var J, H, kt, Ue, bs = (Ue = class extends Kt {
1474
1499
  }
1475
1500
  resumePausedMutations() {
1476
1501
  const t = this.getAll().filter((s) => s.state.isPaused);
1477
- return T.batch(
1502
+ return I.batch(
1478
1503
  () => Promise.all(
1479
- t.map((s) => s.continue().catch(j))
1504
+ t.map((s) => s.continue().catch(N))
1480
1505
  )
1481
1506
  );
1482
1507
  }
1483
- }, J = new WeakMap(), H = new WeakMap(), kt = new WeakMap(), Ue);
1508
+ }, J = new WeakMap(), H = new WeakMap(), kt = new WeakMap(), je);
1484
1509
  function Bt(e) {
1485
1510
  var t;
1486
1511
  return (t = e.options.scope) == null ? void 0 : t.id;
1487
1512
  }
1488
- var z, je, ws = (je = class extends Kt {
1513
+ var z, Ue, Ss = (Ue = class extends Kt {
1489
1514
  constructor(t = {}) {
1490
1515
  super();
1491
1516
  c(this, z);
1492
1517
  this.config = t, o(this, z, /* @__PURE__ */ new Map());
1493
1518
  }
1494
- build(t, s, i) {
1519
+ build(t, s, r) {
1495
1520
  const n = s.queryKey, a = s.queryHash ?? de(n, s);
1496
1521
  let h = this.get(a);
1497
- return h || (h = new ds({
1522
+ return h || (h = new fs({
1498
1523
  client: t,
1499
1524
  queryKey: n,
1500
1525
  queryHash: a,
1501
1526
  options: t.defaultQueryOptions(s),
1502
- state: i,
1527
+ state: r,
1503
1528
  defaultOptions: t.getQueryDefaults(n)
1504
1529
  }), this.add(h)), h;
1505
1530
  }
1506
1531
  add(t) {
1507
- r(this, z).has(t.queryHash) || (r(this, z).set(t.queryHash, t), this.notify({
1532
+ i(this, z).has(t.queryHash) || (i(this, z).set(t.queryHash, t), this.notify({
1508
1533
  type: "added",
1509
1534
  query: t
1510
1535
  }));
1511
1536
  }
1512
1537
  remove(t) {
1513
- const s = r(this, z).get(t.queryHash);
1514
- s && (t.destroy(), s === t && r(this, z).delete(t.queryHash), this.notify({ type: "removed", query: t }));
1538
+ const s = i(this, z).get(t.queryHash);
1539
+ s && (t.destroy(), s === t && i(this, z).delete(t.queryHash), this.notify({ type: "removed", query: t }));
1515
1540
  }
1516
1541
  clear() {
1517
- T.batch(() => {
1542
+ I.batch(() => {
1518
1543
  this.getAll().forEach((t) => {
1519
1544
  this.remove(t);
1520
1545
  });
1521
1546
  });
1522
1547
  }
1523
1548
  get(t) {
1524
- return r(this, z).get(t);
1549
+ return i(this, z).get(t);
1525
1550
  }
1526
1551
  getAll() {
1527
- return [...r(this, z).values()];
1552
+ return [...i(this, z).values()];
1528
1553
  }
1529
1554
  find(t) {
1530
1555
  const s = { exact: !0, ...t };
1531
1556
  return this.getAll().find(
1532
- (i) => ge(s, i)
1557
+ (r) => ge(s, r)
1533
1558
  );
1534
1559
  }
1535
1560
  findAll(t = {}) {
1536
1561
  const s = this.getAll();
1537
- return Object.keys(t).length > 0 ? s.filter((i) => ge(t, i)) : s;
1562
+ return Object.keys(t).length > 0 ? s.filter((r) => ge(t, r)) : s;
1538
1563
  }
1539
1564
  notify(t) {
1540
- T.batch(() => {
1565
+ I.batch(() => {
1541
1566
  this.listeners.forEach((s) => {
1542
1567
  s(t);
1543
1568
  });
1544
1569
  });
1545
1570
  }
1546
1571
  onFocus() {
1547
- T.batch(() => {
1572
+ I.batch(() => {
1548
1573
  this.getAll().forEach((t) => {
1549
1574
  t.onFocus();
1550
1575
  });
1551
1576
  });
1552
1577
  }
1553
1578
  onOnline() {
1554
- T.batch(() => {
1579
+ I.batch(() => {
1555
1580
  this.getAll().forEach((t) => {
1556
1581
  t.onOnline();
1557
1582
  });
1558
1583
  });
1559
1584
  }
1560
- }, z = new WeakMap(), je), M, it, nt, Qt, Dt, at, Tt, It, Ne, Cs = (Ne = class {
1585
+ }, z = new WeakMap(), Ue), M, it, nt, Qt, Dt, at, Tt, It, Ne, Cs = (Ne = class {
1561
1586
  constructor(e = {}) {
1562
1587
  c(this, M);
1563
1588
  c(this, it);
@@ -1567,24 +1592,24 @@ var z, je, ws = (je = class extends Kt {
1567
1592
  c(this, at);
1568
1593
  c(this, Tt);
1569
1594
  c(this, It);
1570
- o(this, M, e.queryCache || new ws()), o(this, it, e.mutationCache || new bs()), o(this, nt, e.defaultOptions || {}), o(this, Qt, /* @__PURE__ */ new Map()), o(this, Dt, /* @__PURE__ */ new Map()), o(this, at, 0);
1595
+ o(this, M, e.queryCache || new Ss()), o(this, it, e.mutationCache || new ws()), o(this, nt, e.defaultOptions || {}), o(this, Qt, /* @__PURE__ */ new Map()), o(this, Dt, /* @__PURE__ */ new Map()), o(this, at, 0);
1571
1596
  }
1572
1597
  mount() {
1573
- Ht(this, at)._++, r(this, at) === 1 && (o(this, Tt, fe.subscribe(async (e) => {
1574
- e && (await this.resumePausedMutations(), r(this, M).onFocus());
1598
+ Ht(this, at)._++, i(this, at) === 1 && (o(this, Tt, fe.subscribe(async (e) => {
1599
+ e && (await this.resumePausedMutations(), i(this, M).onFocus());
1575
1600
  })), o(this, It, $t.subscribe(async (e) => {
1576
- e && (await this.resumePausedMutations(), r(this, M).onOnline());
1601
+ e && (await this.resumePausedMutations(), i(this, M).onOnline());
1577
1602
  })));
1578
1603
  }
1579
1604
  unmount() {
1580
1605
  var e, t;
1581
- Ht(this, at)._--, r(this, at) === 0 && ((e = r(this, Tt)) == null || e.call(this), o(this, Tt, void 0), (t = r(this, It)) == null || t.call(this), o(this, It, void 0));
1606
+ Ht(this, at)._--, i(this, at) === 0 && ((e = i(this, Tt)) == null || e.call(this), o(this, Tt, void 0), (t = i(this, It)) == null || t.call(this), o(this, It, void 0));
1582
1607
  }
1583
1608
  isFetching(e) {
1584
- return r(this, M).findAll({ ...e, fetchStatus: "fetching" }).length;
1609
+ return i(this, M).findAll({ ...e, fetchStatus: "fetching" }).length;
1585
1610
  }
1586
1611
  isMutating(e) {
1587
- return r(this, it).findAll({ ...e, status: "pending" }).length;
1612
+ return i(this, it).findAll({ ...e, status: "pending" }).length;
1588
1613
  }
1589
1614
  /**
1590
1615
  * Imperative (non-reactive) way to retrieve data for a QueryKey.
@@ -1596,52 +1621,52 @@ var z, je, ws = (je = class extends Kt {
1596
1621
  getQueryData(e) {
1597
1622
  var s;
1598
1623
  const t = this.defaultQueryOptions({ queryKey: e });
1599
- return (s = r(this, M).get(t.queryHash)) == null ? void 0 : s.state.data;
1624
+ return (s = i(this, M).get(t.queryHash)) == null ? void 0 : s.state.data;
1600
1625
  }
1601
1626
  ensureQueryData(e) {
1602
- const t = this.defaultQueryOptions(e), s = r(this, M).build(this, t), i = s.state.data;
1603
- return i === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && s.isStaleByTime(ot(t.staleTime, s)) && this.prefetchQuery(t), Promise.resolve(i));
1627
+ const t = this.defaultQueryOptions(e), s = i(this, M).build(this, t), r = s.state.data;
1628
+ return r === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && s.isStaleByTime(ot(t.staleTime, s)) && this.prefetchQuery(t), Promise.resolve(r));
1604
1629
  }
1605
1630
  getQueriesData(e) {
1606
- return r(this, M).findAll(e).map(({ queryKey: t, state: s }) => {
1607
- const i = s.data;
1608
- return [t, i];
1631
+ return i(this, M).findAll(e).map(({ queryKey: t, state: s }) => {
1632
+ const r = s.data;
1633
+ return [t, r];
1609
1634
  });
1610
1635
  }
1611
1636
  setQueryData(e, t, s) {
1612
- const i = this.defaultQueryOptions({ queryKey: e }), n = r(this, M).get(
1613
- i.queryHash
1614
- ), a = n == null ? void 0 : n.state.data, h = es(t, a);
1637
+ const r = this.defaultQueryOptions({ queryKey: e }), n = i(this, M).get(
1638
+ r.queryHash
1639
+ ), a = n == null ? void 0 : n.state.data, h = ss(t, a);
1615
1640
  if (h !== void 0)
1616
- return r(this, M).build(this, i).setData(h, { ...s, manual: !0 });
1641
+ return i(this, M).build(this, r).setData(h, { ...s, manual: !0 });
1617
1642
  }
1618
1643
  setQueriesData(e, t, s) {
1619
- return T.batch(
1620
- () => r(this, M).findAll(e).map(({ queryKey: i }) => [
1621
- i,
1622
- this.setQueryData(i, t, s)
1644
+ return I.batch(
1645
+ () => i(this, M).findAll(e).map(({ queryKey: r }) => [
1646
+ r,
1647
+ this.setQueryData(r, t, s)
1623
1648
  ])
1624
1649
  );
1625
1650
  }
1626
1651
  getQueryState(e) {
1627
1652
  var s;
1628
1653
  const t = this.defaultQueryOptions({ queryKey: e });
1629
- return (s = r(this, M).get(
1654
+ return (s = i(this, M).get(
1630
1655
  t.queryHash
1631
1656
  )) == null ? void 0 : s.state;
1632
1657
  }
1633
1658
  removeQueries(e) {
1634
- const t = r(this, M);
1635
- T.batch(() => {
1659
+ const t = i(this, M);
1660
+ I.batch(() => {
1636
1661
  t.findAll(e).forEach((s) => {
1637
1662
  t.remove(s);
1638
1663
  });
1639
1664
  });
1640
1665
  }
1641
1666
  resetQueries(e, t) {
1642
- const s = r(this, M);
1643
- return T.batch(() => (s.findAll(e).forEach((i) => {
1644
- i.reset();
1667
+ const s = i(this, M);
1668
+ return I.batch(() => (s.findAll(e).forEach((r) => {
1669
+ r.reset();
1645
1670
  }), this.refetchQueries(
1646
1671
  {
1647
1672
  type: "active",
@@ -1651,13 +1676,13 @@ var z, je, ws = (je = class extends Kt {
1651
1676
  )));
1652
1677
  }
1653
1678
  cancelQueries(e, t = {}) {
1654
- const s = { revert: !0, ...t }, i = T.batch(
1655
- () => r(this, M).findAll(e).map((n) => n.cancel(s))
1679
+ const s = { revert: !0, ...t }, r = I.batch(
1680
+ () => i(this, M).findAll(e).map((n) => n.cancel(s))
1656
1681
  );
1657
- return Promise.all(i).then(j).catch(j);
1682
+ return Promise.all(r).then(N).catch(N);
1658
1683
  }
1659
1684
  invalidateQueries(e, t = {}) {
1660
- return T.batch(() => (r(this, M).findAll(e).forEach((s) => {
1685
+ return I.batch(() => (i(this, M).findAll(e).forEach((s) => {
1661
1686
  s.invalidate();
1662
1687
  }), (e == null ? void 0 : e.refetchType) === "none" ? Promise.resolve() : this.refetchQueries(
1663
1688
  {
@@ -1671,78 +1696,78 @@ var z, je, ws = (je = class extends Kt {
1671
1696
  const s = {
1672
1697
  ...t,
1673
1698
  cancelRefetch: t.cancelRefetch ?? !0
1674
- }, i = T.batch(
1675
- () => r(this, M).findAll(e).filter((n) => !n.isDisabled() && !n.isStatic()).map((n) => {
1699
+ }, r = I.batch(
1700
+ () => i(this, M).findAll(e).filter((n) => !n.isDisabled() && !n.isStatic()).map((n) => {
1676
1701
  let a = n.fetch(void 0, s);
1677
- return s.throwOnError || (a = a.catch(j)), n.state.fetchStatus === "paused" ? Promise.resolve() : a;
1702
+ return s.throwOnError || (a = a.catch(N)), n.state.fetchStatus === "paused" ? Promise.resolve() : a;
1678
1703
  })
1679
1704
  );
1680
- return Promise.all(i).then(j);
1705
+ return Promise.all(r).then(N);
1681
1706
  }
1682
1707
  fetchQuery(e) {
1683
1708
  const t = this.defaultQueryOptions(e);
1684
1709
  t.retry === void 0 && (t.retry = !1);
1685
- const s = r(this, M).build(this, t);
1710
+ const s = i(this, M).build(this, t);
1686
1711
  return s.isStaleByTime(
1687
1712
  ot(t.staleTime, s)
1688
1713
  ) ? s.fetch(t) : Promise.resolve(s.state.data);
1689
1714
  }
1690
1715
  prefetchQuery(e) {
1691
- return this.fetchQuery(e).then(j).catch(j);
1716
+ return this.fetchQuery(e).then(N).catch(N);
1692
1717
  }
1693
1718
  fetchInfiniteQuery(e) {
1694
1719
  return e.behavior = Fe(e.pages), this.fetchQuery(e);
1695
1720
  }
1696
1721
  prefetchInfiniteQuery(e) {
1697
- return this.fetchInfiniteQuery(e).then(j).catch(j);
1722
+ return this.fetchInfiniteQuery(e).then(N).catch(N);
1698
1723
  }
1699
1724
  ensureInfiniteQueryData(e) {
1700
1725
  return e.behavior = Fe(e.pages), this.ensureQueryData(e);
1701
1726
  }
1702
1727
  resumePausedMutations() {
1703
- return $t.isOnline() ? r(this, it).resumePausedMutations() : Promise.resolve();
1728
+ return $t.isOnline() ? i(this, it).resumePausedMutations() : Promise.resolve();
1704
1729
  }
1705
1730
  getQueryCache() {
1706
- return r(this, M);
1731
+ return i(this, M);
1707
1732
  }
1708
1733
  getMutationCache() {
1709
- return r(this, it);
1734
+ return i(this, it);
1710
1735
  }
1711
1736
  getDefaultOptions() {
1712
- return r(this, nt);
1737
+ return i(this, nt);
1713
1738
  }
1714
1739
  setDefaultOptions(e) {
1715
1740
  o(this, nt, e);
1716
1741
  }
1717
1742
  setQueryDefaults(e, t) {
1718
- r(this, Qt).set(At(e), {
1743
+ i(this, Qt).set(qt(e), {
1719
1744
  queryKey: e,
1720
1745
  defaultOptions: t
1721
1746
  });
1722
1747
  }
1723
1748
  getQueryDefaults(e) {
1724
- const t = [...r(this, Qt).values()], s = {};
1725
- return t.forEach((i) => {
1726
- xt(e, i.queryKey) && Object.assign(s, i.defaultOptions);
1749
+ const t = [...i(this, Qt).values()], s = {};
1750
+ return t.forEach((r) => {
1751
+ xt(e, r.queryKey) && Object.assign(s, r.defaultOptions);
1727
1752
  }), s;
1728
1753
  }
1729
1754
  setMutationDefaults(e, t) {
1730
- r(this, Dt).set(At(e), {
1755
+ i(this, Dt).set(qt(e), {
1731
1756
  mutationKey: e,
1732
1757
  defaultOptions: t
1733
1758
  });
1734
1759
  }
1735
1760
  getMutationDefaults(e) {
1736
- const t = [...r(this, Dt).values()], s = {};
1737
- return t.forEach((i) => {
1738
- xt(e, i.mutationKey) && Object.assign(s, i.defaultOptions);
1761
+ const t = [...i(this, Dt).values()], s = {};
1762
+ return t.forEach((r) => {
1763
+ xt(e, r.mutationKey) && Object.assign(s, r.defaultOptions);
1739
1764
  }), s;
1740
1765
  }
1741
1766
  defaultQueryOptions(e) {
1742
1767
  if (e._defaulted)
1743
1768
  return e;
1744
1769
  const t = {
1745
- ...r(this, nt).queries,
1770
+ ...i(this, nt).queries,
1746
1771
  ...this.getQueryDefaults(e.queryKey),
1747
1772
  ...e,
1748
1773
  _defaulted: !0
@@ -1754,30 +1779,30 @@ var z, je, ws = (je = class extends Kt {
1754
1779
  }
1755
1780
  defaultMutationOptions(e) {
1756
1781
  return e != null && e._defaulted ? e : {
1757
- ...r(this, nt).mutations,
1782
+ ...i(this, nt).mutations,
1758
1783
  ...(e == null ? void 0 : e.mutationKey) && this.getMutationDefaults(e.mutationKey),
1759
1784
  ...e,
1760
1785
  _defaulted: !0
1761
1786
  };
1762
1787
  }
1763
1788
  clear() {
1764
- r(this, M).clear(), r(this, it).clear();
1789
+ i(this, M).clear(), i(this, it).clear();
1765
1790
  }
1766
- }, M = new WeakMap(), it = new WeakMap(), nt = new WeakMap(), Qt = new WeakMap(), Dt = new WeakMap(), at = new WeakMap(), Tt = new WeakMap(), It = new WeakMap(), Ne), Ve = K.createContext(
1791
+ }, M = new WeakMap(), it = new WeakMap(), nt = new WeakMap(), Qt = new WeakMap(), Dt = new WeakMap(), at = new WeakMap(), Tt = new WeakMap(), It = new WeakMap(), Ne), ze = K.createContext(
1767
1792
  void 0
1768
- ), Ss = (e) => {
1769
- const t = K.useContext(Ve);
1793
+ ), Os = (e) => {
1794
+ const t = K.useContext(ze);
1770
1795
  if (!t)
1771
1796
  throw new Error("No QueryClient set, use QueryClientProvider to set one");
1772
1797
  return t;
1773
- }, Os = ({
1798
+ }, Ps = ({
1774
1799
  client: e,
1775
1800
  children: t
1776
1801
  }) => (K.useEffect(() => (e.mount(), () => {
1777
1802
  e.unmount();
1778
- }), [e]), /* @__PURE__ */ Vt(Ve.Provider, { value: e, children: t })), ze = K.createContext(!1), Ps = () => K.useContext(ze);
1779
- ze.Provider;
1780
- function Es() {
1803
+ }), [e]), /* @__PURE__ */ Vt(ze.Provider, { value: e, children: t })), $e = K.createContext(!1), Es = () => K.useContext($e);
1804
+ $e.Provider;
1805
+ function Fs() {
1781
1806
  let e = !1;
1782
1807
  return {
1783
1808
  clearReset: () => {
@@ -1789,92 +1814,95 @@ function Es() {
1789
1814
  isReset: () => e
1790
1815
  };
1791
1816
  }
1792
- var Fs = K.createContext(Es()), Rs = () => K.useContext(Fs), Ms = (e, t) => {
1793
- (e.suspense || e.throwOnError || e.experimental_prefetchInRender) && (t.isReset() || (e.retryOnMount = !1));
1794
- }, Qs = (e) => {
1817
+ var Rs = K.createContext(Fs()), Ms = () => K.useContext(Rs), Qs = (e, t, s) => {
1818
+ const r = s != null && s.state.error && typeof e.throwOnError == "function" ? Ke(e.throwOnError, [s.state.error, s]) : e.throwOnError;
1819
+ (e.suspense || e.experimental_prefetchInRender || r) && (t.isReset() || (e.retryOnMount = !1));
1820
+ }, Ds = (e) => {
1795
1821
  K.useEffect(() => {
1796
1822
  e.clearReset();
1797
1823
  }, [e]);
1798
- }, Ds = ({
1824
+ }, Ts = ({
1799
1825
  result: e,
1800
1826
  errorResetBoundary: t,
1801
1827
  throwOnError: s,
1802
- query: i,
1828
+ query: r,
1803
1829
  suspense: n
1804
- }) => e.isError && !t.isReset() && !e.isFetching && i && (n && e.data === void 0 || as(s, [e.error, i])), Ts = (e) => {
1830
+ }) => e.isError && !t.isReset() && !e.isFetching && r && (n && e.data === void 0 || Ke(s, [e.error, r])), Is = (e) => {
1805
1831
  if (e.suspense) {
1806
- const s = (n) => n === "static" ? n : Math.max(n ?? 1e3, 1e3), i = e.staleTime;
1807
- e.staleTime = typeof i == "function" ? (...n) => s(i(...n)) : s(i), typeof e.gcTime == "number" && (e.gcTime = Math.max(
1832
+ const s = (n) => n === "static" ? n : Math.max(n ?? 1e3, 1e3), r = e.staleTime;
1833
+ e.staleTime = typeof r == "function" ? (...n) => s(r(...n)) : s(r), typeof e.gcTime == "number" && (e.gcTime = Math.max(
1808
1834
  e.gcTime,
1809
1835
  1e3
1810
1836
  ));
1811
1837
  }
1812
- }, Is = (e, t) => e.isLoading && e.isFetching && !t, qs = (e, t) => (e == null ? void 0 : e.suspense) && t.isPending, Me = (e, t, s) => t.fetchOptimistic(e).catch(() => {
1838
+ }, As = (e, t) => e.isLoading && e.isFetching && !t, qs = (e, t) => (e == null ? void 0 : e.suspense) && t.isPending, Me = (e, t, s) => t.fetchOptimistic(e).catch(() => {
1813
1839
  s.clearReset();
1814
1840
  });
1815
- function As(e, t, s) {
1816
- var f, P, y, F, p;
1841
+ function xs(e, t, s) {
1842
+ var P, p, E, m;
1817
1843
  if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
1818
1844
  throw new Error(
1819
1845
  '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'
1820
1846
  );
1821
- const i = Ps(), n = Rs(), a = Ss(), h = a.defaultQueryOptions(e);
1822
- (P = (f = a.getDefaultOptions().queries) == null ? void 0 : f._experimental_beforeQuery) == null || P.call(
1823
- f,
1847
+ const r = Es(), n = Ms(), a = Os(), h = a.defaultQueryOptions(e);
1848
+ (p = (P = a.getDefaultOptions().queries) == null ? void 0 : P._experimental_beforeQuery) == null || p.call(
1849
+ P,
1824
1850
  h
1825
- ), process.env.NODE_ENV !== "production" && (h.queryFn || console.error(
1851
+ );
1852
+ const u = a.getQueryCache().get(h.queryHash);
1853
+ process.env.NODE_ENV !== "production" && (h.queryFn || console.error(
1826
1854
  `[${h.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`
1827
- )), h._optimisticResults = i ? "isRestoring" : "optimistic", Ts(h), Ms(h, n), Qs(n);
1828
- const u = !a.getQueryCache().get(h.queryHash), [l] = K.useState(
1855
+ )), h._optimisticResults = r ? "isRestoring" : "optimistic", Is(h), Qs(h, n, u), Ds(n);
1856
+ const f = !a.getQueryCache().get(h.queryHash), [y] = K.useState(
1829
1857
  () => new t(
1830
1858
  a,
1831
1859
  h
1832
1860
  )
1833
- ), b = l.getOptimisticResult(h), O = !i && e.subscribed !== !1;
1861
+ ), w = y.getOptimisticResult(h), d = !r && e.subscribed !== !1;
1834
1862
  if (K.useSyncExternalStore(
1835
1863
  K.useCallback(
1836
- (g) => {
1837
- const w = O ? l.subscribe(T.batchCalls(g)) : j;
1838
- return l.updateResult(), w;
1864
+ (b) => {
1865
+ const S = d ? y.subscribe(I.batchCalls(b)) : N;
1866
+ return y.updateResult(), S;
1839
1867
  },
1840
- [l, O]
1868
+ [y, d]
1841
1869
  ),
1842
- () => l.getCurrentResult(),
1843
- () => l.getCurrentResult()
1870
+ () => y.getCurrentResult(),
1871
+ () => y.getCurrentResult()
1844
1872
  ), K.useEffect(() => {
1845
- l.setOptions(h);
1846
- }, [h, l]), qs(h, b))
1847
- throw Me(h, l, n);
1848
- if (Ds({
1849
- result: b,
1873
+ y.setOptions(h);
1874
+ }, [h, y]), qs(h, w))
1875
+ throw Me(h, y, n);
1876
+ if (Ts({
1877
+ result: w,
1850
1878
  errorResetBoundary: n,
1851
1879
  throwOnError: h.throwOnError,
1852
- query: a.getQueryCache().get(h.queryHash),
1880
+ query: u,
1853
1881
  suspense: h.suspense
1854
1882
  }))
1855
- throw b.error;
1856
- if ((F = (y = a.getDefaultOptions().queries) == null ? void 0 : y._experimental_afterQuery) == null || F.call(
1857
- y,
1883
+ throw w.error;
1884
+ if ((m = (E = a.getDefaultOptions().queries) == null ? void 0 : E._experimental_afterQuery) == null || m.call(
1885
+ E,
1858
1886
  h,
1859
- b
1860
- ), h.experimental_prefetchInRender && !bt && Is(b, i)) {
1861
- const g = u ? (
1887
+ w
1888
+ ), h.experimental_prefetchInRender && !bt && As(w, r)) {
1889
+ const b = f ? (
1862
1890
  // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1863
- Me(h, l, n)
1891
+ Me(h, y, n)
1864
1892
  ) : (
1865
1893
  // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1866
- (p = a.getQueryCache().get(h.queryHash)) == null ? void 0 : p.promise
1894
+ u == null ? void 0 : u.promise
1867
1895
  );
1868
- g == null || g.catch(j).finally(() => {
1869
- l.updateResult();
1896
+ b == null || b.catch(N).finally(() => {
1897
+ y.updateResult();
1870
1898
  });
1871
1899
  }
1872
- return h.notifyOnChangeProps ? b : l.trackResult(b);
1900
+ return h.notifyOnChangeProps ? w : y.trackResult(w);
1873
1901
  }
1874
- function xs(e, t) {
1875
- return As(e, fs);
1902
+ function js(e, t) {
1903
+ return xs(e, ys);
1876
1904
  }
1877
- const Us = $e(void 0), js = new Cs({
1905
+ const Us = We(void 0), Ns = new Cs({
1878
1906
  defaultOptions: {
1879
1907
  queries: {
1880
1908
  retry: 1,
@@ -1884,19 +1912,19 @@ const Us = $e(void 0), js = new Cs({
1884
1912
  }
1885
1913
  }
1886
1914
  });
1887
- function Ns({
1915
+ function _s({
1888
1916
  fetchSchedule: e,
1889
1917
  initialSchedule: t = [],
1890
1918
  weeks: s,
1891
- handleDateChanged: i = () => !0,
1919
+ handleDateChanged: r = () => !0,
1892
1920
  children: n
1893
1921
  }) {
1894
- const [a, h] = me(s[0][0].date), [u, l] = me(!1), b = We(Jt(s[0][0].date, "yyyy-MM-dd"));
1922
+ const [a, h] = me(s[0][0].date), [u, f] = me(!1), y = Je(Jt(s[0][0].date, "yyyy-MM-dd"));
1895
1923
  Gt.setComponent("ScheduleContext"), Gt.log("ScheduleProvider initialized with date: ", a);
1896
- const O = Je((w) => {
1897
- const R = Jt(w, "yyyy-MM-dd");
1898
- R !== b.current && (l(!0), b.current = R), h(w), i(w);
1899
- }, [i]), { data: f, isLoading: P, isFetching: y, isError: F, error: p } = xs({
1924
+ const w = Ze((S) => {
1925
+ const R = Jt(S, "yyyy-MM-dd");
1926
+ R !== y.current && (f(!0), y.current = R), h(S), r(S);
1927
+ }, [r]), { data: d, isLoading: P, isFetching: p, isError: E, error: m } = js({
1900
1928
  queryKey: ["schedule", Jt(a, "yyyy-MM-dd")],
1901
1929
  queryFn: () => e(a),
1902
1930
  staleTime: 1e3 * 60 * 15,
@@ -1904,32 +1932,32 @@ function Ns({
1904
1932
  retry: 1
1905
1933
  });
1906
1934
  ve(() => {
1907
- if (f !== void 0 && u)
1908
- if (!y) {
1935
+ if (d !== void 0 && u)
1936
+ if (!p) {
1909
1937
  const R = setTimeout(() => {
1910
- l(!1);
1938
+ f(!1);
1911
1939
  }, 500);
1912
1940
  return () => clearTimeout(R);
1913
1941
  } else
1914
- l(!1);
1915
- }, [f, u, y]), ve(() => {
1916
- F && (Gt.log("Error fetching schedule for date:", a), Gt.log("Error detials: ", p));
1917
- }, [a, F, p]);
1918
- const g = Ze(() => ({
1919
- schedule: f ?? t,
1942
+ f(!1);
1943
+ }, [d, u, p]), ve(() => {
1944
+ E && (Gt.log("Error fetching schedule for date:", a), Gt.log("Error detials: ", m));
1945
+ }, [a, E, m]);
1946
+ const b = Xe(() => ({
1947
+ schedule: d ?? t,
1920
1948
  weeks: s,
1921
1949
  currentDate: a,
1922
1950
  isLoading: P || u,
1923
- isError: F,
1924
- setCurrentDate: O
1925
- }), [f, t, s, a, P, u, F, O]);
1926
- return /* @__PURE__ */ Vt(Us.Provider, { value: g, children: n });
1951
+ isError: E,
1952
+ setCurrentDate: w
1953
+ }), [d, t, s, a, P, u, E, w]);
1954
+ return /* @__PURE__ */ Vt(Us.Provider, { value: b, children: n });
1927
1955
  }
1928
- function Gs(e) {
1929
- return /* @__PURE__ */ Vt(Os, { client: js, children: /* @__PURE__ */ Vt(Ns, { ...e }) });
1956
+ function Bs(e) {
1957
+ return /* @__PURE__ */ Vt(Ps, { client: Ns, children: /* @__PURE__ */ Vt(_s, { ...e }) });
1930
1958
  }
1931
1959
  export {
1932
1960
  Us as ScheduleContext,
1933
- Gs as ScheduleProvider,
1934
- Gs as default
1961
+ Bs as ScheduleProvider,
1962
+ Bs as default
1935
1963
  };