@nexus-cross/crossx-sdk-core 1.3.7 → 1.3.8

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
@@ -167,26 +167,34 @@ class Fs {
167
167
  };
168
168
  }
169
169
  }
170
- let Se = null;
170
+ let _e = null;
171
171
  function vt(r) {
172
- Se = r;
172
+ _e = r;
173
173
  }
174
174
  const d = {
175
+ /** 빌드 모드와 무관하게 항상 출력되는 정보성 로그 (SDK 수명주기 등) */
176
+ info(...r) {
177
+ if (_e) {
178
+ _e.log(...r);
179
+ return;
180
+ }
181
+ console.log(...r);
182
+ },
175
183
  log(...r) {
176
- if (Se) {
177
- Se.log(...r);
184
+ if (_e) {
185
+ _e.log(...r);
178
186
  return;
179
187
  }
180
188
  },
181
189
  warn(...r) {
182
- if (Se) {
183
- Se.warn(...r);
190
+ if (_e) {
191
+ _e.warn(...r);
184
192
  return;
185
193
  }
186
194
  },
187
195
  error(...r) {
188
- if (Se) {
189
- Se.error(...r);
196
+ if (_e) {
197
+ _e.error(...r);
190
198
  return;
191
199
  }
192
200
  }
@@ -869,7 +877,7 @@ function Js() {
869
877
  const Xs = 2e3, At = 6e4, Zs = 1e3, Qs = 1e4, er = "0x77359400", Rt = "0x3B9ACA00", kt = 130, Pt = 6, Ot = 18, tr = 3e4, sr = 5 * 60 * 1e3, rr = 30 * 1e3, re = class re extends js {
870
878
  constructor(e, s, t, n, o, i, a, c, l, u, h) {
871
879
  var _, f;
872
- super(), this.storage = t, this.crypto = n, this.transport = o, this.oauth = i, this.walletProvider = a, this.tokenStore = c, 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._verifyPinMutex = null, this._config = Object.freeze({ ...e }), this.internalConfig = e, this.adapterConfig = s, e.logger && vt(e.logger), this.confirmation = l, this.pinStore = h ?? new es(), this.chainRegistry = u, this.jsonRpc = new zs(u, o), this.signInUseCase = new qs(
880
+ super(), this.storage = t, this.crypto = n, this.transport = o, this.oauth = i, this.walletProvider = a, this.tokenStore = c, 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._verifyPinMutex = null, this._themeMediaCleanup = null, this._config = Object.freeze({ ...e }), this.internalConfig = e, this.adapterConfig = s, e.logger && vt(e.logger), this.confirmation = l, this.pinStore = h ?? new es(), this.chainRegistry = u, this.jsonRpc = new zs(u, o), this.signInUseCase = new qs(
873
881
  this.internalConfig,
874
882
  t,
875
883
  n,
@@ -880,7 +888,7 @@ const Xs = 2e3, At = 6e4, Zs = 1e3, Qs = 1e4, er = "0x77359400", Rt = "0x3B9ACA0
880
888
  ), this.signOutUseCase = new Ks(this.internalConfig, t, c), this.migrateWalletUseCase = new Vs(t, a), (_ = a.setOnUnauthorized) == null || _.call(a, () => this.forceLogout()), (f = a.setTokenRefresher) == null || f.call(
881
889
  a,
882
890
  () => this.signInUseCase.refreshAccessToken()
883
- );
891
+ ), e.autoDetectTheme && this._setupAutoDetectTheme();
884
892
  }
885
893
  get config() {
886
894
  return this._config;
@@ -906,7 +914,7 @@ const Xs = 2e3, At = 6e4, Zs = 1e3, Qs = 1e4, er = "0x77359400", Rt = "0x3B9ACA0
906
914
  }
907
915
  async _doInitialize(e) {
908
916
  var s, t;
909
- d.log("[CROSSx SDK] v1.3.7 초기화 중..."), this.confirmation.setMessages(St(this._config.locale));
917
+ d.log("[CROSSx SDK] v1.3.8 초기화 중..."), this.confirmation.setMessages(St(this._config.locale));
910
918
  try {
911
919
  const n = Js();
912
920
  this.internalConfig.oauthServiceUrl = n.oauthServiceUrl, this.internalConfig.authApiUrl = n.authApiUrl, this.internalConfig.walletGatewayUrl = n.walletGatewayUrl, this.adapterConfig.gatewayUrl = n.walletGatewayUrl, (t = (s = this.crypto).setJWKSEndpoint) == null || t.call(s, `${n.authApiUrl}/.well-known/jwks.json`);
@@ -921,7 +929,7 @@ const Xs = 2e3, At = 6e4, Zs = 1e3, Qs = 1e4, er = "0x77359400", Rt = "0x3B9ACA0
921
929
  d.log("[CROSSx] initialize: 비밀번호 입력 취소 — 지갑 미로드 상태로 계속");
922
930
  }
923
931
  }
924
- return this.initialized = !0, this.emit("initialized", { restored: !!(o != null && o.success) }), o ?? null;
932
+ return this.initialized = !0, d.info("[CROSSx SDK] v1.3.8 초기화 완료"), this.emit("initialized", { restored: !!(o != null && o.success) }), o ?? null;
925
933
  } catch (n) {
926
934
  throw new m(p.AUTH_NOT_INITIALIZED, "SDK 초기화에 실패했습니다", n);
927
935
  }
@@ -1290,6 +1298,20 @@ const Xs = 2e3, At = 6e4, Zs = 1e3, Qs = 1e4, er = "0x77359400", Rt = "0x3B9ACA0
1290
1298
  // ============================================================================
1291
1299
  // 테마
1292
1300
  // ============================================================================
1301
+ /**
1302
+ * `prefers-color-scheme` 미디어 쿼리를 감시하여
1303
+ * 시스템 다크모드 변경 시 자동으로 테마를 전환합니다.
1304
+ */
1305
+ _setupAutoDetectTheme() {
1306
+ if (typeof window > "u" || !window.matchMedia) return;
1307
+ const e = window.matchMedia("(prefers-color-scheme: dark)"), s = (n) => {
1308
+ const o = n ? "dark" : "light";
1309
+ this.applyTheme(o, this._config.themeTokens ?? {});
1310
+ };
1311
+ s(e.matches);
1312
+ const t = (n) => s(n.matches);
1313
+ e.addEventListener("change", t), this._themeMediaCleanup = () => e.removeEventListener("change", t);
1314
+ }
1293
1315
  /**
1294
1316
  * 컨펌 모달 테마를 런타임에 변경합니다.
1295
1317
  * 다음 모달이 열릴 때부터 적용됩니다.
@@ -1684,7 +1706,7 @@ const Xs = 2e3, At = 6e4, Zs = 1e3, Qs = 1e4, er = "0x77359400", Rt = "0x3B9ACA0
1684
1706
  let _, f;
1685
1707
  const w = this.waitForTxAndGetReceipt(a, e, { intervalMs: c, timeoutMs: l }).then((T) => {
1686
1708
  _ = T;
1687
- const C = BigInt(T.gasUsed) * BigInt(T.effectiveGasPrice), W = s.value ? BigInt(s.value) : 0n, B = re.formatTxAmount(s.value, u.symbol, u.decimals), j = re.formatTxAmount("0x" + C.toString(16), u.symbol, u.decimals), q = re.formatTxAmount("0x" + (W + C).toString(16), u.symbol, u.decimals);
1709
+ const N = BigInt(T.gasUsed) * BigInt(T.effectiveGasPrice), W = s.value ? BigInt(s.value) : 0n, B = re.formatTxAmount(s.value, u.symbol, u.decimals), j = re.formatTxAmount("0x" + N.toString(16), u.symbol, u.decimals), q = re.formatTxAmount("0x" + (W + N).toString(16), u.symbol, u.decimals);
1688
1710
  return {
1689
1711
  chainId: e,
1690
1712
  txHash: a,
@@ -2374,7 +2396,8 @@ const Xs = 2e3, At = 6e4, Zs = 1e3, Qs = 1e4, er = "0x77359400", Rt = "0x3B9ACA0
2374
2396
  * dispose 후 SDK 인스턴스는 더 이상 사용할 수 없습니다.
2375
2397
  */
2376
2398
  dispose() {
2377
- this.clearAuthState(), this.tokenStore.clear(), this.pinStore.clear(), this.initialized = !1, this.removeAllListeners(), vt(null);
2399
+ var e;
2400
+ (e = this._themeMediaCleanup) == null || e.call(this), this._themeMediaCleanup = null, this.clearAuthState(), this.tokenStore.clear(), this.pinStore.clear(), this.initialized = !1, this.removeAllListeners(), vt(null);
2378
2401
  }
2379
2402
  /**
2380
2403
  * @internal internal 패키지 전용 — 공개 문서에 기재하지 않음
@@ -2433,8 +2456,8 @@ class nr {
2433
2456
  }
2434
2457
  }
2435
2458
  }
2436
- const Xe = "crossx-sdk", or = 1, de = "data", ve = "keys", $e = "aes-primary", ir = 12;
2437
- class Nt {
2459
+ const Xe = "crossx-sdk", or = 1, de = "data", Se = "keys", $e = "aes-primary", ir = 12;
2460
+ class Ct {
2438
2461
  constructor(e) {
2439
2462
  this.db = null, this.cryptoKey = null, this.initPromise = null, this.dbName = `crossx-sdk-${e}`;
2440
2463
  }
@@ -2446,7 +2469,7 @@ class Nt {
2446
2469
  const n = indexedDB.open(e, or);
2447
2470
  n.onupgradeneeded = () => {
2448
2471
  const o = n.result;
2449
- o.objectStoreNames.contains(de) || o.createObjectStore(de), o.objectStoreNames.contains(ve) || o.createObjectStore(ve);
2472
+ o.objectStoreNames.contains(de) || o.createObjectStore(de), o.objectStoreNames.contains(Se) || o.createObjectStore(Se);
2450
2473
  }, n.onsuccess = () => s(n.result), n.onerror = () => t(n.error);
2451
2474
  });
2452
2475
  }
@@ -2476,7 +2499,7 @@ class Nt {
2476
2499
  }
2477
2500
  async init() {
2478
2501
  this.db = await this.openDB();
2479
- const e = await this.idbGet(ve, $e);
2502
+ const e = await this.idbGet(Se, $e);
2480
2503
  if (e) {
2481
2504
  this.cryptoKey = e;
2482
2505
  return;
@@ -2490,7 +2513,7 @@ class Nt {
2490
2513
  { name: "AES-GCM", length: 256 },
2491
2514
  !1,
2492
2515
  ["encrypt", "decrypt"]
2493
- ), await this.idbPut(ve, $e, this.cryptoKey);
2516
+ ), await this.idbPut(Se, $e, this.cryptoKey);
2494
2517
  }
2495
2518
  /**
2496
2519
  * 레거시 DB('crossx-sdk')에서 projectId 스코프 DB로 암호키·데이터 마이그레이션.
@@ -2499,7 +2522,7 @@ class Nt {
2499
2522
  async migrateFromLegacyDB() {
2500
2523
  if (this.dbName === Xe) return null;
2501
2524
  try {
2502
- const e = await this.openDB(Xe), s = e.transaction([ve, de], "readonly"), t = s.objectStore(ve).get($e), n = await new Promise((l, u) => {
2525
+ const e = await this.openDB(Xe), s = e.transaction([Se, de], "readonly"), t = s.objectStore(Se).get($e), n = await new Promise((l, u) => {
2503
2526
  t.onsuccess = () => l(t.result), t.onerror = () => u(t.error);
2504
2527
  });
2505
2528
  if (!n)
@@ -2512,7 +2535,7 @@ class Nt {
2512
2535
  i.onsuccess = () => l(i.result), i.onerror = () => u(i.error);
2513
2536
  })
2514
2537
  ]);
2515
- e.close(), await this.idbPut(ve, $e, n);
2538
+ e.close(), await this.idbPut(Se, $e, n);
2516
2539
  for (let l = 0; l < c.length; l++)
2517
2540
  await this.idbPut(de, String(c[l]), a[l]);
2518
2541
  return indexedDB.deleteDatabase(Xe), d.log("[CROSSx] IndexedDB 레거시 DB 마이그레이션 완료"), n;
@@ -2583,7 +2606,7 @@ class Nt {
2583
2606
  function ut(r) {
2584
2607
  return r instanceof Uint8Array || ArrayBuffer.isView(r) && r.constructor.name === "Uint8Array";
2585
2608
  }
2586
- function ge(r, e = "") {
2609
+ function me(r, e = "") {
2587
2610
  if (!Number.isSafeInteger(r) || r < 0) {
2588
2611
  const s = e && `"${e}" `;
2589
2612
  throw new Error(`${s}expected integer >= 0, got ${r}`);
@@ -2600,7 +2623,7 @@ function V(r, e, s = "") {
2600
2623
  function ts(r) {
2601
2624
  if (typeof r != "function" || typeof r.create != "function")
2602
2625
  throw new Error("Hash must wrapped by utils.createHasher");
2603
- ge(r.outputLen), ge(r.blockLen);
2626
+ me(r.outputLen), me(r.blockLen);
2604
2627
  }
2605
2628
  function ke(r, e = !0) {
2606
2629
  if (r.destroyed)
@@ -2636,7 +2659,7 @@ function dr(r) {
2636
2659
  r[e] = lr(r[e]);
2637
2660
  return r;
2638
2661
  }
2639
- const Ct = cr ? (r) => r : dr, rs = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", ur = /* @__PURE__ */ Array.from({ length: 256 }, (r, e) => e.toString(16).padStart(2, "0"));
2662
+ const Nt = cr ? (r) => r : dr, rs = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", ur = /* @__PURE__ */ Array.from({ length: 256 }, (r, e) => e.toString(16).padStart(2, "0"));
2640
2663
  function Me(r) {
2641
2664
  if (V(r), rs)
2642
2665
  return r.toHex();
@@ -2673,7 +2696,7 @@ function We(r) {
2673
2696
  }
2674
2697
  return t;
2675
2698
  }
2676
- function be(...r) {
2699
+ function ve(...r) {
2677
2700
  let e = 0;
2678
2701
  for (let t = 0; t < r.length; t++) {
2679
2702
  const n = r[t];
@@ -2767,7 +2790,7 @@ class _r {
2767
2790
  return this._cloneInto();
2768
2791
  }
2769
2792
  }
2770
- const me = /* @__PURE__ */ Uint32Array.from([
2793
+ const we = /* @__PURE__ */ Uint32Array.from([
2771
2794
  1779033703,
2772
2795
  3144134277,
2773
2796
  1013904242,
@@ -2854,7 +2877,7 @@ const mr = (r, e, s) => r << s | e >>> 32 - s, wr = (r, e, s) => e << s | r >>>
2854
2877
  2756734187,
2855
2878
  3204031479,
2856
2879
  3329325298
2857
- ]), we = /* @__PURE__ */ new Uint32Array(64);
2880
+ ]), ye = /* @__PURE__ */ new Uint32Array(64);
2858
2881
  class Sr extends _r {
2859
2882
  constructor(e) {
2860
2883
  super(64, e, 8, !1);
@@ -2869,20 +2892,20 @@ class Sr extends _r {
2869
2892
  }
2870
2893
  process(e, s) {
2871
2894
  for (let h = 0; h < 16; h++, s += 4)
2872
- we[h] = e.getUint32(s, !1);
2895
+ ye[h] = e.getUint32(s, !1);
2873
2896
  for (let h = 16; h < 64; h++) {
2874
- const _ = we[h - 15], f = we[h - 2], w = ue(_, 7) ^ ue(_, 18) ^ _ >>> 3, b = ue(f, 17) ^ ue(f, 19) ^ f >>> 10;
2875
- we[h] = b + we[h - 7] + w + we[h - 16] | 0;
2897
+ const _ = ye[h - 15], f = ye[h - 2], w = ue(_, 7) ^ ue(_, 18) ^ _ >>> 3, b = ue(f, 17) ^ ue(f, 19) ^ f >>> 10;
2898
+ ye[h] = b + ye[h - 7] + w + ye[h - 16] | 0;
2876
2899
  }
2877
2900
  let { A: t, B: n, C: o, D: i, E: a, F: c, G: l, H: u } = this;
2878
2901
  for (let h = 0; h < 64; h++) {
2879
- const _ = ue(a, 6) ^ ue(a, 11) ^ ue(a, 25), f = u + _ + pr(a, c, l) + vr[h] + we[h] | 0, b = (ue(t, 2) ^ ue(t, 13) ^ ue(t, 22)) + fr(t, n, o) | 0;
2902
+ const _ = ue(a, 6) ^ ue(a, 11) ^ ue(a, 25), f = u + _ + pr(a, c, l) + vr[h] + ye[h] | 0, b = (ue(t, 2) ^ ue(t, 13) ^ ue(t, 22)) + fr(t, n, o) | 0;
2880
2903
  u = l, l = c, c = a, a = i + f | 0, i = o, o = n, n = t, t = f + b | 0;
2881
2904
  }
2882
2905
  t = t + this.A | 0, n = n + this.B | 0, o = o + this.C | 0, i = i + this.D | 0, a = a + this.E | 0, c = c + this.F | 0, l = l + this.G | 0, u = u + this.H | 0, this.set(t, n, o, i, a, c, l, u);
2883
2906
  }
2884
2907
  roundClean() {
2885
- Pe(we);
2908
+ Pe(ye);
2886
2909
  }
2887
2910
  destroy() {
2888
2911
  this.set(0, 0, 0, 0, 0, 0, 0, 0), Pe(this.buffer);
@@ -2893,14 +2916,14 @@ class Er extends Sr {
2893
2916
  super(32);
2894
2917
  // We cannot use array here since array allows indexing by variable
2895
2918
  // which means optimizer/compiler cannot use registers.
2896
- E(this, "A", me[0] | 0);
2897
- E(this, "B", me[1] | 0);
2898
- E(this, "C", me[2] | 0);
2899
- E(this, "D", me[3] | 0);
2900
- E(this, "E", me[4] | 0);
2901
- E(this, "F", me[5] | 0);
2902
- E(this, "G", me[6] | 0);
2903
- E(this, "H", me[7] | 0);
2919
+ E(this, "A", we[0] | 0);
2920
+ E(this, "B", we[1] | 0);
2921
+ E(this, "C", we[2] | 0);
2922
+ E(this, "D", we[3] | 0);
2923
+ E(this, "E", we[4] | 0);
2924
+ E(this, "F", we[5] | 0);
2925
+ E(this, "G", we[6] | 0);
2926
+ E(this, "H", we[7] | 0);
2904
2927
  }
2905
2928
  }
2906
2929
  const Ir = /* @__PURE__ */ ns(
@@ -2921,7 +2944,7 @@ function is(r) {
2921
2944
  if (!Fe(r))
2922
2945
  throw new Error("positive bigint expected, got " + r);
2923
2946
  } else
2924
- ge(r);
2947
+ me(r);
2925
2948
  return r;
2926
2949
  }
2927
2950
  function Ue(r) {
@@ -2940,7 +2963,7 @@ function cs(r) {
2940
2963
  return as(Me(Tr(V(r)).reverse()));
2941
2964
  }
2942
2965
  function pt(r, e) {
2943
- ge(e), r = is(r);
2966
+ me(e), r = is(r);
2944
2967
  const s = We(r.toString(16).padStart(e * 2, "0"));
2945
2968
  if (s.length !== e)
2946
2969
  throw new Error("number too large");
@@ -2968,13 +2991,13 @@ function kr(r) {
2968
2991
  }
2969
2992
  const ft = (r) => (at << BigInt(r)) - at;
2970
2993
  function Pr(r, e, s) {
2971
- if (ge(r, "hashLen"), ge(e, "qByteLen"), typeof s != "function")
2994
+ if (me(r, "hashLen"), me(e, "qByteLen"), typeof s != "function")
2972
2995
  throw new Error("hmacFn must be a function");
2973
2996
  const t = (y) => new Uint8Array(y), n = Uint8Array.of(), o = Uint8Array.of(0), i = Uint8Array.of(1), a = 1e3;
2974
2997
  let c = t(r), l = t(r), u = 0;
2975
2998
  const h = () => {
2976
2999
  c.fill(1), l.fill(0), u = 0;
2977
- }, _ = (...y) => s(l, be(c, ...y)), f = (y = n) => {
3000
+ }, _ = (...y) => s(l, ve(c, ...y)), f = (y = n) => {
2978
3001
  l = _(o, y), c = _(), y.length !== 0 && (l = _(i, y), c = _());
2979
3002
  }, w = () => {
2980
3003
  if (u++ >= a)
@@ -2983,17 +3006,17 @@ function Pr(r, e, s) {
2983
3006
  const T = [];
2984
3007
  for (; y < e; ) {
2985
3008
  c = _();
2986
- const C = c.slice();
2987
- T.push(C), y += c.length;
3009
+ const N = c.slice();
3010
+ T.push(N), y += c.length;
2988
3011
  }
2989
- return be(...T);
3012
+ return ve(...T);
2990
3013
  };
2991
3014
  return (y, T) => {
2992
3015
  h(), f(y);
2993
- let C;
2994
- for (; !(C = T(w())); )
3016
+ let N;
3017
+ for (; !(N = T(w())); )
2995
3018
  f();
2996
- return h(), C;
3019
+ return h(), N;
2997
3020
  };
2998
3021
  }
2999
3022
  function _t(r, e = {}, s = {}) {
@@ -3021,7 +3044,7 @@ function Mt(r) {
3021
3044
  };
3022
3045
  }
3023
3046
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3024
- const ne = /* @__PURE__ */ BigInt(0), ee = /* @__PURE__ */ BigInt(1), Ie = /* @__PURE__ */ BigInt(2), ds = /* @__PURE__ */ BigInt(3), us = /* @__PURE__ */ BigInt(4), hs = /* @__PURE__ */ BigInt(5), Or = /* @__PURE__ */ BigInt(7), ps = /* @__PURE__ */ BigInt(8), Nr = /* @__PURE__ */ BigInt(9), fs = /* @__PURE__ */ BigInt(16);
3047
+ const ne = /* @__PURE__ */ BigInt(0), ee = /* @__PURE__ */ BigInt(1), Ie = /* @__PURE__ */ BigInt(2), ds = /* @__PURE__ */ BigInt(3), us = /* @__PURE__ */ BigInt(4), hs = /* @__PURE__ */ BigInt(5), Or = /* @__PURE__ */ BigInt(7), ps = /* @__PURE__ */ BigInt(8), Cr = /* @__PURE__ */ BigInt(9), fs = /* @__PURE__ */ BigInt(16);
3025
3048
  function le(r, e) {
3026
3049
  const s = r % e;
3027
3050
  return s >= ne ? s : e + s;
@@ -3054,7 +3077,7 @@ function _s(r, e) {
3054
3077
  const s = (r.ORDER + ee) / us, t = r.pow(e, s);
3055
3078
  return xt(r, t, e), t;
3056
3079
  }
3057
- function Cr(r, e) {
3080
+ function Nr(r, e) {
3058
3081
  const s = (r.ORDER - hs) / ps, t = r.mul(e, Ie), n = r.pow(t, s), o = r.mul(e, n), i = r.mul(r.mul(o, Ie), n), a = r.mul(o, r.sub(i, r.ONE));
3059
3082
  return xt(r, a, e), a;
3060
3083
  }
@@ -3103,7 +3126,7 @@ function xs(r) {
3103
3126
  };
3104
3127
  }
3105
3128
  function Dr(r) {
3106
- return r % us === ds ? _s : r % ps === hs ? Cr : r % fs === Nr ? Lr(r) : xs(r);
3129
+ return r % us === ds ? _s : r % ps === hs ? Nr : r % fs === Cr ? Lr(r) : xs(r);
3107
3130
  }
3108
3131
  const Mr = [
3109
3132
  "create",
@@ -3155,7 +3178,7 @@ function Bt(r, e) {
3155
3178
  return n ? 1 : o ? 0 : -1;
3156
3179
  }
3157
3180
  function Ur(r, e) {
3158
- e !== void 0 && ge(e);
3181
+ e !== void 0 && me(e);
3159
3182
  const s = e !== void 0 ? e : r.toString(2).length, t = Math.ceil(s / 8);
3160
3183
  return { nBitLength: s, nByteLength: t };
3161
3184
  }
@@ -3503,10 +3526,10 @@ const Wt = (r, e) => (r + (r >= 0 ? e : -e) / Es) / e;
3503
3526
  function Vr(r, e, s) {
3504
3527
  const [[t, n], [o, i]] = e, a = Wt(i * r, s), c = Wt(-n * r, s);
3505
3528
  let l = r - a * t - c * o, u = -a * n - c * i;
3506
- const h = l < _e, _ = u < _e;
3529
+ const h = l < xe, _ = u < xe;
3507
3530
  h && (l = -l), _ && (u = -u);
3508
3531
  const f = ft(Math.ceil(kr(s) / 2)) + Re;
3509
- if (l < _e || l >= f || u < _e || u >= f)
3532
+ if (l < xe || l >= f || u < xe || u >= f)
3510
3533
  throw new Error("splitScalar (endomorphism): failed, k=" + r);
3511
3534
  return { k1neg: h, k1: l, k2neg: _, k2: u };
3512
3535
  }
@@ -3526,13 +3549,13 @@ class zr extends Error {
3526
3549
  super(e);
3527
3550
  }
3528
3551
  }
3529
- const ye = {
3552
+ const be = {
3530
3553
  // asn.1 DER encoding utils
3531
3554
  Err: zr,
3532
3555
  // Basic building block is TLV (Tag-Length-Value)
3533
3556
  _tlv: {
3534
3557
  encode: (r, e) => {
3535
- const { Err: s } = ye;
3558
+ const { Err: s } = be;
3536
3559
  if (r < 0 || r > 256)
3537
3560
  throw new s("tlv.encode: wrong tag");
3538
3561
  if (e.length & 1)
@@ -3545,7 +3568,7 @@ const ye = {
3545
3568
  },
3546
3569
  // v - value, l - left bytes (unparsed)
3547
3570
  decode(r, e) {
3548
- const { Err: s } = ye;
3571
+ const { Err: s } = be;
3549
3572
  let t = 0;
3550
3573
  if (r < 0 || r > 256)
3551
3574
  throw new s("tlv.encode: wrong tag");
@@ -3583,8 +3606,8 @@ const ye = {
3583
3606
  // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
3584
3607
  _int: {
3585
3608
  encode(r) {
3586
- const { Err: e } = ye;
3587
- if (r < _e)
3609
+ const { Err: e } = be;
3610
+ if (r < xe)
3588
3611
  throw new e("integer: negative integers are not allowed");
3589
3612
  let s = Ue(r);
3590
3613
  if (Number.parseInt(s[0], 16) & 8 && (s = "00" + s), s.length & 1)
@@ -3592,7 +3615,7 @@ const ye = {
3592
3615
  return s;
3593
3616
  },
3594
3617
  decode(r) {
3595
- const { Err: e } = ye;
3618
+ const { Err: e } = be;
3596
3619
  if (r[0] & 128)
3597
3620
  throw new e("invalid signature integer: negative");
3598
3621
  if (r[0] === 0 && !(r[1] & 128))
@@ -3601,7 +3624,7 @@ const ye = {
3601
3624
  }
3602
3625
  },
3603
3626
  toSig(r) {
3604
- const { Err: e, _int: s, _tlv: t } = ye, n = V(r, void 0, "signature"), { v: o, l: i } = t.decode(48, n);
3627
+ const { Err: e, _int: s, _tlv: t } = be, n = V(r, void 0, "signature"), { v: o, l: i } = t.decode(48, n);
3605
3628
  if (i.length)
3606
3629
  throw new e("invalid signature: left bytes after parsing");
3607
3630
  const { v: a, l: c } = t.decode(2, o), { v: l, l: u } = t.decode(2, c);
@@ -3610,10 +3633,10 @@ const ye = {
3610
3633
  return { r: s.decode(a), s: s.decode(l) };
3611
3634
  },
3612
3635
  hexFromSig(r) {
3613
- const { _tlv: e, _int: s } = ye, t = e.encode(2, s.encode(r.r)), n = e.encode(2, s.encode(r.s)), o = t + n;
3636
+ const { _tlv: e, _int: s } = be, t = e.encode(2, s.encode(r.r)), n = e.encode(2, s.encode(r.s)), o = t + n;
3614
3637
  return e.encode(48, o);
3615
3638
  }
3616
- }, _e = BigInt(0), Re = BigInt(1), Es = BigInt(2), He = BigInt(3), jr = BigInt(4);
3639
+ }, xe = BigInt(0), Re = BigInt(1), Es = BigInt(2), He = BigInt(3), jr = BigInt(4);
3617
3640
  function Yr(r, e = {}) {
3618
3641
  const s = qr("weierstrass", r, e), { Fp: t, Fn: n } = s;
3619
3642
  let o = s.CURVE;
@@ -3638,19 +3661,19 @@ function Yr(r, e = {}) {
3638
3661
  const { x: v, y: k } = x.toAffine(), D = t.toBytes(v);
3639
3662
  if (qe(g, "isCompressed"), g) {
3640
3663
  u();
3641
- const N = !t.isOdd(k);
3642
- return be(Is(N), D);
3664
+ const C = !t.isOdd(k);
3665
+ return ve(Is(C), D);
3643
3666
  } else
3644
- return be(Uint8Array.of(4), D, t.toBytes(k));
3667
+ return ve(Uint8Array.of(4), D, t.toBytes(k));
3645
3668
  }
3646
3669
  function _(I) {
3647
3670
  V(I, void 0, "Point");
3648
3671
  const { publicKey: x, publicKeyUncompressed: g } = l, v = I.length, k = I[0], D = I.subarray(1);
3649
3672
  if (v === x && (k === 2 || k === 3)) {
3650
- const N = t.fromBytes(D);
3651
- if (!t.isValid(N))
3673
+ const C = t.fromBytes(D);
3674
+ if (!t.isValid(C))
3652
3675
  throw new Error("bad point: is not on curve, wrong x");
3653
- const M = b(N);
3676
+ const M = b(C);
3654
3677
  let R;
3655
3678
  try {
3656
3679
  R = t.sqrt(M);
@@ -3660,9 +3683,9 @@ function Yr(r, e = {}) {
3660
3683
  }
3661
3684
  u();
3662
3685
  const $ = t.isOdd(R);
3663
- return (k & 1) === 1 !== $ && (R = t.neg(R)), { x: N, y: R };
3686
+ return (k & 1) === 1 !== $ && (R = t.neg(R)), { x: C, y: R };
3664
3687
  } else if (v === g && k === 4) {
3665
- const N = t.BYTES, M = t.fromBytes(D.subarray(0, N)), R = t.fromBytes(D.subarray(N, N * 2));
3688
+ const C = t.BYTES, M = t.fromBytes(D.subarray(0, C)), R = t.fromBytes(D.subarray(C, C * 2));
3666
3689
  if (!y(M, R))
3667
3690
  throw new Error("bad point: is not on curve");
3668
3691
  return { x: M, y: R };
@@ -3680,8 +3703,8 @@ function Yr(r, e = {}) {
3680
3703
  }
3681
3704
  if (!y(o.Gx, o.Gy))
3682
3705
  throw new Error("bad curve params: generator point");
3683
- const T = t.mul(t.pow(o.a, He), jr), C = t.mul(t.sqr(o.b), BigInt(27));
3684
- if (t.is0(t.add(T, C)))
3706
+ const T = t.mul(t.pow(o.a, He), jr), N = t.mul(t.sqr(o.b), BigInt(27));
3707
+ if (t.is0(t.add(T, N)))
3685
3708
  throw new Error("bad curve params: a or b");
3686
3709
  function W(I, x, g = !1) {
3687
3710
  if (!t.isValid(x) || g && t.is0(x))
@@ -3703,12 +3726,12 @@ function Yr(r, e = {}) {
3703
3726
  return { x: g, y: v };
3704
3727
  const D = I.is0();
3705
3728
  x == null && (x = D ? t.ONE : t.inv(k));
3706
- const N = t.mul(g, x), M = t.mul(v, x), R = t.mul(k, x);
3729
+ const C = t.mul(g, x), M = t.mul(v, x), R = t.mul(k, x);
3707
3730
  if (D)
3708
3731
  return { x: t.ZERO, y: t.ZERO };
3709
3732
  if (!t.eql(R, t.ONE))
3710
3733
  throw new Error("invZ was invalid");
3711
- return { x: N, y: M };
3734
+ return { x: C, y: M };
3712
3735
  }), P = Mt((I) => {
3713
3736
  if (I.is0()) {
3714
3737
  if (e.allowInfinityPoint && !t.is0(I.Y))
@@ -3783,7 +3806,7 @@ function Yr(r, e = {}) {
3783
3806
  /** Compare one point to another. */
3784
3807
  equals(x) {
3785
3808
  B(x);
3786
- const { X: g, Y: v, Z: k } = this, { X: D, Y: N, Z: M } = x, R = t.eql(t.mul(g, M), t.mul(D, k)), $ = t.eql(t.mul(v, M), t.mul(N, k));
3809
+ const { X: g, Y: v, Z: k } = this, { X: D, Y: C, Z: M } = x, R = t.eql(t.mul(g, M), t.mul(D, k)), $ = t.eql(t.mul(v, M), t.mul(C, k));
3787
3810
  return R && $;
3788
3811
  }
3789
3812
  /** Flips point to one corresponding to (x, -y) in Affine coordinates. */
@@ -3795,9 +3818,9 @@ function Yr(r, e = {}) {
3795
3818
  // https://eprint.iacr.org/2015/1060, algorithm 3
3796
3819
  // Cost: 8M + 3S + 3*a + 2*b3 + 15add.
3797
3820
  double() {
3798
- const { a: x, b: g } = o, v = t.mul(g, He), { X: k, Y: D, Z: N } = this;
3799
- let M = t.ZERO, R = t.ZERO, $ = t.ZERO, F = t.mul(k, k), J = t.mul(D, D), K = t.mul(N, N), H = t.mul(k, D);
3800
- return H = t.add(H, H), $ = t.mul(k, N), $ = t.add($, $), M = t.mul(x, $), R = t.mul(v, K), R = t.add(M, R), M = t.sub(J, R), R = t.add(J, R), R = t.mul(M, R), M = t.mul(H, M), $ = t.mul(v, $), K = t.mul(x, K), H = t.sub(F, K), H = t.mul(x, H), H = t.add(H, $), $ = t.add(F, F), F = t.add($, F), F = t.add(F, K), F = t.mul(F, H), R = t.add(R, F), K = t.mul(D, N), K = t.add(K, K), F = t.mul(K, H), M = t.sub(M, F), $ = t.mul(K, J), $ = t.add($, $), $ = t.add($, $), new A(M, R, $);
3821
+ const { a: x, b: g } = o, v = t.mul(g, He), { X: k, Y: D, Z: C } = this;
3822
+ let M = t.ZERO, R = t.ZERO, $ = t.ZERO, F = t.mul(k, k), J = t.mul(D, D), K = t.mul(C, C), H = t.mul(k, D);
3823
+ return H = t.add(H, H), $ = t.mul(k, C), $ = t.add($, $), M = t.mul(x, $), R = t.mul(v, K), R = t.add(M, R), M = t.sub(J, R), R = t.add(J, R), R = t.mul(M, R), M = t.mul(H, M), $ = t.mul(v, $), K = t.mul(x, K), H = t.sub(F, K), H = t.mul(x, H), H = t.add(H, $), $ = t.add(F, F), F = t.add($, F), F = t.add(F, K), F = t.mul(F, H), R = t.add(R, F), K = t.mul(D, C), K = t.add(K, K), F = t.mul(K, H), M = t.sub(M, F), $ = t.mul(K, J), $ = t.add($, $), $ = t.add($, $), new A(M, R, $);
3801
3824
  }
3802
3825
  // Renes-Costello-Batina exception-free addition formula.
3803
3826
  // There is 30% faster Jacobian formula, but it is not complete.
@@ -3805,13 +3828,13 @@ function Yr(r, e = {}) {
3805
3828
  // Cost: 12M + 0S + 3*a + 3*b3 + 23add.
3806
3829
  add(x) {
3807
3830
  B(x);
3808
- const { X: g, Y: v, Z: k } = this, { X: D, Y: N, Z: M } = x;
3831
+ const { X: g, Y: v, Z: k } = this, { X: D, Y: C, Z: M } = x;
3809
3832
  let R = t.ZERO, $ = t.ZERO, F = t.ZERO;
3810
3833
  const J = o.a, K = t.mul(o.b, He);
3811
- let H = t.mul(g, D), X = t.mul(v, N), Z = t.mul(k, M), oe = t.add(g, v), z = t.add(D, N);
3834
+ let H = t.mul(g, D), X = t.mul(v, C), Z = t.mul(k, M), oe = t.add(g, v), z = t.add(D, C);
3812
3835
  oe = t.mul(oe, z), z = t.add(H, X), oe = t.sub(oe, z), z = t.add(g, k);
3813
3836
  let Q = t.add(D, M);
3814
- return z = t.mul(z, Q), Q = t.add(H, Z), z = t.sub(z, Q), Q = t.add(v, k), R = t.add(N, M), Q = t.mul(Q, R), R = t.add(X, Z), Q = t.sub(Q, R), F = t.mul(J, z), R = t.mul(K, Z), F = t.add(R, F), R = t.sub(X, F), F = t.add(X, F), $ = t.mul(R, F), X = t.add(H, H), X = t.add(X, H), Z = t.mul(J, Z), z = t.mul(K, z), X = t.add(X, Z), Z = t.sub(H, Z), Z = t.mul(J, Z), z = t.add(z, Z), H = t.mul(X, z), $ = t.add($, H), H = t.mul(Q, z), R = t.mul(oe, R), R = t.sub(R, H), H = t.mul(oe, X), F = t.mul(Q, F), F = t.add(F, H), new A(R, $, F);
3837
+ return z = t.mul(z, Q), Q = t.add(H, Z), z = t.sub(z, Q), Q = t.add(v, k), R = t.add(C, M), Q = t.mul(Q, R), R = t.add(X, Z), Q = t.sub(Q, R), F = t.mul(J, z), R = t.mul(K, Z), F = t.add(R, F), R = t.sub(X, F), F = t.add(X, F), $ = t.mul(R, F), X = t.add(H, H), X = t.add(X, H), Z = t.mul(J, Z), z = t.mul(K, z), X = t.add(X, Z), Z = t.sub(H, Z), Z = t.mul(J, Z), z = t.add(z, Z), H = t.mul(X, z), $ = t.add($, H), H = t.mul(Q, z), R = t.mul(oe, R), R = t.sub(R, H), H = t.mul(oe, X), F = t.mul(Q, F), F = t.add(F, H), new A(R, $, F);
3815
3838
  }
3816
3839
  subtract(x) {
3817
3840
  return this.add(x.negate());
@@ -3833,13 +3856,13 @@ function Yr(r, e = {}) {
3833
3856
  if (!n.isValidNot0(x))
3834
3857
  throw new Error("invalid scalar: out of range");
3835
3858
  let v, k;
3836
- const D = (N) => O.cached(this, N, (M) => Ut(A, M));
3859
+ const D = (C) => O.cached(this, C, (M) => Ut(A, M));
3837
3860
  if (g) {
3838
- const { k1neg: N, k1: M, k2neg: R, k2: $ } = j(x), { p: F, f: J } = D(M), { p: K, f: H } = D($);
3839
- k = J.add(H), v = S(g.beta, F, K, N, R);
3861
+ const { k1neg: C, k1: M, k2neg: R, k2: $ } = j(x), { p: F, f: J } = D(M), { p: K, f: H } = D($);
3862
+ k = J.add(H), v = S(g.beta, F, K, C, R);
3840
3863
  } else {
3841
- const { p: N, f: M } = D(x);
3842
- v = N, k = M;
3864
+ const { p: C, f: M } = D(x);
3865
+ v = C, k = M;
3843
3866
  }
3844
3867
  return Ut(A, [v, k])[0];
3845
3868
  }
@@ -3852,15 +3875,15 @@ function Yr(r, e = {}) {
3852
3875
  const { endo: g } = e, v = this;
3853
3876
  if (!n.isValid(x))
3854
3877
  throw new Error("invalid scalar: out of range");
3855
- if (x === _e || v.is0())
3878
+ if (x === xe || v.is0())
3856
3879
  return A.ZERO;
3857
3880
  if (x === Re)
3858
3881
  return v;
3859
3882
  if (O.hasCache(this))
3860
3883
  return this.multiply(x);
3861
3884
  if (g) {
3862
- const { k1neg: k, k1: D, k2neg: N, k2: M } = j(x), { p1: R, p2: $ } = Wr(A, v, D, M);
3863
- return S(g.beta, R, $, k, N);
3885
+ const { k1neg: k, k1: D, k2neg: C, k2: M } = j(x), { p1: R, p2: $ } = Wr(A, v, D, M);
3886
+ return S(g.beta, R, $, k, C);
3864
3887
  } else
3865
3888
  return O.unsafe(v, x);
3866
3889
  }
@@ -3988,7 +4011,7 @@ function Xr(r, e, s = {}) {
3988
4011
  throw new Error(`invalid signature ${x}: out of range 1..Point.Fn.ORDER`);
3989
4012
  return g;
3990
4013
  }
3991
- function C() {
4014
+ function N() {
3992
4015
  if (b)
3993
4016
  throw new Error('"recovered" sig type is not supported for cofactor >2 curves');
3994
4017
  }
@@ -4003,7 +4026,7 @@ function Xr(r, e, s = {}) {
4003
4026
  E(this, "s");
4004
4027
  E(this, "recovery");
4005
4028
  if (this.r = T("r", g), this.s = T("s", v), k != null) {
4006
- if (C(), ![0, 1, 2, 3].includes(k))
4029
+ if (N(), ![0, 1, 2, 3].includes(k))
4007
4030
  throw new Error("invalid recovery id");
4008
4031
  this.recovery = k;
4009
4032
  }
@@ -4013,12 +4036,12 @@ function Xr(r, e, s = {}) {
4013
4036
  W(g, v);
4014
4037
  let k;
4015
4038
  if (v === "der") {
4016
- const { r: R, s: $ } = ye.toSig(V(g));
4039
+ const { r: R, s: $ } = be.toSig(V(g));
4017
4040
  return new B(R, $);
4018
4041
  }
4019
4042
  v === "recovered" && (k = g[0], v = "compact", g = g.subarray(1));
4020
- const D = f.signature / 2, N = g.subarray(0, D), M = g.subarray(D, D * 2);
4021
- return new B(i.fromBytes(N), i.fromBytes(M), k);
4043
+ const D = f.signature / 2, C = g.subarray(0, D), M = g.subarray(D, D * 2);
4044
+ return new B(i.fromBytes(C), i.fromBytes(M), k);
4022
4045
  }
4023
4046
  static fromHex(g, v) {
4024
4047
  return this.fromBytes(We(g), v);
@@ -4033,10 +4056,10 @@ function Xr(r, e, s = {}) {
4033
4056
  return new B(this.r, this.s, g);
4034
4057
  }
4035
4058
  recoverPublicKey(g) {
4036
- const { r: v, s: k } = this, D = this.assertRecovery(), N = D === 2 || D === 3 ? v + a : v;
4037
- if (!o.isValid(N))
4059
+ const { r: v, s: k } = this, D = this.assertRecovery(), C = D === 2 || D === 3 ? v + a : v;
4060
+ if (!o.isValid(C))
4038
4061
  throw new Error("invalid recovery id: sig.r+curve.n != R.x");
4039
- const M = o.toBytes(N), R = r.fromBytes(be(Is((D & 1) === 0), M)), $ = i.inv(N), F = q(V(g, void 0, "msgHash")), J = i.create(-F * $), K = i.create(k * $), H = r.BASE.multiplyUnsafe(J).add(R.multiplyUnsafe(K));
4062
+ const M = o.toBytes(C), R = r.fromBytes(ve(Is((D & 1) === 0), M)), $ = i.inv(C), F = q(V(g, void 0, "msgHash")), J = i.create(-F * $), K = i.create(k * $), H = r.BASE.multiplyUnsafe(J).add(R.multiplyUnsafe(K));
4040
4063
  if (H.is0())
4041
4064
  throw new Error("invalid recovery: point at infinify");
4042
4065
  return H.assertValidity(), H;
@@ -4047,9 +4070,9 @@ function Xr(r, e, s = {}) {
4047
4070
  }
4048
4071
  toBytes(g = w.format) {
4049
4072
  if (ct(g), g === "der")
4050
- return We(ye.hexFromSig(this));
4051
- const { r: v, s: k } = this, D = i.toBytes(v), N = i.toBytes(k);
4052
- return g === "recovered" ? (C(), be(Uint8Array.of(this.assertRecovery()), D, N)) : be(D, N);
4073
+ return We(be.hexFromSig(this));
4074
+ const { r: v, s: k } = this, D = i.toBytes(v), C = i.toBytes(k);
4075
+ return g === "recovered" ? (N(), ve(Uint8Array.of(this.assertRecovery()), D, C)) : ve(D, C);
4053
4076
  }
4054
4077
  toHex(g) {
4055
4078
  return Me(this.toBytes(g));
@@ -4064,32 +4087,32 @@ function Xr(r, e, s = {}) {
4064
4087
  return i.create(j(g));
4065
4088
  }, P = ft(c);
4066
4089
  function S(x) {
4067
- return Rr("num < 2^" + c, x, _e, P), i.toBytes(x);
4090
+ return Rr("num < 2^" + c, x, xe, P), i.toBytes(x);
4068
4091
  }
4069
4092
  function L(x, g) {
4070
4093
  return V(x, void 0, "message"), g ? V(e(x), void 0, "prehashed message") : x;
4071
4094
  }
4072
4095
  function G(x, g, v) {
4073
- const { lowS: k, prehash: D, extraEntropy: N } = st(v, w);
4096
+ const { lowS: k, prehash: D, extraEntropy: C } = st(v, w);
4074
4097
  x = L(x, D);
4075
4098
  const M = q(x), R = i.fromBytes(g);
4076
4099
  if (!i.isValidNot0(R))
4077
4100
  throw new Error("invalid private key");
4078
4101
  const $ = [S(R), S(M)];
4079
- if (N != null && N !== !1) {
4080
- const H = N === !0 ? t(f.secretKey) : N;
4102
+ if (C != null && C !== !1) {
4103
+ const H = C === !0 ? t(f.secretKey) : C;
4081
4104
  $.push(V(H, void 0, "extraEntropy"));
4082
4105
  }
4083
- const F = be(...$), J = M;
4106
+ const F = ve(...$), J = M;
4084
4107
  function K(H) {
4085
4108
  const X = j(H);
4086
4109
  if (!i.isValidNot0(X))
4087
4110
  return;
4088
4111
  const Z = i.inv(X), oe = r.BASE.multiply(X).toAffine(), z = i.create(oe.x);
4089
- if (z === _e)
4112
+ if (z === xe)
4090
4113
  return;
4091
4114
  const Q = i.create(Z * i.create(J + z * R));
4092
- if (Q === _e)
4115
+ if (Q === xe)
4093
4116
  return;
4094
4117
  let yt = (oe.x === z ? 0 : 2) | Number(oe.y & Re), bt = Q;
4095
4118
  return k && y(Q) && (bt = i.neg(Q), yt ^= 1), new B(z, bt, b ? void 0 : yt);
@@ -4101,8 +4124,8 @@ function Xr(r, e, s = {}) {
4101
4124
  return Pr(e.outputLen, i.BYTES, n)(k, D).toBytes(v.format);
4102
4125
  }
4103
4126
  function A(x, g, v, k = {}) {
4104
- const { lowS: D, prehash: N, format: M } = st(k, w);
4105
- if (v = V(v, void 0, "publicKey"), g = L(g, N), !ut(x)) {
4127
+ const { lowS: D, prehash: C, format: M } = st(k, w);
4128
+ if (v = V(v, void 0, "publicKey"), g = L(g, C), !ut(x)) {
4106
4129
  const R = x instanceof B ? ", use sig.toBytes()" : "";
4107
4130
  throw new Error("verify expects Uint8Array signature" + R);
4108
4131
  }
@@ -4152,7 +4175,7 @@ const gt = {
4152
4175
  ]
4153
4176
  }, qt = /* @__PURE__ */ BigInt(2);
4154
4177
  function Qr(r) {
4155
- const e = gt.p, s = BigInt(3), t = BigInt(6), n = BigInt(11), o = BigInt(22), i = BigInt(23), a = BigInt(44), c = BigInt(88), l = r * r * r % e, u = l * l * r % e, h = ae(u, s, e) * u % e, _ = ae(h, s, e) * u % e, f = ae(_, qt, e) * l % e, w = ae(f, n, e) * f % e, b = ae(w, o, e) * w % e, y = ae(b, a, e) * b % e, T = ae(y, c, e) * y % e, C = ae(T, a, e) * b % e, W = ae(C, s, e) * u % e, B = ae(W, i, e) * w % e, j = ae(B, t, e) * l % e, q = ae(j, qt, e);
4178
+ const e = gt.p, s = BigInt(3), t = BigInt(6), n = BigInt(11), o = BigInt(22), i = BigInt(23), a = BigInt(44), c = BigInt(88), l = r * r * r % e, u = l * l * r % e, h = ae(u, s, e) * u % e, _ = ae(h, s, e) * u % e, f = ae(_, qt, e) * l % e, w = ae(f, n, e) * f % e, b = ae(w, o, e) * w % e, y = ae(b, a, e) * b % e, T = ae(y, c, e) * y % e, N = ae(T, a, e) * b % e, W = ae(N, s, e) * u % e, B = ae(W, i, e) * w % e, j = ae(B, t, e) * l % e, q = ae(j, qt, e);
4156
4179
  if (!lt.eql(lt.sqr(q), r))
4157
4180
  throw new Error("Cannot find square root");
4158
4181
  return q;
@@ -4160,12 +4183,12 @@ function Qr(r) {
4160
4183
  const lt = je(gt.p, { sqrt: Qr }), en = /* @__PURE__ */ Yr(gt, {
4161
4184
  Fp: lt,
4162
4185
  endo: Zr
4163
- }), tn = /* @__PURE__ */ Xr(en, Ir), sn = BigInt(0), Ne = BigInt(1), rn = BigInt(2), nn = BigInt(7), on = BigInt(256), an = BigInt(113), As = [], Rs = [], ks = [];
4164
- for (let r = 0, e = Ne, s = 1, t = 0; r < 24; r++) {
4186
+ }), tn = /* @__PURE__ */ Xr(en, Ir), sn = BigInt(0), Ce = BigInt(1), rn = BigInt(2), nn = BigInt(7), on = BigInt(256), an = BigInt(113), As = [], Rs = [], ks = [];
4187
+ for (let r = 0, e = Ce, s = 1, t = 0; r < 24; r++) {
4165
4188
  [s, t] = [t, (2 * s + 3 * t) % 5], As.push(2 * (5 * t + s)), Rs.push((r + 1) * (r + 2) / 2 % 64);
4166
4189
  let n = sn;
4167
4190
  for (let o = 0; o < 7; o++)
4168
- e = (e << Ne ^ (e >> nn) * an) % on, e & rn && (n ^= Ne << (Ne << BigInt(o)) - Ne);
4191
+ e = (e << Ce ^ (e >> nn) * an) % on, e & rn && (n ^= Ce << (Ce << BigInt(o)) - Ce);
4169
4192
  ks.push(n);
4170
4193
  }
4171
4194
  const Ps = gr(ks, !0), cn = Ps[0], ln = Ps[1], Kt = (r, e, s) => s > 32 ? yr(r, e, s) : mr(r, e, s), Vt = (r, e, s) => s > 32 ? br(r, e, s) : wr(r, e, s);
@@ -4208,7 +4231,7 @@ class mt {
4208
4231
  E(this, "outputLen");
4209
4232
  E(this, "enableXOF", !1);
4210
4233
  E(this, "rounds");
4211
- if (this.blockLen = e, this.suffix = s, this.outputLen = t, this.enableXOF = n, this.rounds = o, ge(t, "outputLen"), !(0 < e && e < 200))
4234
+ if (this.blockLen = e, this.suffix = s, this.outputLen = t, this.enableXOF = n, this.rounds = o, me(t, "outputLen"), !(0 < e && e < 200))
4212
4235
  throw new Error("only keccak-f1600 function is supported");
4213
4236
  this.state = new Uint8Array(200), this.state32 = ar(this.state);
4214
4237
  }
@@ -4216,7 +4239,7 @@ class mt {
4216
4239
  return this._cloneInto();
4217
4240
  }
4218
4241
  keccak() {
4219
- Ct(this.state32), dn(this.state32, this.rounds), Ct(this.state32), this.posOut = 0, this.pos = 0;
4242
+ Nt(this.state32), dn(this.state32, this.rounds), Nt(this.state32), this.posOut = 0, this.pos = 0;
4220
4243
  }
4221
4244
  update(e) {
4222
4245
  ke(this), V(e);
@@ -4252,7 +4275,7 @@ class mt {
4252
4275
  return this.writeInto(e);
4253
4276
  }
4254
4277
  xof(e) {
4255
- return ge(e), this.xofInto(new Uint8Array(e));
4278
+ return me(e), this.xofInto(new Uint8Array(e));
4256
4279
  }
4257
4280
  digestInto(e) {
4258
4281
  if (ss(e, this), this.finished)
@@ -4490,7 +4513,7 @@ class Ee {
4490
4513
  d.warn("[CROSSx] OAuth 타임아웃 (5분) — postMessage를 수신하지 못했습니다"), B(), t(new Error("Authentication timeout"));
4491
4514
  }, 5 * 60 * 1e3), w = 10, b = 30;
4492
4515
  let y = 0, T = null;
4493
- const C = () => {
4516
+ const N = () => {
4494
4517
  clearInterval(W), d.warn("[CROSSx] COOP 감지 — OAuth 서버 응답을 " + b + "초간 대기합니다"), T = setTimeout(() => {
4495
4518
  B(), t(new Error(
4496
4519
  "OAuth 서버로부터 응답을 받지 못했습니다. 브라우저 보안 정책(COOP)으로 인해 팝업 통신이 차단되었을 수 있습니다. 다시 시도해 주세요."
@@ -4499,9 +4522,9 @@ class Ee {
4499
4522
  }, W = setInterval(() => {
4500
4523
  y++;
4501
4524
  try {
4502
- _.closed && (y <= w ? C() : (B(), t(new Error("로그인이 취소되었습니다"))));
4525
+ _.closed && (y <= w ? N() : (B(), t(new Error("로그인이 취소되었습니다"))));
4503
4526
  } catch {
4504
- C();
4527
+ N();
4505
4528
  }
4506
4529
  }, 1e3), B = () => {
4507
4530
  clearTimeout(f), clearInterval(W), T && clearTimeout(T), window.removeEventListener("message", j);
@@ -4552,7 +4575,7 @@ class Ee {
4552
4575
  });
4553
4576
  }
4554
4577
  }
4555
- const Ce = "crossx_wallet_data", Ae = "crossx_mock_pin_hash";
4578
+ const Ne = "crossx_wallet_data", Ae = "crossx_mock_pin_hash";
4556
4579
  class wn {
4557
4580
  constructor(e, s) {
4558
4581
  this.storage = e, this.pinStore = s ?? null;
@@ -4566,13 +4589,13 @@ class wn {
4566
4589
  async checkWallet() {
4567
4590
  if (this.migrateScenario !== void 0)
4568
4591
  return d.log("[Mock] checkWallet → migration_required"), "migration_required";
4569
- const s = await this.storage.get(Ce) ? "exists" : "not_found";
4592
+ const s = await this.storage.get(Ne) ? "exists" : "not_found";
4570
4593
  return d.log(`[Mock] checkWallet → ${s}`), s;
4571
4594
  }
4572
4595
  async getOrCreateWallet(e) {
4573
4596
  var s;
4574
4597
  try {
4575
- const t = await this.storage.get(Ce);
4598
+ const t = await this.storage.get(Ne);
4576
4599
  if (t) return t;
4577
4600
  const n = {
4578
4601
  id: e,
@@ -4580,7 +4603,7 @@ class wn {
4580
4603
  derivationPath: "m/44'/60'/0'/0/0",
4581
4604
  createdAt: Date.now()
4582
4605
  };
4583
- await this.storage.set(Ce, n);
4606
+ await this.storage.set(Ne, n);
4584
4607
  const o = (s = this.pinStore) == null ? void 0 : s.get();
4585
4608
  return o && (await this.storage.set(Ae, o), d.log("[Mock] 지갑 생성 — PIN 저장됨")), n;
4586
4609
  } catch (t) {
@@ -4589,7 +4612,7 @@ class wn {
4589
4612
  }
4590
4613
  /** GET /mnemonic/addresses 모킹 — PIN 불필요, 캐시된 주소 반환 */
4591
4614
  async getAddresses(e) {
4592
- const s = await this.storage.get(Ce);
4615
+ const s = await this.storage.get(Ne);
4593
4616
  return s ? [{ address: s.address, index: 0 }] : [];
4594
4617
  }
4595
4618
  async getAddress(e, s) {
@@ -4669,7 +4692,7 @@ class wn {
4669
4692
  derivationPath: "m/44'/60'/0'/0/0",
4670
4693
  createdAt: Date.now()
4671
4694
  };
4672
- await this.storage.set(Ce, t);
4695
+ await this.storage.set(Ne, t);
4673
4696
  const n = (o = this.pinStore) == null ? void 0 : o.get();
4674
4697
  return n && (await this.storage.set(Ae, n), d.log("[Mock] 마이그레이션 — PIN 저장됨")), t;
4675
4698
  }
@@ -4770,8 +4793,8 @@ class Le {
4770
4793
  const w = Le.mapGatewayError(_.code, _.data);
4771
4794
  if (w === p.AUTH_NOT_AUTHENTICATED && !n && this._onTokenRefresh && (d.warn("[CROSSx] Gateway -10002 감지 — 토큰 갱신 후 재시도"), await this.deduplicatedRefresh()))
4772
4795
  return this.request(e, s, t, !0);
4773
- const b = Le.getGatewayErrorMessage(_.code, f), y = _.data, T = w === p.PIN_LOCKED ? Le.extractLockDetails(y) : y ?? void 0, C = new m(w, b, T);
4774
- throw w === p.AUTH_NOT_AUTHENTICATED && this._onUnauthorized && (d.warn("[CROSSx] Gateway -10002 갱신 재시도 실패 — 강제 로그아웃 실행"), this._onUnauthorized()), C;
4796
+ const b = Le.getGatewayErrorMessage(_.code, f), y = _.data, T = w === p.PIN_LOCKED ? Le.extractLockDetails(y) : y ?? void 0, N = new m(w, b, T);
4797
+ throw w === p.AUTH_NOT_AUTHENTICATED && this._onUnauthorized && (d.warn("[CROSSx] Gateway -10002 갱신 재시도 실패 — 강제 로그아웃 실행"), this._onUnauthorized()), N;
4775
4798
  }
4776
4799
  return d.log("[CROSSx] Wallet Gateway API 성공:", { code: _.code, url: i, method: e }), _.data ?? _;
4777
4800
  }
@@ -7123,13 +7146,13 @@ function En(r) {
7123
7146
  return null;
7124
7147
  }
7125
7148
  }
7126
- function Ns(r) {
7149
+ function Cs(r) {
7127
7150
  const e = En(r);
7128
7151
  if (!e) return Y("Estimated fee", "<span>—</span>");
7129
7152
  let s = Y("Est. Tx Fee", `<span>${e.estTxFee}</span>`);
7130
7153
  return e.isDynamic ? (e.maxPriorityFeeGwei !== void 0 && (s += Y("Max Priority Fee", `<span>${e.maxPriorityFeeGwei} Gwei</span>`)), e.maxFeeGwei !== void 0 && (s += Y("Max Gas Fee", `<span>${e.maxFeeGwei} Gwei</span>`))) : e.gasPriceGwei !== void 0 && (s += Y("Gas Price", `<span>${e.gasPriceGwei} Gwei</span>`)), e.gasLimitFormatted && (s += Y("Gas Limit", `<span>${e.gasLimitFormatted}</span>`)), s;
7131
7154
  }
7132
- const xe = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
7155
+ const ge = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
7133
7156
  <rect x="9" y="9" width="13" height="13" rx="2"/>
7134
7157
  <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
7135
7158
  </svg>`, ie = `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
@@ -7184,7 +7207,7 @@ function Y(r, e) {
7184
7207
  }
7185
7208
  function Rn(r, e) {
7186
7209
  const s = e, t = Ye(r.dappName), n = r.to ? `<span class="__crossx-addr-text">${se(r.to)}</span>
7187
- <button class="__crossx-copy-btn" data-copy="${U(r.to)}" title="Copy address">${xe}</button>` : "<span>—</span>", o = Ns(r), i = r.data ?? "0x", a = document.createElement("div");
7210
+ <button class="__crossx-copy-btn" data-copy="${U(r.to)}" title="Copy address">${ge}</button>` : "<span>—</span>", o = Cs(r), i = r.data ?? "0x", a = document.createElement("div");
7188
7211
  return a.id = te, a.innerHTML = `
7189
7212
  <div class="__crossx-card __crossx-card--migration __crossx-card--sign-tx" style="${ce(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
7190
7213
  <div class="__crossx-header">
@@ -7224,7 +7247,7 @@ function Rn(r, e) {
7224
7247
  }
7225
7248
  function kn(r, e) {
7226
7249
  const s = e, t = r.nativeSymbol ?? "ETH", n = r.nativeDecimals ?? 18, o = Ye(r.dappName), i = r.to ? `<span class="__crossx-addr-text">${se(r.to)}</span>
7227
- <button class="__crossx-copy-btn" data-copy="${U(r.to)}" title="Copy address">${xe}</button>` : "<span>—</span>", a = Ns(r), l = vn(r.value, t, n) ?? "—", u = document.createElement("div");
7250
+ <button class="__crossx-copy-btn" data-copy="${U(r.to)}" title="Copy address">${ge}</button>` : "<span>—</span>", a = Cs(r), l = vn(r.value, t, n) ?? "—", u = document.createElement("div");
7228
7251
  return u.id = te, u.innerHTML = `
7229
7252
  <div class="__crossx-card __crossx-card--migration __crossx-card--send-tx" style="${ce(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
7230
7253
  <div class="__crossx-header">
@@ -7276,14 +7299,14 @@ function On(r) {
7276
7299
  return String(r);
7277
7300
  }
7278
7301
  }
7279
- function Nn(r, e) {
7302
+ function Cn(r, e) {
7280
7303
  const s = Y(
7281
7304
  "From",
7282
7305
  `<span class="__crossx-addr-text">${se(r.from)}</span>
7283
- <button class="__crossx-copy-btn" data-copy="${U(r.from)}" title="Copy address">${xe}</button>`
7306
+ <button class="__crossx-copy-btn" data-copy="${U(r.from)}" title="Copy address">${ge}</button>`
7284
7307
  ), t = r.to ? Y("To", `<span class="__crossx-addr-text">${se(r.to)}</span>
7285
- <button class="__crossx-copy-btn" data-copy="${U(r.to)}" title="Copy address">${xe}</button>`) : "", n = r.amount ? Y("Transfer", `<span>${U(r.amount)}</span>`) : "", o = r.fees ? Y("Tx Fee", `<span>${U(r.fees)}</span>`) : "", i = r.txHash ? Y("Tx Hash", `<span class="__crossx-addr-text">${se(r.txHash)}</span>
7286
- <button class="__crossx-copy-btn" data-copy="${U(r.txHash)}" title="Copy hash">${xe}</button>`) : "", a = r.total ? `<div class="__crossx-total-pill">
7308
+ <button class="__crossx-copy-btn" data-copy="${U(r.to)}" title="Copy address">${ge}</button>`) : "", n = r.amount ? Y("Transfer", `<span>${U(r.amount)}</span>`) : "", o = r.fees ? Y("Tx Fee", `<span>${U(r.fees)}</span>`) : "", i = r.txHash ? Y("Tx Hash", `<span class="__crossx-addr-text">${se(r.txHash)}</span>
7309
+ <button class="__crossx-copy-btn" data-copy="${U(r.txHash)}" title="Copy hash">${ge}</button>`) : "", a = r.total ? `<div class="__crossx-total-pill">
7287
7310
  <span class="__crossx-total-label">Total<br>(including fees)</span>
7288
7311
  <span class="__crossx-total-amount">${U(r.total)}</span>
7289
7312
  </div>` : "", c = document.createElement("div");
@@ -7308,7 +7331,7 @@ function Nn(r, e) {
7308
7331
  </div>
7309
7332
  `, c;
7310
7333
  }
7311
- function Cn(r, e) {
7334
+ function Nn(r, e) {
7312
7335
  const s = document.createElement("div");
7313
7336
  return s.id = te, s.innerHTML = `
7314
7337
  <div class="__crossx-card __crossx-card--migration" style="${ce(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
@@ -7338,9 +7361,9 @@ function Ln(r, e, s) {
7338
7361
  const a = r.querySelector("#__crossx-progress-body");
7339
7362
  if (!a) return;
7340
7363
  const c = e.from ? Y("From", `<span class="__crossx-addr-text">${se(e.from)}</span>
7341
- <button class="__crossx-copy-btn" data-copy="${U(e.from)}" title="Copy address">${xe}</button>`) : "", l = e.to ? Y("To", `<span class="__crossx-addr-text">${se(e.to)}</span>
7342
- <button class="__crossx-copy-btn" data-copy="${U(e.to)}" title="Copy address">${xe}</button>`) : "", u = e.amount ? Y("Transfer", `<span>${U(e.amount)}</span>`) : "", h = e.fees ? Y("Tx Fee", `<span>${U(e.fees)}</span>`) : "", _ = e.txHash ? Y("Tx Hash", `<span class="__crossx-addr-text">${se(e.txHash)}</span>
7343
- <button class="__crossx-copy-btn" data-copy="${U(e.txHash)}" title="Copy hash">${xe}</button>`) : "", f = e.total ? `<div class="__crossx-total-pill">
7364
+ <button class="__crossx-copy-btn" data-copy="${U(e.from)}" title="Copy address">${ge}</button>`) : "", l = e.to ? Y("To", `<span class="__crossx-addr-text">${se(e.to)}</span>
7365
+ <button class="__crossx-copy-btn" data-copy="${U(e.to)}" title="Copy address">${ge}</button>`) : "", u = e.amount ? Y("Transfer", `<span>${U(e.amount)}</span>`) : "", h = e.fees ? Y("Tx Fee", `<span>${U(e.fees)}</span>`) : "", _ = e.txHash ? Y("Tx Hash", `<span class="__crossx-addr-text">${se(e.txHash)}</span>
7366
+ <button class="__crossx-copy-btn" data-copy="${U(e.txHash)}" title="Copy hash">${ge}</button>`) : "", f = e.total ? `<div class="__crossx-total-pill">
7344
7367
  <span class="__crossx-total-label">Total<br>(including fees)</span>
7345
7368
  <span class="__crossx-total-amount">${U(e.total)}</span>
7346
7369
  </div>` : "";
@@ -7413,7 +7436,7 @@ function Mn(r, e) {
7413
7436
  </div>`;
7414
7437
  for (const [l, u] of Object.entries(i)) {
7415
7438
  const h = On(u), f = Pn(u) ? `<span class="__crossx-addr-text">${se(u)}</span>
7416
- <button class="__crossx-copy-btn" data-copy="${U(String(u))}" title="Copy">${xe}</button>` : `<span>${h}</span>`;
7439
+ <button class="__crossx-copy-btn" data-copy="${U(String(u))}" title="Copy">${ge}</button>` : `<span>${h}</span>`;
7417
7440
  a += `
7418
7441
  <div class="__crossx-td-row">
7419
7442
  <span class="__crossx-td-label">${U(l)}</span>
@@ -7664,7 +7687,7 @@ function Vn(r) {
7664
7687
  }
7665
7688
  function nt(r) {
7666
7689
  const e = !!r.lockExpiresAt && r.lockExpiresAt > Date.now(), s = r.lockExpiresAt ? ` data-lock-expires="${r.lockExpiresAt}"` : "", t = r.headerSubtitle ? `<p class="__crossx-pin6-header-sub">${U(r.headerSubtitle)}</p>` : "", n = r.subtitle ? `<p class="__crossx-pin6-subtitle">${U(r.subtitle)}</p>` : "", o = r.errorMessage ? `<p class="__crossx-pin6-error" id="__crossx-pin6-error">${U(r.errorMessage)}</p>` : '<p class="__crossx-pin6-error" id="__crossx-pin6-error"></p>', i = e ? `<p class="__crossx-pin6-lock-msg" id="__crossx-pin6-lock-msg">
7667
- ${Cs}
7690
+ ${Ns}
7668
7691
  <span id="__crossx-pin6-lock-countdown"></span>
7669
7692
  </p>` : "", a = e ? " --locked" : "", c = Array.from(
7670
7693
  { length: 6 },
@@ -7727,7 +7750,7 @@ function ot(r, e, s, t, n, o) {
7727
7750
  var G;
7728
7751
  return (G = c()[0]) == null ? void 0 : G.focus();
7729
7752
  }, 50);
7730
- }, C = (P) => {
7753
+ }, N = (P) => {
7731
7754
  var A;
7732
7755
  b(!0), c().forEach((I) => {
7733
7756
  I.value = "";
@@ -7735,7 +7758,7 @@ function ot(r, e, s, t, n, o) {
7735
7758
  const S = u();
7736
7759
  if (S && (S.textContent = "Too many failed attempts. Please wait."), !h()) {
7737
7760
  const I = document.createElement("p");
7738
- I.className = "__crossx-pin6-lock-msg", I.id = "__crossx-pin6-lock-msg", I.innerHTML = `${Cs}<span id="__crossx-pin6-lock-countdown"></span>`;
7761
+ I.className = "__crossx-pin6-lock-msg", I.id = "__crossx-pin6-lock-msg", I.innerHTML = `${Ns}<span id="__crossx-pin6-lock-countdown"></span>`;
7739
7762
  const x = u();
7740
7763
  x ? x.insertAdjacentElement("afterend", I) : (A = f()) == null || A.appendChild(I);
7741
7764
  }
@@ -7762,7 +7785,7 @@ function ot(r, e, s, t, n, o) {
7762
7785
  try {
7763
7786
  if (n) {
7764
7787
  const S = await n(P);
7765
- S.ok ? e(P) : S.lockExpiresAt ? C(S.lockExpiresAt) : T(S.error ?? "Incorrect PIN. Please try again.");
7788
+ S.ok ? e(P) : S.lockExpiresAt ? N(S.lockExpiresAt) : T(S.error ?? "Incorrect PIN. Please try again.");
7766
7789
  } else
7767
7790
  e(P);
7768
7791
  } catch (S) {
@@ -7774,7 +7797,7 @@ function ot(r, e, s, t, n, o) {
7774
7797
  }
7775
7798
  }
7776
7799
  };
7777
- o && o > Date.now() ? C(o) : setTimeout(() => {
7800
+ o && o > Date.now() ? N(o) : setTimeout(() => {
7778
7801
  var P;
7779
7802
  return (P = c()[0]) == null ? void 0 : P.focus();
7780
7803
  }, 100);
@@ -7815,7 +7838,7 @@ function ot(r, e, s, t, n, o) {
7815
7838
  }), P.addEventListener("focus", () => P.select());
7816
7839
  });
7817
7840
  }
7818
- const Cs = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
7841
+ const Ns = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
7819
7842
  <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"/>
7820
7843
  </svg>`, Yn = `<svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
7821
7844
  <path d="M1 4.5L4 7.5L10 1" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -7890,8 +7913,8 @@ class Zn {
7890
7913
  (() => {
7891
7914
  i.querySelectorAll(".__crossx-wallet-item").forEach((y) => {
7892
7915
  y.addEventListener("click", () => {
7893
- const T = y.dataset.walletAddress ?? "", C = parseInt(y.dataset.walletIndex ?? "0", 10);
7894
- u({ address: T, index: C });
7916
+ const T = y.dataset.walletAddress ?? "", N = parseInt(y.dataset.walletIndex ?? "0", 10);
7917
+ u({ address: T, index: N });
7895
7918
  });
7896
7919
  });
7897
7920
  })();
@@ -7903,8 +7926,8 @@ class Zn {
7903
7926
  o.push(y);
7904
7927
  const T = i.querySelector("#__crossx-wallet-list");
7905
7928
  if (T) {
7906
- const C = document.createElement("button");
7907
- C.className = "__crossx-wallet-item", C.dataset.walletIndex = String(y.index), C.dataset.walletAddress = y.address, C.innerHTML = `<span class="__crossx-wallet-addr">${se(y.address)}</span>`, C.addEventListener("click", () => u(y)), T.appendChild(C), C.scrollIntoView({ behavior: "smooth", block: "nearest" });
7929
+ const N = document.createElement("button");
7930
+ N.className = "__crossx-wallet-item", N.dataset.walletIndex = String(y.index), N.dataset.walletAddress = y.address, N.innerHTML = `<span class="__crossx-wallet-addr">${se(y.address)}</span>`, N.addEventListener("click", () => u(y)), T.appendChild(N), N.scrollIntoView({ behavior: "smooth", block: "nearest" });
7908
7931
  }
7909
7932
  } catch {
7910
7933
  } finally {
@@ -8008,8 +8031,8 @@ class Zn {
8008
8031
  let l = !1;
8009
8032
  const u = () => {
8010
8033
  l || (l = !0, a.remove(), document.body.style.overflow = c);
8011
- }, h = (C) => {
8012
- u(), s(C);
8034
+ }, h = (N) => {
8035
+ u(), s(N);
8013
8036
  }, _ = () => {
8014
8037
  u(), s(null);
8015
8038
  }, f = a.querySelector(".__crossx-card"), w = {
@@ -8018,21 +8041,21 @@ class Zn {
8018
8041
  repeatingDigit: (t == null ? void 0 : t.pinValidation_repeatingDigit) ?? "Cannot use the same number 3+ times in a row.",
8019
8042
  sequential: (t == null ? void 0 : t.pinValidation_sequential) ?? "Sequential numbers (e.g., 123456) are not allowed.",
8020
8043
  alternatingPattern: (t == null ? void 0 : t.pinValidation_alternatingPattern) ?? "Repeating patterns (e.g., 121212) are not allowed."
8021
- }, b = (C) => {
8044
+ }, b = (N) => {
8022
8045
  var W;
8023
8046
  f.innerHTML = nt({
8024
8047
  title: i.title,
8025
8048
  headerSubtitle: i.headerSubtitle
8026
8049
  }), (W = f.querySelector("#__crossx-close-btn")) == null || W.addEventListener("click", _), ot(f, (B) => {
8027
- B === C ? h(C) : y(o.mismatchError);
8050
+ B === N ? h(N) : y(o.mismatchError);
8028
8051
  }, _);
8029
- }, y = (C) => {
8052
+ }, y = (N) => {
8030
8053
  var W;
8031
8054
  f.innerHTML = nt({
8032
8055
  title: o.title,
8033
8056
  headerSubtitle: o.headerSubtitle,
8034
8057
  subtitle: o.subtitle,
8035
- errorMessage: C
8058
+ errorMessage: N
8036
8059
  }), (W = f.querySelector("#__crossx-close-btn")) == null || W.addEventListener("click", _), ot(f, (B) => {
8037
8060
  const j = zn(B, w);
8038
8061
  j ? y(j) : b(B);
@@ -8040,10 +8063,10 @@ class Zn {
8040
8063
  };
8041
8064
  (() => {
8042
8065
  var G;
8043
- const C = Array.from(f.querySelectorAll(".__crossx-pw-notice-item")), W = f.querySelector("#__crossx-pin-notice-next"), B = /* @__PURE__ */ new Set();
8066
+ const N = Array.from(f.querySelectorAll(".__crossx-pw-notice-item")), W = f.querySelector("#__crossx-pin-notice-next"), B = /* @__PURE__ */ new Set();
8044
8067
  W.removeAttribute("disabled");
8045
8068
  const j = W.dataset.nextLabel ?? "Next", q = W.dataset.submitLabel ?? "I Understand", P = () => {
8046
- const O = B.size === C.length;
8069
+ const O = B.size === N.length;
8047
8070
  W.classList.toggle("--disabled", !O), W.textContent = O ? q : j;
8048
8071
  }, S = (O, A) => {
8049
8072
  if (B.has(A)) return;
@@ -8054,7 +8077,7 @@ class Zn {
8054
8077
  const I = O.querySelector(`#__crossx-notice-check-${A}`);
8055
8078
  B.delete(A), I.classList.remove("--checked"), O.setAttribute("aria-checked", "false"), P();
8056
8079
  };
8057
- C.forEach((O) => {
8080
+ N.forEach((O) => {
8058
8081
  const A = parseInt(O.dataset.checkIndex ?? "0", 10);
8059
8082
  O.addEventListener("click", () => {
8060
8083
  B.has(A) ? L(O, A) : S(O, A);
@@ -8062,11 +8085,11 @@ class Zn {
8062
8085
  (I.key === " " || I.key === "Enter") && (I.preventDefault(), B.has(A) ? L(O, A) : S(O, A));
8063
8086
  });
8064
8087
  }), W.addEventListener("click", () => {
8065
- if (B.size === C.length) {
8088
+ if (B.size === N.length) {
8066
8089
  y(e == null ? void 0 : e.errorMessage);
8067
8090
  return;
8068
8091
  }
8069
- const O = C.find((I) => {
8092
+ const O = N.find((I) => {
8070
8093
  const x = parseInt(I.dataset.checkIndex ?? "0", 10);
8071
8094
  return !B.has(x);
8072
8095
  });
@@ -8076,8 +8099,8 @@ class Zn {
8076
8099
  O.classList.remove("--highlight"), S(O, A);
8077
8100
  }, 400);
8078
8101
  }), (G = f.querySelector("#__crossx-close-btn")) == null || G.addEventListener("click", _);
8079
- })(), a.addEventListener("click", (C) => {
8080
- C.target === a && _();
8102
+ })(), a.addEventListener("click", (N) => {
8103
+ N.target === a && _();
8081
8104
  });
8082
8105
  });
8083
8106
  }
@@ -8168,7 +8191,7 @@ class Zn {
8168
8191
  return new Promise((s) => {
8169
8192
  var a, c;
8170
8193
  he();
8171
- const t = Nn(e, this.tokens);
8194
+ const t = Cn(e, this.tokens);
8172
8195
  pe(t);
8173
8196
  const n = () => t.remove(), o = () => {
8174
8197
  n(), s();
@@ -8197,7 +8220,7 @@ class Zn {
8197
8220
  showTransactionProgress(e, s) {
8198
8221
  return new Promise((t) => {
8199
8222
  he();
8200
- const n = Cn(e, this.tokens);
8223
+ const n = Nn(e, this.tokens);
8201
8224
  pe(n);
8202
8225
  const o = () => n.remove();
8203
8226
  let i = !1;
@@ -8289,13 +8312,13 @@ function ao(r, e) {
8289
8312
  }, n = {
8290
8313
  gatewayUrl: s.walletGatewayUrl,
8291
8314
  projectId: r.projectId
8292
- }, o = t.authMode !== "cookie" && Nt.isAvailable();
8315
+ }, o = t.authMode !== "cookie" && Ct.isAvailable();
8293
8316
  !o && t.authMode !== "cookie" && d.warn(
8294
8317
  "[CROSSx] IndexedDB 사용 불가 — LocalStorage fallback 사용 중.",
8295
8318
  "refresh_token이 평문 저장되지 않도록 세션 영속성이 제한됩니다.",
8296
8319
  "IndexedDB를 지원하는 브라우저 사용을 권장합니다."
8297
8320
  ), t.secureStorageAvailable = o;
8298
- const i = o ? new Nt(r.projectId) : new nr(), a = new pn(), c = new gn(), l = new Ee(), u = new Qn(), h = new es();
8321
+ const i = o ? new Ct(r.projectId) : new nr(), a = new pn(), c = new gn(), l = new Ee(), u = new Qn(), h = new es();
8299
8322
  let _;
8300
8323
  r.useMockWallet ? (d.log("[CROSSx] Mock Wallet Provider 사용"), _ = new wn(i, h)) : (d.log("[CROSSx] Remote Wallet Provider 사용"), _ = new Le(
8301
8324
  n,