@arcblock/did-connect-react 3.1.30 → 3.1.31

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,96 +1,98 @@
1
- import { jsx as m, jsxs as j, Fragment as Lo } from "react/jsx-runtime";
1
+ import { jsx as g, jsxs as j, Fragment as Mo } from "react/jsx-runtime";
2
2
  import S from "prop-types";
3
- import Eo from "lodash/omit";
4
- import Oo from "lodash/pick";
5
- import be from "lodash/cloneDeep";
3
+ import zo from "lodash/omit";
4
+ import Go from "lodash/pick";
5
+ import Ce from "lodash/cloneDeep";
6
6
  import J from "lodash/isFunction";
7
- import p from "lodash/isUndefined";
8
- import _o from "lodash/defaultsDeep";
9
- import Ro from "js-cookie";
10
- import Uo from "eventemitter3";
11
- import No from "p-wait-for";
12
- import { useTheme as Wo, Typography as Bo, Box as K, CircularProgress as Mo } from "@mui/material";
13
- import { getVisitorId as $, isUrl as zo, ensureVisitorId as Fo, setVisitorId as Ae } from "@arcblock/ux/lib/Util";
14
- import ce, { ToastProvider as Ce } from "@arcblock/ux/lib/Toast";
15
- import Ho from "@arcblock/ux/lib/Center";
16
- import { useReactive as ke, useCreation as ye, useMemoizedFn as f, usePrevious as Go, useLatest as Te, useUpdateEffect as ae, useMount as Vo } from "ahooks";
17
- import { joinURL as z } from "ufo";
18
- import { Icon as jo } from "@iconify/react";
19
- import Ko from "@iconify-icons/material-symbols/keyboard-double-arrow-right-rounded";
20
- import $o from "@arcblock/react-hooks/lib/useBrowser";
21
- import qo from "@arcblock/ux/lib/Dialog/use-confirm";
7
+ import w from "lodash/isUndefined";
8
+ import Vo from "lodash/defaultsDeep";
9
+ import jo from "js-cookie";
10
+ import Ko from "eventemitter3";
11
+ import $o from "p-wait-for";
12
+ import { useTheme as qo, Typography as Xo, Box as K, CircularProgress as Qo } from "@mui/material";
13
+ import { getVisitorId as $, isUrl as Yo, ensureVisitorId as Jo, setVisitorId as Te } from "@arcblock/ux/lib/Util";
14
+ import ae, { ToastProvider as ke } from "@arcblock/ux/lib/Toast";
15
+ import Zo from "@arcblock/ux/lib/Center";
16
+ import { useReactive as ye, useCreation as Ie, useMemoizedFn as f, usePrevious as ei, useLatest as Le, useUpdateEffect as le, useMount as oi } from "ahooks";
17
+ import { joinURL as H } from "ufo";
18
+ import { Icon as ii } from "@iconify/react";
19
+ import ti from "@iconify-icons/material-symbols/keyboard-double-arrow-right-rounded";
20
+ import ri from "@arcblock/react-hooks/lib/useBrowser";
21
+ import ni from "@arcblock/ux/lib/Dialog/use-confirm";
22
22
  import De from "@arcblock/ux/lib/DID";
23
- import Ie from "@arcblock/ux/lib/Avatar";
24
- import { getCurrentAppPid as Xo } from "@arcblock/ux/lib/SessionUser/libs/utils";
25
- import { translate as Qo } from "@arcblock/ux/lib/Locale/util";
26
- import { getBlockletSDK as Yo, BlockletSDK as Jo } from "@blocklet/js-sdk";
23
+ import _e from "@arcblock/ux/lib/Avatar";
24
+ import { getCurrentAppPid as si } from "@arcblock/ux/lib/SessionUser/libs/utils";
25
+ import { translate as ci } from "@arcblock/ux/lib/Locale/util";
26
+ import { getBlockletSDK as ai, BlockletSDK as li } from "@blocklet/js-sdk";
27
27
  import P from "@arcblock/bridge";
28
- import { getFederatedEnabled as Zo } from "@arcblock/ux/lib/Util/federated";
29
- import ei from "lodash/noop";
30
- import oi from "lodash/isNil";
31
- import { useState as ii } from "react";
32
- import ve from "../Storage/index.js";
33
- import { formatCacheTtl as ti, getBrowserLang as ri, debug as u, decodeUrlParams as xe, sleep as L, updateConnectedInfo as Z, getAppId as ee, logger as Le } from "../utils.js";
34
- import Ee from "./window-focus-aware.js";
35
- import { OAuthContext as ni, OAuthConsumer as si, OAuthProvider as Oe, useOAuth as ci } from "../OAuth/context.js";
36
- import { PasskeyContext as ai, PasskeyConsumer as li, PasskeyProvider as _e, usePasskey as di } from "../Passkey/context.js";
28
+ import { getFederatedEnabled as di } from "@arcblock/ux/lib/Util/federated";
29
+ import pi from "lodash/noop";
30
+ import fi from "lodash/isNil";
31
+ import { ReactGA as ui } from "@arcblock/ux/lib/withTracker";
32
+ import { useState as wi, useEffect as hi } from "react";
33
+ import Ee from "../Storage/index.js";
34
+ import { formatCacheTtl as mi, getBrowserLang as gi, debug as h, decodeUrlParams as ve, sleep as E, updateConnectedInfo as Z, getAppId as ee, logger as xe } from "../utils.js";
35
+ import Oe from "./window-focus-aware.js";
36
+ import { OAuthContext as Si, OAuthConsumer as Ai, OAuthProvider as Re, useOAuth as Pi } from "../OAuth/context.js";
37
+ import { PasskeyContext as bi, PasskeyConsumer as Ci, PasskeyProvider as Ne, usePasskey as Ti } from "../Passkey/context.js";
37
38
  import "../Passkey/actions.js";
38
- import pi, { getWalletDid as fi } from "../User/use-did.js";
39
- import ui from "../User/wrap-did.js";
40
- import wi from "./hooks/use-federated.js";
41
- import hi from "./hooks/use-session-token.js";
42
- import mi from "./hooks/use-protected-routes.js";
43
- import { SessionContext as ze } from "./context.js";
44
- import gi from "../Connect/use-connect.js";
45
- import { EVENTS as w } from "./libs/constants.js";
46
- import { translations as W } from "./libs/locales.js";
47
- import { NotOpenError as Si } from "../error.js";
48
- import { SESSION_TOKEN_STORAGE_KEY as Fe, REFRESH_TOKEN_STORAGE_KEY as He, API_DID_PREFIX as Pi, DEFAULT_TIMEOUT as bi, BLOCKLET_SERVICE_PATH_PREFIX as F, DID_SPACES_BASE_URL as Ai } from "../constant.js";
49
- import { getMobileVisitorId as Ci, checkEnableAutoLogin as ki, login as yi } from "./libs/login-mobile.js";
50
- import Ti from "../Connect/hooks/use-quick-connect.js";
51
- import { didSpacesIsRequired as Re } from "./libs/did-spaces.js";
52
- import Di from "./did-spaces-guide.js";
53
- import { FederatedProvider as Ii, useFederatedContext as vi } from "../Federated/context.js";
54
- import xi from "./hooks/use-verify.js";
55
- import { loginFederatedMaster as Rt, mountFederatedIframe as Ut } from "./libs/federated.js";
56
- const Ue = Yo(), { Provider: Li, Consumer: Ne } = ze, We = {
39
+ import ki, { getWalletDid as yi } from "../User/use-did.js";
40
+ import Ii from "../User/wrap-did.js";
41
+ import Li from "./hooks/use-federated.js";
42
+ import Di from "./hooks/use-session-token.js";
43
+ import _i from "./hooks/use-protected-routes.js";
44
+ import { SessionContext as qe } from "./context.js";
45
+ import Ei from "../Connect/use-connect.js";
46
+ import { EVENTS as c } from "./libs/constants.js";
47
+ import { translations as F } from "./libs/locales.js";
48
+ import { NotOpenError as vi } from "../error.js";
49
+ import { SESSION_TOKEN_STORAGE_KEY as Xe, REFRESH_TOKEN_STORAGE_KEY as Qe, API_DID_PREFIX as xi, DEFAULT_TIMEOUT as Oi, BLOCKLET_SERVICE_PATH_PREFIX as M, DID_SPACES_BASE_URL as Ri } from "../constant.js";
50
+ import { getMobileVisitorId as Ni, checkEnableAutoLogin as Wi, login as Fi } from "./libs/login-mobile.js";
51
+ import Bi from "../Connect/hooks/use-quick-connect.js";
52
+ import { didSpacesIsRequired as We } from "./libs/did-spaces.js";
53
+ import Ui from "./did-spaces-guide.js";
54
+ import { FederatedProvider as Hi, useFederatedContext as Mi } from "../Federated/context.js";
55
+ import zi from "./hooks/use-verify.js";
56
+ import { gaLoginSuccessHandler as Fe, gaLoginFailedHandler as Be, gaSwitchPassportSuccessHandler as Ue, gaSwitchPassportFailedHandler as He, gaBindWalletSuccessHandler as Me, gaBindWalletFailedHandler as ze } from "./handler.js";
57
+ import { loginFederatedMaster as Xt, mountFederatedIframe as Qt } from "./libs/federated.js";
58
+ const Ge = ai(), { Provider: Gi, Consumer: Ve } = qe, je = {
57
59
  en: "DID Connect timeout, please reopen DID Connect popup",
58
60
  zh: "DID Connect 超时, 请重新打开 DID Connect"
59
- }, Be = {
61
+ }, Ke = {
60
62
  en: "DID Connect is already opened, please wait for it to complete",
61
63
  zh: "DID Connect 已打开,请等待完成"
62
64
  };
63
- function Me(q = Fe, X = "ls", oe = {}, k = {}) {
64
- let v = "/";
65
- globalThis?.blocklet?.prefix && (v = globalThis.blocklet.prefix), typeof k == "boolean" && (k = {
66
- appendAuthServicePrefix: k,
65
+ function $e(q = Xe, X = "ls", oe = {}, T = {}) {
66
+ let D = "/";
67
+ globalThis?.blocklet?.prefix && (D = globalThis.blocklet.prefix), typeof T == "boolean" && (T = {
68
+ appendAuthServicePrefix: T,
67
69
  extraParams: {}
68
- }), _o(k, {
70
+ }), Vo(T, {
69
71
  rolling: !0,
70
72
  appendAuthServicePrefix: !1,
71
73
  extraParams: {},
72
- refreshTokenStorageKey: He
74
+ refreshTokenStorageKey: Qe
73
75
  });
74
- function O(D) {
76
+ function x(I) {
75
77
  if (globalThis.blocklet)
76
- if (D?.user) {
78
+ if (I?.user) {
77
79
  const r = {
78
- did: D.user.did,
80
+ did: I.user.did,
79
81
  host: window.location.host,
80
82
  appPid: globalThis.blocklet.appPid,
81
83
  visitorId: $(),
82
- sourceAppPid: D.user.sourceAppPid,
83
- fullName: D.user.fullName
84
+ sourceAppPid: I.user.sourceAppPid,
85
+ fullName: I.user.fullName
84
86
  };
85
- u("bridge callArc: onLogin", r), P.callArc("onLogin", { ...r, user: r });
87
+ h("bridge callArc: onLogin", r), P.callArc("onLogin", { ...r, user: r });
86
88
  } else
87
- P.callArc("onLogin", { error: "no user", code: 400 }), u("notifyBridge failed", { sessionState: D });
89
+ P.callArc("onLogin", { error: "no user", code: 400 }), h("notifyBridge failed", { sessionState: I });
88
90
  }
89
- const Q = ve(q, X, oe), H = ve(k.refreshTokenStorageKey, "ls");
90
- function le({ ...D }) {
91
- const r = Object.assign({}, D);
92
- p(r.serviceHost) && (r.serviceHost = v), p(r.locale) && (r.locale = ""), p(r.action) && (r.action = "login"), p(r.prefix) && (r.prefix = Pi), p(r.appendAuthServicePrefix) && (r.appendAuthServicePrefix = !1), p(r.extraParams) && (r.extraParams = {}), p(r.options) && (r.options = {}), p(r.autoConnect) && (r.autoConnect = !1), p(r.autoDisconnect) && (r.autoDisconnect = !0), p(r.useSocket) && (r.useSocket = !0), p(r.timeout) && (r.timeout = bi * 1e3), p(r.webWalletUrl) && (r.webWalletUrl = void 0), p(r.protectedRoutes) && (r.protectedRoutes = ["*"]), p(r.apiOptions) && (r.apiOptions = {}), p(r.lazyRefreshToken) && (r.lazyRefreshToken = !1);
93
- const { connectApi: y, connectHolder: ie } = gi(), [Ve, de] = ii(0), T = $o(), { requestStorageAccess: je } = vi(), { palette: Ke } = Wo(), B = new URLSearchParams(window.location.search), s = ke({
91
+ const Q = Ee(q, X, oe), z = Ee(T.refreshTokenStorageKey, "ls");
92
+ function de({ ...I }) {
93
+ const r = Object.assign({}, I);
94
+ w(r.serviceHost) && (r.serviceHost = D), w(r.locale) && (r.locale = ""), w(r.action) && (r.action = "login"), w(r.prefix) && (r.prefix = xi), w(r.appendAuthServicePrefix) && (r.appendAuthServicePrefix = !1), w(r.extraParams) && (r.extraParams = {}), w(r.options) && (r.options = {}), w(r.autoConnect) && (r.autoConnect = !1), w(r.autoDisconnect) && (r.autoDisconnect = !0), w(r.useSocket) && (r.useSocket = !0), w(r.timeout) && (r.timeout = Oi * 1e3), w(r.webWalletUrl) && (r.webWalletUrl = void 0), w(r.protectedRoutes) && (r.protectedRoutes = ["*"]), w(r.apiOptions) && (r.apiOptions = {}), w(r.lazyRefreshToken) && (r.lazyRefreshToken = !1);
95
+ const { connectApi: k, connectHolder: ie } = Ei(), [Je, pe] = wi(0), y = ri(), { requestStorageAccess: Ze } = Mi(), { palette: eo } = qo(), B = new URLSearchParams(window.location.search), s = ye({
94
96
  extraParams: {},
95
97
  options: {},
96
98
  currentLocale: r.locale,
@@ -100,13 +102,13 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
100
102
  return typeof r.autoConnect == "boolean" ? r.autoConnect : !!r.autoLogin;
101
103
  },
102
104
  get prefix() {
103
- return k.appendAuthServicePrefix || r.appendAuthServicePrefix ? z(F, r.prefix) : r.prefix;
105
+ return T.appendAuthServicePrefix || r.appendAuthServicePrefix ? H(M, r.prefix) : r.prefix;
104
106
  },
105
107
  get notificationPrefix() {
106
108
  const e = "/api/notifications";
107
- return k.appendAuthServicePrefix || r.appendAuthServicePrefix ? z(F, e) : e;
109
+ return T.appendAuthServicePrefix || r.appendAuthServicePrefix ? H(M, e) : e;
108
110
  }
109
- }), t = ke({
111
+ }), t = ye({
110
112
  action: r.action,
111
113
  error: "",
112
114
  initialized: !1,
@@ -118,54 +120,58 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
118
120
  baseUrl: "",
119
121
  unReadCount: 0
120
122
  // 不可以直接个性 props.autoConnect (readonly)
121
- }), b = ye(() => r.locale || s.currentLocale || ri(), [r.locale, s.currentLocale]), { confirmApi: $e, confirmHolder: qe } = qo(), _ = f(() => {
122
- if (t.open && !T.arcSphere) {
123
- const e = Be[b] || Be.en;
124
- throw ce.warning(e), new Error(e);
123
+ }), b = Ie(() => r.locale || s.currentLocale || gi(), [r.locale, s.currentLocale]), { confirmApi: oo, confirmHolder: io } = ni(), O = f(() => {
124
+ if (t.open && !y.arcSphere) {
125
+ const e = Ke[b] || Ke.en;
126
+ throw ae.warning(e), new Error(e);
125
127
  }
126
- }), g = ye(() => new Uo(), []), M = f((e, o, i) => {
128
+ }), d = Ie(() => new Ko(), []);
129
+ hi(() => (d.on(c.LOGIN, Fe), d.on(c.LOGIN_FAILED, Be), d.on(c.SWITCH_PASSPORT, Ue), d.on(c.SWITCH_PASSPORT_FAILED, He), d.on(c.BIND_WALLET, Me), d.on(c.BIND_WALLET_FAILED, ze), () => {
130
+ d.off(c.LOGIN, Fe), d.off(c.LOGIN_FAILED, Be), d.off(c.SWITCH_PASSPORT, Ue), d.off(c.SWITCH_PASSPORT_FAILED, He), d.off(c.BIND_WALLET, Me), d.off(c.BIND_WALLET_FAILED, ze);
131
+ }), [d]);
132
+ const U = f((e, o, i) => {
127
133
  const n = {
128
- login: [w.LOGIN, w.CANCEL_LOGIN],
129
- "bind-wallet": [w.BIND_WALLET, w.CANCEL_BIND_WALLET],
130
- "switch-passport": [w.SWITCH_PASSPORT, w.CANCEL_SWITCH_PASSPORT],
131
- "switch-profile": [w.SWITCH_PROFILE, w.CANCEL_SWITCH_PROFILE],
134
+ login: [c.LOGIN, c.CANCEL_LOGIN],
135
+ "bind-wallet": [c.BIND_WALLET, c.CANCEL_BIND_WALLET],
136
+ "switch-passport": [c.SWITCH_PASSPORT, c.CANCEL_SWITCH_PASSPORT],
137
+ "switch-profile": [c.SWITCH_PROFILE, c.CANCEL_SWITCH_PROFILE],
132
138
  // HACK: 对于内部来说,switch-did 就是 login,所以内部的监听事件仍然是 login
133
- "switch-did": [w.LOGIN, w.CANCEL_LOGIN],
139
+ "switch-did": [c.LOGIN, c.CANCEL_LOGIN],
134
140
  // @FIXME: @zhanghan 整个事件发射的机制需要重构,目前的实现不是很优雅,对于用户来说不是很好用。 https://github.com/ArcBlock/ux/pull/1414#discussion_r1904830954
135
- "did-space-connected": [w.DID_SPACE_CONNECTED]
141
+ "did-space-connected": [c.DID_SPACE_CONNECTED]
136
142
  };
137
143
  if (!Object.keys(n).includes(e))
138
144
  return;
139
- const a = async (...d) => {
140
- J(o) && await o(...d), g.emit(e, ...d);
145
+ const l = async (...u) => {
146
+ J(o) && await o(...u), d.emit(e, ...u);
141
147
  };
142
- g.once(n[e][0], a), g.once(n[e][1], async (...d) => {
143
- J(a) && g.off(n[e][0], a), J(i) && await i(...d), g.emit(`cancel-${e}`, ...d);
148
+ d.once(n[e][0], l), d.once(n[e][1], async (...u) => {
149
+ J(l) && d.off(n[e][0], l), J(i) && await i(...u), d.emit(`cancel-${e}`, ...u);
144
150
  });
145
- }), Xe = Go(t.initialized, (e, o) => e !== o || e === !0 && o === !0), {
146
- syncSessionSate: Qe,
147
- handleRefreshUser: A,
148
- handleRefreshToken: Ye,
149
- renewToken: Je,
150
- clearSession: pe,
151
- handleLoginResult: E,
152
- decrypt: x,
153
- service: Ze,
154
- getSessionToken: eo,
155
- getRefreshToken: oo,
156
- setRefreshToken: io,
157
- setSessionToken: to
158
- } = hi({
151
+ }), to = ei(t.initialized, (e, o) => e !== o || e === !0 && o === !0), {
152
+ syncSessionSate: ro,
153
+ handleRefreshUser: C,
154
+ handleRefreshToken: no,
155
+ renewToken: so,
156
+ clearSession: fe,
157
+ handleLoginResult: v,
158
+ decrypt: _,
159
+ service: co,
160
+ getSessionToken: ao,
161
+ getRefreshToken: lo,
162
+ setRefreshToken: po,
163
+ setSessionToken: fo
164
+ } = Di({
159
165
  state: t,
160
166
  pageState: s,
161
167
  sessionTokenStorage: Q,
162
- refreshTokenStorage: H,
168
+ refreshTokenStorage: z,
163
169
  serviceHost: r.serviceHost,
164
170
  apiOptions: r.apiOptions,
165
171
  lazyRefreshToken: r.lazyRefreshToken,
166
172
  onRefresh({ type: e, sessionToken: o, refreshToken: i, user: n }) {
167
- if (u("onRefresh", { type: e, user: n }), globalThis.blocklet) {
168
- const a = {
173
+ if (h("onRefresh", { type: e, user: n }), globalThis.blocklet) {
174
+ const l = {
169
175
  did: n.did,
170
176
  host: window.location.host,
171
177
  appPid: globalThis.blocklet.appPid,
@@ -173,72 +179,74 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
173
179
  sourceAppPid: n.sourceAppPid,
174
180
  fullName: n.fullName
175
181
  };
176
- e === "refreshToken" ? (u("bridge callArc: onRefreshToken"), P.callArc("onRefreshToken", {
182
+ e === "refreshToken" ? (h("bridge callArc: onRefreshToken"), P.callArc("onRefreshToken", {
177
183
  sessionToken: o,
178
184
  refreshToken: i,
179
- user: a
180
- })) : e === "refreshUser" && (u("bridge callArc: onRefreshUser"), P.callArc("onRefreshUser", {
185
+ user: l
186
+ })) : e === "refreshUser" && (h("bridge callArc: onRefreshUser"), P.callArc("onRefreshUser", {
181
187
  sessionToken: o,
182
188
  refreshToken: i,
183
- user: a
189
+ user: l
184
190
  }));
185
191
  }
186
192
  }
187
- }), ro = xi({ state: t, connectApi: y }), fe = f((e, o = {}, i = {}) => {
188
- _();
193
+ }), uo = zi({ state: t, connectApi: k }), ue = f((e, o = {}, i = {}) => {
194
+ O();
189
195
  const n = e;
190
- typeof n == "object" && (e = n.onSuccess, o = n.extraParams || {}, i = n.options || {}, i.origin = n.origin || ""), (!t.user || i.origin === "switch-did") && (i.origin === "switch-did" ? M("switch-did", e, n?.onCancel) : M("login", e, n?.onCancel), s.extraParams = o, s.options = i, t.action = "login", N());
191
- }), no = f((e, o = {}) => {
196
+ typeof n == "object" && (e = n.onSuccess, o = n.extraParams || {}, i = n.options || {}, i.origin = n.origin || ""), (!t.user || i.origin === "switch-did") && (i.origin === "switch-did" ? U("switch-did", e, n?.onCancel) : U("login", e, n?.onCancel), s.extraParams = o, s.options = i, t.action = "login", W());
197
+ }), wo = f((e, o = {}) => {
192
198
  const i = e;
193
- return function(...a) {
194
- const d = this;
199
+ return function(...l) {
200
+ const u = this;
195
201
  return (async () => {
196
202
  try {
197
- const l = await ro(o);
198
- if (!l.sessionId)
203
+ const p = await uo(o);
204
+ if (!p.sessionId)
199
205
  throw new Error("Authentication failed");
200
- return await i.call(d, l, ...a);
201
- } catch (l) {
202
- throw console.error("Authentication failed", l), l;
206
+ return await i.call(u, p, ...l);
207
+ } catch (p) {
208
+ throw console.error("Authentication failed", p), p;
203
209
  }
204
210
  })();
205
211
  };
206
212
  }), te = f(async (e, o = {}, i = {}) => {
207
- _();
213
+ O();
208
214
  const n = e;
209
- typeof n == "object" && (e = n.onSuccess, o = n.extraParams || {}, i = n.options || {}), p(o?.inviter) && window.localStorage.getItem("inviter") && (o.inviter = window.localStorage.getItem("inviter"));
210
- const { params: a } = await xe();
211
- if (p(o?.forceConnected) && a?.forceConnected && (o.forceConnected = a.forceConnected, p(i.showQuickConnect) && (i.showQuickConnect = !1)), p(o?.sourceAppPid) && !p(a?.sourceAppPid) && (o.sourceAppPid = a.sourceAppPid), o?.openMode === "redirect") {
212
- const h = o?.redirect || "/", I = new URL(`${F}/login`, window.location.origin);
213
- I.searchParams.set("redirect", h), o?.forceConnected && I.searchParams.set("forceConnected", o?.forceConnected), p(o?.sourceAppPid) || I.searchParams.set("sourceAppPid", o?.sourceAppPid), p(o?.inviter) || I.searchParams.set("inviter", o?.inviter), i?.origin && I.searchParams.set("origin", i.origin), window.location.href = I.href;
215
+ typeof n == "object" && (e = n.onSuccess, o = n.extraParams || {}, i = n.options || {}), w(o?.inviter) && window.localStorage.getItem("inviter") && (o.inviter = window.localStorage.getItem("inviter"));
216
+ const { params: l } = await ve();
217
+ if (w(o?.forceConnected) && l?.forceConnected && (o.forceConnected = l.forceConnected, w(i.showQuickConnect) && (i.showQuickConnect = !1)), w(o?.sourceAppPid) && !w(l?.sourceAppPid) && (o.sourceAppPid = l.sourceAppPid), o?.openMode === "redirect") {
218
+ const m = o?.redirect || "/", L = new URL(`${M}/login`, window.location.origin);
219
+ L.searchParams.set("redirect", m), o?.forceConnected && L.searchParams.set("forceConnected", o?.forceConnected), w(o?.sourceAppPid) || L.searchParams.set("sourceAppPid", o?.sourceAppPid), w(o?.inviter) || L.searchParams.set("inviter", o?.inviter), i?.origin && L.searchParams.set("origin", i.origin), window.location.href = L.href;
214
220
  return;
215
221
  }
216
- let d = o?.sourceAppPid;
217
- p(d) && bo && (d = Ao.appPid), await No(() => t.initialized), typeof i == "string" && (i = { origin: i });
218
- const l = be(o);
219
- l.passkeyBehavior = "both", s.allowWallet = void 0;
220
- const c = l?.openMode || r?.extraParams?.openMode;
221
- p(c) ? d ? d !== globalThis.blocklet.appPid && Zo(globalThis.blocklet) && (s.openMode = "window") : s.openMode = "popup" : s.openMode = c, s.openMode === "window" && !T.arcSphere && !T.wallet && await je() && (s.openMode = "popup"), d ? t.baseUrl = globalThis.blocklet.appUrl : t.baseUrl = "", fe(e, l, i);
222
- }), ue = f(async (e) => {
222
+ let u = o?.sourceAppPid;
223
+ w(u) && xo && (u = Oo.appPid), await $o(() => t.initialized), typeof i == "string" && (i = { origin: i });
224
+ const p = Ce(o);
225
+ p.passkeyBehavior = "both", s.allowWallet = void 0;
226
+ const a = p?.openMode || r?.extraParams?.openMode;
227
+ w(a) ? u ? u !== globalThis.blocklet.appPid && di(globalThis.blocklet) && (s.openMode = "window") : s.openMode = "popup" : s.openMode = a, s.openMode === "window" && !y.arcSphere && !y.wallet && await Ze() && (s.openMode = "popup"), u ? t.baseUrl = globalThis.blocklet.appUrl : t.baseUrl = "", ue(e, p, i);
228
+ }), we = f(async (e) => {
223
229
  const o = $();
224
- if (globalThis.blocklet && (Ue.user.logout({ visitorId: o }).catch((i) => {
230
+ if (globalThis.blocklet && (Ge.user.logout({ visitorId: o }).catch((i) => {
225
231
  console.warn("Failed to logout remote", i);
226
- }), await L(100)), globalThis.blocklet) {
232
+ }), await E(100)), globalThis.blocklet) {
227
233
  const i = {
228
234
  visitorId: o,
229
235
  appPid: globalThis.blocklet.appPid,
230
236
  userDid: t.user.did
231
237
  };
232
- u("bridge callArc: onLogout", i), P.callArc("onLogout", i);
238
+ h("bridge callArc: onLogout", i), P.callArc("onLogout", i);
233
239
  }
234
- pe(), V(), t.user = null, t.provider = "", t.walletOS = "", t.error = "", t.loading = !1, g.emit("logout"), typeof e == "function" && e();
240
+ fe(), V(), t.user = null, t.provider = "", t.walletOS = "", t.error = "", t.loading = !1, d.emit("logout"), ui.set({
241
+ user_id: void 0
242
+ }), typeof e == "function" && e();
235
243
  }), {
236
- userSessions: so,
237
- refresh: co,
238
- loaded: ao,
244
+ userSessions: ho,
245
+ refresh: mo,
246
+ loaded: go,
239
247
  loginUserSession: re
240
- } = Ti({
241
- appPid: Xo(t.user),
248
+ } = Bi({
249
+ appPid: si(t.user),
242
250
  loginAppPid: globalThis?.blocklet?.appPid,
243
251
  sourceAppPid: t?.user?.sourceAppPid,
244
252
  autoFetch: !1,
@@ -250,9 +258,9 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
250
258
  });
251
259
  });
252
260
  }), ne = f((e, o = {}, i = {}) => {
253
- _();
261
+ O();
254
262
  const n = e;
255
- typeof n == "object" && (e = n.onSuccess, o = n.extraParams || {}, i = n.options || {}), typeof i == "string" && (i = { origin: i }), i?.userSession ? re(i.userSession).then((a) => {
263
+ typeof n == "object" && (e = n.onSuccess, o = n.extraParams || {}, i = n.options || {}), typeof i == "string" && (i = { origin: i }), i?.userSession ? re(i.userSession).then((l) => {
256
264
  Z(
257
265
  {
258
266
  connected_did: i.userSession.user.did,
@@ -261,35 +269,37 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
261
269
  connected_app: ee()
262
270
  },
263
271
  !0
264
- ), M("switch-did", e), E({ ...a, encrypted: !1 }), A({ showProgress: !0 }).then(async () => {
265
- await L(200), g.emit(w.LOGIN, a, x, C.current), O(C.current), await U();
272
+ ), U("switch-did", e), v({ ...l, encrypted: !1 }), C({ showProgress: !0 }).then(async () => {
273
+ await E(200), d.emit(c.LOGIN, l, _, A.current), x(A.current), await N();
274
+ }).catch((u) => {
275
+ throw d.emit(c.LOGIN_FAILED, u), u;
266
276
  });
267
- }) : (p(o?.forceConnected) && (o.forceConnected = !1), o.passkeyBehavior = "both", te(e, o, { ...i, origin: "switch-did" }));
268
- }), lo = f(async () => {
269
- await Ue.user.refreshProfile();
270
- }), po = f(async (e, o = {}) => {
271
- await R(), _();
277
+ }) : (w(o?.forceConnected) && (o.forceConnected = !1), o.passkeyBehavior = "both", te(e, o, { ...i, origin: "switch-did" }));
278
+ }), So = f(async () => {
279
+ await Ge.user.refreshProfile();
280
+ }), Ao = f(async (e, o = {}) => {
281
+ await R(), O();
272
282
  const i = e;
273
- typeof i == "object" && (e = i.onSuccess, o = i.extraParams || {}), M("switch-profile", e, i?.onCancel), s.extraParams = o, s.options = {}, t.action = "switch-profile", N();
274
- }), fo = f(async (e, o = {}) => {
275
- await R(), _();
283
+ typeof i == "object" && (e = i.onSuccess, o = i.extraParams || {}), U("switch-profile", e, i?.onCancel), s.extraParams = o, s.options = {}, t.action = "switch-profile", W();
284
+ }), Po = f(async (e, o = {}) => {
285
+ await R(), O();
276
286
  const i = e;
277
- typeof i == "object" && (e = i.onSuccess, o = i.extraParams || {}), M("switch-passport", e, i?.onCancel), s.extraParams = o, s.options = {}, t.action = "switch-passport", N();
278
- }), uo = f(async ({ extraParams: e = {}, onSuccess: o = () => {
287
+ typeof i == "object" && (e = i.onSuccess, o = i.extraParams || {}), U("switch-passport", e, i?.onCancel), s.extraParams = o, s.options = {}, t.action = "switch-passport", W();
288
+ }), bo = f(async ({ extraParams: e = {}, onSuccess: o = () => {
279
289
  }, ...i } = {}) => {
280
- await R(), _(), s.extraParams = {
290
+ await R(), O(), s.extraParams = {
281
291
  referrer: window.location.href,
282
292
  purpose: "authorize-for-import",
283
293
  ...e,
284
294
  saveConnect: !1
285
295
  // 连接 spaces 不保存连接信息
286
- }, s.options = {}, t.action = "connect-to-did-spaces-for-user", N({
296
+ }, s.options = {}, t.action = "connect-to-did-spaces-for-user", W({
287
297
  hideCloseButton: !0,
288
298
  onSuccess: o,
289
299
  ...i
290
300
  });
291
- }), we = f(async ({ extraParams: e = {}, onSuccess: o = {} } = {}) => {
292
- await R(), uo({
301
+ }), he = f(async ({ extraParams: e = {}, onSuccess: o = {} } = {}) => {
302
+ await R(), bo({
293
303
  extraParams: {
294
304
  // service 交互
295
305
  purpose: "authorize-for-import",
@@ -298,11 +308,11 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
298
308
  onSuccess: o,
299
309
  hideCloseButton: !1
300
310
  });
301
- }), { didSpacesGuideApi: Y, DidSpacesGuideView: wo } = Di({
311
+ }), { didSpacesGuideApi: Y, DidSpacesGuideView: Co } = Ui({
302
312
  autoClose: !1
303
- }), U = async ({ extraParams: e = {}, onSuccess: o = () => {
313
+ }), N = async ({ extraParams: e = {}, onSuccess: o = () => {
304
314
  } } = {}) => {
305
- await R(), await Re(t?.user) && (Y.open(), Y.onConnect((i = ei) => {
315
+ await R(), await We(t?.user) && (Y.open(), Y.onConnect((i = pi) => {
306
316
  const n = {
307
317
  prefix: "/connect-to-did-space",
308
318
  custom: !0,
@@ -317,109 +327,117 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
317
327
  connectScope: "user",
318
328
  ...e
319
329
  },
320
- onSuccess: async (a, d) => {
321
- const l = d ? d(a.spaceGateway) : a.spaceGateway;
322
- await new Jo().user.updateDidSpace({ spaceGateway: l }), await A({ showProgress: !0 }), await o(a, d), await Y.close(), g.emit(w.DID_SPACE_CONNECTED, a, d), globalThis.blocklet && (u("bridge callArc: onDidSpaceConnected"), P.callArc("onDidSpaceConnected")), i(!0);
330
+ onSuccess: async (l, u) => {
331
+ const p = u ? u(l.spaceGateway) : l.spaceGateway;
332
+ await new li().user.updateDidSpace({ spaceGateway: p }), await C({ showProgress: !0 }), await o(l, u), await Y.close(), d.emit(c.DID_SPACE_CONNECTED, l, u), globalThis.blocklet && (h("bridge callArc: onDidSpaceConnected"), P.callArc("onDidSpaceConnected")), i(!0);
323
333
  },
324
- onError: (a) => {
325
- console.error(a), ce.error(a.message), Y.close(), i(!1);
334
+ onError: (l) => {
335
+ console.error(l), ae.error(l.message), Y.close(), i(!1);
326
336
  },
327
337
  onClose: () => {
328
338
  i();
329
339
  }
330
340
  };
331
- y.openPopup(n, {
332
- baseUrl: Ai
341
+ k.openPopup(n, {
342
+ baseUrl: Ri
333
343
  });
334
344
  }));
335
- }, he = f(async (e, o = {}) => {
336
- if (await R(), fi(t.user)) {
337
- e({}, x, C.current);
345
+ }, me = f(async (e, o = {}) => {
346
+ if (await R(), yi(t.user)) {
347
+ e({}, _, A.current);
338
348
  return;
339
349
  }
340
- _();
350
+ O();
341
351
  const i = e;
342
- typeof i == "object" && (e = i.onSuccess), M("bind-wallet", e, i?.onCancel), s.extraParams = o, s.options = {}, t.action = "bind-wallet", N();
352
+ typeof i == "object" && (e = i.onSuccess), U("bind-wallet", e, i?.onCancel), s.extraParams = o, s.options = {}, t.action = "bind-wallet", W();
343
353
  }), se = f(async (e) => {
344
- u("onSwitchPassport", { result: e }), s.extraParams = {}, s.options = {}, E(e), t.loading = !1, await A({ showProgress: !0 }), await L(200), g.emit(w.SWITCH_PASSPORT, e, x, C.current), globalThis.blocklet && (u("bridge callArc: onSwitchPassport"), P.callArc("onSwitchPassport"));
354
+ h("onSwitchPassport", { result: e }), s.extraParams = {}, s.options = {}, v(e), t.loading = !1, await C({ showProgress: !0 }), await E(200), d.emit(c.SWITCH_PASSPORT, e, _, A.current), globalThis.blocklet && (h("bridge callArc: onSwitchPassport"), P.callArc("onSwitchPassport"));
355
+ }), To = f((e) => {
356
+ d.emit(c.SWITCH_PASSPORT_FAILED, e);
345
357
  }), G = f(async (e) => {
346
358
  if (t.action === "switch-passport") {
347
359
  se(e);
348
360
  return;
349
361
  }
350
- u("onLogin", { result: e }), s.extraParams = {}, s.options = {}, E(e), t.loading = !1, await A({ showProgress: !0 }), await L(200), t.action === "login" && (u("onLogin: emit LOGIN event", { result: e }), g.emit(w.LOGIN, e, x, C.current), O(C.current), U());
351
- }), ho = f((e) => {
352
- s.extraParams = {}, s.options = {}, E(e), t.loading = !1, A({ showProgress: !0 }).then(async () => {
353
- await L(100), g.emit(w.BIND_WALLET, e, x, C.current), globalThis.blocklet && (u("bridge callArc: onBindWallet"), P.callArc("onBindWallet"));
362
+ h("onLogin", { result: e }), s.extraParams = {}, s.options = {}, v(e), t.loading = !1, await C({ showProgress: !0 }), await E(200), t.action === "login" && (h("onLogin: emit LOGIN event", { result: e }), d.emit(c.LOGIN, e, _, A.current), x(A.current), N());
363
+ }), ko = f((e) => {
364
+ d.emit(c.LOGIN_FAILED, e);
365
+ }), yo = f((e) => {
366
+ s.extraParams = {}, s.options = {}, v(e), t.loading = !1, C({ showProgress: !0 }).then(async () => {
367
+ await E(100), d.emit(c.BIND_WALLET, e, _, A.current), globalThis.blocklet && (h("bridge callArc: onBindWallet"), P.callArc("onBindWallet"));
354
368
  });
355
- }), mo = f((e) => {
356
- u("onSwitchProfile", { result: e }), s.extraParams = {}, s.options = {}, t.loading = !1, A({ showProgress: !0 }).then(async () => {
357
- await L(100), g.emit(w.SWITCH_PROFILE, e, x, C.current), globalThis.blocklet && (u("bridge callArc: onSwitchProfile"), P.callArc("onSwitchProfile"));
369
+ }), Io = f((e) => {
370
+ d.emit(c.BIND_WALLET_FAILED, e, A);
371
+ }), Lo = f((e) => {
372
+ h("onSwitchProfile", { result: e }), s.extraParams = {}, s.options = {}, t.loading = !1, C({ showProgress: !0 }).then(async () => {
373
+ await E(100), d.emit(c.SWITCH_PROFILE, e, _, A.current), globalThis.blocklet && (h("bridge callArc: onSwitchProfile"), P.callArc("onSwitchProfile"));
358
374
  });
359
- }), go = f((e) => {
375
+ }), Do = f((e) => {
360
376
  s.extraParams = {}, s.options = {}, V();
361
377
  const o = {
362
- login: w.CANCEL_LOGIN,
363
- "switch-profile": w.CANCEL_SWITCH_PROFILE,
364
- "switch-passport": w.CANCEL_SWITCH_PASSPORT,
365
- "bind-wallet": w.CANCEL_BIND_WALLET
378
+ login: c.CANCEL_LOGIN,
379
+ "switch-profile": c.CANCEL_SWITCH_PROFILE,
380
+ "switch-passport": c.CANCEL_SWITCH_PASSPORT,
381
+ "bind-wallet": c.CANCEL_BIND_WALLET
366
382
  }, i = {
367
383
  login: "offLogin",
368
384
  "switch-profile": "offSwitchProfile",
369
385
  "switch-passport": "offSwitchPassport",
370
386
  "bind-wallet": "offBindWallet"
371
387
  };
372
- g.emit(o[e]), globalThis.blocklet && (u(`bridge callArc: ${i[e]}`), P.callArc(`${i[e]}`));
373
- }), So = f((e, ...o) => {
388
+ d.emit(o[e]), globalThis.blocklet && (h(`bridge callArc: ${i[e]}`), P.callArc(`${i[e]}`));
389
+ }), _o = f((e, ...o) => {
374
390
  try {
375
- vo[e](...o);
391
+ ce[e](...o);
376
392
  } catch (i) {
377
- Le.error("Catch error in onSuccess", {
393
+ xe.error("Catch error in onSuccess", {
378
394
  action: e,
379
395
  args: o,
380
396
  err: i
381
- });
397
+ }), ce[`${e}-failed`]?.(i, ...o);
382
398
  }
399
+ }), Eo = f((e, o, ...i) => {
400
+ ce[`${e}-failed`]?.(o, ...i);
383
401
  }), {
384
- federatedMaster: Po,
385
- federatedEnabled: bo,
386
- master: Ao
387
- } = wi({
402
+ federatedMaster: vo,
403
+ federatedEnabled: xo,
404
+ master: Oo
405
+ } = Li({
388
406
  locale: b,
389
- decrypt: x,
390
- login: fe,
391
- handleLoginResult: E,
392
- handleRefreshUser: A,
393
- setRefreshToken: io,
394
- setSessionToken: to
395
- }), { checkMatch: Co } = mi({ protectedRoutes: r.protectedRoutes || [] }), ko = Te(so), me = f(async () => (ao || (await co(), await L(100)), ko.current)), V = f(() => {
396
- t.open = !1, y.close();
397
- }), N = async (e = {}) => {
407
+ decrypt: _,
408
+ login: ue,
409
+ handleLoginResult: v,
410
+ handleRefreshUser: C,
411
+ setRefreshToken: po,
412
+ setSessionToken: fo
413
+ }), { checkMatch: Ro } = _i({ protectedRoutes: r.protectedRoutes || [] }), No = Le(ho), ge = f(async () => (go || (await mo(), await E(100)), No.current)), V = f(() => {
414
+ t.open = !1, k.close();
415
+ }), W = async (e = {}) => {
398
416
  let o = t.action;
399
417
  s?.options?.origin === "switch-did" && (o = s?.options?.origin);
400
- const i = W[o], n = i[b] || i.en, a = {
401
- ...k.extraParams,
418
+ const i = F[o], n = i[b] || i.en, l = {
419
+ ...T.extraParams,
402
420
  ...r.extraParams,
403
421
  ...s.extraParams,
404
422
  previousUserDid: t?.user?.did,
405
423
  email: t?.user?.email
406
424
  };
407
- if (o === "switch-did" && a?.forceConnected) {
408
- const l = (c, h = {}) => Qo(W["switch-specified-did"], c, b, "en", h);
409
- n.title = l("title"), n.scan = l("scan", { did: a.forceConnected }), n.confirm = l("confirm"), n.success = l("success");
425
+ if (o === "switch-did" && l?.forceConnected) {
426
+ const p = (a, m = {}) => ci(F["switch-specified-did"], a, b, "en", m);
427
+ n.title = p("title"), n.scan = p("scan", { did: l.forceConnected }), n.confirm = p("confirm"), n.success = p("success");
410
428
  }
411
- delete a?.openMode;
412
- const d = {
429
+ delete l?.openMode;
430
+ const u = {
413
431
  action: t.action,
414
432
  locale: b,
415
433
  hideCloseButton: e?.hideCloseButton,
416
- extraParams: a,
434
+ extraParams: l,
417
435
  options: { ...r.options || {}, ...s.options },
418
436
  checkTimeout: r.timeout,
419
437
  webWalletUrl: r.webWalletUrl,
420
438
  messages: n,
421
439
  useSocket: r.useSocket,
422
- ...Eo(r, [
440
+ ...zo(r, [
423
441
  "action",
424
442
  "locale",
425
443
  // NOTICE: 将 serviceHost 也透传给 DID Connect 组件
@@ -438,7 +456,7 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
438
456
  "protectedRoutes"
439
457
  ]),
440
458
  // 允许 login/switchProfile/switchDid 的时候传入自定义参数
441
- ...Oo(s.extraParams || {}, [
459
+ ...Go(s.extraParams || {}, [
442
460
  "autoConnect",
443
461
  "forceConnected",
444
462
  "saveConnect",
@@ -448,43 +466,43 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
448
466
  // baseUrl: state.baseUrl || props.baseUrl || '',
449
467
  // 注意 prefix 经过了特殊处理, 优先级高于 "...rest", 所以放在其后
450
468
  prefix: s.prefix,
451
- allowWallet: p(s.allowWallet) ? t.action !== "login" || ["1", "true", void 0, null].includes(globalThis.blocklet?.DID_CONNECT_ALLOW_WALLET) : s.allowWallet,
452
- onSuccess: async (...l) => {
453
- So(t.action, ...l), J(e?.onSuccess) && await e.onSuccess(...l), t.open = !1;
469
+ allowWallet: w(s.allowWallet) ? t.action !== "login" || ["1", "true", void 0, null].includes(globalThis.blocklet?.DID_CONNECT_ALLOW_WALLET) : s.allowWallet,
470
+ onSuccess: async (...p) => {
471
+ _o(t.action, ...p), J(e?.onSuccess) && await e.onSuccess(...p), t.open = !1;
454
472
  },
455
- onClose(...l) {
456
- go(t.action, ...l);
473
+ onClose(...p) {
474
+ Do(t.action, ...p);
457
475
  },
458
- onError(l) {
459
- console.error(l);
476
+ onError(p) {
477
+ console.error(t.action, p), Eo(t.action, p, A.current);
460
478
  }
461
479
  };
462
- if (t.open = !0, ["login"].includes(t.action) && s.openMode === "window" && !(T.wallet || T.arcSphere))
480
+ if (t.open = !0, ["login"].includes(t.action) && s.openMode === "window" && !(y.wallet || y.arcSphere))
463
481
  try {
464
- const l = {
465
- ...d,
482
+ const p = {
483
+ ...u,
466
484
  baseUrl: window.location.origin
467
485
  };
468
- zo(s.prefix) || (l.prefix = z(window.location.origin, r.serviceHost, s.prefix)), l.extraParams?.provider || (l.extraParams.provider = t?.user?.provider || "wallet"), await y.openPopup(l, { locale: b });
469
- } catch (l) {
470
- l instanceof Si && V(), l.message === "Timeout" ? ce.error(We[b] || We.en) : console.error(l);
486
+ Yo(s.prefix) || (p.prefix = H(window.location.origin, r.serviceHost, s.prefix)), p.extraParams?.provider || (p.extraParams.provider = t?.user?.provider || "wallet"), await k.openPopup(p, { locale: b });
487
+ } catch (p) {
488
+ p instanceof vi && V(), p.message === "Timeout" ? ae.error(je[b] || je.en) : console.error(p);
471
489
  }
472
490
  else
473
- y.open(d);
474
- }, ge = f(async () => {
475
- const { params: e, url: o } = await xe();
491
+ k.open(u);
492
+ }, Se = f(async () => {
493
+ const { params: e, url: o } = await ve();
476
494
  if (e) {
477
- const { switchBehavior: i, forceConnected: n, sourceAppPid: a, showClose: d } = e;
495
+ const { switchBehavior: i, forceConnected: n, sourceAppPid: l, showClose: u } = e;
478
496
  n === t.user.did ? window.history.replaceState(null, "trim", o) : i === "required" ? ne(() => {
479
497
  }, {
480
498
  openMode: "redirect",
481
499
  redirect: o,
482
- sourceAppPid: a,
500
+ sourceAppPid: l,
483
501
  forceConnected: n
484
- }) : i === "disabled" ? window.history.replaceState(null, "trim", o) : $e.open({
485
- title: W.switchAccountDialog[b].title,
486
- content: /* @__PURE__ */ j(Lo, { children: [
487
- /* @__PURE__ */ m(Bo, { variant: "body1", sx: { textAlign: "center", mb: 2 }, children: W.switchAccountDialog[b].description }),
502
+ }) : i === "disabled" ? window.history.replaceState(null, "trim", o) : oo.open({
503
+ title: F.switchAccountDialog[b].title,
504
+ content: /* @__PURE__ */ j(Mo, { children: [
505
+ /* @__PURE__ */ g(Xo, { variant: "body1", sx: { textAlign: "center", mb: 2 }, children: F.switchAccountDialog[b].description }),
488
506
  /* @__PURE__ */ j(K, { sx: { display: "flex", alignItems: "center", color: "grey.A700" }, children: [
489
507
  /* @__PURE__ */ j(
490
508
  K,
@@ -497,20 +515,20 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
497
515
  lineHeight: 1
498
516
  },
499
517
  children: [
500
- /* @__PURE__ */ m(Ie, { did: t.user.did, shape: "circle", variant: "circle", size: 80 }),
501
- /* @__PURE__ */ m(De, { did: t.user.did, showAvatar: !1, compact: !0, responsive: !1 }),
502
- W.switchAccountDialog[b].currentAccount
518
+ /* @__PURE__ */ g(_e, { did: t.user.did, shape: "circle", variant: "circle", size: 80 }),
519
+ /* @__PURE__ */ g(De, { did: t.user.did, showAvatar: !1, compact: !0, responsive: !1 }),
520
+ F.switchAccountDialog[b].currentAccount
503
521
  ]
504
522
  }
505
523
  ),
506
- /* @__PURE__ */ m(K, { sx: { display: "flex", justifyContent: "center", px: 2 }, children: /* @__PURE__ */ m(
524
+ /* @__PURE__ */ g(K, { sx: { display: "flex", justifyContent: "center", px: 2 }, children: /* @__PURE__ */ g(
507
525
  K,
508
526
  {
509
- component: jo,
510
- icon: Ko,
527
+ component: ii,
528
+ icon: ti,
511
529
  sx: {
512
530
  fontSize: 24,
513
- color: Ke.grey[400],
531
+ color: eo.grey[400],
514
532
  animation: "right 2.5s linear infinite",
515
533
  "@keyframes right": {
516
534
  "0%": {
@@ -541,46 +559,48 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
541
559
  fontWeight: 500
542
560
  },
543
561
  children: [
544
- /* @__PURE__ */ m(Ie, { did: n, shape: "circle", variant: "circle", size: 80 }),
545
- /* @__PURE__ */ m(De, { did: n, showAvatar: !1, compact: !0, responsive: !1 }),
546
- W.switchAccountDialog[b].nextAccount
562
+ /* @__PURE__ */ g(_e, { did: n, shape: "circle", variant: "circle", size: 80 }),
563
+ /* @__PURE__ */ g(De, { did: n, showAvatar: !1, compact: !0, responsive: !1 }),
564
+ F.switchAccountDialog[b].nextAccount
547
565
  ]
548
566
  }
549
567
  )
550
568
  ] })
551
569
  ] }),
552
- showCloseButton: d,
570
+ showCloseButton: u,
553
571
  showCancelButton: !1,
554
- confirmButtonText: W.switchAccountDialog[b].confirm,
555
- async onConfirm(l) {
556
- const h = (await me()).find((I) => I.userDid === n);
557
- if (h) {
558
- re(h).then((I) => {
572
+ confirmButtonText: F.switchAccountDialog[b].confirm,
573
+ async onConfirm(p) {
574
+ const m = (await ge()).find((L) => L.userDid === n);
575
+ if (m) {
576
+ re(m).then((L) => {
559
577
  Z(
560
578
  {
561
- connected_did: h.user.did,
562
- connected_pk: h.user.pk,
563
- connected_wallet_os: h.extra.walletOS,
579
+ connected_did: m.user.did,
580
+ connected_pk: m.user.pk,
581
+ connected_wallet_os: m.extra.walletOS,
564
582
  connected_app: ee()
565
583
  },
566
584
  !0
567
- ), E({ ...I, encrypted: !1 }), A({ showProgress: !0 }).then(async () => {
568
- await L(200), g.emit(w.LOGIN, I, x, C.current), O(C.current), await U();
585
+ ), v({ ...L, encrypted: !1 }), C({ showProgress: !0 }).then(async () => {
586
+ await E(200), d.emit(c.LOGIN, L, _, A.current), x(A.current), await N();
587
+ }).catch((be) => {
588
+ throw d.emit(c.LOGIN_FAILED, be), be;
569
589
  });
570
- }), l();
590
+ }), p();
571
591
  return;
572
592
  }
573
593
  ne(
574
594
  () => {
575
- l(), window.location.replace(o);
595
+ p(), window.location.replace(o);
576
596
  },
577
- { sourceAppPid: a, forceConnected: n, enableSwitchApp: !1 },
597
+ { sourceAppPid: l, forceConnected: n, enableSwitchApp: !1 },
578
598
  { showQuickConnect: !0 }
579
599
  );
580
600
  }
581
601
  });
582
602
  }
583
- }), yo = f(async (e, o) => {
603
+ }), Wo = f(async (e, o) => {
584
604
  const i = Object.assign(
585
605
  {
586
606
  login: !0,
@@ -589,30 +609,30 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
589
609
  },
590
610
  o?.requirements
591
611
  ), n = o?.openMode || "popup";
592
- i.login && await R(), i.bindWallet && await new Promise((a) => {
593
- he(() => {
594
- a();
612
+ i.login && await R(), i.bindWallet && await new Promise((l) => {
613
+ me(() => {
614
+ l();
595
615
  });
596
- }), i.bindDidSpaces && (await Re(t?.user) || await new Promise((a) => {
597
- i.bindDidSpaces === "full" ? U({
616
+ }), i.bindDidSpaces && (await We(t?.user) || await new Promise((l) => {
617
+ i.bindDidSpaces === "full" ? N({
598
618
  onSuccess() {
599
- a();
619
+ l();
600
620
  }
601
- }) : i.bindDidSpaces === "read" && we({
621
+ }) : i.bindDidSpaces === "read" && he({
602
622
  onSuccess() {
603
- a();
623
+ l();
604
624
  }
605
625
  });
606
- })), n === "window" ? y.openPopup(e, o) : n === "popup" && y.open(e);
626
+ })), n === "window" ? k.openPopup(e, o) : n === "popup" && k.open(e);
607
627
  });
608
- ae(() => {
628
+ le(() => {
609
629
  const e = Number(t.unReadCount || 0);
610
- de(e);
630
+ pe(e);
611
631
  }, [t.unReadCount]);
612
- const To = f(() => {
632
+ const Fo = f(() => {
613
633
  B.get("magicToken") && B.delete("magicToken"), B.toString() && window.history.replaceState({}, "", `${window.location.pathname}?${B.toString()}`);
614
- }), Se = f((e) => new Promise((o, i) => {
615
- y.open({
634
+ }), Ae = f((e) => new Promise((o, i) => {
635
+ k.open({
616
636
  action: "login",
617
637
  locale: b,
618
638
  prefix: s.prefix,
@@ -622,77 +642,84 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
622
642
  },
623
643
  magicToken: e,
624
644
  onSuccess(...n) {
625
- G(...n), To(), o();
645
+ G(...n), Fo(), o();
626
646
  },
627
647
  onError(n) {
628
- console.error(n), i(n);
648
+ d.emit(c.LOGIN_FAILED, n), i(n);
629
649
  }
630
650
  });
631
- })), Do = {
651
+ })), Bo = {
632
652
  ...t,
633
653
  loading: s.autoConnect && !t.user || t.loading,
634
- openDidConnect: yo,
654
+ openDidConnect: Wo,
635
655
  login: te,
636
- logout: ue,
656
+ logout: we,
637
657
  switchDid: ne,
638
- autoSwitchDid: ge,
639
- refreshProfile: lo,
640
- switchProfile: po,
641
- switchPassport: fo,
642
- connectToDidSpaceForImport: we,
643
- connectToDidSpaceForFullAccess: U,
644
- bindWallet: he,
645
- refresh: A,
658
+ autoSwitchDid: Se,
659
+ refreshProfile: So,
660
+ switchProfile: Ao,
661
+ switchPassport: Po,
662
+ connectToDidSpaceForImport: he,
663
+ connectToDidSpaceForFullAccess: N,
664
+ bindWallet: me,
665
+ refresh: C,
646
666
  updateConnectedInfo: Z,
647
667
  // federated relates
648
- federatedMaster: Po,
668
+ federatedMaster: vo,
649
669
  // oauth relates
650
- useOAuth: ci,
651
- OAuthProvider: Oe,
652
- OAuthConsumer: si,
653
- OAuthContext: ni,
670
+ useOAuth: Pi,
671
+ OAuthProvider: Re,
672
+ OAuthConsumer: Ai,
673
+ OAuthContext: Si,
654
674
  // passkey relates
655
- usePasskey: di,
656
- PasskeyProvider: _e,
657
- PasskeyConsumer: li,
658
- PasskeyContext: ai,
675
+ usePasskey: Ti,
676
+ PasskeyProvider: Ne,
677
+ PasskeyConsumer: Ci,
678
+ PasskeyContext: bi,
659
679
  // user related
660
- useDid: pi,
661
- WrapDid: ui,
662
- getUserSessions: me,
680
+ useDid: ki,
681
+ WrapDid: Ii,
682
+ getUserSessions: ge,
663
683
  async loginUserSession(e) {
664
- const o = await re(e);
665
- Z(
666
- {
667
- connected_did: e.user.did,
668
- connected_pk: e.user.pk,
669
- connected_wallet_os: e.extra.walletOS,
670
- connected_app: ee()
671
- },
672
- !0
673
- ), E({ ...o, encrypted: !1 }), await A({ showProgress: !0 }), await L(200), g.emit(w.LOGIN, o, x, C.current), O(C.current), await U();
684
+ try {
685
+ const o = await re(e);
686
+ Z(
687
+ {
688
+ connected_did: e.user.did,
689
+ connected_pk: e.user.pk,
690
+ connected_wallet_os: e.extra.walletOS,
691
+ connected_app: ee()
692
+ },
693
+ !0
694
+ ), v({ ...o, encrypted: !1 }), await C({ showProgress: !0 }), await E(200), d.emit(c.LOGIN, o, _, A.current), x(A.current), await N();
695
+ } catch (o) {
696
+ throw d.emit(c.LOGIN_FAILED, o), o;
697
+ }
674
698
  },
675
- unReadCount: Ve,
676
- setUnReadCount: de,
677
- verifyMagicToken: Se,
699
+ unReadCount: Je,
700
+ setUnReadCount: pe,
701
+ verifyMagicToken: Ae,
678
702
  // 二次认证相关方法
679
- withSecondaryAuth: no
680
- }, C = Te(Do), Io = {
681
- api: Ze,
682
- events: g,
703
+ withSecondaryAuth: wo
704
+ }, A = Le(Bo), Uo = {
705
+ api: co,
706
+ events: d,
683
707
  storage: Q,
684
- connectApi: y,
685
- session: C.current
686
- }, vo = {
708
+ connectApi: k,
709
+ session: A.current
710
+ }, ce = {
687
711
  login: G,
688
- "switch-profile": mo,
712
+ "switch-profile": Lo,
689
713
  "switch-passport": se,
690
- "bind-wallet": ho
714
+ "switch-passport-failed": To,
715
+ "bind-wallet": yo,
716
+ "bind-wallet-failed": Io,
717
+ "login-failed": ko
691
718
  };
692
- ae(() => {
719
+ le(() => {
693
720
  if (t.initialized) {
694
- const e = !Xe;
695
- if (g.emit("change", { user: be(t.user), isFirst: e }), t.user && globalThis.blocklet) {
721
+ const e = !to;
722
+ if (d.emit("change", { user: Ce(t.user), isFirst: e }), t.user && globalThis.blocklet) {
696
723
  const o = {
697
724
  did: t.user.did,
698
725
  host: window.location.host,
@@ -701,7 +728,7 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
701
728
  sourceAppPid: t.user.sourceAppPid,
702
729
  fullName: t.user.fullName
703
730
  };
704
- u("bridge callArc: onChange", {
731
+ h("bridge callArc: onChange", {
705
732
  isFirst: e,
706
733
  user: o
707
734
  }), P.callArc("onChange", {
@@ -711,116 +738,119 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
711
738
  });
712
739
  }
713
740
  }
714
- }, [t.user, t.initialized, g]), ae(() => {
715
- t.initialized && t.user && ge();
716
- }, [t.initialized]), Vo(async () => {
717
- const e = (c) => {
718
- oi(c.encrypted) && (c.encrypted = !1), window.temporaryDIDConnectOnSuccess instanceof Function ? (u("bridgeOnLogin: temporaryDIDConnectOnSuccess", { result: c }), window.temporaryDIDConnectOnSuccess(c, (h) => h)) : (u("bridgeOnLogin: onLogin", { result: c }), G(c));
741
+ }, [t.user, t.initialized, d]), le(() => {
742
+ t.initialized && t.user && Se();
743
+ }, [t.initialized]), oi(async () => {
744
+ const e = (a) => {
745
+ fi(a.encrypted) && (a.encrypted = !1), window.temporaryDIDConnectOnSuccess instanceof Function ? (h("bridgeOnLogin: temporaryDIDConnectOnSuccess", { result: a }), window.temporaryDIDConnectOnSuccess(a, (m) => m)) : (h("bridgeOnLogin: onLogin", { result: a }), G(a));
719
746
  };
720
- if (P.registerBlocklet("callLoginOAuth", (c) => {
721
- u("bridge registerBlocklet: callLoginOAuth", c), y.loginOAuth({
722
- ...c,
747
+ if (P.registerBlocklet("callLoginOAuth", (a) => {
748
+ h("bridge registerBlocklet: callLoginOAuth", a), k.loginOAuth({
749
+ ...a,
723
750
  onLogin: e
724
751
  });
725
- }), P.registerBlocklet("logout", ue), P.registerBlocklet("login", (c) => {
726
- u("bridge registerBlocklet: login", c), e(c);
727
- }), Fo(), !$()) {
728
- if (T.arcSphere) {
729
- u("bridge callArc: getVisitorId");
730
- const c = await P.callArc("getVisitorId");
731
- u("bridge callArc: getVisitorId result", { walletVisitorId: c }), Ae(c);
732
- } else if (T.wallet) {
733
- const c = await Ci();
734
- Ae(c);
752
+ }), P.registerBlocklet("logout", we), P.registerBlocklet("login", (a) => {
753
+ h("bridge registerBlocklet: login", a), e(a);
754
+ }), Jo(), !$()) {
755
+ if (y.arcSphere) {
756
+ h("bridge callArc: getVisitorId");
757
+ const a = await P.callArc("getVisitorId");
758
+ h("bridge callArc: getVisitorId result", { walletVisitorId: a }), Te(a);
759
+ } else if (y.wallet) {
760
+ const a = await Ni();
761
+ Te(a);
735
762
  }
736
763
  }
737
- const i = Ro.get("connected_app"), n = ee();
764
+ const i = jo.get("connected_app"), n = ee();
738
765
  if (r.autoDisconnect && i && n && i !== n) {
739
- pe(), t.initialized = !0, s.autoConnect ? N() : V();
766
+ fe(), t.initialized = !0, s.autoConnect ? W() : V();
740
767
  return;
741
768
  }
742
- const a = eo();
769
+ const l = ao();
743
770
  if (window?.self === window?.parent) {
744
- let c = "web";
745
- if (T.mobile.apple.device ? c = "ios" : T.mobile.android.device && (c = "android"), T.wallet && ki({ version: T.walletVersion, platform: c }) && !a)
771
+ let a = "web";
772
+ if (y.mobile.apple.device ? a = "ios" : y.mobile.android.device && (a = "android"), y.wallet && Wi({ version: y.walletVersion, platform: a }) && !l)
746
773
  try {
747
774
  t.loading = !0;
748
- const h = await yi();
749
- if (h) {
775
+ const m = await Fi();
776
+ if (m) {
750
777
  await G({
751
- sessionToken: h.sessionToken,
752
- refreshToken: h.refreshToken,
753
- visitorId: h.visitorId,
778
+ sessionToken: m.sessionToken,
779
+ refreshToken: m.refreshToken,
780
+ visitorId: m.visitorId,
754
781
  encrypted: !1
755
782
  }), t.initialized = !0;
756
783
  return;
757
784
  }
785
+ } catch (m) {
786
+ throw d.emit(c.LOGIN_FAILED, m), m;
758
787
  } finally {
759
788
  t.loading = !1;
760
789
  }
761
790
  }
762
- const d = B.get("magicToken");
763
- if (d)
791
+ const u = B.get("magicToken");
792
+ if (u)
764
793
  try {
765
- t.initialized = !0, await Se(d);
766
- } catch (c) {
767
- console.error("verifyMagicToken failed", c);
794
+ t.initialized = !0, await Ae(u);
795
+ } catch (a) {
796
+ console.error("verifyMagicToken failed", a);
768
797
  }
769
- if (a) {
770
- await A({ showProgress: !0 }), t.initialized = !0, t.user && await U();
798
+ if (l) {
799
+ await C({ showProgress: !0 }), t.initialized = !0, t.user && await N();
771
800
  return;
772
801
  }
773
802
  if (typeof window < "u") {
774
- const c = new URL(window.location.href), h = c.searchParams.get("loginToken");
775
- if (h) {
776
- E({ loginToken: h, encrypted: !1 }), c.searchParams.delete("loginToken"), window.history.replaceState({}, window.title, c.href);
803
+ const a = new URL(window.location.href), m = a.searchParams.get("loginToken");
804
+ if (m) {
805
+ v({ loginToken: m, encrypted: !1 }), a.searchParams.delete("loginToken"), window.history.replaceState({}, window.title, a.href);
777
806
  return;
778
807
  }
779
808
  }
780
- if (oo()) {
781
- await Ye(!0), t.initialized = !0;
809
+ if (lo()) {
810
+ await no(!0), t.initialized = !0;
782
811
  return;
783
812
  }
784
- if (t.initialized = !0, s.autoConnect ? N() : V(), T.arcSphere && ![
813
+ if (t.initialized = !0, s.autoConnect ? W() : V(), y.arcSphere && ![
785
814
  // 不应该唤起自动登录的路由
786
- z(F, "login"),
787
- z(F, "connect"),
788
- z(F, "lost-passport")
789
- ].includes(window.location.pathname) && !a)
815
+ H(M, "login"),
816
+ H(M, "connect"),
817
+ H(M, "lost-passport")
818
+ ].includes(window.location.pathname) && !l)
790
819
  try {
791
- u("bridge callArc: autoLogin");
792
- const c = await P.callArc("autoLogin");
793
- u("bridgecallArc: autoLogin result", c), c && await G({
794
- sessionToken: c.sessionToken,
795
- refreshToken: c.refreshToken,
796
- visitorId: c.visitorId,
820
+ h("bridge callArc: autoLogin");
821
+ const a = await P.callArc("autoLogin");
822
+ h("bridgecallArc: autoLogin result", a), a && await G({
823
+ sessionToken: a.sessionToken,
824
+ refreshToken: a.refreshToken,
825
+ visitorId: a.visitorId,
797
826
  encrypted: !1
798
827
  });
799
- } catch (c) {
800
- Le.error("Failed to autoLogin ArcSphere", c);
828
+ } catch (a) {
829
+ d.emit(c.LOGIN_FAILED, a), xe.error("Failed to autoLogin ArcSphere", a);
801
830
  }
802
831
  });
803
- const xo = B.has("popup");
804
- if (Co() && !t.initialized)
805
- return /* @__PURE__ */ m(Ho, { children: xo ? null : /* @__PURE__ */ m(Mo, {}) });
832
+ const Ho = B.has("popup");
833
+ if (Ro() && !t.initialized)
834
+ return /* @__PURE__ */ g(Zo, { children: Ho ? null : /* @__PURE__ */ g(Qo, {}) });
806
835
  const Pe = {
807
836
  locale: b,
808
837
  onSwitchPassport: ({ sessionToken: e, refreshToken: o }) => se({ sessionToken: e, refreshToken: o, encrypted: !1 }),
809
- onUnbindOAuth: () => A(),
810
- onBindOAuth: () => A(),
811
- onAddPasskey: () => A(),
812
- onRemovePasskey: () => A()
838
+ onUnbindOAuth: () => C(),
839
+ onBindOAuth: () => C(),
840
+ onAddPasskey: () => C(),
841
+ onRemovePasskey: () => C(),
842
+ session: A.current
813
843
  };
814
- return /* @__PURE__ */ m(Li, { value: Io, children: /* @__PURE__ */ m(_e, { ...Pe, children: /* @__PURE__ */ j(Oe, { ...Pe, children: [
844
+ return /* @__PURE__ */ g(Gi, { value: Uo, children: /* @__PURE__ */ g(Ne, { ...Pe, children: /* @__PURE__ */ j(Re, { ...Pe, children: [
815
845
  !t.open && typeof r.children == "function" ? r.children(t) : r.children,
816
846
  ie,
817
- qe,
818
- wo,
819
- k.rolling && /* @__PURE__ */ m(Ee, { callback: () => Je() }),
820
- /* @__PURE__ */ m(Ee, { callback: Qe })
847
+ io,
848
+ Co,
849
+ T.rolling && /* @__PURE__ */ g(Oe, { callback: () => so() }),
850
+ /* @__PURE__ */ g(Oe, { callback: ro })
821
851
  ] }) }) });
822
852
  }
823
- le.propTypes = {
853
+ de.propTypes = {
824
854
  children: S.any.isRequired,
825
855
  serviceHost: S.string,
826
856
  action: S.string,
@@ -841,57 +871,57 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
841
871
  apiOptions: S.object,
842
872
  lazyRefreshToken: S.bool
843
873
  };
844
- function Ge(D) {
845
- return function(y) {
846
- return /* @__PURE__ */ m(Ce, { children: /* @__PURE__ */ m(Ne, { children: (ie) => /* @__PURE__ */ m(D, { ...y, ...ie }) }) });
874
+ function Ye(I) {
875
+ return function(k) {
876
+ return /* @__PURE__ */ g(ke, { children: /* @__PURE__ */ g(Ve, { children: (ie) => /* @__PURE__ */ g(I, { ...k, ...ie }) }) });
847
877
  };
848
878
  }
849
879
  return {
850
- SessionProvider: (D) => /* @__PURE__ */ m(Ce, { children: /* @__PURE__ */ m(Ii, { children: /* @__PURE__ */ m(le, { ...D }) }) }),
851
- SessionConsumer: Ne,
852
- SessionContext: ze,
853
- withSession: Ge
880
+ SessionProvider: (I) => /* @__PURE__ */ g(ke, { children: /* @__PURE__ */ g(Hi, { children: /* @__PURE__ */ g(de, { ...I }) }) }),
881
+ SessionConsumer: Ve,
882
+ SessionContext: qe,
883
+ withSession: Ye
854
884
  };
855
885
  }
856
- function Et({ storageEngine: q = "cookie" } = {}) {
857
- const X = Fe, oe = He;
858
- let k = null;
859
- if (typeof window < "u" && (k = (globalThis.blocklet || {}).componentId), q === "cookie") {
860
- let v = "/", O = 1;
886
+ function Kt({ storageEngine: q = "cookie" } = {}) {
887
+ const X = Xe, oe = Qe;
888
+ let T = null;
889
+ if (typeof window < "u" && (T = (globalThis.blocklet || {}).componentId), q === "cookie") {
890
+ let D = "/", x = 1;
861
891
  if (typeof window < "u") {
862
- const Q = window.env || {}, H = window.blocklet || {};
863
- v = Q.groupPathPrefix || H.groupPrefix || H.prefix || "", v = v.replace(/\/+$/, ""), v = v || "/", H.serverVersion && (O = ti(window.blocklet?.settings?.session?.cacheTtl, 1 / 24));
892
+ const Q = window.env || {}, z = window.blocklet || {};
893
+ D = Q.groupPathPrefix || z.groupPrefix || z.prefix || "", D = D.replace(/\/+$/, ""), D = D || "/", z.serverVersion && (x = mi(window.blocklet?.settings?.session?.cacheTtl, 1 / 24));
864
894
  }
865
- return Me(
895
+ return $e(
866
896
  X,
867
897
  "cookie",
868
898
  {
869
- path: v,
899
+ path: D,
870
900
  returnDomain: !1,
871
- expireInDays: O
901
+ expireInDays: x
872
902
  },
873
903
  {
874
904
  appendAuthServicePrefix: !0,
875
- extraParams: { componentId: k },
905
+ extraParams: { componentId: T },
876
906
  refreshTokenStorageKey: oe
877
907
  }
878
908
  );
879
909
  }
880
910
  if (q === "localStorage")
881
- return Me(X, "ls", {}, !0);
911
+ return $e(X, "ls", {}, !0);
882
912
  throw new Error("storageEngine must be cookie or localStorage");
883
913
  }
884
914
  export {
885
- w as EVENTS,
886
- ze as SessionContext,
887
- ki as checkEnableAutoLogin,
888
- Et as createAuthServiceSessionContext,
889
- Me as createSessionContext,
890
- Me as default,
891
- Re as didSpacesIsRequired,
892
- Ci as getMobileVisitorId,
893
- yi as login,
894
- Rt as loginFederatedMaster,
895
- Ut as mountFederatedIframe,
896
- W as translations
915
+ c as EVENTS,
916
+ qe as SessionContext,
917
+ Wi as checkEnableAutoLogin,
918
+ Kt as createAuthServiceSessionContext,
919
+ $e as createSessionContext,
920
+ $e as default,
921
+ We as didSpacesIsRequired,
922
+ Ni as getMobileVisitorId,
923
+ Fi as login,
924
+ Xt as loginFederatedMaster,
925
+ Qt as mountFederatedIframe,
926
+ F as translations
897
927
  };