@rhinestone/deposit-modal 0.13.0 → 0.14.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.
Files changed (57) hide show
  1. package/README.md +47 -12
  2. package/bridge-transcript.json +653 -0
  3. package/dist/ClaimModal-GDFENSLV.mjs +13 -0
  4. package/dist/ClaimModal-L3FUBI5U.cjs +13 -0
  5. package/dist/{DepositModalReown-3H75G3XQ.mjs → DepositModalReown-2EVV64OA.mjs} +30 -27
  6. package/dist/{DepositModalReown-YNNHLAV2.cjs → DepositModalReown-GAD45GIC.cjs} +77 -74
  7. package/dist/WithdrawModal-FAQH35NG.cjs +12 -0
  8. package/dist/WithdrawModal-IKUHF5CF.mjs +12 -0
  9. package/dist/{chunk-RAADLTSW.cjs → chunk-4J5ADVIN.cjs} +184 -139
  10. package/dist/{chunk-DSIZNRWA.mjs → chunk-5Q5CSVKF.mjs} +1049 -388
  11. package/dist/{chunk-HOGZKHHY.cjs → chunk-62UCV2LG.cjs} +3 -3
  12. package/dist/{chunk-CVGNCUVU.cjs → chunk-7AZFT2MV.cjs} +22 -13
  13. package/dist/{chunk-7N77GIP4.cjs → chunk-A6JPBMYY.cjs} +465 -171
  14. package/dist/{chunk-GACIGCSN.cjs → chunk-AQVJUXSG.cjs} +1 -1
  15. package/dist/{chunk-LTMMETAB.mjs → chunk-GZ4GQ5MC.mjs} +404 -110
  16. package/dist/{chunk-ZMT4ATHR.cjs → chunk-HAQOFI3D.cjs} +594 -41
  17. package/dist/{chunk-FZ5FZFIG.mjs → chunk-LMG46EP2.mjs} +1 -1
  18. package/dist/{chunk-2G2EIN4A.cjs → chunk-NQMC5VKQ.cjs} +1343 -682
  19. package/dist/{chunk-OLCD75JK.mjs → chunk-QACOOLOE.mjs} +451 -131
  20. package/dist/{chunk-XYJFEN5D.mjs → chunk-R5UQ3TN4.mjs} +1 -1
  21. package/dist/{chunk-EOMT5LKX.mjs → chunk-UX35GYLM.mjs} +556 -3
  22. package/dist/{chunk-YREVFB64.mjs → chunk-VALXN5IO.mjs} +16 -7
  23. package/dist/{chunk-COCBCQQC.mjs → chunk-XCTRKCNM.mjs} +51 -6
  24. package/dist/{chunk-5NUIKYSF.cjs → chunk-YP7QVKQ6.cjs} +458 -138
  25. package/dist/claim.cjs +6 -6
  26. package/dist/claim.d.cts +3 -3
  27. package/dist/claim.d.ts +3 -3
  28. package/dist/claim.mjs +5 -5
  29. package/dist/constants.cjs +2 -2
  30. package/dist/constants.d.cts +1 -1
  31. package/dist/constants.d.ts +1 -1
  32. package/dist/constants.mjs +1 -1
  33. package/dist/deposit.cjs +6 -6
  34. package/dist/deposit.d.cts +2 -2
  35. package/dist/deposit.d.ts +2 -2
  36. package/dist/deposit.mjs +5 -5
  37. package/dist/embed.cjs +310 -102
  38. package/dist/embed.d.cts +7 -1
  39. package/dist/embed.d.ts +7 -1
  40. package/dist/embed.mjs +285 -77
  41. package/dist/index.cjs +9 -9
  42. package/dist/index.d.cts +1 -1
  43. package/dist/index.d.ts +1 -1
  44. package/dist/index.mjs +8 -8
  45. package/dist/types-Bho4OA03.d.ts +982 -0
  46. package/dist/types-DP_3KwlD.d.cts +982 -0
  47. package/dist/withdraw.cjs +5 -5
  48. package/dist/withdraw.d.cts +3 -3
  49. package/dist/withdraw.d.ts +3 -3
  50. package/dist/withdraw.mjs +4 -4
  51. package/package.json +29 -7
  52. package/dist/ClaimModal-CREZO27I.mjs +0 -11
  53. package/dist/ClaimModal-JRIA32U2.cjs +0 -11
  54. package/dist/WithdrawModal-NVRX44IZ.mjs +0 -10
  55. package/dist/WithdrawModal-YYSBPCJJ.cjs +0 -10
  56. package/dist/types-B89I8_8H.d.ts +0 -638
  57. package/dist/types-nnDR4tqA.d.cts +0 -638
@@ -18,11 +18,11 @@
18
18
 
19
19
 
20
20
 
21
- var _chunkRAADLTSWcjs = require('./chunk-RAADLTSW.cjs');
22
21
 
22
+ var _chunk4J5ADVINcjs = require('./chunk-4J5ADVIN.cjs');
23
23
 
24
- var _chunkHOGZKHHYcjs = require('./chunk-HOGZKHHY.cjs');
25
24
 
25
+ var _chunk62UCV2LGcjs = require('./chunk-62UCV2LG.cjs');
26
26
 
27
27
 
28
28
 
@@ -85,7 +85,10 @@ var _chunkHOGZKHHYcjs = require('./chunk-HOGZKHHY.cjs');
85
85
 
86
86
 
87
87
 
88
- var _chunkZMT4ATHRcjs = require('./chunk-ZMT4ATHR.cjs');
88
+
89
+
90
+
91
+ var _chunkHAQOFI3Dcjs = require('./chunk-HAQOFI3D.cjs');
89
92
 
90
93
 
91
94
 
@@ -123,11 +126,41 @@ var _chunkDW2EQA2Ucjs = require('./chunk-DW2EQA2U.cjs');
123
126
 
124
127
 
125
128
 
129
+
130
+
126
131
 
127
132
 
128
133
 
129
134
  var _chunk4KCSH4T3cjs = require('./chunk-4KCSH4T3.cjs');
130
135
 
136
+ // src/core/reown-dependencies.ts
137
+ var dependencies;
138
+ var dependenciesPromise;
139
+ function loadReownDependencies() {
140
+ _nullishCoalesce(dependenciesPromise, () => ( (dependenciesPromise = Promise.all([
141
+ Promise.resolve().then(() => _interopRequireWildcard(require("@reown/appkit/react"))),
142
+ Promise.resolve().then(() => _interopRequireWildcard(require("@reown/appkit/networks"))),
143
+ Promise.resolve().then(() => _interopRequireWildcard(require("@reown/appkit-adapter-wagmi"))),
144
+ Promise.resolve().then(() => _interopRequireWildcard(require("@reown/appkit-adapter-solana"))),
145
+ Promise.resolve().then(() => _interopRequireWildcard(require("@reown/appkit-adapter-solana/react")))
146
+ ]).then((modules) => dependencies = modules).catch((cause) => {
147
+ const error = new Error(
148
+ "[rhinestone] reownAppId requires @reown/appkit, @reown/appkit-adapter-wagmi, @reown/appkit-adapter-solana, @solana/web3.js, and @solana/spl-token."
149
+ );
150
+ error.cause = cause;
151
+ throw error;
152
+ }))));
153
+ return dependenciesPromise;
154
+ }
155
+ function getReownDependencies() {
156
+ if (!dependencies) {
157
+ throw new Error(
158
+ "[rhinestone] Reown dependencies were accessed before initialization."
159
+ );
160
+ }
161
+ return dependencies;
162
+ }
163
+
131
164
  // src/DepositModal.tsx
132
165
 
133
166
 
@@ -217,11 +250,11 @@ SegmentedToggle.displayName = "SegmentedToggle";
217
250
 
218
251
  function ChainIcon({ chainId, className, loading }) {
219
252
  const badge = _chunk4KCSH4T3cjs.getChainBadge.call(void 0, chainId);
220
- const catalogChain = _chunkZMT4ATHRcjs.useCatalogChain.call(void 0, _chunkZMT4ATHRcjs.catalogKeyForChain.call(void 0, chainId));
253
+ const catalogChain = _chunkHAQOFI3Dcjs.useCatalogChain.call(void 0, _chunkHAQOFI3Dcjs.catalogKeyForChain.call(void 0, chainId));
221
254
  const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _2 => _2.name]), () => ( _chunk4KCSH4T3cjs.getChainName.call(void 0, chainId)));
222
255
  const initial = (_nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _3 => _3.name]), () => ( badge.shortLabel))).charAt(0);
223
256
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
224
- _chunkZMT4ATHRcjs.CdnIcon,
257
+ _chunkHAQOFI3Dcjs.CdnIcon,
225
258
  {
226
259
  src: _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _4 => _4.iconUrl]), () => ( _chunk4KCSH4T3cjs.getChainIcon.call(void 0, chainId))),
227
260
  alt: name,
@@ -244,7 +277,7 @@ ChainIcon.displayName = "ChainIcon";
244
277
  // src/components/ui/WalletBadgeIcons/index.tsx
245
278
 
246
279
  function BadgeImage({ src, alt = "" }) {
247
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CdnIcon, { src, alt }) });
280
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src, alt }) });
248
281
  }
249
282
  var WALLET_BADGES = ["rabby", "phantom", "walletconnect"];
250
283
  function WalletBadgeIcons() {
@@ -297,7 +330,7 @@ var DAPP_IMPORT_CATALOG = [
297
330
  // src/components/ui/BrandIcons.tsx
298
331
 
299
332
  function ExchangeBadgeImage({ name }) {
300
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CdnIcon, { src: _nullishCoalesce(_chunkRAADLTSWcjs.getExchangeLogoSrc.call(void 0, name), () => ( void 0)) });
333
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: _nullishCoalesce(_chunk4J5ADVINcjs.getExchangeLogoSrc.call(void 0, name), () => ( void 0)) });
301
334
  }
302
335
  var CARD_NETWORKS = ["amex", "visa", "mastercard"];
303
336
  function CardNetworkIcons() {
@@ -305,7 +338,7 @@ function CardNetworkIcons() {
305
338
  "span",
306
339
  {
307
340
  className: `rs-card-network rs-card-network--${network}`,
308
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CdnIcon, { src: _chunk4KCSH4T3cjs.cdnIconUrl.call(void 0, "cards", network) })
341
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: _chunk4KCSH4T3cjs.cdnIconUrl.call(void 0, "cards", network) })
309
342
  },
310
343
  network
311
344
  )) });
@@ -324,7 +357,7 @@ function DappBadgeIcons() {
324
357
  ).filter(
325
358
  (brand) => Boolean(brand)
326
359
  );
327
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons rs-list-row-meta-icons--exchanges", children: marks.map((brand) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CdnIcon, { src: brand.iconUrl, alt: brand.label }) }, brand.id)) });
360
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons rs-list-row-meta-icons--exchanges", children: marks.map((brand) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: brand.iconUrl, alt: brand.label }) }, brand.id)) });
328
361
  }
329
362
  DappBadgeIcons.displayName = "DappBadgeIcons";
330
363
  var DAPP_BADGE_COUNT = DAPP_BADGE_ORDER.length;
@@ -344,9 +377,9 @@ function balanceSubtitle(status, balanceUsd, fallback) {
344
377
  return "No balance";
345
378
  }
346
379
  function fiatIcon(name) {
347
- if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.AppleIcon, {});
348
- if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.BankIcon, {});
349
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CardIcon, {});
380
+ if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.AppleIcon, {});
381
+ if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.BankIcon, {});
382
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CardIcon, {});
350
383
  }
351
384
  function FiatMethodIcon({ option }) {
352
385
  const [remoteFailed, setRemoteFailed] = _react.useState.call(void 0, false);
@@ -429,20 +462,20 @@ function renderWalletLeading(row) {
429
462
  }
430
463
  );
431
464
  }
432
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.WalletIcon, {});
465
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.WalletIcon, {});
433
466
  }
434
- var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.TransferCryptoIcon, {});
435
- var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.WalletIcon, {});
436
- var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.UnplugIcon, {});
437
- var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.MigrateAssetsIcon, {});
438
- var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Spinner, { className: "rs-spinner--sm" });
467
+ var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TransferCryptoIcon, {});
468
+ var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.WalletIcon, {});
469
+ var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.UnplugIcon, {});
470
+ var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.MigrateAssetsIcon, {});
471
+ var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Spinner, { className: "rs-spinner--sm" });
439
472
  var CONNECT_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
440
473
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletBadgeIcons, {}),
441
474
  "+100"
442
475
  ] });
443
476
  var EXTRA_EXCHANGE_COUNT = Math.max(
444
477
  0,
445
- _chunkZMT4ATHRcjs.SUPPORTED_CONNECT_EXCHANGE_COUNT - EXCHANGE_BADGE_COUNT
478
+ _chunkHAQOFI3Dcjs.SUPPORTED_CONNECT_EXCHANGE_COUNT - EXCHANGE_BADGE_COUNT
446
479
  );
447
480
  var EXCHANGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
448
481
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeIcons, {}),
@@ -500,7 +533,7 @@ function ConnectStep({
500
533
  if (onSelectTransferCrypto) {
501
534
  cryptoRows.push(
502
535
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
503
- _chunkHOGZKHHYcjs.ListRow,
536
+ _chunk62UCV2LGcjs.ListRow,
504
537
  {
505
538
  leading: TRANSFER_CRYPTO_LEADING,
506
539
  title: "Transfer crypto",
@@ -521,7 +554,7 @@ function ConnectStep({
521
554
  );
522
555
  cryptoRows.push(
523
556
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
524
- _chunkHOGZKHHYcjs.ListRow,
557
+ _chunk62UCV2LGcjs.ListRow,
525
558
  {
526
559
  leading: renderWalletLeading(row),
527
560
  title: collapseToExternal ? "External wallet" : row.label,
@@ -538,7 +571,7 @@ function ConnectStep({
538
571
  if (!hasSessionWallet && handleConnect) {
539
572
  cryptoRows.push(
540
573
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
541
- _chunkHOGZKHHYcjs.ListRow,
574
+ _chunk62UCV2LGcjs.ListRow,
542
575
  {
543
576
  leading: WALLET_LEADING,
544
577
  title: "Connect wallet",
@@ -553,7 +586,7 @@ function ConnectStep({
553
586
  if (onSelectFundFromExchange) {
554
587
  cryptoRows.push(
555
588
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
556
- _chunkHOGZKHHYcjs.ListRow,
589
+ _chunk62UCV2LGcjs.ListRow,
557
590
  {
558
591
  leading: EXCHANGE_LEADING,
559
592
  title: "Connect exchange",
@@ -568,7 +601,7 @@ function ConnectStep({
568
601
  if (onSelectMigrateAssets) {
569
602
  cryptoRows.push(
570
603
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
571
- _chunkHOGZKHHYcjs.ListRow,
604
+ _chunk62UCV2LGcjs.ListRow,
572
605
  {
573
606
  leading: MIGRATE_ASSETS_LEADING,
574
607
  title: "Migrate assets",
@@ -589,7 +622,7 @@ function ConnectStep({
589
622
  for (const opt of fiatPaymentMethods) {
590
623
  cashRows.push(
591
624
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
592
- _chunkHOGZKHHYcjs.ListRow,
625
+ _chunk62UCV2LGcjs.ListRow,
593
626
  {
594
627
  leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FiatMethodIcon, { option: opt }),
595
628
  title: opt.label,
@@ -604,7 +637,7 @@ function ConnectStep({
604
637
  } else if (fiatLoading) {
605
638
  cashRows.push(
606
639
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
607
- _chunkHOGZKHHYcjs.ListRow,
640
+ _chunk62UCV2LGcjs.ListRow,
608
641
  {
609
642
  leading: SMALL_SPINNER,
610
643
  title: "Loading payment options\u2026",
@@ -633,9 +666,9 @@ function ConnectStep({
633
666
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
634
667
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
635
668
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
636
- _chunkZMT4ATHRcjs.BodyHeader,
669
+ _chunkHAQOFI3Dcjs.BodyHeader,
637
670
  {
638
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.HandCoinsIcon, {}),
671
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.HandCoinsIcon, {}),
639
672
  title,
640
673
  subtitle: _nullishCoalesce(subtitle, () => ( defaultSubtitle)),
641
674
  aside: showToggle ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -671,7 +704,7 @@ function ConnectStep({
671
704
  children: "Disconnect wallet"
672
705
  }
673
706
  ) }),
674
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
707
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
675
708
  ] });
676
709
  }
677
710
  ConnectStep.displayName = "ConnectStep";
@@ -694,17 +727,17 @@ function AssetSelectStep({
694
727
  const [selectedAssetId, setSelectedAssetId] = _react.useState.call(void 0, null);
695
728
  const [loading, setLoading] = _react.useState.call(void 0, true);
696
729
  const [error, setError] = _react.useState.call(void 0, null);
697
- const isDepositChain = _chunkZMT4ATHRcjs.useIsDepositChain.call(void 0, );
698
- const { catalog } = _chunkZMT4ATHRcjs.useChainCatalog.call(void 0, );
699
- const chainName = _chunkZMT4ATHRcjs.useChainName.call(void 0, );
730
+ const isDepositChain = _chunkHAQOFI3Dcjs.useIsDepositChain.call(void 0, );
731
+ const { catalog } = _chunkHAQOFI3Dcjs.useChainCatalog.call(void 0, );
732
+ const chainName = _chunkHAQOFI3Dcjs.useChainName.call(void 0, );
700
733
  const defaultAssetId = _react.useMemo.call(void 0, () => {
701
734
  if (!defaultSourceChain || !defaultSourceToken) return null;
702
- return _chunkZMT4ATHRcjs.getAssetId.call(void 0, {
735
+ return _chunkHAQOFI3Dcjs.getAssetId.call(void 0, {
703
736
  chainId: defaultSourceChain,
704
737
  token: defaultSourceToken
705
738
  });
706
739
  }, [defaultSourceChain, defaultSourceToken]);
707
- const onTotalBalanceComputedRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
740
+ const onTotalBalanceComputedRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
708
741
  _react.useEffect.call(void 0, () => {
709
742
  let active = true;
710
743
  function emitAssetsUpdate(currentAssets) {
@@ -724,7 +757,7 @@ function AssetSelectStep({
724
757
  try {
725
758
  const portfolio = await service.fetchPortfolio(address);
726
759
  if (!active) return;
727
- const portfolioAssets = _chunkZMT4ATHRcjs.portfolioToAssets.call(void 0, portfolio.tokens);
760
+ const portfolioAssets = _chunkHAQOFI3Dcjs.portfolioToAssets.call(void 0, portfolio.tokens);
728
761
  setAssets(portfolioAssets);
729
762
  emitAssetsUpdate(portfolioAssets);
730
763
  const hasNative = portfolioAssets.some(
@@ -803,7 +836,7 @@ function AssetSelectStep({
803
836
  const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
804
837
  const numeric = Number(raw);
805
838
  if (!Number.isFinite(numeric)) return raw;
806
- return _chunkZMT4ATHRcjs.tokenFormatter.format(numeric);
839
+ return _chunkHAQOFI3Dcjs.tokenFormatter.format(numeric);
807
840
  } catch (e3) {
808
841
  return asset.balance;
809
842
  }
@@ -811,20 +844,20 @@ function AssetSelectStep({
811
844
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
812
845
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
813
846
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
814
- _chunkZMT4ATHRcjs.BodyHeader,
847
+ _chunkHAQOFI3Dcjs.BodyHeader,
815
848
  {
816
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.WalletIcon, {}),
849
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.WalletIcon, {}),
817
850
  title: "Your assets",
818
851
  subtitle: "Select source assets to transfer"
819
852
  }
820
853
  ),
821
854
  loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
822
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Spinner, { className: "rs-text-tertiary" }),
855
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Spinner, { className: "rs-text-tertiary" }),
823
856
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
824
857
  ] }),
825
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Callout, { variant: "error", children: error }),
858
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: error }),
826
859
  !loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
827
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.WalletIcon, { className: "rs-empty-icon" }),
860
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.WalletIcon, { className: "rs-empty-icon" }),
828
861
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
829
862
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
830
863
  address.slice(0, 6),
@@ -857,13 +890,13 @@ function AssetSelectStep({
857
890
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
858
891
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
859
892
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
860
- _chunkZMT4ATHRcjs.TokenIcon,
893
+ _chunkHAQOFI3Dcjs.TokenIcon,
861
894
  {
862
895
  symbol: asset.symbol,
863
896
  fallback: asset.symbol.slice(0, 4)
864
897
  }
865
898
  ) }),
866
- chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CdnIcon, { src: chainIcon, alt: chainName(asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
899
+ chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: chainIcon, alt: chainName(asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
867
900
  "span",
868
901
  {
869
902
  className: "rs-asset-chain-badge",
@@ -890,14 +923,14 @@ function AssetSelectStep({
890
923
  ] })
891
924
  ] })
892
925
  ] }),
893
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkZMT4ATHRcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
926
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkHAQOFI3Dcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
894
927
  ]
895
928
  },
896
929
  asset.id
897
930
  );
898
931
  }) }),
899
932
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
900
- _chunkZMT4ATHRcjs.Button,
933
+ _chunkHAQOFI3Dcjs.Button,
901
934
  {
902
935
  onClick: () => selectedAsset && onContinue(selectedAsset),
903
936
  disabled: !selectedAsset,
@@ -906,7 +939,7 @@ function AssetSelectStep({
906
939
  }
907
940
  )
908
941
  ] }),
909
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
942
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
910
943
  ] });
911
944
  }
912
945
  async function fetchNativeAssets(address, publicClient, existing, isDepositChain, catalogChain) {
@@ -914,7 +947,7 @@ async function fetchNativeAssets(address, publicClient, existing, isDepositChain
914
947
  const connectedChainId = _optionalChain([publicClient, 'access', _16 => _16.chain, 'optionalAccess', _17 => _17.id]);
915
948
  if (!connectedChainId) return [];
916
949
  if (!isDepositChain(connectedChainId)) return [];
917
- const id = _chunkZMT4ATHRcjs.getAssetId.call(void 0, {
950
+ const id = _chunkHAQOFI3Dcjs.getAssetId.call(void 0, {
918
951
  chainId: connectedChainId,
919
952
  token: _chunk4KCSH4T3cjs.NATIVE_TOKEN_ADDRESS
920
953
  });
@@ -1120,7 +1153,7 @@ function AmountStep({
1120
1153
  const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
1121
1154
  if (!balanceTarget || !publicClient) return;
1122
1155
  try {
1123
- const bal = _chunkZMT4ATHRcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
1156
+ const bal = _chunkHAQOFI3Dcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
1124
1157
  address: asset.token,
1125
1158
  abi: _viem.erc20Abi,
1126
1159
  functionName: "balanceOf",
@@ -1141,7 +1174,7 @@ function AmountStep({
1141
1174
  hasAttemptedSwitch.current = true;
1142
1175
  switchChain(asset.chainId).catch((err) => {
1143
1176
  const raw = err instanceof Error ? err.message : "Failed to switch chain";
1144
- setError(_chunkZMT4ATHRcjs.formatUserError.call(void 0, raw));
1177
+ setError(_chunkHAQOFI3Dcjs.formatUserError.call(void 0, raw));
1145
1178
  });
1146
1179
  }
1147
1180
  }, [chainMismatch, switchChain, asset.chainId]);
@@ -1194,7 +1227,7 @@ function AmountStep({
1194
1227
  const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
1195
1228
  const numeric = Number(raw);
1196
1229
  if (!Number.isFinite(numeric)) return raw;
1197
- return _chunkZMT4ATHRcjs.tokenFormatter.format(numeric);
1230
+ return _chunkHAQOFI3Dcjs.tokenFormatter.format(numeric);
1198
1231
  } catch (e8) {
1199
1232
  return "\u2026";
1200
1233
  }
@@ -1282,12 +1315,12 @@ function AmountStep({
1282
1315
  const needsPricing = !knowsBalance && !isSourceStablecoin;
1283
1316
  const blockedOnPricing = needsPricing && !hasPricing;
1284
1317
  const continueDisabled = chainMismatch || exceedsBalance || blockedOnPricing || numericAmount === 0 && !isBelowMin || knowsBalance && balance === null;
1285
- const chainName = _chunkZMT4ATHRcjs.useChainName.call(void 0, );
1318
+ const chainName = _chunkHAQOFI3Dcjs.useChainName.call(void 0, );
1286
1319
  const sourceChainName = chainName(asset.chainId);
1287
1320
  const targetChainName = chainName(targetChainId);
1288
1321
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
1289
1322
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
1290
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.WalletIcon, {}), title }),
1323
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.WalletIcon, {}), title }),
1291
1324
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
1292
1325
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
1293
1326
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -1307,13 +1340,13 @@ function AmountStep({
1307
1340
  " available",
1308
1341
  balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1309
1342
  " (~",
1310
- _chunkZMT4ATHRcjs.currencyFormatter.format(balanceUsd),
1343
+ _chunkHAQOFI3Dcjs.currencyFormatter.format(balanceUsd),
1311
1344
  ")"
1312
1345
  ] })
1313
1346
  ] }),
1314
1347
  minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
1315
1348
  "Min. deposit ",
1316
- _chunkZMT4ATHRcjs.currencyFormatter.format(minDepositUsd)
1349
+ _chunkHAQOFI3Dcjs.currencyFormatter.format(minDepositUsd)
1317
1350
  ] })
1318
1351
  ] })
1319
1352
  ] }),
@@ -1338,7 +1371,7 @@ function AmountStep({
1338
1371
  " ",
1339
1372
  asset.symbol
1340
1373
  ] }),
1341
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.TokenIcon, { symbol: asset.symbol }) })
1374
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TokenIcon, { symbol: asset.symbol }) })
1342
1375
  ] })
1343
1376
  ] }),
1344
1377
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
@@ -1349,21 +1382,21 @@ function AmountStep({
1349
1382
  " ",
1350
1383
  targetSymbol
1351
1384
  ] }),
1352
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.TokenIcon, { symbol: targetSymbol }) })
1385
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TokenIcon, { symbol: targetSymbol }) })
1353
1386
  ] })
1354
1387
  ] }),
1355
1388
  balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
1356
1389
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
1357
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkZMT4ATHRcjs.currencyFormatter.format(balanceAfterUsd) })
1390
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkHAQOFI3Dcjs.currencyFormatter.format(balanceAfterUsd) })
1358
1391
  ] })
1359
1392
  ] }),
1360
- blockedOnPricing && sourcePriceUnavailable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZMT4ATHRcjs.Callout, { variant: "error", children: [
1393
+ blockedOnPricing && sourcePriceUnavailable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: [
1361
1394
  asset.symbol,
1362
1395
  " can't be priced right now, so this deposit can't be estimated. You can still send any amount to the deposit address."
1363
1396
  ] }),
1364
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Callout, { variant: "error", children: error }),
1397
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: error }),
1365
1398
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1366
- _chunkZMT4ATHRcjs.Button,
1399
+ _chunkHAQOFI3Dcjs.Button,
1367
1400
  {
1368
1401
  onClick: handleContinue,
1369
1402
  fullWidth: true,
@@ -1372,7 +1405,7 @@ function AmountStep({
1372
1405
  }
1373
1406
  )
1374
1407
  ] }),
1375
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
1408
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
1376
1409
  ] });
1377
1410
  }
1378
1411
 
@@ -1399,14 +1432,14 @@ function ReviewDetails({
1399
1432
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
1400
1433
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
1401
1434
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
1402
- sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CdnIcon, { src: sourceChainIcon }) })
1435
+ sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: sourceChainIcon }) })
1403
1436
  ] })
1404
1437
  ] }),
1405
1438
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
1406
1439
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
1407
1440
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
1408
1441
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
1409
- targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CdnIcon, { src: targetChainIcon }) })
1442
+ targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: targetChainIcon }) })
1410
1443
  ] })
1411
1444
  ] }),
1412
1445
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
@@ -1421,21 +1454,21 @@ function ReviewDetails({
1421
1454
  " ",
1422
1455
  sendSymbol
1423
1456
  ] }),
1424
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.TokenIcon, { symbol: sendSymbol }) })
1457
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TokenIcon, { symbol: sendSymbol }) })
1425
1458
  ] })
1426
1459
  ] }),
1427
1460
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
1428
1461
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
1429
1462
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
1430
1463
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
1431
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.TokenIcon, { symbol: receiveSymbol }) })
1464
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TokenIcon, { symbol: receiveSymbol }) })
1432
1465
  ] })
1433
1466
  ] }),
1434
1467
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
1435
1468
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
1436
1469
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
1437
1470
  fee.display === null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-skeleton rs-skeleton-fee", "aria-hidden": "true" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: fee.struck ? { textDecoration: "line-through" } : void 0, children: fee.display }),
1438
- fee.tooltip !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRAADLTSWcjs.Tooltip, { content: fee.tooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.InfoIcon, {}) }) })
1471
+ fee.tooltip !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4J5ADVINcjs.Tooltip, { content: fee.tooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.InfoIcon, {}) }) })
1439
1472
  ] })
1440
1473
  ] })
1441
1474
  ] });
@@ -1653,17 +1686,17 @@ function ConfirmStep({
1653
1686
  const targetChainName = _chunk4KCSH4T3cjs.getChainName.call(void 0, targetChainId);
1654
1687
  const sourceChainIcon = _chunk4KCSH4T3cjs.getChainIcon.call(void 0, asset.chainId);
1655
1688
  const targetChainIcon = _chunk4KCSH4T3cjs.getChainIcon.call(void 0, targetChainId);
1656
- const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkZMT4ATHRcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
1657
- const mustHaveQuote = !appFeesResolved || _chunkZMT4ATHRcjs.resolveAppFeeBps.call(void 0,
1689
+ const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkHAQOFI3Dcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
1690
+ const mustHaveQuote = !appFeesResolved || _chunkHAQOFI3Dcjs.resolveAppFeeBps.call(void 0,
1658
1691
  appFees,
1659
1692
  `eip155:${quoteSource.chainId}`,
1660
1693
  quoteSource.token
1661
1694
  ) > 0;
1662
- const { display: feeDisplay, struck: feesFullySponsored } = _chunkZMT4ATHRcjs.quoteFeeRow.call(void 0,
1695
+ const { display: feeDisplay, struck: feesFullySponsored } = _chunkHAQOFI3Dcjs.quoteFeeRow.call(void 0,
1663
1696
  _optionalChain([quote, 'optionalAccess', _67 => _67.fees])
1664
1697
  );
1665
1698
  const directTransfer = sameRoute && !mustHaveQuote && !executeTransfer;
1666
- const permitEligible = enableGaslessDeposit && !_chunkZMT4ATHRcjs.isNativeAsset.call(void 0, asset) && !isDappImportAsset(asset) && !executeTransfer && !directTransfer && asset.chainId !== _chunk4KCSH4T3cjs.HYPERCORE_CHAIN_ID;
1699
+ const permitEligible = enableGaslessDeposit && !_chunkHAQOFI3Dcjs.isNativeAsset.call(void 0, asset) && !isDappImportAsset(asset) && !executeTransfer && !directTransfer && asset.chainId !== _chunk4KCSH4T3cjs.HYPERCORE_CHAIN_ID;
1667
1700
  const permitRequestKey = JSON.stringify([
1668
1701
  smartAccount.toLowerCase(),
1669
1702
  asset.chainId,
@@ -1676,21 +1709,21 @@ function ConfirmStep({
1676
1709
  const receiveDisplay = (() => {
1677
1710
  if (directTransfer) return `${formattedSendAmount} ${asset.symbol}`;
1678
1711
  if (quote) {
1679
- const quoted = _chunkZMT4ATHRcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
1712
+ const quoted = _chunkHAQOFI3Dcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
1680
1713
  if (quoted !== void 0) return quoted;
1681
1714
  }
1682
1715
  const usdValue = Number(targetAmount);
1683
1716
  const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
1684
- const estimate = _chunkZMT4ATHRcjs.formatReceiveEstimate.call(void 0, {
1717
+ const estimate = _chunkHAQOFI3Dcjs.formatReceiveEstimate.call(void 0, {
1685
1718
  sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
1686
1719
  sourceSymbol: asset.symbol,
1687
1720
  targetSymbol,
1688
1721
  sourceAmountUsd,
1689
- sourceTrusted: _chunkZMT4ATHRcjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
1722
+ sourceTrusted: _chunkHAQOFI3Dcjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
1690
1723
  // The target is the curated deposit destination, so a stablecoin target
1691
1724
  // estimates at $1 when unquoted (DepositFlow skips fetching stablecoin
1692
1725
  // target prices). Not applied to the source — that can be a held token.
1693
- prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkZMT4ATHRcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
1726
+ prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkHAQOFI3Dcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
1694
1727
  });
1695
1728
  if (estimate !== void 0) return estimate;
1696
1729
  return targetSymbol;
@@ -1701,7 +1734,7 @@ function ConfirmStep({
1701
1734
  hasAttemptedSwitch.current = true;
1702
1735
  switchChain(asset.chainId).catch((err) => {
1703
1736
  const raw = err instanceof Error ? err.message : "Failed to switch chain";
1704
- setError(_chunkZMT4ATHRcjs.formatUserError.call(void 0, raw));
1737
+ setError(_chunkHAQOFI3Dcjs.formatUserError.call(void 0, raw));
1705
1738
  });
1706
1739
  }
1707
1740
  }, [chainMismatch, switchChain, asset.chainId]);
@@ -1882,14 +1915,15 @@ function ConfirmStep({
1882
1915
  targetChain,
1883
1916
  targetToken,
1884
1917
  directTransfer: false,
1885
- sourceTxHashPending: true
1918
+ sourceTxHashPending: true,
1919
+ depositId: submitted.depositId
1886
1920
  }
1887
1921
  );
1888
1922
  } catch (err) {
1889
1923
  const raw = err instanceof Error ? err.message : "Signing failed";
1890
- const safeToTransfer = !submitStarted || err instanceof _chunkZMT4ATHRcjs.PermitDepositSubmitError && err.safeToTransfer;
1924
+ const safeToTransfer = !submitStarted || err instanceof _chunkHAQOFI3Dcjs.PermitDepositSubmitError && err.safeToTransfer;
1891
1925
  if (safeToTransfer) setPermitDisabled(true);
1892
- const message = safeToTransfer ? _chunkZMT4ATHRcjs.formatUserError.call(void 0, raw) : "Deposit submission status is uncertain. Check your activity before trying a transfer.";
1926
+ const message = safeToTransfer ? _chunkHAQOFI3Dcjs.formatUserError.call(void 0, raw) : "Deposit submission status is uncertain. Check your activity before trying a transfer.";
1893
1927
  setError(message);
1894
1928
  _optionalChain([onError, 'optionalCall', _69 => _69(message, "PERMIT_ERROR", raw)]);
1895
1929
  } finally {
@@ -1910,7 +1944,7 @@ function ConfirmStep({
1910
1944
  const result = await executeTransfer(amountUnits);
1911
1945
  hash = result.txHash;
1912
1946
  resolvedSourceToken = result.sourceToken;
1913
- } else if (_chunkZMT4ATHRcjs.isNativeAsset.call(void 0, asset)) {
1947
+ } else if (_chunkHAQOFI3Dcjs.isNativeAsset.call(void 0, asset)) {
1914
1948
  hash = await walletClient.sendTransaction({
1915
1949
  account,
1916
1950
  chain,
@@ -1941,8 +1975,8 @@ function ConfirmStep({
1941
1975
  );
1942
1976
  } catch (err) {
1943
1977
  const raw = err instanceof Error ? err.message : "Transfer failed";
1944
- const uncertain = _chunkRAADLTSWcjs.isSubmissionUncertain.call(void 0, err);
1945
- const message = uncertain ? "Deposit submission status is uncertain. Check your activity before trying again." : _chunkZMT4ATHRcjs.formatUserError.call(void 0, raw);
1978
+ const uncertain = _chunk4J5ADVINcjs.isSubmissionUncertain.call(void 0, err);
1979
+ const message = uncertain ? "Deposit submission status is uncertain. Check your activity before trying again." : _chunkHAQOFI3Dcjs.formatUserError.call(void 0, raw);
1946
1980
  if (uncertain) setSubmissionUncertain(true);
1947
1981
  setError(message);
1948
1982
  _optionalChain([onError, 'optionalCall', _71 => _71(message, "TRANSFER_ERROR", raw)]);
@@ -1952,7 +1986,7 @@ function ConfirmStep({
1952
1986
  };
1953
1987
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
1954
1988
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
1955
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.WalletIcon, {}), title: "Review deposit" }),
1989
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.WalletIcon, {}), title: "Review deposit" }),
1956
1990
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1957
1991
  ReviewDetails,
1958
1992
  {
@@ -1968,9 +2002,9 @@ function ConfirmStep({
1968
2002
  fee: { display: feeDisplay, struck: feesFullySponsored }
1969
2003
  }
1970
2004
  ),
1971
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Callout, { variant: "error", children: error }),
2005
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: error }),
1972
2006
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1973
- _chunkZMT4ATHRcjs.Button,
2007
+ _chunkHAQOFI3Dcjs.Button,
1974
2008
  {
1975
2009
  onClick: handleConfirm,
1976
2010
  loading: isSubmitting,
@@ -1997,7 +2031,7 @@ function ConfirmStep({
1997
2031
  ] }),
1998
2032
  !permit && permitEligible && permitUnavailable && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-gasless-note", children: permitUnavailable === "permit2-approval-required" ? "Gasless unavailable until Permit2 is approved; Continue sends a token transaction." : "This wallet/token cannot use gasless authorization; Continue sends a token transaction." })
1999
2033
  ] }),
2000
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
2034
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
2001
2035
  ] });
2002
2036
  }
2003
2037
 
@@ -2050,29 +2084,29 @@ function QrReviewStep({
2050
2084
  cancelled = true;
2051
2085
  };
2052
2086
  }, [service, smartAccount, asset, amount]);
2053
- const formattedSendAmount = _nullishCoalesce(_chunkZMT4ATHRcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( amount));
2087
+ const formattedSendAmount = _nullishCoalesce(_chunkHAQOFI3Dcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( amount));
2054
2088
  const receiveDisplay = (() => {
2055
2089
  if (quote.value) {
2056
- const quoted = _chunkZMT4ATHRcjs.formatQuotedReceive.call(void 0, quote.value.output, targetSymbol);
2090
+ const quoted = _chunkHAQOFI3Dcjs.formatQuotedReceive.call(void 0, quote.value.output, targetSymbol);
2057
2091
  if (quoted !== void 0) return quoted;
2058
2092
  }
2059
2093
  const usdValue = Number(targetAmount);
2060
- const estimate = _chunkZMT4ATHRcjs.formatReceiveEstimate.call(void 0, {
2094
+ const estimate = _chunkHAQOFI3Dcjs.formatReceiveEstimate.call(void 0, {
2061
2095
  sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
2062
2096
  sourceSymbol: asset.symbol,
2063
2097
  targetSymbol,
2064
2098
  sourceAmountUsd: Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0,
2065
- sourceTrusted: _chunkZMT4ATHRcjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
2066
- prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkZMT4ATHRcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
2099
+ sourceTrusted: _chunkHAQOFI3Dcjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
2100
+ prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkHAQOFI3Dcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
2067
2101
  });
2068
2102
  return _nullishCoalesce(estimate, () => ( targetSymbol));
2069
2103
  })();
2070
2104
  const estimatedTime = quote.value && Number.isFinite(quote.value.estimatedFillTimeSeconds) ? quote.value.estimatedFillTimeSeconds < 60 ? "< 1 min" : `~${Math.round(quote.value.estimatedFillTimeSeconds / 60)} min` : quote.state === "loading" ? "\u2026" : "\u2014";
2071
- const { display: quotedFee, struck } = _chunkZMT4ATHRcjs.quoteFeeRow.call(void 0, _optionalChain([quote, 'access', _72 => _72.value, 'optionalAccess', _73 => _73.fees]));
2105
+ const { display: quotedFee, struck } = _chunkHAQOFI3Dcjs.quoteFeeRow.call(void 0, _optionalChain([quote, 'access', _72 => _72.value, 'optionalAccess', _73 => _73.fees]));
2072
2106
  const feeDisplay = quote.state === "unavailable" ? "\u2014" : quotedFee;
2073
2107
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
2074
2108
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2075
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.TransferCryptoIcon, {}), title: "Fee estimate" }),
2109
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TransferCryptoIcon, {}), title: "Fee estimate" }),
2076
2110
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2077
2111
  ReviewDetails,
2078
2112
  {
@@ -2088,9 +2122,9 @@ function QrReviewStep({
2088
2122
  fee: { display: feeDisplay, struck }
2089
2123
  }
2090
2124
  ),
2091
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Button, { onClick: onClose, fullWidth: true, children: "Close" })
2125
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Button, { onClick: onClose, fullWidth: true, children: "Close" })
2092
2126
  ] }),
2093
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
2127
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
2094
2128
  ] });
2095
2129
  }
2096
2130
  QrReviewStep.displayName = "QrReviewStep";
@@ -2121,20 +2155,20 @@ function DepositAddressSkeleton({
2121
2155
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
2122
2156
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
2123
2157
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
2124
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
2158
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
2125
2159
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
2126
2160
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
2127
2161
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
2128
2162
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
2129
2163
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2130
- _chunkZMT4ATHRcjs.CdnIcon,
2164
+ _chunkHAQOFI3Dcjs.CdnIcon,
2131
2165
  {
2132
2166
  src: chainIcon,
2133
2167
  className: "rs-deposit-address-dropdown-icon"
2134
2168
  }
2135
2169
  ),
2136
2170
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
2137
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2171
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2138
2172
  ] })
2139
2173
  ] }),
2140
2174
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
@@ -2143,8 +2177,8 @@ function DepositAddressSkeleton({
2143
2177
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
2144
2178
  "Min.$",
2145
2179
  (_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _74 => _74.minDepositUsd]), () => ( 0.1))).toFixed(2),
2146
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRAADLTSWcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2147
- _chunkZMT4ATHRcjs.InfoIcon,
2180
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4J5ADVINcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2181
+ _chunkHAQOFI3Dcjs.InfoIcon,
2148
2182
  {
2149
2183
  className: "rs-deposit-address-min-icon",
2150
2184
  "aria-hidden": "true"
@@ -2154,14 +2188,14 @@ function DepositAddressSkeleton({
2154
2188
  ] }),
2155
2189
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
2156
2190
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2157
- _chunkZMT4ATHRcjs.TokenIcon,
2191
+ _chunkHAQOFI3Dcjs.TokenIcon,
2158
2192
  {
2159
2193
  symbol: defaultToken,
2160
2194
  className: "rs-deposit-address-dropdown-icon"
2161
2195
  }
2162
2196
  ),
2163
2197
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
2164
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2198
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2165
2199
  ] })
2166
2200
  ] })
2167
2201
  ] }),
@@ -2176,7 +2210,7 @@ function DepositAddressSkeleton({
2176
2210
  ] }),
2177
2211
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-actions", "aria-hidden": "true", children: [
2178
2212
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { type: "button", className: "rs-deposit-address-copy", disabled: true, children: [
2179
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CopyIcon, {}),
2213
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CopyIcon, {}),
2180
2214
  "Copy address"
2181
2215
  ] }),
2182
2216
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -2193,7 +2227,7 @@ function DepositAddressSkeleton({
2193
2227
  }
2194
2228
  )
2195
2229
  ] }),
2196
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
2230
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
2197
2231
  ] });
2198
2232
  }
2199
2233
  DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
@@ -2205,9 +2239,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
2205
2239
  var MAX_POLL_INTERVAL = 3e4;
2206
2240
  var BACKOFF_MULTIPLIER = 1.5;
2207
2241
  function isEventForTx(event, txHash) {
2208
- const eventTxHash = _chunkRAADLTSWcjs.getEventTxHash.call(void 0, event);
2242
+ const eventTxHash = _chunk4J5ADVINcjs.getEventTxHash.call(void 0, event);
2209
2243
  if (!eventTxHash) return false;
2210
- return _chunkRAADLTSWcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
2244
+ return _chunk4J5ADVINcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
2211
2245
  }
2212
2246
  function truncateHash(hash) {
2213
2247
  return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
@@ -2257,7 +2291,7 @@ function formatBridgeFailedMessage(event) {
2257
2291
  }
2258
2292
  return "Bridge failed";
2259
2293
  }
2260
- var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
2294
+ var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
2261
2295
  function DepositNotification({
2262
2296
  deposit,
2263
2297
  smartAccount,
@@ -2290,8 +2324,8 @@ function DepositNotification({
2290
2324
  );
2291
2325
  const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
2292
2326
  const pollTimeoutRef = _react.useRef.call(void 0, null);
2293
- const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
2294
- const depositContextRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, {
2327
+ const completedRef = _react.useRef.call(void 0, false);
2328
+ const depositContextRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, {
2295
2329
  amount,
2296
2330
  sourceChain,
2297
2331
  sourceToken: token,
@@ -2299,8 +2333,8 @@ function DepositNotification({
2299
2333
  targetChain,
2300
2334
  targetToken
2301
2335
  });
2302
- const onCompleteRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onComplete);
2303
- const onFailedRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onFailed);
2336
+ const onCompleteRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onComplete);
2337
+ const onFailedRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onFailed);
2304
2338
  const handleComplete = _react.useCallback.call(void 0,
2305
2339
  (destTxHash) => {
2306
2340
  if (completedRef.current) return;
@@ -2391,12 +2425,12 @@ function DepositNotification({
2391
2425
  status,
2392
2426
  txHash
2393
2427
  ]);
2394
- const explorerTxUrl = _chunkZMT4ATHRcjs.useExplorerTxUrl.call(void 0, );
2428
+ const explorerTxUrl = _chunkHAQOFI3Dcjs.useExplorerTxUrl.call(void 0, );
2395
2429
  const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : explorerTxUrl(sourceChain, txHash);
2396
2430
  const destExplorerUrl = destinationTxHash ? explorerTxUrl(_chunk4KCSH4T3cjs.targetChainToChainId.call(void 0, targetChain), destinationTxHash) : null;
2397
2431
  const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
2398
2432
  const subtitle = status === "complete" ? "Your deposit has been credited to your account." : status === "failed" ? "Your deposit could not be processed." : "Your deposit will be credited to your account shortly.";
2399
- const statusIcon = status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CheckIcon, {}) }) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--failed", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CloseIcon, {}) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2433
+ const statusIcon = status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CheckIcon, {}) }) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--failed", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CloseIcon, {}) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2400
2434
  "svg",
2401
2435
  {
2402
2436
  className: "rs-deposit-notification-spinner",
@@ -2446,7 +2480,7 @@ function DepositNotification({
2446
2480
  className: "rs-deposit-notification-close",
2447
2481
  onClick: () => onDismiss(deposit.id),
2448
2482
  "aria-label": "Dismiss",
2449
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CloseIcon, {})
2483
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CloseIcon, {})
2450
2484
  }
2451
2485
  )
2452
2486
  ] }),
@@ -2462,7 +2496,7 @@ function DepositNotification({
2462
2496
  "aria-expanded": expanded,
2463
2497
  children: [
2464
2498
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
2465
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
2499
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
2466
2500
  ]
2467
2501
  }
2468
2502
  ),
@@ -2513,6 +2547,30 @@ function DepositNotification({
2513
2547
  );
2514
2548
  }
2515
2549
 
2550
+ // src/core/deposit-source-identity.ts
2551
+ var SOLANA_NATIVE_MINT = "11111111111111111111111111111111";
2552
+ var EVM_ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
2553
+ function sourceChainToCaip2(chain) {
2554
+ if (chain === "solana") return _chunk4KCSH4T3cjs.SOLANA_MAINNET_CAIP2;
2555
+ if (chain === "hypercore") return _chunk4KCSH4T3cjs.HYPERCORE_SPOT_CAIP2;
2556
+ return _chunk4KCSH4T3cjs.toEvmCaip2.call(void 0, chain);
2557
+ }
2558
+ function findAddress(tokens, symbol) {
2559
+ return _optionalChain([tokens, 'optionalAccess', _88 => _88.find, 'call', _89 => _89((t) => t.symbol.toLowerCase() === symbol.toLowerCase()), 'optionalAccess', _90 => _90.address]);
2560
+ }
2561
+ function resolveSourceTokenIdentity(input) {
2562
+ const { chain, symbol, shortlist, catalogTokens } = input;
2563
+ if (!symbol) return void 0;
2564
+ const shortlistTokens = _optionalChain([shortlist, 'optionalAccess', _91 => _91[String(chain)]]);
2565
+ const raw = shortlistTokens !== void 0 ? findAddress(shortlistTokens, symbol) : chain === "hypercore" || !Array.isArray(catalogTokens) ? void 0 : findAddress(catalogTokens, symbol);
2566
+ if (!raw) return void 0;
2567
+ if (chain === "solana") {
2568
+ const isNative = raw.toLowerCase() === "native" || raw.toLowerCase() === EVM_ZERO_ADDRESS;
2569
+ return isNative ? SOLANA_NATIVE_MINT : raw;
2570
+ }
2571
+ return raw.toLowerCase();
2572
+ }
2573
+
2516
2574
  // src/components/steps/DepositAddressStep.tsx
2517
2575
 
2518
2576
  var QRCode = _react.lazy.call(void 0,
@@ -2564,7 +2622,7 @@ function resolveSolanaTokenMeta(token) {
2564
2622
  return {};
2565
2623
  }
2566
2624
  function getDepositEventDetails(event) {
2567
- if (!_optionalChain([event, 'optionalAccess', _88 => _88.type]) || !isRecord(event.data)) return {};
2625
+ if (!_optionalChain([event, 'optionalAccess', _92 => _92.type]) || !isRecord(event.data)) return {};
2568
2626
  if (event.type === "deposit-received") {
2569
2627
  const chainId = asChainId(event.data.chain);
2570
2628
  const token = asString(event.data.token);
@@ -2579,12 +2637,12 @@ function getDepositEventDetails(event) {
2579
2637
  const source = isRecord(event.data.source) ? event.data.source : void 0;
2580
2638
  const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
2581
2639
  if (source || deposit) {
2582
- const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _89 => _89.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _90 => _90.chain]))));
2583
- const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess', _91 => _91.asset])), () => ( asString(_optionalChain([deposit, 'optionalAccess', _92 => _92.asset])))), () => ( asString(_optionalChain([deposit, 'optionalAccess', _93 => _93.token]))));
2640
+ const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _93 => _93.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _94 => _94.chain]))));
2641
+ const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess', _95 => _95.asset])), () => ( asString(_optionalChain([deposit, 'optionalAccess', _96 => _96.asset])))), () => ( asString(_optionalChain([deposit, 'optionalAccess', _97 => _97.token]))));
2584
2642
  const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
2585
2643
  return {
2586
2644
  chainId,
2587
- amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _94 => _94.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _95 => _95.amount])))),
2645
+ amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _98 => _98.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _99 => _99.amount])))),
2588
2646
  token,
2589
2647
  ...solanaMeta
2590
2648
  };
@@ -2595,22 +2653,22 @@ function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
2595
2653
  return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
2596
2654
  }
2597
2655
  function chainLabel(chainId, catalogChain) {
2598
- const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _96 => _96.name]), () => ( _chunk4KCSH4T3cjs.getChainName.call(void 0, chainId)));
2656
+ const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _100 => _100.name]), () => ( _chunk4KCSH4T3cjs.getChainName.call(void 0, chainId)));
2599
2657
  return name.replace(/\s+(One|Mainnet|Smart Chain|Chain)$/i, "");
2600
2658
  }
2601
2659
  function computeTokensForChain(chainId, topTokens, catalogChain) {
2602
- const fromBackend = _optionalChain([topTokens, 'optionalAccess', _97 => _97[String(chainId)], 'optionalAccess', _98 => _98.map, 'call', _99 => _99((t) => t.symbol)]);
2660
+ const fromBackend = _optionalChain([topTokens, 'optionalAccess', _101 => _101[String(chainId)], 'optionalAccess', _102 => _102.map, 'call', _103 => _103((t) => t.symbol)]);
2603
2661
  if (fromBackend) return fromBackend;
2604
- return Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _100 => _100.supportedTokens])) ? catalogChain.supportedTokens.map((t) => t.symbol) : [];
2662
+ return Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _104 => _104.supportedTokens])) ? catalogChain.supportedTokens.map((t) => t.symbol) : [];
2605
2663
  }
2606
2664
  function selectionAsAsset(chainId, symbol, topTokens, catalogChain) {
2607
2665
  if (typeof chainId !== "number" || !symbol) return void 0;
2608
- const fromShortlist = _optionalChain([topTokens, 'optionalAccess', _101 => _101[String(chainId)], 'optionalAccess', _102 => _102.find, 'call', _103 => _103(
2666
+ const fromShortlist = _optionalChain([topTokens, 'optionalAccess', _105 => _105[String(chainId)], 'optionalAccess', _106 => _106.find, 'call', _107 => _107(
2609
2667
  (t) => t.symbol === symbol
2610
2668
  )]);
2611
- const fromCatalog = Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _104 => _104.supportedTokens])) ? catalogChain.supportedTokens.find((t) => t.symbol === symbol) : void 0;
2612
- const address = _nullishCoalesce(_optionalChain([fromShortlist, 'optionalAccess', _105 => _105.address]), () => ( _optionalChain([fromCatalog, 'optionalAccess', _106 => _106.address])));
2613
- const decimals = _nullishCoalesce(_optionalChain([fromShortlist, 'optionalAccess', _107 => _107.decimals]), () => ( _optionalChain([fromCatalog, 'optionalAccess', _108 => _108.decimals])));
2669
+ const fromCatalog = Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _108 => _108.supportedTokens])) ? catalogChain.supportedTokens.find((t) => t.symbol === symbol) : void 0;
2670
+ const address = _nullishCoalesce(_optionalChain([fromShortlist, 'optionalAccess', _109 => _109.address]), () => ( _optionalChain([fromCatalog, 'optionalAccess', _110 => _110.address])));
2671
+ const decimals = _nullishCoalesce(_optionalChain([fromShortlist, 'optionalAccess', _111 => _111.decimals]), () => ( _optionalChain([fromCatalog, 'optionalAccess', _112 => _112.decimals])));
2614
2672
  if (!address || decimals === void 0) return void 0;
2615
2673
  return {
2616
2674
  id: `qr-${chainId}-${symbol}`,
@@ -2623,7 +2681,7 @@ function selectionAsAsset(chainId, symbol, topTokens, catalogChain) {
2623
2681
  }
2624
2682
  function TokenGlyph({ symbol }) {
2625
2683
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2626
- _chunkZMT4ATHRcjs.TokenIcon,
2684
+ _chunkHAQOFI3Dcjs.TokenIcon,
2627
2685
  {
2628
2686
  symbol,
2629
2687
  className: "rs-deposit-address-dropdown-icon",
@@ -2647,18 +2705,22 @@ function DepositAddressStep({
2647
2705
  onDepositSubmitted,
2648
2706
  onDepositComplete,
2649
2707
  onDepositFailed,
2708
+ onAddressShown,
2650
2709
  onCopyAddress,
2651
2710
  onReviewDeposit,
2652
2711
  onError
2653
2712
  }) {
2654
2713
  const hasSolana = Boolean(solanaDepositAddress);
2655
2714
  const [topTokens, setTopTokens] = _react.useState.call(void 0, null);
2715
+ const [topTokensSettled, setTopTokensSettled] = _react.useState.call(void 0, false);
2656
2716
  _react.useEffect.call(void 0, () => {
2657
2717
  let active = true;
2658
2718
  setTopTokens(null);
2719
+ setTopTokensSettled(false);
2659
2720
  service.getTopTokens().then((t) => {
2660
2721
  if (!active) return;
2661
2722
  setTopTokens(t);
2723
+ setTopTokensSettled(true);
2662
2724
  if (t) _chunk4KCSH4T3cjs.publishShortlistTokens.call(void 0, t);
2663
2725
  });
2664
2726
  return () => {
@@ -2666,38 +2728,38 @@ function DepositAddressStep({
2666
2728
  };
2667
2729
  }, [service]);
2668
2730
  const BASE_CHAIN_ID2 = 8453;
2669
- const evmChainIds = _chunkZMT4ATHRcjs.useDepositChainIds.call(void 0, );
2670
- const { catalog, isLoading: catalogLoading } = _chunkZMT4ATHRcjs.useChainCatalog.call(void 0, );
2731
+ const evmChainIds = _chunkHAQOFI3Dcjs.useDepositChainIds.call(void 0, );
2732
+ const { catalog, isLoading: catalogLoading } = _chunkHAQOFI3Dcjs.useChainCatalog.call(void 0, );
2671
2733
  const catalogFor = _react.useCallback.call(void 0,
2672
2734
  (chain) => {
2673
2735
  if (!catalog) return void 0;
2674
- const key = _chunkZMT4ATHRcjs.catalogKeyForChain.call(void 0, chain);
2736
+ const key = _chunkHAQOFI3Dcjs.catalogKeyForChain.call(void 0, chain);
2675
2737
  return typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
2676
2738
  },
2677
2739
  [catalog]
2678
2740
  );
2679
2741
  const chainOptions = _react.useMemo.call(void 0, () => {
2680
- const acceptsDeposits = (chain) => _optionalChain([catalogFor, 'call', _109 => _109(chain), 'optionalAccess', _110 => _110.deposit]) !== false;
2742
+ const acceptsDeposits = (chain) => _optionalChain([catalogFor, 'call', _113 => _113(chain), 'optionalAccess', _114 => _114.deposit]) !== false;
2681
2743
  const options = [...evmChainIds];
2682
2744
  const extras = [];
2683
2745
  if (hasSolana && acceptsDeposits("solana")) extras.push("solana");
2684
2746
  if (acceptsDeposits("hypercore")) extras.push("hypercore");
2685
2747
  options.splice(1, 0, ...extras);
2686
2748
  return options.filter(
2687
- (chain) => _optionalChain([topTokens, 'optionalAccess', _111 => _111[String(chain)], 'optionalAccess', _112 => _112.length]) !== 0 && computeTokensForChain(chain, topTokens, catalogFor(chain)).length > 0
2749
+ (chain) => _optionalChain([topTokens, 'optionalAccess', _115 => _115[String(chain)], 'optionalAccess', _116 => _116.length]) !== 0 && computeTokensForChain(chain, topTokens, catalogFor(chain)).length > 0
2688
2750
  );
2689
2751
  }, [evmChainIds, hasSolana, topTokens, catalogFor]);
2690
2752
  const preferredChainId = (options) => options.includes(BASE_CHAIN_ID2) ? BASE_CHAIN_ID2 : _nullishCoalesce(options[0], () => ( BASE_CHAIN_ID2));
2691
- const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, () => _nullishCoalesce(_optionalChain([initialSource, 'optionalAccess', _113 => _113.chainId]), () => ( preferredChainId(chainOptions))));
2753
+ const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, () => _nullishCoalesce(_optionalChain([initialSource, 'optionalAccess', _117 => _117.chainId]), () => ( preferredChainId(chainOptions))));
2692
2754
  const chainChosenByUser = _react.useRef.call(void 0, initialSource !== void 0);
2693
- const pendingChainRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess', _114 => _114.chainId]));
2755
+ const pendingChainRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess', _118 => _118.chainId]));
2694
2756
  _react.useEffect.call(void 0, () => {
2695
2757
  if (chainOptions.length === 0) return;
2696
- const pendingChain = pendingChainRef.current;
2697
- if (pendingChain !== void 0) {
2698
- if (chainOptions.includes(pendingChain)) {
2758
+ const pendingChain2 = pendingChainRef.current;
2759
+ if (pendingChain2 !== void 0) {
2760
+ if (chainOptions.includes(pendingChain2)) {
2699
2761
  pendingChainRef.current = void 0;
2700
- setSourceChainId(pendingChain);
2762
+ setSourceChainId(pendingChain2);
2701
2763
  return;
2702
2764
  }
2703
2765
  if (catalogLoading || topTokens === null) return;
@@ -2714,10 +2776,10 @@ function DepositAddressStep({
2714
2776
  );
2715
2777
  const defaultToken = pickFallbackToken(
2716
2778
  tokensForChain,
2717
- _nullishCoalesce(_optionalChain([initialSource, 'optionalAccess', _115 => _115.symbol]), () => ( "USDC"))
2779
+ _nullishCoalesce(_optionalChain([initialSource, 'optionalAccess', _119 => _119.symbol]), () => ( "USDC"))
2718
2780
  );
2719
2781
  const [sourceTokenSymbol, setSourceTokenSymbol] = _react.useState.call(void 0, defaultToken);
2720
- const pendingTokenRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess', _116 => _116.symbol]));
2782
+ const pendingTokenRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess', _120 => _120.symbol]));
2721
2783
  _react.useEffect.call(void 0, () => {
2722
2784
  if (tokensForChain.includes(sourceTokenSymbol)) {
2723
2785
  pendingTokenRef.current = void 0;
@@ -2744,13 +2806,39 @@ function DepositAddressStep({
2744
2806
  const baselineTxHashRef = _react.useRef.call(void 0, void 0);
2745
2807
  const notificationIdRef = _react.useRef.call(void 0, 0);
2746
2808
  const displayAddress = isSolana && solanaDepositAddress ? solanaDepositAddress : smartAccount;
2809
+ const sourceTokenIdentity = _react.useMemo.call(void 0,
2810
+ () => resolveSourceTokenIdentity({
2811
+ chain: sourceChainId,
2812
+ symbol: sourceTokenSymbol,
2813
+ shortlist: topTokens,
2814
+ catalogTokens: _optionalChain([catalogFor, 'call', _121 => _121(sourceChainId), 'optionalAccess', _122 => _122.supportedTokens])
2815
+ }),
2816
+ [sourceChainId, sourceTokenSymbol, topTokens, catalogFor]
2817
+ );
2818
+ const pendingChain = pendingChainRef.current;
2819
+ const sourceSelectionSettled = !catalogLoading && topTokensSettled && chainOptions.length > 0 && (pendingChain === void 0 || pendingChain === sourceChainId) && (chainChosenByUser.current ? chainOptions.includes(sourceChainId) : sourceChainId === preferredChainId(chainOptions));
2820
+ _react.useEffect.call(void 0, () => {
2821
+ if (!sourceTokenIdentity) return;
2822
+ if (!sourceSelectionSettled) return;
2823
+ _optionalChain([onAddressShown, 'optionalCall', _123 => _123({
2824
+ address: displayAddress,
2825
+ sourceChainCaip2: sourceChainToCaip2(sourceChainId),
2826
+ sourceTokenIdentity
2827
+ })]);
2828
+ }, [
2829
+ displayAddress,
2830
+ onAddressShown,
2831
+ sourceChainId,
2832
+ sourceTokenIdentity,
2833
+ sourceSelectionSettled
2834
+ ]);
2747
2835
  _react.useEffect.call(void 0, () => {
2748
2836
  if (!chainDropdownOpen && !tokenDropdownOpen) return;
2749
2837
  function handlePointerDown(event) {
2750
2838
  const target = event.target;
2751
2839
  if (!target) return;
2752
- const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _117 => _117.current, 'optionalAccess', _118 => _118.contains, 'call', _119 => _119(target)]);
2753
- const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _120 => _120.current, 'optionalAccess', _121 => _121.contains, 'call', _122 => _122(target)]);
2840
+ const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _124 => _124.current, 'optionalAccess', _125 => _125.contains, 'call', _126 => _126(target)]);
2841
+ const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _127 => _127.current, 'optionalAccess', _128 => _128.contains, 'call', _129 => _129(target)]);
2754
2842
  if (clickedChainDropdown || clickedTokenDropdown) return;
2755
2843
  setChainDropdownOpen(false);
2756
2844
  setTokenDropdownOpen(false);
@@ -2763,10 +2851,10 @@ function DepositAddressStep({
2763
2851
  };
2764
2852
  }, [chainDropdownOpen, tokenDropdownOpen]);
2765
2853
  const handleCopy = _react.useCallback.call(void 0, async () => {
2766
- _optionalChain([onCopyAddress, 'optionalCall', _123 => _123()]);
2767
2854
  try {
2768
2855
  await navigator.clipboard.writeText(displayAddress);
2769
2856
  setCopied(true);
2857
+ _optionalChain([onCopyAddress, 'optionalCall', _130 => _130(true)]);
2770
2858
  setTimeout(() => setCopied(false), 2e3);
2771
2859
  } catch (e17) {
2772
2860
  const textarea = document.createElement("textarea");
@@ -2775,10 +2863,13 @@ function DepositAddressStep({
2775
2863
  textarea.style.opacity = "0";
2776
2864
  document.body.appendChild(textarea);
2777
2865
  textarea.select();
2778
- document.execCommand("copy");
2866
+ const copiedWithFallback = document.execCommand("copy");
2779
2867
  document.body.removeChild(textarea);
2780
- setCopied(true);
2781
- setTimeout(() => setCopied(false), 2e3);
2868
+ if (copiedWithFallback) {
2869
+ setCopied(true);
2870
+ setTimeout(() => setCopied(false), 2e3);
2871
+ }
2872
+ _optionalChain([onCopyAddress, 'optionalCall', _131 => _131(copiedWithFallback)]);
2782
2873
  }
2783
2874
  }, [displayAddress, onCopyAddress]);
2784
2875
  const handleSelectChain = _react.useCallback.call(void 0,
@@ -2847,10 +2938,10 @@ function DepositAddressStep({
2847
2938
  return;
2848
2939
  }
2849
2940
  const event = status.lastEvent;
2850
- const eventTxHash = _chunkRAADLTSWcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkRAADLTSWcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
2941
+ const eventTxHash = _chunk4J5ADVINcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunk4J5ADVINcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
2851
2942
  if (baselineTxHashRef.current === void 0) {
2852
2943
  baselineTxHashRef.current = eventTxHash;
2853
- } else if (eventTxHash && (!baselineTxHashRef.current || !_chunkRAADLTSWcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
2944
+ } else if (eventTxHash && (!baselineTxHashRef.current || !_chunk4J5ADVINcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
2854
2945
  const details = getDepositEventDetails(event);
2855
2946
  const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
2856
2947
  const amount = _nullishCoalesce(details.amount, () => ( "0"));
@@ -2882,7 +2973,7 @@ function DepositAddressStep({
2882
2973
  directTransfer
2883
2974
  };
2884
2975
  setNotifications((prev) => [notification, ...prev]);
2885
- _optionalChain([onDepositSubmittedRef, 'access', _124 => _124.current, 'optionalCall', _125 => _125({
2976
+ _optionalChain([onDepositSubmittedRef, 'access', _132 => _132.current, 'optionalCall', _133 => _133({
2886
2977
  txHash: eventTxHash,
2887
2978
  sourceChain: chainId,
2888
2979
  amount,
@@ -2894,7 +2985,7 @@ function DepositAddressStep({
2894
2985
  if (!cancelled) {
2895
2986
  const msg = err instanceof Error ? err.message : "Failed to check status";
2896
2987
  setPollingError(msg);
2897
- _optionalChain([onErrorRef, 'access', _126 => _126.current, 'optionalCall', _127 => _127(msg, "STATUS_POLL_ERROR")]);
2988
+ _optionalChain([onErrorRef, 'access', _134 => _134.current, 'optionalCall', _135 => _135(msg, "STATUS_POLL_ERROR")]);
2898
2989
  }
2899
2990
  }
2900
2991
  if (!cancelled) {
@@ -2910,21 +3001,21 @@ function DepositAddressStep({
2910
3001
  const handleNotificationComplete = _react.useCallback.call(void 0,
2911
3002
  (txHash, destinationTxHash, context) => {
2912
3003
  isTrackingRef.current = false;
2913
- _optionalChain([onDepositCompleteRef, 'access', _128 => _128.current, 'optionalCall', _129 => _129(txHash, destinationTxHash, context)]);
3004
+ _optionalChain([onDepositCompleteRef, 'access', _136 => _136.current, 'optionalCall', _137 => _137(txHash, destinationTxHash, context)]);
2914
3005
  },
2915
3006
  []
2916
3007
  );
2917
3008
  const handleNotificationFailed = _react.useCallback.call(void 0,
2918
3009
  (txHash, error) => {
2919
3010
  isTrackingRef.current = false;
2920
- _optionalChain([onDepositFailedRef, 'access', _130 => _130.current, 'optionalCall', _131 => _131(txHash, error)]);
3011
+ _optionalChain([onDepositFailedRef, 'access', _138 => _138.current, 'optionalCall', _139 => _139(txHash, error)]);
2921
3012
  },
2922
3013
  []
2923
3014
  );
2924
3015
  const handleNotificationDismiss = _react.useCallback.call(void 0, (id) => {
2925
3016
  setNotifications((prev) => prev.filter((n) => n.id !== id));
2926
3017
  }, []);
2927
- const qrIconSrc = _nullishCoalesce(_optionalChain([catalogFor, 'call', _132 => _132(sourceChainId), 'optionalAccess', _133 => _133.iconUrl]), () => ( _chunk4KCSH4T3cjs.getChainIcon.call(void 0, sourceChainId)));
3018
+ const qrIconSrc = _nullishCoalesce(_optionalChain([catalogFor, 'call', _140 => _140(sourceChainId), 'optionalAccess', _141 => _141.iconUrl]), () => ( _chunk4KCSH4T3cjs.getChainIcon.call(void 0, sourceChainId)));
2928
3019
  const reviewAsset = selectionAsAsset(
2929
3020
  sourceChainId,
2930
3021
  sourceTokenSymbol,
@@ -2934,13 +3025,13 @@ function DepositAddressStep({
2934
3025
  if (chainOptions.length === 0) {
2935
3026
  if (catalogLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositAddressSkeleton, { uiConfig });
2936
3027
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-screen", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
2937
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
2938
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Callout, { variant: "error", children: "Supported chains are unavailable right now, so there is no deposit address to show. Close and try again in a moment." })
3028
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
3029
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: "Supported chains are unavailable right now, so there is no deposit address to show. Close and try again in a moment." })
2939
3030
  ] }) });
2940
3031
  }
2941
3032
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
2942
3033
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
2943
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
3034
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
2944
3035
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
2945
3036
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
2946
3037
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
@@ -2956,14 +3047,14 @@ function DepositAddressStep({
2956
3047
  },
2957
3048
  children: [
2958
3049
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2959
- _chunkZMT4ATHRcjs.CdnIcon,
3050
+ _chunkHAQOFI3Dcjs.CdnIcon,
2960
3051
  {
2961
- src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _134 => _134(sourceChainId), 'optionalAccess', _135 => _135.iconUrl]), () => ( _chunk4KCSH4T3cjs.getChainIcon.call(void 0, sourceChainId))),
3052
+ src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _142 => _142(sourceChainId), 'optionalAccess', _143 => _143.iconUrl]), () => ( _chunk4KCSH4T3cjs.getChainIcon.call(void 0, sourceChainId))),
2962
3053
  className: "rs-deposit-address-dropdown-icon"
2963
3054
  }
2964
3055
  ),
2965
3056
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(sourceChainId, catalogFor(sourceChainId)) }),
2966
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
3057
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2967
3058
  ]
2968
3059
  }
2969
3060
  ),
@@ -2975,9 +3066,9 @@ function DepositAddressStep({
2975
3066
  onClick: () => handleSelectChain(chainId),
2976
3067
  children: [
2977
3068
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2978
- _chunkZMT4ATHRcjs.CdnIcon,
3069
+ _chunkHAQOFI3Dcjs.CdnIcon,
2979
3070
  {
2980
- src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _136 => _136(chainId), 'optionalAccess', _137 => _137.iconUrl]), () => ( _chunk4KCSH4T3cjs.getChainIcon.call(void 0, chainId))),
3071
+ src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _144 => _144(chainId), 'optionalAccess', _145 => _145.iconUrl]), () => ( _chunk4KCSH4T3cjs.getChainIcon.call(void 0, chainId))),
2981
3072
  className: "rs-deposit-address-dropdown-icon"
2982
3073
  }
2983
3074
  ),
@@ -2992,9 +3083,9 @@ function DepositAddressStep({
2992
3083
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
2993
3084
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
2994
3085
  "Min.$",
2995
- (_chunk4KCSH4T3cjs.isHyperCoreDestination.call(void 0, targetChain) || isHyperCore ? Math.max(_chunk4KCSH4T3cjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _138 => _138.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _139 => _139.minDepositUsd]), () => ( 0.1))).toFixed(2),
2996
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRAADLTSWcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2997
- _chunkZMT4ATHRcjs.InfoIcon,
3086
+ (_chunk4KCSH4T3cjs.isHyperCoreDestination.call(void 0, targetChain) || isHyperCore ? Math.max(_chunk4KCSH4T3cjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _146 => _146.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _147 => _147.minDepositUsd]), () => ( 0.1))).toFixed(2),
3087
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4J5ADVINcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3088
+ _chunkHAQOFI3Dcjs.InfoIcon,
2998
3089
  {
2999
3090
  className: "rs-deposit-address-min-icon",
3000
3091
  "aria-hidden": "true"
@@ -3015,7 +3106,7 @@ function DepositAddressStep({
3015
3106
  children: [
3016
3107
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenGlyph, { symbol: sourceTokenSymbol }),
3017
3108
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
3018
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
3109
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
3019
3110
  ]
3020
3111
  }
3021
3112
  ),
@@ -3060,7 +3151,7 @@ function DepositAddressStep({
3060
3151
  className: "rs-deposit-address-copy",
3061
3152
  onClick: handleCopy,
3062
3153
  children: [
3063
- copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CopyIcon, {}),
3154
+ copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CopyIcon, {}),
3064
3155
  copied ? "Copied!" : "Copy address"
3065
3156
  ]
3066
3157
  }
@@ -3095,7 +3186,7 @@ function DepositAddressStep({
3095
3186
  },
3096
3187
  deposit.id
3097
3188
  )) }),
3098
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
3189
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
3099
3190
  ] });
3100
3191
  }
3101
3192
  DepositAddressStep.displayName = "DepositAddressStep";
@@ -3152,7 +3243,7 @@ function FinalisingDepositStep() {
3152
3243
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
3153
3244
  ] })
3154
3245
  ] }),
3155
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
3246
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
3156
3247
  ] });
3157
3248
  }
3158
3249
  FinalisingDepositStep.displayName = "FinalisingDepositStep";
@@ -3182,7 +3273,7 @@ function SwappedOrderTracker({
3182
3273
  ];
3183
3274
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
3184
3275
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3185
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.HandCoinsIcon, {}), title }),
3276
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.HandCoinsIcon, {}), title }),
3186
3277
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
3187
3278
  const status = stepStates[idx];
3188
3279
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
@@ -3196,7 +3287,7 @@ function SwappedOrderTracker({
3196
3287
  {
3197
3288
  className: "rs-swapped-tracker-step-marker",
3198
3289
  "aria-hidden": "true",
3199
- children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3290
+ children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3200
3291
  "svg",
3201
3292
  {
3202
3293
  className: "rs-swapped-tracker-step-ring",
@@ -3231,7 +3322,7 @@ function SwappedOrderTracker({
3231
3322
  }
3232
3323
  )
3233
3324
  ] }),
3234
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
3325
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
3235
3326
  ] });
3236
3327
  }
3237
3328
  function formatTrackerAmount(amount) {
@@ -3329,6 +3420,10 @@ function SwappedProviderStep({
3329
3420
  onClose,
3330
3421
  onGoBack,
3331
3422
  onError,
3423
+ onAttemptConsumed,
3424
+ onProviderHandoff,
3425
+ onRetry,
3426
+ onCancelled,
3332
3427
  onImmersiveChange,
3333
3428
  openExternally
3334
3429
  }) {
@@ -3344,6 +3439,7 @@ function SwappedProviderStep({
3344
3439
  const [opening, setOpening] = _react.useState.call(void 0, false);
3345
3440
  const iframeRef = _react.useRef.call(void 0, null);
3346
3441
  const openedUrlRef = _react.useRef.call(void 0, null);
3442
+ const assignedIframeUrlRef = _react.useRef.call(void 0, null);
3347
3443
  const completeFiredRef = _react.useRef.call(void 0, false);
3348
3444
  const failedFiredRef = _react.useRef.call(void 0, false);
3349
3445
  const completeTimeoutRef = _react.useRef.call(void 0, null);
@@ -3364,6 +3460,8 @@ function SwappedProviderStep({
3364
3460
  onSwappedFailedRef.current = onSwappedFailed;
3365
3461
  const onErrorRef = _react.useRef.call(void 0, onError);
3366
3462
  onErrorRef.current = onError;
3463
+ const onProviderHandoffRef = _react.useRef.call(void 0, onProviderHandoff);
3464
+ onProviderHandoffRef.current = onProviderHandoff;
3367
3465
  const onGoBackRef = _react.useRef.call(void 0, onGoBack);
3368
3466
  onGoBackRef.current = onGoBack;
3369
3467
  const onImmersiveChangeRef = _react.useRef.call(void 0, onImmersiveChange);
@@ -3382,6 +3480,7 @@ function SwappedProviderStep({
3382
3480
  setHandoffOpened(false);
3383
3481
  setOpening(false);
3384
3482
  openedUrlRef.current = null;
3483
+ assignedIframeUrlRef.current = null;
3385
3484
  if (completeTimeoutRef.current !== null) {
3386
3485
  clearTimeout(completeTimeoutRef.current);
3387
3486
  completeTimeoutRef.current = null;
@@ -3397,18 +3496,19 @@ function SwappedProviderStep({
3397
3496
  if (cancelled) return;
3398
3497
  if (!isTrustedSwappedWidgetUrl(res.url)) {
3399
3498
  setLoadError(loadErrorFallback);
3400
- _optionalChain([onErrorRef, 'access', _140 => _140.current, 'optionalCall', _141 => _141(loadErrorFallback, loadErrorCode)]);
3499
+ _optionalChain([onErrorRef, 'access', _148 => _148.current, 'optionalCall', _149 => _149(loadErrorFallback, loadErrorCode)]);
3401
3500
  return;
3402
3501
  }
3403
3502
  setWidgetUrl(res.url);
3404
3503
  expectedExternalCustomerIdRef.current = res.externalCustomerId;
3504
+ _optionalChain([onAttemptConsumed, 'optionalCall', _150 => _150(res.externalCustomerId)]);
3405
3505
  const sep = res.externalCustomerId.indexOf(":");
3406
3506
  expectedOrderUuidRef.current = sep >= 0 ? res.externalCustomerId.slice(sep + 1) : null;
3407
3507
  }).catch((err) => {
3408
3508
  if (cancelled) return;
3409
3509
  const message = err instanceof Error ? err.message : loadErrorFallback;
3410
3510
  setLoadError(message);
3411
- _optionalChain([onErrorRef, 'access', _142 => _142.current, 'optionalCall', _143 => _143(message, loadErrorCode)]);
3511
+ _optionalChain([onErrorRef, 'access', _151 => _151.current, 'optionalCall', _152 => _152(message, loadErrorCode)]);
3412
3512
  });
3413
3513
  return () => {
3414
3514
  cancelled = true;
@@ -3421,13 +3521,20 @@ function SwappedProviderStep({
3421
3521
  _react.useEffect.call(void 0, () => {
3422
3522
  if (openExternally || !widgetUrl || iframeLoaded || loadError) return;
3423
3523
  const timer = setTimeout(() => {
3424
- setLoadError("Iframe took too long to load.");
3524
+ const message = "Iframe took too long to load.";
3525
+ setLoadError(message);
3526
+ _optionalChain([onErrorRef, 'access', _153 => _153.current, 'optionalCall', _154 => _154(message, "SWAPPED_IFRAME_TIMEOUT")]);
3425
3527
  }, IFRAME_LOAD_TIMEOUT_MS);
3426
3528
  return () => clearTimeout(timer);
3427
3529
  }, [openExternally, widgetUrl, iframeLoaded, loadError]);
3428
3530
  _react.useEffect.call(void 0, () => {
3429
3531
  if (openExternally) return;
3430
- setIframeSrc(widgetUrl && !loadError ? widgetUrl : null);
3532
+ const nextSrc = widgetUrl && !loadError ? widgetUrl : null;
3533
+ setIframeSrc(nextSrc);
3534
+ if (nextSrc && assignedIframeUrlRef.current !== nextSrc) {
3535
+ assignedIframeUrlRef.current = nextSrc;
3536
+ _optionalChain([onProviderHandoffRef, 'access', _155 => _155.current, 'optionalCall', _156 => _156()]);
3537
+ }
3431
3538
  }, [openExternally, widgetUrl, loadError, retryToken]);
3432
3539
  const openPaymentPage = async (url) => {
3433
3540
  if (!openExternally) return;
@@ -3436,10 +3543,11 @@ function SwappedProviderStep({
3436
3543
  try {
3437
3544
  await openExternally(url);
3438
3545
  setHandoffOpened(true);
3546
+ _optionalChain([onProviderHandoff, 'optionalCall', _157 => _157()]);
3439
3547
  } catch (error) {
3440
3548
  openedUrlRef.current = null;
3441
3549
  setLoadError(OPEN_FAILED_MESSAGE);
3442
- _optionalChain([onErrorRef, 'access', _144 => _144.current, 'optionalCall', _145 => _145(
3550
+ _optionalChain([onErrorRef, 'access', _158 => _158.current, 'optionalCall', _159 => _159(
3443
3551
  error instanceof Error && error.message ? error.message : OPEN_FAILED_MESSAGE,
3444
3552
  OPEN_FAILED_CODE
3445
3553
  )]);
@@ -3487,8 +3595,8 @@ function SwappedProviderStep({
3487
3595
  const doc = globalThis.document;
3488
3596
  const onVisible = () => {
3489
3597
  if (doc.visibilityState !== "visible") return;
3490
- _optionalChain([rescheduleStatusPollRef, 'access', _146 => _146.current, 'optionalCall', _147 => _147(0)]);
3491
- _optionalChain([rescheduleDepositPollRef, 'access', _148 => _148.current, 'optionalCall', _149 => _149(0)]);
3598
+ _optionalChain([rescheduleStatusPollRef, 'access', _160 => _160.current, 'optionalCall', _161 => _161(0)]);
3599
+ _optionalChain([rescheduleDepositPollRef, 'access', _162 => _162.current, 'optionalCall', _163 => _163(0)]);
3492
3600
  };
3493
3601
  doc.addEventListener("visibilitychange", onVisible);
3494
3602
  return () => doc.removeEventListener("visibilitychange", onVisible);
@@ -3502,10 +3610,10 @@ function SwappedProviderStep({
3502
3610
  const status = await service.fetchLatestStatus(smartAccount);
3503
3611
  if (cancelled) return;
3504
3612
  const event = status.lastEvent;
3505
- const eventTxHash = _chunkRAADLTSWcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkRAADLTSWcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
3613
+ const eventTxHash = _chunk4J5ADVINcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunk4J5ADVINcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
3506
3614
  if (baselineDepositTxHashRef.current === void 0) {
3507
3615
  baselineDepositTxHashRef.current = eventTxHash;
3508
- } else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkRAADLTSWcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
3616
+ } else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunk4J5ADVINcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
3509
3617
  currentDepositTxHashRef.current = eventTxHash;
3510
3618
  setLatestEvent(_nullishCoalesce(event, () => ( null)));
3511
3619
  }
@@ -3530,16 +3638,16 @@ function SwappedProviderStep({
3530
3638
  }, [service, smartAccount]);
3531
3639
  _react.useEffect.call(void 0, () => {
3532
3640
  if (fastDepositPollEnabledRef.current) return;
3533
- const status = _optionalChain([orderState, 'optionalAccess', _150 => _150.status]);
3641
+ const status = _optionalChain([orderState, 'optionalAccess', _164 => _164.status]);
3534
3642
  if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
3535
3643
  fastDepositPollEnabledRef.current = true;
3536
- _optionalChain([rescheduleDepositPollRef, 'access', _151 => _151.current, 'optionalCall', _152 => _152(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
3644
+ _optionalChain([rescheduleDepositPollRef, 'access', _165 => _165.current, 'optionalCall', _166 => _166(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
3537
3645
  }, [orderState]);
3538
3646
  _react.useEffect.call(void 0, () => {
3539
3647
  if (openExternally) return;
3540
3648
  function onMessage(e) {
3541
3649
  if (!SWAPPED_IFRAME_ORIGINS.has(e.origin)) return;
3542
- if (e.source !== _optionalChain([iframeRef, 'access', _153 => _153.current, 'optionalAccess', _154 => _154.contentWindow])) return;
3650
+ if (e.source !== _optionalChain([iframeRef, 'access', _167 => _167.current, 'optionalAccess', _168 => _168.contentWindow])) return;
3543
3651
  if (isSwappedGoBackMessage(e.data)) {
3544
3652
  onGoBackRef.current();
3545
3653
  return;
@@ -3554,16 +3662,16 @@ function SwappedProviderStep({
3554
3662
  setOrderState((prev) => ({
3555
3663
  // Normalise to the uuid the backend poll also keys on, so orderState
3556
3664
  // is consistent regardless of which path set it.
3557
- orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess', _155 => _155.orderId]))), () => ( ext)),
3665
+ orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess', _169 => _169.orderId]))), () => ( ext)),
3558
3666
  status: parsed.status,
3559
- orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _156 => _156.orderCrypto]))), () => ( null)),
3560
- orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _157 => _157.orderCryptoAmount]))), () => ( null)),
3561
- transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _158 => _158.transactionId]))), () => ( null)),
3667
+ orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _170 => _170.orderCrypto]))), () => ( null)),
3668
+ orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _171 => _171.orderCryptoAmount]))), () => ( null)),
3669
+ transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _172 => _172.transactionId]))), () => ( null)),
3562
3670
  receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
3563
- paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _159 => _159.paidAmountUsd]), () => ( null)),
3564
- paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _160 => _160.paidAmountEur]), () => ( null)),
3565
- onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _161 => _161.onrampFeeUsd]), () => ( null)),
3566
- paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _162 => _162.paymentMethod]), () => ( null))
3671
+ paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _173 => _173.paidAmountUsd]), () => ( null)),
3672
+ paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _174 => _174.paidAmountEur]), () => ( null)),
3673
+ onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _175 => _175.onrampFeeUsd]), () => ( null)),
3674
+ paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _176 => _176.paymentMethod]), () => ( null))
3567
3675
  }));
3568
3676
  }
3569
3677
  window.addEventListener("message", onMessage);
@@ -3576,25 +3684,28 @@ function SwappedProviderStep({
3576
3684
  }
3577
3685
  }, [phase, orderState, latestEvent, variant]);
3578
3686
  const stepStates = _react.useMemo.call(void 0,
3579
- () => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _163 => _163.status]), () => ( null)), latestEvent),
3687
+ () => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _177 => _177.status]), () => ( null)), latestEvent),
3580
3688
  [orderState, latestEvent]
3581
3689
  );
3582
3690
  const terminalState = _react.useMemo.call(void 0, () => {
3583
- if (_chunkRAADLTSWcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
3691
+ if (_chunk4J5ADVINcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
3584
3692
  return {
3585
3693
  kind: "failed",
3586
- message: _chunkRAADLTSWcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
3694
+ message: _chunk4J5ADVINcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
3587
3695
  };
3588
3696
  }
3589
- if (_optionalChain([orderState, 'optionalAccess', _164 => _164.status]) === "order_cancelled") {
3697
+ if (_optionalChain([orderState, 'optionalAccess', _178 => _178.status]) === "order_cancelled") {
3590
3698
  const banner = bannerForStatus("order_cancelled", {});
3591
3699
  return { kind: "cancelled", message: _nullishCoalesce(banner.detail, () => ( banner.title)) };
3592
3700
  }
3593
3701
  return null;
3594
3702
  }, [latestEvent, orderState, bannerForStatus]);
3703
+ _react.useEffect.call(void 0, () => {
3704
+ if (_optionalChain([orderState, 'optionalAccess', _179 => _179.status]) === "order_cancelled") _optionalChain([onCancelled, 'optionalCall', _180 => _180()]);
3705
+ }, [onCancelled, _optionalChain([orderState, 'optionalAccess', _181 => _181.status])]);
3595
3706
  _react.useEffect.call(void 0, () => {
3596
3707
  if (completeFiredRef.current || failedFiredRef.current) return;
3597
- const t = _optionalChain([latestEvent, 'optionalAccess', _165 => _165.type]);
3708
+ const t = _optionalChain([latestEvent, 'optionalAccess', _182 => _182.type]);
3598
3709
  const isSuccess = t === "bridge-complete";
3599
3710
  if (!isSuccess) return;
3600
3711
  const txHash = currentDepositTxHashRef.current;
@@ -3603,10 +3714,10 @@ function SwappedProviderStep({
3603
3714
  const info = {
3604
3715
  smartAccount,
3605
3716
  txHash,
3606
- orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _166 => _166.orderCrypto]), () => ( null)),
3717
+ orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _183 => _183.orderCrypto]), () => ( null)),
3607
3718
  // Base-unit source amount from the deposit row/event, consistent with the
3608
3719
  // wallet/QR path. ProcessingStep + onLifecycle expect base units.
3609
- amount: _nullishCoalesce(_chunkRAADLTSWcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null)),
3720
+ amount: _nullishCoalesce(_chunk4J5ADVINcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null)),
3610
3721
  expectedOrderUuid: expectedOrderUuidRef.current,
3611
3722
  initialEvent: _nullishCoalesce(latestEvent, () => ( void 0))
3612
3723
  };
@@ -3617,22 +3728,23 @@ function SwappedProviderStep({
3617
3728
  }, [latestEvent, orderState, smartAccount]);
3618
3729
  _react.useEffect.call(void 0, () => {
3619
3730
  if (failedFiredRef.current || completeFiredRef.current) return;
3620
- if (!_chunkRAADLTSWcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
3731
+ if (!_chunk4J5ADVINcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
3621
3732
  const txHash = currentDepositTxHashRef.current;
3622
3733
  if (!txHash) return;
3623
3734
  failedFiredRef.current = true;
3624
3735
  setPhase("tracker");
3625
- _optionalChain([onSwappedFailedRef, 'access', _167 => _167.current, 'optionalCall', _168 => _168(
3736
+ _optionalChain([onSwappedFailedRef, 'access', _184 => _184.current, 'optionalCall', _185 => _185(
3626
3737
  txHash,
3627
- _chunkRAADLTSWcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
3738
+ _chunk4J5ADVINcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
3628
3739
  )]);
3629
3740
  }, [latestEvent]);
3630
3741
  const immersive = !openExternally && variant === "fiat" && phase === "provider" && !loadError;
3631
3742
  _react.useEffect.call(void 0, () => {
3632
- _optionalChain([onImmersiveChangeRef, 'access', _169 => _169.current, 'optionalCall', _170 => _170(immersive)]);
3743
+ _optionalChain([onImmersiveChangeRef, 'access', _186 => _186.current, 'optionalCall', _187 => _187(immersive)]);
3633
3744
  }, [immersive]);
3634
- _react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access', _171 => _171.current, 'optionalCall', _172 => _172(false)]), []);
3745
+ _react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access', _188 => _188.current, 'optionalCall', _189 => _189(false)]), []);
3635
3746
  const handleRetry = () => {
3747
+ _optionalChain([onRetry, 'optionalCall', _190 => _190()]);
3636
3748
  setIframeSrc(null);
3637
3749
  setWidgetUrl(null);
3638
3750
  setIframeLoaded(false);
@@ -3650,8 +3762,8 @@ function SwappedProviderStep({
3650
3762
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3651
3763
  SwappedOrderTracker,
3652
3764
  {
3653
- amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _173 => _173.orderCryptoAmount]), () => ( null)),
3654
- currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _174 => _174.orderCrypto]), () => ( "USDC")),
3765
+ amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _191 => _191.orderCryptoAmount]), () => ( null)),
3766
+ currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _192 => _192.orderCrypto]), () => ( "USDC")),
3655
3767
  stepStates,
3656
3768
  terminal: terminalState,
3657
3769
  onRetry: handleRetry,
@@ -3673,7 +3785,7 @@ function SwappedProviderStep({
3673
3785
  }
3674
3786
  )
3675
3787
  ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
3676
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Spinner, {}),
3788
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Spinner, {}),
3677
3789
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-swapped-handoff-text", children: [
3678
3790
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "rs-swapped-handoff-title", children: handoffOpened ? variant === "fiat" ? "Finish paying in your browser" : "Approve the transfer in your browser" : "Opening your browser\u2026" }),
3679
3791
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-swapped-handoff-subtitle", children: handoffOpened ? (
@@ -3697,7 +3809,7 @@ function SwappedProviderStep({
3697
3809
  }
3698
3810
  )
3699
3811
  ] }) }),
3700
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
3812
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
3701
3813
  ] });
3702
3814
  }
3703
3815
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
@@ -3714,7 +3826,7 @@ function SwappedProviderStep({
3714
3826
  }
3715
3827
  )
3716
3828
  ] }),
3717
- !loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Spinner, {}) }),
3829
+ !loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Spinner, {}) }),
3718
3830
  widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3719
3831
  "iframe",
3720
3832
  {
@@ -3726,7 +3838,7 @@ function SwappedProviderStep({
3726
3838
  allow: "payment; camera; microphone; clipboard-write; geolocation",
3727
3839
  onLoad: () => {
3728
3840
  try {
3729
- if (_optionalChain([iframeRef, 'access', _175 => _175.current, 'optionalAccess', _176 => _176.contentWindow, 'optionalAccess', _177 => _177.location, 'optionalAccess', _178 => _178.href]) === "about:blank") {
3841
+ if (_optionalChain([iframeRef, 'access', _193 => _193.current, 'optionalAccess', _194 => _194.contentWindow, 'optionalAccess', _195 => _195.location, 'optionalAccess', _196 => _196.href]) === "about:blank") {
3730
3842
  return;
3731
3843
  }
3732
3844
  } catch (e24) {
@@ -3737,11 +3849,11 @@ function SwappedProviderStep({
3737
3849
  retryToken
3738
3850
  )
3739
3851
  ] }) }),
3740
- loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
3852
+ loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
3741
3853
  ] });
3742
3854
  }
3743
3855
  function deriveStepStates(swappedStatus, latestEvent) {
3744
- if (_chunkRAADLTSWcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
3856
+ if (_chunk4J5ADVINcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
3745
3857
  return ["complete", "complete", "failed", "pending"];
3746
3858
  }
3747
3859
  if (swappedStatus === "order_cancelled") {
@@ -3749,7 +3861,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
3749
3861
  }
3750
3862
  const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
3751
3863
  const step2Complete = latestEvent !== null || swappedStatus === "order_broadcasted";
3752
- const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _179 => _179.type]) === "bridge-complete";
3864
+ const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _197 => _197.type]) === "bridge-complete";
3753
3865
  if (step3Complete) {
3754
3866
  return ["complete", "complete", "complete", "complete"];
3755
3867
  }
@@ -3802,11 +3914,15 @@ function FiatOnrampStep({
3802
3914
  onClose,
3803
3915
  onGoBack,
3804
3916
  onError,
3917
+ onAttemptConsumed,
3918
+ onProviderHandoff,
3919
+ onRetry,
3920
+ onCancelled,
3805
3921
  onImmersiveChange,
3806
3922
  openExternally
3807
3923
  }) {
3808
3924
  const loadUrl = _react.useCallback.call(void 0, async () => {
3809
- const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall', _180 => _180(
3925
+ const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall', _198 => _198(
3810
3926
  smartAccount,
3811
3927
  paymentMethod,
3812
3928
  methodSelectionSource
@@ -3846,6 +3962,10 @@ function FiatOnrampStep({
3846
3962
  onClose,
3847
3963
  onGoBack,
3848
3964
  onError,
3965
+ onAttemptConsumed,
3966
+ onProviderHandoff,
3967
+ onRetry,
3968
+ onCancelled,
3849
3969
  onImmersiveChange,
3850
3970
  openExternally
3851
3971
  }
@@ -3895,6 +4015,10 @@ function ExchangeConnectStep({
3895
4015
  onClose,
3896
4016
  onGoBack,
3897
4017
  onError,
4018
+ onAttemptConsumed,
4019
+ onProviderHandoff,
4020
+ onRetry,
4021
+ onCancelled,
3898
4022
  onImmersiveChange,
3899
4023
  openExternally
3900
4024
  }) {
@@ -3922,6 +4046,10 @@ function ExchangeConnectStep({
3922
4046
  onClose,
3923
4047
  onGoBack,
3924
4048
  onError,
4049
+ onAttemptConsumed,
4050
+ onProviderHandoff,
4051
+ onRetry,
4052
+ onCancelled,
3925
4053
  onImmersiveChange,
3926
4054
  openExternally
3927
4055
  }
@@ -3935,7 +4063,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
3935
4063
  function ExchangeLogo({ exchange }) {
3936
4064
  const [failed, setFailed] = _react.useState.call(void 0, false);
3937
4065
  if (!exchange.logoUrl || failed) {
3938
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.BankIcon, {});
4066
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.BankIcon, {});
3939
4067
  }
3940
4068
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3941
4069
  "img",
@@ -3980,7 +4108,7 @@ function ExchangeSelectStep({
3980
4108
  setExchanges([]);
3981
4109
  setExchangeFeeBps(0);
3982
4110
  setError(message);
3983
- _optionalChain([onError, 'optionalCall', _181 => _181(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
4111
+ _optionalChain([onError, 'optionalCall', _199 => _199(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
3984
4112
  }).finally(() => {
3985
4113
  if (!cancelled) setLoading(false);
3986
4114
  });
@@ -4006,7 +4134,7 @@ function ExchangeSelectStep({
4006
4134
  } catch (err) {
4007
4135
  const message = err instanceof Error ? err.message : "Failed to prepare Connect";
4008
4136
  setSelectionNotice(message);
4009
- _optionalChain([onError, 'optionalCall', _182 => _182(message, "SWAPPED_CONNECT_URL_FAILED")]);
4137
+ _optionalChain([onError, 'optionalCall', _200 => _200(message, "SWAPPED_CONNECT_URL_FAILED")]);
4010
4138
  } finally {
4011
4139
  setSelectingConnection(null);
4012
4140
  }
@@ -4016,14 +4144,14 @@ function ExchangeSelectStep({
4016
4144
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
4017
4145
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
4018
4146
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4019
- _chunkZMT4ATHRcjs.BodyHeader,
4147
+ _chunkHAQOFI3Dcjs.BodyHeader,
4020
4148
  {
4021
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.UnplugIcon, {}),
4149
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.UnplugIcon, {}),
4022
4150
  title: "Connect exchange",
4023
4151
  subtitle: "Select an exchange to connect"
4024
4152
  }
4025
4153
  ),
4026
- loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Spinner, {}) }),
4154
+ loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Spinner, {}) }),
4027
4155
  !loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
4028
4156
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
4029
4157
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -4049,7 +4177,7 @@ function ExchangeSelectStep({
4049
4177
  )
4050
4178
  ] }),
4051
4179
  !loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
4052
- const brand = _chunkRAADLTSWcjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
4180
+ const brand = _chunk4J5ADVINcjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
4053
4181
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
4054
4182
  "button",
4055
4183
  {
@@ -4074,7 +4202,7 @@ function ExchangeSelectStep({
4074
4202
  );
4075
4203
  }) })
4076
4204
  ] }),
4077
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {}),
4205
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {}),
4078
4206
  exchangeFeeBps > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "rs-exchange-select-fee-note", children: [
4079
4207
  "A ",
4080
4208
  formatFeeRate(exchangeFeeBps),
@@ -4112,7 +4240,7 @@ function SolanaTokenSelectStep({
4112
4240
  setError(null);
4113
4241
  const portfolioBySymbol = {};
4114
4242
  try {
4115
- _chunkZMT4ATHRcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
4243
+ _chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
4116
4244
  solanaAddress
4117
4245
  });
4118
4246
  const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
@@ -4135,12 +4263,12 @@ function SolanaTokenSelectStep({
4135
4263
  };
4136
4264
  }
4137
4265
  }
4138
- _chunkZMT4ATHRcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
4266
+ _chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
4139
4267
  symbols: Object.keys(portfolioBySymbol)
4140
4268
  });
4141
4269
  } catch (err) {
4142
4270
  if (!active) return;
4143
- _chunkZMT4ATHRcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
4271
+ _chunkHAQOFI3Dcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
4144
4272
  solanaAddress
4145
4273
  });
4146
4274
  setError(
@@ -4165,7 +4293,7 @@ function SolanaTokenSelectStep({
4165
4293
  setTokenBalances(results);
4166
4294
  setLoading(false);
4167
4295
  const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
4168
- _optionalChain([onTotalBalanceComputed, 'optionalCall', _183 => _183(totalUsd)]);
4296
+ _optionalChain([onTotalBalanceComputed, 'optionalCall', _201 => _201(totalUsd)]);
4169
4297
  }
4170
4298
  void loadBalances();
4171
4299
  return () => {
@@ -4187,7 +4315,7 @@ function SolanaTokenSelectStep({
4187
4315
  const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
4188
4316
  const numeric = Number(raw);
4189
4317
  if (!Number.isFinite(numeric)) return raw;
4190
- return _chunkZMT4ATHRcjs.tokenFormatter.format(numeric);
4318
+ return _chunkHAQOFI3Dcjs.tokenFormatter.format(numeric);
4191
4319
  } catch (e27) {
4192
4320
  return "--";
4193
4321
  }
@@ -4197,20 +4325,20 @@ function SolanaTokenSelectStep({
4197
4325
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
4198
4326
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
4199
4327
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4200
- _chunkZMT4ATHRcjs.BodyHeader,
4328
+ _chunkHAQOFI3Dcjs.BodyHeader,
4201
4329
  {
4202
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.WalletIcon, {}),
4330
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.WalletIcon, {}),
4203
4331
  title: "Your assets",
4204
4332
  subtitle: "Select source assets to transfer"
4205
4333
  }
4206
4334
  ),
4207
4335
  loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
4208
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Spinner, { className: "rs-text-tertiary" }),
4336
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Spinner, { className: "rs-text-tertiary" }),
4209
4337
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
4210
4338
  ] }),
4211
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Callout, { variant: "error", children: error }),
4339
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: error }),
4212
4340
  !loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
4213
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.WalletIcon, { className: "rs-empty-icon" }),
4341
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.WalletIcon, { className: "rs-empty-icon" }),
4214
4342
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
4215
4343
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
4216
4344
  solanaAddress.slice(0, 6),
@@ -4241,13 +4369,13 @@ function SolanaTokenSelectStep({
4241
4369
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
4242
4370
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
4243
4371
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4244
- _chunkZMT4ATHRcjs.TokenIcon,
4372
+ _chunkHAQOFI3Dcjs.TokenIcon,
4245
4373
  {
4246
4374
  symbol: entry.token.symbol,
4247
4375
  fallback: entry.token.symbol.slice(0, 4)
4248
4376
  }
4249
4377
  ) }),
4250
- chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CdnIcon, { src: chainIcon, alt: chainName }) })
4378
+ chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: chainIcon, alt: chainName }) })
4251
4379
  ] }),
4252
4380
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-text", children: [
4253
4381
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-name-row", children: [
@@ -4264,14 +4392,14 @@ function SolanaTokenSelectStep({
4264
4392
  ] })
4265
4393
  ] })
4266
4394
  ] }),
4267
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkZMT4ATHRcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
4395
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkHAQOFI3Dcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
4268
4396
  ]
4269
4397
  },
4270
4398
  entry.token.symbol
4271
4399
  );
4272
4400
  }) }),
4273
4401
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4274
- _chunkZMT4ATHRcjs.Button,
4402
+ _chunkHAQOFI3Dcjs.Button,
4275
4403
  {
4276
4404
  onClick: () => selectedEntry && onContinue(
4277
4405
  selectedEntry.token,
@@ -4284,7 +4412,7 @@ function SolanaTokenSelectStep({
4284
4412
  }
4285
4413
  )
4286
4414
  ] }),
4287
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
4415
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
4288
4416
  ] });
4289
4417
  }
4290
4418
 
@@ -4316,7 +4444,7 @@ function SolanaAmountStep({
4316
4444
  const [error, setError] = _react.useState.call(void 0, null);
4317
4445
  const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
4318
4446
  const isSourceStablecoin = _chunk4KCSH4T3cjs.isStablecoinSymbol.call(void 0, token.symbol);
4319
- const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _184 => _184.trim, 'call', _185 => _185(), 'access', _186 => _186.toLowerCase, 'call', _187 => _187()]) === "max";
4447
+ const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _202 => _202.trim, 'call', _203 => _203(), 'access', _204 => _204.toLowerCase, 'call', _205 => _205()]) === "max";
4320
4448
  const tokenPriceUsd = _react.useMemo.call(void 0, () => {
4321
4449
  if (isSourceStablecoin) return 1;
4322
4450
  try {
@@ -4336,7 +4464,7 @@ function SolanaAmountStep({
4336
4464
  const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
4337
4465
  const numeric = Number(raw);
4338
4466
  if (!Number.isFinite(numeric)) return raw;
4339
- return _chunkZMT4ATHRcjs.tokenFormatter.format(numeric);
4467
+ return _chunkHAQOFI3Dcjs.tokenFormatter.format(numeric);
4340
4468
  } catch (e29) {
4341
4469
  return "\u2026";
4342
4470
  }
@@ -4418,8 +4546,8 @@ function SolanaAmountStep({
4418
4546
  return null;
4419
4547
  }
4420
4548
  }, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
4421
- const minDepositUsd = _chunk4KCSH4T3cjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunk4KCSH4T3cjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _188 => _188.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _189 => _189.minDepositUsd]), () => ( null));
4422
- const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _190 => _190.maxDepositUsd]), () => ( null));
4549
+ const minDepositUsd = _chunk4KCSH4T3cjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunk4KCSH4T3cjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _206 => _206.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _207 => _207.minDepositUsd]), () => ( null));
4550
+ const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _208 => _208.maxDepositUsd]), () => ( null));
4423
4551
  const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
4424
4552
  const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
4425
4553
  const exceedsBalance = Boolean(
@@ -4429,7 +4557,7 @@ function SolanaAmountStep({
4429
4557
  const handlePresetClick = (percentage) => {
4430
4558
  const formatted = computePresetAmount(percentage);
4431
4559
  if (!formatted) return;
4432
- _chunkZMT4ATHRcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
4560
+ _chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
4433
4561
  percentage,
4434
4562
  symbol: token.symbol,
4435
4563
  formatted
@@ -4464,7 +4592,7 @@ function SolanaAmountStep({
4464
4592
  try {
4465
4593
  amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
4466
4594
  } catch (e34) {
4467
- _chunkZMT4ATHRcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
4595
+ _chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
4468
4596
  amount,
4469
4597
  sourceAmount: sourceAmountStr,
4470
4598
  reason: "parse-units-failed"
@@ -4479,7 +4607,7 @@ function SolanaAmountStep({
4479
4607
  );
4480
4608
  return;
4481
4609
  }
4482
- _chunkZMT4ATHRcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
4610
+ _chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
4483
4611
  symbol: token.symbol,
4484
4612
  inputAmountUsd: amount,
4485
4613
  sourceAmount: sourceAmountStr,
@@ -4492,7 +4620,7 @@ function SolanaAmountStep({
4492
4620
  const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
4493
4621
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
4494
4622
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
4495
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.WalletIcon, {}), title: "Wallet deposit" }),
4623
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.WalletIcon, {}), title: "Wallet deposit" }),
4496
4624
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
4497
4625
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
4498
4626
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -4512,13 +4640,13 @@ function SolanaAmountStep({
4512
4640
  " available",
4513
4641
  computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4514
4642
  " (~",
4515
- _chunkZMT4ATHRcjs.currencyFormatter.format(computedBalanceUsd),
4643
+ _chunkHAQOFI3Dcjs.currencyFormatter.format(computedBalanceUsd),
4516
4644
  ")"
4517
4645
  ] })
4518
4646
  ] }),
4519
4647
  minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
4520
4648
  "Min. deposit ",
4521
- _chunkZMT4ATHRcjs.currencyFormatter.format(minDepositUsd)
4649
+ _chunkHAQOFI3Dcjs.currencyFormatter.format(minDepositUsd)
4522
4650
  ] })
4523
4651
  ] })
4524
4652
  ] }),
@@ -4541,7 +4669,7 @@ function SolanaAmountStep({
4541
4669
  "Solana ",
4542
4670
  token.symbol
4543
4671
  ] }),
4544
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.TokenIcon, { symbol: token.symbol }) })
4672
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TokenIcon, { symbol: token.symbol }) })
4545
4673
  ] })
4546
4674
  ] }),
4547
4675
  targetChainName && targetTokenSymbol && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
@@ -4552,17 +4680,17 @@ function SolanaAmountStep({
4552
4680
  " ",
4553
4681
  targetTokenSymbol
4554
4682
  ] }),
4555
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.TokenIcon, { symbol: targetTokenSymbol }) })
4683
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TokenIcon, { symbol: targetTokenSymbol }) })
4556
4684
  ] })
4557
4685
  ] }),
4558
4686
  balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
4559
4687
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
4560
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkZMT4ATHRcjs.currencyFormatter.format(balanceAfterUsd) })
4688
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkHAQOFI3Dcjs.currencyFormatter.format(balanceAfterUsd) })
4561
4689
  ] })
4562
4690
  ] }),
4563
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Callout, { variant: "error", children: error }),
4691
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: error }),
4564
4692
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4565
- _chunkZMT4ATHRcjs.Button,
4693
+ _chunkHAQOFI3Dcjs.Button,
4566
4694
  {
4567
4695
  onClick: handleContinue,
4568
4696
  fullWidth: true,
@@ -4571,7 +4699,7 @@ function SolanaAmountStep({
4571
4699
  }
4572
4700
  )
4573
4701
  ] }),
4574
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
4702
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
4575
4703
  ] });
4576
4704
  }
4577
4705
 
@@ -4580,40 +4708,41 @@ function SolanaAmountStep({
4580
4708
 
4581
4709
 
4582
4710
  // src/core/solana.ts
4583
-
4584
-
4585
-
4586
-
4587
-
4588
- var _web3js = require('@solana/web3.js');
4589
-
4590
-
4591
-
4592
-
4593
- var _spltoken = require('@solana/spl-token');
4594
4711
  var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
4595
4712
  var cachedConnections = /* @__PURE__ */ new Map();
4713
+ var dependenciesPromise2;
4714
+ function loadSolanaDependencies() {
4715
+ _nullishCoalesce(dependenciesPromise2, () => ( (dependenciesPromise2 = Promise.all([
4716
+ Promise.resolve().then(() => _interopRequireWildcard(require("@solana/web3.js"))),
4717
+ Promise.resolve().then(() => _interopRequireWildcard(require("@solana/spl-token")))
4718
+ ]))));
4719
+ return dependenciesPromise2;
4720
+ }
4596
4721
  function getSolanaRpcUrl(rpcUrls) {
4597
- return _nullishCoalesce(_chunkZMT4ATHRcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
4722
+ return _nullishCoalesce(_chunkHAQOFI3Dcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
4598
4723
  }
4599
4724
  function hasConfiguredSolanaRpcUrl(rpcUrls) {
4600
- return _chunkZMT4ATHRcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
4725
+ return _chunkHAQOFI3Dcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
4601
4726
  }
4602
- function getSolanaConnection(rpcUrls) {
4727
+ async function getSolanaConnection(rpcUrls) {
4603
4728
  const rpcUrl = getSolanaRpcUrl(rpcUrls);
4604
4729
  const cached = cachedConnections.get(rpcUrl);
4605
4730
  if (cached) {
4606
4731
  return cached;
4607
4732
  }
4608
- const next = new (0, _web3js.Connection)(rpcUrl, "confirmed");
4733
+ const [web3] = await loadSolanaDependencies();
4734
+ const initialized = cachedConnections.get(rpcUrl);
4735
+ if (initialized) return initialized;
4736
+ const next = new web3.Connection(rpcUrl, "confirmed");
4609
4737
  cachedConnections.set(rpcUrl, next);
4610
4738
  return next;
4611
4739
  }
4612
4740
  async function buildSolTransferTransaction(connection, from, to, lamports) {
4613
- const fromPubkey = new (0, _web3js.PublicKey)(from);
4614
- const toPubkey = new (0, _web3js.PublicKey)(to);
4615
- const tx = new (0, _web3js.Transaction)().add(
4616
- _web3js.SystemProgram.transfer({
4741
+ const [web3] = await loadSolanaDependencies();
4742
+ const fromPubkey = new web3.PublicKey(from);
4743
+ const toPubkey = new web3.PublicKey(to);
4744
+ const tx = new web3.Transaction().add(
4745
+ web3.SystemProgram.transfer({
4617
4746
  fromPubkey,
4618
4747
  toPubkey,
4619
4748
  lamports
@@ -4626,16 +4755,24 @@ async function buildSolTransferTransaction(connection, from, to, lamports) {
4626
4755
  return tx;
4627
4756
  }
4628
4757
  async function buildSplTransferTransaction(connection, from, to, mint, amount) {
4629
- const fromPubkey = new (0, _web3js.PublicKey)(from);
4630
- const toPubkey = new (0, _web3js.PublicKey)(to);
4631
- const mintPubkey = new (0, _web3js.PublicKey)(mint);
4632
- const fromAta = await _spltoken.getAssociatedTokenAddress.call(void 0, mintPubkey, fromPubkey);
4633
- const toAta = await _spltoken.getAssociatedTokenAddress.call(void 0, mintPubkey, toPubkey, true);
4634
- const tx = new (0, _web3js.Transaction)();
4758
+ const [web3, splToken] = await loadSolanaDependencies();
4759
+ const fromPubkey = new web3.PublicKey(from);
4760
+ const toPubkey = new web3.PublicKey(to);
4761
+ const mintPubkey = new web3.PublicKey(mint);
4762
+ const fromAta = await splToken.getAssociatedTokenAddress(
4763
+ mintPubkey,
4764
+ fromPubkey
4765
+ );
4766
+ const toAta = await splToken.getAssociatedTokenAddress(
4767
+ mintPubkey,
4768
+ toPubkey,
4769
+ true
4770
+ );
4771
+ const tx = new web3.Transaction();
4635
4772
  const toAtaInfo = await connection.getAccountInfo(toAta);
4636
4773
  if (!toAtaInfo) {
4637
4774
  tx.add(
4638
- _spltoken.createAssociatedTokenAccountInstruction.call(void 0,
4775
+ splToken.createAssociatedTokenAccountInstruction(
4639
4776
  fromPubkey,
4640
4777
  toAta,
4641
4778
  toPubkey,
@@ -4643,7 +4780,9 @@ async function buildSplTransferTransaction(connection, from, to, mint, amount) {
4643
4780
  )
4644
4781
  );
4645
4782
  }
4646
- tx.add(_spltoken.createTransferInstruction.call(void 0, fromAta, toAta, fromPubkey, amount));
4783
+ tx.add(
4784
+ splToken.createTransferInstruction(fromAta, toAta, fromPubkey, amount)
4785
+ );
4647
4786
  const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash();
4648
4787
  tx.recentBlockhash = blockhash;
4649
4788
  tx.lastValidBlockHeight = lastValidBlockHeight;
@@ -4699,7 +4838,7 @@ function SolanaConfirmStep({
4699
4838
  onError,
4700
4839
  debug
4701
4840
  }) {
4702
- const rpcUrls = _chunkZMT4ATHRcjs.useRpcUrls.call(void 0, );
4841
+ const rpcUrls = _chunkHAQOFI3Dcjs.useRpcUrls.call(void 0, );
4703
4842
  const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
4704
4843
  const [error, setError] = _react.useState.call(void 0, null);
4705
4844
  const targetChainId = _chunk4KCSH4T3cjs.targetChainToChainId.call(void 0, targetChain);
@@ -4708,28 +4847,28 @@ function SolanaConfirmStep({
4708
4847
  const targetChainName = _chunk4KCSH4T3cjs.getChainName.call(void 0, targetChainId);
4709
4848
  const sourceChainIcon = _chunk4KCSH4T3cjs.getChainIcon.call(void 0, "solana");
4710
4849
  const targetChainIcon = _chunk4KCSH4T3cjs.getChainIcon.call(void 0, targetChainId);
4711
- const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _191 => _191.feeSponsored]), () => ( false));
4712
- const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _192 => _192.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
4713
- const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkZMT4ATHRcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
4850
+ const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _209 => _209.feeSponsored]), () => ( false));
4851
+ const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _210 => _210.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
4852
+ const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkHAQOFI3Dcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
4714
4853
  const receiveDisplay = (() => {
4715
4854
  const usdValue = Number(targetAmount);
4716
4855
  const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
4717
- const estimate = _chunkZMT4ATHRcjs.formatReceiveEstimate.call(void 0, {
4856
+ const estimate = _chunkHAQOFI3Dcjs.formatReceiveEstimate.call(void 0, {
4718
4857
  sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
4719
4858
  sourceSymbol: token.symbol,
4720
4859
  targetSymbol,
4721
4860
  sourceAmountUsd,
4722
- sourceTrusted: _chunkZMT4ATHRcjs.isRecognizedToken.call(void 0, token.mint, "solana"),
4861
+ sourceTrusted: _chunkHAQOFI3Dcjs.isRecognizedToken.call(void 0, token.mint, "solana"),
4723
4862
  // Curated stablecoin target estimates at $1 when unquoted; never applied
4724
4863
  // to the source (a held token). See ConfirmStep for the rationale.
4725
- prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkZMT4ATHRcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
4864
+ prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkHAQOFI3Dcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
4726
4865
  });
4727
4866
  if (estimate !== void 0) return estimate;
4728
4867
  return targetSymbol;
4729
4868
  })();
4730
4869
  const handleConfirm = async () => {
4731
4870
  if (!solanaProvider) {
4732
- _chunkZMT4ATHRcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
4871
+ _chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
4733
4872
  reason: "missing-provider"
4734
4873
  });
4735
4874
  setError("Solana wallet not connected");
@@ -4737,7 +4876,7 @@ function SolanaConfirmStep({
4737
4876
  }
4738
4877
  const parsedAmount = parseFloat(sourceAmount);
4739
4878
  if (isNaN(parsedAmount) || parsedAmount <= 0) {
4740
- _chunkZMT4ATHRcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
4879
+ _chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
4741
4880
  reason: "invalid-amount",
4742
4881
  sourceAmount
4743
4882
  });
@@ -4746,7 +4885,7 @@ function SolanaConfirmStep({
4746
4885
  }
4747
4886
  setError(null);
4748
4887
  setIsSubmitting(true);
4749
- _chunkZMT4ATHRcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
4888
+ _chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
4750
4889
  smartAccount,
4751
4890
  solanaAddress,
4752
4891
  solanaDepositAddress,
@@ -4756,7 +4895,7 @@ function SolanaConfirmStep({
4756
4895
  });
4757
4896
  try {
4758
4897
  const check = await service.checkAccount(smartAccount);
4759
- _chunkZMT4ATHRcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
4898
+ _chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
4760
4899
  smartAccount,
4761
4900
  isRegistered: check.isRegistered,
4762
4901
  targetChain: check.targetChain,
@@ -4767,9 +4906,9 @@ function SolanaConfirmStep({
4767
4906
  "Deposit account is not registered yet. Please restart setup and try again."
4768
4907
  );
4769
4908
  }
4770
- const connection = hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls)));
4909
+ const connection = await (hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls))));
4771
4910
  const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
4772
- _chunkZMT4ATHRcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
4911
+ _chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
4773
4912
  token: token.symbol,
4774
4913
  sourceAmount,
4775
4914
  amountUnits: amountUnits.toString()
@@ -4786,10 +4925,10 @@ function SolanaConfirmStep({
4786
4925
  token.mint,
4787
4926
  amountUnits
4788
4927
  );
4789
- _chunkZMT4ATHRcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
4928
+ _chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
4790
4929
  token: token.symbol,
4791
4930
  instructionCount: transaction.instructions.length,
4792
- feePayer: _optionalChain([transaction, 'access', _193 => _193.feePayer, 'optionalAccess', _194 => _194.toBase58, 'call', _195 => _195()]),
4931
+ feePayer: _optionalChain([transaction, 'access', _211 => _211.feePayer, 'optionalAccess', _212 => _212.toBase58, 'call', _213 => _213()]),
4793
4932
  recentBlockhash: transaction.recentBlockhash
4794
4933
  });
4795
4934
  const txHash = await sendSolanaTransaction(
@@ -4797,7 +4936,7 @@ function SolanaConfirmStep({
4797
4936
  connection,
4798
4937
  transaction
4799
4938
  );
4800
- _chunkZMT4ATHRcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
4939
+ _chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
4801
4940
  txHash,
4802
4941
  amountUnits: amountUnits.toString()
4803
4942
  });
@@ -4809,21 +4948,21 @@ function SolanaConfirmStep({
4809
4948
  });
4810
4949
  } catch (err) {
4811
4950
  const raw = err instanceof Error ? err.message : "Transfer failed";
4812
- const message = _chunkZMT4ATHRcjs.formatUserError.call(void 0, raw);
4813
- _chunkZMT4ATHRcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
4951
+ const message = _chunkHAQOFI3Dcjs.formatUserError.call(void 0, raw);
4952
+ _chunkHAQOFI3Dcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
4814
4953
  smartAccount,
4815
4954
  token: token.symbol,
4816
4955
  sourceAmount
4817
4956
  });
4818
4957
  setError(message);
4819
- _optionalChain([onError, 'optionalCall', _196 => _196(message, "SOLANA_TRANSFER_ERROR", raw)]);
4958
+ _optionalChain([onError, 'optionalCall', _214 => _214(message, "SOLANA_TRANSFER_ERROR", raw)]);
4820
4959
  } finally {
4821
4960
  setIsSubmitting(false);
4822
4961
  }
4823
4962
  };
4824
4963
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
4825
4964
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
4826
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.WalletIcon, {}), title: "Review deposit" }),
4965
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.WalletIcon, {}), title: "Review deposit" }),
4827
4966
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4828
4967
  ReviewDetails,
4829
4968
  {
@@ -4839,9 +4978,9 @@ function SolanaConfirmStep({
4839
4978
  fee: { display: "$0.04", struck: feeSponsored, tooltip: feeTooltip }
4840
4979
  }
4841
4980
  ),
4842
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Callout, { variant: "error", children: error }),
4981
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: error }),
4843
4982
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4844
- _chunkZMT4ATHRcjs.Button,
4983
+ _chunkHAQOFI3Dcjs.Button,
4845
4984
  {
4846
4985
  onClick: handleConfirm,
4847
4986
  loading: isSubmitting,
@@ -4852,7 +4991,7 @@ function SolanaConfirmStep({
4852
4991
  }
4853
4992
  )
4854
4993
  ] }),
4855
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
4994
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
4856
4995
  ] });
4857
4996
  }
4858
4997
 
@@ -4867,19 +5006,19 @@ function DappImportAssetSelectStep({
4867
5006
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
4868
5007
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
4869
5008
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4870
- _chunkZMT4ATHRcjs.BodyHeader,
5009
+ _chunkHAQOFI3Dcjs.BodyHeader,
4871
5010
  {
4872
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.WalletIcon, {}),
5011
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.WalletIcon, {}),
4873
5012
  title: `Transfer from ${sourceLabel}`,
4874
5013
  subtitle: "Pick the balance to import"
4875
5014
  }
4876
5015
  ),
4877
5016
  incompleteSummary && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-notice", role: "status", children: incompleteSummary }),
4878
5017
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
4879
- const tokenAmount = asset.balance ? _chunkZMT4ATHRcjs.tokenFormatter.format(
5018
+ const tokenAmount = asset.balance ? _chunkHAQOFI3Dcjs.tokenFormatter.format(
4880
5019
  Number(asset.balance) / 10 ** asset.decimals
4881
5020
  ) : "0";
4882
- const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkZMT4ATHRcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
5021
+ const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkHAQOFI3Dcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
4883
5022
  const assetIcon = asset.icon;
4884
5023
  const chainIcon = _chunk4KCSH4T3cjs.getChainIcon.call(void 0, asset.chainId);
4885
5024
  const badge = _chunk4KCSH4T3cjs.getChainBadge.call(void 0, asset.chainId);
@@ -4892,14 +5031,14 @@ function DappImportAssetSelectStep({
4892
5031
  children: [
4893
5032
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
4894
5033
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
4895
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CdnIcon, { src: assetIcon, alt: asset.symbol }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4896
- _chunkZMT4ATHRcjs.TokenIcon,
5034
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: assetIcon, alt: asset.symbol }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5035
+ _chunkHAQOFI3Dcjs.TokenIcon,
4897
5036
  {
4898
5037
  symbol: asset.symbol,
4899
5038
  fallback: asset.symbol.slice(0, 4)
4900
5039
  }
4901
5040
  ) }),
4902
- chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CdnIcon, { src: chainIcon, alt: _chunk4KCSH4T3cjs.getChainName.call(void 0, asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5041
+ chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: chainIcon, alt: _chunk4KCSH4T3cjs.getChainName.call(void 0, asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4903
5042
  "span",
4904
5043
  {
4905
5044
  className: "rs-asset-chain-badge",
@@ -4931,7 +5070,7 @@ function DappImportAssetSelectStep({
4931
5070
  );
4932
5071
  }) })
4933
5072
  ] }),
4934
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
5073
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
4935
5074
  ] });
4936
5075
  }
4937
5076
  DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
@@ -4953,7 +5092,7 @@ function describeRow(status, comingSoon) {
4953
5092
  }
4954
5093
  if (status.enabled) {
4955
5094
  return {
4956
- subtitle: status.balanceUsd > 0 ? _chunkZMT4ATHRcjs.currencyFormatter.format(status.balanceUsd) : "No balance",
5095
+ subtitle: status.balanceUsd > 0 ? _chunkHAQOFI3Dcjs.currencyFormatter.format(status.balanceUsd) : "No balance",
4957
5096
  disabled: false,
4958
5097
  busy: false
4959
5098
  };
@@ -4976,9 +5115,9 @@ function DappImportSelectStep({
4976
5115
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
4977
5116
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
4978
5117
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4979
- _chunkZMT4ATHRcjs.BodyHeader,
5118
+ _chunkHAQOFI3Dcjs.BodyHeader,
4980
5119
  {
4981
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.MigrateAssetsIcon, {}),
5120
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.MigrateAssetsIcon, {}),
4982
5121
  title: "Migrate assets",
4983
5122
  subtitle: "Select a position to migrate"
4984
5123
  }
@@ -4990,16 +5129,16 @@ function DappImportSelectStep({
4990
5129
  Boolean(brand.comingSoon)
4991
5130
  );
4992
5131
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4993
- _chunkHOGZKHHYcjs.ListRow,
5132
+ _chunk62UCV2LGcjs.ListRow,
4994
5133
  {
4995
5134
  leadingMedia: brand.iconUrl,
4996
5135
  title: brand.label,
4997
5136
  subtitle,
4998
5137
  disabled,
4999
- trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Spinner, { className: "rs-spinner--sm" }) : void 0,
5138
+ trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Spinner, { className: "rs-spinner--sm" }) : void 0,
5000
5139
  onClick: () => {
5001
5140
  if (status === "needs-connect") {
5002
- _optionalChain([onRequestConnect, 'optionalCall', _197 => _197()]);
5141
+ _optionalChain([onRequestConnect, 'optionalCall', _215 => _215()]);
5003
5142
  return;
5004
5143
  }
5005
5144
  onSelect(brand.id);
@@ -5009,7 +5148,7 @@ function DappImportSelectStep({
5009
5148
  );
5010
5149
  }) })
5011
5150
  ] }),
5012
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
5151
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
5013
5152
  ] });
5014
5153
  }
5015
5154
  DappImportSelectStep.displayName = "DappImportSelectStep";
@@ -5026,9 +5165,9 @@ function DappImportAssetSelectSkeleton({
5026
5165
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
5027
5166
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
5028
5167
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5029
- _chunkZMT4ATHRcjs.BodyHeader,
5168
+ _chunkHAQOFI3Dcjs.BodyHeader,
5030
5169
  {
5031
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.WalletIcon, {}),
5170
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.WalletIcon, {}),
5032
5171
  title: `Transfer from ${sourceLabel}`,
5033
5172
  subtitle: "Pick the balance to import"
5034
5173
  }
@@ -5066,7 +5205,7 @@ function DappImportAssetSelectSkeleton({
5066
5205
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
5067
5206
  }
5068
5207
  ) }),
5069
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
5208
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
5070
5209
  ] });
5071
5210
  }
5072
5211
  DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
@@ -5155,7 +5294,7 @@ var aaveProvider = {
5155
5294
  throw new Error("Aave positions require a backend connection");
5156
5295
  }
5157
5296
  const response = await backend.getPositions(eoa);
5158
- if (_optionalChain([signal, 'optionalAccess', _198 => _198.aborted])) return null;
5297
+ if (_optionalChain([signal, 'optionalAccess', _216 => _216.aborted])) return null;
5159
5298
  const assets = toImportableAssets(response.positions);
5160
5299
  const failures = _nullishCoalesce(response.failures, () => ( []));
5161
5300
  if (assets.length === 0) {
@@ -5488,21 +5627,21 @@ var polymarketProvider = {
5488
5627
  async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
5489
5628
  const proxyWallet = await _chunkDW2EQA2Ucjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
5490
5629
  if (!proxyWallet) return null;
5491
- if (_optionalChain([signal, 'optionalAccess', _199 => _199.aborted])) return null;
5630
+ if (_optionalChain([signal, 'optionalAccess', _217 => _217.aborted])) return null;
5492
5631
  const polygonClient = getPublicClient2(_chunkDW2EQA2Ucjs.POLYMARKET_POLYGON_CHAIN_ID);
5493
5632
  if (!polygonClient) return null;
5494
5633
  const balances = await _chunkDW2EQA2Ucjs.readPolymarketBalances.call(void 0, {
5495
5634
  publicClient: polygonClient,
5496
5635
  proxyWallet
5497
5636
  });
5498
- if (_optionalChain([signal, 'optionalAccess', _200 => _200.aborted])) return null;
5637
+ if (_optionalChain([signal, 'optionalAccess', _218 => _218.aborted])) return null;
5499
5638
  if (balances.pusd === 0n && balances.usdce === 0n) return null;
5500
5639
  const walletKind = await detectPolymarketWalletKind({
5501
5640
  publicClient: polygonClient,
5502
5641
  proxyWallet,
5503
5642
  eoa
5504
5643
  });
5505
- if (_optionalChain([signal, 'optionalAccess', _201 => _201.aborted])) return null;
5644
+ if (_optionalChain([signal, 'optionalAccess', _219 => _219.aborted])) return null;
5506
5645
  if (!walletKind) return null;
5507
5646
  const assets = [];
5508
5647
  if (balances.pusd > 0n) {
@@ -5613,7 +5752,7 @@ function getEnabledProviders(config) {
5613
5752
  function computeDappImportStatus(providerId, inputs) {
5614
5753
  const { owner, availability, availabilityOwner, setup } = inputs;
5615
5754
  if (!owner) return "needs-connect";
5616
- const entry = _optionalChain([availabilityOwner, 'optionalAccess', _202 => _202.toLowerCase, 'call', _203 => _203()]) === owner.toLowerCase() ? availability[providerId] : void 0;
5755
+ const entry = _optionalChain([availabilityOwner, 'optionalAccess', _220 => _220.toLowerCase, 'call', _221 => _221()]) === owner.toLowerCase() ? availability[providerId] : void 0;
5617
5756
  if (entry === "loading" || entry === void 0) return "loading";
5618
5757
  if (entry === "error") {
5619
5758
  return {
@@ -5659,6 +5798,295 @@ function bootRetryPlan(params) {
5659
5798
  };
5660
5799
  }
5661
5800
 
5801
+ // src/core/deposit-analytics.tsx
5802
+
5803
+
5804
+
5805
+
5806
+
5807
+
5808
+ function fundingMethodForFlowMode(mode) {
5809
+ switch (mode) {
5810
+ case "wallet":
5811
+ case "solana-wallet":
5812
+ return "wallet";
5813
+ case "deposit-address":
5814
+ return "transfer";
5815
+ case "fiat-onramp":
5816
+ return "fiat_onramp";
5817
+ case "exchange-connect":
5818
+ return "exchange_connect";
5819
+ case "dapp-import":
5820
+ return "asset_migration";
5821
+ default:
5822
+ return null;
5823
+ }
5824
+ }
5825
+ function analyticsStepForFlowStep(method, step) {
5826
+ if (!method) {
5827
+ return step === "setup" ? "account_setup" : "funding_method_home";
5828
+ }
5829
+ switch (step) {
5830
+ case "connect":
5831
+ return method === "wallet" ? "wallet_connect" : "funding_method_home";
5832
+ case "setup":
5833
+ return "account_setup";
5834
+ case "select-asset":
5835
+ return "wallet_source_asset";
5836
+ case "solana-token-select":
5837
+ return "wallet_source_token";
5838
+ case "amount":
5839
+ case "solana-amount":
5840
+ return method === "asset_migration" ? "migration_amount" : "wallet_amount";
5841
+ case "confirm":
5842
+ case "solana-confirm":
5843
+ return method === "asset_migration" ? "migration_review" : "wallet_review";
5844
+ case "processing":
5845
+ return method === "asset_migration" ? "migration_processing" : method === "transfer" ? "transfer_tracking" : method === "fiat_onramp" ? "fiat_receipt" : method === "exchange_connect" ? "exchange_receipt" : "wallet_processing";
5846
+ case "deposit-address":
5847
+ return "transfer_address_shown";
5848
+ case "qr-amount":
5849
+ return "transfer_fee_amount";
5850
+ case "qr-review":
5851
+ return "transfer_fee_review";
5852
+ case "fiat-onramp":
5853
+ return "fiat_provider_handoff";
5854
+ case "exchange-select":
5855
+ return "exchange_selection";
5856
+ case "exchange-connect":
5857
+ return "exchange_provider_handoff";
5858
+ case "dapp-import-resolving":
5859
+ return "migration_boot_resolve";
5860
+ case "dapp-import-select":
5861
+ return "migration_provider_selection";
5862
+ case "dapp-import-asset-select":
5863
+ return "migration_asset_selection";
5864
+ default:
5865
+ return "funding_method_home";
5866
+ }
5867
+ }
5868
+ function failureReasonForCode(code, cause) {
5869
+ const normalized = `${_nullishCoalesce(code, () => ( ""))} ${_nullishCoalesce(cause, () => ( ""))}`.toLowerCase();
5870
+ if (normalized.includes("uncertain")) return "submission_uncertain";
5871
+ if (normalized.includes("reject") && (normalized.includes("sign") || normalized.includes("permit"))) {
5872
+ return "wallet_signature_rejected";
5873
+ }
5874
+ if (normalized.includes("permit")) {
5875
+ return "wallet_permit_preparation_unavailable";
5876
+ }
5877
+ if (normalized.includes("clipboard")) return "transfer_clipboard_failed";
5878
+ if (normalized.includes("switch") && normalized.includes("reject")) {
5879
+ return "wallet_chain_switch_rejected";
5880
+ }
5881
+ if (normalized.includes("reject")) return "submission_rejected";
5882
+ if (normalized.includes("switch")) return "wallet_chain_switch_failed";
5883
+ if (normalized.includes("quote")) return "quote_unavailable";
5884
+ if (normalized.includes("price")) return "quote_source_price_unavailable";
5885
+ if (normalized.includes("iframe_timeout")) return "swapped_iframe_timeout";
5886
+ if (normalized.includes("connect_exchanges") || normalized.includes("exchange_list")) {
5887
+ return "exchange_list_failed";
5888
+ }
5889
+ if (normalized.includes("browser")) return "swapped_browser_open_failed";
5890
+ if (normalized.includes("swapped") || normalized.includes("onramp")) {
5891
+ return "swapped_mint_failed";
5892
+ }
5893
+ if (normalized.includes("solana") || normalized.includes("transfer")) {
5894
+ return "submission_failed";
5895
+ }
5896
+ return "submission_failed";
5897
+ }
5898
+ function correlatorKey(correlator) {
5899
+ return `${correlator.type}:${correlator.value}`;
5900
+ }
5901
+ function createDepositAnalyticsController(emit) {
5902
+ let method = null;
5903
+ let step = null;
5904
+ let afterHandoff = false;
5905
+ let opened = false;
5906
+ let closed = false;
5907
+ const dedupe = /* @__PURE__ */ new Set();
5908
+ const emitOnce = (key, ...args) => {
5909
+ if (dedupe.has(key)) return;
5910
+ dedupe.add(key);
5911
+ emit(...args);
5912
+ };
5913
+ const controller = {
5914
+ emit,
5915
+ openSession() {
5916
+ if (opened) return;
5917
+ opened = true;
5918
+ emit({ type: "deposit_modal_open" }, null);
5919
+ },
5920
+ selectMethod(...args) {
5921
+ const [nextMethod, entrySource, identifiers] = args;
5922
+ controller.openSession();
5923
+ if (method && method !== nextMethod && !afterHandoff) {
5924
+ controller.abandon("method_replacement");
5925
+ }
5926
+ method = nextMethod;
5927
+ step = null;
5928
+ afterHandoff = false;
5929
+ emitOnce(
5930
+ `method:${nextMethod}:${entrySource}:${JSON.stringify(_nullishCoalesce(identifiers, () => ( {})))}`,
5931
+ ...[
5932
+ {
5933
+ type: "deposit_modal_method_selected",
5934
+ entry_source: entrySource,
5935
+ ...identifiers ? { identifiers } : {}
5936
+ },
5937
+ nextMethod
5938
+ ]
5939
+ );
5940
+ },
5941
+ openStep(nextStep) {
5942
+ controller.openSession();
5943
+ if (step === nextStep) return;
5944
+ step = nextStep;
5945
+ emitOnce(
5946
+ `step-open:${_nullishCoalesce(method, () => ( "none"))}:${nextStep}`,
5947
+ { type: "deposit_modal_step_open", step: nextStep },
5948
+ method
5949
+ );
5950
+ },
5951
+ completeStep(completedStep = _nullishCoalesce(step, () => ( void 0))) {
5952
+ if (!completedStep) return;
5953
+ emitOnce(
5954
+ `step-complete:${_nullishCoalesce(method, () => ( "none"))}:${completedStep}`,
5955
+ { type: "deposit_modal_step_complete", step: completedStep },
5956
+ method
5957
+ );
5958
+ },
5959
+ friction(reason, eventStep = _nullishCoalesce(step, () => ( void 0))) {
5960
+ if (!eventStep) return;
5961
+ emitOnce(
5962
+ `friction:${method}:${eventStep}:${reason}`,
5963
+ {
5964
+ type: "deposit_modal_friction",
5965
+ step: eventStep,
5966
+ reason
5967
+ },
5968
+ method
5969
+ );
5970
+ },
5971
+ failure(reason, retryable, eventStep = _nullishCoalesce(step, () => ( void 0))) {
5972
+ if (!eventStep) return;
5973
+ emitOnce(
5974
+ `failure:${method}:${eventStep}:${reason}`,
5975
+ {
5976
+ type: "deposit_modal_failure",
5977
+ step: eventStep,
5978
+ reason,
5979
+ retryable
5980
+ },
5981
+ method
5982
+ );
5983
+ },
5984
+ retry(reason, eventStep = _nullishCoalesce(step, () => ( void 0))) {
5985
+ if (!eventStep) return;
5986
+ emit({ type: "deposit_modal_retry", step: eventStep, reason }, method);
5987
+ for (const key of [...dedupe]) {
5988
+ if (key.includes(`:${method}:${eventStep}:`)) dedupe.delete(key);
5989
+ }
5990
+ },
5991
+ handoff(...args) {
5992
+ const [handoffMethod, correlator, eventStep = _nullishCoalesce(step, () => ( void 0)), identifiers] = args;
5993
+ if (!eventStep) return;
5994
+ if (step !== eventStep) controller.openStep(eventStep);
5995
+ afterHandoff = true;
5996
+ emitOnce(
5997
+ `handoff:${correlatorKey(correlator)}:${JSON.stringify(_nullishCoalesce(identifiers, () => ( {})))}`,
5998
+ ...[
5999
+ {
6000
+ type: "deposit_modal_handoff",
6001
+ step: eventStep,
6002
+ correlator,
6003
+ ...identifiers ? { identifiers } : {}
6004
+ },
6005
+ handoffMethod
6006
+ ]
6007
+ );
6008
+ },
6009
+ observeCorrelator(correlator, eventStep = _nullishCoalesce(step, () => ( void 0))) {
6010
+ if (!eventStep) return;
6011
+ const key = `correlator:${correlatorKey(correlator)}`;
6012
+ if (dedupe.has(key)) return;
6013
+ if (step !== eventStep) controller.openStep(eventStep);
6014
+ emitOnce(
6015
+ key,
6016
+ {
6017
+ type: "deposit_modal_correlator_observed",
6018
+ step: eventStep,
6019
+ correlator
6020
+ },
6021
+ method
6022
+ );
6023
+ },
6024
+ outcome(outcome) {
6025
+ if (!step) return;
6026
+ emitOnce(
6027
+ `outcome:${method}:${outcome}`,
6028
+ { type: "deposit_modal_ui_outcome", step, outcome },
6029
+ method
6030
+ );
6031
+ },
6032
+ abandon(reason) {
6033
+ if (!method || !step || afterHandoff) return;
6034
+ emitOnce(
6035
+ `abandon:${method}:${reason}`,
6036
+ { type: "deposit_modal_method_abandoned", step, reason },
6037
+ method
6038
+ );
6039
+ },
6040
+ close(source) {
6041
+ if (closed) return;
6042
+ closed = true;
6043
+ emit(
6044
+ {
6045
+ type: "deposit_modal_close",
6046
+ source,
6047
+ step,
6048
+ after_handoff: afterHandoff
6049
+ },
6050
+ method
6051
+ );
6052
+ },
6053
+ resetAttempt(nextMethod = null) {
6054
+ method = nextMethod;
6055
+ step = null;
6056
+ afterHandoff = false;
6057
+ dedupe.clear();
6058
+ },
6059
+ get method() {
6060
+ return method;
6061
+ },
6062
+ get step() {
6063
+ return step;
6064
+ },
6065
+ get afterHandoff() {
6066
+ return afterHandoff;
6067
+ }
6068
+ };
6069
+ return controller;
6070
+ }
6071
+ var DepositAnalyticsControllerContext = _react.createContext.call(void 0, null);
6072
+ var noopController = createDepositAnalyticsController(() => {
6073
+ });
6074
+ function DepositAnalyticsControllerProvider({
6075
+ children,
6076
+ controllerRef
6077
+ }) {
6078
+ const emit = _chunkHAQOFI3Dcjs.useDepositAnalyticsEmitter.call(void 0, );
6079
+ const controller = _react.useMemo.call(void 0,
6080
+ () => createDepositAnalyticsController(emit),
6081
+ [emit]
6082
+ );
6083
+ if (controllerRef) controllerRef.current = controller;
6084
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositAnalyticsControllerContext.Provider, { value: controller, children });
6085
+ }
6086
+ function useDepositAnalyticsController() {
6087
+ return _nullishCoalesce(_react.useContext.call(void 0, DepositAnalyticsControllerContext), () => ( noopController));
6088
+ }
6089
+
5662
6090
  // src/store/index.ts
5663
6091
 
5664
6092
  var _zustand = require('zustand');
@@ -6167,7 +6595,7 @@ function applyAction(state, action) {
6167
6595
  totalUsd: null,
6168
6596
  // Keep any prior chains visible so the cluster does not flicker
6169
6597
  // empty across a refresh.
6170
- chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _204 => _204.chainIds]), () => ( []))
6598
+ chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _222 => _222.chainIds]), () => ( []))
6171
6599
  }
6172
6600
  }
6173
6601
  }
@@ -6378,7 +6806,7 @@ function applyAction(state, action) {
6378
6806
  flow: { ...state.flow, step: "processing" }
6379
6807
  };
6380
6808
  case "processing/quote-loaded":
6381
- if (state.flow.step !== "processing" || _optionalChain([state, 'access', _205 => _205.processing, 'access', _206 => _206.txHash, 'optionalAccess', _207 => _207.toLowerCase, 'call', _208 => _208()]) !== action.txHash.toLowerCase()) {
6809
+ if (state.flow.step !== "processing" || _optionalChain([state, 'access', _223 => _223.processing, 'access', _224 => _224.txHash, 'optionalAccess', _225 => _225.toLowerCase, 'call', _226 => _226()]) !== action.txHash.toLowerCase()) {
6382
6810
  return state;
6383
6811
  }
6384
6812
  return {
@@ -6955,6 +7383,7 @@ function DepositFlow({
6955
7383
  fiatMethods,
6956
7384
  enableExchangeConnect = false,
6957
7385
  walletSession,
7386
+ walletIntegration,
6958
7387
  onConnect,
6959
7388
  onDisconnect,
6960
7389
  onRequestConnect,
@@ -6967,15 +7396,14 @@ function DepositFlow({
6967
7396
  onSubmittingChange,
6968
7397
  onClose,
6969
7398
  onLifecycle,
6970
- onEvent,
6971
7399
  onError,
6972
7400
  debug
6973
7401
  }) {
6974
- const rpcUrls = _chunkZMT4ATHRcjs.useRpcUrls.call(void 0, );
6975
- const onStepChangeRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onStepChange);
6976
- const onEventRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onEvent);
6977
- const onLifecycleRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onLifecycle);
6978
- const onErrorRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onError);
7402
+ const rpcUrls = _chunkHAQOFI3Dcjs.useRpcUrls.call(void 0, );
7403
+ const onStepChangeRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onStepChange);
7404
+ const analytics = useDepositAnalyticsController();
7405
+ const onLifecycleRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onLifecycle);
7406
+ const onErrorRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onError);
6979
7407
  const storeApi = useDepositStoreApi();
6980
7408
  const flowSlice = useDepositStore((s) => s.flow);
6981
7409
  const depositSlice = useDepositStore((s) => s.deposit);
@@ -6992,13 +7420,13 @@ function DepositFlow({
6992
7420
  const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
6993
7421
  const logFlow = _react.useCallback.call(void 0,
6994
7422
  (message, data) => {
6995
- _chunkZMT4ATHRcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
7423
+ _chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
6996
7424
  },
6997
7425
  [debug]
6998
7426
  );
6999
7427
  const logFlowError = _react.useCallback.call(void 0,
7000
7428
  (message, error, data) => {
7001
- _chunkZMT4ATHRcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
7429
+ _chunkHAQOFI3Dcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
7002
7430
  },
7003
7431
  [debug]
7004
7432
  );
@@ -7022,12 +7450,12 @@ function DepositFlow({
7022
7450
  };
7023
7451
  }, [enableSwappedPreconnect]);
7024
7452
  const dappSwitchChain = _react.useMemo.call(void 0, () => {
7025
- if (!_optionalChain([walletClientProp, 'optionalAccess', _209 => _209.switchChain])) return void 0;
7453
+ if (!_optionalChain([walletClientProp, 'optionalAccess', _227 => _227.switchChain])) return void 0;
7026
7454
  return async (chainId) => {
7027
- await _optionalChain([walletClientProp, 'access', _210 => _210.switchChain, 'optionalCall', _211 => _211({ id: chainId })]);
7455
+ await _optionalChain([walletClientProp, 'access', _228 => _228.switchChain, 'optionalCall', _229 => _229({ id: chainId })]);
7028
7456
  };
7029
7457
  }, [walletClientProp]);
7030
- const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _212 => _212.account, 'optionalAccess', _213 => _213.address]), () => ( null));
7458
+ const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _230 => _230.account, 'optionalAccess', _231 => _231.address]), () => ( null));
7031
7459
  const walletOptions = _react.useMemo.call(void 0, () => {
7032
7460
  const options = [];
7033
7461
  const seen = /* @__PURE__ */ new Set();
@@ -7041,7 +7469,7 @@ function DepositFlow({
7041
7469
  });
7042
7470
  seen.add(id);
7043
7471
  }
7044
- if (_optionalChain([walletSession, 'optionalAccess', _214 => _214.isConnected]) && walletSession.isSolana && walletSession.solanaAddress) {
7472
+ if (_optionalChain([walletSession, 'optionalAccess', _232 => _232.isConnected]) && walletSession.isSolana && walletSession.solanaAddress) {
7045
7473
  const id = _nullishCoalesce(walletSession.caipAddress, () => ( `solana:${walletSession.solanaAddress}`));
7046
7474
  if (!seen.has(id)) {
7047
7475
  options.push({
@@ -7053,7 +7481,7 @@ function DepositFlow({
7053
7481
  });
7054
7482
  seen.add(id);
7055
7483
  }
7056
- } else if (_optionalChain([walletSession, 'optionalAccess', _215 => _215.address]) && walletSession.isConnected && walletSession.canSignEvm && !seen.has(`evm:${walletSession.address.toLowerCase()}`)) {
7484
+ } else if (_optionalChain([walletSession, 'optionalAccess', _233 => _233.address]) && walletSession.isConnected && walletSession.canSignEvm && !seen.has(`evm:${walletSession.address.toLowerCase()}`)) {
7057
7485
  const id = `evm:${walletSession.address.toLowerCase()}`;
7058
7486
  if (!seen.has(id)) {
7059
7487
  options.push({
@@ -7069,13 +7497,13 @@ function DepositFlow({
7069
7497
  return options;
7070
7498
  }, [
7071
7499
  connectedWalletAddress,
7072
- _optionalChain([walletSession, 'optionalAccess', _216 => _216.address]),
7073
- _optionalChain([walletSession, 'optionalAccess', _217 => _217.isConnected]),
7074
- _optionalChain([walletSession, 'optionalAccess', _218 => _218.canSignEvm]),
7075
- _optionalChain([walletSession, 'optionalAccess', _219 => _219.icon]),
7076
- _optionalChain([walletSession, 'optionalAccess', _220 => _220.isSolana]),
7077
- _optionalChain([walletSession, 'optionalAccess', _221 => _221.solanaAddress]),
7078
- _optionalChain([walletSession, 'optionalAccess', _222 => _222.caipAddress])
7500
+ _optionalChain([walletSession, 'optionalAccess', _234 => _234.address]),
7501
+ _optionalChain([walletSession, 'optionalAccess', _235 => _235.isConnected]),
7502
+ _optionalChain([walletSession, 'optionalAccess', _236 => _236.canSignEvm]),
7503
+ _optionalChain([walletSession, 'optionalAccess', _237 => _237.icon]),
7504
+ _optionalChain([walletSession, 'optionalAccess', _238 => _238.isSolana]),
7505
+ _optionalChain([walletSession, 'optionalAccess', _239 => _239.solanaAddress]),
7506
+ _optionalChain([walletSession, 'optionalAccess', _240 => _240.caipAddress])
7079
7507
  ]);
7080
7508
  const offeredFiatMethods = _react.useMemo.call(void 0,
7081
7509
  () => fiatMethods ? FIAT_ONRAMP_METHODS.filter((m) => fiatMethods[m.method]) : FIAT_ONRAMP_METHODS,
@@ -7095,11 +7523,11 @@ function DepositFlow({
7095
7523
  hasEnabledAssetMigration
7096
7524
  ].filter(Boolean).length;
7097
7525
  const canAutoLock = Boolean(
7098
- enableWallet && _optionalChain([walletClientProp, 'optionalAccess', _223 => _223.account]) && !walletSession && enabledFeatureCount === 1
7526
+ enableWallet && _optionalChain([walletClientProp, 'optionalAccess', _241 => _241.account]) && !walletSession && enabledFeatureCount === 1
7099
7527
  );
7100
7528
  const hasWalletOptions = enableWallet && walletOptions.length > 0;
7101
7529
  const hasReownSession = Boolean(
7102
- _optionalChain([walletSession, 'optionalAccess', _224 => _224.isConnected]) || _optionalChain([walletSession, 'optionalAccess', _225 => _225.address])
7530
+ _optionalChain([walletSession, 'optionalAccess', _242 => _242.isConnected]) || _optionalChain([walletSession, 'optionalAccess', _243 => _243.address])
7103
7531
  );
7104
7532
  const isDappImportWalletHydrating = Boolean(
7105
7533
  hasWalletClientProp && walletClientProp === void 0 || walletSession && !hasReownSession && !walletSession.isReady
@@ -7130,7 +7558,7 @@ function DepositFlow({
7130
7558
  return;
7131
7559
  }
7132
7560
  let cancelled = false;
7133
- _chunkRAADLTSWcjs.fetchTokenPriceUsd.call(void 0, service, {
7561
+ _chunk4J5ADVINcjs.fetchTokenPriceUsd.call(void 0, service, {
7134
7562
  chainId: targetChainId,
7135
7563
  address: targetToken,
7136
7564
  symbol: targetSymbol
@@ -7147,11 +7575,11 @@ function DepositFlow({
7147
7575
  return null;
7148
7576
  }
7149
7577
  if (canAutoLock) {
7150
- const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _226 => _226.chain, 'optionalAccess', _227 => _227.id]), () => ( setupChainId));
7578
+ const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _244 => _244.chain, 'optionalAccess', _245 => _245.id]), () => ( setupChainId));
7151
7579
  return {
7152
7580
  ownerAddress: walletClientProp.account.address,
7153
7581
  walletClient: walletClientProp,
7154
- publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkZMT4ATHRcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
7582
+ publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkHAQOFI3Dcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
7155
7583
  switchChain: dappSwitchChain
7156
7584
  };
7157
7585
  }
@@ -7163,20 +7591,20 @@ function DepositFlow({
7163
7591
  if (selectedOption.kind === "solana") {
7164
7592
  return null;
7165
7593
  }
7166
- if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess', _228 => _228.account]) && selectedOption.address && walletClientProp.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
7167
- const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _229 => _229.chain, 'optionalAccess', _230 => _230.id]), () => ( setupChainId));
7594
+ if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess', _246 => _246.account]) && selectedOption.address && walletClientProp.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
7595
+ const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _247 => _247.chain, 'optionalAccess', _248 => _248.id]), () => ( setupChainId));
7168
7596
  return {
7169
7597
  ownerAddress: walletClientProp.account.address,
7170
7598
  walletClient: walletClientProp,
7171
- publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkZMT4ATHRcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
7599
+ publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkHAQOFI3Dcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
7172
7600
  switchChain: dappSwitchChain
7173
7601
  };
7174
7602
  }
7175
- if (selectedOption.kind === "external" && _optionalChain([walletSession, 'optionalAccess', _231 => _231.address]) && selectedOption.address && walletSession.address.toLowerCase() === selectedOption.address.toLowerCase()) {
7603
+ if (selectedOption.kind === "external" && _optionalChain([walletSession, 'optionalAccess', _249 => _249.address]) && selectedOption.address && walletSession.address.toLowerCase() === selectedOption.address.toLowerCase()) {
7176
7604
  return {
7177
7605
  ownerAddress: walletSession.address,
7178
7606
  walletClient: walletSession.walletClient,
7179
- publicClient: _nullishCoalesce(walletSession.publicClient, () => ( _chunkZMT4ATHRcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
7607
+ publicClient: _nullishCoalesce(walletSession.publicClient, () => ( _chunkHAQOFI3Dcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
7180
7608
  switchChain: walletSession.switchChain
7181
7609
  };
7182
7610
  }
@@ -7198,7 +7626,7 @@ function DepositFlow({
7198
7626
  // nothing else here when the host switches chain, and the context would go
7199
7627
  // on holding a client bound to the old one: `chainMismatch` never clears
7200
7628
  // and the CTA stays disabled with nothing beside it.
7201
- _optionalChain([walletSession, 'optionalAccess', _232 => _232.walletClient]),
7629
+ _optionalChain([walletSession, 'optionalAccess', _250 => _250.walletClient]),
7202
7630
  setupChainId,
7203
7631
  rpcUrls
7204
7632
  ]);
@@ -7238,35 +7666,35 @@ function DepositFlow({
7238
7666
  const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
7239
7667
  if (!selectedWalletId) return null;
7240
7668
  const opt = walletOptions.find((o) => o.id === selectedWalletId);
7241
- if (_optionalChain([opt, 'optionalAccess', _233 => _233.kind]) === "external" && opt.address) {
7669
+ if (_optionalChain([opt, 'optionalAccess', _251 => _251.kind]) === "external" && opt.address) {
7242
7670
  return opt.address;
7243
7671
  }
7244
- if (_optionalChain([opt, 'optionalAccess', _234 => _234.kind]) === "connected" && opt.address) {
7672
+ if (_optionalChain([opt, 'optionalAccess', _252 => _252.kind]) === "connected" && opt.address) {
7245
7673
  return opt.address;
7246
7674
  }
7247
7675
  return null;
7248
7676
  }, [selectedWalletId, walletOptions]);
7249
7677
  const dappImportOwner = _react.useMemo.call(void 0, () => {
7250
7678
  if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
7251
- if (_optionalChain([walletSession, 'optionalAccess', _235 => _235.address]) && walletSession.isConnected) {
7679
+ if (_optionalChain([walletSession, 'optionalAccess', _253 => _253.address]) && walletSession.isConnected) {
7252
7680
  return walletSession.address;
7253
7681
  }
7254
7682
  if (connectedWalletAddress) return connectedWalletAddress;
7255
7683
  return null;
7256
7684
  }, [
7257
7685
  selectedEvmWalletOwner,
7258
- _optionalChain([walletSession, 'optionalAccess', _236 => _236.address]),
7259
- _optionalChain([walletSession, 'optionalAccess', _237 => _237.isConnected]),
7686
+ _optionalChain([walletSession, 'optionalAccess', _254 => _254.address]),
7687
+ _optionalChain([walletSession, 'optionalAccess', _255 => _255.isConnected]),
7260
7688
  connectedWalletAddress
7261
7689
  ]);
7262
7690
  const activeOwner = _react.useMemo.call(void 0,
7263
7691
  () => resolveOwnerForMode(flowMode, {
7264
- walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _238 => _238.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
7692
+ walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _256 => _256.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
7265
7693
  dappImportOwner
7266
7694
  }),
7267
7695
  [
7268
7696
  flowMode,
7269
- _optionalChain([signerContext, 'optionalAccess', _239 => _239.ownerAddress]),
7697
+ _optionalChain([signerContext, 'optionalAccess', _257 => _257.ownerAddress]),
7270
7698
  canAutoLock,
7271
7699
  connectedWalletAddress,
7272
7700
  selectedEvmWalletOwner,
@@ -7283,7 +7711,7 @@ function DepositFlow({
7283
7711
  ].join(":");
7284
7712
  if (lastSmartAccountLifecycleKeyRef.current === lifecycleKey) return;
7285
7713
  lastSmartAccountLifecycleKeyRef.current = lifecycleKey;
7286
- _optionalChain([onLifecycleRef, 'access', _240 => _240.current, 'optionalCall', _241 => _241({
7714
+ _optionalChain([onLifecycleRef, 'access', _258 => _258.current, 'optionalCall', _259 => _259({
7287
7715
  type: "smart-account-changed",
7288
7716
  evm: activeEntry.smartAccount,
7289
7717
  solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
@@ -7311,7 +7739,7 @@ function DepositFlow({
7311
7739
  return;
7312
7740
  }
7313
7741
  lastConnectedLifecycleKeyRef.current = lifecycleKey;
7314
- _optionalChain([onLifecycleRef, 'access', _242 => _242.current, 'optionalCall', _243 => _243({
7742
+ _optionalChain([onLifecycleRef, 'access', _260 => _260.current, 'optionalCall', _261 => _261({
7315
7743
  type: "connected",
7316
7744
  address: activeOwner,
7317
7745
  smartAccount: activeEntry.smartAccount
@@ -7344,11 +7772,52 @@ function DepositFlow({
7344
7772
  );
7345
7773
  const step = effectiveStep;
7346
7774
  const handleBack = _react.useCallback.call(void 0, () => {
7775
+ if ([
7776
+ "deposit-address",
7777
+ "select-asset",
7778
+ "solana-token-select",
7779
+ "fiat-onramp",
7780
+ "exchange-select",
7781
+ "exchange-connect",
7782
+ "dapp-import-resolving",
7783
+ "dapp-import-select",
7784
+ "dapp-import-asset-select"
7785
+ ].includes(effectiveStep.type)) {
7786
+ analytics.abandon("back");
7787
+ analytics.resetAttempt(
7788
+ effectiveStep.type === "exchange-connect" ? "exchange_connect" : null
7789
+ );
7790
+ }
7791
+ storeApi.dispatch({
7792
+ type: "back/requested",
7793
+ hasWalletOptions: hasWalletOptions || Boolean(walletSession)
7794
+ });
7795
+ }, [
7796
+ analytics,
7797
+ effectiveStep.type,
7798
+ storeApi,
7799
+ hasWalletOptions,
7800
+ walletSession
7801
+ ]);
7802
+ const handleProviderBack = _react.useCallback.call(void 0, () => {
7803
+ analytics.abandon("provider_back");
7804
+ analytics.resetAttempt(
7805
+ flowMode === "exchange-connect" ? "exchange_connect" : null
7806
+ );
7807
+ storeApi.dispatch({
7808
+ type: "back/requested",
7809
+ hasWalletOptions: hasWalletOptions || Boolean(walletSession)
7810
+ });
7811
+ }, [analytics, flowMode, storeApi, hasWalletOptions, walletSession]);
7812
+ const handleWalletDisconnect = _react.useCallback.call(void 0, () => {
7813
+ analytics.abandon("wallet_disconnect");
7814
+ analytics.resetAttempt();
7815
+ _optionalChain([onDisconnect, 'optionalCall', _262 => _262()]);
7347
7816
  storeApi.dispatch({
7348
7817
  type: "back/requested",
7349
7818
  hasWalletOptions: hasWalletOptions || Boolean(walletSession)
7350
7819
  });
7351
- }, [storeApi, hasWalletOptions, walletSession]);
7820
+ }, [analytics, hasWalletOptions, onDisconnect, storeApi, walletSession]);
7352
7821
  const qrSourceAsset = effectiveStep.type === "qr-amount" ? effectiveStep.asset : null;
7353
7822
  const qrSourceKey = qrSourceAsset ? `${qrSourceAsset.chainId}:${qrSourceAsset.token}` : null;
7354
7823
  const [qrSourcePrice, setQrSourcePrice] = _react.useState.call(void 0, { resolved: false, usd: null });
@@ -7356,7 +7825,7 @@ function DepositFlow({
7356
7825
  setQrSourcePrice({ resolved: false, usd: null });
7357
7826
  if (!qrSourceAsset) return;
7358
7827
  let cancelled = false;
7359
- _chunkRAADLTSWcjs.fetchTokenPriceUsd.call(void 0, service, {
7828
+ _chunk4J5ADVINcjs.fetchTokenPriceUsd.call(void 0, service, {
7360
7829
  chainId: qrSourceAsset.chainId,
7361
7830
  address: qrSourceAsset.token,
7362
7831
  symbol: qrSourceAsset.symbol
@@ -7379,7 +7848,7 @@ function DepositFlow({
7379
7848
  const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
7380
7849
  const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
7381
7850
  _react.useEffect.call(void 0, () => {
7382
- _optionalChain([onStepChangeRef, 'access', _244 => _244.current, 'optionalCall', _245 => _245(currentBackHandler, currentScreen)]);
7851
+ _optionalChain([onStepChangeRef, 'access', _263 => _263.current, 'optionalCall', _264 => _264(currentBackHandler, currentScreen)]);
7383
7852
  }, [currentBackHandler, currentScreen, onStepChangeRef]);
7384
7853
  const lastModalHeightRef = _react.useRef.call(void 0, 0);
7385
7854
  const modalContentElRef = _react.useRef.call(void 0, null);
@@ -7389,7 +7858,7 @@ function DepositFlow({
7389
7858
  modalContentElRef.current = mc;
7390
7859
  const ro = new ResizeObserver((entries) => {
7391
7860
  for (const entry of entries) {
7392
- const border = _optionalChain([entry, 'access', _246 => _246.borderBoxSize, 'optionalAccess', _247 => _247[0], 'optionalAccess', _248 => _248.blockSize]);
7861
+ const border = _optionalChain([entry, 'access', _265 => _265.borderBoxSize, 'optionalAccess', _266 => _266[0], 'optionalAccess', _267 => _267.blockSize]);
7393
7862
  lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
7394
7863
  }
7395
7864
  });
@@ -7417,51 +7886,22 @@ function DepositFlow({
7417
7886
  });
7418
7887
  return () => cancelAnimationFrame(rafId);
7419
7888
  }, [stepPinKey]);
7420
- const stepSendToken = effectiveStep.type === "amount" ? effectiveStep.asset.symbol : null;
7421
- const stepOpenEventKey = effectiveStep.type === "select-asset" ? "select-asset" : effectiveStep.type === "deposit-address" ? "deposit-address" : effectiveStep.type === "amount" && stepSendToken ? `amount:${stepSendToken.toLowerCase()}` : null;
7422
- const lastStepOpenEventKeyRef = _react.useRef.call(void 0, null);
7889
+ const analyticsMethod = fundingMethodForFlowMode(flowMode);
7890
+ const analyticsStep = analyticsStepForFlowStep(
7891
+ analyticsMethod,
7892
+ showConnectStep ? "connect" : effectiveStep.type
7893
+ );
7423
7894
  _react.useEffect.call(void 0, () => {
7424
- if (!stepOpenEventKey) {
7425
- lastStepOpenEventKeyRef.current = null;
7426
- return;
7427
- }
7428
- if (lastStepOpenEventKeyRef.current === stepOpenEventKey) {
7429
- return;
7430
- }
7431
- lastStepOpenEventKeyRef.current = stepOpenEventKey;
7432
- if (effectiveStep.type === "select-asset") {
7433
- _optionalChain([onEventRef, 'access', _249 => _249.current, 'optionalCall', _250 => _250({
7434
- type: "deposit_modal_connected_wallet_select_source_open",
7435
- total_balance_in_external_wallet: totalBalanceUsd,
7436
- pred_balance: totalBalanceUsd
7437
- })]);
7438
- } else if (effectiveStep.type === "deposit-address") {
7439
- const chainName = _chunk4KCSH4T3cjs.getChainName.call(void 0, targetChainId);
7440
- const tokenSymbol = _chunk4KCSH4T3cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
7441
- _optionalChain([onEventRef, 'access', _251 => _251.current, 'optionalCall', _252 => _252({
7442
- type: "deposit_modal_transfer_crypto_open",
7443
- default_chain: chainName,
7444
- default_token: tokenSymbol,
7445
- pred_balance: totalBalanceUsd
7446
- })]);
7447
- } else if (effectiveStep.type === "amount" && stepSendToken) {
7448
- const receiveSymbol = _chunk4KCSH4T3cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
7449
- _optionalChain([onEventRef, 'access', _253 => _253.current, 'optionalCall', _254 => _254({
7450
- type: "deposit_modal_connected_wallet_enter_value_open",
7451
- send_token: stepSendToken,
7452
- receive_token: receiveSymbol,
7453
- pred_balance: totalBalanceUsd
7454
- })]);
7895
+ analytics.openSession();
7896
+ analytics.openStep(analyticsStep);
7897
+ }, [analytics, analyticsStep]);
7898
+ _react.useEffect.call(void 0, () => {
7899
+ if (setupSlice.status === "loading") {
7900
+ analytics.friction("account_setup_pending", "account_setup");
7901
+ } else if (setupSlice.status === "error") {
7902
+ analytics.failure("account_setup_failed", true, "account_setup");
7455
7903
  }
7456
- }, [
7457
- effectiveStep.type,
7458
- stepOpenEventKey,
7459
- stepSendToken,
7460
- targetChain,
7461
- targetToken,
7462
- totalBalanceUsd,
7463
- onEventRef
7464
- ]);
7904
+ }, [analytics, setupSlice.status]);
7465
7905
  _react.useEffect.call(void 0, () => {
7466
7906
  logFlow("state:changed", {
7467
7907
  step: effectiveStep.type,
@@ -7479,7 +7919,7 @@ function DepositFlow({
7479
7919
  targetToken
7480
7920
  ]);
7481
7921
  _react.useEffect.call(void 0, () => {
7482
- _optionalChain([onLifecycleRef, 'access', _255 => _255.current, 'optionalCall', _256 => _256({
7922
+ _optionalChain([onLifecycleRef, 'access', _268 => _268.current, 'optionalCall', _269 => _269({
7483
7923
  type: "balance-changed",
7484
7924
  totalUsd: totalBalanceUsd
7485
7925
  })]);
@@ -7490,22 +7930,27 @@ function DepositFlow({
7490
7930
  const isFiatOnrampMode = flowMode === "fiat-onramp";
7491
7931
  const isExchangeConnectMode = flowMode === "exchange-connect";
7492
7932
  const handleSelectTransferCrypto = _react.useCallback.call(void 0, () => {
7933
+ analytics.selectMethod("transfer", "user");
7493
7934
  storeApi.dispatch({ type: "connect/transfer-crypto-selected" });
7494
- }, [storeApi]);
7935
+ }, [analytics, storeApi]);
7495
7936
  const handleConfirmWallet = _react.useCallback.call(void 0,
7496
7937
  (walletId) => {
7497
7938
  const selectedOption = walletOptions.find((o) => o.id === walletId);
7498
- const mode = _optionalChain([selectedOption, 'optionalAccess', _257 => _257.kind]) === "solana" ? "solana-wallet" : "wallet";
7939
+ const mode = _optionalChain([selectedOption, 'optionalAccess', _270 => _270.kind]) === "solana" ? "solana-wallet" : "wallet";
7940
+ analytics.selectMethod("wallet", "user", {
7941
+ network: _optionalChain([selectedOption, 'optionalAccess', _271 => _271.kind]) === "solana" ? "solana" : "evm",
7942
+ integration: _nullishCoalesce(walletIntegration, () => ( "none"))
7943
+ });
7499
7944
  storeApi.dispatch({
7500
7945
  type: "connect/wallet-confirmed",
7501
7946
  walletId,
7502
7947
  mode
7503
7948
  });
7504
7949
  },
7505
- [walletOptions, storeApi]
7950
+ [analytics, walletIntegration, walletOptions, storeApi]
7506
7951
  );
7507
7952
  const isSolanaWalletConnected = Boolean(
7508
- _optionalChain([walletSession, 'optionalAccess', _258 => _258.isConnected]) && _optionalChain([walletSession, 'optionalAccess', _259 => _259.isSolana])
7953
+ _optionalChain([walletSession, 'optionalAccess', _272 => _272.isConnected]) && _optionalChain([walletSession, 'optionalAccess', _273 => _273.isSolana])
7509
7954
  );
7510
7955
  const assetMigrationsKey = assetMigrations ? Object.keys(assetMigrations).filter((k) => assetMigrations[k]).sort().join(",") : "";
7511
7956
  const enabledDappImportProviders = _react.useMemo.call(void 0,
@@ -7522,7 +7967,7 @@ function DepositFlow({
7522
7967
  const owner = dappImportOwner;
7523
7968
  if (owner) {
7524
7969
  const wallet = walletOptions.find(
7525
- (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _260 => _260.toLowerCase, 'call', _261 => _261()]) === owner.toLowerCase()
7970
+ (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _274 => _274.toLowerCase, 'call', _275 => _275()]) === owner.toLowerCase()
7526
7971
  );
7527
7972
  if (wallet) {
7528
7973
  storeApi.dispatch({
@@ -7531,12 +7976,15 @@ function DepositFlow({
7531
7976
  });
7532
7977
  }
7533
7978
  }
7979
+ analytics.selectMethod("asset_migration", "user", {
7980
+ provider: providerId
7981
+ });
7534
7982
  storeApi.dispatch({
7535
7983
  type: "dapp-import/provider-selected",
7536
7984
  providerId
7537
7985
  });
7538
7986
  },
7539
- [storeApi, walletOptions, dappImportOwner]
7987
+ [analytics, storeApi, walletOptions, dappImportOwner]
7540
7988
  );
7541
7989
  const handleDappImportAssetSelected = _react.useCallback.call(void 0,
7542
7990
  (asset) => {
@@ -7563,7 +8011,7 @@ function DepositFlow({
7563
8011
  eoa: dappImportOwner,
7564
8012
  getPublicClient: (chainId) => {
7565
8013
  try {
7566
- return _chunkZMT4ATHRcjs.getPublicClient.call(void 0, chainId, rpcUrls);
8014
+ return _chunkHAQOFI3Dcjs.getPublicClient.call(void 0, chainId, rpcUrls);
7567
8015
  } catch (e38) {
7568
8016
  return null;
7569
8017
  }
@@ -7582,6 +8030,12 @@ function DepositFlow({
7582
8030
  });
7583
8031
  }).catch(() => {
7584
8032
  if (controller.signal.aborted) return;
8033
+ if (analytics.method === "asset_migration") {
8034
+ analytics.friction(
8035
+ "migration_availability_failed",
8036
+ "migration_provider_selection"
8037
+ );
8038
+ }
7585
8039
  storeApi.dispatch({
7586
8040
  type: "dapp-import/availability-failed",
7587
8041
  providerId: provider.id,
@@ -7591,6 +8045,7 @@ function DepositFlow({
7591
8045
  }
7592
8046
  return () => controller.abort();
7593
8047
  }, [
8048
+ analytics,
7594
8049
  dappImportOwner,
7595
8050
  enabledDappImportProviders,
7596
8051
  dappImportAttemptNonce,
@@ -7603,11 +8058,14 @@ function DepositFlow({
7603
8058
  if (flowSlice.step !== "connect" || flowSlice.mode !== null || flowSlice.isConnectSelectionConfirmed || flowSlice.hasNavigatedBack) {
7604
8059
  return;
7605
8060
  }
8061
+ analytics.selectMethod("asset_migration", "initial_config", {
8062
+ provider: initialAssetMigrationProvider.id
8063
+ });
7606
8064
  storeApi.dispatch({
7607
8065
  type: "dapp-import/boot-requested",
7608
8066
  providerId: initialAssetMigrationProvider.id
7609
8067
  });
7610
- }, [initialAssetMigrationProvider, flowSlice, storeApi]);
8068
+ }, [analytics, initialAssetMigrationProvider, flowSlice, storeApi]);
7611
8069
  const dappImportAvailability = useDepositStore((s) => s.dappImport.availability);
7612
8070
  const dappImportAvailabilityOwner = useDepositStore(
7613
8071
  (s) => s.dappImport.availabilityOwner
@@ -7656,7 +8114,7 @@ function DepositFlow({
7656
8114
  }, [activeDappImportProviderId, enabledDappImportProviders]);
7657
8115
  const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
7658
8116
  if (!activeDappImportProviderId) return null;
7659
- if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _262 => _262.toLowerCase, 'call', _263 => _263()]) !== dappImportOwner.toLowerCase()) {
8117
+ if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _276 => _276.toLowerCase, 'call', _277 => _277()]) !== dappImportOwner.toLowerCase()) {
7660
8118
  return null;
7661
8119
  }
7662
8120
  const entry = dappImportAvailability[activeDappImportProviderId];
@@ -7683,6 +8141,8 @@ function DepositFlow({
7683
8141
  const providerId = activeDappImportProviderId;
7684
8142
  if (!providerId) return;
7685
8143
  if (!enabledDappImportProviders.some((p) => p.id === providerId)) {
8144
+ analytics.abandon("initial_migration_fallback");
8145
+ analytics.resetAttempt();
7686
8146
  storeApi.dispatch({
7687
8147
  type: "dapp-import/boot-resolved",
7688
8148
  providerId,
@@ -7697,7 +8157,7 @@ function DepositFlow({
7697
8157
  setup: setupSlice
7698
8158
  });
7699
8159
  const pinnableWallet = dappImportOwner ? _nullishCoalesce(walletOptions.find(
7700
- (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _264 => _264.toLowerCase, 'call', _265 => _265()]) === dappImportOwner.toLowerCase()
8160
+ (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _278 => _278.toLowerCase, 'call', _279 => _279()]) === dappImportOwner.toLowerCase()
7701
8161
  ), () => ( null)) : null;
7702
8162
  const outcome = resolveBootOutcome({
7703
8163
  status,
@@ -7712,6 +8172,9 @@ function DepositFlow({
7712
8172
  type: "wallet/id-selected",
7713
8173
  walletId: pinnableWallet.id
7714
8174
  });
8175
+ } else if (outcome === "unavailable") {
8176
+ analytics.abandon("initial_migration_fallback");
8177
+ analytics.resetAttempt();
7715
8178
  }
7716
8179
  storeApi.dispatch({
7717
8180
  type: "dapp-import/boot-resolved",
@@ -7730,16 +8193,21 @@ function DepositFlow({
7730
8193
  hasResolveDeadlinePassed,
7731
8194
  isDappImportWalletHydrating,
7732
8195
  walletOptions,
8196
+ analytics,
7733
8197
  storeApi
7734
8198
  ]);
7735
8199
  const handleBootRetry = _react.useCallback.call(void 0, () => {
8200
+ analytics.retry(
8201
+ "migration_availability_failed",
8202
+ "migration_boot_resolve"
8203
+ );
7736
8204
  const snapshot = storeApi.getState();
7737
8205
  const providerId = snapshot.dappImport.activeProviderId;
7738
8206
  if (!providerId) return;
7739
8207
  if (dappImportOwner) {
7740
8208
  const plan = bootRetryPlan({
7741
8209
  setupStatus: snapshot.setup.status,
7742
- availabilityEntry: _optionalChain([snapshot, 'access', _266 => _266.dappImport, 'access', _267 => _267.availabilityOwner, 'optionalAccess', _268 => _268.toLowerCase, 'call', _269 => _269()]) === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
8210
+ availabilityEntry: _optionalChain([snapshot, 'access', _280 => _280.dappImport, 'access', _281 => _281.availabilityOwner, 'optionalAccess', _282 => _282.toLowerCase, 'call', _283 => _283()]) === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
7743
8211
  });
7744
8212
  if (plan.restartSetup) {
7745
8213
  storeApi.dispatch({ type: "setup/retry-requested" });
@@ -7754,20 +8222,45 @@ function DepositFlow({
7754
8222
  type: "dapp-import/boot-requested",
7755
8223
  providerId
7756
8224
  });
7757
- }, [storeApi, dappImportOwner]);
8225
+ }, [analytics, storeApi, dappImportOwner]);
7758
8226
  const handleSelectFiatMethod = _react.useCallback.call(void 0,
7759
8227
  (paymentMethod, methodSelectionSource) => {
8228
+ analytics.selectMethod("fiat_onramp", "user", {
8229
+ payment_method: paymentMethod,
8230
+ source: methodSelectionSource
8231
+ });
7760
8232
  storeApi.dispatch({
7761
8233
  type: "connect/fiat-onramp-selected",
7762
8234
  paymentMethod,
7763
8235
  methodSelectionSource
7764
8236
  });
7765
8237
  },
7766
- [storeApi]
8238
+ [analytics, storeApi]
7767
8239
  );
7768
8240
  const handleSelectExchange = _react.useCallback.call(void 0, () => {
8241
+ analytics.selectMethod("exchange_connect", "user");
7769
8242
  storeApi.dispatch({ type: "connect/exchange-selected" });
7770
- }, [storeApi]);
8243
+ }, [analytics, storeApi]);
8244
+ const swappedAnalyticsCorrelatorRef = _react.useRef.call(void 0, null);
8245
+ const handleSwappedAttemptConsumed = _react.useCallback.call(void 0, (externalCustomerId) => {
8246
+ swappedAnalyticsCorrelatorRef.current = externalCustomerId;
8247
+ }, []);
8248
+ const handleSwappedProviderHandoff = _react.useCallback.call(void 0, () => {
8249
+ const externalCustomerId = swappedAnalyticsCorrelatorRef.current;
8250
+ if (!externalCustomerId) return;
8251
+ analytics.handoff(
8252
+ flowMode === "exchange-connect" ? "exchange_connect" : "fiat_onramp",
8253
+ { type: "swapped_external_customer_id", value: externalCustomerId },
8254
+ flowMode === "exchange-connect" ? "exchange_provider_handoff" : "fiat_provider_handoff"
8255
+ );
8256
+ }, [analytics, flowMode]);
8257
+ const handleSwappedRetry = _react.useCallback.call(void 0, () => {
8258
+ analytics.retry(
8259
+ "swapped_mint_failed",
8260
+ flowMode === "exchange-connect" ? "exchange_provider_mint" : "fiat_provider_mint"
8261
+ );
8262
+ swappedAnalyticsCorrelatorRef.current = null;
8263
+ }, [analytics, flowMode]);
7771
8264
  const swappedConnectUrlRef = _react.useRef.call(void 0, /* @__PURE__ */ new Map());
7772
8265
  const acknowledgedConnectFeeRef = _react.useRef.call(void 0, /* @__PURE__ */ new Map());
7773
8266
  const handleSelectExchangeConnection = _react.useCallback.call(void 0,
@@ -7788,7 +8281,7 @@ function DepositFlow({
7788
8281
  acceptedExchangeFeeBps: disclosedFeeBps
7789
8282
  });
7790
8283
  } catch (error) {
7791
- if (error instanceof _chunkZMT4ATHRcjs.SwappedConnectFeeChangedError) {
8284
+ if (error instanceof _chunkHAQOFI3Dcjs.SwappedConnectFeeChangedError) {
7792
8285
  return error.exchangeFeeBps;
7793
8286
  }
7794
8287
  throw error;
@@ -7796,7 +8289,7 @@ function DepositFlow({
7796
8289
  entry = { smartAccount: owner, response };
7797
8290
  }
7798
8291
  const currentAccount = storeApi.getState().setup.smartAccount;
7799
- if (_optionalChain([currentAccount, 'optionalAccess', _270 => _270.toLowerCase, 'call', _271 => _271()]) !== owner) {
8292
+ if (_optionalChain([currentAccount, 'optionalAccess', _284 => _284.toLowerCase, 'call', _285 => _285()]) !== owner) {
7800
8293
  swappedConnectUrlRef.current.delete(key);
7801
8294
  throw new Error("Deposit account changed. Select your exchange again.");
7802
8295
  }
@@ -7808,13 +8301,16 @@ function DepositFlow({
7808
8301
  }
7809
8302
  swappedConnectUrlRef.current.set(key, entry);
7810
8303
  acknowledgedConnectFeeRef.current.set(key, actualFeeBps);
8304
+ analytics.selectMethod("exchange_connect", "user", {
8305
+ exchange: connection
8306
+ });
7811
8307
  storeApi.dispatch({
7812
8308
  type: "exchange/connection-selected",
7813
8309
  connection
7814
8310
  });
7815
8311
  return actualFeeBps;
7816
8312
  },
7817
- [service, setupSlice.status, setupSlice.smartAccount, storeApi]
8313
+ [analytics, service, setupSlice.status, setupSlice.smartAccount, storeApi]
7818
8314
  );
7819
8315
  const loadSwappedConnectUrl = _react.useCallback.call(void 0,
7820
8316
  async (smartAccount, connection) => {
@@ -7827,7 +8323,7 @@ function DepositFlow({
7827
8323
  );
7828
8324
  }
7829
8325
  swappedConnectUrlRef.current.delete(key);
7830
- const response = _optionalChain([entry, 'optionalAccess', _272 => _272.smartAccount]) === smartAccount.toLowerCase() ? entry.response : await service.getSwappedConnectUrl({
8326
+ const response = _optionalChain([entry, 'optionalAccess', _286 => _286.smartAccount]) === smartAccount.toLowerCase() ? entry.response : await service.getSwappedConnectUrl({
7831
8327
  smartAccount,
7832
8328
  connection,
7833
8329
  acceptedExchangeFeeBps: expectedFeeBps
@@ -7916,9 +8412,10 @@ function DepositFlow({
7916
8412
  recommendedMethod: null
7917
8413
  });
7918
8414
  let settled = false;
7919
- const showFallback = () => {
8415
+ const showFallback = (reason) => {
7920
8416
  if (cancelled || settled) return;
7921
8417
  settled = true;
8418
+ analytics.friction(reason, "fiat_regional_payment_method");
7922
8419
  setRegionalMethods({
7923
8420
  status: "error",
7924
8421
  country: null,
@@ -7926,7 +8423,10 @@ function DepositFlow({
7926
8423
  recommendedMethod: null
7927
8424
  });
7928
8425
  };
7929
- const timeoutTimer = setTimeout(showFallback, REGIONAL_METHODS_TIMEOUT_MS);
8426
+ const timeoutTimer = setTimeout(
8427
+ () => showFallback("regional_methods_timeout"),
8428
+ REGIONAL_METHODS_TIMEOUT_MS
8429
+ );
7930
8430
  service.getSwappedPaymentMethods().then((res) => {
7931
8431
  if (cancelled || settled) return;
7932
8432
  settled = true;
@@ -7935,13 +8435,13 @@ function DepositFlow({
7935
8435
  }).catch(() => {
7936
8436
  if (cancelled) return;
7937
8437
  clearTimeout(timeoutTimer);
7938
- showFallback();
8438
+ showFallback("regional_methods_failed");
7939
8439
  });
7940
8440
  return () => {
7941
8441
  cancelled = true;
7942
8442
  clearTimeout(timeoutTimer);
7943
8443
  };
7944
- }, [fiatEnabled, hasConfiguredFiatMethods, service]);
8444
+ }, [analytics, fiatEnabled, hasConfiguredFiatMethods, service]);
7945
8445
  const cashDisplay = _react.useMemo.call(void 0, () => {
7946
8446
  if (!fiatEnabled) return { kind: "hidden" };
7947
8447
  if (hasConfiguredFiatMethods) {
@@ -7960,45 +8460,26 @@ function DepositFlow({
7960
8460
  offeredFiatMethods,
7961
8461
  regionalMethods
7962
8462
  ]);
7963
- const lastFiatMethodsRenderedEventRef = _react.useRef.call(void 0, null);
7964
8463
  _react.useEffect.call(void 0, () => {
7965
- if (cashDisplay.kind !== "list") return;
7966
- const emit = onEventRef.current;
7967
- if (!emit) return;
7968
- const paymentMethods = cashDisplay.methods.map(({ method }) => method);
7969
- const eventKey = [
7970
- cashDisplay.source,
7971
- _nullishCoalesce(cashDisplay.country, () => ( "none")),
7972
- ...paymentMethods
7973
- ].join(":");
7974
- if (lastFiatMethodsRenderedEventRef.current === eventKey) return;
7975
- lastFiatMethodsRenderedEventRef.current = eventKey;
7976
- emit({
7977
- type: "deposit_modal_fiat_methods_rendered",
7978
- country: cashDisplay.country,
7979
- payment_methods: paymentMethods,
7980
- source: cashDisplay.source
7981
- });
7982
- }, [cashDisplay, onEvent, onEventRef]);
8464
+ if (cashDisplay.kind === "hidden" && fiatEnabled) {
8465
+ analytics.friction(
8466
+ "regional_methods_empty",
8467
+ "fiat_regional_payment_method"
8468
+ );
8469
+ } else if (cashDisplay.kind === "list" && cashDisplay.source === "fallback" && !hasConfiguredFiatMethods) {
8470
+ analytics.friction(
8471
+ "regional_methods_fallback",
8472
+ "fiat_regional_payment_method"
8473
+ );
8474
+ }
8475
+ }, [analytics, cashDisplay, fiatEnabled, hasConfiguredFiatMethods]);
7983
8476
  const displayedFiatSource = cashDisplay.kind === "list" ? cashDisplay.source : void 0;
7984
- const displayedFiatCountry = cashDisplay.kind === "list" ? cashDisplay.country : null;
7985
8477
  const handleSelectDisplayedFiatMethod = _react.useCallback.call(void 0,
7986
8478
  (method) => {
7987
8479
  if (!displayedFiatSource) return;
7988
- _optionalChain([onEventRef, 'access', _273 => _273.current, 'optionalCall', _274 => _274({
7989
- type: "deposit_modal_fiat_method_click",
7990
- country: displayedFiatCountry,
7991
- payment_method: method,
7992
- source: displayedFiatSource
7993
- })]);
7994
8480
  handleSelectFiatMethod(method, displayedFiatSource);
7995
8481
  },
7996
- [
7997
- displayedFiatCountry,
7998
- displayedFiatSource,
7999
- handleSelectFiatMethod,
8000
- onEventRef
8001
- ]
8482
+ [displayedFiatSource, handleSelectFiatMethod]
8002
8483
  );
8003
8484
  const handlePrefetchDisplayedFiatMethod = _react.useCallback.call(void 0,
8004
8485
  (method) => {
@@ -8008,7 +8489,9 @@ function DepositFlow({
8008
8489
  [displayedFiatSource, handlePrefetchFiatMethod]
8009
8490
  );
8010
8491
  const handleNewDeposit = _react.useCallback.call(void 0, () => {
8011
- _optionalChain([onLifecycleRef, 'access', _275 => _275.current, 'optionalCall', _276 => _276({
8492
+ analytics.completeStep();
8493
+ analytics.resetAttempt();
8494
+ _optionalChain([onLifecycleRef, 'access', _287 => _287.current, 'optionalCall', _288 => _288({
8012
8495
  type: "smart-account-changed",
8013
8496
  evm: null,
8014
8497
  solana: null
@@ -8020,7 +8503,7 @@ function DepositFlow({
8020
8503
  swappedConnectUrlRef.current.clear();
8021
8504
  acknowledgedConnectFeeRef.current.clear();
8022
8505
  lastSmartAccountLifecycleKeyRef.current = null;
8023
- }, [onLifecycleRef, storeApi]);
8506
+ }, [analytics, onLifecycleRef, storeApi]);
8024
8507
  const setupInput = _react.useMemo.call(void 0,
8025
8508
  () => ({
8026
8509
  targetChain,
@@ -8039,17 +8522,17 @@ function DepositFlow({
8039
8522
  forceRegister
8040
8523
  ]
8041
8524
  );
8042
- const desiredSetupRequestKey = _chunkRAADLTSWcjs.computeRequestKey.call(void 0, setupInput);
8525
+ const desiredSetupRequestKey = _chunk4J5ADVINcjs.computeRequestKey.call(void 0, setupInput);
8043
8526
  const setupReady = setupSlice.status === "ready" && setupSlice.requestKey === desiredSetupRequestKey;
8044
8527
  _react.useEffect.call(void 0, () => {
8045
8528
  void (async () => {
8046
- const requestKey = _chunkRAADLTSWcjs.computeRequestKey.call(void 0, setupInput);
8047
- const cacheKey = _chunkRAADLTSWcjs.computeCacheKey.call(void 0, setupInput);
8048
- const cacheable = _chunkRAADLTSWcjs.computeIsCacheable.call(void 0, setupInput);
8529
+ const requestKey = _chunk4J5ADVINcjs.computeRequestKey.call(void 0, setupInput);
8530
+ const cacheKey = _chunk4J5ADVINcjs.computeCacheKey.call(void 0, setupInput);
8531
+ const cacheable = _chunk4J5ADVINcjs.computeIsCacheable.call(void 0, setupInput);
8049
8532
  if (storeApi.getState().setup.requestKey === requestKey) {
8050
8533
  return;
8051
8534
  }
8052
- const dedupedResult = _chunkRAADLTSWcjs.readDedupedAccountSetupResult.call(void 0, requestKey);
8535
+ const dedupedResult = _chunk4J5ADVINcjs.readDedupedAccountSetupResult.call(void 0, requestKey);
8053
8536
  if (dedupedResult) {
8054
8537
  storeApi.dispatch({
8055
8538
  type: "setup/started",
@@ -8075,7 +8558,7 @@ function DepositFlow({
8075
8558
  cacheable
8076
8559
  });
8077
8560
  try {
8078
- const result = await _chunkRAADLTSWcjs.runAccountSetupDeduped.call(void 0,
8561
+ const result = await _chunk4J5ADVINcjs.runAccountSetupDeduped.call(void 0,
8079
8562
  setupInput,
8080
8563
  { service, debug },
8081
8564
  requestKey
@@ -8090,7 +8573,7 @@ function DepositFlow({
8090
8573
  }
8091
8574
  });
8092
8575
  } catch (error) {
8093
- const message = error instanceof _chunkRAADLTSWcjs.SetupError ? error.message : "Deposit service is temporarily unavailable. Please try again shortly.";
8576
+ const message = error instanceof _chunk4J5ADVINcjs.SetupError ? error.message : "Deposit service is temporarily unavailable. Please try again shortly.";
8094
8577
  storeApi.dispatch({
8095
8578
  type: "setup/failed",
8096
8579
  requestKey,
@@ -8122,11 +8605,11 @@ function DepositFlow({
8122
8605
  return;
8123
8606
  }
8124
8607
  storeApi.dispatch({ type: "portfolio/loading", network, address });
8125
- const requestId = _optionalChain([readPortfolioEntry, 'call', _277 => _277(
8608
+ const requestId = _optionalChain([readPortfolioEntry, 'call', _289 => _289(
8126
8609
  storeApi.getState().portfolio,
8127
8610
  network,
8128
8611
  address
8129
- ), 'optionalAccess', _278 => _278.requestId]);
8612
+ ), 'optionalAccess', _290 => _290.requestId]);
8130
8613
  if (requestId === void 0) return;
8131
8614
  void (async () => {
8132
8615
  try {
@@ -8139,7 +8622,7 @@ function DepositFlow({
8139
8622
  address,
8140
8623
  requestId,
8141
8624
  totalUsd: portfolio.totalUsd,
8142
- chainIds: _chunkZMT4ATHRcjs.chainIdsByValue.call(void 0, portfolio.tokens)
8625
+ chainIds: _chunkHAQOFI3Dcjs.chainIdsByValue.call(void 0, portfolio.tokens)
8143
8626
  });
8144
8627
  } catch (e39) {
8145
8628
  storeApi.dispatch({
@@ -8159,9 +8642,13 @@ function DepositFlow({
8159
8642
  sourceChain: data.sourceChain,
8160
8643
  amount: data.amount
8161
8644
  });
8162
- _optionalChain([onLifecycleRef, 'access', _279 => _279.current, 'optionalCall', _280 => _280({ type: "submitted", ...data })]);
8645
+ analytics.observeCorrelator(
8646
+ { type: "transaction_hash", value: data.txHash },
8647
+ "transfer_tracking"
8648
+ );
8649
+ _optionalChain([onLifecycleRef, 'access', _291 => _291.current, 'optionalCall', _292 => _292({ type: "submitted", ...data })]);
8163
8650
  },
8164
- [logFlow, onLifecycleRef]
8651
+ [analytics, logFlow, onLifecycleRef]
8165
8652
  );
8166
8653
  const handleSolanaTokenContinue = _react.useCallback.call(void 0,
8167
8654
  (token, balance, balanceUsd) => {
@@ -8209,6 +8696,11 @@ function DepositFlow({
8209
8696
  amountUnits,
8210
8697
  token: tokenAtSubmit.symbol
8211
8698
  });
8699
+ analytics.handoff(
8700
+ "wallet",
8701
+ { type: "transaction_hash", value: txHash },
8702
+ "wallet_submit"
8703
+ );
8212
8704
  storeApi.dispatch({
8213
8705
  type: "deposit/submitted",
8214
8706
  txHash,
@@ -8223,7 +8715,7 @@ function DepositFlow({
8223
8715
  sourceDecimals: tokenAtSubmit.decimals,
8224
8716
  inputAmountUsd: amountUsd
8225
8717
  });
8226
- _optionalChain([onLifecycleRef, 'access', _281 => _281.current, 'optionalCall', _282 => _282({
8718
+ _optionalChain([onLifecycleRef, 'access', _293 => _293.current, 'optionalCall', _294 => _294({
8227
8719
  type: "submitted",
8228
8720
  txHash,
8229
8721
  sourceChain: "solana",
@@ -8232,25 +8724,18 @@ function DepositFlow({
8232
8724
  amountUsd
8233
8725
  })]);
8234
8726
  },
8235
- [logFlow, onLifecycleRef, storeApi]
8727
+ [analytics, logFlow, onLifecycleRef, storeApi]
8236
8728
  );
8237
8729
  const handleAssetContinue = _react.useCallback.call(void 0,
8238
8730
  (asset) => {
8239
- _optionalChain([onEventRef, 'access', _283 => _283.current, 'optionalCall', _284 => _284({
8240
- type: "deposit_modal_connected_wallet_select_source_cta_click",
8241
- total_balance_in_external_wallet: totalBalanceUsd,
8242
- pred_balance: totalBalanceUsd,
8243
- cta_name: "token_selected",
8244
- token_name: asset.symbol,
8245
- token_balance: _nullishCoalesce(asset.balance, () => ( "0"))
8246
- })]);
8731
+ analytics.completeStep("wallet_source_asset");
8247
8732
  storeApi.dispatch({
8248
8733
  type: "asset/selected",
8249
8734
  asset,
8250
8735
  seedAmount: defaultAmount
8251
8736
  });
8252
8737
  },
8253
- [defaultAmount, onEventRef, totalBalanceUsd, storeApi]
8738
+ [analytics, defaultAmount, storeApi]
8254
8739
  );
8255
8740
  const handleAmountContinue = _react.useCallback.call(void 0,
8256
8741
  (amount, targetAmount, balance) => {
@@ -8298,6 +8783,21 @@ function DepositFlow({
8298
8783
  });
8299
8784
  const depositAtSubmit = storeApi.getState().deposit;
8300
8785
  const asset = depositAtSubmit.selectedAsset;
8786
+ const handoffMethod = flowMode === "dapp-import" ? "asset_migration" : "wallet";
8787
+ const handoffStep = flowMode === "dapp-import" ? "migration_submit" : "wallet_submit";
8788
+ if (routed.depositId) {
8789
+ analytics.handoff(
8790
+ handoffMethod,
8791
+ { type: "deposit_id", value: routed.depositId },
8792
+ handoffStep
8793
+ );
8794
+ } else if (!routed.sourceTxHashPending) {
8795
+ analytics.handoff(
8796
+ handoffMethod,
8797
+ { type: "transaction_hash", value: txHash },
8798
+ handoffStep
8799
+ );
8800
+ }
8301
8801
  storeApi.dispatch({
8302
8802
  type: "deposit/submitted",
8303
8803
  txHash,
@@ -8309,15 +8809,15 @@ function DepositFlow({
8309
8809
  sourceChain: chainId,
8310
8810
  sourceToken: token,
8311
8811
  amount,
8312
- sourceSymbol: _optionalChain([asset, 'optionalAccess', _285 => _285.symbol]),
8313
- sourceDecimals: _optionalChain([asset, 'optionalAccess', _286 => _286.decimals]),
8812
+ sourceSymbol: _optionalChain([asset, 'optionalAccess', _295 => _295.symbol]),
8813
+ sourceDecimals: _optionalChain([asset, 'optionalAccess', _296 => _296.decimals]),
8314
8814
  inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
8315
8815
  directTransfer: routed.directTransfer,
8316
8816
  sourceTxHashPending: routed.sourceTxHashPending,
8317
8817
  quote
8318
8818
  });
8319
8819
  },
8320
- [logFlow, storeApi]
8820
+ [analytics, flowMode, logFlow, storeApi]
8321
8821
  );
8322
8822
  const handleSwappedComplete = _react.useCallback.call(void 0,
8323
8823
  (info) => {
@@ -8351,7 +8851,7 @@ function DepositFlow({
8351
8851
  swappedContext,
8352
8852
  initialEvent: info.initialEvent
8353
8853
  });
8354
- _optionalChain([onLifecycleRef, 'access', _287 => _287.current, 'optionalCall', _288 => _288({
8854
+ _optionalChain([onLifecycleRef, 'access', _297 => _297.current, 'optionalCall', _298 => _298({
8355
8855
  type: "submitted",
8356
8856
  txHash: info.txHash,
8357
8857
  sourceChain: SWAPPED_SOURCE_CHAIN,
@@ -8379,12 +8879,12 @@ function DepositFlow({
8379
8879
  const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
8380
8880
  (txHash, sourceChain, amount) => {
8381
8881
  const depositAtSubmit = storeApi.getState().deposit;
8382
- _optionalChain([onLifecycleRef, 'access', _289 => _289.current, 'optionalCall', _290 => _290({
8882
+ _optionalChain([onLifecycleRef, 'access', _299 => _299.current, 'optionalCall', _300 => _300({
8383
8883
  type: "submitted",
8384
8884
  txHash,
8385
8885
  sourceChain,
8386
8886
  amount,
8387
- sourceDecimals: _optionalChain([depositAtSubmit, 'access', _291 => _291.selectedAsset, 'optionalAccess', _292 => _292.decimals]),
8887
+ sourceDecimals: _optionalChain([depositAtSubmit, 'access', _301 => _301.selectedAsset, 'optionalAccess', _302 => _302.decimals]),
8388
8888
  amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
8389
8889
  })]);
8390
8890
  },
@@ -8393,28 +8893,51 @@ function DepositFlow({
8393
8893
  const handleDepositComplete = _react.useCallback.call(void 0,
8394
8894
  (txHash, destinationTxHash, context) => {
8395
8895
  logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
8396
- _optionalChain([onLifecycleRef, 'access', _293 => _293.current, 'optionalCall', _294 => _294({
8896
+ analytics.openStep(
8897
+ analyticsStepForFlowStep(analyticsMethod, "processing")
8898
+ );
8899
+ analytics.outcome("completed");
8900
+ _optionalChain([onLifecycleRef, 'access', _303 => _303.current, 'optionalCall', _304 => _304({
8397
8901
  type: "complete",
8398
8902
  txHash,
8399
8903
  destinationTxHash,
8400
8904
  ...context
8401
8905
  })]);
8402
8906
  },
8403
- [logFlow, onLifecycleRef]
8907
+ [analytics, analyticsMethod, logFlow, onLifecycleRef]
8404
8908
  );
8405
8909
  const handleDepositFailed = _react.useCallback.call(void 0,
8406
8910
  (txHash, error) => {
8407
8911
  logFlowError("deposit:failed", error, { txHash });
8408
- _optionalChain([onLifecycleRef, 'access', _295 => _295.current, 'optionalCall', _296 => _296({ type: "failed", txHash, error })]);
8912
+ analytics.openStep(
8913
+ analyticsStepForFlowStep(analyticsMethod, "processing")
8914
+ );
8915
+ analytics.outcome("failed");
8916
+ analytics.failure("processor_failed", false);
8917
+ _optionalChain([onLifecycleRef, 'access', _305 => _305.current, 'optionalCall', _306 => _306({ type: "failed", txHash, error })]);
8409
8918
  },
8410
- [logFlowError, onLifecycleRef]
8919
+ [analytics, analyticsMethod, logFlowError, onLifecycleRef]
8411
8920
  );
8412
8921
  const handleError = _react.useCallback.call(void 0,
8413
8922
  (message, code, cause) => {
8414
8923
  logFlowError("flow:error", _nullishCoalesce(cause, () => ( message)), { code });
8415
- _optionalChain([onErrorRef, 'access', _297 => _297.current, 'optionalCall', _298 => _298({ message, code, cause })]);
8924
+ if (code === "PROCESS_TIMEOUT") {
8925
+ analytics.friction("processor_status_poll_failed");
8926
+ } else {
8927
+ const reason = failureReasonForCode(
8928
+ code,
8929
+ `${message} ${_nullishCoalesce(cause, () => ( ""))}`
8930
+ );
8931
+ const failureStep = code === "SWAPPED_URL_FAILED" ? "fiat_provider_mint" : code === "SWAPPED_CONNECT_URL_FAILED" ? "exchange_provider_mint" : void 0;
8932
+ analytics.failure(
8933
+ reason,
8934
+ reason !== "submission_uncertain",
8935
+ failureStep
8936
+ );
8937
+ }
8938
+ _optionalChain([onErrorRef, 'access', _307 => _307.current, 'optionalCall', _308 => _308({ message, code, cause })]);
8416
8939
  },
8417
- [logFlowError, onErrorRef]
8940
+ [analytics, logFlowError, onErrorRef]
8418
8941
  );
8419
8942
  const handleTotalBalanceComputed = _react.useCallback.call(void 0, (total) => {
8420
8943
  setTotalBalanceUsd(total);
@@ -8461,17 +8984,18 @@ function DepositFlow({
8461
8984
  address: _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id)),
8462
8985
  state,
8463
8986
  errorReason: _nullishCoalesce(entry.message, () => ( void 0)),
8464
- balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _299 => _299.status]), () => ( "loading")),
8465
- balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess', _300 => _300.status]) === "ready" ? portfolioEntry.totalUsd : null,
8466
- balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _301 => _301.chainIds]), () => ( []))
8987
+ balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _309 => _309.status]), () => ( "loading")),
8988
+ balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess', _310 => _310.status]) === "ready" ? portfolioEntry.totalUsd : null,
8989
+ balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _311 => _311.chainIds]), () => ( []))
8467
8990
  };
8468
8991
  });
8469
8992
  }, [enableWallet, walletOptions, setupSlice, portfolioSlice]);
8470
8993
  const transferCryptoEntry = setupSlice;
8471
8994
  const transferCryptoState = transferCryptoEntry.status === "ready" ? "ready" : transferCryptoEntry.status === "error" ? "error" : "loading";
8472
8995
  const handleRetrySetup = _react.useCallback.call(void 0, () => {
8996
+ analytics.retry("account_setup_failed", "account_setup");
8473
8997
  storeApi.dispatch({ type: "setup/retry-requested" });
8474
- }, [storeApi]);
8998
+ }, [analytics, storeApi]);
8475
8999
  if (showConnectStep) {
8476
9000
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8477
9001
  ConnectStep,
@@ -8518,7 +9042,10 @@ function DepositFlow({
8518
9042
  // hasn't landed must still surface the row and show it inside the
8519
9043
  // picker as "Coming soon" — keying this on implemented providers
8520
9044
  // hid the feature entirely for such a config.
8521
- enabledAssetMigrationIds.length > 0 ? () => storeApi.dispatch({ type: "dapp-import/picker-opened" }) : void 0
9045
+ enabledAssetMigrationIds.length > 0 ? () => {
9046
+ analytics.selectMethod("asset_migration", "user");
9047
+ storeApi.dispatch({ type: "dapp-import/picker-opened" });
9048
+ } : void 0
8522
9049
  ),
8523
9050
  migrateAssetsBalanceStatus: dappImportTotal.status,
8524
9051
  migrateAssetsBalanceUsd: dappImportTotal.totalUsd
@@ -8552,16 +9079,31 @@ function DepositFlow({
8552
9079
  onDepositSubmitted: handleDepositAddressSubmitted,
8553
9080
  onDepositComplete: handleDepositComplete,
8554
9081
  onDepositFailed: handleDepositFailed,
8555
- onCopyAddress: () => {
8556
- const chainName = _chunk4KCSH4T3cjs.getChainName.call(void 0, targetChainId);
8557
- const tokenSymbol = _chunk4KCSH4T3cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
8558
- _optionalChain([onEvent, 'optionalCall', _302 => _302({
8559
- type: "deposit_modal_transfer_crypto_cta_click",
8560
- default_chain: chainName,
8561
- default_token: tokenSymbol,
8562
- pred_balance: totalBalanceUsd,
8563
- cta_name: "copy"
8564
- })]);
9082
+ onAddressShown: ({
9083
+ address,
9084
+ sourceChainCaip2,
9085
+ sourceTokenIdentity
9086
+ }) => {
9087
+ analytics.handoff(
9088
+ "transfer",
9089
+ { type: "deposit_address", value: address },
9090
+ "transfer_address_shown",
9091
+ {
9092
+ source_chain: sourceChainCaip2,
9093
+ source_token: sourceTokenIdentity
9094
+ }
9095
+ );
9096
+ },
9097
+ onCopyAddress: (success) => {
9098
+ if (success) {
9099
+ analytics.completeStep("transfer_copy");
9100
+ } else {
9101
+ analytics.failure(
9102
+ "transfer_clipboard_failed",
9103
+ true,
9104
+ "transfer_copy"
9105
+ );
9106
+ }
8565
9107
  },
8566
9108
  onReviewDeposit: handleQrReviewRequested,
8567
9109
  onError: handleError,
@@ -8625,16 +9167,21 @@ function DepositFlow({
8625
9167
  consumePrefetchedUrl: consumeSwappedWidgetUrlPrefetch,
8626
9168
  onSwappedComplete: handleSwappedComplete,
8627
9169
  onSwappedFailed: handleDepositFailed,
8628
- onClose: _nullishCoalesce(onClose, () => ( (() => {
8629
- }))),
8630
- onGoBack: handleBack,
9170
+ onClose: () => _optionalChain([onClose, 'optionalCall', _312 => _312(
9171
+ openExternally ? "native_dismiss_request" : "header_button"
9172
+ )]),
9173
+ onGoBack: handleProviderBack,
8631
9174
  onError: handleError,
9175
+ onAttemptConsumed: handleSwappedAttemptConsumed,
9176
+ onProviderHandoff: handleSwappedProviderHandoff,
9177
+ onRetry: handleSwappedRetry,
9178
+ onCancelled: () => analytics.outcome("cancelled"),
8632
9179
  onImmersiveChange: onSwappedImmersiveChange,
8633
9180
  openExternally
8634
9181
  }
8635
9182
  ),
8636
9183
  step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8637
- _chunkRAADLTSWcjs.ProcessingStep,
9184
+ _chunk4J5ADVINcjs.ProcessingStep,
8638
9185
  {
8639
9186
  smartAccount: step.smartAccount,
8640
9187
  solanaDepositAddress: step.solanaDepositAddress,
@@ -8699,16 +9246,21 @@ function DepositFlow({
8699
9246
  loadUrl: () => loadSwappedConnectUrl(step.smartAccount, step.connection),
8700
9247
  onSwappedComplete: handleSwappedComplete,
8701
9248
  onSwappedFailed: handleDepositFailed,
8702
- onClose: _nullishCoalesce(onClose, () => ( (() => {
8703
- }))),
8704
- onGoBack: handleBack,
9249
+ onClose: () => _optionalChain([onClose, 'optionalCall', _313 => _313(
9250
+ openExternally ? "native_dismiss_request" : "header_button"
9251
+ )]),
9252
+ onGoBack: handleProviderBack,
8705
9253
  onError: handleError,
9254
+ onAttemptConsumed: handleSwappedAttemptConsumed,
9255
+ onProviderHandoff: handleSwappedProviderHandoff,
9256
+ onRetry: handleSwappedRetry,
9257
+ onCancelled: () => analytics.outcome("cancelled"),
8706
9258
  onImmersiveChange: onSwappedImmersiveChange,
8707
9259
  openExternally
8708
9260
  }
8709
9261
  ),
8710
9262
  step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8711
- _chunkRAADLTSWcjs.ProcessingStep,
9263
+ _chunk4J5ADVINcjs.ProcessingStep,
8712
9264
  {
8713
9265
  smartAccount: step.smartAccount,
8714
9266
  solanaDepositAddress: step.solanaDepositAddress,
@@ -8742,8 +9294,8 @@ function DepositFlow({
8742
9294
  );
8743
9295
  }
8744
9296
  if (isSolanaWalletMode) {
8745
- const solanaAddr = _optionalChain([walletSession, 'optionalAccess', _303 => _303.solanaAddress]);
8746
- const solanaProvider = _optionalChain([walletSession, 'optionalAccess', _304 => _304.solanaProvider]);
9297
+ const solanaAddr = _optionalChain([walletSession, 'optionalAccess', _314 => _314.solanaAddress]);
9298
+ const solanaProvider = _optionalChain([walletSession, 'optionalAccess', _315 => _315.solanaProvider]);
8747
9299
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
8748
9300
  effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8749
9301
  AccountPreparingSkeleton,
@@ -8759,10 +9311,7 @@ function DepositFlow({
8759
9311
  service,
8760
9312
  onContinue: handleSolanaTokenContinue,
8761
9313
  onTotalBalanceComputed: handleTotalBalanceComputed,
8762
- onDisconnect: onDisconnect ? () => {
8763
- onDisconnect();
8764
- handleBack();
8765
- } : void 0,
9314
+ onDisconnect: onDisconnect ? handleWalletDisconnect : void 0,
8766
9315
  debug
8767
9316
  }
8768
9317
  ),
@@ -8797,7 +9346,7 @@ function DepositFlow({
8797
9346
  targetToken,
8798
9347
  service,
8799
9348
  solanaProvider,
8800
- solanaConnection: _optionalChain([walletSession, 'optionalAccess', _305 => _305.solanaConnection]),
9349
+ solanaConnection: _optionalChain([walletSession, 'optionalAccess', _316 => _316.solanaConnection]),
8801
9350
  uiConfig,
8802
9351
  onConfirm: handleSolanaConfirmed,
8803
9352
  onError: handleError,
@@ -8838,7 +9387,7 @@ function DepositFlow({
8838
9387
  ) })
8839
9388
  ] }) : null,
8840
9389
  effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8841
- _chunkRAADLTSWcjs.ProcessingStep,
9390
+ _chunk4J5ADVINcjs.ProcessingStep,
8842
9391
  {
8843
9392
  smartAccount: effectiveStep.smartAccount,
8844
9393
  solanaDepositAddress: effectiveStep.solanaDepositAddress,
@@ -8876,7 +9425,7 @@ function DepositFlow({
8876
9425
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8877
9426
  DappImportAssetSelectSkeleton,
8878
9427
  {
8879
- sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _306 => _306.sourceLabel]), () => ( "")),
9428
+ sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _317 => _317.sourceLabel]), () => ( "")),
8880
9429
  error: dappImportBootError,
8881
9430
  onRetry: handleBootRetry
8882
9431
  }
@@ -8898,7 +9447,7 @@ function DepositFlow({
8898
9447
  rows: dappImportSelectRows,
8899
9448
  onRequestConnect: _nullishCoalesce(onConnect, () => ( onRequestConnect)),
8900
9449
  onSelect: (providerId) => {
8901
- const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _307 => _307.toLowerCase, 'call', _308 => _308()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
9450
+ const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _318 => _318.toLowerCase, 'call', _319 => _319()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
8902
9451
  if (availabilityEntry === "error") {
8903
9452
  storeApi.dispatch({
8904
9453
  type: "dapp-import/availability-retry-requested"
@@ -8917,16 +9466,16 @@ function DepositFlow({
8917
9466
  }
8918
9467
  );
8919
9468
  }
8920
- if (!_optionalChain([signerContext, 'optionalAccess', _309 => _309.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _310 => _310.publicClient])) {
9469
+ if (!_optionalChain([signerContext, 'optionalAccess', _320 => _320.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _321 => _321.publicClient])) {
8921
9470
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-state", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: "Connecting wallet\u2026" }) }) }) }) });
8922
9471
  }
8923
9472
  const ownerAddress = signerContext.ownerAddress;
8924
- const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _311 => _311.walletClient, 'optionalAccess', _312 => _312.chain, 'optionalAccess', _313 => _313.id]), () => ( _optionalChain([signerContext, 'access', _314 => _314.publicClient, 'access', _315 => _315.chain, 'optionalAccess', _316 => _316.id]))), () => ( setupChainId));
9473
+ const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _322 => _322.walletClient, 'optionalAccess', _323 => _323.chain, 'optionalAccess', _324 => _324.id]), () => ( _optionalChain([signerContext, 'access', _325 => _325.publicClient, 'access', _326 => _326.chain, 'optionalAccess', _327 => _327.id]))), () => ( setupChainId));
8925
9474
  const getReadClientForChain = (chainId) => {
8926
- if (_optionalChain([signerContext, 'access', _317 => _317.publicClient, 'access', _318 => _318.chain, 'optionalAccess', _319 => _319.id]) === chainId) {
9475
+ if (_optionalChain([signerContext, 'access', _328 => _328.publicClient, 'access', _329 => _329.chain, 'optionalAccess', _330 => _330.id]) === chainId) {
8927
9476
  return signerContext.publicClient;
8928
9477
  }
8929
- return _chunkZMT4ATHRcjs.getPublicClient.call(void 0, chainId, rpcUrls);
9478
+ return _chunkHAQOFI3Dcjs.getPublicClient.call(void 0, chainId, rpcUrls);
8930
9479
  };
8931
9480
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
8932
9481
  effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -8946,18 +9495,15 @@ function DepositFlow({
8946
9495
  service,
8947
9496
  onContinue: handleAssetContinue,
8948
9497
  onTotalBalanceComputed: handleTotalBalanceComputed,
8949
- onDisconnect: onDisconnect ? () => {
8950
- onDisconnect();
8951
- handleBack();
8952
- } : void 0
9498
+ onDisconnect: onDisconnect ? handleWalletDisconnect : void 0
8953
9499
  }
8954
9500
  ),
8955
9501
  effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8956
9502
  DappImportAssetSelectStep,
8957
9503
  {
8958
- sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _320 => _320.assets, 'access', _321 => _321[0], 'optionalAccess', _322 => _322.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
9504
+ sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _331 => _331.assets, 'access', _332 => _332[0], 'optionalAccess', _333 => _333.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
8959
9505
  assets: activeDappImportAvailability.assets,
8960
- incompleteSummary: _optionalChain([activeDappImportAvailability, 'access', _323 => _323.incomplete, 'optionalAccess', _324 => _324.summary]),
9506
+ incompleteSummary: _optionalChain([activeDappImportAvailability, 'access', _334 => _334.incomplete, 'optionalAccess', _335 => _335.summary]),
8961
9507
  onSelect: handleDappImportAssetSelected
8962
9508
  }
8963
9509
  ),
@@ -8978,14 +9524,7 @@ function DepositFlow({
8978
9524
  service,
8979
9525
  onContinue: handleAmountContinue,
8980
9526
  onCtaClick: (ctaName) => {
8981
- const receiveSymbol = _chunk4KCSH4T3cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
8982
- _optionalChain([onEvent, 'optionalCall', _325 => _325({
8983
- type: "deposit_modal_connected_wallet_enter_value_cta_click",
8984
- send_token: effectiveStep.asset.symbol,
8985
- receive_token: receiveSymbol,
8986
- pred_balance: totalBalanceUsd,
8987
- cta_name: ctaName
8988
- })]);
9527
+ if (ctaName === "continue") analytics.completeStep();
8989
9528
  }
8990
9529
  }
8991
9530
  ),
@@ -9039,7 +9578,7 @@ function DepositFlow({
9039
9578
  }
9040
9579
  ),
9041
9580
  effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
9042
- _chunkRAADLTSWcjs.ProcessingStep,
9581
+ _chunk4J5ADVINcjs.ProcessingStep,
9043
9582
  {
9044
9583
  smartAccount: effectiveStep.smartAccount,
9045
9584
  solanaDepositAddress: effectiveStep.solanaDepositAddress,
@@ -9058,6 +9597,10 @@ function DepositFlow({
9058
9597
  initialEvent: effectiveStep.initialEvent,
9059
9598
  quote: effectiveStep.quote,
9060
9599
  uiConfig,
9600
+ onSourceTransactionObserved: (txHash) => analytics.observeCorrelator(
9601
+ { type: "transaction_hash", value: txHash },
9602
+ flowMode === "dapp-import" ? "migration_processing" : "wallet_processing"
9603
+ ),
9061
9604
  onClose,
9062
9605
  onNewDeposit: handleNewDeposit,
9063
9606
  onRetry: handleNewDeposit,
@@ -9190,7 +9733,7 @@ function DepositHistoryPanel({
9190
9733
  );
9191
9734
  const visibleDeposits = _react.useMemo.call(void 0, () => {
9192
9735
  const sourceHashes = new Set(
9193
- deposits.map((d) => _optionalChain([d, 'access', _326 => _326.sourceTxHash, 'optionalAccess', _327 => _327.toLowerCase, 'call', _328 => _328()])).filter((h) => Boolean(h))
9736
+ deposits.map((d) => _optionalChain([d, 'access', _336 => _336.sourceTxHash, 'optionalAccess', _337 => _337.toLowerCase, 'call', _338 => _338()])).filter((h) => Boolean(h))
9194
9737
  );
9195
9738
  return deposits.filter(
9196
9739
  (d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
@@ -9212,7 +9755,7 @@ function DepositHistoryPanel({
9212
9755
  className: "rs-modal-header-back",
9213
9756
  "aria-label": "Back",
9214
9757
  onClick: onClose,
9215
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.ChevronLeftIcon, {})
9758
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChevronLeftIcon, {})
9216
9759
  }
9217
9760
  ) }),
9218
9761
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -9222,29 +9765,29 @@ function DepositHistoryPanel({
9222
9765
  className: "rs-modal-close",
9223
9766
  "aria-label": "Close",
9224
9767
  onClick: onCloseModal,
9225
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CloseIcon, {})
9768
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CloseIcon, {})
9226
9769
  }
9227
9770
  ) })
9228
9771
  ] }),
9229
9772
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
9230
9773
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
9231
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.HistoryIcon, {}), title: "History" }),
9774
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.HistoryIcon, {}), title: "History" }),
9232
9775
  isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
9233
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.HistoryIcon, {}) }),
9776
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.HistoryIcon, {}) }),
9234
9777
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
9235
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.Spinner, { className: "rs-spinner--sm" }),
9778
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Spinner, { className: "rs-spinner--sm" }),
9236
9779
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
9237
9780
  ] })
9238
9781
  ] }),
9239
9782
  error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
9240
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.AlertTriangleIcon, {}) }),
9783
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.AlertTriangleIcon, {}) }),
9241
9784
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
9242
9785
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
9243
9786
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
9244
9787
  ] })
9245
9788
  ] }),
9246
9789
  !isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
9247
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.HistoryIcon, {}) }),
9790
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.HistoryIcon, {}) }),
9248
9791
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
9249
9792
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
9250
9793
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
@@ -9264,14 +9807,14 @@ function DepositHistoryPanel({
9264
9807
  )
9265
9808
  ] })
9266
9809
  ] }),
9267
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.PoweredBy, {})
9810
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
9268
9811
  ] })
9269
9812
  ]
9270
9813
  }
9271
9814
  );
9272
9815
  }
9273
9816
  function HistoryCard({ deposit }) {
9274
- const explorerTxUrl = _chunkZMT4ATHRcjs.useExplorerTxUrl.call(void 0, );
9817
+ const explorerTxUrl = _chunkHAQOFI3Dcjs.useExplorerTxUrl.call(void 0, );
9275
9818
  const [expanded, setExpanded] = _react.useState.call(void 0, false);
9276
9819
  const status = normalizeStatus(deposit.status, deposit.isSpam);
9277
9820
  const sourceChainId = resolveChainId(deposit.chain);
@@ -9301,8 +9844,8 @@ function HistoryCard({ deposit }) {
9301
9844
  children: [
9302
9845
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-row", children: [
9303
9846
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-icons", children: [
9304
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-token", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.TokenIcon, { symbol: sourceSymbol, fallback: sourceSymbol.slice(0, 2) }) }),
9305
- sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-chain", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CdnIcon, { src: sourceChainIcon }) })
9847
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-token", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TokenIcon, { symbol: sourceSymbol, fallback: sourceSymbol.slice(0, 2) }) }),
9848
+ sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-chain", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: sourceChainIcon }) })
9306
9849
  ] }),
9307
9850
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-text", children: [
9308
9851
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-title", children: txTypeLabel }),
@@ -9318,14 +9861,14 @@ function HistoryCard({ deposit }) {
9318
9861
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
9319
9862
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
9320
9863
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
9321
- sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CdnIcon, { src: sourceChainIcon }) })
9864
+ sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: sourceChainIcon }) })
9322
9865
  ] })
9323
9866
  ] }),
9324
9867
  targetChainName && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
9325
9868
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
9326
9869
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
9327
9870
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
9328
- targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CdnIcon, { src: targetChainIcon }) })
9871
+ targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: targetChainIcon }) })
9329
9872
  ] })
9330
9873
  ] }),
9331
9874
  srcTxUrl && srcTxHash && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
@@ -9340,7 +9883,7 @@ function HistoryCard({ deposit }) {
9340
9883
  onClick: (e) => e.stopPropagation(),
9341
9884
  children: [
9342
9885
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(srcTxHash) }),
9343
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.ArrowUpRightIcon, {})
9886
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ArrowUpRightIcon, {})
9344
9887
  ]
9345
9888
  }
9346
9889
  )
@@ -9354,9 +9897,11 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
9354
9897
 
9355
9898
  // src/DepositModal.tsx
9356
9899
 
9357
- var ReownDepositInner = _react.lazy.call(void 0,
9358
- () => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-YNNHLAV2.cjs"))).then((m) => ({ default: m.DepositModalReown }))
9359
- );
9900
+ var ReownDepositInner = _react.lazy.call(void 0, async () => {
9901
+ await loadReownDependencies();
9902
+ const module = await Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-GAD45GIC.cjs")));
9903
+ return { default: module.DepositModalReown };
9904
+ });
9360
9905
  function sortByCreatedAtDesc(items) {
9361
9906
  return [...items].sort((a, b) => {
9362
9907
  const at = a.createdAt ? Date.parse(a.createdAt) : 0;
@@ -9364,13 +9909,62 @@ function sortByCreatedAtDesc(items) {
9364
9909
  return bt - at;
9365
9910
  });
9366
9911
  }
9912
+ function buildDepositAnalyticsSessionProperties({
9913
+ enableWallet = true,
9914
+ enableFiatOnramp = false,
9915
+ enableQrTransfer = true,
9916
+ enableGaslessDeposit = false,
9917
+ enableExchangeConnect = false,
9918
+ fiatMethods,
9919
+ assetMigrations,
9920
+ initialAssetMigration,
9921
+ inline = false,
9922
+ closeOnOverlayClick = false,
9923
+ sourceChain,
9924
+ sourceToken,
9925
+ defaultAmount,
9926
+ walletIntegration,
9927
+ targetChain,
9928
+ targetToken
9929
+ }) {
9930
+ const configuredFiatIdentifiers = fiatMethods ? Object.entries(fiatMethods).filter(([, enabled]) => enabled === true).map(([identifier]) => identifier).sort() : null;
9931
+ const migrationProviders = Object.entries(_nullishCoalesce(assetMigrations, () => ( {}))).filter(([, enabled]) => enabled === true).map(([identifier]) => identifier).sort();
9932
+ const safeInitialMigration = initialAssetMigration && migrationProviders.includes(initialAssetMigration) ? initialAssetMigration : null;
9933
+ const enabledFundingMethods = [];
9934
+ if (enableWallet && walletIntegration !== "none") {
9935
+ enabledFundingMethods.push("wallet");
9936
+ }
9937
+ if (enableQrTransfer) enabledFundingMethods.push("transfer");
9938
+ if (enableFiatOnramp && _optionalChain([configuredFiatIdentifiers, 'optionalAccess', _339 => _339.length]) !== 0) {
9939
+ enabledFundingMethods.push("fiat_onramp");
9940
+ }
9941
+ if (enableExchangeConnect) enabledFundingMethods.push("exchange_connect");
9942
+ if (migrationProviders.length > 0) enabledFundingMethods.push("asset_migration");
9943
+ return {
9944
+ enabled_funding_methods: enabledFundingMethods,
9945
+ wallet_integration: walletIntegration,
9946
+ fiat_methods: configuredFiatIdentifiers === null ? { source: "backend_resolved" } : { source: "configured", identifiers: configuredFiatIdentifiers },
9947
+ asset_migration_providers: migrationProviders,
9948
+ initial_asset_migration: safeInitialMigration,
9949
+ gasless_wallet_flow_enabled: enableGaslessDeposit,
9950
+ presentation: inline ? "inline" : "overlay",
9951
+ overlay_close_enabled: !inline && closeOnOverlayClick,
9952
+ prefills: {
9953
+ source_chain: sourceChain !== void 0,
9954
+ source_token: sourceToken !== void 0,
9955
+ amount: defaultAmount !== void 0,
9956
+ initial_asset_migration: initialAssetMigration !== void 0
9957
+ },
9958
+ ..._chunk4J5ADVINcjs.analyticsTargetProperties.call(void 0, { targetChain, targetToken })
9959
+ };
9960
+ }
9367
9961
  var WALLET_CLIENT_PROP = "walletClient";
9368
9962
  function hasSuppliedWalletClient(props) {
9369
9963
  return Object.prototype.hasOwnProperty.call(props, WALLET_CLIENT_PROP);
9370
9964
  }
9371
9965
  function DepositModal(props) {
9372
- _chunkRAADLTSWcjs.warnRemovedProps.call(void 0, "DepositModal", props);
9373
- _chunkZMT4ATHRcjs.checkBackendUrl.call(void 0, "DepositModal", props.backendUrl);
9966
+ _chunk4J5ADVINcjs.warnRemovedProps.call(void 0, "DepositModal", props);
9967
+ _chunkHAQOFI3Dcjs.checkBackendUrl.call(void 0, "DepositModal", props.backendUrl);
9374
9968
  const needsReown = !!props.reownAppId;
9375
9969
  const hasWalletClientProp = hasSuppliedWalletClient(props);
9376
9970
  if (needsReown) {
@@ -9430,13 +10024,18 @@ function DepositModalInner({
9430
10024
  onLifecycle,
9431
10025
  onEvent,
9432
10026
  onError,
10027
+ enableAnalyticsIngest,
10028
+ analyticsIngestUrl,
9433
10029
  onUiState,
9434
10030
  openExternally,
10031
+ walletIntegration: walletIntegrationProp,
9435
10032
  debug
9436
10033
  }) {
9437
10034
  const modalRef = _react.useRef.call(void 0, null);
9438
- const onReadyRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onReady);
9439
- const onUiStateRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onUiState);
10035
+ const analyticsControllerRef = _react.useRef.call(void 0, null);
10036
+ const previousOpenRef = _react.useRef.call(void 0, isOpen);
10037
+ const onReadyRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onReady);
10038
+ const onUiStateRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onUiState);
9440
10039
  const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
9441
10040
  const [swappedImmersive, setSwappedImmersive] = _react.useState.call(void 0, false);
9442
10041
  const [submitting, setSubmitting] = _react.useState.call(void 0, false);
@@ -9455,9 +10054,9 @@ function DepositModalInner({
9455
10054
  const historyLoadedRef = _react.useRef.call(void 0, false);
9456
10055
  const targetChain = targetChainProp === "solana" || targetChainProp === _chunk4KCSH4T3cjs.HYPERCORE_SPOT_CAIP2 ? targetChainProp : _chunk4KCSH4T3cjs.getChainId.call(void 0, targetChainProp);
9457
10056
  const sourceChain = sourceChainProp ? _chunk4KCSH4T3cjs.getChainId.call(void 0, sourceChainProp) : void 0;
9458
- const rpcUrls = _chunkZMT4ATHRcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
10057
+ const rpcUrls = _chunkHAQOFI3Dcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
9459
10058
  const service = _react.useMemo.call(void 0,
9460
- () => _chunkZMT4ATHRcjs.createDepositService.call(void 0, backendUrl, {
10059
+ () => _chunkHAQOFI3Dcjs.createDepositService.call(void 0, backendUrl, {
9461
10060
  debug,
9462
10061
  debugScope: "service:deposit"
9463
10062
  }),
@@ -9491,15 +10090,15 @@ function DepositModalInner({
9491
10090
  }, [store, targetChain, targetToken]);
9492
10091
  _react.useEffect.call(void 0, () => {
9493
10092
  if (!isOpen || !modalRef.current) return;
9494
- return _chunkZMT4ATHRcjs.applyTheme.call(void 0, modalRef.current, theme);
10093
+ return _chunkHAQOFI3Dcjs.applyTheme.call(void 0, modalRef.current, theme);
9495
10094
  }, [isOpen, theme]);
9496
10095
  _react.useEffect.call(void 0, () => {
9497
10096
  if (isOpen) {
9498
- _optionalChain([onReadyRef, 'access', _329 => _329.current, 'optionalCall', _330 => _330()]);
10097
+ _optionalChain([onReadyRef, 'access', _340 => _340.current, 'optionalCall', _341 => _341()]);
9499
10098
  }
9500
10099
  }, [isOpen, onReadyRef]);
9501
10100
  _react.useEffect.call(void 0, () => {
9502
- _optionalChain([onUiStateRef, 'access', _331 => _331.current, 'optionalCall', _332 => _332({
10101
+ _optionalChain([onUiStateRef, 'access', _342 => _342.current, 'optionalCall', _343 => _343({
9503
10102
  screen: currentScreen,
9504
10103
  back: backHandler,
9505
10104
  submitting
@@ -9578,10 +10177,10 @@ function DepositModalInner({
9578
10177
  fetchHistory("initial");
9579
10178
  }
9580
10179
  }, [historyOpen, fetchHistory]);
9581
- const onLifecycleRef = _chunkZMT4ATHRcjs.useLatestRef.call(void 0, onLifecycle);
10180
+ const onLifecycleRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onLifecycle);
9582
10181
  const handleLifecycle = _react.useCallback.call(void 0,
9583
10182
  (event) => {
9584
- _optionalChain([onLifecycleRef, 'access', _333 => _333.current, 'optionalCall', _334 => _334(event)]);
10183
+ _optionalChain([onLifecycleRef, 'access', _344 => _344.current, 'optionalCall', _345 => _345(event)]);
9585
10184
  if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
9586
10185
  historyStaleRef.current = true;
9587
10186
  }
@@ -9591,6 +10190,31 @@ function DepositModalInner({
9591
10190
  },
9592
10191
  [onLifecycleRef, markHistoryStale]
9593
10192
  );
10193
+ const closeWithSource = _react.useCallback.call(void 0,
10194
+ (source) => {
10195
+ const analytics = analyticsControllerRef.current;
10196
+ _optionalChain([analytics, 'optionalAccess', _346 => _346.abandon, 'call', _347 => _347(source === "provider_back" ? "provider_back" : "modal_close")]);
10197
+ _optionalChain([analytics, 'optionalAccess', _348 => _348.close, 'call', _349 => _349(source)]);
10198
+ onClose();
10199
+ },
10200
+ [onClose]
10201
+ );
10202
+ const handleModalDismiss = _react.useCallback.call(void 0,
10203
+ (reason) => {
10204
+ closeWithSource(
10205
+ reason === "escape" ? "escape" : reason === "overlay" ? "overlay" : "header_button"
10206
+ );
10207
+ },
10208
+ [closeWithSource]
10209
+ );
10210
+ _react.useEffect.call(void 0, () => {
10211
+ if (previousOpenRef.current && !isOpen) {
10212
+ const analytics = analyticsControllerRef.current;
10213
+ _optionalChain([analytics, 'optionalAccess', _350 => _350.abandon, 'call', _351 => _351("modal_close")]);
10214
+ _optionalChain([analytics, 'optionalAccess', _352 => _352.close, 'call', _353 => _353("host_controlled")]);
10215
+ }
10216
+ previousOpenRef.current = isOpen;
10217
+ }, [isOpen]);
9594
10218
  _react.useEffect.call(void 0, () => {
9595
10219
  if (!isOpen) {
9596
10220
  setHistoryOpen(false);
@@ -9611,111 +10235,147 @@ function DepositModalInner({
9611
10235
  store.dispatch({ type: "flow/reset" });
9612
10236
  }
9613
10237
  }, [isOpen, store]);
9614
- const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _335 => _335.showBackButton]), () => ( true));
10238
+ const walletIntegration = _nullishCoalesce(walletIntegrationProp, () => ( (hasWalletClientProp || walletSession || onRequestConnect ? "host_supplied" : "none")));
10239
+ const analyticsSessionProperties = buildDepositAnalyticsSessionProperties({
10240
+ enableWallet,
10241
+ enableFiatOnramp,
10242
+ enableQrTransfer,
10243
+ enableGaslessDeposit,
10244
+ enableExchangeConnect,
10245
+ fiatMethods,
10246
+ assetMigrations,
10247
+ initialAssetMigration,
10248
+ inline,
10249
+ closeOnOverlayClick,
10250
+ sourceChain: sourceChainProp,
10251
+ sourceToken,
10252
+ defaultAmount,
10253
+ walletIntegration,
10254
+ targetChain,
10255
+ targetToken
10256
+ });
10257
+ const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _354 => _354.showBackButton]), () => ( true));
9615
10258
  const canGoBack = backHandler !== void 0;
9616
10259
  const hideHeaderChrome = swappedImmersive;
9617
10260
  const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
9618
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
9619
- _chunkZMT4ATHRcjs.Modal,
10261
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
10262
+ _chunkHAQOFI3Dcjs.Modal,
9620
10263
  {
9621
10264
  isOpen,
9622
- onClose,
10265
+ onClose: handleModalDismiss,
9623
10266
  className,
9624
10267
  inline,
9625
10268
  closeOnOverlayClick,
9626
- children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { ref: modalRef, className: modalClassName, children: [
9627
- !hideHeaderChrome && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header--redesigned", children: [
9628
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && backHandler && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
9629
- "button",
10269
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
10270
+ _chunkHAQOFI3Dcjs.AnalyticsSession,
10271
+ {
10272
+ modal: "deposit",
10273
+ sessionProperties: analyticsSessionProperties,
10274
+ onEvent,
10275
+ backendUrl,
10276
+ enableIngest: enableAnalyticsIngest,
10277
+ ingestUrl: analyticsIngestUrl,
10278
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
10279
+ DepositAnalyticsControllerProvider,
9630
10280
  {
9631
- type: "button",
9632
- className: "rs-modal-header-back",
9633
- "aria-label": "Go back",
9634
- onClick: backHandler,
9635
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.ChevronLeftIcon, {})
10281
+ controllerRef: analyticsControllerRef,
10282
+ children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { ref: modalRef, className: modalClassName, children: [
10283
+ !hideHeaderChrome && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header--redesigned", children: [
10284
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && backHandler && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
10285
+ "button",
10286
+ {
10287
+ type: "button",
10288
+ className: "rs-modal-header-back",
10289
+ "aria-label": "Go back",
10290
+ onClick: backHandler,
10291
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChevronLeftIcon, {})
10292
+ }
10293
+ ) }),
10294
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
10295
+ historyButtonVisible && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
10296
+ "button",
10297
+ {
10298
+ type: "button",
10299
+ className: "rs-modal-header-history",
10300
+ "aria-label": "Deposit history",
10301
+ onClick: handleHistoryOpen,
10302
+ disabled: !recipient,
10303
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.HistoryIcon, {})
10304
+ }
10305
+ ),
10306
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
10307
+ "button",
10308
+ {
10309
+ type: "button",
10310
+ onClick: () => closeWithSource("header_button"),
10311
+ className: "rs-modal-close",
10312
+ "aria-label": "Close",
10313
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CloseIcon, {})
10314
+ }
10315
+ )
10316
+ ] })
10317
+ ] }),
10318
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
10319
+ DepositFlow,
10320
+ {
10321
+ walletClientProp,
10322
+ publicClientProp,
10323
+ hasWalletClientProp,
10324
+ targetChain,
10325
+ targetToken,
10326
+ service,
10327
+ sourceChain,
10328
+ sourceToken,
10329
+ amount: defaultAmount,
10330
+ recipient,
10331
+ appBalanceUsd,
10332
+ outputTokenRules,
10333
+ rejectUnmapped,
10334
+ forceRegister,
10335
+ assetMigrations,
10336
+ initialAssetMigration,
10337
+ enableFiatOnramp,
10338
+ enableQrTransfer,
10339
+ enableGaslessDeposit,
10340
+ fiatMethods,
10341
+ enableWallet,
10342
+ enableExchangeConnect,
10343
+ walletSession,
10344
+ walletIntegration,
10345
+ onConnect,
10346
+ onDisconnect,
10347
+ onRequestConnect,
10348
+ uiConfig,
10349
+ appFees: _optionalChain([clientSetup, 'optionalAccess', _355 => _355.appFees]),
10350
+ appFeesResolved: clientSetup !== null,
10351
+ onStepChange: handleStepChange,
10352
+ onSwappedImmersiveChange: setSwappedImmersive,
10353
+ openExternally,
10354
+ onSubmittingChange: setSubmitting,
10355
+ onClose: (source) => closeWithSource(_nullishCoalesce(source, () => ( "header_button"))),
10356
+ onLifecycle: handleLifecycle,
10357
+ onError,
10358
+ debug
10359
+ }
10360
+ ),
10361
+ historyOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
10362
+ DepositHistoryPanel,
10363
+ {
10364
+ deposits: historyDeposits,
10365
+ isLoading: historyLoading,
10366
+ error: historyError,
10367
+ hasMore: hasMoreHistory,
10368
+ isLoadingMore: historyLoadingMore,
10369
+ onLoadMore: handleHistoryLoadMore,
10370
+ onClose: handleHistoryClose,
10371
+ onCloseModal: () => closeWithSource("header_button")
10372
+ }
10373
+ )
10374
+ ] })
9636
10375
  }
9637
- ) }),
9638
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
9639
- historyButtonVisible && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
9640
- "button",
9641
- {
9642
- type: "button",
9643
- className: "rs-modal-header-history",
9644
- "aria-label": "Deposit history",
9645
- onClick: handleHistoryOpen,
9646
- disabled: !recipient,
9647
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.HistoryIcon, {})
9648
- }
9649
- ),
9650
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
9651
- "button",
9652
- {
9653
- type: "button",
9654
- onClick: onClose,
9655
- className: "rs-modal-close",
9656
- "aria-label": "Close",
9657
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CloseIcon, {})
9658
- }
9659
- )
9660
- ] })
9661
- ] }),
9662
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
9663
- DepositFlow,
9664
- {
9665
- walletClientProp,
9666
- publicClientProp,
9667
- hasWalletClientProp,
9668
- targetChain,
9669
- targetToken,
9670
- service,
9671
- sourceChain,
9672
- sourceToken,
9673
- amount: defaultAmount,
9674
- recipient,
9675
- appBalanceUsd,
9676
- outputTokenRules,
9677
- rejectUnmapped,
9678
- forceRegister,
9679
- assetMigrations,
9680
- initialAssetMigration,
9681
- enableFiatOnramp,
9682
- enableQrTransfer,
9683
- enableGaslessDeposit,
9684
- fiatMethods,
9685
- enableWallet,
9686
- enableExchangeConnect,
9687
- walletSession,
9688
- onConnect,
9689
- onDisconnect,
9690
- onRequestConnect,
9691
- uiConfig,
9692
- appFees: _optionalChain([clientSetup, 'optionalAccess', _336 => _336.appFees]),
9693
- appFeesResolved: clientSetup !== null,
9694
- onStepChange: handleStepChange,
9695
- onSwappedImmersiveChange: setSwappedImmersive,
9696
- openExternally,
9697
- onSubmittingChange: setSubmitting,
9698
- onClose,
9699
- onLifecycle: handleLifecycle,
9700
- onEvent,
9701
- onError,
9702
- debug
9703
- }
9704
- ),
9705
- historyOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
9706
- DepositHistoryPanel,
9707
- {
9708
- deposits: historyDeposits,
9709
- isLoading: historyLoading,
9710
- error: historyError,
9711
- hasMore: hasMoreHistory,
9712
- isLoadingMore: historyLoadingMore,
9713
- onLoadMore: handleHistoryLoadMore,
9714
- onClose: handleHistoryClose,
9715
- onCloseModal: onClose
9716
- }
9717
- )
9718
- ] })
10376
+ )
10377
+ }
10378
+ )
9719
10379
  }
9720
10380
  ) }) }) });
9721
10381
  }
@@ -9723,4 +10383,5 @@ function DepositModalInner({
9723
10383
 
9724
10384
 
9725
10385
 
9726
- exports.DepositModal = DepositModal; exports.DepositModalInner = DepositModalInner;
10386
+
10387
+ exports.getReownDependencies = getReownDependencies; exports.DepositModal = DepositModal; exports.DepositModalInner = DepositModalInner;