mhz-helpers 1.3.22 → 1.3.24
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.
- package/dist/query/index.js +300 -300
- package/dist/useValidate/index.js +1 -1
- package/package.json +14 -14
package/dist/query/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isRef as
|
|
2
|
-
import { logout as
|
|
3
|
-
import { handleError as
|
|
4
|
-
var
|
|
1
|
+
import { isRef as Ae, unref as Je, hasInjectionContext as Xe, inject as Ze, ref as et, nextTick as tt, getCurrentScope as Pe, computed as Re, shallowReactive as Ie, reactive as De, watch as _, onScopeDispose as Te, shallowReadonly as Fe, readonly as Me, toRefs as Ue } from "vue";
|
|
2
|
+
import { logout as st } from "../useAuth/index.js";
|
|
3
|
+
import { handleError as le, deleteAuthHeader as rt } from "../api/index.js";
|
|
4
|
+
var x = class {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
7
7
|
}
|
|
@@ -17,7 +17,7 @@ var j = class {
|
|
|
17
17
|
}
|
|
18
18
|
onUnsubscribe() {
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, it = {
|
|
21
21
|
// We need the wrapper function syntax below instead of direct references to
|
|
22
22
|
// global setTimeout etc.
|
|
23
23
|
//
|
|
@@ -32,14 +32,14 @@ var j = class {
|
|
|
32
32
|
clearTimeout: (e) => clearTimeout(e),
|
|
33
33
|
setInterval: (e, t) => setInterval(e, t),
|
|
34
34
|
clearInterval: (e) => clearInterval(e)
|
|
35
|
-
},
|
|
35
|
+
}, nt = class {
|
|
36
36
|
// We cannot have TimeoutManager<T> as we must instantiate it with a concrete
|
|
37
37
|
// type at app boot; and if we leave that type, then any new timer provider
|
|
38
38
|
// would need to support ReturnType<typeof setTimeout>, which is infeasible.
|
|
39
39
|
//
|
|
40
40
|
// We settle for type safety for the TimeoutProvider type, and accept that
|
|
41
41
|
// this class is unsafe internally to allow for extension.
|
|
42
|
-
#e =
|
|
42
|
+
#e = it;
|
|
43
43
|
#t = !1;
|
|
44
44
|
setTimeoutProvider(e) {
|
|
45
45
|
process.env.NODE_ENV !== "production" && this.#t && e !== this.#e && console.error(
|
|
@@ -59,20 +59,20 @@ var j = class {
|
|
|
59
59
|
clearInterval(e) {
|
|
60
60
|
this.#e.clearInterval(e);
|
|
61
61
|
}
|
|
62
|
-
},
|
|
63
|
-
function
|
|
62
|
+
}, T = new nt();
|
|
63
|
+
function ot(e) {
|
|
64
64
|
setTimeout(e, 0);
|
|
65
65
|
}
|
|
66
66
|
var M = typeof window > "u" || "Deno" in globalThis;
|
|
67
67
|
function w() {
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function at(e, t) {
|
|
70
70
|
return typeof e == "function" ? e(t) : e;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Y(e) {
|
|
73
73
|
return typeof e == "number" && e >= 0 && e !== 1 / 0;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function qe(e, t) {
|
|
76
76
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
77
77
|
}
|
|
78
78
|
function R(e, t) {
|
|
@@ -81,7 +81,7 @@ function R(e, t) {
|
|
|
81
81
|
function E(e, t) {
|
|
82
82
|
return typeof e == "function" ? e(t) : e;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function fe(e, t) {
|
|
85
85
|
const {
|
|
86
86
|
type: s = "all",
|
|
87
87
|
exact: r,
|
|
@@ -92,7 +92,7 @@ function he(e, t) {
|
|
|
92
92
|
} = e;
|
|
93
93
|
if (o) {
|
|
94
94
|
if (r) {
|
|
95
|
-
if (t.queryHash !==
|
|
95
|
+
if (t.queryHash !== ae(o, t.options))
|
|
96
96
|
return !1;
|
|
97
97
|
} else if (!N(t.queryKey, o))
|
|
98
98
|
return !1;
|
|
@@ -104,7 +104,7 @@ function he(e, t) {
|
|
|
104
104
|
}
|
|
105
105
|
return !(typeof a == "boolean" && t.isStale() !== a || i && i !== t.state.fetchStatus || n && !n(t));
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function de(e, t) {
|
|
108
108
|
const { exact: s, status: r, predicate: i, mutationKey: n } = e;
|
|
109
109
|
if (n) {
|
|
110
110
|
if (!t.options.mutationKey)
|
|
@@ -117,43 +117,43 @@ function le(e, t) {
|
|
|
117
117
|
}
|
|
118
118
|
return !(r && t.state.status !== r || i && !i(t));
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function ae(e, t) {
|
|
121
121
|
return (t?.queryKeyHashFn || U)(e);
|
|
122
122
|
}
|
|
123
123
|
function U(e) {
|
|
124
124
|
return JSON.stringify(
|
|
125
125
|
e,
|
|
126
|
-
(t, s) =>
|
|
126
|
+
(t, s) => X(s) ? Object.keys(s).sort().reduce((r, i) => (r[i] = s[i], r), {}) : s
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
129
|
function N(e, t) {
|
|
130
130
|
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) => N(e[s], t[s])) : !1;
|
|
131
131
|
}
|
|
132
|
-
var
|
|
133
|
-
function
|
|
132
|
+
var ut = Object.prototype.hasOwnProperty;
|
|
133
|
+
function J(e, t, s = 0) {
|
|
134
134
|
if (e === t)
|
|
135
135
|
return e;
|
|
136
136
|
if (s > 500) return t;
|
|
137
|
-
const r =
|
|
138
|
-
if (!r && !(
|
|
137
|
+
const r = pe(e) && pe(t);
|
|
138
|
+
if (!r && !(X(e) && X(t))) return t;
|
|
139
139
|
const n = (r ? e : Object.keys(e)).length, o = r ? t : Object.keys(t), a = o.length, u = r ? new Array(a) : {};
|
|
140
140
|
let y = 0;
|
|
141
141
|
for (let c = 0; c < a; c++) {
|
|
142
142
|
const l = r ? c : o[c], f = e[l], d = t[l];
|
|
143
143
|
if (f === d) {
|
|
144
|
-
u[l] = f, (r ? c < n :
|
|
144
|
+
u[l] = f, (r ? c < n : ut.call(e, l)) && y++;
|
|
145
145
|
continue;
|
|
146
146
|
}
|
|
147
147
|
if (f === null || d === null || typeof f != "object" || typeof d != "object") {
|
|
148
148
|
u[l] = d;
|
|
149
149
|
continue;
|
|
150
150
|
}
|
|
151
|
-
const g =
|
|
151
|
+
const g = J(f, d, s + 1);
|
|
152
152
|
u[l] = g, g === f && y++;
|
|
153
153
|
}
|
|
154
154
|
return n === a && y === n ? e : u;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function G(e, t) {
|
|
157
157
|
if (!t || Object.keys(e).length !== Object.keys(t).length)
|
|
158
158
|
return !1;
|
|
159
159
|
for (const s in e)
|
|
@@ -161,67 +161,67 @@ function K(e, t) {
|
|
|
161
161
|
return !1;
|
|
162
162
|
return !0;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function pe(e) {
|
|
165
165
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
if (!
|
|
167
|
+
function X(e) {
|
|
168
|
+
if (!ye(e))
|
|
169
169
|
return !1;
|
|
170
170
|
const t = e.constructor;
|
|
171
171
|
if (t === void 0)
|
|
172
172
|
return !0;
|
|
173
173
|
const s = t.prototype;
|
|
174
|
-
return !(!
|
|
174
|
+
return !(!ye(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function ye(e) {
|
|
177
177
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function ct(e) {
|
|
180
180
|
return new Promise((t) => {
|
|
181
|
-
|
|
181
|
+
T.setTimeout(t, e);
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function Z(e, t, s) {
|
|
185
185
|
if (typeof s.structuralSharing == "function")
|
|
186
186
|
return s.structuralSharing(e, t);
|
|
187
187
|
if (s.structuralSharing !== !1) {
|
|
188
188
|
if (process.env.NODE_ENV !== "production")
|
|
189
189
|
try {
|
|
190
|
-
return
|
|
190
|
+
return J(e, t);
|
|
191
191
|
} catch (r) {
|
|
192
192
|
throw console.error(
|
|
193
193
|
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
|
|
194
194
|
), r;
|
|
195
195
|
}
|
|
196
|
-
return
|
|
196
|
+
return J(e, t);
|
|
197
197
|
}
|
|
198
198
|
return t;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function ht(e, t, s = 0) {
|
|
201
201
|
const r = [...e, t];
|
|
202
202
|
return s && r.length > s ? r.slice(1) : r;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function lt(e, t, s = 0) {
|
|
205
205
|
const r = [t, ...e];
|
|
206
206
|
return s && r.length > s ? r.slice(0, -1) : r;
|
|
207
207
|
}
|
|
208
|
-
var
|
|
209
|
-
function
|
|
210
|
-
return process.env.NODE_ENV !== "production" && e.queryFn ===
|
|
208
|
+
var W = /* @__PURE__ */ Symbol();
|
|
209
|
+
function _e(e, t) {
|
|
210
|
+
return process.env.NODE_ENV !== "production" && e.queryFn === W && console.error(
|
|
211
211
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
|
|
212
|
-
), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn ===
|
|
212
|
+
), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === W ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function ee(e, t) {
|
|
215
215
|
return typeof e == "function" ? e(...t) : !!e;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function ft(e, t, s) {
|
|
218
218
|
let r = !1, i;
|
|
219
219
|
return Object.defineProperty(e, "signal", {
|
|
220
220
|
enumerable: !0,
|
|
221
221
|
get: () => (i ??= t(), r || (r = !0, i.aborted ? s() : i.addEventListener("abort", s, { once: !0 })), i)
|
|
222
222
|
}), e;
|
|
223
223
|
}
|
|
224
|
-
var
|
|
224
|
+
var dt = class extends x {
|
|
225
225
|
#e;
|
|
226
226
|
#t;
|
|
227
227
|
#s;
|
|
@@ -258,8 +258,8 @@ var lt = class extends j {
|
|
|
258
258
|
isFocused() {
|
|
259
259
|
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
260
260
|
}
|
|
261
|
-
},
|
|
262
|
-
function
|
|
261
|
+
}, ue = new dt();
|
|
262
|
+
function te() {
|
|
263
263
|
let e, t;
|
|
264
264
|
const s = new Promise((i, n) => {
|
|
265
265
|
e = i, t = n;
|
|
@@ -281,13 +281,13 @@ function ee() {
|
|
|
281
281
|
}), t(i);
|
|
282
282
|
}, s;
|
|
283
283
|
}
|
|
284
|
-
var
|
|
285
|
-
function
|
|
284
|
+
var pt = ot;
|
|
285
|
+
function yt() {
|
|
286
286
|
let e = [], t = 0, s = (a) => {
|
|
287
287
|
a();
|
|
288
288
|
}, r = (a) => {
|
|
289
289
|
a();
|
|
290
|
-
}, i =
|
|
290
|
+
}, i = pt;
|
|
291
291
|
const n = (a) => {
|
|
292
292
|
t ? e.push(a) : i(() => {
|
|
293
293
|
s(a);
|
|
@@ -341,7 +341,7 @@ function dt() {
|
|
|
341
341
|
}
|
|
342
342
|
};
|
|
343
343
|
}
|
|
344
|
-
var b =
|
|
344
|
+
var b = yt(), gt = class extends x {
|
|
345
345
|
#e = !0;
|
|
346
346
|
#t;
|
|
347
347
|
#s;
|
|
@@ -372,30 +372,30 @@ var b = dt(), pt = class extends j {
|
|
|
372
372
|
isOnline() {
|
|
373
373
|
return this.#e;
|
|
374
374
|
}
|
|
375
|
-
},
|
|
376
|
-
function
|
|
375
|
+
}, k = new gt();
|
|
376
|
+
function mt(e) {
|
|
377
377
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
return (e ?? "online") === "online" ?
|
|
379
|
+
function ke(e) {
|
|
380
|
+
return (e ?? "online") === "online" ? k.isOnline() : !0;
|
|
381
381
|
}
|
|
382
|
-
var
|
|
382
|
+
var se = class extends Error {
|
|
383
383
|
constructor(e) {
|
|
384
384
|
super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
|
|
385
385
|
}
|
|
386
386
|
};
|
|
387
|
-
function
|
|
387
|
+
function xe(e) {
|
|
388
388
|
let t = !1, s = 0, r;
|
|
389
|
-
const i =
|
|
389
|
+
const i = te(), n = () => i.status !== "pending", o = (p) => {
|
|
390
390
|
if (!n()) {
|
|
391
|
-
const m = new
|
|
391
|
+
const m = new se(p);
|
|
392
392
|
f(m), e.onCancel?.(m);
|
|
393
393
|
}
|
|
394
394
|
}, a = () => {
|
|
395
395
|
t = !0;
|
|
396
396
|
}, u = () => {
|
|
397
397
|
t = !1;
|
|
398
|
-
}, y = () =>
|
|
398
|
+
}, y = () => ue.isFocused() && (e.networkMode === "always" || k.isOnline()) && e.canRun(), c = () => ke(e.networkMode) && e.canRun(), l = (p) => {
|
|
399
399
|
n() || (r?.(), i.resolve(p));
|
|
400
400
|
}, f = (p) => {
|
|
401
401
|
n() || (r?.(), i.reject(p));
|
|
@@ -418,12 +418,12 @@ function _e(e) {
|
|
|
418
418
|
Promise.resolve(p).then(l).catch((v) => {
|
|
419
419
|
if (n())
|
|
420
420
|
return;
|
|
421
|
-
const O = e.retry ?? (M ? 0 : 3),
|
|
422
|
-
if (t || !
|
|
421
|
+
const O = e.retry ?? (M ? 0 : 3), Q = e.retryDelay ?? mt, I = typeof Q == "function" ? Q(s, v) : Q, D = O === !0 || typeof O == "number" && s < O || typeof O == "function" && O(s, v);
|
|
422
|
+
if (t || !D) {
|
|
423
423
|
f(v);
|
|
424
424
|
return;
|
|
425
425
|
}
|
|
426
|
-
s++, e.onFail?.(s, v),
|
|
426
|
+
s++, e.onFail?.(s, v), ct(I).then(() => y() ? void 0 : d()).then(() => {
|
|
427
427
|
t ? f(v) : g();
|
|
428
428
|
});
|
|
429
429
|
});
|
|
@@ -439,13 +439,13 @@ function _e(e) {
|
|
|
439
439
|
start: () => (c() ? g() : d().then(g), i)
|
|
440
440
|
};
|
|
441
441
|
}
|
|
442
|
-
var
|
|
442
|
+
var je = class {
|
|
443
443
|
#e;
|
|
444
444
|
destroy() {
|
|
445
445
|
this.clearGcTimeout();
|
|
446
446
|
}
|
|
447
447
|
scheduleGc() {
|
|
448
|
-
this.clearGcTimeout(),
|
|
448
|
+
this.clearGcTimeout(), Y(this.gcTime) && (this.#e = T.setTimeout(() => {
|
|
449
449
|
this.optionalRemove();
|
|
450
450
|
}, this.gcTime));
|
|
451
451
|
}
|
|
@@ -456,9 +456,9 @@ var ke = class {
|
|
|
456
456
|
);
|
|
457
457
|
}
|
|
458
458
|
clearGcTimeout() {
|
|
459
|
-
this.#e && (
|
|
459
|
+
this.#e && (T.clearTimeout(this.#e), this.#e = void 0);
|
|
460
460
|
}
|
|
461
|
-
},
|
|
461
|
+
}, vt = class extends je {
|
|
462
462
|
#e;
|
|
463
463
|
#t;
|
|
464
464
|
#s;
|
|
@@ -467,7 +467,7 @@ var ke = class {
|
|
|
467
467
|
#o;
|
|
468
468
|
#a;
|
|
469
469
|
constructor(e) {
|
|
470
|
-
super(), this.#a = !1, this.#o = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#i = e.client, this.#s = this.#i.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#e =
|
|
470
|
+
super(), this.#a = !1, this.#o = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.#i = e.client, this.#s = this.#i.getQueryCache(), this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.#e = me(this.options), this.state = e.state ?? this.#e, this.scheduleGc();
|
|
471
471
|
}
|
|
472
472
|
get meta() {
|
|
473
473
|
return this.options.meta;
|
|
@@ -477,9 +477,9 @@ var ke = class {
|
|
|
477
477
|
}
|
|
478
478
|
setOptions(e) {
|
|
479
479
|
if (this.options = { ...this.#o, ...e }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
|
|
480
|
-
const t =
|
|
480
|
+
const t = me(this.options);
|
|
481
481
|
t.data !== void 0 && (this.setState(
|
|
482
|
-
|
|
482
|
+
ge(t.data, t.dataUpdatedAt)
|
|
483
483
|
), this.#e = t);
|
|
484
484
|
}
|
|
485
485
|
}
|
|
@@ -487,7 +487,7 @@ var ke = class {
|
|
|
487
487
|
!this.observers.length && this.state.fetchStatus === "idle" && this.#s.remove(this);
|
|
488
488
|
}
|
|
489
489
|
setData(e, t) {
|
|
490
|
-
const s =
|
|
490
|
+
const s = Z(this.state.data, e, this.options);
|
|
491
491
|
return this.#n({
|
|
492
492
|
data: s,
|
|
493
493
|
type: "success",
|
|
@@ -514,7 +514,7 @@ var ke = class {
|
|
|
514
514
|
);
|
|
515
515
|
}
|
|
516
516
|
isDisabled() {
|
|
517
|
-
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn ===
|
|
517
|
+
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === W || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
|
|
518
518
|
}
|
|
519
519
|
isStatic() {
|
|
520
520
|
return this.getObserversCount() > 0 ? this.observers.some(
|
|
@@ -527,7 +527,7 @@ var ke = class {
|
|
|
527
527
|
) : this.state.data === void 0 || this.state.isInvalidated;
|
|
528
528
|
}
|
|
529
529
|
isStaleByTime(e = 0) {
|
|
530
|
-
return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !
|
|
530
|
+
return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !qe(this.state.dataUpdatedAt, e);
|
|
531
531
|
}
|
|
532
532
|
onFocus() {
|
|
533
533
|
this.observers.find((t) => t.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
|
|
@@ -548,7 +548,7 @@ var ke = class {
|
|
|
548
548
|
this.state.isInvalidated || this.#n({ type: "invalidate" });
|
|
549
549
|
}
|
|
550
550
|
async fetch(e, t) {
|
|
551
|
-
if (this.state.fetchStatus !== "idle" && // If the promise in the
|
|
551
|
+
if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely
|
|
552
552
|
// re-start the fetch; there is a chance that the query is still in a
|
|
553
553
|
// pending state when that happens
|
|
554
554
|
this.#r?.status() !== "rejected") {
|
|
@@ -570,7 +570,7 @@ var ke = class {
|
|
|
570
570
|
get: () => (this.#a = !0, s.signal)
|
|
571
571
|
});
|
|
572
572
|
}, i = () => {
|
|
573
|
-
const a =
|
|
573
|
+
const a = _e(this.options, t), y = (() => {
|
|
574
574
|
const c = {
|
|
575
575
|
client: this.#i,
|
|
576
576
|
queryKey: this.queryKey,
|
|
@@ -594,11 +594,11 @@ var ke = class {
|
|
|
594
594
|
};
|
|
595
595
|
return r(a), a;
|
|
596
596
|
})();
|
|
597
|
-
this.options.behavior?.onFetch(o, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#n({ type: "fetch", meta: o.fetchOptions?.meta }), this.#r =
|
|
597
|
+
this.options.behavior?.onFetch(o, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#n({ type: "fetch", meta: o.fetchOptions?.meta }), this.#r = xe({
|
|
598
598
|
initialPromise: t?.initialPromise,
|
|
599
599
|
fn: o.fetchFn,
|
|
600
600
|
onCancel: (a) => {
|
|
601
|
-
a instanceof
|
|
601
|
+
a instanceof se && a.revert && this.setState({
|
|
602
602
|
...this.#t,
|
|
603
603
|
fetchStatus: "idle"
|
|
604
604
|
}), s.abort();
|
|
@@ -629,7 +629,7 @@ var ke = class {
|
|
|
629
629
|
this
|
|
630
630
|
), a;
|
|
631
631
|
} catch (a) {
|
|
632
|
-
if (a instanceof
|
|
632
|
+
if (a instanceof se) {
|
|
633
633
|
if (a.silent)
|
|
634
634
|
return this.#r.promise;
|
|
635
635
|
if (a.revert) {
|
|
@@ -675,13 +675,13 @@ var ke = class {
|
|
|
675
675
|
case "fetch":
|
|
676
676
|
return {
|
|
677
677
|
...s,
|
|
678
|
-
...
|
|
678
|
+
...Ne(s.data, this.options),
|
|
679
679
|
fetchMeta: e.meta ?? null
|
|
680
680
|
};
|
|
681
681
|
case "success":
|
|
682
682
|
const r = {
|
|
683
683
|
...s,
|
|
684
|
-
...
|
|
684
|
+
...ge(e.data, e.dataUpdatedAt),
|
|
685
685
|
dataUpdateCount: s.dataUpdateCount + 1,
|
|
686
686
|
...!e.manual && {
|
|
687
687
|
fetchStatus: "idle",
|
|
@@ -724,18 +724,18 @@ var ke = class {
|
|
|
724
724
|
});
|
|
725
725
|
}
|
|
726
726
|
};
|
|
727
|
-
function
|
|
727
|
+
function Ne(e, t) {
|
|
728
728
|
return {
|
|
729
729
|
fetchFailureCount: 0,
|
|
730
730
|
fetchFailureReason: null,
|
|
731
|
-
fetchStatus:
|
|
731
|
+
fetchStatus: ke(t.networkMode) ? "fetching" : "paused",
|
|
732
732
|
...e === void 0 && {
|
|
733
733
|
error: null,
|
|
734
734
|
status: "pending"
|
|
735
735
|
}
|
|
736
736
|
};
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function ge(e, t) {
|
|
739
739
|
return {
|
|
740
740
|
data: e,
|
|
741
741
|
dataUpdatedAt: t ?? Date.now(),
|
|
@@ -744,7 +744,7 @@ function pe(e, t) {
|
|
|
744
744
|
status: "success"
|
|
745
745
|
};
|
|
746
746
|
}
|
|
747
|
-
function
|
|
747
|
+
function me(e) {
|
|
748
748
|
const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = t !== void 0, r = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
|
|
749
749
|
return {
|
|
750
750
|
data: t,
|
|
@@ -761,9 +761,9 @@ function ye(e) {
|
|
|
761
761
|
fetchStatus: "idle"
|
|
762
762
|
};
|
|
763
763
|
}
|
|
764
|
-
var
|
|
764
|
+
var bt = class extends x {
|
|
765
765
|
constructor(e, t) {
|
|
766
|
-
super(), this.options = t, this.#e = e, this.#n = null, this.#a =
|
|
766
|
+
super(), this.options = t, this.#e = e, this.#n = null, this.#a = te(), this.bindMethods(), this.setOptions(t);
|
|
767
767
|
}
|
|
768
768
|
#e;
|
|
769
769
|
#t = void 0;
|
|
@@ -786,20 +786,20 @@ var mt = class extends j {
|
|
|
786
786
|
this.refetch = this.refetch.bind(this);
|
|
787
787
|
}
|
|
788
788
|
onSubscribe() {
|
|
789
|
-
this.listeners.size === 1 && (this.#t.addObserver(this),
|
|
789
|
+
this.listeners.size === 1 && (this.#t.addObserver(this), ve(this.#t, this.options) ? this.#l() : this.updateResult(), this.#b());
|
|
790
790
|
}
|
|
791
791
|
onUnsubscribe() {
|
|
792
792
|
this.hasListeners() || this.destroy();
|
|
793
793
|
}
|
|
794
794
|
shouldFetchOnReconnect() {
|
|
795
|
-
return
|
|
795
|
+
return re(
|
|
796
796
|
this.#t,
|
|
797
797
|
this.options,
|
|
798
798
|
this.options.refetchOnReconnect
|
|
799
799
|
);
|
|
800
800
|
}
|
|
801
801
|
shouldFetchOnWindowFocus() {
|
|
802
|
-
return
|
|
802
|
+
return re(
|
|
803
803
|
this.#t,
|
|
804
804
|
this.options,
|
|
805
805
|
this.options.refetchOnWindowFocus
|
|
@@ -814,13 +814,13 @@ var mt = class extends j {
|
|
|
814
814
|
throw new Error(
|
|
815
815
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
816
816
|
);
|
|
817
|
-
this.#C(), this.#t.setOptions(this.options), t._defaulted && !
|
|
817
|
+
this.#C(), this.#t.setOptions(this.options), t._defaulted && !G(this.options, t) && this.#e.getQueryCache().notify({
|
|
818
818
|
type: "observerOptionsUpdated",
|
|
819
819
|
query: this.#t,
|
|
820
820
|
observer: this
|
|
821
821
|
});
|
|
822
822
|
const r = this.hasListeners();
|
|
823
|
-
r &&
|
|
823
|
+
r && be(
|
|
824
824
|
this.#t,
|
|
825
825
|
s,
|
|
826
826
|
this.options,
|
|
@@ -831,7 +831,7 @@ var mt = class extends j {
|
|
|
831
831
|
}
|
|
832
832
|
getOptimisticResult(e) {
|
|
833
833
|
const t = this.#e.getQueryCache().build(this.#e, e), s = this.createResult(t, e);
|
|
834
|
-
return
|
|
834
|
+
return St(this, s) && (this.#i = s, this.#o = this.options, this.#r = this.#t.state), s;
|
|
835
835
|
}
|
|
836
836
|
getCurrentResult() {
|
|
837
837
|
return this.#i;
|
|
@@ -880,10 +880,10 @@ var mt = class extends j {
|
|
|
880
880
|
this.options.staleTime,
|
|
881
881
|
this.#t
|
|
882
882
|
);
|
|
883
|
-
if (M || this.#i.isStale || !
|
|
883
|
+
if (M || this.#i.isStale || !Y(e))
|
|
884
884
|
return;
|
|
885
|
-
const s =
|
|
886
|
-
this.#c =
|
|
885
|
+
const s = qe(this.#i.dataUpdatedAt, e) + 1;
|
|
886
|
+
this.#c = T.setTimeout(() => {
|
|
887
887
|
this.#i.isStale || this.updateResult();
|
|
888
888
|
}, s);
|
|
889
889
|
}
|
|
@@ -891,27 +891,27 @@ var mt = class extends j {
|
|
|
891
891
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
892
892
|
}
|
|
893
893
|
#v(e) {
|
|
894
|
-
this.#S(), this.#u = e, !(M || E(this.options.enabled, this.#t) === !1 || !
|
|
895
|
-
(this.options.refetchIntervalInBackground ||
|
|
894
|
+
this.#S(), this.#u = e, !(M || E(this.options.enabled, this.#t) === !1 || !Y(this.#u) || this.#u === 0) && (this.#h = T.setInterval(() => {
|
|
895
|
+
(this.options.refetchIntervalInBackground || ue.isFocused()) && this.#l();
|
|
896
896
|
}, this.#u));
|
|
897
897
|
}
|
|
898
898
|
#b() {
|
|
899
899
|
this.#g(), this.#v(this.#m());
|
|
900
900
|
}
|
|
901
901
|
#O() {
|
|
902
|
-
this.#c && (
|
|
902
|
+
this.#c && (T.clearTimeout(this.#c), this.#c = void 0);
|
|
903
903
|
}
|
|
904
904
|
#S() {
|
|
905
|
-
this.#h && (
|
|
905
|
+
this.#h && (T.clearInterval(this.#h), this.#h = void 0);
|
|
906
906
|
}
|
|
907
907
|
createResult(e, t) {
|
|
908
908
|
const s = this.#t, r = this.options, i = this.#i, n = this.#r, o = this.#o, u = e !== s ? e.state : this.#s, { state: y } = e;
|
|
909
909
|
let c = { ...y }, l = !1, f;
|
|
910
910
|
if (t._optimisticResults) {
|
|
911
|
-
const C = this.hasListeners(),
|
|
912
|
-
(
|
|
911
|
+
const C = this.hasListeners(), j = !C && ve(e, t), H = C && be(e, s, t, r);
|
|
912
|
+
(j || H) && (c = {
|
|
913
913
|
...c,
|
|
914
|
-
...
|
|
914
|
+
...Ne(y.data, e.options)
|
|
915
915
|
}), t._optimisticResults === "isRestoring" && (c.fetchStatus = "idle");
|
|
916
916
|
}
|
|
917
917
|
let { error: d, errorUpdatedAt: g, status: p } = c;
|
|
@@ -922,7 +922,7 @@ var mt = class extends j {
|
|
|
922
922
|
i?.isPlaceholderData && t.placeholderData === o?.placeholderData ? (C = i.data, m = !0) : C = typeof t.placeholderData == "function" ? t.placeholderData(
|
|
923
923
|
this.#d?.state.data,
|
|
924
924
|
this.#d
|
|
925
|
-
) : t.placeholderData, C !== void 0 && (p = "success", f =
|
|
925
|
+
) : t.placeholderData, C !== void 0 && (p = "success", f = Z(
|
|
926
926
|
i?.data,
|
|
927
927
|
C,
|
|
928
928
|
t
|
|
@@ -933,17 +933,17 @@ var mt = class extends j {
|
|
|
933
933
|
f = this.#f;
|
|
934
934
|
else
|
|
935
935
|
try {
|
|
936
|
-
this.#y = t.select, f = t.select(f), f =
|
|
936
|
+
this.#y = t.select, f = t.select(f), f = Z(i?.data, f, t), this.#f = f, this.#n = null;
|
|
937
937
|
} catch (C) {
|
|
938
938
|
this.#n = C;
|
|
939
939
|
}
|
|
940
940
|
this.#n && (d = this.#n, f = this.#f, g = Date.now(), p = "error");
|
|
941
|
-
const v = c.fetchStatus === "fetching", O = p === "pending",
|
|
941
|
+
const v = c.fetchStatus === "fetching", O = p === "pending", Q = p === "error", I = O && v, D = f !== void 0, A = {
|
|
942
942
|
status: p,
|
|
943
943
|
fetchStatus: c.fetchStatus,
|
|
944
944
|
isPending: O,
|
|
945
945
|
isSuccess: p === "success",
|
|
946
|
-
isError:
|
|
946
|
+
isError: Q,
|
|
947
947
|
isInitialLoading: I,
|
|
948
948
|
isLoading: I,
|
|
949
949
|
data: f,
|
|
@@ -957,39 +957,39 @@ var mt = class extends j {
|
|
|
957
957
|
isFetchedAfterMount: c.dataUpdateCount > u.dataUpdateCount || c.errorUpdateCount > u.errorUpdateCount,
|
|
958
958
|
isFetching: v,
|
|
959
959
|
isRefetching: v && !O,
|
|
960
|
-
isLoadingError:
|
|
960
|
+
isLoadingError: Q && !D,
|
|
961
961
|
isPaused: c.fetchStatus === "paused",
|
|
962
962
|
isPlaceholderData: l,
|
|
963
|
-
isRefetchError:
|
|
964
|
-
isStale:
|
|
963
|
+
isRefetchError: Q && D,
|
|
964
|
+
isStale: ce(e, t),
|
|
965
965
|
refetch: this.refetch,
|
|
966
966
|
promise: this.#a,
|
|
967
967
|
isEnabled: E(t.enabled, e) !== !1
|
|
968
968
|
};
|
|
969
969
|
if (this.options.experimental_prefetchInRender) {
|
|
970
|
-
const C = (
|
|
971
|
-
|
|
972
|
-
},
|
|
973
|
-
const
|
|
974
|
-
|
|
975
|
-
},
|
|
976
|
-
switch (
|
|
970
|
+
const C = A.data !== void 0, j = A.status === "error" && !C, H = (V) => {
|
|
971
|
+
j ? V.reject(A.error) : C && V.resolve(A.data);
|
|
972
|
+
}, he = () => {
|
|
973
|
+
const V = this.#a = A.promise = te();
|
|
974
|
+
H(V);
|
|
975
|
+
}, L = this.#a;
|
|
976
|
+
switch (L.status) {
|
|
977
977
|
case "pending":
|
|
978
|
-
e.queryHash === s.queryHash &&
|
|
978
|
+
e.queryHash === s.queryHash && H(L);
|
|
979
979
|
break;
|
|
980
980
|
case "fulfilled":
|
|
981
|
-
(
|
|
981
|
+
(j || A.data !== L.value) && he();
|
|
982
982
|
break;
|
|
983
983
|
case "rejected":
|
|
984
|
-
(
|
|
984
|
+
(!j || A.error !== L.reason) && he();
|
|
985
985
|
break;
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
|
-
return
|
|
988
|
+
return A;
|
|
989
989
|
}
|
|
990
990
|
updateResult() {
|
|
991
991
|
const e = this.#i, t = this.createResult(this.#t, this.options);
|
|
992
|
-
if (this.#r = this.#t.state, this.#o = this.options, this.#r.data !== void 0 && (this.#d = this.#t),
|
|
992
|
+
if (this.#r = this.#t.state, this.#o = this.options, this.#r.data !== void 0 && (this.#d = this.#t), G(t, e))
|
|
993
993
|
return;
|
|
994
994
|
this.#i = t;
|
|
995
995
|
const s = () => {
|
|
@@ -1029,29 +1029,29 @@ var mt = class extends j {
|
|
|
1029
1029
|
});
|
|
1030
1030
|
}
|
|
1031
1031
|
};
|
|
1032
|
-
function
|
|
1032
|
+
function Ot(e, t) {
|
|
1033
1033
|
return E(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return
|
|
1035
|
+
function ve(e, t) {
|
|
1036
|
+
return Ot(e, t) || e.state.data !== void 0 && re(e, t, t.refetchOnMount);
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function re(e, t, s) {
|
|
1039
1039
|
if (E(t.enabled, e) !== !1 && R(t.staleTime, e) !== "static") {
|
|
1040
1040
|
const r = typeof s == "function" ? s(e) : s;
|
|
1041
|
-
return r === "always" || r !== !1 &&
|
|
1041
|
+
return r === "always" || r !== !1 && ce(e, t);
|
|
1042
1042
|
}
|
|
1043
1043
|
return !1;
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1046
|
-
return (e !== t || E(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") &&
|
|
1045
|
+
function be(e, t, s, r) {
|
|
1046
|
+
return (e !== t || E(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && ce(e, s);
|
|
1047
1047
|
}
|
|
1048
|
-
function
|
|
1048
|
+
function ce(e, t) {
|
|
1049
1049
|
return E(t.enabled, e) !== !1 && e.isStaleByTime(R(t.staleTime, e));
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1052
|
-
return !
|
|
1051
|
+
function St(e, t) {
|
|
1052
|
+
return !G(e.getCurrentResult(), t);
|
|
1053
1053
|
}
|
|
1054
|
-
function
|
|
1054
|
+
function Oe(e) {
|
|
1055
1055
|
return {
|
|
1056
1056
|
onFetch: (t, s) => {
|
|
1057
1057
|
const r = t.options, i = t.fetchOptions?.meta?.fetchMore?.direction, n = t.state.data?.pages || [], o = t.state.data?.pageParams || [];
|
|
@@ -1059,33 +1059,33 @@ function ve(e) {
|
|
|
1059
1059
|
const y = async () => {
|
|
1060
1060
|
let c = !1;
|
|
1061
1061
|
const l = (g) => {
|
|
1062
|
-
|
|
1062
|
+
ft(
|
|
1063
1063
|
g,
|
|
1064
1064
|
() => t.signal,
|
|
1065
1065
|
() => c = !0
|
|
1066
1066
|
);
|
|
1067
|
-
}, f =
|
|
1067
|
+
}, f = _e(t.options, t.fetchOptions), d = async (g, p, m) => {
|
|
1068
1068
|
if (c)
|
|
1069
1069
|
return Promise.reject();
|
|
1070
1070
|
if (p == null && g.pages.length)
|
|
1071
1071
|
return Promise.resolve(g);
|
|
1072
1072
|
const O = (() => {
|
|
1073
|
-
const
|
|
1073
|
+
const B = {
|
|
1074
1074
|
client: t.client,
|
|
1075
1075
|
queryKey: t.queryKey,
|
|
1076
1076
|
pageParam: p,
|
|
1077
1077
|
direction: m ? "backward" : "forward",
|
|
1078
1078
|
meta: t.options.meta
|
|
1079
1079
|
};
|
|
1080
|
-
return l(
|
|
1081
|
-
})(),
|
|
1080
|
+
return l(B), B;
|
|
1081
|
+
})(), Q = await f(O), { maxPages: I } = t.options, D = m ? lt : ht;
|
|
1082
1082
|
return {
|
|
1083
|
-
pages:
|
|
1084
|
-
pageParams:
|
|
1083
|
+
pages: D(g.pages, Q, I),
|
|
1084
|
+
pageParams: D(g.pageParams, p, I)
|
|
1085
1085
|
};
|
|
1086
1086
|
};
|
|
1087
1087
|
if (i && n.length) {
|
|
1088
|
-
const g = i === "backward", p = g ?
|
|
1088
|
+
const g = i === "backward", p = g ? Ct : Se, m = {
|
|
1089
1089
|
pages: n,
|
|
1090
1090
|
pageParams: o
|
|
1091
1091
|
}, v = p(r, m);
|
|
@@ -1093,7 +1093,7 @@ function ve(e) {
|
|
|
1093
1093
|
} else {
|
|
1094
1094
|
const g = e ?? n.length;
|
|
1095
1095
|
do {
|
|
1096
|
-
const p = u === 0 ? o[0] ?? r.initialPageParam :
|
|
1096
|
+
const p = u === 0 ? o[0] ?? r.initialPageParam : Se(r, a);
|
|
1097
1097
|
if (u > 0 && p == null)
|
|
1098
1098
|
break;
|
|
1099
1099
|
a = await d(a, p), u++;
|
|
@@ -1114,7 +1114,7 @@ function ve(e) {
|
|
|
1114
1114
|
}
|
|
1115
1115
|
};
|
|
1116
1116
|
}
|
|
1117
|
-
function
|
|
1117
|
+
function Se(e, { pages: t, pageParams: s }) {
|
|
1118
1118
|
const r = t.length - 1;
|
|
1119
1119
|
return t.length > 0 ? e.getNextPageParam(
|
|
1120
1120
|
t[r],
|
|
@@ -1123,16 +1123,16 @@ function be(e, { pages: t, pageParams: s }) {
|
|
|
1123
1123
|
s
|
|
1124
1124
|
) : void 0;
|
|
1125
1125
|
}
|
|
1126
|
-
function
|
|
1126
|
+
function Ct(e, { pages: t, pageParams: s }) {
|
|
1127
1127
|
return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, s[0], s) : void 0;
|
|
1128
1128
|
}
|
|
1129
|
-
var
|
|
1129
|
+
var wt = class extends je {
|
|
1130
1130
|
#e;
|
|
1131
1131
|
#t;
|
|
1132
1132
|
#s;
|
|
1133
1133
|
#i;
|
|
1134
1134
|
constructor(e) {
|
|
1135
|
-
super(), this.#e = e.client, this.mutationId = e.mutationId, this.#s = e.mutationCache, this.#t = [], this.state = e.state ||
|
|
1135
|
+
super(), this.#e = e.client, this.mutationId = e.mutationId, this.#s = e.mutationCache, this.#t = [], this.state = e.state || He(), this.setOptions(e.options), this.scheduleGc();
|
|
1136
1136
|
}
|
|
1137
1137
|
setOptions(e) {
|
|
1138
1138
|
this.options = e, this.updateGcTime(this.options.gcTime);
|
|
@@ -1169,7 +1169,7 @@ var St = class extends ke {
|
|
|
1169
1169
|
meta: this.options.meta,
|
|
1170
1170
|
mutationKey: this.options.mutationKey
|
|
1171
1171
|
};
|
|
1172
|
-
this.#i =
|
|
1172
|
+
this.#i = xe({
|
|
1173
1173
|
fn: () => this.options.mutationFn ? this.options.mutationFn(e, s) : Promise.reject(new Error("No mutationFn found")),
|
|
1174
1174
|
onFail: (n, o) => {
|
|
1175
1175
|
this.#r({ type: "failed", failureCount: n, error: o });
|
|
@@ -1188,7 +1188,7 @@ var St = class extends ke {
|
|
|
1188
1188
|
if (r)
|
|
1189
1189
|
t();
|
|
1190
1190
|
else {
|
|
1191
|
-
this.#r({ type: "pending", variables: e, isPaused: i }), await this.#s.config.onMutate
|
|
1191
|
+
this.#r({ type: "pending", variables: e, isPaused: i }), this.#s.config.onMutate && await this.#s.config.onMutate(
|
|
1192
1192
|
e,
|
|
1193
1193
|
this,
|
|
1194
1194
|
s
|
|
@@ -1345,7 +1345,7 @@ var St = class extends ke {
|
|
|
1345
1345
|
});
|
|
1346
1346
|
}
|
|
1347
1347
|
};
|
|
1348
|
-
function
|
|
1348
|
+
function He() {
|
|
1349
1349
|
return {
|
|
1350
1350
|
context: void 0,
|
|
1351
1351
|
data: void 0,
|
|
@@ -1358,7 +1358,7 @@ function je() {
|
|
|
1358
1358
|
submittedAt: 0
|
|
1359
1359
|
};
|
|
1360
1360
|
}
|
|
1361
|
-
var
|
|
1361
|
+
var Le = class extends x {
|
|
1362
1362
|
constructor(t = {}) {
|
|
1363
1363
|
super(), this.config = t, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#s = 0;
|
|
1364
1364
|
}
|
|
@@ -1366,7 +1366,7 @@ var Ne = class extends j {
|
|
|
1366
1366
|
#t;
|
|
1367
1367
|
#s;
|
|
1368
1368
|
build(t, s, r) {
|
|
1369
|
-
const i = new
|
|
1369
|
+
const i = new wt({
|
|
1370
1370
|
client: t,
|
|
1371
1371
|
mutationCache: this,
|
|
1372
1372
|
mutationId: ++this.#s,
|
|
@@ -1377,7 +1377,7 @@ var Ne = class extends j {
|
|
|
1377
1377
|
}
|
|
1378
1378
|
add(t) {
|
|
1379
1379
|
this.#e.add(t);
|
|
1380
|
-
const s =
|
|
1380
|
+
const s = K(t);
|
|
1381
1381
|
if (typeof s == "string") {
|
|
1382
1382
|
const r = this.#t.get(s);
|
|
1383
1383
|
r ? r.push(t) : this.#t.set(s, [t]);
|
|
@@ -1386,7 +1386,7 @@ var Ne = class extends j {
|
|
|
1386
1386
|
}
|
|
1387
1387
|
remove(t) {
|
|
1388
1388
|
if (this.#e.delete(t)) {
|
|
1389
|
-
const s =
|
|
1389
|
+
const s = K(t);
|
|
1390
1390
|
if (typeof s == "string") {
|
|
1391
1391
|
const r = this.#t.get(s);
|
|
1392
1392
|
if (r)
|
|
@@ -1399,7 +1399,7 @@ var Ne = class extends j {
|
|
|
1399
1399
|
this.notify({ type: "removed", mutation: t });
|
|
1400
1400
|
}
|
|
1401
1401
|
canRun(t) {
|
|
1402
|
-
const s =
|
|
1402
|
+
const s = K(t);
|
|
1403
1403
|
if (typeof s == "string") {
|
|
1404
1404
|
const i = this.#t.get(s)?.find(
|
|
1405
1405
|
(n) => n.state.status === "pending"
|
|
@@ -1409,7 +1409,7 @@ var Ne = class extends j {
|
|
|
1409
1409
|
return !0;
|
|
1410
1410
|
}
|
|
1411
1411
|
runNext(t) {
|
|
1412
|
-
const s =
|
|
1412
|
+
const s = K(t);
|
|
1413
1413
|
return typeof s == "string" ? this.#t.get(s)?.find((i) => i !== t && i.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
|
|
1414
1414
|
}
|
|
1415
1415
|
clear() {
|
|
@@ -1425,11 +1425,11 @@ var Ne = class extends j {
|
|
|
1425
1425
|
find(t) {
|
|
1426
1426
|
const s = { exact: !0, ...t };
|
|
1427
1427
|
return this.getAll().find(
|
|
1428
|
-
(r) =>
|
|
1428
|
+
(r) => de(s, r)
|
|
1429
1429
|
);
|
|
1430
1430
|
}
|
|
1431
1431
|
findAll(t = {}) {
|
|
1432
|
-
return this.getAll().filter((s) =>
|
|
1432
|
+
return this.getAll().filter((s) => de(t, s));
|
|
1433
1433
|
}
|
|
1434
1434
|
notify(t) {
|
|
1435
1435
|
b.batch(() => {
|
|
@@ -1447,10 +1447,10 @@ var Ne = class extends j {
|
|
|
1447
1447
|
);
|
|
1448
1448
|
}
|
|
1449
1449
|
};
|
|
1450
|
-
function
|
|
1450
|
+
function K(e) {
|
|
1451
1451
|
return e.options.scope?.id;
|
|
1452
1452
|
}
|
|
1453
|
-
var
|
|
1453
|
+
var Et = class extends x {
|
|
1454
1454
|
#e;
|
|
1455
1455
|
#t = void 0;
|
|
1456
1456
|
#s;
|
|
@@ -1463,7 +1463,7 @@ var Ct = class extends j {
|
|
|
1463
1463
|
}
|
|
1464
1464
|
setOptions(e) {
|
|
1465
1465
|
const t = this.options;
|
|
1466
|
-
this.options = this.#e.defaultMutationOptions(e),
|
|
1466
|
+
this.options = this.#e.defaultMutationOptions(e), G(this.options, t) || this.#e.getMutationCache().notify({
|
|
1467
1467
|
type: "observerOptionsUpdated",
|
|
1468
1468
|
mutation: this.#s,
|
|
1469
1469
|
observer: this
|
|
@@ -1485,7 +1485,7 @@ var Ct = class extends j {
|
|
|
1485
1485
|
return this.#i = t, this.#s?.removeObserver(this), this.#s = this.#e.getMutationCache().build(this.#e, this.options), this.#s.addObserver(this), this.#s.execute(e);
|
|
1486
1486
|
}
|
|
1487
1487
|
#r() {
|
|
1488
|
-
const e = this.#s?.state ??
|
|
1488
|
+
const e = this.#s?.state ?? He();
|
|
1489
1489
|
this.#t = {
|
|
1490
1490
|
...e,
|
|
1491
1491
|
isPending: e.status === "pending",
|
|
@@ -1555,15 +1555,15 @@ var Ct = class extends j {
|
|
|
1555
1555
|
});
|
|
1556
1556
|
});
|
|
1557
1557
|
}
|
|
1558
|
-
},
|
|
1558
|
+
}, Ve = class extends x {
|
|
1559
1559
|
constructor(t = {}) {
|
|
1560
1560
|
super(), this.config = t, this.#e = /* @__PURE__ */ new Map();
|
|
1561
1561
|
}
|
|
1562
1562
|
#e;
|
|
1563
1563
|
build(t, s, r) {
|
|
1564
|
-
const i = s.queryKey, n = s.queryHash ??
|
|
1564
|
+
const i = s.queryKey, n = s.queryHash ?? ae(i, s);
|
|
1565
1565
|
let o = this.get(n);
|
|
1566
|
-
return o || (o = new
|
|
1566
|
+
return o || (o = new vt({
|
|
1567
1567
|
client: t,
|
|
1568
1568
|
queryKey: i,
|
|
1569
1569
|
queryHash: n,
|
|
@@ -1598,12 +1598,12 @@ var Ct = class extends j {
|
|
|
1598
1598
|
find(t) {
|
|
1599
1599
|
const s = { exact: !0, ...t };
|
|
1600
1600
|
return this.getAll().find(
|
|
1601
|
-
(r) =>
|
|
1601
|
+
(r) => fe(s, r)
|
|
1602
1602
|
);
|
|
1603
1603
|
}
|
|
1604
1604
|
findAll(t = {}) {
|
|
1605
1605
|
const s = this.getAll();
|
|
1606
|
-
return Object.keys(t).length > 0 ? s.filter((r) =>
|
|
1606
|
+
return Object.keys(t).length > 0 ? s.filter((r) => fe(t, r)) : s;
|
|
1607
1607
|
}
|
|
1608
1608
|
notify(t) {
|
|
1609
1609
|
b.batch(() => {
|
|
@@ -1626,7 +1626,7 @@ var Ct = class extends j {
|
|
|
1626
1626
|
});
|
|
1627
1627
|
});
|
|
1628
1628
|
}
|
|
1629
|
-
},
|
|
1629
|
+
}, Qt = class {
|
|
1630
1630
|
#e;
|
|
1631
1631
|
#t;
|
|
1632
1632
|
#s;
|
|
@@ -1636,12 +1636,12 @@ var Ct = class extends j {
|
|
|
1636
1636
|
#a;
|
|
1637
1637
|
#n;
|
|
1638
1638
|
constructor(t = {}) {
|
|
1639
|
-
this.#e = t.queryCache || new
|
|
1639
|
+
this.#e = t.queryCache || new Ve(), this.#t = t.mutationCache || new Le(), this.#s = t.defaultOptions || {}, this.#i = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#o = 0;
|
|
1640
1640
|
}
|
|
1641
1641
|
mount() {
|
|
1642
|
-
this.#o++, this.#o === 1 && (this.#a =
|
|
1642
|
+
this.#o++, this.#o === 1 && (this.#a = ue.subscribe(async (t) => {
|
|
1643
1643
|
t && (await this.resumePausedMutations(), this.#e.onFocus());
|
|
1644
|
-
}), this.#n =
|
|
1644
|
+
}), this.#n = k.subscribe(async (t) => {
|
|
1645
1645
|
t && (await this.resumePausedMutations(), this.#e.onOnline());
|
|
1646
1646
|
}));
|
|
1647
1647
|
}
|
|
@@ -1678,7 +1678,7 @@ var Ct = class extends j {
|
|
|
1678
1678
|
setQueryData(t, s, r) {
|
|
1679
1679
|
const i = this.defaultQueryOptions({ queryKey: t }), o = this.#e.get(
|
|
1680
1680
|
i.queryHash
|
|
1681
|
-
)?.state.data, a =
|
|
1681
|
+
)?.state.data, a = at(s, o);
|
|
1682
1682
|
if (a !== void 0)
|
|
1683
1683
|
return this.#e.build(this, i).setData(a, { ...r, manual: !0 });
|
|
1684
1684
|
}
|
|
@@ -1757,16 +1757,16 @@ var Ct = class extends j {
|
|
|
1757
1757
|
return this.fetchQuery(t).then(w).catch(w);
|
|
1758
1758
|
}
|
|
1759
1759
|
fetchInfiniteQuery(t) {
|
|
1760
|
-
return t.behavior =
|
|
1760
|
+
return t.behavior = Oe(t.pages), this.fetchQuery(t);
|
|
1761
1761
|
}
|
|
1762
1762
|
prefetchInfiniteQuery(t) {
|
|
1763
1763
|
return this.fetchInfiniteQuery(t).then(w).catch(w);
|
|
1764
1764
|
}
|
|
1765
1765
|
ensureInfiniteQueryData(t) {
|
|
1766
|
-
return t.behavior =
|
|
1766
|
+
return t.behavior = Oe(t.pages), this.ensureQueryData(t);
|
|
1767
1767
|
}
|
|
1768
1768
|
resumePausedMutations() {
|
|
1769
|
-
return
|
|
1769
|
+
return k.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
|
|
1770
1770
|
}
|
|
1771
1771
|
getQueryCache() {
|
|
1772
1772
|
return this.#e;
|
|
@@ -1813,10 +1813,10 @@ var Ct = class extends j {
|
|
|
1813
1813
|
...t,
|
|
1814
1814
|
_defaulted: !0
|
|
1815
1815
|
};
|
|
1816
|
-
return s.queryHash || (s.queryHash =
|
|
1816
|
+
return s.queryHash || (s.queryHash = ae(
|
|
1817
1817
|
s.queryKey,
|
|
1818
1818
|
s
|
|
1819
|
-
)), s.refetchOnReconnect === void 0 && (s.refetchOnReconnect = s.networkMode !== "always"), s.throwOnError === void 0 && (s.throwOnError = !!s.suspense), !s.networkMode && s.persister && (s.networkMode = "offlineFirst"), s.queryFn ===
|
|
1819
|
+
)), s.refetchOnReconnect === void 0 && (s.refetchOnReconnect = s.networkMode !== "always"), s.throwOnError === void 0 && (s.throwOnError = !!s.suspense), !s.networkMode && s.persister && (s.networkMode = "offlineFirst"), s.queryFn === W && (s.enabled = !1), s;
|
|
1820
1820
|
}
|
|
1821
1821
|
defaultMutationOptions(t) {
|
|
1822
1822
|
return t?._defaulted ? t : {
|
|
@@ -1829,91 +1829,91 @@ var Ct = class extends j {
|
|
|
1829
1829
|
clear() {
|
|
1830
1830
|
this.#e.clear(), this.#t.clear();
|
|
1831
1831
|
}
|
|
1832
|
-
},
|
|
1833
|
-
function
|
|
1832
|
+
}, At = "VUE_QUERY_CLIENT";
|
|
1833
|
+
function Ke(e) {
|
|
1834
1834
|
const t = e ? `:${e}` : "";
|
|
1835
|
-
return `${
|
|
1835
|
+
return `${At}${t}`;
|
|
1836
1836
|
}
|
|
1837
|
-
function
|
|
1837
|
+
function ie(e, t) {
|
|
1838
1838
|
Object.keys(e).forEach((s) => {
|
|
1839
1839
|
e[s] = t[s];
|
|
1840
1840
|
});
|
|
1841
1841
|
}
|
|
1842
|
-
function
|
|
1842
|
+
function ne(e, t, s = "", r = 0) {
|
|
1843
1843
|
if (t) {
|
|
1844
1844
|
const i = t(e, s, r);
|
|
1845
|
-
if (i === void 0 &&
|
|
1845
|
+
if (i === void 0 && Ae(e) || i !== void 0)
|
|
1846
1846
|
return i;
|
|
1847
1847
|
}
|
|
1848
1848
|
if (Array.isArray(e))
|
|
1849
1849
|
return e.map(
|
|
1850
|
-
(i, n) =>
|
|
1850
|
+
(i, n) => ne(i, t, String(n), r + 1)
|
|
1851
1851
|
);
|
|
1852
|
-
if (typeof e == "object" &&
|
|
1852
|
+
if (typeof e == "object" && Rt(e)) {
|
|
1853
1853
|
const i = Object.entries(e).map(([n, o]) => [
|
|
1854
1854
|
n,
|
|
1855
|
-
|
|
1855
|
+
ne(o, t, n, r + 1)
|
|
1856
1856
|
]);
|
|
1857
1857
|
return Object.fromEntries(i);
|
|
1858
1858
|
}
|
|
1859
1859
|
return e;
|
|
1860
1860
|
}
|
|
1861
|
-
function
|
|
1862
|
-
return
|
|
1861
|
+
function Pt(e, t) {
|
|
1862
|
+
return ne(e, t);
|
|
1863
1863
|
}
|
|
1864
1864
|
function h(e, t = !1) {
|
|
1865
|
-
return
|
|
1865
|
+
return Pt(e, (s, r, i) => {
|
|
1866
1866
|
if (i === 1 && r === "queryKey")
|
|
1867
1867
|
return h(s, !0);
|
|
1868
|
-
if (t &&
|
|
1868
|
+
if (t && It(s))
|
|
1869
1869
|
return h(s(), t);
|
|
1870
|
-
if (
|
|
1871
|
-
return h(
|
|
1870
|
+
if (Ae(s))
|
|
1871
|
+
return h(Je(s), t);
|
|
1872
1872
|
});
|
|
1873
1873
|
}
|
|
1874
|
-
function
|
|
1874
|
+
function Rt(e) {
|
|
1875
1875
|
if (Object.prototype.toString.call(e) !== "[object Object]")
|
|
1876
1876
|
return !1;
|
|
1877
1877
|
const t = Object.getPrototypeOf(e);
|
|
1878
1878
|
return t === null || t === Object.prototype;
|
|
1879
1879
|
}
|
|
1880
|
-
function
|
|
1880
|
+
function It(e) {
|
|
1881
1881
|
return typeof e == "function";
|
|
1882
1882
|
}
|
|
1883
|
-
function
|
|
1884
|
-
if (!
|
|
1883
|
+
function Ge(e = "") {
|
|
1884
|
+
if (!Xe())
|
|
1885
1885
|
throw new Error(
|
|
1886
1886
|
"vue-query hooks can only be used inside setup() function or functions that support injection context."
|
|
1887
1887
|
);
|
|
1888
|
-
const t =
|
|
1888
|
+
const t = Ke(e), s = Ze(t);
|
|
1889
1889
|
if (!s)
|
|
1890
1890
|
throw new Error(
|
|
1891
1891
|
"No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library."
|
|
1892
1892
|
);
|
|
1893
1893
|
return s;
|
|
1894
1894
|
}
|
|
1895
|
-
var
|
|
1895
|
+
var We = class extends Ve {
|
|
1896
1896
|
find(e) {
|
|
1897
1897
|
return super.find(h(e));
|
|
1898
1898
|
}
|
|
1899
1899
|
findAll(e = {}) {
|
|
1900
1900
|
return super.findAll(h(e));
|
|
1901
1901
|
}
|
|
1902
|
-
},
|
|
1902
|
+
}, Dt = class extends Le {
|
|
1903
1903
|
find(e) {
|
|
1904
1904
|
return super.find(h(e));
|
|
1905
1905
|
}
|
|
1906
1906
|
findAll(e = {}) {
|
|
1907
1907
|
return super.findAll(h(e));
|
|
1908
1908
|
}
|
|
1909
|
-
},
|
|
1909
|
+
}, Be = class extends Qt {
|
|
1910
1910
|
constructor(e = {}) {
|
|
1911
1911
|
const t = {
|
|
1912
1912
|
defaultOptions: e.defaultOptions,
|
|
1913
|
-
queryCache: e.queryCache || new
|
|
1914
|
-
mutationCache: e.mutationCache || new
|
|
1913
|
+
queryCache: e.queryCache || new We(),
|
|
1914
|
+
mutationCache: e.mutationCache || new Dt()
|
|
1915
1915
|
};
|
|
1916
|
-
super(t), this.isRestoring =
|
|
1916
|
+
super(t), this.isRestoring = et(!1);
|
|
1917
1917
|
}
|
|
1918
1918
|
isFetching(e = {}) {
|
|
1919
1919
|
return super.isFetching(h(e));
|
|
@@ -1967,7 +1967,7 @@ var Ke = class extends He {
|
|
|
1967
1967
|
...s,
|
|
1968
1968
|
type: s.refetchType ?? s.type ?? "active"
|
|
1969
1969
|
};
|
|
1970
|
-
return
|
|
1970
|
+
return tt().then(() => super.refetchQueries(i, r));
|
|
1971
1971
|
}
|
|
1972
1972
|
refetchQueries(e = {}, t = {}) {
|
|
1973
1973
|
return super.refetchQueries(
|
|
@@ -2006,22 +2006,22 @@ var Ke = class extends He {
|
|
|
2006
2006
|
return super.getMutationDefaults(h(e));
|
|
2007
2007
|
}
|
|
2008
2008
|
};
|
|
2009
|
-
function
|
|
2010
|
-
return
|
|
2009
|
+
function Tt() {
|
|
2010
|
+
return $e().__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
2011
2011
|
}
|
|
2012
|
-
function
|
|
2012
|
+
function $e() {
|
|
2013
2013
|
return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
|
|
2014
2014
|
}
|
|
2015
|
-
const
|
|
2016
|
-
let
|
|
2017
|
-
function
|
|
2015
|
+
const Ft = typeof Proxy == "function", Mt = "devtools-plugin:setup", Ut = "plugin:settings:set";
|
|
2016
|
+
let q, oe;
|
|
2017
|
+
function qt() {
|
|
2018
2018
|
var e;
|
|
2019
|
-
return
|
|
2019
|
+
return q !== void 0 || (typeof window < "u" && window.performance ? (q = !0, oe = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (q = !0, oe = globalThis.perf_hooks.performance) : q = !1), q;
|
|
2020
2020
|
}
|
|
2021
|
-
function
|
|
2022
|
-
return
|
|
2021
|
+
function _t() {
|
|
2022
|
+
return qt() ? oe.now() : Date.now();
|
|
2023
2023
|
}
|
|
2024
|
-
class
|
|
2024
|
+
class kt {
|
|
2025
2025
|
constructor(t, s) {
|
|
2026
2026
|
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = s;
|
|
2027
2027
|
const r = {};
|
|
@@ -2049,9 +2049,9 @@ class qt {
|
|
|
2049
2049
|
n = o;
|
|
2050
2050
|
},
|
|
2051
2051
|
now() {
|
|
2052
|
-
return
|
|
2052
|
+
return _t();
|
|
2053
2053
|
}
|
|
2054
|
-
}, s && s.on(
|
|
2054
|
+
}, s && s.on(Ut, (o, a) => {
|
|
2055
2055
|
o === this.plugin.id && this.fallbacks.setSettings(a);
|
|
2056
2056
|
}), this.proxiedOn = new Proxy({}, {
|
|
2057
2057
|
get: (o, a) => this.target ? this.target.on[a] : (...u) => {
|
|
@@ -2083,12 +2083,12 @@ class qt {
|
|
|
2083
2083
|
s.resolve(await this.target[s.method](...s.args));
|
|
2084
2084
|
}
|
|
2085
2085
|
}
|
|
2086
|
-
function
|
|
2087
|
-
const s = e, r =
|
|
2086
|
+
function xt(e, t) {
|
|
2087
|
+
const s = e, r = $e(), i = Tt(), n = Ft && s.enableEarlyProxy;
|
|
2088
2088
|
if (i && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !n))
|
|
2089
|
-
i.emit(
|
|
2089
|
+
i.emit(Mt, e, t);
|
|
2090
2090
|
else {
|
|
2091
|
-
const o = n ? new
|
|
2091
|
+
const o = n ? new kt(s, i) : null;
|
|
2092
2092
|
(r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
|
|
2093
2093
|
pluginDescriptor: s,
|
|
2094
2094
|
setupFn: t,
|
|
@@ -2096,7 +2096,7 @@ function _t(e, t) {
|
|
|
2096
2096
|
}), o && t(o.proxiedTarget);
|
|
2097
2097
|
}
|
|
2098
2098
|
}
|
|
2099
|
-
const
|
|
2099
|
+
const ze = {
|
|
2100
2100
|
À: "A",
|
|
2101
2101
|
Á: "A",
|
|
2102
2102
|
Â: "A",
|
|
@@ -2496,9 +2496,9 @@ const Be = {
|
|
|
2496
2496
|
x̧: "x",
|
|
2497
2497
|
Z̧: "Z",
|
|
2498
2498
|
z̧: "z"
|
|
2499
|
-
},
|
|
2500
|
-
function
|
|
2501
|
-
return e.replace(
|
|
2499
|
+
}, jt = Object.keys(ze).join("|"), Nt = new RegExp(jt, "g");
|
|
2500
|
+
function Ht(e) {
|
|
2501
|
+
return e.replace(Nt, (t) => ze[t]);
|
|
2502
2502
|
}
|
|
2503
2503
|
const S = {
|
|
2504
2504
|
CASE_SENSITIVE_EQUAL: 7,
|
|
@@ -2510,10 +2510,10 @@ const S = {
|
|
|
2510
2510
|
MATCHES: 1,
|
|
2511
2511
|
NO_MATCH: 0
|
|
2512
2512
|
};
|
|
2513
|
-
function
|
|
2513
|
+
function Lt(e, t, s) {
|
|
2514
2514
|
var r;
|
|
2515
2515
|
if (s = s || {}, s.threshold = (r = s.threshold) != null ? r : S.MATCHES, !s.accessors) {
|
|
2516
|
-
const o =
|
|
2516
|
+
const o = Ce(e, t, s);
|
|
2517
2517
|
return {
|
|
2518
2518
|
// ends up being duplicate of 'item' in matches but consistent
|
|
2519
2519
|
rankedValue: e,
|
|
@@ -2523,7 +2523,7 @@ function Nt(e, t, s) {
|
|
|
2523
2523
|
passed: o >= s.threshold
|
|
2524
2524
|
};
|
|
2525
2525
|
}
|
|
2526
|
-
const i =
|
|
2526
|
+
const i = Wt(e, s.accessors), n = {
|
|
2527
2527
|
rankedValue: e,
|
|
2528
2528
|
rank: S.NO_MATCH,
|
|
2529
2529
|
accessorIndex: -1,
|
|
@@ -2532,7 +2532,7 @@ function Nt(e, t, s) {
|
|
|
2532
2532
|
};
|
|
2533
2533
|
for (let o = 0; o < i.length; o++) {
|
|
2534
2534
|
const a = i[o];
|
|
2535
|
-
let u =
|
|
2535
|
+
let u = Ce(a.itemValue, t, s);
|
|
2536
2536
|
const {
|
|
2537
2537
|
minRanking: y,
|
|
2538
2538
|
maxRanking: c,
|
|
@@ -2542,10 +2542,10 @@ function Nt(e, t, s) {
|
|
|
2542
2542
|
}
|
|
2543
2543
|
return n;
|
|
2544
2544
|
}
|
|
2545
|
-
function
|
|
2546
|
-
return e =
|
|
2545
|
+
function Ce(e, t, s) {
|
|
2546
|
+
return e = we(e, s), t = we(t, s), t.length > e.length ? S.NO_MATCH : e === t ? S.CASE_SENSITIVE_EQUAL : (e = e.toLowerCase(), t = t.toLowerCase(), e === t ? S.EQUAL : e.startsWith(t) ? S.STARTS_WITH : e.includes(` ${t}`) ? S.WORD_STARTS_WITH : e.includes(t) ? S.CONTAINS : t.length === 1 ? S.NO_MATCH : Vt(e).includes(t) ? S.ACRONYM : Kt(e, t));
|
|
2547
2547
|
}
|
|
2548
|
-
function
|
|
2548
|
+
function Vt(e) {
|
|
2549
2549
|
let t = "";
|
|
2550
2550
|
return e.split(" ").forEach((r) => {
|
|
2551
2551
|
r.split("-").forEach((n) => {
|
|
@@ -2553,7 +2553,7 @@ function Ht(e) {
|
|
|
2553
2553
|
});
|
|
2554
2554
|
}), t;
|
|
2555
2555
|
}
|
|
2556
|
-
function
|
|
2556
|
+
function Kt(e, t) {
|
|
2557
2557
|
let s = 0, r = 0;
|
|
2558
2558
|
function i(u, y, c) {
|
|
2559
2559
|
for (let l = c, f = y.length; l < f; l++)
|
|
@@ -2577,22 +2577,22 @@ function Lt(e, t) {
|
|
|
2577
2577
|
const a = r - o;
|
|
2578
2578
|
return n(a);
|
|
2579
2579
|
}
|
|
2580
|
-
function
|
|
2580
|
+
function we(e, t) {
|
|
2581
2581
|
let {
|
|
2582
2582
|
keepDiacritics: s
|
|
2583
2583
|
} = t;
|
|
2584
|
-
return e = `${e}`, s || (e =
|
|
2584
|
+
return e = `${e}`, s || (e = Ht(e)), e;
|
|
2585
2585
|
}
|
|
2586
|
-
function
|
|
2586
|
+
function Gt(e, t) {
|
|
2587
2587
|
let s = t;
|
|
2588
2588
|
typeof t == "object" && (s = t.accessor);
|
|
2589
2589
|
const r = s(e);
|
|
2590
2590
|
return r == null ? [] : Array.isArray(r) ? r : [String(r)];
|
|
2591
2591
|
}
|
|
2592
|
-
function
|
|
2592
|
+
function Wt(e, t) {
|
|
2593
2593
|
const s = [];
|
|
2594
2594
|
for (let r = 0, i = t.length; r < i; r++) {
|
|
2595
|
-
const n = t[r], o =
|
|
2595
|
+
const n = t[r], o = Bt(n), a = Gt(e, n);
|
|
2596
2596
|
for (let u = 0, y = a.length; u < y; u++)
|
|
2597
2597
|
s.push({
|
|
2598
2598
|
itemValue: a[u],
|
|
@@ -2601,40 +2601,40 @@ function Kt(e, t) {
|
|
|
2601
2601
|
}
|
|
2602
2602
|
return s;
|
|
2603
2603
|
}
|
|
2604
|
-
const
|
|
2604
|
+
const Ee = {
|
|
2605
2605
|
maxRanking: 1 / 0,
|
|
2606
2606
|
minRanking: -1 / 0
|
|
2607
2607
|
};
|
|
2608
|
-
function
|
|
2609
|
-
return typeof e == "function" ?
|
|
2610
|
-
...
|
|
2608
|
+
function Bt(e) {
|
|
2609
|
+
return typeof e == "function" ? Ee : {
|
|
2610
|
+
...Ee,
|
|
2611
2611
|
...e
|
|
2612
2612
|
};
|
|
2613
2613
|
}
|
|
2614
2614
|
function F(e) {
|
|
2615
2615
|
return e.state.fetchStatus === "fetching" ? 0 : e.state.fetchStatus === "paused" ? 4 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3;
|
|
2616
2616
|
}
|
|
2617
|
-
function
|
|
2617
|
+
function Qe(e) {
|
|
2618
2618
|
const t = F(e);
|
|
2619
2619
|
return t === 0 ? "fetching" : t === 4 ? "paused" : t === 2 ? "stale" : t === 3 ? "inactive" : "fresh";
|
|
2620
2620
|
}
|
|
2621
|
-
function
|
|
2621
|
+
function $t(e) {
|
|
2622
2622
|
return F(e) === 2 ? 0 : 16777215;
|
|
2623
2623
|
}
|
|
2624
|
-
function
|
|
2624
|
+
function zt(e) {
|
|
2625
2625
|
const t = F(e);
|
|
2626
2626
|
return t === 0 ? 27647 : t === 4 ? 9193963 : t === 2 ? 16757248 : t === 3 ? 4148832 : 33575;
|
|
2627
2627
|
}
|
|
2628
|
-
var
|
|
2629
|
-
"Status > Last Updated":
|
|
2630
|
-
"Query Hash":
|
|
2631
|
-
"Last Updated":
|
|
2632
|
-
}, P = "vue-query",
|
|
2633
|
-
function
|
|
2634
|
-
|
|
2628
|
+
var Yt = (e, t) => e.queryHash.localeCompare(t.queryHash), Ye = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, Jt = (e, t) => F(e) === F(t) ? Ye(e, t) : F(e) > F(t) ? 1 : -1, $ = {
|
|
2629
|
+
"Status > Last Updated": Jt,
|
|
2630
|
+
"Query Hash": Yt,
|
|
2631
|
+
"Last Updated": Ye
|
|
2632
|
+
}, P = "vue-query", z = "Vue Query";
|
|
2633
|
+
function Xt(e, t) {
|
|
2634
|
+
xt(
|
|
2635
2635
|
{
|
|
2636
2636
|
id: P,
|
|
2637
|
-
label:
|
|
2637
|
+
label: z,
|
|
2638
2638
|
packageName: "vue-query",
|
|
2639
2639
|
homepage: "https://tanstack.com/query/latest",
|
|
2640
2640
|
logo: "https://raw.githubusercontent.com/TanStack/query/main/packages/vue-query/media/vue-query.svg",
|
|
@@ -2659,11 +2659,11 @@ function Yt(e, t) {
|
|
|
2659
2659
|
sortFn: {
|
|
2660
2660
|
type: "choice",
|
|
2661
2661
|
label: "Sort Function",
|
|
2662
|
-
options: Object.keys(
|
|
2662
|
+
options: Object.keys($).map((s) => ({
|
|
2663
2663
|
label: s,
|
|
2664
2664
|
value: s
|
|
2665
2665
|
})),
|
|
2666
|
-
defaultValue: Object.keys(
|
|
2666
|
+
defaultValue: Object.keys($)[0]
|
|
2667
2667
|
},
|
|
2668
2668
|
onlineMode: {
|
|
2669
2669
|
type: "choice",
|
|
@@ -2685,11 +2685,11 @@ function Yt(e, t) {
|
|
|
2685
2685
|
},
|
|
2686
2686
|
(s) => {
|
|
2687
2687
|
const r = s.getSettings();
|
|
2688
|
-
|
|
2688
|
+
k.setOnline(!!r.onlineMode.valueOf());
|
|
2689
2689
|
const i = t.getQueryCache();
|
|
2690
2690
|
s.addInspector({
|
|
2691
2691
|
id: P,
|
|
2692
|
-
label:
|
|
2692
|
+
label: z,
|
|
2693
2693
|
icon: "api",
|
|
2694
2694
|
nodeActions: [
|
|
2695
2695
|
{
|
|
@@ -2746,7 +2746,7 @@ function Yt(e, t) {
|
|
|
2746
2746
|
]
|
|
2747
2747
|
}), s.addTimelineLayer({
|
|
2748
2748
|
id: P,
|
|
2749
|
-
label:
|
|
2749
|
+
label: z,
|
|
2750
2750
|
color: 16767308
|
|
2751
2751
|
}), i.subscribe((n) => {
|
|
2752
2752
|
s.sendInspectorTree(P), s.sendInspectorState(P), [
|
|
@@ -2766,23 +2766,23 @@ function Yt(e, t) {
|
|
|
2766
2766
|
}
|
|
2767
2767
|
});
|
|
2768
2768
|
}), s.on.setPluginSettings((n) => {
|
|
2769
|
-
n.key === "onlineMode" &&
|
|
2769
|
+
n.key === "onlineMode" && k.setOnline(!!n.newValue);
|
|
2770
2770
|
}), s.on.getInspectorTree((n) => {
|
|
2771
2771
|
if (n.inspectorId === P) {
|
|
2772
2772
|
const o = i.getAll(), a = s.getSettings(), c = (n.filter ? o.filter(
|
|
2773
|
-
(l) =>
|
|
2773
|
+
(l) => Lt(l.queryHash, n.filter).passed
|
|
2774
2774
|
) : [...o]).sort(
|
|
2775
|
-
(l, f) =>
|
|
2775
|
+
(l, f) => $[a.sortFn](l, f) * a.baseSort
|
|
2776
2776
|
).map((l) => {
|
|
2777
|
-
const f =
|
|
2777
|
+
const f = Qe(l);
|
|
2778
2778
|
return {
|
|
2779
2779
|
id: l.queryHash,
|
|
2780
2780
|
label: l.queryHash,
|
|
2781
2781
|
tags: [
|
|
2782
2782
|
{
|
|
2783
2783
|
label: `${f} [${l.getObserversCount()}]`,
|
|
2784
|
-
textColor:
|
|
2785
|
-
backgroundColor:
|
|
2784
|
+
textColor: $t(l),
|
|
2785
|
+
backgroundColor: zt(l)
|
|
2786
2786
|
}
|
|
2787
2787
|
]
|
|
2788
2788
|
};
|
|
@@ -2802,7 +2802,7 @@ function Yt(e, t) {
|
|
|
2802
2802
|
},
|
|
2803
2803
|
{
|
|
2804
2804
|
key: "Query status",
|
|
2805
|
-
value:
|
|
2805
|
+
value: Qe(o)
|
|
2806
2806
|
},
|
|
2807
2807
|
{
|
|
2808
2808
|
key: "Observers",
|
|
@@ -2831,15 +2831,15 @@ function Yt(e, t) {
|
|
|
2831
2831
|
}
|
|
2832
2832
|
);
|
|
2833
2833
|
}
|
|
2834
|
-
var
|
|
2834
|
+
var os = {
|
|
2835
2835
|
install: (e, t = {}) => {
|
|
2836
|
-
const s =
|
|
2836
|
+
const s = Ke(t.queryClientKey);
|
|
2837
2837
|
let r;
|
|
2838
2838
|
if ("queryClient" in t && t.queryClient)
|
|
2839
2839
|
r = t.queryClient;
|
|
2840
2840
|
else {
|
|
2841
2841
|
const o = "queryClientConfig" in t ? t.queryClientConfig : void 0;
|
|
2842
|
-
r = new
|
|
2842
|
+
r = new Be(o);
|
|
2843
2843
|
}
|
|
2844
2844
|
M || r.mount();
|
|
2845
2845
|
let i = () => {
|
|
@@ -2862,36 +2862,36 @@ var is = {
|
|
|
2862
2862
|
n(), o();
|
|
2863
2863
|
};
|
|
2864
2864
|
}
|
|
2865
|
-
e.provide(s, r), process.env.NODE_ENV === "development" && t.enableDevtoolsV6Plugin &&
|
|
2865
|
+
e.provide(s, r), process.env.NODE_ENV === "development" && t.enableDevtoolsV6Plugin && Xt(e, r);
|
|
2866
2866
|
}
|
|
2867
2867
|
};
|
|
2868
|
-
function
|
|
2869
|
-
process.env.NODE_ENV === "development" && (
|
|
2868
|
+
function Zt(e, t, s) {
|
|
2869
|
+
process.env.NODE_ENV === "development" && (Pe() || console.warn(
|
|
2870
2870
|
'vue-query composable like "useQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.'
|
|
2871
2871
|
));
|
|
2872
|
-
const r = s ||
|
|
2872
|
+
const r = s || Ge(), i = Re(() => {
|
|
2873
2873
|
let d = t;
|
|
2874
2874
|
typeof d == "function" && (d = d());
|
|
2875
2875
|
const g = h(d);
|
|
2876
2876
|
typeof g.enabled == "function" && (g.enabled = g.enabled());
|
|
2877
2877
|
const p = r.defaultQueryOptions(g);
|
|
2878
2878
|
return p._optimisticResults = r.isRestoring?.value ? "isRestoring" : "optimistic", p;
|
|
2879
|
-
}), n = new e(r, i.value), o = i.value.shallow ?
|
|
2879
|
+
}), n = new e(r, i.value), o = i.value.shallow ? Ie(n.getCurrentResult()) : De(n.getCurrentResult());
|
|
2880
2880
|
let a = () => {
|
|
2881
2881
|
};
|
|
2882
|
-
r.isRestoring &&
|
|
2882
|
+
r.isRestoring && _(
|
|
2883
2883
|
r.isRestoring,
|
|
2884
2884
|
(d) => {
|
|
2885
2885
|
d || (a(), a = n.subscribe((g) => {
|
|
2886
|
-
|
|
2886
|
+
ie(o, g);
|
|
2887
2887
|
}));
|
|
2888
2888
|
},
|
|
2889
2889
|
{ immediate: !0 }
|
|
2890
2890
|
);
|
|
2891
2891
|
const u = () => {
|
|
2892
|
-
n.setOptions(i.value),
|
|
2892
|
+
n.setOptions(i.value), ie(o, n.getCurrentResult());
|
|
2893
2893
|
};
|
|
2894
|
-
|
|
2894
|
+
_(i, u), Te(() => {
|
|
2895
2895
|
a();
|
|
2896
2896
|
});
|
|
2897
2897
|
const y = (...d) => (u(), o.refetch(...d)), c = () => new Promise(
|
|
@@ -2905,57 +2905,57 @@ function Jt(e, t, s) {
|
|
|
2905
2905
|
i.value
|
|
2906
2906
|
);
|
|
2907
2907
|
v.isStale ? (p(), n.fetchOptimistic(i.value).then(d, (O) => {
|
|
2908
|
-
|
|
2908
|
+
ee(i.value.throwOnError, [
|
|
2909
2909
|
O,
|
|
2910
2910
|
n.getCurrentQuery()
|
|
2911
2911
|
]) ? g(O) : d(n.getCurrentResult());
|
|
2912
2912
|
})) : (p(), d(v));
|
|
2913
2913
|
}
|
|
2914
2914
|
};
|
|
2915
|
-
m(), p =
|
|
2915
|
+
m(), p = _(i, m);
|
|
2916
2916
|
}
|
|
2917
2917
|
);
|
|
2918
|
-
|
|
2918
|
+
_(
|
|
2919
2919
|
() => o.error,
|
|
2920
2920
|
(d) => {
|
|
2921
|
-
if (o.isError && !o.isFetching &&
|
|
2921
|
+
if (o.isError && !o.isFetching && ee(i.value.throwOnError, [
|
|
2922
2922
|
d,
|
|
2923
2923
|
n.getCurrentQuery()
|
|
2924
2924
|
]))
|
|
2925
2925
|
throw d;
|
|
2926
2926
|
}
|
|
2927
2927
|
);
|
|
2928
|
-
const l = i.value.shallow ?
|
|
2928
|
+
const l = i.value.shallow ? Fe(o) : Me(o), f = Ue(l);
|
|
2929
2929
|
for (const d in o)
|
|
2930
2930
|
typeof o[d] == "function" && (f[d] = o[d]);
|
|
2931
2931
|
return f.suspense = c, f.refetch = y, f;
|
|
2932
2932
|
}
|
|
2933
|
-
function
|
|
2934
|
-
return
|
|
2933
|
+
function as(e, t) {
|
|
2934
|
+
return Zt(bt, e, t);
|
|
2935
2935
|
}
|
|
2936
|
-
function
|
|
2937
|
-
process.env.NODE_ENV === "development" && (
|
|
2936
|
+
function us(e, t) {
|
|
2937
|
+
process.env.NODE_ENV === "development" && (Pe() || console.warn(
|
|
2938
2938
|
'vue-query composable like "useQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.'
|
|
2939
2939
|
));
|
|
2940
|
-
const s = t ||
|
|
2940
|
+
const s = t || Ge(), r = Re(() => {
|
|
2941
2941
|
const c = typeof e == "function" ? e() : e;
|
|
2942
2942
|
return s.defaultMutationOptions(h(c));
|
|
2943
|
-
}), i = new
|
|
2944
|
-
|
|
2943
|
+
}), i = new Et(s, r.value), n = r.value.shallow ? Ie(i.getCurrentResult()) : De(i.getCurrentResult()), o = i.subscribe((c) => {
|
|
2944
|
+
ie(n, c);
|
|
2945
2945
|
}), a = (c, l) => {
|
|
2946
2946
|
i.mutate(c, l).catch(() => {
|
|
2947
2947
|
});
|
|
2948
2948
|
};
|
|
2949
|
-
|
|
2949
|
+
_(r, () => {
|
|
2950
2950
|
i.setOptions(r.value);
|
|
2951
|
-
}),
|
|
2951
|
+
}), Te(() => {
|
|
2952
2952
|
o();
|
|
2953
2953
|
});
|
|
2954
|
-
const u = r.value.shallow ?
|
|
2955
|
-
return
|
|
2954
|
+
const u = r.value.shallow ? Fe(n) : Me(n), y = Ue(u);
|
|
2955
|
+
return _(
|
|
2956
2956
|
() => n.error,
|
|
2957
2957
|
(c) => {
|
|
2958
|
-
if (c &&
|
|
2958
|
+
if (c && ee(r.value.throwOnError, [c]))
|
|
2959
2959
|
throw c;
|
|
2960
2960
|
}
|
|
2961
2961
|
), {
|
|
@@ -2965,21 +2965,21 @@ function os(e, t) {
|
|
|
2965
2965
|
reset: n.reset
|
|
2966
2966
|
};
|
|
2967
2967
|
}
|
|
2968
|
-
const
|
|
2969
|
-
function
|
|
2968
|
+
const cs = new Be();
|
|
2969
|
+
function hs(e, t, s) {
|
|
2970
2970
|
return {
|
|
2971
2971
|
queryClientConfig: {
|
|
2972
|
-
queryCache: new
|
|
2972
|
+
queryCache: new We({
|
|
2973
2973
|
onError: (r) => {
|
|
2974
2974
|
const i = r.code === "ERR_NETWORK", n = [403, 401].includes(r.response?.status);
|
|
2975
|
-
i ? e.error("Ошибка подключения к сети") : n ?
|
|
2975
|
+
i ? e.error("Ошибка подключения к сети") : n ? st(t, rt, s) : e.error(le(r));
|
|
2976
2976
|
}
|
|
2977
2977
|
}),
|
|
2978
2978
|
defaultOptions: {
|
|
2979
2979
|
queries: { refetchOnMount: !1, refetchOnWindowFocus: !1, retry: !1 },
|
|
2980
2980
|
mutations: {
|
|
2981
2981
|
onError: (r) => {
|
|
2982
|
-
e.error(
|
|
2982
|
+
e.error(le(r));
|
|
2983
2983
|
}
|
|
2984
2984
|
}
|
|
2985
2985
|
}
|
|
@@ -2987,10 +2987,10 @@ function us(e, t, s) {
|
|
|
2987
2987
|
};
|
|
2988
2988
|
}
|
|
2989
2989
|
export {
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2990
|
+
os as VueQueryPlugin,
|
|
2991
|
+
cs as queryClient,
|
|
2992
|
+
us as useMutation,
|
|
2993
|
+
as as useQuery,
|
|
2994
|
+
Ge as useQueryClient,
|
|
2995
|
+
hs as vueQueryOptions
|
|
2996
2996
|
};
|