@myxtra/authentication-green 1.1.2 → 1.2.0-alpha.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as d, j as n, g as wt, u as Q, a as Qe, b as _t, E as Rt } from "./index-
|
|
2
|
-
class
|
|
1
|
+
import { r as d, j as n, g as wt, u as Q, a as Qe, b as _t, E as Rt } from "./index-919d6dee.mjs";
|
|
2
|
+
class H {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
5
5
|
}
|
|
@@ -171,7 +171,7 @@ function St() {
|
|
|
171
171
|
function pe(t, e, s) {
|
|
172
172
|
return s.isDataEqual != null && s.isDataEqual(t, e) ? t : typeof s.structuralSharing == "function" ? s.structuralSharing(t, e) : s.structuralSharing !== !1 ? Ke(t, e) : e;
|
|
173
173
|
}
|
|
174
|
-
class Pt extends
|
|
174
|
+
class Pt extends H {
|
|
175
175
|
constructor() {
|
|
176
176
|
super(), this.setup = (e) => {
|
|
177
177
|
if (!z && window.addEventListener) {
|
|
@@ -212,7 +212,7 @@ class Pt extends K {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
const re = new Pt(), Ne = ["online", "offline"];
|
|
215
|
-
class At extends
|
|
215
|
+
class At extends H {
|
|
216
216
|
constructor() {
|
|
217
217
|
super(), this.setup = (e) => {
|
|
218
218
|
if (!z && window.addEventListener) {
|
|
@@ -271,54 +271,54 @@ class Ve {
|
|
|
271
271
|
function te(t) {
|
|
272
272
|
return t instanceof Ve;
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function $e(t) {
|
|
275
275
|
let e = !1, s = 0, r = !1, i, o, a;
|
|
276
|
-
const u = new Promise((
|
|
277
|
-
o =
|
|
278
|
-
}), l = (
|
|
279
|
-
r || (f(new Ve(
|
|
276
|
+
const u = new Promise((m, C) => {
|
|
277
|
+
o = m, a = C;
|
|
278
|
+
}), l = (m) => {
|
|
279
|
+
r || (f(new Ve(m)), t.abort == null || t.abort());
|
|
280
280
|
}, h = () => {
|
|
281
281
|
e = !0;
|
|
282
282
|
}, c = () => {
|
|
283
283
|
e = !1;
|
|
284
|
-
}, p = () => !re.isFocused() || t.networkMode !== "always" && !ne.isOnline(),
|
|
285
|
-
r || (r = !0, t.onSuccess == null || t.onSuccess(
|
|
286
|
-
}, f = (
|
|
287
|
-
r || (r = !0, t.onError == null || t.onError(
|
|
288
|
-
},
|
|
289
|
-
i = (
|
|
284
|
+
}, p = () => !re.isFocused() || t.networkMode !== "always" && !ne.isOnline(), v = (m) => {
|
|
285
|
+
r || (r = !0, t.onSuccess == null || t.onSuccess(m), i == null || i(), o(m));
|
|
286
|
+
}, f = (m) => {
|
|
287
|
+
r || (r = !0, t.onError == null || t.onError(m), i == null || i(), a(m));
|
|
288
|
+
}, y = () => new Promise((m) => {
|
|
289
|
+
i = (C) => {
|
|
290
290
|
const _ = r || !p();
|
|
291
|
-
return _ &&
|
|
291
|
+
return _ && m(C), _;
|
|
292
292
|
}, t.onPause == null || t.onPause();
|
|
293
293
|
}).then(() => {
|
|
294
294
|
i = void 0, r || t.onContinue == null || t.onContinue();
|
|
295
|
-
}),
|
|
295
|
+
}), g = () => {
|
|
296
296
|
if (r)
|
|
297
297
|
return;
|
|
298
|
-
let
|
|
298
|
+
let m;
|
|
299
299
|
try {
|
|
300
|
-
|
|
301
|
-
} catch (
|
|
302
|
-
|
|
300
|
+
m = t.fn();
|
|
301
|
+
} catch (C) {
|
|
302
|
+
m = Promise.reject(C);
|
|
303
303
|
}
|
|
304
|
-
Promise.resolve(
|
|
304
|
+
Promise.resolve(m).then(v).catch((C) => {
|
|
305
305
|
var _, j;
|
|
306
306
|
if (r)
|
|
307
307
|
return;
|
|
308
|
-
const
|
|
308
|
+
const S = (_ = t.retry) != null ? _ : 3, N = (j = t.retryDelay) != null ? j : Nt, R = typeof N == "function" ? N(s, C) : N, w = S === !0 || typeof S == "number" && s < S || typeof S == "function" && S(s, C);
|
|
309
309
|
if (e || !w) {
|
|
310
|
-
f(
|
|
310
|
+
f(C);
|
|
311
311
|
return;
|
|
312
312
|
}
|
|
313
|
-
s++, t.onFail == null || t.onFail(s,
|
|
313
|
+
s++, t.onFail == null || t.onFail(s, C), He(R).then(() => {
|
|
314
314
|
if (p())
|
|
315
|
-
return
|
|
315
|
+
return y();
|
|
316
316
|
}).then(() => {
|
|
317
|
-
e ? f(
|
|
317
|
+
e ? f(C) : g();
|
|
318
318
|
});
|
|
319
319
|
});
|
|
320
320
|
};
|
|
321
|
-
return ue(t.networkMode) ?
|
|
321
|
+
return ue(t.networkMode) ? g() : y().then(g), {
|
|
322
322
|
promise: u,
|
|
323
323
|
cancel: l,
|
|
324
324
|
continue: () => (i == null ? void 0 : i()) ? u : Promise.resolve(),
|
|
@@ -373,7 +373,7 @@ function Mt() {
|
|
|
373
373
|
};
|
|
374
374
|
}
|
|
375
375
|
const P = Mt();
|
|
376
|
-
class
|
|
376
|
+
class Ge {
|
|
377
377
|
destroy() {
|
|
378
378
|
this.clearGcTimeout();
|
|
379
379
|
}
|
|
@@ -389,7 +389,7 @@ class $e {
|
|
|
389
389
|
this.gcTimeout && (clearTimeout(this.gcTimeout), this.gcTimeout = void 0);
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
class Ft extends
|
|
392
|
+
class Ft extends Ge {
|
|
393
393
|
constructor(e) {
|
|
394
394
|
super(), this.abortSignalConsumed = !1, this.defaultOptions = e.defaultOptions, this.setOptions(e.options), this.observers = [], this.cache = e.cache, this.logger = e.logger || be, this.queryKey = e.queryKey, this.queryHash = e.queryHash, this.initialState = e.state || kt(this.options), this.state = this.initialState, this.scheduleGc();
|
|
395
395
|
}
|
|
@@ -497,7 +497,7 @@ class Ft extends $e {
|
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
if (e && this.setOptions(e), !this.options.queryFn) {
|
|
500
|
-
const f = this.observers.find((
|
|
500
|
+
const f = this.observers.find((y) => y.options.queryFn);
|
|
501
501
|
f && this.setOptions(f.options);
|
|
502
502
|
}
|
|
503
503
|
Array.isArray(this.options.queryKey);
|
|
@@ -529,33 +529,33 @@ class Ft extends $e {
|
|
|
529
529
|
meta: (p = c.fetchOptions) == null ? void 0 : p.meta
|
|
530
530
|
});
|
|
531
531
|
}
|
|
532
|
-
const
|
|
532
|
+
const v = (f) => {
|
|
533
533
|
if (te(f) && f.silent || this.dispatch({
|
|
534
534
|
type: "error",
|
|
535
535
|
error: f
|
|
536
536
|
}), !te(f)) {
|
|
537
|
-
var
|
|
538
|
-
(
|
|
537
|
+
var y, g, m, C;
|
|
538
|
+
(y = (g = this.cache.config).onError) == null || y.call(g, f, this), (m = (C = this.cache.config).onSettled) == null || m.call(C, this.state.data, f, this);
|
|
539
539
|
}
|
|
540
540
|
this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
541
541
|
};
|
|
542
|
-
return this.retryer =
|
|
542
|
+
return this.retryer = $e({
|
|
543
543
|
fn: c.fetchFn,
|
|
544
544
|
abort: a == null ? void 0 : a.abort.bind(a),
|
|
545
545
|
onSuccess: (f) => {
|
|
546
|
-
var
|
|
546
|
+
var y, g, m, C;
|
|
547
547
|
if (typeof f > "u") {
|
|
548
|
-
|
|
548
|
+
v(new Error(this.queryHash + " data is undefined"));
|
|
549
549
|
return;
|
|
550
550
|
}
|
|
551
|
-
this.setData(f), (
|
|
551
|
+
this.setData(f), (y = (g = this.cache.config).onSuccess) == null || y.call(g, f, this), (m = (C = this.cache.config).onSettled) == null || m.call(C, f, this.state.error, this), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1;
|
|
552
552
|
},
|
|
553
|
-
onError:
|
|
554
|
-
onFail: (f,
|
|
553
|
+
onError: v,
|
|
554
|
+
onFail: (f, y) => {
|
|
555
555
|
this.dispatch({
|
|
556
556
|
type: "failed",
|
|
557
557
|
failureCount: f,
|
|
558
|
-
error:
|
|
558
|
+
error: y
|
|
559
559
|
});
|
|
560
560
|
},
|
|
561
561
|
onPause: () => {
|
|
@@ -674,7 +674,7 @@ function kt(t) {
|
|
|
674
674
|
fetchStatus: "idle"
|
|
675
675
|
};
|
|
676
676
|
}
|
|
677
|
-
class Lt extends
|
|
677
|
+
class Lt extends H {
|
|
678
678
|
constructor(e) {
|
|
679
679
|
super(), this.config = e || {}, this.queries = [], this.queriesMap = {};
|
|
680
680
|
}
|
|
@@ -750,7 +750,7 @@ class Lt extends K {
|
|
|
750
750
|
});
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
|
-
class Dt extends
|
|
753
|
+
class Dt extends Ge {
|
|
754
754
|
constructor(e) {
|
|
755
755
|
super(), this.defaultOptions = e.defaultOptions, this.mutationId = e.mutationId, this.mutationCache = e.mutationCache, this.logger = e.logger || be, this.observers = [], this.state = e.state || Ze(), this.setOptions(e.options), this.scheduleGc();
|
|
756
756
|
}
|
|
@@ -793,12 +793,12 @@ class Dt extends $e {
|
|
|
793
793
|
async execute() {
|
|
794
794
|
const e = () => {
|
|
795
795
|
var w;
|
|
796
|
-
return this.retryer =
|
|
796
|
+
return this.retryer = $e({
|
|
797
797
|
fn: () => this.options.mutationFn ? this.options.mutationFn(this.state.variables) : Promise.reject("No mutationFn found"),
|
|
798
|
-
onFail: (
|
|
798
|
+
onFail: (b, F) => {
|
|
799
799
|
this.dispatch({
|
|
800
800
|
type: "failed",
|
|
801
|
-
failureCount:
|
|
801
|
+
failureCount: b,
|
|
802
802
|
error: F
|
|
803
803
|
});
|
|
804
804
|
},
|
|
@@ -820,15 +820,15 @@ class Dt extends $e {
|
|
|
820
820
|
try {
|
|
821
821
|
var r, i, o, a, u, l, h, c;
|
|
822
822
|
if (!s) {
|
|
823
|
-
var p,
|
|
823
|
+
var p, v, f, y;
|
|
824
824
|
this.dispatch({
|
|
825
825
|
type: "loading",
|
|
826
826
|
variables: this.options.variables
|
|
827
|
-
}), await ((p = (
|
|
828
|
-
const
|
|
829
|
-
|
|
827
|
+
}), await ((p = (v = this.mutationCache.config).onMutate) == null ? void 0 : p.call(v, this.state.variables, this));
|
|
828
|
+
const b = await ((f = (y = this.options).onMutate) == null ? void 0 : f.call(y, this.state.variables));
|
|
829
|
+
b !== this.state.context && this.dispatch({
|
|
830
830
|
type: "loading",
|
|
831
|
-
context:
|
|
831
|
+
context: b,
|
|
832
832
|
variables: this.state.variables
|
|
833
833
|
});
|
|
834
834
|
}
|
|
@@ -839,8 +839,8 @@ class Dt extends $e {
|
|
|
839
839
|
}), w;
|
|
840
840
|
} catch (w) {
|
|
841
841
|
try {
|
|
842
|
-
var
|
|
843
|
-
throw await ((
|
|
842
|
+
var g, m, C, _, j, S, N, R;
|
|
843
|
+
throw await ((g = (m = this.mutationCache.config).onError) == null ? void 0 : g.call(m, w, this.state.variables, this.state.context, this)), await ((C = (_ = this.options).onError) == null ? void 0 : C.call(_, w, this.state.variables, this.state.context)), await ((j = (S = this.mutationCache.config).onSettled) == null ? void 0 : j.call(S, void 0, w, this.state.variables, this.state.context, this)), await ((N = (R = this.options).onSettled) == null ? void 0 : N.call(R, void 0, w, this.state.variables, this.state.context)), w;
|
|
844
844
|
} finally {
|
|
845
845
|
this.dispatch({
|
|
846
846
|
type: "error",
|
|
@@ -930,7 +930,7 @@ function Ze() {
|
|
|
930
930
|
variables: void 0
|
|
931
931
|
};
|
|
932
932
|
}
|
|
933
|
-
class It extends
|
|
933
|
+
class It extends H {
|
|
934
934
|
constructor(e) {
|
|
935
935
|
super(), this.config = e || {}, this.mutations = [], this.mutationId = 0;
|
|
936
936
|
}
|
|
@@ -997,63 +997,63 @@ function Tt() {
|
|
|
997
997
|
onFetch: (t) => {
|
|
998
998
|
t.fetchFn = () => {
|
|
999
999
|
var e, s, r, i, o, a;
|
|
1000
|
-
const u = (e = t.fetchOptions) == null || (s = e.meta) == null ? void 0 : s.refetchPage, l = (r = t.fetchOptions) == null || (i = r.meta) == null ? void 0 : i.fetchMore, h = l == null ? void 0 : l.pageParam, c = (l == null ? void 0 : l.direction) === "forward", p = (l == null ? void 0 : l.direction) === "backward",
|
|
1001
|
-
let
|
|
1002
|
-
const
|
|
1000
|
+
const u = (e = t.fetchOptions) == null || (s = e.meta) == null ? void 0 : s.refetchPage, l = (r = t.fetchOptions) == null || (i = r.meta) == null ? void 0 : i.fetchMore, h = l == null ? void 0 : l.pageParam, c = (l == null ? void 0 : l.direction) === "forward", p = (l == null ? void 0 : l.direction) === "backward", v = ((o = t.state.data) == null ? void 0 : o.pages) || [], f = ((a = t.state.data) == null ? void 0 : a.pageParams) || [];
|
|
1001
|
+
let y = f, g = !1;
|
|
1002
|
+
const m = (R) => {
|
|
1003
1003
|
Object.defineProperty(R, "signal", {
|
|
1004
1004
|
enumerable: !0,
|
|
1005
1005
|
get: () => {
|
|
1006
1006
|
var w;
|
|
1007
1007
|
if ((w = t.signal) != null && w.aborted)
|
|
1008
|
-
|
|
1008
|
+
g = !0;
|
|
1009
1009
|
else {
|
|
1010
|
-
var
|
|
1011
|
-
(
|
|
1012
|
-
|
|
1010
|
+
var b;
|
|
1011
|
+
(b = t.signal) == null || b.addEventListener("abort", () => {
|
|
1012
|
+
g = !0;
|
|
1013
1013
|
});
|
|
1014
1014
|
}
|
|
1015
1015
|
return t.signal;
|
|
1016
1016
|
}
|
|
1017
1017
|
});
|
|
1018
|
-
},
|
|
1019
|
-
if (
|
|
1018
|
+
}, C = t.options.queryFn || (() => Promise.reject("Missing queryFn for queryKey '" + t.options.queryHash + "'")), _ = (R, w, b, F) => (y = F ? [w, ...y] : [...y, w], F ? [b, ...R] : [...R, b]), j = (R, w, b, F) => {
|
|
1019
|
+
if (g)
|
|
1020
1020
|
return Promise.reject("Cancelled");
|
|
1021
|
-
if (typeof
|
|
1021
|
+
if (typeof b > "u" && !w && R.length)
|
|
1022
1022
|
return Promise.resolve(R);
|
|
1023
|
-
const
|
|
1023
|
+
const W = {
|
|
1024
1024
|
queryKey: t.queryKey,
|
|
1025
|
-
pageParam:
|
|
1025
|
+
pageParam: b,
|
|
1026
1026
|
meta: t.options.meta
|
|
1027
1027
|
};
|
|
1028
|
-
|
|
1029
|
-
const le =
|
|
1030
|
-
return Promise.resolve(le).then((jt) => _(R,
|
|
1028
|
+
m(W);
|
|
1029
|
+
const le = C(W);
|
|
1030
|
+
return Promise.resolve(le).then((jt) => _(R, b, jt, F));
|
|
1031
1031
|
};
|
|
1032
|
-
let
|
|
1033
|
-
if (!
|
|
1034
|
-
|
|
1032
|
+
let S;
|
|
1033
|
+
if (!v.length)
|
|
1034
|
+
S = j([]);
|
|
1035
1035
|
else if (c) {
|
|
1036
|
-
const R = typeof h < "u", w = R ? h : Me(t.options,
|
|
1037
|
-
|
|
1036
|
+
const R = typeof h < "u", w = R ? h : Me(t.options, v);
|
|
1037
|
+
S = j(v, R, w);
|
|
1038
1038
|
} else if (p) {
|
|
1039
|
-
const R = typeof h < "u", w = R ? h : Ut(t.options,
|
|
1040
|
-
|
|
1039
|
+
const R = typeof h < "u", w = R ? h : Ut(t.options, v);
|
|
1040
|
+
S = j(v, R, w, !0);
|
|
1041
1041
|
} else {
|
|
1042
|
-
|
|
1042
|
+
y = [];
|
|
1043
1043
|
const R = typeof t.options.getNextPageParam > "u";
|
|
1044
|
-
|
|
1045
|
-
for (let
|
|
1046
|
-
|
|
1047
|
-
if (u &&
|
|
1048
|
-
const le = R ? f[
|
|
1044
|
+
S = (u && v[0] ? u(v[0], 0, v) : !0) ? j([], R, f[0]) : Promise.resolve(_([], f[0], v[0]));
|
|
1045
|
+
for (let b = 1; b < v.length; b++)
|
|
1046
|
+
S = S.then((F) => {
|
|
1047
|
+
if (u && v[b] ? u(v[b], b, v) : !0) {
|
|
1048
|
+
const le = R ? f[b] : Me(t.options, F);
|
|
1049
1049
|
return j(F, R, le);
|
|
1050
1050
|
}
|
|
1051
|
-
return Promise.resolve(_(F, f[
|
|
1051
|
+
return Promise.resolve(_(F, f[b], v[b]));
|
|
1052
1052
|
});
|
|
1053
1053
|
}
|
|
1054
|
-
return
|
|
1054
|
+
return S.then((R) => ({
|
|
1055
1055
|
pages: R,
|
|
1056
|
-
pageParams:
|
|
1056
|
+
pageParams: y
|
|
1057
1057
|
}));
|
|
1058
1058
|
};
|
|
1059
1059
|
}
|
|
@@ -1261,7 +1261,7 @@ class We {
|
|
|
1261
1261
|
this.queryCache.clear(), this.mutationCache.clear();
|
|
1262
1262
|
}
|
|
1263
1263
|
}
|
|
1264
|
-
class Qt extends
|
|
1264
|
+
class Qt extends H {
|
|
1265
1265
|
constructor(e, s) {
|
|
1266
1266
|
super(), this.client = e, this.options = s, this.trackedProps = /* @__PURE__ */ new Set(), this.selectError = null, this.bindMethods(), this.setOptions(s);
|
|
1267
1267
|
}
|
|
@@ -1378,65 +1378,65 @@ class Qt extends K {
|
|
|
1378
1378
|
state: p
|
|
1379
1379
|
} = e;
|
|
1380
1380
|
let {
|
|
1381
|
-
dataUpdatedAt:
|
|
1381
|
+
dataUpdatedAt: v,
|
|
1382
1382
|
error: f,
|
|
1383
|
-
errorUpdatedAt:
|
|
1384
|
-
fetchStatus:
|
|
1385
|
-
status:
|
|
1386
|
-
} = p,
|
|
1383
|
+
errorUpdatedAt: y,
|
|
1384
|
+
fetchStatus: g,
|
|
1385
|
+
status: m
|
|
1386
|
+
} = p, C = !1, _ = !1, j;
|
|
1387
1387
|
if (s._optimisticResults) {
|
|
1388
|
-
const
|
|
1389
|
-
(F ||
|
|
1388
|
+
const b = this.hasListeners(), F = !b && Fe(e, s), W = b && ke(e, r, s, i);
|
|
1389
|
+
(F || W) && (g = ue(e.options.networkMode) ? "fetching" : "paused", v || (m = "loading")), s._optimisticResults === "isRestoring" && (g = "idle");
|
|
1390
1390
|
}
|
|
1391
|
-
if (s.keepPreviousData && !p.dataUpdatedAt && c != null && c.isSuccess &&
|
|
1392
|
-
j = c.data,
|
|
1391
|
+
if (s.keepPreviousData && !p.dataUpdatedAt && c != null && c.isSuccess && m !== "error")
|
|
1392
|
+
j = c.data, v = c.dataUpdatedAt, m = c.status, C = !0;
|
|
1393
1393
|
else if (s.select && typeof p.data < "u")
|
|
1394
1394
|
if (o && p.data === (a == null ? void 0 : a.data) && s.select === this.selectFn)
|
|
1395
1395
|
j = this.selectResult;
|
|
1396
1396
|
else
|
|
1397
1397
|
try {
|
|
1398
1398
|
this.selectFn = s.select, j = s.select(p.data), j = pe(o == null ? void 0 : o.data, j, s), this.selectResult = j, this.selectError = null;
|
|
1399
|
-
} catch (
|
|
1400
|
-
this.selectError =
|
|
1399
|
+
} catch (b) {
|
|
1400
|
+
this.selectError = b;
|
|
1401
1401
|
}
|
|
1402
1402
|
else
|
|
1403
1403
|
j = p.data;
|
|
1404
|
-
if (typeof s.placeholderData < "u" && typeof j > "u" &&
|
|
1405
|
-
let
|
|
1404
|
+
if (typeof s.placeholderData < "u" && typeof j > "u" && m === "loading") {
|
|
1405
|
+
let b;
|
|
1406
1406
|
if (o != null && o.isPlaceholderData && s.placeholderData === (u == null ? void 0 : u.placeholderData))
|
|
1407
|
-
|
|
1408
|
-
else if (
|
|
1407
|
+
b = o.data;
|
|
1408
|
+
else if (b = typeof s.placeholderData == "function" ? s.placeholderData() : s.placeholderData, s.select && typeof b < "u")
|
|
1409
1409
|
try {
|
|
1410
|
-
|
|
1410
|
+
b = s.select(b), this.selectError = null;
|
|
1411
1411
|
} catch (F) {
|
|
1412
1412
|
this.selectError = F;
|
|
1413
1413
|
}
|
|
1414
|
-
typeof
|
|
1414
|
+
typeof b < "u" && (m = "success", j = pe(o == null ? void 0 : o.data, b, s), _ = !0);
|
|
1415
1415
|
}
|
|
1416
|
-
this.selectError && (f = this.selectError, j = this.selectResult,
|
|
1417
|
-
const
|
|
1416
|
+
this.selectError && (f = this.selectError, j = this.selectResult, y = Date.now(), m = "error");
|
|
1417
|
+
const S = g === "fetching", N = m === "loading", R = m === "error";
|
|
1418
1418
|
return {
|
|
1419
|
-
status:
|
|
1420
|
-
fetchStatus:
|
|
1419
|
+
status: m,
|
|
1420
|
+
fetchStatus: g,
|
|
1421
1421
|
isLoading: N,
|
|
1422
|
-
isSuccess:
|
|
1422
|
+
isSuccess: m === "success",
|
|
1423
1423
|
isError: R,
|
|
1424
|
-
isInitialLoading: N &&
|
|
1424
|
+
isInitialLoading: N && S,
|
|
1425
1425
|
data: j,
|
|
1426
|
-
dataUpdatedAt:
|
|
1426
|
+
dataUpdatedAt: v,
|
|
1427
1427
|
error: f,
|
|
1428
|
-
errorUpdatedAt:
|
|
1428
|
+
errorUpdatedAt: y,
|
|
1429
1429
|
failureCount: p.fetchFailureCount,
|
|
1430
1430
|
failureReason: p.fetchFailureReason,
|
|
1431
1431
|
errorUpdateCount: p.errorUpdateCount,
|
|
1432
1432
|
isFetched: p.dataUpdateCount > 0 || p.errorUpdateCount > 0,
|
|
1433
1433
|
isFetchedAfterMount: p.dataUpdateCount > h.dataUpdateCount || p.errorUpdateCount > h.errorUpdateCount,
|
|
1434
|
-
isFetching:
|
|
1435
|
-
isRefetching:
|
|
1434
|
+
isFetching: S,
|
|
1435
|
+
isRefetching: S && !N,
|
|
1436
1436
|
isLoadingError: R && p.dataUpdatedAt === 0,
|
|
1437
|
-
isPaused:
|
|
1437
|
+
isPaused: g === "paused",
|
|
1438
1438
|
isPlaceholderData: _,
|
|
1439
|
-
isPreviousData:
|
|
1439
|
+
isPreviousData: C,
|
|
1440
1440
|
isRefetchError: R && p.dataUpdatedAt !== 0,
|
|
1441
1441
|
isStale: je(e, s),
|
|
1442
1442
|
refetch: this.refetch,
|
|
@@ -1522,7 +1522,7 @@ function je(t, e) {
|
|
|
1522
1522
|
function Bt(t, e, s) {
|
|
1523
1523
|
return s.keepPreviousData ? !1 : s.placeholderData !== void 0 ? e.isPlaceholderData : t.getCurrentResult() !== e;
|
|
1524
1524
|
}
|
|
1525
|
-
class Kt extends
|
|
1525
|
+
class Kt extends H {
|
|
1526
1526
|
constructor(e, s) {
|
|
1527
1527
|
super(), this.client = e, this.setOptions(s), this.bindMethods(), this.updateResult();
|
|
1528
1528
|
}
|
|
@@ -1606,16 +1606,16 @@ var Ye = { exports: {} }, ze = {};
|
|
|
1606
1606
|
* This source code is licensed under the MIT license found in the
|
|
1607
1607
|
* LICENSE file in the root directory of this source tree.
|
|
1608
1608
|
*/
|
|
1609
|
-
var
|
|
1609
|
+
var K = d;
|
|
1610
1610
|
function Ht(t, e) {
|
|
1611
1611
|
return t === e && (t !== 0 || 1 / t === 1 / e) || t !== t && e !== e;
|
|
1612
1612
|
}
|
|
1613
|
-
var Vt = typeof Object.is == "function" ? Object.is : Ht,
|
|
1613
|
+
var Vt = typeof Object.is == "function" ? Object.is : Ht, $t = K.useState, Gt = K.useEffect, Zt = K.useLayoutEffect, Wt = K.useDebugValue;
|
|
1614
1614
|
function Yt(t, e) {
|
|
1615
|
-
var s = e(), r =
|
|
1615
|
+
var s = e(), r = $t({ inst: { value: s, getSnapshot: e } }), i = r[0].inst, o = r[1];
|
|
1616
1616
|
return Zt(function() {
|
|
1617
1617
|
i.value = s, i.getSnapshot = e, ce(i) && o({ inst: i });
|
|
1618
|
-
}, [t, s, e]),
|
|
1618
|
+
}, [t, s, e]), Gt(function() {
|
|
1619
1619
|
return ce(i) && o({ inst: i }), t(function() {
|
|
1620
1620
|
ce(i) && o({ inst: i });
|
|
1621
1621
|
});
|
|
@@ -1635,7 +1635,7 @@ function zt(t, e) {
|
|
|
1635
1635
|
return e();
|
|
1636
1636
|
}
|
|
1637
1637
|
var Jt = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? zt : Yt;
|
|
1638
|
-
ze.useSyncExternalStore =
|
|
1638
|
+
ze.useSyncExternalStore = K.useSyncExternalStore !== void 0 ? K.useSyncExternalStore : Jt;
|
|
1639
1639
|
Ye.exports = ze;
|
|
1640
1640
|
var Xt = Ye.exports;
|
|
1641
1641
|
const Je = Xt.useSyncExternalStore, Le = /* @__PURE__ */ d.createContext(void 0), Xe = /* @__PURE__ */ d.createContext(!1);
|
|
@@ -1764,7 +1764,7 @@ function it(t) {
|
|
|
1764
1764
|
t[e] && (r && (r += " "), r += e);
|
|
1765
1765
|
return r;
|
|
1766
1766
|
}
|
|
1767
|
-
function
|
|
1767
|
+
function O() {
|
|
1768
1768
|
for (var t, e, s = 0, r = ""; s < arguments.length; )
|
|
1769
1769
|
(t = arguments[s++]) && (e = it(t)) && (r && (r += " "), r += e);
|
|
1770
1770
|
return r;
|
|
@@ -1851,7 +1851,7 @@ var _s = ({ firstName: t, lastName: e, variant: s = "small" }) => {
|
|
|
1851
1851
|
children: /* @__PURE__ */ n.jsx("span", { className: "avatar__initials", children: r })
|
|
1852
1852
|
}
|
|
1853
1853
|
);
|
|
1854
|
-
},
|
|
1854
|
+
}, V = d.forwardRef(
|
|
1855
1855
|
(t, e) => {
|
|
1856
1856
|
var s = t, {
|
|
1857
1857
|
iconLeft: r,
|
|
@@ -1876,7 +1876,7 @@ var _s = ({ firstName: t, lastName: e, variant: s = "small" }) => {
|
|
|
1876
1876
|
E(x({
|
|
1877
1877
|
ref: e
|
|
1878
1878
|
}, c), {
|
|
1879
|
-
className:
|
|
1879
|
+
className: O(
|
|
1880
1880
|
"button",
|
|
1881
1881
|
u && `button--${u}`,
|
|
1882
1882
|
u && a && `button--${u}--filled`,
|
|
@@ -1893,7 +1893,7 @@ var _s = ({ firstName: t, lastName: e, variant: s = "small" }) => {
|
|
|
1893
1893
|
);
|
|
1894
1894
|
}
|
|
1895
1895
|
);
|
|
1896
|
-
|
|
1896
|
+
V.displayName = "Button";
|
|
1897
1897
|
d.createContext(void 0);
|
|
1898
1898
|
var Rs = d.forwardRef(
|
|
1899
1899
|
(t, e) => {
|
|
@@ -1904,7 +1904,7 @@ var Rs = d.forwardRef(
|
|
|
1904
1904
|
"input",
|
|
1905
1905
|
x({
|
|
1906
1906
|
ref: e,
|
|
1907
|
-
className:
|
|
1907
|
+
className: O(
|
|
1908
1908
|
"input",
|
|
1909
1909
|
r && "input--with-prefix",
|
|
1910
1910
|
i && "input--with-suffix",
|
|
@@ -2194,7 +2194,7 @@ var Es = ({ children: t }) => /* @__PURE__ */ n.jsx("div", { className: "card__h
|
|
|
2194
2194
|
)
|
|
2195
2195
|
]
|
|
2196
2196
|
})
|
|
2197
|
-
),
|
|
2197
|
+
), $s = Vs, Gs = (t) => {
|
|
2198
2198
|
const e = (s) => `${s}${t.suffix ? `_${t.suffix}` : ""}`;
|
|
2199
2199
|
return /* @__PURE__ */ n.jsxs(
|
|
2200
2200
|
"svg",
|
|
@@ -2365,7 +2365,7 @@ var Es = ({ children: t }) => /* @__PURE__ */ n.jsx("div", { className: "card__h
|
|
|
2365
2365
|
]
|
|
2366
2366
|
})
|
|
2367
2367
|
);
|
|
2368
|
-
}, _e =
|
|
2368
|
+
}, _e = Gs, Zs = (t) => /* @__PURE__ */ n.jsx(
|
|
2369
2369
|
"svg",
|
|
2370
2370
|
E(x({
|
|
2371
2371
|
fill: "none",
|
|
@@ -2431,7 +2431,7 @@ var Es = ({ children: t }) => /* @__PURE__ */ n.jsx("div", { className: "card__h
|
|
|
2431
2431
|
return /* @__PURE__ */ n.jsx(
|
|
2432
2432
|
"div",
|
|
2433
2433
|
E(x({}, l), {
|
|
2434
|
-
className:
|
|
2434
|
+
className: O(
|
|
2435
2435
|
"card__empty-state",
|
|
2436
2436
|
s === "error" && "card__empty-state--error",
|
|
2437
2437
|
i && "card__empty-state--standalone",
|
|
@@ -2461,7 +2461,7 @@ var Es = ({ children: t }) => /* @__PURE__ */ n.jsx("div", { className: "card__h
|
|
|
2461
2461
|
return /* @__PURE__ */ n.jsx(
|
|
2462
2462
|
"div",
|
|
2463
2463
|
E(x({}, a), {
|
|
2464
|
-
className:
|
|
2464
|
+
className: O(
|
|
2465
2465
|
"card__header",
|
|
2466
2466
|
s && `card__header--${s}`,
|
|
2467
2467
|
r && "card__header--sticky",
|
|
@@ -2470,7 +2470,7 @@ var Es = ({ children: t }) => /* @__PURE__ */ n.jsx("div", { className: "card__h
|
|
|
2470
2470
|
children: o
|
|
2471
2471
|
})
|
|
2472
2472
|
);
|
|
2473
|
-
}, tr = ({ children: t }) => /* @__PURE__ */ n.jsx("div", { className: "card__image", children: t }), sr = ({ children: t, className: e }) => /* @__PURE__ */ n.jsx("div", { className:
|
|
2473
|
+
}, tr = ({ children: t }) => /* @__PURE__ */ n.jsx("div", { className: "card__image", children: t }), sr = ({ children: t, className: e }) => /* @__PURE__ */ n.jsx("div", { className: O("card__body__item", e), children: t }), rr = ({ icon: t, children: e }) => /* @__PURE__ */ n.jsxs("div", { className: "card__header__title", children: [
|
|
2474
2474
|
t && /* @__PURE__ */ n.jsx("span", { className: "card__header__title__icon", children: t }),
|
|
2475
2475
|
e
|
|
2476
2476
|
] }), ut = d.forwardRef(
|
|
@@ -2479,7 +2479,7 @@ var Es = ({ children: t }) => /* @__PURE__ */ n.jsx("div", { className: "card__h
|
|
|
2479
2479
|
return d.createElement(
|
|
2480
2480
|
r,
|
|
2481
2481
|
x({
|
|
2482
|
-
className:
|
|
2482
|
+
className: O(
|
|
2483
2483
|
"card",
|
|
2484
2484
|
u && "card--disabled",
|
|
2485
2485
|
a && `card--${a}`,
|
|
@@ -2504,13 +2504,13 @@ Object.assign(ut, {
|
|
|
2504
2504
|
});
|
|
2505
2505
|
var nr = (t) => {
|
|
2506
2506
|
var e = t, { className: s, children: r } = e, i = A(e, ["className", "children"]);
|
|
2507
|
-
return /* @__PURE__ */ n.jsx("div", E(x({ className:
|
|
2507
|
+
return /* @__PURE__ */ n.jsx("div", E(x({ className: O("checkbox__content", s) }, i), { children: r }));
|
|
2508
2508
|
}, ir = (t) => {
|
|
2509
2509
|
var e = t, { className: s, children: r } = e, i = A(e, ["className", "children"]);
|
|
2510
|
-
return /* @__PURE__ */ n.jsx("span", E(x({ className:
|
|
2510
|
+
return /* @__PURE__ */ n.jsx("span", E(x({ className: O("checkbox__error", s) }, i), { children: r }));
|
|
2511
2511
|
}, or = (t) => {
|
|
2512
2512
|
var e = t, { className: s, children: r } = e, i = A(e, ["className", "children"]);
|
|
2513
|
-
return /* @__PURE__ */ n.jsx("span", E(x({ className:
|
|
2513
|
+
return /* @__PURE__ */ n.jsx("span", E(x({ className: O("checkbox__hint", s) }, i), { children: r }));
|
|
2514
2514
|
}, lt = d.createContext(void 0), ar = ({ id: t, name: e, children: s }) => /* @__PURE__ */ n.jsx(lt.Provider, { value: { id: t, name: e }, children: s }), ur = () => {
|
|
2515
2515
|
const t = d.useContext(lt);
|
|
2516
2516
|
if (!t)
|
|
@@ -2519,7 +2519,7 @@ var nr = (t) => {
|
|
|
2519
2519
|
}, lr = (t) => {
|
|
2520
2520
|
var e = t, { className: s, children: r } = e, i = A(e, ["className", "children"]);
|
|
2521
2521
|
const { id: o } = ur();
|
|
2522
|
-
return /* @__PURE__ */ n.jsx("label", E(x({ htmlFor: o, className:
|
|
2522
|
+
return /* @__PURE__ */ n.jsx("label", E(x({ htmlFor: o, className: O("checkbox__label", s) }, i), { children: r }));
|
|
2523
2523
|
}, U = (t) => {
|
|
2524
2524
|
var e = t, {
|
|
2525
2525
|
id: s,
|
|
@@ -2544,7 +2544,7 @@ var nr = (t) => {
|
|
|
2544
2544
|
}, [i]), /* @__PURE__ */ n.jsxs(
|
|
2545
2545
|
"div",
|
|
2546
2546
|
{
|
|
2547
|
-
className:
|
|
2547
|
+
className: O("checkbox", o && `checkbox--${o}`, a && "checkbox--error"),
|
|
2548
2548
|
children: [
|
|
2549
2549
|
/* @__PURE__ */ n.jsx(
|
|
2550
2550
|
"input",
|
|
@@ -2553,10 +2553,10 @@ var nr = (t) => {
|
|
|
2553
2553
|
name: r,
|
|
2554
2554
|
type: "checkbox",
|
|
2555
2555
|
ref: c,
|
|
2556
|
-
className:
|
|
2556
|
+
className: O("checkbox__input", u)
|
|
2557
2557
|
}, h)
|
|
2558
2558
|
),
|
|
2559
|
-
i ? /* @__PURE__ */ n.jsx(
|
|
2559
|
+
i ? /* @__PURE__ */ n.jsx($s, { className: "checkbox__spinner", "aria-hidden": !0 }) : /* @__PURE__ */ n.jsx(Qs, { className: "checkbox__check", "aria-hidden": !0, strokeDasharray: "75" }),
|
|
2560
2560
|
/* @__PURE__ */ n.jsx(ar, { id: s, name: r, children: l })
|
|
2561
2561
|
]
|
|
2562
2562
|
}
|
|
@@ -2568,20 +2568,20 @@ U.Hint = or;
|
|
|
2568
2568
|
U.Error = ir;
|
|
2569
2569
|
var cr = (t) => {
|
|
2570
2570
|
var e = t, { type: s = "div", className: r, children: i } = e, o = A(e, ["type", "className", "children"]);
|
|
2571
|
-
return d.createElement(s, x({ className:
|
|
2571
|
+
return d.createElement(s, x({ className: O("dialog__body", r) }, o), i);
|
|
2572
2572
|
}, ye = () => document.body.style.removeProperty("overflow"), Ie = (t) => t.preventDefault(), dr = '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])', hr = (t) => {
|
|
2573
2573
|
var e = t, { className: s, children: r, shouldAnimate: i = !0 } = e, o = A(e, ["className", "children", "shouldAnimate"]);
|
|
2574
2574
|
const { ref: a, defaultOpen: u, isModal: l, onClose: h } = X();
|
|
2575
2575
|
return d.useEffect(() => {
|
|
2576
2576
|
const c = a == null ? void 0 : a.current;
|
|
2577
2577
|
if (c != null && c.open) {
|
|
2578
|
-
const p = c.querySelectorAll(dr),
|
|
2579
|
-
if (!(
|
|
2578
|
+
const p = c.querySelectorAll(dr), v = p[0], f = p[p.length - 1], y = (g) => {
|
|
2579
|
+
if (!(g.key === "Tab"))
|
|
2580
2580
|
return;
|
|
2581
|
-
|
|
2581
|
+
g.shiftKey ? document.activeElement === v && (f.focus(), g.preventDefault()) : document.activeElement === f && (v.focus(), g.preventDefault());
|
|
2582
2582
|
};
|
|
2583
|
-
return document.body.style.overflow = "hidden", c.addEventListener("keydown",
|
|
2584
|
-
c.removeEventListener("keydown",
|
|
2583
|
+
return document.body.style.overflow = "hidden", c.addEventListener("keydown", y), window.addEventListener("popstate", () => ye()), () => {
|
|
2584
|
+
c.removeEventListener("keydown", y), window.removeEventListener("popstate", () => ye());
|
|
2585
2585
|
};
|
|
2586
2586
|
}
|
|
2587
2587
|
}, [a]), d.useEffect(() => {
|
|
@@ -2590,9 +2590,9 @@ var cr = (t) => {
|
|
|
2590
2590
|
return;
|
|
2591
2591
|
if (u && (c.removeAttribute("open"), c.showModal(), c.focus()), l)
|
|
2592
2592
|
return c.addEventListener("cancel", Ie), () => c.removeEventListener("cancel", Ie);
|
|
2593
|
-
const p = ({ clientX:
|
|
2594
|
-
const { top:
|
|
2595
|
-
_ && !(j &&
|
|
2593
|
+
const p = ({ clientX: v, clientY: f }) => {
|
|
2594
|
+
const { top: y, right: g, bottom: m, left: C } = c.getBoundingClientRect(), _ = 0 < f && 0 < v, j = y < f && f < m, S = C < v && v < g;
|
|
2595
|
+
_ && !(j && S) && h();
|
|
2596
2596
|
};
|
|
2597
2597
|
return c.addEventListener("cancel", h), c.addEventListener("mousedown", p), () => {
|
|
2598
2598
|
c.removeEventListener("cancel", h), c.removeEventListener("mousedown", p);
|
|
@@ -2604,7 +2604,7 @@ var cr = (t) => {
|
|
|
2604
2604
|
tabIndex: -1,
|
|
2605
2605
|
open: u,
|
|
2606
2606
|
"aria-modal": !!l,
|
|
2607
|
-
className:
|
|
2607
|
+
className: O("dialog", i && "dialog--animated", s)
|
|
2608
2608
|
}, o), {
|
|
2609
2609
|
children: r
|
|
2610
2610
|
})
|
|
@@ -2623,12 +2623,12 @@ var cr = (t) => {
|
|
|
2623
2623
|
}, pr = (t) => {
|
|
2624
2624
|
var e = t, { children: s } = e, r = A(e, ["children"]);
|
|
2625
2625
|
const { onClose: i } = X();
|
|
2626
|
-
return /* @__PURE__ */ n.jsx(
|
|
2626
|
+
return /* @__PURE__ */ n.jsx(V, E(x({ onClick: i }, r), { children: s }));
|
|
2627
2627
|
}, dt = d.forwardRef((t, e) => {
|
|
2628
2628
|
var s = t, { className: r } = s, i = A(s, ["className"]);
|
|
2629
2629
|
const { onClose: o } = X();
|
|
2630
2630
|
return /* @__PURE__ */ n.jsx(
|
|
2631
|
-
|
|
2631
|
+
V,
|
|
2632
2632
|
x({
|
|
2633
2633
|
type: "submit",
|
|
2634
2634
|
ref: e,
|
|
@@ -2636,14 +2636,14 @@ var cr = (t) => {
|
|
|
2636
2636
|
onClick: o,
|
|
2637
2637
|
iconLeft: /* @__PURE__ */ n.jsx(As, {}),
|
|
2638
2638
|
variant: "icon--secondary",
|
|
2639
|
-
className:
|
|
2639
|
+
className: O("dialog__close button--icon", r)
|
|
2640
2640
|
}, i)
|
|
2641
2641
|
);
|
|
2642
2642
|
});
|
|
2643
2643
|
dt.displayName = "Close";
|
|
2644
2644
|
var vr = (t) => {
|
|
2645
2645
|
var e = t, { className: s, children: r } = e, i = A(e, ["className", "children"]);
|
|
2646
|
-
return /* @__PURE__ */ n.jsx("div", E(x({ className:
|
|
2646
|
+
return /* @__PURE__ */ n.jsx("div", E(x({ className: O("dialog__footer", s) }, i), { children: r }));
|
|
2647
2647
|
}, mr = ({ children: t }) => /* @__PURE__ */ n.jsx("div", { className: "dialog__header", children: t }), yr = (t) => {
|
|
2648
2648
|
var e = t, { icon: s, children: r, className: i } = e, o = A(e, ["icon", "children", "className"]);
|
|
2649
2649
|
const { ref: a } = X(), u = d.useRef(null);
|
|
@@ -2654,7 +2654,7 @@ var vr = (t) => {
|
|
|
2654
2654
|
E(x({
|
|
2655
2655
|
tabIndex: 0,
|
|
2656
2656
|
ref: u,
|
|
2657
|
-
className:
|
|
2657
|
+
className: O("dialog__header__title", i)
|
|
2658
2658
|
}, o), {
|
|
2659
2659
|
children: [
|
|
2660
2660
|
s && /* @__PURE__ */ n.jsx("span", { className: "dialog__header__icon", children: s }),
|
|
@@ -2665,7 +2665,7 @@ var vr = (t) => {
|
|
|
2665
2665
|
}, Cr = (t) => {
|
|
2666
2666
|
var e = t, { children: s } = e, r = A(e, ["children"]);
|
|
2667
2667
|
const { ref: i } = X();
|
|
2668
|
-
return /* @__PURE__ */ n.jsx(
|
|
2668
|
+
return /* @__PURE__ */ n.jsx(V, E(x({ onClick: () => {
|
|
2669
2669
|
var o;
|
|
2670
2670
|
return (o = i == null ? void 0 : i.current) == null ? void 0 : o.showModal();
|
|
2671
2671
|
} }, r), { children: s }));
|
|
@@ -2710,55 +2710,64 @@ var ht = d.createContext(void 0), xr = ({
|
|
|
2710
2710
|
if (t === void 0)
|
|
2711
2711
|
throw new Error("useMenu must be used within a MenuProvider");
|
|
2712
2712
|
return t;
|
|
2713
|
-
}, gr = ({
|
|
2713
|
+
}, gr = ({ as: t, children: e }) => {
|
|
2714
2714
|
const {
|
|
2715
|
-
id:
|
|
2716
|
-
position:
|
|
2717
|
-
isOpen:
|
|
2718
|
-
setIsOpen:
|
|
2719
|
-
activeItemIndex:
|
|
2720
|
-
setActiveItemIndex:
|
|
2721
|
-
clearActiveItemIndex:
|
|
2722
|
-
triggerRef:
|
|
2723
|
-
contentRef:
|
|
2724
|
-
} = ft(),
|
|
2725
|
-
var
|
|
2726
|
-
if (!
|
|
2715
|
+
id: s,
|
|
2716
|
+
position: r,
|
|
2717
|
+
isOpen: i,
|
|
2718
|
+
setIsOpen: o,
|
|
2719
|
+
activeItemIndex: a,
|
|
2720
|
+
setActiveItemIndex: u,
|
|
2721
|
+
clearActiveItemIndex: l,
|
|
2722
|
+
triggerRef: h,
|
|
2723
|
+
contentRef: c
|
|
2724
|
+
} = ft(), p = (v) => {
|
|
2725
|
+
var f;
|
|
2726
|
+
if (!i)
|
|
2727
2727
|
return;
|
|
2728
|
-
if (
|
|
2729
|
-
return
|
|
2730
|
-
const
|
|
2731
|
-
switch (
|
|
2728
|
+
if (v.key === "Escape")
|
|
2729
|
+
return l(), o(!1), (f = h.current) == null ? void 0 : f.focus();
|
|
2730
|
+
const y = c.current.childElementCount - 1;
|
|
2731
|
+
switch (v.key) {
|
|
2732
2732
|
case "ArrowUp":
|
|
2733
2733
|
case "ArrowLeft":
|
|
2734
|
-
return
|
|
2734
|
+
return v.preventDefault(), u(a ? Math.max(0, a - 1) : 0);
|
|
2735
2735
|
case "ArrowDown":
|
|
2736
2736
|
case "ArrowRight":
|
|
2737
|
-
|
|
2738
|
-
const
|
|
2739
|
-
return
|
|
2737
|
+
v.preventDefault();
|
|
2738
|
+
const g = a !== void 0 ? a + 1 : 0;
|
|
2739
|
+
return u(Math.min(y, g));
|
|
2740
2740
|
case "Home":
|
|
2741
|
-
return
|
|
2741
|
+
return v.preventDefault(), u(0);
|
|
2742
2742
|
case "End":
|
|
2743
|
-
return
|
|
2743
|
+
return v.preventDefault(), u(y);
|
|
2744
2744
|
}
|
|
2745
2745
|
};
|
|
2746
|
-
return (
|
|
2746
|
+
return t ? d.createElement(
|
|
2747
|
+
t,
|
|
2748
|
+
{
|
|
2749
|
+
id: `${s}-content`,
|
|
2750
|
+
ref: c,
|
|
2751
|
+
className: O("menu__list", `menu__list--${r}`, i && "menu__list--active"),
|
|
2752
|
+
onKeyDown: p
|
|
2753
|
+
},
|
|
2754
|
+
e
|
|
2755
|
+
) : (
|
|
2747
2756
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
2748
2757
|
/* @__PURE__ */ n.jsx(
|
|
2749
2758
|
"ul",
|
|
2750
2759
|
{
|
|
2751
|
-
id: `${
|
|
2752
|
-
ref:
|
|
2753
|
-
className:
|
|
2754
|
-
onKeyDown:
|
|
2755
|
-
children:
|
|
2760
|
+
id: `${s}-content`,
|
|
2761
|
+
ref: c,
|
|
2762
|
+
className: O("menu__list", `menu__list--${r}`, i && "menu__list--active"),
|
|
2763
|
+
onKeyDown: p,
|
|
2764
|
+
children: e
|
|
2756
2765
|
}
|
|
2757
2766
|
)
|
|
2758
2767
|
);
|
|
2759
2768
|
}, br = (t) => {
|
|
2760
2769
|
var e = t, { children: s, className: r } = e, i = A(e, ["children", "className"]);
|
|
2761
|
-
return /* @__PURE__ */ n.jsx("li", E(x({}, i), { className:
|
|
2770
|
+
return /* @__PURE__ */ n.jsx("li", E(x({}, i), { className: O("menu__list-item", r), children: s }));
|
|
2762
2771
|
}, pt = ({ children: t, className: e }) => {
|
|
2763
2772
|
const { id: s, isOpen: r, setIsOpen: i, clearActiveItemIndex: o, setActiveItemIndex: a, triggerRef: u } = ft(), l = () => {
|
|
2764
2773
|
o(), i((c) => !c);
|
|
@@ -2772,7 +2781,7 @@ var ht = d.createContext(void 0), xr = ({
|
|
|
2772
2781
|
return d.cloneElement(t, {
|
|
2773
2782
|
id: `${s}-trigger`,
|
|
2774
2783
|
ref: u,
|
|
2775
|
-
className:
|
|
2784
|
+
className: O("menu__trigger", e),
|
|
2776
2785
|
onClick: l,
|
|
2777
2786
|
onKeyDown: h,
|
|
2778
2787
|
"aria-expanded": r,
|
|
@@ -2782,13 +2791,13 @@ var ht = d.createContext(void 0), xr = ({
|
|
|
2782
2791
|
pt.displayName = "Trigger";
|
|
2783
2792
|
var L = (t) => {
|
|
2784
2793
|
var e = t, { type: s, id: r, position: i = "right", children: o, className: a } = e, u = A(e, ["type", "id", "position", "children", "className"]);
|
|
2785
|
-
const l = d.useRef(null), h = d.useRef(null), c = d.useRef(null), [p,
|
|
2786
|
-
f !==
|
|
2787
|
-
const
|
|
2788
|
-
|
|
2794
|
+
const l = d.useRef(null), h = d.useRef(null), c = d.useRef(null), [p, v] = d.useState(!1), [f, y] = d.useState(), [g, m] = d.useState(f);
|
|
2795
|
+
f !== g && f !== void 0 && (c.current.children[f].firstChild.focus(), m(f));
|
|
2796
|
+
const C = () => {
|
|
2797
|
+
y(void 0), m(void 0);
|
|
2789
2798
|
}, _ = (j) => {
|
|
2790
|
-
var
|
|
2791
|
-
((
|
|
2799
|
+
var S;
|
|
2800
|
+
((S = l.current) == null ? void 0 : S.contains(j.relatedTarget)) || (C(), v(!1));
|
|
2792
2801
|
};
|
|
2793
2802
|
return /* @__PURE__ */ n.jsx(
|
|
2794
2803
|
xr,
|
|
@@ -2796,10 +2805,10 @@ var L = (t) => {
|
|
|
2796
2805
|
id: r,
|
|
2797
2806
|
position: i,
|
|
2798
2807
|
isOpen: p,
|
|
2799
|
-
setIsOpen:
|
|
2808
|
+
setIsOpen: v,
|
|
2800
2809
|
activeItemIndex: f,
|
|
2801
|
-
setActiveItemIndex:
|
|
2802
|
-
clearActiveItemIndex:
|
|
2810
|
+
setActiveItemIndex: y,
|
|
2811
|
+
clearActiveItemIndex: C,
|
|
2803
2812
|
triggerRef: h,
|
|
2804
2813
|
contentRef: c,
|
|
2805
2814
|
children: d.createElement(
|
|
@@ -2826,7 +2835,7 @@ var jr = (/* @__PURE__ */ new Map()).set("BE", "32").set("FR", "33").set("NL", "
|
|
|
2826
2835
|
}));
|
|
2827
2836
|
d.createContext(void 0);
|
|
2828
2837
|
d.createContext(void 0);
|
|
2829
|
-
const
|
|
2838
|
+
const B = ({
|
|
2830
2839
|
className: t,
|
|
2831
2840
|
label: e,
|
|
2832
2841
|
mobileUrl: s,
|
|
@@ -2841,7 +2850,13 @@ const W = ({
|
|
|
2841
2850
|
i,
|
|
2842
2851
|
e
|
|
2843
2852
|
] })
|
|
2844
|
-
] }), vt = d.createContext(void 0), wr = ({
|
|
2853
|
+
] }), vt = d.createContext(void 0), wr = ({
|
|
2854
|
+
position: t,
|
|
2855
|
+
bouMenuItems: e,
|
|
2856
|
+
authenticationStatus: s,
|
|
2857
|
+
profile: r,
|
|
2858
|
+
children: i
|
|
2859
|
+
}) => /* @__PURE__ */ n.jsx(vt.Provider, { value: { position: t, bouMenuItems: e, authenticationStatus: s, profile: r }, children: i }), Re = () => {
|
|
2845
2860
|
const t = d.useContext(vt);
|
|
2846
2861
|
if (!t)
|
|
2847
2862
|
throw new Error("Authentication context can not be rendered outside of Authentication");
|
|
@@ -2851,7 +2866,7 @@ const W = ({
|
|
|
2851
2866
|
if (!t)
|
|
2852
2867
|
throw new Error("Api context can not be rendered outside of Api");
|
|
2853
2868
|
return t;
|
|
2854
|
-
},
|
|
2869
|
+
}, $ = () => {
|
|
2855
2870
|
const { apiUrl: t, redirectUrl: e } = yt(), s = wt({ apiUrl: t, redirectUrl: e }), r = `${t}/logout?redirectUrl=${e}`, i = `${t}/user/profile`, o = `${t}/gdpr/tc/check`, a = `${t}/gdpr/tc`;
|
|
2856
2871
|
return {
|
|
2857
2872
|
loginUrl: s,
|
|
@@ -2860,83 +2875,96 @@ const W = ({
|
|
|
2860
2875
|
getTermsAndConditionsEndpoint: o,
|
|
2861
2876
|
postTermsAndConditionsEndpoint: a
|
|
2862
2877
|
};
|
|
2863
|
-
}, Rr = () => {
|
|
2864
|
-
|
|
2878
|
+
}, Rr = (t) => t ? /* @__PURE__ */ n.jsx("ul", { className: "bou-menu__list", children: t == null ? void 0 : t.map(({ label: e, icon: s, url: r }, i) => /* @__PURE__ */ n.jsx(
|
|
2879
|
+
B,
|
|
2880
|
+
{
|
|
2881
|
+
className: "bou-menu-item",
|
|
2882
|
+
mobileUrl: r,
|
|
2883
|
+
desktopUrl: r,
|
|
2884
|
+
icon: s,
|
|
2885
|
+
label: e
|
|
2886
|
+
},
|
|
2887
|
+
i
|
|
2888
|
+
)) }) : null, Er = () => {
|
|
2889
|
+
const { t } = Q(), e = Qe(), { position: s, profile: r, bouMenuItems: i } = Re(), { logoutUrl: o } = $(), a = (r == null ? void 0 : r.firstName) ?? "", u = (r == null ? void 0 : r.lastName) ?? "";
|
|
2865
2890
|
return /* @__PURE__ */ n.jsxs(L, { type: "nav", id: "xtra-menu", position: s, children: [
|
|
2866
2891
|
/* @__PURE__ */ n.jsx(
|
|
2867
2892
|
L.Trigger,
|
|
2868
2893
|
{
|
|
2869
|
-
className:
|
|
2894
|
+
className: O(
|
|
2870
2895
|
"button",
|
|
2871
2896
|
"button--neutral",
|
|
2872
2897
|
"button--authentication",
|
|
2873
2898
|
"button--authentication--authenticated"
|
|
2874
2899
|
),
|
|
2875
2900
|
children: /* @__PURE__ */ n.jsxs("button", { children: [
|
|
2876
|
-
/* @__PURE__ */ n.jsx("div", { className: "button__icon", children: /* @__PURE__ */ n.jsx(_s, { variant: "small", firstName:
|
|
2877
|
-
/* @__PURE__ */ n.jsx("span", { className: "button__label", children:
|
|
2901
|
+
/* @__PURE__ */ n.jsx("div", { className: "button__icon", children: /* @__PURE__ */ n.jsx(_s, { variant: "small", firstName: a, lastName: u }) }),
|
|
2902
|
+
/* @__PURE__ */ n.jsx("span", { className: "button__label", children: a }),
|
|
2878
2903
|
/* @__PURE__ */ n.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ n.jsx(we, {}) })
|
|
2879
2904
|
] })
|
|
2880
2905
|
}
|
|
2881
2906
|
),
|
|
2882
|
-
/* @__PURE__ */ n.jsxs(L.Content, { children: [
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2907
|
+
/* @__PURE__ */ n.jsxs(L.Content, { as: "div", children: [
|
|
2908
|
+
Rr(i),
|
|
2909
|
+
/* @__PURE__ */ n.jsxs("ul", { children: [
|
|
2910
|
+
/* @__PURE__ */ n.jsx(
|
|
2911
|
+
B,
|
|
2912
|
+
{
|
|
2913
|
+
className: "manage-profile",
|
|
2914
|
+
mobileUrl: `${e}/manage-profile`,
|
|
2915
|
+
desktopUrl: `${e}/manage-profile/personal-data`,
|
|
2916
|
+
icon: /* @__PURE__ */ n.jsx(Ts, {}),
|
|
2917
|
+
label: t("manageProfile")
|
|
2918
|
+
}
|
|
2919
|
+
),
|
|
2920
|
+
/* @__PURE__ */ n.jsx(
|
|
2921
|
+
B,
|
|
2922
|
+
{
|
|
2923
|
+
className: "payment",
|
|
2924
|
+
mobileUrl: `${e}/payment`,
|
|
2925
|
+
desktopUrl: `${e}/payment/pay-with-xtra`,
|
|
2926
|
+
icon: /* @__PURE__ */ n.jsx(Ws, {}),
|
|
2927
|
+
label: t("payment")
|
|
2928
|
+
}
|
|
2929
|
+
),
|
|
2930
|
+
/* @__PURE__ */ n.jsx(
|
|
2931
|
+
B,
|
|
2932
|
+
{
|
|
2933
|
+
mobileUrl: `${e}/identifiers`,
|
|
2934
|
+
icon: /* @__PURE__ */ n.jsx(zs, {}),
|
|
2935
|
+
label: t("qrCode")
|
|
2936
|
+
}
|
|
2937
|
+
),
|
|
2938
|
+
/* @__PURE__ */ n.jsx(
|
|
2939
|
+
B,
|
|
2940
|
+
{
|
|
2941
|
+
className: "manage-privacy",
|
|
2942
|
+
mobileUrl: `${e}/manage-privacy`,
|
|
2943
|
+
desktopUrl: `${e}/manage-privacy/permissions`,
|
|
2944
|
+
icon: /* @__PURE__ */ n.jsx(Bs, {}),
|
|
2945
|
+
label: t("privacy")
|
|
2946
|
+
}
|
|
2947
|
+
),
|
|
2948
|
+
/* @__PURE__ */ n.jsx(B, { mobileUrl: o, icon: /* @__PURE__ */ n.jsx(Ds, {}), label: t("logout") })
|
|
2949
|
+
] })
|
|
2922
2950
|
] })
|
|
2923
2951
|
] });
|
|
2924
|
-
},
|
|
2952
|
+
}, Or = () => {
|
|
2925
2953
|
const { t } = Q();
|
|
2926
|
-
return /* @__PURE__ */ n.jsxs("button", { className:
|
|
2954
|
+
return /* @__PURE__ */ n.jsxs("button", { className: O("button", "button--neutral", "button--authentication"), children: [
|
|
2927
2955
|
/* @__PURE__ */ n.jsx("div", { className: "button__icon", children: /* @__PURE__ */ n.jsx("i", { className: "spinner" }) }),
|
|
2928
2956
|
/* @__PURE__ */ n.jsxs("span", { className: "button__label", children: [
|
|
2929
2957
|
t("loading"),
|
|
2930
2958
|
"..."
|
|
2931
2959
|
] })
|
|
2932
2960
|
] });
|
|
2933
|
-
},
|
|
2934
|
-
const { t: e } = Q(), { loginUrl: s } =
|
|
2961
|
+
}, Sr = ({ className: t }) => {
|
|
2962
|
+
const { t: e } = Q(), { loginUrl: s } = $();
|
|
2935
2963
|
return /* @__PURE__ */ n.jsxs(
|
|
2936
2964
|
"a",
|
|
2937
2965
|
{
|
|
2938
2966
|
href: s,
|
|
2939
|
-
className:
|
|
2967
|
+
className: O(
|
|
2940
2968
|
"button",
|
|
2941
2969
|
"button--neutral",
|
|
2942
2970
|
"button--authentication",
|
|
@@ -2951,10 +2979,10 @@ const W = ({
|
|
|
2951
2979
|
}
|
|
2952
2980
|
);
|
|
2953
2981
|
};
|
|
2954
|
-
const
|
|
2955
|
-
const { t } = Q(), { loginUrl: e } =
|
|
2982
|
+
const Pr = () => {
|
|
2983
|
+
const { t } = Q(), { loginUrl: e } = $(), s = Qe(), { position: r } = Re();
|
|
2956
2984
|
return /* @__PURE__ */ n.jsxs(L, { type: "nav", id: "xtra-menu", position: r, className: "menu--unauthenticated", children: [
|
|
2957
|
-
/* @__PURE__ */ n.jsx(L.Trigger, { className:
|
|
2985
|
+
/* @__PURE__ */ n.jsx(L.Trigger, { className: O("button", "button--neutral", "button--authentication"), children: /* @__PURE__ */ n.jsxs("button", { children: [
|
|
2958
2986
|
/* @__PURE__ */ n.jsx("div", { className: "button__icon", children: /* @__PURE__ */ n.jsx(_e, { width: 24, height: 24, suffix: "mobile" }) }),
|
|
2959
2987
|
/* @__PURE__ */ n.jsx("div", { className: "button__icon button__icon-right", children: /* @__PURE__ */ n.jsx(we, {}) })
|
|
2960
2988
|
] }) }),
|
|
@@ -2971,12 +2999,12 @@ const Sr = () => {
|
|
|
2971
2999
|
] });
|
|
2972
3000
|
};
|
|
2973
3001
|
var D = /* @__PURE__ */ ((t) => (t.Authenticated = "authenticated", t.NotAuthenticated = "notAuthenticated", t.Pending = "pending", t))(D || {});
|
|
2974
|
-
const
|
|
3002
|
+
const Ar = () => {
|
|
2975
3003
|
const { authenticationStatus: t } = Re();
|
|
2976
3004
|
return t === D.NotAuthenticated ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
2977
|
-
/* @__PURE__ */ n.jsx(
|
|
2978
|
-
/* @__PURE__ */ n.jsx(
|
|
2979
|
-
] }) : t === D.Pending ? /* @__PURE__ */ n.jsx(
|
|
3005
|
+
/* @__PURE__ */ n.jsx(Sr, {}),
|
|
3006
|
+
/* @__PURE__ */ n.jsx(Pr, {})
|
|
3007
|
+
] }) : t === D.Pending ? /* @__PURE__ */ n.jsx(Or, {}) : /* @__PURE__ */ n.jsx(Er, {});
|
|
2980
3008
|
};
|
|
2981
3009
|
/*! js-cookie v3.0.5 | MIT */
|
|
2982
3010
|
function ee(t) {
|
|
@@ -2987,7 +3015,7 @@ function ee(t) {
|
|
|
2987
3015
|
}
|
|
2988
3016
|
return t;
|
|
2989
3017
|
}
|
|
2990
|
-
var
|
|
3018
|
+
var Nr = {
|
|
2991
3019
|
read: function(t) {
|
|
2992
3020
|
return t[0] === '"' && (t = t.slice(1, -1)), t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
2993
3021
|
},
|
|
@@ -3048,14 +3076,14 @@ function Ce(t, e) {
|
|
|
3048
3076
|
}
|
|
3049
3077
|
);
|
|
3050
3078
|
}
|
|
3051
|
-
var xe = Ce(
|
|
3079
|
+
var xe = Ce(Nr, { path: "/" });
|
|
3052
3080
|
class Te extends Error {
|
|
3053
3081
|
constructor(e) {
|
|
3054
3082
|
super(e), this.name = "UnauthorizedError";
|
|
3055
3083
|
}
|
|
3056
3084
|
}
|
|
3057
|
-
const
|
|
3058
|
-
const { i18n: t } = Q(), { profileEndpoint: e } =
|
|
3085
|
+
const Mr = () => {
|
|
3086
|
+
const { i18n: t } = Q(), { profileEndpoint: e } = $();
|
|
3059
3087
|
return nt({
|
|
3060
3088
|
// @ts-expect-error queryKey is the right type
|
|
3061
3089
|
queryKey: ["profile"],
|
|
@@ -3078,7 +3106,7 @@ const Nr = () => {
|
|
|
3078
3106
|
e ? D.Authenticated : D.Pending
|
|
3079
3107
|
), [i, o] = d.useState(
|
|
3080
3108
|
e ? JSON.parse(t) : void 0
|
|
3081
|
-
), a =
|
|
3109
|
+
), a = Mr();
|
|
3082
3110
|
return d.useEffect(() => {
|
|
3083
3111
|
if (a.isError && e && (xe.remove("profile"), r(D.NotAuthenticated)), a.isError && !e && r(D.NotAuthenticated), a.isSuccess) {
|
|
3084
3112
|
r(D.Authenticated);
|
|
@@ -3098,18 +3126,27 @@ const Nr = () => {
|
|
|
3098
3126
|
a.isLoading,
|
|
3099
3127
|
a.isSuccess
|
|
3100
3128
|
]), { authenticationStatus: s, profile: i };
|
|
3101
|
-
},
|
|
3102
|
-
const { authenticationStatus:
|
|
3103
|
-
return /* @__PURE__ */ n.jsx(
|
|
3129
|
+
}, Fr = ({ position: t, bouMenuItems: e }) => {
|
|
3130
|
+
const { authenticationStatus: s, profile: r } = Ct();
|
|
3131
|
+
return /* @__PURE__ */ n.jsx(
|
|
3132
|
+
wr,
|
|
3133
|
+
{
|
|
3134
|
+
bouMenuItems: e,
|
|
3135
|
+
authenticationStatus: s,
|
|
3136
|
+
position: t,
|
|
3137
|
+
profile: r,
|
|
3138
|
+
children: /* @__PURE__ */ n.jsx(Ar, {})
|
|
3139
|
+
}
|
|
3140
|
+
);
|
|
3104
3141
|
};
|
|
3105
|
-
var
|
|
3142
|
+
var kr = Object.defineProperty, Lr = Object.defineProperties, Dr = Object.getOwnPropertyDescriptors, ae = Object.getOwnPropertySymbols, xt = Object.prototype.hasOwnProperty, gt = Object.prototype.propertyIsEnumerable, Ue = (t, e, s) => e in t ? kr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, q = (t, e) => {
|
|
3106
3143
|
for (var s in e || (e = {}))
|
|
3107
3144
|
xt.call(e, s) && Ue(t, s, e[s]);
|
|
3108
3145
|
if (ae)
|
|
3109
3146
|
for (var s of ae(e))
|
|
3110
3147
|
gt.call(e, s) && Ue(t, s, e[s]);
|
|
3111
3148
|
return t;
|
|
3112
|
-
}, G = (t, e) =>
|
|
3149
|
+
}, G = (t, e) => Lr(t, Dr(e)), Z = (t, e) => {
|
|
3113
3150
|
var s = {};
|
|
3114
3151
|
for (var r in t)
|
|
3115
3152
|
xt.call(t, r) && e.indexOf(r) < 0 && (s[r] = t[r]);
|
|
@@ -3117,14 +3154,14 @@ var Fr = Object.defineProperty, kr = Object.defineProperties, Lr = Object.getOwn
|
|
|
3117
3154
|
for (var r of ae(t))
|
|
3118
3155
|
e.indexOf(r) < 0 && gt.call(t, r) && (s[r] = t[r]);
|
|
3119
3156
|
return s;
|
|
3120
|
-
},
|
|
3121
|
-
const s = t, { isAuthenticated: r, className: i } = s, o =
|
|
3157
|
+
}, Ir = d.forwardRef((t, e) => {
|
|
3158
|
+
const s = t, { isAuthenticated: r, className: i } = s, o = Z(s, ["isAuthenticated", "className"]);
|
|
3122
3159
|
return /* @__PURE__ */ n.jsx(
|
|
3123
|
-
|
|
3160
|
+
V,
|
|
3124
3161
|
q({
|
|
3125
3162
|
type: "button",
|
|
3126
3163
|
ref: e,
|
|
3127
|
-
className:
|
|
3164
|
+
className: O(
|
|
3128
3165
|
"button--neutral",
|
|
3129
3166
|
"button--authentication",
|
|
3130
3167
|
r && "button--authentication--authenticated",
|
|
@@ -3133,30 +3170,30 @@ var Fr = Object.defineProperty, kr = Object.defineProperties, Lr = Object.getOwn
|
|
|
3133
3170
|
}, o)
|
|
3134
3171
|
);
|
|
3135
3172
|
});
|
|
3136
|
-
|
|
3137
|
-
var
|
|
3173
|
+
Ir.displayName = "AuthenticationButton";
|
|
3174
|
+
var Tr = (t) => {
|
|
3138
3175
|
var e = t, {
|
|
3139
3176
|
children: s
|
|
3140
|
-
} = e, r =
|
|
3177
|
+
} = e, r = Z(e, [
|
|
3141
3178
|
"children"
|
|
3142
3179
|
]);
|
|
3143
3180
|
return /* @__PURE__ */ n.jsx(U.Label, G(q({ className: "form--tc__label" }, r), { children: s }));
|
|
3144
3181
|
}, bt = d.forwardRef(
|
|
3145
3182
|
(t, e) => {
|
|
3146
|
-
var s = t, { children: r } = s, i =
|
|
3183
|
+
var s = t, { children: r } = s, i = Z(s, ["children"]);
|
|
3147
3184
|
return /* @__PURE__ */ n.jsx("form", G(q({ className: "form--tc", ref: e }, i), { children: r }));
|
|
3148
3185
|
}
|
|
3149
3186
|
);
|
|
3150
3187
|
bt.displayName = "TermsAndConditionsForm";
|
|
3151
|
-
var
|
|
3188
|
+
var Ur = (t) => {
|
|
3152
3189
|
var e = t, {
|
|
3153
3190
|
children: s
|
|
3154
|
-
} = e, r =
|
|
3191
|
+
} = e, r = Z(e, [
|
|
3155
3192
|
"children"
|
|
3156
3193
|
]);
|
|
3157
3194
|
return /* @__PURE__ */ n.jsx("p", G(q({ className: "form--tc__description" }, r), { children: s }));
|
|
3158
|
-
},
|
|
3159
|
-
var e = t, { children: s } = e, r =
|
|
3195
|
+
}, Qr = (t) => {
|
|
3196
|
+
var e = t, { children: s } = e, r = Z(e, ["children"]);
|
|
3160
3197
|
return /* @__PURE__ */ n.jsx(
|
|
3161
3198
|
"a",
|
|
3162
3199
|
G(q({
|
|
@@ -3169,16 +3206,16 @@ var Tr = (t) => {
|
|
|
3169
3206
|
children: s
|
|
3170
3207
|
})
|
|
3171
3208
|
);
|
|
3172
|
-
},
|
|
3209
|
+
}, qr = ({ children: t }) => /* @__PURE__ */ n.jsx("h1", { className: "form--tc__title", children: t }), Br = d.forwardRef(
|
|
3173
3210
|
(t, e) => /* @__PURE__ */ n.jsx(M.Close, G(q({ className: "hidden" }, t), { ref: e }))
|
|
3174
3211
|
);
|
|
3175
|
-
|
|
3176
|
-
var
|
|
3177
|
-
var e = t, { children: s } = e, r =
|
|
3212
|
+
Br.displayName = "TermsAndConditionsClose";
|
|
3213
|
+
var Kr = (t) => {
|
|
3214
|
+
var e = t, { children: s } = e, r = Z(e, ["children"]);
|
|
3178
3215
|
return /* @__PURE__ */ n.jsx("span", G(q({ className: "form--tc__error", role: "alert" }, r), { children: s }));
|
|
3179
3216
|
};
|
|
3180
|
-
const
|
|
3181
|
-
const { postTermsAndConditionsEndpoint: t } =
|
|
3217
|
+
const Hr = () => {
|
|
3218
|
+
const { postTermsAndConditionsEndpoint: t } = $(), e = new We();
|
|
3182
3219
|
return fs({
|
|
3183
3220
|
mutationFn: async (r) => {
|
|
3184
3221
|
const i = await fetch(t, {
|
|
@@ -3195,8 +3232,8 @@ const Kr = () => {
|
|
|
3195
3232
|
await e.invalidateQueries({ queryKey: ["gdpr"] });
|
|
3196
3233
|
}
|
|
3197
3234
|
});
|
|
3198
|
-
},
|
|
3199
|
-
const { i18n: t } = Q(), { getTermsAndConditionsEndpoint: e } =
|
|
3235
|
+
}, Vr = () => {
|
|
3236
|
+
const { i18n: t } = Q(), { getTermsAndConditionsEndpoint: e } = $(), { authenticationStatus: s } = Ct(), r = xe.get("hasAcceptedLatestTermsAndConditions"), i = [], o = r === "true", a = s === D.Authenticated;
|
|
3200
3237
|
return nt({
|
|
3201
3238
|
queryKey: ["gdpr"],
|
|
3202
3239
|
queryFn: async () => {
|
|
@@ -3212,68 +3249,68 @@ const Kr = () => {
|
|
|
3212
3249
|
enabled: a && !o,
|
|
3213
3250
|
initialData: i
|
|
3214
3251
|
});
|
|
3215
|
-
},
|
|
3216
|
-
const { t: e } = Q(), { apiUrl: s } = yt(), r = d.useRef(null), [i, o] = d.useState(0), [a, u] = d.useState({}), { mutate: l, isError: h } =
|
|
3217
|
-
var
|
|
3218
|
-
(
|
|
3252
|
+
}, $r = ({ redirectUrl: t }) => {
|
|
3253
|
+
const { t: e } = Q(), { apiUrl: s } = yt(), r = d.useRef(null), [i, o] = d.useState(0), [a, u] = d.useState({}), { mutate: l, isError: h } = Hr(), { AccessibleFormMessage: c, formRef: p } = _t({ submitCount: i, errors: a }), { data: v } = Vr(), f = !!(v != null && v.length), y = e("termsAndConditions.error.required"), g = () => {
|
|
3254
|
+
var C;
|
|
3255
|
+
(C = r == null ? void 0 : r.current) == null || C.click(), document.body.style.removeProperty("overflow");
|
|
3219
3256
|
};
|
|
3220
3257
|
d.useEffect(() => {
|
|
3221
3258
|
f && document.body.style.setProperty("overflow", "hidden");
|
|
3222
3259
|
}, [f]), d.useEffect(() => {
|
|
3223
|
-
h && u({ acceptedTC:
|
|
3224
|
-
}, [
|
|
3225
|
-
const
|
|
3226
|
-
|
|
3227
|
-
const { acceptedTC: _ } =
|
|
3260
|
+
h && u({ acceptedTC: y });
|
|
3261
|
+
}, [y, h]);
|
|
3262
|
+
const m = (C) => {
|
|
3263
|
+
C.preventDefault(), o(i + 1);
|
|
3264
|
+
const { acceptedTC: _ } = C.target;
|
|
3228
3265
|
if (_ instanceof RadioNodeList) {
|
|
3229
3266
|
const j = Object.values(_);
|
|
3230
|
-
j.every((N) => N.checked) ? (u({}), l(j.map((N) => N.value)),
|
|
3267
|
+
j.every((N) => N.checked) ? (u({}), l(j.map((N) => N.value)), g()) : u({ acceptedTC: y });
|
|
3231
3268
|
} else
|
|
3232
|
-
_ != null && _.checked ? (u({}), l([_.value]),
|
|
3269
|
+
_ != null && _.checked ? (u({}), l([_.value]), g()) : u({ acceptedTC: y });
|
|
3233
3270
|
};
|
|
3234
3271
|
return f ? /* @__PURE__ */ n.jsxs(M, { defaultOpen: f, isModal: !0, children: [
|
|
3235
3272
|
c,
|
|
3236
3273
|
/* @__PURE__ */ n.jsxs(M.Root, { children: [
|
|
3237
|
-
/* @__PURE__ */ n.jsx(M.Header, { children: /* @__PURE__ */ n.jsx(M.Title, { icon: /* @__PURE__ */ n.jsx(_e, { role: "presentation" }), children: /* @__PURE__ */ n.jsx(
|
|
3238
|
-
/* @__PURE__ */ n.jsx(M.Body, { children: /* @__PURE__ */ n.jsxs(bt, { ref: p, id: "tc-form", onSubmit:
|
|
3239
|
-
/* @__PURE__ */ n.jsxs(
|
|
3274
|
+
/* @__PURE__ */ n.jsx(M.Header, { children: /* @__PURE__ */ n.jsx(M.Title, { icon: /* @__PURE__ */ n.jsx(_e, { role: "presentation" }), children: /* @__PURE__ */ n.jsx(qr, { children: e("termsAndConditions.title") }) }) }),
|
|
3275
|
+
/* @__PURE__ */ n.jsx(M.Body, { children: /* @__PURE__ */ n.jsxs(bt, { ref: p, id: "tc-form", onSubmit: m, children: [
|
|
3276
|
+
/* @__PURE__ */ n.jsxs(Ur, { children: [
|
|
3240
3277
|
e("termsAndConditions.description"),
|
|
3241
|
-
a.acceptedTC && /* @__PURE__ */ n.jsx(
|
|
3278
|
+
a.acceptedTC && /* @__PURE__ */ n.jsx(Kr, { children: y })
|
|
3242
3279
|
] }),
|
|
3243
|
-
|
|
3280
|
+
v.map(({ tcCode: C, title: _, URL: j }) => /* @__PURE__ */ n.jsx(
|
|
3244
3281
|
U,
|
|
3245
3282
|
{
|
|
3246
|
-
id:
|
|
3247
|
-
value:
|
|
3283
|
+
id: C,
|
|
3284
|
+
value: C,
|
|
3248
3285
|
name: "acceptedTC",
|
|
3249
3286
|
variant: "primary",
|
|
3250
3287
|
children: /* @__PURE__ */ n.jsxs(U.Content, { children: [
|
|
3251
|
-
/* @__PURE__ */ n.jsx(
|
|
3252
|
-
/* @__PURE__ */ n.jsx(
|
|
3288
|
+
/* @__PURE__ */ n.jsx(Tr, { children: _ }),
|
|
3289
|
+
/* @__PURE__ */ n.jsx(Qr, { href: j, children: e("termsAndConditions.action", { title: _ }) })
|
|
3253
3290
|
] })
|
|
3254
3291
|
},
|
|
3255
|
-
|
|
3292
|
+
C
|
|
3256
3293
|
))
|
|
3257
3294
|
] }) }),
|
|
3258
3295
|
/* @__PURE__ */ n.jsxs(M.Footer, { children: [
|
|
3259
3296
|
/* @__PURE__ */ n.jsx(
|
|
3260
3297
|
"a",
|
|
3261
3298
|
{
|
|
3262
|
-
className:
|
|
3299
|
+
className: O("button", "button--secondary", "button--terms-and-conditions"),
|
|
3263
3300
|
href: `${s}/logout?redirectUrl=${t}`,
|
|
3264
3301
|
children: e("logout")
|
|
3265
3302
|
}
|
|
3266
3303
|
),
|
|
3267
|
-
/* @__PURE__ */ n.jsx(
|
|
3304
|
+
/* @__PURE__ */ n.jsx(V, { form: "tc-form", type: "submit", variant: "primary", children: e("confirm") })
|
|
3268
3305
|
] })
|
|
3269
3306
|
] })
|
|
3270
3307
|
] }) : /* @__PURE__ */ n.jsx(n.Fragment, {});
|
|
3271
3308
|
}, Gr = d.forwardRef(({ children: t, ...e }, s) => /* @__PURE__ */ n.jsx("form", { className: "form--tc", ref: s, ...e, children: t }));
|
|
3272
3309
|
Gr.displayName = "TermsAndConditionsForm";
|
|
3273
|
-
const
|
|
3274
|
-
/* @__PURE__ */ n.jsx(
|
|
3275
|
-
/* @__PURE__ */ n.jsx(
|
|
3310
|
+
const Zr = new We(), zr = ({ environment: t, redirectUrl: e, apiUrl: s, position: r, bouMenuItems: i }) => /* @__PURE__ */ n.jsx(Rt, { environment: t, children: /* @__PURE__ */ n.jsx(_r, { apiUrl: s, redirectUrl: e, children: /* @__PURE__ */ n.jsxs(es, { client: Zr, children: [
|
|
3311
|
+
/* @__PURE__ */ n.jsx(Fr, { position: r, bouMenuItems: i }),
|
|
3312
|
+
/* @__PURE__ */ n.jsx($r, { redirectUrl: e })
|
|
3276
3313
|
] }) }) });
|
|
3277
3314
|
export {
|
|
3278
|
-
|
|
3315
|
+
zr as default
|
|
3279
3316
|
};
|