@ahoo-wang/fetcher-react 3.5.8 → 3.6.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 (75) hide show
  1. package/README.md +868 -609
  2. package/README.zh-CN.md +2079 -672
  3. package/dist/core/debounced/index.d.ts +4 -0
  4. package/dist/core/debounced/index.d.ts.map +1 -0
  5. package/dist/core/debounced/useDebouncedCallback.d.ts.map +1 -0
  6. package/dist/core/{useDebouncedExecutePromise.d.ts → debounced/useDebouncedExecutePromise.d.ts} +1 -1
  7. package/dist/core/debounced/useDebouncedExecutePromise.d.ts.map +1 -0
  8. package/dist/{wow/debounce → core/debounced}/useDebouncedQuery.d.ts +1 -2
  9. package/dist/core/debounced/useDebouncedQuery.d.ts.map +1 -0
  10. package/dist/core/index.d.ts +3 -2
  11. package/dist/core/index.d.ts.map +1 -1
  12. package/dist/{wow → core}/useQuery.d.ts +2 -2
  13. package/dist/core/useQuery.d.ts.map +1 -0
  14. package/dist/{wow → core}/useQueryState.d.ts +1 -1
  15. package/dist/core/useQueryState.d.ts.map +1 -0
  16. package/dist/cosec/useSecurity.d.ts +1 -1
  17. package/dist/fetcher/debounced/index.d.ts +3 -0
  18. package/dist/fetcher/debounced/index.d.ts.map +1 -0
  19. package/dist/fetcher/{useDebouncedFetcher.d.ts → debounced/useDebouncedFetcher.d.ts} +2 -2
  20. package/dist/fetcher/debounced/useDebouncedFetcher.d.ts.map +1 -0
  21. package/dist/{wow/debounce → fetcher/debounced}/useDebouncedFetcherQuery.d.ts +1 -1
  22. package/dist/fetcher/debounced/useDebouncedFetcherQuery.d.ts.map +1 -0
  23. package/dist/fetcher/index.d.ts +2 -1
  24. package/dist/fetcher/index.d.ts.map +1 -1
  25. package/dist/{wow → fetcher}/useFetcherQuery.d.ts +3 -3
  26. package/dist/fetcher/useFetcherQuery.d.ts.map +1 -0
  27. package/dist/index.es.js +308 -308
  28. package/dist/index.es.js.map +1 -1
  29. package/dist/index.umd.js +1 -1
  30. package/dist/index.umd.js.map +1 -1
  31. package/dist/types.d.ts +6 -0
  32. package/dist/types.d.ts.map +1 -1
  33. package/dist/wow/fetcher/index.d.ts +6 -0
  34. package/dist/wow/fetcher/index.d.ts.map +1 -0
  35. package/dist/wow/{useFetcherCountQuery.d.ts → fetcher/useFetcherCountQuery.d.ts} +2 -2
  36. package/dist/wow/fetcher/useFetcherCountQuery.d.ts.map +1 -0
  37. package/dist/wow/{useFetcherListQuery.d.ts → fetcher/useFetcherListQuery.d.ts} +2 -2
  38. package/dist/wow/fetcher/useFetcherListQuery.d.ts.map +1 -0
  39. package/dist/wow/{useFetcherListStreamQuery.d.ts → fetcher/useFetcherListStreamQuery.d.ts} +2 -2
  40. package/dist/wow/fetcher/useFetcherListStreamQuery.d.ts.map +1 -0
  41. package/dist/wow/{useFetcherPagedQuery.d.ts → fetcher/useFetcherPagedQuery.d.ts} +2 -2
  42. package/dist/wow/fetcher/useFetcherPagedQuery.d.ts.map +1 -0
  43. package/dist/wow/{useFetcherSingleQuery.d.ts → fetcher/useFetcherSingleQuery.d.ts} +2 -2
  44. package/dist/wow/fetcher/useFetcherSingleQuery.d.ts.map +1 -0
  45. package/dist/wow/index.d.ts +1 -10
  46. package/dist/wow/index.d.ts.map +1 -1
  47. package/dist/wow/useCountQuery.d.ts +1 -1
  48. package/dist/wow/useCountQuery.d.ts.map +1 -1
  49. package/dist/wow/useListQuery.d.ts +1 -1
  50. package/dist/wow/useListQuery.d.ts.map +1 -1
  51. package/dist/wow/useListStreamQuery.d.ts +1 -1
  52. package/dist/wow/useListStreamQuery.d.ts.map +1 -1
  53. package/dist/wow/usePagedQuery.d.ts +1 -1
  54. package/dist/wow/usePagedQuery.d.ts.map +1 -1
  55. package/dist/wow/useSingleQuery.d.ts +1 -1
  56. package/dist/wow/useSingleQuery.d.ts.map +1 -1
  57. package/package.json +1 -1
  58. package/dist/core/useDebouncedCallback.d.ts.map +0 -1
  59. package/dist/core/useDebouncedExecutePromise.d.ts.map +0 -1
  60. package/dist/fetcher/useDebouncedFetcher.d.ts.map +0 -1
  61. package/dist/wow/debounce/index.d.ts +0 -3
  62. package/dist/wow/debounce/index.d.ts.map +0 -1
  63. package/dist/wow/debounce/useDebouncedFetcherQuery.d.ts.map +0 -1
  64. package/dist/wow/debounce/useDebouncedQuery.d.ts.map +0 -1
  65. package/dist/wow/types.d.ts +0 -7
  66. package/dist/wow/types.d.ts.map +0 -1
  67. package/dist/wow/useFetcherCountQuery.d.ts.map +0 -1
  68. package/dist/wow/useFetcherListQuery.d.ts.map +0 -1
  69. package/dist/wow/useFetcherListStreamQuery.d.ts.map +0 -1
  70. package/dist/wow/useFetcherPagedQuery.d.ts.map +0 -1
  71. package/dist/wow/useFetcherQuery.d.ts.map +0 -1
  72. package/dist/wow/useFetcherSingleQuery.d.ts.map +0 -1
  73. package/dist/wow/useQuery.d.ts.map +0 -1
  74. package/dist/wow/useQueryState.d.ts.map +0 -1
  75. /package/dist/core/{useDebouncedCallback.d.ts → debounced/useDebouncedCallback.d.ts} +0 -0
package/dist/index.es.js CHANGED
@@ -1,12 +1,86 @@
1
1
  var B = Object.defineProperty;
2
2
  var l = (r, e) => B(r, "name", { value: e, configurable: !0 });
3
- import { useRef as I, useEffect as $, useState as D, useCallback as _, useMemo as M, useReducer as H, useSyncExternalStore as X, createContext as Z, useContext as ee } from "react";
4
3
  import { c as w } from "react/compiler-runtime";
4
+ import { useRef as I, useEffect as $, useState as D, useCallback as _, useMemo as M, useReducer as H, useSyncExternalStore as X, createContext as Z, useContext as ee } from "react";
5
5
  import { jsx as N, Fragment as te } from "react/jsx-runtime";
6
6
  import { nameGenerator as re } from "@ahoo-wang/fetcher-eventbus";
7
7
  import { produce as ne } from "immer";
8
8
  import { fetcherRegistrar as ce, getFetcher as se, JsonResultExtractor as oe } from "@ahoo-wang/fetcher";
9
9
  import { JsonEventStreamResultExtractor as ue } from "@ahoo-wang/fetcher-eventstream";
10
+ function L(r) {
11
+ const e = I(r);
12
+ return e.current = r, e;
13
+ }
14
+ l(L, "useLatest");
15
+ function T(r, e) {
16
+ const t = w(19);
17
+ if (e.leading === !1 && e.trailing === !1)
18
+ throw new Error("useDebouncedCallback: at least one of leading or trailing must be true");
19
+ const n = I(void 0), o = I(null), c = I(null), s = L(r), u = L(e);
20
+ let i;
21
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ l(() => {
22
+ n.current !== void 0 && (clearTimeout(n.current), n.current = void 0);
23
+ }, "t0"), t[0] = i) : i = t[0];
24
+ const m = i;
25
+ let a;
26
+ t[1] !== u ? (a = /* @__PURE__ */ l((F) => c.current ? F - c.current >= u.current.delay : !0, "t1"), t[1] = u, t[2] = a) : a = t[2];
27
+ const f = a;
28
+ let d;
29
+ t[3] !== s ? (d = /* @__PURE__ */ l((F, C) => {
30
+ c.current = F, s.current(...C);
31
+ }, "t2"), t[3] = s, t[4] = d) : d = t[4];
32
+ const b = d;
33
+ let y;
34
+ t[5] !== b || t[6] !== u ? (y = /* @__PURE__ */ l(() => {
35
+ n.current = setTimeout(() => {
36
+ if (o.current) {
37
+ const F = Date.now();
38
+ b(F, o.current);
39
+ }
40
+ n.current = void 0;
41
+ }, u.current.delay);
42
+ }, "t3"), t[5] = b, t[6] = u, t[7] = y) : y = t[7];
43
+ const h = y;
44
+ let g;
45
+ t[8] !== b || t[9] !== u || t[10] !== h || t[11] !== f ? (g = /* @__PURE__ */ l((...F) => {
46
+ const C = F;
47
+ m();
48
+ const {
49
+ leading: q,
50
+ trailing: k
51
+ } = u.current, z = q === void 0 ? !1 : q, G = k === void 0 ? !0 : k;
52
+ if (o.current = C, G && !z) {
53
+ h();
54
+ return;
55
+ }
56
+ const K = Date.now();
57
+ if (z && f(K)) {
58
+ b(K, C);
59
+ return;
60
+ }
61
+ G && h();
62
+ }, "t4"), t[8] = b, t[9] = u, t[10] = h, t[11] = f, t[12] = g) : g = t[12];
63
+ const x = g;
64
+ let S;
65
+ t[13] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ l(() => {
66
+ m(), o.current = null;
67
+ }, "t5"), t[13] = S) : S = t[13];
68
+ const E = S;
69
+ let Q;
70
+ t[14] === Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ l(() => n.current !== void 0, "t6"), t[14] = Q) : Q = t[14];
71
+ const v = Q;
72
+ let R, O;
73
+ t[15] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ l(() => () => {
74
+ E();
75
+ }, "t7"), O = [E], t[15] = R, t[16] = O) : (R = t[15], O = t[16]), $(R, O);
76
+ let p;
77
+ return t[17] !== x ? (p = {
78
+ run: x,
79
+ cancel: E,
80
+ isPending: v
81
+ }, t[17] = x, t[18] = p) : p = t[18], p;
82
+ }
83
+ l(T, "useDebouncedCallback");
10
84
  function V() {
11
85
  const r = w(3), e = I(!1);
12
86
  let t;
@@ -18,11 +92,6 @@ function V() {
18
92
  }), "t1"), c = [], r[1] = o, r[2] = c) : (o = r[1], c = r[2]), $(o, c), n;
19
93
  }
20
94
  l(V, "useMounted");
21
- function L(r) {
22
- const e = I(r);
23
- return e.current = r, e;
24
- }
25
- l(L, "useLatest");
26
95
  var le = /* @__PURE__ */ ((r) => (r.IDLE = "idle", r.LOADING = "loading", r.SUCCESS = "success", r.ERROR = "error", r))(le || {});
27
96
  function ie(r) {
28
97
  const [e, t] = D(
@@ -159,99 +228,7 @@ function U(r) {
159
228
  }), [e, t, n, o, h, g, x]);
160
229
  }
161
230
  l(U, "useExecutePromise");
162
- function we() {
163
- const r = I(/* @__PURE__ */ new Map()), e = _((f) => r.current.get(f), []), t = _((f, d) => r.current.set(f, d), []), n = _((f) => r.current.has(f), []), o = _((f) => r.current.delete(f), []), c = _(() => r.current.clear(), []), s = _(() => r.current.keys(), []), u = _(() => r.current.values(), []), i = _(() => r.current.entries(), []), m = _(() => r.current[Symbol.iterator](), []), a = _((f) => (d) => {
164
- d ? r.current.set(f, d) : r.current.delete(f);
165
- }, []);
166
- return $(() => () => {
167
- r.current.clear();
168
- }, []), M(() => ({
169
- register: a,
170
- get: e,
171
- set: t,
172
- has: n,
173
- delete: o,
174
- clear: c,
175
- keys: s,
176
- values: u,
177
- entries: i,
178
- get size() {
179
- return r.current.size;
180
- },
181
- [Symbol.iterator]: m
182
- }), [a, e, t, n, o, c, s, u, i, m]);
183
- }
184
- l(we, "useRefs");
185
- function T(r, e) {
186
- const t = w(19);
187
- if (e.leading === !1 && e.trailing === !1)
188
- throw new Error("useDebouncedCallback: at least one of leading or trailing must be true");
189
- const n = I(void 0), o = I(null), c = I(null), s = L(r), u = L(e);
190
- let i;
191
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ l(() => {
192
- n.current !== void 0 && (clearTimeout(n.current), n.current = void 0);
193
- }, "t0"), t[0] = i) : i = t[0];
194
- const m = i;
195
- let a;
196
- t[1] !== u ? (a = /* @__PURE__ */ l((F) => c.current ? F - c.current >= u.current.delay : !0, "t1"), t[1] = u, t[2] = a) : a = t[2];
197
- const f = a;
198
- let d;
199
- t[3] !== s ? (d = /* @__PURE__ */ l((F, C) => {
200
- c.current = F, s.current(...C);
201
- }, "t2"), t[3] = s, t[4] = d) : d = t[4];
202
- const b = d;
203
- let y;
204
- t[5] !== b || t[6] !== u ? (y = /* @__PURE__ */ l(() => {
205
- n.current = setTimeout(() => {
206
- if (o.current) {
207
- const F = Date.now();
208
- b(F, o.current);
209
- }
210
- n.current = void 0;
211
- }, u.current.delay);
212
- }, "t3"), t[5] = b, t[6] = u, t[7] = y) : y = t[7];
213
- const h = y;
214
- let g;
215
- t[8] !== b || t[9] !== u || t[10] !== h || t[11] !== f ? (g = /* @__PURE__ */ l((...F) => {
216
- const C = F;
217
- m();
218
- const {
219
- leading: q,
220
- trailing: k
221
- } = u.current, z = q === void 0 ? !1 : q, G = k === void 0 ? !0 : k;
222
- if (o.current = C, G && !z) {
223
- h();
224
- return;
225
- }
226
- const K = Date.now();
227
- if (z && f(K)) {
228
- b(K, C);
229
- return;
230
- }
231
- G && h();
232
- }, "t4"), t[8] = b, t[9] = u, t[10] = h, t[11] = f, t[12] = g) : g = t[12];
233
- const x = g;
234
- let S;
235
- t[13] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ l(() => {
236
- m(), o.current = null;
237
- }, "t5"), t[13] = S) : S = t[13];
238
- const E = S;
239
- let Q;
240
- t[14] === Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ l(() => n.current !== void 0, "t6"), t[14] = Q) : Q = t[14];
241
- const v = Q;
242
- let R, O;
243
- t[15] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ l(() => () => {
244
- E();
245
- }, "t7"), O = [E], t[15] = R, t[16] = O) : (R = t[15], O = t[16]), $(R, O);
246
- let p;
247
- return t[17] !== x ? (p = {
248
- run: x,
249
- cancel: E,
250
- isPending: v
251
- }, t[17] = x, t[18] = p) : p = t[18], p;
252
- }
253
- l(T, "useDebouncedCallback");
254
- function Re(r) {
231
+ function we(r) {
255
232
  const e = w(10), {
256
233
  loading: t,
257
234
  result: n,
@@ -278,17 +255,142 @@ function Re(r) {
278
255
  isPending: f
279
256
  }, e[0] = u, e[1] = a, e[2] = o, e[3] = f, e[4] = t, e[5] = s, e[6] = n, e[7] = m, e[8] = i, e[9] = d) : d = e[9], d;
280
257
  }
281
- l(Re, "useDebouncedExecutePromise");
258
+ l(we, "useDebouncedExecutePromise");
259
+ function Re(r) {
260
+ const e = w(22), t = r.autoExecute;
261
+ let n;
262
+ e[0] !== r ? (n = {
263
+ ...r,
264
+ autoExecute: !1
265
+ }, e[0] = r, e[1] = n) : n = e[1];
266
+ const o = n, {
267
+ loading: c,
268
+ result: s,
269
+ error: u,
270
+ status: i,
271
+ execute: m,
272
+ reset: a,
273
+ abort: f,
274
+ getQuery: d,
275
+ setQuery: b
276
+ } = P(o), {
277
+ run: y,
278
+ cancel: h,
279
+ isPending: g
280
+ } = T(m, r.debounce);
281
+ let x;
282
+ e[2] !== t || e[3] !== y || e[4] !== b ? (x = /* @__PURE__ */ l((R) => {
283
+ b(R), t && y();
284
+ }, "t1"), e[2] = t, e[3] = y, e[4] = b, e[5] = x) : x = e[5];
285
+ const S = x;
286
+ let E, Q;
287
+ e[6] !== t || e[7] !== y ? (E = /* @__PURE__ */ l(() => {
288
+ t && y();
289
+ }, "t2"), Q = [y, t], e[6] = t, e[7] = y, e[8] = E, e[9] = Q) : (E = e[8], Q = e[9]), $(E, Q);
290
+ let v;
291
+ return e[10] !== f || e[11] !== h || e[12] !== u || e[13] !== d || e[14] !== g || e[15] !== c || e[16] !== a || e[17] !== s || e[18] !== y || e[19] !== S || e[20] !== i ? (v = {
292
+ loading: c,
293
+ result: s,
294
+ error: u,
295
+ status: i,
296
+ reset: a,
297
+ abort: f,
298
+ getQuery: d,
299
+ setQuery: S,
300
+ run: y,
301
+ cancel: h,
302
+ isPending: g
303
+ }, e[10] = f, e[11] = h, e[12] = u, e[13] = d, e[14] = g, e[15] = c, e[16] = a, e[17] = s, e[18] = y, e[19] = S, e[20] = i, e[21] = v) : v = e[21], v;
304
+ }
305
+ l(Re, "useDebouncedQuery");
282
306
  function Fe() {
307
+ const r = I(/* @__PURE__ */ new Map()), e = _((f) => r.current.get(f), []), t = _((f, d) => r.current.set(f, d), []), n = _((f) => r.current.has(f), []), o = _((f) => r.current.delete(f), []), c = _(() => r.current.clear(), []), s = _(() => r.current.keys(), []), u = _(() => r.current.values(), []), i = _(() => r.current.entries(), []), m = _(() => r.current[Symbol.iterator](), []), a = _((f) => (d) => {
308
+ d ? r.current.set(f, d) : r.current.delete(f);
309
+ }, []);
310
+ return $(() => () => {
311
+ r.current.clear();
312
+ }, []), M(() => ({
313
+ register: a,
314
+ get: e,
315
+ set: t,
316
+ has: n,
317
+ delete: o,
318
+ clear: c,
319
+ keys: s,
320
+ values: u,
321
+ entries: i,
322
+ get size() {
323
+ return r.current.size;
324
+ },
325
+ [Symbol.iterator]: m
326
+ }), [a, e, t, n, o, c, s, u, i, m]);
327
+ }
328
+ l(Fe, "useRefs");
329
+ function Ce() {
283
330
  const [, r] = H(fe, 0);
284
331
  return r;
285
332
  }
286
- l(Fe, "useForceUpdate");
333
+ l(Ce, "useForceUpdate");
287
334
  function fe(r) {
288
335
  return r + 1;
289
336
  }
290
337
  l(fe, "_temp");
291
- function j(r, e) {
338
+ function j(r) {
339
+ const e = w(10), {
340
+ initialQuery: t,
341
+ autoExecute: n,
342
+ execute: o
343
+ } = r, c = n ?? !0, s = I(t);
344
+ let u;
345
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ l(() => s.current, "t0"), e[0] = u) : u = e[0];
346
+ const i = u;
347
+ let m;
348
+ e[1] !== c || e[2] !== o ? (m = /* @__PURE__ */ l((y) => {
349
+ s.current = y, c && o(y);
350
+ }, "t1"), e[1] = c, e[2] = o, e[3] = m) : m = e[3];
351
+ const a = m;
352
+ let f, d;
353
+ e[4] !== c || e[5] !== o ? (f = /* @__PURE__ */ l(() => {
354
+ c && o(s.current);
355
+ }, "t2"), d = [c, o], e[4] = c, e[5] = o, e[6] = f, e[7] = d) : (f = e[6], d = e[7]), $(f, d);
356
+ let b;
357
+ return e[8] !== a ? (b = {
358
+ getQuery: i,
359
+ setQuery: a
360
+ }, e[8] = a, e[9] = b) : b = e[9], b;
361
+ }
362
+ l(j, "useQueryState");
363
+ function P(r) {
364
+ const e = L(r), {
365
+ loading: t,
366
+ result: n,
367
+ error: o,
368
+ status: c,
369
+ execute: s,
370
+ reset: u,
371
+ abort: i
372
+ } = U(e.current), m = _((b) => s(/* @__PURE__ */ l(async (h) => e.current.execute(b, e.current.attributes, h), "queryExecutor")), [s, e]), {
373
+ getQuery: a,
374
+ setQuery: f
375
+ } = j({
376
+ initialQuery: r.initialQuery,
377
+ autoExecute: e.current.autoExecute,
378
+ execute: m
379
+ }), d = _(() => m(a()), [m, a]);
380
+ return M(() => ({
381
+ loading: t,
382
+ result: n,
383
+ error: o,
384
+ status: c,
385
+ execute: d,
386
+ reset: u,
387
+ abort: i,
388
+ getQuery: a,
389
+ setQuery: f
390
+ }), [t, n, o, c, d, u, i, a, f]);
391
+ }
392
+ l(P, "useQuery");
393
+ function J(r, e) {
292
394
  const t = w(13);
293
395
  let n;
294
396
  t[0] !== r ? (n = /* @__PURE__ */ l((b) => r.addListener({
@@ -311,9 +413,9 @@ function j(r, e) {
311
413
  let d;
312
414
  return t[9] !== f || t[10] !== m || t[11] !== u ? (d = [u, m, f], t[9] = f, t[10] = m, t[11] = u, t[12] = d) : d = t[12], d;
313
415
  }
314
- l(j, "useKeyStorage");
315
- function Ce(r, e) {
316
- const t = w(8), [n, o, c] = j(r, e);
416
+ l(J, "useKeyStorage");
417
+ function Oe(r, e) {
418
+ const t = w(8), [n, o, c] = J(r, e);
317
419
  let s;
318
420
  t[0] !== c || t[1] !== o || t[2] !== n ? (s = /* @__PURE__ */ l((m) => {
319
421
  const a = ne(n, m);
@@ -327,7 +429,7 @@ function Ce(r, e) {
327
429
  let i;
328
430
  return t[4] !== c || t[5] !== u || t[6] !== n ? (i = [n, u, c], t[4] = c, t[5] = u, t[6] = n, t[7] = i) : i = t[7], i;
329
431
  }
330
- l(Ce, "useImmerKeyStorage");
432
+ l(Oe, "useImmerKeyStorage");
331
433
  const de = {
332
434
  jti: "",
333
435
  sub: "anonymous",
@@ -338,7 +440,7 @@ function me(r, e) {
338
440
  const t = w(13);
339
441
  let n;
340
442
  t[0] !== e ? (n = e === void 0 ? {} : e, t[0] = e, t[1] = n) : n = t[1];
341
- const o = n, [c, , s] = j(r), u = L(o);
443
+ const o = n, [c, , s] = J(r), u = L(o);
342
444
  let i;
343
445
  t[2] !== u || t[3] !== r ? (i = /* @__PURE__ */ l(async (h) => {
344
446
  const g = typeof h == "function" ? await h() : h;
@@ -359,8 +461,8 @@ function me(r, e) {
359
461
  }, t[8] = m, t[9] = f, t[10] = d, t[11] = b, t[12] = y) : y = t[12], y;
360
462
  }
361
463
  l(me, "useSecurity");
362
- const J = Z(void 0);
363
- function Oe(r) {
464
+ const W = Z(void 0);
465
+ function Ie(r) {
364
466
  const e = w(7);
365
467
  let t, n, o;
366
468
  e[0] !== r ? ({
@@ -370,17 +472,17 @@ function Oe(r) {
370
472
  } = r, e[0] = r, e[1] = t, e[2] = n, e[3] = o) : (t = e[1], n = e[2], o = e[3]);
371
473
  const c = me(n, o);
372
474
  let s;
373
- return e[4] !== t || e[5] !== c ? (s = /* @__PURE__ */ N(J.Provider, { value: c, children: t }), e[4] = t, e[5] = c, e[6] = s) : s = e[6], s;
475
+ return e[4] !== t || e[5] !== c ? (s = /* @__PURE__ */ N(W.Provider, { value: c, children: t }), e[4] = t, e[5] = c, e[6] = s) : s = e[6], s;
374
476
  }
375
- l(Oe, "SecurityProvider");
477
+ l(Ie, "SecurityProvider");
376
478
  function be() {
377
- const r = ee(J);
479
+ const r = ee(W);
378
480
  if (!r)
379
481
  throw new Error("useSecurityContext must be used within a SecurityProvider");
380
482
  return r;
381
483
  }
382
484
  l(be, "useSecurityContext");
383
- function Ie(r) {
485
+ function Le(r) {
384
486
  const e = w(2), {
385
487
  children: t,
386
488
  fallback: n,
@@ -394,8 +496,8 @@ function Ie(r) {
394
496
  }
395
497
  return o && o(), n;
396
498
  }
397
- l(Ie, "RouteGuard");
398
- function W(r) {
499
+ l(Le, "RouteGuard");
500
+ function Y(r) {
399
501
  const e = w(21);
400
502
  let t;
401
503
  e[0] !== r ? (t = r || {}, e[0] = r, e[1] = t) : t = e[1];
@@ -449,8 +551,8 @@ function W(r) {
449
551
  abort: R
450
552
  }, e[12] = R, e[13] = u, e[14] = d, e[15] = S, e[16] = c, e[17] = Q, e[18] = s, e[19] = i, e[20] = O) : O = e[20], O;
451
553
  }
452
- l(W, "useFetcher");
453
- function Le(r) {
554
+ l(Y, "useFetcher");
555
+ function $e(r) {
454
556
  const e = w(11), {
455
557
  loading: t,
456
558
  result: n,
@@ -460,7 +562,7 @@ function Le(r) {
460
562
  execute: u,
461
563
  reset: i,
462
564
  abort: m
463
- } = W(r), {
565
+ } = Y(r), {
464
566
  run: a,
465
567
  cancel: f,
466
568
  isPending: d
@@ -479,66 +581,54 @@ function Le(r) {
479
581
  isPending: d
480
582
  }, e[0] = m, e[1] = f, e[2] = o, e[3] = s, e[4] = d, e[5] = t, e[6] = i, e[7] = n, e[8] = a, e[9] = c, e[10] = b) : b = e[10], b;
481
583
  }
482
- l(Le, "useDebouncedFetcher");
483
- function Y(r) {
484
- const e = w(10), {
485
- initialQuery: t,
486
- autoExecute: n,
487
- execute: o
488
- } = r, c = n ?? !1, s = I(t);
489
- let u;
490
- e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ l(() => s.current, "t0"), e[0] = u) : u = e[0];
491
- const i = u;
492
- let m;
493
- e[1] !== c || e[2] !== o ? (m = /* @__PURE__ */ l((y) => {
494
- s.current = y, c && o(y);
495
- }, "t1"), e[1] = c, e[2] = o, e[3] = m) : m = e[3];
496
- const a = m;
497
- let f, d;
498
- e[4] !== c || e[5] !== o ? (f = /* @__PURE__ */ l(() => {
499
- c && o(s.current);
500
- }, "t2"), d = [c, o], e[4] = c, e[5] = o, e[6] = f, e[7] = d) : (f = e[6], d = e[7]), $(f, d);
501
- let b;
502
- return e[8] !== a ? (b = {
503
- getQuery: i,
504
- setQuery: a
505
- }, e[8] = a, e[9] = b) : b = e[9], b;
506
- }
507
- l(Y, "useQueryState");
508
- function P(r) {
509
- const e = L(r), {
510
- loading: t,
511
- result: n,
512
- error: o,
513
- status: c,
514
- execute: s,
515
- reset: u,
516
- abort: i
517
- } = U(e.current), m = _((b) => s(/* @__PURE__ */ l(async (h) => e.current.execute(b, e.current.attributes, h), "queryExecutor")), [s, e]), {
518
- getQuery: a,
519
- setQuery: f
520
- } = Y({
521
- initialQuery: r.initialQuery,
522
- autoExecute: e.current.autoExecute,
523
- execute: m
524
- }), d = _(() => m(a()), [m, a]);
525
- return M(() => ({
526
- loading: t,
527
- result: n,
528
- error: o,
529
- status: c,
530
- execute: d,
531
- reset: u,
532
- abort: i,
533
- getQuery: a,
534
- setQuery: f
535
- }), [t, n, o, c, d, u, i, a, f]);
536
- }
537
- l(P, "useQuery");
538
- function $e(r) {
539
- return P(r);
584
+ l($e, "useDebouncedFetcher");
585
+ function pe(r) {
586
+ const e = w(22), t = r.autoExecute;
587
+ let n;
588
+ e[0] !== r ? (n = {
589
+ ...r,
590
+ autoExecute: !1
591
+ }, e[0] = r, e[1] = n) : n = e[1];
592
+ const o = n, {
593
+ loading: c,
594
+ result: s,
595
+ error: u,
596
+ status: i,
597
+ execute: m,
598
+ reset: a,
599
+ abort: f,
600
+ getQuery: d,
601
+ setQuery: b
602
+ } = A(o), {
603
+ run: y,
604
+ cancel: h,
605
+ isPending: g
606
+ } = T(m, r.debounce);
607
+ let x;
608
+ e[2] !== t || e[3] !== y || e[4] !== b ? (x = /* @__PURE__ */ l((R) => {
609
+ b(R), t && y();
610
+ }, "t1"), e[2] = t, e[3] = y, e[4] = b, e[5] = x) : x = e[5];
611
+ const S = x;
612
+ let E, Q;
613
+ e[6] !== t || e[7] !== y ? (E = /* @__PURE__ */ l(() => {
614
+ t && y();
615
+ }, "t2"), Q = [y, t], e[6] = t, e[7] = y, e[8] = E, e[9] = Q) : (E = e[8], Q = e[9]), $(E, Q);
616
+ let v;
617
+ return e[10] !== f || e[11] !== h || e[12] !== u || e[13] !== d || e[14] !== g || e[15] !== c || e[16] !== a || e[17] !== s || e[18] !== y || e[19] !== S || e[20] !== i ? (v = {
618
+ loading: c,
619
+ result: s,
620
+ error: u,
621
+ status: i,
622
+ reset: a,
623
+ abort: f,
624
+ getQuery: d,
625
+ setQuery: S,
626
+ run: y,
627
+ cancel: h,
628
+ isPending: g
629
+ }, e[10] = f, e[11] = h, e[12] = u, e[13] = d, e[14] = g, e[15] = c, e[16] = a, e[17] = s, e[18] = y, e[19] = S, e[20] = i, e[21] = v) : v = e[21], v;
540
630
  }
541
- l($e, "useCountQuery");
631
+ l(pe, "useDebouncedFetcherQuery");
542
632
  function A(r) {
543
633
  const e = w(22);
544
634
  let t;
@@ -554,7 +644,7 @@ function A(r) {
554
644
  execute: m,
555
645
  reset: a,
556
646
  abort: f
557
- } = W(n);
647
+ } = Y(n);
558
648
  let d;
559
649
  e[2] !== m || e[3] !== o ? (d = /* @__PURE__ */ l((Q) => {
560
650
  const v = {
@@ -574,7 +664,7 @@ function A(r) {
574
664
  const {
575
665
  getQuery: h,
576
666
  setQuery: g
577
- } = Y(y);
667
+ } = j(y);
578
668
  let x;
579
669
  e[9] !== b || e[10] !== h ? (x = /* @__PURE__ */ l(() => b(h()), "t3"), e[9] = b, e[10] = h, e[11] = x) : x = e[11];
580
670
  const S = x;
@@ -592,15 +682,15 @@ function A(r) {
592
682
  }, e[12] = f, e[13] = u, e[14] = S, e[15] = h, e[16] = c, e[17] = a, e[18] = s, e[19] = g, e[20] = i, e[21] = E) : E = e[21], E;
593
683
  }
594
684
  l(A, "useFetcherQuery");
595
- function pe(r) {
596
- return A(r);
597
- }
598
- l(pe, "useFetcherCountQuery");
599
685
  function Pe(r) {
600
686
  return A(r);
601
687
  }
602
- l(Pe, "useFetcherListQuery");
688
+ l(Pe, "useFetcherCountQuery");
603
689
  function Ae(r) {
690
+ return A(r);
691
+ }
692
+ l(Ae, "useFetcherListQuery");
693
+ function De(r) {
604
694
  const e = w(2);
605
695
  let t;
606
696
  return e[0] !== r ? (t = {
@@ -608,125 +698,35 @@ function Ae(r) {
608
698
  resultExtractor: ue
609
699
  }, e[0] = r, e[1] = t) : t = e[1], A(t);
610
700
  }
611
- l(Ae, "useFetcherListStreamQuery");
612
- function De(r) {
613
- return A(r);
614
- }
615
- l(De, "useFetcherPagedQuery");
701
+ l(De, "useFetcherListStreamQuery");
616
702
  function Me(r) {
617
703
  return A(r);
618
704
  }
619
- l(Me, "useFetcherSingleQuery");
705
+ l(Me, "useFetcherPagedQuery");
620
706
  function Te(r) {
621
- return P(r);
707
+ return A(r);
622
708
  }
623
- l(Te, "useListQuery");
709
+ l(Te, "useFetcherSingleQuery");
624
710
  function Ue(r) {
625
711
  return P(r);
626
712
  }
627
- l(Ue, "useListStreamQuery");
713
+ l(Ue, "useCountQuery");
628
714
  function qe(r) {
629
715
  return P(r);
630
716
  }
631
- l(qe, "usePagedQuery");
717
+ l(qe, "useListQuery");
632
718
  function ke(r) {
633
719
  return P(r);
634
720
  }
635
- l(ke, "useSingleQuery");
721
+ l(ke, "useListStreamQuery");
636
722
  function ze(r) {
637
- const e = w(22), t = r.autoExecute;
638
- let n;
639
- e[0] !== r ? (n = {
640
- ...r,
641
- autoExecute: !1
642
- }, e[0] = r, e[1] = n) : n = e[1];
643
- const o = n, {
644
- loading: c,
645
- result: s,
646
- error: u,
647
- status: i,
648
- execute: m,
649
- reset: a,
650
- abort: f,
651
- getQuery: d,
652
- setQuery: b
653
- } = A(o), {
654
- run: y,
655
- cancel: h,
656
- isPending: g
657
- } = T(m, r.debounce);
658
- let x;
659
- e[2] !== t || e[3] !== y || e[4] !== b ? (x = /* @__PURE__ */ l((R) => {
660
- b(R), t && y();
661
- }, "t1"), e[2] = t, e[3] = y, e[4] = b, e[5] = x) : x = e[5];
662
- const S = x;
663
- let E, Q;
664
- e[6] !== t || e[7] !== y ? (E = /* @__PURE__ */ l(() => {
665
- t && y();
666
- }, "t2"), Q = [y, t], e[6] = t, e[7] = y, e[8] = E, e[9] = Q) : (E = e[8], Q = e[9]), $(E, Q);
667
- let v;
668
- return e[10] !== f || e[11] !== h || e[12] !== u || e[13] !== d || e[14] !== g || e[15] !== c || e[16] !== a || e[17] !== s || e[18] !== y || e[19] !== S || e[20] !== i ? (v = {
669
- loading: c,
670
- result: s,
671
- error: u,
672
- status: i,
673
- reset: a,
674
- abort: f,
675
- getQuery: d,
676
- setQuery: S,
677
- run: y,
678
- cancel: h,
679
- isPending: g
680
- }, e[10] = f, e[11] = h, e[12] = u, e[13] = d, e[14] = g, e[15] = c, e[16] = a, e[17] = s, e[18] = y, e[19] = S, e[20] = i, e[21] = v) : v = e[21], v;
723
+ return P(r);
681
724
  }
682
- l(ze, "useDebouncedFetcherQuery");
725
+ l(ze, "usePagedQuery");
683
726
  function Ge(r) {
684
- const e = w(22), t = r.autoExecute;
685
- let n;
686
- e[0] !== r ? (n = {
687
- ...r,
688
- autoExecute: !1
689
- }, e[0] = r, e[1] = n) : n = e[1];
690
- const o = n, {
691
- loading: c,
692
- result: s,
693
- error: u,
694
- status: i,
695
- execute: m,
696
- reset: a,
697
- abort: f,
698
- getQuery: d,
699
- setQuery: b
700
- } = P(o), {
701
- run: y,
702
- cancel: h,
703
- isPending: g
704
- } = T(m, r.debounce);
705
- let x;
706
- e[2] !== t || e[3] !== y || e[4] !== b ? (x = /* @__PURE__ */ l((R) => {
707
- b(R), t && y();
708
- }, "t1"), e[2] = t, e[3] = y, e[4] = b, e[5] = x) : x = e[5];
709
- const S = x;
710
- let E, Q;
711
- e[6] !== t || e[7] !== y ? (E = /* @__PURE__ */ l(() => {
712
- t && y();
713
- }, "t2"), Q = [y, t], e[6] = t, e[7] = y, e[8] = E, e[9] = Q) : (E = e[8], Q = e[9]), $(E, Q);
714
- let v;
715
- return e[10] !== f || e[11] !== h || e[12] !== u || e[13] !== d || e[14] !== g || e[15] !== c || e[16] !== a || e[17] !== s || e[18] !== y || e[19] !== S || e[20] !== i ? (v = {
716
- loading: c,
717
- result: s,
718
- error: u,
719
- status: i,
720
- reset: a,
721
- abort: f,
722
- getQuery: d,
723
- setQuery: S,
724
- run: y,
725
- cancel: h,
726
- isPending: g
727
- }, e[10] = f, e[11] = h, e[12] = u, e[13] = d, e[14] = g, e[15] = c, e[16] = a, e[17] = s, e[18] = y, e[19] = S, e[20] = i, e[21] = v) : v = e[21], v;
727
+ return P(r);
728
728
  }
729
- l(Ge, "useDebouncedQuery");
729
+ l(Ge, "useSingleQuery");
730
730
  function Ke(r) {
731
731
  const e = w(13), {
732
732
  bus: t,
@@ -752,39 +752,39 @@ l(Ke, "useEventSubscription");
752
752
  export {
753
753
  de as ANONYMOUS_USER,
754
754
  le as PromiseStatus,
755
- Ie as RouteGuard,
756
- J as SecurityContext,
757
- Oe as SecurityProvider,
758
- $e as useCountQuery,
755
+ Le as RouteGuard,
756
+ W as SecurityContext,
757
+ Ie as SecurityProvider,
758
+ Ue as useCountQuery,
759
759
  T as useDebouncedCallback,
760
- Re as useDebouncedExecutePromise,
761
- Le as useDebouncedFetcher,
762
- ze as useDebouncedFetcherQuery,
763
- Ge as useDebouncedQuery,
760
+ we as useDebouncedExecutePromise,
761
+ $e as useDebouncedFetcher,
762
+ pe as useDebouncedFetcherQuery,
763
+ Re as useDebouncedQuery,
764
764
  Ke as useEventSubscription,
765
765
  U as useExecutePromise,
766
- W as useFetcher,
767
- pe as useFetcherCountQuery,
768
- Pe as useFetcherListQuery,
769
- Ae as useFetcherListStreamQuery,
770
- De as useFetcherPagedQuery,
766
+ Y as useFetcher,
767
+ Pe as useFetcherCountQuery,
768
+ Ae as useFetcherListQuery,
769
+ De as useFetcherListStreamQuery,
770
+ Me as useFetcherPagedQuery,
771
771
  A as useFetcherQuery,
772
- Me as useFetcherSingleQuery,
773
- Fe as useForceUpdate,
774
- Ce as useImmerKeyStorage,
775
- j as useKeyStorage,
772
+ Te as useFetcherSingleQuery,
773
+ Ce as useForceUpdate,
774
+ Oe as useImmerKeyStorage,
775
+ J as useKeyStorage,
776
776
  L as useLatest,
777
- Te as useListQuery,
778
- Ue as useListStreamQuery,
777
+ qe as useListQuery,
778
+ ke as useListStreamQuery,
779
779
  V as useMounted,
780
- qe as usePagedQuery,
780
+ ze as usePagedQuery,
781
781
  ie as usePromiseState,
782
782
  P as useQuery,
783
- Y as useQueryState,
784
- we as useRefs,
783
+ j as useQueryState,
784
+ Fe as useRefs,
785
785
  ae as useRequestId,
786
786
  me as useSecurity,
787
787
  be as useSecurityContext,
788
- ke as useSingleQuery
788
+ Ge as useSingleQuery
789
789
  };
790
790
  //# sourceMappingURL=index.es.js.map