@arcblock/did-connect-react 3.4.3 → 3.4.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,8 +1,8 @@
1
1
  import { jsx as l, jsxs as po } from "react/jsx-runtime";
2
2
  import n from "prop-types";
3
3
  import { Box as A } from "@mui/material";
4
- import { LOGIN_PROVIDER as e, LOGIN_PROVIDER_ICON_SIZE as E, LOGIN_PROVIDER_NAME as ho } from "@arcblock/ux/lib/Util/constant";
5
- import { checkSameProtocol as uo, getWebWalletUrl as go } from "@arcblock/ux/lib/Util/wallet";
4
+ import { LOGIN_PROVIDER as e, LOGIN_PROVIDER_ICON_SIZE as E, LOGIN_PROVIDER_NAME as uo } from "@arcblock/ux/lib/Util/constant";
5
+ import { checkSameProtocol as go, getWebWalletUrl as ho } from "@arcblock/ux/lib/Util/wallet";
6
6
  import b from "lodash/noop";
7
7
  import { useMemoizedFn as a, useCreation as fo } from "ahooks";
8
8
  import O from "js-cookie";
@@ -10,7 +10,7 @@ import { detectWalletExtension as yo, getCookieOptions as Lo } from "@arcblock/u
10
10
  import { useRef as w, useEffect as J } from "react";
11
11
  import { mergeSx as Io } from "@arcblock/ux/lib/Util/style";
12
12
  import Ao from "@arcblock/ux/lib/DIDConnect/provider-icon";
13
- import { GA_LAST_LOGIN_METHOD as f } from "@arcblock/ux/lib/withTracker/constant";
13
+ import { GA_LAST_LOGIN_METHOD as y } from "@arcblock/ux/lib/withTracker/constant";
14
14
  import { translate as Eo } from "@arcblock/ux/lib/Locale/util";
15
15
  import bo from "@arcblock/ux/lib/Empty";
16
16
  import { useBrowser as xo } from "@arcblock/react-hooks";
@@ -31,11 +31,11 @@ function No({
31
31
  onError: T = b,
32
32
  size: m = "small",
33
33
  tokenState: t,
34
- webWalletUrl: x = go(),
34
+ webWalletUrl: x = ho(),
35
35
  tokenKey: k,
36
36
  passkeyBehavior: S = "none",
37
37
  onReset: C = b,
38
- providerList: d = [],
38
+ providerList: p = [],
39
39
  slotProps: X = {},
40
40
  disableSwitchApp: P = !1,
41
41
  forceUpdate: z = b,
@@ -43,9 +43,9 @@ function No({
43
43
  baseUrl: Q = "/",
44
44
  customItems: oo = [],
45
45
  qrcode: eo = null,
46
- hideQRCode: y = !1
46
+ hideQRCode: d = !1
47
47
  }) {
48
- const M = w(null), v = w(null), j = w(null), no = uo(x), N = yo(), p = xo(), { loginOAuth: to, logoutOAuth: ro, t: io, oauthState: s } = _o(), { passkeyState: D } = So(), {
48
+ const M = w(null), v = w(null), j = w(null), no = go(x), N = yo(), u = xo(), { loginOAuth: to, logoutOAuth: ro, t: io, oauthState: s } = _o(), { passkeyState: D } = So(), {
49
49
  extraParams: F,
50
50
  locale: B,
51
51
  connectState: i,
@@ -53,11 +53,11 @@ function No({
53
53
  setPlugins: lo,
54
54
  setSelectedPlugin: so,
55
55
  getPlugin: U,
56
- showWalletOptions: g,
56
+ showWalletOptions: f,
57
57
  setShowWalletOptions: L,
58
- lastLoginMethod: h
58
+ lastLoginMethod: g
59
59
  } = Oo(), I = a((o, r = {}) => Eo(jo, o, B, "en", r)), q = a(async (o) => {
60
- localStorage.setItem(f, o.provider), t.reset(), s.reset({
60
+ localStorage.setItem(y, o.provider), t.reset(), s.reset({
61
61
  status: "scanned"
62
62
  }), D.reset(), i.chooseMethod = o.provider;
63
63
  const r = F?.sourceAppPid;
@@ -66,8 +66,8 @@ function No({
66
66
  const c = await to(o, {
67
67
  action: t.action,
68
68
  ...F
69
- }), u = Lo({ returnDomain: !1 });
70
- O.remove("connected_did", u), O.remove("connected_pk", u), O.remove("connected_wallet_os", u), c?.sessionToken && (await W(
69
+ }), h = Lo({ returnDomain: !1 });
70
+ O.remove("connected_did", h), O.remove("connected_pk", h), O.remove("connected_wallet_os", h), c?.sessionToken && (await W(
71
71
  {
72
72
  ...c,
73
73
  encrypted: !1
@@ -80,33 +80,33 @@ function No({
80
80
  ), s.loading = !1, s.status = "succeed");
81
81
  } catch (c) {
82
82
  Wo.error(`Failed login OAuth: ${o.provider}`, c);
83
- const u = To(c, io("loginOAuthFailed"));
84
- s.loading = !1, s.error = u, s.status = "error", await ro({ provider: o.provider }), T(new Error(u));
83
+ const h = To(c, io("loginOAuthFailed"));
84
+ s.loading = !1, s.error = h, s.status = "error", await ro({ provider: o.provider }), T(new Error(h));
85
85
  }
86
86
  }), K = a(async () => {
87
87
  t.reset(), await C(), t.status = "created", i.chooseMethod = "wallet";
88
88
  }), V = a(async () => {
89
- localStorage.setItem(f, e.WALLET), t.reset(), await C(), t.status = "created", i.chooseMethod = "wallet";
89
+ localStorage.setItem(y, e.WALLET), t.reset(), await C(), t.status = "created", i.chooseMethod = "wallet";
90
90
  const o = M.current?.connect;
91
91
  i.retryConnect = () => {
92
92
  o(K);
93
93
  };
94
94
  }), Y = a(() => {
95
- localStorage.setItem(f, e.WALLET), t.status = "scanned", i.chooseMethod = "wallet-web";
95
+ localStorage.setItem(y, e.WALLET), t.status = "scanned", i.chooseMethod = "wallet-web";
96
96
  const o = v.current.connect;
97
97
  i.retryConnect = async () => {
98
98
  await C(), t.error = "", t.status = "scanned", o();
99
99
  };
100
100
  }), co = a(() => {
101
101
  L(!1);
102
- }), _ = fo(() => d.length === 1 && d[0].provider === e.WALLET, [d]);
102
+ }), _ = fo(() => p.length === 1 && p[0].provider === e.WALLET, [p]);
103
103
  J(() => {
104
- _ && !p.mobile.any && !g && L(!0);
105
- }, [_, p.mobile.any, L, g]);
106
- const H = d.some((o) => o.provider === e.EMAIL), Z = Ro({ baseUrl: Q }), ao = a(() => {
107
- if (R && d.some((o) => o.name === e.EMAIL) && G.some((o) => o.name === e.EMAIL)) {
104
+ d && _ && !u.mobile.any && !f && L(!0);
105
+ }, [d, _, u.mobile.any, L, f]);
106
+ const H = p.some((o) => o.provider === e.EMAIL), Z = Ro({ baseUrl: Q }), ao = a(() => {
107
+ if (R && p.some((o) => o.name === e.EMAIL) && G.some((o) => o.name === e.EMAIL)) {
108
108
  const o = U(e.EMAIL);
109
- o.state.status === "idle" && (localStorage.setItem(f, e.EMAIL), o.state.reset(), o.state.magicToken = R, i.chooseMethod = e.EMAIL, so(o), z());
109
+ o.state.status === "idle" && (localStorage.setItem(y, e.EMAIL), o.state.reset(), o.state.magicToken = R, i.chooseMethod = e.EMAIL, so(o), z());
110
110
  }
111
111
  });
112
112
  J(() => {
@@ -119,13 +119,13 @@ function No({
119
119
  ao();
120
120
  }, 100);
121
121
  }, [H]);
122
- const $ = d.map((o) => {
122
+ const $ = p.map((o) => {
123
123
  if (o.provider === e.WALLET)
124
- return p.mobile.any && !g ? /* @__PURE__ */ l(
124
+ return u.mobile.any && !f ? /* @__PURE__ */ l(
125
125
  Co,
126
126
  {
127
127
  t: I,
128
- isLatest: h && h === e.WALLET,
128
+ isLatest: g && g === e.WALLET,
129
129
  ref: M,
130
130
  tokenState: t,
131
131
  sx: [m === "small" ? { p: 1 } : { p: 2 }],
@@ -135,19 +135,19 @@ function No({
135
135
  onClick: V
136
136
  },
137
137
  e.WALLET
138
- ) : y || !y && (no || N) && (!p.mobile.any || N) ? /* @__PURE__ */ l(
138
+ ) : d || !d && (no || N) && (!u.mobile.any || N) ? /* @__PURE__ */ l(
139
139
  Po,
140
140
  {
141
141
  t: I,
142
- isLatest: h && h === e.WALLET,
142
+ isLatest: g && g === e.WALLET,
143
143
  ref: v,
144
144
  tokenState: t,
145
145
  webWalletUrl: x,
146
146
  sx: [m === "small" ? { p: 1 } : { p: 2 }],
147
147
  disableSwitchApp: P,
148
- autoConnect: !y,
148
+ autoConnect: !d,
149
149
  onClick: () => {
150
- y ? L(!0) : Y();
150
+ d ? L(!0) : Y();
151
151
  }
152
152
  },
153
153
  e.WALLET
@@ -163,7 +163,7 @@ function No({
163
163
  behavior: S,
164
164
  sx: [m === "small" ? { p: 1 } : { p: 2 }],
165
165
  onClick: () => {
166
- localStorage.setItem(f, e.PASSKEY);
166
+ localStorage.setItem(y, e.PASSKEY);
167
167
  const r = j.current.connect;
168
168
  i.chooseMethod = "passkey", i.retryConnect = () => {
169
169
  D.verifying = !0, i.chooseMethod = "passkey", r();
@@ -196,8 +196,8 @@ function No({
196
196
  Mo,
197
197
  {
198
198
  t: I,
199
- isLatest: h && h === o.provider,
200
- title: ho[o.provider],
199
+ isLatest: g && g === o.provider,
200
+ title: uo[o.provider],
201
201
  icon: /* @__PURE__ */ l(
202
202
  Ao,
203
203
  {
@@ -235,11 +235,11 @@ function No({
235
235
  {
236
236
  display: "flex",
237
237
  flexDirection: "column",
238
- ...g && !p.mobile.any ? { alignItems: "center", gap: 0 } : { gap: 1.5 }
238
+ ...f && !u.mobile.any ? { alignItems: "center", gap: 0 } : { gap: 1.5 }
239
239
  }
240
240
  ],
241
241
  children: [
242
- g && !p.mobile.any ? /* @__PURE__ */ l(
242
+ f && !u.mobile.any ? /* @__PURE__ */ l(
243
243
  vo,
244
244
  {
245
245
  qrcode: eo,
@@ -1,10 +1,10 @@
1
1
  import { useBrowser as k } from "@arcblock/react-hooks";
2
- import { useRequest as y, useCreation as L } from "ahooks";
3
- import n from "lodash/isNil";
2
+ import { useRequest as y, useCreation as p } from "ahooks";
3
+ import i from "lodash/isNil";
4
4
  import { LOGIN_PROVIDER as s } from "@arcblock/ux/lib/Util/constant";
5
- import { getFederatedEnabled as A, getMaster as C, getBlockletData as T } from "@arcblock/ux/lib/Util/federated";
6
- import { useState as I } from "react";
7
- const S = async ({ sourceAppPid: a }) => {
5
+ import { getFederatedEnabled as C, getMaster as T, getBlockletData as I } from "@arcblock/ux/lib/Util/federated";
6
+ import { useState as S } from "react";
7
+ const B = async ({ sourceAppPid: d }) => {
8
8
  const t = globalThis?.blocklet;
9
9
  if (!t)
10
10
  return {
@@ -18,49 +18,49 @@ const S = async ({ sourceAppPid: a }) => {
18
18
  enabled: !0
19
19
  }
20
20
  };
21
- const l = A(t), e = C(t);
22
- return l && e?.appPid && a === e?.appPid ? (await T(e.appUrl))?.settings?.authentication || {} : t?.settings?.authentication || {};
23
- }, B = async ({ sourceAppPid: a } = {}) => {
24
- const t = await S({ sourceAppPid: a });
25
- return Object.entries(t).map(([e, o]) => ({ ...o, provider: e })).filter((e) => e.enabled).sort((e, o) => !n(e?.order) && !n(o?.order) ? e.order - o.order : n(e?.order) ? 1 : -1);
21
+ const a = C(t), e = T(t);
22
+ return a && e?.appPid && d === e?.appPid ? (await I(e.appUrl))?.settings?.authentication || {} : t?.settings?.authentication || {};
23
+ }, R = async ({ sourceAppPid: d } = {}) => {
24
+ const t = await B({ sourceAppPid: d });
25
+ return Object.entries(t).map(([e, o]) => ({ ...o, provider: e })).filter((e) => e.enabled).sort((e, o) => !i(e?.order) && !i(o?.order) ? e.order - o.order : i(e?.order) ? 1 : -1);
26
26
  };
27
- function Y({
28
- allowWallet: a = !0,
27
+ function j({
28
+ allowWallet: d = !0,
29
29
  passkeyBehavior: t = "none",
30
- action: l,
30
+ action: a,
31
31
  sourceAppPid: e,
32
32
  mode: o = "dialog",
33
33
  blocklet: b = globalThis.blocklet,
34
- isSmallView: p = !1,
34
+ isSmallView: L = !1,
35
35
  lastLoginMethod: u = ""
36
36
  }) {
37
- const [P, g] = I(!1), w = ["login", "invite", "connect-to-did-space", "connect-to-did-domain", "destroy-self"], c = k(), { data: h = [] } = y(
37
+ const [P, g] = S(!1), w = ["login", "invite", "connect-to-did-space", "connect-to-did-domain", "destroy-self"], E = ["login", "invite", "connect-to-did-space", "connect-to-did-domain", "destroy-self"], c = k(), { data: v = [] } = y(
38
38
  async () => {
39
39
  g(!0);
40
- const d = await B({ sourceAppPid: e });
41
- return g(!1), d;
40
+ const l = await R({ sourceAppPid: e });
41
+ return g(!1), l;
42
42
  },
43
43
  { refreshDeps: [e] }
44
- ), f = L(() => h.filter((r) => r.name === s.WALLET ? a : r.name === s.PASSKEY ? t !== "none" && !c.wallet && !c.arcSphere : r.name === s.EMAIL ? b?.settings?.notification?.email?.enabled ?? !1 : !(r.type === "oauth" && !w.includes(l))).sort((r, i) => {
44
+ ), f = p(() => v.filter((r) => r.provider === s.WALLET ? d : r.provider === s.PASSKEY ? t !== "none" && !c.wallet && !c.arcSphere : r.provider === s.EMAIL ? E.includes(a) && (b?.settings?.notification?.email?.enabled ?? !1) : !(r.type === "oauth" && !w.includes(a))).sort((r, n) => {
45
45
  if (u) {
46
- const m = r.provider === u, v = i.provider === u;
47
- if (m && !v)
46
+ const h = r.provider === u, m = n.provider === u;
47
+ if (h && !m)
48
48
  return -1;
49
- if (!m && v)
49
+ if (!h && m)
50
50
  return 1;
51
51
  }
52
- return !n(r?.order) && !n(i?.order) ? r.order - i.order : n(r?.order) ? n(i?.order) ? 0 : 1 : -1;
53
- }), [h, u]), E = L(() => {
54
- const d = o === "drawer" || p && c.mobile.any;
55
- return globalThis?.blocklet ? !!(f.find((i) => i.provider === s.WALLET)?.showQrcode !== !0 || d) : !!d;
56
- }, [o, p, f]);
52
+ return !i(r?.order) && !i(n?.order) ? r.order - n.order : i(r?.order) ? i(n?.order) ? 0 : 1 : -1;
53
+ }), [v, u]), A = p(() => {
54
+ const l = o === "drawer" || L && c.mobile.any;
55
+ return globalThis?.blocklet ? !!(f.find((n) => n.provider === s.WALLET)?.showQrcode !== !0 || l) : !!l;
56
+ }, [o, L, f]);
57
57
  return {
58
- hideChooseList: L(() => !1),
59
- hideQRCode: E,
58
+ hideChooseList: p(() => !1),
59
+ hideQRCode: A,
60
60
  providerList: f,
61
61
  loadingProviderList: P
62
62
  };
63
63
  }
64
64
  export {
65
- Y as default
65
+ j as default
66
66
  };
@@ -1,19 +1,21 @@
1
- import { jsxs as V, jsx as O } from "react/jsx-runtime";
2
- import p from "prop-types";
3
- import z from "lodash/isUndefined";
4
- import { use as J, createContext as K } from "react";
1
+ import { jsxs as z, jsx as O } from "react/jsx-runtime";
2
+ import y from "prop-types";
3
+ import J from "lodash/isUndefined";
4
+ import { use as K, createContext as W } from "react";
5
5
  import u from "@arcblock/ux/lib/Toast";
6
- import { useReactive as g, useMemoizedFn as i, useCreation as W } from "ahooks";
6
+ import { useReactive as g, useMemoizedFn as i, useCreation as q } from "ahooks";
7
7
  import w from "lodash/noop";
8
8
  import { joinURL as S } from "ufo";
9
- import { translate as q } from "@arcblock/ux/lib/Locale/util";
10
- import { BLOCKLET_SERVICE_PATH_PREFIX as G } from "@arcblock/ux/lib/Util/constant";
11
- import { getBlockletData as H, getFederatedEnabled as X, getMaster as Q } from "@arcblock/ux/lib/Util/federated";
9
+ import { translate as G } from "@arcblock/ux/lib/Locale/util";
10
+ import { BLOCKLET_SERVICE_PATH_PREFIX as H } from "@arcblock/ux/lib/Util/constant";
11
+ import { getBlockletData as X, getFederatedEnabled as $, getMaster as Q } from "@arcblock/ux/lib/Util/federated";
12
12
  import { startRegistration as Y, startAuthentication as Z } from "@simplewebauthn/browser";
13
- import { createAxios as $, getWebAuthnErrorMessage as h, logger as U, getApiErrorMessage as A } from "../utils.js";
14
- import { parseResponse as ee, PassportSwitcher as se } from "../components/PassportSwitcher.js";
15
- const F = K({}), { Provider: te, Consumer: he } = F, re = {
13
+ import { createAxios as ee, getWebAuthnErrorMessage as h, logger as U, getApiErrorMessage as A } from "../utils.js";
14
+ import { parseResponse as se, PassportSwitcher as te } from "../components/PassportSwitcher.js";
15
+ import F from "../Connect/assets/locale.js";
16
+ const E = W({}), { Provider: re, Consumer: ve } = E, ae = {
16
17
  zh: {
18
+ ...F.zh,
17
19
  cancel: "取消",
18
20
  usePasskey: "使用 Passkey",
19
21
  createPasskey: "新建 Passkey",
@@ -45,6 +47,7 @@ const F = K({}), { Provider: te, Consumer: he } = F, re = {
45
47
  }
46
48
  },
47
49
  en: {
50
+ ...F.en,
48
51
  cancel: "Cancel",
49
52
  usePasskey: "Use Existing Passkey",
50
53
  createPasskey: "Create New Passkey",
@@ -76,15 +79,15 @@ const F = K({}), { Provider: te, Consumer: he } = F, re = {
76
79
  }
77
80
  }
78
81
  };
79
- function ae({
82
+ function ne({
80
83
  children: m,
81
84
  locale: l = "en",
82
- onAddPasskey: E = w,
83
- onRemovePasskey: C = w,
84
- onSwitchPassport: I = w,
85
- session: R = null
85
+ onAddPasskey: C = w,
86
+ onRemovePasskey: I = w,
87
+ onSwitchPassport: R = w,
88
+ session: x = null
86
89
  }) {
87
- const v = S(window.env?.apiPrefix || G, "/api/passkey"), r = g({
90
+ const v = S(window.env?.apiPrefix || H, "/api/passkey"), r = g({
88
91
  baseUrl: "/",
89
92
  session: void 0,
90
93
  connecting: !1,
@@ -117,7 +120,7 @@ function ae({
117
120
  reset() {
118
121
  d.creating = !1, d.verifying = !1, d.creatingStatus = "", d.verifyingStatus = "", d.error = "";
119
122
  }
120
- }), n = i((t, e = {}) => q(re, t, l, "en", e)), c = W(() => $({ baseURL: S(r.baseUrl, v), sessionTokenKey: "__sst", timeout: 60 * 1e3 }), [r.baseUrl, v]), x = i(async () => {
123
+ }), n = i((t, e = {}) => G(ae, t, l, "en", e)), c = q(() => ee({ baseURL: S(r.baseUrl, v), sessionTokenKey: "__sst", timeout: 60 * 1e3 }), [r.baseUrl, v]), B = i(async () => {
121
124
  if (r.baseUrl === "/")
122
125
  return window.blocklet;
123
126
  try {
@@ -125,10 +128,10 @@ function ae({
125
128
  return window.blocklet;
126
129
  } catch {
127
130
  }
128
- return await H(r.baseUrl);
129
- }), P = window?.blocklet?.componentId, B = (t) => {
131
+ return await X(r.baseUrl);
132
+ }), P = window?.blocklet?.componentId, T = (t) => {
130
133
  r.baseUrl = t || "/";
131
- }, T = (t) => {
134
+ }, M = (t) => {
132
135
  r.targetAppPid = t;
133
136
  }, b = i(async (t) => {
134
137
  const { data: e } = await c.get("/register", { params: t });
@@ -158,7 +161,7 @@ function ae({
158
161
  } catch (s) {
159
162
  throw console.error("passkey.auth.error", s), s.name ? new Error(h(s, n("verifyPasskeyFailed"), n)) : s;
160
163
  }
161
- }), M = async (t) => {
164
+ }), D = async (t) => {
162
165
  r.connecting = !0;
163
166
  try {
164
167
  const e = await b({
@@ -166,13 +169,13 @@ function ae({
166
169
  locale: l,
167
170
  componentId: P
168
171
  });
169
- return u.success(n("connectPasskeySucceed")), E(e), e;
172
+ return u.success(n("connectPasskeySucceed")), C(e), e;
170
173
  } catch (e) {
171
174
  U.error("Failed to connect passkey", e), u.error(A(e, n("connectPasskeyFailed")));
172
175
  } finally {
173
176
  r.connecting = !1;
174
177
  }
175
- }, D = async ({ session: t, connectedAccount: e }) => {
178
+ }, N = async ({ session: t, connectedAccount: e }) => {
176
179
  r.session = t, r.disconnecting = !0;
177
180
  try {
178
181
  const s = await k({
@@ -182,28 +185,28 @@ function ae({
182
185
  sourceAppPid: t?.user?.sourceAppPid,
183
186
  credentialId: e.id
184
187
  });
185
- u.success(n("disconnectPasskeySucceed")), C(s);
188
+ u.success(n("disconnectPasskeySucceed")), I(s);
186
189
  } catch (s) {
187
190
  U.error("Failed to disconnect passkey", s), u.error(A(s, n("disconnectPasskeyFailed")));
188
191
  } finally {
189
192
  r.disconnecting = !1;
190
193
  }
191
- }, N = async (t = {}) => {
194
+ }, j = async (t = {}) => {
192
195
  try {
193
196
  const { data: e } = await c.get("/passports");
194
197
  e.length ? (o.open = !0, o.currentUser = t, o.passports = e || []) : u.error(n("noPassports"));
195
198
  } catch (e) {
196
199
  u.error(e.message || n("getPassportFailed"));
197
200
  }
198
- }, j = i((...t) => {
199
- o.reset(), I(...t);
200
- }), L = i(async ({ action: t = "login", ...e } = {}) => {
201
+ }, L = i((...t) => {
202
+ o.reset(), R(...t);
203
+ }), _ = i(async ({ action: t = "login", ...e } = {}) => {
201
204
  const s = r.baseUrl;
202
205
  if (e?.sourceAppPid === window.blocklet?.appPid)
203
206
  r.baseUrl = window.blocklet?.appUrl || "/";
204
207
  else if (e?.sourceAppPid) {
205
- const a = await x(), y = X(a), f = Q(a);
206
- y && f?.appPid && e?.sourceAppPid === f?.appPid && (r.baseUrl = f.appUrl);
208
+ const a = await B(), p = $(a), f = Q(a);
209
+ p && f?.appPid && e?.sourceAppPid === f?.appPid && (r.baseUrl = f.appUrl);
207
210
  }
208
211
  try {
209
212
  const a = {
@@ -212,32 +215,32 @@ function ae({
212
215
  locale: l,
213
216
  componentId: P
214
217
  };
215
- z(a.inviter) && window.localStorage.getItem("inviter") && (a.inviter = window.localStorage.getItem("inviter"));
216
- const y = ee(await k(a));
217
- return y.provider = "passkey", y;
218
+ J(a.inviter) && window.localStorage.getItem("inviter") && (a.inviter = window.localStorage.getItem("inviter"));
219
+ const p = se(await k(a));
220
+ return p.provider = "passkey", p;
218
221
  } catch (a) {
219
222
  console.error("passkey.login.error", a);
220
- const y = h(a, n("verifyPasskeyFailed"), n);
221
- throw r.baseUrl = s, new Error(y);
223
+ const p = h(a, n("verifyPasskeyFailed"), n);
224
+ throw r.baseUrl = s, new Error(p);
222
225
  }
223
- }), _ = i(() => {
226
+ }), V = i(() => {
224
227
  });
225
- return /* @__PURE__ */ V(
226
- te,
228
+ return /* @__PURE__ */ z(
229
+ re,
227
230
  {
228
231
  value: {
229
232
  api: c,
230
233
  locale: l,
231
- connectPasskey: M,
232
- disconnectPasskey: D,
234
+ connectPasskey: D,
235
+ disconnectPasskey: N,
233
236
  createPasskey: b,
234
237
  verifyPasskey: k,
235
- loginPasskey: L,
236
- logoutPasskey: _,
237
- switchPassport: N,
238
+ loginPasskey: _,
239
+ logoutPasskey: V,
240
+ switchPassport: j,
238
241
  baseUrl: r.baseUrl,
239
- setBaseUrl: B,
240
- setTargetAppPid: T,
242
+ setBaseUrl: T,
243
+ setTargetAppPid: M,
241
244
  passkeyState: d,
242
245
  disconnecting: r.disconnecting,
243
246
  connecting: r.connecting,
@@ -246,33 +249,33 @@ function ae({
246
249
  children: [
247
250
  m,
248
251
  /* @__PURE__ */ O(
249
- se,
252
+ te,
250
253
  {
251
254
  api: c,
252
255
  locale: l,
253
256
  switchState: o,
254
- onSwitchPassport: j,
255
- session: R
257
+ onSwitchPassport: L,
258
+ session: x
256
259
  }
257
260
  )
258
261
  ]
259
262
  }
260
263
  );
261
264
  }
262
- function me() {
263
- return J(F);
265
+ function be() {
266
+ return K(E);
264
267
  }
265
- ae.propTypes = {
266
- children: p.node.isRequired,
267
- locale: p.string,
268
- onAddPasskey: p.func,
269
- onRemovePasskey: p.func,
270
- onSwitchPassport: p.func,
271
- session: p.object
268
+ ne.propTypes = {
269
+ children: y.node.isRequired,
270
+ locale: y.string,
271
+ onAddPasskey: y.func,
272
+ onRemovePasskey: y.func,
273
+ onSwitchPassport: y.func,
274
+ session: y.object
272
275
  };
273
276
  export {
274
- he as PasskeyConsumer,
275
- F as PasskeyContext,
276
- ae as PasskeyProvider,
277
- me as usePasskey
277
+ ve as PasskeyConsumer,
278
+ E as PasskeyContext,
279
+ ne as PasskeyProvider,
280
+ be as usePasskey
278
281
  };