@myxtra/authentication-green 2.6.0 → 2.8.1
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/App-BFcRPC4w.js +3286 -0
- package/dist/{index-ja2JZ7Im.mjs → index-BZr861VF.js} +1309 -1856
- package/dist/xtra-authentication.js +4 -0
- package/package.json +29 -28
- package/dist/App-Cnf7pTr3.mjs +0 -3291
- package/dist/xtra-authentication.mjs +0 -4
|
@@ -0,0 +1,3286 @@
|
|
|
1
|
+
var Ee = (t) => {
|
|
2
|
+
throw TypeError(t);
|
|
3
|
+
};
|
|
4
|
+
var re = (t, e, s) => e.has(t) || Ee("Cannot " + s);
|
|
5
|
+
var n = (t, e, s) => (re(t, e, "read from private field"), s ? s.call(t) : e.get(t)), y = (t, e, s) => e.has(t) ? Ee("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), p = (t, e, s, r) => (re(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s), b = (t, e, s) => (re(t, e, "access private method"), s);
|
|
6
|
+
var zt = (t, e, s, r) => ({
|
|
7
|
+
set _(a) {
|
|
8
|
+
p(t, e, a, s);
|
|
9
|
+
},
|
|
10
|
+
get _() {
|
|
11
|
+
return n(t, e, r);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
import { r as f, j as i, u as Fs, a as Ds, b as jt, P as Pe, c as Xe, d as Ts, e as Us, E as Qs, C as Hs } from "./index-BZr861VF.js";
|
|
15
|
+
var Ht = class {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
18
|
+
}
|
|
19
|
+
subscribe(t) {
|
|
20
|
+
return this.listeners.add(t), this.onSubscribe(), () => {
|
|
21
|
+
this.listeners.delete(t), this.onUnsubscribe();
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
hasListeners() {
|
|
25
|
+
return this.listeners.size > 0;
|
|
26
|
+
}
|
|
27
|
+
onSubscribe() {
|
|
28
|
+
}
|
|
29
|
+
onUnsubscribe() {
|
|
30
|
+
}
|
|
31
|
+
}, Qt = typeof window > "u" || "Deno" in globalThis;
|
|
32
|
+
function $() {
|
|
33
|
+
}
|
|
34
|
+
function Ks(t, e) {
|
|
35
|
+
return typeof t == "function" ? t(e) : t;
|
|
36
|
+
}
|
|
37
|
+
function ne(t) {
|
|
38
|
+
return typeof t == "number" && t >= 0 && t !== 1 / 0;
|
|
39
|
+
}
|
|
40
|
+
function Ie(t, e) {
|
|
41
|
+
return Math.max(t + (e || 0) - Date.now(), 0);
|
|
42
|
+
}
|
|
43
|
+
function St(t, e) {
|
|
44
|
+
return typeof t == "function" ? t(e) : t;
|
|
45
|
+
}
|
|
46
|
+
function z(t, e) {
|
|
47
|
+
return typeof t == "function" ? t(e) : t;
|
|
48
|
+
}
|
|
49
|
+
function Ae(t, e) {
|
|
50
|
+
const {
|
|
51
|
+
type: s = "all",
|
|
52
|
+
exact: r,
|
|
53
|
+
fetchStatus: a,
|
|
54
|
+
predicate: l,
|
|
55
|
+
queryKey: o,
|
|
56
|
+
stale: c
|
|
57
|
+
} = t;
|
|
58
|
+
if (o) {
|
|
59
|
+
if (r) {
|
|
60
|
+
if (e.queryHash !== xe(o, e.options))
|
|
61
|
+
return !1;
|
|
62
|
+
} else if (!Gt(e.queryKey, o))
|
|
63
|
+
return !1;
|
|
64
|
+
}
|
|
65
|
+
if (s !== "all") {
|
|
66
|
+
const v = e.isActive();
|
|
67
|
+
if (s === "active" && !v || s === "inactive" && v)
|
|
68
|
+
return !1;
|
|
69
|
+
}
|
|
70
|
+
return !(typeof c == "boolean" && e.isStale() !== c || a && a !== e.state.fetchStatus || l && !l(e));
|
|
71
|
+
}
|
|
72
|
+
function ke(t, e) {
|
|
73
|
+
const { exact: s, status: r, predicate: a, mutationKey: l } = t;
|
|
74
|
+
if (l) {
|
|
75
|
+
if (!e.options.mutationKey)
|
|
76
|
+
return !1;
|
|
77
|
+
if (s) {
|
|
78
|
+
if (bt(e.options.mutationKey) !== bt(l))
|
|
79
|
+
return !1;
|
|
80
|
+
} else if (!Gt(e.options.mutationKey, l))
|
|
81
|
+
return !1;
|
|
82
|
+
}
|
|
83
|
+
return !(r && e.state.status !== r || a && !a(e));
|
|
84
|
+
}
|
|
85
|
+
function xe(t, e) {
|
|
86
|
+
return ((e == null ? void 0 : e.queryKeyHashFn) || bt)(t);
|
|
87
|
+
}
|
|
88
|
+
function bt(t) {
|
|
89
|
+
return JSON.stringify(
|
|
90
|
+
t,
|
|
91
|
+
(e, s) => ae(s) ? Object.keys(s).sort().reduce((r, a) => (r[a] = s[a], r), {}) : s
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function Gt(t, e) {
|
|
95
|
+
return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? !Object.keys(e).some((s) => !Gt(t[s], e[s])) : !1;
|
|
96
|
+
}
|
|
97
|
+
function Be(t, e) {
|
|
98
|
+
if (t === e)
|
|
99
|
+
return t;
|
|
100
|
+
const s = Ne(t) && Ne(e);
|
|
101
|
+
if (s || ae(t) && ae(e)) {
|
|
102
|
+
const r = s ? t : Object.keys(t), a = r.length, l = s ? e : Object.keys(e), o = l.length, c = s ? [] : {};
|
|
103
|
+
let v = 0;
|
|
104
|
+
for (let g = 0; g < o; g++) {
|
|
105
|
+
const h = s ? g : l[g];
|
|
106
|
+
(!s && r.includes(h) || s) && t[h] === void 0 && e[h] === void 0 ? (c[h] = void 0, v++) : (c[h] = Be(t[h], e[h]), c[h] === t[h] && t[h] !== void 0 && v++);
|
|
107
|
+
}
|
|
108
|
+
return a === o && v === a ? t : c;
|
|
109
|
+
}
|
|
110
|
+
return e;
|
|
111
|
+
}
|
|
112
|
+
function It(t, e) {
|
|
113
|
+
if (!e || Object.keys(t).length !== Object.keys(e).length)
|
|
114
|
+
return !1;
|
|
115
|
+
for (const s in t)
|
|
116
|
+
if (t[s] !== e[s])
|
|
117
|
+
return !1;
|
|
118
|
+
return !0;
|
|
119
|
+
}
|
|
120
|
+
function Ne(t) {
|
|
121
|
+
return Array.isArray(t) && t.length === Object.keys(t).length;
|
|
122
|
+
}
|
|
123
|
+
function ae(t) {
|
|
124
|
+
if (!Me(t))
|
|
125
|
+
return !1;
|
|
126
|
+
const e = t.constructor;
|
|
127
|
+
if (e === void 0)
|
|
128
|
+
return !0;
|
|
129
|
+
const s = e.prototype;
|
|
130
|
+
return !(!Me(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
|
|
131
|
+
}
|
|
132
|
+
function Me(t) {
|
|
133
|
+
return Object.prototype.toString.call(t) === "[object Object]";
|
|
134
|
+
}
|
|
135
|
+
function Gs(t) {
|
|
136
|
+
return new Promise((e) => {
|
|
137
|
+
setTimeout(e, t);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function oe(t, e, s) {
|
|
141
|
+
return typeof s.structuralSharing == "function" ? s.structuralSharing(t, e) : s.structuralSharing !== !1 ? Be(t, e) : e;
|
|
142
|
+
}
|
|
143
|
+
function qs(t, e, s = 0) {
|
|
144
|
+
const r = [...t, e];
|
|
145
|
+
return s && r.length > s ? r.slice(1) : r;
|
|
146
|
+
}
|
|
147
|
+
function Ws(t, e, s = 0) {
|
|
148
|
+
const r = [e, ...t];
|
|
149
|
+
return s && r.length > s ? r.slice(0, -1) : r;
|
|
150
|
+
}
|
|
151
|
+
var ts = Symbol(), es = (t, e) => !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === ts ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn, pt, at, Et, Ke, Vs = (Ke = class extends Ht {
|
|
152
|
+
constructor() {
|
|
153
|
+
super();
|
|
154
|
+
y(this, pt);
|
|
155
|
+
y(this, at);
|
|
156
|
+
y(this, Et);
|
|
157
|
+
p(this, Et, (e) => {
|
|
158
|
+
if (!Qt && window.addEventListener) {
|
|
159
|
+
const s = () => e();
|
|
160
|
+
return window.addEventListener("visibilitychange", s, !1), () => {
|
|
161
|
+
window.removeEventListener("visibilitychange", s);
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
onSubscribe() {
|
|
167
|
+
n(this, at) || this.setEventListener(n(this, Et));
|
|
168
|
+
}
|
|
169
|
+
onUnsubscribe() {
|
|
170
|
+
var e;
|
|
171
|
+
this.hasListeners() || ((e = n(this, at)) == null || e.call(this), p(this, at, void 0));
|
|
172
|
+
}
|
|
173
|
+
setEventListener(e) {
|
|
174
|
+
var s;
|
|
175
|
+
p(this, Et, e), (s = n(this, at)) == null || s.call(this), p(this, at, e((r) => {
|
|
176
|
+
typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
|
|
177
|
+
}));
|
|
178
|
+
}
|
|
179
|
+
setFocused(e) {
|
|
180
|
+
n(this, pt) !== e && (p(this, pt, e), this.onFocus());
|
|
181
|
+
}
|
|
182
|
+
onFocus() {
|
|
183
|
+
const e = this.isFocused();
|
|
184
|
+
this.listeners.forEach((s) => {
|
|
185
|
+
s(e);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
isFocused() {
|
|
189
|
+
var e;
|
|
190
|
+
return typeof n(this, pt) == "boolean" ? n(this, pt) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
|
|
191
|
+
}
|
|
192
|
+
}, pt = new WeakMap(), at = new WeakMap(), Et = new WeakMap(), Ke), be = new Vs(), Pt, ot, At, Ge, $s = (Ge = class extends Ht {
|
|
193
|
+
constructor() {
|
|
194
|
+
super();
|
|
195
|
+
y(this, Pt, !0);
|
|
196
|
+
y(this, ot);
|
|
197
|
+
y(this, At);
|
|
198
|
+
p(this, At, (e) => {
|
|
199
|
+
if (!Qt && window.addEventListener) {
|
|
200
|
+
const s = () => e(!0), r = () => e(!1);
|
|
201
|
+
return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
|
|
202
|
+
window.removeEventListener("online", s), window.removeEventListener("offline", r);
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
onSubscribe() {
|
|
208
|
+
n(this, ot) || this.setEventListener(n(this, At));
|
|
209
|
+
}
|
|
210
|
+
onUnsubscribe() {
|
|
211
|
+
var e;
|
|
212
|
+
this.hasListeners() || ((e = n(this, ot)) == null || e.call(this), p(this, ot, void 0));
|
|
213
|
+
}
|
|
214
|
+
setEventListener(e) {
|
|
215
|
+
var s;
|
|
216
|
+
p(this, At, e), (s = n(this, ot)) == null || s.call(this), p(this, ot, e(this.setOnline.bind(this)));
|
|
217
|
+
}
|
|
218
|
+
setOnline(e) {
|
|
219
|
+
n(this, Pt) !== e && (p(this, Pt, e), this.listeners.forEach((r) => {
|
|
220
|
+
r(e);
|
|
221
|
+
}));
|
|
222
|
+
}
|
|
223
|
+
isOnline() {
|
|
224
|
+
return n(this, Pt);
|
|
225
|
+
}
|
|
226
|
+
}, Pt = new WeakMap(), ot = new WeakMap(), At = new WeakMap(), Ge), Bt = new $s();
|
|
227
|
+
function Zs(t) {
|
|
228
|
+
return Math.min(1e3 * 2 ** t, 3e4);
|
|
229
|
+
}
|
|
230
|
+
function ss(t) {
|
|
231
|
+
return (t ?? "online") === "online" ? Bt.isOnline() : !0;
|
|
232
|
+
}
|
|
233
|
+
var rs = class {
|
|
234
|
+
constructor(t) {
|
|
235
|
+
this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
function ie(t) {
|
|
239
|
+
return t instanceof rs;
|
|
240
|
+
}
|
|
241
|
+
function is(t) {
|
|
242
|
+
let e = !1, s = 0, r = !1, a, l, o;
|
|
243
|
+
const c = new Promise((C, w) => {
|
|
244
|
+
l = C, o = w;
|
|
245
|
+
}), v = (C) => {
|
|
246
|
+
var w;
|
|
247
|
+
r || (S(new rs(C)), (w = t.abort) == null || w.call(t));
|
|
248
|
+
}, g = () => {
|
|
249
|
+
e = !0;
|
|
250
|
+
}, h = () => {
|
|
251
|
+
e = !1;
|
|
252
|
+
}, u = () => be.isFocused() && (t.networkMode === "always" || Bt.isOnline()) && t.canRun(), d = () => ss(t.networkMode) && t.canRun(), m = (C) => {
|
|
253
|
+
var w;
|
|
254
|
+
r || (r = !0, (w = t.onSuccess) == null || w.call(t, C), a == null || a(), l(C));
|
|
255
|
+
}, S = (C) => {
|
|
256
|
+
var w;
|
|
257
|
+
r || (r = !0, (w = t.onError) == null || w.call(t, C), a == null || a(), o(C));
|
|
258
|
+
}, P = () => new Promise((C) => {
|
|
259
|
+
var w;
|
|
260
|
+
a = (j) => {
|
|
261
|
+
(r || u()) && C(j);
|
|
262
|
+
}, (w = t.onPause) == null || w.call(t);
|
|
263
|
+
}).then(() => {
|
|
264
|
+
var C;
|
|
265
|
+
a = void 0, r || (C = t.onContinue) == null || C.call(t);
|
|
266
|
+
}), k = () => {
|
|
267
|
+
if (r)
|
|
268
|
+
return;
|
|
269
|
+
let C;
|
|
270
|
+
const w = s === 0 ? t.initialPromise : void 0;
|
|
271
|
+
try {
|
|
272
|
+
C = w ?? t.fn();
|
|
273
|
+
} catch (j) {
|
|
274
|
+
C = Promise.reject(j);
|
|
275
|
+
}
|
|
276
|
+
Promise.resolve(C).then(m).catch((j) => {
|
|
277
|
+
var E;
|
|
278
|
+
if (r)
|
|
279
|
+
return;
|
|
280
|
+
const M = t.retry ?? (Qt ? 0 : 3), R = t.retryDelay ?? Zs, J = typeof R == "function" ? R(s, j) : R, et = M === !0 || typeof M == "number" && s < M || typeof M == "function" && M(s, j);
|
|
281
|
+
if (e || !et) {
|
|
282
|
+
S(j);
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
s++, (E = t.onFail) == null || E.call(t, s, j), Gs(J).then(() => u() ? void 0 : P()).then(() => {
|
|
286
|
+
e ? S(j) : k();
|
|
287
|
+
});
|
|
288
|
+
});
|
|
289
|
+
};
|
|
290
|
+
return {
|
|
291
|
+
promise: c,
|
|
292
|
+
cancel: v,
|
|
293
|
+
continue: () => (a == null || a(), c),
|
|
294
|
+
cancelRetry: g,
|
|
295
|
+
continueRetry: h,
|
|
296
|
+
canStart: d,
|
|
297
|
+
start: () => (d() ? k() : P().then(k), c)
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
function Ys() {
|
|
301
|
+
let t = [], e = 0, s = (d) => {
|
|
302
|
+
d();
|
|
303
|
+
}, r = (d) => {
|
|
304
|
+
d();
|
|
305
|
+
}, a = (d) => setTimeout(d, 0);
|
|
306
|
+
const l = (d) => {
|
|
307
|
+
a = d;
|
|
308
|
+
}, o = (d) => {
|
|
309
|
+
let m;
|
|
310
|
+
e++;
|
|
311
|
+
try {
|
|
312
|
+
m = d();
|
|
313
|
+
} finally {
|
|
314
|
+
e--, e || g();
|
|
315
|
+
}
|
|
316
|
+
return m;
|
|
317
|
+
}, c = (d) => {
|
|
318
|
+
e ? t.push(d) : a(() => {
|
|
319
|
+
s(d);
|
|
320
|
+
});
|
|
321
|
+
}, v = (d) => (...m) => {
|
|
322
|
+
c(() => {
|
|
323
|
+
d(...m);
|
|
324
|
+
});
|
|
325
|
+
}, g = () => {
|
|
326
|
+
const d = t;
|
|
327
|
+
t = [], d.length && a(() => {
|
|
328
|
+
r(() => {
|
|
329
|
+
d.forEach((m) => {
|
|
330
|
+
s(m);
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
};
|
|
335
|
+
return {
|
|
336
|
+
batch: o,
|
|
337
|
+
batchCalls: v,
|
|
338
|
+
schedule: c,
|
|
339
|
+
setNotifyFunction: (d) => {
|
|
340
|
+
s = d;
|
|
341
|
+
},
|
|
342
|
+
setBatchNotifyFunction: (d) => {
|
|
343
|
+
r = d;
|
|
344
|
+
},
|
|
345
|
+
setScheduler: l
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
var D = Ys(), mt, qe, ns = (qe = class {
|
|
349
|
+
constructor() {
|
|
350
|
+
y(this, mt);
|
|
351
|
+
}
|
|
352
|
+
destroy() {
|
|
353
|
+
this.clearGcTimeout();
|
|
354
|
+
}
|
|
355
|
+
scheduleGc() {
|
|
356
|
+
this.clearGcTimeout(), ne(this.gcTime) && p(this, mt, setTimeout(() => {
|
|
357
|
+
this.optionalRemove();
|
|
358
|
+
}, this.gcTime));
|
|
359
|
+
}
|
|
360
|
+
updateGcTime(t) {
|
|
361
|
+
this.gcTime = Math.max(
|
|
362
|
+
this.gcTime || 0,
|
|
363
|
+
t ?? (Qt ? 1 / 0 : 5 * 60 * 1e3)
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
clearGcTimeout() {
|
|
367
|
+
n(this, mt) && (clearTimeout(n(this, mt)), p(this, mt, void 0));
|
|
368
|
+
}
|
|
369
|
+
}, mt = new WeakMap(), qe), kt, Nt, V, T, qt, vt, Y, st, We, zs = (We = class extends ns {
|
|
370
|
+
constructor(e) {
|
|
371
|
+
super();
|
|
372
|
+
y(this, Y);
|
|
373
|
+
y(this, kt);
|
|
374
|
+
y(this, Nt);
|
|
375
|
+
y(this, V);
|
|
376
|
+
y(this, T);
|
|
377
|
+
y(this, qt);
|
|
378
|
+
y(this, vt);
|
|
379
|
+
p(this, vt, !1), p(this, qt, e.defaultOptions), this.setOptions(e.options), this.observers = [], p(this, V, e.cache), this.queryKey = e.queryKey, this.queryHash = e.queryHash, p(this, kt, e.state || Js(this.options)), this.state = n(this, kt), this.scheduleGc();
|
|
380
|
+
}
|
|
381
|
+
get meta() {
|
|
382
|
+
return this.options.meta;
|
|
383
|
+
}
|
|
384
|
+
get promise() {
|
|
385
|
+
var e;
|
|
386
|
+
return (e = n(this, T)) == null ? void 0 : e.promise;
|
|
387
|
+
}
|
|
388
|
+
setOptions(e) {
|
|
389
|
+
this.options = { ...n(this, qt), ...e }, this.updateGcTime(this.options.gcTime);
|
|
390
|
+
}
|
|
391
|
+
optionalRemove() {
|
|
392
|
+
!this.observers.length && this.state.fetchStatus === "idle" && n(this, V).remove(this);
|
|
393
|
+
}
|
|
394
|
+
setData(e, s) {
|
|
395
|
+
const r = oe(this.state.data, e, this.options);
|
|
396
|
+
return b(this, Y, st).call(this, {
|
|
397
|
+
data: r,
|
|
398
|
+
type: "success",
|
|
399
|
+
dataUpdatedAt: s == null ? void 0 : s.updatedAt,
|
|
400
|
+
manual: s == null ? void 0 : s.manual
|
|
401
|
+
}), r;
|
|
402
|
+
}
|
|
403
|
+
setState(e, s) {
|
|
404
|
+
b(this, Y, st).call(this, { type: "setState", state: e, setStateOptions: s });
|
|
405
|
+
}
|
|
406
|
+
cancel(e) {
|
|
407
|
+
var r, a;
|
|
408
|
+
const s = (r = n(this, T)) == null ? void 0 : r.promise;
|
|
409
|
+
return (a = n(this, T)) == null || a.cancel(e), s ? s.then($).catch($) : Promise.resolve();
|
|
410
|
+
}
|
|
411
|
+
destroy() {
|
|
412
|
+
super.destroy(), this.cancel({ silent: !0 });
|
|
413
|
+
}
|
|
414
|
+
reset() {
|
|
415
|
+
this.destroy(), this.setState(n(this, kt));
|
|
416
|
+
}
|
|
417
|
+
isActive() {
|
|
418
|
+
return this.observers.some(
|
|
419
|
+
(e) => z(e.options.enabled, this) !== !1
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
isDisabled() {
|
|
423
|
+
return this.getObserversCount() > 0 && !this.isActive();
|
|
424
|
+
}
|
|
425
|
+
isStale() {
|
|
426
|
+
return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
|
|
427
|
+
(e) => e.getCurrentResult().isStale
|
|
428
|
+
) : this.state.data === void 0;
|
|
429
|
+
}
|
|
430
|
+
isStaleByTime(e = 0) {
|
|
431
|
+
return this.state.isInvalidated || this.state.data === void 0 || !Ie(this.state.dataUpdatedAt, e);
|
|
432
|
+
}
|
|
433
|
+
onFocus() {
|
|
434
|
+
var s;
|
|
435
|
+
const e = this.observers.find((r) => r.shouldFetchOnWindowFocus());
|
|
436
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this, T)) == null || s.continue();
|
|
437
|
+
}
|
|
438
|
+
onOnline() {
|
|
439
|
+
var s;
|
|
440
|
+
const e = this.observers.find((r) => r.shouldFetchOnReconnect());
|
|
441
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this, T)) == null || s.continue();
|
|
442
|
+
}
|
|
443
|
+
addObserver(e) {
|
|
444
|
+
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), n(this, V).notify({ type: "observerAdded", query: this, observer: e }));
|
|
445
|
+
}
|
|
446
|
+
removeObserver(e) {
|
|
447
|
+
this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (n(this, T) && (n(this, vt) ? n(this, T).cancel({ revert: !0 }) : n(this, T).cancelRetry()), this.scheduleGc()), n(this, V).notify({ type: "observerRemoved", query: this, observer: e }));
|
|
448
|
+
}
|
|
449
|
+
getObserversCount() {
|
|
450
|
+
return this.observers.length;
|
|
451
|
+
}
|
|
452
|
+
invalidate() {
|
|
453
|
+
this.state.isInvalidated || b(this, Y, st).call(this, { type: "invalidate" });
|
|
454
|
+
}
|
|
455
|
+
fetch(e, s) {
|
|
456
|
+
var v, g, h;
|
|
457
|
+
if (this.state.fetchStatus !== "idle") {
|
|
458
|
+
if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
|
|
459
|
+
this.cancel({ silent: !0 });
|
|
460
|
+
else if (n(this, T))
|
|
461
|
+
return n(this, T).continueRetry(), n(this, T).promise;
|
|
462
|
+
}
|
|
463
|
+
if (e && this.setOptions(e), !this.options.queryFn) {
|
|
464
|
+
const u = this.observers.find((d) => d.options.queryFn);
|
|
465
|
+
u && this.setOptions(u.options);
|
|
466
|
+
}
|
|
467
|
+
const r = new AbortController(), a = (u) => {
|
|
468
|
+
Object.defineProperty(u, "signal", {
|
|
469
|
+
enumerable: !0,
|
|
470
|
+
get: () => (p(this, vt, !0), r.signal)
|
|
471
|
+
});
|
|
472
|
+
}, l = () => {
|
|
473
|
+
const u = es(this.options, s), d = {
|
|
474
|
+
queryKey: this.queryKey,
|
|
475
|
+
meta: this.meta
|
|
476
|
+
};
|
|
477
|
+
return a(d), p(this, vt, !1), this.options.persister ? this.options.persister(
|
|
478
|
+
u,
|
|
479
|
+
d,
|
|
480
|
+
this
|
|
481
|
+
) : u(d);
|
|
482
|
+
}, o = {
|
|
483
|
+
fetchOptions: s,
|
|
484
|
+
options: this.options,
|
|
485
|
+
queryKey: this.queryKey,
|
|
486
|
+
state: this.state,
|
|
487
|
+
fetchFn: l
|
|
488
|
+
};
|
|
489
|
+
a(o), (v = this.options.behavior) == null || v.onFetch(
|
|
490
|
+
o,
|
|
491
|
+
this
|
|
492
|
+
), p(this, Nt, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((g = o.fetchOptions) == null ? void 0 : g.meta)) && b(this, Y, st).call(this, { type: "fetch", meta: (h = o.fetchOptions) == null ? void 0 : h.meta });
|
|
493
|
+
const c = (u) => {
|
|
494
|
+
var d, m, S, P;
|
|
495
|
+
ie(u) && u.silent || b(this, Y, st).call(this, {
|
|
496
|
+
type: "error",
|
|
497
|
+
error: u
|
|
498
|
+
}), ie(u) || ((m = (d = n(this, V).config).onError) == null || m.call(
|
|
499
|
+
d,
|
|
500
|
+
u,
|
|
501
|
+
this
|
|
502
|
+
), (P = (S = n(this, V).config).onSettled) == null || P.call(
|
|
503
|
+
S,
|
|
504
|
+
this.state.data,
|
|
505
|
+
u,
|
|
506
|
+
this
|
|
507
|
+
)), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
508
|
+
};
|
|
509
|
+
return p(this, T, is({
|
|
510
|
+
initialPromise: s == null ? void 0 : s.initialPromise,
|
|
511
|
+
fn: o.fetchFn,
|
|
512
|
+
abort: r.abort.bind(r),
|
|
513
|
+
onSuccess: (u) => {
|
|
514
|
+
var d, m, S, P;
|
|
515
|
+
if (u === void 0) {
|
|
516
|
+
c(new Error(`${this.queryHash} data is undefined`));
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
this.setData(u), (m = (d = n(this, V).config).onSuccess) == null || m.call(d, u, this), (P = (S = n(this, V).config).onSettled) == null || P.call(
|
|
520
|
+
S,
|
|
521
|
+
u,
|
|
522
|
+
this.state.error,
|
|
523
|
+
this
|
|
524
|
+
), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
525
|
+
},
|
|
526
|
+
onError: c,
|
|
527
|
+
onFail: (u, d) => {
|
|
528
|
+
b(this, Y, st).call(this, { type: "failed", failureCount: u, error: d });
|
|
529
|
+
},
|
|
530
|
+
onPause: () => {
|
|
531
|
+
b(this, Y, st).call(this, { type: "pause" });
|
|
532
|
+
},
|
|
533
|
+
onContinue: () => {
|
|
534
|
+
b(this, Y, st).call(this, { type: "continue" });
|
|
535
|
+
},
|
|
536
|
+
retry: o.options.retry,
|
|
537
|
+
retryDelay: o.options.retryDelay,
|
|
538
|
+
networkMode: o.options.networkMode,
|
|
539
|
+
canRun: () => !0
|
|
540
|
+
})), n(this, T).start();
|
|
541
|
+
}
|
|
542
|
+
}, kt = new WeakMap(), Nt = new WeakMap(), V = new WeakMap(), T = new WeakMap(), qt = new WeakMap(), vt = new WeakMap(), Y = new WeakSet(), st = function(e) {
|
|
543
|
+
const s = (r) => {
|
|
544
|
+
switch (e.type) {
|
|
545
|
+
case "failed":
|
|
546
|
+
return {
|
|
547
|
+
...r,
|
|
548
|
+
fetchFailureCount: e.failureCount,
|
|
549
|
+
fetchFailureReason: e.error
|
|
550
|
+
};
|
|
551
|
+
case "pause":
|
|
552
|
+
return {
|
|
553
|
+
...r,
|
|
554
|
+
fetchStatus: "paused"
|
|
555
|
+
};
|
|
556
|
+
case "continue":
|
|
557
|
+
return {
|
|
558
|
+
...r,
|
|
559
|
+
fetchStatus: "fetching"
|
|
560
|
+
};
|
|
561
|
+
case "fetch":
|
|
562
|
+
return {
|
|
563
|
+
...r,
|
|
564
|
+
...as(r.data, this.options),
|
|
565
|
+
fetchMeta: e.meta ?? null
|
|
566
|
+
};
|
|
567
|
+
case "success":
|
|
568
|
+
return {
|
|
569
|
+
...r,
|
|
570
|
+
data: e.data,
|
|
571
|
+
dataUpdateCount: r.dataUpdateCount + 1,
|
|
572
|
+
dataUpdatedAt: e.dataUpdatedAt ?? Date.now(),
|
|
573
|
+
error: null,
|
|
574
|
+
isInvalidated: !1,
|
|
575
|
+
status: "success",
|
|
576
|
+
...!e.manual && {
|
|
577
|
+
fetchStatus: "idle",
|
|
578
|
+
fetchFailureCount: 0,
|
|
579
|
+
fetchFailureReason: null
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
case "error":
|
|
583
|
+
const a = e.error;
|
|
584
|
+
return ie(a) && a.revert && n(this, Nt) ? { ...n(this, Nt), fetchStatus: "idle" } : {
|
|
585
|
+
...r,
|
|
586
|
+
error: a,
|
|
587
|
+
errorUpdateCount: r.errorUpdateCount + 1,
|
|
588
|
+
errorUpdatedAt: Date.now(),
|
|
589
|
+
fetchFailureCount: r.fetchFailureCount + 1,
|
|
590
|
+
fetchFailureReason: a,
|
|
591
|
+
fetchStatus: "idle",
|
|
592
|
+
status: "error"
|
|
593
|
+
};
|
|
594
|
+
case "invalidate":
|
|
595
|
+
return {
|
|
596
|
+
...r,
|
|
597
|
+
isInvalidated: !0
|
|
598
|
+
};
|
|
599
|
+
case "setState":
|
|
600
|
+
return {
|
|
601
|
+
...r,
|
|
602
|
+
...e.state
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
};
|
|
606
|
+
this.state = s(this.state), D.batch(() => {
|
|
607
|
+
this.observers.forEach((r) => {
|
|
608
|
+
r.onQueryUpdate();
|
|
609
|
+
}), n(this, V).notify({ query: this, type: "updated", action: e });
|
|
610
|
+
});
|
|
611
|
+
}, We);
|
|
612
|
+
function as(t, e) {
|
|
613
|
+
return {
|
|
614
|
+
fetchFailureCount: 0,
|
|
615
|
+
fetchFailureReason: null,
|
|
616
|
+
fetchStatus: ss(e.networkMode) ? "fetching" : "paused",
|
|
617
|
+
...t === void 0 && {
|
|
618
|
+
error: null,
|
|
619
|
+
status: "pending"
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
function Js(t) {
|
|
624
|
+
const e = typeof t.initialData == "function" ? t.initialData() : t.initialData, s = e !== void 0, r = s ? typeof t.initialDataUpdatedAt == "function" ? t.initialDataUpdatedAt() : t.initialDataUpdatedAt : 0;
|
|
625
|
+
return {
|
|
626
|
+
data: e,
|
|
627
|
+
dataUpdateCount: 0,
|
|
628
|
+
dataUpdatedAt: s ? r ?? Date.now() : 0,
|
|
629
|
+
error: null,
|
|
630
|
+
errorUpdateCount: 0,
|
|
631
|
+
errorUpdatedAt: 0,
|
|
632
|
+
fetchFailureCount: 0,
|
|
633
|
+
fetchFailureReason: null,
|
|
634
|
+
fetchMeta: null,
|
|
635
|
+
isInvalidated: !1,
|
|
636
|
+
status: s ? "success" : "pending",
|
|
637
|
+
fetchStatus: "idle"
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
var X, Ve, Xs = (Ve = class extends Ht {
|
|
641
|
+
constructor(e = {}) {
|
|
642
|
+
super();
|
|
643
|
+
y(this, X);
|
|
644
|
+
this.config = e, p(this, X, /* @__PURE__ */ new Map());
|
|
645
|
+
}
|
|
646
|
+
build(e, s, r) {
|
|
647
|
+
const a = s.queryKey, l = s.queryHash ?? xe(a, s);
|
|
648
|
+
let o = this.get(l);
|
|
649
|
+
return o || (o = new zs({
|
|
650
|
+
cache: this,
|
|
651
|
+
queryKey: a,
|
|
652
|
+
queryHash: l,
|
|
653
|
+
options: e.defaultQueryOptions(s),
|
|
654
|
+
state: r,
|
|
655
|
+
defaultOptions: e.getQueryDefaults(a)
|
|
656
|
+
}), this.add(o)), o;
|
|
657
|
+
}
|
|
658
|
+
add(e) {
|
|
659
|
+
n(this, X).has(e.queryHash) || (n(this, X).set(e.queryHash, e), this.notify({
|
|
660
|
+
type: "added",
|
|
661
|
+
query: e
|
|
662
|
+
}));
|
|
663
|
+
}
|
|
664
|
+
remove(e) {
|
|
665
|
+
const s = n(this, X).get(e.queryHash);
|
|
666
|
+
s && (e.destroy(), s === e && n(this, X).delete(e.queryHash), this.notify({ type: "removed", query: e }));
|
|
667
|
+
}
|
|
668
|
+
clear() {
|
|
669
|
+
D.batch(() => {
|
|
670
|
+
this.getAll().forEach((e) => {
|
|
671
|
+
this.remove(e);
|
|
672
|
+
});
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
get(e) {
|
|
676
|
+
return n(this, X).get(e);
|
|
677
|
+
}
|
|
678
|
+
getAll() {
|
|
679
|
+
return [...n(this, X).values()];
|
|
680
|
+
}
|
|
681
|
+
find(e) {
|
|
682
|
+
const s = { exact: !0, ...e };
|
|
683
|
+
return this.getAll().find(
|
|
684
|
+
(r) => Ae(s, r)
|
|
685
|
+
);
|
|
686
|
+
}
|
|
687
|
+
findAll(e = {}) {
|
|
688
|
+
const s = this.getAll();
|
|
689
|
+
return Object.keys(e).length > 0 ? s.filter((r) => Ae(e, r)) : s;
|
|
690
|
+
}
|
|
691
|
+
notify(e) {
|
|
692
|
+
D.batch(() => {
|
|
693
|
+
this.listeners.forEach((s) => {
|
|
694
|
+
s(e);
|
|
695
|
+
});
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
onFocus() {
|
|
699
|
+
D.batch(() => {
|
|
700
|
+
this.getAll().forEach((e) => {
|
|
701
|
+
e.onFocus();
|
|
702
|
+
});
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
onOnline() {
|
|
706
|
+
D.batch(() => {
|
|
707
|
+
this.getAll().forEach((e) => {
|
|
708
|
+
e.onOnline();
|
|
709
|
+
});
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
}, X = new WeakMap(), Ve), I, U, gt, B, nt, $e, Is = ($e = class extends ns {
|
|
713
|
+
constructor(e) {
|
|
714
|
+
super();
|
|
715
|
+
y(this, B);
|
|
716
|
+
y(this, I);
|
|
717
|
+
y(this, U);
|
|
718
|
+
y(this, gt);
|
|
719
|
+
this.mutationId = e.mutationId, p(this, U, e.mutationCache), p(this, I, []), this.state = e.state || os(), this.setOptions(e.options), this.scheduleGc();
|
|
720
|
+
}
|
|
721
|
+
setOptions(e) {
|
|
722
|
+
this.options = e, this.updateGcTime(this.options.gcTime);
|
|
723
|
+
}
|
|
724
|
+
get meta() {
|
|
725
|
+
return this.options.meta;
|
|
726
|
+
}
|
|
727
|
+
addObserver(e) {
|
|
728
|
+
n(this, I).includes(e) || (n(this, I).push(e), this.clearGcTimeout(), n(this, U).notify({
|
|
729
|
+
type: "observerAdded",
|
|
730
|
+
mutation: this,
|
|
731
|
+
observer: e
|
|
732
|
+
}));
|
|
733
|
+
}
|
|
734
|
+
removeObserver(e) {
|
|
735
|
+
p(this, I, n(this, I).filter((s) => s !== e)), this.scheduleGc(), n(this, U).notify({
|
|
736
|
+
type: "observerRemoved",
|
|
737
|
+
mutation: this,
|
|
738
|
+
observer: e
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
optionalRemove() {
|
|
742
|
+
n(this, I).length || (this.state.status === "pending" ? this.scheduleGc() : n(this, U).remove(this));
|
|
743
|
+
}
|
|
744
|
+
continue() {
|
|
745
|
+
var e;
|
|
746
|
+
return ((e = n(this, gt)) == null ? void 0 : e.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
|
|
747
|
+
this.execute(this.state.variables);
|
|
748
|
+
}
|
|
749
|
+
async execute(e) {
|
|
750
|
+
var a, l, o, c, v, g, h, u, d, m, S, P, k, C, w, j, M, R, J, et;
|
|
751
|
+
p(this, gt, is({
|
|
752
|
+
fn: () => this.options.mutationFn ? this.options.mutationFn(e) : Promise.reject(new Error("No mutationFn found")),
|
|
753
|
+
onFail: (E, Z) => {
|
|
754
|
+
b(this, B, nt).call(this, { type: "failed", failureCount: E, error: Z });
|
|
755
|
+
},
|
|
756
|
+
onPause: () => {
|
|
757
|
+
b(this, B, nt).call(this, { type: "pause" });
|
|
758
|
+
},
|
|
759
|
+
onContinue: () => {
|
|
760
|
+
b(this, B, nt).call(this, { type: "continue" });
|
|
761
|
+
},
|
|
762
|
+
retry: this.options.retry ?? 0,
|
|
763
|
+
retryDelay: this.options.retryDelay,
|
|
764
|
+
networkMode: this.options.networkMode,
|
|
765
|
+
canRun: () => n(this, U).canRun(this)
|
|
766
|
+
}));
|
|
767
|
+
const s = this.state.status === "pending", r = !n(this, gt).canStart();
|
|
768
|
+
try {
|
|
769
|
+
if (!s) {
|
|
770
|
+
b(this, B, nt).call(this, { type: "pending", variables: e, isPaused: r }), await ((l = (a = n(this, U).config).onMutate) == null ? void 0 : l.call(
|
|
771
|
+
a,
|
|
772
|
+
e,
|
|
773
|
+
this
|
|
774
|
+
));
|
|
775
|
+
const Z = await ((c = (o = this.options).onMutate) == null ? void 0 : c.call(o, e));
|
|
776
|
+
Z !== this.state.context && b(this, B, nt).call(this, {
|
|
777
|
+
type: "pending",
|
|
778
|
+
context: Z,
|
|
779
|
+
variables: e,
|
|
780
|
+
isPaused: r
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
const E = await n(this, gt).start();
|
|
784
|
+
return await ((g = (v = n(this, U).config).onSuccess) == null ? void 0 : g.call(
|
|
785
|
+
v,
|
|
786
|
+
E,
|
|
787
|
+
e,
|
|
788
|
+
this.state.context,
|
|
789
|
+
this
|
|
790
|
+
)), await ((u = (h = this.options).onSuccess) == null ? void 0 : u.call(h, E, e, this.state.context)), await ((m = (d = n(this, U).config).onSettled) == null ? void 0 : m.call(
|
|
791
|
+
d,
|
|
792
|
+
E,
|
|
793
|
+
null,
|
|
794
|
+
this.state.variables,
|
|
795
|
+
this.state.context,
|
|
796
|
+
this
|
|
797
|
+
)), await ((P = (S = this.options).onSettled) == null ? void 0 : P.call(S, E, null, e, this.state.context)), b(this, B, nt).call(this, { type: "success", data: E }), E;
|
|
798
|
+
} catch (E) {
|
|
799
|
+
try {
|
|
800
|
+
throw await ((C = (k = n(this, U).config).onError) == null ? void 0 : C.call(
|
|
801
|
+
k,
|
|
802
|
+
E,
|
|
803
|
+
e,
|
|
804
|
+
this.state.context,
|
|
805
|
+
this
|
|
806
|
+
)), await ((j = (w = this.options).onError) == null ? void 0 : j.call(
|
|
807
|
+
w,
|
|
808
|
+
E,
|
|
809
|
+
e,
|
|
810
|
+
this.state.context
|
|
811
|
+
)), await ((R = (M = n(this, U).config).onSettled) == null ? void 0 : R.call(
|
|
812
|
+
M,
|
|
813
|
+
void 0,
|
|
814
|
+
E,
|
|
815
|
+
this.state.variables,
|
|
816
|
+
this.state.context,
|
|
817
|
+
this
|
|
818
|
+
)), await ((et = (J = this.options).onSettled) == null ? void 0 : et.call(
|
|
819
|
+
J,
|
|
820
|
+
void 0,
|
|
821
|
+
E,
|
|
822
|
+
e,
|
|
823
|
+
this.state.context
|
|
824
|
+
)), E;
|
|
825
|
+
} finally {
|
|
826
|
+
b(this, B, nt).call(this, { type: "error", error: E });
|
|
827
|
+
}
|
|
828
|
+
} finally {
|
|
829
|
+
n(this, U).runNext(this);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}, I = new WeakMap(), U = new WeakMap(), gt = new WeakMap(), B = new WeakSet(), nt = function(e) {
|
|
833
|
+
const s = (r) => {
|
|
834
|
+
switch (e.type) {
|
|
835
|
+
case "failed":
|
|
836
|
+
return {
|
|
837
|
+
...r,
|
|
838
|
+
failureCount: e.failureCount,
|
|
839
|
+
failureReason: e.error
|
|
840
|
+
};
|
|
841
|
+
case "pause":
|
|
842
|
+
return {
|
|
843
|
+
...r,
|
|
844
|
+
isPaused: !0
|
|
845
|
+
};
|
|
846
|
+
case "continue":
|
|
847
|
+
return {
|
|
848
|
+
...r,
|
|
849
|
+
isPaused: !1
|
|
850
|
+
};
|
|
851
|
+
case "pending":
|
|
852
|
+
return {
|
|
853
|
+
...r,
|
|
854
|
+
context: e.context,
|
|
855
|
+
data: void 0,
|
|
856
|
+
failureCount: 0,
|
|
857
|
+
failureReason: null,
|
|
858
|
+
error: null,
|
|
859
|
+
isPaused: e.isPaused,
|
|
860
|
+
status: "pending",
|
|
861
|
+
variables: e.variables,
|
|
862
|
+
submittedAt: Date.now()
|
|
863
|
+
};
|
|
864
|
+
case "success":
|
|
865
|
+
return {
|
|
866
|
+
...r,
|
|
867
|
+
data: e.data,
|
|
868
|
+
failureCount: 0,
|
|
869
|
+
failureReason: null,
|
|
870
|
+
error: null,
|
|
871
|
+
status: "success",
|
|
872
|
+
isPaused: !1
|
|
873
|
+
};
|
|
874
|
+
case "error":
|
|
875
|
+
return {
|
|
876
|
+
...r,
|
|
877
|
+
data: void 0,
|
|
878
|
+
error: e.error,
|
|
879
|
+
failureCount: r.failureCount + 1,
|
|
880
|
+
failureReason: e.error,
|
|
881
|
+
isPaused: !1,
|
|
882
|
+
status: "error"
|
|
883
|
+
};
|
|
884
|
+
}
|
|
885
|
+
};
|
|
886
|
+
this.state = s(this.state), D.batch(() => {
|
|
887
|
+
n(this, I).forEach((r) => {
|
|
888
|
+
r.onMutationUpdate(e);
|
|
889
|
+
}), n(this, U).notify({
|
|
890
|
+
mutation: this,
|
|
891
|
+
type: "updated",
|
|
892
|
+
action: e
|
|
893
|
+
});
|
|
894
|
+
});
|
|
895
|
+
}, $e);
|
|
896
|
+
function os() {
|
|
897
|
+
return {
|
|
898
|
+
context: void 0,
|
|
899
|
+
data: void 0,
|
|
900
|
+
error: null,
|
|
901
|
+
failureCount: 0,
|
|
902
|
+
failureReason: null,
|
|
903
|
+
isPaused: !1,
|
|
904
|
+
status: "idle",
|
|
905
|
+
variables: void 0,
|
|
906
|
+
submittedAt: 0
|
|
907
|
+
};
|
|
908
|
+
}
|
|
909
|
+
var q, Wt, Ze, Bs = (Ze = class extends Ht {
|
|
910
|
+
constructor(e = {}) {
|
|
911
|
+
super();
|
|
912
|
+
y(this, q);
|
|
913
|
+
y(this, Wt);
|
|
914
|
+
this.config = e, p(this, q, /* @__PURE__ */ new Map()), p(this, Wt, Date.now());
|
|
915
|
+
}
|
|
916
|
+
build(e, s, r) {
|
|
917
|
+
const a = new Is({
|
|
918
|
+
mutationCache: this,
|
|
919
|
+
mutationId: ++zt(this, Wt)._,
|
|
920
|
+
options: e.defaultMutationOptions(s),
|
|
921
|
+
state: r
|
|
922
|
+
});
|
|
923
|
+
return this.add(a), a;
|
|
924
|
+
}
|
|
925
|
+
add(e) {
|
|
926
|
+
const s = Jt(e), r = n(this, q).get(s) ?? [];
|
|
927
|
+
r.push(e), n(this, q).set(s, r), this.notify({ type: "added", mutation: e });
|
|
928
|
+
}
|
|
929
|
+
remove(e) {
|
|
930
|
+
var r;
|
|
931
|
+
const s = Jt(e);
|
|
932
|
+
if (n(this, q).has(s)) {
|
|
933
|
+
const a = (r = n(this, q).get(s)) == null ? void 0 : r.filter((l) => l !== e);
|
|
934
|
+
a && (a.length === 0 ? n(this, q).delete(s) : n(this, q).set(s, a));
|
|
935
|
+
}
|
|
936
|
+
this.notify({ type: "removed", mutation: e });
|
|
937
|
+
}
|
|
938
|
+
canRun(e) {
|
|
939
|
+
var r;
|
|
940
|
+
const s = (r = n(this, q).get(Jt(e))) == null ? void 0 : r.find((a) => a.state.status === "pending");
|
|
941
|
+
return !s || s === e;
|
|
942
|
+
}
|
|
943
|
+
runNext(e) {
|
|
944
|
+
var r;
|
|
945
|
+
const s = (r = n(this, q).get(Jt(e))) == null ? void 0 : r.find((a) => a !== e && a.state.isPaused);
|
|
946
|
+
return (s == null ? void 0 : s.continue()) ?? Promise.resolve();
|
|
947
|
+
}
|
|
948
|
+
clear() {
|
|
949
|
+
D.batch(() => {
|
|
950
|
+
this.getAll().forEach((e) => {
|
|
951
|
+
this.remove(e);
|
|
952
|
+
});
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
getAll() {
|
|
956
|
+
return [...n(this, q).values()].flat();
|
|
957
|
+
}
|
|
958
|
+
find(e) {
|
|
959
|
+
const s = { exact: !0, ...e };
|
|
960
|
+
return this.getAll().find(
|
|
961
|
+
(r) => ke(s, r)
|
|
962
|
+
);
|
|
963
|
+
}
|
|
964
|
+
findAll(e = {}) {
|
|
965
|
+
return this.getAll().filter((s) => ke(e, s));
|
|
966
|
+
}
|
|
967
|
+
notify(e) {
|
|
968
|
+
D.batch(() => {
|
|
969
|
+
this.listeners.forEach((s) => {
|
|
970
|
+
s(e);
|
|
971
|
+
});
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
resumePausedMutations() {
|
|
975
|
+
const e = this.getAll().filter((s) => s.state.isPaused);
|
|
976
|
+
return D.batch(
|
|
977
|
+
() => Promise.all(
|
|
978
|
+
e.map((s) => s.continue().catch($))
|
|
979
|
+
)
|
|
980
|
+
);
|
|
981
|
+
}
|
|
982
|
+
}, q = new WeakMap(), Wt = new WeakMap(), Ze);
|
|
983
|
+
function Jt(t) {
|
|
984
|
+
var e;
|
|
985
|
+
return ((e = t.options.scope) == null ? void 0 : e.id) ?? String(t.mutationId);
|
|
986
|
+
}
|
|
987
|
+
function tr(t) {
|
|
988
|
+
return {
|
|
989
|
+
onFetch: (e, s) => {
|
|
990
|
+
const r = async () => {
|
|
991
|
+
var S, P, k, C, w;
|
|
992
|
+
const a = e.options, l = (k = (P = (S = e.fetchOptions) == null ? void 0 : S.meta) == null ? void 0 : P.fetchMore) == null ? void 0 : k.direction, o = ((C = e.state.data) == null ? void 0 : C.pages) || [], c = ((w = e.state.data) == null ? void 0 : w.pageParams) || [], v = { pages: [], pageParams: [] };
|
|
993
|
+
let g = !1;
|
|
994
|
+
const h = (j) => {
|
|
995
|
+
Object.defineProperty(j, "signal", {
|
|
996
|
+
enumerable: !0,
|
|
997
|
+
get: () => (e.signal.aborted ? g = !0 : e.signal.addEventListener("abort", () => {
|
|
998
|
+
g = !0;
|
|
999
|
+
}), e.signal)
|
|
1000
|
+
});
|
|
1001
|
+
}, u = es(e.options, e.fetchOptions), d = async (j, M, R) => {
|
|
1002
|
+
if (g)
|
|
1003
|
+
return Promise.reject();
|
|
1004
|
+
if (M == null && j.pages.length)
|
|
1005
|
+
return Promise.resolve(j);
|
|
1006
|
+
const J = {
|
|
1007
|
+
queryKey: e.queryKey,
|
|
1008
|
+
pageParam: M,
|
|
1009
|
+
direction: R ? "backward" : "forward",
|
|
1010
|
+
meta: e.options.meta
|
|
1011
|
+
};
|
|
1012
|
+
h(J);
|
|
1013
|
+
const et = await u(
|
|
1014
|
+
J
|
|
1015
|
+
), { maxPages: E } = e.options, Z = R ? Ws : qs;
|
|
1016
|
+
return {
|
|
1017
|
+
pages: Z(j.pages, et, E),
|
|
1018
|
+
pageParams: Z(j.pageParams, M, E)
|
|
1019
|
+
};
|
|
1020
|
+
};
|
|
1021
|
+
let m;
|
|
1022
|
+
if (l && o.length) {
|
|
1023
|
+
const j = l === "backward", M = j ? er : Oe, R = {
|
|
1024
|
+
pages: o,
|
|
1025
|
+
pageParams: c
|
|
1026
|
+
}, J = M(a, R);
|
|
1027
|
+
m = await d(R, J, j);
|
|
1028
|
+
} else {
|
|
1029
|
+
m = await d(
|
|
1030
|
+
v,
|
|
1031
|
+
c[0] ?? a.initialPageParam
|
|
1032
|
+
);
|
|
1033
|
+
const j = t ?? o.length;
|
|
1034
|
+
for (let M = 1; M < j; M++) {
|
|
1035
|
+
const R = Oe(a, m);
|
|
1036
|
+
m = await d(m, R);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
return m;
|
|
1040
|
+
};
|
|
1041
|
+
e.options.persister ? e.fetchFn = () => {
|
|
1042
|
+
var a, l;
|
|
1043
|
+
return (l = (a = e.options).persister) == null ? void 0 : l.call(
|
|
1044
|
+
a,
|
|
1045
|
+
r,
|
|
1046
|
+
{
|
|
1047
|
+
queryKey: e.queryKey,
|
|
1048
|
+
meta: e.options.meta,
|
|
1049
|
+
signal: e.signal
|
|
1050
|
+
},
|
|
1051
|
+
s
|
|
1052
|
+
);
|
|
1053
|
+
} : e.fetchFn = r;
|
|
1054
|
+
}
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
function Oe(t, { pages: e, pageParams: s }) {
|
|
1058
|
+
const r = e.length - 1;
|
|
1059
|
+
return t.getNextPageParam(
|
|
1060
|
+
e[r],
|
|
1061
|
+
e,
|
|
1062
|
+
s[r],
|
|
1063
|
+
s
|
|
1064
|
+
);
|
|
1065
|
+
}
|
|
1066
|
+
function er(t, { pages: e, pageParams: s }) {
|
|
1067
|
+
var r;
|
|
1068
|
+
return (r = t.getPreviousPageParam) == null ? void 0 : r.call(
|
|
1069
|
+
t,
|
|
1070
|
+
e[0],
|
|
1071
|
+
e,
|
|
1072
|
+
s[0],
|
|
1073
|
+
s
|
|
1074
|
+
);
|
|
1075
|
+
}
|
|
1076
|
+
var L, lt, ct, Mt, Ot, ut, Rt, Lt, Ye, ls = (Ye = class {
|
|
1077
|
+
constructor(t = {}) {
|
|
1078
|
+
y(this, L);
|
|
1079
|
+
y(this, lt);
|
|
1080
|
+
y(this, ct);
|
|
1081
|
+
y(this, Mt);
|
|
1082
|
+
y(this, Ot);
|
|
1083
|
+
y(this, ut);
|
|
1084
|
+
y(this, Rt);
|
|
1085
|
+
y(this, Lt);
|
|
1086
|
+
p(this, L, t.queryCache || new Xs()), p(this, lt, t.mutationCache || new Bs()), p(this, ct, t.defaultOptions || {}), p(this, Mt, /* @__PURE__ */ new Map()), p(this, Ot, /* @__PURE__ */ new Map()), p(this, ut, 0);
|
|
1087
|
+
}
|
|
1088
|
+
mount() {
|
|
1089
|
+
zt(this, ut)._++, n(this, ut) === 1 && (p(this, Rt, be.subscribe(async (t) => {
|
|
1090
|
+
t && (await this.resumePausedMutations(), n(this, L).onFocus());
|
|
1091
|
+
})), p(this, Lt, Bt.subscribe(async (t) => {
|
|
1092
|
+
t && (await this.resumePausedMutations(), n(this, L).onOnline());
|
|
1093
|
+
})));
|
|
1094
|
+
}
|
|
1095
|
+
unmount() {
|
|
1096
|
+
var t, e;
|
|
1097
|
+
zt(this, ut)._--, n(this, ut) === 0 && ((t = n(this, Rt)) == null || t.call(this), p(this, Rt, void 0), (e = n(this, Lt)) == null || e.call(this), p(this, Lt, void 0));
|
|
1098
|
+
}
|
|
1099
|
+
isFetching(t) {
|
|
1100
|
+
return n(this, L).findAll({ ...t, fetchStatus: "fetching" }).length;
|
|
1101
|
+
}
|
|
1102
|
+
isMutating(t) {
|
|
1103
|
+
return n(this, lt).findAll({ ...t, status: "pending" }).length;
|
|
1104
|
+
}
|
|
1105
|
+
getQueryData(t) {
|
|
1106
|
+
var s;
|
|
1107
|
+
const e = this.defaultQueryOptions({ queryKey: t });
|
|
1108
|
+
return (s = n(this, L).get(e.queryHash)) == null ? void 0 : s.state.data;
|
|
1109
|
+
}
|
|
1110
|
+
ensureQueryData(t) {
|
|
1111
|
+
const e = this.getQueryData(t.queryKey);
|
|
1112
|
+
if (e === void 0)
|
|
1113
|
+
return this.fetchQuery(t);
|
|
1114
|
+
{
|
|
1115
|
+
const s = this.defaultQueryOptions(t), r = n(this, L).build(this, s);
|
|
1116
|
+
return t.revalidateIfStale && r.isStaleByTime(St(s.staleTime, r)) && this.prefetchQuery(s), Promise.resolve(e);
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
getQueriesData(t) {
|
|
1120
|
+
return n(this, L).findAll(t).map(({ queryKey: e, state: s }) => {
|
|
1121
|
+
const r = s.data;
|
|
1122
|
+
return [e, r];
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
setQueryData(t, e, s) {
|
|
1126
|
+
const r = this.defaultQueryOptions({ queryKey: t }), a = n(this, L).get(
|
|
1127
|
+
r.queryHash
|
|
1128
|
+
), l = a == null ? void 0 : a.state.data, o = Ks(e, l);
|
|
1129
|
+
if (o !== void 0)
|
|
1130
|
+
return n(this, L).build(this, r).setData(o, { ...s, manual: !0 });
|
|
1131
|
+
}
|
|
1132
|
+
setQueriesData(t, e, s) {
|
|
1133
|
+
return D.batch(
|
|
1134
|
+
() => n(this, L).findAll(t).map(({ queryKey: r }) => [
|
|
1135
|
+
r,
|
|
1136
|
+
this.setQueryData(r, e, s)
|
|
1137
|
+
])
|
|
1138
|
+
);
|
|
1139
|
+
}
|
|
1140
|
+
getQueryState(t) {
|
|
1141
|
+
var s;
|
|
1142
|
+
const e = this.defaultQueryOptions({ queryKey: t });
|
|
1143
|
+
return (s = n(this, L).get(e.queryHash)) == null ? void 0 : s.state;
|
|
1144
|
+
}
|
|
1145
|
+
removeQueries(t) {
|
|
1146
|
+
const e = n(this, L);
|
|
1147
|
+
D.batch(() => {
|
|
1148
|
+
e.findAll(t).forEach((s) => {
|
|
1149
|
+
e.remove(s);
|
|
1150
|
+
});
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
resetQueries(t, e) {
|
|
1154
|
+
const s = n(this, L), r = {
|
|
1155
|
+
type: "active",
|
|
1156
|
+
...t
|
|
1157
|
+
};
|
|
1158
|
+
return D.batch(() => (s.findAll(t).forEach((a) => {
|
|
1159
|
+
a.reset();
|
|
1160
|
+
}), this.refetchQueries(r, e)));
|
|
1161
|
+
}
|
|
1162
|
+
cancelQueries(t = {}, e = {}) {
|
|
1163
|
+
const s = { revert: !0, ...e }, r = D.batch(
|
|
1164
|
+
() => n(this, L).findAll(t).map((a) => a.cancel(s))
|
|
1165
|
+
);
|
|
1166
|
+
return Promise.all(r).then($).catch($);
|
|
1167
|
+
}
|
|
1168
|
+
invalidateQueries(t = {}, e = {}) {
|
|
1169
|
+
return D.batch(() => {
|
|
1170
|
+
if (n(this, L).findAll(t).forEach((r) => {
|
|
1171
|
+
r.invalidate();
|
|
1172
|
+
}), t.refetchType === "none")
|
|
1173
|
+
return Promise.resolve();
|
|
1174
|
+
const s = {
|
|
1175
|
+
...t,
|
|
1176
|
+
type: t.refetchType ?? t.type ?? "active"
|
|
1177
|
+
};
|
|
1178
|
+
return this.refetchQueries(s, e);
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
refetchQueries(t = {}, e) {
|
|
1182
|
+
const s = {
|
|
1183
|
+
...e,
|
|
1184
|
+
cancelRefetch: (e == null ? void 0 : e.cancelRefetch) ?? !0
|
|
1185
|
+
}, r = D.batch(
|
|
1186
|
+
() => n(this, L).findAll(t).filter((a) => !a.isDisabled()).map((a) => {
|
|
1187
|
+
let l = a.fetch(void 0, s);
|
|
1188
|
+
return s.throwOnError || (l = l.catch($)), a.state.fetchStatus === "paused" ? Promise.resolve() : l;
|
|
1189
|
+
})
|
|
1190
|
+
);
|
|
1191
|
+
return Promise.all(r).then($);
|
|
1192
|
+
}
|
|
1193
|
+
fetchQuery(t) {
|
|
1194
|
+
const e = this.defaultQueryOptions(t);
|
|
1195
|
+
e.retry === void 0 && (e.retry = !1);
|
|
1196
|
+
const s = n(this, L).build(this, e);
|
|
1197
|
+
return s.isStaleByTime(
|
|
1198
|
+
St(e.staleTime, s)
|
|
1199
|
+
) ? s.fetch(e) : Promise.resolve(s.state.data);
|
|
1200
|
+
}
|
|
1201
|
+
prefetchQuery(t) {
|
|
1202
|
+
return this.fetchQuery(t).then($).catch($);
|
|
1203
|
+
}
|
|
1204
|
+
fetchInfiniteQuery(t) {
|
|
1205
|
+
return t.behavior = tr(t.pages), this.fetchQuery(t);
|
|
1206
|
+
}
|
|
1207
|
+
prefetchInfiniteQuery(t) {
|
|
1208
|
+
return this.fetchInfiniteQuery(t).then($).catch($);
|
|
1209
|
+
}
|
|
1210
|
+
resumePausedMutations() {
|
|
1211
|
+
return Bt.isOnline() ? n(this, lt).resumePausedMutations() : Promise.resolve();
|
|
1212
|
+
}
|
|
1213
|
+
getQueryCache() {
|
|
1214
|
+
return n(this, L);
|
|
1215
|
+
}
|
|
1216
|
+
getMutationCache() {
|
|
1217
|
+
return n(this, lt);
|
|
1218
|
+
}
|
|
1219
|
+
getDefaultOptions() {
|
|
1220
|
+
return n(this, ct);
|
|
1221
|
+
}
|
|
1222
|
+
setDefaultOptions(t) {
|
|
1223
|
+
p(this, ct, t);
|
|
1224
|
+
}
|
|
1225
|
+
setQueryDefaults(t, e) {
|
|
1226
|
+
n(this, Mt).set(bt(t), {
|
|
1227
|
+
queryKey: t,
|
|
1228
|
+
defaultOptions: e
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
getQueryDefaults(t) {
|
|
1232
|
+
const e = [...n(this, Mt).values()];
|
|
1233
|
+
let s = {};
|
|
1234
|
+
return e.forEach((r) => {
|
|
1235
|
+
Gt(t, r.queryKey) && (s = { ...s, ...r.defaultOptions });
|
|
1236
|
+
}), s;
|
|
1237
|
+
}
|
|
1238
|
+
setMutationDefaults(t, e) {
|
|
1239
|
+
n(this, Ot).set(bt(t), {
|
|
1240
|
+
mutationKey: t,
|
|
1241
|
+
defaultOptions: e
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1244
|
+
getMutationDefaults(t) {
|
|
1245
|
+
const e = [...n(this, Ot).values()];
|
|
1246
|
+
let s = {};
|
|
1247
|
+
return e.forEach((r) => {
|
|
1248
|
+
Gt(t, r.mutationKey) && (s = { ...s, ...r.defaultOptions });
|
|
1249
|
+
}), s;
|
|
1250
|
+
}
|
|
1251
|
+
defaultQueryOptions(t) {
|
|
1252
|
+
if (t._defaulted)
|
|
1253
|
+
return t;
|
|
1254
|
+
const e = {
|
|
1255
|
+
...n(this, ct).queries,
|
|
1256
|
+
...this.getQueryDefaults(t.queryKey),
|
|
1257
|
+
...t,
|
|
1258
|
+
_defaulted: !0
|
|
1259
|
+
};
|
|
1260
|
+
return e.queryHash || (e.queryHash = xe(
|
|
1261
|
+
e.queryKey,
|
|
1262
|
+
e
|
|
1263
|
+
)), e.refetchOnReconnect === void 0 && (e.refetchOnReconnect = e.networkMode !== "always"), e.throwOnError === void 0 && (e.throwOnError = !!e.suspense), !e.networkMode && e.persister && (e.networkMode = "offlineFirst"), e.enabled !== !0 && e.queryFn === ts && (e.enabled = !1), e;
|
|
1264
|
+
}
|
|
1265
|
+
defaultMutationOptions(t) {
|
|
1266
|
+
return t != null && t._defaulted ? t : {
|
|
1267
|
+
...n(this, ct).mutations,
|
|
1268
|
+
...(t == null ? void 0 : t.mutationKey) && this.getMutationDefaults(t.mutationKey),
|
|
1269
|
+
...t,
|
|
1270
|
+
_defaulted: !0
|
|
1271
|
+
};
|
|
1272
|
+
}
|
|
1273
|
+
clear() {
|
|
1274
|
+
n(this, L).clear(), n(this, lt).clear();
|
|
1275
|
+
}
|
|
1276
|
+
}, L = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), Mt = new WeakMap(), Ot = new WeakMap(), ut = new WeakMap(), Rt = new WeakMap(), Lt = new WeakMap(), Ye), H, _, Vt, Q, yt, Ft, tt, $t, Dt, Tt, Ct, xt, ht, Ut, N, Kt, le, ce, ue, he, de, fe, pe, cs, ze, sr = (ze = class extends Ht {
|
|
1277
|
+
constructor(e, s) {
|
|
1278
|
+
super();
|
|
1279
|
+
y(this, N);
|
|
1280
|
+
y(this, H);
|
|
1281
|
+
y(this, _);
|
|
1282
|
+
y(this, Vt);
|
|
1283
|
+
y(this, Q);
|
|
1284
|
+
y(this, yt);
|
|
1285
|
+
y(this, Ft);
|
|
1286
|
+
y(this, tt);
|
|
1287
|
+
y(this, $t);
|
|
1288
|
+
y(this, Dt);
|
|
1289
|
+
// This property keeps track of the last query with defined data.
|
|
1290
|
+
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
1291
|
+
y(this, Tt);
|
|
1292
|
+
y(this, Ct);
|
|
1293
|
+
y(this, xt);
|
|
1294
|
+
y(this, ht);
|
|
1295
|
+
y(this, Ut, /* @__PURE__ */ new Set());
|
|
1296
|
+
this.options = s, p(this, H, e), p(this, tt, null), this.bindMethods(), this.setOptions(s);
|
|
1297
|
+
}
|
|
1298
|
+
bindMethods() {
|
|
1299
|
+
this.refetch = this.refetch.bind(this);
|
|
1300
|
+
}
|
|
1301
|
+
onSubscribe() {
|
|
1302
|
+
this.listeners.size === 1 && (n(this, _).addObserver(this), Re(n(this, _), this.options) ? b(this, N, Kt).call(this) : this.updateResult(), b(this, N, he).call(this));
|
|
1303
|
+
}
|
|
1304
|
+
onUnsubscribe() {
|
|
1305
|
+
this.hasListeners() || this.destroy();
|
|
1306
|
+
}
|
|
1307
|
+
shouldFetchOnReconnect() {
|
|
1308
|
+
return me(
|
|
1309
|
+
n(this, _),
|
|
1310
|
+
this.options,
|
|
1311
|
+
this.options.refetchOnReconnect
|
|
1312
|
+
);
|
|
1313
|
+
}
|
|
1314
|
+
shouldFetchOnWindowFocus() {
|
|
1315
|
+
return me(
|
|
1316
|
+
n(this, _),
|
|
1317
|
+
this.options,
|
|
1318
|
+
this.options.refetchOnWindowFocus
|
|
1319
|
+
);
|
|
1320
|
+
}
|
|
1321
|
+
destroy() {
|
|
1322
|
+
this.listeners = /* @__PURE__ */ new Set(), b(this, N, de).call(this), b(this, N, fe).call(this), n(this, _).removeObserver(this);
|
|
1323
|
+
}
|
|
1324
|
+
setOptions(e, s) {
|
|
1325
|
+
const r = this.options, a = n(this, _);
|
|
1326
|
+
if (this.options = n(this, H).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof z(this.options.enabled, n(this, _)) != "boolean")
|
|
1327
|
+
throw new Error(
|
|
1328
|
+
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
1329
|
+
);
|
|
1330
|
+
b(this, N, pe).call(this), n(this, _).setOptions(this.options), r._defaulted && !It(this.options, r) && n(this, H).getQueryCache().notify({
|
|
1331
|
+
type: "observerOptionsUpdated",
|
|
1332
|
+
query: n(this, _),
|
|
1333
|
+
observer: this
|
|
1334
|
+
});
|
|
1335
|
+
const l = this.hasListeners();
|
|
1336
|
+
l && Le(
|
|
1337
|
+
n(this, _),
|
|
1338
|
+
a,
|
|
1339
|
+
this.options,
|
|
1340
|
+
r
|
|
1341
|
+
) && b(this, N, Kt).call(this), this.updateResult(s), l && (n(this, _) !== a || z(this.options.enabled, n(this, _)) !== z(r.enabled, n(this, _)) || St(this.options.staleTime, n(this, _)) !== St(r.staleTime, n(this, _))) && b(this, N, le).call(this);
|
|
1342
|
+
const o = b(this, N, ce).call(this);
|
|
1343
|
+
l && (n(this, _) !== a || z(this.options.enabled, n(this, _)) !== z(r.enabled, n(this, _)) || o !== n(this, ht)) && b(this, N, ue).call(this, o);
|
|
1344
|
+
}
|
|
1345
|
+
getOptimisticResult(e) {
|
|
1346
|
+
const s = n(this, H).getQueryCache().build(n(this, H), e), r = this.createResult(s, e);
|
|
1347
|
+
return ir(this, r) && (p(this, Q, r), p(this, Ft, this.options), p(this, yt, n(this, _).state)), r;
|
|
1348
|
+
}
|
|
1349
|
+
getCurrentResult() {
|
|
1350
|
+
return n(this, Q);
|
|
1351
|
+
}
|
|
1352
|
+
trackResult(e, s) {
|
|
1353
|
+
const r = {};
|
|
1354
|
+
return Object.keys(e).forEach((a) => {
|
|
1355
|
+
Object.defineProperty(r, a, {
|
|
1356
|
+
configurable: !1,
|
|
1357
|
+
enumerable: !0,
|
|
1358
|
+
get: () => (this.trackProp(a), s == null || s(a), e[a])
|
|
1359
|
+
});
|
|
1360
|
+
}), r;
|
|
1361
|
+
}
|
|
1362
|
+
trackProp(e) {
|
|
1363
|
+
n(this, Ut).add(e);
|
|
1364
|
+
}
|
|
1365
|
+
getCurrentQuery() {
|
|
1366
|
+
return n(this, _);
|
|
1367
|
+
}
|
|
1368
|
+
refetch({ ...e } = {}) {
|
|
1369
|
+
return this.fetch({
|
|
1370
|
+
...e
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
fetchOptimistic(e) {
|
|
1374
|
+
const s = n(this, H).defaultQueryOptions(e), r = n(this, H).getQueryCache().build(n(this, H), s);
|
|
1375
|
+
return r.isFetchingOptimistic = !0, r.fetch().then(() => this.createResult(r, s));
|
|
1376
|
+
}
|
|
1377
|
+
fetch(e) {
|
|
1378
|
+
return b(this, N, Kt).call(this, {
|
|
1379
|
+
...e,
|
|
1380
|
+
cancelRefetch: e.cancelRefetch ?? !0
|
|
1381
|
+
}).then(() => (this.updateResult(), n(this, Q)));
|
|
1382
|
+
}
|
|
1383
|
+
createResult(e, s) {
|
|
1384
|
+
var et;
|
|
1385
|
+
const r = n(this, _), a = this.options, l = n(this, Q), o = n(this, yt), c = n(this, Ft), g = e !== r ? e.state : n(this, Vt), { state: h } = e;
|
|
1386
|
+
let u = { ...h }, d = !1, m;
|
|
1387
|
+
if (s._optimisticResults) {
|
|
1388
|
+
const E = this.hasListeners(), Z = !E && Re(e, s), Ls = E && Le(e, r, s, a);
|
|
1389
|
+
(Z || Ls) && (u = {
|
|
1390
|
+
...u,
|
|
1391
|
+
...as(h.data, e.options)
|
|
1392
|
+
}), s._optimisticResults === "isRestoring" && (u.fetchStatus = "idle");
|
|
1393
|
+
}
|
|
1394
|
+
let { error: S, errorUpdatedAt: P, status: k } = u;
|
|
1395
|
+
if (s.select && u.data !== void 0)
|
|
1396
|
+
if (l && u.data === (o == null ? void 0 : o.data) && s.select === n(this, $t))
|
|
1397
|
+
m = n(this, Dt);
|
|
1398
|
+
else
|
|
1399
|
+
try {
|
|
1400
|
+
p(this, $t, s.select), m = s.select(u.data), m = oe(l == null ? void 0 : l.data, m, s), p(this, Dt, m), p(this, tt, null);
|
|
1401
|
+
} catch (E) {
|
|
1402
|
+
p(this, tt, E);
|
|
1403
|
+
}
|
|
1404
|
+
else
|
|
1405
|
+
m = u.data;
|
|
1406
|
+
if (s.placeholderData !== void 0 && m === void 0 && k === "pending") {
|
|
1407
|
+
let E;
|
|
1408
|
+
if (l != null && l.isPlaceholderData && s.placeholderData === (c == null ? void 0 : c.placeholderData))
|
|
1409
|
+
E = l.data;
|
|
1410
|
+
else if (E = typeof s.placeholderData == "function" ? s.placeholderData(
|
|
1411
|
+
(et = n(this, Tt)) == null ? void 0 : et.state.data,
|
|
1412
|
+
n(this, Tt)
|
|
1413
|
+
) : s.placeholderData, s.select && E !== void 0)
|
|
1414
|
+
try {
|
|
1415
|
+
E = s.select(E), p(this, tt, null);
|
|
1416
|
+
} catch (Z) {
|
|
1417
|
+
p(this, tt, Z);
|
|
1418
|
+
}
|
|
1419
|
+
E !== void 0 && (k = "success", m = oe(
|
|
1420
|
+
l == null ? void 0 : l.data,
|
|
1421
|
+
E,
|
|
1422
|
+
s
|
|
1423
|
+
), d = !0);
|
|
1424
|
+
}
|
|
1425
|
+
n(this, tt) && (S = n(this, tt), m = n(this, Dt), P = Date.now(), k = "error");
|
|
1426
|
+
const C = u.fetchStatus === "fetching", w = k === "pending", j = k === "error", M = w && C, R = m !== void 0;
|
|
1427
|
+
return {
|
|
1428
|
+
status: k,
|
|
1429
|
+
fetchStatus: u.fetchStatus,
|
|
1430
|
+
isPending: w,
|
|
1431
|
+
isSuccess: k === "success",
|
|
1432
|
+
isError: j,
|
|
1433
|
+
isInitialLoading: M,
|
|
1434
|
+
isLoading: M,
|
|
1435
|
+
data: m,
|
|
1436
|
+
dataUpdatedAt: u.dataUpdatedAt,
|
|
1437
|
+
error: S,
|
|
1438
|
+
errorUpdatedAt: P,
|
|
1439
|
+
failureCount: u.fetchFailureCount,
|
|
1440
|
+
failureReason: u.fetchFailureReason,
|
|
1441
|
+
errorUpdateCount: u.errorUpdateCount,
|
|
1442
|
+
isFetched: u.dataUpdateCount > 0 || u.errorUpdateCount > 0,
|
|
1443
|
+
isFetchedAfterMount: u.dataUpdateCount > g.dataUpdateCount || u.errorUpdateCount > g.errorUpdateCount,
|
|
1444
|
+
isFetching: C,
|
|
1445
|
+
isRefetching: C && !w,
|
|
1446
|
+
isLoadingError: j && !R,
|
|
1447
|
+
isPaused: u.fetchStatus === "paused",
|
|
1448
|
+
isPlaceholderData: d,
|
|
1449
|
+
isRefetchError: j && R,
|
|
1450
|
+
isStale: we(e, s),
|
|
1451
|
+
refetch: this.refetch
|
|
1452
|
+
};
|
|
1453
|
+
}
|
|
1454
|
+
updateResult(e) {
|
|
1455
|
+
const s = n(this, Q), r = this.createResult(n(this, _), this.options);
|
|
1456
|
+
if (p(this, yt, n(this, _).state), p(this, Ft, this.options), n(this, yt).data !== void 0 && p(this, Tt, n(this, _)), It(r, s))
|
|
1457
|
+
return;
|
|
1458
|
+
p(this, Q, r);
|
|
1459
|
+
const a = {}, l = () => {
|
|
1460
|
+
if (!s)
|
|
1461
|
+
return !0;
|
|
1462
|
+
const { notifyOnChangeProps: o } = this.options, c = typeof o == "function" ? o() : o;
|
|
1463
|
+
if (c === "all" || !c && !n(this, Ut).size)
|
|
1464
|
+
return !0;
|
|
1465
|
+
const v = new Set(
|
|
1466
|
+
c ?? n(this, Ut)
|
|
1467
|
+
);
|
|
1468
|
+
return this.options.throwOnError && v.add("error"), Object.keys(n(this, Q)).some((g) => {
|
|
1469
|
+
const h = g;
|
|
1470
|
+
return n(this, Q)[h] !== s[h] && v.has(h);
|
|
1471
|
+
});
|
|
1472
|
+
};
|
|
1473
|
+
(e == null ? void 0 : e.listeners) !== !1 && l() && (a.listeners = !0), b(this, N, cs).call(this, { ...a, ...e });
|
|
1474
|
+
}
|
|
1475
|
+
onQueryUpdate() {
|
|
1476
|
+
this.updateResult(), this.hasListeners() && b(this, N, he).call(this);
|
|
1477
|
+
}
|
|
1478
|
+
}, H = new WeakMap(), _ = new WeakMap(), Vt = new WeakMap(), Q = new WeakMap(), yt = new WeakMap(), Ft = new WeakMap(), tt = new WeakMap(), $t = new WeakMap(), Dt = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), xt = new WeakMap(), ht = new WeakMap(), Ut = new WeakMap(), N = new WeakSet(), Kt = function(e) {
|
|
1479
|
+
b(this, N, pe).call(this);
|
|
1480
|
+
let s = n(this, _).fetch(
|
|
1481
|
+
this.options,
|
|
1482
|
+
e
|
|
1483
|
+
);
|
|
1484
|
+
return e != null && e.throwOnError || (s = s.catch($)), s;
|
|
1485
|
+
}, le = function() {
|
|
1486
|
+
b(this, N, de).call(this);
|
|
1487
|
+
const e = St(
|
|
1488
|
+
this.options.staleTime,
|
|
1489
|
+
n(this, _)
|
|
1490
|
+
);
|
|
1491
|
+
if (Qt || n(this, Q).isStale || !ne(e))
|
|
1492
|
+
return;
|
|
1493
|
+
const r = Ie(n(this, Q).dataUpdatedAt, e) + 1;
|
|
1494
|
+
p(this, Ct, setTimeout(() => {
|
|
1495
|
+
n(this, Q).isStale || this.updateResult();
|
|
1496
|
+
}, r));
|
|
1497
|
+
}, ce = function() {
|
|
1498
|
+
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(n(this, _)) : this.options.refetchInterval) ?? !1;
|
|
1499
|
+
}, ue = function(e) {
|
|
1500
|
+
b(this, N, fe).call(this), p(this, ht, e), !(Qt || z(this.options.enabled, n(this, _)) === !1 || !ne(n(this, ht)) || n(this, ht) === 0) && p(this, xt, setInterval(() => {
|
|
1501
|
+
(this.options.refetchIntervalInBackground || be.isFocused()) && b(this, N, Kt).call(this);
|
|
1502
|
+
}, n(this, ht)));
|
|
1503
|
+
}, he = function() {
|
|
1504
|
+
b(this, N, le).call(this), b(this, N, ue).call(this, b(this, N, ce).call(this));
|
|
1505
|
+
}, de = function() {
|
|
1506
|
+
n(this, Ct) && (clearTimeout(n(this, Ct)), p(this, Ct, void 0));
|
|
1507
|
+
}, fe = function() {
|
|
1508
|
+
n(this, xt) && (clearInterval(n(this, xt)), p(this, xt, void 0));
|
|
1509
|
+
}, pe = function() {
|
|
1510
|
+
const e = n(this, H).getQueryCache().build(n(this, H), this.options);
|
|
1511
|
+
if (e === n(this, _))
|
|
1512
|
+
return;
|
|
1513
|
+
const s = n(this, _);
|
|
1514
|
+
p(this, _, e), p(this, Vt, e.state), this.hasListeners() && (s == null || s.removeObserver(this), e.addObserver(this));
|
|
1515
|
+
}, cs = function(e) {
|
|
1516
|
+
D.batch(() => {
|
|
1517
|
+
e.listeners && this.listeners.forEach((s) => {
|
|
1518
|
+
s(n(this, Q));
|
|
1519
|
+
}), n(this, H).getQueryCache().notify({
|
|
1520
|
+
query: n(this, _),
|
|
1521
|
+
type: "observerResultsUpdated"
|
|
1522
|
+
});
|
|
1523
|
+
});
|
|
1524
|
+
}, ze);
|
|
1525
|
+
function rr(t, e) {
|
|
1526
|
+
return z(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
|
|
1527
|
+
}
|
|
1528
|
+
function Re(t, e) {
|
|
1529
|
+
return rr(t, e) || t.state.data !== void 0 && me(t, e, e.refetchOnMount);
|
|
1530
|
+
}
|
|
1531
|
+
function me(t, e, s) {
|
|
1532
|
+
if (z(e.enabled, t) !== !1) {
|
|
1533
|
+
const r = typeof s == "function" ? s(t) : s;
|
|
1534
|
+
return r === "always" || r !== !1 && we(t, e);
|
|
1535
|
+
}
|
|
1536
|
+
return !1;
|
|
1537
|
+
}
|
|
1538
|
+
function Le(t, e, s, r) {
|
|
1539
|
+
return (t !== e || z(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && we(t, s);
|
|
1540
|
+
}
|
|
1541
|
+
function we(t, e) {
|
|
1542
|
+
return z(e.enabled, t) !== !1 && t.isStaleByTime(St(e.staleTime, t));
|
|
1543
|
+
}
|
|
1544
|
+
function ir(t, e) {
|
|
1545
|
+
return !It(t.getCurrentResult(), e);
|
|
1546
|
+
}
|
|
1547
|
+
var dt, ft, K, rt, it, Xt, ve, Je, nr = (Je = class extends Ht {
|
|
1548
|
+
constructor(e, s) {
|
|
1549
|
+
super();
|
|
1550
|
+
y(this, it);
|
|
1551
|
+
y(this, dt);
|
|
1552
|
+
y(this, ft);
|
|
1553
|
+
y(this, K);
|
|
1554
|
+
y(this, rt);
|
|
1555
|
+
p(this, dt, e), this.setOptions(s), this.bindMethods(), b(this, it, Xt).call(this);
|
|
1556
|
+
}
|
|
1557
|
+
bindMethods() {
|
|
1558
|
+
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
|
|
1559
|
+
}
|
|
1560
|
+
setOptions(e) {
|
|
1561
|
+
var r;
|
|
1562
|
+
const s = this.options;
|
|
1563
|
+
this.options = n(this, dt).defaultMutationOptions(e), It(this.options, s) || n(this, dt).getMutationCache().notify({
|
|
1564
|
+
type: "observerOptionsUpdated",
|
|
1565
|
+
mutation: n(this, K),
|
|
1566
|
+
observer: this
|
|
1567
|
+
}), s != null && s.mutationKey && this.options.mutationKey && bt(s.mutationKey) !== bt(this.options.mutationKey) ? this.reset() : ((r = n(this, K)) == null ? void 0 : r.state.status) === "pending" && n(this, K).setOptions(this.options);
|
|
1568
|
+
}
|
|
1569
|
+
onUnsubscribe() {
|
|
1570
|
+
var e;
|
|
1571
|
+
this.hasListeners() || (e = n(this, K)) == null || e.removeObserver(this);
|
|
1572
|
+
}
|
|
1573
|
+
onMutationUpdate(e) {
|
|
1574
|
+
b(this, it, Xt).call(this), b(this, it, ve).call(this, e);
|
|
1575
|
+
}
|
|
1576
|
+
getCurrentResult() {
|
|
1577
|
+
return n(this, ft);
|
|
1578
|
+
}
|
|
1579
|
+
reset() {
|
|
1580
|
+
var e;
|
|
1581
|
+
(e = n(this, K)) == null || e.removeObserver(this), p(this, K, void 0), b(this, it, Xt).call(this), b(this, it, ve).call(this);
|
|
1582
|
+
}
|
|
1583
|
+
mutate(e, s) {
|
|
1584
|
+
var r;
|
|
1585
|
+
return p(this, rt, s), (r = n(this, K)) == null || r.removeObserver(this), p(this, K, n(this, dt).getMutationCache().build(n(this, dt), this.options)), n(this, K).addObserver(this), n(this, K).execute(e);
|
|
1586
|
+
}
|
|
1587
|
+
}, dt = new WeakMap(), ft = new WeakMap(), K = new WeakMap(), rt = new WeakMap(), it = new WeakSet(), Xt = function() {
|
|
1588
|
+
var s;
|
|
1589
|
+
const e = ((s = n(this, K)) == null ? void 0 : s.state) ?? os();
|
|
1590
|
+
p(this, ft, {
|
|
1591
|
+
...e,
|
|
1592
|
+
isPending: e.status === "pending",
|
|
1593
|
+
isSuccess: e.status === "success",
|
|
1594
|
+
isError: e.status === "error",
|
|
1595
|
+
isIdle: e.status === "idle",
|
|
1596
|
+
mutate: this.mutate,
|
|
1597
|
+
reset: this.reset
|
|
1598
|
+
});
|
|
1599
|
+
}, ve = function(e) {
|
|
1600
|
+
D.batch(() => {
|
|
1601
|
+
var s, r, a, l, o, c, v, g;
|
|
1602
|
+
if (n(this, rt) && this.hasListeners()) {
|
|
1603
|
+
const h = n(this, ft).variables, u = n(this, ft).context;
|
|
1604
|
+
(e == null ? void 0 : e.type) === "success" ? ((r = (s = n(this, rt)).onSuccess) == null || r.call(s, e.data, h, u), (l = (a = n(this, rt)).onSettled) == null || l.call(a, e.data, null, h, u)) : (e == null ? void 0 : e.type) === "error" && ((c = (o = n(this, rt)).onError) == null || c.call(o, e.error, h, u), (g = (v = n(this, rt)).onSettled) == null || g.call(
|
|
1605
|
+
v,
|
|
1606
|
+
void 0,
|
|
1607
|
+
e.error,
|
|
1608
|
+
h,
|
|
1609
|
+
u
|
|
1610
|
+
));
|
|
1611
|
+
}
|
|
1612
|
+
this.listeners.forEach((h) => {
|
|
1613
|
+
h(n(this, ft));
|
|
1614
|
+
});
|
|
1615
|
+
});
|
|
1616
|
+
}, Je), us = f.createContext(
|
|
1617
|
+
void 0
|
|
1618
|
+
), je = (t) => {
|
|
1619
|
+
const e = f.useContext(us);
|
|
1620
|
+
if (!e)
|
|
1621
|
+
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
1622
|
+
return e;
|
|
1623
|
+
}, ar = ({
|
|
1624
|
+
client: t,
|
|
1625
|
+
children: e
|
|
1626
|
+
}) => (f.useEffect(() => (t.mount(), () => {
|
|
1627
|
+
t.unmount();
|
|
1628
|
+
}), [t]), /* @__PURE__ */ i.jsx(us.Provider, { value: t, children: e })), hs = f.createContext(!1), or = () => f.useContext(hs);
|
|
1629
|
+
hs.Provider;
|
|
1630
|
+
function lr() {
|
|
1631
|
+
let t = !1;
|
|
1632
|
+
return {
|
|
1633
|
+
clearReset: () => {
|
|
1634
|
+
t = !1;
|
|
1635
|
+
},
|
|
1636
|
+
reset: () => {
|
|
1637
|
+
t = !0;
|
|
1638
|
+
},
|
|
1639
|
+
isReset: () => t
|
|
1640
|
+
};
|
|
1641
|
+
}
|
|
1642
|
+
var cr = f.createContext(lr()), ur = () => f.useContext(cr);
|
|
1643
|
+
function ds(t, e) {
|
|
1644
|
+
return typeof t == "function" ? t(...e) : !!t;
|
|
1645
|
+
}
|
|
1646
|
+
function hr() {
|
|
1647
|
+
}
|
|
1648
|
+
var dr = (t, e) => {
|
|
1649
|
+
(t.suspense || t.throwOnError) && (e.isReset() || (t.retryOnMount = !1));
|
|
1650
|
+
}, fr = (t) => {
|
|
1651
|
+
f.useEffect(() => {
|
|
1652
|
+
t.clearReset();
|
|
1653
|
+
}, [t]);
|
|
1654
|
+
}, pr = ({
|
|
1655
|
+
result: t,
|
|
1656
|
+
errorResetBoundary: e,
|
|
1657
|
+
throwOnError: s,
|
|
1658
|
+
query: r
|
|
1659
|
+
}) => t.isError && !e.isReset() && !t.isFetching && r && ds(s, [t.error, r]), mr = (t) => {
|
|
1660
|
+
t.suspense && typeof t.staleTime != "number" && (t.staleTime = 1e3);
|
|
1661
|
+
}, vr = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, gr = (t, e, s) => e.fetchOptimistic(t).catch(() => {
|
|
1662
|
+
s.clearReset();
|
|
1663
|
+
});
|
|
1664
|
+
function yr(t, e, s) {
|
|
1665
|
+
var g, h, u, d;
|
|
1666
|
+
const r = je(), a = or(), l = ur(), o = r.defaultQueryOptions(t);
|
|
1667
|
+
(h = (g = r.getDefaultOptions().queries) == null ? void 0 : g._experimental_beforeQuery) == null || h.call(
|
|
1668
|
+
g,
|
|
1669
|
+
o
|
|
1670
|
+
), o._optimisticResults = a ? "isRestoring" : "optimistic", mr(o), dr(o, l), fr(l);
|
|
1671
|
+
const [c] = f.useState(
|
|
1672
|
+
() => new e(
|
|
1673
|
+
r,
|
|
1674
|
+
o
|
|
1675
|
+
)
|
|
1676
|
+
), v = c.getOptimisticResult(o);
|
|
1677
|
+
if (f.useSyncExternalStore(
|
|
1678
|
+
f.useCallback(
|
|
1679
|
+
(m) => {
|
|
1680
|
+
const S = a ? () => {
|
|
1681
|
+
} : c.subscribe(D.batchCalls(m));
|
|
1682
|
+
return c.updateResult(), S;
|
|
1683
|
+
},
|
|
1684
|
+
[c, a]
|
|
1685
|
+
),
|
|
1686
|
+
() => c.getCurrentResult(),
|
|
1687
|
+
() => c.getCurrentResult()
|
|
1688
|
+
), f.useEffect(() => {
|
|
1689
|
+
c.setOptions(o, { listeners: !1 });
|
|
1690
|
+
}, [o, c]), vr(o, v))
|
|
1691
|
+
throw gr(o, c, l);
|
|
1692
|
+
if (pr({
|
|
1693
|
+
result: v,
|
|
1694
|
+
errorResetBoundary: l,
|
|
1695
|
+
throwOnError: o.throwOnError,
|
|
1696
|
+
query: r.getQueryCache().get(o.queryHash)
|
|
1697
|
+
}))
|
|
1698
|
+
throw v.error;
|
|
1699
|
+
return (d = (u = r.getDefaultOptions().queries) == null ? void 0 : u._experimental_afterQuery) == null || d.call(
|
|
1700
|
+
u,
|
|
1701
|
+
o,
|
|
1702
|
+
v
|
|
1703
|
+
), o.notifyOnChangeProps ? v : c.trackResult(v);
|
|
1704
|
+
}
|
|
1705
|
+
function fs(t, e) {
|
|
1706
|
+
return yr(t, sr);
|
|
1707
|
+
}
|
|
1708
|
+
function Cr(t, e) {
|
|
1709
|
+
const s = je(), [r] = f.useState(
|
|
1710
|
+
() => new nr(
|
|
1711
|
+
s,
|
|
1712
|
+
t
|
|
1713
|
+
)
|
|
1714
|
+
);
|
|
1715
|
+
f.useEffect(() => {
|
|
1716
|
+
r.setOptions(t);
|
|
1717
|
+
}, [r, t]);
|
|
1718
|
+
const a = f.useSyncExternalStore(
|
|
1719
|
+
f.useCallback(
|
|
1720
|
+
(o) => r.subscribe(D.batchCalls(o)),
|
|
1721
|
+
[r]
|
|
1722
|
+
),
|
|
1723
|
+
() => r.getCurrentResult(),
|
|
1724
|
+
() => r.getCurrentResult()
|
|
1725
|
+
), l = f.useCallback(
|
|
1726
|
+
(o, c) => {
|
|
1727
|
+
r.mutate(o, c).catch(hr);
|
|
1728
|
+
},
|
|
1729
|
+
[r]
|
|
1730
|
+
);
|
|
1731
|
+
if (a.error && ds(r.options.throwOnError, [a.error]))
|
|
1732
|
+
throw a.error;
|
|
1733
|
+
return { ...a, mutate: l, mutateAsync: a.mutate };
|
|
1734
|
+
}
|
|
1735
|
+
function ps(t) {
|
|
1736
|
+
var e, s, r = "";
|
|
1737
|
+
if (typeof t == "string" || typeof t == "number") r += t;
|
|
1738
|
+
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
1739
|
+
var a = t.length;
|
|
1740
|
+
for (e = 0; e < a; e++) t[e] && (s = ps(t[e])) && (r && (r += " "), r += s);
|
|
1741
|
+
} else for (s in t) t[s] && (r && (r += " "), r += s);
|
|
1742
|
+
return r;
|
|
1743
|
+
}
|
|
1744
|
+
function O() {
|
|
1745
|
+
for (var t, e, s = 0, r = "", a = arguments.length; s < a; s++) (t = arguments[s]) && (e = ps(t)) && (r && (r += " "), r += e);
|
|
1746
|
+
return r;
|
|
1747
|
+
}
|
|
1748
|
+
var xr = Object.defineProperty, br = Object.defineProperties, wr = Object.getOwnPropertyDescriptors, te = Object.getOwnPropertySymbols, ms = Object.prototype.hasOwnProperty, vs = Object.prototype.propertyIsEnumerable, Fe = (t, e, s) => e in t ? xr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, x = (t, e) => {
|
|
1749
|
+
for (var s in e || (e = {}))
|
|
1750
|
+
ms.call(e, s) && Fe(t, s, e[s]);
|
|
1751
|
+
if (te)
|
|
1752
|
+
for (var s of te(e))
|
|
1753
|
+
vs.call(e, s) && Fe(t, s, e[s]);
|
|
1754
|
+
return t;
|
|
1755
|
+
}, A = (t, e) => br(t, wr(e)), F = (t, e) => {
|
|
1756
|
+
var s = {};
|
|
1757
|
+
for (var r in t)
|
|
1758
|
+
ms.call(t, r) && e.indexOf(r) < 0 && (s[r] = t[r]);
|
|
1759
|
+
if (t != null && te)
|
|
1760
|
+
for (var r of te(t))
|
|
1761
|
+
e.indexOf(r) < 0 && vs.call(t, r) && (s[r] = t[r]);
|
|
1762
|
+
return s;
|
|
1763
|
+
};
|
|
1764
|
+
function jr(t, e) {
|
|
1765
|
+
typeof t == "function" ? t(e) : t != null && (t.current = e);
|
|
1766
|
+
}
|
|
1767
|
+
function _r(...t) {
|
|
1768
|
+
return (e) => t.forEach((s) => jr(s, e));
|
|
1769
|
+
}
|
|
1770
|
+
var Sr = f.forwardRef((t, e) => {
|
|
1771
|
+
const s = t, { children: r } = s, a = F(s, ["children"]), l = f.Children.toArray(r), o = l.find(Pr);
|
|
1772
|
+
if (o) {
|
|
1773
|
+
const c = o.props.children, v = l.map((g) => g === o ? f.Children.count(c) > 1 ? f.Children.only(null) : f.isValidElement(c) ? c.props.children : null : g);
|
|
1774
|
+
return /* @__PURE__ */ i.jsx(ge, A(x({}, a), { ref: e, children: f.isValidElement(c) ? f.cloneElement(c, void 0, v) : null }));
|
|
1775
|
+
}
|
|
1776
|
+
return /* @__PURE__ */ i.jsx(ge, A(x({}, a), { ref: e, children: r }));
|
|
1777
|
+
});
|
|
1778
|
+
Sr.displayName = "Slot";
|
|
1779
|
+
var ge = f.forwardRef((t, e) => {
|
|
1780
|
+
const s = t, { children: r } = s, a = F(s, ["children"]);
|
|
1781
|
+
if (f.isValidElement(r)) {
|
|
1782
|
+
const l = kr(r);
|
|
1783
|
+
return f.cloneElement(r, A(x({}, Ar(a, r.props)), {
|
|
1784
|
+
// @ts-ignore
|
|
1785
|
+
ref: e ? _r(e, l) : l
|
|
1786
|
+
}));
|
|
1787
|
+
}
|
|
1788
|
+
return f.Children.count(r) > 1 ? f.Children.only(null) : null;
|
|
1789
|
+
});
|
|
1790
|
+
ge.displayName = "SlotClone";
|
|
1791
|
+
var Er = ({ children: t }) => /* @__PURE__ */ i.jsx(i.Fragment, { children: t });
|
|
1792
|
+
function Pr(t) {
|
|
1793
|
+
return f.isValidElement(t) && t.type === Er;
|
|
1794
|
+
}
|
|
1795
|
+
function Ar(t, e) {
|
|
1796
|
+
const s = x({}, e);
|
|
1797
|
+
for (const r in e) {
|
|
1798
|
+
const a = t[r], l = e[r];
|
|
1799
|
+
/^on[A-Z]/.test(r) ? a && l ? s[r] = (...c) => {
|
|
1800
|
+
l(...c), a(...c);
|
|
1801
|
+
} : a && (s[r] = a) : r === "style" ? s[r] = x(x({}, a), l) : r === "className" && (s[r] = [a, l].filter(Boolean).join(" "));
|
|
1802
|
+
}
|
|
1803
|
+
return x(x({}, t), s);
|
|
1804
|
+
}
|
|
1805
|
+
function kr(t) {
|
|
1806
|
+
var e, s;
|
|
1807
|
+
let r = (e = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : e.get, a = r && "isReactWarning" in r && r.isReactWarning;
|
|
1808
|
+
return a ? t.ref : (r = (s = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : s.get, a = r && "isReactWarning" in r && r.isReactWarning, a ? t.props.ref : t.props.ref || t.ref);
|
|
1809
|
+
}
|
|
1810
|
+
var Nr = ({ firstName: t, lastName: e, variant: s = "small" }) => {
|
|
1811
|
+
const r = `${t.charAt(0)}${e.charAt(0)}`;
|
|
1812
|
+
return /* @__PURE__ */ i.jsx(
|
|
1813
|
+
"span",
|
|
1814
|
+
{
|
|
1815
|
+
className: `avatar avatar--${s}`,
|
|
1816
|
+
"aria-label": `${t} ${e}`,
|
|
1817
|
+
role: "img",
|
|
1818
|
+
children: /* @__PURE__ */ i.jsx("span", { className: "avatar__initials", children: r })
|
|
1819
|
+
}
|
|
1820
|
+
);
|
|
1821
|
+
}, Zt = f.forwardRef(
|
|
1822
|
+
(t, e) => {
|
|
1823
|
+
var s = t, {
|
|
1824
|
+
iconLeft: r,
|
|
1825
|
+
iconRight: a,
|
|
1826
|
+
isPending: l = !1,
|
|
1827
|
+
isFilled: o = !1,
|
|
1828
|
+
variant: c,
|
|
1829
|
+
className: v,
|
|
1830
|
+
children: g
|
|
1831
|
+
} = s, h = F(s, [
|
|
1832
|
+
"iconLeft",
|
|
1833
|
+
"iconRight",
|
|
1834
|
+
"isPending",
|
|
1835
|
+
"isFilled",
|
|
1836
|
+
"variant",
|
|
1837
|
+
"className",
|
|
1838
|
+
"children"
|
|
1839
|
+
]);
|
|
1840
|
+
const u = !!r || !!a;
|
|
1841
|
+
return /* @__PURE__ */ i.jsxs(
|
|
1842
|
+
"button",
|
|
1843
|
+
A(x({
|
|
1844
|
+
ref: e
|
|
1845
|
+
}, h), {
|
|
1846
|
+
className: O(
|
|
1847
|
+
"button",
|
|
1848
|
+
c && `button--${c}`,
|
|
1849
|
+
c && o && `button--${c}--filled`,
|
|
1850
|
+
u && "button--with-icon",
|
|
1851
|
+
l && "button--pending",
|
|
1852
|
+
v
|
|
1853
|
+
),
|
|
1854
|
+
children: [
|
|
1855
|
+
r && /* @__PURE__ */ i.jsx("div", { className: "button__icon", children: r }),
|
|
1856
|
+
!!g && /* @__PURE__ */ i.jsx("span", { className: "button__label", children: g }),
|
|
1857
|
+
a && /* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: a })
|
|
1858
|
+
]
|
|
1859
|
+
})
|
|
1860
|
+
);
|
|
1861
|
+
}
|
|
1862
|
+
);
|
|
1863
|
+
Zt.displayName = "Button";
|
|
1864
|
+
f.createContext(void 0);
|
|
1865
|
+
var Mr = f.forwardRef(
|
|
1866
|
+
(t, e) => {
|
|
1867
|
+
var s = t, { prefix: r, suffix: a, className: l } = s, o = F(s, ["prefix", "suffix", "className"]);
|
|
1868
|
+
return /* @__PURE__ */ i.jsxs("div", { className: "input__wrapper", children: [
|
|
1869
|
+
r && /* @__PURE__ */ i.jsx("span", { className: "input__prefix", children: r }),
|
|
1870
|
+
/* @__PURE__ */ i.jsx(
|
|
1871
|
+
"input",
|
|
1872
|
+
x({
|
|
1873
|
+
ref: e,
|
|
1874
|
+
className: O(
|
|
1875
|
+
"input",
|
|
1876
|
+
r && "input--with-prefix",
|
|
1877
|
+
a && "input--with-suffix",
|
|
1878
|
+
l
|
|
1879
|
+
)
|
|
1880
|
+
}, o)
|
|
1881
|
+
),
|
|
1882
|
+
a && /* @__PURE__ */ i.jsx("span", { className: "input__suffix", children: a })
|
|
1883
|
+
] });
|
|
1884
|
+
}
|
|
1885
|
+
);
|
|
1886
|
+
Mr.displayName = "TextField";
|
|
1887
|
+
f.createContext(void 0);
|
|
1888
|
+
var Or = ({ children: t }) => /* @__PURE__ */ i.jsx("div", { className: "card__header__action", children: t }), Rr = (t) => {
|
|
1889
|
+
var e = t, { children: s, className: r } = e, a = F(e, ["children", "className"]);
|
|
1890
|
+
return /* @__PURE__ */ i.jsx("div", A(x({ className: O("card__body", r) }, a), { children: s }));
|
|
1891
|
+
}, Lr = (t) => /* @__PURE__ */ i.jsx(
|
|
1892
|
+
"svg",
|
|
1893
|
+
A(x({
|
|
1894
|
+
width: "24",
|
|
1895
|
+
height: "24",
|
|
1896
|
+
viewBox: "0 0 24 24",
|
|
1897
|
+
fill: "none",
|
|
1898
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1899
|
+
}, t), {
|
|
1900
|
+
children: /* @__PURE__ */ i.jsx(
|
|
1901
|
+
"path",
|
|
1902
|
+
{
|
|
1903
|
+
d: "M8 10L12 14L16 10",
|
|
1904
|
+
stroke: "currentColor",
|
|
1905
|
+
strokeWidth: "1.5",
|
|
1906
|
+
strokeLinecap: "round",
|
|
1907
|
+
strokeLinejoin: "round"
|
|
1908
|
+
}
|
|
1909
|
+
)
|
|
1910
|
+
})
|
|
1911
|
+
), _e = Lr, Fr = (t) => /* @__PURE__ */ i.jsx(
|
|
1912
|
+
"svg",
|
|
1913
|
+
A(x({
|
|
1914
|
+
width: "24",
|
|
1915
|
+
height: "24",
|
|
1916
|
+
viewBox: "0 0 24 24",
|
|
1917
|
+
fill: "none",
|
|
1918
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1919
|
+
}, t), {
|
|
1920
|
+
children: /* @__PURE__ */ i.jsx(
|
|
1921
|
+
"path",
|
|
1922
|
+
{
|
|
1923
|
+
d: "M20 6.5L9 17.5L4 12.5",
|
|
1924
|
+
stroke: "currentColor",
|
|
1925
|
+
strokeWidth: "1.5",
|
|
1926
|
+
strokeLinecap: "round",
|
|
1927
|
+
strokeLinejoin: "round"
|
|
1928
|
+
}
|
|
1929
|
+
)
|
|
1930
|
+
})
|
|
1931
|
+
), Dr = Fr, Tr = (t) => /* @__PURE__ */ i.jsx(
|
|
1932
|
+
"svg",
|
|
1933
|
+
A(x({
|
|
1934
|
+
width: "24",
|
|
1935
|
+
height: "24",
|
|
1936
|
+
viewBox: "0 0 24 24",
|
|
1937
|
+
fill: "none",
|
|
1938
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1939
|
+
}, t), {
|
|
1940
|
+
children: /* @__PURE__ */ i.jsx(
|
|
1941
|
+
"path",
|
|
1942
|
+
{
|
|
1943
|
+
fillRule: "evenodd",
|
|
1944
|
+
clipRule: "evenodd",
|
|
1945
|
+
fill: "currentColor",
|
|
1946
|
+
d: "M5.53033 4.46967C5.23744 4.17678 4.76256 4.17678 4.46967 4.46967C4.17678 4.76256 4.17678 5.23744 4.46967 5.53033L10.9393 12L4.46967 18.4697C4.17678 18.7626 4.17678 19.2374 4.46967 19.5303C4.76256 19.8232 5.23744 19.8232 5.53033 19.5303L12 13.0607L18.4697 19.5303C18.7626 19.8232 19.2374 19.8232 19.5303 19.5303C19.8232 19.2374 19.8232 18.7626 19.5303 18.4697L13.0607 12L19.5303 5.53033C19.8232 5.23744 19.8232 4.76256 19.5303 4.46967C19.2374 4.17678 18.7626 4.17678 18.4697 4.46967L12 10.9393L5.53033 4.46967Z"
|
|
1947
|
+
}
|
|
1948
|
+
)
|
|
1949
|
+
})
|
|
1950
|
+
), Ur = Tr, Qr = (t) => /* @__PURE__ */ i.jsx(
|
|
1951
|
+
"svg",
|
|
1952
|
+
A(x({
|
|
1953
|
+
width: "24",
|
|
1954
|
+
height: "24",
|
|
1955
|
+
viewBox: "0 0 24 24",
|
|
1956
|
+
fill: "none",
|
|
1957
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1958
|
+
}, t), {
|
|
1959
|
+
children: /* @__PURE__ */ i.jsx(
|
|
1960
|
+
"path",
|
|
1961
|
+
{
|
|
1962
|
+
fillRule: "evenodd",
|
|
1963
|
+
clipRule: "evenodd",
|
|
1964
|
+
d: "M10.25 2.25C9.83579 2.25 9.5 2.58579 9.5 3C9.5 3.41421 9.83579 3.75 10.25 3.75H15.25C16.112 3.75 16.9386 4.09241 17.5481 4.7019C18.1576 5.3114 18.5 6.13805 18.5 7V17C18.5 17.862 18.1576 18.6886 17.5481 19.2981C16.9386 19.9076 16.112 20.25 15.25 20.25H10.25C9.83579 20.25 9.5 20.5858 9.5 21C9.5 21.4142 9.83579 21.75 10.25 21.75H15.25C16.5098 21.75 17.718 21.2496 18.6088 20.3588C19.4996 19.468 20 18.2598 20 17V7C20 5.74022 19.4996 4.53204 18.6088 3.64124C17.718 2.75044 16.5098 2.25 15.25 2.25H10.25ZM9.71967 9.53033C9.42678 9.23744 9.42678 8.76256 9.71967 8.46967C10.0126 8.17678 10.4874 8.17678 10.7803 8.46967L13.7803 11.4697C14.0732 11.7626 14.0732 12.2374 13.7803 12.5303L10.7803 15.5303C10.4874 15.8232 10.0126 15.8232 9.71967 15.5303C9.42678 15.2374 9.42678 14.7626 9.71967 14.4697L11.4393 12.75L4.25 12.75C3.83579 12.75 3.5 12.4142 3.5 12C3.5 11.5858 3.83579 11.25 4.25 11.25L11.4393 11.25L9.71967 9.53033Z",
|
|
1965
|
+
fill: "#323232"
|
|
1966
|
+
}
|
|
1967
|
+
)
|
|
1968
|
+
})
|
|
1969
|
+
), Hr = Qr, Kr = (t) => /* @__PURE__ */ i.jsx(
|
|
1970
|
+
"svg",
|
|
1971
|
+
A(x({
|
|
1972
|
+
width: "24",
|
|
1973
|
+
height: "24",
|
|
1974
|
+
viewBox: "0 0 24 24",
|
|
1975
|
+
fill: "none",
|
|
1976
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1977
|
+
}, t), {
|
|
1978
|
+
children: /* @__PURE__ */ i.jsx(
|
|
1979
|
+
"path",
|
|
1980
|
+
{
|
|
1981
|
+
fillRule: "evenodd",
|
|
1982
|
+
clipRule: "evenodd",
|
|
1983
|
+
d: "M13.25 2.25C13.6642 2.25 14 2.58579 14 3C14 3.41421 13.6642 3.75 13.25 3.75H8.25C7.38805 3.75 6.5614 4.09241 5.9519 4.7019C5.34241 5.3114 5 6.13805 5 7V17C5 17.862 5.34241 18.6886 5.9519 19.2981C6.5614 19.9076 7.38805 20.25 8.25 20.25H13.25C13.6642 20.25 14 20.5858 14 21C14 21.4142 13.6642 21.75 13.25 21.75H8.25C6.99022 21.75 5.78204 21.2496 4.89124 20.3588C4.00045 19.468 3.5 18.2598 3.5 17V7C3.5 5.74022 4.00045 4.53204 4.89124 3.64124C5.78204 2.75044 6.99022 2.25 8.25 2.25H13.25ZM15.7197 8.46967C16.0126 8.17678 16.4874 8.17678 16.7803 8.46967L19.7803 11.4697C20.0732 11.7626 20.0732 12.2374 19.7803 12.5303L16.7803 15.5303C16.4874 15.8232 16.0126 15.8232 15.7197 15.5303C15.4268 15.2374 15.4268 14.7626 15.7197 14.4697L17.4393 12.75L10.25 12.75C9.83579 12.75 9.5 12.4142 9.5 12C9.5 11.5858 9.83579 11.25 10.25 11.25L17.4393 11.25L15.7197 9.53033C15.4268 9.23744 15.4268 8.76256 15.7197 8.46967Z",
|
|
1984
|
+
fill: "currentColor"
|
|
1985
|
+
}
|
|
1986
|
+
)
|
|
1987
|
+
})
|
|
1988
|
+
), Gr = Kr, qr = (t) => /* @__PURE__ */ i.jsxs(
|
|
1989
|
+
"svg",
|
|
1990
|
+
A(x({
|
|
1991
|
+
width: "24",
|
|
1992
|
+
height: "24",
|
|
1993
|
+
fill: "none",
|
|
1994
|
+
viewBox: "0 0 24 24",
|
|
1995
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1996
|
+
}, t), {
|
|
1997
|
+
children: [
|
|
1998
|
+
/* @__PURE__ */ i.jsxs("g", { clipPath: "url(#clip0_19_444)", children: [
|
|
1999
|
+
/* @__PURE__ */ i.jsx(
|
|
2000
|
+
"path",
|
|
2001
|
+
{
|
|
2002
|
+
d: "M17 21H7V21C5.89543 21 5 20.1046 5 19V12V12C5 10.8954 5.89543 10 7 10H17V10C18.1046 10 19 10.8954 19 12V19V19C19 20.1046 18.1046 21 17 21C17 21 17 21 17 21V21Z",
|
|
2003
|
+
stroke: "currentColor",
|
|
2004
|
+
strokeWidth: "1.5",
|
|
2005
|
+
strokeLinecap: "round",
|
|
2006
|
+
strokeLinejoin: "round"
|
|
2007
|
+
}
|
|
2008
|
+
),
|
|
2009
|
+
/* @__PURE__ */ i.jsx("circle", { cx: "10.3", cy: "15.5", r: "0.8", fill: "currentColor" }),
|
|
2010
|
+
/* @__PURE__ */ i.jsx("circle", { cx: "13.7", cy: "15.5", r: "0.8", fill: "currentColor" }),
|
|
2011
|
+
/* @__PURE__ */ i.jsx(
|
|
2012
|
+
"path",
|
|
2013
|
+
{
|
|
2014
|
+
d: "M8 10V7V7C8 4.79086 9.79086 3 12 3V3C14.2091 3 16 4.79086 16 7V10",
|
|
2015
|
+
stroke: "currentColor",
|
|
2016
|
+
strokeWidth: "1.5",
|
|
2017
|
+
strokeLinecap: "round",
|
|
2018
|
+
strokeLinejoin: "round"
|
|
2019
|
+
}
|
|
2020
|
+
)
|
|
2021
|
+
] }),
|
|
2022
|
+
/* @__PURE__ */ i.jsx("defs", { children: /* @__PURE__ */ i.jsx("clipPath", { id: "clip0_19_444", children: /* @__PURE__ */ i.jsx("rect", { width: "24", height: "24", fill: "white" }) }) })
|
|
2023
|
+
]
|
|
2024
|
+
})
|
|
2025
|
+
), Wr = qr, Vr = (t) => /* @__PURE__ */ i.jsxs(
|
|
2026
|
+
"svg",
|
|
2027
|
+
A(x({
|
|
2028
|
+
width: "24",
|
|
2029
|
+
height: "24",
|
|
2030
|
+
viewBox: "0 0 24 24",
|
|
2031
|
+
fill: "none",
|
|
2032
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2033
|
+
}, t), {
|
|
2034
|
+
children: [
|
|
2035
|
+
/* @__PURE__ */ i.jsx(
|
|
2036
|
+
"path",
|
|
2037
|
+
{
|
|
2038
|
+
d: "M14.4749 4.52513C15.8418 5.89197 15.8418 8.10804 14.4749 9.47488C13.1081 10.8417 10.892 10.8417 9.52516 9.47488C8.15832 8.10804 8.15832 5.89197 9.52516 4.52513C10.892 3.15829 13.1081 3.15829 14.4749 4.52513",
|
|
2039
|
+
stroke: "currentColor",
|
|
2040
|
+
strokeWidth: "1.5",
|
|
2041
|
+
strokeLinecap: "round",
|
|
2042
|
+
strokeLinejoin: "round"
|
|
2043
|
+
}
|
|
2044
|
+
),
|
|
2045
|
+
/* @__PURE__ */ i.jsx(
|
|
2046
|
+
"path",
|
|
2047
|
+
{
|
|
2048
|
+
d: "M4 18.5V19.5C4 20.052 4.448 20.5 5 20.5H19C19.552 20.5 20 20.052 20 19.5V18.5C20 15.474 16.048 13.508 12 13.508C7.952 13.508 4 15.474 4 18.5Z",
|
|
2049
|
+
stroke: "currentColor",
|
|
2050
|
+
strokeWidth: "1.5",
|
|
2051
|
+
strokeLinecap: "round",
|
|
2052
|
+
strokeLinejoin: "round"
|
|
2053
|
+
}
|
|
2054
|
+
)
|
|
2055
|
+
]
|
|
2056
|
+
})
|
|
2057
|
+
), $r = Vr, Zr = (t) => /* @__PURE__ */ i.jsxs(
|
|
2058
|
+
"svg",
|
|
2059
|
+
A(x({
|
|
2060
|
+
width: "24",
|
|
2061
|
+
height: "24",
|
|
2062
|
+
viewBox: "0 0 24 24",
|
|
2063
|
+
fill: "none",
|
|
2064
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2065
|
+
}, t), {
|
|
2066
|
+
children: [
|
|
2067
|
+
/* @__PURE__ */ i.jsx(
|
|
2068
|
+
"path",
|
|
2069
|
+
{
|
|
2070
|
+
d: "M14.4749 4.52513C15.8418 5.89197 15.8418 8.10804 14.4749 9.47488C13.1081 10.8417 10.892 10.8417 9.52516 9.47488C8.15832 8.10804 8.15832 5.89197 9.52516 4.52513C10.892 3.15829 13.1081 3.15829 14.4749 4.52513",
|
|
2071
|
+
stroke: "currentColor",
|
|
2072
|
+
strokeWidth: "1.5",
|
|
2073
|
+
strokeLinecap: "round",
|
|
2074
|
+
strokeLinejoin: "round"
|
|
2075
|
+
}
|
|
2076
|
+
),
|
|
2077
|
+
/* @__PURE__ */ i.jsx(
|
|
2078
|
+
"path",
|
|
2079
|
+
{
|
|
2080
|
+
d: "M13.5 20.5H10H5C4.448 20.5 4 20.052 4 19.5V18.5C4 15.9788 6.7434 14.1935 10 13.6679C10.6521 13.5627 11.3247 13.508 12 13.508C13.0272 13.508 14.0482 13.6346 15 13.873",
|
|
2081
|
+
stroke: "currentColor",
|
|
2082
|
+
strokeWidth: "1.5",
|
|
2083
|
+
strokeLinecap: "round",
|
|
2084
|
+
strokeLinejoin: "round"
|
|
2085
|
+
}
|
|
2086
|
+
),
|
|
2087
|
+
/* @__PURE__ */ i.jsx(
|
|
2088
|
+
"path",
|
|
2089
|
+
{
|
|
2090
|
+
d: "M17.5 16V18.0164V20",
|
|
2091
|
+
stroke: "currentColor",
|
|
2092
|
+
strokeWidth: "1.5",
|
|
2093
|
+
strokeLinecap: "round",
|
|
2094
|
+
strokeLinejoin: "round"
|
|
2095
|
+
}
|
|
2096
|
+
),
|
|
2097
|
+
/* @__PURE__ */ i.jsx(
|
|
2098
|
+
"path",
|
|
2099
|
+
{
|
|
2100
|
+
d: "M19.5 18L17.4836 18L15.5 18",
|
|
2101
|
+
stroke: "currentColor",
|
|
2102
|
+
strokeWidth: "1.5",
|
|
2103
|
+
strokeLinecap: "round",
|
|
2104
|
+
strokeLinejoin: "round"
|
|
2105
|
+
}
|
|
2106
|
+
)
|
|
2107
|
+
]
|
|
2108
|
+
})
|
|
2109
|
+
), Yr = Zr, zr = (t) => {
|
|
2110
|
+
var e = t, { className: s } = e, r = F(e, ["className"]);
|
|
2111
|
+
return /* @__PURE__ */ i.jsxs(
|
|
2112
|
+
"svg",
|
|
2113
|
+
A(x({
|
|
2114
|
+
width: "20",
|
|
2115
|
+
height: "20",
|
|
2116
|
+
viewBox: "0 0 20 20",
|
|
2117
|
+
fill: "none",
|
|
2118
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2119
|
+
className: O("spinner", s)
|
|
2120
|
+
}, r), {
|
|
2121
|
+
children: [
|
|
2122
|
+
/* @__PURE__ */ i.jsx("circle", { cx: "10", cy: "10", r: "9", stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "1.5" }),
|
|
2123
|
+
/* @__PURE__ */ i.jsx(
|
|
2124
|
+
"circle",
|
|
2125
|
+
{
|
|
2126
|
+
cx: "10",
|
|
2127
|
+
cy: "10",
|
|
2128
|
+
r: "9",
|
|
2129
|
+
stroke: "currentColor",
|
|
2130
|
+
strokeWidth: "1.5",
|
|
2131
|
+
strokeLinecap: "round",
|
|
2132
|
+
strokeDasharray: "42.42 14.14"
|
|
2133
|
+
}
|
|
2134
|
+
)
|
|
2135
|
+
]
|
|
2136
|
+
})
|
|
2137
|
+
);
|
|
2138
|
+
}, Jr = zr, Xr = (t) => /* @__PURE__ */ i.jsxs(
|
|
2139
|
+
"svg",
|
|
2140
|
+
A(x({
|
|
2141
|
+
width: "24",
|
|
2142
|
+
height: "24",
|
|
2143
|
+
fill: "none",
|
|
2144
|
+
viewBox: "0 0 24 24",
|
|
2145
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2146
|
+
}, t), {
|
|
2147
|
+
children: [
|
|
2148
|
+
/* @__PURE__ */ i.jsxs("g", { clipPath: "url(#clip0_762_2934)", children: [
|
|
2149
|
+
/* @__PURE__ */ i.jsx(
|
|
2150
|
+
"path",
|
|
2151
|
+
{
|
|
2152
|
+
fillRule: "evenodd",
|
|
2153
|
+
clipRule: "evenodd",
|
|
2154
|
+
d: "M12.75 8.39996C12.75 7.98575 12.4142 7.64996 12 7.64996C11.5858 7.64996 11.25 7.98575 11.25 8.39996V11.669C11.25 12.0832 11.5858 12.419 12 12.419C12.4142 12.419 12.75 12.0832 12.75 11.669V8.39996ZM12.005 16.35C12.5159 16.35 12.93 15.9359 12.93 15.425C12.93 14.9141 12.5159 14.5 12.005 14.5C11.4942 14.5 11.08 14.9141 11.08 15.425C11.08 15.9359 11.4942 16.35 12.005 16.35Z",
|
|
2155
|
+
fill: "currentColor"
|
|
2156
|
+
}
|
|
2157
|
+
),
|
|
2158
|
+
/* @__PURE__ */ i.jsx(
|
|
2159
|
+
"path",
|
|
2160
|
+
{
|
|
2161
|
+
d: "M12 21C7.029 21 3 16.971 3 12C3 7.029 7.029 3 12 3C16.971 3 21 7.029 21 12C21 16.971 16.971 21 12 21Z",
|
|
2162
|
+
stroke: "currentColor",
|
|
2163
|
+
strokeWidth: "1.5",
|
|
2164
|
+
strokeLinecap: "round",
|
|
2165
|
+
strokeLinejoin: "round"
|
|
2166
|
+
}
|
|
2167
|
+
)
|
|
2168
|
+
] }),
|
|
2169
|
+
/* @__PURE__ */ i.jsx("defs", { children: /* @__PURE__ */ i.jsx("clipPath", { id: "clip0_762_2934", children: /* @__PURE__ */ i.jsx("rect", { width: "24", height: "24", fill: "white" }) }) })
|
|
2170
|
+
]
|
|
2171
|
+
})
|
|
2172
|
+
), Ir = Xr, Br = (t) => {
|
|
2173
|
+
const e = (s) => `${s}${t.suffix ? `_${t.suffix}` : ""}`;
|
|
2174
|
+
return /* @__PURE__ */ i.jsxs(
|
|
2175
|
+
"svg",
|
|
2176
|
+
A(x({
|
|
2177
|
+
width: "24",
|
|
2178
|
+
height: "24",
|
|
2179
|
+
viewBox: "0 0 24 24",
|
|
2180
|
+
fill: "none",
|
|
2181
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2182
|
+
}, t), {
|
|
2183
|
+
children: [
|
|
2184
|
+
/* @__PURE__ */ i.jsx(
|
|
2185
|
+
"path",
|
|
2186
|
+
{
|
|
2187
|
+
d: "M17.6214 11.1549C20.4161 8.33951 21.712 5.41047 20.6067 3.876C19.1586 1.85988 14.1278 2.98841 9.3766 6.39936C8.31103 7.15864 7.31229 8.00725 6.39122 8.93598L17.6214 11.1549Z",
|
|
2188
|
+
fill: e("url(#paint0")
|
|
2189
|
+
}
|
|
2190
|
+
),
|
|
2191
|
+
/* @__PURE__ */ i.jsx(
|
|
2192
|
+
"path",
|
|
2193
|
+
{
|
|
2194
|
+
opacity: "0.9",
|
|
2195
|
+
d: "M17.6214 11.1548C17.1178 9.955 16.5189 8.79735 15.8301 7.693C12.6925 2.58286 8.41126 -0.498612 6.30132 0.794902C4.66377 1.79657 4.80319 5.119 6.39145 8.93562L17.6214 11.1548Z",
|
|
2196
|
+
fill: e("url(#paint1")
|
|
2197
|
+
}
|
|
2198
|
+
),
|
|
2199
|
+
/* @__PURE__ */ i.jsx(
|
|
2200
|
+
"path",
|
|
2201
|
+
{
|
|
2202
|
+
d: "M6.39122 8.93591C6.89474 10.1357 7.49373 11.2934 8.18245 12.3977C11.3329 17.5079 15.6006 20.5894 17.7229 19.2958C19.3616 18.2942 19.221 14.9718 17.6339 11.1549L6.39122 8.93591Z",
|
|
2203
|
+
fill: e("url(#paint2")
|
|
2204
|
+
}
|
|
2205
|
+
),
|
|
2206
|
+
/* @__PURE__ */ i.jsx(
|
|
2207
|
+
"path",
|
|
2208
|
+
{
|
|
2209
|
+
opacity: "0.85",
|
|
2210
|
+
d: "M6.39113 8.93591C3.5836 11.7637 2.28796 14.6927 3.39319 16.2272C4.8413 18.2433 9.87186 17.1147 14.6224 13.7038C15.6888 12.9404 16.6916 12.0922 17.6213 11.1677L6.39113 8.93591Z",
|
|
2211
|
+
fill: e("url(#paint3")
|
|
2212
|
+
}
|
|
2213
|
+
),
|
|
2214
|
+
/* @__PURE__ */ i.jsx(
|
|
2215
|
+
"path",
|
|
2216
|
+
{
|
|
2217
|
+
opacity: "0.87",
|
|
2218
|
+
d: "M6.39113 8.93591C3.5836 11.7509 2.28796 14.6801 3.39319 16.2272C4.8413 18.2433 9.87186 17.1147 14.6224 13.7038C15.6888 12.9404 16.6916 12.0922 17.6213 11.1677L6.39113 8.93591Z",
|
|
2219
|
+
fill: e("url(#paint4")
|
|
2220
|
+
}
|
|
2221
|
+
),
|
|
2222
|
+
/* @__PURE__ */ i.jsx(
|
|
2223
|
+
"path",
|
|
2224
|
+
{
|
|
2225
|
+
d: "M12.0064 23.2897C16.2652 23.2897 19.7177 22.9093 19.7177 22.4402C19.7177 21.971 16.2652 21.5907 12.0064 21.5907C7.74761 21.5907 4.29517 21.971 4.29517 22.4402C4.29517 22.9093 7.74761 23.2897 12.0064 23.2897Z",
|
|
2226
|
+
fill: e("url(#paint5")
|
|
2227
|
+
}
|
|
2228
|
+
),
|
|
2229
|
+
/* @__PURE__ */ i.jsxs("defs", { children: [
|
|
2230
|
+
/* @__PURE__ */ i.jsxs(
|
|
2231
|
+
"linearGradient",
|
|
2232
|
+
{
|
|
2233
|
+
id: e("paint0"),
|
|
2234
|
+
x1: "10.6862",
|
|
2235
|
+
y1: "11.0225",
|
|
2236
|
+
x2: "14.9751",
|
|
2237
|
+
y2: "0.707188",
|
|
2238
|
+
gradientUnits: "userSpaceOnUse",
|
|
2239
|
+
children: [
|
|
2240
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.413", stopColor: "#90B117" }),
|
|
2241
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.501", stopColor: "#8BAF19" }),
|
|
2242
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.601", stopColor: "#7DAB1E" }),
|
|
2243
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.706", stopColor: "#67A325" }),
|
|
2244
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.815", stopColor: "#479830" }),
|
|
2245
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.925", stopColor: "#1F8A3E" }),
|
|
2246
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "1", stopColor: "#007F48" })
|
|
2247
|
+
]
|
|
2248
|
+
}
|
|
2249
|
+
),
|
|
2250
|
+
/* @__PURE__ */ i.jsxs(
|
|
2251
|
+
"linearGradient",
|
|
2252
|
+
{
|
|
2253
|
+
id: e("paint1"),
|
|
2254
|
+
x1: "11.5281",
|
|
2255
|
+
y1: "8.85339",
|
|
2256
|
+
x2: "12.4519",
|
|
2257
|
+
y2: "1.60772",
|
|
2258
|
+
gradientUnits: "userSpaceOnUse",
|
|
2259
|
+
children: [
|
|
2260
|
+
/* @__PURE__ */ i.jsx("stop", { stopColor: "#36BCEE" }),
|
|
2261
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.201", stopColor: "#31ACE3" }),
|
|
2262
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.59", stopColor: "#2583C5" }),
|
|
2263
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "1", stopColor: "#1652A1" })
|
|
2264
|
+
]
|
|
2265
|
+
}
|
|
2266
|
+
),
|
|
2267
|
+
/* @__PURE__ */ i.jsxs(
|
|
2268
|
+
"linearGradient",
|
|
2269
|
+
{
|
|
2270
|
+
id: e("paint2"),
|
|
2271
|
+
x1: "15.0651",
|
|
2272
|
+
y1: "18.7384",
|
|
2273
|
+
x2: "12.9747",
|
|
2274
|
+
y2: "8.0336",
|
|
2275
|
+
gradientUnits: "userSpaceOnUse",
|
|
2276
|
+
children: [
|
|
2277
|
+
/* @__PURE__ */ i.jsx("stop", { stopColor: "#E42313" }),
|
|
2278
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.071", stopColor: "#E73611" }),
|
|
2279
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.312", stopColor: "#F0710B" }),
|
|
2280
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.534", stopColor: "#F6A006" }),
|
|
2281
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.73", stopColor: "#FBC103" }),
|
|
2282
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.891", stopColor: "#FED601" }),
|
|
2283
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.999", stopColor: "#FFDD00" })
|
|
2284
|
+
]
|
|
2285
|
+
}
|
|
2286
|
+
),
|
|
2287
|
+
/* @__PURE__ */ i.jsxs(
|
|
2288
|
+
"linearGradient",
|
|
2289
|
+
{
|
|
2290
|
+
id: e("paint3"),
|
|
2291
|
+
x1: "13.9806",
|
|
2292
|
+
y1: "8.29749",
|
|
2293
|
+
x2: "10.8203",
|
|
2294
|
+
y2: "18.1127",
|
|
2295
|
+
gradientUnits: "userSpaceOnUse",
|
|
2296
|
+
children: [
|
|
2297
|
+
/* @__PURE__ */ i.jsx("stop", { stopColor: "#FFC832" }),
|
|
2298
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.354", stopColor: "#F8A220" }),
|
|
2299
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.779", stopColor: "#F07A0D" }),
|
|
2300
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "1", stopColor: "#ED6B06" })
|
|
2301
|
+
]
|
|
2302
|
+
}
|
|
2303
|
+
),
|
|
2304
|
+
/* @__PURE__ */ i.jsxs(
|
|
2305
|
+
"linearGradient",
|
|
2306
|
+
{
|
|
2307
|
+
id: e("paint4"),
|
|
2308
|
+
x1: "13.9806",
|
|
2309
|
+
y1: "8.2892",
|
|
2310
|
+
x2: "10.8212",
|
|
2311
|
+
y2: "18.1113",
|
|
2312
|
+
gradientUnits: "userSpaceOnUse",
|
|
2313
|
+
children: [
|
|
2314
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.461", stopColor: "#F3C636", stopOpacity: "0" }),
|
|
2315
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.645", stopColor: "#F1A223", stopOpacity: "0.341" }),
|
|
2316
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.879", stopColor: "#EE7A0E", stopOpacity: "0.776" }),
|
|
2317
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "1", stopColor: "#ED6B06" })
|
|
2318
|
+
]
|
|
2319
|
+
}
|
|
2320
|
+
),
|
|
2321
|
+
/* @__PURE__ */ i.jsxs(
|
|
2322
|
+
"radialGradient",
|
|
2323
|
+
{
|
|
2324
|
+
id: e("paint5"),
|
|
2325
|
+
cx: "0",
|
|
2326
|
+
cy: "0",
|
|
2327
|
+
r: "1",
|
|
2328
|
+
gradientUnits: "userSpaceOnUse",
|
|
2329
|
+
gradientTransform: "translate(11.9404 22.4736) scale(7.73227 0.851796)",
|
|
2330
|
+
children: [
|
|
2331
|
+
/* @__PURE__ */ i.jsx("stop", { stopColor: "#C9C9C9" }),
|
|
2332
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.302", stopColor: "#CCCCCC", stopOpacity: "0.698" }),
|
|
2333
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.554", stopColor: "#D7D7D7", stopOpacity: "0.447" }),
|
|
2334
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "0.787", stopColor: "#E8E8E8", stopOpacity: "0.212" }),
|
|
2335
|
+
/* @__PURE__ */ i.jsx("stop", { offset: "1", stopColor: "white", stopOpacity: "0" })
|
|
2336
|
+
]
|
|
2337
|
+
}
|
|
2338
|
+
)
|
|
2339
|
+
] })
|
|
2340
|
+
]
|
|
2341
|
+
})
|
|
2342
|
+
);
|
|
2343
|
+
}, gs = Br, ti = (t) => /* @__PURE__ */ i.jsxs(
|
|
2344
|
+
"svg",
|
|
2345
|
+
A(x({
|
|
2346
|
+
fill: "none",
|
|
2347
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2348
|
+
viewBox: "0 0 24 24",
|
|
2349
|
+
width: "24",
|
|
2350
|
+
height: "24"
|
|
2351
|
+
}, t), {
|
|
2352
|
+
children: [
|
|
2353
|
+
/* @__PURE__ */ i.jsx(
|
|
2354
|
+
"path",
|
|
2355
|
+
{
|
|
2356
|
+
d: "M16 3H8C5.23858 3 3 5.23858 3 8V16C3 18.7614 5.23858 21 8 21H16C18.7614 21 21 18.7614 21 16V8C21 5.23858 18.7614 3 16 3Z",
|
|
2357
|
+
stroke: "currentColor",
|
|
2358
|
+
strokeWidth: "1.5",
|
|
2359
|
+
strokeLinecap: "round",
|
|
2360
|
+
strokeLinejoin: "round"
|
|
2361
|
+
}
|
|
2362
|
+
),
|
|
2363
|
+
/* @__PURE__ */ i.jsx(
|
|
2364
|
+
"path",
|
|
2365
|
+
{
|
|
2366
|
+
d: "M12.001 11.258C12.001 8.906 13.634 7 15.648 7C16.515 7 17.218 7.703 17.218 8.57C17.218 10.464 14.881 12 11.999 12C9.117 12 6.78 10.465 6.78 8.57C6.78 7.703 7.483 7 8.351 7C10.365 7 11.998 8.906 11.998 11.258",
|
|
2367
|
+
stroke: "currentColor",
|
|
2368
|
+
strokeWidth: "1.5",
|
|
2369
|
+
strokeLinecap: "round",
|
|
2370
|
+
strokeLinejoin: "round"
|
|
2371
|
+
}
|
|
2372
|
+
),
|
|
2373
|
+
/* @__PURE__ */ i.jsx(
|
|
2374
|
+
"path",
|
|
2375
|
+
{
|
|
2376
|
+
d: "M8 15.854C10.208 15.854 11.998 13.764 11.998 11.186L12.002 11.2C12.002 13.778 13.792 15.868 16 15.868",
|
|
2377
|
+
stroke: "currentColor",
|
|
2378
|
+
strokeWidth: "1.5",
|
|
2379
|
+
strokeLinecap: "round",
|
|
2380
|
+
strokeLinejoin: "round"
|
|
2381
|
+
}
|
|
2382
|
+
),
|
|
2383
|
+
/* @__PURE__ */ i.jsx(
|
|
2384
|
+
"path",
|
|
2385
|
+
{
|
|
2386
|
+
d: "M12 3V21",
|
|
2387
|
+
stroke: "currentColor",
|
|
2388
|
+
strokeWidth: "1.5",
|
|
2389
|
+
strokeLinecap: "round",
|
|
2390
|
+
strokeLinejoin: "round"
|
|
2391
|
+
}
|
|
2392
|
+
),
|
|
2393
|
+
/* @__PURE__ */ i.jsx(
|
|
2394
|
+
"path",
|
|
2395
|
+
{
|
|
2396
|
+
d: "M21 12H3",
|
|
2397
|
+
stroke: "currentColor",
|
|
2398
|
+
strokeWidth: "1.5",
|
|
2399
|
+
strokeLinecap: "round",
|
|
2400
|
+
strokeLinejoin: "round"
|
|
2401
|
+
}
|
|
2402
|
+
)
|
|
2403
|
+
]
|
|
2404
|
+
})
|
|
2405
|
+
), ei = ti, si = (t) => /* @__PURE__ */ i.jsx(
|
|
2406
|
+
"svg",
|
|
2407
|
+
A(x({
|
|
2408
|
+
fill: "none",
|
|
2409
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2410
|
+
viewBox: "0 0 21 16",
|
|
2411
|
+
width: "21",
|
|
2412
|
+
height: "16"
|
|
2413
|
+
}, t), {
|
|
2414
|
+
children: /* @__PURE__ */ i.jsx(
|
|
2415
|
+
"path",
|
|
2416
|
+
{
|
|
2417
|
+
d: "M1.5 5h18M8.07 9H5.5M16.5 15h-12a3 3 0 0 1-3-3V4a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3Z",
|
|
2418
|
+
stroke: "currentcolor",
|
|
2419
|
+
strokeWidth: "1.5",
|
|
2420
|
+
strokeLinecap: "round",
|
|
2421
|
+
strokeLinejoin: "round"
|
|
2422
|
+
}
|
|
2423
|
+
)
|
|
2424
|
+
})
|
|
2425
|
+
), ri = si, ii = (t) => /* @__PURE__ */ i.jsxs(
|
|
2426
|
+
"svg",
|
|
2427
|
+
A(x({
|
|
2428
|
+
width: "24",
|
|
2429
|
+
height: "24",
|
|
2430
|
+
fill: "none",
|
|
2431
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2432
|
+
viewBox: "0 0 24 24"
|
|
2433
|
+
}, t), {
|
|
2434
|
+
children: [
|
|
2435
|
+
/* @__PURE__ */ i.jsx(
|
|
2436
|
+
"path",
|
|
2437
|
+
{
|
|
2438
|
+
d: "M3 3h6v6H3V3ZM2.8 14.8h6v6h-6v-6ZM20.8 8.8h-6v-6h6v6Z",
|
|
2439
|
+
strokeWidth: "1.5",
|
|
2440
|
+
strokeLinecap: "round",
|
|
2441
|
+
strokeLinejoin: "round",
|
|
2442
|
+
stroke: "currentColor"
|
|
2443
|
+
}
|
|
2444
|
+
),
|
|
2445
|
+
/* @__PURE__ */ i.jsx("circle", { r: ".8", transform: "matrix(1 0 0 -1 14.8 14.7)", fill: "currentColor" }),
|
|
2446
|
+
/* @__PURE__ */ i.jsx("circle", { r: ".8", transform: "matrix(1 0 0 -1 20.8 14.7)", fill: "currentColor" }),
|
|
2447
|
+
/* @__PURE__ */ i.jsx("circle", { r: ".8", transform: "matrix(1 0 0 -1 17.8 17.7)", fill: "currentColor" }),
|
|
2448
|
+
/* @__PURE__ */ i.jsx("circle", { r: ".8", transform: "matrix(1 0 0 -1 14.8 20.7)", fill: "currentColor" }),
|
|
2449
|
+
/* @__PURE__ */ i.jsx("circle", { r: ".8", transform: "matrix(1 0 0 -1 20.8 20.7)", fill: "currentColor" })
|
|
2450
|
+
]
|
|
2451
|
+
})
|
|
2452
|
+
), ni = ii, ai = (t) => {
|
|
2453
|
+
var e = t, {
|
|
2454
|
+
variant: s,
|
|
2455
|
+
icon: r,
|
|
2456
|
+
isStandalone: a,
|
|
2457
|
+
title: l,
|
|
2458
|
+
description: o,
|
|
2459
|
+
className: c
|
|
2460
|
+
} = e, v = F(e, [
|
|
2461
|
+
"variant",
|
|
2462
|
+
"icon",
|
|
2463
|
+
"isStandalone",
|
|
2464
|
+
"title",
|
|
2465
|
+
"description",
|
|
2466
|
+
"className"
|
|
2467
|
+
]);
|
|
2468
|
+
return /* @__PURE__ */ i.jsx(
|
|
2469
|
+
"div",
|
|
2470
|
+
A(x({}, v), {
|
|
2471
|
+
className: O(
|
|
2472
|
+
"card__empty-state",
|
|
2473
|
+
s === "error" && "card__empty-state--error",
|
|
2474
|
+
a && "card__empty-state--standalone",
|
|
2475
|
+
c
|
|
2476
|
+
),
|
|
2477
|
+
children: /* @__PURE__ */ i.jsxs("div", { className: "card__empty-state__wrapper", children: [
|
|
2478
|
+
/* @__PURE__ */ i.jsx("i", { className: "card__empty-state__icon", "aria-hidden": !0, children: s === "error" ? /* @__PURE__ */ i.jsx(Ir, {}) : r }),
|
|
2479
|
+
/* @__PURE__ */ i.jsxs("div", { className: "card__empty-state__content", children: [
|
|
2480
|
+
/* @__PURE__ */ i.jsx("p", { className: "card__empty-state__title", children: l }),
|
|
2481
|
+
/* @__PURE__ */ i.jsx("p", { className: "card__empty-state__description", children: o })
|
|
2482
|
+
] })
|
|
2483
|
+
] })
|
|
2484
|
+
})
|
|
2485
|
+
);
|
|
2486
|
+
}, oi = ({ children: t }) => /* @__PURE__ */ i.jsx("div", { className: "card__footer", children: t }), li = (t) => {
|
|
2487
|
+
var e = t, {
|
|
2488
|
+
variant: s = "default",
|
|
2489
|
+
sticky: r,
|
|
2490
|
+
className: a,
|
|
2491
|
+
children: l
|
|
2492
|
+
} = e, o = F(e, [
|
|
2493
|
+
"variant",
|
|
2494
|
+
"sticky",
|
|
2495
|
+
"className",
|
|
2496
|
+
"children"
|
|
2497
|
+
]);
|
|
2498
|
+
return /* @__PURE__ */ i.jsx(
|
|
2499
|
+
"div",
|
|
2500
|
+
A(x({}, o), {
|
|
2501
|
+
className: O(
|
|
2502
|
+
"card__header",
|
|
2503
|
+
s && `card__header--${s}`,
|
|
2504
|
+
r && "card__header--sticky",
|
|
2505
|
+
a
|
|
2506
|
+
),
|
|
2507
|
+
children: l
|
|
2508
|
+
})
|
|
2509
|
+
);
|
|
2510
|
+
}, ci = ({ children: t }) => /* @__PURE__ */ i.jsx("div", { className: "card__image", children: t }), ui = ({ children: t, className: e }) => /* @__PURE__ */ i.jsx("div", { className: O("card__body__item", e), children: t }), hi = ({ children: t }) => /* @__PURE__ */ i.jsx("div", { className: "card__body__subtitle", children: t }), di = ({ icon: t, children: e }) => /* @__PURE__ */ i.jsxs("div", { className: "card__header__title", children: [
|
|
2511
|
+
t && /* @__PURE__ */ i.jsx("span", { className: "card__header__title__icon", children: t }),
|
|
2512
|
+
e
|
|
2513
|
+
] }), ys = f.forwardRef(
|
|
2514
|
+
(t, e) => {
|
|
2515
|
+
var s = t, { type: r, children: a, className: l, variant: o = "default", disabled: c = !1 } = s, v = F(s, ["type", "children", "className", "variant", "disabled"]);
|
|
2516
|
+
return f.createElement(
|
|
2517
|
+
r,
|
|
2518
|
+
x({
|
|
2519
|
+
className: O(
|
|
2520
|
+
"card",
|
|
2521
|
+
c && "card--disabled",
|
|
2522
|
+
o && `card--${o}`,
|
|
2523
|
+
l
|
|
2524
|
+
),
|
|
2525
|
+
ref: e
|
|
2526
|
+
}, v),
|
|
2527
|
+
a
|
|
2528
|
+
);
|
|
2529
|
+
}
|
|
2530
|
+
);
|
|
2531
|
+
ys.displayName = "Card";
|
|
2532
|
+
Object.assign(ys, {
|
|
2533
|
+
Header: li,
|
|
2534
|
+
Action: Or,
|
|
2535
|
+
Title: di,
|
|
2536
|
+
Subtitle: hi,
|
|
2537
|
+
Body: Rr,
|
|
2538
|
+
Image: ci,
|
|
2539
|
+
Item: ui,
|
|
2540
|
+
Footer: oi,
|
|
2541
|
+
EmptyState: ai
|
|
2542
|
+
});
|
|
2543
|
+
var fi = (t) => {
|
|
2544
|
+
var e = t, { className: s, children: r } = e, a = F(e, ["className", "children"]);
|
|
2545
|
+
return /* @__PURE__ */ i.jsx("div", A(x({ className: O("checkbox__content", s) }, a), { children: r }));
|
|
2546
|
+
}, pi = (t) => {
|
|
2547
|
+
var e = t, { className: s, children: r } = e, a = F(e, ["className", "children"]);
|
|
2548
|
+
return /* @__PURE__ */ i.jsx("span", A(x({ className: O("checkbox__hint", s) }, a), { children: r }));
|
|
2549
|
+
}, Cs = f.createContext(void 0), mi = ({ id: t, name: e, children: s }) => /* @__PURE__ */ i.jsx(Cs.Provider, { value: { id: t, name: e }, children: s }), vi = () => {
|
|
2550
|
+
const t = f.useContext(Cs);
|
|
2551
|
+
if (!t)
|
|
2552
|
+
throw new Error("Checkbox compound components can not be rendered outside of Checkbox");
|
|
2553
|
+
return t;
|
|
2554
|
+
}, gi = (t) => {
|
|
2555
|
+
var e = t, { className: s, children: r } = e, a = F(e, ["className", "children"]);
|
|
2556
|
+
const { id: l } = vi();
|
|
2557
|
+
return /* @__PURE__ */ i.jsx("label", A(x({ htmlFor: l, className: O("checkbox__label", s) }, a), { children: r }));
|
|
2558
|
+
}, wt = (t) => {
|
|
2559
|
+
var e = t, {
|
|
2560
|
+
id: s,
|
|
2561
|
+
name: r,
|
|
2562
|
+
isPending: a = !1,
|
|
2563
|
+
variant: l = "neutral",
|
|
2564
|
+
hasError: o = !1,
|
|
2565
|
+
single: c,
|
|
2566
|
+
className: v,
|
|
2567
|
+
children: g
|
|
2568
|
+
} = e, h = F(e, [
|
|
2569
|
+
"id",
|
|
2570
|
+
"name",
|
|
2571
|
+
"isPending",
|
|
2572
|
+
"variant",
|
|
2573
|
+
"hasError",
|
|
2574
|
+
"single",
|
|
2575
|
+
"className",
|
|
2576
|
+
"children"
|
|
2577
|
+
]);
|
|
2578
|
+
const u = f.useRef(null);
|
|
2579
|
+
return f.useEffect(() => {
|
|
2580
|
+
u.current && (a ? u.current.indeterminate = !0 : u.current.indeterminate = !1);
|
|
2581
|
+
}, [a]), /* @__PURE__ */ i.jsxs(
|
|
2582
|
+
"div",
|
|
2583
|
+
{
|
|
2584
|
+
className: O("checkbox", l && `checkbox--${l}`, o && "checkbox--error"),
|
|
2585
|
+
children: [
|
|
2586
|
+
/* @__PURE__ */ i.jsx(
|
|
2587
|
+
"input",
|
|
2588
|
+
x({
|
|
2589
|
+
id: s,
|
|
2590
|
+
name: r,
|
|
2591
|
+
type: "checkbox",
|
|
2592
|
+
ref: u,
|
|
2593
|
+
className: O("checkbox__input", v),
|
|
2594
|
+
value: c ? "true" : ""
|
|
2595
|
+
}, h)
|
|
2596
|
+
),
|
|
2597
|
+
a ? /* @__PURE__ */ i.jsx(Jr, { className: "checkbox__spinner", "aria-hidden": !0 }) : /* @__PURE__ */ i.jsx(Dr, { className: "checkbox__check", "aria-hidden": !0, strokeDasharray: "75" }),
|
|
2598
|
+
/* @__PURE__ */ i.jsx(mi, { id: s, name: r, children: g })
|
|
2599
|
+
]
|
|
2600
|
+
}
|
|
2601
|
+
);
|
|
2602
|
+
};
|
|
2603
|
+
wt.Content = fi;
|
|
2604
|
+
wt.Label = gi;
|
|
2605
|
+
wt.Hint = pi;
|
|
2606
|
+
wt.Error = Error;
|
|
2607
|
+
var yi = (t) => {
|
|
2608
|
+
var e = t, { type: s = "div", className: r, children: a } = e, l = F(e, ["type", "className", "children"]);
|
|
2609
|
+
return f.createElement(s, x({ className: O("dialog__body", r) }, l), a);
|
|
2610
|
+
}, ye = () => document.body.style.removeProperty("overflow"), De = (t) => t.preventDefault(), Ci = 'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])', xi = (t) => {
|
|
2611
|
+
var e = t, { className: s, children: r, shouldAnimate: a = !0 } = e, l = F(e, ["className", "children", "shouldAnimate"]);
|
|
2612
|
+
const { ref: o, defaultOpen: c, isModal: v, onClose: g } = Yt();
|
|
2613
|
+
return f.useEffect(() => {
|
|
2614
|
+
const h = o == null ? void 0 : o.current;
|
|
2615
|
+
if (h != null && h.open) {
|
|
2616
|
+
const u = h.querySelectorAll(Ci), d = u[0], m = u[u.length - 1], S = (P) => {
|
|
2617
|
+
if (!(P.key === "Tab"))
|
|
2618
|
+
return;
|
|
2619
|
+
P.shiftKey ? document.activeElement === d && (m.focus(), P.preventDefault()) : document.activeElement === m && (d.focus(), P.preventDefault());
|
|
2620
|
+
};
|
|
2621
|
+
return document.body.style.overflow = "hidden", h.addEventListener("keydown", S), window.addEventListener("popstate", () => ye()), () => {
|
|
2622
|
+
h.removeEventListener("keydown", S), window.removeEventListener("popstate", () => ye());
|
|
2623
|
+
};
|
|
2624
|
+
}
|
|
2625
|
+
}, [o]), f.useEffect(() => {
|
|
2626
|
+
const h = o == null ? void 0 : o.current;
|
|
2627
|
+
if (!h)
|
|
2628
|
+
return;
|
|
2629
|
+
if (c && (h.removeAttribute("open"), h.showModal(), h.focus()), v)
|
|
2630
|
+
return h.addEventListener("cancel", De), () => h.removeEventListener("cancel", De);
|
|
2631
|
+
const u = ({ clientX: d, clientY: m }) => {
|
|
2632
|
+
const { top: S, right: P, bottom: k, left: C } = h.getBoundingClientRect(), w = 0 < m && 0 < d, j = S < m && m < k, M = C < d && d < P;
|
|
2633
|
+
w && !(j && M) && g();
|
|
2634
|
+
};
|
|
2635
|
+
return h.addEventListener("cancel", g), h.addEventListener("mousedown", u), () => {
|
|
2636
|
+
h.removeEventListener("cancel", g), h.removeEventListener("mousedown", u);
|
|
2637
|
+
};
|
|
2638
|
+
}, [o, v, g, c]), /* @__PURE__ */ i.jsx(
|
|
2639
|
+
"dialog",
|
|
2640
|
+
A(x({
|
|
2641
|
+
ref: o,
|
|
2642
|
+
open: c,
|
|
2643
|
+
"aria-modal": !!v,
|
|
2644
|
+
"aria-labelledby": "dialogTitle",
|
|
2645
|
+
className: O("dialog", a && "dialog--animated", s)
|
|
2646
|
+
}, l), {
|
|
2647
|
+
children: r
|
|
2648
|
+
})
|
|
2649
|
+
);
|
|
2650
|
+
}, xs = f.createContext(void 0), bi = ({ defaultOpen: t, onClose: e, isModal: s, children: r }) => {
|
|
2651
|
+
const a = f.useRef(null), l = f.useRef(e), o = f.useCallback(() => {
|
|
2652
|
+
var c;
|
|
2653
|
+
ye(), (c = a.current) == null || c.close(), l.current && (l == null || l.current());
|
|
2654
|
+
}, [a]);
|
|
2655
|
+
return /* @__PURE__ */ i.jsx(xs.Provider, { value: { ref: a, defaultOpen: t, isModal: s, onClose: o }, children: r });
|
|
2656
|
+
}, Yt = () => {
|
|
2657
|
+
const t = f.useContext(xs);
|
|
2658
|
+
if (!t)
|
|
2659
|
+
throw new Error("Dialog compound components can not be rendered outside of Dialog");
|
|
2660
|
+
return t;
|
|
2661
|
+
}, wi = (t) => {
|
|
2662
|
+
var e = t, { children: s } = e, r = F(e, ["children"]);
|
|
2663
|
+
const { onClose: a } = Yt();
|
|
2664
|
+
return /* @__PURE__ */ i.jsx(Zt, A(x({ onClick: a }, r), { children: s }));
|
|
2665
|
+
}, bs = f.forwardRef((t, e) => {
|
|
2666
|
+
var s = t, { className: r } = s, a = F(s, ["className"]);
|
|
2667
|
+
const { onClose: l } = Yt();
|
|
2668
|
+
return /* @__PURE__ */ i.jsx(
|
|
2669
|
+
Zt,
|
|
2670
|
+
x({
|
|
2671
|
+
type: "submit",
|
|
2672
|
+
ref: e,
|
|
2673
|
+
formMethod: "dialog",
|
|
2674
|
+
onClick: l,
|
|
2675
|
+
iconLeft: /* @__PURE__ */ i.jsx(Ur, {}),
|
|
2676
|
+
variant: "icon--secondary",
|
|
2677
|
+
className: O("dialog__close button--icon", r)
|
|
2678
|
+
}, a)
|
|
2679
|
+
);
|
|
2680
|
+
});
|
|
2681
|
+
bs.displayName = "Close";
|
|
2682
|
+
var ji = (t) => {
|
|
2683
|
+
var e = t, { className: s, children: r } = e, a = F(e, ["className", "children"]);
|
|
2684
|
+
return /* @__PURE__ */ i.jsx("div", A(x({ className: O("dialog__footer", s) }, a), { children: r }));
|
|
2685
|
+
}, _i = ({ children: t }) => /* @__PURE__ */ i.jsx("div", { className: "dialog__header", children: t }), Si = (t) => {
|
|
2686
|
+
var e = t, { icon: s, children: r, className: a } = e, l = F(e, ["icon", "children", "className"]);
|
|
2687
|
+
const { ref: o } = Yt(), c = f.useRef(null);
|
|
2688
|
+
return f.useEffect(() => {
|
|
2689
|
+
o != null && o.current && o.current.focus();
|
|
2690
|
+
}, [o]), /* @__PURE__ */ i.jsxs(
|
|
2691
|
+
"div",
|
|
2692
|
+
A(x({
|
|
2693
|
+
tabIndex: 0,
|
|
2694
|
+
ref: c,
|
|
2695
|
+
id: "dialogTitle",
|
|
2696
|
+
className: O("dialog__header__title", a)
|
|
2697
|
+
}, l), {
|
|
2698
|
+
children: [
|
|
2699
|
+
s && /* @__PURE__ */ i.jsx("span", { className: "dialog__header__icon", children: s }),
|
|
2700
|
+
r
|
|
2701
|
+
]
|
|
2702
|
+
})
|
|
2703
|
+
);
|
|
2704
|
+
}, Ei = (t) => {
|
|
2705
|
+
var e = t, { children: s } = e, r = F(e, ["children"]);
|
|
2706
|
+
const { ref: a } = Yt();
|
|
2707
|
+
return /* @__PURE__ */ i.jsx(Zt, A(x({ onClick: () => {
|
|
2708
|
+
var l;
|
|
2709
|
+
return (l = a == null ? void 0 : a.current) == null ? void 0 : l.showModal();
|
|
2710
|
+
} }, r), { children: s }));
|
|
2711
|
+
}, G = ({ defaultOpen: t, isModal: e, children: s, onClose: r }) => /* @__PURE__ */ i.jsx(bi, { defaultOpen: !!t, isModal: e, onClose: r, children: s });
|
|
2712
|
+
G.Trigger = Ei;
|
|
2713
|
+
G.Root = xi;
|
|
2714
|
+
G.Title = Si;
|
|
2715
|
+
G.Header = _i;
|
|
2716
|
+
G.Body = yi;
|
|
2717
|
+
G.Footer = ji;
|
|
2718
|
+
G.Button = wi;
|
|
2719
|
+
G.Close = bs;
|
|
2720
|
+
var ws = f.createContext(void 0), Pi = ({
|
|
2721
|
+
id: t,
|
|
2722
|
+
position: e,
|
|
2723
|
+
isOpen: s,
|
|
2724
|
+
setIsOpen: r,
|
|
2725
|
+
activeItemIndex: a,
|
|
2726
|
+
setActiveItemIndex: l,
|
|
2727
|
+
clearActiveItemIndex: o,
|
|
2728
|
+
triggerRef: c,
|
|
2729
|
+
contentRef: v,
|
|
2730
|
+
children: g
|
|
2731
|
+
}) => /* @__PURE__ */ i.jsx(
|
|
2732
|
+
ws.Provider,
|
|
2733
|
+
{
|
|
2734
|
+
value: {
|
|
2735
|
+
id: t,
|
|
2736
|
+
position: e,
|
|
2737
|
+
isOpen: s,
|
|
2738
|
+
setIsOpen: r,
|
|
2739
|
+
activeItemIndex: a,
|
|
2740
|
+
setActiveItemIndex: l,
|
|
2741
|
+
clearActiveItemIndex: o,
|
|
2742
|
+
triggerRef: c,
|
|
2743
|
+
contentRef: v
|
|
2744
|
+
},
|
|
2745
|
+
children: g
|
|
2746
|
+
}
|
|
2747
|
+
), js = () => {
|
|
2748
|
+
const t = f.useContext(ws);
|
|
2749
|
+
if (t === void 0)
|
|
2750
|
+
throw new Error("useMenu must be used within a MenuProvider");
|
|
2751
|
+
return t;
|
|
2752
|
+
}, Ai = ({ as: t, children: e }) => {
|
|
2753
|
+
const {
|
|
2754
|
+
id: s,
|
|
2755
|
+
position: r,
|
|
2756
|
+
isOpen: a,
|
|
2757
|
+
setIsOpen: l,
|
|
2758
|
+
activeItemIndex: o,
|
|
2759
|
+
setActiveItemIndex: c,
|
|
2760
|
+
clearActiveItemIndex: v,
|
|
2761
|
+
triggerRef: g,
|
|
2762
|
+
contentRef: h
|
|
2763
|
+
} = js(), u = (d) => {
|
|
2764
|
+
var m;
|
|
2765
|
+
if (!a)
|
|
2766
|
+
return;
|
|
2767
|
+
if (d.key === "Escape")
|
|
2768
|
+
return v(), l(!1), (m = g.current) == null ? void 0 : m.focus();
|
|
2769
|
+
const S = d.shiftKey, P = Ss(h.current).length - 1;
|
|
2770
|
+
switch (d.key) {
|
|
2771
|
+
case "Tab": {
|
|
2772
|
+
if (S && o !== 0)
|
|
2773
|
+
return d.preventDefault(), c(o ? Math.max(0, o - 1) : 0);
|
|
2774
|
+
if (!S && o !== P) {
|
|
2775
|
+
d.preventDefault();
|
|
2776
|
+
const k = o !== void 0 ? o + 1 : 0;
|
|
2777
|
+
return c(Math.min(P, k));
|
|
2778
|
+
}
|
|
2779
|
+
break;
|
|
2780
|
+
}
|
|
2781
|
+
case "ArrowUp":
|
|
2782
|
+
case "ArrowLeft":
|
|
2783
|
+
return d.preventDefault(), c(o ? Math.max(0, o - 1) : 0);
|
|
2784
|
+
case "ArrowDown":
|
|
2785
|
+
case "ArrowRight": {
|
|
2786
|
+
d.preventDefault();
|
|
2787
|
+
const k = o !== void 0 ? o + 1 : 0;
|
|
2788
|
+
return c(Math.min(P, k));
|
|
2789
|
+
}
|
|
2790
|
+
case "Home":
|
|
2791
|
+
return d.preventDefault(), c(0);
|
|
2792
|
+
case "End":
|
|
2793
|
+
return d.preventDefault(), c(P);
|
|
2794
|
+
}
|
|
2795
|
+
};
|
|
2796
|
+
return t ? f.createElement(
|
|
2797
|
+
t,
|
|
2798
|
+
{
|
|
2799
|
+
id: `${s}-content`,
|
|
2800
|
+
ref: h,
|
|
2801
|
+
className: O("menu__list", `menu__list--${r}`, a && "menu__list--active"),
|
|
2802
|
+
onKeyDown: u
|
|
2803
|
+
},
|
|
2804
|
+
e
|
|
2805
|
+
) : (
|
|
2806
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
2807
|
+
/* @__PURE__ */ i.jsx(
|
|
2808
|
+
"ul",
|
|
2809
|
+
{
|
|
2810
|
+
id: `${s}-content`,
|
|
2811
|
+
ref: h,
|
|
2812
|
+
className: O("menu__list", `menu__list--${r}`, a && "menu__list--active"),
|
|
2813
|
+
onKeyDown: u,
|
|
2814
|
+
children: e
|
|
2815
|
+
}
|
|
2816
|
+
)
|
|
2817
|
+
);
|
|
2818
|
+
}, ki = (t) => {
|
|
2819
|
+
var e = t, { children: s, className: r } = e, a = F(e, ["children", "className"]);
|
|
2820
|
+
return /* @__PURE__ */ i.jsx("li", A(x({}, a), { className: O("menu__list-item", r), children: s }));
|
|
2821
|
+
}, _s = ({ children: t, className: e }) => {
|
|
2822
|
+
const { id: s, isOpen: r, setIsOpen: a, clearActiveItemIndex: l, setActiveItemIndex: o, triggerRef: c } = js(), v = () => {
|
|
2823
|
+
l(), a((h) => !h), r || o(0);
|
|
2824
|
+
}, g = (h) => {
|
|
2825
|
+
if (r) {
|
|
2826
|
+
if (h.key === "Escape")
|
|
2827
|
+
return l(), a(!1);
|
|
2828
|
+
h.key === "ArrowDown" && (h.preventDefault(), o(0));
|
|
2829
|
+
}
|
|
2830
|
+
};
|
|
2831
|
+
return f.cloneElement(t, {
|
|
2832
|
+
id: `${s}-trigger`,
|
|
2833
|
+
ref: c,
|
|
2834
|
+
className: O("menu__trigger", e),
|
|
2835
|
+
onClick: v,
|
|
2836
|
+
onKeyDown: g,
|
|
2837
|
+
"aria-expanded": r,
|
|
2838
|
+
"aria-controls": `${s}-content`
|
|
2839
|
+
});
|
|
2840
|
+
};
|
|
2841
|
+
_s.displayName = "Trigger";
|
|
2842
|
+
var Ss = (t) => t ? t.tagName === "UL" ? t.children : Array.from(t.getElementsByTagName("ul")).reduce((s, r) => [...s, ...Array.from(r.getElementsByTagName("li"))], []) : [], W = (t) => {
|
|
2843
|
+
var e = t, { type: s, id: r, position: a = "bottom-end", children: l, className: o } = e, c = F(e, ["type", "id", "position", "children", "className"]);
|
|
2844
|
+
const v = f.useRef(null), g = f.useRef(null), h = f.useRef(null), [u, d] = f.useState(!1), [m, S] = f.useState(), [P, k] = f.useState(m);
|
|
2845
|
+
m !== P && m !== void 0 && h.current && (Ss(h.current)[m].firstChild.focus(), k(m));
|
|
2846
|
+
const C = () => {
|
|
2847
|
+
S(void 0), k(void 0);
|
|
2848
|
+
}, w = (j) => {
|
|
2849
|
+
var M;
|
|
2850
|
+
((M = v.current) == null ? void 0 : M.contains(j.relatedTarget)) || (C(), d(!1));
|
|
2851
|
+
};
|
|
2852
|
+
return /* @__PURE__ */ i.jsx(
|
|
2853
|
+
Pi,
|
|
2854
|
+
{
|
|
2855
|
+
id: r,
|
|
2856
|
+
position: a,
|
|
2857
|
+
isOpen: u,
|
|
2858
|
+
setIsOpen: d,
|
|
2859
|
+
activeItemIndex: m,
|
|
2860
|
+
setActiveItemIndex: S,
|
|
2861
|
+
clearActiveItemIndex: C,
|
|
2862
|
+
triggerRef: g,
|
|
2863
|
+
contentRef: h,
|
|
2864
|
+
children: f.createElement(
|
|
2865
|
+
s,
|
|
2866
|
+
A(x({}, c), {
|
|
2867
|
+
id: r,
|
|
2868
|
+
ref: v,
|
|
2869
|
+
className: `menu ${o || ""}`,
|
|
2870
|
+
onBlur: w
|
|
2871
|
+
}),
|
|
2872
|
+
l
|
|
2873
|
+
)
|
|
2874
|
+
}
|
|
2875
|
+
);
|
|
2876
|
+
};
|
|
2877
|
+
W.Trigger = _s;
|
|
2878
|
+
W.Content = Ai;
|
|
2879
|
+
W.Item = ki;
|
|
2880
|
+
f.createContext(void 0);
|
|
2881
|
+
var Ni = (/* @__PURE__ */ new Map()).set("BE", "32").set("FR", "33").set("NL", "31").set("LU", "352").set("DE", "49").set("CA", "1").set("PR", "1").set("TC", "1").set("US", "1").set("BS", "1242").set("BB", "1246").set("AI", "1264").set("AG", "1268").set("KY", "1345").set("BM", "1441").set("GD", "1473").set("MS", "1664").set("GU", "1671").set("LC", "1758").set("DM", "1767").set("VC", "1784").set("DO", "1809").set("TT", "1868").set("KN", "1869").set("JM", "1876").set("EG", "20").set("SS", "211").set("MA", "212").set("DZ", "213").set("TN", "216").set("LY", "218").set("GM", "220").set("SN", "221").set("MR", "222").set("ML", "223").set("GN", "224").set("CI", "225").set("BF", "226").set("NE", "227").set("TG", "228").set("BJ", "229").set("MU", "230").set("LR", "231").set("SL", "232").set("GH", "233").set("NG", "234").set("TD", "235").set("CF", "236").set("CM", "237").set("CV", "238").set("ST", "239").set("GQ", "240").set("GA", "241").set("CG", "242").set("CD", "243").set("AO", "244").set("GW", "245").set("SC", "248").set("SD", "249").set("RW", "250").set("ET", "251").set("SO", "252").set("DJ", "253").set("KE", "254").set("TZ", "255").set("UG", "256").set("BI", "257").set("MZ", "258").set("ZM", "260").set("MG", "261").set("RE", "262").set("ZW", "263").set("NA", "264").set("MW", "265").set("LS", "266").set("BW", "267").set("SZ", "268").set("KM", "269").set("ZA", "27").set("VG", "284").set("ER", "291").set("AW", "297").set("FO", "298").set("GL", "299").set("GR", "30").set("ES", "34").set("GI", "350").set("PT", "351").set("IE", "353").set("IS", "354").set("AL", "355").set("MT", "356").set("CY", "357").set("FI", "358").set("BG", "359").set("HU", "36").set("LT", "370").set("LV", "371").set("EE", "372").set("MD", "373").set("AM", "374").set("BY", "375").set("AD", "376").set("MC", "377").set("SM", "378").set("UA", "380").set("RS", "381").set("ME", "382").set("HR", "385").set("SI", "386").set("BA", "387").set("MK", "389").set("IT", "39").set("RO", "40").set("CH", "41").set("CZ", "420").set("SK", "421").set("LI", "423").set("AT", "43").set("GB", "44").set("DK", "45").set("SE", "46").set("NO", "47").set("PL", "48").set("FK", "500").set("BZ", "501").set("GT", "502").set("SV", "503").set("HN", "504").set("NI", "505").set("CR", "506").set("PA", "507").set("PM", "508").set("HT", "509").set("PE", "51").set("MX", "52").set("CU", "53").set("AR", "54").set("BR", "55").set("CL", "56").set("CO", "57").set("VE", "58").set("GP", "590").set("BO", "591").set("GY", "592").set("EC", "593").set("FG", "594").set("PY", "595").set("MQ", "596").set("SR", "597").set("UY", "598").set("CW", "599").set("AN", "599").set("MY", "60").set("AU", "61").set("ID", "62").set("PH", "63").set("NZ", "64").set("SG", "65").set("TH", "66").set("TP", "670").set("BN", "673").set("PG", "675").set("TO", "676").set("SB", "677").set("VU", "678").set("FJ", "679").set("PW", "680").set("CK", "682").set("NU", "683").set("AS", "684").set("WS", "685").set("KI", "686").set("NC", "687").set("TV", "688").set("PF", "689").set("FM", "691").set("KZ", "7").set("RU", "7").set("JP", "81").set("KR", "82").set("VN", "84").set("KP", "850").set("HK", "852").set("MO", "853").set("KH", "855").set("LA", "856").set("CN", "86").set("BD", "880").set("TW", "886").set("TR", "90").set("IN", "91").set("PK", "92").set("AF", "93").set("LK", "94").set("MM", "95").set("MV", "960").set("LB", "961").set("JO", "962").set("SY", "963").set("IQ", "964").set("KW", "965").set("SA", "966").set("YE", "967").set("OM", "968").set("PS", "970").set("AE", "971").set("IL", "972").set("BH", "973").set("QA", "974").set("BT", "975").set("MN", "976").set("NP", "977").set("IR", "98").set("TK", "992").set("TM", "993").set("AZ", "994").set("GE", "995").set("KG", "996").set("UZ", "998");
|
|
2882
|
+
[...new Set(Ni.values())].map((t) => ({
|
|
2883
|
+
label: `+${t}`,
|
|
2884
|
+
value: t
|
|
2885
|
+
}));
|
|
2886
|
+
f.createContext(void 0);
|
|
2887
|
+
f.createContext(void 0);
|
|
2888
|
+
var ee = /* @__PURE__ */ ((t) => (t[t.categoriesVegetables = 0] = "categoriesVegetables", t[t.categoriesMeat = 1] = "categoriesMeat", t[t.categoriesFish = 2] = "categoriesFish", t[t.categoriesDairy = 3] = "categoriesDairy", t[t.categoriesBreakfast = 4] = "categoriesBreakfast", t[t.categoriesSnacks = 5] = "categoriesSnacks", t[t.categoriesCandy = 6] = "categoriesCandy", t[t.categoriesNonFood = 7] = "categoriesNonFood", t[t.categoriesDryFood = 8] = "categoriesDryFood", t[t.categoriesTins = 9] = "categoriesTins", t[t.categoriesGrid = 10] = "categoriesGrid", t[t.categoriesSoda = 11] = "categoriesSoda", t[t.categoriesBakery = 12] = "categoriesBakery", t[t.categoriesWine = 13] = "categoriesWine", t[t.categoriesBaby = 14] = "categoriesBaby", t[t.categoriesDiet = 15] = "categoriesDiet", t[t.categoriesHygiene = 16] = "categoriesHygiene", t[t.categoriesCleaning = 17] = "categoriesCleaning", t[t.categoriesPets = 18] = "categoriesPets", t[t.categoriesFreezer = 19] = "categoriesFreezer", t[t.categoriesBbq = 20] = "categoriesBbq", t[t.categoriesMealbox = 21] = "categoriesMealbox", t[t.categoriesBrik = 22] = "categoriesBrik", t[t.categoriesGranen = 23] = "categoriesGranen", t[t.categoriesConserve = 24] = "categoriesConserve", t[t.categoriesHome = 25] = "categoriesHome", t[t.categoriesEaster = 26] = "categoriesEaster", t[t.categoriesOnlinePromo = 27] = "categoriesOnlinePromo", t[t.categoriesSportFood = 28] = "categoriesSportFood", t[t.categoriesClothing = 29] = "categoriesClothing", t[t.categoriesEnergy = 30] = "categoriesEnergy", t[t.categoriesDeskAndTravel = 31] = "categoriesDeskAndTravel", t[t.categoriesCigarette = 32] = "categoriesCigarette", t[t.categoriesFood = 33] = "categoriesFood", t[t.categoriesChild = 34] = "categoriesChild", t[t.categoriesPuzzle = 35] = "categoriesPuzzle", t[t.categoriesToys = 36] = "categoriesToys", t[t.categoriesCar = 37] = "categoriesCar", t[t.categoriesPlaceholder = 38] = "categoriesPlaceholder", t[t.categoriesFuel = 39] = "categoriesFuel", t[t.categoriesCarAndBike = 40] = "categoriesCarAndBike", t[t.categoriesToyAndHobby = 41] = "categoriesToyAndHobby", t[t.categoriesMultimedia = 42] = "categoriesMultimedia", t[t.categoriesParty = 43] = "categoriesParty", t[t.toolsPay = 44] = "toolsPay", t[t.toolsReceipt = 45] = "toolsReceipt", t[t.toolsFuel = 46] = "toolsFuel", t[t.toolsStoreLocator = 47] = "toolsStoreLocator", t[t.toolsStats = 48] = "toolsStats", t[t.toolsShowXtraOld = 49] = "toolsShowXtraOld", t[t.toolsShowXtraNew = 50] = "toolsShowXtraNew", t[t.toolsScan2 = 51] = "toolsScan2", t[t.toolsRecipes2 = 52] = "toolsRecipes2", t[t.toolsWarranty = 53] = "toolsWarranty", t[t.toolsCoupons = 54] = "toolsCoupons", t[t.toolsFavoriteInactive = 55] = "toolsFavoriteInactive", t[t.toolsFavoriteActive = 56] = "toolsFavoriteActive", t[t.toolsAssortment = 57] = "toolsAssortment", t[t.toolsPromo = 58] = "toolsPromo", t[t.fuelCng = 59] = "fuelCng", t[t.fuelE5 = 60] = "fuelE5", t[t.fuelAdblue = 61] = "fuelAdblue", t[t.fuelB7 = 62] = "fuelB7", t[t.fuelH2 = 63] = "fuelH2", t[t.fuelE10 = 64] = "fuelE10", t[t.fuelFreeTireInflation = 65] = "fuelFreeTireInflation", t[t.functionalClose = 66] = "functionalClose", t[t.functionalBack = 67] = "functionalBack", t[t.functionalSearch = 68] = "functionalSearch", t[t.functionalEdit = 69] = "functionalEdit", t[t.functionalShare = 70] = "functionalShare", t[t.functionalLocation = 71] = "functionalLocation", t[t.functionalTrash = 72] = "functionalTrash", t[t.functionalCamera = 73] = "functionalCamera", t[t.functionalPhone = 74] = "functionalPhone", t[t.functionalPushNotifications = 75] = "functionalPushNotifications", t[t.functionalMail = 76] = "functionalMail", t[t.functionalGift = 77] = "functionalGift", t[t.functionalPresent = 78] = "functionalPresent", t[t.functionalLoading = 79] = "functionalLoading", t[t.functionalChevronRight = 80] = "functionalChevronRight", t[t.functionalCheck = 81] = "functionalCheck", t[t.functionalChevronDown = 82] = "functionalChevronDown", t[t.functionalChevronUp = 83] = "functionalChevronUp", t[t.functionalPlus = 84] = "functionalPlus", t[t.functionalReset = 85] = "functionalReset", t[t.functionalDownload = 86] = "functionalDownload", t[t.functionalExport = 87] = "functionalExport", t[t.functionalCustomerService = 88] = "functionalCustomerService", t[t.functionalTruck = 89] = "functionalTruck", t[t.functionalBox = 90] = "functionalBox", t[t.functionalEllipsis = 91] = "functionalEllipsis", t[t.functionalLocationHome = 92] = "functionalLocationHome", t[t.functionalLocationPickup = 93] = "functionalLocationPickup", t[t.functionalAccount = 94] = "functionalAccount", t[t.functionalPrivacy = 95] = "functionalPrivacy", t[t.functionalSettings = 96] = "functionalSettings", t[t.functionalUserInfo = 97] = "functionalUserInfo", t[t.functionalPinOutlines = 98] = "functionalPinOutlines", t[t.functionalCalendar = 99] = "functionalCalendar", t[t.functionalMinus = 100] = "functionalMinus", t[t.functionalLifestyle = 101] = "functionalLifestyle", t[t.functionalSms = 102] = "functionalSms", t[t.functionalSwitch = 103] = "functionalSwitch", t[t.functionalSorting = 104] = "functionalSorting", t[t.functionalWarningCircle = 105] = "functionalWarningCircle", t[t.functionalQuestionCircle = 106] = "functionalQuestionCircle", t[t.functionalErrorCircle = 107] = "functionalErrorCircle", t[t.functionalSuccessCircle = 108] = "functionalSuccessCircle", t[t.functionalMessage = 109] = "functionalMessage", t[t.functionalExternalLink = 110] = "functionalExternalLink", t[t.functionalAddToList = 111] = "functionalAddToList", t[t.functionalShoppingcart = 112] = "functionalShoppingcart", t[t.functionalFilter = 113] = "functionalFilter", t[t.functionalLocate = 114] = "functionalLocate", t[t.functionalBarcode = 115] = "functionalBarcode", t[t.functionalClock = 116] = "functionalClock", t[t.functionalHistory = 117] = "functionalHistory", t[t.functionalShops = 118] = "functionalShops", t[t.functionalAddUser = 119] = "functionalAddUser", t[t.functionalOther = 120] = "functionalOther", t[t.functionalInAppNotifications = 121] = "functionalInAppNotifications", t[t.functionalExit = 122] = "functionalExit", t[t.functionalShared = 123] = "functionalShared", t[t.functionalThumbsup = 124] = "functionalThumbsup", t[t.functionalDiscount = 125] = "functionalDiscount", t[t.functionalPercentage = 126] = "functionalPercentage", t[t.functionalList = 127] = "functionalList", t[t.functionalMapLocation = 128] = "functionalMapLocation", t[t.functionalNoConnection = 129] = "functionalNoConnection", t[t.functionalSwap = 130] = "functionalSwap", t[t.functionalPiece = 131] = "functionalPiece", t[t.functionalWeight = 132] = "functionalWeight", t[t.functionalPack = 133] = "functionalPack", t[t.functionalCommunications = 134] = "functionalCommunications", t[t.functionalDeliveryAddresses = 135] = "functionalDeliveryAddresses", t[t["functional18+"] = 136] = "functional18+", t[t.functionalReadtime = 137] = "functionalReadtime", t[t.functionalCopy = 138] = "functionalCopy", t[t.functionalMessageField = 139] = "functionalMessageField", t[t.functionalNext = 140] = "functionalNext", t[t.functionalSave = 141] = "functionalSave", t[t.functionalLogin = 142] = "functionalLogin", t[t.functionalLogout = 143] = "functionalLogout", t[t.functionalWebsite = 144] = "functionalWebsite", t[t.functionalMenu = 145] = "functionalMenu", t[t.functionalRegister = 146] = "functionalRegister", t[t.functionalNews = 147] = "functionalNews", t[t.functionalTimer = 148] = "functionalTimer", t[t.functionalEyeShow = 149] = "functionalEyeShow", t[t.functionalMobilePay = 150] = "functionalMobilePay", t[t.functionalConnectionCable = 151] = "functionalConnectionCable", t[t.functionalDryCleaning = 152] = "functionalDryCleaning", t[t.functionalKiosk = 153] = "functionalKiosk", t[t.functionalConnectedDevice = 154] = "functionalConnectedDevice", t[t.functionalCookies = 155] = "functionalCookies", t[t.functionalViewFile = 156] = "functionalViewFile", t[t.functionalLastAdded = 157] = "functionalLastAdded", t[t.functionalFirstAdded = 158] = "functionalFirstAdded", t[t.functionalStoreLayout = 159] = "functionalStoreLayout", t[t.functionalBlock = 160] = "functionalBlock", t[t.functionalChecklist = 161] = "functionalChecklist", t[t.functionalCartCheckout = 162] = "functionalCartCheckout", t[t.functionalCartEdit = 163] = "functionalCartEdit", t[t.functionalEyeHidden = 164] = "functionalEyeHidden", t[t.functionalWarningCircleFilled = 165] = "functionalWarningCircleFilled", t[t.functionalErrorCircleFilled = 166] = "functionalErrorCircleFilled", t[t.functionalSuccessCircleFilled = 167] = "functionalSuccessCircleFilled", t[t.functionalPlusCircle = 168] = "functionalPlusCircle", t[t.functionalSpinner = 169] = "functionalSpinner", t[t.functionalEcoEarth = 170] = "functionalEcoEarth", t[t.functionalAlphaBeta = 171] = "functionalAlphaBeta", t[t.functionalEuro = 172] = "functionalEuro", t[t.functionalNumber = 173] = "functionalNumber", t[t.functionalIdea = 174] = "functionalIdea", t[t.functionalMultifactorAuthenticator = 175] = "functionalMultifactorAuthenticator", t[t.functionalPassword = 176] = "functionalPassword", t[t.functionalDiscountCode = 177] = "functionalDiscountCode", t))(ee || {});
|
|
2889
|
+
const Mi = "/icons/bouMenuIcons.svg", Oi = ({
|
|
2890
|
+
bouIconId: t,
|
|
2891
|
+
...e
|
|
2892
|
+
}) => /* @__PURE__ */ i.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", ...e, children: /* @__PURE__ */ i.jsx("use", { href: `${Mi}#${ee[t]}` }) }), Ce = (t) => typeof t.icon == "string" && t.icon in ee ? /* @__PURE__ */ i.jsx(Oi, { bouIconId: ee[t.icon] }) : t.icon, Ri = ({
|
|
2893
|
+
label: t,
|
|
2894
|
+
className: e,
|
|
2895
|
+
onClick: s,
|
|
2896
|
+
icon: r
|
|
2897
|
+
}) => /* @__PURE__ */ i.jsx(W.Item, { className: e, children: /* @__PURE__ */ i.jsxs("button", { onClick: s, children: [
|
|
2898
|
+
/* @__PURE__ */ i.jsx(Ce, { icon: r }),
|
|
2899
|
+
t
|
|
2900
|
+
] }) }), _t = (t) => {
|
|
2901
|
+
const e = Fs(), { className: s, label: r, mobileUrl: a, desktopUrl: l, icon: o } = t;
|
|
2902
|
+
return /* @__PURE__ */ i.jsxs(W.Item, { className: s, children: [
|
|
2903
|
+
(!e || e && !l) && /* @__PURE__ */ i.jsxs("a", { href: a, referrerPolicy: "no-referrer-when-downgrade", children: [
|
|
2904
|
+
/* @__PURE__ */ i.jsx(Ce, { icon: o }),
|
|
2905
|
+
r
|
|
2906
|
+
] }),
|
|
2907
|
+
!!l && /* @__PURE__ */ i.jsxs("a", { href: l, referrerPolicy: "no-referrer-when-downgrade", children: [
|
|
2908
|
+
/* @__PURE__ */ i.jsx(Ce, { icon: o }),
|
|
2909
|
+
r
|
|
2910
|
+
] })
|
|
2911
|
+
] });
|
|
2912
|
+
}, Es = f.createContext(void 0), Li = ({ position: t, bouMenuItems: e, children: s }) => /* @__PURE__ */ i.jsx(Es.Provider, { value: { position: t, bouMenuItems: e }, children: s }), Ps = () => {
|
|
2913
|
+
const t = f.useContext(Es);
|
|
2914
|
+
if (!t)
|
|
2915
|
+
throw new Error("Authentication context can not be rendered outside of Authentication");
|
|
2916
|
+
return t;
|
|
2917
|
+
}, As = f.createContext(void 0), Fi = ({ apiUrl: t, redirectUrl: e, children: s }) => /* @__PURE__ */ i.jsx(As.Provider, { value: { apiUrl: t, redirectUrl: e }, children: s }), Se = () => {
|
|
2918
|
+
const t = f.useContext(As);
|
|
2919
|
+
if (!t)
|
|
2920
|
+
throw new Error("Api context can not be rendered outside of Api");
|
|
2921
|
+
return t;
|
|
2922
|
+
}, ks = ({ apiUrl: t, redirectUrl: e, trackingInfo: s }) => {
|
|
2923
|
+
const r = new URLSearchParams({ redirectUrl: e });
|
|
2924
|
+
s && r.append("trackingInfo", s);
|
|
2925
|
+
const a = `${t}/login?${r.toString()}`, l = `${t}/logout?${r.toString()}`;
|
|
2926
|
+
return { loginUrl: a, logoutUrl: l };
|
|
2927
|
+
}, se = () => {
|
|
2928
|
+
const { apiUrl: t, redirectUrl: e } = Se(), s = Ds();
|
|
2929
|
+
return ks({ apiUrl: t, redirectUrl: e, trackingInfo: s });
|
|
2930
|
+
}, Di = () => {
|
|
2931
|
+
const { apiUrl: t } = Se();
|
|
2932
|
+
return `${`${t}/xtra`}/authentication/v1/user/profile`;
|
|
2933
|
+
}, Te = (t) => t ? `+${t.countryCode} ${t.number}` : "", Ue = (t, e) => e == null ? void 0 : e.find((s) => s.type === t), Qe = ({ apiUrl: t, redirectUrl: e }) => {
|
|
2934
|
+
const { loginUrl: s } = ks({ apiUrl: t, redirectUrl: e });
|
|
2935
|
+
window.location.replace(s);
|
|
2936
|
+
}, He = (t) => {
|
|
2937
|
+
var l;
|
|
2938
|
+
if (!t)
|
|
2939
|
+
return { user: { state: () => "NotAuthenticated" }, tryToLogon: Qe };
|
|
2940
|
+
const e = new Date(t.dateOfBirth), s = Ue(Pe.Mobile, t.phone), r = Ue(Pe.Fixed, t.phone), a = Te(s) ?? Te(r) ?? "";
|
|
2941
|
+
return {
|
|
2942
|
+
user: {
|
|
2943
|
+
...(l = window.XTRA) == null ? void 0 : l.user,
|
|
2944
|
+
firstName: () => t.firstName,
|
|
2945
|
+
lastName: () => t.lastName,
|
|
2946
|
+
dob: () => e.getDate(),
|
|
2947
|
+
mob: () => e.getMonth() + 1,
|
|
2948
|
+
yob: () => e.getFullYear(),
|
|
2949
|
+
gender: () => t.genderCode,
|
|
2950
|
+
phone: () => a,
|
|
2951
|
+
streetName: () => {
|
|
2952
|
+
var o;
|
|
2953
|
+
return (o = t.address) == null ? void 0 : o.streetName;
|
|
2954
|
+
},
|
|
2955
|
+
houseNr: () => {
|
|
2956
|
+
var o;
|
|
2957
|
+
return (o = t.address) == null ? void 0 : o.houseNumber;
|
|
2958
|
+
},
|
|
2959
|
+
box: () => {
|
|
2960
|
+
var o;
|
|
2961
|
+
return (o = t.address) == null ? void 0 : o.letterBoxName;
|
|
2962
|
+
},
|
|
2963
|
+
zip: () => {
|
|
2964
|
+
var o;
|
|
2965
|
+
return (o = t.address) == null ? void 0 : o.postalCode;
|
|
2966
|
+
},
|
|
2967
|
+
city: () => {
|
|
2968
|
+
var o;
|
|
2969
|
+
return (o = t.address) == null ? void 0 : o.locationName;
|
|
2970
|
+
},
|
|
2971
|
+
country: () => {
|
|
2972
|
+
var o;
|
|
2973
|
+
return (o = t.address) == null ? void 0 : o.countryCode;
|
|
2974
|
+
},
|
|
2975
|
+
email: () => t.email,
|
|
2976
|
+
cbh: () => t.customerIdentifier,
|
|
2977
|
+
state: () => "Authenticated"
|
|
2978
|
+
},
|
|
2979
|
+
tryToLogon: Qe
|
|
2980
|
+
};
|
|
2981
|
+
}, Ns = ["profile"], Ms = () => {
|
|
2982
|
+
const { i18n: t } = jt(), e = Di(), s = sessionStorage.getItem("profile"), r = !!s;
|
|
2983
|
+
return fs({
|
|
2984
|
+
queryKey: Ns,
|
|
2985
|
+
queryFn: async () => {
|
|
2986
|
+
const l = await fetch(e, {
|
|
2987
|
+
credentials: "include",
|
|
2988
|
+
mode: "cors",
|
|
2989
|
+
headers: { "Accept-Language": t.language }
|
|
2990
|
+
});
|
|
2991
|
+
if (!l.ok) {
|
|
2992
|
+
if (l.status === 401)
|
|
2993
|
+
return window.XTRA = { ...window.XTRA, ...He() }, window.postMessage(
|
|
2994
|
+
{ source: "xtra-authentication", isAuthenticated: !1 },
|
|
2995
|
+
new URL(window.location.href).origin
|
|
2996
|
+
), sessionStorage.removeItem("profile"), { authenticationStatus: "NotAuthenticated" };
|
|
2997
|
+
if (r)
|
|
2998
|
+
return { authenticationStatus: "Authenticated", profile: JSON.parse(s) };
|
|
2999
|
+
throw new Error("Failed to retrieve profile");
|
|
3000
|
+
}
|
|
3001
|
+
const o = await l.json(), { firstName: c, lastName: v } = o;
|
|
3002
|
+
return sessionStorage.setItem("profile", JSON.stringify({ firstName: c, lastName: v })), window.postMessage(
|
|
3003
|
+
{ source: "xtra-authentication", isAuthenticated: !0 },
|
|
3004
|
+
new URL(window.location.href).origin
|
|
3005
|
+
), window.XTRA = { ...window.XTRA, ...He(o) }, {
|
|
3006
|
+
authenticationStatus: "Authenticated",
|
|
3007
|
+
profile: { firstName: o.firstName, lastName: o.lastName }
|
|
3008
|
+
};
|
|
3009
|
+
},
|
|
3010
|
+
initialData: r ? {
|
|
3011
|
+
authenticationStatus: "Authenticated",
|
|
3012
|
+
profile: JSON.parse(s)
|
|
3013
|
+
} : void 0,
|
|
3014
|
+
placeholderData: { authenticationStatus: "Pending" },
|
|
3015
|
+
refetchOnWindowFocus: !1
|
|
3016
|
+
});
|
|
3017
|
+
}, Ti = () => {
|
|
3018
|
+
const { t } = jt(), e = Xe(), { position: s, bouMenuItems: r } = Ps(), { logoutUrl: a } = se(), o = je().getQueryData(Ns), c = (o == null ? void 0 : o.profile.firstName) ?? "", v = (o == null ? void 0 : o.profile.lastName) ?? "", g = () => {
|
|
3019
|
+
sessionStorage.removeItem("profile"), window.location.href = a;
|
|
3020
|
+
};
|
|
3021
|
+
return /* @__PURE__ */ i.jsxs(W, { type: "nav", id: "xtra-menu", position: s, children: [
|
|
3022
|
+
/* @__PURE__ */ i.jsx(
|
|
3023
|
+
W.Trigger,
|
|
3024
|
+
{
|
|
3025
|
+
className: O(
|
|
3026
|
+
"button",
|
|
3027
|
+
"button--neutral",
|
|
3028
|
+
"button--authentication",
|
|
3029
|
+
"button--authentication--authenticated"
|
|
3030
|
+
),
|
|
3031
|
+
children: /* @__PURE__ */ i.jsxs("button", { children: [
|
|
3032
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(Nr, { variant: "small", firstName: c, lastName: v }) }),
|
|
3033
|
+
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: c }),
|
|
3034
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(_e, {}) })
|
|
3035
|
+
] })
|
|
3036
|
+
}
|
|
3037
|
+
),
|
|
3038
|
+
/* @__PURE__ */ i.jsxs(W.Content, { as: "div", children: [
|
|
3039
|
+
!!r && r.length > 0 && /* @__PURE__ */ i.jsx("ul", { className: "bou-menu__list", children: r.map(({ label: h, icon: u, url: d }, m) => /* @__PURE__ */ i.jsx(
|
|
3040
|
+
_t,
|
|
3041
|
+
{
|
|
3042
|
+
className: "bou-menu-item",
|
|
3043
|
+
mobileUrl: d,
|
|
3044
|
+
icon: u,
|
|
3045
|
+
label: h
|
|
3046
|
+
},
|
|
3047
|
+
m
|
|
3048
|
+
)) }),
|
|
3049
|
+
/* @__PURE__ */ i.jsxs("ul", { children: [
|
|
3050
|
+
/* @__PURE__ */ i.jsx(
|
|
3051
|
+
_t,
|
|
3052
|
+
{
|
|
3053
|
+
className: "manage-profile",
|
|
3054
|
+
mobileUrl: `${e}/manage-profile`,
|
|
3055
|
+
desktopUrl: `${e}/manage-profile/personal-data`,
|
|
3056
|
+
icon: /* @__PURE__ */ i.jsx($r, {}),
|
|
3057
|
+
label: t("manageProfile")
|
|
3058
|
+
}
|
|
3059
|
+
),
|
|
3060
|
+
/* @__PURE__ */ i.jsx(
|
|
3061
|
+
_t,
|
|
3062
|
+
{
|
|
3063
|
+
className: "payment",
|
|
3064
|
+
mobileUrl: `${e}/payment`,
|
|
3065
|
+
icon: /* @__PURE__ */ i.jsx(ri, {}),
|
|
3066
|
+
label: t("payment")
|
|
3067
|
+
}
|
|
3068
|
+
),
|
|
3069
|
+
/* @__PURE__ */ i.jsx(
|
|
3070
|
+
_t,
|
|
3071
|
+
{
|
|
3072
|
+
className: "gift-cards",
|
|
3073
|
+
mobileUrl: `${e}/gift-cards`,
|
|
3074
|
+
icon: /* @__PURE__ */ i.jsx(ei, {}),
|
|
3075
|
+
label: t("giftCards")
|
|
3076
|
+
}
|
|
3077
|
+
),
|
|
3078
|
+
/* @__PURE__ */ i.jsx(
|
|
3079
|
+
_t,
|
|
3080
|
+
{
|
|
3081
|
+
mobileUrl: `${e}/identifiers`,
|
|
3082
|
+
icon: /* @__PURE__ */ i.jsx(ni, {}),
|
|
3083
|
+
label: t("qrCode")
|
|
3084
|
+
}
|
|
3085
|
+
),
|
|
3086
|
+
/* @__PURE__ */ i.jsx(
|
|
3087
|
+
_t,
|
|
3088
|
+
{
|
|
3089
|
+
className: "manage-privacy",
|
|
3090
|
+
mobileUrl: `${e}/manage-privacy`,
|
|
3091
|
+
desktopUrl: `${e}/manage-privacy/permissions`,
|
|
3092
|
+
icon: /* @__PURE__ */ i.jsx(Wr, {}),
|
|
3093
|
+
label: t("privacy")
|
|
3094
|
+
}
|
|
3095
|
+
),
|
|
3096
|
+
/* @__PURE__ */ i.jsx(Ri, { onClick: g, icon: /* @__PURE__ */ i.jsx(Gr, {}), label: t("logout") })
|
|
3097
|
+
] })
|
|
3098
|
+
] })
|
|
3099
|
+
] });
|
|
3100
|
+
}, Ui = () => {
|
|
3101
|
+
const { t } = jt();
|
|
3102
|
+
return /* @__PURE__ */ i.jsxs("button", { className: O("button", "button--neutral", "button--authentication"), children: [
|
|
3103
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx("i", { className: "spinner" }) }),
|
|
3104
|
+
/* @__PURE__ */ i.jsxs("span", { className: "button__label", children: [
|
|
3105
|
+
t("loading"),
|
|
3106
|
+
"..."
|
|
3107
|
+
] })
|
|
3108
|
+
] });
|
|
3109
|
+
}, Qi = ({ className: t }) => {
|
|
3110
|
+
const { t: e } = jt(), { loginUrl: s } = se();
|
|
3111
|
+
return /* @__PURE__ */ i.jsxs(
|
|
3112
|
+
"a",
|
|
3113
|
+
{
|
|
3114
|
+
href: s,
|
|
3115
|
+
className: O(
|
|
3116
|
+
"button",
|
|
3117
|
+
"button--neutral",
|
|
3118
|
+
"button--authentication",
|
|
3119
|
+
"button--authentication--unauthenticated",
|
|
3120
|
+
t
|
|
3121
|
+
),
|
|
3122
|
+
children: [
|
|
3123
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(gs, { width: 24, height: 24, suffix: "desktop" }) }),
|
|
3124
|
+
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: e("login") }),
|
|
3125
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(_e, {}) })
|
|
3126
|
+
]
|
|
3127
|
+
}
|
|
3128
|
+
);
|
|
3129
|
+
}, Hi = () => {
|
|
3130
|
+
const { t } = jt(), { loginUrl: e } = se(), s = Xe(), { position: r } = Ps();
|
|
3131
|
+
return /* @__PURE__ */ i.jsxs(
|
|
3132
|
+
W,
|
|
3133
|
+
{
|
|
3134
|
+
type: "nav",
|
|
3135
|
+
id: "xtra-menu",
|
|
3136
|
+
position: r,
|
|
3137
|
+
className: "menu--unauthenticated",
|
|
3138
|
+
"aria-label": t("xtraMenuAriaLabel"),
|
|
3139
|
+
children: [
|
|
3140
|
+
/* @__PURE__ */ i.jsx(W.Trigger, { className: O("button", "button--neutral", "button--authentication"), children: /* @__PURE__ */ i.jsxs("button", { children: [
|
|
3141
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(gs, { width: 24, height: 24, suffix: "mobile" }) }),
|
|
3142
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(_e, {}) })
|
|
3143
|
+
] }) }),
|
|
3144
|
+
/* @__PURE__ */ i.jsxs(W.Content, { children: [
|
|
3145
|
+
/* @__PURE__ */ i.jsx(W.Item, { children: /* @__PURE__ */ i.jsxs("a", { href: e, className: "button button--with-icon", children: [
|
|
3146
|
+
/* @__PURE__ */ i.jsx("span", { className: "button__icon", children: /* @__PURE__ */ i.jsx(Hr, {}) }),
|
|
3147
|
+
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: t("login") })
|
|
3148
|
+
] }) }),
|
|
3149
|
+
/* @__PURE__ */ i.jsx(W.Item, { children: /* @__PURE__ */ i.jsxs("a", { href: `${s}/onboarding/register`, className: "button button--with-icon", children: [
|
|
3150
|
+
/* @__PURE__ */ i.jsx("span", { className: "button__icon", children: /* @__PURE__ */ i.jsx(Yr, {}) }),
|
|
3151
|
+
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: t("register") })
|
|
3152
|
+
] }) })
|
|
3153
|
+
] })
|
|
3154
|
+
]
|
|
3155
|
+
}
|
|
3156
|
+
);
|
|
3157
|
+
}, Ki = () => {
|
|
3158
|
+
var e, s;
|
|
3159
|
+
const t = Ms();
|
|
3160
|
+
return ((e = t.data) == null ? void 0 : e.authenticationStatus) === "Authenticated" ? /* @__PURE__ */ i.jsx(Ti, {}) : ((s = t.data) == null ? void 0 : s.authenticationStatus) === "NotAuthenticated" || t.isError ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
3161
|
+
/* @__PURE__ */ i.jsx(Qi, {}),
|
|
3162
|
+
/* @__PURE__ */ i.jsx(Hi, {})
|
|
3163
|
+
] }) : /* @__PURE__ */ i.jsx(Ui, {});
|
|
3164
|
+
}, Os = () => {
|
|
3165
|
+
const { apiUrl: t } = Se();
|
|
3166
|
+
return `${`${t}/xtra`}/authentication/v1/gdpr`;
|
|
3167
|
+
}, Gi = () => {
|
|
3168
|
+
const t = Os(), e = new ls();
|
|
3169
|
+
return Cr({
|
|
3170
|
+
mutationFn: async (r) => {
|
|
3171
|
+
const a = await fetch(`${t}/tc`, {
|
|
3172
|
+
body: JSON.stringify({ acceptedTC: r }),
|
|
3173
|
+
credentials: "include",
|
|
3174
|
+
method: "POST",
|
|
3175
|
+
mode: "cors"
|
|
3176
|
+
});
|
|
3177
|
+
if (!a.ok)
|
|
3178
|
+
throw new Error("Network response was not ok");
|
|
3179
|
+
return a;
|
|
3180
|
+
},
|
|
3181
|
+
onSuccess: async () => {
|
|
3182
|
+
await e.invalidateQueries({ queryKey: ["gdpr"] });
|
|
3183
|
+
}
|
|
3184
|
+
});
|
|
3185
|
+
}, qi = () => {
|
|
3186
|
+
var l;
|
|
3187
|
+
const { i18n: t } = jt(), e = Os(), r = ((l = Ms().data) == null ? void 0 : l.authenticationStatus) === "Authenticated";
|
|
3188
|
+
return fs({
|
|
3189
|
+
queryKey: ["gdpr"],
|
|
3190
|
+
queryFn: async () => {
|
|
3191
|
+
const o = await fetch(`${e}/tc/check`, {
|
|
3192
|
+
credentials: "include",
|
|
3193
|
+
mode: "cors",
|
|
3194
|
+
headers: { "Accept-Language": t.language }
|
|
3195
|
+
});
|
|
3196
|
+
if (!o.ok)
|
|
3197
|
+
throw new Error("Network response was not ok");
|
|
3198
|
+
return o.status === 204 ? [] : await o.json();
|
|
3199
|
+
},
|
|
3200
|
+
enabled: r
|
|
3201
|
+
});
|
|
3202
|
+
}, Wi = () => {
|
|
3203
|
+
var k;
|
|
3204
|
+
const { t } = jt();
|
|
3205
|
+
Ts({ element: "xtra-authentication" });
|
|
3206
|
+
const { logoutUrl: e } = se(), s = f.useRef(null), [r, a] = f.useState(0), [l, o] = f.useState({}), { mutate: c, isError: v } = Gi(), { AccessibleFormMessage: g, formRef: h } = Us({ submitCount: r, errors: l }), u = qi(), d = !!((k = u.data) != null && k.length), m = t("termsAndConditions.error.required"), S = () => {
|
|
3207
|
+
var C;
|
|
3208
|
+
(C = s == null ? void 0 : s.current) == null || C.click(), document.body.style.removeProperty("overflow");
|
|
3209
|
+
};
|
|
3210
|
+
f.useEffect(() => {
|
|
3211
|
+
d && document.body.style.setProperty("overflow", "hidden");
|
|
3212
|
+
}, [d]), f.useEffect(() => {
|
|
3213
|
+
v && o({ acceptedTC: m });
|
|
3214
|
+
}, [m, v]);
|
|
3215
|
+
const P = (C) => {
|
|
3216
|
+
C.preventDefault(), a(r + 1);
|
|
3217
|
+
const { acceptedTC: w } = C.target;
|
|
3218
|
+
if (w instanceof RadioNodeList) {
|
|
3219
|
+
const j = Object.values(w);
|
|
3220
|
+
j.every((R) => R.checked) ? (o({}), c(j.map((R) => R.value)), S()) : o({ acceptedTC: m });
|
|
3221
|
+
} else
|
|
3222
|
+
w != null && w.checked ? (o({}), c([w.value]), S()) : o({ acceptedTC: m });
|
|
3223
|
+
};
|
|
3224
|
+
return d ? /* @__PURE__ */ i.jsxs(G, { defaultOpen: d, isModal: !0, children: [
|
|
3225
|
+
g,
|
|
3226
|
+
/* @__PURE__ */ i.jsxs(G.Root, { children: [
|
|
3227
|
+
/* @__PURE__ */ i.jsx(G.Header, { children: /* @__PURE__ */ i.jsx(G.Title, { icon: /* @__PURE__ */ i.jsx("i", { className: "commerce__icon" }), children: /* @__PURE__ */ i.jsx(Yi, { children: t("termsAndConditions.title") }) }) }),
|
|
3228
|
+
/* @__PURE__ */ i.jsx(G.Body, { children: /* @__PURE__ */ i.jsxs(Rs, { ref: h, id: "tc-form", onSubmit: P, children: [
|
|
3229
|
+
/* @__PURE__ */ i.jsxs($i, { children: [
|
|
3230
|
+
t("termsAndConditions.description"),
|
|
3231
|
+
l.acceptedTC && /* @__PURE__ */ i.jsx(zi, { children: m })
|
|
3232
|
+
] }),
|
|
3233
|
+
u.data.map(({ tcCode: C, title: w, URL: j }) => /* @__PURE__ */ i.jsx(
|
|
3234
|
+
wt,
|
|
3235
|
+
{
|
|
3236
|
+
id: C,
|
|
3237
|
+
value: C,
|
|
3238
|
+
name: "acceptedTC",
|
|
3239
|
+
variant: "primary",
|
|
3240
|
+
children: /* @__PURE__ */ i.jsxs(wt.Content, { children: [
|
|
3241
|
+
/* @__PURE__ */ i.jsx(Vi, { children: w }),
|
|
3242
|
+
/* @__PURE__ */ i.jsx(Zi, { href: j, children: t("termsAndConditions.action", { title: w }) })
|
|
3243
|
+
] })
|
|
3244
|
+
},
|
|
3245
|
+
C
|
|
3246
|
+
))
|
|
3247
|
+
] }) }),
|
|
3248
|
+
/* @__PURE__ */ i.jsxs(G.Footer, { children: [
|
|
3249
|
+
/* @__PURE__ */ i.jsx(
|
|
3250
|
+
"a",
|
|
3251
|
+
{
|
|
3252
|
+
className: O("button", "button--secondary", "button--terms-and-conditions"),
|
|
3253
|
+
href: e,
|
|
3254
|
+
children: t("logout")
|
|
3255
|
+
}
|
|
3256
|
+
),
|
|
3257
|
+
/* @__PURE__ */ i.jsx(Zt, { form: "tc-form", type: "submit", variant: "primary", children: t("confirm") })
|
|
3258
|
+
] })
|
|
3259
|
+
] })
|
|
3260
|
+
] }) : /* @__PURE__ */ i.jsx(i.Fragment, {});
|
|
3261
|
+
}, Vi = ({
|
|
3262
|
+
children: t,
|
|
3263
|
+
...e
|
|
3264
|
+
}) => /* @__PURE__ */ i.jsx(wt.Label, { className: "form--tc__label", ...e, children: t }), Rs = f.forwardRef(({ children: t, ...e }, s) => /* @__PURE__ */ i.jsx("form", { className: "form--tc", ref: s, ...e, children: t }));
|
|
3265
|
+
Rs.displayName = "TermsAndConditionsForm";
|
|
3266
|
+
const $i = ({
|
|
3267
|
+
children: t,
|
|
3268
|
+
...e
|
|
3269
|
+
}) => /* @__PURE__ */ i.jsx("p", { className: "form--tc__description", ...e, children: t }), Zi = ({ children: t, ...e }) => /* @__PURE__ */ i.jsx(
|
|
3270
|
+
"a",
|
|
3271
|
+
{
|
|
3272
|
+
className: "form--tc__link",
|
|
3273
|
+
target: "_blank",
|
|
3274
|
+
rel: "noreferrer",
|
|
3275
|
+
role: "button",
|
|
3276
|
+
download: !0,
|
|
3277
|
+
...e,
|
|
3278
|
+
children: t
|
|
3279
|
+
}
|
|
3280
|
+
), Yi = ({ children: t }) => /* @__PURE__ */ i.jsx("h1", { className: "form--tc__title", children: t }), zi = ({ children: t, ...e }) => /* @__PURE__ */ i.jsx("span", { className: "form--tc__error", role: "alert", ...e, children: t }), Ji = new ls(), Bi = ({ environment: t, redirectUrl: e, apiUrl: s, position: r, commerceId: a, bouMenuItems: l }) => /* @__PURE__ */ i.jsx(Qs, { environment: t, children: /* @__PURE__ */ i.jsx(Hs, { commerceId: a, children: /* @__PURE__ */ i.jsx(Fi, { apiUrl: s, redirectUrl: e, children: /* @__PURE__ */ i.jsxs(ar, { client: Ji, children: [
|
|
3281
|
+
/* @__PURE__ */ i.jsx(Li, { position: r, bouMenuItems: l, children: /* @__PURE__ */ i.jsx(Ki, {}) }),
|
|
3282
|
+
/* @__PURE__ */ i.jsx(Wi, {})
|
|
3283
|
+
] }) }) }) });
|
|
3284
|
+
export {
|
|
3285
|
+
Bi as default
|
|
3286
|
+
};
|