@myxtra/authentication-green 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-c57e7c72.mjs → App-C2fLzzLZ.mjs} +1191 -1160
- package/dist/App.css +1 -0
- package/dist/{style.css → Authentication.css} +1 -1
- package/dist/TermsAndConditions.css +1 -0
- package/dist/global.css +1 -0
- package/dist/index-DibhjQ0Y.mjs +8476 -0
- package/dist/index.css +1 -0
- package/dist/xtra-authentication.mjs +1 -1
- package/package.json +13 -13
- package/dist/index-97a2898d.mjs +0 -9012
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ht = (e, t, s) => {
|
|
2
2
|
if (!t.has(e))
|
|
3
3
|
throw TypeError("Cannot " + s);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
5
|
+
var a = (e, t, s) => (ht(e, t, "read from private field"), s ? s.call(e) : t.get(e)), g = (e, t, s) => {
|
|
6
6
|
if (t.has(e))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
9
|
-
},
|
|
10
|
-
var
|
|
11
|
-
set _(
|
|
12
|
-
|
|
9
|
+
}, f = (e, t, s, r) => (ht(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s);
|
|
10
|
+
var tt = (e, t, s, r) => ({
|
|
11
|
+
set _(n) {
|
|
12
|
+
f(e, t, n, s);
|
|
13
13
|
},
|
|
14
14
|
get _() {
|
|
15
|
-
return
|
|
15
|
+
return a(e, t, r);
|
|
16
16
|
}
|
|
17
|
-
}), b = (e, t, s) => (
|
|
18
|
-
import { r as
|
|
19
|
-
var
|
|
17
|
+
}), b = (e, t, s) => (ht(e, t, "access private method"), s);
|
|
18
|
+
import { r as h, j as i, u as $s, a as Ks, b as be, P as Rt, c as ns, d as qs, e as Gs, E as Vs, C as Ws } from "./index-DibhjQ0Y.mjs";
|
|
19
|
+
var Ue = class {
|
|
20
20
|
constructor() {
|
|
21
21
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
22
22
|
}
|
|
@@ -32,128 +32,128 @@ var Ke = class {
|
|
|
32
32
|
}
|
|
33
33
|
onUnsubscribe() {
|
|
34
34
|
}
|
|
35
|
-
},
|
|
36
|
-
function
|
|
35
|
+
}, Te = typeof window > "u" || "Deno" in globalThis;
|
|
36
|
+
function V() {
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function Zs(e, t) {
|
|
39
39
|
return typeof e == "function" ? e(t) : e;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function ft(e) {
|
|
42
42
|
return typeof e == "number" && e >= 0 && e !== 1 / 0;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function as(e, t) {
|
|
45
45
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Dt(e, t) {
|
|
48
48
|
const {
|
|
49
49
|
type: s = "all",
|
|
50
50
|
exact: r,
|
|
51
|
-
fetchStatus:
|
|
51
|
+
fetchStatus: n,
|
|
52
52
|
predicate: l,
|
|
53
53
|
queryKey: o,
|
|
54
54
|
stale: c
|
|
55
55
|
} = e;
|
|
56
56
|
if (o) {
|
|
57
57
|
if (r) {
|
|
58
|
-
if (t.queryHash !==
|
|
58
|
+
if (t.queryHash !== At(o, t.options))
|
|
59
59
|
return !1;
|
|
60
|
-
} else if (!
|
|
60
|
+
} else if (!He(t.queryKey, o))
|
|
61
61
|
return !1;
|
|
62
62
|
}
|
|
63
63
|
if (s !== "all") {
|
|
64
|
-
const
|
|
65
|
-
if (s === "active" && !
|
|
64
|
+
const m = t.isActive();
|
|
65
|
+
if (s === "active" && !m || s === "inactive" && m)
|
|
66
66
|
return !1;
|
|
67
67
|
}
|
|
68
|
-
return !(typeof c == "boolean" && t.isStale() !== c ||
|
|
68
|
+
return !(typeof c == "boolean" && t.isStale() !== c || n && n !== t.state.fetchStatus || l && !l(t));
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const { exact: s, status: r, predicate:
|
|
70
|
+
function Tt(e, t) {
|
|
71
|
+
const { exact: s, status: r, predicate: n, mutationKey: l } = e;
|
|
72
72
|
if (l) {
|
|
73
73
|
if (!t.options.mutationKey)
|
|
74
74
|
return !1;
|
|
75
75
|
if (s) {
|
|
76
|
-
if (
|
|
76
|
+
if (Ce(t.options.mutationKey) !== Ce(l))
|
|
77
77
|
return !1;
|
|
78
|
-
} else if (!
|
|
78
|
+
} else if (!He(t.options.mutationKey, l))
|
|
79
79
|
return !1;
|
|
80
80
|
}
|
|
81
|
-
return !(r && t.state.status !== r ||
|
|
81
|
+
return !(r && t.state.status !== r || n && !n(t));
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
return ((t == null ? void 0 : t.queryKeyHashFn) ||
|
|
83
|
+
function At(e, t) {
|
|
84
|
+
return ((t == null ? void 0 : t.queryKeyHashFn) || Ce)(e);
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function Ce(e) {
|
|
87
87
|
return JSON.stringify(
|
|
88
88
|
e,
|
|
89
|
-
(t, s) =>
|
|
89
|
+
(t, s) => pt(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? !Object.keys(t).some((s) => !
|
|
92
|
+
function He(e, t) {
|
|
93
|
+
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? !Object.keys(t).some((s) => !He(e[s], t[s])) : !1;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function os(e, t) {
|
|
96
96
|
if (e === t)
|
|
97
97
|
return e;
|
|
98
|
-
const s =
|
|
99
|
-
if (s ||
|
|
100
|
-
const r = s ? e : Object.keys(e),
|
|
101
|
-
let
|
|
102
|
-
for (let
|
|
103
|
-
const
|
|
104
|
-
!s && e[
|
|
98
|
+
const s = Ut(e) && Ut(t);
|
|
99
|
+
if (s || pt(e) && pt(t)) {
|
|
100
|
+
const r = s ? e : Object.keys(e), n = r.length, l = s ? t : Object.keys(t), o = l.length, c = s ? [] : {};
|
|
101
|
+
let m = 0;
|
|
102
|
+
for (let y = 0; y < o; y++) {
|
|
103
|
+
const d = s ? y : l[y];
|
|
104
|
+
(!s && r.includes(d) || s) && e[d] === void 0 && t[d] === void 0 ? (c[d] = void 0, m++) : (c[d] = os(e[d], t[d]), c[d] === e[d] && e[d] !== void 0 && m++);
|
|
105
105
|
}
|
|
106
|
-
return
|
|
106
|
+
return n === o && m === n ? e : c;
|
|
107
107
|
}
|
|
108
108
|
return t;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
if (
|
|
110
|
+
function it(e, t) {
|
|
111
|
+
if (!t || Object.keys(e).length !== Object.keys(t).length)
|
|
112
112
|
return !1;
|
|
113
113
|
for (const s in e)
|
|
114
114
|
if (e[s] !== t[s])
|
|
115
115
|
return !1;
|
|
116
116
|
return !0;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Ut(e) {
|
|
119
119
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
if (!
|
|
121
|
+
function pt(e) {
|
|
122
|
+
if (!Qt(e))
|
|
123
123
|
return !1;
|
|
124
124
|
const t = e.constructor;
|
|
125
|
-
if (
|
|
125
|
+
if (t === void 0)
|
|
126
126
|
return !0;
|
|
127
127
|
const s = t.prototype;
|
|
128
|
-
return !(!
|
|
128
|
+
return !(!Qt(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Qt(e) {
|
|
131
131
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Ys(e) {
|
|
134
134
|
return new Promise((t) => {
|
|
135
135
|
setTimeout(t, e);
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
return typeof s.structuralSharing == "function" ? s.structuralSharing(e, t) : s.structuralSharing !== !1 ?
|
|
138
|
+
function mt(e, t, s) {
|
|
139
|
+
return typeof s.structuralSharing == "function" ? s.structuralSharing(e, t) : s.structuralSharing !== !1 ? os(e, t) : t;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function zs(e, t, s = 0) {
|
|
142
142
|
const r = [...e, t];
|
|
143
143
|
return s && r.length > s ? r.slice(1) : r;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Js(e, t, s = 0) {
|
|
146
146
|
const r = [t, ...e];
|
|
147
147
|
return s && r.length > s ? r.slice(0, -1) : r;
|
|
148
148
|
}
|
|
149
|
-
var
|
|
149
|
+
var Nt = Symbol(), he, re, je, zt, Xs = (zt = class extends Ue {
|
|
150
150
|
constructor() {
|
|
151
151
|
super();
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
if (
|
|
152
|
+
g(this, he, void 0);
|
|
153
|
+
g(this, re, void 0);
|
|
154
|
+
g(this, je, void 0);
|
|
155
|
+
f(this, je, (t) => {
|
|
156
|
+
if (!Te && window.addEventListener) {
|
|
157
157
|
const s = () => t();
|
|
158
158
|
return window.addEventListener("visibilitychange", s, !1), () => {
|
|
159
159
|
window.removeEventListener("visibilitychange", s);
|
|
@@ -162,38 +162,39 @@ var fe, ne, Ee, es, Bs = (es = class extends Ke {
|
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
onSubscribe() {
|
|
165
|
-
|
|
165
|
+
a(this, re) || this.setEventListener(a(this, je));
|
|
166
166
|
}
|
|
167
167
|
onUnsubscribe() {
|
|
168
168
|
var t;
|
|
169
|
-
this.hasListeners() || ((t =
|
|
169
|
+
this.hasListeners() || ((t = a(this, re)) == null || t.call(this), f(this, re, void 0));
|
|
170
170
|
}
|
|
171
171
|
setEventListener(t) {
|
|
172
172
|
var s;
|
|
173
|
-
|
|
173
|
+
f(this, je, t), (s = a(this, re)) == null || s.call(this), f(this, re, t((r) => {
|
|
174
174
|
typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
|
|
175
175
|
}));
|
|
176
176
|
}
|
|
177
177
|
setFocused(t) {
|
|
178
|
-
|
|
178
|
+
a(this, he) !== t && (f(this, he, t), this.onFocus());
|
|
179
179
|
}
|
|
180
180
|
onFocus() {
|
|
181
|
-
this.
|
|
182
|
-
|
|
181
|
+
const t = this.isFocused();
|
|
182
|
+
this.listeners.forEach((s) => {
|
|
183
|
+
s(t);
|
|
183
184
|
});
|
|
184
185
|
}
|
|
185
186
|
isFocused() {
|
|
186
187
|
var t;
|
|
187
|
-
return typeof
|
|
188
|
+
return typeof a(this, he) == "boolean" ? a(this, he) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
|
|
188
189
|
}
|
|
189
|
-
},
|
|
190
|
+
}, he = new WeakMap(), re = new WeakMap(), je = new WeakMap(), zt), kt = new Xs(), _e, ie, Se, Jt, Is = (Jt = class extends Ue {
|
|
190
191
|
constructor() {
|
|
191
192
|
super();
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if (
|
|
193
|
+
g(this, _e, !0);
|
|
194
|
+
g(this, ie, void 0);
|
|
195
|
+
g(this, Se, void 0);
|
|
196
|
+
f(this, Se, (t) => {
|
|
197
|
+
if (!Te && window.addEventListener) {
|
|
197
198
|
const s = () => t(!0), r = () => t(!1);
|
|
198
199
|
return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
|
|
199
200
|
window.removeEventListener("online", s), window.removeEventListener("offline", r);
|
|
@@ -202,192 +203,190 @@ var fe, ne, Ee, es, Bs = (es = class extends Ke {
|
|
|
202
203
|
});
|
|
203
204
|
}
|
|
204
205
|
onSubscribe() {
|
|
205
|
-
|
|
206
|
+
a(this, ie) || this.setEventListener(a(this, Se));
|
|
206
207
|
}
|
|
207
208
|
onUnsubscribe() {
|
|
208
209
|
var t;
|
|
209
|
-
this.hasListeners() || ((t =
|
|
210
|
+
this.hasListeners() || ((t = a(this, ie)) == null || t.call(this), f(this, ie, void 0));
|
|
210
211
|
}
|
|
211
212
|
setEventListener(t) {
|
|
212
213
|
var s;
|
|
213
|
-
|
|
214
|
+
f(this, Se, t), (s = a(this, ie)) == null || s.call(this), f(this, ie, t(this.setOnline.bind(this)));
|
|
214
215
|
}
|
|
215
216
|
setOnline(t) {
|
|
216
|
-
|
|
217
|
+
a(this, _e) !== t && (f(this, _e, t), this.listeners.forEach((r) => {
|
|
217
218
|
r(t);
|
|
218
219
|
}));
|
|
219
220
|
}
|
|
220
221
|
isOnline() {
|
|
221
|
-
return
|
|
222
|
+
return a(this, _e);
|
|
222
223
|
}
|
|
223
|
-
},
|
|
224
|
-
function
|
|
224
|
+
}, _e = new WeakMap(), ie = new WeakMap(), Se = new WeakMap(), Jt), nt = new Is();
|
|
225
|
+
function Bs(e) {
|
|
225
226
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
226
227
|
}
|
|
227
|
-
function
|
|
228
|
-
return (e ?? "online") === "online" ?
|
|
228
|
+
function ls(e) {
|
|
229
|
+
return (e ?? "online") === "online" ? nt.isOnline() : !0;
|
|
229
230
|
}
|
|
230
|
-
var
|
|
231
|
+
var cs = class {
|
|
231
232
|
constructor(e) {
|
|
232
233
|
this.revert = e == null ? void 0 : e.revert, this.silent = e == null ? void 0 : e.silent;
|
|
233
234
|
}
|
|
234
235
|
};
|
|
235
|
-
function
|
|
236
|
-
return e instanceof
|
|
236
|
+
function dt(e) {
|
|
237
|
+
return e instanceof cs;
|
|
237
238
|
}
|
|
238
|
-
function
|
|
239
|
-
let t = !1, s = 0, r = !1,
|
|
240
|
-
const c = new Promise((
|
|
241
|
-
l =
|
|
242
|
-
}),
|
|
239
|
+
function us(e) {
|
|
240
|
+
let t = !1, s = 0, r = !1, n, l, o;
|
|
241
|
+
const c = new Promise((x, C) => {
|
|
242
|
+
l = x, o = C;
|
|
243
|
+
}), m = (x) => {
|
|
243
244
|
var C;
|
|
244
|
-
r || (
|
|
245
|
-
},
|
|
245
|
+
r || (E(new cs(x)), (C = e.abort) == null || C.call(e));
|
|
246
|
+
}, y = () => {
|
|
246
247
|
t = !0;
|
|
247
|
-
},
|
|
248
|
+
}, d = () => {
|
|
248
249
|
t = !1;
|
|
249
|
-
},
|
|
250
|
+
}, v = () => kt.isFocused() && (e.networkMode === "always" || nt.isOnline()) && e.canRun(), u = () => ls(e.networkMode) && e.canRun(), p = (x) => {
|
|
250
251
|
var C;
|
|
251
|
-
r || (r = !0, (C = e.onSuccess) == null || C.call(e,
|
|
252
|
-
},
|
|
252
|
+
r || (r = !0, (C = e.onSuccess) == null || C.call(e, x), n == null || n(), l(x));
|
|
253
|
+
}, E = (x) => {
|
|
253
254
|
var C;
|
|
254
|
-
r || (r = !0, (C = e.onError) == null || C.call(e,
|
|
255
|
-
},
|
|
255
|
+
r || (r = !0, (C = e.onError) == null || C.call(e, x), n == null || n(), o(x));
|
|
256
|
+
}, S = () => new Promise((x) => {
|
|
256
257
|
var C;
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
return _ && y(S), _;
|
|
258
|
+
n = (_) => {
|
|
259
|
+
(r || v()) && x(_);
|
|
260
260
|
}, (C = e.onPause) == null || C.call(e);
|
|
261
261
|
}).then(() => {
|
|
262
|
-
var
|
|
263
|
-
|
|
264
|
-
}),
|
|
262
|
+
var x;
|
|
263
|
+
n = void 0, r || (x = e.onContinue) == null || x.call(e);
|
|
264
|
+
}), j = () => {
|
|
265
265
|
if (r)
|
|
266
266
|
return;
|
|
267
|
-
let
|
|
267
|
+
let x;
|
|
268
268
|
try {
|
|
269
|
-
|
|
269
|
+
x = e.fn();
|
|
270
270
|
} catch (C) {
|
|
271
|
-
|
|
271
|
+
x = Promise.reject(C);
|
|
272
272
|
}
|
|
273
|
-
Promise.resolve(
|
|
274
|
-
var
|
|
273
|
+
Promise.resolve(x).then(p).catch((C) => {
|
|
274
|
+
var z;
|
|
275
275
|
if (r)
|
|
276
276
|
return;
|
|
277
|
-
const
|
|
278
|
-
if (t || !
|
|
279
|
-
|
|
277
|
+
const _ = e.retry ?? (Te ? 0 : 3), O = e.retryDelay ?? Bs, F = typeof O == "function" ? O(s, C) : O, Y = _ === !0 || typeof _ == "number" && s < _ || typeof _ == "function" && _(s, C);
|
|
278
|
+
if (t || !Y) {
|
|
279
|
+
E(C);
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
|
-
s++, (
|
|
283
|
-
|
|
284
|
-
return w();
|
|
285
|
-
}).then(() => {
|
|
286
|
-
t ? f(C) : E();
|
|
282
|
+
s++, (z = e.onFail) == null || z.call(e, s, C), Ys(F).then(() => v() ? void 0 : S()).then(() => {
|
|
283
|
+
t ? E(C) : j();
|
|
287
284
|
});
|
|
288
285
|
});
|
|
289
286
|
};
|
|
290
|
-
return
|
|
287
|
+
return {
|
|
291
288
|
promise: c,
|
|
292
|
-
cancel:
|
|
293
|
-
continue: () => (
|
|
294
|
-
cancelRetry:
|
|
295
|
-
continueRetry:
|
|
289
|
+
cancel: m,
|
|
290
|
+
continue: () => (n == null || n(), c),
|
|
291
|
+
cancelRetry: y,
|
|
292
|
+
continueRetry: d,
|
|
293
|
+
canStart: u,
|
|
294
|
+
start: () => (u() ? j() : S().then(j), c)
|
|
296
295
|
};
|
|
297
296
|
}
|
|
298
|
-
function
|
|
299
|
-
let e = [], t = 0, s = (
|
|
300
|
-
|
|
301
|
-
}, r = (
|
|
302
|
-
|
|
303
|
-
},
|
|
304
|
-
const l = (
|
|
305
|
-
|
|
306
|
-
}, o = (
|
|
307
|
-
let
|
|
297
|
+
function er() {
|
|
298
|
+
let e = [], t = 0, s = (u) => {
|
|
299
|
+
u();
|
|
300
|
+
}, r = (u) => {
|
|
301
|
+
u();
|
|
302
|
+
}, n = (u) => setTimeout(u, 0);
|
|
303
|
+
const l = (u) => {
|
|
304
|
+
n = u;
|
|
305
|
+
}, o = (u) => {
|
|
306
|
+
let p;
|
|
308
307
|
t++;
|
|
309
308
|
try {
|
|
310
|
-
|
|
309
|
+
p = u();
|
|
311
310
|
} finally {
|
|
312
|
-
t--, t ||
|
|
311
|
+
t--, t || y();
|
|
313
312
|
}
|
|
314
|
-
return
|
|
315
|
-
}, c = (
|
|
316
|
-
t ? e.push(
|
|
317
|
-
s(
|
|
313
|
+
return p;
|
|
314
|
+
}, c = (u) => {
|
|
315
|
+
t ? e.push(u) : n(() => {
|
|
316
|
+
s(u);
|
|
318
317
|
});
|
|
319
|
-
},
|
|
318
|
+
}, m = (u) => (...p) => {
|
|
320
319
|
c(() => {
|
|
321
|
-
|
|
320
|
+
u(...p);
|
|
322
321
|
});
|
|
323
|
-
},
|
|
324
|
-
const
|
|
325
|
-
e = [],
|
|
322
|
+
}, y = () => {
|
|
323
|
+
const u = e;
|
|
324
|
+
e = [], u.length && n(() => {
|
|
326
325
|
r(() => {
|
|
327
|
-
|
|
328
|
-
s(
|
|
326
|
+
u.forEach((p) => {
|
|
327
|
+
s(p);
|
|
329
328
|
});
|
|
330
329
|
});
|
|
331
330
|
});
|
|
332
331
|
};
|
|
333
332
|
return {
|
|
334
333
|
batch: o,
|
|
335
|
-
batchCalls:
|
|
334
|
+
batchCalls: m,
|
|
336
335
|
schedule: c,
|
|
337
|
-
setNotifyFunction: (
|
|
338
|
-
s =
|
|
336
|
+
setNotifyFunction: (u) => {
|
|
337
|
+
s = u;
|
|
339
338
|
},
|
|
340
|
-
setBatchNotifyFunction: (
|
|
341
|
-
r =
|
|
339
|
+
setBatchNotifyFunction: (u) => {
|
|
340
|
+
r = u;
|
|
342
341
|
},
|
|
343
342
|
setScheduler: l
|
|
344
343
|
};
|
|
345
344
|
}
|
|
346
|
-
var R =
|
|
345
|
+
var R = er(), de, Xt, hs = (Xt = class {
|
|
347
346
|
constructor() {
|
|
348
|
-
|
|
347
|
+
g(this, de, void 0);
|
|
349
348
|
}
|
|
350
349
|
destroy() {
|
|
351
350
|
this.clearGcTimeout();
|
|
352
351
|
}
|
|
353
352
|
scheduleGc() {
|
|
354
|
-
this.clearGcTimeout(),
|
|
353
|
+
this.clearGcTimeout(), ft(this.gcTime) && f(this, de, setTimeout(() => {
|
|
355
354
|
this.optionalRemove();
|
|
356
355
|
}, this.gcTime));
|
|
357
356
|
}
|
|
358
357
|
updateGcTime(e) {
|
|
359
358
|
this.gcTime = Math.max(
|
|
360
359
|
this.gcTime || 0,
|
|
361
|
-
e ?? (
|
|
360
|
+
e ?? (Te ? 1 / 0 : 5 * 60 * 1e3)
|
|
362
361
|
);
|
|
363
362
|
}
|
|
364
363
|
clearGcTimeout() {
|
|
365
|
-
|
|
364
|
+
a(this, de) && (clearTimeout(a(this, de)), f(this, de, void 0));
|
|
366
365
|
}
|
|
367
|
-
},
|
|
366
|
+
}, de = new WeakMap(), Xt), Ee, Pe, G, D, $e, fe, Z, ee, It, tr = (It = class extends hs {
|
|
368
367
|
constructor(t) {
|
|
369
368
|
super();
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
p(this, qe, void 0);
|
|
379
|
-
p(this, me, void 0);
|
|
380
|
-
h(this, me, !1), h(this, qe, t.defaultOptions), b(this, Ne, ot).call(this, t.options), h(this, D, []), h(this, q, t.cache), this.queryKey = t.queryKey, this.queryHash = t.queryHash, h(this, Pe, t.state || ir(this.options)), this.state = n(this, Pe), this.scheduleGc();
|
|
369
|
+
g(this, Z);
|
|
370
|
+
g(this, Ee, void 0);
|
|
371
|
+
g(this, Pe, void 0);
|
|
372
|
+
g(this, G, void 0);
|
|
373
|
+
g(this, D, void 0);
|
|
374
|
+
g(this, $e, void 0);
|
|
375
|
+
g(this, fe, void 0);
|
|
376
|
+
f(this, fe, !1), f(this, $e, t.defaultOptions), this.setOptions(t.options), this.observers = [], f(this, G, t.cache), this.queryKey = t.queryKey, this.queryHash = t.queryHash, f(this, Ee, t.state || sr(this.options)), this.state = a(this, Ee), this.scheduleGc();
|
|
381
377
|
}
|
|
382
378
|
get meta() {
|
|
383
379
|
return this.options.meta;
|
|
384
380
|
}
|
|
381
|
+
setOptions(t) {
|
|
382
|
+
this.options = { ...a(this, $e), ...t }, this.updateGcTime(this.options.gcTime);
|
|
383
|
+
}
|
|
385
384
|
optionalRemove() {
|
|
386
|
-
!
|
|
385
|
+
!this.observers.length && this.state.fetchStatus === "idle" && a(this, G).remove(this);
|
|
387
386
|
}
|
|
388
387
|
setData(t, s) {
|
|
389
|
-
const r =
|
|
390
|
-
return b(this,
|
|
388
|
+
const r = mt(this.state.data, t, this.options);
|
|
389
|
+
return b(this, Z, ee).call(this, {
|
|
391
390
|
data: r,
|
|
392
391
|
type: "success",
|
|
393
392
|
dataUpdatedAt: s == null ? void 0 : s.updatedAt,
|
|
@@ -395,146 +394,145 @@ var R = sr(), pe, ss, ms = (ss = class {
|
|
|
395
394
|
}), r;
|
|
396
395
|
}
|
|
397
396
|
setState(t, s) {
|
|
398
|
-
b(this,
|
|
397
|
+
b(this, Z, ee).call(this, { type: "setState", state: t, setStateOptions: s });
|
|
399
398
|
}
|
|
400
399
|
cancel(t) {
|
|
401
|
-
var r;
|
|
402
|
-
const s =
|
|
403
|
-
return (
|
|
400
|
+
var r, n;
|
|
401
|
+
const s = (r = a(this, D)) == null ? void 0 : r.promise;
|
|
402
|
+
return (n = a(this, D)) == null || n.cancel(t), s ? s.then(V).catch(V) : Promise.resolve();
|
|
404
403
|
}
|
|
405
404
|
destroy() {
|
|
406
405
|
super.destroy(), this.cancel({ silent: !0 });
|
|
407
406
|
}
|
|
408
407
|
reset() {
|
|
409
|
-
this.destroy(), this.setState(
|
|
408
|
+
this.destroy(), this.setState(a(this, Ee));
|
|
410
409
|
}
|
|
411
410
|
isActive() {
|
|
412
|
-
return
|
|
413
|
-
(t) => t.options.enabled !== !1
|
|
414
|
-
);
|
|
411
|
+
return this.observers.some((t) => t.options.enabled !== !1);
|
|
415
412
|
}
|
|
416
413
|
isDisabled() {
|
|
417
414
|
return this.getObserversCount() > 0 && !this.isActive();
|
|
418
415
|
}
|
|
419
416
|
isStale() {
|
|
420
|
-
return this.state.isInvalidated
|
|
417
|
+
return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
|
|
418
|
+
(t) => t.getCurrentResult().isStale
|
|
419
|
+
) : this.state.data === void 0;
|
|
421
420
|
}
|
|
422
421
|
isStaleByTime(t = 0) {
|
|
423
|
-
return this.state.isInvalidated ||
|
|
422
|
+
return this.state.isInvalidated || this.state.data === void 0 || !as(this.state.dataUpdatedAt, t);
|
|
424
423
|
}
|
|
425
424
|
onFocus() {
|
|
426
425
|
var s;
|
|
427
|
-
const t =
|
|
428
|
-
t == null || t.refetch({ cancelRefetch: !1 }), (s =
|
|
426
|
+
const t = this.observers.find((r) => r.shouldFetchOnWindowFocus());
|
|
427
|
+
t == null || t.refetch({ cancelRefetch: !1 }), (s = a(this, D)) == null || s.continue();
|
|
429
428
|
}
|
|
430
429
|
onOnline() {
|
|
431
430
|
var s;
|
|
432
|
-
const t =
|
|
433
|
-
t == null || t.refetch({ cancelRefetch: !1 }), (s =
|
|
431
|
+
const t = this.observers.find((r) => r.shouldFetchOnReconnect());
|
|
432
|
+
t == null || t.refetch({ cancelRefetch: !1 }), (s = a(this, D)) == null || s.continue();
|
|
434
433
|
}
|
|
435
434
|
addObserver(t) {
|
|
436
|
-
|
|
435
|
+
this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), a(this, G).notify({ type: "observerAdded", query: this, observer: t }));
|
|
437
436
|
}
|
|
438
437
|
removeObserver(t) {
|
|
439
|
-
|
|
438
|
+
this.observers.includes(t) && (this.observers = this.observers.filter((s) => s !== t), this.observers.length || (a(this, D) && (a(this, fe) ? a(this, D).cancel({ revert: !0 }) : a(this, D).cancelRetry()), this.scheduleGc()), a(this, G).notify({ type: "observerRemoved", query: this, observer: t }));
|
|
440
439
|
}
|
|
441
440
|
getObserversCount() {
|
|
442
|
-
return
|
|
441
|
+
return this.observers.length;
|
|
443
442
|
}
|
|
444
443
|
invalidate() {
|
|
445
|
-
this.state.isInvalidated || b(this,
|
|
444
|
+
this.state.isInvalidated || b(this, Z, ee).call(this, { type: "invalidate" });
|
|
446
445
|
}
|
|
447
446
|
fetch(t, s) {
|
|
448
|
-
var
|
|
447
|
+
var y, d, v;
|
|
449
448
|
if (this.state.fetchStatus !== "idle") {
|
|
450
|
-
if (this.state.
|
|
449
|
+
if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
|
|
451
450
|
this.cancel({ silent: !0 });
|
|
452
|
-
else if (
|
|
453
|
-
return (
|
|
451
|
+
else if (a(this, D))
|
|
452
|
+
return a(this, D).continueRetry(), a(this, D).promise;
|
|
454
453
|
}
|
|
455
|
-
if (t &&
|
|
456
|
-
const
|
|
457
|
-
|
|
454
|
+
if (t && this.setOptions(t), !this.options.queryFn) {
|
|
455
|
+
const u = this.observers.find((p) => p.options.queryFn);
|
|
456
|
+
u && this.setOptions(u.options);
|
|
458
457
|
}
|
|
459
|
-
const r = new AbortController(),
|
|
458
|
+
const r = new AbortController(), n = {
|
|
460
459
|
queryKey: this.queryKey,
|
|
461
460
|
meta: this.meta
|
|
462
|
-
}, l = (
|
|
463
|
-
Object.defineProperty(
|
|
461
|
+
}, l = (u) => {
|
|
462
|
+
Object.defineProperty(u, "signal", {
|
|
464
463
|
enumerable: !0,
|
|
465
|
-
get: () => (
|
|
464
|
+
get: () => (f(this, fe, !0), r.signal)
|
|
466
465
|
});
|
|
467
466
|
};
|
|
468
|
-
l(
|
|
469
|
-
const o = () => this.options.queryFn
|
|
467
|
+
l(n);
|
|
468
|
+
const o = () => !this.options.queryFn || this.options.queryFn === Nt ? Promise.reject(
|
|
469
|
+
new Error(`Missing queryFn: '${this.options.queryHash}'`)
|
|
470
|
+
) : (f(this, fe, !1), this.options.persister ? this.options.persister(
|
|
470
471
|
this.options.queryFn,
|
|
471
|
-
|
|
472
|
+
n,
|
|
472
473
|
this
|
|
473
474
|
) : this.options.queryFn(
|
|
474
|
-
|
|
475
|
-
))
|
|
476
|
-
new Error(`Missing queryFn: '${this.options.queryHash}'`)
|
|
477
|
-
), c = {
|
|
475
|
+
n
|
|
476
|
+
)), c = {
|
|
478
477
|
fetchOptions: s,
|
|
479
478
|
options: this.options,
|
|
480
479
|
queryKey: this.queryKey,
|
|
481
480
|
state: this.state,
|
|
482
481
|
fetchFn: o
|
|
483
482
|
};
|
|
484
|
-
l(c), (
|
|
483
|
+
l(c), (y = this.options.behavior) == null || y.onFetch(
|
|
485
484
|
c,
|
|
486
485
|
this
|
|
487
|
-
),
|
|
488
|
-
const
|
|
489
|
-
var
|
|
490
|
-
|
|
486
|
+
), f(this, Pe, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((d = c.fetchOptions) == null ? void 0 : d.meta)) && b(this, Z, ee).call(this, { type: "fetch", meta: (v = c.fetchOptions) == null ? void 0 : v.meta });
|
|
487
|
+
const m = (u) => {
|
|
488
|
+
var p, E, S, j;
|
|
489
|
+
dt(u) && u.silent || b(this, Z, ee).call(this, {
|
|
491
490
|
type: "error",
|
|
492
|
-
error:
|
|
493
|
-
}),
|
|
494
|
-
|
|
495
|
-
|
|
491
|
+
error: u
|
|
492
|
+
}), dt(u) || ((E = (p = a(this, G).config).onError) == null || E.call(
|
|
493
|
+
p,
|
|
494
|
+
u,
|
|
496
495
|
this
|
|
497
|
-
), (
|
|
498
|
-
|
|
496
|
+
), (j = (S = a(this, G).config).onSettled) == null || j.call(
|
|
497
|
+
S,
|
|
499
498
|
this.state.data,
|
|
500
|
-
|
|
499
|
+
u,
|
|
501
500
|
this
|
|
502
501
|
)), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
503
502
|
};
|
|
504
|
-
return
|
|
503
|
+
return f(this, D, us({
|
|
505
504
|
fn: c.fetchFn,
|
|
506
505
|
abort: r.abort.bind(r),
|
|
507
|
-
onSuccess: (
|
|
508
|
-
var
|
|
509
|
-
if (
|
|
510
|
-
|
|
506
|
+
onSuccess: (u) => {
|
|
507
|
+
var p, E, S, j;
|
|
508
|
+
if (u === void 0) {
|
|
509
|
+
m(new Error(`${this.queryHash} data is undefined`));
|
|
511
510
|
return;
|
|
512
511
|
}
|
|
513
|
-
this.setData(
|
|
514
|
-
|
|
515
|
-
|
|
512
|
+
this.setData(u), (E = (p = a(this, G).config).onSuccess) == null || E.call(p, u, this), (j = (S = a(this, G).config).onSettled) == null || j.call(
|
|
513
|
+
S,
|
|
514
|
+
u,
|
|
516
515
|
this.state.error,
|
|
517
516
|
this
|
|
518
517
|
), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
519
518
|
},
|
|
520
|
-
onError:
|
|
521
|
-
onFail: (
|
|
522
|
-
b(this,
|
|
519
|
+
onError: m,
|
|
520
|
+
onFail: (u, p) => {
|
|
521
|
+
b(this, Z, ee).call(this, { type: "failed", failureCount: u, error: p });
|
|
523
522
|
},
|
|
524
523
|
onPause: () => {
|
|
525
|
-
b(this,
|
|
524
|
+
b(this, Z, ee).call(this, { type: "pause" });
|
|
526
525
|
},
|
|
527
526
|
onContinue: () => {
|
|
528
|
-
b(this,
|
|
527
|
+
b(this, Z, ee).call(this, { type: "continue" });
|
|
529
528
|
},
|
|
530
529
|
retry: c.options.retry,
|
|
531
530
|
retryDelay: c.options.retryDelay,
|
|
532
|
-
networkMode: c.options.networkMode
|
|
533
|
-
|
|
531
|
+
networkMode: c.options.networkMode,
|
|
532
|
+
canRun: () => !0
|
|
533
|
+
})), a(this, D).start();
|
|
534
534
|
}
|
|
535
|
-
},
|
|
536
|
-
this.options = { ...n(this, qe), ...t }, this.updateGcTime(this.options.gcTime);
|
|
537
|
-
}, z = new WeakSet(), te = function(t) {
|
|
535
|
+
}, Ee = new WeakMap(), Pe = new WeakMap(), G = new WeakMap(), D = new WeakMap(), $e = new WeakMap(), fe = new WeakMap(), Z = new WeakSet(), ee = function(t) {
|
|
538
536
|
const s = (r) => {
|
|
539
537
|
switch (t.type) {
|
|
540
538
|
case "failed":
|
|
@@ -556,14 +554,8 @@ var R = sr(), pe, ss, ms = (ss = class {
|
|
|
556
554
|
case "fetch":
|
|
557
555
|
return {
|
|
558
556
|
...r,
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
fetchMeta: t.meta ?? null,
|
|
562
|
-
fetchStatus: vt(this.options.networkMode) ? "fetching" : "paused",
|
|
563
|
-
...!r.dataUpdatedAt && {
|
|
564
|
-
error: null,
|
|
565
|
-
status: "pending"
|
|
566
|
-
}
|
|
557
|
+
...ds(r.data, this.options),
|
|
558
|
+
fetchMeta: t.meta ?? null
|
|
567
559
|
};
|
|
568
560
|
case "success":
|
|
569
561
|
return {
|
|
@@ -581,14 +573,14 @@ var R = sr(), pe, ss, ms = (ss = class {
|
|
|
581
573
|
}
|
|
582
574
|
};
|
|
583
575
|
case "error":
|
|
584
|
-
const
|
|
585
|
-
return
|
|
576
|
+
const n = t.error;
|
|
577
|
+
return dt(n) && n.revert && a(this, Pe) ? { ...a(this, Pe), fetchStatus: "idle" } : {
|
|
586
578
|
...r,
|
|
587
|
-
error:
|
|
579
|
+
error: n,
|
|
588
580
|
errorUpdateCount: r.errorUpdateCount + 1,
|
|
589
581
|
errorUpdatedAt: Date.now(),
|
|
590
582
|
fetchFailureCount: r.fetchFailureCount + 1,
|
|
591
|
-
fetchFailureReason:
|
|
583
|
+
fetchFailureReason: n,
|
|
592
584
|
fetchStatus: "idle",
|
|
593
585
|
status: "error"
|
|
594
586
|
};
|
|
@@ -605,13 +597,24 @@ var R = sr(), pe, ss, ms = (ss = class {
|
|
|
605
597
|
}
|
|
606
598
|
};
|
|
607
599
|
this.state = s(this.state), R.batch(() => {
|
|
608
|
-
|
|
600
|
+
this.observers.forEach((r) => {
|
|
609
601
|
r.onQueryUpdate();
|
|
610
|
-
}),
|
|
602
|
+
}), a(this, G).notify({ query: this, type: "updated", action: t });
|
|
611
603
|
});
|
|
612
|
-
},
|
|
613
|
-
function
|
|
614
|
-
|
|
604
|
+
}, It);
|
|
605
|
+
function ds(e, t) {
|
|
606
|
+
return {
|
|
607
|
+
fetchFailureCount: 0,
|
|
608
|
+
fetchFailureReason: null,
|
|
609
|
+
fetchStatus: ls(t.networkMode) ? "fetching" : "paused",
|
|
610
|
+
...e === void 0 && {
|
|
611
|
+
error: null,
|
|
612
|
+
status: "pending"
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
function sr(e) {
|
|
617
|
+
const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, s = t !== void 0, r = s ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
|
|
615
618
|
return {
|
|
616
619
|
data: t,
|
|
617
620
|
dataUpdateCount: 0,
|
|
@@ -627,33 +630,33 @@ function ir(e) {
|
|
|
627
630
|
fetchStatus: "idle"
|
|
628
631
|
};
|
|
629
632
|
}
|
|
630
|
-
var J,
|
|
633
|
+
var J, Bt, rr = (Bt = class extends Ue {
|
|
631
634
|
constructor(t = {}) {
|
|
632
635
|
super();
|
|
633
|
-
|
|
634
|
-
this.config = t,
|
|
636
|
+
g(this, J, void 0);
|
|
637
|
+
this.config = t, f(this, J, /* @__PURE__ */ new Map());
|
|
635
638
|
}
|
|
636
639
|
build(t, s, r) {
|
|
637
|
-
const
|
|
640
|
+
const n = s.queryKey, l = s.queryHash ?? At(n, s);
|
|
638
641
|
let o = this.get(l);
|
|
639
|
-
return o || (o = new
|
|
642
|
+
return o || (o = new tr({
|
|
640
643
|
cache: this,
|
|
641
|
-
queryKey:
|
|
644
|
+
queryKey: n,
|
|
642
645
|
queryHash: l,
|
|
643
646
|
options: t.defaultQueryOptions(s),
|
|
644
647
|
state: r,
|
|
645
|
-
defaultOptions: t.getQueryDefaults(
|
|
648
|
+
defaultOptions: t.getQueryDefaults(n)
|
|
646
649
|
}), this.add(o)), o;
|
|
647
650
|
}
|
|
648
651
|
add(t) {
|
|
649
|
-
|
|
652
|
+
a(this, J).has(t.queryHash) || (a(this, J).set(t.queryHash, t), this.notify({
|
|
650
653
|
type: "added",
|
|
651
654
|
query: t
|
|
652
655
|
}));
|
|
653
656
|
}
|
|
654
657
|
remove(t) {
|
|
655
|
-
const s =
|
|
656
|
-
s && (t.destroy(), s === t &&
|
|
658
|
+
const s = a(this, J).get(t.queryHash);
|
|
659
|
+
s && (t.destroy(), s === t && a(this, J).delete(t.queryHash), this.notify({ type: "removed", query: t }));
|
|
657
660
|
}
|
|
658
661
|
clear() {
|
|
659
662
|
R.batch(() => {
|
|
@@ -663,20 +666,20 @@ var J, is, nr = (is = class extends Ke {
|
|
|
663
666
|
});
|
|
664
667
|
}
|
|
665
668
|
get(t) {
|
|
666
|
-
return
|
|
669
|
+
return a(this, J).get(t);
|
|
667
670
|
}
|
|
668
671
|
getAll() {
|
|
669
|
-
return [...
|
|
672
|
+
return [...a(this, J).values()];
|
|
670
673
|
}
|
|
671
674
|
find(t) {
|
|
672
675
|
const s = { exact: !0, ...t };
|
|
673
676
|
return this.getAll().find(
|
|
674
|
-
(r) =>
|
|
677
|
+
(r) => Dt(s, r)
|
|
675
678
|
);
|
|
676
679
|
}
|
|
677
680
|
findAll(t = {}) {
|
|
678
681
|
const s = this.getAll();
|
|
679
|
-
return Object.keys(t).length > 0 ? s.filter((r) =>
|
|
682
|
+
return Object.keys(t).length > 0 ? s.filter((r) => Dt(t, r)) : s;
|
|
680
683
|
}
|
|
681
684
|
notify(t) {
|
|
682
685
|
R.batch(() => {
|
|
@@ -699,123 +702,127 @@ var J, is, nr = (is = class extends Ke {
|
|
|
699
702
|
});
|
|
700
703
|
});
|
|
701
704
|
}
|
|
702
|
-
}, J = new WeakMap(),
|
|
705
|
+
}, J = new WeakMap(), Bt), X, T, pe, I, se, es, ir = (es = class extends hs {
|
|
703
706
|
constructor(t) {
|
|
704
707
|
super();
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
this.mutationId = t.mutationId, h(this, We, t.defaultOptions), h(this, K, t.mutationCache), h(this, X, []), this.state = t.state || vs(), this.setOptions(t.options), this.scheduleGc();
|
|
708
|
+
g(this, I);
|
|
709
|
+
g(this, X, void 0);
|
|
710
|
+
g(this, T, void 0);
|
|
711
|
+
g(this, pe, void 0);
|
|
712
|
+
this.mutationId = t.mutationId, f(this, T, t.mutationCache), f(this, X, []), this.state = t.state || fs(), this.setOptions(t.options), this.scheduleGc();
|
|
711
713
|
}
|
|
712
714
|
setOptions(t) {
|
|
713
|
-
this.options =
|
|
715
|
+
this.options = t, this.updateGcTime(this.options.gcTime);
|
|
714
716
|
}
|
|
715
717
|
get meta() {
|
|
716
718
|
return this.options.meta;
|
|
717
719
|
}
|
|
718
720
|
addObserver(t) {
|
|
719
|
-
|
|
721
|
+
a(this, X).includes(t) || (a(this, X).push(t), this.clearGcTimeout(), a(this, T).notify({
|
|
720
722
|
type: "observerAdded",
|
|
721
723
|
mutation: this,
|
|
722
724
|
observer: t
|
|
723
725
|
}));
|
|
724
726
|
}
|
|
725
727
|
removeObserver(t) {
|
|
726
|
-
|
|
728
|
+
f(this, X, a(this, X).filter((s) => s !== t)), this.scheduleGc(), a(this, T).notify({
|
|
727
729
|
type: "observerRemoved",
|
|
728
730
|
mutation: this,
|
|
729
731
|
observer: t
|
|
730
732
|
});
|
|
731
733
|
}
|
|
732
734
|
optionalRemove() {
|
|
733
|
-
|
|
735
|
+
a(this, X).length || (this.state.status === "pending" ? this.scheduleGc() : a(this, T).remove(this));
|
|
734
736
|
}
|
|
735
737
|
continue() {
|
|
736
738
|
var t;
|
|
737
|
-
return ((t =
|
|
739
|
+
return ((t = a(this, pe)) == null ? void 0 : t.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
|
|
738
740
|
this.execute(this.state.variables);
|
|
739
741
|
}
|
|
740
742
|
async execute(t) {
|
|
741
|
-
var
|
|
742
|
-
|
|
743
|
+
var n, l, o, c, m, y, d, v, u, p, E, S, j, x, C, _, O, F, Y, z;
|
|
744
|
+
f(this, pe, us({
|
|
743
745
|
fn: () => this.options.mutationFn ? this.options.mutationFn(t) : Promise.reject(new Error("No mutationFn found")),
|
|
744
|
-
onFail: (
|
|
745
|
-
b(this, I,
|
|
746
|
+
onFail: (P, W) => {
|
|
747
|
+
b(this, I, se).call(this, { type: "failed", failureCount: P, error: W });
|
|
746
748
|
},
|
|
747
749
|
onPause: () => {
|
|
748
|
-
b(this, I,
|
|
750
|
+
b(this, I, se).call(this, { type: "pause" });
|
|
749
751
|
},
|
|
750
752
|
onContinue: () => {
|
|
751
|
-
b(this, I,
|
|
753
|
+
b(this, I, se).call(this, { type: "continue" });
|
|
752
754
|
},
|
|
753
755
|
retry: this.options.retry ?? 0,
|
|
754
756
|
retryDelay: this.options.retryDelay,
|
|
755
|
-
networkMode: this.options.networkMode
|
|
756
|
-
|
|
757
|
+
networkMode: this.options.networkMode,
|
|
758
|
+
canRun: () => a(this, T).canRun(this)
|
|
759
|
+
}));
|
|
760
|
+
const s = this.state.status === "pending", r = !a(this, pe).canStart();
|
|
757
761
|
try {
|
|
758
|
-
if (!
|
|
759
|
-
b(this, I,
|
|
760
|
-
|
|
762
|
+
if (!s) {
|
|
763
|
+
b(this, I, se).call(this, { type: "pending", variables: t, isPaused: r }), await ((l = (n = a(this, T).config).onMutate) == null ? void 0 : l.call(
|
|
764
|
+
n,
|
|
761
765
|
t,
|
|
762
766
|
this
|
|
763
767
|
));
|
|
764
|
-
const
|
|
765
|
-
|
|
768
|
+
const W = await ((c = (o = this.options).onMutate) == null ? void 0 : c.call(o, t));
|
|
769
|
+
W !== this.state.context && b(this, I, se).call(this, {
|
|
766
770
|
type: "pending",
|
|
767
|
-
context:
|
|
768
|
-
variables: t
|
|
771
|
+
context: W,
|
|
772
|
+
variables: t,
|
|
773
|
+
isPaused: r
|
|
769
774
|
});
|
|
770
775
|
}
|
|
771
|
-
const
|
|
772
|
-
return await ((
|
|
773
|
-
|
|
774
|
-
|
|
776
|
+
const P = await a(this, pe).start();
|
|
777
|
+
return await ((y = (m = a(this, T).config).onSuccess) == null ? void 0 : y.call(
|
|
778
|
+
m,
|
|
779
|
+
P,
|
|
775
780
|
t,
|
|
776
781
|
this.state.context,
|
|
777
782
|
this
|
|
778
|
-
)), await ((
|
|
779
|
-
|
|
780
|
-
|
|
783
|
+
)), await ((v = (d = this.options).onSuccess) == null ? void 0 : v.call(d, P, t, this.state.context)), await ((p = (u = a(this, T).config).onSettled) == null ? void 0 : p.call(
|
|
784
|
+
u,
|
|
785
|
+
P,
|
|
781
786
|
null,
|
|
782
787
|
this.state.variables,
|
|
783
788
|
this.state.context,
|
|
784
789
|
this
|
|
785
|
-
)), await ((
|
|
786
|
-
} catch (
|
|
790
|
+
)), await ((S = (E = this.options).onSettled) == null ? void 0 : S.call(E, P, null, t, this.state.context)), b(this, I, se).call(this, { type: "success", data: P }), P;
|
|
791
|
+
} catch (P) {
|
|
787
792
|
try {
|
|
788
|
-
throw await ((
|
|
789
|
-
|
|
790
|
-
|
|
793
|
+
throw await ((x = (j = a(this, T).config).onError) == null ? void 0 : x.call(
|
|
794
|
+
j,
|
|
795
|
+
P,
|
|
791
796
|
t,
|
|
792
797
|
this.state.context,
|
|
793
798
|
this
|
|
794
|
-
)), await ((_ = (
|
|
795
|
-
|
|
796
|
-
|
|
799
|
+
)), await ((_ = (C = this.options).onError) == null ? void 0 : _.call(
|
|
800
|
+
C,
|
|
801
|
+
P,
|
|
797
802
|
t,
|
|
798
803
|
this.state.context
|
|
799
|
-
)), await ((
|
|
800
|
-
|
|
804
|
+
)), await ((F = (O = a(this, T).config).onSettled) == null ? void 0 : F.call(
|
|
805
|
+
O,
|
|
801
806
|
void 0,
|
|
802
|
-
|
|
807
|
+
P,
|
|
803
808
|
this.state.variables,
|
|
804
809
|
this.state.context,
|
|
805
810
|
this
|
|
806
|
-
)), await ((
|
|
807
|
-
|
|
811
|
+
)), await ((z = (Y = this.options).onSettled) == null ? void 0 : z.call(
|
|
812
|
+
Y,
|
|
808
813
|
void 0,
|
|
809
|
-
|
|
814
|
+
P,
|
|
810
815
|
t,
|
|
811
816
|
this.state.context
|
|
812
|
-
)),
|
|
817
|
+
)), P;
|
|
813
818
|
} finally {
|
|
814
|
-
b(this, I,
|
|
819
|
+
b(this, I, se).call(this, { type: "error", error: P });
|
|
815
820
|
}
|
|
821
|
+
} finally {
|
|
822
|
+
a(this, T).runNext(this);
|
|
816
823
|
}
|
|
817
824
|
}
|
|
818
|
-
}, X = new WeakMap(),
|
|
825
|
+
}, X = new WeakMap(), T = new WeakMap(), pe = new WeakMap(), I = new WeakSet(), se = function(t) {
|
|
819
826
|
const s = (r) => {
|
|
820
827
|
switch (t.type) {
|
|
821
828
|
case "failed":
|
|
@@ -842,7 +849,7 @@ var J, is, nr = (is = class extends Ke {
|
|
|
842
849
|
failureCount: 0,
|
|
843
850
|
failureReason: null,
|
|
844
851
|
error: null,
|
|
845
|
-
isPaused:
|
|
852
|
+
isPaused: t.isPaused,
|
|
846
853
|
status: "pending",
|
|
847
854
|
variables: t.variables,
|
|
848
855
|
submittedAt: Date.now()
|
|
@@ -870,16 +877,16 @@ var J, is, nr = (is = class extends Ke {
|
|
|
870
877
|
}
|
|
871
878
|
};
|
|
872
879
|
this.state = s(this.state), R.batch(() => {
|
|
873
|
-
|
|
880
|
+
a(this, X).forEach((r) => {
|
|
874
881
|
r.onMutationUpdate(t);
|
|
875
|
-
}),
|
|
882
|
+
}), a(this, T).notify({
|
|
876
883
|
mutation: this,
|
|
877
884
|
type: "updated",
|
|
878
885
|
action: t
|
|
879
886
|
});
|
|
880
887
|
});
|
|
881
|
-
},
|
|
882
|
-
function
|
|
888
|
+
}, es);
|
|
889
|
+
function fs() {
|
|
883
890
|
return {
|
|
884
891
|
context: void 0,
|
|
885
892
|
data: void 0,
|
|
@@ -892,49 +899,63 @@ function vs() {
|
|
|
892
899
|
submittedAt: 0
|
|
893
900
|
};
|
|
894
901
|
}
|
|
895
|
-
var
|
|
902
|
+
var K, Ke, ts, nr = (ts = class extends Ue {
|
|
896
903
|
constructor(t = {}) {
|
|
897
904
|
super();
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
this.config = t, h(this, Z, []), h(this, Ze, 0);
|
|
905
|
+
g(this, K, void 0);
|
|
906
|
+
g(this, Ke, void 0);
|
|
907
|
+
this.config = t, f(this, K, /* @__PURE__ */ new Map()), f(this, Ke, Date.now());
|
|
902
908
|
}
|
|
903
909
|
build(t, s, r) {
|
|
904
|
-
const
|
|
910
|
+
const n = new ir({
|
|
905
911
|
mutationCache: this,
|
|
906
|
-
mutationId: ++
|
|
912
|
+
mutationId: ++tt(this, Ke)._,
|
|
907
913
|
options: t.defaultMutationOptions(s),
|
|
908
914
|
state: r
|
|
909
915
|
});
|
|
910
|
-
return this.add(
|
|
916
|
+
return this.add(n), n;
|
|
911
917
|
}
|
|
912
918
|
add(t) {
|
|
913
|
-
|
|
919
|
+
const s = st(t), r = a(this, K).get(s) ?? [];
|
|
920
|
+
r.push(t), a(this, K).set(s, r), this.notify({ type: "added", mutation: t });
|
|
914
921
|
}
|
|
915
922
|
remove(t) {
|
|
916
|
-
|
|
923
|
+
var r;
|
|
924
|
+
const s = st(t);
|
|
925
|
+
if (a(this, K).has(s)) {
|
|
926
|
+
const n = (r = a(this, K).get(s)) == null ? void 0 : r.filter((l) => l !== t);
|
|
927
|
+
n && (n.length === 0 ? a(this, K).delete(s) : a(this, K).set(s, n));
|
|
928
|
+
}
|
|
929
|
+
this.notify({ type: "removed", mutation: t });
|
|
930
|
+
}
|
|
931
|
+
canRun(t) {
|
|
932
|
+
var r;
|
|
933
|
+
const s = (r = a(this, K).get(st(t))) == null ? void 0 : r.find((n) => n.state.status === "pending");
|
|
934
|
+
return !s || s === t;
|
|
935
|
+
}
|
|
936
|
+
runNext(t) {
|
|
937
|
+
var r;
|
|
938
|
+
const s = (r = a(this, K).get(st(t))) == null ? void 0 : r.find((n) => n !== t && n.state.isPaused);
|
|
939
|
+
return (s == null ? void 0 : s.continue()) ?? Promise.resolve();
|
|
917
940
|
}
|
|
918
941
|
clear() {
|
|
919
942
|
R.batch(() => {
|
|
920
|
-
|
|
943
|
+
this.getAll().forEach((t) => {
|
|
921
944
|
this.remove(t);
|
|
922
945
|
});
|
|
923
946
|
});
|
|
924
947
|
}
|
|
925
948
|
getAll() {
|
|
926
|
-
return
|
|
949
|
+
return [...a(this, K).values()].flat();
|
|
927
950
|
}
|
|
928
951
|
find(t) {
|
|
929
952
|
const s = { exact: !0, ...t };
|
|
930
|
-
return
|
|
931
|
-
(r) =>
|
|
953
|
+
return this.getAll().find(
|
|
954
|
+
(r) => Tt(s, r)
|
|
932
955
|
);
|
|
933
956
|
}
|
|
934
957
|
findAll(t = {}) {
|
|
935
|
-
return
|
|
936
|
-
(s) => Kt(t, s)
|
|
937
|
-
);
|
|
958
|
+
return this.getAll().filter((s) => Tt(t, s));
|
|
938
959
|
}
|
|
939
960
|
notify(t) {
|
|
940
961
|
R.batch(() => {
|
|
@@ -944,79 +965,78 @@ var Z, Ze, ve, as, or = (as = class extends Ke {
|
|
|
944
965
|
});
|
|
945
966
|
}
|
|
946
967
|
resumePausedMutations() {
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
() =>
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
)
|
|
954
|
-
);
|
|
955
|
-
}).then(() => {
|
|
956
|
-
h(this, ve, void 0);
|
|
957
|
-
})), n(this, ve);
|
|
968
|
+
const t = this.getAll().filter((s) => s.state.isPaused);
|
|
969
|
+
return R.batch(
|
|
970
|
+
() => Promise.all(
|
|
971
|
+
t.map((s) => s.continue().catch(V))
|
|
972
|
+
)
|
|
973
|
+
);
|
|
958
974
|
}
|
|
959
|
-
},
|
|
960
|
-
function
|
|
975
|
+
}, K = new WeakMap(), Ke = new WeakMap(), ts);
|
|
976
|
+
function st(e) {
|
|
977
|
+
var t;
|
|
978
|
+
return ((t = e.options.scope) == null ? void 0 : t.id) ?? String(e.mutationId);
|
|
979
|
+
}
|
|
980
|
+
function ar(e) {
|
|
961
981
|
return {
|
|
962
982
|
onFetch: (t, s) => {
|
|
963
983
|
const r = async () => {
|
|
964
|
-
var
|
|
965
|
-
const
|
|
966
|
-
let
|
|
967
|
-
const
|
|
984
|
+
var E, S, j, x, C;
|
|
985
|
+
const n = t.options, l = (j = (S = (E = t.fetchOptions) == null ? void 0 : E.meta) == null ? void 0 : S.fetchMore) == null ? void 0 : j.direction, o = ((x = t.state.data) == null ? void 0 : x.pages) || [], c = ((C = t.state.data) == null ? void 0 : C.pageParams) || [], m = { pages: [], pageParams: [] };
|
|
986
|
+
let y = !1;
|
|
987
|
+
const d = (_) => {
|
|
968
988
|
Object.defineProperty(_, "signal", {
|
|
969
989
|
enumerable: !0,
|
|
970
|
-
get: () => (t.signal.aborted ?
|
|
971
|
-
|
|
990
|
+
get: () => (t.signal.aborted ? y = !0 : t.signal.addEventListener("abort", () => {
|
|
991
|
+
y = !0;
|
|
972
992
|
}), t.signal)
|
|
973
993
|
});
|
|
974
|
-
},
|
|
994
|
+
}, v = t.options.queryFn && t.options.queryFn !== Nt ? t.options.queryFn : () => Promise.reject(
|
|
975
995
|
new Error(`Missing queryFn: '${t.options.queryHash}'`)
|
|
976
|
-
)
|
|
977
|
-
if (
|
|
996
|
+
), u = async (_, O, F) => {
|
|
997
|
+
if (y)
|
|
978
998
|
return Promise.reject();
|
|
979
|
-
if (
|
|
999
|
+
if (O == null && _.pages.length)
|
|
980
1000
|
return Promise.resolve(_);
|
|
981
|
-
const
|
|
1001
|
+
const Y = {
|
|
982
1002
|
queryKey: t.queryKey,
|
|
983
|
-
pageParam:
|
|
984
|
-
direction:
|
|
1003
|
+
pageParam: O,
|
|
1004
|
+
direction: F ? "backward" : "forward",
|
|
985
1005
|
meta: t.options.meta
|
|
986
1006
|
};
|
|
987
|
-
|
|
988
|
-
const
|
|
989
|
-
|
|
990
|
-
), { maxPages:
|
|
1007
|
+
d(Y);
|
|
1008
|
+
const z = await v(
|
|
1009
|
+
Y
|
|
1010
|
+
), { maxPages: P } = t.options, W = F ? Js : zs;
|
|
991
1011
|
return {
|
|
992
|
-
pages:
|
|
993
|
-
pageParams:
|
|
1012
|
+
pages: W(_.pages, z, P),
|
|
1013
|
+
pageParams: W(_.pageParams, O, P)
|
|
994
1014
|
};
|
|
995
1015
|
};
|
|
996
|
-
let
|
|
1016
|
+
let p;
|
|
997
1017
|
if (l && o.length) {
|
|
998
|
-
const _ = l === "backward",
|
|
1018
|
+
const _ = l === "backward", O = _ ? or : Ht, F = {
|
|
999
1019
|
pages: o,
|
|
1000
1020
|
pageParams: c
|
|
1001
|
-
},
|
|
1002
|
-
|
|
1021
|
+
}, Y = O(n, F);
|
|
1022
|
+
p = await u(F, Y, _);
|
|
1003
1023
|
} else {
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
c[0] ??
|
|
1024
|
+
p = await u(
|
|
1025
|
+
m,
|
|
1026
|
+
c[0] ?? n.initialPageParam
|
|
1007
1027
|
);
|
|
1008
1028
|
const _ = e ?? o.length;
|
|
1009
|
-
for (let
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1029
|
+
for (let O = 1; O < _; O++) {
|
|
1030
|
+
const F = Ht(n, p);
|
|
1031
|
+
p = await u(p, F);
|
|
1012
1032
|
}
|
|
1013
1033
|
}
|
|
1014
|
-
return
|
|
1034
|
+
return p;
|
|
1015
1035
|
};
|
|
1016
1036
|
t.options.persister ? t.fetchFn = () => {
|
|
1017
|
-
var
|
|
1018
|
-
return (l = (
|
|
1019
|
-
|
|
1037
|
+
var n, l;
|
|
1038
|
+
return (l = (n = t.options).persister) == null ? void 0 : l.call(
|
|
1039
|
+
n,
|
|
1020
1040
|
r,
|
|
1021
1041
|
{
|
|
1022
1042
|
queryKey: t.queryKey,
|
|
@@ -1029,7 +1049,7 @@ function lr(e) {
|
|
|
1029
1049
|
}
|
|
1030
1050
|
};
|
|
1031
1051
|
}
|
|
1032
|
-
function
|
|
1052
|
+
function Ht(e, { pages: t, pageParams: s }) {
|
|
1033
1053
|
const r = t.length - 1;
|
|
1034
1054
|
return e.getNextPageParam(
|
|
1035
1055
|
t[r],
|
|
@@ -1038,7 +1058,7 @@ function qt(e, { pages: t, pageParams: s }) {
|
|
|
1038
1058
|
s
|
|
1039
1059
|
);
|
|
1040
1060
|
}
|
|
1041
|
-
function
|
|
1061
|
+
function or(e, { pages: t, pageParams: s }) {
|
|
1042
1062
|
var r;
|
|
1043
1063
|
return (r = e.getPreviousPageParam) == null ? void 0 : r.call(
|
|
1044
1064
|
e,
|
|
@@ -1048,70 +1068,77 @@ function cr(e, { pages: t, pageParams: s }) {
|
|
|
1048
1068
|
s
|
|
1049
1069
|
);
|
|
1050
1070
|
}
|
|
1051
|
-
var
|
|
1071
|
+
var M, ne, ae, Ae, Ne, oe, ke, Oe, ss, ps = (ss = class {
|
|
1052
1072
|
constructor(e = {}) {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1073
|
+
g(this, M, void 0);
|
|
1074
|
+
g(this, ne, void 0);
|
|
1075
|
+
g(this, ae, void 0);
|
|
1076
|
+
g(this, Ae, void 0);
|
|
1077
|
+
g(this, Ne, void 0);
|
|
1078
|
+
g(this, oe, void 0);
|
|
1079
|
+
g(this, ke, void 0);
|
|
1080
|
+
g(this, Oe, void 0);
|
|
1081
|
+
f(this, M, e.queryCache || new rr()), f(this, ne, e.mutationCache || new nr()), f(this, ae, e.defaultOptions || {}), f(this, Ae, /* @__PURE__ */ new Map()), f(this, Ne, /* @__PURE__ */ new Map()), f(this, oe, 0);
|
|
1062
1082
|
}
|
|
1063
1083
|
mount() {
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
})),
|
|
1067
|
-
|
|
1084
|
+
tt(this, oe)._++, a(this, oe) === 1 && (f(this, ke, kt.subscribe(async (e) => {
|
|
1085
|
+
e && (await this.resumePausedMutations(), a(this, M).onFocus());
|
|
1086
|
+
})), f(this, Oe, nt.subscribe(async (e) => {
|
|
1087
|
+
e && (await this.resumePausedMutations(), a(this, M).onOnline());
|
|
1068
1088
|
})));
|
|
1069
1089
|
}
|
|
1070
1090
|
unmount() {
|
|
1071
1091
|
var e, t;
|
|
1072
|
-
|
|
1092
|
+
tt(this, oe)._--, a(this, oe) === 0 && ((e = a(this, ke)) == null || e.call(this), f(this, ke, void 0), (t = a(this, Oe)) == null || t.call(this), f(this, Oe, void 0));
|
|
1073
1093
|
}
|
|
1074
1094
|
isFetching(e) {
|
|
1075
|
-
return
|
|
1095
|
+
return a(this, M).findAll({ ...e, fetchStatus: "fetching" }).length;
|
|
1076
1096
|
}
|
|
1077
1097
|
isMutating(e) {
|
|
1078
|
-
return
|
|
1098
|
+
return a(this, ne).findAll({ ...e, status: "pending" }).length;
|
|
1079
1099
|
}
|
|
1080
1100
|
getQueryData(e) {
|
|
1081
|
-
var
|
|
1082
|
-
|
|
1101
|
+
var s;
|
|
1102
|
+
const t = this.defaultQueryOptions({ queryKey: e });
|
|
1103
|
+
return (s = a(this, M).get(t.queryHash)) == null ? void 0 : s.state.data;
|
|
1083
1104
|
}
|
|
1084
1105
|
ensureQueryData(e) {
|
|
1085
1106
|
const t = this.getQueryData(e.queryKey);
|
|
1086
|
-
|
|
1107
|
+
if (t === void 0)
|
|
1108
|
+
return this.fetchQuery(e);
|
|
1109
|
+
{
|
|
1110
|
+
const s = this.defaultQueryOptions(e), r = a(this, M).build(this, s);
|
|
1111
|
+
return e.revalidateIfStale && r.isStaleByTime(s.staleTime) && this.prefetchQuery(s), Promise.resolve(t);
|
|
1112
|
+
}
|
|
1087
1113
|
}
|
|
1088
1114
|
getQueriesData(e) {
|
|
1089
|
-
return this
|
|
1115
|
+
return a(this, M).findAll(e).map(({ queryKey: t, state: s }) => {
|
|
1090
1116
|
const r = s.data;
|
|
1091
1117
|
return [t, r];
|
|
1092
1118
|
});
|
|
1093
1119
|
}
|
|
1094
1120
|
setQueryData(e, t, s) {
|
|
1095
|
-
const r =
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1121
|
+
const r = this.defaultQueryOptions({ queryKey: e }), n = a(this, M).get(
|
|
1122
|
+
r.queryHash
|
|
1123
|
+
), l = n == null ? void 0 : n.state.data, o = Zs(t, l);
|
|
1124
|
+
if (o !== void 0)
|
|
1125
|
+
return a(this, M).build(this, r).setData(o, { ...s, manual: !0 });
|
|
1100
1126
|
}
|
|
1101
1127
|
setQueriesData(e, t, s) {
|
|
1102
1128
|
return R.batch(
|
|
1103
|
-
() => this
|
|
1129
|
+
() => a(this, M).findAll(e).map(({ queryKey: r }) => [
|
|
1104
1130
|
r,
|
|
1105
1131
|
this.setQueryData(r, t, s)
|
|
1106
1132
|
])
|
|
1107
1133
|
);
|
|
1108
1134
|
}
|
|
1109
1135
|
getQueryState(e) {
|
|
1110
|
-
var
|
|
1111
|
-
|
|
1136
|
+
var s;
|
|
1137
|
+
const t = this.defaultQueryOptions({ queryKey: e });
|
|
1138
|
+
return (s = a(this, M).get(t.queryHash)) == null ? void 0 : s.state;
|
|
1112
1139
|
}
|
|
1113
1140
|
removeQueries(e) {
|
|
1114
|
-
const t =
|
|
1141
|
+
const t = a(this, M);
|
|
1115
1142
|
R.batch(() => {
|
|
1116
1143
|
t.findAll(e).forEach((s) => {
|
|
1117
1144
|
t.remove(s);
|
|
@@ -1119,23 +1146,23 @@ var F, le, ce, Oe, Le, ue, Fe, Re, os, ys = (os = class {
|
|
|
1119
1146
|
});
|
|
1120
1147
|
}
|
|
1121
1148
|
resetQueries(e, t) {
|
|
1122
|
-
const s =
|
|
1149
|
+
const s = a(this, M), r = {
|
|
1123
1150
|
type: "active",
|
|
1124
1151
|
...e
|
|
1125
1152
|
};
|
|
1126
|
-
return R.batch(() => (s.findAll(e).forEach((
|
|
1127
|
-
|
|
1153
|
+
return R.batch(() => (s.findAll(e).forEach((n) => {
|
|
1154
|
+
n.reset();
|
|
1128
1155
|
}), this.refetchQueries(r, t)));
|
|
1129
1156
|
}
|
|
1130
1157
|
cancelQueries(e = {}, t = {}) {
|
|
1131
1158
|
const s = { revert: !0, ...t }, r = R.batch(
|
|
1132
|
-
() =>
|
|
1159
|
+
() => a(this, M).findAll(e).map((n) => n.cancel(s))
|
|
1133
1160
|
);
|
|
1134
|
-
return Promise.all(r).then(
|
|
1161
|
+
return Promise.all(r).then(V).catch(V);
|
|
1135
1162
|
}
|
|
1136
1163
|
invalidateQueries(e = {}, t = {}) {
|
|
1137
1164
|
return R.batch(() => {
|
|
1138
|
-
if (
|
|
1165
|
+
if (a(this, M).findAll(e).forEach((r) => {
|
|
1139
1166
|
r.invalidate();
|
|
1140
1167
|
}), e.refetchType === "none")
|
|
1141
1168
|
return Promise.resolve();
|
|
@@ -1151,188 +1178,191 @@ var F, le, ce, Oe, Le, ue, Fe, Re, os, ys = (os = class {
|
|
|
1151
1178
|
...t,
|
|
1152
1179
|
cancelRefetch: (t == null ? void 0 : t.cancelRefetch) ?? !0
|
|
1153
1180
|
}, r = R.batch(
|
|
1154
|
-
() =>
|
|
1155
|
-
let l =
|
|
1156
|
-
return s.throwOnError || (l = l.catch(
|
|
1181
|
+
() => a(this, M).findAll(e).filter((n) => !n.isDisabled()).map((n) => {
|
|
1182
|
+
let l = n.fetch(void 0, s);
|
|
1183
|
+
return s.throwOnError || (l = l.catch(V)), n.state.fetchStatus === "paused" ? Promise.resolve() : l;
|
|
1157
1184
|
})
|
|
1158
1185
|
);
|
|
1159
|
-
return Promise.all(r).then(
|
|
1186
|
+
return Promise.all(r).then(V);
|
|
1160
1187
|
}
|
|
1161
1188
|
fetchQuery(e) {
|
|
1162
1189
|
const t = this.defaultQueryOptions(e);
|
|
1163
|
-
|
|
1164
|
-
const s =
|
|
1190
|
+
t.retry === void 0 && (t.retry = !1);
|
|
1191
|
+
const s = a(this, M).build(this, t);
|
|
1165
1192
|
return s.isStaleByTime(t.staleTime) ? s.fetch(t) : Promise.resolve(s.state.data);
|
|
1166
1193
|
}
|
|
1167
1194
|
prefetchQuery(e) {
|
|
1168
|
-
return this.fetchQuery(e).then(
|
|
1195
|
+
return this.fetchQuery(e).then(V).catch(V);
|
|
1169
1196
|
}
|
|
1170
1197
|
fetchInfiniteQuery(e) {
|
|
1171
|
-
return e.behavior =
|
|
1198
|
+
return e.behavior = ar(e.pages), this.fetchQuery(e);
|
|
1172
1199
|
}
|
|
1173
1200
|
prefetchInfiniteQuery(e) {
|
|
1174
|
-
return this.fetchInfiniteQuery(e).then(
|
|
1201
|
+
return this.fetchInfiniteQuery(e).then(V).catch(V);
|
|
1175
1202
|
}
|
|
1176
1203
|
resumePausedMutations() {
|
|
1177
|
-
return
|
|
1204
|
+
return nt.isOnline() ? a(this, ne).resumePausedMutations() : Promise.resolve();
|
|
1178
1205
|
}
|
|
1179
1206
|
getQueryCache() {
|
|
1180
|
-
return
|
|
1207
|
+
return a(this, M);
|
|
1181
1208
|
}
|
|
1182
1209
|
getMutationCache() {
|
|
1183
|
-
return
|
|
1210
|
+
return a(this, ne);
|
|
1184
1211
|
}
|
|
1185
1212
|
getDefaultOptions() {
|
|
1186
|
-
return
|
|
1213
|
+
return a(this, ae);
|
|
1187
1214
|
}
|
|
1188
1215
|
setDefaultOptions(e) {
|
|
1189
|
-
|
|
1216
|
+
f(this, ae, e);
|
|
1190
1217
|
}
|
|
1191
1218
|
setQueryDefaults(e, t) {
|
|
1192
|
-
|
|
1219
|
+
a(this, Ae).set(Ce(e), {
|
|
1193
1220
|
queryKey: e,
|
|
1194
1221
|
defaultOptions: t
|
|
1195
1222
|
});
|
|
1196
1223
|
}
|
|
1197
1224
|
getQueryDefaults(e) {
|
|
1198
|
-
const t = [...
|
|
1225
|
+
const t = [...a(this, Ae).values()];
|
|
1199
1226
|
let s = {};
|
|
1200
1227
|
return t.forEach((r) => {
|
|
1201
|
-
|
|
1228
|
+
He(e, r.queryKey) && (s = { ...s, ...r.defaultOptions });
|
|
1202
1229
|
}), s;
|
|
1203
1230
|
}
|
|
1204
1231
|
setMutationDefaults(e, t) {
|
|
1205
|
-
|
|
1232
|
+
a(this, Ne).set(Ce(e), {
|
|
1206
1233
|
mutationKey: e,
|
|
1207
1234
|
defaultOptions: t
|
|
1208
1235
|
});
|
|
1209
1236
|
}
|
|
1210
1237
|
getMutationDefaults(e) {
|
|
1211
|
-
const t = [...
|
|
1238
|
+
const t = [...a(this, Ne).values()];
|
|
1212
1239
|
let s = {};
|
|
1213
1240
|
return t.forEach((r) => {
|
|
1214
|
-
|
|
1241
|
+
He(e, r.mutationKey) && (s = { ...s, ...r.defaultOptions });
|
|
1215
1242
|
}), s;
|
|
1216
1243
|
}
|
|
1217
1244
|
defaultQueryOptions(e) {
|
|
1218
|
-
if (e
|
|
1245
|
+
if (e._defaulted)
|
|
1219
1246
|
return e;
|
|
1220
1247
|
const t = {
|
|
1221
|
-
...
|
|
1222
|
-
...
|
|
1248
|
+
...a(this, ae).queries,
|
|
1249
|
+
...this.getQueryDefaults(e.queryKey),
|
|
1223
1250
|
...e,
|
|
1224
1251
|
_defaulted: !0
|
|
1225
1252
|
};
|
|
1226
|
-
return t.queryHash || (t.queryHash =
|
|
1253
|
+
return t.queryHash || (t.queryHash = At(
|
|
1227
1254
|
t.queryKey,
|
|
1228
1255
|
t
|
|
1229
|
-
)),
|
|
1256
|
+
)), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.enabled !== !0 && t.queryFn === Nt && (t.enabled = !1), t;
|
|
1230
1257
|
}
|
|
1231
1258
|
defaultMutationOptions(e) {
|
|
1232
1259
|
return e != null && e._defaulted ? e : {
|
|
1233
|
-
...
|
|
1260
|
+
...a(this, ae).mutations,
|
|
1234
1261
|
...(e == null ? void 0 : e.mutationKey) && this.getMutationDefaults(e.mutationKey),
|
|
1235
1262
|
...e,
|
|
1236
1263
|
_defaulted: !0
|
|
1237
1264
|
};
|
|
1238
1265
|
}
|
|
1239
1266
|
clear() {
|
|
1240
|
-
|
|
1267
|
+
a(this, M).clear(), a(this, ne).clear();
|
|
1241
1268
|
}
|
|
1242
|
-
},
|
|
1269
|
+
}, M = new WeakMap(), ne = new WeakMap(), ae = new WeakMap(), Ae = new WeakMap(), Ne = new WeakMap(), oe = new WeakMap(), ke = new WeakMap(), Oe = new WeakMap(), ss), Q, k, qe, U, me, Me, B, Ge, Le, Fe, ve, ge, le, Re, ye, Qe, Ve, vt, We, gt, Ze, yt, Ye, Ct, ze, xt, Je, bt, Xe, wt, ct, ms, rs, lr = (rs = class extends Ue {
|
|
1243
1270
|
constructor(t, s) {
|
|
1244
1271
|
super();
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1272
|
+
g(this, ye);
|
|
1273
|
+
g(this, Ve);
|
|
1274
|
+
g(this, We);
|
|
1275
|
+
g(this, Ze);
|
|
1276
|
+
g(this, Ye);
|
|
1277
|
+
g(this, ze);
|
|
1278
|
+
g(this, Je);
|
|
1279
|
+
g(this, Xe);
|
|
1280
|
+
g(this, ct);
|
|
1281
|
+
g(this, Q, void 0);
|
|
1282
|
+
g(this, k, void 0);
|
|
1283
|
+
g(this, qe, void 0);
|
|
1284
|
+
g(this, U, void 0);
|
|
1285
|
+
g(this, me, void 0);
|
|
1286
|
+
g(this, Me, void 0);
|
|
1287
|
+
g(this, B, void 0);
|
|
1288
|
+
g(this, Ge, void 0);
|
|
1289
|
+
g(this, Le, void 0);
|
|
1263
1290
|
// This property keeps track of the last query with defined data.
|
|
1264
1291
|
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
this.options = s,
|
|
1292
|
+
g(this, Fe, void 0);
|
|
1293
|
+
g(this, ve, void 0);
|
|
1294
|
+
g(this, ge, void 0);
|
|
1295
|
+
g(this, le, void 0);
|
|
1296
|
+
g(this, Re, /* @__PURE__ */ new Set());
|
|
1297
|
+
this.options = s, f(this, Q, t), f(this, B, null), this.bindMethods(), this.setOptions(s);
|
|
1271
1298
|
}
|
|
1272
1299
|
bindMethods() {
|
|
1273
1300
|
this.refetch = this.refetch.bind(this);
|
|
1274
1301
|
}
|
|
1275
1302
|
onSubscribe() {
|
|
1276
|
-
this.listeners.size === 1 && (
|
|
1303
|
+
this.listeners.size === 1 && (a(this, k).addObserver(this), $t(a(this, k), this.options) ? b(this, ye, Qe).call(this) : this.updateResult(), b(this, Ye, Ct).call(this));
|
|
1277
1304
|
}
|
|
1278
1305
|
onUnsubscribe() {
|
|
1279
1306
|
this.hasListeners() || this.destroy();
|
|
1280
1307
|
}
|
|
1281
1308
|
shouldFetchOnReconnect() {
|
|
1282
|
-
return
|
|
1283
|
-
|
|
1309
|
+
return jt(
|
|
1310
|
+
a(this, k),
|
|
1284
1311
|
this.options,
|
|
1285
1312
|
this.options.refetchOnReconnect
|
|
1286
1313
|
);
|
|
1287
1314
|
}
|
|
1288
1315
|
shouldFetchOnWindowFocus() {
|
|
1289
|
-
return
|
|
1290
|
-
|
|
1316
|
+
return jt(
|
|
1317
|
+
a(this, k),
|
|
1291
1318
|
this.options,
|
|
1292
1319
|
this.options.refetchOnWindowFocus
|
|
1293
1320
|
);
|
|
1294
1321
|
}
|
|
1295
1322
|
destroy() {
|
|
1296
|
-
this.listeners = /* @__PURE__ */ new Set(), b(this,
|
|
1323
|
+
this.listeners = /* @__PURE__ */ new Set(), b(this, ze, xt).call(this), b(this, Je, bt).call(this), a(this, k).removeObserver(this);
|
|
1297
1324
|
}
|
|
1298
1325
|
setOptions(t, s) {
|
|
1299
|
-
const r = this.options,
|
|
1300
|
-
if (this.options =
|
|
1326
|
+
const r = this.options, n = a(this, k);
|
|
1327
|
+
if (this.options = a(this, Q).defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean")
|
|
1328
|
+
throw new Error("Expected enabled to be a boolean");
|
|
1329
|
+
b(this, Xe, wt).call(this), a(this, k).setOptions(this.options), r._defaulted && !it(this.options, r) && a(this, Q).getQueryCache().notify({
|
|
1301
1330
|
type: "observerOptionsUpdated",
|
|
1302
|
-
query:
|
|
1331
|
+
query: a(this, k),
|
|
1303
1332
|
observer: this
|
|
1304
|
-
})
|
|
1305
|
-
throw new Error("Expected enabled to be a boolean");
|
|
1306
|
-
this.options.queryKey || (this.options.queryKey = r.queryKey), b(this, st, kt).call(this);
|
|
1333
|
+
});
|
|
1307
1334
|
const l = this.hasListeners();
|
|
1308
|
-
l &&
|
|
1309
|
-
|
|
1310
|
-
|
|
1335
|
+
l && Kt(
|
|
1336
|
+
a(this, k),
|
|
1337
|
+
n,
|
|
1311
1338
|
this.options,
|
|
1312
1339
|
r
|
|
1313
|
-
) && b(this,
|
|
1314
|
-
const o = b(this,
|
|
1315
|
-
l && (
|
|
1340
|
+
) && b(this, ye, Qe).call(this), this.updateResult(s), l && (a(this, k) !== n || this.options.enabled !== r.enabled || this.options.staleTime !== r.staleTime) && b(this, Ve, vt).call(this);
|
|
1341
|
+
const o = b(this, We, gt).call(this);
|
|
1342
|
+
l && (a(this, k) !== n || this.options.enabled !== r.enabled || o !== a(this, le)) && b(this, Ze, yt).call(this, o);
|
|
1316
1343
|
}
|
|
1317
1344
|
getOptimisticResult(t) {
|
|
1318
|
-
const s =
|
|
1319
|
-
return
|
|
1345
|
+
const s = a(this, Q).getQueryCache().build(a(this, Q), t), r = this.createResult(s, t);
|
|
1346
|
+
return ur(this, r) && (f(this, U, r), f(this, Me, this.options), f(this, me, a(this, k).state)), r;
|
|
1320
1347
|
}
|
|
1321
1348
|
getCurrentResult() {
|
|
1322
|
-
return
|
|
1349
|
+
return a(this, U);
|
|
1323
1350
|
}
|
|
1324
|
-
trackResult(t) {
|
|
1325
|
-
const
|
|
1326
|
-
return Object.keys(t).forEach((
|
|
1327
|
-
Object.defineProperty(
|
|
1351
|
+
trackResult(t, s) {
|
|
1352
|
+
const r = {};
|
|
1353
|
+
return Object.keys(t).forEach((n) => {
|
|
1354
|
+
Object.defineProperty(r, n, {
|
|
1328
1355
|
configurable: !1,
|
|
1329
1356
|
enumerable: !0,
|
|
1330
|
-
get: () => (n
|
|
1357
|
+
get: () => (this.trackProp(n), s == null || s(n), t[n])
|
|
1331
1358
|
});
|
|
1332
|
-
}),
|
|
1359
|
+
}), r;
|
|
1360
|
+
}
|
|
1361
|
+
trackProp(t) {
|
|
1362
|
+
a(this, Re).add(t);
|
|
1333
1363
|
}
|
|
1334
1364
|
getCurrentQuery() {
|
|
1335
|
-
return
|
|
1365
|
+
return a(this, k);
|
|
1336
1366
|
}
|
|
1337
1367
|
refetch({ ...t } = {}) {
|
|
1338
1368
|
return this.fetch({
|
|
@@ -1340,183 +1370,187 @@ var F, le, ce, Oe, Le, ue, Fe, Re, os, ys = (os = class {
|
|
|
1340
1370
|
});
|
|
1341
1371
|
}
|
|
1342
1372
|
fetchOptimistic(t) {
|
|
1343
|
-
const s =
|
|
1373
|
+
const s = a(this, Q).defaultQueryOptions(t), r = a(this, Q).getQueryCache().build(a(this, Q), s);
|
|
1344
1374
|
return r.isFetchingOptimistic = !0, r.fetch().then(() => this.createResult(r, s));
|
|
1345
1375
|
}
|
|
1346
1376
|
fetch(t) {
|
|
1347
|
-
return b(this,
|
|
1377
|
+
return b(this, ye, Qe).call(this, {
|
|
1348
1378
|
...t,
|
|
1349
1379
|
cancelRefetch: t.cancelRefetch ?? !0
|
|
1350
|
-
}).then(() => (this.updateResult(),
|
|
1380
|
+
}).then(() => (this.updateResult(), a(this, U)));
|
|
1351
1381
|
}
|
|
1352
1382
|
createResult(t, s) {
|
|
1353
|
-
var
|
|
1354
|
-
const r =
|
|
1355
|
-
let
|
|
1383
|
+
var z;
|
|
1384
|
+
const r = a(this, k), n = this.options, l = a(this, U), o = a(this, me), c = a(this, Me), y = t !== r ? t.state : a(this, qe), { state: d } = t;
|
|
1385
|
+
let v = { ...d }, u = !1, p;
|
|
1356
1386
|
if (s._optimisticResults) {
|
|
1357
|
-
const
|
|
1358
|
-
(
|
|
1387
|
+
const P = this.hasListeners(), W = !P && $t(t, s), Hs = P && Kt(t, r, s, n);
|
|
1388
|
+
(W || Hs) && (v = {
|
|
1389
|
+
...v,
|
|
1390
|
+
...ds(d.data, t.options)
|
|
1391
|
+
}), s._optimisticResults === "isRestoring" && (v.fetchStatus = "idle");
|
|
1359
1392
|
}
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1393
|
+
let { error: E, errorUpdatedAt: S, status: j } = v;
|
|
1394
|
+
if (s.select && v.data !== void 0)
|
|
1395
|
+
if (l && v.data === (o == null ? void 0 : o.data) && s.select === a(this, Ge))
|
|
1396
|
+
p = a(this, Le);
|
|
1363
1397
|
else
|
|
1364
1398
|
try {
|
|
1365
|
-
|
|
1366
|
-
} catch (
|
|
1367
|
-
|
|
1399
|
+
f(this, Ge, s.select), p = s.select(v.data), p = mt(l == null ? void 0 : l.data, p, s), f(this, Le, p), f(this, B, null);
|
|
1400
|
+
} catch (P) {
|
|
1401
|
+
f(this, B, P);
|
|
1368
1402
|
}
|
|
1369
1403
|
else
|
|
1370
|
-
|
|
1371
|
-
if (
|
|
1372
|
-
let
|
|
1404
|
+
p = v.data;
|
|
1405
|
+
if (s.placeholderData !== void 0 && p === void 0 && j === "pending") {
|
|
1406
|
+
let P;
|
|
1373
1407
|
if (l != null && l.isPlaceholderData && s.placeholderData === (c == null ? void 0 : c.placeholderData))
|
|
1374
|
-
|
|
1375
|
-
else if (
|
|
1376
|
-
(
|
|
1377
|
-
|
|
1378
|
-
) : s.placeholderData, s.select &&
|
|
1408
|
+
P = l.data;
|
|
1409
|
+
else if (P = typeof s.placeholderData == "function" ? s.placeholderData(
|
|
1410
|
+
(z = a(this, Fe)) == null ? void 0 : z.state.data,
|
|
1411
|
+
a(this, Fe)
|
|
1412
|
+
) : s.placeholderData, s.select && P !== void 0)
|
|
1379
1413
|
try {
|
|
1380
|
-
|
|
1381
|
-
} catch (
|
|
1382
|
-
|
|
1414
|
+
P = s.select(P), f(this, B, null);
|
|
1415
|
+
} catch (W) {
|
|
1416
|
+
f(this, B, W);
|
|
1383
1417
|
}
|
|
1384
|
-
|
|
1418
|
+
P !== void 0 && (j = "success", p = mt(
|
|
1385
1419
|
l == null ? void 0 : l.data,
|
|
1386
|
-
|
|
1420
|
+
P,
|
|
1387
1421
|
s
|
|
1388
|
-
),
|
|
1422
|
+
), u = !0);
|
|
1389
1423
|
}
|
|
1390
|
-
|
|
1391
|
-
const
|
|
1424
|
+
a(this, B) && (E = a(this, B), p = a(this, Le), S = Date.now(), j = "error");
|
|
1425
|
+
const x = v.fetchStatus === "fetching", C = j === "pending", _ = j === "error", O = C && x, F = p !== void 0;
|
|
1392
1426
|
return {
|
|
1393
|
-
status:
|
|
1394
|
-
fetchStatus:
|
|
1395
|
-
isPending:
|
|
1396
|
-
isSuccess:
|
|
1427
|
+
status: j,
|
|
1428
|
+
fetchStatus: v.fetchStatus,
|
|
1429
|
+
isPending: C,
|
|
1430
|
+
isSuccess: j === "success",
|
|
1397
1431
|
isError: _,
|
|
1398
|
-
isInitialLoading:
|
|
1399
|
-
isLoading:
|
|
1400
|
-
data:
|
|
1401
|
-
dataUpdatedAt:
|
|
1402
|
-
error:
|
|
1403
|
-
errorUpdatedAt:
|
|
1404
|
-
failureCount:
|
|
1405
|
-
failureReason:
|
|
1406
|
-
errorUpdateCount:
|
|
1407
|
-
isFetched:
|
|
1408
|
-
isFetchedAfterMount:
|
|
1409
|
-
isFetching:
|
|
1410
|
-
isRefetching:
|
|
1411
|
-
isLoadingError: _ &&
|
|
1412
|
-
isPaused:
|
|
1413
|
-
isPlaceholderData:
|
|
1414
|
-
isRefetchError: _ &&
|
|
1415
|
-
isStale:
|
|
1432
|
+
isInitialLoading: O,
|
|
1433
|
+
isLoading: O,
|
|
1434
|
+
data: p,
|
|
1435
|
+
dataUpdatedAt: v.dataUpdatedAt,
|
|
1436
|
+
error: E,
|
|
1437
|
+
errorUpdatedAt: S,
|
|
1438
|
+
failureCount: v.fetchFailureCount,
|
|
1439
|
+
failureReason: v.fetchFailureReason,
|
|
1440
|
+
errorUpdateCount: v.errorUpdateCount,
|
|
1441
|
+
isFetched: v.dataUpdateCount > 0 || v.errorUpdateCount > 0,
|
|
1442
|
+
isFetchedAfterMount: v.dataUpdateCount > y.dataUpdateCount || v.errorUpdateCount > y.errorUpdateCount,
|
|
1443
|
+
isFetching: x,
|
|
1444
|
+
isRefetching: x && !C,
|
|
1445
|
+
isLoadingError: _ && !F,
|
|
1446
|
+
isPaused: v.fetchStatus === "paused",
|
|
1447
|
+
isPlaceholderData: u,
|
|
1448
|
+
isRefetchError: _ && F,
|
|
1449
|
+
isStale: Ot(t, s),
|
|
1416
1450
|
refetch: this.refetch
|
|
1417
1451
|
};
|
|
1418
1452
|
}
|
|
1419
1453
|
updateResult(t) {
|
|
1420
|
-
const s =
|
|
1421
|
-
if (
|
|
1454
|
+
const s = a(this, U), r = this.createResult(a(this, k), this.options);
|
|
1455
|
+
if (f(this, me, a(this, k).state), f(this, Me, this.options), a(this, me).data !== void 0 && f(this, Fe, a(this, k)), it(r, s))
|
|
1422
1456
|
return;
|
|
1423
|
-
|
|
1424
|
-
const
|
|
1457
|
+
f(this, U, r);
|
|
1458
|
+
const n = {}, l = () => {
|
|
1425
1459
|
if (!s)
|
|
1426
1460
|
return !0;
|
|
1427
1461
|
const { notifyOnChangeProps: o } = this.options, c = typeof o == "function" ? o() : o;
|
|
1428
|
-
if (c === "all" || !c && !
|
|
1462
|
+
if (c === "all" || !c && !a(this, Re).size)
|
|
1429
1463
|
return !0;
|
|
1430
|
-
const
|
|
1431
|
-
c ??
|
|
1464
|
+
const m = new Set(
|
|
1465
|
+
c ?? a(this, Re)
|
|
1432
1466
|
);
|
|
1433
|
-
return this.options.throwOnError &&
|
|
1434
|
-
const
|
|
1435
|
-
return
|
|
1467
|
+
return this.options.throwOnError && m.add("error"), Object.keys(a(this, U)).some((y) => {
|
|
1468
|
+
const d = y;
|
|
1469
|
+
return a(this, U)[d] !== s[d] && m.has(d);
|
|
1436
1470
|
});
|
|
1437
1471
|
};
|
|
1438
|
-
(t == null ? void 0 : t.listeners) !== !1 && l() && (
|
|
1472
|
+
(t == null ? void 0 : t.listeners) !== !1 && l() && (n.listeners = !0), b(this, ct, ms).call(this, { ...n, ...t });
|
|
1439
1473
|
}
|
|
1440
1474
|
onQueryUpdate() {
|
|
1441
|
-
this.updateResult(), this.hasListeners() && b(this,
|
|
1475
|
+
this.updateResult(), this.hasListeners() && b(this, Ye, Ct).call(this);
|
|
1442
1476
|
}
|
|
1443
|
-
}, Q = new WeakMap(), k = new WeakMap(),
|
|
1444
|
-
b(this,
|
|
1445
|
-
let s =
|
|
1477
|
+
}, Q = new WeakMap(), k = new WeakMap(), qe = new WeakMap(), U = new WeakMap(), me = new WeakMap(), Me = new WeakMap(), B = new WeakMap(), Ge = new WeakMap(), Le = new WeakMap(), Fe = new WeakMap(), ve = new WeakMap(), ge = new WeakMap(), le = new WeakMap(), Re = new WeakMap(), ye = new WeakSet(), Qe = function(t) {
|
|
1478
|
+
b(this, Xe, wt).call(this);
|
|
1479
|
+
let s = a(this, k).fetch(
|
|
1446
1480
|
this.options,
|
|
1447
1481
|
t
|
|
1448
1482
|
);
|
|
1449
|
-
return t != null && t.throwOnError || (s = s.catch(
|
|
1450
|
-
},
|
|
1451
|
-
if (b(this,
|
|
1483
|
+
return t != null && t.throwOnError || (s = s.catch(V)), s;
|
|
1484
|
+
}, Ve = new WeakSet(), vt = function() {
|
|
1485
|
+
if (b(this, ze, xt).call(this), Te || a(this, U).isStale || !ft(this.options.staleTime))
|
|
1452
1486
|
return;
|
|
1453
|
-
const s =
|
|
1454
|
-
|
|
1487
|
+
const s = as(
|
|
1488
|
+
a(this, U).dataUpdatedAt,
|
|
1455
1489
|
this.options.staleTime
|
|
1456
1490
|
) + 1;
|
|
1457
|
-
|
|
1458
|
-
|
|
1491
|
+
f(this, ve, setTimeout(() => {
|
|
1492
|
+
a(this, U).isStale || this.updateResult();
|
|
1459
1493
|
}, s));
|
|
1460
|
-
},
|
|
1461
|
-
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(
|
|
1462
|
-
},
|
|
1463
|
-
b(this,
|
|
1464
|
-
(this.options.refetchIntervalInBackground ||
|
|
1465
|
-
},
|
|
1466
|
-
},
|
|
1467
|
-
b(this,
|
|
1468
|
-
},
|
|
1469
|
-
|
|
1470
|
-
},
|
|
1471
|
-
|
|
1472
|
-
},
|
|
1473
|
-
const t =
|
|
1474
|
-
if (t ===
|
|
1494
|
+
}, We = new WeakSet(), gt = function() {
|
|
1495
|
+
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(a(this, k)) : this.options.refetchInterval) ?? !1;
|
|
1496
|
+
}, Ze = new WeakSet(), yt = function(t) {
|
|
1497
|
+
b(this, Je, bt).call(this), f(this, le, t), !(Te || this.options.enabled === !1 || !ft(a(this, le)) || a(this, le) === 0) && f(this, ge, setInterval(() => {
|
|
1498
|
+
(this.options.refetchIntervalInBackground || kt.isFocused()) && b(this, ye, Qe).call(this);
|
|
1499
|
+
}, a(this, le)));
|
|
1500
|
+
}, Ye = new WeakSet(), Ct = function() {
|
|
1501
|
+
b(this, Ve, vt).call(this), b(this, Ze, yt).call(this, b(this, We, gt).call(this));
|
|
1502
|
+
}, ze = new WeakSet(), xt = function() {
|
|
1503
|
+
a(this, ve) && (clearTimeout(a(this, ve)), f(this, ve, void 0));
|
|
1504
|
+
}, Je = new WeakSet(), bt = function() {
|
|
1505
|
+
a(this, ge) && (clearInterval(a(this, ge)), f(this, ge, void 0));
|
|
1506
|
+
}, Xe = new WeakSet(), wt = function() {
|
|
1507
|
+
const t = a(this, Q).getQueryCache().build(a(this, Q), this.options);
|
|
1508
|
+
if (t === a(this, k))
|
|
1475
1509
|
return;
|
|
1476
|
-
const s =
|
|
1477
|
-
|
|
1478
|
-
},
|
|
1510
|
+
const s = a(this, k);
|
|
1511
|
+
f(this, k, t), f(this, qe, t.state), this.hasListeners() && (s == null || s.removeObserver(this), t.addObserver(this));
|
|
1512
|
+
}, ct = new WeakSet(), ms = function(t) {
|
|
1479
1513
|
R.batch(() => {
|
|
1480
1514
|
t.listeners && this.listeners.forEach((s) => {
|
|
1481
|
-
s(
|
|
1482
|
-
}),
|
|
1483
|
-
query:
|
|
1515
|
+
s(a(this, U));
|
|
1516
|
+
}), a(this, Q).getQueryCache().notify({
|
|
1517
|
+
query: a(this, k),
|
|
1484
1518
|
type: "observerResultsUpdated"
|
|
1485
1519
|
});
|
|
1486
1520
|
});
|
|
1487
|
-
},
|
|
1488
|
-
function
|
|
1489
|
-
return t.enabled !== !1 &&
|
|
1521
|
+
}, rs);
|
|
1522
|
+
function cr(e, t) {
|
|
1523
|
+
return t.enabled !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
1490
1524
|
}
|
|
1491
|
-
function
|
|
1492
|
-
return
|
|
1525
|
+
function $t(e, t) {
|
|
1526
|
+
return cr(e, t) || e.state.data !== void 0 && jt(e, t, t.refetchOnMount);
|
|
1493
1527
|
}
|
|
1494
|
-
function
|
|
1528
|
+
function jt(e, t, s) {
|
|
1495
1529
|
if (t.enabled !== !1) {
|
|
1496
1530
|
const r = typeof s == "function" ? s(e) : s;
|
|
1497
|
-
return r === "always" || r !== !1 &&
|
|
1531
|
+
return r === "always" || r !== !1 && Ot(e, t);
|
|
1498
1532
|
}
|
|
1499
1533
|
return !1;
|
|
1500
1534
|
}
|
|
1501
|
-
function
|
|
1502
|
-
return
|
|
1535
|
+
function Kt(e, t, s, r) {
|
|
1536
|
+
return (e !== t || r.enabled === !1) && (!s.suspense || e.state.status !== "error") && Ot(e, s);
|
|
1503
1537
|
}
|
|
1504
|
-
function
|
|
1505
|
-
return e.isStaleByTime(t.staleTime);
|
|
1538
|
+
function Ot(e, t) {
|
|
1539
|
+
return t.enabled !== !1 && e.isStaleByTime(t.staleTime);
|
|
1506
1540
|
}
|
|
1507
|
-
function
|
|
1508
|
-
return !
|
|
1541
|
+
function ur(e, t) {
|
|
1542
|
+
return !it(e.getCurrentResult(), t);
|
|
1509
1543
|
}
|
|
1510
|
-
var
|
|
1544
|
+
var ce, ue, H, te, De, rt, Ie, _t, is, hr = (is = class extends Ue {
|
|
1511
1545
|
constructor(t, s) {
|
|
1512
1546
|
super();
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1547
|
+
g(this, De);
|
|
1548
|
+
g(this, Ie);
|
|
1549
|
+
g(this, ce, void 0);
|
|
1550
|
+
g(this, ue, void 0);
|
|
1551
|
+
g(this, H, void 0);
|
|
1552
|
+
g(this, te, void 0);
|
|
1553
|
+
f(this, ce, t), this.setOptions(s), this.bindMethods(), b(this, De, rt).call(this);
|
|
1520
1554
|
}
|
|
1521
1555
|
bindMethods() {
|
|
1522
1556
|
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
|
|
@@ -1524,34 +1558,34 @@ var he, se, G, re, He, lt, rt, Mt, cs, fr = (cs = class extends Ke {
|
|
|
1524
1558
|
setOptions(t) {
|
|
1525
1559
|
var r;
|
|
1526
1560
|
const s = this.options;
|
|
1527
|
-
this.options =
|
|
1561
|
+
this.options = a(this, ce).defaultMutationOptions(t), it(this.options, s) || a(this, ce).getMutationCache().notify({
|
|
1528
1562
|
type: "observerOptionsUpdated",
|
|
1529
|
-
mutation:
|
|
1563
|
+
mutation: a(this, H),
|
|
1530
1564
|
observer: this
|
|
1531
|
-
}),
|
|
1565
|
+
}), s != null && s.mutationKey && this.options.mutationKey && Ce(s.mutationKey) !== Ce(this.options.mutationKey) ? this.reset() : ((r = a(this, H)) == null ? void 0 : r.state.status) === "pending" && a(this, H).setOptions(this.options);
|
|
1532
1566
|
}
|
|
1533
1567
|
onUnsubscribe() {
|
|
1534
1568
|
var t;
|
|
1535
|
-
this.hasListeners() || (t =
|
|
1569
|
+
this.hasListeners() || (t = a(this, H)) == null || t.removeObserver(this);
|
|
1536
1570
|
}
|
|
1537
1571
|
onMutationUpdate(t) {
|
|
1538
|
-
b(this,
|
|
1572
|
+
b(this, De, rt).call(this), b(this, Ie, _t).call(this, t);
|
|
1539
1573
|
}
|
|
1540
1574
|
getCurrentResult() {
|
|
1541
|
-
return
|
|
1575
|
+
return a(this, ue);
|
|
1542
1576
|
}
|
|
1543
1577
|
reset() {
|
|
1544
1578
|
var t;
|
|
1545
|
-
(t =
|
|
1579
|
+
(t = a(this, H)) == null || t.removeObserver(this), f(this, H, void 0), b(this, De, rt).call(this), b(this, Ie, _t).call(this);
|
|
1546
1580
|
}
|
|
1547
1581
|
mutate(t, s) {
|
|
1548
1582
|
var r;
|
|
1549
|
-
return
|
|
1583
|
+
return f(this, te, s), (r = a(this, H)) == null || r.removeObserver(this), f(this, H, a(this, ce).getMutationCache().build(a(this, ce), this.options)), a(this, H).addObserver(this), a(this, H).execute(t);
|
|
1550
1584
|
}
|
|
1551
|
-
},
|
|
1585
|
+
}, ce = new WeakMap(), ue = new WeakMap(), H = new WeakMap(), te = new WeakMap(), De = new WeakSet(), rt = function() {
|
|
1552
1586
|
var s;
|
|
1553
|
-
const t = ((s =
|
|
1554
|
-
|
|
1587
|
+
const t = ((s = a(this, H)) == null ? void 0 : s.state) ?? fs();
|
|
1588
|
+
f(this, ue, {
|
|
1555
1589
|
...t,
|
|
1556
1590
|
isPending: t.status === "pending",
|
|
1557
1591
|
isSuccess: t.status === "success",
|
|
@@ -1560,40 +1594,38 @@ var he, se, G, re, He, lt, rt, Mt, cs, fr = (cs = class extends Ke {
|
|
|
1560
1594
|
mutate: this.mutate,
|
|
1561
1595
|
reset: this.reset
|
|
1562
1596
|
});
|
|
1563
|
-
},
|
|
1597
|
+
}, Ie = new WeakSet(), _t = function(t) {
|
|
1564
1598
|
R.batch(() => {
|
|
1565
|
-
var s, r,
|
|
1566
|
-
if (
|
|
1567
|
-
const
|
|
1568
|
-
(t == null ? void 0 : t.type) === "success" ? ((r = (s =
|
|
1569
|
-
|
|
1599
|
+
var s, r, n, l, o, c, m, y;
|
|
1600
|
+
if (a(this, te) && this.hasListeners()) {
|
|
1601
|
+
const d = a(this, ue).variables, v = a(this, ue).context;
|
|
1602
|
+
(t == null ? void 0 : t.type) === "success" ? ((r = (s = a(this, te)).onSuccess) == null || r.call(s, t.data, d, v), (l = (n = a(this, te)).onSettled) == null || l.call(n, t.data, null, d, v)) : (t == null ? void 0 : t.type) === "error" && ((c = (o = a(this, te)).onError) == null || c.call(o, t.error, d, v), (y = (m = a(this, te)).onSettled) == null || y.call(
|
|
1603
|
+
m,
|
|
1570
1604
|
void 0,
|
|
1571
1605
|
t.error,
|
|
1572
|
-
|
|
1573
|
-
|
|
1606
|
+
d,
|
|
1607
|
+
v
|
|
1574
1608
|
));
|
|
1575
1609
|
}
|
|
1576
|
-
this.listeners.forEach((
|
|
1577
|
-
|
|
1610
|
+
this.listeners.forEach((d) => {
|
|
1611
|
+
d(a(this, ue));
|
|
1578
1612
|
});
|
|
1579
1613
|
});
|
|
1580
|
-
},
|
|
1614
|
+
}, is), vs = h.createContext(
|
|
1581
1615
|
void 0
|
|
1582
|
-
),
|
|
1583
|
-
const t =
|
|
1584
|
-
if (e)
|
|
1585
|
-
return e;
|
|
1616
|
+
), Mt = (e) => {
|
|
1617
|
+
const t = h.useContext(vs);
|
|
1586
1618
|
if (!t)
|
|
1587
1619
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
1588
1620
|
return t;
|
|
1589
|
-
},
|
|
1621
|
+
}, dr = ({
|
|
1590
1622
|
client: e,
|
|
1591
1623
|
children: t
|
|
1592
|
-
}) => (
|
|
1624
|
+
}) => (h.useEffect(() => (e.mount(), () => {
|
|
1593
1625
|
e.unmount();
|
|
1594
|
-
}), [e]), /* @__PURE__ */
|
|
1595
|
-
|
|
1596
|
-
function
|
|
1626
|
+
}), [e]), /* @__PURE__ */ i.jsx(vs.Provider, { value: e, children: t })), gs = h.createContext(!1), fr = () => h.useContext(gs);
|
|
1627
|
+
gs.Provider;
|
|
1628
|
+
function pr() {
|
|
1597
1629
|
let e = !1;
|
|
1598
1630
|
return {
|
|
1599
1631
|
clearReset: () => {
|
|
@@ -1605,182 +1637,182 @@ function vr() {
|
|
|
1605
1637
|
isReset: () => e
|
|
1606
1638
|
};
|
|
1607
1639
|
}
|
|
1608
|
-
var
|
|
1609
|
-
function
|
|
1640
|
+
var mr = h.createContext(pr()), vr = () => h.useContext(mr);
|
|
1641
|
+
function ys(e, t) {
|
|
1610
1642
|
return typeof e == "function" ? e(...t) : !!e;
|
|
1611
1643
|
}
|
|
1612
|
-
|
|
1644
|
+
function gr() {
|
|
1645
|
+
}
|
|
1646
|
+
var yr = (e, t) => {
|
|
1613
1647
|
(e.suspense || e.throwOnError) && (t.isReset() || (e.retryOnMount = !1));
|
|
1614
|
-
},
|
|
1615
|
-
|
|
1648
|
+
}, Cr = (e) => {
|
|
1649
|
+
h.useEffect(() => {
|
|
1616
1650
|
e.clearReset();
|
|
1617
1651
|
}, [e]);
|
|
1618
|
-
},
|
|
1652
|
+
}, xr = ({
|
|
1619
1653
|
result: e,
|
|
1620
1654
|
errorResetBoundary: t,
|
|
1621
1655
|
throwOnError: s,
|
|
1622
1656
|
query: r
|
|
1623
|
-
}) => e.isError && !t.isReset() && !e.isFetching && r &&
|
|
1657
|
+
}) => e.isError && !t.isReset() && !e.isFetching && r && ys(s, [e.error, r]), br = (e) => {
|
|
1624
1658
|
e.suspense && typeof e.staleTime != "number" && (e.staleTime = 1e3);
|
|
1625
|
-
},
|
|
1659
|
+
}, wr = (e, t) => (e == null ? void 0 : e.suspense) && t.isPending, jr = (e, t, s) => t.fetchOptimistic(e).catch(() => {
|
|
1626
1660
|
s.clearReset();
|
|
1627
1661
|
});
|
|
1628
|
-
function
|
|
1629
|
-
const r =
|
|
1630
|
-
o._optimisticResults =
|
|
1631
|
-
const [c] =
|
|
1662
|
+
function _r(e, t, s) {
|
|
1663
|
+
const r = Mt(), n = fr(), l = vr(), o = r.defaultQueryOptions(e);
|
|
1664
|
+
o._optimisticResults = n ? "isRestoring" : "optimistic", br(o), yr(o, l), Cr(l);
|
|
1665
|
+
const [c] = h.useState(
|
|
1632
1666
|
() => new t(
|
|
1633
1667
|
r,
|
|
1634
1668
|
o
|
|
1635
1669
|
)
|
|
1636
|
-
),
|
|
1637
|
-
if (
|
|
1638
|
-
|
|
1639
|
-
(
|
|
1640
|
-
const
|
|
1641
|
-
} : c.subscribe(R.batchCalls(
|
|
1642
|
-
return c.updateResult(),
|
|
1670
|
+
), m = c.getOptimisticResult(o);
|
|
1671
|
+
if (h.useSyncExternalStore(
|
|
1672
|
+
h.useCallback(
|
|
1673
|
+
(y) => {
|
|
1674
|
+
const d = n ? () => {
|
|
1675
|
+
} : c.subscribe(R.batchCalls(y));
|
|
1676
|
+
return c.updateResult(), d;
|
|
1643
1677
|
},
|
|
1644
|
-
[c,
|
|
1678
|
+
[c, n]
|
|
1645
1679
|
),
|
|
1646
1680
|
() => c.getCurrentResult(),
|
|
1647
1681
|
() => c.getCurrentResult()
|
|
1648
|
-
),
|
|
1682
|
+
), h.useEffect(() => {
|
|
1649
1683
|
c.setOptions(o, { listeners: !1 });
|
|
1650
|
-
}, [o, c]),
|
|
1651
|
-
throw
|
|
1652
|
-
if (
|
|
1653
|
-
result:
|
|
1684
|
+
}, [o, c]), wr(o, m))
|
|
1685
|
+
throw jr(o, c, l);
|
|
1686
|
+
if (xr({
|
|
1687
|
+
result: m,
|
|
1654
1688
|
errorResetBoundary: l,
|
|
1655
1689
|
throwOnError: o.throwOnError,
|
|
1656
1690
|
query: r.getQueryCache().get(o.queryHash)
|
|
1657
1691
|
}))
|
|
1658
|
-
throw
|
|
1659
|
-
return o.notifyOnChangeProps ?
|
|
1692
|
+
throw m.error;
|
|
1693
|
+
return o.notifyOnChangeProps ? m : c.trackResult(m);
|
|
1660
1694
|
}
|
|
1661
|
-
function
|
|
1662
|
-
return
|
|
1695
|
+
function Cs(e, t) {
|
|
1696
|
+
return _r(e, lr);
|
|
1663
1697
|
}
|
|
1664
1698
|
function Sr(e, t) {
|
|
1665
|
-
const s =
|
|
1666
|
-
() => new
|
|
1699
|
+
const s = Mt(), [r] = h.useState(
|
|
1700
|
+
() => new hr(
|
|
1667
1701
|
s,
|
|
1668
1702
|
e
|
|
1669
1703
|
)
|
|
1670
1704
|
);
|
|
1671
|
-
|
|
1705
|
+
h.useEffect(() => {
|
|
1672
1706
|
r.setOptions(e);
|
|
1673
1707
|
}, [r, e]);
|
|
1674
|
-
const
|
|
1675
|
-
|
|
1708
|
+
const n = h.useSyncExternalStore(
|
|
1709
|
+
h.useCallback(
|
|
1676
1710
|
(o) => r.subscribe(R.batchCalls(o)),
|
|
1677
1711
|
[r]
|
|
1678
1712
|
),
|
|
1679
1713
|
() => r.getCurrentResult(),
|
|
1680
1714
|
() => r.getCurrentResult()
|
|
1681
|
-
), l =
|
|
1715
|
+
), l = h.useCallback(
|
|
1682
1716
|
(o, c) => {
|
|
1683
|
-
r.mutate(o, c).catch(
|
|
1717
|
+
r.mutate(o, c).catch(gr);
|
|
1684
1718
|
},
|
|
1685
1719
|
[r]
|
|
1686
1720
|
);
|
|
1687
|
-
if (
|
|
1688
|
-
throw
|
|
1689
|
-
return { ...
|
|
1690
|
-
}
|
|
1691
|
-
function Ar() {
|
|
1721
|
+
if (n.error && ys(r.options.throwOnError, [n.error]))
|
|
1722
|
+
throw n.error;
|
|
1723
|
+
return { ...n, mutate: l, mutateAsync: n.mutate };
|
|
1692
1724
|
}
|
|
1693
|
-
function
|
|
1725
|
+
function xs(e) {
|
|
1694
1726
|
var t, s, r = "";
|
|
1695
1727
|
if (typeof e == "string" || typeof e == "number")
|
|
1696
1728
|
r += e;
|
|
1697
1729
|
else if (typeof e == "object")
|
|
1698
1730
|
if (Array.isArray(e)) {
|
|
1699
|
-
var
|
|
1700
|
-
for (t = 0; t <
|
|
1701
|
-
e[t] && (s =
|
|
1731
|
+
var n = e.length;
|
|
1732
|
+
for (t = 0; t < n; t++)
|
|
1733
|
+
e[t] && (s = xs(e[t])) && (r && (r += " "), r += s);
|
|
1702
1734
|
} else
|
|
1703
1735
|
for (s in e)
|
|
1704
1736
|
e[s] && (r && (r += " "), r += s);
|
|
1705
1737
|
return r;
|
|
1706
1738
|
}
|
|
1707
|
-
function
|
|
1708
|
-
for (var e, t, s = 0, r = "",
|
|
1709
|
-
(e = arguments[s]) && (t =
|
|
1739
|
+
function N() {
|
|
1740
|
+
for (var e, t, s = 0, r = "", n = arguments.length; s < n; s++)
|
|
1741
|
+
(e = arguments[s]) && (t = xs(e)) && (r && (r += " "), r += t);
|
|
1710
1742
|
return r;
|
|
1711
1743
|
}
|
|
1712
|
-
var
|
|
1744
|
+
var Er = Object.defineProperty, Pr = Object.defineProperties, Ar = Object.getOwnPropertyDescriptors, at = Object.getOwnPropertySymbols, bs = Object.prototype.hasOwnProperty, ws = Object.prototype.propertyIsEnumerable, qt = (e, t, s) => t in e ? Er(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, w = (e, t) => {
|
|
1713
1745
|
for (var s in t || (t = {}))
|
|
1714
|
-
|
|
1715
|
-
if (
|
|
1716
|
-
for (var s of
|
|
1717
|
-
|
|
1746
|
+
bs.call(t, s) && qt(e, s, t[s]);
|
|
1747
|
+
if (at)
|
|
1748
|
+
for (var s of at(t))
|
|
1749
|
+
ws.call(t, s) && qt(e, s, t[s]);
|
|
1718
1750
|
return e;
|
|
1719
|
-
}, A = (e, t) =>
|
|
1751
|
+
}, A = (e, t) => Pr(e, Ar(t)), L = (e, t) => {
|
|
1720
1752
|
var s = {};
|
|
1721
1753
|
for (var r in e)
|
|
1722
|
-
|
|
1723
|
-
if (e != null &&
|
|
1724
|
-
for (var r of
|
|
1725
|
-
t.indexOf(r) < 0 &&
|
|
1754
|
+
bs.call(e, r) && t.indexOf(r) < 0 && (s[r] = e[r]);
|
|
1755
|
+
if (e != null && at)
|
|
1756
|
+
for (var r of at(e))
|
|
1757
|
+
t.indexOf(r) < 0 && ws.call(e, r) && (s[r] = e[r]);
|
|
1726
1758
|
return s;
|
|
1727
1759
|
};
|
|
1728
|
-
function
|
|
1729
|
-
return
|
|
1760
|
+
function ot() {
|
|
1761
|
+
return ot = Object.assign ? Object.assign.bind() : function(e) {
|
|
1730
1762
|
for (var t = 1; t < arguments.length; t++) {
|
|
1731
1763
|
var s = arguments[t];
|
|
1732
1764
|
for (var r in s)
|
|
1733
1765
|
Object.prototype.hasOwnProperty.call(s, r) && (e[r] = s[r]);
|
|
1734
1766
|
}
|
|
1735
1767
|
return e;
|
|
1736
|
-
},
|
|
1768
|
+
}, ot.apply(this, arguments);
|
|
1737
1769
|
}
|
|
1738
|
-
function
|
|
1770
|
+
function Nr(e, t) {
|
|
1739
1771
|
typeof e == "function" ? e(t) : e != null && (e.current = t);
|
|
1740
1772
|
}
|
|
1741
|
-
function
|
|
1773
|
+
function kr(...e) {
|
|
1742
1774
|
return (t) => e.forEach(
|
|
1743
|
-
(s) =>
|
|
1775
|
+
(s) => Nr(s, t)
|
|
1744
1776
|
);
|
|
1745
1777
|
}
|
|
1746
|
-
var
|
|
1747
|
-
const s = e, { children: r } = s,
|
|
1778
|
+
var Or = /* @__PURE__ */ h.forwardRef((e, t) => {
|
|
1779
|
+
const s = e, { children: r } = s, n = L(s, ["children"]), l = h.Children.toArray(r), o = l.find(Lr);
|
|
1748
1780
|
if (o) {
|
|
1749
|
-
const c = o.props.children,
|
|
1750
|
-
return /* @__PURE__ */
|
|
1781
|
+
const c = o.props.children, m = l.map((y) => y === o ? h.Children.count(c) > 1 ? h.Children.only(null) : /* @__PURE__ */ h.isValidElement(c) ? c.props.children : null : y);
|
|
1782
|
+
return /* @__PURE__ */ h.createElement(St, ot({}, n, {
|
|
1751
1783
|
ref: t
|
|
1752
|
-
}), /* @__PURE__ */
|
|
1784
|
+
}), /* @__PURE__ */ h.isValidElement(c) ? /* @__PURE__ */ h.cloneElement(c, void 0, m) : null);
|
|
1753
1785
|
}
|
|
1754
|
-
return /* @__PURE__ */
|
|
1786
|
+
return /* @__PURE__ */ h.createElement(St, ot({}, n, {
|
|
1755
1787
|
ref: t
|
|
1756
1788
|
}), r);
|
|
1757
1789
|
});
|
|
1758
|
-
|
|
1759
|
-
var
|
|
1760
|
-
const s = e, { children: r } = s,
|
|
1761
|
-
return /* @__PURE__ */
|
|
1762
|
-
ref: t ?
|
|
1763
|
-
})) :
|
|
1790
|
+
Or.displayName = "Slot";
|
|
1791
|
+
var St = /* @__PURE__ */ h.forwardRef((e, t) => {
|
|
1792
|
+
const s = e, { children: r } = s, n = L(s, ["children"]);
|
|
1793
|
+
return /* @__PURE__ */ h.isValidElement(r) ? /* @__PURE__ */ h.cloneElement(r, A(w({}, Fr(n, r.props)), {
|
|
1794
|
+
ref: t ? kr(t, r.ref) : r.ref
|
|
1795
|
+
})) : h.Children.count(r) > 1 ? h.Children.only(null) : null;
|
|
1764
1796
|
});
|
|
1765
|
-
|
|
1766
|
-
var
|
|
1767
|
-
function
|
|
1768
|
-
return /* @__PURE__ */
|
|
1797
|
+
St.displayName = "SlotClone";
|
|
1798
|
+
var Mr = ({ children: e }) => /* @__PURE__ */ h.createElement(h.Fragment, null, e);
|
|
1799
|
+
function Lr(e) {
|
|
1800
|
+
return /* @__PURE__ */ h.isValidElement(e) && e.type === Mr;
|
|
1769
1801
|
}
|
|
1770
|
-
function
|
|
1771
|
-
const s =
|
|
1802
|
+
function Fr(e, t) {
|
|
1803
|
+
const s = w({}, t);
|
|
1772
1804
|
for (const r in t) {
|
|
1773
|
-
const
|
|
1774
|
-
/^on[A-Z]/.test(r) ?
|
|
1775
|
-
l(...c),
|
|
1776
|
-
} :
|
|
1777
|
-
|
|
1805
|
+
const n = e[r], l = t[r];
|
|
1806
|
+
/^on[A-Z]/.test(r) ? n && l ? s[r] = (...c) => {
|
|
1807
|
+
l(...c), n(...c);
|
|
1808
|
+
} : n && (s[r] = n) : r === "style" ? s[r] = w(w({}, n), l) : r === "className" && (s[r] = [
|
|
1809
|
+
n,
|
|
1778
1810
|
l
|
|
1779
1811
|
].filter(Boolean).join(" "));
|
|
1780
1812
|
}
|
|
1781
|
-
return
|
|
1813
|
+
return w(w({}, e), s);
|
|
1782
1814
|
}
|
|
1783
|
-
var
|
|
1815
|
+
var Rr = ({ firstName: e, lastName: t, variant: s = "small" }) => {
|
|
1784
1816
|
const r = `${e.charAt(0)}${t.charAt(0)}`;
|
|
1785
1817
|
return /* @__PURE__ */ i.jsx(
|
|
1786
1818
|
"span",
|
|
@@ -1791,17 +1823,17 @@ var Tr = ({ firstName: e, lastName: t, variant: s = "small" }) => {
|
|
|
1791
1823
|
children: /* @__PURE__ */ i.jsx("span", { className: "avatar__initials", children: r })
|
|
1792
1824
|
}
|
|
1793
1825
|
);
|
|
1794
|
-
},
|
|
1826
|
+
}, Be = h.forwardRef(
|
|
1795
1827
|
(e, t) => {
|
|
1796
1828
|
var s = e, {
|
|
1797
1829
|
iconLeft: r,
|
|
1798
|
-
iconRight:
|
|
1830
|
+
iconRight: n,
|
|
1799
1831
|
isPending: l = !1,
|
|
1800
1832
|
isFilled: o = !1,
|
|
1801
1833
|
variant: c,
|
|
1802
|
-
className:
|
|
1803
|
-
children:
|
|
1804
|
-
} = s,
|
|
1834
|
+
className: m,
|
|
1835
|
+
children: y
|
|
1836
|
+
} = s, d = L(s, [
|
|
1805
1837
|
"iconLeft",
|
|
1806
1838
|
"iconRight",
|
|
1807
1839
|
"isPending",
|
|
@@ -1810,60 +1842,60 @@ var Tr = ({ firstName: e, lastName: t, variant: s = "small" }) => {
|
|
|
1810
1842
|
"className",
|
|
1811
1843
|
"children"
|
|
1812
1844
|
]);
|
|
1813
|
-
const
|
|
1845
|
+
const v = !!r || !!n;
|
|
1814
1846
|
return /* @__PURE__ */ i.jsxs(
|
|
1815
1847
|
"button",
|
|
1816
|
-
A(
|
|
1848
|
+
A(w({
|
|
1817
1849
|
ref: t
|
|
1818
|
-
},
|
|
1819
|
-
className:
|
|
1850
|
+
}, d), {
|
|
1851
|
+
className: N(
|
|
1820
1852
|
"button",
|
|
1821
1853
|
c && `button--${c}`,
|
|
1822
1854
|
c && o && `button--${c}--filled`,
|
|
1823
|
-
|
|
1855
|
+
v && "button--with-icon",
|
|
1824
1856
|
l && "button--pending",
|
|
1825
|
-
|
|
1857
|
+
m
|
|
1826
1858
|
),
|
|
1827
1859
|
children: [
|
|
1828
1860
|
r && /* @__PURE__ */ i.jsx("div", { className: "button__icon", children: r }),
|
|
1829
|
-
!!
|
|
1830
|
-
|
|
1861
|
+
!!y && /* @__PURE__ */ i.jsx("span", { className: "button__label", children: y }),
|
|
1862
|
+
n && /* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: n })
|
|
1831
1863
|
]
|
|
1832
1864
|
})
|
|
1833
1865
|
);
|
|
1834
1866
|
}
|
|
1835
1867
|
);
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
var
|
|
1868
|
+
Be.displayName = "Button";
|
|
1869
|
+
h.createContext(void 0);
|
|
1870
|
+
var Dr = h.forwardRef(
|
|
1839
1871
|
(e, t) => {
|
|
1840
|
-
var s = e, { prefix: r, suffix:
|
|
1872
|
+
var s = e, { prefix: r, suffix: n, className: l } = s, o = L(s, ["prefix", "suffix", "className"]);
|
|
1841
1873
|
return /* @__PURE__ */ i.jsxs("div", { className: "input__wrapper", children: [
|
|
1842
1874
|
r && /* @__PURE__ */ i.jsx("span", { className: "input__prefix", children: r }),
|
|
1843
1875
|
/* @__PURE__ */ i.jsx(
|
|
1844
1876
|
"input",
|
|
1845
|
-
|
|
1877
|
+
w({
|
|
1846
1878
|
ref: t,
|
|
1847
|
-
className:
|
|
1879
|
+
className: N(
|
|
1848
1880
|
"input",
|
|
1849
1881
|
r && "input--with-prefix",
|
|
1850
|
-
|
|
1882
|
+
n && "input--with-suffix",
|
|
1851
1883
|
l
|
|
1852
1884
|
)
|
|
1853
1885
|
}, o)
|
|
1854
1886
|
),
|
|
1855
|
-
|
|
1887
|
+
n && /* @__PURE__ */ i.jsx("span", { className: "input__suffix", children: n })
|
|
1856
1888
|
] });
|
|
1857
1889
|
}
|
|
1858
1890
|
);
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
var
|
|
1862
|
-
var t = e, { children: s, className: r } = t,
|
|
1863
|
-
return /* @__PURE__ */ i.jsx("div", A(
|
|
1864
|
-
},
|
|
1891
|
+
Dr.displayName = "TextField";
|
|
1892
|
+
h.createContext(void 0);
|
|
1893
|
+
var Tr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__header__action", children: e }), Ur = (e) => {
|
|
1894
|
+
var t = e, { children: s, className: r } = t, n = L(t, ["children", "className"]);
|
|
1895
|
+
return /* @__PURE__ */ i.jsx("div", A(w({ className: N("card__body", r) }, n), { children: s }));
|
|
1896
|
+
}, Qr = (e) => /* @__PURE__ */ i.jsx(
|
|
1865
1897
|
"svg",
|
|
1866
|
-
A(
|
|
1898
|
+
A(w({
|
|
1867
1899
|
width: "24",
|
|
1868
1900
|
height: "24",
|
|
1869
1901
|
viewBox: "0 0 24 24",
|
|
@@ -1881,9 +1913,9 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1881
1913
|
}
|
|
1882
1914
|
)
|
|
1883
1915
|
})
|
|
1884
|
-
),
|
|
1916
|
+
), Lt = Qr, Hr = (e) => /* @__PURE__ */ i.jsx(
|
|
1885
1917
|
"svg",
|
|
1886
|
-
A(
|
|
1918
|
+
A(w({
|
|
1887
1919
|
width: "24",
|
|
1888
1920
|
height: "24",
|
|
1889
1921
|
viewBox: "0 0 24 24",
|
|
@@ -1901,9 +1933,9 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1901
1933
|
}
|
|
1902
1934
|
)
|
|
1903
1935
|
})
|
|
1904
|
-
),
|
|
1936
|
+
), $r = Hr, Kr = (e) => /* @__PURE__ */ i.jsx(
|
|
1905
1937
|
"svg",
|
|
1906
|
-
A(
|
|
1938
|
+
A(w({
|
|
1907
1939
|
width: "24",
|
|
1908
1940
|
height: "24",
|
|
1909
1941
|
viewBox: "0 0 24 24",
|
|
@@ -1920,9 +1952,9 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1920
1952
|
}
|
|
1921
1953
|
)
|
|
1922
1954
|
})
|
|
1923
|
-
), qr =
|
|
1955
|
+
), qr = Kr, Gr = (e) => /* @__PURE__ */ i.jsx(
|
|
1924
1956
|
"svg",
|
|
1925
|
-
A(
|
|
1957
|
+
A(w({
|
|
1926
1958
|
width: "24",
|
|
1927
1959
|
height: "24",
|
|
1928
1960
|
viewBox: "0 0 24 24",
|
|
@@ -1939,9 +1971,9 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1939
1971
|
}
|
|
1940
1972
|
)
|
|
1941
1973
|
})
|
|
1942
|
-
),
|
|
1974
|
+
), Vr = Gr, Wr = (e) => /* @__PURE__ */ i.jsx(
|
|
1943
1975
|
"svg",
|
|
1944
|
-
A(
|
|
1976
|
+
A(w({
|
|
1945
1977
|
width: "24",
|
|
1946
1978
|
height: "24",
|
|
1947
1979
|
viewBox: "0 0 24 24",
|
|
@@ -1958,9 +1990,9 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1958
1990
|
}
|
|
1959
1991
|
)
|
|
1960
1992
|
})
|
|
1961
|
-
),
|
|
1993
|
+
), Zr = Wr, Yr = (e) => /* @__PURE__ */ i.jsxs(
|
|
1962
1994
|
"svg",
|
|
1963
|
-
A(
|
|
1995
|
+
A(w({
|
|
1964
1996
|
width: "24",
|
|
1965
1997
|
height: "24",
|
|
1966
1998
|
fill: "none",
|
|
@@ -1995,9 +2027,9 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
1995
2027
|
/* @__PURE__ */ i.jsx("defs", { children: /* @__PURE__ */ i.jsx("clipPath", { id: "clip0_19_444", children: /* @__PURE__ */ i.jsx("rect", { width: "24", height: "24", fill: "white" }) }) })
|
|
1996
2028
|
]
|
|
1997
2029
|
})
|
|
1998
|
-
),
|
|
2030
|
+
), zr = Yr, Jr = (e) => /* @__PURE__ */ i.jsxs(
|
|
1999
2031
|
"svg",
|
|
2000
|
-
A(
|
|
2032
|
+
A(w({
|
|
2001
2033
|
width: "24",
|
|
2002
2034
|
height: "24",
|
|
2003
2035
|
viewBox: "0 0 24 24",
|
|
@@ -2027,9 +2059,9 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2027
2059
|
)
|
|
2028
2060
|
]
|
|
2029
2061
|
})
|
|
2030
|
-
),
|
|
2062
|
+
), Xr = Jr, Ir = (e) => /* @__PURE__ */ i.jsxs(
|
|
2031
2063
|
"svg",
|
|
2032
|
-
A(
|
|
2064
|
+
A(w({
|
|
2033
2065
|
width: "24",
|
|
2034
2066
|
height: "24",
|
|
2035
2067
|
viewBox: "0 0 24 24",
|
|
@@ -2079,17 +2111,17 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2079
2111
|
)
|
|
2080
2112
|
]
|
|
2081
2113
|
})
|
|
2082
|
-
),
|
|
2083
|
-
var t = e, { className: s } = t, r =
|
|
2114
|
+
), Br = Ir, ei = (e) => {
|
|
2115
|
+
var t = e, { className: s } = t, r = L(t, ["className"]);
|
|
2084
2116
|
return /* @__PURE__ */ i.jsxs(
|
|
2085
2117
|
"svg",
|
|
2086
|
-
A(
|
|
2118
|
+
A(w({
|
|
2087
2119
|
width: "20",
|
|
2088
2120
|
height: "20",
|
|
2089
2121
|
viewBox: "0 0 20 20",
|
|
2090
2122
|
fill: "none",
|
|
2091
2123
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2092
|
-
className:
|
|
2124
|
+
className: N("spinner", s)
|
|
2093
2125
|
}, r), {
|
|
2094
2126
|
children: [
|
|
2095
2127
|
/* @__PURE__ */ i.jsx("circle", { cx: "10", cy: "10", r: "9", stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "1.5" }),
|
|
@@ -2108,9 +2140,9 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2108
2140
|
]
|
|
2109
2141
|
})
|
|
2110
2142
|
);
|
|
2111
|
-
},
|
|
2143
|
+
}, ti = ei, si = (e) => /* @__PURE__ */ i.jsxs(
|
|
2112
2144
|
"svg",
|
|
2113
|
-
A(
|
|
2145
|
+
A(w({
|
|
2114
2146
|
width: "24",
|
|
2115
2147
|
height: "24",
|
|
2116
2148
|
fill: "none",
|
|
@@ -2142,11 +2174,11 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2142
2174
|
/* @__PURE__ */ i.jsx("defs", { children: /* @__PURE__ */ i.jsx("clipPath", { id: "clip0_762_2934", children: /* @__PURE__ */ i.jsx("rect", { width: "24", height: "24", fill: "white" }) }) })
|
|
2143
2175
|
]
|
|
2144
2176
|
})
|
|
2145
|
-
),
|
|
2177
|
+
), ri = si, ii = (e) => {
|
|
2146
2178
|
const t = (s) => `${s}${e.suffix ? `_${e.suffix}` : ""}`;
|
|
2147
2179
|
return /* @__PURE__ */ i.jsxs(
|
|
2148
2180
|
"svg",
|
|
2149
|
-
A(
|
|
2181
|
+
A(w({
|
|
2150
2182
|
width: "24",
|
|
2151
2183
|
height: "24",
|
|
2152
2184
|
viewBox: "0 0 24 24",
|
|
@@ -2313,9 +2345,9 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2313
2345
|
]
|
|
2314
2346
|
})
|
|
2315
2347
|
);
|
|
2316
|
-
},
|
|
2348
|
+
}, js = ii, ni = (e) => /* @__PURE__ */ i.jsxs(
|
|
2317
2349
|
"svg",
|
|
2318
|
-
A(
|
|
2350
|
+
A(w({
|
|
2319
2351
|
fill: "none",
|
|
2320
2352
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2321
2353
|
viewBox: "0 0 24 24",
|
|
@@ -2375,9 +2407,9 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2375
2407
|
)
|
|
2376
2408
|
]
|
|
2377
2409
|
})
|
|
2378
|
-
),
|
|
2410
|
+
), ai = ni, oi = (e) => /* @__PURE__ */ i.jsx(
|
|
2379
2411
|
"svg",
|
|
2380
|
-
A(
|
|
2412
|
+
A(w({
|
|
2381
2413
|
fill: "none",
|
|
2382
2414
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2383
2415
|
viewBox: "0 0 21 16",
|
|
@@ -2395,9 +2427,9 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2395
2427
|
}
|
|
2396
2428
|
)
|
|
2397
2429
|
})
|
|
2398
|
-
),
|
|
2430
|
+
), li = oi, ci = (e) => /* @__PURE__ */ i.jsxs(
|
|
2399
2431
|
"svg",
|
|
2400
|
-
A(
|
|
2432
|
+
A(w({
|
|
2401
2433
|
width: "24",
|
|
2402
2434
|
height: "24",
|
|
2403
2435
|
fill: "none",
|
|
@@ -2422,15 +2454,15 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2422
2454
|
/* @__PURE__ */ i.jsx("circle", { r: ".8", transform: "matrix(1 0 0 -1 20.8 20.7)", fill: "currentColor" })
|
|
2423
2455
|
]
|
|
2424
2456
|
})
|
|
2425
|
-
),
|
|
2457
|
+
), ui = ci, hi = (e) => {
|
|
2426
2458
|
var t = e, {
|
|
2427
2459
|
variant: s,
|
|
2428
2460
|
icon: r,
|
|
2429
|
-
isStandalone:
|
|
2461
|
+
isStandalone: n,
|
|
2430
2462
|
title: l,
|
|
2431
2463
|
description: o,
|
|
2432
2464
|
className: c
|
|
2433
|
-
} = t,
|
|
2465
|
+
} = t, m = L(t, [
|
|
2434
2466
|
"variant",
|
|
2435
2467
|
"icon",
|
|
2436
2468
|
"isStandalone",
|
|
@@ -2440,15 +2472,15 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2440
2472
|
]);
|
|
2441
2473
|
return /* @__PURE__ */ i.jsx(
|
|
2442
2474
|
"div",
|
|
2443
|
-
A(
|
|
2444
|
-
className:
|
|
2475
|
+
A(w({}, m), {
|
|
2476
|
+
className: N(
|
|
2445
2477
|
"card__empty-state",
|
|
2446
2478
|
s === "error" && "card__empty-state--error",
|
|
2447
|
-
|
|
2479
|
+
n && "card__empty-state--standalone",
|
|
2448
2480
|
c
|
|
2449
2481
|
),
|
|
2450
2482
|
children: /* @__PURE__ */ i.jsxs("div", { className: "card__empty-state__wrapper", children: [
|
|
2451
|
-
/* @__PURE__ */ i.jsx("i", { className: "card__empty-state__icon", "aria-hidden": !0, children: s === "error" ? /* @__PURE__ */ i.jsx(
|
|
2483
|
+
/* @__PURE__ */ i.jsx("i", { className: "card__empty-state__icon", "aria-hidden": !0, children: s === "error" ? /* @__PURE__ */ i.jsx(ri, {}) : r }),
|
|
2452
2484
|
/* @__PURE__ */ i.jsxs("div", { className: "card__empty-state__content", children: [
|
|
2453
2485
|
/* @__PURE__ */ i.jsx("p", { className: "card__empty-state__title", children: l }),
|
|
2454
2486
|
/* @__PURE__ */ i.jsx("p", { className: "card__empty-state__description", children: o })
|
|
@@ -2456,13 +2488,13 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2456
2488
|
] })
|
|
2457
2489
|
})
|
|
2458
2490
|
);
|
|
2459
|
-
},
|
|
2491
|
+
}, di = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__footer", children: e }), fi = (e) => {
|
|
2460
2492
|
var t = e, {
|
|
2461
2493
|
variant: s = "default",
|
|
2462
2494
|
sticky: r,
|
|
2463
|
-
className:
|
|
2495
|
+
className: n,
|
|
2464
2496
|
children: l
|
|
2465
|
-
} = t, o =
|
|
2497
|
+
} = t, o = L(t, [
|
|
2466
2498
|
"variant",
|
|
2467
2499
|
"sticky",
|
|
2468
2500
|
"className",
|
|
@@ -2470,75 +2502,75 @@ var Qr = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__h
|
|
|
2470
2502
|
]);
|
|
2471
2503
|
return /* @__PURE__ */ i.jsx(
|
|
2472
2504
|
"div",
|
|
2473
|
-
A(
|
|
2474
|
-
className:
|
|
2505
|
+
A(w({}, o), {
|
|
2506
|
+
className: N(
|
|
2475
2507
|
"card__header",
|
|
2476
2508
|
s && `card__header--${s}`,
|
|
2477
2509
|
r && "card__header--sticky",
|
|
2478
|
-
|
|
2510
|
+
n
|
|
2479
2511
|
),
|
|
2480
2512
|
children: l
|
|
2481
2513
|
})
|
|
2482
2514
|
);
|
|
2483
|
-
},
|
|
2515
|
+
}, pi = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__image", children: e }), mi = ({ children: e, className: t }) => /* @__PURE__ */ i.jsx("div", { className: N("card__body__item", t), children: e }), vi = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "card__body__subtitle", children: e }), gi = ({ icon: e, children: t }) => /* @__PURE__ */ i.jsxs("div", { className: "card__header__title", children: [
|
|
2484
2516
|
e && /* @__PURE__ */ i.jsx("span", { className: "card__header__title__icon", children: e }),
|
|
2485
2517
|
t
|
|
2486
|
-
] }),
|
|
2518
|
+
] }), _s = h.forwardRef(
|
|
2487
2519
|
(e, t) => {
|
|
2488
|
-
var s = e, { type: r, children:
|
|
2489
|
-
return
|
|
2520
|
+
var s = e, { type: r, children: n, className: l, variant: o = "default", disabled: c = !1 } = s, m = L(s, ["type", "children", "className", "variant", "disabled"]);
|
|
2521
|
+
return h.createElement(
|
|
2490
2522
|
r,
|
|
2491
|
-
|
|
2492
|
-
className:
|
|
2523
|
+
w({
|
|
2524
|
+
className: N(
|
|
2493
2525
|
"card",
|
|
2494
2526
|
c && "card--disabled",
|
|
2495
2527
|
o && `card--${o}`,
|
|
2496
2528
|
l
|
|
2497
2529
|
),
|
|
2498
2530
|
ref: t
|
|
2499
|
-
},
|
|
2500
|
-
|
|
2531
|
+
}, m),
|
|
2532
|
+
n
|
|
2501
2533
|
);
|
|
2502
2534
|
}
|
|
2503
2535
|
);
|
|
2504
|
-
|
|
2505
|
-
Object.assign(
|
|
2506
|
-
Header:
|
|
2507
|
-
Action:
|
|
2508
|
-
Title:
|
|
2509
|
-
Subtitle:
|
|
2510
|
-
Body:
|
|
2511
|
-
Image:
|
|
2512
|
-
Item:
|
|
2513
|
-
Footer:
|
|
2514
|
-
EmptyState:
|
|
2536
|
+
_s.displayName = "Card";
|
|
2537
|
+
Object.assign(_s, {
|
|
2538
|
+
Header: fi,
|
|
2539
|
+
Action: Tr,
|
|
2540
|
+
Title: gi,
|
|
2541
|
+
Subtitle: vi,
|
|
2542
|
+
Body: Ur,
|
|
2543
|
+
Image: pi,
|
|
2544
|
+
Item: mi,
|
|
2545
|
+
Footer: di,
|
|
2546
|
+
EmptyState: hi
|
|
2515
2547
|
});
|
|
2516
|
-
var
|
|
2517
|
-
var t = e, { className: s, children: r } = t,
|
|
2518
|
-
return /* @__PURE__ */ i.jsx("div", A(
|
|
2519
|
-
},
|
|
2520
|
-
var t = e, { className: s, children: r } = t,
|
|
2521
|
-
return /* @__PURE__ */ i.jsx("span", A(
|
|
2522
|
-
},
|
|
2523
|
-
const e =
|
|
2548
|
+
var yi = (e) => {
|
|
2549
|
+
var t = e, { className: s, children: r } = t, n = L(t, ["className", "children"]);
|
|
2550
|
+
return /* @__PURE__ */ i.jsx("div", A(w({ className: N("checkbox__content", s) }, n), { children: r }));
|
|
2551
|
+
}, Ci = (e) => {
|
|
2552
|
+
var t = e, { className: s, children: r } = t, n = L(t, ["className", "children"]);
|
|
2553
|
+
return /* @__PURE__ */ i.jsx("span", A(w({ className: N("checkbox__hint", s) }, n), { children: r }));
|
|
2554
|
+
}, Ss = h.createContext(void 0), xi = ({ id: e, name: t, children: s }) => /* @__PURE__ */ i.jsx(Ss.Provider, { value: { id: e, name: t }, children: s }), bi = () => {
|
|
2555
|
+
const e = h.useContext(Ss);
|
|
2524
2556
|
if (!e)
|
|
2525
2557
|
throw new Error("Checkbox compound components can not be rendered outside of Checkbox");
|
|
2526
2558
|
return e;
|
|
2527
|
-
},
|
|
2528
|
-
var t = e, { className: s, children: r } = t,
|
|
2529
|
-
const { id: l } =
|
|
2530
|
-
return /* @__PURE__ */ i.jsx("label", A(
|
|
2531
|
-
},
|
|
2559
|
+
}, wi = (e) => {
|
|
2560
|
+
var t = e, { className: s, children: r } = t, n = L(t, ["className", "children"]);
|
|
2561
|
+
const { id: l } = bi();
|
|
2562
|
+
return /* @__PURE__ */ i.jsx("label", A(w({ htmlFor: l, className: N("checkbox__label", s) }, n), { children: r }));
|
|
2563
|
+
}, xe = (e) => {
|
|
2532
2564
|
var t = e, {
|
|
2533
2565
|
id: s,
|
|
2534
2566
|
name: r,
|
|
2535
|
-
isPending:
|
|
2567
|
+
isPending: n = !1,
|
|
2536
2568
|
variant: l = "neutral",
|
|
2537
2569
|
hasError: o = !1,
|
|
2538
2570
|
single: c,
|
|
2539
|
-
className:
|
|
2540
|
-
children:
|
|
2541
|
-
} = t,
|
|
2571
|
+
className: m,
|
|
2572
|
+
children: y
|
|
2573
|
+
} = t, d = L(t, [
|
|
2542
2574
|
"id",
|
|
2543
2575
|
"name",
|
|
2544
2576
|
"isPending",
|
|
@@ -2548,125 +2580,125 @@ var xi = (e) => {
|
|
|
2548
2580
|
"className",
|
|
2549
2581
|
"children"
|
|
2550
2582
|
]);
|
|
2551
|
-
const
|
|
2552
|
-
return
|
|
2553
|
-
|
|
2554
|
-
}, [
|
|
2583
|
+
const v = h.useRef(null);
|
|
2584
|
+
return h.useEffect(() => {
|
|
2585
|
+
v.current && (n ? v.current.indeterminate = !0 : v.current.indeterminate = !1);
|
|
2586
|
+
}, [n]), /* @__PURE__ */ i.jsxs(
|
|
2555
2587
|
"div",
|
|
2556
2588
|
{
|
|
2557
|
-
className:
|
|
2589
|
+
className: N("checkbox", l && `checkbox--${l}`, o && "checkbox--error"),
|
|
2558
2590
|
children: [
|
|
2559
2591
|
/* @__PURE__ */ i.jsx(
|
|
2560
2592
|
"input",
|
|
2561
|
-
|
|
2593
|
+
w({
|
|
2562
2594
|
id: s,
|
|
2563
2595
|
name: r,
|
|
2564
2596
|
type: "checkbox",
|
|
2565
|
-
ref:
|
|
2566
|
-
className:
|
|
2597
|
+
ref: v,
|
|
2598
|
+
className: N("checkbox__input", m),
|
|
2567
2599
|
value: c ? "true" : ""
|
|
2568
|
-
},
|
|
2600
|
+
}, d)
|
|
2569
2601
|
),
|
|
2570
|
-
|
|
2571
|
-
/* @__PURE__ */ i.jsx(
|
|
2602
|
+
n ? /* @__PURE__ */ i.jsx(ti, { className: "checkbox__spinner", "aria-hidden": !0 }) : /* @__PURE__ */ i.jsx($r, { className: "checkbox__check", "aria-hidden": !0, strokeDasharray: "75" }),
|
|
2603
|
+
/* @__PURE__ */ i.jsx(xi, { id: s, name: r, children: y })
|
|
2572
2604
|
]
|
|
2573
2605
|
}
|
|
2574
2606
|
);
|
|
2575
2607
|
};
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
var
|
|
2581
|
-
var t = e, { type: s = "div", className: r, children:
|
|
2582
|
-
return
|
|
2583
|
-
},
|
|
2584
|
-
var t = e, { className: s, children: r, shouldAnimate:
|
|
2585
|
-
const { ref: o, defaultOpen: c, isModal:
|
|
2586
|
-
return
|
|
2587
|
-
const
|
|
2588
|
-
if (
|
|
2589
|
-
const
|
|
2590
|
-
if (!(
|
|
2608
|
+
xe.Content = yi;
|
|
2609
|
+
xe.Label = wi;
|
|
2610
|
+
xe.Hint = Ci;
|
|
2611
|
+
xe.Error = Error;
|
|
2612
|
+
var ji = (e) => {
|
|
2613
|
+
var t = e, { type: s = "div", className: r, children: n } = t, l = L(t, ["type", "className", "children"]);
|
|
2614
|
+
return h.createElement(s, w({ className: N("dialog__body", r) }, l), n);
|
|
2615
|
+
}, Et = () => document.body.style.removeProperty("overflow"), Gt = (e) => e.preventDefault(), _i = '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])', Si = (e) => {
|
|
2616
|
+
var t = e, { className: s, children: r, shouldAnimate: n = !0 } = t, l = L(t, ["className", "children", "shouldAnimate"]);
|
|
2617
|
+
const { ref: o, defaultOpen: c, isModal: m, onClose: y } = et();
|
|
2618
|
+
return h.useEffect(() => {
|
|
2619
|
+
const d = o == null ? void 0 : o.current;
|
|
2620
|
+
if (d != null && d.open) {
|
|
2621
|
+
const v = d.querySelectorAll(_i), u = v[0], p = v[v.length - 1], E = (S) => {
|
|
2622
|
+
if (!(S.key === "Tab"))
|
|
2591
2623
|
return;
|
|
2592
|
-
|
|
2624
|
+
S.shiftKey ? document.activeElement === u && (p.focus(), S.preventDefault()) : document.activeElement === p && (u.focus(), S.preventDefault());
|
|
2593
2625
|
};
|
|
2594
|
-
return document.body.style.overflow = "hidden",
|
|
2595
|
-
|
|
2626
|
+
return document.body.style.overflow = "hidden", d.addEventListener("keydown", E), window.addEventListener("popstate", () => Et()), () => {
|
|
2627
|
+
d.removeEventListener("keydown", E), window.removeEventListener("popstate", () => Et());
|
|
2596
2628
|
};
|
|
2597
2629
|
}
|
|
2598
|
-
}, [o]),
|
|
2599
|
-
const
|
|
2600
|
-
if (!
|
|
2630
|
+
}, [o]), h.useEffect(() => {
|
|
2631
|
+
const d = o == null ? void 0 : o.current;
|
|
2632
|
+
if (!d)
|
|
2601
2633
|
return;
|
|
2602
|
-
if (c && (
|
|
2603
|
-
return
|
|
2604
|
-
const
|
|
2605
|
-
const { top:
|
|
2606
|
-
|
|
2634
|
+
if (c && (d.removeAttribute("open"), d.showModal(), d.focus()), m)
|
|
2635
|
+
return d.addEventListener("cancel", Gt), () => d.removeEventListener("cancel", Gt);
|
|
2636
|
+
const v = ({ clientX: u, clientY: p }) => {
|
|
2637
|
+
const { top: E, right: S, bottom: j, left: x } = d.getBoundingClientRect(), C = 0 < p && 0 < u, _ = E < p && p < j, O = x < u && u < S;
|
|
2638
|
+
C && !(_ && O) && y();
|
|
2607
2639
|
};
|
|
2608
|
-
return
|
|
2609
|
-
|
|
2640
|
+
return d.addEventListener("cancel", y), d.addEventListener("mousedown", v), () => {
|
|
2641
|
+
d.removeEventListener("cancel", y), d.removeEventListener("mousedown", v);
|
|
2610
2642
|
};
|
|
2611
|
-
}, [o,
|
|
2643
|
+
}, [o, m, y, c]), /* @__PURE__ */ i.jsx(
|
|
2612
2644
|
"dialog",
|
|
2613
|
-
A(
|
|
2645
|
+
A(w({
|
|
2614
2646
|
ref: o,
|
|
2615
2647
|
open: c,
|
|
2616
|
-
"aria-modal": !!
|
|
2648
|
+
"aria-modal": !!m,
|
|
2617
2649
|
"aria-labelledby": "dialogTitle",
|
|
2618
|
-
className:
|
|
2650
|
+
className: N("dialog", n && "dialog--animated", s)
|
|
2619
2651
|
}, l), {
|
|
2620
2652
|
children: r
|
|
2621
2653
|
})
|
|
2622
2654
|
);
|
|
2623
|
-
},
|
|
2624
|
-
const
|
|
2655
|
+
}, Es = h.createContext(void 0), Ei = ({ defaultOpen: e, onClose: t, isModal: s, children: r }) => {
|
|
2656
|
+
const n = h.useRef(null), l = h.useRef(t), o = h.useCallback(() => {
|
|
2625
2657
|
var c;
|
|
2626
|
-
|
|
2627
|
-
}, [
|
|
2628
|
-
return /* @__PURE__ */ i.jsx(
|
|
2629
|
-
},
|
|
2630
|
-
const e =
|
|
2658
|
+
Et(), (c = n.current) == null || c.close(), l.current && (l == null || l.current());
|
|
2659
|
+
}, [n]);
|
|
2660
|
+
return /* @__PURE__ */ i.jsx(Es.Provider, { value: { ref: n, defaultOpen: e, isModal: s, onClose: o }, children: r });
|
|
2661
|
+
}, et = () => {
|
|
2662
|
+
const e = h.useContext(Es);
|
|
2631
2663
|
if (!e)
|
|
2632
2664
|
throw new Error("Dialog compound components can not be rendered outside of Dialog");
|
|
2633
2665
|
return e;
|
|
2634
|
-
},
|
|
2635
|
-
var t = e, { children: s } = t, r =
|
|
2636
|
-
const { onClose:
|
|
2637
|
-
return /* @__PURE__ */ i.jsx(
|
|
2638
|
-
},
|
|
2639
|
-
var s = e, { className: r } = s,
|
|
2640
|
-
const { onClose: l } =
|
|
2666
|
+
}, Pi = (e) => {
|
|
2667
|
+
var t = e, { children: s } = t, r = L(t, ["children"]);
|
|
2668
|
+
const { onClose: n } = et();
|
|
2669
|
+
return /* @__PURE__ */ i.jsx(Be, A(w({ onClick: n }, r), { children: s }));
|
|
2670
|
+
}, Ps = h.forwardRef((e, t) => {
|
|
2671
|
+
var s = e, { className: r } = s, n = L(s, ["className"]);
|
|
2672
|
+
const { onClose: l } = et();
|
|
2641
2673
|
return /* @__PURE__ */ i.jsx(
|
|
2642
|
-
|
|
2643
|
-
|
|
2674
|
+
Be,
|
|
2675
|
+
w({
|
|
2644
2676
|
type: "submit",
|
|
2645
2677
|
ref: t,
|
|
2646
2678
|
formMethod: "dialog",
|
|
2647
2679
|
onClick: l,
|
|
2648
2680
|
iconLeft: /* @__PURE__ */ i.jsx(qr, {}),
|
|
2649
2681
|
variant: "icon--secondary",
|
|
2650
|
-
className:
|
|
2651
|
-
},
|
|
2682
|
+
className: N("dialog__close button--icon", r)
|
|
2683
|
+
}, n)
|
|
2652
2684
|
);
|
|
2653
2685
|
});
|
|
2654
|
-
|
|
2655
|
-
var
|
|
2656
|
-
var t = e, { className: s, children: r } = t,
|
|
2657
|
-
return /* @__PURE__ */ i.jsx("div", A(
|
|
2658
|
-
},
|
|
2659
|
-
var t = e, { icon: s, children: r, className:
|
|
2660
|
-
const { ref: o } =
|
|
2661
|
-
return
|
|
2686
|
+
Ps.displayName = "Close";
|
|
2687
|
+
var Ai = (e) => {
|
|
2688
|
+
var t = e, { className: s, children: r } = t, n = L(t, ["className", "children"]);
|
|
2689
|
+
return /* @__PURE__ */ i.jsx("div", A(w({ className: N("dialog__footer", s) }, n), { children: r }));
|
|
2690
|
+
}, Ni = ({ children: e }) => /* @__PURE__ */ i.jsx("div", { className: "dialog__header", children: e }), ki = (e) => {
|
|
2691
|
+
var t = e, { icon: s, children: r, className: n } = t, l = L(t, ["icon", "children", "className"]);
|
|
2692
|
+
const { ref: o } = et(), c = h.useRef(null);
|
|
2693
|
+
return h.useEffect(() => {
|
|
2662
2694
|
o != null && o.current && o.current.focus();
|
|
2663
2695
|
}, [o]), /* @__PURE__ */ i.jsxs(
|
|
2664
2696
|
"div",
|
|
2665
|
-
A(
|
|
2697
|
+
A(w({
|
|
2666
2698
|
tabIndex: 0,
|
|
2667
2699
|
ref: c,
|
|
2668
2700
|
id: "dialogTitle",
|
|
2669
|
-
className:
|
|
2701
|
+
className: N("dialog__header__title", n)
|
|
2670
2702
|
}, l), {
|
|
2671
2703
|
children: [
|
|
2672
2704
|
s && /* @__PURE__ */ i.jsx("span", { className: "dialog__header__icon", children: s }),
|
|
@@ -2674,105 +2706,105 @@ var Ni = (e) => {
|
|
|
2674
2706
|
]
|
|
2675
2707
|
})
|
|
2676
2708
|
);
|
|
2677
|
-
},
|
|
2678
|
-
var t = e, { children: s } = t, r =
|
|
2679
|
-
const { ref:
|
|
2680
|
-
return /* @__PURE__ */ i.jsx(
|
|
2709
|
+
}, Oi = (e) => {
|
|
2710
|
+
var t = e, { children: s } = t, r = L(t, ["children"]);
|
|
2711
|
+
const { ref: n } = et();
|
|
2712
|
+
return /* @__PURE__ */ i.jsx(Be, A(w({ onClick: () => {
|
|
2681
2713
|
var l;
|
|
2682
|
-
return (l =
|
|
2714
|
+
return (l = n == null ? void 0 : n.current) == null ? void 0 : l.showModal();
|
|
2683
2715
|
} }, r), { children: s }));
|
|
2684
|
-
},
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
var
|
|
2716
|
+
}, $ = ({ defaultOpen: e, isModal: t, children: s, onClose: r }) => /* @__PURE__ */ i.jsx(Ei, { defaultOpen: !!e, isModal: t, onClose: r, children: s });
|
|
2717
|
+
$.Trigger = Oi;
|
|
2718
|
+
$.Root = Si;
|
|
2719
|
+
$.Title = ki;
|
|
2720
|
+
$.Header = Ni;
|
|
2721
|
+
$.Body = ji;
|
|
2722
|
+
$.Footer = Ai;
|
|
2723
|
+
$.Button = Pi;
|
|
2724
|
+
$.Close = Ps;
|
|
2725
|
+
var As = h.createContext(void 0), Mi = ({
|
|
2694
2726
|
id: e,
|
|
2695
2727
|
position: t,
|
|
2696
2728
|
isOpen: s,
|
|
2697
2729
|
setIsOpen: r,
|
|
2698
|
-
activeItemIndex:
|
|
2730
|
+
activeItemIndex: n,
|
|
2699
2731
|
setActiveItemIndex: l,
|
|
2700
2732
|
clearActiveItemIndex: o,
|
|
2701
2733
|
triggerRef: c,
|
|
2702
|
-
contentRef:
|
|
2703
|
-
children:
|
|
2734
|
+
contentRef: m,
|
|
2735
|
+
children: y
|
|
2704
2736
|
}) => /* @__PURE__ */ i.jsx(
|
|
2705
|
-
|
|
2737
|
+
As.Provider,
|
|
2706
2738
|
{
|
|
2707
2739
|
value: {
|
|
2708
2740
|
id: e,
|
|
2709
2741
|
position: t,
|
|
2710
2742
|
isOpen: s,
|
|
2711
2743
|
setIsOpen: r,
|
|
2712
|
-
activeItemIndex:
|
|
2744
|
+
activeItemIndex: n,
|
|
2713
2745
|
setActiveItemIndex: l,
|
|
2714
2746
|
clearActiveItemIndex: o,
|
|
2715
2747
|
triggerRef: c,
|
|
2716
|
-
contentRef:
|
|
2748
|
+
contentRef: m
|
|
2717
2749
|
},
|
|
2718
|
-
children:
|
|
2750
|
+
children: y
|
|
2719
2751
|
}
|
|
2720
|
-
),
|
|
2721
|
-
const e =
|
|
2752
|
+
), Ns = () => {
|
|
2753
|
+
const e = h.useContext(As);
|
|
2722
2754
|
if (e === void 0)
|
|
2723
2755
|
throw new Error("useMenu must be used within a MenuProvider");
|
|
2724
2756
|
return e;
|
|
2725
|
-
},
|
|
2757
|
+
}, Li = ({ as: e, children: t }) => {
|
|
2726
2758
|
const {
|
|
2727
2759
|
id: s,
|
|
2728
2760
|
position: r,
|
|
2729
|
-
isOpen:
|
|
2761
|
+
isOpen: n,
|
|
2730
2762
|
setIsOpen: l,
|
|
2731
2763
|
activeItemIndex: o,
|
|
2732
2764
|
setActiveItemIndex: c,
|
|
2733
|
-
clearActiveItemIndex:
|
|
2734
|
-
triggerRef:
|
|
2735
|
-
contentRef:
|
|
2736
|
-
} =
|
|
2737
|
-
var
|
|
2738
|
-
if (!
|
|
2765
|
+
clearActiveItemIndex: m,
|
|
2766
|
+
triggerRef: y,
|
|
2767
|
+
contentRef: d
|
|
2768
|
+
} = Ns(), v = (u) => {
|
|
2769
|
+
var p;
|
|
2770
|
+
if (!n)
|
|
2739
2771
|
return;
|
|
2740
|
-
if (
|
|
2741
|
-
return
|
|
2742
|
-
const
|
|
2743
|
-
switch (
|
|
2772
|
+
if (u.key === "Escape")
|
|
2773
|
+
return m(), l(!1), (p = y.current) == null ? void 0 : p.focus();
|
|
2774
|
+
const E = u.shiftKey, S = Os(d.current).length - 1;
|
|
2775
|
+
switch (u.key) {
|
|
2744
2776
|
case "Tab": {
|
|
2745
|
-
if (
|
|
2746
|
-
return
|
|
2747
|
-
if (!
|
|
2748
|
-
|
|
2749
|
-
const
|
|
2750
|
-
return c(Math.min(
|
|
2777
|
+
if (E && o !== 0)
|
|
2778
|
+
return u.preventDefault(), c(o ? Math.max(0, o - 1) : 0);
|
|
2779
|
+
if (!E && o !== S) {
|
|
2780
|
+
u.preventDefault();
|
|
2781
|
+
const j = o !== void 0 ? o + 1 : 0;
|
|
2782
|
+
return c(Math.min(S, j));
|
|
2751
2783
|
}
|
|
2752
2784
|
break;
|
|
2753
2785
|
}
|
|
2754
2786
|
case "ArrowUp":
|
|
2755
2787
|
case "ArrowLeft":
|
|
2756
|
-
return
|
|
2788
|
+
return u.preventDefault(), c(o ? Math.max(0, o - 1) : 0);
|
|
2757
2789
|
case "ArrowDown":
|
|
2758
2790
|
case "ArrowRight": {
|
|
2759
|
-
|
|
2760
|
-
const
|
|
2761
|
-
return c(Math.min(
|
|
2791
|
+
u.preventDefault();
|
|
2792
|
+
const j = o !== void 0 ? o + 1 : 0;
|
|
2793
|
+
return c(Math.min(S, j));
|
|
2762
2794
|
}
|
|
2763
2795
|
case "Home":
|
|
2764
|
-
return
|
|
2796
|
+
return u.preventDefault(), c(0);
|
|
2765
2797
|
case "End":
|
|
2766
|
-
return
|
|
2798
|
+
return u.preventDefault(), c(S);
|
|
2767
2799
|
}
|
|
2768
2800
|
};
|
|
2769
|
-
return e ?
|
|
2801
|
+
return e ? h.createElement(
|
|
2770
2802
|
e,
|
|
2771
2803
|
{
|
|
2772
2804
|
id: `${s}-content`,
|
|
2773
|
-
ref:
|
|
2774
|
-
className:
|
|
2775
|
-
onKeyDown:
|
|
2805
|
+
ref: d,
|
|
2806
|
+
className: N("menu__list", `menu__list--${r}`, n && "menu__list--active"),
|
|
2807
|
+
onKeyDown: v
|
|
2776
2808
|
},
|
|
2777
2809
|
t
|
|
2778
2810
|
) : (
|
|
@@ -2781,136 +2813,136 @@ var Ms = d.createContext(void 0), Fi = ({
|
|
|
2781
2813
|
"ul",
|
|
2782
2814
|
{
|
|
2783
2815
|
id: `${s}-content`,
|
|
2784
|
-
ref:
|
|
2785
|
-
className:
|
|
2786
|
-
onKeyDown:
|
|
2816
|
+
ref: d,
|
|
2817
|
+
className: N("menu__list", `menu__list--${r}`, n && "menu__list--active"),
|
|
2818
|
+
onKeyDown: v,
|
|
2787
2819
|
children: t
|
|
2788
2820
|
}
|
|
2789
2821
|
)
|
|
2790
2822
|
);
|
|
2791
|
-
},
|
|
2792
|
-
var t = e, { children: s, className: r } = t,
|
|
2793
|
-
return /* @__PURE__ */ i.jsx("li", A(
|
|
2794
|
-
},
|
|
2795
|
-
const { id: s, isOpen: r, setIsOpen:
|
|
2796
|
-
l(),
|
|
2797
|
-
},
|
|
2823
|
+
}, Fi = (e) => {
|
|
2824
|
+
var t = e, { children: s, className: r } = t, n = L(t, ["children", "className"]);
|
|
2825
|
+
return /* @__PURE__ */ i.jsx("li", A(w({}, n), { className: N("menu__list-item", r), children: s }));
|
|
2826
|
+
}, ks = ({ children: e, className: t }) => {
|
|
2827
|
+
const { id: s, isOpen: r, setIsOpen: n, clearActiveItemIndex: l, setActiveItemIndex: o, triggerRef: c } = Ns(), m = () => {
|
|
2828
|
+
l(), n((d) => !d), r || o(0);
|
|
2829
|
+
}, y = (d) => {
|
|
2798
2830
|
if (r) {
|
|
2799
|
-
if (
|
|
2800
|
-
return l(),
|
|
2801
|
-
|
|
2831
|
+
if (d.key === "Escape")
|
|
2832
|
+
return l(), n(!1);
|
|
2833
|
+
d.key === "ArrowDown" && (d.preventDefault(), o(0));
|
|
2802
2834
|
}
|
|
2803
2835
|
};
|
|
2804
|
-
return
|
|
2836
|
+
return h.cloneElement(e, {
|
|
2805
2837
|
id: `${s}-trigger`,
|
|
2806
2838
|
ref: c,
|
|
2807
|
-
className:
|
|
2808
|
-
onClick:
|
|
2809
|
-
onKeyDown:
|
|
2839
|
+
className: N("menu__trigger", t),
|
|
2840
|
+
onClick: m,
|
|
2841
|
+
onKeyDown: y,
|
|
2810
2842
|
"aria-expanded": r,
|
|
2811
2843
|
"aria-controls": `${s}-content`
|
|
2812
2844
|
});
|
|
2813
2845
|
};
|
|
2814
|
-
|
|
2815
|
-
var
|
|
2816
|
-
var t = e, { type: s, id: r, position:
|
|
2817
|
-
const
|
|
2818
|
-
|
|
2819
|
-
const
|
|
2820
|
-
|
|
2821
|
-
},
|
|
2822
|
-
var
|
|
2823
|
-
((
|
|
2846
|
+
ks.displayName = "Trigger";
|
|
2847
|
+
var Os = (e) => e ? e.tagName === "UL" ? e.children : Array.from(e.getElementsByTagName("ul")).reduce((s, r) => [...s, ...Array.from(r.getElementsByTagName("li"))], []) : [], q = (e) => {
|
|
2848
|
+
var t = e, { type: s, id: r, position: n = "bottom-end", children: l, className: o } = t, c = L(t, ["type", "id", "position", "children", "className"]);
|
|
2849
|
+
const m = h.useRef(null), y = h.useRef(null), d = h.useRef(null), [v, u] = h.useState(!1), [p, E] = h.useState(), [S, j] = h.useState(p);
|
|
2850
|
+
p !== S && p !== void 0 && d.current && (Os(d.current)[p].firstChild.focus(), j(p));
|
|
2851
|
+
const x = () => {
|
|
2852
|
+
E(void 0), j(void 0);
|
|
2853
|
+
}, C = (_) => {
|
|
2854
|
+
var O;
|
|
2855
|
+
((O = m.current) == null ? void 0 : O.contains(_.relatedTarget)) || (x(), u(!1));
|
|
2824
2856
|
};
|
|
2825
2857
|
return /* @__PURE__ */ i.jsx(
|
|
2826
|
-
|
|
2858
|
+
Mi,
|
|
2827
2859
|
{
|
|
2828
2860
|
id: r,
|
|
2829
|
-
position:
|
|
2830
|
-
isOpen:
|
|
2831
|
-
setIsOpen:
|
|
2832
|
-
activeItemIndex:
|
|
2833
|
-
setActiveItemIndex:
|
|
2834
|
-
clearActiveItemIndex:
|
|
2835
|
-
triggerRef:
|
|
2836
|
-
contentRef:
|
|
2837
|
-
children:
|
|
2861
|
+
position: n,
|
|
2862
|
+
isOpen: v,
|
|
2863
|
+
setIsOpen: u,
|
|
2864
|
+
activeItemIndex: p,
|
|
2865
|
+
setActiveItemIndex: E,
|
|
2866
|
+
clearActiveItemIndex: x,
|
|
2867
|
+
triggerRef: y,
|
|
2868
|
+
contentRef: d,
|
|
2869
|
+
children: h.createElement(
|
|
2838
2870
|
s,
|
|
2839
|
-
A(
|
|
2871
|
+
A(w({}, c), {
|
|
2840
2872
|
id: r,
|
|
2841
|
-
ref:
|
|
2873
|
+
ref: m,
|
|
2842
2874
|
className: `menu ${o || ""}`,
|
|
2843
|
-
onBlur:
|
|
2875
|
+
onBlur: C
|
|
2844
2876
|
}),
|
|
2845
2877
|
l
|
|
2846
2878
|
)
|
|
2847
2879
|
}
|
|
2848
2880
|
);
|
|
2849
2881
|
};
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
var
|
|
2855
|
-
[...new Set(
|
|
2882
|
+
q.Trigger = ks;
|
|
2883
|
+
q.Content = Li;
|
|
2884
|
+
q.Item = Fi;
|
|
2885
|
+
h.createContext(void 0);
|
|
2886
|
+
var Ri = (/* @__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");
|
|
2887
|
+
[...new Set(Ri.values())].map((e) => ({
|
|
2856
2888
|
label: `+${e}`,
|
|
2857
2889
|
value: e
|
|
2858
2890
|
}));
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
var
|
|
2862
|
-
const
|
|
2891
|
+
h.createContext(void 0);
|
|
2892
|
+
h.createContext(void 0);
|
|
2893
|
+
var lt = /* @__PURE__ */ ((e) => (e[e.categoriesVegetables = 0] = "categoriesVegetables", e[e.categoriesMeat = 1] = "categoriesMeat", e[e.categoriesFish = 2] = "categoriesFish", e[e.categoriesDairy = 3] = "categoriesDairy", e[e.categoriesBreakfast = 4] = "categoriesBreakfast", e[e.categoriesSnacks = 5] = "categoriesSnacks", e[e.categoriesCandy = 6] = "categoriesCandy", e[e.categoriesNonFood = 7] = "categoriesNonFood", e[e.categoriesDryFood = 8] = "categoriesDryFood", e[e.categoriesTins = 9] = "categoriesTins", e[e.categoriesGrid = 10] = "categoriesGrid", e[e.categoriesSoda = 11] = "categoriesSoda", e[e.categoriesBakery = 12] = "categoriesBakery", e[e.categoriesWine = 13] = "categoriesWine", e[e.categoriesBaby = 14] = "categoriesBaby", e[e.categoriesDiet = 15] = "categoriesDiet", e[e.categoriesHygiene = 16] = "categoriesHygiene", e[e.categoriesCleaning = 17] = "categoriesCleaning", e[e.categoriesPets = 18] = "categoriesPets", e[e.categoriesFreezer = 19] = "categoriesFreezer", e[e.categoriesBbq = 20] = "categoriesBbq", e[e.categoriesMealbox = 21] = "categoriesMealbox", e[e.categoriesBrik = 22] = "categoriesBrik", e[e.categoriesGranen = 23] = "categoriesGranen", e[e.categoriesConserve = 24] = "categoriesConserve", e[e.categoriesHome = 25] = "categoriesHome", e[e.categoriesEaster = 26] = "categoriesEaster", e[e.categoriesOnlinePromo = 27] = "categoriesOnlinePromo", e[e.categoriesSportFood = 28] = "categoriesSportFood", e[e.categoriesClothing = 29] = "categoriesClothing", e[e.categoriesEnergy = 30] = "categoriesEnergy", e[e.categoriesDeskAndTravel = 31] = "categoriesDeskAndTravel", e[e.categoriesCigarette = 32] = "categoriesCigarette", e[e.categoriesFood = 33] = "categoriesFood", e[e.categoriesChild = 34] = "categoriesChild", e[e.categoriesPuzzle = 35] = "categoriesPuzzle", e[e.categoriesToys = 36] = "categoriesToys", e[e.categoriesCar = 37] = "categoriesCar", e[e.categoriesPlaceholder = 38] = "categoriesPlaceholder", e[e.categoriesFuel = 39] = "categoriesFuel", e[e.categoriesCarAndBike = 40] = "categoriesCarAndBike", e[e.categoriesToyAndHobby = 41] = "categoriesToyAndHobby", e[e.categoriesMultimedia = 42] = "categoriesMultimedia", e[e.categoriesParty = 43] = "categoriesParty", e[e.toolsPay = 44] = "toolsPay", e[e.toolsReceipt = 45] = "toolsReceipt", e[e.toolsFuel = 46] = "toolsFuel", e[e.toolsStoreLocator = 47] = "toolsStoreLocator", e[e.toolsStats = 48] = "toolsStats", e[e.toolsShowXtraOld = 49] = "toolsShowXtraOld", e[e.toolsShowXtraNew = 50] = "toolsShowXtraNew", e[e.toolsScan2 = 51] = "toolsScan2", e[e.toolsRecipes2 = 52] = "toolsRecipes2", e[e.toolsWarranty = 53] = "toolsWarranty", e[e.toolsCoupons = 54] = "toolsCoupons", e[e.toolsFavoriteInactive = 55] = "toolsFavoriteInactive", e[e.toolsFavoriteActive = 56] = "toolsFavoriteActive", e[e.toolsAssortment = 57] = "toolsAssortment", e[e.toolsPromo = 58] = "toolsPromo", e[e.fuelCng = 59] = "fuelCng", e[e.fuelE5 = 60] = "fuelE5", e[e.fuelAdblue = 61] = "fuelAdblue", e[e.fuelB7 = 62] = "fuelB7", e[e.fuelH2 = 63] = "fuelH2", e[e.fuelE10 = 64] = "fuelE10", e[e.fuelFreeTireInflation = 65] = "fuelFreeTireInflation", e[e.functionalClose = 66] = "functionalClose", e[e.functionalBack = 67] = "functionalBack", e[e.functionalSearch = 68] = "functionalSearch", e[e.functionalEdit = 69] = "functionalEdit", e[e.functionalShare = 70] = "functionalShare", e[e.functionalLocation = 71] = "functionalLocation", e[e.functionalTrash = 72] = "functionalTrash", e[e.functionalCamera = 73] = "functionalCamera", e[e.functionalPhone = 74] = "functionalPhone", e[e.functionalPushNotifications = 75] = "functionalPushNotifications", e[e.functionalMail = 76] = "functionalMail", e[e.functionalGift = 77] = "functionalGift", e[e.functionalPresent = 78] = "functionalPresent", e[e.functionalLoading = 79] = "functionalLoading", e[e.functionalChevronRight = 80] = "functionalChevronRight", e[e.functionalCheck = 81] = "functionalCheck", e[e.functionalChevronDown = 82] = "functionalChevronDown", e[e.functionalChevronUp = 83] = "functionalChevronUp", e[e.functionalPlus = 84] = "functionalPlus", e[e.functionalReset = 85] = "functionalReset", e[e.functionalDownload = 86] = "functionalDownload", e[e.functionalExport = 87] = "functionalExport", e[e.functionalCustomerService = 88] = "functionalCustomerService", e[e.functionalTruck = 89] = "functionalTruck", e[e.functionalBox = 90] = "functionalBox", e[e.functionalEllipsis = 91] = "functionalEllipsis", e[e.functionalLocationHome = 92] = "functionalLocationHome", e[e.functionalLocationPickup = 93] = "functionalLocationPickup", e[e.functionalAccount = 94] = "functionalAccount", e[e.functionalPrivacy = 95] = "functionalPrivacy", e[e.functionalSettings = 96] = "functionalSettings", e[e.functionalUserInfo = 97] = "functionalUserInfo", e[e.functionalPinOutlines = 98] = "functionalPinOutlines", e[e.functionalCalendar = 99] = "functionalCalendar", e[e.functionalMinus = 100] = "functionalMinus", e[e.functionalLifestyle = 101] = "functionalLifestyle", e[e.functionalSms = 102] = "functionalSms", e[e.functionalSwitch = 103] = "functionalSwitch", e[e.functionalSorting = 104] = "functionalSorting", e[e.functionalWarningCircle = 105] = "functionalWarningCircle", e[e.functionalQuestionCircle = 106] = "functionalQuestionCircle", e[e.functionalErrorCircle = 107] = "functionalErrorCircle", e[e.functionalSuccessCircle = 108] = "functionalSuccessCircle", e[e.functionalMessage = 109] = "functionalMessage", e[e.functionalExternalLink = 110] = "functionalExternalLink", e[e.functionalAddToList = 111] = "functionalAddToList", e[e.functionalShoppingcart = 112] = "functionalShoppingcart", e[e.functionalFilter = 113] = "functionalFilter", e[e.functionalLocate = 114] = "functionalLocate", e[e.functionalBarcode = 115] = "functionalBarcode", e[e.functionalClock = 116] = "functionalClock", e[e.functionalHistory = 117] = "functionalHistory", e[e.functionalShops = 118] = "functionalShops", e[e.functionalAddUser = 119] = "functionalAddUser", e[e.functionalOther = 120] = "functionalOther", e[e.functionalInAppNotifications = 121] = "functionalInAppNotifications", e[e.functionalExit = 122] = "functionalExit", e[e.functionalShared = 123] = "functionalShared", e[e.functionalThumbsup = 124] = "functionalThumbsup", e[e.functionalDiscount = 125] = "functionalDiscount", e[e.functionalPercentage = 126] = "functionalPercentage", e[e.functionalList = 127] = "functionalList", e[e.functionalMapLocation = 128] = "functionalMapLocation", e[e.functionalNoConnection = 129] = "functionalNoConnection", e[e.functionalSwap = 130] = "functionalSwap", e[e.functionalPiece = 131] = "functionalPiece", e[e.functionalWeight = 132] = "functionalWeight", e[e.functionalPack = 133] = "functionalPack", e[e.functionalCommunications = 134] = "functionalCommunications", e[e.functionalDeliveryAddresses = 135] = "functionalDeliveryAddresses", e[e["functional18+"] = 136] = "functional18+", e[e.functionalReadtime = 137] = "functionalReadtime", e[e.functionalCopy = 138] = "functionalCopy", e[e.functionalMessageField = 139] = "functionalMessageField", e[e.functionalNext = 140] = "functionalNext", e[e.functionalSave = 141] = "functionalSave", e[e.functionalLogin = 142] = "functionalLogin", e[e.functionalLogout = 143] = "functionalLogout", e[e.functionalWebsite = 144] = "functionalWebsite", e[e.functionalMenu = 145] = "functionalMenu", e[e.functionalRegister = 146] = "functionalRegister", e[e.functionalNews = 147] = "functionalNews", e[e.functionalTimer = 148] = "functionalTimer", e[e.functionalEyeShow = 149] = "functionalEyeShow", e[e.functionalMobilePay = 150] = "functionalMobilePay", e[e.functionalConnectionCable = 151] = "functionalConnectionCable", e[e.functionalDryCleaning = 152] = "functionalDryCleaning", e[e.functionalKiosk = 153] = "functionalKiosk", e[e.functionalConnectedDevice = 154] = "functionalConnectedDevice", e[e.functionalCookies = 155] = "functionalCookies", e[e.functionalViewFile = 156] = "functionalViewFile", e[e.functionalLastAdded = 157] = "functionalLastAdded", e[e.functionalFirstAdded = 158] = "functionalFirstAdded", e[e.functionalStoreLayout = 159] = "functionalStoreLayout", e[e.functionalBlock = 160] = "functionalBlock", e[e.functionalChecklist = 161] = "functionalChecklist", e[e.functionalCartCheckout = 162] = "functionalCartCheckout", e[e.functionalCartEdit = 163] = "functionalCartEdit", e[e.functionalEyeHidden = 164] = "functionalEyeHidden", e[e.functionalWarningCircleFilled = 165] = "functionalWarningCircleFilled", e[e.functionalErrorCircleFilled = 166] = "functionalErrorCircleFilled", e[e.functionalSuccessCircleFilled = 167] = "functionalSuccessCircleFilled", e[e.functionalPlusCircle = 168] = "functionalPlusCircle", e[e.functionalSpinner = 169] = "functionalSpinner", e[e.functionalEcoEarth = 170] = "functionalEcoEarth", e[e.functionalAlphaBeta = 171] = "functionalAlphaBeta", e[e.functionalEuro = 172] = "functionalEuro", e[e.functionalNumber = 173] = "functionalNumber", e[e.functionalIdea = 174] = "functionalIdea", e[e.functionalMultifactorAuthenticator = 175] = "functionalMultifactorAuthenticator", e[e.functionalPassword = 176] = "functionalPassword", e[e.functionalDiscountCode = 177] = "functionalDiscountCode", e))(lt || {});
|
|
2894
|
+
const Di = "/icons/bouMenuIcons.svg", Ti = ({
|
|
2863
2895
|
bouIconId: e,
|
|
2864
2896
|
...t
|
|
2865
|
-
}) => /* @__PURE__ */ i.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", ...t, children: /* @__PURE__ */ i.jsx("use", { href: `${
|
|
2897
|
+
}) => /* @__PURE__ */ i.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", ...t, children: /* @__PURE__ */ i.jsx("use", { href: `${Di}#${lt[e]}` }) }), Pt = (e) => typeof e.icon == "string" && e.icon in lt ? /* @__PURE__ */ i.jsx(Ti, { bouIconId: lt[e.icon] }) : e.icon, Ui = ({
|
|
2866
2898
|
label: e,
|
|
2867
2899
|
className: t,
|
|
2868
2900
|
onClick: s,
|
|
2869
2901
|
icon: r
|
|
2870
|
-
}) => /* @__PURE__ */ i.jsx(
|
|
2871
|
-
/* @__PURE__ */ i.jsx(
|
|
2902
|
+
}) => /* @__PURE__ */ i.jsx(q.Item, { className: t, children: /* @__PURE__ */ i.jsxs("button", { onClick: s, children: [
|
|
2903
|
+
/* @__PURE__ */ i.jsx(Pt, { icon: r }),
|
|
2872
2904
|
e
|
|
2873
|
-
] }) }),
|
|
2874
|
-
const t =
|
|
2875
|
-
return /* @__PURE__ */ i.jsxs(
|
|
2876
|
-
(!t || t && !l) && /* @__PURE__ */ i.jsxs("a", { href:
|
|
2877
|
-
/* @__PURE__ */ i.jsx(
|
|
2905
|
+
] }) }), we = (e) => {
|
|
2906
|
+
const t = $s(), { className: s, label: r, mobileUrl: n, desktopUrl: l, icon: o } = e;
|
|
2907
|
+
return /* @__PURE__ */ i.jsxs(q.Item, { className: s, children: [
|
|
2908
|
+
(!t || t && !l) && /* @__PURE__ */ i.jsxs("a", { href: n, referrerPolicy: "no-referrer-when-downgrade", children: [
|
|
2909
|
+
/* @__PURE__ */ i.jsx(Pt, { icon: o }),
|
|
2878
2910
|
r
|
|
2879
2911
|
] }),
|
|
2880
2912
|
!!l && /* @__PURE__ */ i.jsxs("a", { href: l, referrerPolicy: "no-referrer-when-downgrade", children: [
|
|
2881
|
-
/* @__PURE__ */ i.jsx(
|
|
2913
|
+
/* @__PURE__ */ i.jsx(Pt, { icon: o }),
|
|
2882
2914
|
r
|
|
2883
2915
|
] })
|
|
2884
2916
|
] });
|
|
2885
|
-
},
|
|
2886
|
-
const e =
|
|
2917
|
+
}, Ms = h.createContext(void 0), Qi = ({ position: e, bouMenuItems: t, children: s }) => /* @__PURE__ */ i.jsx(Ms.Provider, { value: { position: e, bouMenuItems: t }, children: s }), Ls = () => {
|
|
2918
|
+
const e = h.useContext(Ms);
|
|
2887
2919
|
if (!e)
|
|
2888
2920
|
throw new Error("Authentication context can not be rendered outside of Authentication");
|
|
2889
2921
|
return e;
|
|
2890
|
-
},
|
|
2891
|
-
const e =
|
|
2922
|
+
}, Fs = h.createContext(void 0), Hi = ({ apiUrl: e, redirectUrl: t, children: s }) => /* @__PURE__ */ i.jsx(Fs.Provider, { value: { apiUrl: e, redirectUrl: t }, children: s }), Ft = () => {
|
|
2923
|
+
const e = h.useContext(Fs);
|
|
2892
2924
|
if (!e)
|
|
2893
2925
|
throw new Error("Api context can not be rendered outside of Api");
|
|
2894
2926
|
return e;
|
|
2895
|
-
},
|
|
2927
|
+
}, Rs = ({ apiUrl: e, redirectUrl: t, trackingInfo: s }) => {
|
|
2896
2928
|
const r = new URLSearchParams({ redirectUrl: t });
|
|
2897
2929
|
s && r.append("trackingInfo", s);
|
|
2898
|
-
const
|
|
2899
|
-
return { loginUrl:
|
|
2900
|
-
},
|
|
2901
|
-
const { apiUrl: e, redirectUrl: t } =
|
|
2902
|
-
return
|
|
2903
|
-
},
|
|
2904
|
-
const { apiUrl: e } =
|
|
2930
|
+
const n = `${e}/login?${r.toString()}`, l = `${e}/logout?${r.toString()}`;
|
|
2931
|
+
return { loginUrl: n, logoutUrl: l };
|
|
2932
|
+
}, ut = () => {
|
|
2933
|
+
const { apiUrl: e, redirectUrl: t } = Ft(), s = Ks();
|
|
2934
|
+
return Rs({ apiUrl: e, redirectUrl: t, trackingInfo: s });
|
|
2935
|
+
}, $i = () => {
|
|
2936
|
+
const { apiUrl: e } = Ft();
|
|
2905
2937
|
return `${`${e}/xtra`}/authentication/v1/user/profile`;
|
|
2906
|
-
},
|
|
2907
|
-
const { loginUrl: s } =
|
|
2938
|
+
}, Vt = (e) => e ? `+${e.countryCode} ${e.number}` : "", Wt = (e, t) => t == null ? void 0 : t.find((s) => s.type === e), Zt = ({ apiUrl: e, redirectUrl: t }) => {
|
|
2939
|
+
const { loginUrl: s } = Rs({ apiUrl: e, redirectUrl: t });
|
|
2908
2940
|
window.location.replace(s);
|
|
2909
|
-
},
|
|
2941
|
+
}, Yt = (e) => {
|
|
2910
2942
|
var l;
|
|
2911
2943
|
if (!e)
|
|
2912
|
-
return { user: { state: () => "NotAuthenticated" }, tryToLogon:
|
|
2913
|
-
const t = new Date(e.dateOfBirth), s =
|
|
2944
|
+
return { user: { state: () => "NotAuthenticated" }, tryToLogon: Zt };
|
|
2945
|
+
const t = new Date(e.dateOfBirth), s = Wt(Rt.Mobile, e.phone), r = Wt(Rt.Fixed, e.phone), n = Vt(s) ?? Vt(r) ?? "";
|
|
2914
2946
|
return {
|
|
2915
2947
|
user: {
|
|
2916
2948
|
...(l = window.XTRA) == null ? void 0 : l.user,
|
|
@@ -2920,7 +2952,7 @@ const Ui = "/icons/bouMenuIcons.svg", Qi = ({
|
|
|
2920
2952
|
mob: () => t.getMonth() + 1,
|
|
2921
2953
|
yob: () => t.getFullYear(),
|
|
2922
2954
|
gender: () => e.genderCode,
|
|
2923
|
-
phone: () =>
|
|
2955
|
+
phone: () => n,
|
|
2924
2956
|
streetName: () => {
|
|
2925
2957
|
var o;
|
|
2926
2958
|
return (o = e.address) == null ? void 0 : o.streetName;
|
|
@@ -2949,12 +2981,12 @@ const Ui = "/icons/bouMenuIcons.svg", Qi = ({
|
|
|
2949
2981
|
cbh: () => e.customerIdentifier,
|
|
2950
2982
|
state: () => "Authenticated"
|
|
2951
2983
|
},
|
|
2952
|
-
tryToLogon:
|
|
2984
|
+
tryToLogon: Zt
|
|
2953
2985
|
};
|
|
2954
|
-
},
|
|
2955
|
-
const { i18n: e } =
|
|
2956
|
-
return
|
|
2957
|
-
queryKey:
|
|
2986
|
+
}, Ds = ["profile"], Ts = () => {
|
|
2987
|
+
const { i18n: e } = be(), t = $i(), s = sessionStorage.getItem("profile"), r = !!s;
|
|
2988
|
+
return Cs({
|
|
2989
|
+
queryKey: Ds,
|
|
2958
2990
|
queryFn: async () => {
|
|
2959
2991
|
const l = await fetch(t, {
|
|
2960
2992
|
credentials: "include",
|
|
@@ -2963,7 +2995,7 @@ const Ui = "/icons/bouMenuIcons.svg", Qi = ({
|
|
|
2963
2995
|
});
|
|
2964
2996
|
if (!l.ok) {
|
|
2965
2997
|
if (l.status === 401)
|
|
2966
|
-
return window.XTRA = { ...window.XTRA, ...
|
|
2998
|
+
return window.XTRA = { ...window.XTRA, ...Yt() }, window.postMessage(
|
|
2967
2999
|
{ source: "xtra-authentication", isAuthenticated: !1 },
|
|
2968
3000
|
new URL(window.location.href).origin
|
|
2969
3001
|
), sessionStorage.removeItem("profile"), { authenticationStatus: "NotAuthenticated" };
|
|
@@ -2971,11 +3003,11 @@ const Ui = "/icons/bouMenuIcons.svg", Qi = ({
|
|
|
2971
3003
|
return { authenticationStatus: "Authenticated", profile: JSON.parse(s) };
|
|
2972
3004
|
throw new Error("Failed to retrieve profile");
|
|
2973
3005
|
}
|
|
2974
|
-
const o = await l.json(), { firstName: c, lastName:
|
|
2975
|
-
return sessionStorage.setItem("profile", JSON.stringify({ firstName: c, lastName:
|
|
3006
|
+
const o = await l.json(), { firstName: c, lastName: m } = o;
|
|
3007
|
+
return sessionStorage.setItem("profile", JSON.stringify({ firstName: c, lastName: m })), window.postMessage(
|
|
2976
3008
|
{ source: "xtra-authentication", isAuthenticated: !0 },
|
|
2977
3009
|
new URL(window.location.href).origin
|
|
2978
|
-
), window.XTRA = { ...window.XTRA, ...
|
|
3010
|
+
), window.XTRA = { ...window.XTRA, ...Yt(o) }, {
|
|
2979
3011
|
authenticationStatus: "Authenticated",
|
|
2980
3012
|
profile: { firstName: o.firstName, lastName: o.lastName }
|
|
2981
3013
|
};
|
|
@@ -2987,105 +3019,105 @@ const Ui = "/icons/bouMenuIcons.svg", Qi = ({
|
|
|
2987
3019
|
placeholderData: { authenticationStatus: "Pending" },
|
|
2988
3020
|
refetchOnWindowFocus: !1
|
|
2989
3021
|
});
|
|
2990
|
-
},
|
|
2991
|
-
const { t: e } =
|
|
2992
|
-
sessionStorage.removeItem("profile"), window.location.href =
|
|
3022
|
+
}, Ki = () => {
|
|
3023
|
+
const { t: e } = be(), t = ns(), { position: s, bouMenuItems: r } = Ls(), { logoutUrl: n } = ut(), o = Mt().getQueryData(Ds), c = (o == null ? void 0 : o.profile.firstName) ?? "", m = (o == null ? void 0 : o.profile.lastName) ?? "", y = () => {
|
|
3024
|
+
sessionStorage.removeItem("profile"), window.location.href = n;
|
|
2993
3025
|
};
|
|
2994
|
-
return /* @__PURE__ */ i.jsxs(
|
|
3026
|
+
return /* @__PURE__ */ i.jsxs(q, { type: "nav", id: "xtra-menu", position: s, children: [
|
|
2995
3027
|
/* @__PURE__ */ i.jsx(
|
|
2996
|
-
|
|
3028
|
+
q.Trigger,
|
|
2997
3029
|
{
|
|
2998
|
-
className:
|
|
3030
|
+
className: N(
|
|
2999
3031
|
"button",
|
|
3000
3032
|
"button--neutral",
|
|
3001
3033
|
"button--authentication",
|
|
3002
3034
|
"button--authentication--authenticated"
|
|
3003
3035
|
),
|
|
3004
3036
|
children: /* @__PURE__ */ i.jsxs("button", { children: [
|
|
3005
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(
|
|
3037
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(Rr, { variant: "small", firstName: c, lastName: m }) }),
|
|
3006
3038
|
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: c }),
|
|
3007
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(
|
|
3039
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(Lt, {}) })
|
|
3008
3040
|
] })
|
|
3009
3041
|
}
|
|
3010
3042
|
),
|
|
3011
|
-
/* @__PURE__ */ i.jsxs(
|
|
3012
|
-
!!r && r.length > 0 && /* @__PURE__ */ i.jsx("ul", { className: "bou-menu__list", children: r.map(({ label:
|
|
3013
|
-
|
|
3043
|
+
/* @__PURE__ */ i.jsxs(q.Content, { as: "div", children: [
|
|
3044
|
+
!!r && r.length > 0 && /* @__PURE__ */ i.jsx("ul", { className: "bou-menu__list", children: r.map(({ label: d, icon: v, url: u }, p) => /* @__PURE__ */ i.jsx(
|
|
3045
|
+
we,
|
|
3014
3046
|
{
|
|
3015
3047
|
className: "bou-menu-item",
|
|
3016
|
-
mobileUrl:
|
|
3017
|
-
icon:
|
|
3018
|
-
label:
|
|
3048
|
+
mobileUrl: u,
|
|
3049
|
+
icon: v,
|
|
3050
|
+
label: d
|
|
3019
3051
|
},
|
|
3020
|
-
|
|
3052
|
+
p
|
|
3021
3053
|
)) }),
|
|
3022
3054
|
/* @__PURE__ */ i.jsxs("ul", { children: [
|
|
3023
3055
|
/* @__PURE__ */ i.jsx(
|
|
3024
|
-
|
|
3056
|
+
we,
|
|
3025
3057
|
{
|
|
3026
3058
|
className: "manage-profile",
|
|
3027
3059
|
mobileUrl: `${t}/manage-profile`,
|
|
3028
3060
|
desktopUrl: `${t}/manage-profile/personal-data`,
|
|
3029
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3061
|
+
icon: /* @__PURE__ */ i.jsx(Xr, {}),
|
|
3030
3062
|
label: e("manageProfile")
|
|
3031
3063
|
}
|
|
3032
3064
|
),
|
|
3033
3065
|
/* @__PURE__ */ i.jsx(
|
|
3034
|
-
|
|
3066
|
+
we,
|
|
3035
3067
|
{
|
|
3036
3068
|
className: "payment",
|
|
3037
3069
|
mobileUrl: `${t}/payment`,
|
|
3038
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3070
|
+
icon: /* @__PURE__ */ i.jsx(li, {}),
|
|
3039
3071
|
label: e("payment")
|
|
3040
3072
|
}
|
|
3041
3073
|
),
|
|
3042
3074
|
/* @__PURE__ */ i.jsx(
|
|
3043
|
-
|
|
3075
|
+
we,
|
|
3044
3076
|
{
|
|
3045
3077
|
className: "gift-cards",
|
|
3046
3078
|
mobileUrl: `${t}/gift-cards`,
|
|
3047
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3079
|
+
icon: /* @__PURE__ */ i.jsx(ai, {}),
|
|
3048
3080
|
label: e("giftCards")
|
|
3049
3081
|
}
|
|
3050
3082
|
),
|
|
3051
3083
|
/* @__PURE__ */ i.jsx(
|
|
3052
|
-
|
|
3084
|
+
we,
|
|
3053
3085
|
{
|
|
3054
3086
|
mobileUrl: `${t}/identifiers`,
|
|
3055
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3087
|
+
icon: /* @__PURE__ */ i.jsx(ui, {}),
|
|
3056
3088
|
label: e("qrCode")
|
|
3057
3089
|
}
|
|
3058
3090
|
),
|
|
3059
3091
|
/* @__PURE__ */ i.jsx(
|
|
3060
|
-
|
|
3092
|
+
we,
|
|
3061
3093
|
{
|
|
3062
3094
|
className: "manage-privacy",
|
|
3063
3095
|
mobileUrl: `${t}/manage-privacy`,
|
|
3064
3096
|
desktopUrl: `${t}/manage-privacy/permissions`,
|
|
3065
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
3097
|
+
icon: /* @__PURE__ */ i.jsx(zr, {}),
|
|
3066
3098
|
label: e("privacy")
|
|
3067
3099
|
}
|
|
3068
3100
|
),
|
|
3069
|
-
/* @__PURE__ */ i.jsx(
|
|
3101
|
+
/* @__PURE__ */ i.jsx(Ui, { onClick: y, icon: /* @__PURE__ */ i.jsx(Zr, {}), label: e("logout") })
|
|
3070
3102
|
] })
|
|
3071
3103
|
] })
|
|
3072
3104
|
] });
|
|
3073
3105
|
}, qi = () => {
|
|
3074
|
-
const { t: e } =
|
|
3075
|
-
return /* @__PURE__ */ i.jsxs("button", { className:
|
|
3106
|
+
const { t: e } = be();
|
|
3107
|
+
return /* @__PURE__ */ i.jsxs("button", { className: N("button", "button--neutral", "button--authentication"), children: [
|
|
3076
3108
|
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx("i", { className: "spinner" }) }),
|
|
3077
3109
|
/* @__PURE__ */ i.jsxs("span", { className: "button__label", children: [
|
|
3078
3110
|
e("loading"),
|
|
3079
3111
|
"..."
|
|
3080
3112
|
] })
|
|
3081
3113
|
] });
|
|
3082
|
-
},
|
|
3083
|
-
const { t } =
|
|
3114
|
+
}, Gi = ({ className: e }) => {
|
|
3115
|
+
const { t } = be(), { loginUrl: s } = ut();
|
|
3084
3116
|
return /* @__PURE__ */ i.jsxs(
|
|
3085
3117
|
"a",
|
|
3086
3118
|
{
|
|
3087
3119
|
href: s,
|
|
3088
|
-
className:
|
|
3120
|
+
className: N(
|
|
3089
3121
|
"button",
|
|
3090
3122
|
"button--neutral",
|
|
3091
3123
|
"button--authentication",
|
|
@@ -3093,17 +3125,16 @@ const Ui = "/icons/bouMenuIcons.svg", Qi = ({
|
|
|
3093
3125
|
e
|
|
3094
3126
|
),
|
|
3095
3127
|
children: [
|
|
3096
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(
|
|
3128
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(js, { width: 24, height: 24, suffix: "desktop" }) }),
|
|
3097
3129
|
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: t("login") }),
|
|
3098
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(
|
|
3130
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(Lt, {}) })
|
|
3099
3131
|
]
|
|
3100
3132
|
}
|
|
3101
3133
|
);
|
|
3102
|
-
}
|
|
3103
|
-
const
|
|
3104
|
-
const { t: e } = je(), { loginUrl: t } = yt(), s = us(), { position: r } = Ds();
|
|
3134
|
+
}, Vi = () => {
|
|
3135
|
+
const { t: e } = be(), { loginUrl: t } = ut(), s = ns(), { position: r } = Ls();
|
|
3105
3136
|
return /* @__PURE__ */ i.jsxs(
|
|
3106
|
-
|
|
3137
|
+
q,
|
|
3107
3138
|
{
|
|
3108
3139
|
type: "nav",
|
|
3109
3140
|
id: "xtra-menu",
|
|
@@ -3111,55 +3142,55 @@ const Zi = () => {
|
|
|
3111
3142
|
className: "menu--unauthenticated",
|
|
3112
3143
|
"aria-label": e("xtraMenuAriaLabel"),
|
|
3113
3144
|
children: [
|
|
3114
|
-
/* @__PURE__ */ i.jsx(
|
|
3115
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(
|
|
3116
|
-
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(
|
|
3145
|
+
/* @__PURE__ */ i.jsx(q.Trigger, { className: N("button", "button--neutral", "button--authentication"), children: /* @__PURE__ */ i.jsxs("button", { children: [
|
|
3146
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon", children: /* @__PURE__ */ i.jsx(js, { width: 24, height: 24, suffix: "mobile" }) }),
|
|
3147
|
+
/* @__PURE__ */ i.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ i.jsx(Lt, {}) })
|
|
3117
3148
|
] }) }),
|
|
3118
|
-
/* @__PURE__ */ i.jsxs(
|
|
3119
|
-
/* @__PURE__ */ i.jsx(
|
|
3120
|
-
/* @__PURE__ */ i.jsx("span", { className: "button__icon", children: /* @__PURE__ */ i.jsx(
|
|
3149
|
+
/* @__PURE__ */ i.jsxs(q.Content, { children: [
|
|
3150
|
+
/* @__PURE__ */ i.jsx(q.Item, { children: /* @__PURE__ */ i.jsxs("a", { href: t, className: "button button--with-icon", children: [
|
|
3151
|
+
/* @__PURE__ */ i.jsx("span", { className: "button__icon", children: /* @__PURE__ */ i.jsx(Vr, {}) }),
|
|
3121
3152
|
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: e("login") })
|
|
3122
3153
|
] }) }),
|
|
3123
|
-
/* @__PURE__ */ i.jsx(
|
|
3124
|
-
/* @__PURE__ */ i.jsx("span", { className: "button__icon", children: /* @__PURE__ */ i.jsx(
|
|
3154
|
+
/* @__PURE__ */ i.jsx(q.Item, { children: /* @__PURE__ */ i.jsxs("a", { href: `${s}/onboarding/register`, className: "button button--with-icon", children: [
|
|
3155
|
+
/* @__PURE__ */ i.jsx("span", { className: "button__icon", children: /* @__PURE__ */ i.jsx(Br, {}) }),
|
|
3125
3156
|
/* @__PURE__ */ i.jsx("span", { className: "button__label", children: e("register") })
|
|
3126
3157
|
] }) })
|
|
3127
3158
|
] })
|
|
3128
3159
|
]
|
|
3129
3160
|
}
|
|
3130
3161
|
);
|
|
3131
|
-
},
|
|
3162
|
+
}, Wi = () => {
|
|
3132
3163
|
var t, s;
|
|
3133
|
-
const e =
|
|
3134
|
-
return ((t = e.data) == null ? void 0 : t.authenticationStatus) === "Authenticated" ? /* @__PURE__ */ i.jsx(
|
|
3135
|
-
/* @__PURE__ */ i.jsx(
|
|
3136
|
-
/* @__PURE__ */ i.jsx(
|
|
3164
|
+
const e = Ts();
|
|
3165
|
+
return ((t = e.data) == null ? void 0 : t.authenticationStatus) === "Authenticated" ? /* @__PURE__ */ i.jsx(Ki, {}) : ((s = e.data) == null ? void 0 : s.authenticationStatus) === "NotAuthenticated" || e.isError ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
3166
|
+
/* @__PURE__ */ i.jsx(Gi, {}),
|
|
3167
|
+
/* @__PURE__ */ i.jsx(Vi, {})
|
|
3137
3168
|
] }) : /* @__PURE__ */ i.jsx(qi, {});
|
|
3138
|
-
},
|
|
3139
|
-
const { apiUrl: e } =
|
|
3169
|
+
}, Us = () => {
|
|
3170
|
+
const { apiUrl: e } = Ft();
|
|
3140
3171
|
return `${`${e}/xtra`}/authentication/v1/gdpr`;
|
|
3141
|
-
},
|
|
3142
|
-
const e =
|
|
3172
|
+
}, Zi = () => {
|
|
3173
|
+
const e = Us(), t = new ps();
|
|
3143
3174
|
return Sr({
|
|
3144
3175
|
mutationFn: async (r) => {
|
|
3145
|
-
const
|
|
3176
|
+
const n = await fetch(`${e}/tc`, {
|
|
3146
3177
|
body: JSON.stringify({ acceptedTC: r }),
|
|
3147
3178
|
credentials: "include",
|
|
3148
3179
|
method: "POST",
|
|
3149
3180
|
mode: "cors"
|
|
3150
3181
|
});
|
|
3151
|
-
if (!
|
|
3182
|
+
if (!n.ok)
|
|
3152
3183
|
throw new Error("Network response was not ok");
|
|
3153
|
-
return
|
|
3184
|
+
return n;
|
|
3154
3185
|
},
|
|
3155
3186
|
onSuccess: async () => {
|
|
3156
3187
|
await t.invalidateQueries({ queryKey: ["gdpr"] });
|
|
3157
3188
|
}
|
|
3158
3189
|
});
|
|
3159
|
-
},
|
|
3190
|
+
}, Yi = () => {
|
|
3160
3191
|
var l;
|
|
3161
|
-
const { i18n: e } =
|
|
3162
|
-
return
|
|
3192
|
+
const { i18n: e } = be(), t = Us(), r = ((l = Ts().data) == null ? void 0 : l.authenticationStatus) === "Authenticated";
|
|
3193
|
+
return Cs({
|
|
3163
3194
|
queryKey: ["gdpr"],
|
|
3164
3195
|
queryFn: async () => {
|
|
3165
3196
|
const o = await fetch(`${t}/tc/check`, {
|
|
@@ -3173,74 +3204,74 @@ const Zi = () => {
|
|
|
3173
3204
|
},
|
|
3174
3205
|
enabled: r
|
|
3175
3206
|
});
|
|
3176
|
-
},
|
|
3177
|
-
var
|
|
3178
|
-
const { t: e } =
|
|
3207
|
+
}, zi = () => {
|
|
3208
|
+
var j;
|
|
3209
|
+
const { t: e } = be();
|
|
3179
3210
|
qs({ element: "xtra-authentication" });
|
|
3180
|
-
const { logoutUrl: t } =
|
|
3181
|
-
var
|
|
3182
|
-
(
|
|
3211
|
+
const { logoutUrl: t } = ut(), s = h.useRef(null), [r, n] = h.useState(0), [l, o] = h.useState({}), { mutate: c, isError: m } = Zi(), { AccessibleFormMessage: y, formRef: d } = Gs({ submitCount: r, errors: l }), v = Yi(), u = !!((j = v.data) != null && j.length), p = e("termsAndConditions.error.required"), E = () => {
|
|
3212
|
+
var x;
|
|
3213
|
+
(x = s == null ? void 0 : s.current) == null || x.click(), document.body.style.removeProperty("overflow");
|
|
3183
3214
|
};
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
}, [
|
|
3187
|
-
|
|
3188
|
-
}, [
|
|
3189
|
-
const
|
|
3190
|
-
|
|
3191
|
-
const { acceptedTC:
|
|
3192
|
-
if (
|
|
3193
|
-
const _ = Object.values(
|
|
3194
|
-
_.every((
|
|
3215
|
+
h.useEffect(() => {
|
|
3216
|
+
u && document.body.style.setProperty("overflow", "hidden");
|
|
3217
|
+
}, [u]), h.useEffect(() => {
|
|
3218
|
+
m && o({ acceptedTC: p });
|
|
3219
|
+
}, [p, m]);
|
|
3220
|
+
const S = (x) => {
|
|
3221
|
+
x.preventDefault(), n(r + 1);
|
|
3222
|
+
const { acceptedTC: C } = x.target;
|
|
3223
|
+
if (C instanceof RadioNodeList) {
|
|
3224
|
+
const _ = Object.values(C);
|
|
3225
|
+
_.every((F) => F.checked) ? (o({}), c(_.map((F) => F.value)), E()) : o({ acceptedTC: p });
|
|
3195
3226
|
} else
|
|
3196
|
-
|
|
3227
|
+
C != null && C.checked ? (o({}), c([C.value]), E()) : o({ acceptedTC: p });
|
|
3197
3228
|
};
|
|
3198
|
-
return
|
|
3199
|
-
|
|
3200
|
-
/* @__PURE__ */ i.jsxs(
|
|
3201
|
-
/* @__PURE__ */ i.jsx(
|
|
3202
|
-
/* @__PURE__ */ i.jsx(
|
|
3203
|
-
/* @__PURE__ */ i.jsxs(
|
|
3229
|
+
return u ? /* @__PURE__ */ i.jsxs($, { defaultOpen: u, isModal: !0, children: [
|
|
3230
|
+
y,
|
|
3231
|
+
/* @__PURE__ */ i.jsxs($.Root, { children: [
|
|
3232
|
+
/* @__PURE__ */ i.jsx($.Header, { children: /* @__PURE__ */ i.jsx($.Title, { icon: /* @__PURE__ */ i.jsx("i", { className: "commerce__icon" }), children: /* @__PURE__ */ i.jsx(Bi, { children: e("termsAndConditions.title") }) }) }),
|
|
3233
|
+
/* @__PURE__ */ i.jsx($.Body, { children: /* @__PURE__ */ i.jsxs(Qs, { ref: d, id: "tc-form", onSubmit: S, children: [
|
|
3234
|
+
/* @__PURE__ */ i.jsxs(Xi, { children: [
|
|
3204
3235
|
e("termsAndConditions.description"),
|
|
3205
|
-
l.acceptedTC && /* @__PURE__ */ i.jsx(
|
|
3236
|
+
l.acceptedTC && /* @__PURE__ */ i.jsx(en, { children: p })
|
|
3206
3237
|
] }),
|
|
3207
|
-
|
|
3208
|
-
|
|
3238
|
+
v.data.map(({ tcCode: x, title: C, URL: _ }) => /* @__PURE__ */ i.jsx(
|
|
3239
|
+
xe,
|
|
3209
3240
|
{
|
|
3210
|
-
id:
|
|
3211
|
-
value:
|
|
3241
|
+
id: x,
|
|
3242
|
+
value: x,
|
|
3212
3243
|
name: "acceptedTC",
|
|
3213
3244
|
variant: "primary",
|
|
3214
|
-
children: /* @__PURE__ */ i.jsxs(
|
|
3215
|
-
/* @__PURE__ */ i.jsx(
|
|
3216
|
-
/* @__PURE__ */ i.jsx(
|
|
3245
|
+
children: /* @__PURE__ */ i.jsxs(xe.Content, { children: [
|
|
3246
|
+
/* @__PURE__ */ i.jsx(Ji, { children: C }),
|
|
3247
|
+
/* @__PURE__ */ i.jsx(Ii, { href: _, children: e("termsAndConditions.action", { title: C }) })
|
|
3217
3248
|
] })
|
|
3218
3249
|
},
|
|
3219
|
-
|
|
3250
|
+
x
|
|
3220
3251
|
))
|
|
3221
3252
|
] }) }),
|
|
3222
|
-
/* @__PURE__ */ i.jsxs(
|
|
3253
|
+
/* @__PURE__ */ i.jsxs($.Footer, { children: [
|
|
3223
3254
|
/* @__PURE__ */ i.jsx(
|
|
3224
3255
|
"a",
|
|
3225
3256
|
{
|
|
3226
|
-
className:
|
|
3257
|
+
className: N("button", "button--secondary", "button--terms-and-conditions"),
|
|
3227
3258
|
href: t,
|
|
3228
3259
|
children: e("logout")
|
|
3229
3260
|
}
|
|
3230
3261
|
),
|
|
3231
|
-
/* @__PURE__ */ i.jsx(
|
|
3262
|
+
/* @__PURE__ */ i.jsx(Be, { form: "tc-form", type: "submit", variant: "primary", children: e("confirm") })
|
|
3232
3263
|
] })
|
|
3233
3264
|
] })
|
|
3234
3265
|
] }) : /* @__PURE__ */ i.jsx(i.Fragment, {});
|
|
3235
|
-
},
|
|
3266
|
+
}, Ji = ({
|
|
3236
3267
|
children: e,
|
|
3237
3268
|
...t
|
|
3238
|
-
}) => /* @__PURE__ */ i.jsx(
|
|
3239
|
-
|
|
3240
|
-
const
|
|
3269
|
+
}) => /* @__PURE__ */ i.jsx(xe.Label, { className: "form--tc__label", ...t, children: e }), Qs = h.forwardRef(({ children: e, ...t }, s) => /* @__PURE__ */ i.jsx("form", { className: "form--tc", ref: s, ...t, children: e }));
|
|
3270
|
+
Qs.displayName = "TermsAndConditionsForm";
|
|
3271
|
+
const Xi = ({
|
|
3241
3272
|
children: e,
|
|
3242
3273
|
...t
|
|
3243
|
-
}) => /* @__PURE__ */ i.jsx("p", { className: "form--tc__description", ...t, children: e }),
|
|
3274
|
+
}) => /* @__PURE__ */ i.jsx("p", { className: "form--tc__description", ...t, children: e }), Ii = ({ children: e, ...t }) => /* @__PURE__ */ i.jsx(
|
|
3244
3275
|
"a",
|
|
3245
3276
|
{
|
|
3246
3277
|
className: "form--tc__link",
|
|
@@ -3251,10 +3282,10 @@ const Bi = ({
|
|
|
3251
3282
|
...t,
|
|
3252
3283
|
children: e
|
|
3253
3284
|
}
|
|
3254
|
-
),
|
|
3255
|
-
/* @__PURE__ */ i.jsx(
|
|
3256
|
-
/* @__PURE__ */ i.jsx(
|
|
3285
|
+
), Bi = ({ children: e }) => /* @__PURE__ */ i.jsx("h1", { className: "form--tc__title", children: e }), en = ({ children: e, ...t }) => /* @__PURE__ */ i.jsx("span", { className: "form--tc__error", role: "alert", ...t, children: e }), tn = new ps(), nn = ({ environment: e, redirectUrl: t, apiUrl: s, position: r, commerceId: n, bouMenuItems: l }) => /* @__PURE__ */ i.jsx(Vs, { environment: e, children: /* @__PURE__ */ i.jsx(Ws, { commerceId: n, children: /* @__PURE__ */ i.jsx(Hi, { apiUrl: s, redirectUrl: t, children: /* @__PURE__ */ i.jsxs(dr, { client: tn, children: [
|
|
3286
|
+
/* @__PURE__ */ i.jsx(Qi, { position: r, bouMenuItems: l, children: /* @__PURE__ */ i.jsx(Wi, {}) }),
|
|
3287
|
+
/* @__PURE__ */ i.jsx(zi, {})
|
|
3257
3288
|
] }) }) }) });
|
|
3258
3289
|
export {
|
|
3259
|
-
|
|
3290
|
+
nn as default
|
|
3260
3291
|
};
|