@gen-epix/ui-client-common 4.6.1 → 4.7.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 (123) hide show
  1. package/README.md +2 -2
  2. package/dist/_chunks/Breadcrumbs.js +4 -4
  3. package/dist/_chunks/CrudPage.js +166 -166
  4. package/dist/_chunks/CrudPage.js.map +1 -1
  5. package/dist/_chunks/Notifications.js +16 -16
  6. package/dist/_chunks/QueryClientProvider.js +1 -1
  7. package/dist/_chunks/QueryClientProvider.js.map +1 -1
  8. package/dist/_chunks/QueryClientService.js +73 -72
  9. package/dist/_chunks/QueryClientService.js.map +1 -1
  10. package/dist/_chunks/Table.js +853 -744
  11. package/dist/_chunks/Table.js.map +1 -1
  12. package/dist/_chunks/TableUtil.js +38 -38
  13. package/dist/_chunks/TableUtil.js.map +1 -1
  14. package/dist/_chunks/UserInvitationsAdminPage.js +131 -131
  15. package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
  16. package/dist/_chunks/_baseFlatten.js +12 -12
  17. package/dist/_chunks/_baseFlatten.js.map +1 -1
  18. package/dist/_chunks/_baseIteratee.js +78 -78
  19. package/dist/_chunks/_baseIteratee.js.map +1 -1
  20. package/dist/_chunks/decorate.js +1 -1
  21. package/dist/_chunks/decorateParam.js +1 -1
  22. package/dist/_chunks/middleware.js +66 -70
  23. package/dist/_chunks/middleware.js.map +1 -1
  24. package/dist/_chunks/omit.js +98 -98
  25. package/dist/_chunks/omit.js.map +1 -1
  26. package/dist/_chunks/query.js +108 -92
  27. package/dist/_chunks/query.js.map +1 -1
  28. package/dist/_chunks/react.js +1 -1
  29. package/dist/_chunks/react.js.map +1 -1
  30. package/dist/_chunks/tableStore.js +61 -58
  31. package/dist/_chunks/tableStore.js.map +1 -1
  32. package/dist/_chunks/useColumnsMenu.js +73 -71
  33. package/dist/_chunks/useColumnsMenu.js.map +1 -1
  34. package/dist/_chunks/useMutation.js +2 -2
  35. package/dist/_chunks/useMutation.js.map +1 -1
  36. package/dist/_chunks/useQueryMemo.js +15 -16
  37. package/dist/_chunks/useQueryMemo.js.map +1 -1
  38. package/dist/_chunks/vanilla.js +1 -1
  39. package/dist/_chunks/vanilla.js.map +1 -1
  40. package/dist/_chunks/yup.js +2 -2
  41. package/dist/_chunks/yup.js.map +1 -1
  42. package/dist/classes/services/AuthenticationService/index.js +8 -8
  43. package/dist/classes/services/AuthenticationService/index.js.map +1 -1
  44. package/dist/classes/services/AuthorizationService/index.js +4 -4
  45. package/dist/classes/services/AuthorizationService/index.js.map +1 -1
  46. package/dist/classes/services/BreadcrumbService/index.js +4 -4
  47. package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
  48. package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
  49. package/dist/classes/services/InactivityService/index.js +30 -30
  50. package/dist/classes/services/InactivityService/index.js.map +1 -1
  51. package/dist/classes/services/LogService/index.js +15 -15
  52. package/dist/classes/services/LogService/index.js.map +1 -1
  53. package/dist/classes/services/PageEventBusService/index.js.map +1 -1
  54. package/dist/components/app/App/index.js +26 -24
  55. package/dist/components/app/App/index.js.map +1 -1
  56. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +18 -18
  57. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
  58. package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +18 -18
  59. package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
  60. package/dist/components/app/AuthenticationWrapper/index.js +15 -15
  61. package/dist/components/app/AuthorizationWrapper/index.js +16 -16
  62. package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
  63. package/dist/components/app/RouterRoot/index.js +33 -33
  64. package/dist/components/app/RouterRoot/index.js.map +1 -1
  65. package/dist/components/epi/EpiContactDetailsDialog/index.js +4 -4
  66. package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
  67. package/dist/components/ui/ApplicationBar/index.js +234 -234
  68. package/dist/components/ui/ApplicationBar/index.js.map +1 -1
  69. package/dist/components/ui/GenericErrorMessage/index.js +13 -13
  70. package/dist/components/ui/LicensesDialog/index.js +6 -6
  71. package/dist/components/ui/OrganizationSwitcherDialog/index.js +11 -11
  72. package/dist/components/ui/OutagesDialog/index.js +4 -4
  73. package/dist/components/ui/OutagesDialog/index.js.map +1 -1
  74. package/dist/components/ui/PageContainer/index.js +5 -5
  75. package/dist/components/ui/PageContainer/index.js.map +1 -1
  76. package/dist/components/ui/ResponseHandler/index.js +4 -4
  77. package/dist/components/ui/SortableList/SortableList.d.ts +5 -3
  78. package/dist/components/ui/Table/Table.d.ts +5 -2
  79. package/dist/components/ui/Table/TableColumnsEditorDialog.d.ts +13 -2
  80. package/dist/components/ui/Table/index.d.ts +1 -0
  81. package/dist/components/ui/Table/index.js +1 -1
  82. package/dist/components/ui/UserFeedbackDialog/index.js +15 -15
  83. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +12 -12
  84. package/dist/dataHooks/useIdentifierIssuerQuery/index.js +11 -11
  85. package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +5 -5
  86. package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
  87. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +15 -15
  88. package/dist/dataHooks/useOrganizationsQuery/index.js +7 -7
  89. package/dist/dataHooks/useUsersQuery/index.js +10 -10
  90. package/dist/hooks/useCreateMutation/index.js +14 -14
  91. package/dist/hooks/useCreateMutation/index.js.map +1 -1
  92. package/dist/hooks/useDeleteMutation/index.js +17 -17
  93. package/dist/hooks/useDeleteMutation/index.js.map +1 -1
  94. package/dist/hooks/useEditMutation/index.js +22 -22
  95. package/dist/hooks/useEditMutation/index.js.map +1 -1
  96. package/dist/hooks/useInitializeTableStore/index.js +6 -6
  97. package/dist/hooks/useInitializeTableStore/index.js.map +1 -1
  98. package/dist/locale/en.json +13 -5
  99. package/dist/locale/nl.json +13 -5
  100. package/dist/pages/AcceptInvitationPage/index.js +10 -10
  101. package/dist/pages/AdminPage/index.js +19 -19
  102. package/dist/pages/ChooseIdentityProviderPage/index.js +5 -5
  103. package/dist/pages/ErrorPage/index.js +4 -4
  104. package/dist/pages/IdentifierIssuersAdminPage/index.js +7 -7
  105. package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
  106. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +16 -16
  107. package/dist/pages/OrganizationContactsAdminPage/index.js +10 -10
  108. package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
  109. package/dist/pages/OrganizationSitesAdminPage/index.js +12 -12
  110. package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
  111. package/dist/pages/OrganizationsAdminPage/index.js +20 -20
  112. package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
  113. package/dist/pages/OutagesAdminPage/index.js +11 -11
  114. package/dist/pages/OutagesAdminPage/index.js.map +1 -1
  115. package/dist/pages/RouterErrorPage/index.js +4 -4
  116. package/dist/pages/UsersAdminPage/index.js +34 -34
  117. package/dist/pages/UsersAdminPage/index.js.map +1 -1
  118. package/dist/setup/setup.js +4 -4
  119. package/dist/setup/setup.js.map +1 -1
  120. package/dist/stores/oidcStore/oidcStore.d.ts +1 -1
  121. package/dist/utils/StandardConfigUtil/index.js +2 -2
  122. package/dist/utils/StandardConfigUtil/index.js.map +1 -1
  123. package/package.json +33 -33
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.pnpm/@tanstack+query-core@5.105.0/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
1
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
2
2
  var e = {
3
3
  setTimeout: (e, t) => setTimeout(e, t),
4
4
  clearTimeout: (e) => clearTimeout(e),
@@ -29,7 +29,7 @@ var e = {
29
29
  function n(e) {
30
30
  setTimeout(e, 0);
31
31
  }
32
- // ../../node_modules/.pnpm/@tanstack+query-core@5.105.0/node_modules/@tanstack/query-core/build/modern/utils.js
32
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/utils.js
33
33
  var r = typeof window > "u" || "Deno" in globalThis;
34
34
  function i() {}
35
35
  function a(e, t) {
@@ -112,7 +112,7 @@ function h(e, t, n = 0) {
112
112
  }
113
113
  function g(e, t) {
114
114
  if (!t || Object.keys(e).length !== Object.keys(t).length) return !1;
115
- for (let n in e) if (e[n] !== t[n]) return !1;
115
+ for (let n of Object.keys(e)) if (!m.call(t, n) || e[n] !== t[n]) return !1;
116
116
  return !0;
117
117
  }
118
118
  function _(e) {
@@ -148,11 +148,11 @@ function x(e, t, n) {
148
148
  }
149
149
  function S(e, t, n = 0) {
150
150
  let r = [...e, t];
151
- return n && r.length > n ? r.slice(1) : r;
151
+ return n && r.length > n ? r.slice(-n) : r;
152
152
  }
153
153
  function C(e, t, n = 0) {
154
154
  let r = [t, ...e];
155
- return n && r.length > n ? r.slice(0, -1) : r;
155
+ return n && r.length > n ? r.slice(0, n) : r;
156
156
  }
157
157
  var w = Symbol();
158
158
  function T(e, t) {
@@ -161,15 +161,19 @@ function T(e, t) {
161
161
  function E(e, t) {
162
162
  return typeof e == "function" ? e(...t) : !!e;
163
163
  }
164
- function D(e, t, n) {
165
- let r = !1, i;
166
- return Object.defineProperty(e, "signal", {
167
- enumerable: !0,
168
- get: () => (i ??= t(), r || (r = !0, i.aborted ? n() : i.addEventListener("abort", n, { once: !0 })), i)
164
+ var D = Symbol();
165
+ function O(e, t, n, r) {
166
+ let i = !1, a;
167
+ return Object.defineProperties(e, {
168
+ [D]: { value: r },
169
+ signal: {
170
+ enumerable: !0,
171
+ get: () => (a ??= t(), i || (i = !0, a.aborted ? n() : a.addEventListener("abort", n, { once: !0 })), a)
172
+ }
169
173
  }), e;
170
174
  }
171
- // ../../node_modules/.pnpm/@tanstack+query-core@5.105.0/node_modules/@tanstack/query-core/build/modern/environmentManager.js
172
- var O = () => r, k = () => O(), A = class {
175
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/environmentManager.js
176
+ var k = () => r, A = () => k(), j = class {
173
177
  constructor() {
174
178
  this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
175
179
  }
@@ -183,7 +187,7 @@ var O = () => r, k = () => O(), A = class {
183
187
  }
184
188
  onSubscribe() {}
185
189
  onUnsubscribe() {}
186
- }, j = new class extends A {
190
+ }, M = new class extends j {
187
191
  #e;
188
192
  #t;
189
193
  #n;
@@ -220,13 +224,13 @@ var O = () => r, k = () => O(), A = class {
220
224
  isFocused() {
221
225
  return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
222
226
  }
223
- }(), M = n;
224
- function N() {
227
+ }(), N = n;
228
+ function P() {
225
229
  let e = [], t = 0, n = (e) => {
226
230
  e();
227
231
  }, r = (e) => {
228
232
  e();
229
- }, i = M, a = (r) => {
233
+ }, i = N, a = (r) => {
230
234
  t ? e.push(r) : i(() => {
231
235
  n(r);
232
236
  });
@@ -268,7 +272,7 @@ function N() {
268
272
  }
269
273
  };
270
274
  }
271
- var P = N(), F = new class extends A {
275
+ var F = P(), I = new class extends j {
272
276
  #e = !0;
273
277
  #t;
274
278
  #n;
@@ -300,33 +304,33 @@ var P = N(), F = new class extends A {
300
304
  return this.#e;
301
305
  }
302
306
  }();
303
- // ../../node_modules/.pnpm/@tanstack+query-core@5.105.0/node_modules/@tanstack/query-core/build/modern/retryer.js
304
- function I(e) {
307
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/retryer.js
308
+ function L(e) {
305
309
  return Math.min(1e3 * 2 ** e, 3e4);
306
310
  }
307
- function L(e) {
308
- return (e ?? "online") !== "online" || F.isOnline();
311
+ function R(e) {
312
+ return (e ?? "online") !== "online" || I.isOnline();
309
313
  }
310
- var R = class extends Error {
314
+ var z = class extends Error {
311
315
  constructor(e) {
312
316
  super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
313
317
  }
314
318
  };
315
- function z(e) {
319
+ function B(e) {
316
320
  let t = !1, n = 0, r, a = "pending", o, s, c = new Promise((e, t) => {
317
321
  o = e, s = t;
318
322
  });
319
323
  c.catch(i);
320
324
  let l = () => a !== "pending", u = (t) => {
321
325
  if (!l()) {
322
- let n = new R(t);
326
+ let n = new z(t);
323
327
  g(n), e.onCancel?.(n);
324
328
  }
325
329
  }, d = () => {
326
330
  t = !0;
327
331
  }, f = () => {
328
332
  t = !1;
329
- }, p = () => j.isFocused() && (e.networkMode === "always" || F.isOnline()) && e.canRun(), m = () => L(e.networkMode) && e.canRun(), h = (e) => {
333
+ }, p = () => M.isFocused() && (e.networkMode === "always" || I.isOnline()) && e.canRun(), m = () => R(e.networkMode) && e.canRun(), h = (e) => {
330
334
  l() || (r?.(), a = "resolved", o(e));
331
335
  }, g = (e) => {
332
336
  l() || (r?.(), a = "rejected", s(e));
@@ -346,8 +350,8 @@ function z(e) {
346
350
  }
347
351
  Promise.resolve(r).then(h).catch((r) => {
348
352
  if (l()) return;
349
- let i = e.retry ?? (k() ? 0 : 3), a = e.retryDelay ?? I, o = typeof a == "function" ? a(n, r) : a, s = i === !0 || typeof i == "number" && n < i || typeof i == "function" && i(n, r);
350
- t || !s ? g(r) : (n++, e.onFail?.(n, r), b(o).then(() => p() ? void 0 : _(p)).then(() => {
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(() => {
351
355
  t ? g(r) : v();
352
356
  }));
353
357
  });
@@ -363,8 +367,8 @@ function z(e) {
363
367
  start: () => (m() ? v() : _(m).then(v), c)
364
368
  };
365
369
  }
366
- // ../../node_modules/.pnpm/@tanstack+query-core@5.105.0/node_modules/@tanstack/query-core/build/modern/removable.js
367
- var B = class {
370
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/removable.js
371
+ var V = class {
368
372
  #e;
369
373
  destroy() {
370
374
  this.clearGcTimeout();
@@ -375,22 +379,22 @@ var B = class {
375
379
  }, this.gcTime));
376
380
  }
377
381
  updateGcTime(e) {
378
- this.gcTime = Math.max(this.gcTime || 0, e ?? (k() ? Infinity : 3e5));
382
+ this.gcTime = Math.max(this.gcTime || 0, e ?? (A() ? Infinity : 3e5));
379
383
  }
380
384
  clearGcTimeout() {
381
385
  this.#e !== void 0 && (t.clearTimeout(this.#e), this.#e = void 0);
382
386
  }
383
387
  };
384
- // ../../node_modules/.pnpm/@tanstack+query-core@5.105.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
385
- function V(e) {
388
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
389
+ function H(e) {
386
390
  return { onFetch: (t, n) => {
387
391
  let r = t.options, i = t.fetchOptions?.meta?.fetchMore?.direction, a = t.state.data?.pages || [], o = t.state.data?.pageParams || [], s = {
388
392
  pages: [],
389
393
  pageParams: []
390
394
  }, c = 0, l = async () => {
391
- let n = !1, l = (e) => {
392
- D(e, () => t.signal, () => n = !0);
393
- }, u = T(t.options, t.fetchOptions), d = async (e, r, i) => {
395
+ let n = !1, l = t, u = (e) => {
396
+ O(e, () => t.signal, () => n = !0, l[D]);
397
+ }, d = T(t.options, t.fetchOptions), f = async (e, r, i) => {
394
398
  if (n) return Promise.reject(t.signal.reason);
395
399
  if (r == null && e.pages.length) return Promise.resolve(e);
396
400
  let a = (() => {
@@ -401,25 +405,25 @@ function V(e) {
401
405
  direction: i ? "backward" : "forward",
402
406
  meta: t.options.meta
403
407
  };
404
- return l(e), e;
405
- })(), o = await u(a), { maxPages: s } = t.options, c = i ? C : S;
408
+ return u(e), e;
409
+ })(), o = await d(a), { maxPages: s } = t.options, c = i ? C : S;
406
410
  return {
407
411
  pages: c(e.pages, o, s),
408
412
  pageParams: c(e.pageParams, r, s)
409
413
  };
410
414
  };
411
415
  if (i && a.length) {
412
- let e = i === "backward", t = e ? U : H, n = {
416
+ let e = i === "backward", t = e ? W : U, n = {
413
417
  pages: a,
414
418
  pageParams: o
415
419
  };
416
- s = await d(n, t(r, n), e);
420
+ s = await f(n, t(r, n), e);
417
421
  } else {
418
422
  let t = e ?? a.length;
419
423
  do {
420
- let e = c === 0 ? o[0] === void 0 ? r.initialPageParam : o[0] : H(r, s);
424
+ let e = c === 0 ? o[0] === void 0 ? r.initialPageParam : o[0] : U(r, s);
421
425
  if (c > 0 && e == null) break;
422
- s = await d(s, e), c++;
426
+ s = await f(s, e), c++;
423
427
  } while (c < t);
424
428
  }
425
429
  return s;
@@ -432,15 +436,15 @@ function V(e) {
432
436
  }, n) : l;
433
437
  } };
434
438
  }
435
- function H(e, { pages: t, pageParams: n }) {
439
+ function U(e, { pages: t, pageParams: n }) {
436
440
  let r = t.length - 1;
437
441
  return t.length > 0 ? e.getNextPageParam(t[r], t, n[r], n) : void 0;
438
442
  }
439
- function U(e, { pages: t, pageParams: n }) {
443
+ function W(e, { pages: t, pageParams: n }) {
440
444
  return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, n[0], n) : void 0;
441
445
  }
442
- // ../../node_modules/.pnpm/@tanstack+query-core@5.105.0/node_modules/@tanstack/query-core/build/modern/query.js
443
- var W = class extends B {
446
+ // ../../node_modules/.pnpm/@tanstack+query-core@5.107.1/node_modules/@tanstack/query-core/build/modern/query.js
447
+ var G = class extends V {
444
448
  #e;
445
449
  #t;
446
450
  #n;
@@ -449,8 +453,9 @@ var W = class extends B {
449
453
  #a;
450
454
  #o;
451
455
  #s;
456
+ #c;
452
457
  constructor(e) {
453
- super(), this.#s = !1, this.#o = 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();
458
+ 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();
454
459
  }
455
460
  get meta() {
456
461
  return this.options.meta;
@@ -463,11 +468,11 @@ var W = class extends B {
463
468
  }
464
469
  setOptions(e) {
465
470
  if (this.options = {
466
- ...this.#o,
471
+ ...this.#s,
467
472
  ...e
468
473
  }, e?._type && (this.#e = e._type), this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
469
- let e = q(this.options);
470
- e.data !== void 0 && (this.setState(K(e.data, e.dataUpdatedAt)), this.#t = e);
474
+ let e = J(this.options);
475
+ e.data !== void 0 && (this.setState(q(e.data, e.dataUpdatedAt)), this.#t = e);
471
476
  }
472
477
  }
473
478
  optionalRemove() {
@@ -475,7 +480,7 @@ var W = class extends B {
475
480
  }
476
481
  setData(e, t) {
477
482
  let n = x(this.state.data, e, this.options);
478
- return this.#c({
483
+ return this.#l({
479
484
  data: n,
480
485
  type: "success",
481
486
  dataUpdatedAt: t?.updatedAt,
@@ -483,7 +488,7 @@ var W = class extends B {
483
488
  }), n;
484
489
  }
485
490
  setState(e) {
486
- this.#c({
491
+ this.#l({
487
492
  type: "setState",
488
493
  state: e
489
494
  });
@@ -511,7 +516,7 @@ var W = class extends B {
511
516
  return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;
512
517
  }
513
518
  isStatic() {
514
- return this.getObserversCount() > 0 && this.observers.some((e) => c(e.options.staleTime, this) === "static");
519
+ return this.state.data !== void 0 && this.getObserversCount() > 0 && this.observers.some((e) => c(e.options.staleTime, this) === "static");
515
520
  }
516
521
  isStale() {
517
522
  return this.getObserversCount() > 0 ? this.observers.some((e) => e.getCurrentResult().isStale) : this.state.data === void 0 || this.state.isInvalidated;
@@ -534,7 +539,7 @@ var W = class extends B {
534
539
  }
535
540
  removeObserver(e) {
536
541
  let t = this.observers.indexOf(e);
537
- t !== -1 && (this.observers.splice(t, 1), this.observers.length || (this.#a && (this.#s || this.state.fetchStatus === "paused" && this.state.status === "pending" ? this.#a.cancel({ revert: !0 }) : this.#a.cancelRetry()), this.scheduleGc()), this.#r.notify({
542
+ 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({
538
543
  type: "observerRemoved",
539
544
  query: this,
540
545
  observer: e
@@ -544,12 +549,12 @@ var W = class extends B {
544
549
  return this.observers.length;
545
550
  }
546
551
  invalidate() {
547
- this.state.isInvalidated || this.#c({ type: "invalidate" });
552
+ this.state.isInvalidated || this.#l({ type: "invalidate" });
548
553
  }
549
554
  async fetch(e, t) {
550
555
  if (this.state.fetchStatus !== "idle" && this.#a?.status() !== "rejected") {
551
556
  if (this.state.data !== void 0 && t?.cancelRefetch) this.cancel({ silent: !0 });
552
- else if (this.#a) return this.#a.continueRetry(), this.#a.promise;
557
+ else if (this.#a && this.#o) return this.#a.continueRetry(), this.#o;
553
558
  }
554
559
  if (e && this.setOptions(e), !this.options.queryFn) {
555
560
  let e = this.observers.find((e) => e.options.queryFn);
@@ -557,9 +562,15 @@ var W = class extends B {
557
562
  }
558
563
  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']"));
559
564
  let n = new AbortController(), r = (e) => {
560
- Object.defineProperty(e, "signal", {
561
- enumerable: !0,
562
- get: () => (this.#s = !0, n.signal)
565
+ Object.defineProperties(e, {
566
+ [D]: {
567
+ value: n.signal,
568
+ enumerable: !0
569
+ },
570
+ signal: {
571
+ enumerable: !0,
572
+ get: () => (this.#c = !0, n.signal)
573
+ }
563
574
  });
564
575
  }, i = () => {
565
576
  let e = T(this.options, t), n = (() => {
@@ -570,7 +581,7 @@ var W = class extends B {
570
581
  };
571
582
  return r(e), e;
572
583
  })();
573
- return this.#s = !1, this.options.persister ? this.options.persister(e, n, this) : e(n);
584
+ return this.#c = !1, this.options.persister ? this.options.persister(e, n, this) : e(n);
574
585
  }, a = (() => {
575
586
  let e = {
576
587
  fetchOptions: t,
@@ -582,58 +593,63 @@ var W = class extends B {
582
593
  };
583
594
  return r(e), e;
584
595
  })();
585
- (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.#c({
596
+ (this.#e === "infinite" ? H(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({
586
597
  type: "fetch",
587
598
  meta: a.fetchOptions?.meta
588
599
  });
589
- let o = this.#a = z({
600
+ let o = this.#a = B({
590
601
  initialPromise: t?.initialPromise,
591
602
  fn: a.fetchFn,
592
603
  onCancel: (e) => {
593
- e instanceof R && e.revert && this.setState({
604
+ e instanceof z && e.revert && this.setState({
594
605
  ...this.#n,
595
606
  fetchStatus: "idle"
596
607
  }), n.abort();
597
608
  },
598
609
  onFail: (e, t) => {
599
- this.#c({
610
+ this.#l({
600
611
  type: "failed",
601
612
  failureCount: e,
602
613
  error: t
603
614
  });
604
615
  },
605
616
  onPause: () => {
606
- this.#c({ type: "pause" });
617
+ this.#l({ type: "pause" });
607
618
  },
608
619
  onContinue: () => {
609
- this.#c({ type: "continue" });
620
+ this.#l({ type: "continue" });
610
621
  },
611
622
  retry: a.options.retry,
612
623
  retryDelay: a.options.retryDelay,
613
624
  networkMode: a.options.networkMode,
614
625
  canRun: () => !0
615
- });
616
- try {
617
- let e = await o.start();
618
- 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`);
619
- return this.setData(e), this.#r.config.onSuccess?.(e, this), this.#r.config.onSettled?.(e, this.state.error, this), e;
620
- } catch (e) {
621
- if (e instanceof R) {
622
- if (e.silent) return this.#a.promise;
623
- if (e.revert) {
624
- if (this.state.data === void 0) throw e;
625
- return this.state.data;
626
+ }), s = (async () => {
627
+ try {
628
+ let e = await o.promise;
629
+ 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`);
630
+ return this.setData(e), this.#r.config.onSuccess?.(e, this), this.#r.config.onSettled?.(e, this.state.error, this), e;
631
+ } catch (e) {
632
+ if (e instanceof z) {
633
+ if (e.silent) {
634
+ if (this.#a !== o && this.#o) return this.#o;
635
+ throw e;
636
+ }
637
+ if (e.revert) {
638
+ if (this.state.data === void 0) throw e;
639
+ return this.state.data;
640
+ }
626
641
  }
642
+ throw this.#l({
643
+ type: "error",
644
+ error: e
645
+ }), this.#r.config.onError?.(e, this), this.#r.config.onSettled?.(this.state.data, e, this), e;
646
+ } finally {
647
+ this.#a === o && (this.#a = void 0, this.#o = void 0), this.scheduleGc();
627
648
  }
628
- throw this.#c({
629
- type: "error",
630
- error: e
631
- }), this.#r.config.onError?.(e, this), this.#r.config.onSettled?.(this.state.data, e, this), e;
632
- } finally {
633
- this.#a === o && (this.#a = void 0), this.scheduleGc();
634
- }
649
+ })();
650
+ return this.#o = s, o.start(), s;
635
651
  }
636
- #c(e) {
652
+ #l(e) {
637
653
  let t = (t) => {
638
654
  switch (e.type) {
639
655
  case "failed": return {
@@ -651,13 +667,13 @@ var W = class extends B {
651
667
  };
652
668
  case "fetch": return {
653
669
  ...t,
654
- ...G(t.data, this.options),
670
+ ...K(t.data, this.options),
655
671
  fetchMeta: e.meta ?? null
656
672
  };
657
673
  case "success":
658
674
  let n = {
659
675
  ...t,
660
- ...K(e.data, e.dataUpdatedAt),
676
+ ...q(e.data, e.dataUpdatedAt),
661
677
  dataUpdateCount: t.dataUpdateCount + 1,
662
678
  ...!e.manual && {
663
679
  fetchStatus: "idle",
@@ -689,7 +705,7 @@ var W = class extends B {
689
705
  };
690
706
  }
691
707
  };
692
- this.state = t(this.state), P.batch(() => {
708
+ this.state = t(this.state), F.batch(() => {
693
709
  this.observers.slice().forEach((e) => {
694
710
  e.onQueryUpdate();
695
711
  }), this.#r.notify({
@@ -700,18 +716,18 @@ var W = class extends B {
700
716
  });
701
717
  }
702
718
  };
703
- function G(e, t) {
719
+ function K(e, t) {
704
720
  return {
705
721
  fetchFailureCount: 0,
706
722
  fetchFailureReason: null,
707
- fetchStatus: L(t.networkMode) ? "fetching" : "paused",
723
+ fetchStatus: R(t.networkMode) ? "fetching" : "paused",
708
724
  ...e === void 0 && {
709
725
  error: null,
710
726
  status: "pending"
711
727
  }
712
728
  };
713
729
  }
714
- function K(e, t) {
730
+ function q(e, t) {
715
731
  return {
716
732
  data: e,
717
733
  dataUpdatedAt: t ?? Date.now(),
@@ -720,7 +736,7 @@ function K(e, t) {
720
736
  status: "success"
721
737
  };
722
738
  }
723
- function q(e) {
739
+ function J(e) {
724
740
  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;
725
741
  return {
726
742
  data: t,
@@ -737,6 +753,6 @@ function q(e) {
737
753
  fetchStatus: "idle"
738
754
  };
739
755
  }
740
- export { s as C, w as S, p as _, F as a, g as b, A as c, f as d, d as f, i as g, l as h, z as i, k as l, u as m, G as n, P as o, o as p, B as r, j as s, W as t, a as u, x as v, t as w, E as x, c as y };
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, V as r, M as s, G as t, a as u, x as v, t as w, E as x, c as y };
741
757
 
742
758
  //# sourceMappingURL=query.js.map