@arcblock/did-connect-react 3.3.9 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1,41 +1,41 @@
1
1
  import { default as t, default as r, default as s } from "./Connect/index.js";
2
2
  import { default as n, default as d } from "./Button/index.js";
3
3
  import { default as f, default as p } from "@arcblock/ux/lib/DIDLogo";
4
- import { createSessionContext as _, createAuthServiceSessionContext as m, createSessionContext as x } from "./Session/index.js";
4
+ import { createSessionContext as _, createAuthServiceSessionContext as x, createSessionContext as m } from "./Session/index.js";
5
5
  import { OAuthConsumer as C, OAuthContext as T, OAuthProvider as i, useOAuth as I } from "./OAuth/context.js";
6
- import { PasskeyConsumer as S, PasskeyContext as c, PasskeyProvider as O, usePasskey as D } from "./Passkey/context.js";
6
+ import { PasskeyConsumer as S, PasskeyContext as c, PasskeyProvider as O, usePasskey as g } from "./Passkey/context.js";
7
7
  import { default as R } from "./Passkey/actions.js";
8
8
  import { default as N } from "./User/use-did.js";
9
9
  import { default as F } from "./User/wrap-did.js";
10
10
  import { FederatedConsumer as K, FederatedContext as M, FederatedProvider as y, useFederatedContext as h } from "./Federated/context.js";
11
- import { API_DID_PREFIX as V, BLOCKLET_SERVICE_PATH_PREFIX as v, BUSY_STATUS as b, CHECK_INTERVAL_TIME as B, CHECK_STATUS_INTERVAL as W, CSRF_TOKEN_STORAGE_KEY as Y, DEFAULT_NAME as G, DEFAULT_TIMEOUT as H, DEFAULT_WINDOW_TIMEOUT as X, DID_CONNECT_URL_PARAMS_NAME as w, DID_SPACES_BASE_URL as q, EXT_DOWNLOAD_URL as j, LANG_COOKIE_NAME as z, REFRESH_TOKEN_STORAGE_KEY as J, RELAY_SOCKET_PREFIX as Q, SESSION_TOKEN_STORAGE_KEY as Z, VERIFY_CODE_LENGTH as $ } from "./constant.js";
12
- import { createAxios as oe, debug as te, debugTmp as re, debugTmpInterval as se, decodeConnectUrl as ae, decodeKey as ne, decodeUrlParams as de, decrypt as Ee, encodeConnectUrl as fe, encodeKey as pe, encrypt as ue, formatCacheTtl as _e, getApiErrorMessage as me, getAppId as xe, getBrowserLang as Ae, getConnectedInfo as Ce, getWebAuthnErrorMessage as Te, logger as ie, openPopup as Ie, parseNextWorkflow as le, parseTokenFromConnectUrl as Se, runPopup as ce, sleep as Oe, updateConnectedInfo as De, version as ge } from "./utils.js";
13
- import { NotOpenError as Le } from "./error.js";
14
- import { default as Pe } from "@arcblock/ux/lib/SessionManager";
15
- import { default as Ue } from "@arcblock/ux/lib/Address";
16
- import { default as Me } from "@arcblock/ux/lib/Avatar";
17
- import { default as he } from "./Connect/use-connect.js";
18
- import { EVENTS as Ve } from "./Session/libs/constants.js";
19
- import { didSpacesIsRequired as be } from "./Session/libs/did-spaces.js";
11
+ import { API_DID_PREFIX as V, BLOCKLET_SERVICE_PATH_PREFIX as v, BUSY_STATUS as b, CHECK_INTERVAL_TIME as B, CHECK_STATUS_INTERVAL as H, CSRF_TOKEN_STORAGE_KEY as W, DEFAULT_NAME as Y, DEFAULT_TIMEOUT as G, DEFAULT_WINDOW_TIMEOUT as X, DID_CONNECT_URL_PARAMS_NAME as w, DID_SPACES_BASE_URL as q, EXT_DOWNLOAD_URL as j, LANG_COOKIE_NAME as z, REFRESH_TOKEN_STORAGE_KEY as J, RELAY_SOCKET_PREFIX as Q, SESSION_TOKEN_STORAGE_KEY as Z, VERIFY_CODE_LENGTH as $ } from "./constant.js";
12
+ import { createAxios as oe, debug as te, debugTmp as re, debugTmpInterval as se, decodeConnectUrl as ae, decodeKey as ne, decodeUrlParams as de, decrypt as Ee, encodeConnectUrl as fe, encodeKey as pe, encrypt as ue, formatCacheTtl as _e, getApiErrorMessage as xe, getAppId as me, getBrowserLang as Ae, getConnectedInfo as Ce, getExtraHeaders as Te, getWebAuthnErrorMessage as ie, logger as Ie, openPopup as le, parseNextWorkflow as Se, parseTokenFromConnectUrl as ce, runPopup as Oe, sleep as ge, updateConnectedInfo as De, version as Re } from "./utils.js";
13
+ import { NotOpenError as Ne } from "./error.js";
14
+ import { default as Fe } from "@arcblock/ux/lib/SessionManager";
15
+ import { default as Ke } from "@arcblock/ux/lib/Address";
16
+ import { default as ye } from "@arcblock/ux/lib/Avatar";
17
+ import { default as ke } from "./Connect/use-connect.js";
18
+ import { EVENTS as ve } from "./Session/libs/constants.js";
19
+ import { didSpacesIsRequired as Be } from "./Session/libs/did-spaces.js";
20
20
  import { loginFederatedMaster as We, mountFederatedIframe as Ye } from "./Session/libs/federated.js";
21
- import { translations as He } from "./Session/libs/locales.js";
22
- import { checkEnableAutoLogin as we, getMobileVisitorId as qe, login as je } from "./Session/libs/login-mobile.js";
23
- import { SessionContext as Je } from "./Session/context.js";
21
+ import { translations as Xe } from "./Session/libs/locales.js";
22
+ import { checkEnableAutoLogin as qe, getMobileVisitorId as je, login as ze } from "./Session/libs/login-mobile.js";
23
+ import { SessionContext as Qe } from "./Session/context.js";
24
24
  export * from "@arcblock/ux/lib/Util/wallet";
25
- import { getVisitorId as $e, setVisitorId as eo } from "@arcblock/ux/lib/Util";
25
+ import { getVisitorId as eo, setVisitorId as oo } from "@arcblock/ux/lib/Util";
26
26
  export {
27
27
  V as API_DID_PREFIX,
28
- Ue as Address,
29
- Me as Avatar,
28
+ Ke as Address,
29
+ ye as Avatar,
30
30
  v as BLOCKLET_SERVICE_PATH_PREFIX,
31
31
  b as BUSY_STATUS,
32
32
  n as Button,
33
33
  B as CHECK_INTERVAL_TIME,
34
- W as CHECK_STATUS_INTERVAL,
35
- Y as CSRF_TOKEN_STORAGE_KEY,
34
+ H as CHECK_STATUS_INTERVAL,
35
+ W as CSRF_TOKEN_STORAGE_KEY,
36
36
  t as Connect,
37
- G as DEFAULT_NAME,
38
- H as DEFAULT_TIMEOUT,
37
+ Y as DEFAULT_NAME,
38
+ G as DEFAULT_TIMEOUT,
39
39
  X as DEFAULT_WINDOW_TIMEOUT,
40
40
  d as DIDButton,
41
41
  r as DIDConnect,
@@ -43,14 +43,14 @@ export {
43
43
  w as DID_CONNECT_URL_PARAMS_NAME,
44
44
  q as DID_SPACES_BASE_URL,
45
45
  s as DidConnect,
46
- Ve as EVENTS,
46
+ ve as EVENTS,
47
47
  j as EXT_DOWNLOAD_URL,
48
48
  K as FederatedConsumer,
49
49
  M as FederatedContext,
50
50
  y as FederatedProvider,
51
51
  z as LANG_COOKIE_NAME,
52
52
  p as Logo,
53
- Le as NotOpenError,
53
+ Ne as NotOpenError,
54
54
  C as OAuthConsumer,
55
55
  T as OAuthContext,
56
56
  i as OAuthProvider,
@@ -62,14 +62,14 @@ export {
62
62
  Q as RELAY_SOCKET_PREFIX,
63
63
  Z as SESSION_TOKEN_STORAGE_KEY,
64
64
  _ as Session,
65
- Je as SessionContext,
66
- Pe as SessionManager,
65
+ Qe as SessionContext,
66
+ Fe as SessionManager,
67
67
  $ as VERIFY_CODE_LENGTH,
68
68
  F as WrapDid,
69
- we as checkEnableAutoLogin,
70
- m as createAuthServiceSessionContext,
69
+ qe as checkEnableAutoLogin,
70
+ x as createAuthServiceSessionContext,
71
71
  oe as createAxios,
72
- x as createSessionContext,
72
+ m as createSessionContext,
73
73
  te as debug,
74
74
  re as debugTmp,
75
75
  se as debugTmpInterval,
@@ -77,34 +77,35 @@ export {
77
77
  ne as decodeKey,
78
78
  de as decodeUrlParams,
79
79
  Ee as decrypt,
80
- be as didSpacesIsRequired,
80
+ Be as didSpacesIsRequired,
81
81
  fe as encodeConnectUrl,
82
82
  pe as encodeKey,
83
83
  ue as encrypt,
84
84
  _e as formatCacheTtl,
85
- me as getApiErrorMessage,
86
- xe as getAppId,
85
+ xe as getApiErrorMessage,
86
+ me as getAppId,
87
87
  Ae as getBrowserLang,
88
88
  Ce as getConnectedInfo,
89
- qe as getMobileVisitorId,
90
- $e as getVisitorId,
91
- Te as getWebAuthnErrorMessage,
92
- ie as logger,
93
- je as login,
89
+ Te as getExtraHeaders,
90
+ je as getMobileVisitorId,
91
+ eo as getVisitorId,
92
+ ie as getWebAuthnErrorMessage,
93
+ Ie as logger,
94
+ ze as login,
94
95
  We as loginFederatedMaster,
95
96
  Ye as mountFederatedIframe,
96
- Ie as openPopup,
97
- le as parseNextWorkflow,
98
- Se as parseTokenFromConnectUrl,
99
- ce as runPopup,
100
- eo as setVisitorId,
101
- Oe as sleep,
102
- He as translations,
97
+ le as openPopup,
98
+ Se as parseNextWorkflow,
99
+ ce as parseTokenFromConnectUrl,
100
+ Oe as runPopup,
101
+ oo as setVisitorId,
102
+ ge as sleep,
103
+ Xe as translations,
103
104
  De as updateConnectedInfo,
104
- he as useConnect,
105
+ ke as useConnect,
105
106
  N as useDid,
106
107
  h as useFederatedContext,
107
108
  I as useOAuth,
108
- D as usePasskey,
109
- ge as version
109
+ g as usePasskey,
110
+ Re as version
110
111
  };
@@ -1,4 +1,4 @@
1
- const o = "3.3.9", s = {
1
+ const o = "3.4.0", s = {
2
2
  version: o
3
3
  };
4
4
  export {
package/lib/utils.js CHANGED
@@ -1,31 +1,31 @@
1
1
  import { Buffer as a } from "buffer";
2
2
  import h from "tweetnacl-sealedbox-js";
3
- import { getCookieOptions as A, getVisitorId as U } from "@arcblock/ux/lib/Util";
4
- import { getVisitorId as ke, setVisitorId as ye } from "@arcblock/ux/lib/Util";
3
+ import { isUrl as U, getCookieOptions as A, getVisitorId as E } from "@arcblock/ux/lib/Util";
4
+ import { getVisitorId as Ue, setVisitorId as Ae } from "@arcblock/ux/lib/Util";
5
5
  import c from "js-cookie";
6
- import d from "lodash/isNil";
6
+ import l from "lodash/isNil";
7
7
  import T from "lodash/isString";
8
8
  import m from "lodash/isUndefined";
9
- import { createAxios as E, BlockletSDK as P } from "@blocklet/js-sdk";
9
+ import { createAxios as P, getBlockletSDK as x } from "@blocklet/js-sdk";
10
10
  import { withQuery as L } from "ufo";
11
11
  import { isValid as w, isFromPublicKey as S } from "@arcblock/did";
12
- import { getSafeUrl as x } from "@arcblock/ux/lib/Util/security";
13
- import { createDebug as u, createLogger as C } from "@arcblock/ux/lib/Util/logger";
14
- import I from "./package.json.js";
15
- import { DID_CONNECT_URL_PARAMS_NAME as f, DEFAULT_WINDOW_TIMEOUT as N } from "./constant.js";
16
- import { NotOpenError as D } from "./error.js";
12
+ import { getSafeUrl as C } from "@arcblock/ux/lib/Util/security";
13
+ import { createDebug as u, createLogger as I } from "@arcblock/ux/lib/Util/logger";
14
+ import N from "./package.json.js";
15
+ import { DID_CONNECT_URL_PARAMS_NAME as f, DEFAULT_WINDOW_TIMEOUT as D } from "./constant.js";
16
+ import { NotOpenError as W } from "./error.js";
17
17
  export * from "@arcblock/ux/lib/Util/wallet";
18
- const { version: O } = I, Z = u("did-connect"), ee = u("did-connect:tmp"), re = u("did-connect:tmp-interval"), oe = C("did-connect");
18
+ const { version: O } = N, re = u("did-connect"), oe = u("did-connect:tmp"), te = u("did-connect:tmp-interval"), ne = I("did-connect");
19
19
  function b(e) {
20
20
  return (e + "===".slice((e.length + 3) % 4)).replace(/-/g, "+").replace(/_/g, "/");
21
21
  }
22
22
  function _(e) {
23
23
  return e.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
24
24
  }
25
- const ne = (e) => _(window.btoa(e)), te = (e) => window.atob(b(e)), se = (e) => {
25
+ const se = (e) => _(window.btoa(e)), ie = (e) => window.atob(b(e)), ae = (e) => {
26
26
  const o = new URL(e), r = decodeURIComponent(o.searchParams.get("url"));
27
27
  return new URL(r).searchParams.get("_t_");
28
- }, W = (e, o) => {
28
+ }, R = (e, o) => {
29
29
  let r = o?.publisher;
30
30
  if (!r) {
31
31
  if (e?.agentDid)
@@ -37,40 +37,40 @@ const ne = (e) => _(window.btoa(e)), te = (e) => window.atob(b(e)), se = (e) =>
37
37
  const o = {
38
38
  connected_did: e.did || "",
39
39
  connected_pk: e.pk || "",
40
- connected_app: W(e.appInfo, e.memberAppInfo)
40
+ connected_app: R(e.appInfo, e.memberAppInfo)
41
41
  };
42
42
  return e?.connectedWallet?.os && (o.connected_wallet_os = e.connectedWallet.os), o;
43
- }, ie = (e, o = !1) => {
43
+ }, ce = (e, o = !1) => {
44
44
  if (!e) return;
45
45
  o || (e = z(e));
46
46
  const r = A({
47
47
  expireInDays: 7,
48
48
  returnDomain: !1
49
49
  });
50
- !d(e.connected_did) && !d(e.connected_pk) && w(e.connected_did) && S(e.connected_did, e.connected_pk) && (c.set("connected_did", e.connected_did, r), c.set("connected_pk", e.connected_pk, r)), !d(e.connected_app) && w(e.connected_app) && c.set("connected_app", e.connected_app, r), e.connected_wallet_os && c.set("connected_wallet_os", e.connected_wallet_os, r);
51
- }, ae = (e) => _(a.from(e).toString("base64")), l = (e) => Uint8Array.from(a.from(b(e), "base64")), ce = (e, o, r) => {
52
- const n = h.open(
50
+ !l(e.connected_did) && !l(e.connected_pk) && w(e.connected_did) && S(e.connected_did, e.connected_pk) && (c.set("connected_did", e.connected_did, r), c.set("connected_pk", e.connected_pk, r)), !l(e.connected_app) && w(e.connected_app) && c.set("connected_app", e.connected_app, r), e.connected_wallet_os && c.set("connected_wallet_os", e.connected_wallet_os, r);
51
+ }, pe = (e) => _(a.from(e).toString("base64")), d = (e) => Uint8Array.from(a.from(b(e), "base64")), le = (e, o, r) => {
52
+ const t = h.open(
53
53
  Uint8Array.from(a.from(e, "base64")),
54
- l(o),
55
- l(r)
54
+ d(o),
55
+ d(r)
56
56
  );
57
- return JSON.parse(a.from(n).toString("utf8"));
58
- }, pe = (e, o) => a.from(h.seal(Uint8Array.from(a.from(e)), l(o))).toString("base64"), de = (e, o = "_t_") => {
59
- const r = new URL(e), n = {
57
+ return JSON.parse(a.from(t).toString("utf8"));
58
+ }, de = (e, o) => a.from(h.seal(Uint8Array.from(a.from(e)), d(o))).toString("base64"), ue = (e, o = "_t_") => {
59
+ const r = new URL(e), t = {
60
60
  baseUrl: r.origin,
61
61
  prefix: r.pathname.replace(/\/auth$/, ""),
62
62
  token: r.searchParams.get(o) || ""
63
63
  };
64
- if (!n.baseUrl)
64
+ if (!t.baseUrl)
65
65
  throw new Error("Invalid next workflow: origin empty");
66
- if (!n.token)
66
+ if (!t.token)
67
67
  throw new Error("Invalid next workflow: token not found");
68
- return n;
68
+ return t;
69
69
  }, g = (e, o) => {
70
70
  let r = e.message;
71
- const { response: n } = e;
72
- return n && (r = n.data?.error || n.data?.message || n.data || o, r = typeof r == "object" ? o : r), r;
73
- }, le = (e, o, r) => {
71
+ const { response: t } = e;
72
+ return t && (r = t.data?.error || t.data?.message || t.data || o, r = typeof r == "object" ? o : r), r;
73
+ }, me = (e, o, r) => {
74
74
  if (!e)
75
75
  return e;
76
76
  if (!e.name)
@@ -87,27 +87,35 @@ const ne = (e) => _(window.btoa(e)), te = (e) => window.atob(b(e)), se = (e) =>
87
87
  default:
88
88
  return console.warn("Unhandled WebAuthn error type:", e.name), g(e, o);
89
89
  }
90
- }, ue = (e = {}, { lazy: o = !1, lazyTime: r = 300 } = {}) => {
91
- const n = {
90
+ }, M = (e) => {
91
+ const o = {}, r = U(e) ? e : window.location.href;
92
+ if (r) {
93
+ const { hostname: t, protocol: n, port: s } = new URL(r);
94
+ o["x-real-hostname"] = t, o["x-real-port"] = s, o["x-real-protocol"] = n.endsWith(":") ? n.substring(0, n.length - 1) : n;
95
+ }
96
+ return o;
97
+ }, we = (e = {}, { lazy: o = !1, lazyTime: r = 300 } = {}) => {
98
+ const t = {
99
+ ...M(e.baseURL),
92
100
  ...e.headers,
93
101
  "x-did-connect-version": O
94
- }, i = E(
102
+ }, n = P(
95
103
  {
96
104
  ...e,
97
- headers: n
105
+ headers: t
98
106
  },
99
107
  { lazy: o, lazyTime: r }
100
108
  );
101
- return i.interceptors.request.use((t) => {
102
- const s = U();
103
- return s && (t.headers["x-blocklet-visitor-id"] = s), t;
104
- }), i;
105
- }, me = (e = 0) => new Promise((o) => {
109
+ return n.interceptors.request.use((s) => {
110
+ const i = E();
111
+ return i && (s.headers["x-blocklet-visitor-id"] = i), s;
112
+ }), n;
113
+ }, fe = (e = 0) => new Promise((o) => {
106
114
  setTimeout(() => {
107
115
  o();
108
116
  }, e);
109
117
  });
110
- function we() {
118
+ function ge() {
111
119
  if (typeof window > "u")
112
120
  return null;
113
121
  const e = window.navigator.languages && window.navigator.languages[0] || window.navigator.language || window.navigator.browserLanguage || window.navigator.userLanguage || window.navigator.systemLanguage || null;
@@ -118,22 +126,22 @@ function we() {
118
126
  en: "en"
119
127
  }[e] || "en";
120
128
  }
121
- function fe(e, o) {
129
+ function he(e, o) {
122
130
  return [void 0, null, ""].includes(e) ? o : e / 86400;
123
131
  }
124
- async function ge() {
132
+ async function be() {
125
133
  const e = window.location.href;
126
134
  try {
127
135
  const o = new URL(e), r = o.searchParams.get(f);
128
136
  if (r) {
129
137
  o.searchParams.delete(f);
130
- const n = JSON.parse(a.from(r, "base64").toString("utf-8"));
131
- if (T(n.forceConnected) && m(n.sourceAppPid)) {
132
- const t = await new P().user.getUserPublicInfo({ did: n.forceConnected });
133
- m(t?.sourceAppPid) || (n.sourceAppPid = t.sourceAppPid);
138
+ const t = JSON.parse(a.from(r, "base64").toString("utf-8"));
139
+ if (T(t.forceConnected) && m(t.sourceAppPid)) {
140
+ const s = await x().user.getUserPublicInfo({ did: t.forceConnected });
141
+ m(s?.sourceAppPid) || (t.sourceAppPid = s.sourceAppPid);
134
142
  }
135
143
  return {
136
- params: n,
144
+ params: t,
137
145
  url: o.href
138
146
  };
139
147
  }
@@ -145,8 +153,8 @@ async function ge() {
145
153
  url: e
146
154
  };
147
155
  }
148
- const he = (e, { width: o = 680, height: r = 720, name: n = "did-connect:popup", offsetX: i = 0, offsetY: t = 0 } = {}) => {
149
- const s = x(e, { allowDomains: null }), v = window.screenX + (window.innerWidth - o) / 2 + i, k = window.screenY + (window.innerHeight - r) / 2 + t, y = [
156
+ const _e = (e, { width: o = 680, height: r = 720, name: t = "did-connect:popup", offsetX: n = 0, offsetY: s = 0 } = {}) => {
157
+ const i = C(e, { allowDomains: null }), v = window.screenX + (window.innerWidth - o) / 2 + n, k = window.screenY + (window.innerHeight - r) / 2 + s, y = [
150
158
  `left=${v}`,
151
159
  `top=${k}`,
152
160
  `width=${o}`,
@@ -156,61 +164,62 @@ const he = (e, { width: o = 680, height: r = 720, name: n = "did-connect:popup",
156
164
  "scrollbars=yes",
157
165
  "status=yes",
158
166
  "popup=yes"
159
- ], p = window.open("", n, y.join(","));
167
+ ], p = window.open("", t, y.join(","));
160
168
  if (p === null)
161
- throw new D();
162
- return p.location.href = L(s, {
169
+ throw new W();
170
+ return p.location.href = L(i, {
163
171
  // NOTICE: 携带当前页面的 origin,用于在 popup 中通过该参数判断是否可以发送 postMessage,即使该参数被伪造,最终也只有该域名能接收到消息,所以没有关系
164
172
  opener: window.location.origin
165
173
  }), p;
166
- }, be = (e) => new Promise((o, r) => {
167
- let n, i;
168
- const t = ({ data: s }) => {
169
- if (s && s.type === "authorization_response") {
170
- if (s?.error) {
171
- console.error(s.error);
174
+ }, ve = (e) => new Promise((o, r) => {
175
+ let t, n;
176
+ const s = ({ data: i }) => {
177
+ if (i && i.type === "authorization_response") {
178
+ if (i?.error) {
179
+ console.error(i.error);
172
180
  return;
173
181
  }
174
182
  setTimeout(() => {
175
- e.popup?.close(), clearTimeout(i), clearInterval(n), window.removeEventListener("message", t, !1);
176
- }, e.closeTimeout || 0), o(s);
183
+ e.popup?.close(), clearTimeout(n), clearInterval(t), window.removeEventListener("message", s, !1);
184
+ }, e.closeTimeout || 0), o(i);
177
185
  }
178
186
  };
179
- i = setTimeout(
187
+ n = setTimeout(
180
188
  () => {
181
- clearInterval(n), r(new Error("Timeout")), window.removeEventListener("message", t, !1);
189
+ clearInterval(t), r(new Error("Timeout")), window.removeEventListener("message", s, !1);
182
190
  },
183
- (e.timeoutInSeconds || N) * 1e3
184
- ), n = setInterval(() => {
185
- e.popup?.closed && (clearInterval(n), clearTimeout(i), window.removeEventListener("message", t, !1), r(new Error("Popup closed")));
186
- }, 1e3), window.addEventListener("message", t);
191
+ (e.timeoutInSeconds || D) * 1e3
192
+ ), t = setInterval(() => {
193
+ e.popup?.closed && (clearInterval(t), clearTimeout(n), window.removeEventListener("message", s, !1), r(new Error("Popup closed")));
194
+ }, 1e3), window.addEventListener("message", s);
187
195
  });
188
196
  export {
189
- ue as createAxios,
190
- Z as debug,
191
- ee as debugTmp,
192
- re as debugTmpInterval,
193
- te as decodeConnectUrl,
194
- l as decodeKey,
195
- ge as decodeUrlParams,
196
- ce as decrypt,
197
- ne as encodeConnectUrl,
198
- ae as encodeKey,
199
- pe as encrypt,
200
- fe as formatCacheTtl,
197
+ we as createAxios,
198
+ re as debug,
199
+ oe as debugTmp,
200
+ te as debugTmpInterval,
201
+ ie as decodeConnectUrl,
202
+ d as decodeKey,
203
+ be as decodeUrlParams,
204
+ le as decrypt,
205
+ se as encodeConnectUrl,
206
+ pe as encodeKey,
207
+ de as encrypt,
208
+ he as formatCacheTtl,
201
209
  g as getApiErrorMessage,
202
- W as getAppId,
203
- we as getBrowserLang,
210
+ R as getAppId,
211
+ ge as getBrowserLang,
204
212
  z as getConnectedInfo,
205
- ke as getVisitorId,
206
- le as getWebAuthnErrorMessage,
207
- oe as logger,
208
- he as openPopup,
209
- de as parseNextWorkflow,
210
- se as parseTokenFromConnectUrl,
211
- be as runPopup,
212
- ye as setVisitorId,
213
- me as sleep,
214
- ie as updateConnectedInfo,
213
+ M as getExtraHeaders,
214
+ Ue as getVisitorId,
215
+ me as getWebAuthnErrorMessage,
216
+ ne as logger,
217
+ _e as openPopup,
218
+ ue as parseNextWorkflow,
219
+ ae as parseTokenFromConnectUrl,
220
+ ve as runPopup,
221
+ Ae as setVisitorId,
222
+ fe as sleep,
223
+ ce as updateConnectedInfo,
215
224
  O as version
216
225
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/did-connect-react",
3
- "version": "3.3.9",
3
+ "version": "3.4.0",
4
4
  "description": "Client side library to work with DID Connect by ArcBlock.",
5
5
  "keywords": [
6
6
  "react",
@@ -32,17 +32,17 @@
32
32
  "url": "https://github.com/ArcBlock/ux/issues"
33
33
  },
34
34
  "dependencies": {
35
- "@arcblock/bridge": "3.3.9",
36
- "@arcblock/did": "^1.27.16",
37
- "@arcblock/icons": "3.3.9",
38
- "@arcblock/react-hooks": "3.3.9",
39
- "@arcblock/ws": "^1.27.16",
35
+ "@arcblock/bridge": "3.4.0",
36
+ "@arcblock/did": "^1.28.1",
37
+ "@arcblock/icons": "3.4.0",
38
+ "@arcblock/react-hooks": "3.4.0",
39
+ "@arcblock/ws": "^1.28.1",
40
40
  "@blocklet/constant": "^1.17.7",
41
41
  "@fontsource/lexend": "^5.2.9",
42
42
  "@iconify-icons/logos": "^1.2.36",
43
43
  "@iconify-icons/material-symbols": "^1.2.58",
44
44
  "@iconify/react": "^5.2.1",
45
- "@ocap/util": "^1.27.16",
45
+ "@ocap/util": "^1.28.1",
46
46
  "@simplewebauthn/browser": "^13.1.0",
47
47
  "ahooks": "^3.8.5",
48
48
  "axios": "^1.10.0",
@@ -81,5 +81,5 @@
81
81
  "eslint-plugin-react-hooks": "^4.6.2",
82
82
  "jest": "^29.7.0"
83
83
  },
84
- "gitHead": "c7a122040ee66c92cb979d185ad4a30cb80ef3fa"
84
+ "gitHead": "bbf3a178a14a767aef0da795ea31abe8dfb858c1"
85
85
  }