@arcblock/did-connect-react 3.3.3 → 3.3.5

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,24 +1,25 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import i from "prop-types";
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import s from "prop-types";
3
3
  import o from "../assets/locale.js";
4
- import { useStateContext as s } from "../contexts/state.js";
5
- import c from "./action-button.js";
6
- function a({ onClick: t }) {
7
- const { locale: r } = s(), n = o[r] || o.en;
8
- return /* @__PURE__ */ e(
9
- c,
4
+ import { useStateContext as c } from "../contexts/state.js";
5
+ import a from "./action-button.js";
6
+ function p({ onClick: t, ...r }) {
7
+ const { locale: n } = c(), e = o[n] || o.en;
8
+ return /* @__PURE__ */ i(
9
+ a,
10
10
  {
11
11
  onClick: t,
12
12
  sx: {
13
13
  color: "text.secondary"
14
14
  },
15
- children: n.back
15
+ ...r,
16
+ children: e.back
16
17
  }
17
18
  );
18
19
  }
19
- a.propTypes = {
20
- onClick: i.func.isRequired
20
+ p.propTypes = {
21
+ onClick: s.func.isRequired
21
22
  };
22
23
  export {
23
- a as default
24
+ p as default
24
25
  };
@@ -1,157 +1,170 @@
1
- import { jsx as s, jsxs as oe } from "react/jsx-runtime";
2
- import t from "prop-types";
3
- import { Box as p } from "@mui/material";
4
- import { LOGIN_PROVIDER as r, LOGIN_PROVIDER_ICON_SIZE as h, LOGIN_PROVIDER_NAME as te } from "@arcblock/ux/lib/Util/constant";
5
- import { checkSameProtocol as ne, getWebWalletUrl as re } from "@arcblock/ux/lib/Util/wallet";
1
+ import { jsx as l, jsxs as ie } from "react/jsx-runtime";
2
+ import o from "prop-types";
3
+ import { Box as h } from "@mui/material";
4
+ import { LOGIN_PROVIDER as r, LOGIN_PROVIDER_ICON_SIZE as g, LOGIN_PROVIDER_NAME as le } from "@arcblock/ux/lib/Util/constant";
5
+ import { getWebWalletUrl as se } from "@arcblock/ux/lib/Util/wallet";
6
6
  import u from "lodash/noop";
7
- import { useMemoizedFn as g } from "ahooks";
8
- import I from "js-cookie";
9
- import { detectWalletExtension as ie, getCookieOptions as se } from "@arcblock/ux/lib/Util";
10
- import { useRef as L, useEffect as le } from "react";
11
- import { mergeSx as ce } from "@arcblock/ux/lib/Util/style";
12
- import ae from "@arcblock/ux/lib/DIDConnect/provider-icon";
13
- import { GA_LAST_LOGIN_METHOD as d } from "@arcblock/ux/lib/withTracker/constant";
14
- import { translate as me } from "@arcblock/ux/lib/Locale/util";
15
- import de from "@arcblock/ux/lib/Empty";
16
- import { useBrowser as pe } from "@arcblock/react-hooks";
17
- import he from "./mobile-login-item.js";
18
- import ue from "./web-login-item.js";
19
- import ge from "./login-method-item.js";
20
- import { useOAuth as fe } from "../../../OAuth/context.js";
21
- import { useStateContext as ye } from "../../contexts/state.js";
22
- import { getAppId as Ie, logger as Le, getApiErrorMessage as xe } from "../../../utils.js";
23
- import Ae from "./passkey-login-item.js";
24
- import { usePasskey as Ee } from "../../../Passkey/context.js";
7
+ import { useMemoizedFn as c } from "ahooks";
8
+ import E from "js-cookie";
9
+ import { getCookieOptions as ae } from "@arcblock/ux/lib/Util";
10
+ import { useRef as b, useEffect as ce } from "react";
11
+ import { mergeSx as me } from "@arcblock/ux/lib/Util/style";
12
+ import de from "@arcblock/ux/lib/DIDConnect/provider-icon";
13
+ import { GA_LAST_LOGIN_METHOD as p } from "@arcblock/ux/lib/withTracker/constant";
14
+ import { translate as pe } from "@arcblock/ux/lib/Locale/util";
15
+ import he from "@arcblock/ux/lib/Empty";
16
+ import { useBrowser as ge } from "@arcblock/react-hooks";
17
+ import ue from "./mobile-login-item.js";
18
+ import fe from "./web-login-item.js";
19
+ import ye from "./login-method-item.js";
20
+ import Le from "./wallet-login-options.js";
21
+ import { useOAuth as Ie } from "../../../OAuth/context.js";
22
+ import { useStateContext as Ce } from "../../contexts/state.js";
23
+ import { getAppId as xe, logger as Ae, getApiErrorMessage as Ee } from "../../../utils.js";
24
+ import be from "./passkey-login-item.js";
25
+ import { usePasskey as Me } from "../../../Passkey/context.js";
25
26
  import "../../../Passkey/actions.js";
26
- import Ce from "../../plugins/email/index.js";
27
+ import ve from "../../plugins/email/index.js";
27
28
  import Pe from "../../assets/locale.js";
28
- function ve({
29
- onSuccess: x = u,
30
- onError: A = u,
29
+ function _e({
30
+ onSuccess: M = u,
31
+ onError: v = u,
31
32
  size: m = "small",
32
33
  tokenState: n,
33
- webWalletUrl: E = re(),
34
- tokenKey: U,
35
- passkeyBehavior: C = "none",
34
+ webWalletUrl: P = se(),
35
+ tokenKey: _,
36
+ passkeyBehavior: w = "none",
36
37
  onReset: f = u,
37
38
  providerList: y = [],
38
- slotProps: B = {},
39
- disableSwitchApp: P = !1,
39
+ slotProps: V = {},
40
+ disableSwitchApp: L = !1,
40
41
  forceUpdate: K = u,
41
- magicToken: v = void 0,
42
- baseUrl: V = "/",
43
- customItems: q = []
42
+ magicToken: O = void 0,
43
+ baseUrl: Y = "/",
44
+ customItems: H = [],
45
+ qrcode: Z = null
44
46
  }) {
45
- const _ = L(null), M = L(null), b = L(null), w = pe(), Y = ne(E), O = ie(), { loginOAuth: H, logoutOAuth: Z, t: $, oauthState: l } = fe(), { passkeyState: R } = Ee(), { extraParams: T, locale: k, connectState: i, plugins: S, setPlugins: z, setSelectedPlugin: J, getPlugin: j } = ye(), Q = g((e, o = {}) => me(Pe, e, k, "en", o)), N = g(async (e) => {
46
- localStorage.setItem(d, e.provider), n.reset(), l.reset({
47
+ const I = b(null), C = b(null), R = b(null), x = ge(), { loginOAuth: $, logoutOAuth: J, t: Q, oauthState: s } = Ie(), { passkeyState: T } = Me(), {
48
+ extraParams: k,
49
+ locale: W,
50
+ connectState: i,
51
+ plugins: j,
52
+ setPlugins: X,
53
+ setSelectedPlugin: z,
54
+ getPlugin: N,
55
+ showWalletOptions: A,
56
+ setShowWalletOptions: D
57
+ } = Ce(), ee = c((e, t = {}) => pe(Pe, e, W, "en", t)), F = c(async (e) => {
58
+ localStorage.setItem(p, e.provider), n.reset(), s.reset({
47
59
  status: "scanned"
48
- }), R.reset(), i.chooseMethod = e.provider;
49
- const o = T?.sourceAppPid;
60
+ }), T.reset(), i.chooseMethod = e.provider;
61
+ const t = k?.sourceAppPid;
50
62
  try {
51
- l.loading = !0, l.status = "scanned";
52
- const c = await H(e, {
63
+ s.loading = !0, s.status = "scanned";
64
+ const a = await $(e, {
53
65
  action: n.action,
54
- ...T
55
- }), a = se({ returnDomain: !1 });
56
- I.remove("connected_did", a), I.remove("connected_pk", a), I.remove("connected_wallet_os", a), c?.sessionToken && (await x(
66
+ ...k
67
+ }), d = ae({ returnDomain: !1 });
68
+ E.remove("connected_did", d), E.remove("connected_pk", d), E.remove("connected_wallet_os", d), a?.sessionToken && (await M(
57
69
  {
58
- ...c,
70
+ ...a,
59
71
  encrypted: !1
60
72
  },
61
- (ee) => ee,
73
+ (re) => re,
62
74
  {
63
- sourceAppPid: o,
64
- connected_app: Ie(n.appInfo, n.memberAppInfo)
75
+ sourceAppPid: t,
76
+ connected_app: xe(n.appInfo, n.memberAppInfo)
65
77
  }
66
- ), l.loading = !1, l.status = "succeed");
67
- } catch (c) {
68
- Le.error(`Failed login OAuth: ${e.provider}`, c);
69
- const a = xe(c, $("loginOAuthFailed"));
70
- l.loading = !1, l.error = a, l.status = "error", await Z({ provider: e.provider }), A(new Error(a));
78
+ ), s.loading = !1, s.status = "succeed");
79
+ } catch (a) {
80
+ Ae.error(`Failed login OAuth: ${e.provider}`, a);
81
+ const d = Ee(a, Q("loginOAuthFailed"));
82
+ s.loading = !1, s.error = d, s.status = "error", await J({ provider: e.provider }), v(new Error(d));
71
83
  }
72
- }), D = g(async () => {
84
+ }), S = c(async () => {
73
85
  n.reset(), await f(), n.status = "created", i.chooseMethod = "wallet";
74
- }), W = y.some((e) => e.provider === r.EMAIL), F = Ce({ baseUrl: V }), X = g(() => {
75
- if (v && y.some((e) => e.name === r.EMAIL) && S.some((e) => e.name === r.EMAIL)) {
76
- const e = j(r.EMAIL);
77
- e.state.status === "idle" && (localStorage.setItem(d, "email"), e.state.reset(), e.state.magicToken = v, i.chooseMethod = r.EMAIL, J(e), K());
86
+ }), B = c(async () => {
87
+ localStorage.setItem(p, "wallet"), n.reset(), await f(), n.status = "created", i.chooseMethod = "wallet";
88
+ const e = I.current?.connect;
89
+ i.retryConnect = () => {
90
+ e(S);
91
+ };
92
+ }), oe = c(() => {
93
+ localStorage.setItem(p, "wallet"), n.status = "scanned", i.chooseMethod = "wallet-web";
94
+ const e = C.current.connect;
95
+ i.retryConnect = async () => {
96
+ await f(), n.error = "", n.status = "scanned", e();
97
+ };
98
+ }), ne = c(() => {
99
+ D(!1);
100
+ }), G = y.some((e) => e.provider === r.EMAIL), U = ve({ baseUrl: Y }), te = c(() => {
101
+ if (O && y.some((e) => e.name === r.EMAIL) && j.some((e) => e.name === r.EMAIL)) {
102
+ const e = N(r.EMAIL);
103
+ e.state.status === "idle" && (localStorage.setItem(p, "email"), e.state.reset(), e.state.magicToken = O, i.chooseMethod = r.EMAIL, z(e), K());
78
104
  }
79
105
  });
80
- le(() => {
106
+ ce(() => {
81
107
  const e = [];
82
- if (W) {
83
- const o = j(r.EMAIL);
84
- o && o.baseUrl === F.baseUrl ? e.push(o) : e.push(F);
108
+ if (G) {
109
+ const t = N(r.EMAIL);
110
+ t && t.baseUrl === U.baseUrl ? e.push(t) : e.push(U);
85
111
  }
86
- z(e), i.retryConnect = D, setTimeout(() => {
87
- X();
112
+ X(e), i.retryConnect = S, setTimeout(() => {
113
+ te();
88
114
  }, 100);
89
- }, [W]);
90
- const G = y.map((e) => {
91
- if (e.provider === r.WALLET) {
92
- if (w.mobile.any)
93
- return /* @__PURE__ */ s(
94
- he,
95
- {
96
- ref: _,
97
- tokenState: n,
98
- sx: [m === "small" ? { p: 1 } : { p: 2 }],
99
- locale: k,
100
- tokenKey: U,
101
- disableSwitchApp: P,
102
- onClick: async () => {
103
- localStorage.setItem(d, "wallet"), n.reset(), await f(), n.status = "created", i.chooseMethod = "wallet";
104
- const o = _.current?.connect;
105
- i.retryConnect = () => {
106
- o(D);
107
- };
108
- }
109
- },
110
- r.WALLET
111
- );
112
- if ((Y || O) && (!w.mobile.any || O))
113
- return /* @__PURE__ */ s(
114
- ue,
115
- {
116
- ref: M,
117
- tokenState: n,
118
- webWalletUrl: E,
119
- sx: [m === "small" ? { p: 1 } : { p: 2 }],
120
- disableSwitchApp: P,
121
- onClick: () => {
122
- localStorage.setItem(d, "wallet"), n.status = "scanned", i.chooseMethod = "wallet-web";
123
- const o = M.current.connect;
124
- i.retryConnect = async () => {
125
- await f(), n.error = "", n.status = "scanned", o();
126
- };
127
- }
128
- },
129
- r.WALLET
130
- );
131
- }
115
+ }, [G]);
116
+ const q = y.map((e) => {
117
+ if (e.provider === r.WALLET)
118
+ return x.mobile.any && !A ? /* @__PURE__ */ l(
119
+ ue,
120
+ {
121
+ ref: I,
122
+ tokenState: n,
123
+ sx: [m === "small" ? { p: 1 } : { p: 2 }],
124
+ locale: W,
125
+ tokenKey: _,
126
+ disableSwitchApp: L,
127
+ onClick: B
128
+ },
129
+ r.WALLET
130
+ ) : /* @__PURE__ */ l(
131
+ fe,
132
+ {
133
+ ref: C,
134
+ tokenState: n,
135
+ webWalletUrl: P,
136
+ sx: [m === "small" ? { p: 1 } : { p: 2 }],
137
+ disableSwitchApp: L,
138
+ autoConnect: !1,
139
+ onClick: () => {
140
+ D(!0);
141
+ }
142
+ },
143
+ r.WALLET
144
+ );
132
145
  if (e.provider === r.PASSKEY)
133
- return C === "none" ? null : /* @__PURE__ */ s(
134
- Ae,
146
+ return w === "none" ? null : /* @__PURE__ */ l(
147
+ be,
135
148
  {
136
- ref: b,
137
- onSuccess: x,
138
- onError: A,
149
+ ref: R,
150
+ onSuccess: M,
151
+ onError: v,
139
152
  tokenState: n,
140
- behavior: C,
153
+ behavior: w,
141
154
  sx: [m === "small" ? { p: 1 } : { p: 2 }],
142
155
  onClick: () => {
143
- localStorage.setItem(d, "passkey");
144
- const o = b.current.connect;
156
+ localStorage.setItem(p, "passkey");
157
+ const t = R.current.connect;
145
158
  i.chooseMethod = "passkey", i.retryConnect = () => {
146
- R.verifying = !0, i.chooseMethod = "passkey", o();
159
+ T.verifying = !0, i.chooseMethod = "passkey", t();
147
160
  };
148
161
  },
149
162
  slotProps: {
150
163
  icon: {
151
164
  sx: {
152
- fontSize: h,
165
+ fontSize: g,
153
166
  "& svg": {
154
- fontSize: h,
167
+ fontSize: g,
155
168
  width: "1em",
156
169
  height: "1em"
157
170
  }
@@ -162,32 +175,32 @@ function ve({
162
175
  r.PASSKEY
163
176
  );
164
177
  if (e.provider === r.EMAIL) {
165
- const o = S.find((c) => c.name === r.EMAIL);
166
- return o ? o?.renderListItem({
167
- key: o.name,
178
+ const t = j.find((a) => a.name === r.EMAIL);
179
+ return t ? t?.renderListItem({
180
+ key: t.name,
168
181
  sx: [m === "small" ? { p: 1 } : { p: 2 }]
169
182
  // forceUpdate,
170
183
  }) : null;
171
184
  }
172
- return e.type === "oauth" ? /* @__PURE__ */ s(
173
- ge,
185
+ return e.type === "oauth" ? /* @__PURE__ */ l(
186
+ ye,
174
187
  {
175
- title: te[e.provider],
176
- icon: /* @__PURE__ */ s(
177
- ae,
188
+ title: le[e.provider],
189
+ icon: /* @__PURE__ */ l(
190
+ de,
178
191
  {
179
192
  provider: e.provider,
180
193
  sx: {
181
194
  transform: "scale(0.95)",
182
- width: h,
183
- height: h,
195
+ width: g,
196
+ height: g,
184
197
  color: "text.primary"
185
198
  }
186
199
  }
187
200
  ),
188
201
  onClick: () => {
189
- N(e), i.retryConnect = () => {
190
- N(e);
202
+ F(e), i.retryConnect = () => {
203
+ F(e);
191
204
  };
192
205
  },
193
206
  sx: [m === "small" ? { p: 1.2 } : { p: 2 }]
@@ -195,27 +208,42 @@ function ve({
195
208
  e.provider
196
209
  ) : null;
197
210
  }).filter(Boolean);
198
- return /* @__PURE__ */ s(p, { className: "did-connect__choose", sx: ce({ flex: 1 }, B?.root?.sx), children: /* @__PURE__ */ s(
199
- p,
211
+ return /* @__PURE__ */ l(h, { className: "did-connect__choose", sx: me({ flex: 1 }, V?.root?.sx), children: /* @__PURE__ */ l(
212
+ h,
200
213
  {
201
214
  sx: {
202
215
  display: "flex",
203
216
  flexDirection: "column",
204
217
  gap: 2
205
218
  },
206
- children: /* @__PURE__ */ oe(
207
- p,
219
+ children: /* @__PURE__ */ ie(
220
+ h,
208
221
  {
209
222
  sx: [
210
223
  {
211
224
  display: "flex",
212
225
  flexDirection: "column",
213
- gap: 1.5
226
+ ...A && !x.mobile.any ? { alignItems: "center", gap: 0 } : { gap: 1.5 }
214
227
  }
215
228
  ],
216
229
  children: [
217
- /* @__PURE__ */ s(
218
- p,
230
+ A && !x.mobile.any ? /* @__PURE__ */ l(
231
+ Le,
232
+ {
233
+ qrcode: Z,
234
+ tokenState: n,
235
+ webWalletUrl: P,
236
+ size: m,
237
+ disableSwitchApp: L,
238
+ tokenKey: _,
239
+ walletLoginRef: I,
240
+ webLoginRef: C,
241
+ onMobileLoginClick: B,
242
+ onWebLoginClick: oe,
243
+ onBack: ne
244
+ }
245
+ ) : /* @__PURE__ */ l(
246
+ h,
219
247
  {
220
248
  sx: {
221
249
  display: "grid",
@@ -260,8 +288,8 @@ function ve({
260
288
  }
261
289
  }
262
290
  },
263
- children: G.length > 0 ? G : /* @__PURE__ */ s(
264
- de,
291
+ children: q.length > 0 ? q : /* @__PURE__ */ l(
292
+ he,
265
293
  {
266
294
  className: "arc-login-item",
267
295
  sx: {
@@ -269,35 +297,36 @@ function ve({
269
297
  textAlign: "center"
270
298
  }
271
299
  },
272
- children: Q("noAuthenticationProvider")
300
+ children: ee("noAuthenticationProvider")
273
301
  }
274
302
  )
275
303
  }
276
304
  ),
277
- q.map((e) => e || null)
305
+ H.map((e) => e || null)
278
306
  ]
279
307
  }
280
308
  )
281
309
  }
282
310
  ) });
283
311
  }
284
- ve.propTypes = {
285
- onSuccess: t.func,
286
- onError: t.func,
287
- size: t.oneOf(["small", "normal", "large"]),
288
- tokenState: t.object.isRequired,
289
- webWalletUrl: t.string,
290
- tokenKey: t.string.isRequired,
291
- passkeyBehavior: t.oneOf(["none", "both", "only-existing", "only-new"]),
292
- onReset: t.func,
293
- providerList: t.array,
294
- slotProps: t.object,
295
- disableSwitchApp: t.bool,
296
- forceUpdate: t.func,
297
- magicToken: t.string,
298
- baseUrl: t.string,
299
- customItems: t.arrayOf(t.node)
312
+ _e.propTypes = {
313
+ onSuccess: o.func,
314
+ onError: o.func,
315
+ size: o.oneOf(["small", "normal", "large"]),
316
+ tokenState: o.object.isRequired,
317
+ webWalletUrl: o.string,
318
+ tokenKey: o.string.isRequired,
319
+ passkeyBehavior: o.oneOf(["none", "both", "only-existing", "only-new"]),
320
+ onReset: o.func,
321
+ providerList: o.array,
322
+ slotProps: o.object,
323
+ disableSwitchApp: o.bool,
324
+ forceUpdate: o.func,
325
+ magicToken: o.string,
326
+ baseUrl: o.string,
327
+ customItems: o.arrayOf(o.node),
328
+ qrcode: o.node
300
329
  };
301
330
  export {
302
- ve as default
331
+ _e as default
303
332
  };
@@ -1,36 +1,37 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
2
  import n from "prop-types";
3
- import { CircularProgress as D } from "@mui/material";
4
- import { useReactive as E, useCreation as T, useMemoizedFn as a } from "ahooks";
5
- import W from "@arcblock/bridge";
6
- import { useBrowser as _ } from "@arcblock/react-hooks";
7
- import N from "lodash/noop";
8
- import { useImperativeHandle as q } from "react";
9
- import { mergeSx as F } from "@arcblock/ux/lib/Util/style";
10
- import M from "@arcblock/ux/lib/DIDConnect/provider-icon";
11
- import { LOGIN_PROVIDER_ICON_SIZE as p, LOGIN_PROVIDER as j } from "@arcblock/ux/lib/Util/constant";
12
- import { useStateContext as z } from "../../contexts/state.js";
13
- import G from "./login-method-item.js";
3
+ import { CircularProgress as T } from "@mui/material";
4
+ import { useReactive as E, useCreation as W, useMemoizedFn as a } from "ahooks";
5
+ import _ from "@arcblock/bridge";
6
+ import { useBrowser as N } from "@arcblock/react-hooks";
7
+ import q from "lodash/noop";
8
+ import { useImperativeHandle as F } from "react";
9
+ import { mergeSx as M } from "@arcblock/ux/lib/Util/style";
10
+ import j from "@arcblock/ux/lib/DIDConnect/provider-icon";
11
+ import { LOGIN_PROVIDER_ICON_SIZE as p, LOGIN_PROVIDER as z } from "@arcblock/ux/lib/Util/constant";
12
+ import { useStateContext as G } from "../../contexts/state.js";
13
+ import J from "./login-method-item.js";
14
14
  import { logger as b } from "../../../utils.js";
15
- import J from "../../hooks/auth-url.js";
16
- function K({
17
- ref: w = null,
15
+ import K from "../../hooks/auth-url.js";
16
+ function V({
17
+ isTablet: w = !1,
18
+ ref: C = null,
18
19
  tokenState: e,
19
- locale: C,
20
- tokenKey: P,
21
- onClick: y = N,
22
- disableSwitchApp: R = !1,
20
+ locale: P,
21
+ tokenKey: y,
22
+ onClick: R = q,
23
+ disableSwitchApp: A = !1,
23
24
  ...f
24
25
  }) {
25
26
  const l = E({
26
27
  loading: !1
27
- }), { isWalletWebview: d } = z(), A = "DID Wallet", c = _(), h = new URL(window.location.href), L = J({ disableSwitchApp: R, tokenState: e }), u = T(() => {
28
+ }), { isWalletWebview: d } = G(), L = "DID Wallet", c = N(), h = new URL(window.location.href), x = K({ disableSwitchApp: A, tokenState: e }), u = W(() => {
28
29
  if (!e.url)
29
30
  return "";
30
31
  h.searchParams.set("tokenKey", e.token);
31
- const o = new URL(L);
32
- c.wallet || (o.searchParams.set("callback", encodeURIComponent(h)), o.searchParams.set("callback_delay", 1500)), o.searchParams.set("locale", C);
33
- const g = new TextEncoder(), v = o.href.length;
32
+ const o = new URL(x);
33
+ c.wallet || (o.searchParams.set("callback", encodeURIComponent(h)), o.searchParams.set("callback_delay", 1500)), o.searchParams.set("locale", P);
34
+ const g = new TextEncoder(), D = o.href.length;
34
35
  let r = "", i = "";
35
36
  try {
36
37
  if (e.appInfo) {
@@ -41,41 +42,41 @@ function K({
41
42
  const t = g.encode(JSON.stringify(e.memberAppInfo));
42
43
  i = btoa(String.fromCharCode(...t));
43
44
  }
44
- if (v + 8 + r.length + 14 + i.length > 2e3)
45
+ if (D + 8 + r.length + 14 + i.length > 2e3)
45
46
  throw b.warn("URL too long, drop appInfo & memberAppInfo", { appInfo: r, memberAppInfo: i }), new Error("URL too long");
46
47
  i ? r && (o.searchParams.set("appInfo", r), o.searchParams.set("memberAppInfo", i)) : r && o.searchParams.set("appInfo", r);
47
48
  } catch (t) {
48
49
  b.warn("Failed to convert appInfo & memberAppInfo", t);
49
50
  }
50
51
  return o.href.replace(/^https?:\/\//, "abt://");
51
- }, [P, e.token, e.appInfo, e.memberAppInfo, e.url]), x = a(() => {
52
+ }, [y, e.token, e.appInfo, e.memberAppInfo, e.url]), O = a(() => {
52
53
  l.loading = !0, setTimeout(() => {
53
- W.call("authAction", { action: "auth", deepLink: u });
54
+ _.call("authAction", { action: "auth", deepLink: u });
54
55
  }, 600), setTimeout(() => {
55
56
  l.loading = !1;
56
57
  }, 2e3);
57
- }), O = a(() => {
58
+ }), U = a(() => {
58
59
  e.checking = !0, e.status = "scanned";
59
60
  }), s = {};
60
61
  !d && c.mobile.any && (s.component = "a", s.href = u), e.url || (s.sx = {
61
62
  cursor: "not-allowed"
62
63
  });
63
64
  const I = a((o) => {
64
- e.url && (d ? x() : c.mobile.any ? O() : o());
65
- }), U = a(() => {
66
- I(y);
65
+ e.url && (d ? O() : c.mobile.any || w ? U() : o());
66
+ }), v = a(() => {
67
+ I(R);
67
68
  });
68
- return q(w, () => ({
69
+ return F(C, () => ({
69
70
  connect: I
70
71
  })), /* @__PURE__ */ m(
71
- G,
72
+ J,
72
73
  {
73
74
  ...f,
74
75
  ...s,
75
- sx: F(f?.sx, s?.sx),
76
- title: A,
76
+ sx: M(f?.sx, s?.sx),
77
+ title: L,
77
78
  icon: l.loading || !e.url ? /* @__PURE__ */ m(
78
- D,
79
+ T,
79
80
  {
80
81
  color: "primary",
81
82
  size: p,
@@ -86,9 +87,9 @@ function K({
86
87
  }
87
88
  }
88
89
  ) : /* @__PURE__ */ m(
89
- M,
90
+ j,
90
91
  {
91
- provider: j.DID_WALLET,
92
+ provider: z.DID_WALLET,
92
93
  sx: {
93
94
  width: p,
94
95
  height: p,
@@ -97,18 +98,19 @@ function K({
97
98
  }
98
99
  ),
99
100
  iconScale: 1,
100
- onClick: U
101
+ onClick: v
101
102
  }
102
103
  );
103
104
  }
104
- K.propTypes = {
105
+ V.propTypes = {
105
106
  tokenState: n.object.isRequired,
106
107
  tokenKey: n.string.isRequired,
107
108
  locale: n.string.isRequired,
108
109
  onClick: n.func,
109
110
  disableSwitchApp: n.bool,
110
- ref: n.any
111
+ ref: n.any,
112
+ isTablet: n.bool
111
113
  };
112
114
  export {
113
- K as default
115
+ V as default
114
116
  };