@novasamatech/host-papp-react-ui 0.8.11 → 0.9.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/flow/Pairing.module.css.js +38 -50
- package/dist/flow/PairingModal.js +131 -100
- package/dist/flow/PairingPopover.js +157 -121
- package/dist/flow/PappProvider.js +27 -28
- package/dist/hooks/authStatus.js +19 -23
- package/dist/hooks/identity.js +30 -31
- package/dist/index.css +2 -1
- package/dist/index.js +9 -19
- package/dist/providers/AuthProvider.js +43 -51
- package/dist/providers/SessionsProvider.js +29 -38
- package/dist/providers/TranslationProvider.js +39 -46
- package/dist/ui/LogoSmall.js +43 -21
- package/dist/ui/Modal.js +39 -34
- package/dist/ui/Modal.module.css.js +7 -8
- package/dist/ui/QrCode.js +79 -64
- package/dist/ui/QrCode.module.css.js +16 -18
- package/package.json +8 -8
|
@@ -1,51 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
l as loaderText,
|
|
38
|
-
e as pairingContainer,
|
|
39
|
-
a as pairingDescription,
|
|
40
|
-
v as pairingDescriptionPopover,
|
|
41
|
-
n as pairingHeader,
|
|
42
|
-
T as pairingPopoverContainer,
|
|
43
|
-
u as pairingPopoverHeader,
|
|
44
|
-
s as popoverContainer,
|
|
45
|
-
r as popoverContent,
|
|
46
|
-
t as qrSurfaceDark,
|
|
47
|
-
p as qrSurfaceLight,
|
|
48
|
-
H as retryButton,
|
|
49
|
-
i as scanCallToAction,
|
|
50
|
-
C as scanCallToActionPopover
|
|
1
|
+
//#region src/flow/Pairing.module.css
|
|
2
|
+
var e = "papp_Pairing-module_popoverContent_3xnU8", t = "papp_Pairing-module_container_gH7WU", n = "papp_Pairing-module_genericText_zDzqC", r = "papp_Pairing-module_pairingContainer_R5atH", i = "papp_Pairing-module_pairingHeader_bpfNW", a = "papp_Pairing-module_scanCallToAction_lOQ-T", o = "papp_Pairing-module_pairingDescription_UJE0U", s = "papp_Pairing-module_qrSurface_wDMjT", c = "papp_Pairing-module_qrSurfaceLight_dIa-z papp_Pairing-module_qrSurface_wDMjT", l = "papp_Pairing-module_qrSurfaceDark_2icM9 papp_Pairing-module_qrSurface_wDMjT", u = "papp_Pairing-module_loaderLogo_iHsP9", d = "papp_Pairing-module_loader_S62aK", f = "papp_Pairing-module_loaderContainer_cR46U", p = "papp_Pairing-module_loaderText_beteT", m = "papp_Pairing-module_loaderContainerPopover_n1-JJ", h = "papp_Pairing-module_finishedContainer_FtMTm", g = "papp_Pairing-module_finishedLogo_jkEDX", _ = "papp_Pairing-module_finishedLogoSeparator_iRufd", v = "papp_Pairing-module_finishedLogoTitle_qKs3e", y = "papp_Pairing-module_finishedWelcome_Zvm-X", b = "papp_Pairing-module_finishedUsername_RIpsa", x = "papp_Pairing-module_finishedVoucher_rR0jH", S = "papp_Pairing-module_finishedButton_iuvIR", C = "papp_Pairing-module_errorContainer_KW5T-", w = "papp_Pairing-module_errorTitle_qokH0", T = "papp_Pairing-module_popoverContainer_fOWoF", E = "papp_Pairing-module_pairingPopoverHeader_PAQot", D = "papp_Pairing-module_scanCallToActionPopover_Irz-z", O = "papp_Pairing-module_pairingDescriptionPopover_z71yj", k = "papp_Pairing-module_errorContainerPopover_4mELg", A = "papp_Pairing-module_pairingPopoverContainer_RvVnH", j = "papp_Pairing-module_errorTitlePopover_-FPrd", M = "papp_Pairing-module_errorGenericText_ZPwQb", N = "papp_Pairing-module_retryButton_kWeRx", P = {
|
|
3
|
+
popoverContent: e,
|
|
4
|
+
container: t,
|
|
5
|
+
genericText: n,
|
|
6
|
+
pairingContainer: r,
|
|
7
|
+
pairingHeader: i,
|
|
8
|
+
scanCallToAction: a,
|
|
9
|
+
pairingDescription: o,
|
|
10
|
+
qrSurface: s,
|
|
11
|
+
qrSurfaceLight: c,
|
|
12
|
+
qrSurfaceDark: l,
|
|
13
|
+
loaderLogo: u,
|
|
14
|
+
loader: d,
|
|
15
|
+
loaderContainer: f,
|
|
16
|
+
loaderText: p,
|
|
17
|
+
loaderContainerPopover: m,
|
|
18
|
+
finishedContainer: h,
|
|
19
|
+
finishedLogo: g,
|
|
20
|
+
finishedLogoSeparator: _,
|
|
21
|
+
finishedLogoTitle: v,
|
|
22
|
+
finishedWelcome: y,
|
|
23
|
+
finishedUsername: b,
|
|
24
|
+
finishedVoucher: x,
|
|
25
|
+
finishedButton: S,
|
|
26
|
+
errorContainer: C,
|
|
27
|
+
errorTitle: w,
|
|
28
|
+
popoverContainer: T,
|
|
29
|
+
pairingPopoverHeader: E,
|
|
30
|
+
scanCallToActionPopover: D,
|
|
31
|
+
pairingDescriptionPopover: O,
|
|
32
|
+
errorContainerPopover: k,
|
|
33
|
+
pairingPopoverContainer: A,
|
|
34
|
+
errorTitlePopover: j,
|
|
35
|
+
errorGenericText: M,
|
|
36
|
+
retryButton: N
|
|
51
37
|
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { t as container, P as default, C as errorContainer, k as errorContainerPopover, M as errorGenericText, w as errorTitle, j as errorTitlePopover, S as finishedButton, h as finishedContainer, g as finishedLogo, _ as finishedLogoSeparator, v as finishedLogoTitle, b as finishedUsername, x as finishedVoucher, y as finishedWelcome, n as genericText, d as loader, f as loaderContainer, m as loaderContainerPopover, u as loaderLogo, p as loaderText, r as pairingContainer, o as pairingDescription, O as pairingDescriptionPopover, i as pairingHeader, A as pairingPopoverContainer, E as pairingPopoverHeader, T as popoverContainer, e as popoverContent, s as qrSurface, l as qrSurfaceDark, c as qrSurfaceLight, N as retryButton, a as scanCallToAction, D as scanCallToActionPopover };
|
|
@@ -1,101 +1,132 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
1
|
+
import { useTranslations as e } from "../providers/TranslationProvider.js";
|
|
2
|
+
import { useAuthentication as t } from "../providers/AuthProvider.js";
|
|
3
|
+
import { useAuthStatus as n } from "../hooks/authStatus.js";
|
|
4
|
+
import { LogoSmall as r } from "../ui/LogoSmall.js";
|
|
5
|
+
import { Modal as i } from "../ui/Modal.js";
|
|
6
|
+
import { QrCode as a } from "../ui/QrCode.js";
|
|
7
|
+
import o from "./Pairing.module.css.js";
|
|
8
|
+
import { Button as s } from "@novasamatech/tr-ui";
|
|
9
|
+
import { memo as c, useEffect as l } from "react";
|
|
10
|
+
import { c as u } from "react/compiler-runtime";
|
|
11
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
12
|
+
//#region src/flow/PairingModal.tsx
|
|
13
|
+
var p = c((e) => {
|
|
14
|
+
let r = u(28), a;
|
|
15
|
+
r[0] === e ? a = r[1] : (a = e === void 0 ? {} : e, r[0] = e, r[1] = a);
|
|
16
|
+
let { theme: s, size: c } = a, p = c === void 0 ? 280 : c, _ = t(), { status: v } = n(), y = _.authUIMode === "modal" && v.step !== "none" && v.step !== "finished", b;
|
|
17
|
+
r[2] !== _ || r[3] !== v.step ? (b = (e) => {
|
|
18
|
+
!e && v.step !== "pending" && _.abortAuthentication();
|
|
19
|
+
}, r[2] = _, r[3] = v.step, r[4] = b) : b = r[4];
|
|
20
|
+
let x = b, S, C;
|
|
21
|
+
r[5] !== _ || r[6] !== v.step ? (S = () => {
|
|
22
|
+
_.authUIMode === "modal" && v.step === "finished" && _.abortAuthentication();
|
|
23
|
+
}, C = [_, v.step], r[5] = _, r[6] = v.step, r[7] = S, r[8] = C) : (S = r[7], C = r[8]), l(S, C);
|
|
24
|
+
let w;
|
|
25
|
+
r[9] !== p || r[10] !== v.payload || r[11] !== v.step || r[12] !== s ? (w = v.step === "pairing" && /* @__PURE__ */ d(m, {
|
|
26
|
+
theme: s,
|
|
27
|
+
size: p,
|
|
28
|
+
payload: v.payload
|
|
29
|
+
}), r[9] = p, r[10] = v.payload, r[11] = v.step, r[12] = s, r[13] = w) : w = r[13];
|
|
30
|
+
let T;
|
|
31
|
+
r[14] !== v.stage || r[15] !== v.step ? (T = v.step === "pending" && /* @__PURE__ */ d(h, { stage: v.stage }), r[14] = v.stage, r[15] = v.step, r[16] = T) : T = r[16];
|
|
32
|
+
let E;
|
|
33
|
+
r[17] !== v.message || r[18] !== v.step ? (E = v.step === "pairingError" && /* @__PURE__ */ d(g, { message: v.message }), r[17] = v.message, r[18] = v.step, r[19] = E) : E = r[19];
|
|
34
|
+
let D;
|
|
35
|
+
r[20] !== w || r[21] !== T || r[22] !== E ? (D = /* @__PURE__ */ f("div", {
|
|
36
|
+
className: o.container,
|
|
37
|
+
children: [
|
|
38
|
+
w,
|
|
39
|
+
T,
|
|
40
|
+
E
|
|
41
|
+
]
|
|
42
|
+
}), r[20] = w, r[21] = T, r[22] = E, r[23] = D) : D = r[23];
|
|
43
|
+
let O;
|
|
44
|
+
return r[24] !== y || r[25] !== D || r[26] !== x ? (O = /* @__PURE__ */ d(i, {
|
|
45
|
+
open: y,
|
|
46
|
+
onOpenChange: x,
|
|
47
|
+
width: "fit-content",
|
|
48
|
+
children: D
|
|
49
|
+
}), r[24] = y, r[25] = D, r[26] = x, r[27] = O) : O = r[27], O;
|
|
50
|
+
}), m = (t) => {
|
|
51
|
+
let n = u(18), { payload: r, size: i, theme: s } = t, c = e(), l = s === "dark", p;
|
|
52
|
+
n[0] === c.pairingHeader ? p = n[1] : (p = /* @__PURE__ */ d("span", {
|
|
53
|
+
className: o.pairingHeader,
|
|
54
|
+
children: c.pairingHeader
|
|
55
|
+
}), n[0] = c.pairingHeader, n[1] = p);
|
|
56
|
+
let m;
|
|
57
|
+
n[2] === c.pairingScanCallToAction ? m = n[3] : (m = /* @__PURE__ */ d("span", {
|
|
58
|
+
className: o.scanCallToAction,
|
|
59
|
+
children: c.pairingScanCallToAction
|
|
60
|
+
}), n[2] = c.pairingScanCallToAction, n[3] = m);
|
|
61
|
+
let h = l ? o.qrSurfaceDark : o.qrSurfaceLight, g;
|
|
62
|
+
n[4] !== r || n[5] !== i || n[6] !== s ? (g = /* @__PURE__ */ d(a, {
|
|
63
|
+
value: r,
|
|
64
|
+
size: i,
|
|
65
|
+
theme: s
|
|
66
|
+
}), n[4] = r, n[5] = i, n[6] = s, n[7] = g) : g = n[7];
|
|
67
|
+
let _;
|
|
68
|
+
n[8] !== h || n[9] !== g ? (_ = /* @__PURE__ */ d("div", {
|
|
69
|
+
className: h,
|
|
70
|
+
children: g
|
|
71
|
+
}), n[8] = h, n[9] = g, n[10] = _) : _ = n[10];
|
|
72
|
+
let v;
|
|
73
|
+
n[11] === c.pairingDescription ? v = n[12] : (v = /* @__PURE__ */ d("span", {
|
|
74
|
+
className: o.pairingDescription,
|
|
75
|
+
children: c.pairingDescription
|
|
76
|
+
}), n[11] = c.pairingDescription, n[12] = v);
|
|
77
|
+
let y;
|
|
78
|
+
return n[13] !== p || n[14] !== m || n[15] !== _ || n[16] !== v ? (y = /* @__PURE__ */ f("div", {
|
|
79
|
+
className: o.pairingContainer,
|
|
80
|
+
children: [
|
|
81
|
+
p,
|
|
82
|
+
m,
|
|
83
|
+
_,
|
|
84
|
+
v
|
|
85
|
+
]
|
|
86
|
+
}), n[13] = p, n[14] = m, n[15] = _, n[16] = v, n[17] = y) : y = n[17], y;
|
|
87
|
+
}, h = (e) => {
|
|
88
|
+
let t = u(3), { stage: n } = e, i;
|
|
89
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ d("div", {
|
|
90
|
+
className: o.loaderLogo,
|
|
91
|
+
children: /* @__PURE__ */ d(r, { size: 100 })
|
|
92
|
+
}), t[0] = i) : i = t[0];
|
|
93
|
+
let a;
|
|
94
|
+
return t[1] === n ? a = t[2] : (a = /* @__PURE__ */ f("div", {
|
|
95
|
+
className: o.loaderContainer,
|
|
96
|
+
children: [i, /* @__PURE__ */ d("span", {
|
|
97
|
+
className: o.loaderText,
|
|
98
|
+
children: n
|
|
99
|
+
})]
|
|
100
|
+
}), t[1] = n, t[2] = a), a;
|
|
101
|
+
}, g = (n) => {
|
|
102
|
+
let r = u(13), { message: i } = n, a = t(), c = e(), l;
|
|
103
|
+
r[0] === c.pairingError ? l = r[1] : (l = /* @__PURE__ */ d("span", {
|
|
104
|
+
className: o.errorTitle,
|
|
105
|
+
children: c.pairingError
|
|
106
|
+
}), r[0] = c.pairingError, r[1] = l);
|
|
107
|
+
let p;
|
|
108
|
+
r[2] === i ? p = r[3] : (p = /* @__PURE__ */ d("span", {
|
|
109
|
+
className: o.errorGenericText,
|
|
110
|
+
children: i
|
|
111
|
+
}), r[2] = i, r[3] = p);
|
|
112
|
+
let m;
|
|
113
|
+
r[4] === a ? m = r[5] : (m = () => a.authenticate(), r[4] = a, r[5] = m);
|
|
114
|
+
let h;
|
|
115
|
+
r[6] !== m || r[7] !== c.pairingRetry ? (h = /* @__PURE__ */ d(s, {
|
|
116
|
+
variant: "secondary",
|
|
117
|
+
type: "button",
|
|
118
|
+
onClick: m,
|
|
119
|
+
children: c.pairingRetry
|
|
120
|
+
}), r[6] = m, r[7] = c.pairingRetry, r[8] = h) : h = r[8];
|
|
121
|
+
let g;
|
|
122
|
+
return r[9] !== l || r[10] !== p || r[11] !== h ? (g = /* @__PURE__ */ f("div", {
|
|
123
|
+
className: o.errorContainer,
|
|
124
|
+
children: [
|
|
125
|
+
l,
|
|
126
|
+
p,
|
|
127
|
+
h
|
|
128
|
+
]
|
|
129
|
+
}), r[9] = l, r[10] = p, r[11] = h, r[12] = g) : g = r[12], g;
|
|
101
130
|
};
|
|
131
|
+
//#endregion
|
|
132
|
+
export { p as PairingModal };
|
|
@@ -1,122 +1,158 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
1
|
+
import { useTranslations as e } from "../providers/TranslationProvider.js";
|
|
2
|
+
import { useAuthentication as t } from "../providers/AuthProvider.js";
|
|
3
|
+
import { useAuthStatus as n } from "../hooks/authStatus.js";
|
|
4
|
+
import { LogoSmall as r } from "../ui/LogoSmall.js";
|
|
5
|
+
import { QrCode as i } from "../ui/QrCode.js";
|
|
6
|
+
import a from "./Pairing.module.css.js";
|
|
7
|
+
import { memo as o, useEffect as s } from "react";
|
|
8
|
+
import { c } from "react/compiler-runtime";
|
|
9
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
+
import * as d from "@radix-ui/react-popover";
|
|
11
|
+
import "@radix-ui/react-popper";
|
|
12
|
+
//#region src/flow/PairingPopover.tsx
|
|
13
|
+
var f = o((e) => {
|
|
14
|
+
let r = c(44), { theme: i, size: o, align: f, side: g, alignOffset: _, sizeOffset: v, children: y } = e, b = i === void 0 ? "dark" : i, x = o === void 0 ? 240 : o, S = v === void 0 ? 4 : v, C = t(), { status: w } = n(), T = typeof process < "u" && process.env?.STORYBOOK === "true", E = C.authUIMode === "popover" && (T || w.step !== "none"), D;
|
|
15
|
+
r[0] !== C || r[1] !== w.step ? (D = () => {
|
|
16
|
+
w.step === "none" && C.authenticate("popover");
|
|
17
|
+
}, r[0] = C, r[1] = w.step, r[2] = D) : D = r[2];
|
|
18
|
+
let O = D, k;
|
|
19
|
+
r[3] !== C || r[4] !== w.step ? (k = (e) => {
|
|
20
|
+
!e && w.step !== "pending" && C.abortAuthentication();
|
|
21
|
+
}, r[3] = C, r[4] = w.step, r[5] = k) : k = r[5];
|
|
22
|
+
let A = k, j;
|
|
23
|
+
r[6] === C ? j = r[7] : (j = () => () => {
|
|
24
|
+
C.abortAuthentication();
|
|
25
|
+
}, r[6] = C, r[7] = j);
|
|
26
|
+
let M;
|
|
27
|
+
r[8] === C.abortAuthentication ? M = r[9] : (M = [C.abortAuthentication], r[8] = C.abortAuthentication, r[9] = M), s(j, M);
|
|
28
|
+
let N;
|
|
29
|
+
r[10] !== y || r[11] !== O ? (N = /* @__PURE__ */ l(d.Trigger, {
|
|
30
|
+
asChild: !0,
|
|
31
|
+
onClick: O,
|
|
32
|
+
children: y
|
|
33
|
+
}), r[10] = y, r[11] = O, r[12] = N) : N = r[12];
|
|
34
|
+
let P, F;
|
|
35
|
+
r[13] === w.step ? (P = r[14], F = r[15]) : (F = (e) => {
|
|
36
|
+
w.step === "pending" && e.preventDefault();
|
|
37
|
+
}, P = (e) => {
|
|
38
|
+
w.step === "pending" && e.preventDefault();
|
|
39
|
+
}, r[13] = w.step, r[14] = P, r[15] = F);
|
|
40
|
+
let I;
|
|
41
|
+
r[16] !== x || r[17] !== w.payload || r[18] !== w.step || r[19] !== b ? (I = w.step === "pairing" && /* @__PURE__ */ l(p, {
|
|
42
|
+
theme: b,
|
|
43
|
+
size: x,
|
|
44
|
+
payload: w.payload
|
|
45
|
+
}), r[16] = x, r[17] = w.payload, r[18] = w.step, r[19] = b, r[20] = I) : I = r[20];
|
|
46
|
+
let L;
|
|
47
|
+
r[21] !== w.stage || r[22] !== w.step ? (L = w.step === "pending" && /* @__PURE__ */ l(m, { stage: w.stage }), r[21] = w.stage, r[22] = w.step, r[23] = L) : L = r[23];
|
|
48
|
+
let R;
|
|
49
|
+
r[24] !== w.message || r[25] !== w.step ? (R = w.step === "pairingError" && /* @__PURE__ */ l(h, { message: w.message }), r[24] = w.message, r[25] = w.step, r[26] = R) : R = r[26];
|
|
50
|
+
let z;
|
|
51
|
+
r[27] !== I || r[28] !== L || r[29] !== R ? (z = /* @__PURE__ */ u("div", {
|
|
52
|
+
className: a.popoverContainer,
|
|
53
|
+
children: [
|
|
54
|
+
I,
|
|
55
|
+
L,
|
|
56
|
+
R
|
|
57
|
+
]
|
|
58
|
+
}), r[27] = I, r[28] = L, r[29] = R, r[30] = z) : z = r[30];
|
|
59
|
+
let B;
|
|
60
|
+
r[31] !== f || r[32] !== _ || r[33] !== g || r[34] !== S || r[35] !== P || r[36] !== z || r[37] !== F ? (B = /* @__PURE__ */ l(d.Portal, { children: /* @__PURE__ */ l(d.Content, {
|
|
61
|
+
side: g,
|
|
62
|
+
align: f,
|
|
63
|
+
sideOffset: S,
|
|
64
|
+
alignOffset: _,
|
|
65
|
+
className: a.popoverContent,
|
|
66
|
+
onInteractOutside: F,
|
|
67
|
+
onEscapeKeyDown: P,
|
|
68
|
+
children: z
|
|
69
|
+
}) }), r[31] = f, r[32] = _, r[33] = g, r[34] = S, r[35] = P, r[36] = z, r[37] = F, r[38] = B) : B = r[38];
|
|
70
|
+
let V;
|
|
71
|
+
return r[39] !== E || r[40] !== B || r[41] !== N || r[42] !== A ? (V = /* @__PURE__ */ u(d.Root, {
|
|
72
|
+
open: E,
|
|
73
|
+
onOpenChange: A,
|
|
74
|
+
children: [N, B]
|
|
75
|
+
}), r[39] = E, r[40] = B, r[41] = N, r[42] = A, r[43] = V) : V = r[43], V;
|
|
76
|
+
}), p = (t) => {
|
|
77
|
+
let n = c(18), { payload: r, size: o, theme: s } = t, d = s === void 0 ? "light" : s, f = e(), p = d === "dark", m;
|
|
78
|
+
n[0] === f.pairingPopoverWelcome ? m = n[1] : (m = /* @__PURE__ */ l("span", {
|
|
79
|
+
className: a.pairingPopoverHeader,
|
|
80
|
+
children: f.pairingPopoverWelcome
|
|
81
|
+
}), n[0] = f.pairingPopoverWelcome, n[1] = m);
|
|
82
|
+
let h = p ? a.qrSurfaceDark : a.qrSurfaceLight, g;
|
|
83
|
+
n[2] !== r || n[3] !== o || n[4] !== d ? (g = /* @__PURE__ */ l(i, {
|
|
84
|
+
value: r,
|
|
85
|
+
size: o,
|
|
86
|
+
theme: d
|
|
87
|
+
}), n[2] = r, n[3] = o, n[4] = d, n[5] = g) : g = n[5];
|
|
88
|
+
let _;
|
|
89
|
+
n[6] !== h || n[7] !== g ? (_ = /* @__PURE__ */ l("div", {
|
|
90
|
+
className: h,
|
|
91
|
+
children: g
|
|
92
|
+
}), n[6] = h, n[7] = g, n[8] = _) : _ = n[8];
|
|
93
|
+
let v;
|
|
94
|
+
n[9] === f.pairingPopoverLoginHeading ? v = n[10] : (v = /* @__PURE__ */ l("span", {
|
|
95
|
+
className: a.scanCallToActionPopover,
|
|
96
|
+
children: f.pairingPopoverLoginHeading
|
|
97
|
+
}), n[9] = f.pairingPopoverLoginHeading, n[10] = v);
|
|
98
|
+
let y;
|
|
99
|
+
n[11] === f.pairingPopoverScanDescription ? y = n[12] : (y = /* @__PURE__ */ l("span", {
|
|
100
|
+
className: a.pairingDescriptionPopover,
|
|
101
|
+
children: f.pairingPopoverScanDescription
|
|
102
|
+
}), n[11] = f.pairingPopoverScanDescription, n[12] = y);
|
|
103
|
+
let b;
|
|
104
|
+
return n[13] !== m || n[14] !== _ || n[15] !== v || n[16] !== y ? (b = /* @__PURE__ */ u("div", {
|
|
105
|
+
className: a.pairingPopoverContainer,
|
|
106
|
+
children: [
|
|
107
|
+
m,
|
|
108
|
+
_,
|
|
109
|
+
v,
|
|
110
|
+
y
|
|
111
|
+
]
|
|
112
|
+
}), n[13] = m, n[14] = _, n[15] = v, n[16] = y, n[17] = b) : b = n[17], b;
|
|
113
|
+
}, m = (e) => {
|
|
114
|
+
let t = c(3), { stage: n } = e, i;
|
|
115
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ l("div", {
|
|
116
|
+
className: a.loaderLogo,
|
|
117
|
+
children: /* @__PURE__ */ l(r, { size: 100 })
|
|
118
|
+
}), t[0] = i) : i = t[0];
|
|
119
|
+
let o;
|
|
120
|
+
return t[1] === n ? o = t[2] : (o = /* @__PURE__ */ u("div", {
|
|
121
|
+
className: a.loaderContainerPopover,
|
|
122
|
+
children: [i, /* @__PURE__ */ l("span", {
|
|
123
|
+
className: a.loaderText,
|
|
124
|
+
children: n
|
|
125
|
+
})]
|
|
126
|
+
}), t[1] = n, t[2] = o), o;
|
|
127
|
+
}, h = (n) => {
|
|
128
|
+
let r = c(13), { message: i } = n, o = t(), s = e(), d;
|
|
129
|
+
r[0] === s.pairingError ? d = r[1] : (d = /* @__PURE__ */ l("span", {
|
|
130
|
+
className: a.errorTitlePopover,
|
|
131
|
+
children: s.pairingError
|
|
132
|
+
}), r[0] = s.pairingError, r[1] = d);
|
|
133
|
+
let f;
|
|
134
|
+
r[2] === i ? f = r[3] : (f = i && /* @__PURE__ */ l("span", {
|
|
135
|
+
className: a.errorGenericText,
|
|
136
|
+
children: i
|
|
137
|
+
}), r[2] = i, r[3] = f);
|
|
138
|
+
let p;
|
|
139
|
+
r[4] === o ? p = r[5] : (p = () => o.authenticate(), r[4] = o, r[5] = p);
|
|
140
|
+
let m;
|
|
141
|
+
r[6] !== p || r[7] !== s.pairingRetry ? (m = /* @__PURE__ */ l("button", {
|
|
142
|
+
className: a.retryButton,
|
|
143
|
+
type: "button",
|
|
144
|
+
onClick: p,
|
|
145
|
+
children: s.pairingRetry
|
|
146
|
+
}), r[6] = p, r[7] = s.pairingRetry, r[8] = m) : m = r[8];
|
|
147
|
+
let h;
|
|
148
|
+
return r[9] !== d || r[10] !== f || r[11] !== m ? (h = /* @__PURE__ */ u("div", {
|
|
149
|
+
className: a.errorContainerPopover,
|
|
150
|
+
children: [
|
|
151
|
+
d,
|
|
152
|
+
f,
|
|
153
|
+
m
|
|
154
|
+
]
|
|
155
|
+
}), r[9] = d, r[10] = f, r[11] = m, r[12] = h) : h = r[12], h;
|
|
122
156
|
};
|
|
157
|
+
//#endregion
|
|
158
|
+
export { f as PairingPopover };
|