@nexus-cross/crossx-sdk-core 2.4.0 → 2.5.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { createRemoteJWKSet as Dt, jwtVerify as Lt, decodeJwt as Mt } from "jose";
2
- import { secp256k1 as Ft } from "@noble/curves/secp256k1.js";
1
+ import { createRemoteJWKSet as Lt, jwtVerify as Ft, decodeJwt as Mt } from "jose";
2
+ import { secp256k1 as $t } from "@noble/curves/secp256k1.js";
3
3
  import { keccak_256 as Je } from "@noble/hashes/sha3.js";
4
- import { bytesToHex as $t } from "@noble/hashes/utils.js";
5
- var d = /* @__PURE__ */ ((i) => (i.AUTH_NOT_INITIALIZED = "AUTH_NOT_INITIALIZED", i.AUTH_FAILED = "AUTH_FAILED", i.AUTH_TOKEN_INVALID = "AUTH_TOKEN_INVALID", i.AUTH_TOKEN_EXPIRED = "AUTH_TOKEN_EXPIRED", i.AUTH_NOT_AUTHENTICATED = "AUTH_NOT_AUTHENTICATED", i.ALREADY_AUTHENTICATED = "ALREADY_AUTHENTICATED", i.SESSION_EXPIRED = "SESSION_EXPIRED", i.OAUTH_POPUP_BLOCKED = "OAUTH_POPUP_BLOCKED", i.WALLET_NOT_FOUND = "WALLET_NOT_FOUND", i.WALLET_CREATION_FAILED = "WALLET_CREATION_FAILED", i.WALLET_ALREADY_EXISTS = "WALLET_ALREADY_EXISTS", i.ADDRESS_LIMIT_EXCEEDED = "ADDRESS_LIMIT_EXCEEDED", i.SIGN_FAILED = "SIGN_FAILED", i.SIGN_REJECTED = "SIGN_REJECTED", i.TX_FAILED = "TX_FAILED", i.TX_REJECTED = "TX_REJECTED", i.BROADCAST_FAILED = "BROADCAST_FAILED", i.USER_REJECTED = "USER_REJECTED", i.TX_INVALID_PARAMS = "TX_INVALID_PARAMS", i.NETWORK_ERROR = "NETWORK_ERROR", i.NETWORK_NOT_CONFIGURED = "NETWORK_NOT_CONFIGURED", i.INVALID_CHAIN = "INVALID_CHAIN", i.CHAIN_NOT_SUPPORTED = "CHAIN_NOT_SUPPORTED", i.CHAIN_ADAPTER_NOT_FOUND = "CHAIN_ADAPTER_NOT_FOUND", i.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", i.SIGNATURE_FAILED = "SIGNATURE_FAILED", i.TRANSACTION_FAILED = "TRANSACTION_FAILED", i.PREPARE_FAILED = "PREPARE_FAILED", i.PREPARE_EXPIRED = "PREPARE_EXPIRED", i.PREPARE_MISMATCH = "PREPARE_MISMATCH", i.MIGRATION_FAILED = "MIGRATION_FAILED", i.MIGRATION_BACKUP_EXISTS = "MIGRATION_BACKUP_EXISTS", i.MIGRATION_PIN_LOCKED = "MIGRATION_PIN_LOCKED", i.GATEWAY_INTERNAL_ERROR = "GATEWAY_INTERNAL_ERROR", i.GATEWAY_LOCK_CONFLICT = "GATEWAY_LOCK_CONFLICT", i.WALLET_INCONSISTENT_STATE = "WALLET_INCONSISTENT_STATE", i.PROJECT_ID_MISSING = "PROJECT_ID_MISSING", i.ORIGIN_NOT_ALLOWED = "ORIGIN_NOT_ALLOWED", i.APP_IDENTIFIER_MISSING = "APP_IDENTIFIER_MISSING", i.INVALID_APP_TYPE = "INVALID_APP_TYPE", i.PROJECT_NOT_REGISTERED = "PROJECT_NOT_REGISTERED", i.SIGNATURE_SIGNER_MISMATCH = "SIGNATURE_SIGNER_MISMATCH", i.GAS_ESTIMATION_FAILED = "GAS_ESTIMATION_FAILED", i.TYPED_DATA_CHAIN_ID_MISMATCH = "TYPED_DATA_CHAIN_ID_MISMATCH", i.PIN_NOT_SET = "PIN_NOT_SET", i.PIN_WRONG = "PIN_WRONG", i.PIN_INVALID = "PIN_INVALID", i.PIN_REPEATED_PATTERN = "PIN_REPEATED_PATTERN", i.PIN_CANCELLED = "PIN_CANCELLED", i.EXTERNAL_WALLET_REQUESTED = "EXTERNAL_WALLET_REQUESTED", i.PIN_LOCKED = "PIN_LOCKED", i.PIN_ENCRYPTION_INVALID = "PIN_ENCRYPTION_INVALID", i.PIN_POLICY_VIOLATION = "PIN_POLICY_VIOLATION", i.PIN_ENCRYPTION_FAILED = "PIN_ENCRYPTION_FAILED", i.HMAC_REQUIRED = "HMAC_REQUIRED", i.HMAC_VERIFICATION_FAILED = "HMAC_VERIFICATION_FAILED", i.WITHDRAW_FAILED = "WITHDRAW_FAILED", i.USER_NOT_FOUND = "USER_NOT_FOUND", i.RN_BRIDGE_NOT_AVAILABLE = "RN_BRIDGE_NOT_AVAILABLE", i.RN_BRIDGE_HANDSHAKE_FAILED = "RN_BRIDGE_HANDSHAKE_FAILED", i.RN_NATIVE_SESSION_EXPIRED = "RN_NATIVE_SESSION_EXPIRED", i.INVALID_CONFIG = "INVALID_CONFIG", i.UNKNOWN_ERROR = "UNKNOWN_ERROR", i))(d || {});
4
+ import { bytesToHex as Bt } from "@noble/hashes/utils.js";
5
+ var d = /* @__PURE__ */ ((i) => (i.AUTH_NOT_INITIALIZED = "AUTH_NOT_INITIALIZED", i.AUTH_FAILED = "AUTH_FAILED", i.AUTH_TOKEN_INVALID = "AUTH_TOKEN_INVALID", i.AUTH_TOKEN_EXPIRED = "AUTH_TOKEN_EXPIRED", i.AUTH_NOT_AUTHENTICATED = "AUTH_NOT_AUTHENTICATED", i.ALREADY_AUTHENTICATED = "ALREADY_AUTHENTICATED", i.SESSION_EXPIRED = "SESSION_EXPIRED", i.OAUTH_POPUP_BLOCKED = "OAUTH_POPUP_BLOCKED", i.WALLET_NOT_FOUND = "WALLET_NOT_FOUND", i.WALLET_CREATION_FAILED = "WALLET_CREATION_FAILED", i.WALLET_ALREADY_EXISTS = "WALLET_ALREADY_EXISTS", i.ADDRESS_LIMIT_EXCEEDED = "ADDRESS_LIMIT_EXCEEDED", i.SIGN_FAILED = "SIGN_FAILED", i.SIGN_REJECTED = "SIGN_REJECTED", i.TX_FAILED = "TX_FAILED", i.TX_REJECTED = "TX_REJECTED", i.BROADCAST_FAILED = "BROADCAST_FAILED", i.USER_REJECTED = "USER_REJECTED", i.TX_INVALID_PARAMS = "TX_INVALID_PARAMS", i.NETWORK_ERROR = "NETWORK_ERROR", i.NETWORK_NOT_CONFIGURED = "NETWORK_NOT_CONFIGURED", i.INVALID_CHAIN = "INVALID_CHAIN", i.CHAIN_NOT_SUPPORTED = "CHAIN_NOT_SUPPORTED", i.CHAIN_ADAPTER_NOT_FOUND = "CHAIN_ADAPTER_NOT_FOUND", i.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", i.SIGNATURE_FAILED = "SIGNATURE_FAILED", i.TRANSACTION_FAILED = "TRANSACTION_FAILED", i.PREPARE_FAILED = "PREPARE_FAILED", i.PREPARE_EXPIRED = "PREPARE_EXPIRED", i.PREPARE_MISMATCH = "PREPARE_MISMATCH", i.MIGRATION_FAILED = "MIGRATION_FAILED", i.MIGRATION_BACKUP_EXISTS = "MIGRATION_BACKUP_EXISTS", i.MIGRATION_PIN_LOCKED = "MIGRATION_PIN_LOCKED", i.GATEWAY_INTERNAL_ERROR = "GATEWAY_INTERNAL_ERROR", i.GATEWAY_LOCK_CONFLICT = "GATEWAY_LOCK_CONFLICT", i.WALLET_INCONSISTENT_STATE = "WALLET_INCONSISTENT_STATE", i.PROJECT_ID_MISSING = "PROJECT_ID_MISSING", i.ORIGIN_NOT_ALLOWED = "ORIGIN_NOT_ALLOWED", i.APP_IDENTIFIER_MISSING = "APP_IDENTIFIER_MISSING", i.INVALID_APP_TYPE = "INVALID_APP_TYPE", i.PROJECT_NOT_REGISTERED = "PROJECT_NOT_REGISTERED", i.SIGNATURE_SIGNER_MISMATCH = "SIGNATURE_SIGNER_MISMATCH", i.GAS_ESTIMATION_FAILED = "GAS_ESTIMATION_FAILED", i.EXECUTION_REVERTED = "EXECUTION_REVERTED", i.TYPED_DATA_CHAIN_ID_MISMATCH = "TYPED_DATA_CHAIN_ID_MISMATCH", i.PIN_NOT_SET = "PIN_NOT_SET", i.PIN_WRONG = "PIN_WRONG", i.PIN_INVALID = "PIN_INVALID", i.PIN_REPEATED_PATTERN = "PIN_REPEATED_PATTERN", i.PIN_CANCELLED = "PIN_CANCELLED", i.EXTERNAL_WALLET_REQUESTED = "EXTERNAL_WALLET_REQUESTED", i.PIN_LOCKED = "PIN_LOCKED", i.PIN_ENCRYPTION_INVALID = "PIN_ENCRYPTION_INVALID", i.PIN_POLICY_VIOLATION = "PIN_POLICY_VIOLATION", i.PIN_ENCRYPTION_FAILED = "PIN_ENCRYPTION_FAILED", i.HMAC_REQUIRED = "HMAC_REQUIRED", i.HMAC_VERIFICATION_FAILED = "HMAC_VERIFICATION_FAILED", i.WITHDRAW_FAILED = "WITHDRAW_FAILED", i.USER_NOT_FOUND = "USER_NOT_FOUND", i.RN_BRIDGE_NOT_AVAILABLE = "RN_BRIDGE_NOT_AVAILABLE", i.RN_BRIDGE_HANDSHAKE_FAILED = "RN_BRIDGE_HANDSHAKE_FAILED", i.RN_NATIVE_SESSION_EXPIRED = "RN_NATIVE_SESSION_EXPIRED", i.INVALID_CONFIG = "INVALID_CONFIG", i.UNKNOWN_ERROR = "UNKNOWN_ERROR", i))(d || {});
6
6
  class u extends Error {
7
7
  constructor(e, r, t) {
8
8
  super(r), this.code = e, this.details = t, this.name = "CROSSxError", Object.setPrototypeOf(this, u.prototype);
@@ -16,12 +16,12 @@ class u extends Error {
16
16
  };
17
17
  }
18
18
  }
19
- const Bt = 2e3, Ze = 6e4, Ut = 1e3, Wt = 1e4, Ht = "0x77359400", Qe = "0x3B9ACA00", et = 130, Ge = 6, tt = 18, rt = 3e4, Gt = 5 * 60 * 1e3, Kt = 30 * 1e3, Fe = 100, Vt = 5 * 60 * 1e3, st = 60 * 1e3, zt = 5 * 60 * 1e3, qt = "crossx-sdk-js/2.4.0", Ke = "ONEpocket";
20
- var fe = /* @__PURE__ */ ((i) => (i.MetaMask = "io.metamask", i.Binance = "com.binance.wallet", i.CROSSx = "crossx", i))(fe || {});
19
+ const Ut = 2e3, Ze = 6e4, Wt = 1e3, Ht = 1e4, Gt = "0x77359400", Qe = "0x3B9ACA00", et = 130, He = 6, tt = 18, rt = 3e4, Kt = 300 * 1e3, Vt = 30 * 1e3, Fe = 100, qt = 300 * 1e3, st = 60 * 1e3, zt = "crossx-sdk-js/2.5.0-beta.1", Ge = "ONEpocket";
20
+ var we = /* @__PURE__ */ ((i) => (i.MetaMask = "io.metamask", i.Binance = "com.binance.wallet", i.CROSSx = "crossx", i))(we || {});
21
21
  const jt = {
22
22
  "io.metamask": "MetaMask",
23
23
  "com.binance.wallet": "Binance Wallet",
24
- crossx: Ke
24
+ crossx: Ge
25
25
  }, Yt = [
26
26
  "crossx",
27
27
  "io.metamask",
@@ -38,7 +38,27 @@ function ft(i) {
38
38
  const e = i instanceof Error ? i.message : String(i);
39
39
  return e.includes("BRIDGE_NOT_AUTHORIZED") || e.includes("Bridge session not authenticated");
40
40
  }
41
- const Ie = {
41
+ const Zt = /* @__PURE__ */ new Set(["ERR_USER_REJECTED", "USER_REJECTED", "USER_REJECT"]), Qt = /user rejected|rejected the request|request (?:was )?cancell?ed|entry was cancell?ed|거부했습니다|취소되었습니다/i;
42
+ function wt(i) {
43
+ if (!i || typeof i != "object") return;
44
+ const e = i.code;
45
+ return typeof e == "string" && e.length > 0 ? e : void 0;
46
+ }
47
+ function er(i) {
48
+ const e = wt(i);
49
+ if (e) return Zt.has(e);
50
+ const r = i instanceof Error ? i.message : String(i);
51
+ return Qt.test(r);
52
+ }
53
+ function de(i, e) {
54
+ if (i instanceof u) return i;
55
+ const r = wt(i), t = i instanceof Error ? i.message : String(i), s = { nativeCode: r, cause: i };
56
+ if (er(i))
57
+ return new u(d.USER_REJECTED, t, s);
58
+ const n = r && !t.includes(r) ? `${t} (${r})` : t;
59
+ return new u(e, n, s);
60
+ }
61
+ const ke = {
42
62
  // ─── CROSS ────────────────────────────────────────────
43
63
  ONE_MAINNET: {
44
64
  caipId: "eip155:612055",
@@ -87,20 +107,20 @@ const Ie = {
87
107
  rpcUrl: "https://saigon-testnet.roninchain.com/rpc",
88
108
  testnet: !0
89
109
  }
90
- }, xi = Object.fromEntries(
91
- Object.entries(Ie).map(([i, e]) => [i, e.caipId])
92
- ), Zt = new Map(
93
- Object.values(Ie).map((i) => [i.caipId, i])
110
+ }, bi = Object.fromEntries(
111
+ Object.entries(ke).map(([i, e]) => [i, e.caipId])
112
+ ), tr = new Map(
113
+ Object.values(ke).map((i) => [i.caipId, i])
94
114
  );
95
115
  new Map(
96
- Object.values(Ie).map((i) => [i.chainId, i])
116
+ Object.values(ke).map((i) => [i.chainId, i])
97
117
  );
98
- const Qt = { symbol: "", decimals: 18 };
99
- function Re(i) {
100
- var e;
101
- return ((e = Zt.get(i)) == null ? void 0 : e.nativeCurrency) ?? Qt;
118
+ const rr = { symbol: "", decimals: 18 };
119
+ function sr(i, e) {
120
+ var r;
121
+ return (e == null ? void 0 : e[i]) ?? ((r = tr.get(i)) == null ? void 0 : r.nativeCurrency);
102
122
  }
103
- class er {
123
+ class ir {
104
124
  constructor(e, r) {
105
125
  this.sdk = e, this.chainId = r, this._listeners = /* @__PURE__ */ new Map();
106
126
  }
@@ -110,29 +130,36 @@ class er {
110
130
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
111
131
  async request({ method: e, params: r = [] }) {
112
132
  switch (e) {
133
+ // ── 계정 ──────────────────────────────────
113
134
  case "eth_accounts":
114
135
  case "eth_requestAccounts": {
115
136
  const t = await this.sdk.getAddress();
116
137
  return t ? [t.address] : [];
117
138
  }
139
+ // ── 체인 정보 ──────────────────────────────
118
140
  case "eth_chainId":
119
141
  return this._caip2ToHex(this.chainId);
120
142
  case "net_version":
121
143
  return this.chainId.split(":")[1] ?? "1";
144
+ // ── 서명 (트랜잭션) ─────────────────────────
122
145
  case "eth_signTransaction": {
123
146
  const t = this._normalizeEIP1193Tx(r[0]);
124
147
  return (await this.sdk.signTransaction(this.chainId, t)).signedTx;
125
148
  }
149
+ // ── 전송 ──────────────────────────────────
126
150
  case "eth_sendTransaction": {
127
151
  const t = this._normalizeEIP1193Tx(r[0]);
128
152
  return (await this.sdk.sendTransaction(this.chainId, t)).txHash;
129
153
  }
154
+ // ── personal_sign / eth_sign ────────────────
155
+ // EIP-1193 메시지 서명은 현재 미구현 (향후 sdk.signMessage() 로 연결 예정)
130
156
  case "personal_sign":
131
157
  case "eth_sign":
132
158
  throw new u(
133
159
  d.NOT_IMPLEMENTED,
134
160
  `${e}은(는) 아직 지원되지 않습니다. sdk.signMessage()를 직접 사용하세요.`
135
161
  );
162
+ // ── EIP-712 Typed Data ────────────────────
136
163
  case "eth_signTypedData":
137
164
  case "eth_signTypedData_v1":
138
165
  case "eth_signTypedData_v3":
@@ -141,6 +168,7 @@ class er {
141
168
  d.NOT_IMPLEMENTED,
142
169
  `${e}은(는) 아직 지원되지 않습니다. sdk.signTypedData() 또는 sdk.signTypedDataOffchain()을 직접 사용하세요.`
143
170
  );
171
+ // ── 범용 RPC (노드 직접 호출) ─────────────
144
172
  default:
145
173
  return this.sdk.walletRpc(e, r, this.chainId);
146
174
  }
@@ -220,7 +248,7 @@ const c = {
220
248
  return;
221
249
  }
222
250
  }
223
- }, tr = {
251
+ }, nr = {
224
252
  // ── 공통 버튼 ────────────────────────────────────────────────
225
253
  confirm: "확인",
226
254
  cancel: "취소",
@@ -342,7 +370,7 @@ const c = {
342
370
  session_alert_apple_account: "Apple 계정",
343
371
  session_alert_sign_out_button: "로그아웃",
344
372
  session_alert_sign_in_again_button: "다시 로그인"
345
- }, wt = {
373
+ }, mt = {
346
374
  // ── Common buttons ───────────────────────────────────────────
347
375
  confirm: "Confirm",
348
376
  cancel: "Cancel",
@@ -387,7 +415,7 @@ const c = {
387
415
  label_including_fees: "(including fees)",
388
416
  label_primary_type: "Primary Type",
389
417
  // ── Login selector modal ─────────────────────────────────────
390
- login_selector_title: Ke,
418
+ login_selector_title: Ge,
391
419
  login_selector_subtitle: "Sign in instantly with your social account",
392
420
  login_selector_google: "Sign in with Google",
393
421
  login_selector_apple: "Sign in with Apple",
@@ -463,17 +491,17 @@ For security, you must continue with the same account.`,
463
491
  session_alert_apple_account: "Apple account",
464
492
  session_alert_sign_out_button: "Sign out",
465
493
  session_alert_sign_in_again_button: "Sign in again"
466
- }, rr = {
467
- ko: tr,
468
- en: wt
494
+ }, or = {
495
+ ko: nr,
496
+ en: mt
469
497
  };
470
498
  function Q(i = "en", e) {
471
- return rr[i] ?? wt;
499
+ return or[i] ?? mt;
472
500
  }
473
- function sr(i) {
501
+ function ar(i) {
474
502
  return i === "ko" || i === "en" ? i : typeof navigator < "u" && (navigator.language ?? "").toLowerCase().startsWith("ko") ? "ko" : "en";
475
503
  }
476
- const nt = "crossx_access_token", ot = "crossx_refresh_token", at = "crossx_user_info", Ae = class Ae {
504
+ const nt = "crossx_access_token", ot = "crossx_refresh_token", at = "crossx_user_info", Te = class Te {
477
505
  constructor(e, r, t, s, n, o, a, l, p = () => {
478
506
  }) {
479
507
  this.config = e, this.storage = r, this.crypto = t, this.oauth = s, this.transport = n, this.walletProvider = o, this.tokenStore = a, this.requestFreshTokenFromBridge = l, this.getLocale = p, this._refreshPromise = null, this._migrated = !1;
@@ -572,9 +600,9 @@ const nt = "crossx_access_token", ot = "crossx_refresh_token", at = "crossx_user
572
600
  const s = e == null ? void 0 : e.provider;
573
601
  let n = "/login";
574
602
  s === "google" ? n = "/google" : s === "apple" && (n = "/apple");
575
- const { oauthServiceUrl: o, legacyOauthServiceUrl: a } = this.config, l = sr(this.getLocale()), p = (w) => {
576
- const f = `${w}${n}`, x = f.includes("?") ? "&" : "?";
577
- return `${f}${x}locale=${l}`;
603
+ const { oauthServiceUrl: o, legacyOauthServiceUrl: a } = this.config, l = ar(this.getLocale()), p = (m) => {
604
+ const w = `${m}${n}`, x = w.includes("?") ? "&" : "?";
605
+ return `${w}${x}locale=${l}`;
578
606
  }, h = p(o), _ = a ? p(a) : void 0;
579
607
  c.log(`[CROSSx] OAuth 팝업 열기 (${s || "일반"} 로그인)`), c.log(`[CROSSx] Auth URL: ${h}`);
580
608
  const g = await this.oauth.openAuth({
@@ -683,12 +711,12 @@ const nt = "crossx_access_token", ot = "crossx_refresh_token", at = "crossx_user
683
711
  let t, s = !1;
684
712
  try {
685
713
  const { authApiUrl: h } = this.config, { accessToken: _, refreshToken: g } = await this.exchangeFirebaseToken(e, h);
686
- let w, f, x;
714
+ let m, w, x;
687
715
  try {
688
716
  const b = this.crypto.decodeJWT(e);
689
- c.log("[CROSSx] Firebase JWT 필드:", Object.keys(b).join(", ")), f = (n = b.firebase) == null ? void 0 : n.sign_in_provider;
717
+ c.log("[CROSSx] Firebase JWT 필드:", Object.keys(b).join(", ")), w = (n = b.firebase) == null ? void 0 : n.sign_in_provider;
690
718
  const E = ((o = b.firebase) == null ? void 0 : o.identities) ?? {};
691
- x = b.email ?? ((a = E.email) == null ? void 0 : a[0]), f === "google.com" ? w = (l = E["google.com"]) == null ? void 0 : l[0] : f === "apple.com" && (w = (p = E["apple.com"]) == null ? void 0 : p[0]), c.log("[CROSSx] OAuth provider sub 추출 — provider:", f, "hasProviderSub:", !!w, "email:", x ?? "(없음)");
719
+ x = b.email ?? ((a = E.email) == null ? void 0 : a[0]), w === "google.com" ? m = (l = E["google.com"]) == null ? void 0 : l[0] : w === "apple.com" && (m = (p = E["apple.com"]) == null ? void 0 : p[0]), c.log("[CROSSx] OAuth provider sub 추출 — provider:", w, "hasProviderSub:", !!m, "email:", x ?? "(없음)");
692
720
  } catch {
693
721
  c.warn("[CROSSx] firebaseToken에서 providerSub 추출 실패");
694
722
  }
@@ -698,7 +726,7 @@ const nt = "crossx_access_token", ot = "crossx_refresh_token", at = "crossx_user
698
726
  const E = await this.crypto.verifyJWT(_);
699
727
  if (s = E.signatureVerified ?? !1, !E.valid)
700
728
  throw c.error("[CROSSx] access_token 검증 실패"), new Error("유효하지 않은 access token");
701
- const A = E.payload, T = A.email ?? x ?? r;
729
+ const A = E.payload, k = A.email ?? x ?? r;
702
730
  c.log(
703
731
  "[CROSSx] email 소스 — CROSSx JWT:",
704
732
  A.email ?? "(없음)",
@@ -707,20 +735,20 @@ const nt = "crossx_access_token", ot = "crossx_refresh_token", at = "crossx_user
707
735
  "/ OAuth 콜백:",
708
736
  r ?? "(없음)",
709
737
  "→",
710
- T ?? "(없음)"
738
+ k ?? "(없음)"
711
739
  ), t = {
712
740
  id: A.sub,
713
- email: T,
714
- signInProvider: f,
715
- providerSub: w
741
+ email: k,
742
+ signInProvider: w,
743
+ providerSub: m
716
744
  }, this.tokenStore.set(_), this.useCookieAuth || (await this.storage.set(this.STORAGE_KEY_ACCESS_TOKEN, _), g && this.config.secureStorageAvailable !== !1 ? await this.storage.set(this.STORAGE_KEY_REFRESH_TOKEN, g) : g && c.warn("[CROSSx] 안전한 스토리지 미사용 — refresh_token 영속 저장을 건너뜁니다"));
717
745
  } else {
718
746
  const b = this.crypto.decodeJWT(e);
719
747
  t = {
720
748
  id: b.sub,
721
749
  email: b.email ?? r,
722
- signInProvider: f,
723
- providerSub: w
750
+ signInProvider: w,
751
+ providerSub: m
724
752
  }, c.log("[CROSSx] Cookie 모드 — Firebase 토큰에서 사용자 정보 추출 — id:", t.id);
725
753
  }
726
754
  c.log("[CROSSx] 사용자 정보 — id:", t.id, "email:", t.email ?? "(없음)");
@@ -923,7 +951,7 @@ const nt = "crossx_access_token", ot = "crossx_refresh_token", at = "crossx_user
923
951
  c.log("[CROSSx] silentRefresh 응답 — status:", o.status);
924
952
  const a = o.data, l = this.extractResponseErrorCode(a);
925
953
  if (l) {
926
- const h = Ae.REFRESH_RELOGIN_CODES.has(l.code);
954
+ const h = Te.REFRESH_RELOGIN_CODES.has(l.code);
927
955
  throw new u(
928
956
  h ? d.SESSION_EXPIRED : d.AUTH_FAILED,
929
957
  `토큰 갱신 실패 (코드 ${l.code}): ${l.message}`
@@ -1059,9 +1087,9 @@ const nt = "crossx_access_token", ot = "crossx_refresh_token", at = "crossx_user
1059
1087
  return c.log("[CROSSx] loadWallet 결과 — address:", t, "needsMigration:", s), { success: !0, address: t, user: e, needsMigration: s, tokenSignatureVerified: r };
1060
1088
  }
1061
1089
  };
1062
- Ae.REFRESH_RELOGIN_CODES = /* @__PURE__ */ new Set([1007, 1008]);
1063
- let $e = Ae;
1064
- class ir {
1090
+ Te.REFRESH_RELOGIN_CODES = /* @__PURE__ */ new Set([1007, 1008]);
1091
+ let Me = Te;
1092
+ class cr {
1065
1093
  constructor(e, r, t) {
1066
1094
  this.config = e, this.storage = r, this.tokenStore = t;
1067
1095
  const s = e.projectId;
@@ -1071,7 +1099,7 @@ class ir {
1071
1099
  this.tokenStore.clear(), this.config.authMode !== "cookie" && (await this.storage.remove(this.STORAGE_KEY_ACCESS_TOKEN), await this.storage.remove(this.STORAGE_KEY_REFRESH_TOKEN)), await this.storage.remove(this.STORAGE_KEY_USER), await this.storage.clear();
1072
1100
  }
1073
1101
  }
1074
- class nr {
1102
+ class lr {
1075
1103
  constructor(e, r) {
1076
1104
  this.storage = e, this.walletProvider = r;
1077
1105
  }
@@ -1088,7 +1116,7 @@ class nr {
1088
1116
  };
1089
1117
  }
1090
1118
  }
1091
- class mt {
1119
+ class yt {
1092
1120
  constructor() {
1093
1121
  this.encryptedBytes = null, this.xorKey = null;
1094
1122
  }
@@ -1129,7 +1157,11 @@ class mt {
1129
1157
  return this.encryptedBytes !== null;
1130
1158
  }
1131
1159
  }
1132
- class or {
1160
+ const dr = 3, pr = /^0x(?:[0-9a-fA-F]{2}){4,}$/;
1161
+ function hr(i) {
1162
+ return i.code === dr || /execution reverted/i.test(i.message ?? "");
1163
+ }
1164
+ class ur {
1133
1165
  constructor(e, r) {
1134
1166
  this.chainRegistry = e, this.transport = r, this._nextId = 1;
1135
1167
  }
@@ -1153,15 +1185,18 @@ class or {
1153
1185
  headers: { "Content-Type": "application/json" },
1154
1186
  body: n
1155
1187
  })).data;
1156
- if (a != null && a.error)
1157
- throw new u(
1158
- d.UNKNOWN_ERROR,
1159
- `RPC 오류 [${e}] (${t}): ${a.error.message} (코드: ${a.error.code})`
1188
+ if (a != null && a.error) {
1189
+ const { code: l, message: p } = a.error, h = { method: e, chainId: t, code: l, message: p, data: a.error.data }, _ = hr(a.error);
1190
+ throw _ && typeof h.data == "string" && pr.test(h.data) && (h.revertData = h.data, h.selector = h.data.slice(0, 10).toLowerCase()), new u(
1191
+ _ ? d.EXECUTION_REVERTED : d.UNKNOWN_ERROR,
1192
+ `RPC 오류 [${e}] (${t}): ${p} (코드: ${l})`,
1193
+ h
1160
1194
  );
1195
+ }
1161
1196
  return a == null ? void 0 : a.result;
1162
1197
  }
1163
1198
  }
1164
- class ar {
1199
+ class _r {
1165
1200
  constructor() {
1166
1201
  this.listeners = /* @__PURE__ */ new Map();
1167
1202
  }
@@ -1184,7 +1219,7 @@ class ar {
1184
1219
  this.listeners.clear();
1185
1220
  }
1186
1221
  }
1187
- function cr() {
1222
+ function xr() {
1188
1223
  var e;
1189
1224
  if (typeof globalThis < "u" && ((e = globalThis.crypto) != null && e.getRandomValues)) {
1190
1225
  const r = new Uint8Array(16);
@@ -1254,7 +1289,7 @@ class Y {
1254
1289
  async handshake() {
1255
1290
  if (!this.bridge)
1256
1291
  throw new u(d.AUTH_NOT_INITIALIZED, "Bridge not initialized");
1257
- const e = cr(), r = Date.now(), t = {
1292
+ const e = xr(), r = Date.now(), t = {
1258
1293
  version: 1,
1259
1294
  appId: this.config.appId,
1260
1295
  appVersion: this.config.appVersion,
@@ -1418,7 +1453,7 @@ class Y {
1418
1453
  );
1419
1454
  }
1420
1455
  }
1421
- const pe = {
1456
+ const he = {
1422
1457
  production: {
1423
1458
  oauthServiceUrl: "https://one-wallet-oauth.onechain.nexus",
1424
1459
  legacyOauthServiceUrl: "https://cross-wallet-oauth.crosstoken.io",
@@ -1445,8 +1480,8 @@ const pe = {
1445
1480
  contentsBaseUrl: "https://stg-contents.crosstoken.io/frontend/common/app-launcher"
1446
1481
  }
1447
1482
  };
1448
- function lr(i) {
1449
- const e = i.environment, r = e && e in pe ? pe[e] : null;
1483
+ function gr(i) {
1484
+ const e = i.environment, r = e && e in he ? he[e] : null;
1450
1485
  if (!r)
1451
1486
  return null;
1452
1487
  const t = i.overrides;
@@ -1457,50 +1492,50 @@ function lr(i) {
1457
1492
  typeof o == "string" && o.trim() !== "" && (s[n] = o);
1458
1493
  return s;
1459
1494
  }
1460
- function ke() {
1495
+ function Ke() {
1461
1496
  try {
1462
1497
  if (typeof __CROSSX_CONFIG__ < "u") {
1463
- const i = typeof __CROSSX_CONFIG__ == "string" ? JSON.parse(__CROSSX_CONFIG__) : __CROSSX_CONFIG__, e = lr(i);
1498
+ const i = typeof __CROSSX_CONFIG__ == "string" ? JSON.parse(__CROSSX_CONFIG__) : __CROSSX_CONFIG__, e = gr(i);
1464
1499
  if (e) return e;
1465
1500
  }
1466
1501
  } catch {
1467
1502
  }
1468
1503
  try {
1469
1504
  const i = process.env.NEXT_PUBLIC_CROSSX_ENVIRONMENT;
1470
- if (i && i in pe)
1471
- return pe[i];
1505
+ if (i && i in he)
1506
+ return he[i];
1472
1507
  } catch {
1473
1508
  }
1474
- return pe.production;
1509
+ return he.production;
1475
1510
  }
1476
- function yt(i) {
1511
+ function bt(i) {
1477
1512
  let e = i.length;
1478
1513
  for (; e > 0 && i.charCodeAt(e - 1) === 48; ) e--;
1479
1514
  return i.slice(0, e);
1480
1515
  }
1481
- function dr(i, e = Ge) {
1516
+ function fr(i, e = He) {
1482
1517
  if (!i || i === "0x0" || i === "0x") return "0";
1483
1518
  try {
1484
1519
  const r = BigInt(i);
1485
1520
  if (r === 0n) return "0";
1486
- const t = 10n ** BigInt(tt), s = r / t, o = (r % t).toString().padStart(tt, "0"), a = yt(o).slice(0, e);
1521
+ const t = 10n ** BigInt(tt), s = r / t, o = (r % t).toString().padStart(tt, "0"), a = bt(o).slice(0, e);
1487
1522
  return a ? `${s}.${a}` : `${s}`;
1488
1523
  } catch {
1489
1524
  return "?";
1490
1525
  }
1491
1526
  }
1492
- function be(i, e, r, t = Ge) {
1527
+ function Se(i, e, r, t = He) {
1493
1528
  if (!(!i || i === "0x" || i === "0x0"))
1494
1529
  try {
1495
1530
  const s = BigInt(i);
1496
1531
  if (s === 0n) return;
1497
- const n = 10n ** BigInt(r), o = s / n, l = (s % n).toString().padStart(r, "0"), p = yt(l.slice(0, t));
1498
- return `${p ? `${o}.${p}` : `${o}`} ${e}`;
1532
+ const n = 10n ** BigInt(r), o = s / n, l = (s % n).toString().padStart(r, "0"), p = bt(l.slice(0, t)), h = p ? `${o}.${p}` : `${o}`;
1533
+ return e ? `${h} ${e}` : h;
1499
1534
  } catch {
1500
1535
  return;
1501
1536
  }
1502
1537
  }
1503
- function pr(i) {
1538
+ function wr(i) {
1504
1539
  const e = i.startsWith("0x") ? i.slice(2) : i;
1505
1540
  if (!/^[0-9a-fA-F]+$/.test(e))
1506
1541
  throw new u(
@@ -1513,7 +1548,7 @@ function pr(i) {
1513
1548
  `서명 길이가 유효하지 않습니다: ${et} hex 문자(65 바이트) 예상, 현재 ${e.length}`
1514
1549
  );
1515
1550
  }
1516
- function hr(i) {
1551
+ function mr(i) {
1517
1552
  const e = i.startsWith("0x") ? i.slice(2) : i;
1518
1553
  if (!/^[0-9a-fA-F]+$/.test(e))
1519
1554
  throw new u(
@@ -1526,8 +1561,8 @@ function hr(i) {
1526
1561
  "유효하지 않은 서명된 트랜잭션: 너무 짧습니다"
1527
1562
  );
1528
1563
  }
1529
- function ur(i, e) {
1530
- const r = _r(e);
1564
+ function yr(i, e) {
1565
+ const r = br(e);
1531
1566
  if (i === "0") {
1532
1567
  if (r !== void 0 && r !== 0)
1533
1568
  throw new u(
@@ -1551,7 +1586,7 @@ function ur(i, e) {
1551
1586
  );
1552
1587
  }
1553
1588
  }
1554
- function _r(i) {
1589
+ function br(i) {
1555
1590
  if (i == null || typeof i != "object") return;
1556
1591
  const e = i.domain;
1557
1592
  if (e == null || typeof e != "object") return;
@@ -1560,7 +1595,7 @@ function _r(i) {
1560
1595
  const t = Number(r);
1561
1596
  return Number.isFinite(t) ? t : void 0;
1562
1597
  }
1563
- class de {
1598
+ class pe {
1564
1599
  constructor(e) {
1565
1600
  this.deps = e, this.verifyPinMutex = null;
1566
1601
  }
@@ -1636,7 +1671,7 @@ class de {
1636
1671
  if (g.code === d.PIN_INVALID)
1637
1672
  return { ok: !1, error: g.message };
1638
1673
  if (g.code === d.PIN_LOCKED)
1639
- return de.buildPinLockedResult(g, a);
1674
+ return pe.buildPinLockedResult(g, a);
1640
1675
  }
1641
1676
  throw g;
1642
1677
  }
@@ -1670,7 +1705,7 @@ class de {
1670
1705
  return await e();
1671
1706
  } catch (s) {
1672
1707
  if (s instanceof u) {
1673
- if (t = de.parsePinError(s, r), !t) throw s;
1708
+ if (t = pe.parsePinError(s, r), !t) throw s;
1674
1709
  } else
1675
1710
  throw s;
1676
1711
  }
@@ -1684,7 +1719,7 @@ class de {
1684
1719
  try {
1685
1720
  return await e();
1686
1721
  } catch (s) {
1687
- if (s instanceof u && (t = de.parsePinError(s, r), t))
1722
+ if (s instanceof u && (t = pe.parsePinError(s, r), t))
1688
1723
  continue;
1689
1724
  throw s;
1690
1725
  }
@@ -1709,13 +1744,13 @@ class de {
1709
1744
  return null;
1710
1745
  }
1711
1746
  static buildPinLockedResult(e, r) {
1712
- const t = de.parsePinError(e, r);
1747
+ const t = pe.parsePinError(e, r);
1713
1748
  if (!t) return { ok: !1, error: e.message };
1714
1749
  const { errorMessage: s, ...n } = t;
1715
1750
  return { ok: !1, error: s, ...n };
1716
1751
  }
1717
1752
  }
1718
- class xr {
1753
+ class Sr {
1719
1754
  constructor(e) {
1720
1755
  this.deps = e;
1721
1756
  }
@@ -1736,10 +1771,10 @@ class xr {
1736
1771
  });
1737
1772
  }
1738
1773
  }
1739
- function gr(i) {
1774
+ function vr(i) {
1740
1775
  return i === "google" || i === "apple";
1741
1776
  }
1742
- class fr {
1777
+ class Er {
1743
1778
  constructor(e) {
1744
1779
  this.deps = e;
1745
1780
  }
@@ -1750,7 +1785,7 @@ class fr {
1750
1785
  this.deps.setRecoveringSession(!0);
1751
1786
  try {
1752
1787
  this.deps.setAuthenticated(!1), this.deps.clearTokenStore();
1753
- const s = gr(e.loginType) ? { provider: e.loginType } : void 0;
1788
+ const s = vr(e.loginType) ? { provider: e.loginType } : void 0;
1754
1789
  let n;
1755
1790
  try {
1756
1791
  n = await this.deps.executeSignIn(s);
@@ -1830,7 +1865,7 @@ class fr {
1830
1865
  }
1831
1866
  }
1832
1867
  }
1833
- class wr {
1868
+ class Ar {
1834
1869
  constructor(e) {
1835
1870
  this.deps = e;
1836
1871
  }
@@ -1877,7 +1912,7 @@ class wr {
1877
1912
  c.log("[CROSSx] 세션 복원 후 지갑 주소 로드 완료:", a.address), this.deps.setActiveWallet(a.address, 0);
1878
1913
  }
1879
1914
  }
1880
- class mr {
1915
+ class Ir {
1881
1916
  constructor(e) {
1882
1917
  this.deps = e;
1883
1918
  }
@@ -1925,14 +1960,14 @@ class mr {
1925
1960
  }
1926
1961
  const g = _.pinStatus;
1927
1962
  if (o = g.maxAttempts, n = o - g.remainingAttempts, g.remainingAttempts === 0 && g.lockExpiresAt) {
1928
- const w = g.lockExpiresAt * 1e3, f = Math.max(
1963
+ const m = g.lockExpiresAt * 1e3, w = Math.max(
1929
1964
  1,
1930
- Math.round((w - Date.now()) / 1e3)
1931
- ), x = f <= 1800 ? "Too many failed attempts. Please try again in 30 minutes." : "Too many failed attempts. Please try again in 24 hours.";
1965
+ Math.round((m - Date.now()) / 1e3)
1966
+ ), x = w <= 1800 ? "Too many failed attempts. Please try again in 30 minutes." : "Too many failed attempts. Please try again in 24 hours.";
1932
1967
  c.warn(
1933
- `[CROSSx][Migration Phase 4] verify-recovery-pin 잠금 — ${f}초, 메시지: ${x}`
1968
+ `[CROSSx][Migration Phase 4] verify-recovery-pin 잠금 — ${w}초, 메시지: ${x}`
1934
1969
  ), await this.deps.confirmation.showRecoveryPinLockedPrompt(
1935
- f,
1970
+ w,
1936
1971
  x
1937
1972
  ), n = 0, s = "Your account lock has been lifted. You may try again.";
1938
1973
  } else
@@ -1945,11 +1980,11 @@ class mr {
1945
1980
  c.warn(
1946
1981
  "[CROSSx][Migration Phase 4] 세션 만료 — 재로그인 후 PIN 입력 재시도"
1947
1982
  );
1948
- const g = Q(this.deps.getLocale() ?? "en"), w = this.deps.getUserEmail();
1983
+ const g = Q(this.deps.getLocale() ?? "en"), m = this.deps.getUserEmail();
1949
1984
  if (await this.deps.confirmation.showSessionAlert({
1950
1985
  title: g.session_alert_title,
1951
1986
  message: g.alert_session_expired,
1952
- email: w ? this.deps.maskEmail(w, g.session_alert_apple_account) : void 0
1987
+ email: m ? this.deps.maskEmail(m, g.session_alert_apple_account) : void 0
1953
1988
  }) === "signin-again" && (await this.deps.signInAgain()).success) {
1954
1989
  c.log(
1955
1990
  "[CROSSx][Migration Phase 4] 재로그인 성공 — PIN 입력 루프 계속"
@@ -1967,14 +2002,14 @@ class mr {
1967
2002
  0,
1968
2003
  "Your account has been permanently locked due to too many failed attempts."
1969
2004
  ), null;
1970
- const w = ((g == null ? void 0 : g.lockExpiresAt) ?? 0) * 1e3, f = Math.max(
2005
+ const m = ((g == null ? void 0 : g.lockExpiresAt) ?? 0) * 1e3, w = Math.max(
1971
2006
  1,
1972
- Math.round((w - Date.now()) / 1e3)
1973
- ), x = f <= 1800 ? "Too many failed attempts. Please try again in 30 minutes." : "Too many failed attempts. Please try again in 24 hours.";
2007
+ Math.round((m - Date.now()) / 1e3)
2008
+ ), x = w <= 1800 ? "Too many failed attempts. Please try again in 30 minutes." : "Too many failed attempts. Please try again in 24 hours.";
1974
2009
  c.warn(
1975
- `[CROSSx][Migration Phase 4] verify-recovery-pin 이미 잠금 — ${f}초`
2010
+ `[CROSSx][Migration Phase 4] verify-recovery-pin 이미 잠금 — ${w}초`
1976
2011
  ), await this.deps.confirmation.showRecoveryPinLockedPrompt(
1977
- f,
2012
+ w,
1978
2013
  x
1979
2014
  ), n = 0, s = "Your account lock has been lifted. You may try again.";
1980
2015
  } else
@@ -2034,12 +2069,12 @@ class mr {
2034
2069
  }
2035
2070
  }
2036
2071
  }
2037
- class yr {
2072
+ class Tr {
2038
2073
  constructor(e) {
2039
2074
  this.deps = e;
2040
2075
  }
2041
2076
  async withResolvedGasAndFee(e, r) {
2042
- const t = (w) => !(w != null && w.trim()), s = e.nonce === void 0 || e.nonce === null, n = t(e.gasLimit), o = t(e.gasPrice) && t(e.maxFeePerGas), a = !t(e.maxFeePerGas) && t(e.maxPriorityFeePerGas);
2077
+ const t = (m) => !(m != null && m.trim()), s = e.nonce === void 0 || e.nonce === null, n = t(e.gasLimit), o = t(e.gasPrice) && t(e.maxFeePerGas), a = !t(e.maxFeePerGas) && t(e.maxPriorityFeePerGas);
2043
2078
  if (!s && !n && !o && !a) return e;
2044
2079
  const l = { ...e }, p = s ? l.from ?? this.deps.getActiveAddress() ?? void 0 : void 0;
2045
2080
  p && c.log(
@@ -2059,23 +2094,23 @@ class yr {
2059
2094
  o ? this.deps.getBaseFeePerGas(r) : null
2060
2095
  ]);
2061
2096
  if (p && (l.nonce = parseInt(h ?? "0x0", 16), c.log("[CROSSx] nonce 결과:", l.nonce)), n && (l.gasLimit = _, c.log("[CROSSx] estimateGas 결과:", l.gasLimit)), o) {
2062
- const w = g;
2063
- if (w) {
2064
- const f = Qe;
2065
- l.maxFeePerGas = `0x${(BigInt(w) + BigInt(f)).toString(16)}`, l.maxPriorityFeePerGas = f, c.log(
2097
+ const m = g;
2098
+ if (m) {
2099
+ const w = Qe;
2100
+ l.maxFeePerGas = `0x${(BigInt(m) + BigInt(w)).toString(16)}`, l.maxPriorityFeePerGas = w, c.log(
2066
2101
  "[CROSSx] Dynamic 체인 감지 — baseFee:",
2067
- w,
2102
+ m,
2068
2103
  "maxFeePerGas:",
2069
2104
  l.maxFeePerGas,
2070
2105
  "maxPriorityFeePerGas: 1 Gwei"
2071
2106
  );
2072
2107
  } else
2073
- l.gasPrice = Ht, c.log("[CROSSx] Legacy 체인 감지 — gasPrice: 2 Gwei");
2108
+ l.gasPrice = Gt, c.log("[CROSSx] Legacy 체인 감지 — gasPrice: 2 Gwei");
2074
2109
  }
2075
2110
  return !o && a && (l.maxPriorityFeePerGas = Qe, c.log("[CROSSx] maxPriorityFeePerGas 비어있음 → 1 Gwei 기본값 적용")), l;
2076
2111
  }
2077
2112
  }
2078
- class br {
2113
+ class kr {
2079
2114
  constructor(e) {
2080
2115
  this.crypto = e;
2081
2116
  }
@@ -2101,10 +2136,10 @@ class br {
2101
2136
  }
2102
2137
  }
2103
2138
  }
2104
- function vr(i) {
2139
+ function Rr(i) {
2105
2140
  return i ? i.includes("google") ? "google" : i.includes("apple") ? "apple" : i : null;
2106
2141
  }
2107
- class Sr {
2142
+ class Nr {
2108
2143
  constructor(e) {
2109
2144
  this.deps = e;
2110
2145
  }
@@ -2126,7 +2161,7 @@ class Sr {
2126
2161
  activeWalletIndex: 0,
2127
2162
  userEmail: ((n = e.user) == null ? void 0 : n.email) ?? null,
2128
2163
  providerSub: ((o = e.user) == null ? void 0 : o.providerSub) ?? null,
2129
- loginType: vr(
2164
+ loginType: Rr(
2130
2165
  (a = e.user) == null ? void 0 : a.signInProvider
2131
2166
  ),
2132
2167
  tokenSignatureVerified: e.tokenSignatureVerified ?? !1
@@ -2156,7 +2191,7 @@ class Sr {
2156
2191
  });
2157
2192
  }
2158
2193
  }
2159
- class Er {
2194
+ class Cr {
2160
2195
  constructor(e) {
2161
2196
  this.deps = e;
2162
2197
  }
@@ -2175,7 +2210,7 @@ class Er {
2175
2210
  )).address, index: e };
2176
2211
  }
2177
2212
  }
2178
- class Ar {
2213
+ class Pr {
2179
2214
  constructor(e) {
2180
2215
  this.deps = e;
2181
2216
  }
@@ -2194,7 +2229,7 @@ class Ar {
2194
2229
  );
2195
2230
  }
2196
2231
  }
2197
- class Ir {
2232
+ class Or {
2198
2233
  constructor(e) {
2199
2234
  this.deps = e;
2200
2235
  }
@@ -2258,7 +2293,7 @@ function ct(i, e) {
2258
2293
  const r = i.replace(/\/$/, ""), t = e.startsWith("/") ? e : `/${e}`;
2259
2294
  return `${r}/cross-auth${t}`;
2260
2295
  }
2261
- class kr {
2296
+ class Dr {
2262
2297
  constructor(e) {
2263
2298
  this.deps = e;
2264
2299
  }
@@ -2406,10 +2441,10 @@ function Ne(i, e = "Apple account") {
2406
2441
  const t = i.substring(0, r), s = i.substring(r);
2407
2442
  return t.length <= 1 ? `${t}${"*".repeat(Math.max(t.length, 1))}${s}` : `${t[0]}${"*".repeat(t.length - 1)}${s}`;
2408
2443
  }
2409
- const ce = class ce extends ar {
2444
+ const ce = class ce extends _r {
2410
2445
  constructor(e, r, t, s, n, o, a, l, p, h, _, g) {
2411
- var w, f;
2412
- super(), this.storage = t, this.crypto = s, this.transport = n, this.oauth = o, this.walletProvider = a, this.tokenStore = l, this.pinEncryptor = g, this.initialized = !1, this._initPromise = null, this.authenticated = !1, this.userId = null, this.address = null, this.activeWalletIndex = 0, this.userEmail = null, this.loginType = null, this.providerSub = null, this.tokenSignatureVerified = !1, this._themeMediaCleanup = null, this._isRecoveringSession = !1, this._rnBridgeService = null, this._providers = /* @__PURE__ */ new Map(), this._isAuthenticatedViaRNBridge = !1, this._bridgeSessionRestorePromise = null, this._config = Object.freeze({ ...e }), this.internalConfig = e, this.adapterConfig = r, e.logger && it(e.logger), this.confirmation = p, this.pinStore = _ ?? new mt(), this.stateManager = new Sr({
2446
+ var m, w;
2447
+ super(), this.storage = t, this.crypto = s, this.transport = n, this.oauth = o, this.walletProvider = a, this.tokenStore = l, this.pinEncryptor = g, this._warnedUnknownNativeCurrency = /* @__PURE__ */ new Set(), this.initialized = !1, this._initPromise = null, this.authenticated = !1, this.userId = null, this.address = null, this.activeWalletIndex = 0, this.userEmail = null, this.loginType = null, this.providerSub = null, this.tokenSignatureVerified = !1, this._themeMediaCleanup = null, this._isRecoveringSession = !1, this._rnBridgeService = null, this._providers = /* @__PURE__ */ new Map(), this._isAuthenticatedViaRNBridge = !1, this._bridgeSessionRestorePromise = null, this._config = Object.freeze({ ...e }), this.internalConfig = e, this.adapterConfig = r, e.logger && it(e.logger), this.confirmation = p, this.pinStore = _ ?? new yt(), this.stateManager = new Nr({
2413
2448
  setState: (x) => {
2414
2449
  x.authenticated !== void 0 && (this.authenticated = x.authenticated), x.userId !== void 0 && (this.userId = x.userId), x.address !== void 0 && (this.address = x.address), x.activeWalletIndex !== void 0 && (this.activeWalletIndex = x.activeWalletIndex), x.userEmail !== void 0 && (this.userEmail = x.userEmail), x.providerSub !== void 0 && (this.providerSub = x.providerSub), x.loginType !== void 0 && (this.loginType = x.loginType), x.tokenSignatureVerified !== void 0 && (this.tokenSignatureVerified = x.tokenSignatureVerified);
2415
2450
  },
@@ -2430,7 +2465,7 @@ const ce = class ce extends ar {
2430
2465
  walletPreferenceKey: ce.WALLET_PREF_KEY,
2431
2466
  storage: this.storage,
2432
2467
  pinStore: this.pinStore
2433
- }), this.pinOrchestrator = new de({
2468
+ }), this.pinOrchestrator = new pe({
2434
2469
  confirmation: this.confirmation,
2435
2470
  walletProvider: this.walletProvider,
2436
2471
  pinStore: this.pinStore,
@@ -2442,19 +2477,19 @@ const ce = class ce extends ar {
2442
2477
  // dApp 이 sdk.pinOrchestrator.ensureVerifiedPin() 을 직접 호출해도 (SigningOrchestrator 우회)
2443
2478
  // WebView 안에서 embedded PIN 프롬프트가 뜨지 않도록 게이팅. SigningOrchestrator 와 동일 신호.
2444
2479
  isRNBridgeMode: () => this._isAuthenticatedViaRNBridge
2445
- }), this.signingOrchestrator = new xr({
2480
+ }), this.signingOrchestrator = new Sr({
2446
2481
  confirmation: this.confirmation,
2447
2482
  walletProvider: this.walletProvider,
2448
2483
  pinOrchestrator: this.pinOrchestrator,
2449
2484
  // §12 native sign delegation: 이 SDK 세션이 RN bridge 자동 로그인으로 인증된 경우만 활성.
2450
2485
  // 자동 로그인 거부 / OAuth 로 별도 로그인한 세션에서는 native SDK 가 미인증이라 우회한다.
2451
2486
  isRNBridgeMode: () => this._isAuthenticatedViaRNBridge
2452
- }), this.walletLifecycleService = new wr({
2487
+ }), this.walletLifecycleService = new Ar({
2453
2488
  walletProvider: this.walletProvider,
2454
2489
  pinOrchestrator: this.pinOrchestrator,
2455
2490
  getUserId: () => this.userId,
2456
2491
  setActiveWallet: (x, y, b) => this.setActiveWallet(x, y, b)
2457
- }), this.migrationOrchestrator = new mr({
2492
+ }), this.migrationOrchestrator = new Ir({
2458
2493
  confirmation: this.confirmation,
2459
2494
  walletProvider: this.walletProvider,
2460
2495
  pinOrchestrator: this.pinOrchestrator,
@@ -2468,21 +2503,21 @@ const ce = class ce extends ar {
2468
2503
  var x;
2469
2504
  return ((x = this._config.migration) == null ? void 0 : x.allowSkip) ?? !0;
2470
2505
  }
2471
- }), this.transactionLifecycleService = new yr({
2506
+ }), this.transactionLifecycleService = new Tr({
2472
2507
  getActiveAddress: () => this.address,
2473
2508
  estimateGas: (x, y) => this.estimateGas(x, y),
2474
2509
  getBaseFeePerGas: (x) => this.getBaseFeePerGas(x),
2475
2510
  jsonRpcCall: (x, y, b) => this.jsonRpc.call(x, y, b)
2476
- }), this.signatureVerifier = new br(this.crypto), this.addressResolverService = new Er({
2511
+ }), this.signatureVerifier = new kr(this.crypto), this.addressResolverService = new Cr({
2477
2512
  walletProvider: this.walletProvider,
2478
2513
  pinOrchestrator: this.pinOrchestrator,
2479
2514
  getActiveAddress: () => this.address,
2480
2515
  getActiveWalletIndex: () => this.activeWalletIndex,
2481
2516
  getUserId: () => this.userId
2482
- }), this.authGuardService = new Ar({
2517
+ }), this.authGuardService = new Pr({
2483
2518
  isInitialized: () => this.initialized,
2484
2519
  isAuthenticated: () => this.authenticated
2485
- }), this.walletCreationService = new Ir({
2520
+ }), this.walletCreationService = new Or({
2486
2521
  walletProvider: this.walletProvider,
2487
2522
  pinOrchestrator: this.pinOrchestrator,
2488
2523
  migrationOrchestrator: this.migrationOrchestrator,
@@ -2494,10 +2529,10 @@ const ce = class ce extends ar {
2494
2529
  var x, y;
2495
2530
  return ((y = (x = this.confirmation).showWalletCreatedPrompt) == null ? void 0 : y.call(x)) ?? Promise.resolve();
2496
2531
  }
2497
- }), this.tokenHistoryService = new kr({
2532
+ }), this.tokenHistoryService = new Dr({
2498
2533
  transport: n,
2499
2534
  getApiBaseUrl: () => this.internalConfig.authApiUrl
2500
- }), this.sessionOrchestrator = new fr({
2535
+ }), this.sessionOrchestrator = new Er({
2501
2536
  ensureInitialized: () => this.ensureInitialized(),
2502
2537
  getSessionSnapshot: () => ({
2503
2538
  providerSub: this.providerSub,
@@ -2520,7 +2555,7 @@ const ce = class ce extends ar {
2520
2555
  loadWalletAfterAuth: () => this.walletLifecycleService.loadWalletAfterAuth(),
2521
2556
  getLocale: () => this._config.locale,
2522
2557
  maskEmail: Ne
2523
- }), this.chainRegistry = h, this.jsonRpc = new or(h, n), this.signInUseCase = new $e(
2558
+ }), this.chainRegistry = h, this.jsonRpc = new ur(h, n), this.signInUseCase = new Me(
2524
2559
  this.internalConfig,
2525
2560
  t,
2526
2561
  s,
@@ -2530,7 +2565,7 @@ const ce = class ce extends ar {
2530
2565
  l,
2531
2566
  void 0,
2532
2567
  () => this._config.locale
2533
- ), this.signOutUseCase = new ir(this.internalConfig, t, l), this.migrateWalletUseCase = new nr(t, a), (w = a.setOnUnauthorized) == null || w.call(a, () => this.forceLogout()), (f = a.setTokenRefresher) == null || f.call(
2568
+ ), this.signOutUseCase = new cr(this.internalConfig, t, l), this.migrateWalletUseCase = new lr(t, a), (m = a.setOnUnauthorized) == null || m.call(a, () => this.forceLogout()), (w = a.setTokenRefresher) == null || w.call(
2534
2569
  a,
2535
2570
  () => this.signInUseCase.refreshAccessToken()
2536
2571
  ), e.autoDetectTheme && this._setupAutoDetectTheme();
@@ -2596,9 +2631,9 @@ const ce = class ce extends ar {
2596
2631
  }
2597
2632
  async _doInitialize(e) {
2598
2633
  var r, t;
2599
- c.log("[CROSSx SDK] v2.4.0 초기화 중..."), this.confirmation.setMessages(Q(this._config.locale));
2634
+ c.log("[CROSSx SDK] v2.5.0-beta.1 초기화 중..."), this.confirmation.setMessages(Q(this._config.locale));
2600
2635
  try {
2601
- const s = ke();
2636
+ const s = Ke();
2602
2637
  this.internalConfig.oauthServiceUrl = s.oauthServiceUrl, this.internalConfig.legacyOauthServiceUrl = s.legacyOauthServiceUrl, this.internalConfig.authApiUrl = s.authApiUrl, this.internalConfig.walletGatewayUrl = s.walletGatewayUrl, this.adapterConfig.gatewayUrl = s.walletGatewayUrl, (t = (r = this.crypto).setJWKSEndpoint) == null || t.call(r, `${s.authApiUrl}/.well-known/jwks.json`);
2603
2638
  const n = this._config.persistWalletPreference !== !1 ? await this.storage.get(
2604
2639
  ce.WALLET_PREF_KEY
@@ -2632,7 +2667,7 @@ const ce = class ce extends ar {
2632
2667
  throw _;
2633
2668
  }
2634
2669
  }
2635
- return this.initialized = !0, c.info("[CROSSx SDK] v2.4.0 초기화 완료"), this.emit("initialized", { restored: !!(l != null && l.success) }), l ?? null;
2670
+ return this.initialized = !0, c.info("[CROSSx SDK] v2.5.0-beta.1 초기화 완료"), this.emit("initialized", { restored: !!(l != null && l.success) }), l ?? null;
2636
2671
  } catch (s) {
2637
2672
  throw new u(d.AUTH_NOT_INITIALIZED, "SDK 초기화에 실패했습니다", s);
2638
2673
  }
@@ -2652,7 +2687,7 @@ const ce = class ce extends ar {
2652
2687
  c.log("[CROSSx] RN Bridge 감지 — Handshake 시도"), c.info("[CROSSx][RNBridge trace] Bootstrap config", {
2653
2688
  appId: this._config.projectId,
2654
2689
  appVersion: "1.0.0",
2655
- sdkVersion: "2.4.0",
2690
+ sdkVersion: "2.5.0-beta.1",
2656
2691
  keyId: "key-id-1",
2657
2692
  userIdHash: "user-hash-placeholder",
2658
2693
  projectId: this._config.projectId
@@ -2660,7 +2695,7 @@ const ce = class ce extends ar {
2660
2695
  const e = new Y({
2661
2696
  appId: this._config.projectId,
2662
2697
  appVersion: "1.0.0",
2663
- sdkVersion: "2.4.0",
2698
+ sdkVersion: "2.5.0-beta.1",
2664
2699
  keyId: "key-id-1",
2665
2700
  userIdHash: "user-hash-placeholder",
2666
2701
  projectId: this._config.projectId
@@ -3298,6 +3333,22 @@ const ce = class ce extends ar {
3298
3333
  var r, t;
3299
3334
  this._config = Object.freeze({ ...this._config, pinKeyboard: e }), (t = (r = this.confirmation).setPinKeyboard) == null || t.call(r, e);
3300
3335
  }
3336
+ /**
3337
+ * 컨펌 모달에 표시할 native 통화 정보를 해결한다.
3338
+ *
3339
+ * 우선순위: `SDKConfig.nativeCurrencies` → 내장 `CHAIN_REGISTRY` → 폴백.
3340
+ *
3341
+ * 폴백(`{ symbol: '', decimals: 18 }`)은 **추측**이다. 심볼이 비면 사용자는
3342
+ * 서명 화면에서 단위 없는 금액을 보고, decimals 가 18 이 아닌 체인이면 금액
3343
+ * 자체가 틀린다. 백엔드 체인 목록은 SDK 릴리즈보다 먼저 늘어날 수 있어 이
3344
+ * 상황은 정상적으로 발생하므로, 조용히 넘어가지 않고 체인당 한 번 경고한다.
3345
+ */
3346
+ resolveNativeCurrency(e) {
3347
+ const r = sr(e, this._config.nativeCurrencies);
3348
+ return r || (this._warnedUnknownNativeCurrency.has(e) || (this._warnedUnknownNativeCurrency.add(e), console.warn(
3349
+ `[CROSSx SDK] ${e} 의 native 통화 정보가 없어 심볼을 비우고 decimals 를 18 로 가정합니다. 컨펌 모달 금액이 단위 없이 표시되며, decimals 가 18 이 아니면 금액이 틀립니다. SDKConfig.nativeCurrencies 에 { '${e}': { symbol, decimals } } 를 넘겨 주세요.`
3350
+ )), rr);
3351
+ }
3301
3352
  /**
3302
3353
  * 지갑 생성/로드 (로그인 후 address가 없는 경우)
3303
3354
  * - exists: Enter Password → POST /mnemonic/addresses
@@ -3336,7 +3387,8 @@ const ce = class ce extends ar {
3336
3387
  });
3337
3388
  return { chainId: e, signature: a.signature, message: r, address: this.address ?? "" };
3338
3389
  } catch (a) {
3339
- if (!ft(a)) throw a;
3390
+ if (!ft(a))
3391
+ throw de(a, d.SIGNATURE_FAILED);
3340
3392
  await this.clearRNBridgeDelegation("native signMessage 가 ERR_BRIDGE_NOT_AUTHORIZED 로 거부"), c.warn("[CROSSx] Bridge 미인증 — 일반 서명 경로로 폴백 (signMessage)");
3341
3393
  }
3342
3394
  if (this.ensureAuthenticated(), !this.userId)
@@ -3407,7 +3459,7 @@ const ce = class ce extends ar {
3407
3459
  throw new u(d.AUTH_NOT_AUTHENTICATED, "사용자 ID를 찾을 수 없습니다");
3408
3460
  if (!this.walletProvider.signTypedData)
3409
3461
  throw new u(d.NOT_IMPLEMENTED, "signTypedData가 구현되어 있지 않습니다");
3410
- ur(e, r);
3462
+ yr(e, r);
3411
3463
  const s = await this.resolveAddress(t == null ? void 0 : t.index);
3412
3464
  try {
3413
3465
  const n = await this.signingOrchestrator.confirmAndExecuteWithPreparedPin({
@@ -3431,7 +3483,7 @@ const ce = class ce extends ar {
3431
3483
  s.address
3432
3484
  )
3433
3485
  });
3434
- return pr(n.signature), {
3486
+ return wr(n.signature), {
3435
3487
  chainId: e,
3436
3488
  signature: n.signature,
3437
3489
  address: s.address
@@ -3479,7 +3531,7 @@ const ce = class ce extends ar {
3479
3531
  throw new u(d.AUTH_NOT_AUTHENTICATED, "사용자 ID를 찾을 수 없습니다");
3480
3532
  const s = await this.transactionLifecycleService.withResolvedGasAndFee(r, e);
3481
3533
  s.from || (s.from = (await this.resolveAddress(t == null ? void 0 : t.index)).address);
3482
- const n = Re(e);
3534
+ const n = this.resolveNativeCurrency(e);
3483
3535
  try {
3484
3536
  const o = await this.signingOrchestrator.confirmAndExecuteWithPreparedPin({
3485
3537
  confirmation: {
@@ -3509,7 +3561,7 @@ const ce = class ce extends ar {
3509
3561
  a
3510
3562
  )
3511
3563
  });
3512
- return hr(o.signature), {
3564
+ return mr(o.signature), {
3513
3565
  chainId: e,
3514
3566
  signedTx: o.signature,
3515
3567
  txHash: o.txHash ?? ""
@@ -3538,7 +3590,7 @@ const ce = class ce extends ar {
3538
3590
  throw new u(d.AUTH_NOT_AUTHENTICATED, "사용자 ID를 찾을 수 없습니다");
3539
3591
  const s = await this.transactionLifecycleService.withResolvedGasAndFee(r, e);
3540
3592
  s.from || (s.from = (await this.resolveAddress(t == null ? void 0 : t.index)).address);
3541
- const n = Re(e);
3593
+ const n = this.resolveNativeCurrency(e);
3542
3594
  try {
3543
3595
  const o = await this.signingOrchestrator.confirmAndExecuteWithPreparedPin({
3544
3596
  confirmation: {
@@ -3578,7 +3630,7 @@ const ce = class ce extends ar {
3578
3630
  return _.txHash ?? _.signature;
3579
3631
  }
3580
3632
  }), a = (r.data ?? "").toLowerCase().replace(/^0x/, ""), l = a === "" || a === "00000000", p = a.startsWith("a9059cbb");
3581
- return (l || p) && this.tokenHistoryService.registerHistoryFireAndForget(e, o, qt).catch(
3633
+ return (l || p) && this.tokenHistoryService.registerHistoryFireAndForget(e, o, zt).catch(
3582
3634
  (h) => c.log("[TokenHistory] register failed (non-critical):", h)
3583
3635
  ), { chainId: e, txHash: o, status: "pending" };
3584
3636
  } catch (o) {
@@ -3610,7 +3662,7 @@ const ce = class ce extends ar {
3610
3662
  * @param opts.timeoutMs 최대 대기 시간 (기본 60000ms)
3611
3663
  */
3612
3664
  async waitForTxAndGetReceipt(e, r, t = {}) {
3613
- const s = t.intervalMs ?? Ut, n = Wt, o = t.timeoutMs ?? Ze, a = Date.now() + o;
3665
+ const s = t.intervalMs ?? Wt, n = Ht, o = t.timeoutMs ?? Ze, a = Date.now() + o;
3614
3666
  let l = s;
3615
3667
  for (; Date.now() < a; ) {
3616
3668
  const p = await this.getTransactionReceipt(e, r);
@@ -3644,35 +3696,35 @@ const ce = class ce extends ar {
3644
3696
  if (b != null && b.sendTransactionWithWaitForReceipt)
3645
3697
  return this.bridgeSendTransactionWithWaitForReceipt(b, e, r, t);
3646
3698
  }
3647
- const { intervalMs: s, timeoutMs: n, ...o } = t, { txHash: a } = await this.sendTransaction(e, r, o), l = s ?? ((x = this._config.receiptPolling) == null ? void 0 : x.intervalMs) ?? Bt, p = n ?? ((y = this._config.receiptPolling) == null ? void 0 : y.timeoutMs) ?? Ze, h = Re(e), _ = r.from ?? "";
3648
- let g, w;
3649
- const f = this.waitForTxAndGetReceipt(a, e, { intervalMs: l, timeoutMs: p }).then((b) => {
3699
+ const { intervalMs: s, timeoutMs: n, ...o } = t, { txHash: a } = await this.sendTransaction(e, r, o), l = s ?? ((x = this._config.receiptPolling) == null ? void 0 : x.intervalMs) ?? Ut, p = n ?? ((y = this._config.receiptPolling) == null ? void 0 : y.timeoutMs) ?? Ze, h = this.resolveNativeCurrency(e), _ = r.from ?? "";
3700
+ let g, m;
3701
+ const w = this.waitForTxAndGetReceipt(a, e, { intervalMs: l, timeoutMs: p }).then((b) => {
3650
3702
  g = b;
3651
- const E = BigInt(b.gasUsed) * BigInt(b.effectiveGasPrice), A = r.value ? BigInt(r.value) : 0n, T = be(r.value, h.symbol, h.decimals, this._config.displayDecimals), R = be("0x" + E.toString(16), h.symbol, h.decimals, this._config.displayDecimals), D = be("0x" + (A + E).toString(16), h.symbol, h.decimals, this._config.displayDecimals);
3703
+ const E = BigInt(b.gasUsed) * BigInt(b.effectiveGasPrice), A = r.value ? BigInt(r.value) : 0n, k = Se(r.value, h.symbol, h.decimals, this._config.displayDecimals), R = Se("0x" + E.toString(16), h.symbol, h.decimals, this._config.displayDecimals), D = Se("0x" + (A + E).toString(16), h.symbol, h.decimals, this._config.displayDecimals);
3652
3704
  return {
3653
3705
  chainId: e,
3654
3706
  txHash: a,
3655
3707
  from: b.from,
3656
3708
  to: b.to ?? r.to,
3657
- amount: T,
3709
+ amount: k,
3658
3710
  fees: R,
3659
3711
  total: D,
3660
3712
  nativeSymbol: h.symbol,
3661
3713
  status: b.status === "0x1" ? "success" : "reverted"
3662
3714
  };
3663
- }).catch((b) => (w = b instanceof Error ? b : new Error(String(b)), {
3715
+ }).catch((b) => (m = b instanceof Error ? b : new Error(String(b)), {
3664
3716
  chainId: e,
3665
3717
  txHash: a,
3666
3718
  from: _,
3667
3719
  to: r.to,
3668
- amount: be(r.value, h.symbol, h.decimals, this._config.displayDecimals),
3720
+ amount: Se(r.value, h.symbol, h.decimals, this._config.displayDecimals),
3669
3721
  nativeSymbol: h.symbol,
3670
3722
  status: "timeout"
3671
3723
  }));
3672
3724
  if (await this.confirmation.showTransactionProgress(
3673
3725
  { chainId: e, txHash: a, from: _, to: r.to },
3674
- f
3675
- ), w) throw w;
3726
+ w
3727
+ ), m) throw m;
3676
3728
  return { chainId: e, txHash: a, receipt: g };
3677
3729
  }
3678
3730
  /**
@@ -3680,25 +3732,30 @@ const ce = class ce extends ar {
3680
3732
  * Native CROSSx SDK 가 sign / broadcast / receipt 폴링 + 자체 결과 UI 까지 통합 처리.
3681
3733
  */
3682
3734
  async bridgeSendTransactionWithWaitForReceipt(e, r, t, s) {
3683
- const n = await e.sendTransactionWithWaitForReceipt({
3684
- chainId: r,
3685
- tx: {
3686
- to: t.to,
3687
- value: t.value,
3688
- data: t.data,
3689
- gasLimit: t.gasLimit,
3690
- gasPrice: t.gasPrice,
3691
- maxFeePerGas: t.maxFeePerGas,
3692
- maxPriorityFeePerGas: t.maxPriorityFeePerGas,
3693
- nonce: t.nonce
3694
- },
3695
- from: t.from,
3696
- dappName: s.dappName ?? this._config.appName,
3697
- accountName: s.accountName,
3698
- index: s.index,
3699
- timeoutMs: s.timeoutMs,
3700
- pollIntervalMs: s.intervalMs
3701
- });
3735
+ let n;
3736
+ try {
3737
+ n = await e.sendTransactionWithWaitForReceipt({
3738
+ chainId: r,
3739
+ tx: {
3740
+ to: t.to,
3741
+ value: t.value,
3742
+ data: t.data,
3743
+ gasLimit: t.gasLimit,
3744
+ gasPrice: t.gasPrice,
3745
+ maxFeePerGas: t.maxFeePerGas,
3746
+ maxPriorityFeePerGas: t.maxPriorityFeePerGas,
3747
+ nonce: t.nonce
3748
+ },
3749
+ from: t.from,
3750
+ dappName: s.dappName ?? this._config.appName,
3751
+ accountName: s.accountName,
3752
+ index: s.index,
3753
+ timeoutMs: s.timeoutMs,
3754
+ pollIntervalMs: s.intervalMs
3755
+ });
3756
+ } catch (o) {
3757
+ throw de(o, d.TRANSACTION_FAILED);
3758
+ }
3702
3759
  return {
3703
3760
  chainId: r,
3704
3761
  txHash: n.txHash,
@@ -3823,6 +3880,7 @@ const ce = class ce extends ar {
3823
3880
  try {
3824
3881
  return await this.walletRpc("eth_estimateGas", [t], r);
3825
3882
  } catch (s) {
3883
+ if (s instanceof u && s.code === d.EXECUTION_REVERTED) throw s;
3826
3884
  const n = s instanceof Error ? s.message : String(s);
3827
3885
  throw new u(d.GAS_ESTIMATION_FAILED, `가스 추정에 실패했습니다 (${r}): ${n}`, s);
3828
3886
  }
@@ -3899,7 +3957,7 @@ const ce = class ce extends ar {
3899
3957
  return { wei: "0x0", formatted: "0", chainId: e };
3900
3958
  try {
3901
3959
  const s = await this.jsonRpc.call("eth_getBalance", [r, "latest"], e) ?? "0x0";
3902
- return { wei: s, formatted: dr(s, this._config.displayDecimals), chainId: e };
3960
+ return { wei: s, formatted: fr(s, this._config.displayDecimals), chainId: e };
3903
3961
  } catch (t) {
3904
3962
  if (t instanceof u) throw t;
3905
3963
  const s = t instanceof Error ? t.message : String(t);
@@ -3927,7 +3985,7 @@ const ce = class ce extends ar {
3927
3985
  getProvider(e) {
3928
3986
  this.ensureAuthenticated();
3929
3987
  let r = this._providers.get(e);
3930
- return r || (r = new er(this, e), this._providers.set(e, r)), r;
3988
+ return r || (r = new ir(this, e), this._providers.set(e, r)), r;
3931
3989
  }
3932
3990
  /**
3933
3991
  * EIP-1193 `accountsChanged` 이벤트를 모든 활성 provider 인스턴스에 dispatch 한다.
@@ -4170,8 +4228,8 @@ const ce = class ce extends ar {
4170
4228
  }
4171
4229
  };
4172
4230
  ce.WALLET_PREF_KEY = "wallet_preference", ce.OFFCHAIN_CHAIN_ID = "0";
4173
- let Be = ce;
4174
- class Tr {
4231
+ let $e = ce;
4232
+ class Lr {
4175
4233
  constructor() {
4176
4234
  this.prefix = "crossx_";
4177
4235
  }
@@ -4208,21 +4266,66 @@ class Tr {
4208
4266
  }
4209
4267
  }
4210
4268
  }
4211
- const Pe = "crossx-sdk", Rr = 1, j = "data", ie = "keys", ve = "aes-primary", Nr = 12;
4212
- class lt {
4269
+ const ve = "crossx-sdk", lt = 1, z = "data", se = "keys", Ee = "aes-primary", Fr = 12;
4270
+ class dt {
4213
4271
  constructor(e) {
4214
4272
  this.db = null, this.cryptoKey = null, this.initPromise = null, this.dbName = `crossx-sdk-${e}`;
4215
4273
  }
4216
4274
  async ensureReady() {
4217
4275
  this.db && this.cryptoKey || (this.initPromise || (this.initPromise = this.init()), await this.initPromise);
4218
4276
  }
4219
- openDB(e = this.dbName) {
4220
- return new Promise((r, t) => {
4221
- const s = indexedDB.open(e, Rr);
4277
+ openDB() {
4278
+ return new Promise((e, r) => {
4279
+ const t = indexedDB.open(this.dbName, lt);
4280
+ t.onupgradeneeded = () => {
4281
+ const s = t.result;
4282
+ s.objectStoreNames.contains(z) || s.createObjectStore(z), s.objectStoreNames.contains(se) || s.createObjectStore(se);
4283
+ }, t.onsuccess = () => e(t.result), t.onerror = () => r(t.error);
4284
+ });
4285
+ }
4286
+ /**
4287
+ * 레거시 DB 를 **존재할 때만** 연다.
4288
+ *
4289
+ * `indexedDB.open()` 은 DB 가 없으면 새로 만들기 때문에, 마이그레이션 조회만
4290
+ * 하려고 열면 빈 레거시 DB('crossx-sdk')가 생성되어 그대로 남는다. 생성이
4291
+ * 감지되면(onupgradeneeded) 스토어를 만들지 않고 즉시 되돌려 유령 DB 가
4292
+ * 남지 않게 한다.
4293
+ */
4294
+ openLegacyIfExists() {
4295
+ return new Promise((e, r) => {
4296
+ let t = !1;
4297
+ const s = indexedDB.open(ve, lt);
4222
4298
  s.onupgradeneeded = () => {
4299
+ t = !0;
4300
+ }, s.onsuccess = () => {
4223
4301
  const n = s.result;
4224
- n.objectStoreNames.contains(j) || n.createObjectStore(j), n.objectStoreNames.contains(ie) || n.createObjectStore(ie);
4225
- }, s.onsuccess = () => r(s.result), s.onerror = () => t(s.error);
4302
+ if (t) {
4303
+ n.close(), this.deleteDB(ve).then(() => e(null));
4304
+ return;
4305
+ }
4306
+ if (!n.objectStoreNames.contains(se) || !n.objectStoreNames.contains(z)) {
4307
+ n.close(), e(null);
4308
+ return;
4309
+ }
4310
+ e(n);
4311
+ }, s.onerror = () => r(s.error);
4312
+ });
4313
+ }
4314
+ /**
4315
+ * DB 삭제. 다른 탭이 연결을 잡고 있으면 onblocked 로 보류되므로,
4316
+ * 조용히 실패하지 않도록 경고를 남기고 진행한다.
4317
+ */
4318
+ deleteDB(e) {
4319
+ return new Promise((r) => {
4320
+ const t = indexedDB.deleteDatabase(e);
4321
+ t.onsuccess = () => r(), t.onerror = () => {
4322
+ c.warn("[CROSSx] IndexedDB 삭제 실패:", e, t.error), r();
4323
+ }, t.onblocked = () => {
4324
+ c.warn(
4325
+ "[CROSSx] IndexedDB 삭제 보류 — 다른 탭이 DB 를 열고 있습니다:",
4326
+ e
4327
+ ), r();
4328
+ };
4226
4329
  });
4227
4330
  }
4228
4331
  idbGet(e, r) {
@@ -4251,7 +4354,7 @@ class lt {
4251
4354
  }
4252
4355
  async init() {
4253
4356
  this.db = await this.openDB();
4254
- const e = await this.idbGet(ie, ve);
4357
+ const e = await this.idbGet(se, Ee);
4255
4358
  if (e) {
4256
4359
  this.cryptoKey = e;
4257
4360
  return;
@@ -4265,21 +4368,23 @@ class lt {
4265
4368
  { name: "AES-GCM", length: 256 },
4266
4369
  !1,
4267
4370
  ["encrypt", "decrypt"]
4268
- ), await this.idbPut(ie, ve, this.cryptoKey);
4371
+ ), await this.idbPut(se, Ee, this.cryptoKey);
4269
4372
  }
4270
4373
  /**
4271
4374
  * 레거시 DB('crossx-sdk')에서 projectId 스코프 DB로 암호키·데이터 마이그레이션.
4272
4375
  * 마이그레이션 성공 시 레거시 DB 삭제.
4273
4376
  */
4274
4377
  async migrateFromLegacyDB() {
4275
- if (this.dbName === Pe) return null;
4378
+ if (this.dbName === ve) return null;
4276
4379
  try {
4277
- const e = await this.openDB(Pe), r = e.transaction([ie, j], "readonly"), t = r.objectStore(ie).get(ve), s = await new Promise((p, h) => {
4380
+ const e = await this.openLegacyIfExists();
4381
+ if (!e) return null;
4382
+ const r = e.transaction([se, z], "readonly"), t = r.objectStore(se).get(Ee), s = await new Promise((p, h) => {
4278
4383
  t.onsuccess = () => p(t.result), t.onerror = () => h(t.error);
4279
4384
  });
4280
4385
  if (!s)
4281
4386
  return e.close(), null;
4282
- const n = r.objectStore(j).getAll(), o = r.objectStore(j).getAllKeys(), [a, l] = await Promise.all([
4387
+ const n = r.objectStore(z).getAll(), o = r.objectStore(z).getAllKeys(), [a, l] = await Promise.all([
4283
4388
  new Promise((p, h) => {
4284
4389
  n.onsuccess = () => p(n.result), n.onerror = () => h(n.error);
4285
4390
  }),
@@ -4287,16 +4392,16 @@ class lt {
4287
4392
  o.onsuccess = () => p(o.result), o.onerror = () => h(o.error);
4288
4393
  })
4289
4394
  ]);
4290
- e.close(), await this.idbPut(ie, ve, s);
4395
+ e.close(), await this.idbPut(se, Ee, s);
4291
4396
  for (let p = 0; p < l.length; p++)
4292
- await this.idbPut(j, String(l[p]), a[p]);
4293
- return indexedDB.deleteDatabase(Pe), c.log("[CROSSx] IndexedDB 레거시 DB 마이그레이션 완료"), s;
4397
+ await this.idbPut(z, String(l[p]), a[p]);
4398
+ return await this.deleteDB(ve), c.log("[CROSSx] IndexedDB 레거시 DB 마이그레이션 완료"), s;
4294
4399
  } catch (e) {
4295
4400
  return c.warn("[CROSSx] IndexedDB 레거시 DB 마이그레이션 실패:", e), null;
4296
4401
  }
4297
4402
  }
4298
4403
  async encrypt(e) {
4299
- const r = new Uint8Array(Nr);
4404
+ const r = new Uint8Array(Fr);
4300
4405
  crypto.getRandomValues(r);
4301
4406
  const t = new TextEncoder().encode(e), s = await crypto.subtle.encrypt(
4302
4407
  { name: "AES-GCM", iv: r },
@@ -4317,7 +4422,7 @@ class lt {
4317
4422
  try {
4318
4423
  await this.ensureReady();
4319
4424
  const t = JSON.stringify(r), s = await this.encrypt(t);
4320
- await this.idbPut(j, e, s);
4425
+ await this.idbPut(z, e, s);
4321
4426
  } catch (t) {
4322
4427
  throw c.error("[CROSSx] IndexedDB set error:", t), t;
4323
4428
  }
@@ -4325,7 +4430,7 @@ class lt {
4325
4430
  async get(e) {
4326
4431
  try {
4327
4432
  await this.ensureReady();
4328
- const r = await this.idbGet(j, e);
4433
+ const r = await this.idbGet(z, e);
4329
4434
  if (!r) return null;
4330
4435
  const t = await this.decrypt(r);
4331
4436
  return JSON.parse(t);
@@ -4335,14 +4440,14 @@ class lt {
4335
4440
  }
4336
4441
  async remove(e) {
4337
4442
  try {
4338
- await this.ensureReady(), await this.idbDelete(j, e);
4443
+ await this.ensureReady(), await this.idbDelete(z, e);
4339
4444
  } catch (r) {
4340
4445
  throw c.error("[CROSSx] IndexedDB remove error:", r), r;
4341
4446
  }
4342
4447
  }
4343
4448
  async clear() {
4344
4449
  try {
4345
- await this.ensureReady(), await this.idbClear(j);
4450
+ await this.ensureReady(), await this.idbClear(z);
4346
4451
  } catch (e) {
4347
4452
  throw c.error("[CROSSx] IndexedDB clear error:", e), e;
4348
4453
  }
@@ -4354,14 +4459,14 @@ class lt {
4354
4459
  return typeof indexedDB < "u" && typeof crypto < "u" && typeof crypto.subtle < "u";
4355
4460
  }
4356
4461
  }
4357
- const Pr = 60;
4358
- class Cr {
4462
+ const Mr = 60;
4463
+ class $r {
4359
4464
  constructor() {
4360
4465
  this.jwks = null;
4361
4466
  }
4362
4467
  setJWKSEndpoint(e) {
4363
4468
  try {
4364
- this.jwks = Dt(new URL(e)), c.log("[CROSSx] JWKS 엔드포인트 설정:", e);
4469
+ this.jwks = Lt(new URL(e)), c.log("[CROSSx] JWKS 엔드포인트 설정:", e);
4365
4470
  } catch (r) {
4366
4471
  c.warn("[CROSSx] JWKS 엔드포인트 URL 파싱 실패:", r);
4367
4472
  }
@@ -4375,7 +4480,7 @@ class Cr {
4375
4480
  iat: t.iat
4376
4481
  });
4377
4482
  const s = Math.floor(Date.now() / 1e3);
4378
- if (t.exp && t.exp + Pr < s)
4483
+ if (t.exp && t.exp + Mr < s)
4379
4484
  return c.warn("[CROSSx] 토큰 만료:", {
4380
4485
  exp: t.exp,
4381
4486
  now: s,
@@ -4385,7 +4490,7 @@ class Cr {
4385
4490
  return c.warn("[CROSSx] JWT에 sub(사용자ID) 없음"), { payload: t, valid: !1, signatureVerified: !1 };
4386
4491
  if (this.jwks)
4387
4492
  try {
4388
- const { payload: n } = await Lt(e, this.jwks, {
4493
+ const { payload: n } = await Ft(e, this.jwks, {
4389
4494
  algorithms: ["RS256", "ES256"]
4390
4495
  });
4391
4496
  return c.log("[CROSSx] JWT 서명 검증 성공"), {
@@ -4422,28 +4527,28 @@ ${t.length}`
4422
4527
  const o = Je(n), a = r.startsWith("0x") ? r.slice(2) : r;
4423
4528
  if (a.length !== 130)
4424
4529
  throw new Error(`서명 길이가 유효하지 않습니다: 130 hex 문자 예상, 현재 ${a.length}`);
4425
- const l = Or(a), p = l.slice(0, 32), h = l.slice(32, 64), _ = l[64], g = _ >= 27 ? _ - 27 : _, x = new Ft.Signature(
4426
- dt(p),
4427
- dt(h)
4530
+ const l = Br(a), p = l.slice(0, 32), h = l.slice(32, 64), _ = l[64], g = _ >= 27 ? _ - 27 : _, x = new $t.Signature(
4531
+ pt(p),
4532
+ pt(h)
4428
4533
  ).addRecoveryBit(g).recoverPublicKey(o).toBytes(!1).slice(1), y = Je(x);
4429
- return "0x" + $t(y.slice(12));
4534
+ return "0x" + Bt(y.slice(12));
4430
4535
  }
4431
4536
  }
4432
- function Or(i) {
4537
+ function Br(i) {
4433
4538
  const e = new Uint8Array(i.length / 2);
4434
4539
  for (let r = 0; r < e.length; r++)
4435
4540
  e[r] = parseInt(i.substring(r * 2, r * 2 + 2), 16);
4436
4541
  return e;
4437
4542
  }
4438
- function dt(i) {
4543
+ function pt(i) {
4439
4544
  let e = "0x";
4440
4545
  for (const r of i) e += r.toString(16).padStart(2, "0");
4441
4546
  return BigInt(e);
4442
4547
  }
4443
- const pt = 5e3, Dr = "sdk-flags.json";
4444
- class Lr {
4548
+ const Ur = 5e3;
4549
+ class Wr {
4445
4550
  constructor(e, r) {
4446
- this.cachedKey = null, this.cachedVersion = null, this.cachedAt = 0, this.keyInFlight = null, this.keyFailedAt = 0, this.cachedMode = null, this.modeResolvedAt = 0, this.modeInFlight = null, this.required = !1, this.adapterConfig = e, this.transport = r;
4551
+ this.cachedKey = null, this.cachedVersion = null, this.cachedAt = 0, this.keyInFlight = null, this.keyFailedAt = 0, this.required = !1, this.adapterConfig = e, this.transport = r;
4447
4552
  }
4448
4553
  get baseUrl() {
4449
4554
  return this.adapterConfig.gatewayUrl;
@@ -4451,19 +4556,17 @@ class Lr {
4451
4556
  // ── PinEncryptorPort ────────────────────────────────────────────────────────
4452
4557
  async seal(e) {
4453
4558
  if (!e) return e;
4454
- const r = await this.resolveMode();
4455
- if (r === "off") return e;
4456
- const t = r === "on" || this.required;
4457
- if (!t && this.hasFreshFailure()) return e;
4559
+ const r = this.required;
4560
+ if (!r && this.hasFreshFailure()) return e;
4458
4561
  try {
4459
- const { version: s, key: n } = await this.currentKey(), o = await Mr(n, e);
4460
- return `${s}.${Fr(o)}`;
4461
- } catch (s) {
4462
- if (t)
4463
- throw this.keyFailedAt = Date.now(), s instanceof u ? s : new u(
4562
+ const { version: t, key: s } = await this.currentKey(), n = await Hr(s, e);
4563
+ return `${t}.${Gr(n)}`;
4564
+ } catch (t) {
4565
+ if (r)
4566
+ throw this.keyFailedAt = Date.now(), t instanceof u ? t : new u(
4464
4567
  d.PIN_ENCRYPTION_FAILED,
4465
4568
  "PIN 암호화에 실패했습니다. 잠시 후 다시 시도해 주세요.",
4466
- { cause: String(s) }
4569
+ { cause: String(t) }
4467
4570
  );
4468
4571
  return this.keyFailedAt = Date.now(), c.warn(
4469
4572
  "[CROSSx] pin-key 조회 실패 — PIN 평문 전송을 유지합니다",
@@ -4478,61 +4581,31 @@ class Lr {
4478
4581
  this.required || (c.warn("[CROSSx] 게이트웨이가 PIN 암호화를 요구함 — 이후 요청은 항상 암호화합니다"), this.required = !0);
4479
4582
  }
4480
4583
  /**
4481
- * 원격 플래그와 공개키를 미리 받아 둡니다 (fire-and-forget).
4584
+ * 공개키를 미리 받아 둡니다 (fire-and-forget).
4482
4585
  *
4483
- * PIN 입력 직후 첫 요청이 두 번의 네트워크 왕복을 기다리지 않도록, PIN이
4484
- * 필요 없는 초기 호출(`GET /mnemonic/check`) 시점에 호출됩니다. 실패는 무시하며
4485
- * 실제 판정은 {@link seal}에서 다시 이뤄집니다.
4586
+ * PIN 입력 직후 첫 요청이 네트워크 왕복을 기다리지 않도록, PIN이 필요 없는 초기
4587
+ * 호출(`GET /mnemonic/check`) 시점에 호출됩니다. 실패는 무시하며 실제 판정은
4588
+ * {@link seal}에서 다시 이뤄집니다.
4486
4589
  */
4487
4590
  prewarm() {
4488
- this.resolveMode().then((e) => {
4489
- if (e !== "off")
4490
- return this.currentKey().then(
4491
- () => {
4492
- },
4493
- () => {
4494
- }
4495
- );
4496
- }).catch(() => {
4497
- });
4498
- }
4499
- // ── 모드 판정 ───────────────────────────────────────────────────────────────
4500
- async resolveMode() {
4501
- return this.cachedMode && Date.now() - this.modeResolvedAt < zt ? this.cachedMode : this.modeInFlight ? this.modeInFlight : (this.modeInFlight = this.fetchRemoteMode().then((e) => (this.cachedMode = e, this.modeResolvedAt = Date.now(), e)).finally(() => {
4502
- this.modeInFlight = null;
4503
- }), this.modeInFlight);
4504
- }
4505
- /** `{contentsBaseUrl}/sdk-flags.json` 조회. 없거나 실패하면 `auto`. */
4506
- async fetchRemoteMode() {
4507
- let e;
4508
- try {
4509
- e = `${ke().contentsBaseUrl}/${Dr}`;
4510
- } catch {
4511
- return "auto";
4512
- }
4513
- try {
4514
- const r = await this.transport.request({
4515
- url: e,
4516
- method: "GET",
4517
- timeoutMs: pt
4518
- }), t = typeof r.data == "string" ? Wr(r.data) : r.data, s = t == null ? void 0 : t.pinEncryption;
4519
- if (s === "auto" || s === "on" || s === "off")
4520
- return c.log("[CROSSx] 운영 플래그 pinEncryption =", s), s;
4521
- } catch {
4522
- }
4523
- return "auto";
4591
+ this.currentKey().then(
4592
+ () => {
4593
+ },
4594
+ () => {
4595
+ }
4596
+ );
4524
4597
  }
4525
4598
  // ── 공개키 캐시 ─────────────────────────────────────────────────────────────
4526
4599
  hasFreshFailure() {
4527
4600
  return this.keyFailedAt !== 0 && Date.now() - this.keyFailedAt < st;
4528
4601
  }
4529
4602
  async currentKey() {
4530
- return this.cachedKey && this.cachedVersion && Date.now() - this.cachedAt < Vt ? { version: this.cachedVersion, key: this.cachedKey } : this.keyInFlight ? this.keyInFlight : (this.keyInFlight = this.fetchAndImportKey().then((e) => (this.cachedVersion = e.version, this.cachedKey = e.key, this.cachedAt = Date.now(), this.keyFailedAt = 0, c.log("[CROSSx] PIN 공개키 캐시 완료 (keyVersion:", e.version, ")"), e)).finally(() => {
4603
+ return this.cachedKey && this.cachedVersion && Date.now() - this.cachedAt < qt ? { version: this.cachedVersion, key: this.cachedKey } : this.keyInFlight ? this.keyInFlight : (this.keyInFlight = this.fetchAndImportKey().then((e) => (this.cachedVersion = e.version, this.cachedKey = e.key, this.cachedAt = Date.now(), this.keyFailedAt = 0, c.log("[CROSSx] PIN 공개키 캐시 완료 (keyVersion:", e.version, ")"), e)).finally(() => {
4531
4604
  this.keyInFlight = null;
4532
4605
  }), this.keyInFlight);
4533
4606
  }
4534
4607
  async fetchAndImportKey() {
4535
- const e = bt();
4608
+ const e = St();
4536
4609
  if (!e)
4537
4610
  throw new u(
4538
4611
  d.PIN_ENCRYPTION_FAILED,
@@ -4542,16 +4615,16 @@ class Lr {
4542
4615
  url: `${this.baseUrl}/pin-key`,
4543
4616
  method: "GET",
4544
4617
  headers: { "X-Project-Id": this.adapterConfig.projectId },
4545
- timeoutMs: pt
4546
- }), t = Hr(r.data);
4618
+ timeoutMs: Ur
4619
+ }), t = zr(r.data);
4547
4620
  if (!(t != null && t.keyVersion) || !(t != null && t.publicKey))
4548
4621
  throw new u(
4549
4622
  d.PIN_ENCRYPTION_FAILED,
4550
4623
  "pin-key 응답을 해석할 수 없습니다."
4551
4624
  );
4552
- const s = Br(t.publicKey), n = await e.importKey(
4625
+ const s = Vr(t.publicKey), n = await e.importKey(
4553
4626
  "spki",
4554
- Ur(s),
4627
+ qr(s),
4555
4628
  { name: "RSA-OAEP", hash: "SHA-256" },
4556
4629
  !1,
4557
4630
  ["encrypt"]
@@ -4559,8 +4632,8 @@ class Lr {
4559
4632
  return { version: t.keyVersion, key: n };
4560
4633
  }
4561
4634
  }
4562
- async function Mr(i, e) {
4563
- const r = bt();
4635
+ async function Hr(i, e) {
4636
+ const r = St();
4564
4637
  if (!r)
4565
4638
  throw new u(
4566
4639
  d.PIN_ENCRYPTION_FAILED,
@@ -4573,29 +4646,29 @@ async function Mr(i, e) {
4573
4646
  );
4574
4647
  return new Uint8Array(t);
4575
4648
  }
4576
- function bt() {
4649
+ function St() {
4577
4650
  const i = globalThis.crypto;
4578
4651
  return (i == null ? void 0 : i.subtle) ?? null;
4579
4652
  }
4580
- function Fr(i) {
4581
- return $r(i).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
4653
+ function Gr(i) {
4654
+ return Kr(i).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
4582
4655
  }
4583
- const ge = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
4584
- function $r(i) {
4656
+ const fe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
4657
+ function Kr(i) {
4585
4658
  let e = "";
4586
4659
  for (let r = 0; r < i.length; r += 3) {
4587
4660
  const t = i[r], s = i[r + 1], n = i[r + 2];
4588
- e += ge[t >> 2], e += ge[(t & 3) << 4 | (s ?? 0) >> 4], e += s === void 0 ? "=" : ge[(s & 15) << 2 | (n ?? 0) >> 6], e += n === void 0 ? "=" : ge[n & 63];
4661
+ e += fe[t >> 2], e += fe[(t & 3) << 4 | (s ?? 0) >> 4], e += s === void 0 ? "=" : fe[(s & 15) << 2 | (n ?? 0) >> 6], e += n === void 0 ? "=" : fe[n & 63];
4589
4662
  }
4590
4663
  return e;
4591
4664
  }
4592
- function Br(i) {
4665
+ function Vr(i) {
4593
4666
  const e = i.replace(/-----BEGIN [A-Z ]+-----/g, "").replace(/-----END [A-Z ]+-----/g, "").replace(/\s+/g, "").replace(/-/g, "+").replace(/_/g, "/"), r = e.length % 4 === 0 ? e : e + "=".repeat(4 - e.length % 4), t = [];
4594
4667
  for (let s = 0; s < r.length; s += 4) {
4595
4668
  const n = [0, 1, 2, 3].map((o) => {
4596
4669
  const a = r[s + o];
4597
4670
  if (a === "=" || a === void 0) return -1;
4598
- const l = ge.indexOf(a);
4671
+ const l = fe.indexOf(a);
4599
4672
  if (l === -1)
4600
4673
  throw new u(
4601
4674
  d.PIN_ENCRYPTION_FAILED,
@@ -4607,18 +4680,11 @@ function Br(i) {
4607
4680
  }
4608
4681
  return new Uint8Array(t);
4609
4682
  }
4610
- function Ur(i) {
4683
+ function qr(i) {
4611
4684
  const e = new Uint8Array(i.length);
4612
4685
  return e.set(i), e.buffer;
4613
4686
  }
4614
- function Wr(i) {
4615
- try {
4616
- return JSON.parse(i);
4617
- } catch {
4618
- return null;
4619
- }
4620
- }
4621
- function Hr(i) {
4687
+ function zr(i) {
4622
4688
  if (!i || typeof i != "object") return null;
4623
4689
  const e = i;
4624
4690
  if (typeof e.code == "number") {
@@ -4632,8 +4698,8 @@ function Hr(i) {
4632
4698
  }
4633
4699
  return typeof e.keyVersion == "string" && typeof e.publicKey == "string" ? e : null;
4634
4700
  }
4635
- const Gr = 3e4, Kr = 1e3;
4636
- class Vr {
4701
+ const jr = 3e4, Yr = 1e3;
4702
+ class Xr {
4637
4703
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4638
4704
  async request(e) {
4639
4705
  const r = e.retries ?? 0;
@@ -4644,7 +4710,7 @@ class Vr {
4644
4710
  } catch (s) {
4645
4711
  if (t === r) throw s;
4646
4712
  }
4647
- await new Promise((s) => setTimeout(s, Kr * 2 ** t));
4713
+ await new Promise((s) => setTimeout(s, Yr * 2 ** t));
4648
4714
  }
4649
4715
  throw new Error("Unexpected: retry loop exited without result");
4650
4716
  }
@@ -4652,7 +4718,7 @@ class Vr {
4652
4718
  async _doRequest(e) {
4653
4719
  const r = new AbortController(), t = setTimeout(
4654
4720
  () => r.abort(),
4655
- e.timeoutMs ?? Gr
4721
+ e.timeoutMs ?? jr
4656
4722
  );
4657
4723
  try {
4658
4724
  const s = await fetch(e.url, {
@@ -4679,7 +4745,7 @@ class Vr {
4679
4745
  }
4680
4746
  }
4681
4747
  }
4682
- const zr = [
4748
+ const Jr = [
4683
4749
  /CROSSx\/([\d.]+)/i,
4684
4750
  /ONE\s?wallet[^\s/]*\/([\d.]+)/i,
4685
4751
  /ONE\s?pocket[^\s/]*\/([\d.]+)/i
@@ -4687,18 +4753,18 @@ const zr = [
4687
4753
  function Ve() {
4688
4754
  return typeof window > "u" ? void 0 : window;
4689
4755
  }
4690
- function qr() {
4756
+ function Zr() {
4691
4757
  const i = Ve();
4692
4758
  return i == null ? void 0 : i.__crossx;
4693
4759
  }
4694
- function jr(i) {
4760
+ function Qr(i) {
4695
4761
  return i === "ios" || i === "android" ? i : null;
4696
4762
  }
4697
4763
  function Ce() {
4698
4764
  const i = typeof navigator > "u" ? "" : navigator.userAgent;
4699
4765
  return /Android/i.test(i) ? "android" : /iPhone|iPad|iPod|Macintosh/i.test(i) ? "ios" : null;
4700
4766
  }
4701
- function Yr(i, e) {
4767
+ function es(i, e) {
4702
4768
  const r = (o) => o.split(/[^\d]+/).filter((a) => a !== "").map((a) => Number.parseInt(a, 10)), t = r(i), s = r(e), n = Math.max(t.length, s.length);
4703
4769
  for (let o = 0; o < n; o += 1) {
4704
4770
  const a = (t[o] ?? 0) - (s[o] ?? 0);
@@ -4706,7 +4772,7 @@ function Yr(i, e) {
4706
4772
  }
4707
4773
  return 0;
4708
4774
  }
4709
- function Xr() {
4775
+ function ts() {
4710
4776
  const i = Ve();
4711
4777
  if (!i) return !1;
4712
4778
  const e = i.__crossxRNBridge;
@@ -4714,20 +4780,20 @@ function Xr() {
4714
4780
  }
4715
4781
  function ht() {
4716
4782
  const i = typeof navigator > "u" ? "" : navigator.userAgent;
4717
- for (const e of zr) {
4783
+ for (const e of Jr) {
4718
4784
  const r = e.exec(i);
4719
4785
  if (r) return r[1] ?? null;
4720
4786
  }
4721
4787
  }
4722
- function Se() {
4723
- const i = qr();
4788
+ function Ae() {
4789
+ const i = Zr();
4724
4790
  if (i != null && i.browser)
4725
4791
  return {
4726
4792
  version: i.version ?? null,
4727
- platform: jr(i.platform) ?? Ce(),
4793
+ platform: Qr(i.platform) ?? Ce(),
4728
4794
  detectedBy: "marker"
4729
4795
  };
4730
- if (Xr())
4796
+ if (ts())
4731
4797
  return {
4732
4798
  version: ht() ?? null,
4733
4799
  platform: Ce(),
@@ -4736,14 +4802,14 @@ function Se() {
4736
4802
  const e = ht();
4737
4803
  return e !== void 0 ? { version: e, platform: Ce(), detectedBy: "user-agent" } : null;
4738
4804
  }
4739
- function gi() {
4740
- return Se() !== null;
4805
+ function Si() {
4806
+ return Ae() !== null;
4741
4807
  }
4742
- function fi(i = 3e3) {
4743
- const e = Se();
4808
+ function vi(i = 3e3) {
4809
+ const e = Ae();
4744
4810
  return e ? Promise.resolve(e) : Ve() ? new Promise((r) => {
4745
4811
  const t = Date.now(), s = setInterval(() => {
4746
- const n = Se();
4812
+ const n = Ae();
4747
4813
  if (n) {
4748
4814
  clearInterval(s), r(n);
4749
4815
  return;
@@ -4752,16 +4818,16 @@ function fi(i = 3e3) {
4752
4818
  }, 50);
4753
4819
  }) : Promise.resolve(null);
4754
4820
  }
4755
- const Jr = /* @__PURE__ */ new Set([
4821
+ const rs = /* @__PURE__ */ new Set([
4756
4822
  "https://cross-wallet-oauth.crosstoken.io",
4757
4823
  "https://stg-cross-wallet-oauth.crosstoken.io",
4758
4824
  "https://dev-cross-wallet-oauth.crosstoken.io",
4759
4825
  "https://one-wallet-oauth.onechain.nexus",
4760
4826
  "https://stg-one-wallet-oauth.onechain.nexus",
4761
4827
  "https://dev-one-wallet-oauth.onechain.nexus"
4762
- ]), Zr = "crossx://oauth-callback", Qr = "2.3.2";
4763
- function es(i) {
4764
- return i.platform !== "ios" ? !1 : i.version ? Yr(i.version, Qr) <= 0 : !0;
4828
+ ]), ss = "crossx://oauth-callback", is = "2.3.2";
4829
+ function ns(i) {
4830
+ return i.platform !== "ios" ? !1 : i.version ? es(i.version, is) <= 0 : !0;
4765
4831
  }
4766
4832
  class oe {
4767
4833
  constructor() {
@@ -4837,16 +4903,16 @@ class oe {
4837
4903
  }
4838
4904
  openAuth(e) {
4839
4905
  return new Promise((r, t) => {
4840
- const s = Math.max(e.width ?? 500, 500), n = Math.max(e.height ?? 700, 700), o = window.screenX + (window.outerWidth - s) / 2, a = window.screenY + (window.outerHeight - n) / 2, l = oe.generateRandom16Hex(), p = oe.generateRandom16Hex(), h = Se();
4906
+ const s = Math.max(e.width ?? 500, 500), n = Math.max(e.height ?? 700, 700), o = window.screenX + (window.outerWidth - s) / 2, a = window.screenY + (window.outerHeight - n) / 2, l = oe.generateRandom16Hex(), p = oe.generateRandom16Hex(), h = Ae();
4841
4907
  let _ = e.authUrl;
4842
- h && e.legacyAuthUrl && es(h) && (_ = e.legacyAuthUrl, c.info("[CROSSx] 구버전 iOS 지갑 감지 — 이관 전 OAuth 호스트 사용", {
4908
+ h && e.legacyAuthUrl && ns(h) && (_ = e.legacyAuthUrl, c.info("[CROSSx] 구버전 iOS 지갑 감지 — 이관 전 OAuth 호스트 사용", {
4843
4909
  appVersion: h.version ?? "(unknown)",
4844
4910
  detectedBy: h.detectedBy,
4845
4911
  authUrlBase: e.legacyAuthUrl
4846
4912
  }));
4847
- const g = _.includes("?") ? "&" : "?", w = encodeURIComponent(window.location.origin);
4848
- let f = `${_}${g}state=${l}&nonce=${p}&origin=${w}`;
4849
- h && !f.includes("redirectUrl=") && (f += `&redirectUrl=${encodeURIComponent(Zr)}`, c.info("[CROSSx] 지갑 인앱 브라우저 감지 — redirectUrl 콜백 자동 부착", {
4913
+ const g = _.includes("?") ? "&" : "?", m = encodeURIComponent(window.location.origin);
4914
+ let w = `${_}${g}state=${l}&nonce=${p}&origin=${m}`;
4915
+ h && !w.includes("redirectUrl=") && (w += `&redirectUrl=${encodeURIComponent(ss)}`, c.info("[CROSSx] 지갑 인앱 브라우저 감지 — redirectUrl 콜백 자동 부착", {
4850
4916
  detectedBy: h.detectedBy,
4851
4917
  appVersion: h.version ?? "(unknown)",
4852
4918
  platform: h.platform ?? "(unknown)"
@@ -4856,7 +4922,7 @@ class oe {
4856
4922
  authUrlBase: _
4857
4923
  });
4858
4924
  const x = window.open(
4859
- f,
4925
+ w,
4860
4926
  h ? "_blank" : "CROSSx OAuth",
4861
4927
  `width=${s},height=${n},left=${o},top=${a}`
4862
4928
  );
@@ -4865,12 +4931,12 @@ class oe {
4865
4931
  return;
4866
4932
  }
4867
4933
  const y = setTimeout(() => {
4868
- c.warn("[CROSSx] OAuth 타임아웃 (5분) — postMessage를 수신하지 못했습니다"), F(), t(new Error("Authentication timeout"));
4869
- }, 5 * 60 * 1e3), b = 10, E = 30;
4870
- let A = 0, T = null;
4934
+ c.warn("[CROSSx] OAuth 타임아웃 (5분) — postMessage를 수신하지 못했습니다"), M(), t(new Error("Authentication timeout"));
4935
+ }, 300 * 1e3), b = 10, E = 30;
4936
+ let A = 0, k = null;
4871
4937
  const R = () => {
4872
- clearInterval(D), c.warn("[CROSSx] COOP 감지 — OAuth 서버 응답을 " + E + "초간 대기합니다"), T = setTimeout(() => {
4873
- F(), t(new Error(
4938
+ clearInterval(D), c.warn("[CROSSx] COOP 감지 — OAuth 서버 응답을 " + E + "초간 대기합니다"), k = setTimeout(() => {
4939
+ M(), t(new Error(
4874
4940
  "OAuth 서버로부터 응답을 받지 못했습니다. 브라우저 보안 정책(COOP)으로 인해 팝업 통신이 차단되었을 수 있습니다. 다시 시도해 주세요."
4875
4941
  ));
4876
4942
  }, E * 1e3);
@@ -4879,19 +4945,19 @@ class oe {
4879
4945
  try {
4880
4946
  if (!x.closed) return;
4881
4947
  if (!!h) {
4882
- F(), t(new u(d.USER_REJECTED, "로그인이 취소되었습니다"));
4948
+ M(), t(new u(d.USER_REJECTED, "로그인이 취소되었습니다"));
4883
4949
  return;
4884
4950
  }
4885
4951
  const K = typeof document < "u" && document.hasFocus();
4886
- A <= b && !K ? R() : (F(), t(new u(d.USER_REJECTED, "로그인이 취소되었습니다")));
4952
+ A <= b && !K ? R() : (M(), t(new u(d.USER_REJECTED, "로그인이 취소되었습니다")));
4887
4953
  } catch {
4888
4954
  R();
4889
4955
  }
4890
- }, 1e3), F = () => {
4891
- this.abortPending = null, clearTimeout(y), clearInterval(D), T && clearTimeout(T), window.removeEventListener("message", C);
4892
- }, C = (O) => {
4893
- if (!Jr.has(O.origin)) return;
4894
- F();
4956
+ }, 1e3), M = () => {
4957
+ this.abortPending = null, clearTimeout(y), clearInterval(D), k && clearTimeout(k), window.removeEventListener("message", P);
4958
+ }, P = (O) => {
4959
+ if (!rs.has(O.origin)) return;
4960
+ M();
4895
4961
  const K = typeof O.data.status == "string", I = K ? O.data.data ?? {} : O.data;
4896
4962
  c.log("[CROSSx] OAuth postMessage 수신 —", {
4897
4963
  format: K ? "wrapped" : "flat",
@@ -4910,33 +4976,33 @@ class oe {
4910
4976
  c.error("[CROSSx] OAuth 실패:", I.error), t(new Error(I.error || "Authentication failed"));
4911
4977
  return;
4912
4978
  }
4913
- const $ = I == null ? void 0 : I.idToken, X = I == null ? void 0 : I.accessToken, he = X ?? $, me = (I == null ? void 0 : I.email) || void 0;
4979
+ const $ = I == null ? void 0 : I.idToken, X = I == null ? void 0 : I.accessToken, ue = X ?? $, ye = (I == null ? void 0 : I.email) || void 0;
4914
4980
  if (c.log("[CROSSx] OAuth 토큰 수신:", {
4915
4981
  hasAccessToken: !!X,
4916
4982
  hasIdToken: !!$,
4917
- hasEmail: !!me
4918
- }), !he) {
4983
+ hasEmail: !!ye
4984
+ }), !ue) {
4919
4985
  c.error("[CROSSx] 토큰을 찾을 수 없음:", O.data), t(new Error("Token not found in response"));
4920
4986
  return;
4921
4987
  }
4922
- const ue = { token: he, email: me }, se = (_e) => {
4923
- oe.verifyIdTokenNonce(_e, p).then(() => r(ue)).catch((J) => {
4988
+ const _e = { token: ue, email: ye }, ie = (xe) => {
4989
+ oe.verifyIdTokenNonce(xe, p).then(() => r(_e)).catch((J) => {
4924
4990
  c.error("[CROSSx] nonce 검증 실패:", J), t(J instanceof Error ? J : new Error("nonce verification failed"));
4925
4991
  });
4926
4992
  };
4927
- X ? X.split(".").length === 3 ? se(X) : $ ? se($) : (c.warn(
4993
+ X ? X.split(".").length === 3 ? ie(X) : $ ? ie($) : (c.warn(
4928
4994
  "[CROSSx] opaque accessToken만 수신 (idToken 없음) — nonce 검증 불가.",
4929
4995
  "서버 측 nonce 검증이 필요합니다."
4930
- ), r(ue)) : $ ? se($) : t(new Error("Token not found in response"));
4996
+ ), r(_e)) : $ ? ie($) : t(new Error("Token not found in response"));
4931
4997
  };
4932
4998
  this.abortPending = (O) => {
4933
- F(), t(new Error(O));
4934
- }, window.addEventListener("message", C);
4999
+ M(), t(new Error(O));
5000
+ }, window.addEventListener("message", P);
4935
5001
  });
4936
5002
  }
4937
5003
  }
4938
- const xe = "crossx_wallet_data", le = "crossx_mock_pin_hash";
4939
- class ts {
5004
+ const ge = "crossx_wallet_data", le = "crossx_mock_pin_hash";
5005
+ class os {
4940
5006
  constructor(e, r) {
4941
5007
  this.storage = e, this.pinStore = r ?? null;
4942
5008
  }
@@ -4949,13 +5015,13 @@ class ts {
4949
5015
  async checkWallet() {
4950
5016
  if (this.migrateScenario !== void 0)
4951
5017
  return c.log("[Mock] checkWallet → migration_required"), "migration_required";
4952
- const r = await this.storage.get(xe) ? "exists" : "not_found";
5018
+ const r = await this.storage.get(ge) ? "exists" : "not_found";
4953
5019
  return c.log(`[Mock] checkWallet → ${r}`), r;
4954
5020
  }
4955
5021
  async getOrCreateWallet(e) {
4956
5022
  var r;
4957
5023
  try {
4958
- const t = await this.storage.get(xe);
5024
+ const t = await this.storage.get(ge);
4959
5025
  if (t) return t;
4960
5026
  const s = {
4961
5027
  id: e,
@@ -4963,7 +5029,7 @@ class ts {
4963
5029
  derivationPath: "m/44'/60'/0'/0/0",
4964
5030
  createdAt: Date.now()
4965
5031
  };
4966
- await this.storage.set(xe, s);
5032
+ await this.storage.set(ge, s);
4967
5033
  const n = (r = this.pinStore) == null ? void 0 : r.get();
4968
5034
  return n && (await this.storage.set(le, n), c.log("[Mock] 지갑 생성 — PIN 저장됨")), s;
4969
5035
  } catch (t) {
@@ -4972,7 +5038,7 @@ class ts {
4972
5038
  }
4973
5039
  /** GET /mnemonic/addresses 모킹 — PIN 불필요, 캐시된 주소 반환 */
4974
5040
  async getAddresses(e) {
4975
- const r = await this.storage.get(xe);
5041
+ const r = await this.storage.get(ge);
4976
5042
  return r ? [{ address: r.address, index: 0 }] : [];
4977
5043
  }
4978
5044
  async getAddress(e, r) {
@@ -5052,7 +5118,7 @@ class ts {
5052
5118
  derivationPath: "m/44'/60'/0'/0/0",
5053
5119
  createdAt: Date.now()
5054
5120
  };
5055
- await this.storage.set(xe, t);
5121
+ await this.storage.set(ge, t);
5056
5122
  const s = (n = this.pinStore) == null ? void 0 : n.get();
5057
5123
  return s && (await this.storage.set(le, s), c.log("[Mock] 마이그레이션 — PIN 저장됨")), t;
5058
5124
  }
@@ -5081,7 +5147,7 @@ class ts {
5081
5147
  ).join("");
5082
5148
  }
5083
5149
  }
5084
- const rs = ["password", "newPassword", "recoveryPin"];
5150
+ const as = ["password", "newPassword", "recoveryPin"];
5085
5151
  class ae {
5086
5152
  constructor(e, r, t, s, n, o) {
5087
5153
  this._refreshPromise = null, this._walletStatusCache = null, this.adapterConfig = e, this.projectId = e.projectId, this.storage = r, this.transport = t, this.tokenStore = s, this.pinStore = n ?? null, this.pinEncryptor = o ?? null;
@@ -5147,7 +5213,7 @@ class ae {
5147
5213
  async sealPinFields(e) {
5148
5214
  if (!this.pinEncryptor || !e || typeof e != "object") return e;
5149
5215
  let r = null;
5150
- for (const t of rs) {
5216
+ for (const t of as) {
5151
5217
  const s = e[t];
5152
5218
  if (typeof s != "string" || s === "") continue;
5153
5219
  const n = await this.pinEncryptor.seal(s);
@@ -5156,7 +5222,7 @@ class ae {
5156
5222
  return r ?? e;
5157
5223
  }
5158
5224
  async request(e, r, t, s = !1, n = !1) {
5159
- var h, _, g, w;
5225
+ var h, _, g, m;
5160
5226
  const o = await this.ensureValidToken(), a = `${this.baseUrl}${r}`, l = {
5161
5227
  Authorization: `Bearer ${o}`,
5162
5228
  "Content-Type": "application/json",
@@ -5191,16 +5257,16 @@ class ae {
5191
5257
  d.USER_NOT_FOUND,
5192
5258
  ae.getGatewayErrorMessage(x.code, y)
5193
5259
  );
5194
- const E = b === d.AUTH_NOT_AUTHENTICATED ? d.SESSION_EXPIRED : b, A = E === d.SESSION_EXPIRED ? "인증 세션이 만료되었습니다. 다시 로그인해 주세요." : ae.getGatewayErrorMessage(x.code, y), T = x.data;
5260
+ const E = b === d.AUTH_NOT_AUTHENTICATED ? d.SESSION_EXPIRED : b, A = E === d.SESSION_EXPIRED ? "인증 세션이 만료되었습니다. 다시 로그인해 주세요." : ae.getGatewayErrorMessage(x.code, y), k = x.data;
5195
5261
  let R;
5196
- throw b === d.PIN_LOCKED ? R = ae.extractLockDetails(T) : b === d.ADDRESS_LIMIT_EXCEEDED ? R = { limit: Fe, raw: T } : R = T ?? void 0, new u(E, A, R);
5262
+ throw b === d.PIN_LOCKED ? R = ae.extractLockDetails(k) : b === d.ADDRESS_LIMIT_EXCEEDED ? R = { limit: Fe, raw: k } : R = k ?? void 0, new u(E, A, R);
5197
5263
  }
5198
5264
  return c.log("[CROSSx] Wallet Gateway API 성공:", { code: x.code, url: a, method: e }), x.data ?? x;
5199
5265
  }
5200
5266
  return x;
5201
- } catch (f) {
5202
- if (f instanceof u) throw f;
5203
- const x = ((_ = f.response) == null ? void 0 : _.status) ?? f.status;
5267
+ } catch (w) {
5268
+ if (w instanceof u) throw w;
5269
+ const x = ((_ = w.response) == null ? void 0 : _.status) ?? w.status;
5204
5270
  if ((x === 401 || x === 403) && !s && this._onTokenRefresh) {
5205
5271
  if (c.warn(`[CROSSx] HTTP ${x} 감지 — 토큰 갱신 후 재시도`), await this.deduplicatedRefresh())
5206
5272
  return this.request(e, r, t, !0, n);
@@ -5209,20 +5275,20 @@ class ae {
5209
5275
  "인증 세션이 만료되었습니다. 다시 로그인해 주세요."
5210
5276
  );
5211
5277
  }
5212
- if ((g = f.response) != null && g.data) {
5213
- const y = f.response.data, b = y.message || y.data || "API 요청에 실패했습니다", E = y.code || "UNKNOWN";
5278
+ if ((g = w.response) != null && g.data) {
5279
+ const y = w.response.data, b = y.message || y.data || "API 요청에 실패했습니다", E = y.code || "UNKNOWN";
5214
5280
  throw c.error("[CROSSx] Wallet Gateway API 에러 (HTTP 에러):", {
5215
5281
  code: E,
5216
5282
  message: b,
5217
5283
  url: a,
5218
5284
  method: e,
5219
- status: (w = f.response) == null ? void 0 : w.status
5285
+ status: (m = w.response) == null ? void 0 : m.status
5220
5286
  }), new u(
5221
5287
  d.UNKNOWN_ERROR,
5222
5288
  `Wallet Gateway 오류 (${E}): ${b}`
5223
5289
  );
5224
5290
  }
5225
- throw f;
5291
+ throw w;
5226
5292
  }
5227
5293
  }
5228
5294
  /**
@@ -5472,16 +5538,20 @@ class ae {
5472
5538
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5473
5539
  static mapGatewayError(e, r) {
5474
5540
  switch (e) {
5541
+ // 인증 관련
5475
5542
  case -10002:
5476
5543
  return d.AUTH_NOT_AUTHENTICATED;
5544
+ // 클라이언트 버그 (정상 운영 시 발생 안 함)
5477
5545
  case -10001:
5478
5546
  return d.UNKNOWN_ERROR;
5547
+ // 서버 내부 / 재시도 권장
5479
5548
  case -10006:
5480
5549
  return d.GATEWAY_INTERNAL_ERROR;
5481
5550
  case -10007:
5482
5551
  return d.BROADCAST_FAILED;
5483
5552
  case -10008:
5484
5553
  return d.GATEWAY_LOCK_CONFLICT;
5554
+ // 지갑 상태
5485
5555
  case -10004:
5486
5556
  return d.WALLET_ALREADY_EXISTS;
5487
5557
  case -10005:
@@ -5490,6 +5560,7 @@ class ae {
5490
5560
  return d.WALLET_NOT_FOUND;
5491
5561
  case -10030:
5492
5562
  return d.WALLET_INCONSISTENT_STATE;
5563
+ // 마이그레이션
5493
5564
  case -10010:
5494
5565
  return d.MIGRATION_FAILED;
5495
5566
  case -10012:
@@ -5502,6 +5573,7 @@ class ae {
5502
5573
  return d.ADDRESS_LIMIT_EXCEEDED;
5503
5574
  case -10027:
5504
5575
  return d.MIGRATION_PIN_LOCKED;
5576
+ // 프로젝트 접근 제어
5505
5577
  case -10022:
5506
5578
  return d.PROJECT_NOT_REGISTERED;
5507
5579
  case -10023:
@@ -5510,6 +5582,7 @@ class ae {
5510
5582
  return d.ORIGIN_NOT_ALLOWED;
5511
5583
  case -10025:
5512
5584
  return d.INVALID_APP_TYPE;
5585
+ // PIN 관련
5513
5586
  case -10028:
5514
5587
  return ae.hasLockInfo(r) ? d.PIN_LOCKED : d.PIN_WRONG;
5515
5588
  case -10029:
@@ -5522,21 +5595,28 @@ class ae {
5522
5595
  return d.PIN_ENCRYPTION_INVALID;
5523
5596
  case -10046:
5524
5597
  return d.PIN_POLICY_VIOLATION;
5598
+ // EIP-712 domain chainId mismatch
5525
5599
  case -10026:
5526
5600
  return d.TYPED_DATA_CHAIN_ID_MISMATCH;
5601
+ // Prepare
5527
5602
  case -10014:
5603
+ // Invalid prepare action
5528
5604
  case -10015:
5605
+ // Invalid prepare params
5529
5606
  case -10019:
5530
5607
  return d.PREPARE_FAILED;
5531
5608
  case -10016:
5532
5609
  return d.PREPARE_EXPIRED;
5533
5610
  case -10017:
5611
+ // Prepare action mismatch
5534
5612
  case -10018:
5535
5613
  return d.PREPARE_MISMATCH;
5614
+ // 체인 관련
5536
5615
  case -10020:
5537
5616
  return d.CHAIN_NOT_SUPPORTED;
5538
5617
  case -10021:
5539
5618
  return d.INVALID_CHAIN;
5619
+ // HMAC
5540
5620
  case -10040:
5541
5621
  return d.HMAC_REQUIRED;
5542
5622
  case -10041:
@@ -5600,7 +5680,7 @@ class ae {
5600
5680
  }
5601
5681
  }
5602
5682
  }
5603
- class ss {
5683
+ class cs {
5604
5684
  constructor(e, r, t, s = () => {
5605
5685
  }, n = () => {
5606
5686
  }, o = () => {
@@ -5656,7 +5736,8 @@ class ss {
5656
5736
  format: "hex"
5657
5737
  };
5658
5738
  } catch (l) {
5659
- if (!await this.recoverFromUnauthorized(l, e, o, "signMessage")) throw l;
5739
+ if (!await this.recoverFromUnauthorized(l, e, o, "signMessage"))
5740
+ throw de(l, d.SIGNATURE_FAILED);
5660
5741
  }
5661
5742
  }
5662
5743
  return this.inner.signMessage(e, r, t, s, n, o);
@@ -5679,7 +5760,8 @@ class ss {
5679
5760
  format: "hex"
5680
5761
  };
5681
5762
  } catch (l) {
5682
- if (!await this.recoverFromUnauthorized(l, e, o, "signTypedData")) throw l;
5763
+ if (!await this.recoverFromUnauthorized(l, e, o, "signTypedData"))
5764
+ throw de(l, d.SIGNATURE_FAILED);
5683
5765
  }
5684
5766
  }
5685
5767
  if (!this.inner.signTypedData)
@@ -5705,7 +5787,7 @@ class ss {
5705
5787
  };
5706
5788
  } catch (a) {
5707
5789
  if (!await this.recoverFromUnauthorized(a, e, t.from, "signTransaction"))
5708
- throw a;
5790
+ throw de(a, d.SIGNATURE_FAILED);
5709
5791
  }
5710
5792
  }
5711
5793
  return this.inner.signTransaction(e, r, t, s, n);
@@ -5723,7 +5805,7 @@ class ss {
5723
5805
  })).txHash };
5724
5806
  } catch (o) {
5725
5807
  if (!await this.recoverFromUnauthorized(o, e, t.from, "sendTransaction"))
5726
- throw o;
5808
+ throw de(o, d.TRANSACTION_FAILED);
5727
5809
  }
5728
5810
  }
5729
5811
  if (!this.inner.sendTransaction)
@@ -5761,7 +5843,7 @@ class ss {
5761
5843
  (t = (r = this.inner).setTokenRefresher) == null || t.call(r, e);
5762
5844
  }
5763
5845
  }
5764
- class we {
5846
+ class me {
5765
5847
  constructor(e, r) {
5766
5848
  this.cache = /* @__PURE__ */ new Map(), this.loadedAt = 0, this.usingFallback = !1, this._fetchPromise = null, this.adapterConfig = e, this.projectId = e.projectId, this.transport = r;
5767
5849
  }
@@ -5782,7 +5864,7 @@ class we {
5782
5864
  const r = e.data.chains;
5783
5865
  return this.populateCache(r, !1), r;
5784
5866
  } catch {
5785
- const e = we.fallbackChains();
5867
+ const e = me.fallbackChains();
5786
5868
  return this.populateCache(e, !0), e;
5787
5869
  }
5788
5870
  }
@@ -5796,7 +5878,7 @@ class we {
5796
5878
  }
5797
5879
  isCacheValid() {
5798
5880
  if (this.loadedAt === 0) return !1;
5799
- const e = this.usingFallback ? Kt : Gt;
5881
+ const e = this.usingFallback ? Vt : Kt;
5800
5882
  return e === 0 ? !0 : Date.now() - this.loadedAt < e;
5801
5883
  }
5802
5884
  populateCache(e, r) {
@@ -5818,13 +5900,13 @@ class we {
5818
5900
  if (e.code < 0) {
5819
5901
  const r = typeof e.data == "string" ? e.data : e.message ?? "체인 레지스트리 요청에 실패했습니다";
5820
5902
  throw new u(
5821
- we.mapErrorCode(e.code),
5903
+ me.mapErrorCode(e.code),
5822
5904
  r
5823
5905
  );
5824
5906
  }
5825
5907
  }
5826
5908
  fallbackOrThrow(e) {
5827
- const r = we.fallbackChains().find(
5909
+ const r = me.fallbackChains().find(
5828
5910
  (t) => t.chainId === e
5829
5911
  );
5830
5912
  if (r) return r;
@@ -5834,7 +5916,7 @@ class we {
5834
5916
  );
5835
5917
  }
5836
5918
  static fallbackChains() {
5837
- return Object.values(Ie).map((e) => ({
5919
+ return Object.values(ke).map((e) => ({
5838
5920
  chainId: e.caipId,
5839
5921
  rpcUrl: e.rpcUrl
5840
5922
  }));
@@ -5858,7 +5940,7 @@ class we {
5858
5940
  }
5859
5941
  }
5860
5942
  }
5861
- const ut = "__crossx-confirm-style", U = "__crossx-confirm-overlay", is = {
5943
+ const ut = "__crossx-confirm-style", U = "__crossx-confirm-overlay", ls = {
5862
5944
  light: {
5863
5945
  bg: "#FFFFFF",
5864
5946
  border: "rgba(0,0,0,0.07)",
@@ -5927,7 +6009,7 @@ const ut = "__crossx-confirm-style", U = "__crossx-confirm-overlay", is = {
5927
6009
  }
5928
6010
  };
5929
6011
  function _t(i, e) {
5930
- const r = is[i], t = e == null ? void 0 : e[i];
6012
+ const r = ls[i], t = e == null ? void 0 : e[i];
5931
6013
  return t ? {
5932
6014
  ...r,
5933
6015
  // ── Brand
@@ -5961,7 +6043,7 @@ function _t(i, e) {
5961
6043
  ...t.error !== void 0 && { errorColor: t.error }
5962
6044
  } : r;
5963
6045
  }
5964
- const ns = `
6046
+ const ds = `
5965
6047
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400&family=Sora:wght@400;600&display=swap');
5966
6048
 
5967
6049
  #${U} {
@@ -8564,9 +8646,9 @@ button.__crossx-connect-other-block:active {
8564
8646
  `;
8565
8647
  function V() {
8566
8648
  let i = document.getElementById(ut);
8567
- i || (i = document.createElement("style"), i.id = ut, document.head.appendChild(i)), i.textContent = ns;
8649
+ i || (i = document.createElement("style"), i.id = ut, document.head.appendChild(i)), i.textContent = ds;
8568
8650
  }
8569
- function os() {
8651
+ function ps() {
8570
8652
  const i = `#${U}`, e = (t) => {
8571
8653
  var s, n;
8572
8654
  (n = (s = t.target) == null ? void 0 : s.closest) != null && n.call(s, i) && t.stopImmediatePropagation();
@@ -8578,7 +8660,7 @@ function os() {
8578
8660
  document.removeEventListener("focusin", e, !0), document.removeEventListener("focusout", r, !0);
8579
8661
  };
8580
8662
  }
8581
- function z(i) {
8663
+ function q(i) {
8582
8664
  const e = i.querySelector(".__crossx-card");
8583
8665
  if (e) {
8584
8666
  const a = (e.getAttribute("style") ?? "").match(/--cx-bg:\s*([^;]+)/);
@@ -8606,12 +8688,12 @@ function z(i) {
8606
8688
  }
8607
8689
  o.preventDefault();
8608
8690
  }, { passive: !1 });
8609
- const t = os(), s = as(i), n = i.remove.bind(i);
8691
+ const t = ps(), s = hs(i), n = i.remove.bind(i);
8610
8692
  i.remove = () => {
8611
8693
  s(), t(), n();
8612
8694
  }, document.body.appendChild(i);
8613
8695
  }
8614
- function as(i) {
8696
+ function hs(i) {
8615
8697
  if (typeof window > "u") return () => {
8616
8698
  };
8617
8699
  const e = window.visualViewport;
@@ -8626,7 +8708,7 @@ function as(i) {
8626
8708
  e.removeEventListener("resize", t), e.removeEventListener("scroll", t), i.style.removeProperty("--cx-keyboard-inset");
8627
8709
  };
8628
8710
  }
8629
- function cs(i) {
8711
+ function us(i) {
8630
8712
  const e = Array.from(i.querySelectorAll(".__crossx-amount-tip"));
8631
8713
  if (!e.length) return;
8632
8714
  const r = document.createElement("div");
@@ -8650,9 +8732,9 @@ function cs(i) {
8650
8732
  o.target.closest(".__crossx-amount-tip") || n();
8651
8733
  }, { passive: !0 });
8652
8734
  }
8653
- const ls = () => /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
8735
+ const _s = () => /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
8654
8736
  function ne() {
8655
- if (ls()) {
8737
+ if (_s()) {
8656
8738
  const e = window.scrollY;
8657
8739
  return document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = "0", document.body.style.right = "0", () => {
8658
8740
  document.body.style.position = "", document.body.style.top = "", document.body.style.left = "", document.body.style.right = "", window.scrollTo(0, e);
@@ -8669,15 +8751,15 @@ function te(i) {
8669
8751
  function vt(i) {
8670
8752
  return i ? i.length <= 13 ? i : `${i.slice(0, 6)}...${i.slice(-4)}` : "—";
8671
8753
  }
8672
- function St(i, e = "ONE", r = 18, t = 6) {
8754
+ function Et(i, e = "ONE", r = 18, t = 6) {
8673
8755
  if (!i || i === "0x" || i === "0x0") return null;
8674
8756
  try {
8675
8757
  const s = BigInt(i);
8676
8758
  if (s === 0n) return null;
8677
- const n = He(s, r, t);
8759
+ const n = We(s, r, t);
8678
8760
  if (n === "0") return null;
8679
- const o = Ue(s, r);
8680
- return We(`${n} ${e}`, `${o} ${e}`);
8761
+ const o = Be(s, r);
8762
+ return Ue(`${n} ${e}`, `${o} ${e}`);
8681
8763
  } catch {
8682
8764
  return null;
8683
8765
  }
@@ -8704,60 +8786,60 @@ const xt = {
8704
8786
  202601: "Ronin Saigon",
8705
8787
  612044: "ONEchain Testnet",
8706
8788
  612055: "CROSS Mainnet"
8707
- }, ze = /* @__PURE__ */ new Map();
8708
- let Oe = !1;
8709
- function ds() {
8710
- if (Oe || (Oe = !0, typeof fetch > "u")) return;
8711
- const i = ke().contentsBaseUrl;
8789
+ }, qe = /* @__PURE__ */ new Map();
8790
+ let Pe = !1;
8791
+ function xs() {
8792
+ if (Pe || (Pe = !0, typeof fetch > "u")) return;
8793
+ const i = Ke().contentsBaseUrl;
8712
8794
  i && fetch(`${i}/chains.json`, { cache: "no-store" }).then((e) => e.ok ? e.json() : null).then((e) => {
8713
8795
  const r = e == null ? void 0 : e.chains;
8714
8796
  if (r)
8715
8797
  for (const [t, s] of Object.entries(r)) {
8716
8798
  const n = Number(t);
8717
- !Number.isNaN(n) && s && ze.set(n, s);
8799
+ !Number.isNaN(n) && s && qe.set(n, s);
8718
8800
  }
8719
8801
  }).catch(() => {
8720
- Oe = !1;
8802
+ Pe = !1;
8721
8803
  });
8722
8804
  }
8723
- function Et(i) {
8805
+ function At(i) {
8724
8806
  return parseInt(i.split(":")[1] ?? "", 10);
8725
8807
  }
8726
- function At(i) {
8808
+ function It(i) {
8727
8809
  var r;
8728
- const e = Et(i);
8810
+ const e = At(i);
8729
8811
  if (!isNaN(e)) {
8730
- const t = (r = ze.get(e)) == null ? void 0 : r.name;
8812
+ const t = (r = qe.get(e)) == null ? void 0 : r.name;
8731
8813
  if (t) return t;
8732
8814
  if (xt[e]) return xt[e];
8733
8815
  }
8734
8816
  return i;
8735
8817
  }
8736
- function qe(i, e) {
8818
+ function ze(i, e) {
8737
8819
  var r;
8738
8820
  if (i) {
8739
- const t = Et(i);
8821
+ const t = At(i);
8740
8822
  if (!isNaN(t)) {
8741
- const s = (r = ze.get(t)) == null ? void 0 : r.nativeSymbol;
8823
+ const s = (r = qe.get(t)) == null ? void 0 : r.nativeSymbol;
8742
8824
  if (s) return s;
8743
8825
  }
8744
8826
  }
8745
8827
  return e;
8746
8828
  }
8747
- function Ue(i, e) {
8829
+ function Be(i, e) {
8748
8830
  if (i === 0n) return "0";
8749
8831
  const r = 10n ** BigInt(e), t = i / r, n = (i % r).toString().padStart(e, "0").replace(/0+$/, "");
8750
8832
  return n ? `${t}.${n}` : `${t}`;
8751
8833
  }
8752
- function We(i, e) {
8753
- return i === e ? m(i) : `<span class="__crossx-amount-tip" data-full="${m(e)}">${m(i)}</span>`;
8834
+ function Ue(i, e) {
8835
+ return i === e ? f(i) : `<span class="__crossx-amount-tip" data-full="${f(e)}">${f(i)}</span>`;
8754
8836
  }
8755
- function He(i, e, r) {
8837
+ function We(i, e, r) {
8756
8838
  if (i === 0n) return "0";
8757
8839
  const t = 10n ** BigInt(e), s = i / t, a = (i % t).toString().padStart(e, "0").slice(0, r).replace(/0+$/, "");
8758
8840
  return a ? `${s}.${a}` : `${s}`;
8759
8841
  }
8760
- function De(i) {
8842
+ function Oe(i) {
8761
8843
  try {
8762
8844
  const e = BigInt(i), r = e / 1000000000n, s = (e % 1000000000n).toString().padStart(9, "0").slice(0, 2).replace(/0+$/, "");
8763
8845
  return s ? `${r}.${s}` : `${r}`;
@@ -8765,28 +8847,28 @@ function De(i) {
8765
8847
  return i;
8766
8848
  }
8767
8849
  }
8768
- function ps(i) {
8850
+ function gs(i) {
8769
8851
  try {
8770
8852
  return BigInt(i).toLocaleString();
8771
8853
  } catch {
8772
8854
  return i;
8773
8855
  }
8774
8856
  }
8775
- function hs(i, e) {
8776
- const { gasLimit: r, gasPrice: t, maxFeePerGas: s, maxPriorityFeePerGas: n, nativeDecimals: o = 18 } = i, a = qe(i.chainId, i.nativeSymbol ?? "ETH");
8857
+ function fs(i, e) {
8858
+ const { gasLimit: r, gasPrice: t, maxFeePerGas: s, maxPriorityFeePerGas: n, nativeDecimals: o = 18 } = i, a = ze(i.chainId, i.nativeSymbol ?? "ETH");
8777
8859
  if (!r) return null;
8778
8860
  try {
8779
- const l = BigInt(r), p = ps(r);
8861
+ const l = BigInt(r), p = gs(r);
8780
8862
  if (s) {
8781
8863
  const h = l * BigInt(s);
8782
8864
  return {
8783
8865
  isDynamic: !0,
8784
- estTxFee: We(
8785
- `${He(h, o, e)} ${a}`,
8786
- `${Ue(h, o)} ${a}`
8866
+ estTxFee: Ue(
8867
+ `${We(h, o, e)} ${a}`,
8868
+ `${Be(h, o)} ${a}`
8787
8869
  ),
8788
- maxFeeGwei: De(s),
8789
- maxPriorityFeeGwei: n ? De(n) : void 0,
8870
+ maxFeeGwei: Oe(s),
8871
+ maxPriorityFeeGwei: n ? Oe(n) : void 0,
8790
8872
  gasLimitFormatted: p
8791
8873
  };
8792
8874
  }
@@ -8794,11 +8876,11 @@ function hs(i, e) {
8794
8876
  const h = l * BigInt(t);
8795
8877
  return {
8796
8878
  isDynamic: !1,
8797
- estTxFee: We(
8798
- `${He(h, o, e)} ${a}`,
8799
- `${Ue(h, o)} ${a}`
8879
+ estTxFee: Ue(
8880
+ `${We(h, o, e)} ${a}`,
8881
+ `${Be(h, o)} ${a}`
8800
8882
  ),
8801
- gasPriceGwei: De(t),
8883
+ gasPriceGwei: Oe(t),
8802
8884
  gasLimitFormatted: p
8803
8885
  };
8804
8886
  }
@@ -8807,11 +8889,11 @@ function hs(i, e) {
8807
8889
  return null;
8808
8890
  }
8809
8891
  }
8810
- function It(i, e, r) {
8811
- const t = hs(i, e);
8812
- if (!t) return M((r == null ? void 0 : r.label_estimated_fee) ?? "Estimated fee", "<span>—</span>");
8813
- let s = M((r == null ? void 0 : r.label_est_tx_fee) ?? "Est. Tx Fee", `<span>${t.estTxFee}</span>`);
8814
- return t.isDynamic ? (t.maxPriorityFeeGwei !== void 0 && (s += M((r == null ? void 0 : r.label_max_priority_fee) ?? "Max Priority Fee", `<span>${t.maxPriorityFeeGwei} Gwei</span>`)), t.maxFeeGwei !== void 0 && (s += M((r == null ? void 0 : r.label_max_gas_fee) ?? "Max Gas Fee", `<span>${t.maxFeeGwei} Gwei</span>`))) : t.gasPriceGwei !== void 0 && (s += M((r == null ? void 0 : r.label_gas_price) ?? "Gas Price", `<span>${t.gasPriceGwei} Gwei</span>`)), t.gasLimitFormatted && (s += M((r == null ? void 0 : r.label_gas_limit) ?? "Gas Limit", `<span>${t.gasLimitFormatted}</span>`)), s;
8892
+ function Tt(i, e, r) {
8893
+ const t = fs(i, e);
8894
+ if (!t) return F((r == null ? void 0 : r.label_estimated_fee) ?? "Estimated fee", "<span>—</span>");
8895
+ let s = F((r == null ? void 0 : r.label_est_tx_fee) ?? "Est. Tx Fee", `<span>${t.estTxFee}</span>`);
8896
+ return t.isDynamic ? (t.maxPriorityFeeGwei !== void 0 && (s += F((r == null ? void 0 : r.label_max_priority_fee) ?? "Max Priority Fee", `<span>${t.maxPriorityFeeGwei} Gwei</span>`)), t.maxFeeGwei !== void 0 && (s += F((r == null ? void 0 : r.label_max_gas_fee) ?? "Max Gas Fee", `<span>${t.maxFeeGwei} Gwei</span>`))) : t.gasPriceGwei !== void 0 && (s += F((r == null ? void 0 : r.label_gas_price) ?? "Gas Price", `<span>${t.gasPriceGwei} Gwei</span>`)), t.gasLimitFormatted && (s += F((r == null ? void 0 : r.label_gas_limit) ?? "Gas Limit", `<span>${t.gasLimitFormatted}</span>`)), s;
8815
8897
  }
8816
8898
  const ee = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
8817
8899
  <rect x="9" y="9" width="13" height="13" rx="2"/>
@@ -8819,17 +8901,17 @@ const ee = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="
8819
8901
  </svg>`, H = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
8820
8902
  <line x1="18" y1="6" x2="6" y2="18"/>
8821
8903
  <line x1="6" y1="6" x2="18" y2="18"/>
8822
- </svg>`, us = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 318.6 318.6" aria-hidden="true"><style>.st1,.st6{fill:#e4761b;stroke:#e4761b;stroke-linecap:round;stroke-linejoin:round}.st6{fill:#f6851b;stroke:#f6851b}</style><path fill="#e2761b" stroke="#e2761b" stroke-linecap="round" stroke-linejoin="round" d="m274.1 35.5-99.5 73.9L193 65.8z"/><path d="m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z" class="st1"/><path d="m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z" class="st1"/><path fill="#d7c1b3" stroke="#d7c1b3" stroke-linecap="round" stroke-linejoin="round" d="m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"/><path fill="#233447" stroke="#233447" stroke-linecap="round" stroke-linejoin="round" d="m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"/><path fill="#cd6116" stroke="#cd6116" stroke-linecap="round" stroke-linejoin="round" d="m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"/><path fill="#e4751f" stroke="#e4751f" stroke-linecap="round" stroke-linejoin="round" d="m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"/><path d="m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z" class="st6"/><path fill="#c0ad9e" stroke="#c0ad9e" stroke-linecap="round" stroke-linejoin="round" d="m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"/><path fill="#161616" stroke="#161616" stroke-linecap="round" stroke-linejoin="round" d="m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"/><path fill="#763d16" stroke="#763d16" stroke-linecap="round" stroke-linejoin="round" d="m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"/><path d="m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z" class="st6"/></svg>', _s = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 126.611 126.611" aria-hidden="true"><polygon fill="#F3BA2F" points="38.171,53.203 62.759,28.616 87.36,53.216 101.667,38.909 62.759,0 23.864,38.896 "/><rect x="3.644" y="53.188" transform="matrix(0.7071 0.7071 -0.7071 0.7071 48.7933 8.8106)" fill="#F3BA2F" width="20.233" height="20.234"/><polygon fill="#F3BA2F" points="38.171,73.408 62.759,97.995 87.359,73.396 101.674,87.695 101.667,87.703 62.759,126.611 23.863,87.716 23.843,87.696 "/><rect x="101.64" y="53.189" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 235.5457 29.0503)" fill="#F3BA2F" width="20.234" height="20.233"/><polygon fill="#F3BA2F" points="77.271,63.298 77.277,63.298 62.759,48.78 52.03,59.509 52.029,59.509 50.797,60.742 48.254,63.285 48.254,63.285 48.234,63.305 48.254,63.326 62.759,77.831 77.277,63.313 77.284,63.305 "/></svg>';
8904
+ </svg>`, ws = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 318.6 318.6" aria-hidden="true"><style>.st1,.st6{fill:#e4761b;stroke:#e4761b;stroke-linecap:round;stroke-linejoin:round}.st6{fill:#f6851b;stroke:#f6851b}</style><path fill="#e2761b" stroke="#e2761b" stroke-linecap="round" stroke-linejoin="round" d="m274.1 35.5-99.5 73.9L193 65.8z"/><path d="m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z" class="st1"/><path d="m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z" class="st1"/><path fill="#d7c1b3" stroke="#d7c1b3" stroke-linecap="round" stroke-linejoin="round" d="m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"/><path fill="#233447" stroke="#233447" stroke-linecap="round" stroke-linejoin="round" d="m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"/><path fill="#cd6116" stroke="#cd6116" stroke-linecap="round" stroke-linejoin="round" d="m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"/><path fill="#e4751f" stroke="#e4751f" stroke-linecap="round" stroke-linejoin="round" d="m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"/><path d="m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z" class="st6"/><path fill="#c0ad9e" stroke="#c0ad9e" stroke-linecap="round" stroke-linejoin="round" d="m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"/><path fill="#161616" stroke="#161616" stroke-linecap="round" stroke-linejoin="round" d="m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"/><path fill="#763d16" stroke="#763d16" stroke-linecap="round" stroke-linejoin="round" d="m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"/><path d="m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z" class="st6"/></svg>', ms = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 126.611 126.611" aria-hidden="true"><polygon fill="#F3BA2F" points="38.171,53.203 62.759,28.616 87.36,53.216 101.667,38.909 62.759,0 23.864,38.896 "/><rect x="3.644" y="53.188" transform="matrix(0.7071 0.7071 -0.7071 0.7071 48.7933 8.8106)" fill="#F3BA2F" width="20.233" height="20.234"/><polygon fill="#F3BA2F" points="38.171,73.408 62.759,97.995 87.359,73.396 101.674,87.695 101.667,87.703 62.759,126.611 23.863,87.716 23.843,87.696 "/><rect x="101.64" y="53.189" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 235.5457 29.0503)" fill="#F3BA2F" width="20.234" height="20.233"/><polygon fill="#F3BA2F" points="77.271,63.298 77.277,63.298 62.759,48.78 52.03,59.509 52.029,59.509 50.797,60.742 48.254,63.285 48.254,63.285 48.234,63.305 48.254,63.326 62.759,77.831 77.277,63.313 77.284,63.305 "/></svg>';
8823
8905
  function kt(i, e) {
8824
8906
  return `<svg width="${i}" height="${i}" viewBox="0 0 229 229" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><g clip-path="url(#clip0_${e})"><rect width="228.273" height="228.273" rx="87" fill="white"/><path d="M228.307 -0.0644531H0.0332031V228.209H228.307V-0.0644531Z" fill="#CE3E35"/><path d="M33.9219 43.7533C33.9219 31.934 43.5033 22.3527 55.3225 22.3527H173.019C184.838 22.3527 194.419 31.9341 194.419 43.7533V123.107H33.9219V43.7533Z" fill="white"/><g filter="url(#filter0_d_${e})"><path d="M228.241 228.21H0.0332031V56.5961C0.0332031 48.7166 6.4208 42.329 14.3003 42.329H77.9502C84.6851 42.329 90.1926 47.3831 94.2527 52.7566C98.8699 58.8676 106.06 62.7958 114.137 62.7958C122.214 62.7958 129.404 58.8676 134.021 52.7566C138.081 47.3831 143.589 42.329 150.324 42.329H213.974C221.854 42.329 228.241 48.7166 228.241 56.5961V228.21Z" fill="url(#paint0_linear_${e})"/></g><path d="M79.7598 228.096H228.24V64.7367L79.7598 159.851V228.096Z" fill="url(#paint1_linear_${e})"/><path d="M79.7694 228.209H0.0332031V75.9257L79.7694 160.218V228.209Z" fill="url(#paint2_linear_${e})"/><g filter="url(#filter1_d_${e})"><path d="M113.105 89.2908L81.3322 107.655C75.7279 110.878 73.7862 118.118 77.0076 123.724C80.229 129.331 87.4661 131.273 93.0704 128.051L119.945 112.511L107.147 126.241V180.098C107.147 186.588 112.443 191.885 118.93 191.885C125.417 191.885 130.712 186.588 130.712 180.098V99.4884C130.712 97.237 130.006 95.0297 129.124 93.5729C125.814 88.0106 118.665 86.024 113.061 89.2466L113.105 89.2908Z" fill="white"/></g></g><defs><filter id="filter0_d_${e}" x="-7.10034" y="33.4121" width="242.474" height="200.148" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="-1.78339"/><feGaussianBlur stdDeviation="3.56677"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0.892803 0 0 0 0 0.220099 0 0 0 0 0.293135 0 0 0 0.5 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_${e}"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_${e}" result="shape"/></filter><filter id="filter1_d_${e}" x="67.9009" y="80.1489" width="75.3839" height="124.308" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="2.51084" dy="2.51084"/><feGaussianBlur stdDeviation="5.03056"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_${e}"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_${e}" result="shape"/></filter><linearGradient id="paint0_linear_${e}" x1="-26.3993" y1="19.4879" x2="193.409" y2="286.17" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_${e}" x1="56.978" y1="73.7355" x2="168.096" y2="169.248" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_${e}" x1="142.362" y1="29.5078" x2="37.3384" y2="166.255" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_${e}"><rect width="228.273" height="228.273" rx="87" fill="white"/></clipPath></defs></svg>`;
8825
8907
  }
8826
- const xs = kt(16, "connect-inline"), gs = {
8827
- [fe.MetaMask]: us,
8828
- [fe.Binance]: _s,
8829
- [fe.CROSSx]: xs
8830
- }, Tt = '<path d="M22.6667 11.8333V10.1667C22.6667 9.2475 21.9192 8.5 21.0001 8.5H10.1667C8.78841 8.5 7.66675 9.62167 7.66675 11V21C7.66675 22.8342 9.16175 23.5 10.1667 23.5H22.6667C23.5859 23.5 24.3334 22.7525 24.3334 21.8333V13.5C24.3334 12.5808 23.5859 11.8333 22.6667 11.8333ZM21.0001 19.3333H19.3334V16H21.0001V19.3333ZM10.1667 11.8333C9.95218 11.8237 9.74959 11.7317 9.60114 11.5765C9.4527 11.4213 9.36986 11.2148 9.36986 11C9.36986 10.7852 9.4527 10.5787 9.60114 10.4235C9.74959 10.2683 9.95218 10.1763 10.1667 10.1667H21.0001V11.8333H10.1667Z"/>', je = `<svg width="20" height="20" viewBox="0 0 32 32" fill="currentColor" xmlns="http://www.w3.org/2000/svg">${Tt}</svg>`, fs = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
8908
+ const ys = kt(16, "connect-inline"), bs = {
8909
+ [we.MetaMask]: ws,
8910
+ [we.Binance]: ms,
8911
+ [we.CROSSx]: ys
8912
+ }, Rt = '<path d="M22.6667 11.8333V10.1667C22.6667 9.2475 21.9192 8.5 21.0001 8.5H10.1667C8.78841 8.5 7.66675 9.62167 7.66675 11V21C7.66675 22.8342 9.16175 23.5 10.1667 23.5H22.6667C23.5859 23.5 24.3334 22.7525 24.3334 21.8333V13.5C24.3334 12.5808 23.5859 11.8333 22.6667 11.8333ZM21.0001 19.3333H19.3334V16H21.0001V19.3333ZM10.1667 11.8333C9.95218 11.8237 9.74959 11.7317 9.60114 11.5765C9.4527 11.4213 9.36986 11.2148 9.36986 11C9.36986 10.7852 9.4527 10.5787 9.60114 10.4235C9.74959 10.2683 9.95218 10.1763 10.1667 10.1667H21.0001V11.8333H10.1667Z"/>', je = `<svg width="20" height="20" viewBox="0 0 32 32" fill="currentColor" xmlns="http://www.w3.org/2000/svg">${Rt}</svg>`, Ss = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
8831
8913
  <path d="M12 0C18.6274 0 24 5.37258 24 12C23.9999 18.6273 18.6274 24 12 24C5.37264 24 9.89594e-05 18.6273 0 12C0 5.37258 5.37258 0 12 0ZM10.875 15.127V17.377H13.125V15.127H10.875ZM10.875 6.62207V13.627H13.125V6.62207H10.875Z" fill="var(--cx-error)"/>
8832
- </svg>`, ws = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
8914
+ </svg>`, vs = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
8833
8915
  <circle cx="12" cy="12" r="12" fill="var(--cx-error)"/>
8834
8916
  <circle cx="12" cy="12" r="5.5" stroke="white" stroke-width="1.5"/>
8835
8917
  <path d="M12 9.5v3l2 1.5" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
@@ -8867,23 +8949,23 @@ function G(i) {
8867
8949
  `--cx-on-primary:${i.onPrimary}`
8868
8950
  ].join(";");
8869
8951
  }
8870
- function ms(i, e) {
8952
+ function Es(i, e) {
8871
8953
  i.style.setProperty("--cx-bg", e.bg), i.style.setProperty("--cx-border", e.border), i.style.setProperty("--cx-border-medium", e.borderMedium), i.style.setProperty("--cx-title", e.titleColor), i.style.setProperty("--cx-subtitle", e.subtitleColor), i.style.setProperty("--cx-label", e.labelColor), i.style.setProperty("--cx-value", e.valueColor), i.style.setProperty("--cx-pill-bg", e.pillBg), i.style.setProperty("--cx-pill-from", e.pillFromColor), i.style.setProperty("--cx-pill-amt", e.pillAmtColor), i.style.setProperty("--cx-divider", e.divider), i.style.setProperty("--cx-close", e.closeColor), i.style.setProperty("--cx-close-hover", e.closeHoverBg), i.style.setProperty("--cx-copy", e.copyColor), i.style.setProperty("--cx-input-bg", e.inputBg), i.style.setProperty("--cx-input-border", e.inputBorder), i.style.setProperty("--cx-hint", e.hintColor), i.style.setProperty("--cx-surface-subtle", e.surfaceSubtle), i.style.setProperty("--cx-surface-high", e.surfaceHigh), i.style.setProperty("--cx-primary", e.primary), i.style.setProperty("--cx-primary-glow", e.primaryGlow), i.style.setProperty("--cx-primary-gradient", e.primaryGradient), i.style.setProperty("--cx-secondary", e.secondary), i.style.setProperty("--cx-error", e.errorColor), i.style.setProperty("--cx-notice-bg", e.noticeBg), i.style.setProperty("--cx-notice-border", e.noticeBorder), i.style.setProperty("--cx-notice-title", e.noticeTitleColor), i.style.setProperty("--cx-on-primary", e.onPrimary);
8872
8954
  }
8873
- function M(i, e) {
8955
+ function F(i, e) {
8874
8956
  return `
8875
8957
  <div class="__crossx-row">
8876
8958
  <span class="__crossx-row-label">${i}</span>
8877
8959
  <div class="__crossx-row-value">${e}</div>
8878
8960
  </div>`;
8879
8961
  }
8880
- function ys(i, e, r, t) {
8881
- const s = e, n = qe(i.chainId, i.nativeSymbol ?? "ETH"), o = i.nativeDecimals ?? 18, a = Te(i.dappName), l = i.to ? `<span class="__crossx-addr-text">${te(i.to)}</span>
8882
- <button class="__crossx-copy-btn" data-copy="${m(i.to)}" title="Copy address">${ee}</button>` : "<span>—</span>", p = It(i, r, t), h = St(i.value, n, o, r), _ = h ? M((t == null ? void 0 : t.label_value) ?? "Value", `<span>${h}</span>`) : "", g = i.data ?? "0x", w = document.createElement("div");
8883
- return w.id = U, w.innerHTML = `
8962
+ function As(i, e, r, t) {
8963
+ const s = e, n = ze(i.chainId, i.nativeSymbol ?? "ETH"), o = i.nativeDecimals ?? 18, a = Re(i.dappName), l = i.to ? `<span class="__crossx-addr-text">${te(i.to)}</span>
8964
+ <button class="__crossx-copy-btn" data-copy="${f(i.to)}" title="Copy address">${ee}</button>` : "<span>—</span>", p = Tt(i, r, t), h = Et(i.value, n, o, r), _ = h ? F((t == null ? void 0 : t.label_value) ?? "Value", `<span>${h}</span>`) : "", g = i.data ?? "0x", m = document.createElement("div");
8965
+ return m.id = U, m.innerHTML = `
8884
8966
  <div class="__crossx-card __crossx-card--migration __crossx-card--sign-tx" style="${G(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
8885
8967
  <div class="__crossx-header">
8886
- <p class="__crossx-title" id="__crossx-ttl">${m((t == null ? void 0 : t.sign_transaction_title) ?? "Signature Request")}</p>
8968
+ <p class="__crossx-title" id="__crossx-ttl">${f((t == null ? void 0 : t.sign_transaction_title) ?? "Signature Request")}</p>
8887
8969
  <button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${H}</button>
8888
8970
  </div>
8889
8971
  <hr class="__crossx-divider">
@@ -8891,34 +8973,34 @@ function ys(i, e, r, t) {
8891
8973
  <div class="__crossx-body-cols">
8892
8974
  <div class="__crossx-col-left">
8893
8975
  <p class="__crossx-sig-subtitle">
8894
- <span class="__crossx-sig-origin">${m(a)}</span>${m((t == null ? void 0 : t.signature_requesting) ?? " is requesting a Signature")}
8976
+ <span class="__crossx-sig-origin">${f(a)}</span>${f((t == null ? void 0 : t.signature_requesting) ?? " is requesting a Signature")}
8895
8977
  </p>
8896
8978
  <div class="__crossx-addr-pill">
8897
8979
  ${je}
8898
8980
  <span class="__crossx-addr-pill-text">${te(i.from)}</span>
8899
8981
  </div>
8900
- <p class="__crossx-warning">${m((t == null ? void 0 : t.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
8982
+ <p class="__crossx-warning">${f((t == null ? void 0 : t.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
8901
8983
  </div>
8902
8984
  <hr class="__crossx-divider __crossx-divider--cols">
8903
8985
  <div class="__crossx-col-right-sign">
8904
8986
  <div class="__crossx-rows">
8905
- ${M((t == null ? void 0 : t.label_to) ?? "To", l)}
8906
- ${M((t == null ? void 0 : t.label_network) ?? "Network", `<span>${At(i.chainId)}</span>`)}
8987
+ ${F((t == null ? void 0 : t.label_to) ?? "To", l)}
8988
+ ${F((t == null ? void 0 : t.label_network) ?? "Network", `<span>${It(i.chainId)}</span>`)}
8907
8989
  ${_}
8908
8990
  ${p}
8909
8991
  </div>
8910
- <pre class="__crossx-raw-tx">${m(g)}</pre>
8992
+ <pre class="__crossx-raw-tx">${f(g)}</pre>
8911
8993
  </div>
8912
8994
  </div>
8913
8995
  <div class="__crossx-btn-row">
8914
- <button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${m((t == null ? void 0 : t.cancel) ?? "Cancel")}</button>
8915
- <button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${m((t == null ? void 0 : t.signature_sign_button) ?? "Sign")}</button>
8996
+ <button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${f((t == null ? void 0 : t.cancel) ?? "Cancel")}</button>
8997
+ <button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${f((t == null ? void 0 : t.signature_sign_button) ?? "Sign")}</button>
8916
8998
  </div>
8917
8999
  </div>
8918
9000
  </div>
8919
- `, w;
9001
+ `, m;
8920
9002
  }
8921
- const bs = /* @__PURE__ */ new Set([
9003
+ const Is = /* @__PURE__ */ new Set([
8922
9004
  "0x095ea7b3",
8923
9005
  // approve(address,uint256) — ERC20 / ERC721
8924
9006
  "0xa22cb465",
@@ -8928,27 +9010,27 @@ const bs = /* @__PURE__ */ new Set([
8928
9010
  "0x8fcbaf0c"
8929
9011
  // permit(address,address,uint256,uint256,bool,uint8,bytes32,bytes32) — DAI 스타일
8930
9012
  ]);
8931
- function vs(i) {
8932
- return i ? bs.has(i.slice(0, 10).toLowerCase()) : !1;
9013
+ function Ts(i) {
9014
+ return i ? Is.has(i.slice(0, 10).toLowerCase()) : !1;
8933
9015
  }
8934
- function Ss(i, e, r, t) {
8935
- const s = e, n = qe(i.chainId, i.nativeSymbol ?? "ETH"), o = i.nativeDecimals ?? 18, a = Te(i.dappName), l = i.to ? `<span class="__crossx-addr-text">${te(i.to)}</span>
8936
- <button class="__crossx-copy-btn" data-copy="${m(i.to)}" title="Copy address">${ee}</button>` : "<span>—</span>", p = It(i, r, t), _ = St(i.value, n, o, r) ?? "—", g = vs(i.data) ? (t == null ? void 0 : t.send_tx_approve_button) ?? "Approve" : (t == null ? void 0 : t.send_tx_confirm_button) ?? "Confirm", w = document.createElement("div");
8937
- return w.id = U, w.innerHTML = `
9016
+ function ks(i, e, r, t) {
9017
+ const s = e, n = ze(i.chainId, i.nativeSymbol ?? "ETH"), o = i.nativeDecimals ?? 18, a = Re(i.dappName), l = i.to ? `<span class="__crossx-addr-text">${te(i.to)}</span>
9018
+ <button class="__crossx-copy-btn" data-copy="${f(i.to)}" title="Copy address">${ee}</button>` : "<span>—</span>", p = Tt(i, r, t), _ = Et(i.value, n, o, r) ?? "—", g = Ts(i.data) ? (t == null ? void 0 : t.send_tx_approve_button) ?? "Approve" : (t == null ? void 0 : t.send_tx_confirm_button) ?? "Confirm", m = document.createElement("div");
9019
+ return m.id = U, m.innerHTML = `
8938
9020
  <div class="__crossx-card __crossx-card--migration __crossx-card--send-tx" style="${G(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
8939
9021
  <div class="__crossx-header">
8940
- <p class="__crossx-title" id="__crossx-ttl">${m((t == null ? void 0 : t.send_transaction_title) ?? "Approve transaction")}</p>
9022
+ <p class="__crossx-title" id="__crossx-ttl">${f((t == null ? void 0 : t.send_transaction_title) ?? "Approve transaction")}</p>
8941
9023
  <button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${H}</button>
8942
9024
  </div>
8943
9025
  <hr class="__crossx-divider">
8944
9026
  <div class="__crossx-body">
8945
9027
  <p class="__crossx-tx-subtitle">
8946
- <span class="__crossx-sig-origin">${m(a)}</span>${m((t == null ? void 0 : t.send_tx_permission_text) ?? " wants your permission to approve the following transaction.")}
9028
+ <span class="__crossx-sig-origin">${f(a)}</span>${f((t == null ? void 0 : t.send_tx_permission_text) ?? " wants your permission to approve the following transaction.")}
8947
9029
  </p>
8948
9030
  <div class="__crossx-body-cols">
8949
9031
  <div class="__crossx-rows">
8950
- ${M((t == null ? void 0 : t.label_to) ?? "To", l)}
8951
- ${M((t == null ? void 0 : t.label_network) ?? "Network", `<span>${At(i.chainId)}</span>`)}
9032
+ ${F((t == null ? void 0 : t.label_to) ?? "To", l)}
9033
+ ${F((t == null ? void 0 : t.label_network) ?? "Network", `<span>${It(i.chainId)}</span>`)}
8952
9034
  ${p}
8953
9035
  </div>
8954
9036
  <div class="__crossx-pill">
@@ -8956,12 +9038,12 @@ function Ss(i, e, r, t) {
8956
9038
  <span class="__crossx-pill-amount">${_}</span>
8957
9039
  </div>
8958
9040
  </div>
8959
- <button class="__crossx-approve-btn" id="__crossx-confirm-btn">${m(g)}</button>
9041
+ <button class="__crossx-approve-btn" id="__crossx-confirm-btn">${f(g)}</button>
8960
9042
  </div>
8961
9043
  </div>
8962
- `, w;
9044
+ `, m;
8963
9045
  }
8964
- function Te(i) {
9046
+ function Re(i) {
8965
9047
  var e;
8966
9048
  if (i) return i;
8967
9049
  try {
@@ -8970,54 +9052,54 @@ function Te(i) {
8970
9052
  return "This site";
8971
9053
  }
8972
9054
  }
8973
- function m(i) {
9055
+ function f(i) {
8974
9056
  return i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
8975
9057
  }
8976
- function Es(i) {
9058
+ function Rs(i) {
8977
9059
  return typeof i == "string" && /^0x[0-9a-fA-F]{40}$/i.test(i);
8978
9060
  }
8979
- function As(i) {
8980
- if (typeof i == "string") return m(i);
9061
+ function Ns(i) {
9062
+ if (typeof i == "string") return f(i);
8981
9063
  if (typeof i == "number" || typeof i == "bigint" || typeof i == "boolean") return String(i);
8982
9064
  try {
8983
- return m(JSON.stringify(i));
9065
+ return f(JSON.stringify(i));
8984
9066
  } catch {
8985
9067
  return String(i);
8986
9068
  }
8987
9069
  }
8988
- function Is(i) {
9070
+ function Cs(i) {
8989
9071
  return i.includes(":") ? i.split(":")[1] ?? i : i;
8990
9072
  }
8991
- function ks(i) {
9073
+ function Ps(i) {
8992
9074
  return `https://www.crossscan.io/address/${i}?tab=txs`;
8993
9075
  }
8994
- function Ts(i, e) {
8995
- return `https://explorer.crosstoken.io/${Is(i)}/tx/${e}`;
9076
+ function Os(i, e) {
9077
+ return `https://explorer.crosstoken.io/${Cs(i)}/tx/${e}`;
8996
9078
  }
8997
- function Rt(i, e) {
8998
- return `<a class="__crossx-addr-text __crossx-row-link" href="${m(e)}" target="_blank" rel="noopener noreferrer">${m(i)}</a>`;
9079
+ function Nt(i, e) {
9080
+ return `<a class="__crossx-addr-text __crossx-row-link" href="${f(e)}" target="_blank" rel="noopener noreferrer">${f(i)}</a>`;
8999
9081
  }
9000
- function Ee(i) {
9001
- return Rt(te(i), ks(i));
9082
+ function Ie(i) {
9083
+ return Nt(te(i), Ps(i));
9002
9084
  }
9003
- function Nt(i, e) {
9004
- return Rt(te(e), Ts(i, e));
9085
+ function Ct(i, e) {
9086
+ return Nt(te(e), Os(i, e));
9005
9087
  }
9006
- function Rs(i, e, r) {
9007
- const t = M(
9088
+ function Ds(i, e, r) {
9089
+ const t = F(
9008
9090
  (r == null ? void 0 : r.label_from) ?? "From",
9009
- `${Ee(i.from)}
9010
- <button class="__crossx-copy-btn" data-copy="${m(i.from)}" title="Copy address">${ee}</button>`
9011
- ), s = i.to ? M((r == null ? void 0 : r.label_to) ?? "To", `${Ee(i.to)}
9012
- <button class="__crossx-copy-btn" data-copy="${m(i.to)}" title="Copy address">${ee}</button>`) : "", n = i.amount ? M((r == null ? void 0 : r.label_transfer) ?? "Transfer", `<span>${m(i.amount)}</span>`) : "", o = i.fees ? M((r == null ? void 0 : r.label_tx_fee) ?? "Tx Fee", `<span>${m(i.fees)}</span>`) : "", a = i.txHash ? M((r == null ? void 0 : r.label_tx_hash) ?? "Tx Hash", `${Nt(i.chainId, i.txHash)}
9013
- <button class="__crossx-copy-btn" data-copy="${m(i.txHash)}" title="Copy hash">${ee}</button>`) : "", l = i.total ? `<div class="__crossx-total-pill">
9014
- <span class="__crossx-total-label">${m((r == null ? void 0 : r.label_total) ?? "Total")}<br>${m((r == null ? void 0 : r.label_including_fees) ?? "(including fees)")}</span>
9015
- <span class="__crossx-total-amount">${m(i.total)}</span>
9091
+ `${Ie(i.from)}
9092
+ <button class="__crossx-copy-btn" data-copy="${f(i.from)}" title="Copy address">${ee}</button>`
9093
+ ), s = i.to ? F((r == null ? void 0 : r.label_to) ?? "To", `${Ie(i.to)}
9094
+ <button class="__crossx-copy-btn" data-copy="${f(i.to)}" title="Copy address">${ee}</button>`) : "", n = i.amount ? F((r == null ? void 0 : r.label_transfer) ?? "Transfer", `<span>${f(i.amount)}</span>`) : "", o = i.fees ? F((r == null ? void 0 : r.label_tx_fee) ?? "Tx Fee", `<span>${f(i.fees)}</span>`) : "", a = i.txHash ? F((r == null ? void 0 : r.label_tx_hash) ?? "Tx Hash", `${Ct(i.chainId, i.txHash)}
9095
+ <button class="__crossx-copy-btn" data-copy="${f(i.txHash)}" title="Copy hash">${ee}</button>`) : "", l = i.total ? `<div class="__crossx-total-pill">
9096
+ <span class="__crossx-total-label">${f((r == null ? void 0 : r.label_total) ?? "Total")}<br>${f((r == null ? void 0 : r.label_including_fees) ?? "(including fees)")}</span>
9097
+ <span class="__crossx-total-amount">${f(i.total)}</span>
9016
9098
  </div>` : "", p = document.createElement("div");
9017
9099
  return p.id = U, p.innerHTML = `
9018
9100
  <div class="__crossx-card __crossx-card--migration" style="${G(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
9019
9101
  <div class="__crossx-header">
9020
- <p class="__crossx-title" id="__crossx-ttl">${m((r == null ? void 0 : r.tx_success) ?? "Transaction complete")}</p>
9102
+ <p class="__crossx-title" id="__crossx-ttl">${f((r == null ? void 0 : r.tx_success) ?? "Transaction complete")}</p>
9021
9103
  <button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${H}</button>
9022
9104
  </div>
9023
9105
  <hr class="__crossx-divider">
@@ -9030,33 +9112,33 @@ function Rs(i, e, r) {
9030
9112
  ${a}
9031
9113
  </div>
9032
9114
  ${l}
9033
- <button class="__crossx-approve-btn" id="__crossx-done-btn">${m((r == null ? void 0 : r.tx_complete_done_button) ?? "All Done")}</button>
9115
+ <button class="__crossx-approve-btn" id="__crossx-done-btn">${f((r == null ? void 0 : r.tx_complete_done_button) ?? "All Done")}</button>
9034
9116
  </div>
9035
9117
  </div>
9036
9118
  `, p;
9037
9119
  }
9038
- function Ns(i, e, r) {
9120
+ function Ls(i, e, r) {
9039
9121
  const t = document.createElement("div");
9040
9122
  return t.id = U, t.innerHTML = `
9041
9123
  <div class="__crossx-card __crossx-card--migration" style="${G(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
9042
9124
  <div class="__crossx-header">
9043
- <p class="__crossx-title" id="__crossx-ttl">${m((r == null ? void 0 : r.tx_progress_waiting_title) ?? "Waiting for confirmation")}</p>
9125
+ <p class="__crossx-title" id="__crossx-ttl">${f((r == null ? void 0 : r.tx_progress_waiting_title) ?? "Waiting for confirmation")}</p>
9044
9126
  </div>
9045
9127
  <hr class="__crossx-divider">
9046
9128
  <div class="__crossx-body" id="__crossx-progress-body">
9047
9129
  <div class="__crossx-progress-center">
9048
9130
  <div class="__crossx-spinner"></div>
9049
- <p class="__crossx-progress-text">${m((r == null ? void 0 : r.tx_progress_waiting_text) ?? "Waiting for transaction receipt...")}</p>
9131
+ <p class="__crossx-progress-text">${f((r == null ? void 0 : r.tx_progress_waiting_text) ?? "Waiting for transaction receipt...")}</p>
9050
9132
  </div>
9051
9133
  </div>
9052
9134
  </div>
9053
9135
  `, t;
9054
9136
  }
9055
- function Ps(i, e, r, t) {
9137
+ function Fs(i, e, r, t) {
9056
9138
  const s = e.status !== "reverted" && e.status !== "timeout", n = e.status === "timeout", o = i.querySelector("#__crossx-ttl"), a = i.querySelector(".__crossx-header");
9057
9139
  if (o) {
9058
- const x = n ? ws : s ? "" : fs, y = n ? (t == null ? void 0 : t.tx_timeout) ?? "Transaction timeout" : s ? (t == null ? void 0 : t.tx_success) ?? "Transaction complete" : (t == null ? void 0 : t.tx_failed) ?? "Transaction failed";
9059
- x ? (o.style.display = "flex", o.style.alignItems = "center", o.style.gap = "8px", o.innerHTML = `${x}<span>${m(y)}</span>`) : o.textContent = y;
9140
+ const x = n ? vs : s ? "" : Ss, y = n ? (t == null ? void 0 : t.tx_timeout) ?? "Transaction timeout" : s ? (t == null ? void 0 : t.tx_success) ?? "Transaction complete" : (t == null ? void 0 : t.tx_failed) ?? "Transaction failed";
9141
+ x ? (o.style.display = "flex", o.style.alignItems = "center", o.style.gap = "8px", o.innerHTML = `${x}<span>${f(y)}</span>`) : o.textContent = y;
9060
9142
  }
9061
9143
  if (a && !i.querySelector("#__crossx-close-btn")) {
9062
9144
  const x = document.createElement("button");
@@ -9064,12 +9146,12 @@ function Ps(i, e, r, t) {
9064
9146
  }
9065
9147
  const l = i.querySelector("#__crossx-progress-body");
9066
9148
  if (!l) return;
9067
- const p = e.from ? M((t == null ? void 0 : t.label_from) ?? "From", `${Ee(e.from)}
9068
- <button class="__crossx-copy-btn" data-copy="${m(e.from)}" title="Copy address">${ee}</button>`) : "", h = e.to ? M((t == null ? void 0 : t.label_to) ?? "To", `${Ee(e.to)}
9069
- <button class="__crossx-copy-btn" data-copy="${m(e.to)}" title="Copy address">${ee}</button>`) : "", _ = e.amount ? M((t == null ? void 0 : t.label_transfer) ?? "Transfer", `<span>${m(e.amount)}</span>`) : "", g = e.fees ? M((t == null ? void 0 : t.label_tx_fee) ?? "Tx Fee", `<span>${m(e.fees)}</span>`) : "", w = e.txHash ? M((t == null ? void 0 : t.label_tx_hash) ?? "Tx Hash", `${Nt(e.chainId, e.txHash)}
9070
- <button class="__crossx-copy-btn" data-copy="${m(e.txHash)}" title="Copy hash">${ee}</button>`) : "", f = e.total ? `<div class="__crossx-total-pill">
9071
- <span class="__crossx-total-label">${m((t == null ? void 0 : t.label_total) ?? "Total")}<br>${m((t == null ? void 0 : t.label_including_fees) ?? "(including fees)")}</span>
9072
- <span class="__crossx-total-amount">${m(e.total)}</span>
9149
+ const p = e.from ? F((t == null ? void 0 : t.label_from) ?? "From", `${Ie(e.from)}
9150
+ <button class="__crossx-copy-btn" data-copy="${f(e.from)}" title="Copy address">${ee}</button>`) : "", h = e.to ? F((t == null ? void 0 : t.label_to) ?? "To", `${Ie(e.to)}
9151
+ <button class="__crossx-copy-btn" data-copy="${f(e.to)}" title="Copy address">${ee}</button>`) : "", _ = e.amount ? F((t == null ? void 0 : t.label_transfer) ?? "Transfer", `<span>${f(e.amount)}</span>`) : "", g = e.fees ? F((t == null ? void 0 : t.label_tx_fee) ?? "Tx Fee", `<span>${f(e.fees)}</span>`) : "", m = e.txHash ? F((t == null ? void 0 : t.label_tx_hash) ?? "Tx Hash", `${Ct(e.chainId, e.txHash)}
9152
+ <button class="__crossx-copy-btn" data-copy="${f(e.txHash)}" title="Copy hash">${ee}</button>`) : "", w = e.total ? `<div class="__crossx-total-pill">
9153
+ <span class="__crossx-total-label">${f((t == null ? void 0 : t.label_total) ?? "Total")}<br>${f((t == null ? void 0 : t.label_including_fees) ?? "(including fees)")}</span>
9154
+ <span class="__crossx-total-amount">${f(e.total)}</span>
9073
9155
  </div>` : "";
9074
9156
  l.innerHTML = `
9075
9157
  <div class="__crossx-rows">
@@ -9077,10 +9159,10 @@ function Ps(i, e, r, t) {
9077
9159
  ${h}
9078
9160
  ${_}
9079
9161
  ${g}
9080
- ${w}
9162
+ ${m}
9081
9163
  </div>
9082
- ${f}
9083
- <button class="__crossx-approve-btn" id="__crossx-done-btn">${m((t == null ? void 0 : t.tx_complete_done_button) ?? (s ? "All Done" : "Done"))}</button>
9164
+ ${w}
9165
+ <button class="__crossx-approve-btn" id="__crossx-done-btn">${f((t == null ? void 0 : t.tx_complete_done_button) ?? (s ? "All Done" : "Done"))}</button>
9084
9166
  `, l.querySelectorAll(".__crossx-copy-btn").forEach((x) => {
9085
9167
  x.addEventListener("click", (y) => {
9086
9168
  var E;
@@ -9091,12 +9173,12 @@ function Ps(i, e, r, t) {
9091
9173
  });
9092
9174
  });
9093
9175
  }
9094
- function Cs(i, e, r) {
9095
- const t = e, s = Te(i.dappName), n = m(i.message), o = document.createElement("div");
9176
+ function Ms(i, e, r) {
9177
+ const t = e, s = Re(i.dappName), n = f(i.message), o = document.createElement("div");
9096
9178
  return o.id = U, o.innerHTML = `
9097
9179
  <div class="__crossx-card __crossx-card--migration __crossx-card--sign-msg" style="${G(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
9098
9180
  <div class="__crossx-header">
9099
- <p class="__crossx-title" id="__crossx-ttl">${m((r == null ? void 0 : r.sign_message_title) ?? "Signature Request")}</p>
9181
+ <p class="__crossx-title" id="__crossx-ttl">${f((r == null ? void 0 : r.sign_message_title) ?? "Signature Request")}</p>
9100
9182
  <button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${H}</button>
9101
9183
  </div>
9102
9184
  <hr class="__crossx-divider">
@@ -9104,27 +9186,27 @@ function Cs(i, e, r) {
9104
9186
  <div class="__crossx-body-cols">
9105
9187
  <div class="__crossx-col-left">
9106
9188
  <p class="__crossx-sig-subtitle">
9107
- <span class="__crossx-sig-origin">${m(s)}</span>${m((r == null ? void 0 : r.signature_requesting) ?? " is requesting a Signature")}
9189
+ <span class="__crossx-sig-origin">${f(s)}</span>${f((r == null ? void 0 : r.signature_requesting) ?? " is requesting a Signature")}
9108
9190
  </p>
9109
9191
  <div class="__crossx-addr-pill">
9110
9192
  ${je}
9111
9193
  <span class="__crossx-addr-pill-text">${te(i.from)}</span>
9112
9194
  </div>
9113
- <p class="__crossx-warning">${m((r == null ? void 0 : r.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
9195
+ <p class="__crossx-warning">${f((r == null ? void 0 : r.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
9114
9196
  </div>
9115
9197
  <hr class="__crossx-divider __crossx-divider--cols">
9116
9198
  <div class="__crossx-msg-raw">${n}</div>
9117
9199
  </div>
9118
9200
  <div class="__crossx-btn-row">
9119
- <button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${m((r == null ? void 0 : r.cancel) ?? "Cancel")}</button>
9120
- <button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${m((r == null ? void 0 : r.confirm) ?? "Confirm")}</button>
9201
+ <button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${f((r == null ? void 0 : r.cancel) ?? "Cancel")}</button>
9202
+ <button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${f((r == null ? void 0 : r.confirm) ?? "Confirm")}</button>
9121
9203
  </div>
9122
9204
  </div>
9123
9205
  </div>
9124
9206
  `, o;
9125
9207
  }
9126
- function Os(i, e, r) {
9127
- const t = e, s = Te(i.dappName);
9208
+ function $s(i, e, r) {
9209
+ const t = e, s = Re(i.dappName);
9128
9210
  let n = {};
9129
9211
  if (typeof i.typedData == "string")
9130
9212
  try {
@@ -9135,23 +9217,23 @@ function Os(i, e, r) {
9135
9217
  const o = n.primaryType ?? "—", a = n.message ?? {};
9136
9218
  let l = `
9137
9219
  <div class="__crossx-td-row">
9138
- <span class="__crossx-td-label">${m((r == null ? void 0 : r.label_primary_type) ?? "Primary Type")}</span>
9139
- <span class="__crossx-td-value">${m(o)}</span>
9220
+ <span class="__crossx-td-label">${f((r == null ? void 0 : r.label_primary_type) ?? "Primary Type")}</span>
9221
+ <span class="__crossx-td-value">${f(o)}</span>
9140
9222
  </div>`;
9141
9223
  for (const [h, _] of Object.entries(a)) {
9142
- const g = As(_), f = Es(_) ? `<span class="__crossx-addr-text">${te(_)}</span>
9143
- <button class="__crossx-copy-btn" data-copy="${m(String(_))}" title="Copy">${ee}</button>` : `<span>${g}</span>`;
9224
+ const g = Ns(_), w = Rs(_) ? `<span class="__crossx-addr-text">${te(_)}</span>
9225
+ <button class="__crossx-copy-btn" data-copy="${f(String(_))}" title="Copy">${ee}</button>` : `<span>${g}</span>`;
9144
9226
  l += `
9145
9227
  <div class="__crossx-td-row">
9146
- <span class="__crossx-td-label">${m(h)}</span>
9147
- <div class="__crossx-td-value">${f}</div>
9228
+ <span class="__crossx-td-label">${f(h)}</span>
9229
+ <div class="__crossx-td-value">${w}</div>
9148
9230
  </div>`;
9149
9231
  }
9150
9232
  const p = document.createElement("div");
9151
9233
  return p.id = U, p.innerHTML = `
9152
9234
  <div class="__crossx-card __crossx-card--migration __crossx-card--sign-typed" style="${G(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
9153
9235
  <div class="__crossx-header">
9154
- <p class="__crossx-title" id="__crossx-ttl">${m((r == null ? void 0 : r.sign_typed_data_title) ?? "Signature Request")}</p>
9236
+ <p class="__crossx-title" id="__crossx-ttl">${f((r == null ? void 0 : r.sign_typed_data_title) ?? "Signature Request")}</p>
9155
9237
  <button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${H}</button>
9156
9238
  </div>
9157
9239
  <hr class="__crossx-divider">
@@ -9159,49 +9241,49 @@ function Os(i, e, r) {
9159
9241
  <div class="__crossx-body-cols">
9160
9242
  <div class="__crossx-col-left">
9161
9243
  <p class="__crossx-sig-subtitle">
9162
- <span class="__crossx-sig-origin">${m(s)}</span>${m((r == null ? void 0 : r.signature_requesting) ?? " is requesting a Signature")}
9244
+ <span class="__crossx-sig-origin">${f(s)}</span>${f((r == null ? void 0 : r.signature_requesting) ?? " is requesting a Signature")}
9163
9245
  </p>
9164
9246
  <div class="__crossx-addr-pill">
9165
9247
  ${je}
9166
9248
  <span class="__crossx-addr-pill-text">${te(i.from)}</span>
9167
9249
  </div>
9168
- <p class="__crossx-warning">${m((r == null ? void 0 : r.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
9250
+ <p class="__crossx-warning">${f((r == null ? void 0 : r.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
9169
9251
  </div>
9170
9252
  <hr class="__crossx-divider __crossx-divider--cols">
9171
9253
  <div class="__crossx-td-rows">${l}</div>
9172
9254
  </div>
9173
9255
  <div class="__crossx-btn-row">
9174
- <button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${m((r == null ? void 0 : r.cancel) ?? "Cancel")}</button>
9175
- <button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${m((r == null ? void 0 : r.confirm) ?? "Confirm")}</button>
9256
+ <button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${f((r == null ? void 0 : r.cancel) ?? "Cancel")}</button>
9257
+ <button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${f((r == null ? void 0 : r.confirm) ?? "Confirm")}</button>
9176
9258
  </div>
9177
9259
  </div>
9178
9260
  </div>
9179
9261
  `, p;
9180
9262
  }
9181
- const Ds = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
9263
+ const Bs = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
9182
9264
  <line x1="12" y1="5" x2="12" y2="19"/>
9183
9265
  <line x1="5" y1="12" x2="19" y2="12"/>
9184
- </svg>`, Ls = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="var(--cx-primary, #00ceb2)"/><path d="M7.5 12.5L10.5 15.5L16.5 8.5" stroke="var(--cx-on-primary, #000)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';
9266
+ </svg>`, Us = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="var(--cx-primary, #00ceb2)"/><path d="M7.5 12.5L10.5 15.5L16.5 8.5" stroke="var(--cx-on-primary, #000)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';
9185
9267
  function Pt(i) {
9186
9268
  return i.name || `Account ${i.index + 1}`;
9187
9269
  }
9188
- function Ms() {
9189
- return `<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><rect width="32" height="32" rx="16" fill="#121212" fill-opacity="0.1"/><g fill="#121212" fill-opacity="0.5">${Tt}</g></svg>`;
9270
+ function Ws() {
9271
+ return `<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><rect width="32" height="32" rx="16" fill="#121212" fill-opacity="0.1"/><g fill="#121212" fill-opacity="0.5">${Rt}</g></svg>`;
9190
9272
  }
9191
- const Fs = ke().portraitBaseUrl;
9192
- function $s(i, e) {
9273
+ const Hs = Ke().portraitBaseUrl;
9274
+ function Gs(i, e) {
9193
9275
  const r = e.replace("#", "");
9194
- return `${Fs}/portrait/evm/${i}.png?size=256&bg=${r}`;
9276
+ return `${Hs}/portrait/evm/${encodeURIComponent(i)}.png?size=256&bg=${encodeURIComponent(r)}`;
9195
9277
  }
9196
- function Ct(i, e, r) {
9197
- const t = $s(i, r), n = Ms().replace(/"/g, "&quot;");
9198
- return `<span class="__crossx-wallet-avatar"><img class="__crossx-wallet-avatar-img" src="${t}" alt="" onerror="this.style.display='none';this.nextElementSibling.innerHTML='${n}';this.nextElementSibling.style.display='flex';"><span class="__crossx-wallet-avatar-fallback"></span></span>`;
9278
+ function Ot(i, e, r) {
9279
+ const t = Gs(i, r), n = Ws().replace(/"/g, "&quot;");
9280
+ return `<span class="__crossx-wallet-avatar"><img class="__crossx-wallet-avatar-img" src="${f(t)}" alt="" onerror="this.style.display='none';this.nextElementSibling.innerHTML='${n}';this.nextElementSibling.style.display='flex';"><span class="__crossx-wallet-avatar-fallback"></span></span>`;
9199
9281
  }
9200
- function Bs(i, e, r, t) {
9282
+ function Ks(i, e, r, t) {
9201
9283
  const s = r == null ? void 0 : r.toLowerCase(), n = i.map((a) => {
9202
- const l = s && a.address.toLowerCase() === s, p = l ? " __crossx-wallet-item--selected" : "", h = l ? `<span class="__crossx-wallet-selected">${m((t == null ? void 0 : t.wallet_selector_selected) ?? "Selected")}</span><span class="__crossx-wallet-check">${Ls}</span>` : "";
9203
- return `<button class="__crossx-wallet-item${p}" data-wallet-index="${a.index}" data-wallet-address="${m(a.address)}">
9204
- ${Ct(a.address, a.index, e.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${m(Pt(a))}</span><span class="__crossx-wallet-addr">${vt(a.address)}</span></span>${h}
9284
+ const l = s && a.address.toLowerCase() === s, p = l ? " __crossx-wallet-item--selected" : "", h = l ? `<span class="__crossx-wallet-selected">${f((t == null ? void 0 : t.wallet_selector_selected) ?? "Selected")}</span><span class="__crossx-wallet-check">${Us}</span>` : "";
9285
+ return `<button class="__crossx-wallet-item${p}" data-wallet-index="${f(String(a.index))}" data-wallet-address="${f(a.address)}">
9286
+ ${Ot(a.address, a.index, e.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${f(Pt(a))}</span><span class="__crossx-wallet-addr">${f(vt(a.address))}</span></span>${h}
9205
9287
  </button>`;
9206
9288
  }).join(""), o = document.createElement("div");
9207
9289
  return o.id = U, o.className = "__crossx-overlay--wallet-selector", o.innerHTML = `
@@ -9209,8 +9291,8 @@ function Bs(i, e, r, t) {
9209
9291
  <div class="__crossx-header">
9210
9292
  <span class="__crossx-wallet-sheet-handle" aria-hidden="true"></span>
9211
9293
  <div class="__crossx-wallet-header-copy">
9212
- <p class="__crossx-title" id="__crossx-ttl">${m((t == null ? void 0 : t.wallet_selector_title) ?? "Select Connected Wallet")}</p>
9213
- <p class="__crossx-subtitle--body">${m((t == null ? void 0 : t.wallet_selector_description) ?? "Please select the wallet you previously used for this game to continue.")}</p>
9294
+ <p class="__crossx-title" id="__crossx-ttl">${f((t == null ? void 0 : t.wallet_selector_title) ?? "Select Connected Wallet")}</p>
9295
+ <p class="__crossx-subtitle--body">${f((t == null ? void 0 : t.wallet_selector_description) ?? "Please select the wallet you previously used for this game to continue.")}</p>
9214
9296
  </div>
9215
9297
  <button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${H}</button>
9216
9298
  </div>
@@ -9221,26 +9303,26 @@ function Bs(i, e, r, t) {
9221
9303
  ${n}
9222
9304
  </div>
9223
9305
  <button class="__crossx-wallet-add" id="__crossx-add-wallet-btn" type="button">
9224
- <span class="__crossx-wallet-add-icon">${Ds}</span>
9225
- <span class="__crossx-wallet-add-label">${m((t == null ? void 0 : t.wallet_selector_add_button) ?? "Add Wallet")}</span>
9306
+ <span class="__crossx-wallet-add-icon">${Bs}</span>
9307
+ <span class="__crossx-wallet-add-label">${f((t == null ? void 0 : t.wallet_selector_add_button) ?? "Add Wallet")}</span>
9226
9308
  </button>
9227
9309
  <p class="__crossx-wallet-add-error" id="__crossx-add-wallet-error" role="alert" aria-live="polite" hidden></p>
9228
9310
  </div>
9229
9311
  <div class="__crossx-wallet-help-section">
9230
9312
  <div class="__crossx-mig-info">
9231
- <p class="__crossx-mig-info-title">${m((t == null ? void 0 : t.wallet_selector_info_title) ?? "Why do I need to select a wallet?")}</p>
9232
- <p class="__crossx-mig-info-desc">${m((t == null ? void 0 : t.wallet_selector_info_desc) ?? "Identifying your previously linked wallet ensures your game progress and assets are synced correctly.")}</p>
9313
+ <p class="__crossx-mig-info-title">${f((t == null ? void 0 : t.wallet_selector_info_title) ?? "Why do I need to select a wallet?")}</p>
9314
+ <p class="__crossx-mig-info-desc">${f((t == null ? void 0 : t.wallet_selector_info_desc) ?? "Identifying your previously linked wallet ensures your game progress and assets are synced correctly.")}</p>
9233
9315
  </div>
9234
9316
  </div>
9235
9317
  </div>
9236
9318
  </div>
9237
9319
  `, o;
9238
9320
  }
9239
- function Us(i, e) {
9321
+ function Vs(i, e) {
9240
9322
  const r = document.createElement("div");
9241
9323
  r.id = U;
9242
9324
  const t = document.createElement("div");
9243
- t.className = "__crossx-card __crossx-card--wallet-created", ms(t, i), t.role = "dialog", t.ariaModal = "true", t.setAttribute("aria-labelledby", "__crossx-ttl");
9325
+ t.className = "__crossx-card __crossx-card--wallet-created", Es(t, i), t.role = "dialog", t.ariaModal = "true", t.setAttribute("aria-labelledby", "__crossx-ttl");
9244
9326
  const s = document.createElement("div");
9245
9327
  s.className = "__crossx-header";
9246
9328
  const n = document.createElement("span");
@@ -9272,27 +9354,27 @@ function Us(i, e) {
9272
9354
  g("__crossx-wallet-created-dot __crossx-wallet-created-dot--one"),
9273
9355
  g("__crossx-wallet-created-dot __crossx-wallet-created-dot--two")
9274
9356
  ), h.appendChild(_), p.appendChild(h);
9275
- const w = document.createElement("div");
9276
- w.className = "__crossx-wallet-created-footer";
9277
- const f = document.createElement("button");
9278
- return f.className = "__crossx-wallet-created-btn", f.id = "__crossx-wallet-created-done", f.type = "button", f.textContent = (e == null ? void 0 : e.wallet_created_button) ?? "Got it", w.appendChild(f), t.append(s, l, p, w), r.appendChild(t), r;
9357
+ const m = document.createElement("div");
9358
+ m.className = "__crossx-wallet-created-footer";
9359
+ const w = document.createElement("button");
9360
+ return w.className = "__crossx-wallet-created-btn", w.id = "__crossx-wallet-created-done", w.type = "button", w.textContent = (e == null ? void 0 : e.wallet_created_button) ?? "Got it", m.appendChild(w), t.append(s, l, p, m), r.appendChild(t), r;
9279
9361
  }
9280
- const Ws = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
9362
+ const qs = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
9281
9363
  <path d="M26.693 21.193c-.028-3.168 2.587-4.712 2.706-4.786-1.477-2.16-3.77-2.454-4.58-2.484-1.944-.197-3.804 1.148-4.793 1.148-.992 0-2.52-1.12-4.147-1.09-2.13.032-4.1 1.239-5.198 3.133-2.222 3.855-.569 9.562 1.593 12.69 1.061 1.535 2.318 3.258 3.975 3.196 1.6-.064 2.2-1.03 4.133-1.03 1.928 0 2.48 1.03 4.172.997 1.72-.03 2.806-1.56 3.862-3.1 1.211-1.779 1.713-3.495 1.74-3.583-.037-.017-3.427-1.316-3.463-5.09z" fill="currentColor"/>
9282
9364
  <path d="M23.527 11.876c.877-1.065 1.471-2.545 1.31-4.024-1.266.053-2.807.845-3.718 1.907-.813.946-1.53 2.468-1.34 3.915 1.41.107 2.852-.716 3.748-1.798z" fill="currentColor"/>
9283
- </svg>`, Hs = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
9365
+ </svg>`, zs = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
9284
9366
  <path d="M38.06 20.44c0-1.34-.12-2.63-.34-3.87H20.5v7.32h9.84c-.42 2.28-1.71 4.21-3.65 5.51v4.57h5.91c3.46-3.19 5.46-7.88 5.46-13.53z" fill="#4285F4"/>
9285
9367
  <path d="M20.5 38.5c4.94 0 9.09-1.64 12.12-4.44l-5.91-4.57c-1.64 1.1-3.73 1.75-6.21 1.75-4.77 0-8.82-3.22-10.26-7.55H4.16v4.72A18.49 18.49 0 0 0 20.5 38.5z" fill="#34A853"/>
9286
9368
  <path d="M10.24 23.69A11.16 11.16 0 0 1 9.66 20c0-1.28.22-2.52.58-3.69v-4.72H4.16A18.49 18.49 0 0 0 2 20c0 2.97.71 5.78 1.97 8.28l6.27-4.59z" fill="#FBBC05"/>
9287
9369
  <path d="M20.5 8.76c2.69 0 5.1.92 7 2.73l5.24-5.24C29.58 3.36 25.43 1.5 20.5 1.5A18.49 18.49 0 0 0 4.16 11.59l6.08 4.72C11.68 11.98 15.73 8.76 20.5 8.76z" fill="#EA4335"/>
9288
9370
  </svg>`;
9289
- function Gs(i) {
9371
+ function js(i) {
9290
9372
  const e = Xt(i);
9291
- return `<span class="__crossx-connect-other-wallet-desc-part"><span class="__crossx-connect-other-wallet-icon" aria-hidden="true">${gs[i] ?? ""}</span><span class="__crossx-connect-other-wallet-name">${m(e)}</span></span>`;
9373
+ return `<span class="__crossx-connect-other-wallet-desc-part"><span class="__crossx-connect-other-wallet-icon" aria-hidden="true">${bs[i] ?? ""}</span><span class="__crossx-connect-other-wallet-name">${f(e)}</span></span>`;
9292
9374
  }
9293
- function Ks(i) {
9375
+ function Ys(i) {
9294
9376
  if (i.length === 0) return "";
9295
- const e = (s) => Gs(i[s]), r = "Supported wallets include ";
9377
+ const e = (s) => js(i[s]), r = "Supported wallets include ";
9296
9378
  if (i.length === 1)
9297
9379
  return `${r}${e(0)}.`;
9298
9380
  if (i.length === 2)
@@ -9302,23 +9384,23 @@ function Ks(i) {
9302
9384
  const t = i.length - 3;
9303
9385
  return `${r}${e(0)}, ${e(1)}, ${e(2)}, and ${t} more.`;
9304
9386
  }
9305
- function Vs(i, e = [], r) {
9306
- const t = i, s = m(String(e[0])), n = m((r == null ? void 0 : r.login_selector_or) ?? "or"), o = e.length > 0 ? `
9387
+ function Xs(i, e = [], r) {
9388
+ const t = i, s = f(String(e[0])), n = f((r == null ? void 0 : r.login_selector_or) ?? "or"), o = e.length > 0 ? `
9307
9389
  <div class="__crossx-login-or-divider">
9308
9390
  <hr><span>${n}</span><hr>
9309
9391
  </div>
9310
9392
  <button type="button" class="__crossx-connect-other-block" id="__crossx-connect-other-wallet-btn" data-wallet-id="${s}" aria-labelledby="__crossx-connect-other-heading">
9311
9393
  <span class="__crossx-connect-other-text">
9312
- <span class="__crossx-connect-other-title" id="__crossx-connect-other-heading">${m((r == null ? void 0 : r.login_selector_connect_other_wallets) ?? "Connect with Other Wallets")}</span>
9313
- <span class="__crossx-connect-other-desc __crossx-connect-other-summary">${Ks(e)}</span>
9394
+ <span class="__crossx-connect-other-title" id="__crossx-connect-other-heading">${f((r == null ? void 0 : r.login_selector_connect_other_wallets) ?? "Connect with Other Wallets")}</span>
9395
+ <span class="__crossx-connect-other-desc __crossx-connect-other-summary">${Ys(e)}</span>
9314
9396
  </span>
9315
9397
  </button>` : "", a = document.createElement("div");
9316
9398
  return a.id = U, a.innerHTML = `
9317
9399
  <div class="__crossx-card __crossx-card--migration" style="${G(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
9318
9400
  <div class="__crossx-header">
9319
9401
  <div style="display:flex;flex-direction:column;gap:4px;padding-right:36px;">
9320
- <p class="__crossx-title" id="__crossx-ttl" style="padding-right:0;">${m((r == null ? void 0 : r.login_selector_title) ?? Ke)}</p>
9321
- <p class="__crossx-subtitle">${m((r == null ? void 0 : r.login_selector_subtitle) ?? "Sign in instantly with your social account")}</p>
9402
+ <p class="__crossx-title" id="__crossx-ttl" style="padding-right:0;">${f((r == null ? void 0 : r.login_selector_title) ?? Ge)}</p>
9403
+ <p class="__crossx-subtitle">${f((r == null ? void 0 : r.login_selector_subtitle) ?? "Sign in instantly with your social account")}</p>
9322
9404
  </div>
9323
9405
  <button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${H}</button>
9324
9406
  </div>
@@ -9326,50 +9408,50 @@ function Vs(i, e = [], r) {
9326
9408
  <div class="__crossx-body">
9327
9409
  <div class="__crossx-login-btn-row">
9328
9410
  <button class="__crossx-login-btn" id="__crossx-apple-btn" type="button">
9329
- <span class="__crossx-login-icon" style="color:var(--cx-value);">${Ws}</span>
9330
- <span class="__crossx-login-btn-label">${m((r == null ? void 0 : r.login_selector_apple) ?? "Sign in with Apple")}</span>
9411
+ <span class="__crossx-login-icon" style="color:var(--cx-value);">${qs}</span>
9412
+ <span class="__crossx-login-btn-label">${f((r == null ? void 0 : r.login_selector_apple) ?? "Sign in with Apple")}</span>
9331
9413
  </button>
9332
9414
  <button class="__crossx-login-btn" id="__crossx-google-btn" type="button">
9333
- <span class="__crossx-login-icon">${Hs}</span>
9334
- <span class="__crossx-login-btn-label">${m((r == null ? void 0 : r.login_selector_google) ?? "Sign in with Google")}</span>
9415
+ <span class="__crossx-login-icon">${zs}</span>
9416
+ <span class="__crossx-login-btn-label">${f((r == null ? void 0 : r.login_selector_google) ?? "Sign in with Google")}</span>
9335
9417
  </button>
9336
9418
  </div>${o}
9337
9419
  <p class="__crossx-login-terms">
9338
- ${((r == null ? void 0 : r.login_selector_terms_template) ?? "By continuing, you agree to NEXUS {tos} and consent to its {pp}").replace("{tos}", `<a class="__crossx-login-terms-link" href="https://terms.onechain.nexus/docs/terms-july-23-2026" target="_blank" rel="noopener noreferrer">${m((r == null ? void 0 : r.login_selector_terms_tos) ?? "Terms of Service")}</a>`).replace("{pp}", `<a class="__crossx-login-terms-link" href="https://terms.onechain.nexus/docs/pp-july-23-2026" target="_blank" rel="noopener noreferrer">${m((r == null ? void 0 : r.login_selector_terms_pp) ?? "Privacy Policy.")}</a>`)}
9420
+ ${((r == null ? void 0 : r.login_selector_terms_template) ?? "By continuing, you agree to NEXUS {tos} and consent to its {pp}").replace("{tos}", `<a class="__crossx-login-terms-link" href="https://terms.onechain.nexus/docs/terms-july-23-2026" target="_blank" rel="noopener noreferrer">${f((r == null ? void 0 : r.login_selector_terms_tos) ?? "Terms of Service")}</a>`).replace("{pp}", `<a class="__crossx-login-terms-link" href="https://terms.onechain.nexus/docs/pp-july-23-2026" target="_blank" rel="noopener noreferrer">${f((r == null ? void 0 : r.login_selector_terms_pp) ?? "Privacy Policy.")}</a>`)}
9339
9421
  </p>
9340
9422
  </div>
9341
9423
  </div>
9342
9424
  `, a;
9343
9425
  }
9344
- function zs(i, e) {
9426
+ function Js(i, e) {
9345
9427
  const r = i, t = document.createElement("div");
9346
9428
  t.id = U;
9347
- const s = m(e.message).replace(/\n/g, "<br>"), n = e.email ? `<div class="__crossx-session-account-card">
9348
- <p class="__crossx-session-account-label">${m(e.accountLabel)}</p>
9349
- <p class="__crossx-session-account-email">${m(e.email)}</p>
9429
+ const s = f(e.message).replace(/\n/g, "<br>"), n = e.email ? `<div class="__crossx-session-account-card">
9430
+ <p class="__crossx-session-account-label">${f(e.accountLabel)}</p>
9431
+ <p class="__crossx-session-account-email">${f(e.email)}</p>
9350
9432
  </div>` : "";
9351
9433
  return t.innerHTML = `
9352
9434
  <div class="__crossx-card __crossx-card--migration" style="${G(r)}" role="alertdialog" aria-modal="true" aria-labelledby="__crossx-session-header-title" aria-describedby="__crossx-session-msg">
9353
9435
  <div class="__crossx-header">
9354
- <p class="__crossx-title" id="__crossx-session-header-title">${m(e.title)}</p>
9436
+ <p class="__crossx-title" id="__crossx-session-header-title">${f(e.title)}</p>
9355
9437
  <button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${H}</button>
9356
9438
  </div>
9357
9439
  <hr class="__crossx-divider">
9358
9440
  <div class="__crossx-body" style="padding:20px 24px 24px;display:flex;flex-direction:column;gap:16px;">
9359
9441
  <div class="__crossx-session-hero">
9360
- <p class="__crossx-session-hero-title">${m(e.title)}</p>
9442
+ <p class="__crossx-session-hero-title">${f(e.title)}</p>
9361
9443
  <p class="__crossx-session-hero-message" id="__crossx-session-msg">${s}</p>
9362
9444
  </div>
9363
9445
  ${n}
9364
9446
  <div class="__crossx-btn-row">
9365
- <button class="__crossx-cancel-btn" id="__crossx-session-signout">${m(e.signOutLabel)}</button>
9366
- <button class="__crossx-confirm-btn" id="__crossx-session-signin">${m(e.signInAgainLabel)}</button>
9447
+ <button class="__crossx-cancel-btn" id="__crossx-session-signout">${f(e.signOutLabel)}</button>
9448
+ <button class="__crossx-confirm-btn" id="__crossx-session-signin">${f(e.signInAgainLabel)}</button>
9367
9449
  </div>
9368
9450
  </div>
9369
9451
  </div>
9370
9452
  `, t;
9371
9453
  }
9372
- function qs(i, e = !0) {
9454
+ function Zs(i, e = !0) {
9373
9455
  const r = i, t = e ? `<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${H}</button>` : "", s = e ? '<button class="__crossx-skip-btn" id="__crossx-skip-btn">Skip for Now</button>' : "", n = document.createElement("div");
9374
9456
  return n.id = U, n.innerHTML = `
9375
9457
  <div class="__crossx-card __crossx-card--migration" style="${G(r)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
@@ -9393,7 +9475,7 @@ function qs(i, e = !0) {
9393
9475
  </div>
9394
9476
  `, n;
9395
9477
  }
9396
- function js(i, e) {
9478
+ function Qs(i, e) {
9397
9479
  const r = i, { errorMessage: t, attemptCount: s, maxAttempts: n = 5 } = e ?? {}, o = !!t, a = o ? " --error" : "", l = s != null && s > 0 ? `<p class="__crossx-pin-attempt">${s}/${n}</p>` : "", p = s != null && s >= 3 ? '<p class="__crossx-pin-warning">Your account will be locked after further failures.</p>' : "", h = o ? `<p class="__crossx-pin-error-text">${t}</p>` : "", _ = document.createElement("div");
9398
9480
  return _.id = U, _.innerHTML = `
9399
9481
  <div class="__crossx-card __crossx-card--migration" style="${G(r)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
@@ -9417,12 +9499,12 @@ function js(i, e) {
9417
9499
  </div>
9418
9500
  `, _;
9419
9501
  }
9420
- function Ys(i) {
9502
+ function ei(i) {
9421
9503
  const e = new Date(i), r = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], t = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], s = r[e.getDay()], n = t[e.getMonth()], o = e.getDate(), a = String(e.getHours()).padStart(2, "0"), l = String(e.getMinutes()).padStart(2, "0");
9422
9504
  return `${s}, ${n} ${o} ${a}:${l}`;
9423
9505
  }
9424
- function Xs(i, e, r) {
9425
- const t = i, s = e <= 0, n = s ? null : Date.now() + e * 1e3, o = n ? Ys(n) : null, a = document.createElement("div");
9506
+ function ti(i, e, r) {
9507
+ const t = i, s = e <= 0, n = s ? null : Date.now() + e * 1e3, o = n ? ei(n) : null, a = document.createElement("div");
9426
9508
  return a.id = U, a.innerHTML = `
9427
9509
  <div class="__crossx-card __crossx-card--migration" style="${G(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
9428
9510
  <div class="__crossx-header">
@@ -9452,18 +9534,18 @@ function Xs(i, e, r) {
9452
9534
  return () => clearInterval(_);
9453
9535
  } };
9454
9536
  }
9455
- function Js(i) {
9537
+ function ri(i) {
9456
9538
  const r = [i.check1, i.check2].map((t, s) => `
9457
9539
  <div class="__crossx-pw-notice-item" data-check-index="${s}" role="checkbox" aria-checked="false" tabindex="0">
9458
- <div class="__crossx-pw-notice-check" id="__crossx-notice-check-${s}">${ti}</div>
9459
- <span class="__crossx-pw-notice-item-text">${m(t)}</span>
9540
+ <div class="__crossx-pw-notice-check" id="__crossx-notice-check-${s}">${oi}</div>
9541
+ <span class="__crossx-pw-notice-item-text">${f(t)}</span>
9460
9542
  </div>
9461
9543
  `).join("");
9462
9544
  return `
9463
9545
  <div class="__crossx-header">
9464
9546
  <span class="__crossx-pin6-sheet-handle" aria-hidden="true"></span>
9465
- <p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${m(i.title)}</p>
9466
- <p class="__crossx-pw-subtitle">${m(i.headerSubtitle)}</p>
9547
+ <p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${f(i.title)}</p>
9548
+ <p class="__crossx-pw-subtitle">${f(i.headerSubtitle)}</p>
9467
9549
  <button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${H}</button>
9468
9550
  </div>
9469
9551
  <hr class="__crossx-divider">
@@ -9471,10 +9553,10 @@ function Js(i) {
9471
9553
  <div class="__crossx-pw-fields __crossx-pw-fields--notice">
9472
9554
  <div class="__crossx-pw-notice-header">
9473
9555
  <div class="__crossx-pw-notice-title-row">
9474
- <span class="__crossx-pw-notice-icon">${ri}</span>
9475
- <p class="__crossx-pw-notice-title">${m(i.noticeTitle)}</p>
9556
+ <span class="__crossx-pw-notice-icon">${ai}</span>
9557
+ <p class="__crossx-pw-notice-title">${f(i.noticeTitle)}</p>
9476
9558
  </div>
9477
- <p class="__crossx-pw-notice-desc">${m(i.noticeDesc)}</p>
9559
+ <p class="__crossx-pw-notice-desc">${f(i.noticeDesc)}</p>
9478
9560
  </div>
9479
9561
  <div class="__crossx-pw-notice-checks" id="__crossx-notice-checks">
9480
9562
  ${r}
@@ -9483,51 +9565,51 @@ function Js(i) {
9483
9565
  </div>
9484
9566
  <div class="__crossx-pin6-footer">
9485
9567
  <button class="__crossx-pw-btn --disabled" id="__crossx-pin-notice-next"
9486
- data-next-label="${m(i.nextButton)}"
9487
- data-submit-label="${m(i.submitButton)}">
9488
- ${m(i.submitButton)}
9568
+ data-next-label="${f(i.nextButton)}"
9569
+ data-submit-label="${f(i.submitButton)}">
9570
+ ${f(i.submitButton)}
9489
9571
  </button>
9490
9572
  </div>
9491
9573
  <div class="__crossx-home-indicator"></div>
9492
9574
  `;
9493
9575
  }
9494
- function Le(i) {
9495
- const e = !!i.lockExpiresAt && i.lockExpiresAt > Date.now(), r = i.lockExpiresAt ? ` data-lock-expires="${i.lockExpiresAt}"` : "", t = i.headerSubtitle ? `<p class="__crossx-pin6-header-sub">${m(i.headerSubtitle)}</p>` : "", s = i.subtitle ? `<p class="__crossx-pin6-subtitle">${m(i.subtitle)}</p>` : "", n = i.errorMessage ? `<p class="__crossx-pin6-error" id="__crossx-pin6-error">${m(i.errorMessage)}</p>` : '<p class="__crossx-pin6-error" id="__crossx-pin6-error"></p>', o = e ? `<p class="__crossx-pin6-lock-msg" id="__crossx-pin6-lock-msg">
9496
- ${Ot}
9576
+ function De(i) {
9577
+ const e = !!i.lockExpiresAt && i.lockExpiresAt > Date.now(), r = i.lockExpiresAt ? ` data-lock-expires="${i.lockExpiresAt}"` : "", t = i.headerSubtitle ? `<p class="__crossx-pin6-header-sub">${f(i.headerSubtitle)}</p>` : "", s = i.subtitle ? `<p class="__crossx-pin6-subtitle">${f(i.subtitle)}</p>` : "", n = i.errorMessage ? `<p class="__crossx-pin6-error" id="__crossx-pin6-error">${f(i.errorMessage)}</p>` : '<p class="__crossx-pin6-error" id="__crossx-pin6-error"></p>', o = e ? `<p class="__crossx-pin6-lock-msg" id="__crossx-pin6-lock-msg">
9578
+ ${Dt}
9497
9579
  <span id="__crossx-pin6-lock-countdown"></span>
9498
- </p>` : "", a = i.warningMessage && i.attemptCount != null && i.attemptCount > 0 ? `<p class="__crossx-pin6-warning" id="__crossx-pin6-warning">${m(i.warningMessage)}</p>` : '<p class="__crossx-pin6-warning" id="__crossx-pin6-warning"></p>', l = i.attemptCount != null && i.attemptCount > 0 ? `<p class="__crossx-pin6-attempt" id="__crossx-pin6-attempt">${i.attemptCount}/${i.maxAttempts ?? "?"}</p>` : '<p class="__crossx-pin6-attempt" id="__crossx-pin6-attempt"></p>', p = e ? " --locked" : "", h = Array.from(
9580
+ </p>` : "", a = i.warningMessage && i.attemptCount != null && i.attemptCount > 0 ? `<p class="__crossx-pin6-warning" id="__crossx-pin6-warning">${f(i.warningMessage)}</p>` : '<p class="__crossx-pin6-warning" id="__crossx-pin6-warning"></p>', l = i.attemptCount != null && i.attemptCount > 0 ? `<p class="__crossx-pin6-attempt" id="__crossx-pin6-attempt">${i.attemptCount}/${i.maxAttempts ?? "?"}</p>` : '<p class="__crossx-pin6-attempt" id="__crossx-pin6-attempt"></p>', p = e ? " --locked" : "", h = Array.from(
9499
9581
  { length: 6 },
9500
9582
  (x, y) => `<input class="__crossx-pin6-box${p}" type="tel" maxlength="1" inputmode="numeric" pattern="[0-9]" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" aria-label="PIN digit ${y + 1}"${e ? " disabled" : ""}>`
9501
9583
  ).join(""), _ = e ? " --locked" : "", g = Array.from(
9502
9584
  { length: 6 },
9503
9585
  (x, y) => `<div class="__crossx-pin6-dot${_}" data-dot-index="${y}" aria-label="PIN digit ${y + 1}"></div>`
9504
- ).join(""), w = e ? " --disabled" : "", f = `
9586
+ ).join(""), m = e ? " --disabled" : "", w = `
9505
9587
  <div class="__crossx-pin6-numpad" id="__crossx-pin6-numpad">
9506
9588
  <div class="__crossx-pin6-numpad-row">
9507
- <button type="button" class="__crossx-pin6-numpad-key${w}" data-key="1">1</button>
9508
- <button type="button" class="__crossx-pin6-numpad-key${w}" data-key="2">2</button>
9509
- <button type="button" class="__crossx-pin6-numpad-key${w}" data-key="3">3</button>
9589
+ <button type="button" class="__crossx-pin6-numpad-key${m}" data-key="1">1</button>
9590
+ <button type="button" class="__crossx-pin6-numpad-key${m}" data-key="2">2</button>
9591
+ <button type="button" class="__crossx-pin6-numpad-key${m}" data-key="3">3</button>
9510
9592
  </div>
9511
9593
  <div class="__crossx-pin6-numpad-row">
9512
- <button type="button" class="__crossx-pin6-numpad-key${w}" data-key="4">4</button>
9513
- <button type="button" class="__crossx-pin6-numpad-key${w}" data-key="5">5</button>
9514
- <button type="button" class="__crossx-pin6-numpad-key${w}" data-key="6">6</button>
9594
+ <button type="button" class="__crossx-pin6-numpad-key${m}" data-key="4">4</button>
9595
+ <button type="button" class="__crossx-pin6-numpad-key${m}" data-key="5">5</button>
9596
+ <button type="button" class="__crossx-pin6-numpad-key${m}" data-key="6">6</button>
9515
9597
  </div>
9516
9598
  <div class="__crossx-pin6-numpad-row">
9517
- <button type="button" class="__crossx-pin6-numpad-key${w}" data-key="7">7</button>
9518
- <button type="button" class="__crossx-pin6-numpad-key${w}" data-key="8">8</button>
9519
- <button type="button" class="__crossx-pin6-numpad-key${w}" data-key="9">9</button>
9599
+ <button type="button" class="__crossx-pin6-numpad-key${m}" data-key="7">7</button>
9600
+ <button type="button" class="__crossx-pin6-numpad-key${m}" data-key="8">8</button>
9601
+ <button type="button" class="__crossx-pin6-numpad-key${m}" data-key="9">9</button>
9520
9602
  </div>
9521
9603
  <div class="__crossx-pin6-numpad-row">
9522
9604
  <button type="button" class="__crossx-pin6-numpad-key --empty" aria-hidden="true"></button>
9523
- <button type="button" class="__crossx-pin6-numpad-key${w}" data-key="0">0</button>
9524
- <button type="button" class="__crossx-pin6-numpad-key --delete${w}" data-key="backspace" aria-label="Delete">${ei}</button>
9605
+ <button type="button" class="__crossx-pin6-numpad-key${m}" data-key="0">0</button>
9606
+ <button type="button" class="__crossx-pin6-numpad-key --delete${m}" data-key="backspace" aria-label="Delete">${ni}</button>
9525
9607
  </div>
9526
9608
  </div>`;
9527
9609
  return `
9528
9610
  <div class="__crossx-header">
9529
9611
  <span class="__crossx-pin6-sheet-handle" aria-hidden="true"></span>
9530
- <p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${m(i.title)}</p>
9612
+ <p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${f(i.title)}</p>
9531
9613
  ${t}
9532
9614
  <button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${H}</button>
9533
9615
  </div>
@@ -9545,7 +9627,7 @@ function Le(i) {
9545
9627
  ${l}
9546
9628
  ${o}
9547
9629
  </div>
9548
- ${f}
9630
+ ${w}
9549
9631
  `;
9550
9632
  }
9551
9633
  function gt(i, e) {
@@ -9556,204 +9638,204 @@ function gt(i, e) {
9556
9638
  </div>
9557
9639
  `, r;
9558
9640
  }
9559
- function Zs(i, e) {
9641
+ function si(i, e) {
9560
9642
  if (i.length !== 6) return e.tooShort;
9561
9643
  if (!/^\d+$/.test(i)) return e.numbersOnly;
9562
9644
  if (/(.)\1{2}/.test(i)) return e.repeatingDigit;
9563
9645
  const r = i.split("").map(Number), t = r.every((n, o) => o === 0 || n === (r[o - 1] + 1) % 10), s = r.every((n, o) => o === 0 || n === (r[o - 1] + 9) % 10);
9564
9646
  return t || s ? e.sequential : i[0] !== i[1] && i === i.slice(0, 2).repeat(3) ? e.alternatingPattern : null;
9565
9647
  }
9566
- function Qs(i) {
9648
+ function ii(i) {
9567
9649
  const e = Math.max(0, Math.ceil(i / 1e3)), r = Math.floor(e / 3600), t = Math.floor(e % 3600 / 60), s = e % 60;
9568
9650
  return r > 0 ? `${r}h ${String(t).padStart(2, "0")}m` : `${String(t).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
9569
9651
  }
9570
- function Me(i, e, r, t, s, n, o) {
9652
+ function Le(i, e, r, t, s, n, o) {
9571
9653
  var Ye, Xe;
9572
9654
  let a = !!(n && n > Date.now()), l = !1;
9573
- const p = () => Array.from(i.querySelectorAll(".__crossx-pin6-box")), h = () => i.querySelector("#__crossx-pin6-boxes"), _ = () => i.querySelector("#__crossx-pin6-error"), g = () => i.querySelector("#__crossx-pin6-lock-msg"), w = () => i.querySelector("#__crossx-pin6-lock-countdown"), f = () => i.querySelector(".__crossx-pin6-body"), x = "●", y = (v, S) => {
9574
- v.dataset.digit = S, v.value = x;
9575
- }, b = (v) => {
9576
- delete v.dataset.digit, v.value = "";
9577
- }, E = (v) => v.dataset.digit ?? "", A = () => p().map(E).join(""), T = () => Array.from(i.querySelectorAll(".__crossx-pin6-dot")), R = () => {
9578
- var k;
9579
- const v = p(), S = T();
9580
- if (S.length && (S.forEach((N, P) => {
9581
- const B = !!(v[P] && E(v[P]));
9655
+ const p = () => Array.from(i.querySelectorAll(".__crossx-pin6-box")), h = () => i.querySelector("#__crossx-pin6-boxes"), _ = () => i.querySelector("#__crossx-pin6-error"), g = () => i.querySelector("#__crossx-pin6-lock-msg"), m = () => i.querySelector("#__crossx-pin6-lock-countdown"), w = () => i.querySelector(".__crossx-pin6-body"), x = "●", y = (S, v) => {
9656
+ S.dataset.digit = v, S.value = x;
9657
+ }, b = (S) => {
9658
+ delete S.dataset.digit, S.value = "";
9659
+ }, E = (S) => S.dataset.digit ?? "", A = () => p().map(E).join(""), k = () => Array.from(i.querySelectorAll(".__crossx-pin6-dot")), R = () => {
9660
+ var T;
9661
+ const S = p(), v = k();
9662
+ if (v.length && (v.forEach((N, C) => {
9663
+ const B = !!(S[C] && E(S[C]));
9582
9664
  N.classList.toggle("--filled", B), N.classList.toggle("--active", !1);
9583
9665
  }), !a && !l)) {
9584
- const N = v.findIndex((B) => !E(B));
9585
- (k = S[N === -1 ? 5 : N]) == null || k.classList.add("--active");
9666
+ const N = S.findIndex((B) => !E(B));
9667
+ (T = v[N === -1 ? 5 : N]) == null || T.classList.add("--active");
9586
9668
  }
9587
9669
  }, D = () => {
9588
- i.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach((S) => S.classList.toggle("--disabled", a)), T().forEach((S) => S.classList.toggle("--locked", a)), R();
9589
- }, F = (v) => {
9590
- a = v, p().forEach((S) => {
9591
- S.disabled = v, S.classList.toggle("--locked", v);
9670
+ i.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach((v) => v.classList.toggle("--disabled", a)), k().forEach((v) => v.classList.toggle("--locked", a)), R();
9671
+ }, M = (S) => {
9672
+ a = S, p().forEach((v) => {
9673
+ v.disabled = S, v.classList.toggle("--locked", S);
9592
9674
  });
9593
- }, C = () => i.querySelector("#__crossx-pin6-attempt"), O = () => {
9594
- const v = _();
9595
- v && (v.textContent = "");
9596
- }, K = () => o ?? "Your account will be locked after further failures.", I = () => i.querySelector("#__crossx-pin6-warning"), L = (v) => {
9597
- var k;
9598
- let S = I();
9599
- if (!S) {
9600
- S = document.createElement("p"), S.className = "__crossx-pin6-warning", S.id = "__crossx-pin6-warning";
9675
+ }, P = () => i.querySelector("#__crossx-pin6-attempt"), O = () => {
9676
+ const S = _();
9677
+ S && (S.textContent = "");
9678
+ }, K = () => o ?? "Your account will be locked after further failures.", I = () => i.querySelector("#__crossx-pin6-warning"), L = (S) => {
9679
+ var T;
9680
+ let v = I();
9681
+ if (!v) {
9682
+ v = document.createElement("p"), v.className = "__crossx-pin6-warning", v.id = "__crossx-pin6-warning";
9601
9683
  const N = _();
9602
- N ? N.insertAdjacentElement("afterend", S) : (k = f()) == null || k.appendChild(S);
9684
+ N ? N.insertAdjacentElement("afterend", v) : (T = w()) == null || T.appendChild(v);
9603
9685
  }
9604
- S.textContent = v;
9686
+ v.textContent = S;
9605
9687
  }, $ = () => {
9606
- const v = I();
9607
- v && (v.textContent = "");
9608
- }, X = (v, S) => {
9688
+ const S = I();
9689
+ S && (S.textContent = "");
9690
+ }, X = (S, v) => {
9609
9691
  var N;
9610
- let k = C();
9611
- if (!k) {
9612
- k = document.createElement("p"), k.className = "__crossx-pin6-attempt", k.id = "__crossx-pin6-attempt";
9613
- const P = I() ?? _();
9614
- P ? P.insertAdjacentElement("afterend", k) : (N = f()) == null || N.appendChild(k);
9615
- }
9616
- k.textContent = `${v}/${S}`;
9617
- }, he = () => {
9618
- const v = C();
9619
- v && (v.textContent = "");
9620
- }, me = (v) => {
9621
- const S = _();
9622
- S && (S.textContent = v);
9623
- const k = h();
9624
- k == null || k.classList.add("--shake"), setTimeout(() => k == null ? void 0 : k.classList.remove("--shake"), 500), p().forEach(b), setTimeout(() => {
9692
+ let T = P();
9693
+ if (!T) {
9694
+ T = document.createElement("p"), T.className = "__crossx-pin6-attempt", T.id = "__crossx-pin6-attempt";
9695
+ const C = I() ?? _();
9696
+ C ? C.insertAdjacentElement("afterend", T) : (N = w()) == null || N.appendChild(T);
9697
+ }
9698
+ T.textContent = `${S}/${v}`;
9699
+ }, ue = () => {
9700
+ const S = P();
9701
+ S && (S.textContent = "");
9702
+ }, ye = (S) => {
9703
+ const v = _();
9704
+ v && (v.textContent = S);
9705
+ const T = h();
9706
+ T == null || T.classList.add("--shake"), setTimeout(() => T == null ? void 0 : T.classList.remove("--shake"), 500), p().forEach(b), setTimeout(() => {
9625
9707
  var N;
9626
9708
  (N = p()[0]) == null || N.focus(), R();
9627
9709
  }, 50);
9628
- }, ue = (v) => {
9710
+ }, _e = (S) => {
9629
9711
  var B;
9630
- F(!0), p().forEach(b), D();
9631
- const S = _();
9632
- if (S && (S.textContent = "Too many failed attempts. Please wait."), !g()) {
9712
+ M(!0), p().forEach(b), D();
9713
+ const v = _();
9714
+ if (v && (v.textContent = "Too many failed attempts. Please wait."), !g()) {
9633
9715
  const W = document.createElement("p");
9634
- W.className = "__crossx-pin6-lock-msg", W.id = "__crossx-pin6-lock-msg", W.innerHTML = `${Ot}<span id="__crossx-pin6-lock-countdown"></span>`;
9635
- const q = _();
9636
- q ? q.insertAdjacentElement("afterend", W) : (B = f()) == null || B.appendChild(W);
9716
+ W.className = "__crossx-pin6-lock-msg", W.id = "__crossx-pin6-lock-msg", W.innerHTML = `${Dt}<span id="__crossx-pin6-lock-countdown"></span>`;
9717
+ const j = _();
9718
+ j ? j.insertAdjacentElement("afterend", W) : (B = w()) == null || B.appendChild(W);
9637
9719
  }
9638
- const k = () => {
9720
+ const T = () => {
9639
9721
  var re;
9640
- const W = v - Date.now(), q = w();
9641
- W <= 0 ? (clearInterval(N), F(!1), (re = g()) == null || re.remove(), S && (S.textContent = ""), D(), setTimeout(() => {
9642
- var ye;
9643
- return (ye = p()[0]) == null ? void 0 : ye.focus();
9644
- }, 50)) : q && (q.textContent = ` ${Qs(W)}`);
9645
- }, N = setInterval(k, 1e3);
9646
- k();
9647
- const P = new MutationObserver(() => {
9648
- document.contains(i) || (clearInterval(N), P.disconnect());
9722
+ const W = S - Date.now(), j = m();
9723
+ W <= 0 ? (clearInterval(N), M(!1), (re = g()) == null || re.remove(), v && (v.textContent = ""), D(), setTimeout(() => {
9724
+ var be;
9725
+ return (be = p()[0]) == null ? void 0 : be.focus();
9726
+ }, 50)) : j && (j.textContent = ` ${ii(W)}`);
9727
+ }, N = setInterval(T, 1e3);
9728
+ T();
9729
+ const C = new MutationObserver(() => {
9730
+ document.contains(i) || (clearInterval(N), C.disconnect());
9649
9731
  });
9650
- P.observe(document.body, { childList: !0, subtree: !1 });
9651
- }, se = async () => {
9732
+ C.observe(document.body, { childList: !0, subtree: !1 });
9733
+ }, ie = async () => {
9652
9734
  if (a || l) return;
9653
- const v = A();
9654
- if (v.length === 6) {
9655
- l = !0, p().forEach((S) => {
9656
- S.disabled = !0;
9735
+ const S = A();
9736
+ if (S.length === 6) {
9737
+ l = !0, p().forEach((v) => {
9738
+ v.disabled = !0;
9657
9739
  });
9658
9740
  try {
9659
9741
  if (s) {
9660
- const S = await s(v);
9661
- S.ok ? e(v) : S.lockExpiresAt ? (he(), ue(S.lockExpiresAt)) : (me(S.error ?? "Incorrect PIN. Please try again."), S.attemptCount != null && S.maxAttempts != null ? (L(K()), X(S.attemptCount, S.maxAttempts)) : ($(), he()));
9742
+ const v = await s(S);
9743
+ v.ok ? e(S) : v.lockExpiresAt ? (ue(), _e(v.lockExpiresAt)) : (ye(v.error ?? "Incorrect PIN. Please try again."), v.attemptCount != null && v.maxAttempts != null ? (L(K()), X(v.attemptCount, v.maxAttempts)) : ($(), ue()));
9662
9744
  } else
9663
- e(v);
9664
- } catch (S) {
9665
- t && t(S);
9745
+ e(S);
9746
+ } catch (v) {
9747
+ t && t(v);
9666
9748
  } finally {
9667
- l = !1, a || p().forEach((S) => {
9668
- S.disabled = !1;
9749
+ l = !1, a || p().forEach((v) => {
9750
+ v.disabled = !1;
9669
9751
  }), R();
9670
9752
  }
9671
9753
  }
9672
9754
  };
9673
- n && n > Date.now() ? ue(n) : setTimeout(() => {
9674
- var v;
9675
- return (v = p()[0]) == null ? void 0 : v.focus();
9755
+ n && n > Date.now() ? _e(n) : setTimeout(() => {
9756
+ var S;
9757
+ return (S = p()[0]) == null ? void 0 : S.focus();
9676
9758
  }, 100);
9677
- const _e = () => {
9759
+ const xe = () => {
9678
9760
  if (a || l) return;
9679
- const v = p(), S = v.find((k) => !E(k)) ?? v[v.length - 1];
9680
- S == null || S.focus();
9761
+ const S = p(), v = S.find((T) => !E(T)) ?? S[S.length - 1];
9762
+ v == null || v.focus();
9681
9763
  };
9682
- (Ye = h()) == null || Ye.addEventListener("click", (v) => {
9683
- v.target.classList.contains("__crossx-pin6-box") || _e();
9684
- }), (Xe = f()) == null || Xe.addEventListener("click", (v) => {
9685
- const S = v.target;
9686
- S.classList.contains("__crossx-pin6-box") || S.closest("button") || _e();
9687
- }), p().forEach((v, S) => {
9688
- v.addEventListener("input", () => {
9764
+ (Ye = h()) == null || Ye.addEventListener("click", (S) => {
9765
+ S.target.classList.contains("__crossx-pin6-box") || xe();
9766
+ }), (Xe = w()) == null || Xe.addEventListener("click", (S) => {
9767
+ const v = S.target;
9768
+ v.classList.contains("__crossx-pin6-box") || v.closest("button") || xe();
9769
+ }), p().forEach((S, v) => {
9770
+ S.addEventListener("input", () => {
9689
9771
  var N;
9690
- const k = v.value.replace(/\D/g, "").slice(-1);
9691
- k ? y(v, k) : b(v), O(), k && S < 5 && ((N = p()[S + 1]) == null || N.focus()), R(), A().length === 6 && setTimeout(se, 80);
9692
- }), v.addEventListener("keydown", (k) => {
9693
- var N, P;
9694
- if (k.key === "Backspace") {
9695
- if (k.preventDefault(), E(v))
9696
- b(v);
9697
- else if (S > 0) {
9698
- const B = p()[S - 1];
9772
+ const T = S.value.replace(/\D/g, "").slice(-1);
9773
+ T ? y(S, T) : b(S), O(), T && v < 5 && ((N = p()[v + 1]) == null || N.focus()), R(), A().length === 6 && setTimeout(ie, 80);
9774
+ }), S.addEventListener("keydown", (T) => {
9775
+ var N, C;
9776
+ if (T.key === "Backspace") {
9777
+ if (T.preventDefault(), E(S))
9778
+ b(S);
9779
+ else if (v > 0) {
9780
+ const B = p()[v - 1];
9699
9781
  b(B), B.focus();
9700
9782
  }
9701
9783
  R();
9702
- } else k.key === "ArrowLeft" && S > 0 ? (k.preventDefault(), (N = p()[S - 1]) == null || N.focus()) : k.key === "ArrowRight" && S < 5 ? (k.preventDefault(), (P = p()[S + 1]) == null || P.focus()) : k.key === "Escape" && r();
9703
- }), v.addEventListener("paste", (k) => {
9784
+ } else T.key === "ArrowLeft" && v > 0 ? (T.preventDefault(), (N = p()[v - 1]) == null || N.focus()) : T.key === "ArrowRight" && v < 5 ? (T.preventDefault(), (C = p()[v + 1]) == null || C.focus()) : T.key === "Escape" && r();
9785
+ }), S.addEventListener("paste", (T) => {
9704
9786
  var B, W;
9705
- k.preventDefault();
9706
- const N = (((B = k.clipboardData) == null ? void 0 : B.getData("text")) ?? "").replace(/\D/g, "").slice(0, 6);
9787
+ T.preventDefault();
9788
+ const N = (((B = T.clipboardData) == null ? void 0 : B.getData("text")) ?? "").replace(/\D/g, "").slice(0, 6);
9707
9789
  if (!N) return;
9708
- const P = p();
9709
- N.split("").forEach((q, re) => {
9710
- P[re] && y(P[re], q);
9711
- }), (W = P[Math.min(N.length - 1, 5)]) == null || W.focus(), O(), R(), A().length === 6 && setTimeout(se, 80);
9712
- }), v.addEventListener("focus", () => v.select());
9790
+ const C = p();
9791
+ N.split("").forEach((j, re) => {
9792
+ C[re] && y(C[re], j);
9793
+ }), (W = C[Math.min(N.length - 1, 5)]) == null || W.focus(), O(), R(), A().length === 6 && setTimeout(ie, 80);
9794
+ }), S.addEventListener("focus", () => S.select());
9713
9795
  });
9714
9796
  const J = i.querySelector("#__crossx-pin6-numpad");
9715
9797
  if (J) {
9716
- let v = null;
9717
- const S = () => {
9718
- v && (v.classList.remove("--pressed"), v = null);
9798
+ let S = null;
9799
+ const v = () => {
9800
+ S && (S.classList.remove("--pressed"), S = null);
9719
9801
  };
9720
9802
  J.addEventListener("pointerdown", (N) => {
9721
- const P = N.target.closest(".__crossx-pin6-numpad-key");
9722
- !P || a || l || (S(), v = P, P.classList.add("--pressed"), P.setPointerCapture(N.pointerId));
9803
+ const C = N.target.closest(".__crossx-pin6-numpad-key");
9804
+ !C || a || l || (v(), S = C, C.classList.add("--pressed"), C.setPointerCapture(N.pointerId));
9723
9805
  });
9724
- const k = (N) => {
9725
- const P = N.dataset.key;
9726
- if (!P) return;
9727
- if (P === "backspace") {
9728
- const re = [...p()].reverse().find((ye) => E(ye));
9806
+ const T = (N) => {
9807
+ const C = N.dataset.key;
9808
+ if (!C) return;
9809
+ if (C === "backspace") {
9810
+ const re = [...p()].reverse().find((be) => E(be));
9729
9811
  re && (b(re), O()), R();
9730
9812
  return;
9731
9813
  }
9732
- if (!/^\d$/.test(P)) return;
9733
- const W = p().find((q) => !E(q));
9734
- W && (y(W, P), O(), R(), A().length === 6 && setTimeout(se, 80));
9814
+ if (!/^\d$/.test(C)) return;
9815
+ const W = p().find((j) => !E(j));
9816
+ W && (y(W, C), O(), R(), A().length === 6 && setTimeout(ie, 80));
9735
9817
  };
9736
9818
  J.addEventListener("pointerup", (N) => {
9737
- if (!v) return;
9738
- const P = v;
9739
- S();
9740
- const B = P.getBoundingClientRect();
9741
- N.clientX >= B.left && N.clientX <= B.right && N.clientY >= B.top && N.clientY <= B.bottom && !a && !l && k(P);
9742
- }), J.addEventListener("pointercancel", S), J.addEventListener("pointerleave", S, !0), R(), n && n > Date.now() && D();
9819
+ if (!S) return;
9820
+ const C = S;
9821
+ v();
9822
+ const B = C.getBoundingClientRect();
9823
+ N.clientX >= B.left && N.clientX <= B.right && N.clientY >= B.top && N.clientY <= B.bottom && !a && !l && T(C);
9824
+ }), J.addEventListener("pointercancel", v), J.addEventListener("pointerleave", v, !0), R(), n && n > Date.now() && D();
9743
9825
  }
9744
9826
  }
9745
- const ei = `<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
9827
+ const ni = `<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
9746
9828
  <path d="M7.36 0.5H19.5C20.6046 0.5 21.5 1.39543 21.5 2.5V14.5C21.5 15.6046 20.6046 16.5 19.5 16.5H7.36C6.76 16.5 6.19 16.24 5.8 15.79L0.94 10.02C0.35 9.32 0.35 8.3 0.94 7.6L5.8 1.71C6.19 1.26 6.76 0.5 7.36 0.5Z" stroke="currentColor" stroke-width="1.2" fill="none"/>
9747
9829
  <line x1="10" y1="5.5" x2="16" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
9748
9830
  <line x1="16" y1="5.5" x2="10" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
9749
- </svg>`, Ot = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
9831
+ </svg>`, Dt = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
9750
9832
  <path d="M14.5 8.5H14V6.5C14 4.015 11.985 2 9.5 2C7.015 2 5 4.015 5 6.5V8.5H4.5C3.672 8.5 3 9.172 3 10V16.5C3 17.328 3.672 18 4.5 18H14.5C15.328 18 16 17.328 16 16.5V10C16 9.172 15.328 8.5 14.5 8.5ZM10.5 13.415V15C10.5 15.276 10.276 15.5 10 15.5H9C8.724 15.5 8.5 15.276 8.5 15V13.415C8.187 13.196 8 12.847 8 12.5C8 11.672 8.672 11 9.5 11C10.328 11 11 11.672 11 12.5C11 12.847 10.813 13.196 10.5 13.415ZM12.5 8.5H6.5V6.5C6.5 4.843 7.843 3.5 9.5 3.5C11.157 3.5 12.5 4.843 12.5 6.5V8.5Z" fill="currentColor"/>
9751
- </svg>`, ti = `<svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
9833
+ </svg>`, oi = `<svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
9752
9834
  <path d="M1 4.5L4 7.5L10 1" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
9753
- </svg>`, ri = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
9835
+ </svg>`, ai = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
9754
9836
  <path d="M12 0C18.6274 0 24 5.37258 24 12C23.9999 18.6273 18.6274 24 12 24C5.37264 24 9.89594e-05 18.6273 0 12C0 5.37258 5.37258 0 12 0ZM10.875 15.127V17.377H13.125V15.127H10.875ZM10.875 6.62207V13.627H13.125V6.62207H10.875Z" fill="currentColor"/>
9755
9837
  </svg>`;
9756
- function si(i, e, r) {
9838
+ function ci(i, e, r) {
9757
9839
  var n;
9758
9840
  const t = i.querySelectorAll(".__crossx-pin-input");
9759
9841
  t.forEach((o, a) => {
@@ -9771,8 +9853,8 @@ function si(i, e, r) {
9771
9853
  l.preventDefault();
9772
9854
  const p = (((_ = l.clipboardData) == null ? void 0 : _.getData("text")) ?? "").replace(/\D/g, "").slice(0, 4);
9773
9855
  if (!p) return;
9774
- p.split("").forEach((g, w) => {
9775
- t[w] && (t[w].value = g);
9856
+ p.split("").forEach((g, m) => {
9857
+ t[m] && (t[m].value = g);
9776
9858
  });
9777
9859
  const h = Math.min(p.length, 3);
9778
9860
  t[h].focus(), p.length === 4 && setTimeout(() => e(p), 200);
@@ -9786,9 +9868,9 @@ function si(i, e, r) {
9786
9868
  }
9787
9869
  }), (n = t[0]) == null || n.focus();
9788
9870
  }
9789
- class ii {
9790
- constructor(e = "light", r, t = Ge, s) {
9791
- this.theme = e, this.overrides = r, this.tokens = _t(e, r), this.displayDecimals = t, this.pinKeyboard = s, ds();
9871
+ class li {
9872
+ constructor(e = "light", r, t = He, s) {
9873
+ this.theme = e, this.overrides = r, this.tokens = _t(e, r), this.displayDecimals = t, this.pinKeyboard = s, xs();
9792
9874
  }
9793
9875
  setPinKeyboard(e) {
9794
9876
  this.pinKeyboard = e;
@@ -9831,8 +9913,8 @@ class ii {
9831
9913
  return new Promise((s, n) => {
9832
9914
  var E;
9833
9915
  V();
9834
- const o = [...e], a = Bs(o, this.tokens, t, this.messages), l = ne();
9835
- z(a);
9916
+ const o = [...e], a = Ks(o, this.tokens, t, this.messages), l = ne();
9917
+ q(a);
9836
9918
  let p = !1;
9837
9919
  const h = () => {
9838
9920
  p || (p = !0, a.remove(), l());
@@ -9840,14 +9922,14 @@ class ii {
9840
9922
  let _ = null;
9841
9923
  const g = (A) => {
9842
9924
  h(), s(A);
9843
- }, w = () => {
9925
+ }, m = () => {
9844
9926
  h(), _ ? n(_) : s(null);
9845
9927
  };
9846
9928
  (() => {
9847
9929
  a.querySelectorAll(".__crossx-wallet-item").forEach((A) => {
9848
9930
  A.addEventListener("click", () => {
9849
- const T = A.dataset.walletAddress ?? "", R = parseInt(A.dataset.walletIndex ?? "0", 10), D = o.find((F) => F.index === R);
9850
- g({ address: T, index: R, name: D == null ? void 0 : D.name });
9931
+ const k = A.dataset.walletAddress ?? "", R = parseInt(A.dataset.walletIndex ?? "0", 10), D = o.find((M) => M.index === R);
9932
+ g({ address: k, index: R, name: D == null ? void 0 : D.name });
9851
9933
  });
9852
9934
  });
9853
9935
  })();
@@ -9857,10 +9939,10 @@ class ii {
9857
9939
  try {
9858
9940
  const A = await r();
9859
9941
  o.push(A);
9860
- const T = a.querySelector("#__crossx-wallet-list");
9861
- if (T) {
9942
+ const k = a.querySelector("#__crossx-wallet-list");
9943
+ if (k) {
9862
9944
  const R = document.createElement("button");
9863
- R.className = "__crossx-wallet-item", R.dataset.walletIndex = String(A.index), R.dataset.walletAddress = A.address, R.innerHTML = `${Ct(A.address, A.index, this.tokens.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${m(Pt(A))}</span><span class="__crossx-wallet-addr">${vt(A.address)}</span></span>`, R.addEventListener("click", () => g(A)), T.appendChild(R);
9945
+ R.className = "__crossx-wallet-item", R.dataset.walletIndex = String(A.index), R.dataset.walletAddress = A.address, R.innerHTML = `${Ot(A.address, A.index, this.tokens.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${f(Pt(A))}</span><span class="__crossx-wallet-addr">${f(vt(A.address))}</span></span>`, R.addEventListener("click", () => g(A)), k.appendChild(R);
9864
9946
  try {
9865
9947
  R.scrollIntoView({ behavior: "smooth", block: "nearest" });
9866
9948
  } catch {
@@ -9868,14 +9950,14 @@ class ii {
9868
9950
  }
9869
9951
  y.disabled = !1;
9870
9952
  } catch (A) {
9871
- const T = A instanceof u && A.code === d.ADDRESS_LIMIT_EXCEEDED, R = this.resolveAddWalletErrorMessage(A);
9872
- x && (x.textContent = R, x.hidden = !1), T ? (y.disabled = !0, y.setAttribute("aria-disabled", "true")) : y.disabled = !1, _ = A;
9953
+ const k = A instanceof u && A.code === d.ADDRESS_LIMIT_EXCEEDED, R = this.resolveAddWalletErrorMessage(A);
9954
+ x && (x.textContent = R, x.hidden = !1), k ? (y.disabled = !0, y.setAttribute("aria-disabled", "true")) : y.disabled = !1, _ = A;
9873
9955
  }
9874
- }), (E = a.querySelector("#__crossx-close-btn")) == null || E.addEventListener("click", w), a.addEventListener("click", (A) => {
9875
- A.target === a && w();
9956
+ }), (E = a.querySelector("#__crossx-close-btn")) == null || E.addEventListener("click", m), a.addEventListener("click", (A) => {
9957
+ A.target === a && m();
9876
9958
  });
9877
9959
  const b = (A) => {
9878
- A.key === "Escape" && (document.removeEventListener("keydown", b), w());
9960
+ A.key === "Escape" && (document.removeEventListener("keydown", b), m());
9879
9961
  };
9880
9962
  document.addEventListener("keydown", b);
9881
9963
  });
@@ -9884,8 +9966,8 @@ class ii {
9884
9966
  return new Promise((e) => {
9885
9967
  var a, l;
9886
9968
  V();
9887
- const r = Us(this.tokens, this.messages), t = ne();
9888
- z(r);
9969
+ const r = Vs(this.tokens, this.messages), t = ne();
9970
+ q(r);
9889
9971
  let s = !1, n = null;
9890
9972
  const o = () => {
9891
9973
  s || (s = !0, n && document.removeEventListener("keydown", n), r.remove(), t(), e());
@@ -9920,13 +10002,13 @@ class ii {
9920
10002
  showLoginSelector(e) {
9921
10003
  var t;
9922
10004
  const r = ((t = e == null ? void 0 : e.connectOtherWallets) == null ? void 0 : t.filter(
9923
- (s) => Object.values(fe).includes(s) && String(s).trim() !== ""
10005
+ (s) => Object.values(we).includes(s) && String(s).trim() !== ""
9924
10006
  )) ?? [];
9925
10007
  return new Promise((s) => {
9926
- var g, w, f, x;
10008
+ var g, m, w, x;
9927
10009
  V();
9928
- const n = Vs(this.tokens, r, this.messages), o = ne();
9929
- z(n);
10010
+ const n = Xs(this.tokens, r, this.messages), o = ne();
10011
+ q(n);
9930
10012
  const a = () => {
9931
10013
  n.remove(), o();
9932
10014
  }, l = (y) => {
@@ -9936,7 +10018,7 @@ class ii {
9936
10018
  }, h = () => {
9937
10019
  a(), s(null);
9938
10020
  };
9939
- (g = n.querySelector("#__crossx-apple-btn")) == null || g.addEventListener("click", () => l("apple")), (w = n.querySelector("#__crossx-google-btn")) == null || w.addEventListener("click", () => l("google")), (f = n.querySelector("#__crossx-connect-other-wallet-btn")) == null || f.addEventListener("click", (y) => {
10021
+ (g = n.querySelector("#__crossx-apple-btn")) == null || g.addEventListener("click", () => l("apple")), (m = n.querySelector("#__crossx-google-btn")) == null || m.addEventListener("click", () => l("google")), (w = n.querySelector("#__crossx-connect-other-wallet-btn")) == null || w.addEventListener("click", (y) => {
9940
10022
  const E = y.currentTarget.dataset.walletId ?? "";
9941
10023
  E && p(E);
9942
10024
  }), (x = n.querySelector("#__crossx-close-btn")) == null || x.addEventListener("click", h), n.addEventListener("click", (y) => {
@@ -9954,7 +10036,7 @@ class ii {
9954
10036
  return new Promise((r) => {
9955
10037
  var h, _, g;
9956
10038
  V();
9957
- const t = this.messages, s = zs(this.tokens, {
10039
+ const t = this.messages, s = Js(this.tokens, {
9958
10040
  title: e.title,
9959
10041
  message: e.message,
9960
10042
  email: e.email,
@@ -9962,7 +10044,7 @@ class ii {
9962
10044
  signOutLabel: (t == null ? void 0 : t.session_alert_sign_out_button) ?? "Sign out",
9963
10045
  signInAgainLabel: (t == null ? void 0 : t.session_alert_sign_in_again_button) ?? "Sign in again"
9964
10046
  }), n = ne();
9965
- z(s);
10047
+ q(s);
9966
10048
  let o = !1;
9967
10049
  const a = () => {
9968
10050
  o || (o = !0, s.remove(), n());
@@ -9984,8 +10066,8 @@ class ii {
9984
10066
  return new Promise((t) => {
9985
10067
  var a, l, p;
9986
10068
  V();
9987
- const s = qs(this.tokens, r);
9988
- z(s);
10069
+ const s = Zs(this.tokens, r);
10070
+ q(s);
9989
10071
  const n = () => s.remove(), o = () => {
9990
10072
  n(), t("recover");
9991
10073
  };
@@ -10031,8 +10113,8 @@ class ii {
10031
10113
  title: (t == null ? void 0 : t.pin_setup_confirm_title) ?? "Confirm PIN",
10032
10114
  headerSubtitle: (t == null ? void 0 : t.pin_setup_header_subtitle) ?? "This PIN is used to authorize your transactions.",
10033
10115
  subtitle: (t == null ? void 0 : t.pin_setup_confirm_subtitle) ?? "Confirm your 6-digit PIN"
10034
- }, a = gt(this.tokens, Js(s)), l = ne();
10035
- z(a);
10116
+ }, a = gt(this.tokens, ri(s)), l = ne();
10117
+ q(a);
10036
10118
  let p = !1;
10037
10119
  const h = () => {
10038
10120
  p || (p = !0, a.remove(), l());
@@ -10040,7 +10122,7 @@ class ii {
10040
10122
  h(), r(E);
10041
10123
  }, g = () => {
10042
10124
  h(), r(null);
10043
- }, w = a.querySelector(".__crossx-card"), f = {
10125
+ }, m = a.querySelector(".__crossx-card"), w = {
10044
10126
  tooShort: (t == null ? void 0 : t.pin_validation_too_short) ?? "Please enter a 6-digit PIN.",
10045
10127
  numbersOnly: (t == null ? void 0 : t.pin_validation_numbers_only) ?? "Only numbers (0-9) are allowed.",
10046
10128
  repeatingDigit: (t == null ? void 0 : t.pin_validation_repeating_digit) ?? "Cannot use the same number 3+ times in a row.",
@@ -10048,63 +10130,63 @@ class ii {
10048
10130
  alternatingPattern: (t == null ? void 0 : t.pin_validation_alternating_pattern) ?? "Repeating patterns (e.g., 121212) are not allowed."
10049
10131
  }, x = (E) => {
10050
10132
  var A;
10051
- w.innerHTML = Le({
10133
+ m.innerHTML = De({
10052
10134
  title: o.title,
10053
10135
  headerSubtitle: o.headerSubtitle,
10054
10136
  subtitle: o.subtitle
10055
- }), this.applyPinKeyboardMode(w), (A = w.querySelector("#__crossx-close-btn")) == null || A.addEventListener("click", g), Me(w, (T) => {
10056
- T === E ? _(E) : y(n.mismatchError);
10137
+ }), this.applyPinKeyboardMode(m), (A = m.querySelector("#__crossx-close-btn")) == null || A.addEventListener("click", g), Le(m, (k) => {
10138
+ k === E ? _(E) : y(n.mismatchError);
10057
10139
  }, g);
10058
10140
  }, y = (E) => {
10059
10141
  var A;
10060
- w.innerHTML = Le({
10142
+ m.innerHTML = De({
10061
10143
  title: n.title,
10062
10144
  headerSubtitle: n.headerSubtitle,
10063
10145
  subtitle: n.subtitle,
10064
10146
  errorMessage: E
10065
- }), this.applyPinKeyboardMode(w), (A = w.querySelector("#__crossx-close-btn")) == null || A.addEventListener("click", g), Me(w, (T) => {
10066
- const R = Zs(T, f);
10067
- R ? y(R) : x(T);
10147
+ }), this.applyPinKeyboardMode(m), (A = m.querySelector("#__crossx-close-btn")) == null || A.addEventListener("click", g), Le(m, (k) => {
10148
+ const R = si(k, w);
10149
+ R ? y(R) : x(k);
10068
10150
  }, g);
10069
10151
  };
10070
10152
  (() => {
10071
10153
  var K;
10072
- const E = Array.from(w.querySelectorAll(".__crossx-pw-notice-item")), A = w.querySelector("#__crossx-pin-notice-next"), T = /* @__PURE__ */ new Set();
10154
+ const E = Array.from(m.querySelectorAll(".__crossx-pw-notice-item")), A = m.querySelector("#__crossx-pin-notice-next"), k = /* @__PURE__ */ new Set();
10073
10155
  A.removeAttribute("disabled");
10074
- const R = A.dataset.nextLabel ?? "Next", D = A.dataset.submitLabel ?? "I Understand", F = () => {
10075
- const I = T.size === E.length;
10156
+ const R = A.dataset.nextLabel ?? "Next", D = A.dataset.submitLabel ?? "I Understand", M = () => {
10157
+ const I = k.size === E.length;
10076
10158
  A.classList.toggle("--disabled", !I), A.textContent = D || R;
10077
- }, C = (I, L) => {
10078
- if (T.has(L)) return;
10159
+ }, P = (I, L) => {
10160
+ if (k.has(L)) return;
10079
10161
  const $ = I.querySelector(`#__crossx-notice-check-${L}`);
10080
- T.add(L), $.classList.add("--checked"), I.setAttribute("aria-checked", "true"), F();
10162
+ k.add(L), $.classList.add("--checked"), I.setAttribute("aria-checked", "true"), M();
10081
10163
  }, O = (I, L) => {
10082
- if (!T.has(L)) return;
10164
+ if (!k.has(L)) return;
10083
10165
  const $ = I.querySelector(`#__crossx-notice-check-${L}`);
10084
- T.delete(L), $.classList.remove("--checked"), I.setAttribute("aria-checked", "false"), F();
10166
+ k.delete(L), $.classList.remove("--checked"), I.setAttribute("aria-checked", "false"), M();
10085
10167
  };
10086
10168
  E.forEach((I) => {
10087
10169
  const L = parseInt(I.dataset.checkIndex ?? "0", 10);
10088
10170
  I.addEventListener("click", () => {
10089
- T.has(L) ? O(I, L) : C(I, L);
10171
+ k.has(L) ? O(I, L) : P(I, L);
10090
10172
  }), I.addEventListener("keydown", ($) => {
10091
- ($.key === " " || $.key === "Enter") && ($.preventDefault(), T.has(L) ? O(I, L) : C(I, L));
10173
+ ($.key === " " || $.key === "Enter") && ($.preventDefault(), k.has(L) ? O(I, L) : P(I, L));
10092
10174
  });
10093
10175
  }), A.addEventListener("click", () => {
10094
- if (T.size === E.length) {
10176
+ if (k.size === E.length) {
10095
10177
  y(e == null ? void 0 : e.errorMessage);
10096
10178
  return;
10097
10179
  }
10098
10180
  const I = E.find(($) => {
10099
10181
  const X = parseInt($.dataset.checkIndex ?? "0", 10);
10100
- return !T.has(X);
10182
+ return !k.has(X);
10101
10183
  });
10102
10184
  if (!I) return;
10103
10185
  const L = parseInt(I.dataset.checkIndex ?? "0", 10);
10104
10186
  I.scrollIntoView({ behavior: "smooth", block: "nearest" }), I.classList.add("--highlight"), setTimeout(() => {
10105
- I.classList.remove("--highlight"), C(I, L);
10187
+ I.classList.remove("--highlight"), P(I, L);
10106
10188
  }, 400);
10107
- }), (K = w.querySelector("#__crossx-close-btn")) == null || K.addEventListener("click", g);
10189
+ }), (K = m.querySelector("#__crossx-close-btn")) == null || K.addEventListener("click", g);
10108
10190
  })(), a.addEventListener("click", (E) => {
10109
10191
  E.target === a && g();
10110
10192
  });
@@ -10121,7 +10203,7 @@ class ii {
10121
10203
  V();
10122
10204
  const s = this.messages, n = (e == null ? void 0 : e.verifyMode) === !0, o = n ? (s == null ? void 0 : s.verify_pin_title) ?? "Verify Your PIN" : (s == null ? void 0 : s.pin_input_title) ?? "Enter PIN", a = n ? (s == null ? void 0 : s.verify_pin_subtitle) ?? "Enter your PIN to authorize this transaction." : (s == null ? void 0 : s.pin_input_subtitle) ?? "Enter your 6-digit PIN to continue.", l = (s == null ? void 0 : s.pin_locked_failure_warning) ?? "Your account will be locked after further failures.", p = gt(
10123
10205
  this.tokens,
10124
- Le({
10206
+ De({
10125
10207
  title: o,
10126
10208
  headerSubtitle: a,
10127
10209
  errorMessage: e == null ? void 0 : e.errorMessage,
@@ -10131,19 +10213,19 @@ class ii {
10131
10213
  maxAttempts: e == null ? void 0 : e.maxAttempts
10132
10214
  })
10133
10215
  ), h = ne();
10134
- z(p);
10216
+ q(p);
10135
10217
  let _ = !1;
10136
10218
  const g = () => {
10137
10219
  _ || (_ = !0, p.remove(), h());
10138
- }, w = (E) => {
10220
+ }, m = (E) => {
10139
10221
  g(), r(E);
10140
- }, f = () => {
10222
+ }, w = () => {
10141
10223
  g(), r(null);
10142
10224
  }, x = (E) => {
10143
10225
  g(), t(E);
10144
10226
  }, y = p.querySelector(".__crossx-card");
10145
- this.applyPinKeyboardMode(y), (b = y.querySelector("#__crossx-close-btn")) == null || b.addEventListener("click", f), Me(y, w, f, x, e == null ? void 0 : e.onSubmit, e == null ? void 0 : e.lockExpiresAt, l), p.addEventListener("click", (E) => {
10146
- E.target === p && f();
10227
+ this.applyPinKeyboardMode(y), (b = y.querySelector("#__crossx-close-btn")) == null || b.addEventListener("click", w), Le(y, m, w, x, e == null ? void 0 : e.onSubmit, e == null ? void 0 : e.lockExpiresAt, l), p.addEventListener("click", (E) => {
10228
+ E.target === p && w();
10147
10229
  });
10148
10230
  });
10149
10231
  }
@@ -10158,14 +10240,14 @@ class ii {
10158
10240
  return new Promise((r) => {
10159
10241
  var l;
10160
10242
  V();
10161
- const t = js(this.tokens, e);
10162
- z(t);
10243
+ const t = Qs(this.tokens, e);
10244
+ q(t);
10163
10245
  const s = () => t.remove(), n = (p) => {
10164
10246
  s(), r(p);
10165
10247
  }, o = () => {
10166
10248
  s(), r(null);
10167
10249
  }, a = t.querySelector(".__crossx-card");
10168
- a && this.applyPinKeyboardMode(a), si(t, n, o), (l = t.querySelector("#__crossx-close-btn")) == null || l.addEventListener("click", o), t.addEventListener("click", (p) => {
10250
+ a && this.applyPinKeyboardMode(a), ci(t, n, o), (l = t.querySelector("#__crossx-close-btn")) == null || l.addEventListener("click", o), t.addEventListener("click", (p) => {
10169
10251
  p.target === t && o();
10170
10252
  });
10171
10253
  });
@@ -10180,8 +10262,8 @@ class ii {
10180
10262
  return new Promise((t) => {
10181
10263
  var p;
10182
10264
  V();
10183
- const { overlay: s, startCountdown: n } = Xs(this.tokens, e, r);
10184
- z(s);
10265
+ const { overlay: s, startCountdown: n } = ti(this.tokens, e, r);
10266
+ q(s);
10185
10267
  const o = () => {
10186
10268
  l(), s.remove();
10187
10269
  }, a = () => {
@@ -10200,8 +10282,8 @@ class ii {
10200
10282
  return new Promise((r) => {
10201
10283
  var a, l;
10202
10284
  V();
10203
- const t = Rs(e, this.tokens, this.messages);
10204
- z(t);
10285
+ const t = Ds(e, this.tokens, this.messages);
10286
+ q(t);
10205
10287
  const s = () => t.remove(), n = () => {
10206
10288
  s(), r();
10207
10289
  };
@@ -10229,8 +10311,8 @@ class ii {
10229
10311
  showTransactionProgress(e, r) {
10230
10312
  return new Promise((t) => {
10231
10313
  V();
10232
- const s = Ns(e, this.tokens, this.messages);
10233
- z(s);
10314
+ const s = Ls(e, this.tokens, this.messages);
10315
+ q(s);
10234
10316
  const n = () => s.remove();
10235
10317
  let o = !1;
10236
10318
  const a = () => {
@@ -10246,7 +10328,7 @@ class ii {
10246
10328
  document.addEventListener("keydown", p);
10247
10329
  };
10248
10330
  r.then((p) => {
10249
- o || (Ps(s, p, this.tokens, this.messages), l());
10331
+ o || (Fs(s, p, this.tokens, this.messages), l());
10250
10332
  });
10251
10333
  });
10252
10334
  }
@@ -10255,9 +10337,9 @@ class ii {
10255
10337
  var p, h, _;
10256
10338
  V();
10257
10339
  let t;
10258
- e.type === "sign-message" ? t = Cs(e, this.tokens, this.messages) : e.type === "sign-typed-data" ? t = Os(e, this.tokens, this.messages) : e.type === "sign" ? t = ys(e, this.tokens, this.displayDecimals, this.messages) : t = Ss(e, this.tokens, this.displayDecimals, this.messages);
10340
+ e.type === "sign-message" ? t = Ms(e, this.tokens, this.messages) : e.type === "sign-typed-data" ? t = $s(e, this.tokens, this.messages) : e.type === "sign" ? t = As(e, this.tokens, this.displayDecimals, this.messages) : t = ks(e, this.tokens, this.displayDecimals, this.messages);
10259
10341
  const s = ne();
10260
- z(t);
10342
+ q(t);
10261
10343
  const n = () => {
10262
10344
  t.remove(), s();
10263
10345
  }, o = () => {
@@ -10266,14 +10348,14 @@ class ii {
10266
10348
  n(), r(!1);
10267
10349
  };
10268
10350
  (p = t.querySelector("#__crossx-confirm-btn")) == null || p.addEventListener("click", o), (h = t.querySelector("#__crossx-cancel-btn")) == null || h.addEventListener("click", a), (_ = t.querySelector("#__crossx-close-btn")) == null || _.addEventListener("click", a), t.querySelectorAll(".__crossx-copy-btn").forEach((g) => {
10269
- g.addEventListener("click", (w) => {
10351
+ g.addEventListener("click", (m) => {
10270
10352
  var x;
10271
- w.stopPropagation();
10272
- const f = g.dataset.copy;
10273
- f && ((x = navigator.clipboard) == null || x.writeText(f).catch(() => {
10353
+ m.stopPropagation();
10354
+ const w = g.dataset.copy;
10355
+ w && ((x = navigator.clipboard) == null || x.writeText(w).catch(() => {
10274
10356
  }));
10275
10357
  });
10276
- }), cs(t), t.addEventListener("click", (g) => {
10358
+ }), us(t), t.addEventListener("click", (g) => {
10277
10359
  g.target === t && a();
10278
10360
  });
10279
10361
  const l = (g) => {
@@ -10283,7 +10365,7 @@ class ii {
10283
10365
  });
10284
10366
  }
10285
10367
  }
10286
- class ni {
10368
+ class di {
10287
10369
  constructor(e, r, t, s = () => !1) {
10288
10370
  this.browserConfirmation = e, this.getBridge = r, this.getOrigin = t, this.isAuthenticatedViaRNBridge = s;
10289
10371
  }
@@ -10453,7 +10535,7 @@ class ni {
10453
10535
  (t = (r = this.browserConfirmation).setPinKeyboard) == null || t.call(r, e);
10454
10536
  }
10455
10537
  }
10456
- class oi {
10538
+ class pi {
10457
10539
  constructor() {
10458
10540
  this._accessToken = null, this._expiresAt = 0;
10459
10541
  }
@@ -10485,7 +10567,7 @@ class oi {
10485
10567
  return !this._accessToken || this._expiresAt <= 0 ? !0 : Date.now() >= this._expiresAt - e;
10486
10568
  }
10487
10569
  }
10488
- function wi(i, e) {
10570
+ function hi(i, e) {
10489
10571
  if (!i.projectId)
10490
10572
  throw new Error(
10491
10573
  `[CROSSx] Fatal: projectId is required but was not provided.
@@ -10493,7 +10575,7 @@ Set the projectId field in SDKConfig when calling createCROSSxSDK().
10493
10575
  Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
10494
10576
  );
10495
10577
  i.debug;
10496
- const r = pe.production, t = {
10578
+ const r = he.production, t = {
10497
10579
  ...i,
10498
10580
  oauthServiceUrl: r.oauthServiceUrl,
10499
10581
  legacyOauthServiceUrl: r.legacyOauthServiceUrl,
@@ -10502,15 +10584,15 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
10502
10584
  }, s = {
10503
10585
  gatewayUrl: r.walletGatewayUrl,
10504
10586
  projectId: i.projectId
10505
- }, n = t.authMode !== "cookie" && lt.isAvailable();
10587
+ }, n = t.authMode !== "cookie" && dt.isAvailable();
10506
10588
  !n && t.authMode !== "cookie" && c.warn(
10507
10589
  "[CROSSx] IndexedDB 사용 불가 — LocalStorage fallback 사용 중.",
10508
10590
  "refresh_token이 평문 저장되지 않도록 세션 영속성이 제한됩니다.",
10509
10591
  "IndexedDB를 지원하는 브라우저 사용을 권장합니다."
10510
10592
  ), t.secureStorageAvailable = n;
10511
- const o = n ? new lt(i.projectId) : new Tr(), a = new Cr(), l = new Vr(), p = new oe(), h = new oi(), _ = new mt(), g = new Lr(s, l);
10512
- let w;
10513
- i.useMockWallet ? (c.log("[CROSSx] Mock Wallet Provider 사용"), w = new ts(o, _)) : (c.log("[CROSSx] Remote Wallet Provider 사용"), w = new ae(
10593
+ const o = n ? new dt(i.projectId) : new Lr(), a = new $r(), l = new Xr(), p = new oe(), h = new pi(), _ = new yt(), g = new Wr(s, l);
10594
+ let m;
10595
+ i.useMockWallet ? (c.log("[CROSSx] Mock Wallet Provider 사용"), m = new os(o, _)) : (c.log("[CROSSx] Remote Wallet Provider 사용"), m = new ae(
10514
10596
  s,
10515
10597
  o,
10516
10598
  l,
@@ -10518,62 +10600,63 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
10518
10600
  _,
10519
10601
  g
10520
10602
  ));
10521
- let f = null;
10603
+ let w = null;
10522
10604
  const x = () => {
10523
- var C;
10524
- return ((C = f == null ? void 0 : f.isAuthenticatedViaRNBridge) == null ? void 0 : C.call(f)) ?? !1;
10605
+ var P;
10606
+ return ((P = w == null ? void 0 : w.isAuthenticatedViaRNBridge) == null ? void 0 : P.call(w)) ?? !1;
10525
10607
  }, y = () => {
10526
- var C;
10527
- return (C = f == null ? void 0 : f.assertRNBridgeSessionActive) == null ? void 0 : C.call(f);
10528
- }, b = (C) => {
10608
+ var P;
10609
+ return (P = w == null ? void 0 : w.assertRNBridgeSessionActive) == null ? void 0 : P.call(w);
10610
+ }, b = (P) => {
10529
10611
  var O;
10530
- (O = f == null ? void 0 : f.clearRNBridgeDelegation) == null || O.call(f, C);
10612
+ (O = w == null ? void 0 : w.clearRNBridgeDelegation) == null || O.call(w, P);
10531
10613
  };
10532
- w = new ss(
10533
- w,
10614
+ m = new cs(
10615
+ m,
10534
10616
  () => {
10535
- var C;
10536
- return (C = f == null ? void 0 : f.getRNBridge) == null ? void 0 : C.call(f);
10617
+ var P;
10618
+ return (P = w == null ? void 0 : w.getRNBridge) == null ? void 0 : P.call(w);
10537
10619
  },
10538
10620
  x,
10539
10621
  y,
10540
10622
  () => i.appName,
10541
10623
  b
10542
10624
  );
10543
- const E = new we(s, l), A = new ii(
10625
+ const E = new me(s, l), A = new li(
10544
10626
  i.theme ?? "light",
10545
10627
  i.themeTokens,
10546
10628
  i.displayDecimals,
10547
10629
  i.pinKeyboard
10548
- ), T = new ni(
10630
+ ), k = new di(
10549
10631
  A,
10550
10632
  () => {
10551
- var C;
10552
- return (C = f == null ? void 0 : f.getRNBridge) == null ? void 0 : C.call(f);
10633
+ var P;
10634
+ return (P = w == null ? void 0 : w.getRNBridge) == null ? void 0 : P.call(w);
10553
10635
  },
10554
10636
  () => typeof window < "u" ? window.location.origin : "http://localhost",
10555
10637
  x
10556
- ), R = e != null && e.wrapConfirmation ? e.wrapConfirmation(T) : T, D = new Be(
10638
+ ), R = e != null && e.wrapConfirmation ? e.wrapConfirmation(k) : k, D = new $e(
10557
10639
  t,
10558
10640
  s,
10559
10641
  o,
10560
10642
  a,
10561
10643
  l,
10562
10644
  p,
10563
- w,
10645
+ m,
10564
10646
  h,
10565
10647
  R,
10566
10648
  E,
10567
10649
  _,
10568
10650
  g
10569
10651
  );
10570
- f = D;
10571
- const F = D.signInUseCase;
10572
- return F && typeof F.setFreshTokenCallback == "function" && F.setFreshTokenCallback(() => D.requestFreshFirebaseIdTokenFromBridge()), typeof window < "u" && (window.__crossxSDK = D), D;
10573
- }
10574
- function mi(i) {
10575
- const e = ai(i), r = ci(e), t = JSON.parse(r);
10576
- di(t);
10652
+ w = D;
10653
+ const M = D.signInUseCase;
10654
+ return M && typeof M.setFreshTokenCallback == "function" && M.setFreshTokenCallback(() => D.requestFreshFirebaseIdTokenFromBridge()), typeof window < "u" && (window.__crossxSDK = D), D;
10655
+ }
10656
+ const Ei = hi;
10657
+ function Ai(i) {
10658
+ const e = ui(i), r = _i(e), t = JSON.parse(r);
10659
+ gi(t);
10577
10660
  const { data: s } = t;
10578
10661
  return {
10579
10662
  status: t.status,
@@ -10587,7 +10670,7 @@ function mi(i) {
10587
10670
  raw: t
10588
10671
  };
10589
10672
  }
10590
- function ai(i) {
10673
+ function ui(i) {
10591
10674
  if (i.includes("://") && i.includes("?")) {
10592
10675
  const e = new URL(i), r = e.searchParams.get("crossx_oauth_result");
10593
10676
  if (r) return r;
@@ -10597,22 +10680,22 @@ function ai(i) {
10597
10680
  }
10598
10681
  return i;
10599
10682
  }
10600
- function ci(i) {
10683
+ function _i(i) {
10601
10684
  if (i.startsWith("{"))
10602
10685
  return i;
10603
10686
  if (i.startsWith("%7B") || i.startsWith("%7b"))
10604
10687
  return decodeURIComponent(i);
10605
- const e = li(i);
10688
+ const e = xi(i);
10606
10689
  return decodeURIComponent(e);
10607
10690
  }
10608
- function li(i) {
10691
+ function xi(i) {
10609
10692
  if (typeof atob == "function")
10610
10693
  return atob(i);
10611
10694
  if (typeof Buffer < "u")
10612
10695
  return Buffer.from(i, "base64").toString("utf-8");
10613
10696
  throw new Error("Base64 디코딩을 지원하는 환경이 아닙니다");
10614
10697
  }
10615
- function di(i) {
10698
+ function gi(i) {
10616
10699
  if (typeof i != "object" || i === null)
10617
10700
  throw new Error("Deeplink payload가 유효한 객체가 아닙니다");
10618
10701
  const e = i;
@@ -10631,19 +10714,23 @@ function di(i) {
10631
10714
  export {
10632
10715
  Yt as CONNECT_OTHER_WALLET_DISPLAY_ORDER,
10633
10716
  u as CROSSxError,
10634
- er as CROSSxEthereumProvider,
10635
- Be as CROSSxSDK,
10636
- xi as ChainId,
10637
- fe as ConnectOtherWalletItem,
10717
+ ir as CROSSxEthereumProvider,
10718
+ $e as CROSSxSDK,
10719
+ bi as ChainId,
10720
+ we as ConnectOtherWalletItem,
10638
10721
  d as ErrorCode,
10639
10722
  Fe as MNEMONIC_ADDRESS_LIMIT,
10640
- mt as PinMemoryStore,
10641
- oi as TokenMemoryStore,
10642
- Ke as WALLET_BRAND_NAME,
10643
- wi as createCROSSxSDK,
10723
+ u as ONEpocketError,
10724
+ ir as ONEpocketEthereumProvider,
10725
+ $e as ONEpocketSDK,
10726
+ yt as PinMemoryStore,
10727
+ pi as TokenMemoryStore,
10728
+ Ge as WALLET_BRAND_NAME,
10729
+ hi as createCROSSxSDK,
10730
+ Ei as createONEpocketSDK,
10644
10731
  Xt as getConnectOtherWalletLabel,
10645
- Se as getWalletBrowserInfo,
10646
- gi as isWalletInAppBrowser,
10647
- mi as parseOAuthDeeplink,
10648
- fi as waitForWalletBrowser
10732
+ Ae as getWalletBrowserInfo,
10733
+ Si as isWalletInAppBrowser,
10734
+ Ai as parseOAuthDeeplink,
10735
+ vi as waitForWalletBrowser
10649
10736
  };