@gen-epix/ui-client-common 4.8.0 → 4.10.0

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 (87) hide show
  1. package/dist/@types/mui.d.ts +2 -0
  2. package/dist/_chunks/CrudPage.js +3 -3
  3. package/dist/_chunks/CrudPage.js.map +1 -1
  4. package/dist/_chunks/GeoFilter.js +1 -1
  5. package/dist/_chunks/QueryClientProvider.js +1 -1
  6. package/dist/_chunks/QueryClientProvider.js.map +1 -1
  7. package/dist/_chunks/QueryClientService.js +39 -35
  8. package/dist/_chunks/QueryClientService.js.map +1 -1
  9. package/dist/_chunks/Table.js +602 -582
  10. package/dist/_chunks/Table.js.map +1 -1
  11. package/dist/_chunks/TableUtil.js +1668 -1659
  12. package/dist/_chunks/TableUtil.js.map +1 -1
  13. package/dist/_chunks/TextFilter.js +41 -32
  14. package/dist/_chunks/TextFilter.js.map +1 -1
  15. package/dist/_chunks/UserInvitationsAdminPage.js +3 -3
  16. package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
  17. package/dist/_chunks/{_cacheHas.js → _arrayIncludesWith.js} +17 -17
  18. package/dist/_chunks/_arrayIncludesWith.js.map +1 -0
  19. package/dist/_chunks/{isArrayLike.js → _arrayMap.js} +94 -94
  20. package/dist/_chunks/_arrayMap.js.map +1 -0
  21. package/dist/_chunks/_baseGet.js +61 -61
  22. package/dist/_chunks/_baseGet.js.map +1 -1
  23. package/dist/_chunks/_baseIteratee.js +28 -28
  24. package/dist/_chunks/_baseIteratee.js.map +1 -1
  25. package/dist/_chunks/_setToString.js +7 -7
  26. package/dist/_chunks/_setToString.js.map +1 -1
  27. package/dist/_chunks/middleware.js +1 -1
  28. package/dist/_chunks/middleware.js.map +1 -1
  29. package/dist/_chunks/omit.js +74 -58
  30. package/dist/_chunks/omit.js.map +1 -1
  31. package/dist/_chunks/query.js +264 -262
  32. package/dist/_chunks/query.js.map +1 -1
  33. package/dist/_chunks/react.js +1 -1
  34. package/dist/_chunks/react.js.map +1 -1
  35. package/dist/_chunks/tableStore.js +46 -21
  36. package/dist/_chunks/tableStore.js.map +1 -1
  37. package/dist/_chunks/uniq.js +2 -2
  38. package/dist/_chunks/uniq.js.map +1 -1
  39. package/dist/_chunks/useMutation.js +17 -17
  40. package/dist/_chunks/useMutation.js.map +1 -1
  41. package/dist/_chunks/useQueryMemo.js +103 -103
  42. package/dist/_chunks/useQueryMemo.js.map +1 -1
  43. package/dist/_chunks/vanilla.js +1 -1
  44. package/dist/_chunks/vanilla.js.map +1 -1
  45. package/dist/_chunks/yup.js +2 -2
  46. package/dist/_chunks/yup.js.map +1 -1
  47. package/dist/classes/filters/MultiSelectFilter.d.ts +8 -6
  48. package/dist/classes/services/EmotionCacheService/index.js +3 -1
  49. package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
  50. package/dist/components/app/App/index.js +1 -1
  51. package/dist/components/app/App/index.js.map +1 -1
  52. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +1 -1
  53. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
  54. package/dist/components/ui/ApplicationBar/index.js +2 -0
  55. package/dist/components/ui/ApplicationBar/index.js.map +1 -1
  56. package/dist/components/ui/GenericErrorMessage/index.js +1 -0
  57. package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
  58. package/dist/components/ui/OrganizationSwitcherDialog/index.js +1 -1
  59. package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
  60. package/dist/components/ui/Sidebar/index.js +1 -1
  61. package/dist/components/ui/Sidebar/index.js.map +1 -1
  62. package/dist/components/ui/Table/Table.d.ts +4 -0
  63. package/dist/dataHooks/useSitesQuery/index.d.ts +1 -0
  64. package/dist/dataHooks/useSitesQuery/index.js +18 -0
  65. package/dist/dataHooks/useSitesQuery/index.js.map +1 -0
  66. package/dist/dataHooks/useSitesQuery/useSitesQuery.d.ts +5 -0
  67. package/dist/locale/en.json +2 -0
  68. package/dist/locale/nl.json +2 -0
  69. package/dist/models/table.models.d.ts +1 -1
  70. package/dist/models/table.models.js.map +1 -1
  71. package/dist/pages/CrudPage/CrudPage.d.ts +1 -1
  72. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +12 -11
  73. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
  74. package/dist/pages/OutagesAdminPage/index.js +55 -55
  75. package/dist/pages/OutagesAdminPage/index.js.map +1 -1
  76. package/dist/pages/UsersAdminPage/index.js +90 -90
  77. package/dist/pages/UsersAdminPage/index.js.map +1 -1
  78. package/dist/theme/demoTheme/index.js +6 -2
  79. package/dist/theme/demoTheme/index.js.map +1 -1
  80. package/dist/utils/TableUtil/TableUtil.d.ts +8 -1
  81. package/package.json +33 -27
  82. package/dist/_chunks/_baseFlatten.js +0 -26
  83. package/dist/_chunks/_baseFlatten.js.map +0 -1
  84. package/dist/_chunks/_cacheHas.js.map +0 -1
  85. package/dist/_chunks/isArrayLike.js.map +0 -1
  86. package/dist/test/lib/index.d.ts +0 -1
  87. package/dist/test/lib/render.d.ts +0 -2
@@ -1,11 +1,62 @@
1
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
2
- var e = {
1
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/subscribable.js
2
+ var e = class {
3
+ constructor() {
4
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
5
+ }
6
+ subscribe(e) {
7
+ return this.listeners.add(e), this.onSubscribe(), () => {
8
+ this.listeners.delete(e), this.onUnsubscribe();
9
+ };
10
+ }
11
+ hasListeners() {
12
+ return this.listeners.size > 0;
13
+ }
14
+ onSubscribe() {}
15
+ onUnsubscribe() {}
16
+ }, t = new class extends e {
17
+ #e;
18
+ #t;
19
+ #n;
20
+ constructor() {
21
+ super(), this.#n = (e) => {
22
+ if (typeof window < "u" && window.addEventListener) {
23
+ let t = () => e();
24
+ return window.addEventListener("visibilitychange", t, !1), () => {
25
+ window.removeEventListener("visibilitychange", t);
26
+ };
27
+ }
28
+ };
29
+ }
30
+ onSubscribe() {
31
+ this.#t || this.setEventListener(this.#n);
32
+ }
33
+ onUnsubscribe() {
34
+ this.hasListeners() || (this.#t?.(), this.#t = void 0);
35
+ }
36
+ setEventListener(e) {
37
+ this.#n = e, this.#t?.(), this.#t = e((e) => {
38
+ typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
39
+ });
40
+ }
41
+ setFocused(e) {
42
+ this.#e !== e && (this.#e = e, this.onFocus());
43
+ }
44
+ onFocus() {
45
+ let e = this.isFocused();
46
+ this.listeners.forEach((t) => {
47
+ t(e);
48
+ });
49
+ }
50
+ isFocused() {
51
+ return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
52
+ }
53
+ }(), n = {
3
54
  setTimeout: (e, t) => setTimeout(e, t),
4
55
  clearTimeout: (e) => clearTimeout(e),
5
56
  setInterval: (e, t) => setInterval(e, t),
6
57
  clearInterval: (e) => clearInterval(e)
7
- }, t = new class {
8
- #e = e;
58
+ }, r = new class {
59
+ #e = n;
9
60
  #t = !1;
10
61
  setTimeoutProvider(e) {
11
62
  process.env.NODE_ENV !== "production" && this.#t && e !== this.#e && console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.", {
@@ -26,30 +77,30 @@ var e = {
26
77
  this.#e.clearInterval(e);
27
78
  }
28
79
  }();
29
- function n(e) {
80
+ function i(e) {
30
81
  setTimeout(e, 0);
31
82
  }
32
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/utils.js
33
- var r = typeof window > "u" || "Deno" in globalThis;
34
- function i() {}
35
- function a(e, t) {
83
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/utils.js
84
+ var a = typeof window > "u" || "Deno" in globalThis;
85
+ function o() {}
86
+ function s(e, t) {
36
87
  return typeof e == "function" ? e(t) : e;
37
88
  }
38
- function o(e) {
89
+ function c(e) {
39
90
  return typeof e == "number" && e >= 0 && e !== Infinity;
40
91
  }
41
- function s(e, t) {
92
+ function l(e, t) {
42
93
  return Math.max(e + (t || 0) - Date.now(), 0);
43
94
  }
44
- function c(e, t) {
95
+ function u(e, t) {
45
96
  return typeof e == "function" ? e(t) : e;
46
97
  }
47
- function l(e, t) {
98
+ function d(e, t) {
48
99
  let { type: n = "all", exact: r, fetchStatus: i, predicate: a, queryKey: o, stale: s } = e;
49
100
  if (o) {
50
101
  if (r) {
51
- if (t.queryHash !== d(o, t.options)) return !1;
52
- } else if (!p(t.queryKey, o)) return !1;
102
+ if (t.queryHash !== p(o, t.options)) return !1;
103
+ } else if (!h(t.queryKey, o)) return !1;
53
104
  }
54
105
  if (n !== "all") {
55
106
  let e = t.isActive();
@@ -57,180 +108,186 @@ function l(e, t) {
57
108
  }
58
109
  return !(typeof s == "boolean" && t.isStale() !== s || i && i !== t.state.fetchStatus || a && !a(t));
59
110
  }
60
- function u(e, t) {
111
+ function f(e, t) {
61
112
  let { exact: n, status: r, predicate: i, mutationKey: a } = e;
62
113
  if (a) {
63
114
  if (!t.options.mutationKey) return !1;
64
115
  if (n) {
65
- if (f(t.options.mutationKey) !== f(a)) return !1;
66
- } else if (!p(t.options.mutationKey, a)) return !1;
116
+ if (m(t.options.mutationKey) !== m(a)) return !1;
117
+ } else if (!h(t.options.mutationKey, a)) return !1;
67
118
  }
68
119
  return !(r && t.state.status !== r || i && !i(t));
69
120
  }
70
- function d(e, t) {
71
- return (t?.queryKeyHashFn || f)(e);
121
+ function p(e, t) {
122
+ return (t?.queryKeyHashFn || m)(e);
72
123
  }
73
- function f(e) {
74
- return JSON.stringify(e, (e, t) => v(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
124
+ function m(e) {
125
+ return JSON.stringify(e, (e, t) => b(t) ? Object.keys(t).sort().reduce((e, n) => (e[n] = t[n], e), {}) : t);
75
126
  }
76
- function p(e, t) {
127
+ function h(e, t) {
77
128
  if (e === t) return !0;
78
129
  if (typeof e != typeof t) return !1;
79
130
  if (e && t && typeof e == "object" && typeof t == "object") {
131
+ if (Array.isArray(e) !== Array.isArray(t)) return !1;
80
132
  if (Array.isArray(e) && Array.isArray(t)) {
81
133
  if (t.length > e.length) return !1;
82
- for (let n = 0; n < t.length; n++) if (!p(e[n], t[n])) return !1;
134
+ for (let n = 0; n < t.length; n++) if (!h(e[n], t[n])) return !1;
83
135
  return !0;
84
136
  }
85
137
  let n = Object.keys(t);
86
- for (let r of n) if (!p(e[r], t[r])) return !1;
138
+ for (let r of n) if (!h(e[r], t[r])) return !1;
87
139
  return !0;
88
140
  }
89
141
  return !1;
90
142
  }
91
- var m = Object.prototype.hasOwnProperty;
92
- function h(e, t, n = 0) {
143
+ var g = Object.prototype.hasOwnProperty;
144
+ function _(e, t, n = 0) {
93
145
  if (e === t) return e;
94
146
  if (n > 500) return t;
95
- let r = _(e) && _(t);
96
- if (!r && !(v(e) && v(t))) return t;
147
+ let r = y(e) && y(t);
148
+ if (!r && !(b(e) && b(t))) return t;
97
149
  let i = (r ? e : Object.keys(e)).length, a = r ? t : Object.keys(t), o = a.length, s = r ? Array(o) : {}, c = 0;
98
150
  for (let l = 0; l < o; l++) {
99
151
  let o = r ? l : a[l], u = e[o], d = t[o];
100
152
  if (u === d) {
101
- s[o] = u, (r ? l < i : m.call(e, o)) && c++;
153
+ s[o] = u, (r ? l < i : g.call(e, o)) && c++;
102
154
  continue;
103
155
  }
104
156
  if (u === null || d === null || typeof u != "object" || typeof d != "object") {
105
157
  s[o] = d;
106
158
  continue;
107
159
  }
108
- let f = h(u, d, n + 1);
160
+ let f = _(u, d, n + 1);
109
161
  s[o] = f, f === u && c++;
110
162
  }
111
163
  return i === o && c === i ? e : s;
112
164
  }
113
- function g(e, t) {
165
+ function v(e, t) {
114
166
  if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
115
- for (let n of Object.keys(e)) if (!m.call(t, n) || e[n] !== t[n]) return !1;
167
+ for (let n of Object.keys(e)) if (!g.call(t, n) || e[n] !== t[n]) return !1;
116
168
  return !0;
117
169
  }
118
- function _(e) {
170
+ function y(e) {
119
171
  return Array.isArray(e) && e.length === Object.keys(e).length;
120
172
  }
121
- function v(e) {
122
- if (!y(e)) return !1;
173
+ function b(e) {
174
+ if (!x(e)) return !1;
123
175
  let t = Object.getPrototypeOf(e), n = t?.constructor;
124
176
  if (n === void 0) return !0;
125
177
  if (typeof n != "function") return !1;
126
178
  let r = n.prototype;
127
- return !(!y(r) || !r.hasOwnProperty("isPrototypeOf") || t !== Object.prototype);
179
+ return !(!x(r) || !r.hasOwnProperty("isPrototypeOf") || t !== Object.prototype);
128
180
  }
129
- function y(e) {
181
+ function x(e) {
130
182
  return Object.prototype.toString.call(e) === "[object Object]";
131
183
  }
132
- function b(e) {
133
- return new Promise((n) => {
134
- t.setTimeout(n, e);
184
+ function S(e) {
185
+ return new Promise((t) => {
186
+ r.setTimeout(t, e);
135
187
  });
136
188
  }
137
- function x(e, t, n) {
189
+ function C(e, t, n) {
138
190
  if (typeof n.structuralSharing == "function") return n.structuralSharing(e, t);
139
191
  if (n.structuralSharing !== !1) {
140
192
  if (process.env.NODE_ENV !== "production") try {
141
- return h(e, t);
193
+ return _(e, t);
142
194
  } catch (e) {
143
195
  throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`), e;
144
196
  }
145
- return h(e, t);
197
+ return _(e, t);
146
198
  }
147
199
  return t;
148
200
  }
149
- function S(e, t, n = 0) {
150
- let r = [...e, t];
151
- return n && r.length > n ? r.slice(-n) : r;
152
- }
153
- function C(e, t, n = 0) {
154
- let r = [t, ...e];
155
- return n && r.length > n ? r.slice(0, n) : r;
156
- }
157
- var w = Symbol();
158
- function T(e, t) {
159
- return process.env.NODE_ENV !== "production" && e.queryFn === w && console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === w ? () => Promise.reject(/* @__PURE__ */ Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
201
+ function w(e, t, n, r) {
202
+ let i = r ? [t, ...e] : [...e, t];
203
+ return n && i.length > n ? r ? i.slice(0, n) : i.slice(-n) : i;
160
204
  }
205
+ var T = Symbol();
161
206
  function E(e, t) {
207
+ return process.env.NODE_ENV !== "production" && e.queryFn === T && console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === T ? () => Promise.reject(/* @__PURE__ */ Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
208
+ }
209
+ function D(e, t) {
162
210
  return typeof e == "function" ? e(...t) : !!e;
163
211
  }
164
- var D = Symbol();
165
- function O(e, t, n, r) {
212
+ var O = Symbol();
213
+ function k(e, t, n, r) {
166
214
  let i = !1, a;
167
215
  return Object.defineProperties(e, {
168
- [D]: { value: r },
216
+ [O]: { value: r },
169
217
  signal: {
170
218
  enumerable: !0,
171
219
  get: () => (a ??= t(), i || (i = !0, a.aborted ? n() : a.addEventListener("abort", n, { once: !0 })), a)
172
220
  }
173
221
  }), e;
174
222
  }
175
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/environmentManager.js
176
- var k = () => r, A = () => k(), j = class {
177
- constructor() {
178
- this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
179
- }
180
- subscribe(e) {
181
- return this.listeners.add(e), this.onSubscribe(), () => {
182
- this.listeners.delete(e), this.onUnsubscribe();
183
- };
184
- }
185
- hasListeners() {
186
- return this.listeners.size > 0;
187
- }
188
- onSubscribe() {}
189
- onUnsubscribe() {}
190
- }, M = new class extends j {
191
- #e;
192
- #t;
193
- #n;
194
- constructor() {
195
- super(), this.#n = (e) => {
196
- if (typeof window < "u" && window.addEventListener) {
197
- let t = () => e();
198
- return window.addEventListener("visibilitychange", t, !1), () => {
199
- window.removeEventListener("visibilitychange", t);
223
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/environmentManager.js
224
+ var A = () => a, j = () => A();
225
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
226
+ function M(e) {
227
+ return { onFetch: (t, n) => {
228
+ let r = t.options, i = t.fetchOptions?.meta?.fetchMore?.direction, a = t.state.data?.pages || [], o = t.state.data?.pageParams || [], s = {
229
+ pages: [],
230
+ pageParams: []
231
+ }, c = 0, l = async () => {
232
+ let n = !1, l = t, u = (e) => {
233
+ k(e, () => t.signal, () => n = !0, l[O]);
234
+ }, d = E(t.options, t.fetchOptions), f = async (e, r, i) => {
235
+ if (n) return Promise.reject(t.signal.reason);
236
+ if (r == null && e.pages.length) return Promise.resolve(e);
237
+ let a = (() => {
238
+ let e = {
239
+ client: t.client,
240
+ queryKey: t.queryKey,
241
+ pageParam: r,
242
+ direction: i ? "backward" : "forward",
243
+ meta: t.options.meta
244
+ };
245
+ return u(e), e;
246
+ })(), o = await d(a), { maxPages: s } = t.options;
247
+ return {
248
+ pages: w(e.pages, o, s, i),
249
+ pageParams: w(e.pageParams, r, s, i)
250
+ };
251
+ };
252
+ if (i && a.length) {
253
+ let e = i === "backward", t = e ? P : N, n = {
254
+ pages: a,
255
+ pageParams: o
200
256
  };
257
+ s = await f(n, t(r, n), e);
258
+ } else {
259
+ let t = e ?? a.length;
260
+ do {
261
+ let e = c === 0 ? o[0] === void 0 ? r.initialPageParam : o[0] : N(r, s);
262
+ if (c > 0 && e == null) break;
263
+ s = await f(s, e), c++;
264
+ } while (c < t);
201
265
  }
266
+ return s;
202
267
  };
203
- }
204
- onSubscribe() {
205
- this.#t || this.setEventListener(this.#n);
206
- }
207
- onUnsubscribe() {
208
- this.hasListeners() || (this.#t?.(), this.#t = void 0);
209
- }
210
- setEventListener(e) {
211
- this.#n = e, this.#t?.(), this.#t = e((e) => {
212
- typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
213
- });
214
- }
215
- setFocused(e) {
216
- this.#e !== e && (this.#e = e, this.onFocus());
217
- }
218
- onFocus() {
219
- let e = this.isFocused();
220
- this.listeners.forEach((t) => {
221
- t(e);
222
- });
223
- }
224
- isFocused() {
225
- return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
226
- }
227
- }(), N = n;
228
- function P() {
268
+ t.fetchFn = t.options.persister ? () => t.options.persister?.(l, {
269
+ client: t.client,
270
+ queryKey: t.queryKey,
271
+ meta: t.options.meta,
272
+ signal: t.signal
273
+ }, n) : l;
274
+ } };
275
+ }
276
+ function N(e, { pages: t, pageParams: n }) {
277
+ let r = t.length - 1;
278
+ return t.length > 0 ? e.getNextPageParam(t[r], t, n[r], n) : void 0;
279
+ }
280
+ function P(e, { pages: t, pageParams: n }) {
281
+ return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, n[0], n) : void 0;
282
+ }
283
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/notifyManager.js
284
+ var F = i;
285
+ function I() {
229
286
  let e = [], t = 0, n = (e) => {
230
287
  e();
231
288
  }, r = (e) => {
232
289
  e();
233
- }, i = N, a = (r) => {
290
+ }, i = F, a = (r) => {
234
291
  t ? e.push(r) : i(() => {
235
292
  n(r);
236
293
  });
@@ -272,7 +329,23 @@ function P() {
272
329
  }
273
330
  };
274
331
  }
275
- var F = P(), I = new class extends j {
332
+ var L = I(), R = class {
333
+ #e;
334
+ destroy() {
335
+ this.clearGcTimeout();
336
+ }
337
+ scheduleGc() {
338
+ this.clearGcTimeout(), c(this.gcTime) && (this.#e = r.setTimeout(() => {
339
+ this.optionalRemove();
340
+ }, this.gcTime));
341
+ }
342
+ updateGcTime(e) {
343
+ this.gcTime = Math.max(this.gcTime || 0, e ?? (j() ? Infinity : 3e5));
344
+ }
345
+ clearGcTimeout() {
346
+ this.#e !== void 0 && (r.clearTimeout(this.#e), this.#e = void 0);
347
+ }
348
+ }, z = new class extends e {
276
349
  #e = !0;
277
350
  #t;
278
351
  #n;
@@ -304,145 +377,71 @@ var F = P(), I = new class extends j {
304
377
  return this.#e;
305
378
  }
306
379
  }();
307
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/retryer.js
308
- function L(e) {
380
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/retryer.js
381
+ function B(e) {
309
382
  return Math.min(1e3 * 2 ** e, 3e4);
310
383
  }
311
- function R(e) {
312
- return (e ?? "online") !== "online" || I.isOnline();
384
+ function V(e) {
385
+ return (e ?? "online") !== "online" || z.isOnline();
313
386
  }
314
- var z = class extends Error {
387
+ var H = class extends Error {
315
388
  constructor(e) {
316
389
  super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
317
390
  }
318
391
  };
319
- function B(e) {
320
- let t = !1, n = 0, r, a = "pending", o, s, c = new Promise((e, t) => {
321
- o = e, s = t;
392
+ function U(e) {
393
+ let n = !1, r = 0, i, a = "pending", s, c, l = new Promise((e, t) => {
394
+ s = e, c = t;
322
395
  });
323
- c.catch(i);
324
- let l = () => a !== "pending", u = (t) => {
325
- if (!l()) {
326
- let n = new z(t);
327
- g(n), e.onCancel?.(n);
396
+ l.catch(o);
397
+ let u = () => a !== "pending", d = (t) => {
398
+ if (!u()) {
399
+ let n = new H(t);
400
+ _(n), e.onCancel?.(n);
328
401
  }
329
- }, d = () => {
330
- t = !0;
331
402
  }, f = () => {
332
- t = !1;
333
- }, p = () => M.isFocused() && (e.networkMode === "always" || I.isOnline()) && e.canRun(), m = () => R(e.networkMode) && e.canRun(), h = (e) => {
334
- l() || (r?.(), a = "resolved", o(e));
335
- }, g = (e) => {
336
- l() || (r?.(), a = "rejected", s(e));
337
- }, _ = (t) => new Promise((n) => {
338
- r = (e) => {
339
- (l() || t()) && n(e);
403
+ n = !0;
404
+ }, p = () => {
405
+ n = !1;
406
+ }, m = () => t.isFocused() && (e.networkMode === "always" || z.isOnline()) && e.canRun(), h = () => V(e.networkMode) && e.canRun(), g = (e) => {
407
+ u() || (i?.(), a = "resolved", s(e));
408
+ }, _ = (e) => {
409
+ u() || (i?.(), a = "rejected", c(e));
410
+ }, v = (t) => new Promise((n) => {
411
+ i = (e) => {
412
+ (u() || t()) && n(e);
340
413
  }, e.onPause?.();
341
414
  }).then(() => {
342
- r = void 0, l() || e.onContinue?.();
343
- }), v = () => {
344
- if (l()) return;
345
- let r, i = n === 0 ? e.initialPromise : void 0;
415
+ i = void 0, u() || e.onContinue?.();
416
+ }), y = () => {
417
+ if (u()) return;
418
+ let t, i = r === 0 ? e.initialPromise : void 0;
346
419
  try {
347
- r = i ?? e.fn();
420
+ t = i ?? e.fn();
348
421
  } catch (e) {
349
- r = Promise.reject(e);
422
+ t = Promise.reject(e);
350
423
  }
351
- Promise.resolve(r).then(h).catch((r) => {
352
- if (l()) return;
353
- let i = e.retry ?? (A() ? 0 : 3), a = e.retryDelay ?? L, o = typeof a == "function" ? a(n, r) : a, s = i === !0 || typeof i == "number" && n < i || typeof i == "function" && i(n, r);
354
- t || !s ? g(r) : (n++, e.onFail?.(n, r), b(o).then(() => l() || p() ? void 0 : _(p)).then(() => {
355
- t ? g(r) : v();
424
+ Promise.resolve(t).then(g).catch((t) => {
425
+ if (u()) return;
426
+ let i = e.retry ?? (j() ? 0 : 3), a = e.retryDelay ?? B, o = typeof a == "function" ? a(r, t) : a, s = i === !0 || typeof i == "number" && r < i || typeof i == "function" && i(r, t);
427
+ n || !s ? _(t) : (r++, e.onFail?.(r, t), S(o).then(() => u() || m() ? void 0 : v(m)).then(() => {
428
+ n ? _(t) : y();
356
429
  }));
357
430
  });
358
431
  };
359
432
  return {
360
- promise: c,
433
+ promise: l,
361
434
  status: () => a,
362
- cancel: u,
363
- continue: () => (r?.(), c),
364
- cancelRetry: d,
365
- continueRetry: f,
366
- canStart: m,
367
- start: () => (m() ? v() : _(m).then(v), c)
435
+ cancel: d,
436
+ continue: () => (i?.(), l),
437
+ cancelRetry: f,
438
+ continueRetry: p,
439
+ canStart: h,
440
+ start: () => (h() ? y() : v(h).then(y), l)
368
441
  };
369
442
  }
370
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
371
- function V(e) {
372
- return { onFetch: (t, n) => {
373
- let r = t.options, i = t.fetchOptions?.meta?.fetchMore?.direction, a = t.state.data?.pages || [], o = t.state.data?.pageParams || [], s = {
374
- pages: [],
375
- pageParams: []
376
- }, c = 0, l = async () => {
377
- let n = !1, l = t, u = (e) => {
378
- O(e, () => t.signal, () => n = !0, l[D]);
379
- }, d = T(t.options, t.fetchOptions), f = async (e, r, i) => {
380
- if (n) return Promise.reject(t.signal.reason);
381
- if (r == null && e.pages.length) return Promise.resolve(e);
382
- let a = (() => {
383
- let e = {
384
- client: t.client,
385
- queryKey: t.queryKey,
386
- pageParam: r,
387
- direction: i ? "backward" : "forward",
388
- meta: t.options.meta
389
- };
390
- return u(e), e;
391
- })(), o = await d(a), { maxPages: s } = t.options, c = i ? C : S;
392
- return {
393
- pages: c(e.pages, o, s),
394
- pageParams: c(e.pageParams, r, s)
395
- };
396
- };
397
- if (i && a.length) {
398
- let e = i === "backward", t = e ? U : H, n = {
399
- pages: a,
400
- pageParams: o
401
- };
402
- s = await f(n, t(r, n), e);
403
- } else {
404
- let t = e ?? a.length;
405
- do {
406
- let e = c === 0 ? o[0] === void 0 ? r.initialPageParam : o[0] : H(r, s);
407
- if (c > 0 && e == null) break;
408
- s = await f(s, e), c++;
409
- } while (c < t);
410
- }
411
- return s;
412
- };
413
- t.fetchFn = t.options.persister ? () => t.options.persister?.(l, {
414
- client: t.client,
415
- queryKey: t.queryKey,
416
- meta: t.options.meta,
417
- signal: t.signal
418
- }, n) : l;
419
- } };
420
- }
421
- function H(e, { pages: t, pageParams: n }) {
422
- let r = t.length - 1;
423
- return t.length > 0 ? e.getNextPageParam(t[r], t, n[r], n) : void 0;
424
- }
425
- function U(e, { pages: t, pageParams: n }) {
426
- return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, n[0], n) : void 0;
427
- }
428
- // ../../node_modules/.pnpm/@tanstack+query-core@5.107.2/node_modules/@tanstack/query-core/build/modern/removable.js
429
- var W = class {
430
- #e;
431
- destroy() {
432
- this.clearGcTimeout();
433
- }
434
- scheduleGc() {
435
- this.clearGcTimeout(), o(this.gcTime) && (this.#e = t.setTimeout(() => {
436
- this.optionalRemove();
437
- }, this.gcTime));
438
- }
439
- updateGcTime(e) {
440
- this.gcTime = Math.max(this.gcTime || 0, e ?? (A() ? Infinity : 3e5));
441
- }
442
- clearGcTimeout() {
443
- this.#e !== void 0 && (t.clearTimeout(this.#e), this.#e = void 0);
444
- }
445
- }, G = class extends W {
443
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.108.4/node_modules/@tanstack/query-core/build/modern/query.js
444
+ var W = class extends R {
446
445
  #e;
447
446
  #t;
448
447
  #n;
@@ -453,7 +452,7 @@ var W = class {
453
452
  #s;
454
453
  #c;
455
454
  constructor(e) {
456
- super(), this.#c = !1, this.#s = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#i = e.client, this.#r = this.#i.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#t = J(this.options), this.state = e.state ?? this.#t, this.scheduleGc();
455
+ super(), this.#c = !1, this.#s = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#i = e.client, this.#r = this.#i.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#t = q(this.options), this.state = e.state ?? this.#t, this.scheduleGc();
457
456
  }
458
457
  get meta() {
459
458
  return this.options.meta;
@@ -469,16 +468,16 @@ var W = class {
469
468
  ...this.#s,
470
469
  ...e
471
470
  }, e?._type && (this.#e = e._type), this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
472
- let e = J(this.options);
473
- e.data !== void 0 && (this.setState(q(e.data, e.dataUpdatedAt)), this.#t = e);
471
+ let e = q(this.options);
472
+ e.data !== void 0 && (this.setState(K(e.data, e.dataUpdatedAt)), this.#t = e);
474
473
  }
475
474
  }
476
475
  optionalRemove() {
477
476
  !this.observers.length && this.state.fetchStatus === "idle" && this.#r.remove(this);
478
477
  }
479
478
  setData(e, t) {
480
- let n = x(this.state.data, e, this.options);
481
- return this.#l({
479
+ let n = C(this.state.data, e, this.options);
480
+ return this.#u({
482
481
  data: n,
483
482
  type: "success",
484
483
  dataUpdatedAt: t?.updatedAt,
@@ -486,17 +485,17 @@ var W = class {
486
485
  }), n;
487
486
  }
488
487
  setState(e) {
489
- this.#l({
488
+ this.#u({
490
489
  type: "setState",
491
490
  state: e
492
491
  });
493
492
  }
494
493
  cancel(e) {
495
494
  let t = this.#a?.promise;
496
- return this.#a?.cancel(e), t ? t.then(i).catch(i) : Promise.resolve();
495
+ return this.#a?.cancel(e), t ? t.then(o).catch(o) : Promise.resolve();
497
496
  }
498
497
  destroy() {
499
- super.destroy(), this.cancel({ silent: !0 });
498
+ this.cancel({ silent: !0 }), super.destroy();
500
499
  }
501
500
  get resetState() {
502
501
  return this.#t;
@@ -505,22 +504,22 @@ var W = class {
505
504
  this.destroy(), this.setState(this.resetState);
506
505
  }
507
506
  isActive() {
508
- return this.observers.some((e) => c(e.options.enabled, this) !== !1);
507
+ return this.observers.some((e) => u(e.options.enabled, this) !== !1);
509
508
  }
510
509
  isDisabled() {
511
- return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === w || !this.isFetched();
510
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === T || !this.isFetched();
512
511
  }
513
512
  isFetched() {
514
513
  return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;
515
514
  }
516
515
  isStatic() {
517
- return this.state.data !== void 0 && this.getObserversCount() > 0 && this.observers.some((e) => c(e.options.staleTime, this) === "static");
516
+ return this.state.data !== void 0 && this.getObserversCount() > 0 && this.observers.some((e) => u(e.options.staleTime, this) === "static");
518
517
  }
519
518
  isStale() {
520
519
  return this.getObserversCount() > 0 ? this.observers.some((e) => e.getCurrentResult().isStale) : this.state.data === void 0 || this.state.isInvalidated;
521
520
  }
522
521
  isStaleByTime(e = 0) {
523
- return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !s(this.state.dataUpdatedAt, e);
522
+ return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !l(this.state.dataUpdatedAt, e);
524
523
  }
525
524
  onFocus() {
526
525
  this.observers.find((e) => e.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#a?.continue();
@@ -537,7 +536,7 @@ var W = class {
537
536
  }
538
537
  removeObserver(e) {
539
538
  let t = this.observers.indexOf(e);
540
- t !== -1 && (this.observers.splice(t, 1), this.observers.length || (this.#a && (this.#c || this.state.fetchStatus === "paused" && this.state.status === "pending" ? this.#a.cancel({ revert: !0 }) : this.#a.cancelRetry()), this.scheduleGc()), this.#r.notify({
539
+ t !== -1 && (this.observers.splice(t, 1), this.observers.length || (this.#a && (this.#c || this.state.fetchStatus === "paused" && this.state.status === "pending" ? this.#a.cancel({ revert: !0 }) : this.#a.cancelRetry()), this.#l()), this.#r.notify({
541
540
  type: "observerRemoved",
542
541
  query: this,
543
542
  observer: e
@@ -547,7 +546,7 @@ var W = class {
547
546
  return this.observers.length;
548
547
  }
549
548
  invalidate() {
550
- this.state.isInvalidated || this.#l({ type: "invalidate" });
549
+ this.state.isInvalidated || this.#u({ type: "invalidate" });
551
550
  }
552
551
  async fetch(e, t) {
553
552
  if (this.state.fetchStatus !== "idle" && this.#a?.status() !== "rejected") {
@@ -561,7 +560,7 @@ var W = class {
561
560
  process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));
562
561
  let n = new AbortController(), r = (e) => {
563
562
  Object.defineProperties(e, {
564
- [D]: {
563
+ [O]: {
565
564
  value: n.signal,
566
565
  enumerable: !0
567
566
  },
@@ -571,7 +570,7 @@ var W = class {
571
570
  }
572
571
  });
573
572
  }, i = () => {
574
- let e = T(this.options, t), n = (() => {
573
+ let e = E(this.options, t), n = (() => {
575
574
  let e = {
576
575
  client: this.#i,
577
576
  queryKey: this.queryKey,
@@ -591,31 +590,31 @@ var W = class {
591
590
  };
592
591
  return r(e), e;
593
592
  })();
594
- (this.#e === "infinite" ? V(this.options.pages) : this.options.behavior)?.onFetch(a, this), this.#n = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== a.fetchOptions?.meta) && this.#l({
593
+ (this.#e === "infinite" ? M(this.options.pages) : this.options.behavior)?.onFetch(a, this), this.#n = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== a.fetchOptions?.meta) && this.#u({
595
594
  type: "fetch",
596
595
  meta: a.fetchOptions?.meta
597
596
  });
598
- let o = this.#a = B({
597
+ let o = this.#a = U({
599
598
  initialPromise: t?.initialPromise,
600
599
  fn: a.fetchFn,
601
600
  onCancel: (e) => {
602
- e instanceof z && e.revert && this.setState({
601
+ e instanceof H && e.revert && this.setState({
603
602
  ...this.#n,
604
603
  fetchStatus: "idle"
605
604
  }), n.abort();
606
605
  },
607
606
  onFail: (e, t) => {
608
- this.#l({
607
+ this.#u({
609
608
  type: "failed",
610
609
  failureCount: e,
611
610
  error: t
612
611
  });
613
612
  },
614
613
  onPause: () => {
615
- this.#l({ type: "pause" });
614
+ this.#u({ type: "pause" });
616
615
  },
617
616
  onContinue: () => {
618
- this.#l({ type: "continue" });
617
+ this.#u({ type: "continue" });
619
618
  },
620
619
  retry: a.options.retry,
621
620
  retryDelay: a.options.retryDelay,
@@ -627,7 +626,7 @@ var W = class {
627
626
  if (e === void 0) throw process.env.NODE_ENV !== "production" && console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`), Error(`${this.queryHash} data is undefined`);
628
627
  return this.setData(e), this.#r.config.onSuccess?.(e, this), this.#r.config.onSettled?.(e, this.state.error, this), e;
629
628
  } catch (e) {
630
- if (e instanceof z) {
629
+ if (e instanceof H) {
631
630
  if (e.silent) {
632
631
  if (this.#a !== o && this.#o) return this.#o;
633
632
  throw e;
@@ -637,17 +636,20 @@ var W = class {
637
636
  return this.state.data;
638
637
  }
639
638
  }
640
- throw this.#l({
639
+ throw this.#u({
641
640
  type: "error",
642
641
  error: e
643
642
  }), this.#r.config.onError?.(e, this), this.#r.config.onSettled?.(this.state.data, e, this), e;
644
643
  } finally {
645
- this.#a === o && (this.#a = void 0, this.#o = void 0), this.scheduleGc();
644
+ this.#a === o && (this.#a = void 0, this.#o = void 0), this.#l();
646
645
  }
647
646
  })();
648
647
  return this.#o = s, o.start(), s;
649
648
  }
650
- #l(e) {
649
+ #l() {
650
+ this.#r.get(this.queryHash) === this && this.scheduleGc();
651
+ }
652
+ #u(e) {
651
653
  let t = (t) => {
652
654
  switch (e.type) {
653
655
  case "failed": return {
@@ -665,13 +667,13 @@ var W = class {
665
667
  };
666
668
  case "fetch": return {
667
669
  ...t,
668
- ...K(t.data, this.options),
670
+ ...G(t.data, this.options),
669
671
  fetchMeta: e.meta ?? null
670
672
  };
671
673
  case "success": {
672
674
  let n = {
673
675
  ...t,
674
- ...q(e.data, e.dataUpdatedAt),
676
+ ...K(e.data, e.dataUpdatedAt),
675
677
  dataUpdateCount: t.dataUpdateCount + 1,
676
678
  ...!e.manual && {
677
679
  fetchStatus: "idle",
@@ -705,7 +707,7 @@ var W = class {
705
707
  };
706
708
  }
707
709
  };
708
- this.state = t(this.state), F.batch(() => {
710
+ this.state = t(this.state), L.batch(() => {
709
711
  this.observers.slice().forEach((e) => {
710
712
  e.onQueryUpdate();
711
713
  }), this.#r.notify({
@@ -716,18 +718,18 @@ var W = class {
716
718
  });
717
719
  }
718
720
  };
719
- function K(e, t) {
721
+ function G(e, t) {
720
722
  return {
721
723
  fetchFailureCount: 0,
722
724
  fetchFailureReason: null,
723
- fetchStatus: R(t.networkMode) ? "fetching" : "paused",
725
+ fetchStatus: V(t.networkMode) ? "fetching" : "paused",
724
726
  ...e === void 0 && {
725
727
  error: null,
726
728
  status: "pending"
727
729
  }
728
730
  };
729
731
  }
730
- function q(e, t) {
732
+ function K(e, t) {
731
733
  return {
732
734
  data: e,
733
735
  dataUpdatedAt: t ?? Date.now(),
@@ -736,7 +738,7 @@ function q(e, t) {
736
738
  status: "success"
737
739
  };
738
740
  }
739
- function J(e) {
741
+ function q(e) {
740
742
  let t = typeof e.initialData == "function" ? e.initialData() : e.initialData, n = t !== void 0, r = n ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
741
743
  return {
742
744
  data: t,
@@ -753,6 +755,6 @@ function J(e) {
753
755
  fetchStatus: "idle"
754
756
  };
755
757
  }
756
- export { s as C, w as S, p as _, I as a, g as b, j as c, f as d, d as f, i as g, l as h, B as i, A as l, u as m, K as n, F as o, o as p, W as r, M as s, G as t, a as u, x as v, t as w, E as x, c as y };
758
+ export { t as C, r as S, u as _, R as a, T as b, s as c, c as d, f, C as g, h, z as i, m as l, o as m, G as n, L as o, d as p, U as r, j as s, W as t, p as u, v, e as w, l as x, D as y };
757
759
 
758
760
  //# sourceMappingURL=query.js.map